(()=>{"use strict";function e(e){return Array.from(e.querySelectorAll(".flexa-tabs__nav .flexa-tabs__tab"))}function t(e){return Array.from(e.querySelectorAll(".flexa-tabs__panel-wrap"))}function r(e){const t=e.querySelector(".flexa-tabs__nav");if(!t)return;const r=t.querySelector(".flexa-tabs__indicator");if(!r)return;const a=t.querySelector(".flexa-tabs__tab.is-active");a&&0!==a.offsetWidth?(r.style.setProperty("--flexa-tabs-ind-x",a.offsetLeft+"px"),r.style.setProperty("--flexa-tabs-ind-w",a.offsetWidth+"px"),t.classList.add("is-indicator-ready")):t.classList.remove("is-indicator-ready")}function a(a,o){e(a).forEach((e,t)=>{const r=t===o;e.classList.toggle("is-active",r),e.setAttribute("aria-selected",r?"true":"false"),e.setAttribute("tabindex",r?"0":"-1")}),t(a).forEach((e,t)=>{const r=t===o;e.classList.toggle("is-active",r),e.classList.toggle("is-open",r);const a=e.querySelector(".flexa-tabs__accordion-header");a&&(a.classList.toggle("is-active",r),a.setAttribute("aria-expanded",r?"true":"false"))}),r(a)}function o(o){const n=e(o);n.length&&(n.forEach((e,t)=>{e.addEventListener("click",()=>a(o,t)),e.addEventListener("keydown",e=>{const r=n.length-1;let s=-1;"ArrowRight"===e.key||"ArrowDown"===e.key?s=t>=r?0:t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?s=t<=0?r:t-1:"Home"===e.key?s=0:"End"===e.key&&(s=r),-1!==s&&(e.preventDefault(),a(o,s),n[s].focus())})}),t(o).forEach((e,r)=>{const n=e.querySelector(".flexa-tabs__accordion-header");n&&n.addEventListener("click",()=>function(e,r){const o=t(e)[r];if(o){if(o.classList.contains("is-open")){o.classList.remove("is-open");const e=o.querySelector(".flexa-tabs__accordion-header");return void(e&&e.setAttribute("aria-expanded","false"))}a(e,r)}}(o,r))}),window.requestAnimationFrame(()=>r(o)))}let n=!1;function s(){n||(n=!0,window.requestAnimationFrame(()=>{n=!1,document.querySelectorAll("[data-flexa-tabs]").forEach(r)}))}function i(e){e.classList.add("flexa-bg-loaded"),e.removeAttribute("data-flexa-lazy-bg")}function c(){document.querySelectorAll("[data-flexa-tabs]").forEach(o),window.addEventListener("resize",s);const e=document.querySelectorAll("[data-flexa-lazy-bg]");if(!e.length)return;if(void 0===window.IntersectionObserver)return void e.forEach(i);const t=new window.IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(i(e.target),t.unobserve(e.target))})},{rootMargin:"200px 0px"});e.forEach(e=>t.observe(e))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c):c()})();