!function(n){n.each(["frontend/element_ready/wd_products.default","frontend/element_ready/wd_products_tabs.default"],function(e,o){woodmartThemeModule.wdElementorAddAction(o,function(){woodmartThemeModule.quickViewInit()})}),woodmartThemeModule.$document.on("wdReplaceMainGallery",function(){woodmartThemeModule.quickViewCarousel()}),woodmartThemeModule.quickViewInit=function(){woodmartThemeModule.$document.on("click",".open-quick-view",function(e){if(e.preventDefault(),n(".open-quick-view").hasClass("loading"))return!0;var e=n(this),o=e.data("id"),t=e.data("loop-name"),i=e.data("loop"),a="",d="",t=n(".quick-view").find('[data-loop-name="'+t+'"]');e.addClass("loading"),void 0!==t[i-1]&&(a=t.eq(i-1).addClass("quick-view-prev"),a=n("<div>").append(a.clone()).html()),void 0!==t[i+1]&&(d=t.eq(i+1).addClass("quick-view-next"),d=n("<div>").append(d.clone()).html()),woodmartThemeModule.quickViewLoad(o,e,a,d)})},woodmartThemeModule.quickViewCarousel=function(){var e;void 0!==n.fn.owlCarousel&&((e=n(".product-quick-view .woocommerce-product-gallery__wrapper")).trigger("destroy.owl.carousel"),e.addClass("owl-carousel wd-owl").owlCarousel({rtl:woodmartThemeModule.$body.hasClass("rtl"),items:1,dots:!1,nav:!0,navText:!1,navClass:["owl-prev wd-btn-arrow","owl-next wd-btn-arrow"]}))},woodmartThemeModule.quickViewLoad=function(e,o){function t(e){e=n(e),n.magnificPopup.open({items:{src:e,type:"inline"},tClose:woodmart_settings.close,tLoading:woodmart_settings.loading,removalDelay:500,callbacks:{beforeOpen:function(){this.st.mainClass="mfp-move-horizontal quick-view-wrapper"},open:function(){var e=n(this.content[0]).find(".variations_form");e.each(function(){n(this).wc_variation_form().find(".variations select:eq(0)").trigger("change")}),e.trigger("wc_variation_form"),woodmartThemeModule.$body.trigger("woodmart-quick-view-displayed"),woodmartThemeModule.$document.trigger("wdQuickViewOpen"),setTimeout(function(){woodmartThemeModule.$document.trigger("wdQuickViewOpen300")},300),woodmartThemeModule.quickViewCarousel()}}})}e={id:e,action:"woodmart_quick_view"};void 0!==o.data("attribute")&&n.extend(e,o.data("attribute"));n.ajax({url:woodmart_settings.ajaxurl,data:e,method:"get",success:function(e){woodmartThemeModule.removeDuplicatedStylesFromHTML(e,function(e){woodmart_settings.quickview_in_popup_fix?(n.magnificPopup.close(),setTimeout(function(){t(e)},500)):t(e)})},complete:function(){o.removeClass("loading")}})},n(document).ready(function(){woodmartThemeModule.quickViewInit(),woodmartThemeModule.quickViewCarousel()})}(jQuery);