'use strict';

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

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

const EclTimelineItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.theme = 'ec';
        this.styleClass = undefined;
        this.label = undefined;
        this.type = undefined;
        this.itemTitle = undefined;
    }
    getClass() {
        const styleClasses = [
            `ecl-timeline__item`,
            `sc-ecl-timeline-${this.theme}`,
            this.styleClass
        ];
        if (this.type === 'toggle') {
            styleClasses.push(`ecl-timeline__item--toggle`);
        }
        return styleClasses.join(' ');
    }
    componentDidRender() {
        const element = this.el;
        let previousSibling = element.previousElementSibling;
        while (previousSibling) {
            if (previousSibling instanceof HTMLElement && previousSibling.getAttribute('type') === 'toggle') {
                this.el.firstElementChild.classList.add('ecl-timeline__item--collapsed');
                break;
            }
            previousSibling = previousSibling.previousElementSibling;
        }
    }
    render() {
        return (index.h("li", { class: this.getClass() }, this.type !== 'toggle' ?
            index.h("div", { class: `ecl-timeline__tooltip sc-ecl-timeline-${this.theme}` }, index.h("div", { class: `ecl-timeline__tooltip-arrow sc-ecl-timeline-${this.theme}` }), this.label ?
                index.h("div", { class: `ecl-timeline__label sc-ecl-timeline-${this.theme}` }, this.label) : '', this.itemTitle ?
                index.h("div", { class: `ecl-timeline__title sc-ecl-timeline-${this.theme}` }, this.itemTitle) : '', index.h("div", { class: `ecl-timeline__content sc-ecl-timeline-${this.theme}` }, index.h("slot", null))) : '', this.type === 'toggle' ?
            index.h("ecl-button", { theme: this.theme, variant: "secondary", "data-ecl-timeline-button": true, styleClass: `sc-ecl-timeline-${this.theme}` }, index.h("ecl-icon", { styleClass: `ecl-button__icon--after sc-ecl-timeline-${this.theme}`, icon: "corner-arrow", size: "xs", transform: "rotate-180", slot: "icon-after", theme: this.theme }), index.h("slot", null)) : ''));
    }
    get el() { return index.getElement(this); }
};

exports.ecl_timeline_item = EclTimelineItem;

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