import{r as e,h as t,a as i}from"./p-ytAlchvh.js";const l=class{constructor(t){e(this,t),this.elId=`ecl-timeline-item-${Date.now().toString(16)+Math.random().toString(16).slice(2,10)}`}getClass(){const e=["ecl-timeline__item",`sc-ecl-timeline-${this.theme}`,this.styleClass];return"toggle"===this.type&&e.push("ecl-timeline__item--toggle"),"headline"===this.type&&e.push("ecl-timeline__item--headline"),e.join(" ")}componentWillLoad(){var e;this.theme=null!==(e=document.documentElement.getAttribute("data-ecl-theme"))&&void 0!==e?e:this.theme||"ec"}componentDidRender(){const e=this.el;e.querySelector("ecl-timeline__item--headline")&&e.parentElement.classList.add("ecl-timeline--has-headline");let t=e.previousElementSibling;for(;t;){if(t instanceof HTMLElement&&"toggle"===t.getAttribute("type")){this.el.firstElementChild.classList.add("ecl-timeline__item--collapsed");break}t=t.previousElementSibling}}render(){return t("li",{key:"0b710c2817714299507570dfea63635d863d4af9",class:this.getClass(),id:this.elId},"toggle"!==this.type?t("div",{class:`ecl-timeline__tooltip sc-ecl-timeline-${this.theme}`},t("div",{class:`ecl-timeline__tooltip-arrow sc-ecl-timeline-${this.theme}`}),this.label?t("div",{class:`ecl-timeline__label sc-ecl-timeline-${this.theme}`},this.label):"",this.itemTitle?t("div",{class:`ecl-timeline__title sc-ecl-timeline-${this.theme}`},this.itemTitle):"",t("div",{class:`ecl-timeline__content sc-ecl-timeline-${this.theme}`},t("slot",null))):"","toggle"===this.type?t("ecl-button",{theme:this.theme,variant:"secondary","data-ecl-timeline-button":!0,styleClass:`ecl-timeline__toggle sc-ecl-timeline-${this.theme}`,"data-ecl-label-expanded":this.toggleLabelExpanded,"data-ecl-label-collapsed":this.toggleLabelCollapsed},t("ecl-icon",{styleClass:`ecl-button__icon--after sc-ecl-timeline-${this.theme}`,icon:"corner-arrow",size:"xs",rotate:"180",slot:"icon-after"}),this.toggleLabelCollapsed):"")}get el(){return i(this)}};export{l as ecl_timeline_item}