import{r as t,h as s,g as o}from"./p-c87337b7.js";const e=class{constructor(s){t(this,s),this.items=[]}valueChanged(t){this.updateItems()}handleOpenClose(t){t.detail.open?this.value=t.detail.name:this.value==t.detail.name&&(this.value=void 0)}onAccordionItemDidLoad(t){const s=t.target;this.items.push(s),null==this.value&&s.open?this.value=s.name:this.updateItems()}onAccordionItemDidUnload(t){const s=this.items.indexOf(t.target);s>-1&&this.items.splice(s,1)}componentDidLoad(){this.updateItems()}updateItems(){let t=!1;for(const s of this.items)(s.open=!t&&s.name==this.value)&&(t=!0)}render(){return[s("slot",null)]}get me(){return o(this)}static get watchers(){return{value:["valueChanged"]}}static get style(){return"smoothly-accordion-item.sc-smoothly-accordion{border:1px solid rgb(var(--smoothly-dark-color));border-bottom:none}smoothly-accordion-item.sc-smoothly-accordion:first-of-type{border-top-left-radius:4px;border-top-right-radius:4px;margin-top:.4em}smoothly-accordion-item.sc-smoothly-accordion:last-of-type{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:1px solid rgb(var(--smoothly-dark-color));margin-bottom:.6em}smoothly-accordion-item[open].sc-smoothly-accordion{border-color:rgb(var(--smoothly-primary-color));border-bottom:1px solid rgb(var(--smoothly-primary-color))}smoothly-accordion-item[open].sc-smoothly-accordion + smoothly-accordion-item.sc-smoothly-accordion{border-top:none}"}};export{e as smoothly_accordion};