!function(){var e="jules-product-carousel-styles";function t(){var e=document.querySelector("[data-product-carousel]");if(e){var t=e.querySelector(".product-carousel-track"),r=Array.prototype.slice.call(e.querySelectorAll("[data-product-slide]")),a=Array.prototype.slice.call(e.querySelectorAll("[data-carousel-dot]")),o=null;a.forEach(function(e){e.addEventListener("click",function(){i(Number(e.dataset.carouselDot))})}),r.forEach(function(e,t){e.addEventListener("click",function(){i(t)})}),t.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),d()}function c(e){return Math.max(0,Math.min(e,r.length-1))}function n(e){var t=c(e);r.forEach(function(e,r){e.classList.toggle("is-active",r===t)}),a.forEach(function(e,r){e.classList.toggle("is-active",r===t)})}function i(e){var t=c(e),a=r[t];a&&(a.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),n(t))}function d(){var e,a,o,c;n((e=t.getBoundingClientRect(),a=e.left+e.width/2,o=0,c=Number.POSITIVE_INFINITY,r.forEach(function(e,t){var r=e.getBoundingClientRect(),n=r.left+r.width/2,i=Math.abs(n-a);i