'use strict';

var index = require('./index-Bkm7eeWO.js');

const EclTagSet = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    getClass() {
        const styleClasses = [
            'ecl-tag-set',
            `sc-ecl-tag-${this.theme}`,
            this.styleClass
        ];
        if (this.colorMode) {
            styleClasses.push(`ecl-color-mode--${this.colorMode}`);
        }
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme =
            (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidLoad() {
        const tagElements = Array.from(this.el.querySelectorAll('ecl-tag'));
        tagElements.forEach((tag) => {
            const li = document.createElement('li');
            li.className = `ecl-tag-set__item sc-ecl-tag-${this.theme}`;
            li.appendChild(tag);
            this.listEl.appendChild(li);
        });
    }
    render() {
        return (index.h("ul", { key: '4e760bec5e90ca30234ba16496ac2317ac943c32', class: this.getClass(), ref: (el) => (this.listEl = el) }));
    }
    get el() { return index.getElement(this); }
};

exports.ecl_tag_set = EclTagSet;
