var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
!function(r){woodmartThemeModule.addToCartAllTypes=function(){0!=woodmart_settings.ajax_add_to_cart&&(woodmartThemeModule.$body.on("submit","form.cart",function(a){var d,t=r(this),o=t.parents(".single-product-page");(o=0===o.length?t.parents(".product-quick-view"):o).hasClass("product-type-external")||o.hasClass("product-type-zakeke")||o.hasClass("product-type-gift-card")||void 0!==a.originalEvent&&r(a.originalEvent.submitter).hasClass("wd-buy-now-btn")||(a.preventDefault(),d=t.find(".single_add_to_cart_button"),o=t.serialize(),o+="&action=woodmart_ajax_add_to_cart",d.val()&&(o+="&add-to-cart="+d.val()),d.removeClass("added not-added"),d.addClass("loading"),woodmartThemeModule.$body.trigger("adding_to_cart",[d,o]),r.ajax({url:woodmart_settings.ajaxurl,data:o,method:"POST",success:function(a){var t,o,e;a&&(window.location.toString().replace("add-to-cart","added-to-cart"),a.error&&a.product_url?window.location=a.product_url:"yes"===woodmart_settings.cart_redirect_after_add?window.location=woodmart_settings.cart_url:(d.removeClass("loading"),t=a.fragments,o=a.cart_hash,t&&r.each(t,function(a){r(a).addClass("updating")}),t&&r.each(t,function(a,t){r(a).replaceWith(t)}),(e=r(".woocommerce-notices-wrapper")).empty(),0<a.notices.indexOf("error")?(e.append(a.notices),d.addClass("not-added")):(void 0!==r.fn.magnificPopup&&"widget"===woodmart_settings.add_to_cart_action&&r.magnificPopup.close(),d.addClass("added"),woodmartThemeModule.$body.trigger("added_to_cart",[t,o,d]))))},error:function(){console.log("ajax adding to cart error")},complete:function(){}}))}),woodmartThemeModule.$body.on("click",".variations_form .wd-buy-now-btn",function(a){var t=r(this).siblings(".single_add_to_cart_button");"undefined"!=typeof wc_add_to_cart_variation_params&&t.hasClass("disabled")&&(a.preventDefault(),t.hasClass("wc-variation-is-unavailable")?alert(wc_add_to_cart_variation_params.i18n_unavailable_text):t.hasClass("wc-variation-selection-needed")&&alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))}))},r(document).ready(function(){woodmartThemeModule.addToCartAllTypes()})}(jQuery);
}