'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-420e0ca1.js');

const EclListIllustrationItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        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 (index.h("div", { class: this.getClass() }, this.image ?
            index.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()), index.h("slot", { name: "sources" })) : '', index.h("div", { class: `ecl-list-illustration__detail sc-ecl-list-illustration-${this.theme}` }, index.h("div", { class: `ecl-list-illustration__title-container sc-ecl-list-illustration-${this.theme}` }, this.icon ?
            index.h("ecl-icon", { icon: this.icon, size: this.getIconSize(), "style-class": `ecl-list-illustration__icon sc-ecl-list-illustration-${this.theme}` }) : '', this.itemValue ?
            index.h("div", { class: `ecl-list-illustration__value sc-ecl-list-illustration-${this.theme}` }, this.itemValue) : '', this.itemTitle && (index.h("div", { class: `ecl-list-illustration__title sc-ecl-list-illustration-${this.theme}` }, this.itemLink ? (index.h("ecl-link", { variant: "standalone", path: this.itemLink }, this.itemTitle)) : (this.itemTitle)))), index.h("div", { class: `ecl-list-illustration__description sc-ecl-list-illustration-${this.theme}` }, index.h("slot", null)))));
    }
};

exports.ecl_list_illustration_item = EclListIllustrationItem;

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