import { p as proxyCustomElement, H, h, F as Fragment } from './p-604af0ee.js';
import { d as defineCustomElement$4 } from './p-115ed7c3.js';
import { d as defineCustomElement$3 } from './p-42103fc2.js';
import { d as defineCustomElement$2 } from './p-9efe8fae.js';
import { d as defineCustomElement$1 } from './p-66861708.js';

const TabComponent = /*@__PURE__*/ proxyCustomElement(class TabComponent extends H {
    constructor() {
        super();
        this.__registerHost();
        this.isExpanded = false;
    }
    handleExpanded(expanded) {
        this.isExpanded = expanded;
        if (expanded) {
            this.submenuElement.style.maxHeight = 'fit-content';
        }
        else {
            this.submenuElement.style.maxHeight = '';
        }
    }
    render() {
        return (h(Fragment, { key: '77fe597a248f75f8061885c00fb811a9c8b033b5' }, h("tab-link", { key: '9301b3ac308c952c6d59df062b436935a51020e8', text: this.route.name, type: this.route.children && this.route.children.length > 0 ? 'parent' : 'child', icon: this.route.icon, link: this.route.path, onExpand: this.handleExpanded.bind(this), disabled: this.route.disabled }), this.route.children && this.route.children.length > 0 && (h("ul", { key: 'd52c304557fe9c84d24319c389b31c27910e1d17', class: "sidepanel__submenu-list", ref: el => (this.submenuElement = el) }, this.route.children.map((childRoute, index) => (h("submenu-component", { key: index, route: this.route, childRoute: childRoute, onChildExpanded: expanded => {
                if (expanded) {
                    this.submenuElement.style.maxHeight = 'fit-content';
                }
            } })))))));
    }
}, [0, "tab-component", {
        "route": [16],
        "isExpanded": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["tab-component", "dga-icon-v2", "dga-tag", "submenu-component", "tab-link"];
    components.forEach(tagName => { switch (tagName) {
        case "tab-component":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, TabComponent);
            }
            break;
        case "dga-icon-v2":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "dga-tag":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "submenu-component":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
        case "tab-link":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { TabComponent as T, defineCustomElement as d };

//# sourceMappingURL=p-1702d2da.js.map