import { h } from "@stencil/core";
export class EclBanner {
    constructor() {
        this.theme = 'ec';
        this.styleClass = undefined;
        this.external = false;
        this.variant = 'display';
        this.fullWidth = false;
        this.bannerTitle = undefined;
        this.image = undefined;
        this.imageAlt = undefined;
        this.ctaLabel = undefined;
        this.ctaLink = undefined;
        this.centered = false;
        this.credit = undefined;
        this.size = 'm';
        this.ctaClicked = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-banner`,
            `ecl-banner--${this.variant}`,
            `ecl-banner--${this.size}`,
            this.styleClass
        ];
        if (this.centered) {
            styleClasses.push('ecl-banner--centered');
        }
        if (this.fullWidth) {
            styleClasses.push('ecl-banner--full-width');
        }
        return styleClasses.join(' ');
    }
    componentDidRender() {
        if (this.el.querySelector('.ecl-banner__cta')) {
            this.el.querySelector('.ecl-banner__cta').addEventListener('click', () => {
                this.ctaClicked = true;
            });
        }
    }
    render() {
        const imageBanners = [
            'text-box',
            'image-overlay',
            'text-highlight',
        ];
        return (h("section", { class: this.getClass() }, imageBanners.includes(this.variant) && this.image ?
            h("ecl-picture", { styleClass: `ecl-banner__picture sc-ecl-banner-${this.theme}`, image: this.image, imageAlt: this.imageAlt, imgClass: `ecl-banner__image sc-ecl-banner-${this.theme}` }, h("slot", { name: "sources" }))
            : '', this.credit && this.variant != 'plain-background' ?
            h("div", { class: "ecl-banner__credit" }, this.credit) : '', h("div", { class: "ecl-container" }, h("div", { class: "ecl-banner__container" }, h("div", { class: "ecl-banner__content" }, this.bannerTitle ?
            h("div", { class: "ecl-banner__title" }, h("span", { class: "ecl-banner__title-text" }, this.bannerTitle)) : '', h("p", { class: "ecl-banner__description" }, h("span", { class: "ecl-banner__description-text" }, h("slot", null))), this.ctaLabel && this.ctaLink ?
            h("div", { class: "ecl-banner__cta" }, h("ecl-link", { theme: this.theme, variant: "cta", path: this.ctaLink, "style-class": `ecl-banner__link-cta sc-ecl-banner-${this.theme}` }, this.ctaLabel, h("ecl-icon", { icon: "corner-arrow", slot: "icon-after", transform: "rotate-90", theme: this.theme })))
            : '')))));
    }
    static get is() { return "ecl-banner"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-banner-ec.css"],
            "eu": ["./build/styles/ecl-banner-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-banner-ec.css"],
            "eu": ["build/styles/ecl-banner-eu.css"]
        };
    }
    static get properties() {
        return {
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "theme",
                "reflect": false,
                "defaultValue": "'ec'"
            },
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "style-class",
                "reflect": false
            },
            "external": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "external",
                "reflect": false,
                "defaultValue": "false"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "variant",
                "reflect": false,
                "defaultValue": "'display'"
            },
            "fullWidth": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "full-width",
                "reflect": false,
                "defaultValue": "false"
            },
            "bannerTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "banner-title",
                "reflect": false
            },
            "image": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "image",
                "reflect": false
            },
            "imageAlt": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "image-alt",
                "reflect": false
            },
            "ctaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "cta-label",
                "reflect": false
            },
            "ctaLink": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "cta-link",
                "reflect": false
            },
            "centered": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "centered",
                "reflect": false,
                "defaultValue": "false"
            },
            "credit": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "credit",
                "reflect": false
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "size",
                "reflect": false,
                "defaultValue": "'m'"
            },
            "ctaClicked": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "cta-clicked",
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-banner.js.map
