import { h } from "@stencil/core";
import getAssetPath from "../../utils/assetPath";
export class EclFooterEu {
    constructor() {
        this.styleClass = '';
    }
    getClass() {
        const styleClasses = [
            `ecl-site-footer`,
            `ecl-site-footer--${this.variant}`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'eu');
    }
    componentDidLoad() {
        const lists = this.el.querySelectorAll('.ecl-site-footer__list');
        const titles = this.el.querySelectorAll('ecl-text[tag="div"]');
        if (titles && titles[0]) {
            titles.forEach((title) => {
                const section = title.parentElement.parentElement;
                title.firstElementChild.classList.add(`sc-ecl-footer-${this.theme}-${this.theme}`);
                section.insertBefore(title.firstElementChild, section.firstElementChild);
            });
        }
        if (lists) {
            lists.forEach((list) => {
                const items = list.querySelectorAll('.ecl-site-footer__list-item');
                if (items) {
                    list.innerHTML = '';
                    list.append(...items);
                }
            });
        }
    }
    render() {
        const logoPath = getAssetPath(`./build/images/${this.theme}/logos/standard-version/positive/logo-${this.theme}--${this.logoLangCode}.svg`);
        const coOwnerLinks = this.coOwnerLinks ? JSON.parse(this.coOwnerLinks) : '';
        return (h("footer", { key: '058a4e9330d12e2c54499f0ca4efbb3ddb0c2b8c', class: this.getClass() }, (this.coOwnerTitle || this.coOwnerLinks) &&
            h("div", { key: '272f7eee991a8d4c3e25ceaac0785a5af63a0f4a', class: "ecl-site-footer__co-owner" }, h("div", { key: '3b36208e0f74d1059f8a507c591e592f53cbd998', class: "ecl-container ecl-site-footer__co-owner-container" }, this.coOwnerTitle &&
                h("div", { key: 'e5a427dc7bae1f3232bbf13674a18afcc605ba2b', class: "ecl-site-footer__co-owner-title" }, this.coOwnerTitle), coOwnerLinks &&
                h("ul", { key: '217ee8bdb47df3c6a2cdc2e24ed44f704e7c23e4', class: "ecl-site-footer__co-owner-list" }, coOwnerLinks.map((link, i) => {
                    let liClass = 'ecl-site-footer__co-owner-item';
                    if (i === 0) {
                        liClass += ' is-first';
                    }
                    return (h("li", { class: liClass }, h("ecl-link", { path: link.path, styleClass: `ecl-site-footer__co-owner-link sc-ecl-footer-${this.theme}-${this.theme}` }, link.label)));
                })))), h("div", { key: '4401e512c02ed322d7970984f97d8a85c792b2b7', class: "ecl-site-footer__main" }, h("div", { key: '19e9dee4c79e5c7035c577ba9ffbe64b8f8c2936', class: "ecl-container ecl-site-footer__container" }, this.variant === 'harmonised' &&
            h("div", { key: '3b96da85b6c513df0de00d59c60454902986d75a', class: "ecl-site-footer__row" }, h("div", { key: 'e7167d983f36965afb24359c13361fe6aece094f', class: "ecl-site-footer__column" }, h("div", { key: '92d62d2af249074305477ed544119aaf5168c038', class: "ecl-site-footer__section  ecl-site-footer__section--site-info" }, h("h2", { key: 'd78a3698043d8e2bf4f1fc6c82a29b05a59efc28', class: "ecl-site-footer__title" }, !this.siteNameLink ? this.siteName :
                h("ecl-link", { path: this.siteNameLink, "style-class": `ecl-site-footer__title-link sc-ecl-footer-eu-${this.theme}` }, this.siteName)), h("div", { key: '0c7fdec4bca9eec0b38c31800795c0cb96ca3d4a', class: "ecl-site-footer__description" }, this.description, this.descriptionName &&
                h("span", { key: '4ada46da5eedef75fbfb0ed573e66604a14b691e', class: "ecl-site-footer__description-name" }, ` ${this.descriptionName}`)), h("ul", { key: 'e41694c7344cec61b66a0fdec2003f844ba30c42', class: "ecl-site-footer__list" }, h("slot", { key: '23eb2b2ffa248eea35f6b6f568ca04f1f84e8347', name: "ecl-footer-list-info" })))), h("div", { key: 'b73bc760b26a30048488ff0fee59f990eed949b3', class: "ecl-site-footer__column" }, h("div", { key: '2e281743e9c06109a97fbdb2ee8c8d88dfe4b8c9', class: "ecl-site-footer__section" }, h("ul", { key: 'e7429a9bde6e09f9cbb9de1f0f7c11701f2e7a9e', class: "ecl-site-footer__list" }, h("slot", { key: '54749f5ebd914a8d25479405b67bf90be8c8bd91', name: "ecl-footer-list-top-middle" }))), h("div", { key: '54b896737371ae5139f6ad8a0818d91b3f8e541c', class: "ecl-site-footer__section" }, h("ul", { key: 'bf71a59760d5883e29ae41ba36dfe5c74e33afb5', class: "ecl-site-footer__list" }, h("slot", { key: '0788910487637be93ae3bc204ee3e00e47f270cf', name: "ecl-footer-list-top-middle-bottom" })))), h("div", { key: '43999ce01b9a028b85f0c448735e70ada4283afc', class: "ecl-site-footer__column" }, h("div", { key: '4f97b6b293006f56ca1143b7efafe8951926371f', class: "ecl-site-footer__section" }, h("ul", { key: '785a890ac9a1efc54096d88af634ae2709b6d45b', class: "ecl-site-footer__list" }, h("slot", { key: '070dd66c8800ffa556b451ab7d240777f0eb7b97', name: "ecl-footer-list-top-right" }))))), h("div", { key: 'fee6efd2b1b89448023b28f7b001b6362697fc9c', class: "ecl-site-footer__row" }, h("div", { key: '1f685d3078218cc1dd898e760daff50469467548', class: "ecl-site-footer__column" }, h("div", { key: '8c2251f8d40696c958e919b2656f1a655428f657', class: "ecl-site-footer__section" }, h("ecl-link", { key: 'd202f5008ef970b55bfe1f1182190514b15feb48', path: this.logoLink, theme: this.theme, variant: "standalone", styleClass: `ecl-site-footer__logo-link sc-ecl-footer-eu-${this.theme}`, ariaLabel: this.logoAriaLabel }, h("ecl-picture", { key: 'a59e3a2c3df62244338f47323a53ed389149c1d1', theme: this.theme, imageAlt: this.logoAlt, imgClass: `sc-ecl-footer-eu-${this.theme} ecl-site-footer__logo-image`, styleClass: `ecl-site-footer__picture sc-ecl-site-footer-eu-${this.theme}`, image: getAssetPath(`./build/images/${this.theme}/logos/condensed-version/positive/logo-${this.theme}--${this.logoLangCode}.svg`) }, h("source", { key: '0953b24e416185be5a37408c2d276f61d51837e7', srcSet: logoPath, media: "(min-width: 996px)" }), h("slot", { key: '17c7b447fd4b62cf6b526227f55cd05cdc4852b1', name: "sources" }))), this.variant === 'core' &&
            h("div", { key: 'bf6c2c4bb25a59e8ae0f12e8e76fdfc29ae20ca8', class: "ecl-site-footer__description" }, this.description), this.variant === 'harmonised' &&
            h("ul", { key: '6e8204b6c575ec8a7294c2d673c21fc0db9361fb', class: "ecl-site-footer__list" }, h("slot", { key: '42f662b37406ca8454292644e005d02c9469e991', name: "ecl-footer-logo-info" })))), h("div", { key: 'd1a077a74c4b092862b38da93bbc9fc01fc814e0', class: "ecl-site-footer__column" }, h("div", { key: '2a3a506114703ae7166f69ffbb542dc534d00a99', class: "ecl-site-footer__section" }, h("ul", { key: 'def5b9f281ef12f3f1ae29b38e9f84a2f8e73787', class: "ecl-site-footer__list" }, h("slot", { key: 'b18003f999a558ca6461a736b8f6b75fa5f1f790', name: "ecl-footer-list-main" }))), h("div", { key: '2353b8268cebe97006b049352b8cfe72d686511a', class: "ecl-site-footer__section" }, h("ul", { key: 'fedd44c1598b08cdd7479c6a4a8e3750c5f2387c', class: "ecl-site-footer__list" }, h("slot", { key: '5882ddbb878981d460c504fa197ac0a2014bf813', name: "ecl-footer-list-bottom-left" }))), (this.variant === 'harmonised') &&
            h("div", { key: 'a23ee56618cd1f6c3078a18193ed3fc4933f606e', class: "ecl-site-footer__section" }, h("ul", { key: '7fae5ad0ae6793b86461739c26f649115270cd40', class: `ecl-site-footer__list` }, h("slot", { key: '0c767cf0cb55935c58ef890cf743be79a54d1f47', name: "ecl-footer-list-main-bottom" }))), this.variant === 'core' &&
            h("div", { key: '065ca34a402007241eadb83742cd5cf5f9f15e4e', class: "ecl-site-footer__section" }, h("ul", { key: '0201470bcf470fe4f8883960cdfdb222a7155e88', class: "ecl-site-footer__list" }, h("slot", { key: '5c91c60ab490bd03f6dbe8746712cb9b9f2c782f', name: "ecl-footer-list-bottom-right" })))), h("div", { key: '897367fc70d0f93bd1261a734d9218f65b13fae2', class: "ecl-site-footer__column" }, h("div", { key: '1181800377f1ff73bdee207a6f2c74c5cde8fd82', class: "ecl-site-footer__section" }, h("ul", { key: '542693be0164028d343602555e80d26b02fff3d6', class: "ecl-site-footer__list" }, h("slot", { key: 'e6fa33e6d5cbbd5c8b1d6f5c9968ad41681936e7', name: "ecl-footer-list-right-top" }))), h("div", { key: '14b800b9f3792965eeb7272ff08af901c2a6ed75', class: "ecl-site-footer__section" }, h("ul", { key: '591bf518546d47beb9c3a6bc3b4f110eac49c8e3', class: "ecl-site-footer__list" }, h("slot", { key: 'd6e0ec0b8818c6f3ac1138852104be8993b07b29', name: "ecl-footer-list-right" })))))))));
    }
    static get is() { return "ecl-footer-eu"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "eu": ["./build/styles/ecl-footer-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "eu": ["build/styles/ecl-footer-eu.css"]
        };
    }
    static get assetsDirs() { return ["build"]; }
    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"
            },
            "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"
            },
            "logoTitle": {
                "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-title"
            },
            "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"
            },
            "logoAriaLabel": {
                "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-aria-label"
            },
            "logoLangCode": {
                "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-lang-code"
            },
            "siteName": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "site-name"
            },
            "siteNameLink": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "site-name-link"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant"
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "description"
            },
            "descriptionName": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "description-name"
            },
            "coOwnerTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "co-owner-title"
            },
            "coOwnerLinks": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "co-owner-links"
            }
        };
    }
    static get elementRef() { return "el"; }
}
