import*as e from"@wordpress/interactivity";var t={d:(e,i)=>{for(var o in i)t.o(i,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const i=(o={getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store},s={},t.d(s,o),s);var o,s;(0,i.store)("spectra/accordion",{actions:{toggleAnswer:()=>{const e=(0,i.getContext)("spectra/accordion");if(e.isDisabled)return;const{activeItem:t,item:o}=e;e.activeItem=t===o?"":o},handleKeyDown:e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const t=(0,i.getContext)("spectra/accordion");if(t.isDisabled)return;const{activeItem:o,item:s}=t;t.activeItem=o===s?"":s}}},callbacks:{isToggled:()=>{const e=(0,i.getContext)("spectra/accordion"),{activeItem:t,item:o}=e;if(e.isExpanded=t===o,e.isExpanded){const{ref:e}=(0,i.getElement)(),t=e.querySelector(".wp-block-spectra-accordion-child-details");if(t){const e=t.querySelectorAll("[data-aos]");e.length>0&&(e.forEach((e=>{e.style.visibility="hidden",e.classList.remove("aos-init","aos-animate")})),requestAnimationFrame((()=>{setTimeout((()=>{e.forEach((e=>{e.style.visibility="visible"})),void 0!==window.AOS&&window.AOS.refresh&&window.AOS.refresh()}),250)})))}}},isAnimated:()=>{const e=(0,i.getContext)("spectra/accordion"),{isExpanded:t}=e,{ref:o}=(0,i.getElement)(),s=o.querySelector(".wp-block-spectra-accordion-child-header"),a=o.querySelector(".wp-block-spectra-accordion-child-details");s&&a&&(t?(a.style.display="",o.style.maxHeight="",requestAnimationFrame((()=>{const t=o.scrollHeight,i=s.offsetHeight;o.style.maxHeight=`${i}px`,requestAnimationFrame((()=>{o.style.maxHeight=`${t}px`;const i=()=>{o.style.maxHeight="",e.detailsDisplay=""};o.addEventListener("transitionend",i,{once:!0}),setTimeout(i,300)}))}))):requestAnimationFrame((()=>{const t=o.scrollHeight,i=s.offsetHeight;o.style.maxHeight=`${t}px`,requestAnimationFrame((()=>{o.style.maxHeight=`${i}px`;const t=()=>{o.style.maxHeight="",e.detailsDisplay="none"};o.addEventListener("transitionend",t,{once:!0}),setTimeout(t,300)}))})))},updateIconDisplay:()=>{const e=(0,i.getContext)("spectra/accordion"),{isExpanded:t,displayType:o}=e;e.styleDisplay=t?o:"none",e.styleHide=t?"none":o},updateHeaderTabIndex:()=>{const e=(0,i.getContext)("spectra/accordion"),{isDisabled:t}=e;e.headerTabIndex=t?-1:0}}});