import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-4d3658f6.js';
import { r as readSubLevels } from './level.utils-e25dee61.js';
import { a as inheritTrackingAttributes } from './attributes-f95bca13.js';

const NavigationLevelMeta = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.balClick = createEvent(this, "balClick", 7);
        this.inheritAttributes = {};
        this.label = '';
        this.value = `meta-value-${navigationLevelMetaIds++}`;
        this.link = undefined;
        this.linkLabel = undefined;
        this.isTabLink = undefined;
    }
    componentWillLoad() {
        this.inheritAttributes = inheritTrackingAttributes(this.el);
    }
    async getLevelInfo() {
        const subLevels = await readSubLevels(this.el, 'bal-navigation-level-main');
        return {
            type: 'meta',
            value: this.value,
            label: this.label,
            link: this.link,
            linkLabel: this.linkLabel,
            isTabLink: this.isTabLink,
            subLevels,
            trackingData: this.inheritAttributes,
            onClick: (ev) => this.balClick.emit(ev),
        };
    }
    render() {
        return (h(Host, null, h("slot", null)));
    }
    get el() { return getElement(this); }
};
let navigationLevelMetaIds = 0;

export { NavigationLevelMeta as bal_navigation_level_meta };
