(()=>{const e=(e,t)=>{const o=e.closest(".gb-accordion__item"),i=o.querySelector(".gb-accordion__content"),c=o.querySelector(".gb-accordion__toggle"),n=o.closest(".gb-accordion"),a=o.getAttribute("data-transition"),s=t.target.closest(".gb-accordion__content");if(s&&(s.style.maxHeight=null),n&&null===n.getAttribute("data-accordion-multiple-open")){const e=(r=o,Array.prototype.filter.call(r.parentNode.children,(e=>e!==r)));e&&e.forEach((e=>{if(e.classList.contains("gb-accordion__item-open")){if("slide"===a){const t=e.querySelector(".gb-accordion__content");t&&(t.style.maxHeight=t.scrollHeight+"px",setTimeout((()=>{e.classList.remove("gb-accordion__item-open"),t.style.maxHeight=null}),10))}else e.classList.remove("gb-accordion__item-open");const t=e.querySelector(".gb-accordion__toggle");t&&(t.setAttribute("aria-expanded",!1),t.classList.remove("gb-block-is-current"))}}))}var r;o.classList.contains("gb-accordion__item-open")?"slide"===a?(i.style.maxHeight=i.scrollHeight+"px",setTimeout((()=>{c.setAttribute("aria-expanded",!1),c.classList.remove("gb-block-is-current"),o.classList.remove("gb-accordion__item-open"),i.style.maxHeight=null}),10)):(c.setAttribute("aria-expanded",!1),c.classList.remove("gb-block-is-current"),o.classList.remove("gb-accordion__item-open")):"slide"===a?(i.style.maxHeight=i.scrollHeight+"px",setTimeout((()=>{c.setAttribute("aria-expanded",!0),c.classList.add("gb-block-is-current"),o.classList.add("gb-accordion__item-open"),i.addEventListener("transitionend",(e=>{"max-height"===e.propertyName&&(i.style.maxHeight=null)}),{once:!0})}),10)):(c.setAttribute("aria-expanded",!0),c.classList.add("gb-block-is-current"),o.classList.add("gb-accordion__item-open"),o.classList.add("gb-accordion__item-transition"),setTimeout((()=>o.classList.remove("gb-accordion__item-transition")),100))};function t(){const e=window.location.hash;if(e){const t=document.getElementById(String(e).replace("#",""));if(t&&t.classList.contains("gb-accordion__item")){const e=t.querySelector(".gb-accordion__toggle"),o=t.querySelector(".gb-accordion__content");o.style.transition="none",e&&(t.classList.contains("gb-accordion__item-open")||e.click(),t.scrollIntoView(),o.style.transition="")}}}document.querySelectorAll(".gb-accordion__item .gb-accordion__toggle").forEach((t=>{t.addEventListener("click",(o=>e(t,o))),"BUTTON"!==t?.tagName.toUpperCase()&&t.addEventListener("keydown",(o=>{" "!==o.key&&"Enter"!==o.key&&"Spacebar"!==o.key||(o.preventDefault(),e(t,o))}))})),window.addEventListener("hashchange",t),document.addEventListener("DOMContentLoaded",t);const o=document.querySelectorAll(".gb-accordion__item");o&&o.forEach((e=>{const t=e.querySelector(".gb-accordion__toggle"),o=e.querySelector(".gb-accordion__content"),i=t.getAttribute("id"),c=o.getAttribute("id");i&&o.setAttribute("aria-labelledby",i),c&&t.setAttribute("aria-controls",c),e.classList.contains("gb-accordion__item-open")&&t?t.setAttribute("aria-expanded",!0):t&&t.setAttribute("aria-expanded",!1)}))})();