jQuery.fn.serializeArrayAll=function(){var e=/\r?\n/g;return this.map((function(){return this.elements?jQuery.makeArray(this.elements):this})).map((function(t,n){var r=jQuery(this).val();return null===r?null===r:"checkbox"===this.type&&!1===this.checked?{name:this.name,value:this.checked?this.value:""}:"radio"!==this.type?jQuery.isArray(r)?jQuery.map(r,(function(t,r){return{name:n.name,value:t.replace(e,"\r\n")}})):{name:n.name,value:r.replace(e,"\r\n")}:this.checked?{name:this.name,value:this.checked?this.value:""}:void 0})).get()},jQuery(document).ready((function(){jQuery(document.body).on("click",".single_add_to_cart_button:not(.disabled)",(function(e){var t=jQuery(this),n=t.closest("form.cart"),r=n.find('input:not([name="product_id"]), select, button, textarea').serializeArrayAll()||0,a=(n.attr("action")?n.attr("action"):window.location.toString()).split("#")[0];a=-1!==a.indexOf("?")?a+"&wc-ajax=awb_add_to_cart":a+"?wc-ajax=awb_add_to_cart",e.preventDefault(),t.find("span").length||t.wrapInner("<span></span>"),n.find('input[name="product_id"]').length&&t.attr("value",n.find('input[name="product_id"]').val()),jQuery(document.body).trigger("adding_to_cart",[t,r]),jQuery.ajax({type:"POST",url:a,data:r,beforeSend:function(){t.removeClass("added").addClass("loading")},complete:function(){t.addClass("added").removeClass("loading")},success:function(e){e.error&&e.product_url?window.location=e.product_url:(void 0!==e.fragments.awb_woo_notices&&jQuery(e.fragments.awb_woo_notices).hasClass("woocommerce-notices-wrapper")&&jQuery(".woocommerce-notices-wrapper").each((function(t){jQuery(this).replaceWith(jQuery(e.fragments.awb_woo_notices).eq(t))})),jQuery(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash,t]))}})})).on("added_to_cart",(function(e,t,n,r){!function(e){const t=jQuery(".awb-dynamic-free-shipping-min-amount-progress");if(t.length){function n(e){if(!Number.isFinite(Number(e))){const t=e.match(/\d+(?:[.,]\d+)?/);t&&(e=t[0].replace(",","."))}return(e=parseFloat(e))||0}const r=n(e['.awb-dynamic-free-shipping-min-amount[data-type="percentage_reached"]']),a=n(e[".fusion-dynamic-cart-sub-totals-discounts"]),i=n(e[".fusion-dynamic-cart-sub-totals"]);t.each((function(){jQuery(this).find(".progress").attr("aria-valuenow",r);const e=jQuery(this).find(".fusion-progressbar-value");if(e.length){const t=jQuery(this).data("value-type");let n="";n="min-amount-percentage"===t?e.text().includes("%")?r+"%":r:"sub-totals-discounts"===t?a:i,e.html(n)}jQuery(window).trigger("fusion-dynamic-content-render",jQuery(this).parent())}))}}(t);const a=r.closest(".entry-summary").parent();if(a.hasClass("fusion-wqv-content-inner"))return void setTimeout((function(){a.closest(".fusion-woocommerce-quick-view-container").find(".fusion-wqv-close button").trigger("click")}),200);if(!jQuery(".woocommerce-notices-wrapper").length||!r.hasClass("single_add_to_cart_button"))return;const i=fusion.getAdminbarHeight();jQuery(".fusion-header-wrapper").find("div").each((function(){"fixed"===jQuery(this).css("position")&&($stickyHeaderHeight=jQuery(this).height())})),jQuery("html, body").stop(),jQuery("html, body").animate({scrollTop:jQuery(".woocommerce-notices-wrapper").offset().top-i-0-10},500)}))}));