!function(){"use strict";class t{constructor(t){this.blockEl=t.parentElement,this.rootEl=t,this.buttonEl=this.rootEl.querySelector(".accordion__trigger");const e=this.buttonEl.getAttribute("aria-controls");this.contentEl=()=>document.getElementById(e),this.open="true"===this.buttonEl.getAttribute("aria-expanded"),this.buttonEl.addEventListener("click",this.onButtonClick.bind(this)),this.rootEl.parentElement.classList.contains("accordion--toggleable")&&this.buttonEl.addEventListener("accordion-toggle",this.onAccordionToggle.bind(this))}onButtonClick(){for(let t=0;t<this.blockEl.children.length;t++)this.blockEl.children[t].classList.contains("accordion__item")&&this.blockEl.children[t]!==this.rootEl&&this.blockEl.children[t].children[0].dispatchEvent(new Event("accordion-toggle"));this.toggle(!this.open)}onAccordionToggle(){this.open&&this.toggle(!this.open)}toggle(t){if(t===this.open)return;this.open=t,this.buttonEl.setAttribute("aria-expanded",`${t}`);const e=this.contentEl();t?(e?.removeAttribute("hidden"),setTimeout(()=>{e?.classList.add("accordion__content-active")},10),this.rootEl.classList.add("accordion__item-active")):(e?.classList.remove("accordion__content-active"),setTimeout(()=>{e?.setAttribute("hidden","")},510),this.rootEl.classList.remove("accordion__item-active"))}open(){this.toggle(!0)}close(){this.toggle(!1)}}window.addEventListener("DOMContentLoaded",function(){!function(e=document){e.querySelectorAll(".accordion__item").forEach(e=>{e.dataset.accordionInitialized||(new t(e),e.dataset.accordionInitialized="true")})}()})}();