import{r as t,h as s,g as o}from"./p-dfbe004d.js";const l=class{constructor(s){t(this,s),this.accordion=!1,this.collapsible=!0,this.theme="default"}getToggles(){var t,s,o;let l=this.el.shadowRoot.querySelector("slot");if(l)return(null===(o=null===(s=null===(t=null==l?void 0:l.assignedNodes)||void 0===t?void 0:t.call(l))||void 0===s?void 0:s.filter)||void 0===o?void 0:o.call(s,(t=>"SC-TOGGLE"===t.nodeName)))||[]}handleShowChange(t){"SC-TOGGLE"===t.target.tagName&&this.accordion&&this.getToggles().map((s=>s.open=t.target===s))}handleCollapibleChange(){this.getToggles().map((t=>t.collapsible=this.collapsible))}componentDidLoad(){this.handleCollapibleChange();const t=this.getToggles();(null==t?void 0:t.length)&&!t.some((t=>t.open))&&(t[0].open=!0)}render(){return s("container"===this.theme?"sc-card":"div",{class:{toggles:!0,[`toggles--theme-${this.theme}`]:!0},part:"base","no-padding":!0},s("slot",null))}get el(){return o(this)}static get watchers(){return{collapsible:["handleCollapibleChange"]}}};l.style=':host{display:block;--toggle-spacing:0}::slotted(*){margin-bottom:var(--toggle-spacing)}::slotted(:not(:first-child):not([style*="display: none"])){border-top:1px solid var(--sc-input-border-color)}';export{l as sc_toggles}