1customElements.get("product-slider")||customElements.define("product-slider",class extends HTMLElement{constructor(){super()}connectedCallback(){if(this.selectors={productsWrap:".products-grid-wrap",products:".products-grid",nextEl:".swiper-button-next",prevEl:".swiper-button-prev",pagination:".swiper-pagination"},this.classes={grid:"f-grid",swiper:"swiper",swiperWrapper:"swiper-wrapper"},this.sectionId=this.dataset.sectionId,this.elements=FoxTheme.utils.queryDomNodes(this.selectors,this),this.elements.section=this.closest(`.section-${this.sectionId}`),this.enableSlider="true"===this.dataset.enableSlider,this.items=parseInt(this.dataset.items),this.tabletItems=parseInt(this.dataset.tabletItems),this.totalItems=parseInt(this.dataset.totalItems),this.paginationType=this.dataset.paginationType||"bullets",this.sliderInstance=!1,!this.enableSlider)return;if(!this.elements.productsWrap||!this.elements.products)return;window.matchMedia(FoxTheme.config.mediaQueryMobile).onchange=this.init.bind(this);window.matchMedia(FoxTheme.config.mediaQueryTablet).onchange=this.init.bind(this),this.init()}init(){if(FoxTheme.config.mqlMobile)this.destroySlider();else{const e=FoxTheme.config.mqlTablet?this.tabletItems:this.items;this.totalItems>e?this.initSlider():this.destroySlider()}}initSlider(){if("object"==typeof this.sliderInstance)return;const e=window.getComputedStyle(this.elements.products).getPropertyValue("--f-column-gap"),s=10*parseFloat(e.replace("rem",""));this.sliderOptions={slidesPerView:2,spaceBetween:s,navigation:{nextEl:this.elements.nextEl,prevEl:this.elements.prevEl},pagination:{el:this.elements.pagination,type:this.paginationType},breakpoints:{768:{slidesPerView:this.tabletItems},1024:{slidesPerView:this.items}},loop:!1,threshold:2,mousewheel:{enabled:!0,forceToAxis:!0}},this.elements.productsWrap.classList.add(this.classes.swiper),this.elements.products.classList.remove(this.classes.grid),this.elements.products.classList.add(this.classes.swiperWrapper),this.sliderInstance=new window.FoxTheme.Carousel(this.elements.productsWrap,this.sliderOptions,[FoxTheme.Swiper.Mousewheel]),this.sliderInstance.init(),this.handleAccessibility(),this.fixQuickviewDuplicate()}handleAccessibility(){FoxTheme.a11y.getFocusableElements(this).forEach(e=>{e.addEventListener("focusin",s=>{if(null!==s.relatedTarget){if(e.closest(".swiper-slide")){const s=e.closest(".swiper-slide");this.sliderInstance.slider.slideTo(this.sliderInstance.slider.slides.indexOf(s))}}else e.blur()})})}destroySlider(){this.elements.productsWrap.classList.remove(this.classes.swiper),this.elements.products.classList.remove(this.classes.swiperWrapper),this.elements.products.classList.add(this.classes.grid),"object"==typeof this.sliderInstance&&(this.sliderInstance.slider.destroy(),this.sliderInstance=!1)}fixQuickviewDuplicate(){let e=[];Array.from(this.querySelectorAll("quick-view-modal")).forEach(s=>{const t=s.getAttribute("id");e.includes(t)?s.remove():e.push(t)})}}); 2//# sourceMappingURL=product-slider.js.map
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.