1document.addEventListener("DOMContentLoaded",function(){const carousels=document.getElementsByClassName("xcp-grid-carousel");carousels.length>0&&Array.from(carousels).forEach(carousel=>{handleArrows(carousel),handleSwipe(carousel)});function carouselActiveIndex(carousel){const activeImage=carouselActiveImage(carousel);return activeImage?activeImage[0].dataset.itemIndex:null}function carouselActiveImage(carousel){const images=carousel.getElementsByClassName("xcp-grid-carousel__carousel__image");return Array.from(images).filter(img=>img.classList.contains("active"))}function clearActive(carousel){const images=carousel.getElementsByClassName("xcp-grid-carousel__carousel__image");Array.from(images).forEach(img=>{img.classList.remove("active")});const indicators=carousel.getElementsByClassName("xcp-grid-carousel__carousel__indicator");Array.from(indicators).forEach(ind=>{ind.classList.remove("active")})}function scrollToIndex(carousel,index){const imageToActivate=carousel.querySelector(`.xcp-grid-carousel__carousel__image[data-item-index="${index}"]`),indicatorToActivate=carousel.querySelector(`.xcp-grid-carousel__carousel__indicator[data-item-index="${index}"]`),carouselInner=carousel.querySelector(".xcp-grid-carousel__carousel__inner"),images=carousel.getElementsByClassName("xcp-grid-carousel__carousel__image");index<images.length&&index>=0&&(clearActive(carousel),carouselInner.style.left=`-${imageToActivate.offsetLeft}px`,imageToActivate.classList.add("active"),indicatorToActivate.classList.add("active"))}function handleArrows(carousel){const leftArrow=carousel.getElementsByClassName("xcp-grid-carousel__carousel__left-arrow")[0],rightArrow=carousel.getElementsByClassName("xcp-grid-carousel__carousel__right-arrow")[0];leftArrow&&leftArrow.addEventListener("click",function(){const activeIndex=carouselActiveIndex(carousel);scrollToIndex(carousel,parseInt(activeIndex)-1)}),rightArrow&&rightArrow.addEventListener("click",function(){const activeIndex=carouselActiveIndex(carousel);scrollToIndex(carousel,parseInt(activeIndex)+1)})}function handleSwipe(carousel){var touchstartX=0,touchstartY=0,touchendX=0,touchendY=0,gesuredZone=carousel;gesuredZone.addEventListener("touchstart",function(event){touchstartX=event.changedTouches[0].screenX,touchstartY=event.changedTouches[0].screenY},!1),gesuredZone.addEventListener("touchend",function(event){touchendX=event.changedTouches[0].screenX,touchendY=event.changedTouches[0].screenY,handleGesure()},!1);function handleGesure(){const activeIndex=carouselActiveIndex(carousel);touchendX<touchstartX&&scrollToIndex(carousel,parseInt(activeIndex)+1),touchendX>touchstartX&&scrollToIndex(carousel,parseInt(activeIndex)-1),touchendY>touchstartY&&scrollToIndex(carousel,parseInt(activeIndex)+1)}}}); 2//# sourceMappingURL=/cdn/shop/t/129/assets/xcp-carousel.js.map?v=173406299262015423631787070267
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.