import { h } from "@stencil/core";
import getAssetPath from "../../utils/assetPath";
export class EclSplashPage {
    constructor() {
        this.styleClass = '';
    }
    getClass() {
        const classes = [
            `ecl-splash-page`,
            this.styleClass
        ];
        return classes.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidLoad() {
        const items = this.el.querySelectorAll('[slot="eu-category"]');
        const container = this.el.querySelector('.ecl-splash-page__language-container');
        if (items.length === 1) {
            container.classList.add('ecl-splash-page__language-single-item-category');
        }
        if (items.length === 2) {
            container.classList.add('ecl-splash-page__language-single-item-category');
        }
        if (items.length === 4) {
            container.classList.add('ecl-splash-page__language-four-item-category');
        }
    }
    render() {
        const logoPath = this.logo
            ? this.logo
            : this.theme === 'ec'
                ? getAssetPath(`./build/images/${this.theme}/logos/logo-${this.theme}--mute.svg`)
                : getAssetPath(`./build/images/${this.theme}/logos/condensed-version/positive/logo-${this.theme}--${this.langCode}.svg`);
        return (h("div", { key: '9cf314a5bf904b63a9e5df95f2ea3f62b3e38c79', class: this.getClass() }, h("div", { key: 'b05272b4f6328f1b57e783cf6cb0b9c269a804aa', class: "ecl-splash-page__logo-container" }, h("ecl-grid", { key: '6988ce391e88f0fc5dee7c7820f82d4e35e32a45', container: true, styleClass: `sc-ecl-splash-page-${this.theme}` }, h("ecl-link", { key: '1dc496ab68b107ffad63681ddbec69e576ece924', styleClass: `ecl-splash-page__logo-link sc-ecl-splash-page-${this.theme}`, path: this.logoLink, variant: "standalone" }, h("ecl-picture", { key: '7586fb17975284a1c36ff50c3767d292fa84a4d8', styleClass: `ecl-splash-page__picture sc-ecl-picture-${this.theme}`, imageAlt: this.logoAlt, imgClass: `ecl-splash-page__logo-image sc-ecl-splash-page-${this.theme}`, image: logoPath }, !this.logo && (this.theme === 'eu' ? (h("source", { srcSet: getAssetPath(`./build/images/${this.theme}/logos/standard-version/positive/logo-${this.theme}--${this.langCode}.svg`), media: "(min-width: 996px)" })) : this.theme === 'ec' ? (h("source", { srcSet: getAssetPath(`./build/images/${this.theme}/logos/positive/logo-${this.theme}--${this.langCode}.svg`), media: "(min-width: 415px)" })) : null), h("slot", { key: 'e50adddf95829d483f0b68ed9464eb2c3ea515c5', name: "logoSources" }))))), h("ecl-grid", { key: 'b7ca7564951915b975f79ef38826cb55768a7ab2', container: true, styleClass: `sc-ecl-splash-page-${this.theme} ecl-splash-page__language-container` }, this.elTitle &&
            h("h1", { key: '5ea3721b8b8f31433e0c2424d157a3473ffc9671', class: "ecl-splash-page__language-title" }, this.elTitle), h("div", { key: 'b45d6f52f344d2a58a5eba66bc4fe23e9a3e5912', class: "ecl-splash-page__language-content" }, h("div", { key: '1b8e52b1c825c6925836c0f281917c3f0705f8f8', class: "ecl-splash-page__language-category" }, this.euLabel &&
            h("h2", { key: '2376030ed983ad043839b85c5def5ac0ea0ea2f5', class: "ecl-splash-page__language-category-title" }, this.euLabel), h("ul", { key: '2e9e2c2970c1d4869ece5232baa9bd89dd4013ae', class: "ecl-splash-page__language-list" }, h("slot", { key: 'a4ac938a9e4f72255df4a8e14311a6d171898548', name: "eu-category" }))), h("div", { key: '9a0a836610292a4f3432290a824a374aa9c37c7c', class: "ecl-splash-page__language-category" }, this.nonEuLabel &&
            h("h2", { key: '1859eba49fbbe70f5a5a6df452507229f8f55524', class: "ecl-splash-page__language-category-title" }, this.nonEuLabel), h("ul", { key: 'f29e4b8dc1b693a95445628a39a1847111afca46', class: "ecl-splash-page__language-list" }, h("slot", { key: '936d0b7e2bbd124477ab33d3cfc59b598f15a91d', name: "non-eu-category" })))))));
    }
    static get is() { return "ecl-splash-page"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-splash-page-ec.css"],
            "eu": ["./build/styles/ecl-splash-page-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-splash-page-ec.css"],
            "eu": ["build/styles/ecl-splash-page-eu.css"]
        };
    }
    static get properties() {
        return {
            "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",
                "defaultValue": "''"
            },
            "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"
            },
            "elTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "el-title"
            },
            "language": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "language"
            },
            "langCode": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "lang-code"
            },
            "logo": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "logo"
            },
            "logoLink": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "logo-link"
            },
            "logoAlt": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "logo-alt"
            },
            "euLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "eu-label"
            },
            "nonEuLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "non-eu-label"
            }
        };
    }
    static get elementRef() { return "el"; }
}
