jQuery((function($){"use strict";function remove_class_property(){$("body").find(".wpsp-product-section").each((function(){var _this=$(this),custom_id=$(this).attr("id");$(this).removeClass("wpsp-custom-product-section");var parents_class=$("#"+custom_id).parents(".wpsp-slider-section");$(parents_class).removeClass("wpsp-custom-slider-section"),$("#"+custom_id).children(".wpsp-product").css("flex","none")}))}function setSameHeight(productImage){for(var maxHeight=0,i=0;i<productImage.length;i++)maxHeight<$(productImage[i]).outerHeight()&&(maxHeight=$(productImage[i]).outerHeight());for(var i=0;i<productImage.length;i++)$(productImage[i]).outerHeight(maxHeight)}$(document).find(".wpsp-product-section").each((function(){var _this=$(this),custom_id=$(this).attr("id"),preloader;if("1"==_this.data("preloader")){var parents_class,parents_siblings_id=$("#"+custom_id).parents(".wpsp-slider-section").find(".wpspro-preloader").attr("id");$(document).ready((function(){$("#"+parents_siblings_id).animate({opacity:1},600).hide(),$("#"+custom_id).animate({opacity:1},600)}))}})),remove_class_property(),$(document).find(".wpsp-product-section").each((function(){var custom_id=$(this).attr("id"),wrapper_id="#"+custom_id,parents_class=$("#"+custom_id).parent(".wpsp-slider-section"),_this=$(this);$(wrapper_id).parents(".woocommerce ul.products, .woocommerce-page ul.products, .dt-css-grid").css("display","block");var layout_preset=_this.data("layout"),wspSwiper,tickerSlider;function slider_init(){if(""!=custom_id&&("ticker"==layout_preset||"slider"==layout_preset||"multi-row"==layout_preset)){var slider_mode=_this.data("mode"),sliderData=_this.data("swiper"),custom_swiper=wpspro_vars.swiper;if("ticker"==layout_preset){$(".wpsp-product img").removeAttr("loading"),$("body").hasClass("rtl")&&$(".wpsp-slider-section .bx-viewport").css("direction","ltr");var ticker=_this.data("ticker"),mode=ticker.mode,pauseOnHover=ticker.pauseOnHover,speed=ticker.speed,slideWidth=ticker.slideWidth,maxColumn=ticker.maxColumn,slideMargin=ticker.slideMargin,minColumn=ticker.minColumn,rtl=ticker.rtl,speed=_this.find(".wpsp-product, .wpsp-cat-item").length*speed;if(1==rtl)var direction="prev";else var direction="next";tickerSlider=jQuery("#"+custom_id).bxSlider({mode:mode,slideMargin:slideMargin,infiniteLoop:!0,slideWidth:slideWidth,minSlides:minColumn,maxSlides:maxColumn,speed:speed,tickerHover:pauseOnHover,ticker:!0,autoDirection:direction})}else{if("fade"===sliderData.effect){function fade_effect(slidesPerView){for(var fade_items=$("#"+custom_id+" .swiper-wrapper >.single-item-fade"),i=0;i<fade_items.length;i+=slidesPerView)fade_items.slice(i,i+slidesPerView).wrapAll('<div class="wpsp-product swiper-slide"><div class="wpsp-fade-wrapper"></div>');$("#"+custom_id+" .wpsp-fade-wrapper").each((function(){var empty_items=slidesPerView-$(this).find(".single-item-fade").length;if(empty_items>0)for(let i=0;i<empty_items;i++)$(this).append('<div class="wpsp-product single-item-fade" style="width:'+100/slidesPerView+"%; flex-basis:"+100/slidesPerView+'%;"></div>')})),$(fade_items).css("width",100/slidesPerView+"%"),$(fade_items).css("flex","1 0 "+100/slidesPerView+"%")}$(window).width()>sliderData.responsive.desktop?fade_effect(sliderData.slidesPerView.lg_desktop):$(window).width()>sliderData.responsive.tablet?fade_effect(sliderData.slidesPerView.desktop):$(window).width()>sliderData.responsive.mobile?fade_effect(sliderData.slidesPerView.tablet):$(window).width()>0&&fade_effect(sliderData.slidesPerView.mobile);var wspSwiper_options={slidesPerGroup:1,loop:1===sliderData.rows.mobile&&sliderData.infinite,slidesPerView:1,spaceBetween:sliderData.spaceBetween,autoplay:!!sliderData.autoplay&&{delay:sliderData.autoplaySpeed,disableOnInteraction:!1},speed:sliderData.speed,simulateTouch:sliderData.draggable,allowTouchMove:sliderData.swipe,freeMode:sliderData.freeMode,mousewheel:sliderData.mousewheel,autoHeight:1===sliderData.rows.mobile&&sliderData.adaptiveHeight,updateOnWindowResize:!0,grid:{rows:sliderData.rows.mobile},keyboard:{enabled:sliderData.carousel_accessibility},preloadImages:"false"!==sliderData.lazyLoad,lazy:{loadPrevNext:"false"!==sliderData.lazyLoad,loadPrevNextAmount:2,elementClass:"wpsp-lazy",loadedClass:"wpsp-lazy-loaded"},touchReleaseOnEdges:!0,watchSlidesProgress:!0,watchSlidesVisibility:!0,effect:"fade",fadeEffect:{crossFade:!0},grabCursor:!0,pagination:1==sliderData.dots&&"scrollbar"!==sliderData.pagination_type&&{el:"#"+custom_id+" .wpsp-pagination-dot",clickable:!0,dynamicBullets:"dynamic"==sliderData.pagination_type,renderBullet:function(index,className){return"number"===sliderData.pagination_type?'<span class="'+className+'"><span class="number">'+(index+1)+"</span> </span>":'<span class="'+className+'"></span>'}},scrollbar:{el:"#"+custom_id+" .wpsp-pagination-scrollbar",draggable:!0,dragSize:50},navigation:{nextEl:"#"+custom_id+" .wpsp-nav.swiper-button-next",prevEl:"#"+custom_id+" .wpsp-nav.swiper-button-prev"},breakpoints:{[sliderData.responsive.mobile]:{grid:{rows:sliderData.rows.tablet},loop:1===sliderData.rows.tablet&&sliderData.infinite,autoHeight:1===sliderData.rows.tablet&&sliderData.adaptiveHeight},[sliderData.responsive.tablet]:{grid:{rows:sliderData.rows.desktop},loop:1===sliderData.rows.desktop&&sliderData.infinite,autoHeight:1===sliderData.rows.desktop&&sliderData.adaptiveHeight},[sliderData.responsive.desktop]:{grid:{rows:sliderData.rows.lg_desktop},loop:1===sliderData.rows.lg_desktop&&sliderData.infinite,autoHeight:1===sliderData.rows.lg_desktop&&sliderData.adaptiveHeight}}}}else var carousel_items=$("#"+custom_id).find(".swiper-slide:not(.swiper-slide-duplicate)").length,dragScrollSize=$("#"+custom_id).find(".swiper-wrapper").width()/carousel_items,wspSwiper_options={centeredSlides:sliderData.centeredSlides,direction:sliderData.carousel_orientation,slidesPerGroup:sliderData.slidesToScroll.mobile,loop:1===sliderData.rows.mobile&&sliderData.infinite,slidesPerView:sliderData.slidesPerView.mobile,spaceBetween:sliderData.spaceBetween,autoplay:!!sliderData.autoplay&&{delay:sliderData.autoplaySpeed,disableOnInteraction:!1},speed:sliderData.speed,simulateTouch:sliderData.draggable,allowTouchMove:sliderData.swipe,freeMode:sliderData.freeMode,mousewheel:sliderData.mousewheel,grabCursor:!0,updateOnWindowResize:!0,grid:{rows:sliderData.rows.mobile},preloadImages:"false"!==sliderData.lazyLoad,lazy:{loadPrevNext:"false"!==sliderData.lazyLoad,loadPrevNextAmount:2,elementClass:"wpsp-lazy",loadedClass:"wpsp-lazy-loaded"},touchReleaseOnEdges:!0,watchSlidesProgress:!0,watchSlidesVisibility:!0,effect:sliderData.effect,fadeEffect:{crossFade:!0},grabCursor:!0,autoHeight:1===sliderData.rows.mobile&&sliderData.adaptiveHeight,keyboard:{enabled:sliderData.carousel_accessibility},pagination:1==sliderData.dots&&"scrollbar"!==sliderData.pagination_type&&{el:"#"+custom_id+" .wpsp-pagination-dot",clickable:!0,dynamicBullets:"dynamic"==sliderData.pagination_type,renderBullet:function(index,className){return"number"===sliderData.pagination_type?'<span class="'+className+'"><span class="number">'+(index+1)+"</span> </span>":'<span class="'+className+'"></span>'}},navigation:{nextEl:"#"+custom_id+" .wpsp-nav.swiper-button-next",prevEl:"#"+custom_id+" .wpsp-nav.swiper-button-prev"},breakpoints:{[sliderData.responsive.mobile]:{slidesPerView:sliderData.slidesPerView.tablet,slidesPerGroup:sliderData.slidesToScroll.tablet,grid:{rows:sliderData.rows.tablet},loop:1===sliderData.rows.tablet&&sliderData.infinite,autoHeight:1===sliderData.rows.tablet&&sliderData.adaptiveHeight},[sliderData.responsive.tablet]:{slidesPerView:sliderData.slidesPerView.desktop,slidesPerGroup:sliderData.slidesToScroll.desktop,grid:{rows:sliderData.rows.desktop},loop:1===sliderData.rows.desktop&&sliderData.infinite,autoHeight:1===sliderData.rows.desktop&&sliderData.adaptiveHeight},[sliderData.responsive.desktop]:{slidesPerView:sliderData.slidesPerView.lg_desktop,slidesPerGroup:sliderData.slidesToScroll.lg_desktop,grid:{rows:sliderData.rows.lg_desktop},loop:1===sliderData.rows.lg_desktop&&sliderData.infinite,autoHeight:1===sliderData.rows.lg_desktop&&sliderData.adaptiveHeight}},scrollbar:{el:"#"+custom_id+" .wpsp-pagination-scrollbar",draggable:!0,dragSize:dragScrollSize}};function vertical_layout(slidesPerView){if("vertical"===sliderData.carousel_orientation){var verticalMargin=1!=slidesPerView?20*slidesPerView:0,verticalSlideToShow=slidesPerView,verticalItemHeight="";$("#"+custom_id+" .wpspro-product-data").each((function(){$(this).height()>verticalItemHeight&&(verticalItemHeight=$(this).outerHeight())})),verticalItemHeight=verticalItemHeight*verticalSlideToShow+verticalMargin,$("#"+custom_id).css("height",verticalItemHeight+"px")}}wspSwiper=custom_swiper?new WPSSwiper("#"+custom_id,wspSwiper_options):new Swiper("#"+custom_id,wspSwiper_options),sliderData.pauseOnHover&&sliderData.autoplay&&$("#"+custom_id).on({mouseenter:function(){wspSwiper.autoplay.stop()},mouseleave:function(){wspSwiper.autoplay.start()}}),"vertical"===sliderData.carousel_orientation&&($(window).width()>sliderData.responsive.desktop?vertical_layout(sliderData.slidesPerView.lg_desktop):$(window).width()>sliderData.responsive.tablet?vertical_layout(sliderData.slidesPerView.desktop):$(window).width()>sliderData.responsive.mobile?vertical_layout(sliderData.slidesPerView.tablet):$(window).width()>0&&vertical_layout(sliderData.slidesPerView.mobile))}}var navigationParentsWrapper=$("#"+custom_id).parents(".wpsp-slider-section");if(navigationParentsWrapper.hasClass("navigation_position_vertical_center")||navigationParentsWrapper.hasClass("navigation_position_vertical_outer")||navigationParentsWrapper.hasClass("navigation_position_vertical_center_inner")){var title_h=$("#"+custom_id).parents(".wpsp-slider-section").find(".sp-woo-product-slider-pro-section-title").length>0?$("#"+custom_id).parents(".wpsp-slider-section").find(".sp-woo-product-slider-pro-section-title").height():-5;title_h+=title_h/2;var search_h=$("#"+custom_id).parents(".wpsp-slider-section").find(".wpsp-search").length>0?$("#"+custom_id).parents(".wpsp-slider-section").find(".wpsp-search").height():-5;search_h+=search_h/2;var filter_h=$("#"+custom_id).parents(".wpsp-slider-section").find(".sp-wsp-live-filter").length>0?$("#"+custom_id).parents(".wpsp-slider-section").find(".sp-wsp-live-filter").height()+21:-5;filter_h+=filter_h/2;var navTop=$("#"+custom_id+":not(.swiper-vertical)").find(".swiper-wrapper").height();$("#"+custom_id+":not(.swiper-vertical)").find(".wpsp-nav").css("top",navTop/2+title_h+search_h+filter_h+(sliderData.spaceBetween+-5)+"px").css("transform","translateY(0)"),setTimeout((function(){$("#"+custom_id+":not(.swiper-vertical)").find(".wpsp-nav").css("visibility","visible")}),200)}}function same_height_item(){var parent_attr;if($("#"+custom_id).parents(".sp_wpsp_item_same_height").length>0){var productImage=$(wrapper_id+" .wpsp-masonry-item .wpspro-product-data"),productImageWrapper=$(wrapper_id+" .wpsp-masonry-item .wpspro-product-data .wpsp-product-image"),productDetailsWrapper=$(wrapper_id+" .wpsp-masonry-item .product-details");$(wrapper_id).parents(".wpsp_category_slider").length>0&&(productImage=$(wrapper_id+" .wpsp-masonry-item .wpspro-cat-data"),productImageWrapper=$(wrapper_id+" .wpsp-masonry-item .wpspro-cat-data .wpsp-cat-link")),setTimeout((function(){setSameHeight(productImageWrapper),setSameHeight(productDetailsWrapper),setSameHeight(productImage)}),100)}}if(slider_init(),same_height_item(),""!=custom_id&&"masonry"==layout_preset)var $grid_masonry,msnry=$(".grid_style_masonry .wpsp-product-section#"+custom_id).masonry({itemSelector:"div.wpsp-masonry-item"}).data("masonry");var lightbox=_this.data("lightbox");function wpsproLightbox(){$("#"+custom_id+" .wpsp-product").magnificPopup({delegate:"a.sp-wpsp-lightbox",type:"image",closeOnContentClick:!1,closeBtnInside:!1,mainClass:"mfp-with-zoom mfp-img-mobile wpsp-image-light-box",zoom:{enabled:!0,duration:300,opener:function(element){return element.find("img")}},callbacks:{open:function(){setTimeout((function(){$(document).find(".elementor-lightbox").remove()}),1e3)}}})}"1"==lightbox&&wpsproLightbox();var pagination_type=_this.data("pagination");function ajax_pagination(wsp_filter_slug="",search_value=""){let count=0;if(jQuery("."+custom_id+" .wpspro-item-load-more > span").on("click",(function(e){e.preventDefault(),e.stopPropagation();var $this=$(this),shortcodeId=$this.parents(".wpsp-slider-section").data("id"),total_product=$this.data("total"),page=$this.data("page")+1,total_items=$this.parents(".wpspro-item-load-more").data("load_more_items"),per_page_item=$this.parents(".wpspro-item-load-more").data("load_per_page"),end_text=$this.parents(".wpspro-item-load-more").data("text");$this.attr("data-wps-processing",1),jQuery("."+custom_id).find(".wpspro-item-load-more").before('<div class="sp-wps-infinite-scroll-loader"><svg width="44" height="44" viewBox="0 0 44 44" xmlns="http://www.w3.org/2000/svg" stroke="#444"><g fill="none" fill-rule="evenodd" stroke-width="2"><circle cx="22" cy="22" r="1"><animate attributeName="r" begin="0s" dur="1.8s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" repeatCount="indefinite" /> <animate attributeName="stroke-opacity" begin="0s" dur="1.8s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" repeatCount="indefinite" /> </circle> <circle cx="22" cy="22" r="1"> <animate attributeName="r" begin="-0.9s" dur="1.8s" values="1; 20" calcMode="spline" keyTimes="0; 1" keySplines="0.165, 0.84, 0.44, 1" repeatCount="indefinite" /> <animate attributeName="stroke-opacity" begin="-0.9s" dur="1.8s" values="1; 0" calcMode="spline" keyTimes="0; 1" keySplines="0.3, 0.61, 0.355, 1" repeatCount="indefinite"/></circle></g></svg></div>');var is_shop=$("body").hasClass("archive")&&$("body").hasClass("post-type-archive-product")||$("body").hasClass("tax-product_cat")||$("body").hasClass("tax-product_tag");$.ajax({type:"POST",url:wpspro_vars.ajax_url,data:{value:search_value,slug:wsp_filter_slug,generator_id:shortcodeId,is_shop:is_shop,page:page,action:"spwps_ajax_search_items",nonce:wpspro_vars.nonce},success:function(response){var $data=$(response);$this.data("page",page),total_product<=page*per_page_item&&$("."+custom_id).find(".wpspro-item-load-more").html(end_text).show(),$this.attr("data-wps-processing",0),jQuery("."+custom_id).find(".sp-wps-infinite-scroll-loader").remove();var product_data=$("#"+custom_id+".wpsp-table-layout table tbody, #"+custom_id+".wpsp-product-section:not(.wpsp-table-layout,.swiper-container)"),scrollTop=$(window).scrollTop();if(""!=custom_id&&"masonry"==layout_preset){var masonryContainer=$(".wpsp-slider-section"+shortcodeId+".grid_style_masonry .wpsp-product-section#"+custom_id);masonryContainer.masonry("destroy"),masonryContainer.append($data).imagesLoaded((function(){masonryContainer.masonry("reloadItems"),masonryContainer.masonry(),$(window).scrollTop(scrollTop)}))}else product_data.append(response),$(window).scrollTop(scrollTop);"1"==lightbox&&wpsproLightbox(),same_height_item(),wpcp_lazyload();var pagination_wrapper=$(document).find("#"+custom_id+" .sp-wps-ajax-live-filter-pagination");if(pagination_wrapper.length>0&&($("#"+custom_id+" .wps-ajax-pagination-wrapper").replaceWith(pagination_wrapper.html()),pagination_wrapper.remove()),"load_more_btn"==pagination_type){count+=1;const items=total_items-per_page_item*count;$(".wpspro-item-load-more","."+custom_id).find("span.wpsp-count-product").html("("+items+")");const viewed_items=per_page_item*(count+1);total_items+per_page_item>viewed_items?$(".notice-load-more-post","."+custom_id).find(".load-more-items-have").html(viewed_items):$(".notice-load-more-post","."+custom_id).css("display","none"),items<=0&&$("."+custom_id).find(".wpspro-item-load-more").html(end_text)}product_data.animate({opacity:"1"},"slow"),document.dispatchEvent(new CustomEvent("sp-wps-ajax-completed"))}}),e.stopImmediatePropagation()})),"load_more_scroll"==pagination_type){var bufferBefore=Math.abs(20);$("."+custom_id).find(".wpspro-item-load-more").hide(),$(window).scroll((function(){var TopAndContent,areaLeft;$("."+custom_id).find(".wpsp-product-section").length&&($("."+custom_id).find(".wpsp-product-section").offset().top+$("."+custom_id).find(".wpsp-product-section").outerHeight()-$(window).scrollTop()-bufferBefore<$(window).height()&&0==$("."+custom_id).find(".wpspro-item-load-more > span").attr("data-wps-processing")&&$("."+custom_id).find(".wpspro-item-load-more > span").trigger("click"))}))}"ajax_number"==pagination_type&&(jQuery("."+custom_id).find(".sp-wps-pagination-number a:nth-child(2)").addClass("active"),$(".prev","."+custom_id).hide(),jQuery("."+custom_id).find(".sp-wps-pagination-number a").on("click",(function(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();var $this=$(this),wsp_filter_slug=$this.parents(".wpsp-slider-section").find(".sp-wsp-button-wrapper .is-checked").data("slug"),shortcodeId=$this.parents(".wpsp-slider-section").data("id"),page=$this.data("page")+1,page=$this.data("page")-1,total_product=$(this).parents(".sp-wps-pagination-number").data("total");if($this.hasClass("next")){var page=jQuery("."+custom_id).find(".sp-wps-pagination-number a.active:not(.next, .prev)").data("page")-1;page++}if($this.hasClass("prev")){var page=jQuery("."+custom_id).find(".sp-wps-pagination-number a.active:not(.next, .prev)").data("page")-1;page--}var is_shop=$("body").hasClass("archive")&&$("body").hasClass("post-type-archive-product")||$("body").hasClass("tax-product_cat")||$("body").hasClass("tax-product_tag");$.ajax({type:"POST",url:wpspro_vars.ajax_url,data:{value:search_value,slug:wsp_filter_slug,generator_id:shortcodeId,is_shop:is_shop,page:page+1,action:"spwps_ajax_search_items",nonce:wpspro_vars.nonce},success:function(response){var $data=$(response),product_data=$("#"+custom_id+".wpsp-table-layout table tbody, #"+custom_id+".wpsp-product-section:not(.wpsp-table-layout,.swiper-container)");if(""!=custom_id&&"masonry"==layout_preset){var masonryContainer=$(".wpsp-slider-section"+shortcodeId+".grid_style_masonry .wpsp-product-section#"+custom_id);masonryContainer.masonry("destroy"),masonryContainer.html($data).imagesLoaded((function(){masonryContainer.masonry()}))}else product_data.html(response);"1"==lightbox&&wpsproLightbox(),same_height_item(),wpcp_lazyload(),jQuery("."+custom_id).find(".sp-wps-pagination-number a").removeClass("active"),page++,$(".sp-wps-page-numbers","."+custom_id).each((function(){jQuery("."+custom_id).find(".sp-wps-pagination-number a[data-page="+page+"]").addClass("active")})),$(".sp-wps-pagination-number a.active","."+custom_id).each((function(){parseInt($(this).data("page"))===Math.ceil(total_product)?$(".next","."+custom_id).hide():$(".next","."+custom_id).show(),jQuery("."+custom_id).find(".sp-wps-pagination-number a:nth-child(2)").hasClass("active")?$(".prev","."+custom_id).hide():$(".prev","."+custom_id).show()})),document.dispatchEvent(new CustomEvent("sp-wps-ajax-completed"))}})})))}function makeDelay(fn,ms){let timer=0;return function(...args){clearTimeout(timer),timer=setTimeout(fn.bind(this,...args),ms||0)}}ajax_pagination(),$(".wpspro_quantity .wpspro_input_text").on("change",(function(){var new_quantity=$(this).val(),selector;$(this).parents(".wpsp-cart-button").find(".product_type_simple.add_to_cart_button")[0].setAttribute("data-quantity",new_quantity)}));var main_wrapper=$(wrapper_id).parents("#wpsp-slider-section-wrapper"),shortcodeId=main_wrapper.data("id"),ajaxCache={};function ajax_live_filter(wsp_filter_slug="",search_value=""){var cacheKey=wsp_filter_slug+"|"+search_value;const $productSection=$("#"+custom_id+".wpsp-product-section"),$productNav=$productSection.find(".wpsp-nav");if($productNav.css("opacity",0),ajaxCache[cacheKey])return updateProductData(ajaxCache[cacheKey],search_value,wsp_filter_slug),void setTimeout(()=>{$productNav.css("opacity",1)},500);var is_shop=$("body").hasClass("archive")&&$("body").hasClass("post-type-archive-product")||$("body").hasClass("tax-product_cat")||$("body").hasClass("tax-product_tag");$.ajax({type:"POST",url:wpspro_vars.ajax_url,data:{value:search_value,slug:wsp_filter_slug,generator_id:shortcodeId,is_shop:is_shop,page:1,action:"spwps_ajax_search_items",nonce:wpspro_vars.nonce},success:function(response){var $data=$(response);ajaxCache[cacheKey]=$data,updateProductData($data,search_value,wsp_filter_slug),setTimeout(()=>{$productNav.css("opacity",1),document.dispatchEvent(new CustomEvent("sp-wps-ajax-completed"))},500)}})}function updateProductData(data,search_value,wsp_filter_slug){var product_data=$("#"+custom_id+".wpsp-product-section:not(.wpsp-table-layout,.swiper-container),#"+custom_id+".wpsp-product-section:not(.wpsp-table-layout) .swiper-wrapper");"slider"===layout_preset&&""!==custom_id&&wspSwiper.destroy(),product_data.html(data),slider_init(),wpcp_lazyload(),same_height_item(),$(document).ready((function(){var pagination_wrapper=$("."+custom_id+" .sp-wps-ajax-live-filter-pagination"),pagination=$("."+custom_id+" .wps-ajax-pagination-wrapper,.sp-wps-ajax-number-pagination");if(pagination_wrapper.length>0){pagination.css("display","block");var pagination_html=pagination_wrapper.html();pagination.html(pagination_html),pagination_wrapper.remove()}else pagination.css("display","none");ajax_pagination(wsp_filter_slug,search_value)}));for(var list=$("."+custom_id+" .wpsp-product"),delay=0,i=0;i<list.length;++i)list[i].style.animationDelay=delay+"s",delay+=.06}function wpcp_lazyload(){var $enable_lazyLoad;$("."+custom_id+" img").hasClass("wpsp-lazy")&&""!=custom_id&&"slider"!==layout_preset&&$(window).ready((function(){$("."+custom_id+" img.wpsp-lazy").wpsp_lazyload({effect:"fadeIn",effectTime:2e3,appear:function(){$(this).attr("srcset",$(this).attr("data-srcset")),$(this).removeAttr("data-srcset"),$(this).removeClass("wpsp-lazy").addClass("wpsp-lazy-loaded")}})}))}main_wrapper.find(".sp-wsp-live-filter.filters-button-group").on("click","button",(function(event){var $buttonGroup,wsp_filter_slug;event.preventDefault(),main_wrapper.find(".filters-button-group").find(".is-checked").removeClass("is-checked"),$(this).addClass("is-checked"),ajax_live_filter($(this).data("slug"),"")})),main_wrapper.find(".sp-wsp-filter-select").on("change",(function(e){var wsp_filter_slug;e.preventDefault(),ajax_live_filter($(this).val(),"")})),main_wrapper.on("keyup",".wpsp-search input",makeDelay((function(){var search_value=$(this).val(),wsp_filter_slug;ajax_live_filter(main_wrapper.find(".sp-wsp-live-filter.filters-button-group .is-checked").data("slug"),search_value)}),500)),wpcp_lazyload(),$(".sp-wpsp-grid").find(".wpsp-product").removeAttr("style"),$(this).addClass("wpsp-product-section-loaded")})),$(document).ajaxComplete((function(event,xhr,settings){settings.url&&-1!==settings.url.indexOf("wpf_")&&$(".wpspro-preloader").remove()}))}));