import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$4 } from './ecl-icon2.js';
import { d as defineCustomElement$3 } from './ecl-link2.js';
import { d as defineCustomElement$2 } from './ecl-picture2.js';

const EclListIllustrationItem$1 = /*@__PURE__*/ proxyCustomElement(class EclListIllustrationItem extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.theme = 'ec';
        this.itemTitle = undefined;
        this.itemLink = undefined;
        this.image = undefined;
        this.icon = undefined;
        this.imageAlt = undefined;
        this.squareImage = false;
        this.styleClass = undefined;
        this.mediaSize = 'm';
        this.itemValue = undefined;
    }
    getClass() {
        const styleClasses = [
            `sc-ecl-list-illustration-${this.theme}`,
            `ecl-list-illustration__item`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    getImgClass() {
        const imgClasses = [
            `sc-ecl-list-illustration-${this.theme}`,
            `ecl-list-illustration__image`,
        ];
        if (this.squareImage) {
            imgClasses.push('ecl-list-illustration__image--square');
            imgClasses.push(`ecl-list-illustration__image--${this.mediaSize}`);
        }
        return imgClasses.join(' ');
    }
    getImgAttr() {
        const attrs = {
            role: 'img',
        };
        if (this.imageAlt) {
            attrs['aria-label'] = this.imageAlt;
        }
        return attrs;
    }
    getIconSize() {
        return this.mediaSize === 'l' ? '2xl' : 'l';
    }
    render() {
        return (h("div", { class: this.getClass() }, this.image ?
            h("ecl-picture", Object.assign({ styleClass: `ecl-list-illustration__picture sc-ecl-list-illustration-${this.theme}`, imgClass: this.getImgClass(), image: this.image, imageAlt: this.imageAlt }, this.getImgAttr()), h("slot", { name: "sources" })) : '', h("div", { class: `ecl-list-illustration__detail sc-ecl-list-illustration-${this.theme}` }, h("div", { class: `ecl-list-illustration__title-container sc-ecl-list-illustration-${this.theme}` }, this.icon ?
            h("ecl-icon", { icon: this.icon, size: this.getIconSize(), "style-class": `ecl-list-illustration__icon sc-ecl-list-illustration-${this.theme}` }) : '', this.itemValue ?
            h("div", { class: `ecl-list-illustration__value sc-ecl-list-illustration-${this.theme}` }, this.itemValue) : '', this.itemTitle && (h("div", { class: `ecl-list-illustration__title sc-ecl-list-illustration-${this.theme}` }, this.itemLink ? (h("ecl-link", { variant: "standalone", path: this.itemLink }, this.itemTitle)) : (this.itemTitle)))), h("div", { class: `ecl-list-illustration__description sc-ecl-list-illustration-${this.theme}` }, h("slot", null)))));
    }
}, [4, "ecl-list-illustration-item", {
        "theme": [1],
        "itemTitle": [1, "item-title"],
        "itemLink": [1, "item-link"],
        "image": [1],
        "icon": [1],
        "imageAlt": [1, "image-alt"],
        "squareImage": [4, "square-image"],
        "styleClass": [1, "style-class"],
        "mediaSize": [1, "media-size"],
        "itemValue": [1, "item-value"]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["ecl-list-illustration-item", "ecl-icon", "ecl-link", "ecl-picture"];
    components.forEach(tagName => { switch (tagName) {
        case "ecl-list-illustration-item":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, EclListIllustrationItem$1);
            }
            break;
        case "ecl-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "ecl-link":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "ecl-picture":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const EclListIllustrationItem = EclListIllustrationItem$1;
const defineCustomElement = defineCustomElement$1;

export { EclListIllustrationItem, defineCustomElement };

//# sourceMappingURL=ecl-list-illustration-item.js.map