import { r as registerInstance, a as getElement, h } from './index-Cby2wKoI.js';
import { i as isNestedInIfxComponent } from './dom-utils-CtINY9El.js';
import { d as detectFramework, t as trackComponent } from './tracking-DNHOWgWh.js';

const breadcrumbCss = () => `:host{display:flex}.breadcrumb{list-style:none;padding:0px;margin:0px;display:flex;flex-direction:row;font-family:var(--ifx-font-family);font-size:0.875rem;align-items:flex-start}`;

const Breadcrumb = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
    }
    get el() { return getElement(this); }
    async componentDidLoad() {
        if (!isNestedInIfxComponent(this.el)) {
            const framework = detectFramework();
            trackComponent("ifx-breadcrumb", await framework);
        }
        const element = this.el.shadowRoot?.firstElementChild;
        if (element instanceof HTMLElement) {
            this.validateBreadcrumbItemStructure(element);
        }
    }
    validateBreadcrumbItemStructure(element) {
        if (!element) {
            console.error("element not found");
            return;
        }
        const slot = element.querySelector("slot");
        if (slot) {
            const assignedNodes = slot.assignedNodes();
            for (let i = 0; i < assignedNodes.length; i++) {
                const node = assignedNodes[i];
                if (node.nodeName === "IFX-BREADCRUMB-ITEM") {
                    const breadcrumbItem = node;
                    const breadcrumbItemLabel = breadcrumbItem.querySelector("ifx-breadcrumb-item-label");
                    const breadcrumbDropdown = breadcrumbItem.querySelector("ifx-dropdown-menu");
                    if (breadcrumbItemLabel.hasAttribute("href") && breadcrumbDropdown) {
                        throw new Error("ifx-breadcrumb-item cannot have both a href and a dropdown menu.");
                    }
                }
            }
        }
    }
    render() {
        return (h("nav", { key: 'f9e3ab03f477edc2f42857d773c924845c1f1d2e', "aria-label": "Page navigation breadcrumb" }, h("ol", { key: 'c56109519419ef1e697065e611d6047c6f4285e3', class: "breadcrumb" }, h("slot", { key: '224406744edd734167bca7882e9da6381ee37bac' }))));
    }
};
Breadcrumb.style = breadcrumbCss();

export { Breadcrumb as ifx_breadcrumb };
//# sourceMappingURL=ifx-breadcrumb.entry.js.map

//# sourceMappingURL=ifx-breadcrumb.entry.js.map