'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const dgaHeaderActionBtn = require('./dga-header-action-btn-5c41bd3a.js');
const index = require('./index-a0b63bee.js');

const DgaNavHeaderSubMenu = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.active = false;
        this.subMenuFullWidth = false;
    }
    onActiveChange() {
        if (this.active && this.submenu) {
            this.submenu.style.display = 'block';
            this.submenu.style.maxHeight = `${this.submenu.scrollHeight}px`;
        }
        else if (this.submenu) {
            this.submenu.style.maxHeight = '';
        }
    }
    componentDidLoad() {
        this.submenu = this.el.shadowRoot.querySelector('.header__sub-menu');
        this.onActiveChange(); // Ensure styles are set on initial load
    }
    render() {
        const backgroundClass = this.background === 'Brand' ? 'header__sub-menu--bg-brand' : '';
        const fullWidthClass = this.subMenuFullWidth ? 'header__sub-menu--full' : '';
        return (index.h("div", { key: '60795e354d8aca73dbadda2e1abb81731662d046', class: `header__sub-menu ${backgroundClass} ${fullWidthClass}`, ref: el => (this.submenu = el) }, index.h("div", { key: 'e26408241071d544add36fb1769893e9964ebbd5', class: "sub-menu__container" }, index.h("slot", { key: '59998beb0e160440d9c7c788b826dba6ee98712b' }))));
    }
    get el() { return index.getElement(this); }
    static get watchers() { return {
        "active": ["onActiveChange"]
    }; }
};

const DgaSecondNavHeader = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.variant = 'primary';
    }
    componentWillLoad() {
        this.el.childNodes.forEach((item) => {
            const el = item;
            if (el.tagName === 'DGA-SECOND-NAV-HEADER-CONTENT' && this.hideContent === true) {
                el.style.display = 'none';
            }
            if (el.tagName === 'DGA-SECOND-NAV-HEADER-ACTIONS' && this.hideActions === true) {
                el.style.display = 'none';
            }
            if (el.tagName === 'DGA-SECOND-NAV-HEADER-CONTENT' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'content');
            }
            if (el.tagName === 'DGA-SECOND-NAV-HEADER-ACTIONS' && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'actions');
            }
        });
    }
    render() {
        return (index.h(index.Host, { key: '7b4337019906155b588661d26fdd266133fc3dd3' }, index.h("div", { key: '030d1b0d16e57f33bd2acead40d79ada06c62eba', class: `wrapper ${this.variant} `, "aria-label": 'a secondary navigation navbar' }, index.h("div", { key: '845cbc1af765c49d9c0cd186b3320b44996ddcf9', class: `container ${this.hideDivider ? '' : 'border'}` }, index.h("div", { key: 'a15f8a49420573d4b24b1dfd7996be03bf29fbf5', class: `content` }, index.h("slot", { key: '4dbf4b68e5770b1b45d5ada842c6028e3940c0f7', name: "content" })), index.h("div", { key: '1f2648a0395229235809606ef03ac7e8ecb9ee63', class: `actions` }, index.h("slot", { key: 'be8df10b159b7e536db796d61ab25f0c1f7203c6', name: "actions" }))))));
    }
    get el() { return index.getElement(this); }
};

const DgaSecondNavHeaderActions = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    render() {
        return (index.h(index.Host, { key: '573f01829709de8e8bb5ab134445c13f9958ee22' }, index.h("div", { key: '3be4cd1e638b0786ecbd49baaf7dc1223cc236de', class: `items-container` }, index.h("slot", { key: '50c985bdb80a92cdc542bd296be3a5bbc00b9db2' }))));
    }
};

const DgaSecondNavHeaderContent = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    render() {
        return (index.h(index.Host, { key: 'eea53f3f4cacd826343df1c500235fc3876587f9' }, index.h("div", { key: '0d016bb7c6afb92c03fd665c6e46c54d12eac988', class: `items-container` }, index.h("slot", { key: '97755366fd00f0545d15157357238e41fa614a74' }))));
    }
};

const DgaSecondNavHeaderItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    connectedCallback() {
        this.el.childNodes.forEach((item) => {
            const el = item;
            if (el.tagName === 'DGA-ICON'.toLocaleUpperCase() && el.attributes.getNamedItem('slot') === null) {
                el.setAttribute('slot', 'icon');
            }
        });
    }
    render() {
        return (index.h(index.Host, { key: '4d2ca1cf5c638f5647d9f80f47aa505455434576' }, index.h("slot", { key: '9aaf12cbe019b34b41e8cbed03b508b1c0d01a28', name: 'icon' }), index.h("slot", { key: 'adccc572b834f22150efdae46405800b5f5b588a', name: 'label' }, this.label)));
    }
    get el() { return index.getElement(this); }
};

exports.dga_header_action_btn = dgaHeaderActionBtn.DgaHeaderActionBtn;
exports.dga_nav_header = dgaHeaderActionBtn.DgaNavHeader;
exports.dga_nav_header_actions = dgaHeaderActionBtn.DgaNavHeaderActions;
exports.dga_nav_header_link = dgaHeaderActionBtn.DgaNavHeaderLink;
exports.dga_nav_header_logos = dgaHeaderActionBtn.DgaNavHeaderLogos;
exports.dga_nav_header_main = dgaHeaderActionBtn.DgaNavHeaderMain;
exports.dga_nav_header_menu = dgaHeaderActionBtn.DgaNavHeaderMenu;
exports.dga_nav_header_sub_menu = DgaNavHeaderSubMenu;
exports.dga_second_nav_header = DgaSecondNavHeader;
exports.dga_second_nav_header_actions = DgaSecondNavHeaderActions;
exports.dga_second_nav_header_content = DgaSecondNavHeaderContent;
exports.dga_second_nav_header_item = DgaSecondNavHeaderItem;

//# sourceMappingURL=dga-header-action-btn_12.cjs.entry.js.map