import{p as e,H as s,c as t,h as a,a as c}from"./index.js";import{v as i}from"./p-BKP-F1qP.js";import{b as o,a as n,A as d}from"./p-4i8qDRtu.js";import{g as f,c as r,b as m}from"./p-DKo9A5gq.js";import{i as b}from"./p-CXgom82_.js";import{t as h}from"./p-Cjg0wpDG.js";import{d as l}from"./p-BJnSrRNH.js";const p=e(class e extends s{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change");this.inheritedAttributes={};this.disabled=false;this.open=false;this.h=f(this.host)}validateSize(e){i(n,e,o.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=b(this.host)}componentDidRender(){h((()=>this.getPropsFromParents()))}getPropsFromParents(){const e=this.h.getParent(d.root);if(e){this.size=e.getAttribute("size")}}render(){return a(c,{key:"322aca243fd956d90542c23ffd384969a3e702ba",class:this.h.classes([o.root,this.disabled&&o.disabled]),size:this.size,role:"listitem"},a("details",{key:"80befb8ec6ecc9e1718d9e94fc693e382a384512",class:o.details,id:this.identifier,"aria-disabled":r(this.disabled),open:this.open},a("summary",Object.assign({key:"f04df2d0a5c29c9c6621e69ab15c1ac72bc95912",onClick:e=>{e.stopPropagation();e.preventDefault();!this.disabled&&this.toggle().finally()},class:o.summary,tabIndex:this.disabled?-1:0,"aria-expanded":m(this.open)},this.inheritedAttributes),this.h.hasSlot("icon")&&a("span",{key:"0889615c3b616615947e09cb7dc82a45f5bf3c36",class:o.icon},a("slot",{key:"204ee8071c84d94fe44f06781a169c6ed6548748",name:"icon"})),a("span",{key:"2558df9bfa5b027fd78858bc07c59c812144f7b0",class:o.title},a("slot",{key:"ce4fc19e7bcd801e789fa920b75726ac2e6d64fa",name:"label"}),a("slot",{key:"6493bed9d3ff025212c6ddd483c6afc66e4e2555",name:"annotation"})),a("span",{key:"86bb4f277aa23a921803d1b15b19ddc1f9bef788",class:o.right},a("slot",{key:"6125404df4e25f638b3c0a2dc10d13cc58d5a2db",name:"suffix"}),a("span",{key:"4ec7fde2af7b5648b033440a646af0fa9cdb575a",class:o.arrow},a("slot",{key:"cf5ace176c8c7cd53e8bad7c8155e396d37ca6fa",name:"toggle-icon"},a("gov-icon",{key:"0d5e06a98c5ac069c3680ed5442064aed996eb46",name:"chevron-down",type:"components"}))))),a("div",{key:"6ce82f8da04142d8330f9da035f046272deffd4d",class:o.content},a("slot",{key:"47790abbe664864a3cf1d456762fb414d7c63418"}))))}async toggle(){this.open=!this.open;this.govChange.emit({open:this.open,component:o.root,ref:this.host})}async currentState(){return this.open}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-accordion-item",{identifier:[1],size:[1025],disabled:[4],open:[1028],openState:[32],toggle:[64],currentState:[64]},undefined,{size:["validateSize"]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-accordion-item","gov-icon"];e.forEach((e=>{switch(e){case"gov-accordion-item":if(!customElements.get(e)){customElements.define(e,p)}break;case"gov-icon":if(!customElements.get(e)){l()}break}}))}g();const y=p;const u=g;export{y as GovAccordionItem,u as defineCustomElement};
//# sourceMappingURL=gov-accordion-item.js.map