import { h, Host } from "@stencil/core";
export class EclMegaMenuSubitem {
    constructor() {
        this.oneLevelOnly = false;
        this.external = false;
        this.seeAll = false;
        this.hasFeatured = false;
        this.hasChildren = false;
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    getClass() {
        const styleClasses = [
            `ecl-mega-menu__subitem`,
            `sc-ecl-mega-menu-${this.theme}`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    render() {
        return (h(Host, { key: '6322d9a7d4fbee7cb4b055b12d0bbdfedd43d45f', class: this.getClass(), "data-ecl-mega-menu-subitem": true }, this.hasChildren ?
            h("ecl-button", { type: "button", "style-class": `ecl-mega-menu__sublink sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-sublink": true, "aria-expanded": "false", "aria-haspopup": true }, this.label, h("ecl-icon", { "style-class": `sc-ecl-mega-menu-${this.theme} is-first`, icon: "corner-arrow", size: "2xs", rotate: "90", slot: "icon-after" }), h("ecl-icon", { "style-class": `sc-ecl-mega-menu-${this.theme}`, icon: "arrow-left", flip: "horizontal", size: "s", slot: "icon-after" })) :
            h("ecl-link", { variant: "standalone", "data-ecl-mega-menu-link": true, path: this.path, "style-class": `ecl-mega-menu__sublink sc-ecl-mega-menu-${this.theme}` }, this.label), this.hasChildren &&
            h("div", { key: '7a737ce92d2ab0303ba28190ca50aea570db8921', class: `ecl-mega-menu__mega ecl-mega-menu__mega--level-2 sc-ecl-mega-menu-${this.theme} ${!this.hasChildren ? 'ecl-mega-menu-featured-only' : ''}`, "data-ecl-mega-menu-mega": true }, h("ul", Object.assign({ key: 'cfb07c00423a62ca86ba9f8e1844af8ce8accdf1', class: `ecl-mega-menu__sublist sc-ecl-mega-menu-${this.theme}` }, (this.ariaLabel && { 'aria-label': this.ariaLabel })), h("slot", { key: '57484eb65b43d99d0684e562a1e1f9600362164a' }), h("li", { key: 'bf68600c0f398d58400b757b2ba227ac27c0682f', class: `ecl-mega-menu__spacer sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-subitem": true }, "\u00A0"), this.seeAll && (h("li", { key: 'c530d682db8502e39331e843b08945c3b72bf7da', class: `ecl-mega-menu__subitem ecl-mega-menu__see-all sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-subitem": true }, h("ecl-link", { key: 'b5d6fffc1d53c3376c71a03464dbd62b4d6b0a31', "style-class": `sc-ecl-mega-menu-${this.theme}`, variant: "standalone", path: this.path }, this.seeAllLabel, h("ecl-icon", { key: '98b843c93a7407290252d755f4633035f2e07db7', "style-class": `sc-ecl-mega-menu-${this.theme}`, icon: "arrow-left", size: "xs", rotate: "180", slot: "icon-after" }))))), this.hasFeatured &&
                h("div", { key: '81f11466593594047bf6e3233ef6e06c1131d388', class: `ecl-mega-menu__featured sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-featured": true }, h("div", { key: 'ff885a49281c6786648bbafd072874a4857f1dc5', class: `ecl-mega-menu__featured-scrollable sc-ecl-mega-menu-${this.theme}` }, this.featuredTitle &&
                    h("div", { key: 'e7281b9c57e665ea969865b2b151059fbcba9b89', class: `ecl-mega-menu__featured-title sc-ecl-mega-menu-${this.theme}` }, this.featuredTitle), h("ul", { key: '5b702650b20d2bd47b60f2fee46bda249f5dba98', class: `ecl-mega-menu__featured-list sc-ecl-mega-menu-${this.theme}` }, h("slot", { key: '05b9d322719f0528c87f25178a702d318260946e', name: "featured-second" })))))));
    }
    static get is() { return "ecl-mega-menu-subitem"; }
    static get properties() {
        return {
            "theme": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme"
            },
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "style-class"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "path": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "path"
            },
            "oneLevelOnly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "one-level-only",
                "defaultValue": "false"
            },
            "external": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "external",
                "defaultValue": "false"
            },
            "seeAll": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "see-all",
                "defaultValue": "false"
            },
            "hasFeatured": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-featured",
                "defaultValue": "false"
            },
            "featuredTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "featured-title"
            },
            "hasChildren": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-children",
                "defaultValue": "false"
            },
            "seeAllLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "see-all-label"
            },
            "ariaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "aria-label"
            }
        };
    }
}
