import { r as registerInstance, h, a as getElement } from './index-DtIEDtZ8.js';
import { d as detectFramework, t as trackComponent } from './framework-detection-DcmcuUOA.js';
import { i as isNestedInIfxComponent } from './dom-utils-Bw2fh5LT.js';

const breadcrumbCss = ":root{--ifx-font-family:\"Source Sans 3\", 'Arial, sans-serif'}: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);
    }
    async componentDidLoad() {
        if (!isNestedInIfxComponent(this.el)) {
            const framework = detectFramework();
            trackComponent('ifx-breadcrumb', await framework);
        }
        const element = this.el.shadowRoot.firstChild;
        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: 'edf76204e96413a39d1a543735bbb0a2530d8348', "aria-label": "Page navigation breadcrumb" }, h("ol", { key: '1b64075586076eb4f6ca73cf41202a52a180d1c3', class: "breadcrumb" }, h("slot", { key: '352a0be161eb7b0ab45bdbbb59d023bd9da6ff73' }))));
    }
    get el() { return getElement(this); }
};
Breadcrumb.style = breadcrumbCss;

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

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