function initSelect2(){"use strict";$j(".woocommerce-ordering .orderby, #calc_shipping_country, #dropdown_product_cat, select#calc_shipping_state").select2({minimumResultsForSearch:-1}),$j(".woocommerce-account .country_select, .woocommerce .product .summary select").select2()}function initAddToCartPlusMinus(){"use strict";$j(document).on("click",".quantity .plus, .quantity .minus",function(){var e=$j(this).closest(".quantity").find(".qty"),t=parseFloat(e.val()),o=parseFloat(e.attr("max")),a=parseFloat(e.attr("min")),i=e.attr("step");t&&""!==t&&"NaN"!==t||(t=0),""!==o&&"NaN"!==o||(o=""),""!==a&&"NaN"!==a||(a=0),"any"!==i&&""!==i&&void 0!==i&&"NaN"!==parseFloat(i)||(i=1),$j(this).is(".plus")?o&&(o==t||t>o)?e.val(o):e.val(t+parseFloat(i)):a&&(a==t||t0&&e.val(t-parseFloat(i)),e.trigger("change")})}function qodeInitSingleProductLightbox(){"use strict";var e=$j(".woocommerce.single-product .product .images:not(.qode-add-gallery-and-zoom-support) .woocommerce-product-gallery__image");e.length&&e.each(function(){$j(this).children("a").attr("data-rel","prettyPhoto[woo_single_pretty_photo]"),$j("a[data-rel]").each(function(){$j(this).attr("rel",$j(this).data("rel"))}),$j("a[rel^='prettyPhoto']").prettyPhoto({animation_speed:"normal",slideshow:!1,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,horizontal_padding:0,default_width:650,default_height:400,counter_separator_label:"/",theme:"pp_default",hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,overlay_gallery:!1,keyboard_shortcuts:!0,deeplinking:!1,social_tools:!1})})}function qodeWishlistRefresh(){var e=function(){$j.ajax({url:QodeAdminAjax.ajaxurl,type:"POST",data:{action:"qode_product_ajax_wishlist"},success:function(e){$j(".qode-wishlist-widget-holder .qode-wishlist-items-number span").html(e.wishlist_count_products)}})};return{init:function(){qode_body.on("added_to_wishlist",function(){e()}),$j("#yith-wcwl-form").on("click",".product-remove a, .product-add-to-cart a",function(){setTimeout(function(){e()},2e3)})}}}function qodeQuickViewGallery(){var e=function(){var e=$j(".qode-quick-view-gallery.qode-owl-slider");e.length&&e.each(function(){var e=$j(this);e.owlCarousel({items:1,loop:!0,autoplay:!1,smartSpeed:600,margin:0,center:!1,autoWidth:!1,animateIn:!1,animateOut:!1,dots:!1,nav:!0,navText:['',''],onInitialize:function(){e.css("visibility","visible")}})})};return{init:function(){$j(document).on("qv_loader_stop",function(){e(),$j(".yith-wcqv-wrapper").css("top",$scroll+20)})}}}function qodeQuickViewSelect2(){$j(document).on("qv_loader_stop",function(){$j("#yith-quick-view-modal select").select2()})}function qodeInitProductListElegantFilter(){var e=$j(".qode-elegant-pl-holder"),t={},o=function(e){e.find(".qode-pl-categories a, .qode-pl-ordering a").on("click",function(t){t.preventDefault(),t.stopPropagation();var o=$j(this);o.hasClass("active")||r(e,o)})},a=function(e,t,o){e.html(o),t.fadeOut()},i=function(e,t){for(var o in t)e[o]=t[o];switch(e.ordering){case"menu_order":e.metaKey="",e.order="asc",e.orderby="menu_order title";break;case"popularity":e.metaKey="total_sales",e.order="desc",e.orderby="meta_value_num";break;case"rating":e.metaKey="_wc_average_rating",e.order="desc",e.orderby="meta_value_num";break;case"newness":e.metaKey="",e.order="desc",e.orderby="date";break;case"price":e.metaKey="_price",e.order="asc",e.orderby="meta_value_num";break;case"price-desc":e.metaKey="_price",e.order="desc",e.orderby="meta_value_num"}return e},r=function(e,o){var r=e.find(".qode-pl-outer"),n=qode.modules.common.getLoadMoreData(e),d=e.find(".qode-prl-loading");i(t,o.data()),n.category=void 0!==t.category?t.category:"",n.metaKey=void 0!==t.metaKey?t.metaKey:"",n.order=void 0!==t.order?t.order:"",n.orderby=void 0!==t.orderby?t.orderby:"",n.minPrice=void 0!==t.minprice?t.minprice:"",n.maxPrice=void 0!==t.maxprice?t.maxprice:"",d.fadeIn();var c=qode.modules.common.setLoadMoreAjaxData(n,"qode_product_ajax_load_category");$j.ajax({type:"POST",data:c,url:QodeAdminAjax.ajaxurl,success:function(t){var i=$j.parseJSON(t),n=i.html;e.waitForImages(function(){o.parent().siblings().find("a").removeClass("active"),o.addClass("active"),a(r,d,n)})}})},n=function(e,t){e.on("click",function(){$window_width<=768&&(e.hasClass("opened")?(e.removeClass("opened"),t.slideUp()):(e.addClass("opened"),t.slideDown()))})};return{init:function(){e.length&&e.each(function(){var e=$j(this);o(e),n(e.find(".qode-pl-ordering-outer p"),e.find(".qode-pl-ordering")),n(e.find(".qode-pl-categories-label"),e.find(".qode-pl-categories-label").next("ul"))})}}}$j(document).ready(function(){"use strict";$j(".price_slider_wrapper").parents(".widget").addClass("widget_price_filter"),initSelect2(),initAddToCartPlusMinus(),qodeInitSingleProductLightbox(),qodeWishlistRefresh().init(),qodeQuickViewGallery().init(),qodeQuickViewSelect2(),qodeInitProductListElegantFilter().init()});