!function(){"use strict";const e=window.themeisleGutenbergContentSlider?.goToSlide||"Go to slide %d";var t;t=()=>{document.querySelectorAll(".wp-block-themeisle-blocks-content-slider").forEach((t=>(t=>{const n=t.querySelector(".o-content-track");if(!n)return;const o=Array.from(n.children);if(0===o.length)return;const r="true"===t.dataset.autoplay,c="false"!==t.dataset.loop,a=1e3*Math.max(1,parseFloat(t.dataset.delay)||5),l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let d=0;const s=t.querySelector(".o-content-dots"),i=[],u=()=>{i.forEach(((e,t)=>e.classList.toggle("o-content-dot--active",t===d)))},f=e=>{const t=o.length;e=c?(e+t)%t:Math.max(0,Math.min(e,t-1)),d=e;const r=o[e].getBoundingClientRect().left-n.getBoundingClientRect().left+n.scrollLeft;n.scrollTo({left:r,behavior:l?"auto":"smooth"}),u()};s&&o.forEach(((t,n)=>{const o=document.createElement("button");o.type="button",o.className="o-content-dot",o.setAttribute("aria-label",e.replace("%d",n+1)),o.addEventListener("click",(()=>f(n))),s.appendChild(o),i.push(o)}));const m=t.querySelector(".o-content-arrow--prev"),h=t.querySelector(".o-content-arrow--next");let v;m?.addEventListener("click",(()=>f(d-1))),h?.addEventListener("click",(()=>f(d+1))),n.addEventListener("scroll",(()=>{window.clearTimeout(v),v=window.setTimeout((()=>{d=(()=>{const e=n.getBoundingClientRect().left;let t=0,r=1/0;return o.forEach(((n,o)=>{const c=Math.abs(n.getBoundingClientRect().left-e);c<r&&(r=c,t=o)})),t})(),u()}),100)}),{passive:!0}),t.addEventListener("keydown",(e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e=>{const t=e?.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"]');return Boolean(t)})(e.target)||(e.preventDefault(),f("ArrowLeft"===e.key?d-1:d+1))}));let w=null;const g=()=>{w&&(window.clearInterval(w),w=null)},p=()=>{r&&!l&&(g(),w=window.setInterval((()=>f(d+1)),a))};r&&!l&&(t.addEventListener("mouseenter",g),t.addEventListener("mouseleave",p),t.addEventListener("focusin",g),t.addEventListener("focusout",p),p()),u()})(t)))},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t):t())}();