jQuery((function($){"use strict";$("body").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).parent(".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)}))}})),$(".wpsp-product-section").each((function(){var custom_id=$(this).attr("id"),_this=$(this),layout_preset=_this.data("layout"),slider_mode;if(""!=custom_id&&"slider"==layout_preset)if("ticker"==_this.data("mode")){var ticker=_this.data("ticker"),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";jQuery("#"+custom_id).bxSlider({mode:"horizontal",slideMargin:slideMargin,infiniteLoop:!0,slideWidth:slideWidth,minSlides:minColumn,maxSlides:maxColumn,speed:speed,tickerHover:pauseOnHover,ticker:!0,autoDirection:direction})}else jQuery("#"+custom_id).slick({prevArrow:'
',nextArrow:'
'});if(""!=custom_id&&"grid"==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",zoom:{enabled:!0,duration:300,opener:function(element){return element.find("img")}}})}"1"==lightbox&&wpsproLightbox();var pagination_type=_this.data("pagination"),appendClass="#"+custom_id+" .wpsp-product";if(""!=custom_id&&"grid"==layout_preset)if("ajax_number"==pagination_type)$(".wpsp-slider-section .wpspro-preloader").hide(),$("#wpsp-slider-section").on("click",".wpspro-pagination.wpspro-ajax-num-pagination a",(function(e){e.preventDefault();var link=$(this).attr("href");history.pushState(null,null,link),$("#wpsp-slider-section").animate({opacity:1},400,(function(){$(".wpsp-slider-section .wpspro-preloader").show(),$(this).load(link+" #wpsp-slider-section",(function(){$(this).animate({opacity:1},400),$(".wpsp-slider-section .wpspro-preloader").hide(),"1"==lightbox&&wpsproLightbox()}))}))}));else if("load_more_scroll"==pagination_type||"load_more_btn"==pagination_type){var loadOnScroll="load_more_btn"!=pagination_type;$("#"+custom_id+".wpsp-product-section").infiniteScroll({path:"."+custom_id+" .next.page-numbers",append:appendClass,scrollThreshold:100,history:!1,status:"."+custom_id+" .page-load-status",button:"."+custom_id+" .wpspro-item-load-more",loadOnScroll:loadOnScroll,outlayer:msnry,onInit:function(){this.on("append",(function(){"1"==lightbox&&wpsproLightbox()}))}})}}))}));