!function(){"use strict";const e=(e,t={})=>{if(!e)return;const s=e.getBoundingClientRect();0<=s.top&&0<=s.left&&s.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&s.right<=(window.innerWidth||document.documentElement.clientWidth)||e.scrollIntoView(t)};var t;t=()=>{const t=document.querySelectorAll(".wp-block-themeisle-blocks-tabs"),s=window.location.hash.substring(1);t.forEach((t=>{const c=Array.from(t.querySelectorAll(":scope > .wp-block-themeisle-blocks-tabs__content > .wp-block-themeisle-blocks-tabs-item")),o=document.createElement("div");o.classList.add("wp-block-themeisle-blocks-tabs__header"),t.prepend(o);let a=!1;const i=[];c.forEach(((t,l)=>{const d=t.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__content");d.setAttribute("role","tabpanel");const n=t.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__header");n.setAttribute("role","tab");const r=document.createElement("div");r.classList.add("wp-block-themeisle-blocks-tabs__header_item"),r.tabIndex=0;const b=n.cloneNode(!0);b.classList.remove("wp-block-themeisle-blocks-tabs-item__header"),r.appendChild(b),t?.id&&r.setAttribute("for",t.id),"true"!==t.dataset.defaultOpen||a?i.push({headerItem:r,content:d,headerMobile:n}):(r.classList.add("active"),d.classList.add("active"),n.classList.add("active"),a=!0);const h=(t,s)=>{const c=t.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__content"),a=t.querySelector(":scope > .wp-block-themeisle-blocks-tabs-item__header");c.classList.toggle("active",s===l),c.classList.toggle("hidden",s!==l),a.classList.toggle("active",s===l),a.classList.toggle("hidden",s!==l),a.setAttribute("aria-selected",s===l),Array.from(o.childNodes).forEach(((e,t)=>{e.classList.toggle("active",t===l),e.classList.toggle("hidden",t!==l),e.setAttribute("aria-selected",t===l)})),s===l&&a&&e(a)};r.addEventListener("click",(()=>c.forEach(h))),r.addEventListener("keyup",(e=>{"Enter"===e.code&&(e.preventDefault(),c.forEach(h))})),n.addEventListener("click",(()=>c.forEach(h))),n.addEventListener("keyup",(e=>{"Enter"===e.code&&(e.preventDefault(),c.forEach(h))})),o.appendChild(r),s&&t.id===s&&(h(t,l),a=!0,e(r))})),a||(i?.[0]?.headerItem.classList.add("active"),i?.[0]?.content.classList.add("active"),i?.[0]?.headerMobile.classList.add("active"))}))},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t):t())}();