%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/infra/betheme/betheme/js/
Upload File :
Create Path :
Current File : //home/infra/betheme/betheme/js/woocommerce.min.js

!function(e){e(document).ready((function(){function i(){e(".woocommerce .column_shop_products ul.products.list li.product").each((function(){e(this).css({"min-height":"1px"});var t=e(this).outerHeight(),o=e(this).find(".product-loop-thumb").outerHeight();o>t&&e(this).css({"min-height":o})}))}function s(){let t=[];var o=function(){var t=window.location.pathname,o="";o=t.includes("/page/")?t.split("/page/")[0]:t;e("body").hasClass("archive")||(o=e("form.mfn_attr_filters").attr("action"));return o}();e("form.mfn_attr_filters").each((function(){t.push(e(this).formData())})),e("form.woocommerce-ordering").length&&(e('form.woocommerce-ordering input[name="post_type"]').length&&t.push("post_type="+e('form.woocommerce-ordering input[name="post_type"]').val()),e('form.woocommerce-ordering input[name="s"]').length&&t.push("s="+e('form.woocommerce-ordering input[name="s"]').val()),e('form.woocommerce-ordering input[name="paged"]').length&&t.push("paged="+e('form.woocommerce-ordering input[name="paged"]').val()),e('form.woocommerce-ordering select[name="orderby"]').length&&t.push("orderby="+e('form.woocommerce-ordering select[name="orderby"]').val())),formUnique=t.filter((function(e){if(!this[e])return this[e]=1,e}),{}),function(t){e(".entry-content .mfn-woo-products");e(".mfn_attr_filters button").addClass("loading disabled"),e("body").hasClass("archive")?e.get(t,(function(o){if(e(".pager_wrapper").remove(),e(".woocommerce-info").remove(),e(".default-woo-list").length?e(".default-woo-list").replaceWith(e(e.parseHTML(o)).find(".default-woo-list").clone()):e(".column_shop_products").length&&e(".column_shop_products").replaceWith(e(e.parseHTML(o)).find(".column_shop_products").clone()),e(".woocommerce-ordering select").on("change",(function(){e(this).closest("form").submit()})),t=(t=function(e,t){e=window.location.origin+e;const o=new URL(e);return t.forEach((e=>{o.searchParams.delete(e)})),o.toString()}(t,["layout","per_page"])).replace(/%2C/g,","),history.replaceState(null,"",t),e(".mcb-sidebar").length){var a=e("#Content .sections_group").outerHeight();e(".mcb-sidebar").each((function(){e(this).css("min-height",0),e(this).height()>a&&(a=e(this).height())})),e(".mcb-sidebar").css("min-height",a+"px")}e(".woocommerce .column_shop_products ul.products.list").length&&(i(),e(window).on("debouncedresize",i)),e(".products li img").length&&e(".products li img").each((function(){void 0!==e(this).attr("data-src")&&e(this).attr("src",e(this).attr("data-src"))})),e(".mfn_attr_filters ul li").removeClass("loading"),e(".mfn_attr_filters button").removeClass("loading disabled")})):window.location.href=t}(o+"?"+formUnique.join("&"))}e("body").hasClass("shop-sidecart-active")&&woocart.refresh(),a.init(),!e("body").hasClass("mfn-ui")&&e(".mfn-product-gallery-grid").length&&(e("body").hasClass("product-zoom-disabled")||e(" .mfn-product-gg-img a").zoom(),r(".mfn-product-gallery-grid")),e(document).on("click",".mfn-quick-view",(function(t){t.preventDefault();var o=e(this).attr("data-id");e(this).addClass("loading"),quickview.display(o)})),e("body").hasClass("mfn-ajax-add-to-cart")&&e(document).on("click",".single_add_to_cart_button:not(.disabled)",(function(t){t.preventDefault();var o=e("#header_cart .header-cart-count").length?e("#header_cart .header-cart-count").first().text():0,a=e(this),n=a.closest("form.cart"),r=a.closest("form.cart").get(0),i=n.find("input.qty"),s=i.attr("max");if(void 0!==s&&""!=s&&parseInt(i.val())>parseInt(s))return i.css({"background-color":"#77a464",transition:"0.8s"}),i.val(s),void setTimeout((function(){i.removeAttr("style")}),1e3);var c={url:wc_add_to_cart_params.ajax_url,type:"POST",beforeSend:function(t){e(document.body).trigger("adding_to_cart"),a.removeClass("added").addClass("loading")},success:function(t){void 0===t.error?(a.addClass("added").removeClass("loading"),e(document.body).trigger("added_to_cart"),e(document.body).trigger("wc_fragment_refresh"),e(".mfn-cart-holder").attr("aria-expanded","true")):location.reload()}};if(n.hasClass("grouped_form")){var l=e("input.qty",n),m=!1;if(l.each((function(){parseInt(e(this).val())>0&&(m=!0)})),!m)return alert(mfnwoovars.groupedQuantityErrori18n),!1}var f=new FormData(r);return f.append("action","woocommerce_add_to_cart"),f.append("current_cart",o),e(".mnm_cart.mnm_data .mnm_add_to_cart_button").length&&f.delete("add-to-cart"),f.has("product_id")||"undefined"===a.val()||f.append("product_id",parseInt(a.val())),f.has("variation_id")&&f.delete("product_id"),c.data=f,c.contentType=!1,c.processData=!1,e(document.body).trigger("adding_to_cart",[a,f]),e.ajax(c),!1})),e(".wc-block-product-categories-list")&&(e(".wc-block-product-categories-list li.wc-block-product-categories-list-item").each((function(){e(this).children("ul").length&&e(this).append('<span class="cat-expander"></span>')})),e(".wc-block-product-categories-list li > span.cat-expander").on("click",(function(t){e(this).siblings("ul").is(":visible")?(e(this).siblings("ul").slideUp(300),e(this).parent("li").removeClass("li-expanded")):(e(this).siblings("ul").slideDown(300),e(this).parent("li").addClass("li-expanded"))}))),e(".woocommerce-product-attributes").length&&e(".woocommerce-product-attributes td, .woocommerce-product-attributes th").each((function(){e(this).html("<span>"+e(this).html()+"</span>")})),e(".mfn-variations-wrapper").length&&e("body").hasClass("mfn-variable-swatches")&&t.run(),e(".toggle-mfn-cart").on("click",(function(t){if(e("body").hasClass("shop-sidecart-active")&&e(".mfn-cart-holder").length){if(t.preventDefault(),e("body").hasClass("mfn-bebuilder-header"))return;e("html").hasClass("mfn-cart-opened")?e(".mfn-cart-holder").attr("aria-expanded","false"):e(".mfn-cart-holder").attr("aria-expanded","true"),woocart.click()}})),e(".toggle-mfn-cart").on("keypress",(function(t){if(t.preventDefault(),"Enter"===t.originalEvent.key){if(e("html").hasClass("mfn-cart-opened")){e(".mfn-cart-holder").attr("aria-expanded","false");const t=e("body").hasClass("side-slide-is-open")?".extras-wrapper ":".top_bar_right ";e(`${t} #header_cart`).trigger("focus")}else e(".mfn-cart-holder").find("a").first().trigger("focus"),e(".mfn-cart-holder").attr("aria-expanded","true");woocart.click()}})),e(".mfn-cart-overlay").on("click",(function(){woocart.click()})),e("body").hasClass("shop-sidecart-active")&&woocart.start(),e(".toggle-login-modal").on("click",(function(t){t.preventDefault(),e("body").hasClass("mfn-ui")||modallogin.click(e(this))})),e(document).on("mouseup",(function(t){e("body").hasClass("mfn-show-login-modal")&&(e(".mfn-header-login").is(t.target)||0!==e(".mfn-header-login").has(t.target).length||e(".toggle-login-modal").is(t.target)||0!==e(".toggle-login-modal").has(t.target).length||modallogin.click())})),e(".woocommerce .column_shop_products ul.products.list").length&&(i(),e(window).on("debouncedresize",i)),e(".mfn-header-modal-login .woocommerce-form-login .form-row").on("click",(function(){e(this).hasClass("active")||e(this).addClass("active")})),e(".mfn-header-modal-login .woocommerce-form-login .form-row input").on("blur change",(function(){modallogin.check()})),modallogin.check(),e(".mfn-cart-holder .mfn-ch-content").on("click",".mfn-chp-remove",(function(t){if(t.preventDefault(),!e(".mfn-cart-holder").hasClass("loading")){e(".mfn-cart-holder").addClass("loading");var o=e(this).closest(".mfn-ch-product").attr("data-row-key");woocart.delete(o)}})),e(".mfn-woo-products").on("change",".mfn-variations-wrapper-loop .mfn-vr-select",(function(){var t=e(this).find(":selected").attr("data-link");""!=t&&(window.location.href=t)})),e(".mfn-cart-holder .mfn-ch-content").on("change",".qty",(function(){var t=e(this);if(!e(".mfn-cart-holder").hasClass("loading")){e(".mfn-cart-holder").addClass("loading");var o=t.closest(".mfn-ch-product").attr("data-row-key"),a=t.val();woocart.updatequantity(o,a)}})),e("body").hasClass("woocommerce-checkout")&&(e(".woocommerce-form-login").length&&e(".woocommerce-form-login").addClass("checkout-form-toggle"),e(".woocommerce-form-coupon").length&&e(".woocommerce-form-coupon").addClass("checkout-form-toggle"),setTimeout((function(){checkoutpayment.start()}),1500)),e(document.body).on("added_to_cart",(function(t){e("body").hasClass("shop-sidecart-active")&&(woocart.refresh(),e("html").hasClass("mfn-cart-opened")||(woocart.force_open=!0))})),e(document.body).on("updated_cart_totals removed_from_cart",(function(){e("body").hasClass("shop-sidecart-active")&&woocart.refresh()})),o.set(),e(document).on("click",".mfn-wish-button",(function(t){t.preventDefault();var a=e(this).attr("data-id");o.click(a)})),e("form.mfn_attr_filters").length&&(e(document).on("click",".mfn-woo-list-active-filters li span",(function(){var t=e(this).attr("data-id");e(this).closest("li").addClass("laoding"),e(".widget.mfn_woo_attributes .mfn_attr_filters input."+t).length&&(e(".mfn_woo_attributes .mfn_attr_filters input."+t).is(":checked")&&(e(".mfn_woo_attributes .mfn_attr_filters input."+t).prop("checked",!1),e(".mfn_woo_attributes .mfn_attr_filters input."+t).closest("li").hasClass("active")&&e(".mfn_woo_attributes .mfn_attr_filters input."+t).closest("li").removeClass("active")),s())})),e(document).on("click","form.mfn_attr_filters ul li",(function(){var t=e(this),o=(e(this).closest("ul"),e(this).closest("form")),a=t.find("input").attr("class");o.hasClass("mfn-before-products-list-form")?(t.find("input").is(":checked")?t.find("input").prop("checked",!1):t.find("input").prop("checked",!0),t.toggleClass("active")):o.hasClass("mfn_attr_filters")&&(t.find("input").is(":checked")?e("form.mfn_attr_filters ul li input."+a).prop("checked",!1):e("form.mfn_attr_filters ul li input."+a).prop("checked",!0),e("form.mfn_attr_filters ul li input."+a).closest("li").toggleClass("active")),t.closest("form").hasClass("button-enabled")||(t.addClass("loading"),s())}))),e("form.mfn_attr_filters.button-enabled").length&&e("form.mfn_attr_filters.button-enabled").submit((function(e){e.preventDefault(),s()})),e.fn.extend({formData:function(){var t={};return e.each(this.serializeArray(),(function(e,o){t[o.name]?t[o.name]+=","+o.value:t[o.name]=o.value})),e.param(t)}}),setTimeout((function(){n.start()}),300)}));var t={run:function(){if(e(".mfn-variations-wrapper .mfn-vr-options li a").on("click",(function(o){o.preventDefault(),e(this).parent().siblings().removeClass("active"),e(this).parent().addClass("active");var a=e(this).attr("data-id"),n=e(this).parent().parent().attr("data-atr");e(".variations select#"+n).val(a),e(".variations select#"+n).trigger("change"),"false"!=e("form.variations_form").attr("data-product_variations")&&setTimeout((function(){t.triggerChange()}),100)})),e(".mfn-variations-wrapper .mfn-vr-select").on("change",(function(){var o=e(this).val(),a=e(this).attr("data-atr");e(".variations select#"+a).val(o),e(".variations select#"+a).trigger("change"),"false"!=e("form.variations_form").attr("data-product_variations")&&setTimeout((function(){t.triggerChange()}),100)})),e(".woocommerce div.product form.cart .variations select").each((function(){var t=e(this).val(),o=e(this).attr("id");t.length&&(e('.mfn-variations-wrapper .mfn-vr-options[data-atr="'+o+'"] li a[data-id="'+t+'"]').length?e('.mfn-variations-wrapper .mfn-vr-options[data-atr="'+o+'"] li a[data-id="'+t+'"]').trigger("click"):e('.mfn-variations-wrapper .mfn-vr-select[data-atr="'+o+'"]').length&&e('.mfn-variations-wrapper .mfn-vr-select[data-atr="'+o+'"]').val(t))})),window.location.search&&e(".mfn-variations-wrapper ul.mfn-vr-options").length){const t=new URLSearchParams(window.location.search);e(".mfn-variations-wrapper ul.mfn-vr-options").each((function(){let o=e(this).attr("data-atr");t.get(o)&&void 0!==o&&e(this).find('li a[data-id="'+t.get(o)+'"]').length&&e(this).find('li a[data-id="'+t.get(o)+'"]').trigger("click")}))}setTimeout((function(){t.triggerChange()}),200)},triggerChange:function(){e(".mfn-vr-options li").length&&e(".mfn-vr-options li a").css("opacity","0.3"),e(".mfn-vr-select option").length&&e(".mfn-vr-select option").attr("disabled","true"),e(".woocommerce form.variations_form.cart table.variations select option").each((function(){var t=e(this).attr("value"),o=e(this).closest("select").attr("name");e(".woocommerce .mfn-variations-wrapper .mfn-vr ul."+o).length&&e(".woocommerce .mfn-variations-wrapper .mfn-vr ul."+o+' a[data-id="'+t+'"]').css("opacity","1"),e(".woocommerce .mfn-variations-wrapper .mfn-vr select."+o).length&&e(".woocommerce .mfn-variations-wrapper .mfn-vr select."+o+' option[value="'+t+'"]').removeAttr("disabled")}))}},o={cookiename:"mfn_wishlist",click:function(t){o.readcookie()?arr=o.readcookie().split(","):arr=[],arr.includes(t)?(arr=arr.filter((e=>e!=t)),e('.mfn-wish-button[data-id="'+t+'"]').removeClass("loved"),e('.mfn-wish-button[data-id="'+t+'"]').closest(".wishlist-row").slideUp(300),setTimeout((function(){e('.mfn-wish-button[data-id="'+t+'"]').closest(".wishlist-row").remove()}),400),1==e(".wishlist .wishlist-row").length&&e(".wishlist .wishlist-info").show()):(arr.push(t),e('.mfn-wish-button[data-id="'+t+'"]').addClass("loved")),o.createcookie(arr),o.updatecounter(arr.length)},set:function(){o.readcookie()?arr=o.readcookie().split(","):arr=[],arr.length&&e.each(arr,(function(t,o){e('.mfn-wish-button[data-id="'+o+'"]').addClass("loved")})),o.updatecounter(arr.length)},readcookie:function(){for(var e=o.cookiename+"=",t=document.cookie.split(";"),a=0;a<t.length;a++){for(var n=t[a];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(e))return n.substring(e.length,n.length)}return null},createcookie:function(e){var t=new Date;t.setTime(t.getTime()+31536e6);var a="; expires="+t.toGMTString();document.cookie=o.cookiename+"="+e+a+"; path="+mfnwoovars.rooturl+"/"},updatecounter:function(t){e(".header-wishlist-count").text(t).attr("class","header-wishlist-count mfn-header-icon-"+t)}};modallogin={check:function(){e(".mfn-header-modal-login form.woocommerce-form-login").attr("action",mfnwoovars.myaccountpage),e(".mfn-header-modal-login .woocommerce-form-login .form-row input").each((function(){e(this).val()?e(this).closest(".form-row").addClass("active"):e(this).closest(".form-row").removeClass("active")}))},click:function(t){var o=e("body").hasClass("rtl");if(e(".mfn-header-login").hasClass("disabled"))return!0;if(e("body").hasClass("mfn-show-login-modal"))e(".mfn-header-login").removeAttr("style").addClass("disabled"),setTimeout((function(){e(".mfn-header-login").addClass("is-side").removeClass("disabled")}),300),e("body").removeClass("mfn-show-login-modal no-overlay");else{if(t.hasClass("is-boxed")){var a=e("body").offset().top||0,n=t.offset().top||0,r=t.offset().left||0,i=window.innerWidth;modalW=340,n-=a,e(".mfn-header-login").removeClass("is-side"),e(".mfn-header-login").css("top",n+"px"),o?r-modalW<0?e(".mfn-header-login").css("left",r+"px"):e(".mfn-header-login").css("left",r-modalW+37+"px"):r+modalW>i?e(".mfn-header-login").css("left",r-modalW+37+"px"):e(".mfn-header-login").css("left",r+"px"),e("body").addClass("no-overlay")}e("body").addClass("mfn-show-login-modal")}}},checkoutpayment={start:function(t=!1){e(".wc_payment_methods .wc_payment_method").each((function(){e(this).find(".mfn-payment-check").length||e(this).append('<span class="mfn-payment-check"><i class="icon-check" aria-label="payment check icon"></i></span>'),e(this).find(".input-radio").is(":checked")&&checkoutpayment.set(e(this),t)})),checkoutpayment.watch()},watch:function(){e(document).on("click",".wc_payment_methods .wc_payment_method",(function(){checkoutpayment.set(e(this))}))},set:function(t,o=!1){$input=t.find(".input-radio"),$input.is(":checked")?t.addClass("active-payment"):(e(".wc_payment_methods .wc_payment_method .payment_box").slideUp(300),e(".wc_payment_methods .wc_payment_method").removeClass("active-payment"),$input.trigger("click"),t.addClass("active-payment"),t.find(".payment_box").slideDown(300)),o||setTimeout((function(){checkoutpayment.start(!0)}),1500)}},quickview={headerOffset:!1,display:function(a){e.ajax({url:mfnwoovars.ajaxurl,data:{"mfn-woo-nonce":mfnwoovars.wpnonce,action:"mfnproductquickview",id:a},type:"POST",success:function(a){e("body").append(a),e(".mfn-quick-view").removeClass("loading"),quickview.close(),e(".mfn-variations-wrapper").length&&e("body").hasClass("mfn-variable-swatches")&&t.run(),e("html").addClass("mfn-quick-view-opened"),e(".mfn-popup-quickview .mfn-quickview-slider").slick({slidesToShow:1,slidesToScroll:1,autoplay:!0,autoplaySpeed:3e3,dots:!1,arrows:!0,prevArrow:'<a class="slick-prev mfn-popup-arrow slick-arrow" href="#"><i class="icon-left-open-big" aria-label="previous slide"></i></a>',nextArrow:'<a class="slick-next mfn-popup-arrow slick-arrow" href="#"><i class="icon-right-open-big" aria-label="next slide"></i></a>',focusOnChange:!0}),e(".mfn-popup-quickview form.cart.variations_form").length&&e(".mfn-popup-quickview .variations_form").wc_variation_form(),e(".mfn-popup-quickview .mfn-quickview-slider").imagesLoaded((function(){quickview.setHeight()})),o.set(),e(window).on("debouncedresize",quickview.setHeight)}})},setHeight:function(){var t=e(".mfn-popup-quickview .mfn-popup-content").outerHeight(),o=e(".mfn-popup-quickview .mfn-popup-content-photos .mfn-qs-one-first img").height();o>t?e(".mfn-popup-quickview .mfn-popup-content-text").css({height:t}):e(".mfn-popup-quickview .mfn-popup-content-text").css({height:o}),e("body").hasClass("mfn-header-scrolled")&&e(".mfn-header-tmpl.mfn-hasSticky").length&&(e("html").addClass("mfn-disable-css-animations"),e("body").removeClass("mfn-header-scrolled"),quickview.headerOffset=e(".mfn-header-tmpl.mfn-hasSticky").outerHeight(),e("body").addClass("mfn-header-scrolled"),e("#Wrapper").css({"padding-top":quickview.headerOffset+"px"}))},close:function(){e(".mfn-close-popup").on("click",(function(){e(".mfn-popup").remove(),e("html").removeClass("mfn-quick-view-opened"),e("html").removeClass("mfn-disable-css-animations")})),e(".mfn-popup").on("click",(function(t){e(".mfn-popup-content").is(t.target)||0!==e(".mfn-popup-content").has(t.target).length||(e(".mfn-popup").remove(),e("html").removeClass("mfn-quick-view-opened"),e("html").removeClass("mfn-disable-css-animations"))}))}},woocart={force_open:!1,coupons:{init:function(){woocart.coupons.toggle(),woocart.coupons.apply(),woocart.coupons.remove()},back:function(t){e(".mfn-chft-apply-coupon-wrapper").is(t.target)||e(t.target).closest(".mfn-chft-apply-coupon-wrapper").length||(e(".mfn-chft-apply-coupon-wrapper").removeClass("mfn-chft-apply-coupon-active"),e(document).unbind("click",woocart.coupons.back))},toggle:function(){e(document).on("click",".mfn-chft-apply-coupon-switcher",(function(t){t.preventDefault(),e(this).closest(".mfn-chft-apply-coupon-wrapper").addClass("mfn-chft-apply-coupon-active"),e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input").focus(),e(document).bind("click",woocart.coupons.back)}))},remove:function(){e(document).on("click",".mfn-chft-apply-coupon-wrapper .mfn-chft-coupons-list .mfn-sidecart-remove-coupon",(function(t){if(t.preventDefault(),e(this).hasClass("loading"))return;e(this).addClass("loading");let o=e(this).attr("data-code");e.ajax({url:mfnwoovars.ajaxurl,data:{"mfn-woo-nonce":mfnwoovars.wpnonce,action:"mfndeletecoupon",code:o},type:"POST",cache:!1,success:function(e){woocart.refresh()}})}))},ajax:function(){let t=e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon");if(t.hasClass("loading"))return;if(e(".mfn-chft-apply-coupon-wrapper .mfn-sidecart-notice").remove(),e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input").removeClass("mfn-error"),!e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input").val().length)return void e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input").addClass("mfn-error");let o=e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input").val();t.addClass("loading"),e.ajax({url:mfnwoovars.ajaxurl,data:{"mfn-woo-nonce":mfnwoovars.wpnonce,action:"mfnapplycoupon",code:o},type:"POST",cache:!1,success:function(o){if(o){let t="";void 0===o.notice.error?(e(".mfn-cart-holder .mfn-ch-content").html(o.content),e(".mfn-cart-holder .mfn-ch-footer .mfn-ch-footer-totals").html(o.footer)):e(".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input").addClass("mfn-error");for(const[e,a]of Object.entries(o.notice))t+='<div class="mfn-sidecart-notice mfn-sidecart-notice-'+e+'">',a&&(t+=a.map((e=>`<p>${e.notice}</p>`)).join("")),t+="</div>";e(".mfn-chft-apply-coupon-wrapper").prepend(t),woocart.coupons.removeNotices()}t.removeClass("loading")}})},apply:function(){e(document).on("click",".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon",(function(e){e.preventDefault(),woocart.coupons.ajax()})),e(document).on("keypress",".mfn-sidecart-apply-coupon-wrapper .mfn-sidecart-apply-coupon-input",(function(e){13==e.which&&woocart.coupons.ajax()}))},removeNotices:function(){setTimeout((function(){e(".mfn-chft-apply-coupon-wrapper .mfn-sidecart-notice").remove()}),3e3)}},start:function(){return!1},click:function(){e("body").hasClass("shop-sidecart-active")&&e(".mfn-cart-holder").length&&(e("html").toggleClass("mfn-cart-opened"),woocart.force_open=!1)},refresh:function(){e.ajax({url:mfnwoovars.ajaxurl,data:{"mfn-woo-nonce":mfnwoovars.wpnonce,action:"mfnrefreshcart"},type:"POST",cache:!1,success:function(t){e(".mfn-cart-holder .mfn-ch-content").html(t.content),e(".mfn-cart-holder .mfn-ch-footer .mfn-ch-footer-totals").html(t.footer),e(".mfn-cart-holder").removeClass("loading"),0==t.total?e(".mfn-ch-footer-buttons").hide():e(".mfn-ch-footer-buttons").show(),woocart.force_open&&woocart.click()}})},delete:function(t){e.ajax({url:mfnwoovars.ajaxurl,data:{"mfn-woo-nonce":mfnwoovars.wpnonce,action:"mfnremovewooproduct",pid:t},type:"POST",cache:!1,success:function(o){e(document.body).trigger("wc_fragment_refresh"),woocart.refresh(),e("body").hasClass("woocommerce-cart")&&e('.woocommerce .shop_table .product-remove a.remove[data-product_id="'+t+'"]').trigger("click")}})},updatequantity:function(t,o){e.ajax({url:mfnwoovars.ajaxurl,data:{"mfn-woo-nonce":mfnwoovars.wpnonce,action:"mfnchangeqtyproduct",pid:t,qty:o},type:"POST",cache:!1,success:function(a){e(document.body).trigger("wc_fragment_refresh"),woocart.refresh(),e("body").hasClass("woocommerce-cart")&&(e('.woocommerce .shop_table .product-remove a.remove[data-product_id="'+t+'"]').parent().siblings(".product-quantity").find("input.qty").val(o).trigger("change"),e('.woocommerce-cart-form .button[name="update_cart"]').trigger("click"))}})}},woocart.coupons.init();var a={active:!0,time:function(){let e=[2e4,25e3,3e4,35e3,4e4,5e4];return e[Math.floor(Math.random()*e.length)]},init:function(){if(e("body").hasClass("mfn-ui"))return;if(a.checkCookie("mfnFakeSale")&&(a.active=!1),"undefined"==typeof mfn_fake_sale||!a.active)return;let t=void 0!==mfn_fake_sale.delay?mfn_fake_sale.delay:5;t=1e3*parseFloat(t),setTimeout(a.show,t),e(document).on("click",".mfn-fake-sale-noti .mfn-fake-sale-noti-close",(function(e){e.preventDefault(),a.active=!1,a.hide(),a.addCookie(1,"mfnFakeSale")}))},show:function(){var t=mfn_fake_sale.items[Math.floor(Math.random()*mfn_fake_sale.items.length)],o=`<div class="mfn-fake-sale-noti mfn-fake-sale-noti-${mfn_fake_sale.position}">${t} ${"1"==mfn_fake_sale.closeable?'<a href="/" class="mfn-fake-sale-noti-close"><span class="icon">&#10005;</span></a>':""}</div>`;e("body").append(o),setTimeout(a.hide,15e3)},hide:function(){e(".mfn-fake-sale-noti").length&&(e(".mfn-fake-sale-noti").addClass("mfn-fake-sale-noti-out"),setTimeout((function(){e(".mfn-fake-sale-noti").remove()}),500),a.active&&a.reset())},reset:function(){setTimeout(a.show,a.time())},addCookie(e,t){let o=new Date;o.setTime(o.getTime()+24*parseInt(e)*60*60*1e3);let a="; expires="+o.toGMTString();document.cookie=t+"=true"+a+"; path=/"},checkCookie(e){for(var t=e+"=",o=document.cookie.split(";"),a=0;a<o.length;a++){for(var n=o[a];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return null}},n={start:function(){e(".flex-viewport").length?($loup=e(".woocommerce-product-gallery__trigger").clone(!0).empty().appendTo(".flex-viewport"),e(".woocommerce-product-gallery > .woocommerce-product-gallery__trigger").remove(),e(".woocommerce-product-gallery .mfn-wish-button").length&&(e(".woocommerce-product-gallery .mfn-wish-button").clone(!0).appendTo(".flex-viewport"),e(".woocommerce-product-gallery > .mfn-wish-button").remove(),e(document).trigger("resize"))):e(".woocommerce-product-gallery__trigger").length&&e(".woocommerce-product-gallery__trigger").empty(),e(".mfn-product-gallery").length&&(e(".flex-control-thumbs").length&&e(".flex-control-thumbs").wrap('<div class="mfn-flex-control-thumbs-wrapper"></div>'),e(".woocommerce-product-gallery").imagesLoaded((function(){e(".mfn-thumbnails-left").length||e(".mfn-thumbnails-right").length?n.verticalThumbs():e(".mfn-thumbnails-bottom").length&&n.horizontalThumbs()})))},horizontalThumbs:function(){var t=e(".mfn-product-gallery"),o=t.outerWidth(),a=t.find(".flex-control-thumbs"),n=0;if(a.find("li").each((function(){e(this).addClass("swiper-slide"),n+=e(this).outerWidth()})),t.length&&a.length){n>o&&(a.css({"justify-content":"flex-start",width:"100%"}),e(".mfn-flex-control-thumbs-wrapper").addClass("mfn-scroller-active")),a.addClass("swiper-wrapper");var r={slidesPerView:5,spaceBetween:parseInt(mfnwoovars.productthumbs)};a.parent().addClass("mfn-arrows-absolute"),a.parent().append('<div class="swiper-button-next mfn-swiper-arrow"><i class="icon-right-open-big"></i></div><div class="swiper-button-prev mfn-swiper-arrow"><i class="icon-left-open-big"></i></div>'),r.navigation={nextEl:".swiper-button-next",prevEl:".swiper-button-prev"};new Swiper(".mfn-flex-control-thumbs-wrapper",r)}},verticalThumbs:function(){var t=e(".mfn-product-gallery"),o=t.find(".woocommerce-product-gallery__image").first().outerHeight(),a=t.find(".flex-control-thumbs"),n=0,r=0,i=mfnwoovars.productthumbsover?mfnwoovars.productthumbsover:0;if(a.find("li img").css({height:"auto"}),a.find("li").css({height:"auto"}),a.find("li").each((function(){e(this).addClass("swiper-slide").css({"margin-bottom":parseInt(mfnwoovars.productthumbs)}),n+=e(this).outerHeight()+parseInt(mfnwoovars.productthumbs),e(this).css({opacity:"1"})})),"mfn-mim-2"==mfnwoovars.mainimgmargin?r=4:"mfn-mim-5"==mfnwoovars.mainimgmargin?r=10:"mfn-mim-10"==mfnwoovars.mainimgmargin?r=20:"mfn-mim-15"==mfnwoovars.mainimgmargin?r=30:"mfn-mim-20"==mfnwoovars.mainimgmargin?r=40:"mfn-mim-25"==mfnwoovars.mainimgmargin?r=50:"mfn-mim-30"==mfnwoovars.mainimgmargin&&(r=60),t.length&&a.length){if(t.find(".flex-viewport").css({height:"auto"}),n>o){"mfn-thumbnails-overlay"==i?e(".mfn-flex-control-thumbs-wrapper").height(o-r):e(".mfn-flex-control-thumbs-wrapper").height(o),a.css({"align-items":"flex-start"}),e(".mfn-flex-control-thumbs-wrapper").addClass("mfn-scroller-active"),a.addClass("swiper-wrapper");new Swiper(".mfn-flex-control-thumbs-wrapper",{slidesPerView:4,spaceBetween:parseInt(mfnwoovars.productthumbs),direction:"vertical",mousewheel:!0});a.find("li").each((function(){e(this).find("img").css({height:e(this).outerHeight()}),e(this).css({opacity:"1"})}))}t.find(".flex-viewport").css("height",o)}}};e(window).on("debouncedresize",(function(){(e(".mfn-thumbnails-left").length||e(".mfn-thumbnails-right").length)&&setTimeout(n.verticalThumbs(),300)}));var r=function(t){var o=function(o){var a,n=document.querySelectorAll(".pswp")[0];a=function(){var o=[];return e(t).find("div img").not(".zoomImg").each((function(){var t=e(this),a=t.attr("data-large_image"),n=t.attr("data-large_image_width"),r=t.attr("data-large_image_height"),i={alt:t.attr("alt"),src:a,w:n,h:r,title:t.attr("data-caption")?t.attr("data-caption"):t.attr("title")};o.push(i)})),o}();var r={index:parseInt(o,10),getThumbBoundsFn:function(t){var o=e('.mfn-product-gallery-grid .mfn-product-gg-img[data-index="'+t+'"] div img:first-child'),a=(window.pageYOffset||document.documentElement.scrollTop,o.offset());return{x:a.left,y:a.top,w:o.width()}}};isNaN(r.index)||(gallery=new PhotoSwipe(n,PhotoSwipeUI_Default,a,r),gallery.init())};e(".mfn-product-gallery-grid a.woocommerce-product-gallery__trigger").on("click",(function(t){t.preventDefault();var a=e(this).closest(".mfn-product-gg-img").attr("data-index");o(a)})),e(".mfn-product-gallery-grid .woocommerce-product-gallery__image a").on("click",(function(t){t.preventDefault(),e(this).closest(".elementor-widget-container").length||e(this).closest(".mfn-product-gg-img").find(".woocommerce-product-gallery__trigger").trigger("click")}))};e(document).on("click",".mfn-woocommerce-tabs .mfn-woocommerce-tabs-nav a",(function(t){if(t.preventDefault(),e(this).parent("li").hasClass("active"))return;let o=e(this).closest(".mfn-woocommerce-tabs"),a=e(this).attr("href").replace("#",".");e(this).parent().siblings("li").removeClass("active"),e(this).closest(".mfn-woocommerce-tabs").find(".mfn-woocommerce-tabs-content.active").removeClass("active"),e(this).parent("li").addClass("active"),o.find(a).addClass("active")}))}(jQuery);

Zerion Mini Shell 1.0