import{p as t,H as e,h as n,t as i}from"./index.js";const o=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isOpened=!1}componentDidLoad(){this.assignItemId(),this.updateHeight(),window.addEventListener("resize",this.handleResize.bind(this)),this.contentElement.addEventListener("transitionend",this.handleTransitionEnd.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.handleResize.bind(this)),this.contentElement.removeEventListener("transitionend",this.handleTransitionEnd.bind(this))}assignItemId(){const t=this.el.closest("spw-accordion-item");if(t){const e=t.getAttribute("data-accordion-id");e&&this.el.setAttribute("data-accordion-id",e)}}handleAccordionToggle(t){const e=this.el.getAttribute("data-accordion-id");t.detail.id===e&&(this.isOpened=t.detail.isOpen,this.updateHeight())}handleResize(){this.updateHeight(),setTimeout((()=>{this.updateHeight()}),300)}handleTransitionEnd(t){"max-height"===t.propertyName&&(this.isOpened?this.contentElement.classList.add("spw-accordion-content--is-opened"):this.contentElement.classList.remove("spw-accordion-content--is-opened"))}updateHeight(){requestAnimationFrame((()=>{const t=this.contentElement;t.style.maxHeight=this.isOpened?`${t.scrollHeight}px`:"0px"}))}render(){return n("div",{key:"b372cc0a27e1ff25e0e9dde30f0a4e4cdc48601a",class:"spw-accordion-content",ref:t=>this.contentElement=t,"data-accordion-id":this.el.getAttribute("data-accordion-id")},n("div",{key:"79e9cd2d38ba392dc248c9ea991753f6c897d654",class:"spw-accordion-content__inner"},n("slot",{key:"99e8bda5b6e72ef32c355b02fd33b7fd68ff6b44",onSlotchange:()=>this.updateHeight()})))}get el(){return this}static get style(){return"html{line-height:1.3;-webkit-text-size-adjust:100%;}h1,h2,h3,h4,h5,h6,p,ul,li{padding:0;margin:0}ul{list-style:none}:host{box-sizing:border-box;line-height:1.3;-webkit-text-size-adjust:100%;font-size:100%}:host *,:host *::before,:host *::after{box-sizing:inherit;font-family:var(--spw-ds-font-main)}body{margin:0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0;}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px;}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--spw-ds-container-xl:1232px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%;padding-left:16px;padding-right:16px;margin-left:auto;margin-right:auto}@media (min-width: 460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width: 768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width: 1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width: 1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-accordion-content{line-height:1.5;font-weight:400;overflow:hidden;color:var(--spw-color-themes-grey-grey-800);transition:all 0.25s ease-in}:host(.--collapsed) .spw-accordion-content{max-height:0 !important}.spw-accordion-content--is-opened{max-height:100% !important}.spw-accordion-content__inner{padding:0;margin-bottom:var(--spw-spacings-spacing-lg)}"}},[257,"spw-accordion-content",{isOpened:[32]},[[4,"accordionToggle","handleAccordionToggle"]]]);function s(){"undefined"!=typeof customElements&&["spw-accordion-content"].forEach((t=>{"spw-accordion-content"===t&&(customElements.get(i(t))||customElements.define(i(t),o))}))}export{o as S,s as d}