"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./query-assigned-elements-8EurZY45.js"),p=require("./property-DYTC_2-m.js");var h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,i=(o,n,t,l)=>{for(var s=l>1?void 0:l?c(n,t):n,e=o.length-1,r;e>=0;e--)(r=o[e])&&(s=(l?r(n,t,s):r(s))||s);return l&&s&&h(n,t,s),s};exports.CovalentExpansionPanel=class extends a.s{constructor(){super(...arguments),this.noSurface=!1,this.titleWidth="150px",this._handleToggle=n=>{const t=n.detail.index,l=this.panelItems[t],s=l.open;this.panelItems.forEach(e=>{e.resetPanel()}),s&&(l.open=!0,this.panelItems.forEach(e=>{e.index==t-1?e.index==0?e.separateSinglePanel=!0:e.aboveOpenInnerPanel=!0:e.index==t+1&&(e.index==this.panelItems.length-1&&(e.separateSinglePanel=!0),e.belowOpenInnerPanel=!0)}))}}render(){return a.x`
      <div class="container">
        <div class="content">
          <slot id="mainSlot"></slot>
        </div>
      </div>
    `}firstUpdated(){if(window.addEventListener("cv-expansionPanel-togglePanel",n=>this._handleToggle(n)),this.style.setProperty("--cv-expansion-panel-item-title-width",this.titleWidth),this.noSurface&&this.style.setProperty("--cv-theme-surface-container","transparent"),this.panelItems.length==1)this.panelItems[0].isSinglePanel=!0;else{let n=0;this.panelItems.forEach(t=>{n==0?t.isTopPanel=!0:n==this.panelItems.length-1?t.isBottomPanel=!0:t.isInnerPanel=!0,t.index=n,n++})}}};i([p.n({type:Boolean,reflect:!0})],exports.CovalentExpansionPanel.prototype,"noSurface",2);i([p.n({type:String})],exports.CovalentExpansionPanel.prototype,"titleWidth",2);i([a.l()],exports.CovalentExpansionPanel.prototype,"panelItems",2);exports.CovalentExpansionPanel=i([a.e("cv-expansion-panel")],exports.CovalentExpansionPanel);
