!function(t){woodmartThemeModule.miniCartQuantity=function(){var e;woodmartThemeModule.$document.on("change input",".woocommerce-mini-cart .quantity .qty",function(){var a=t(this),o=a.val(),r=a.parents(".woocommerce-mini-cart-item").data("key"),i=a.attr("max"),n=woodmart_settings.cart_hash_key,m=woodmart_settings.fragment_name;clearTimeout(e),parseInt(o)>parseInt(i)&&(o=i),e=setTimeout(function(){a.parents(".mini_cart_item").addClass("wd-loading"),t.ajax({url:woodmart_settings.ajaxurl,data:{action:"woodmart_update_cart_item",item_id:r,qty:o},success:function(e){e&&e.fragments&&(t.each(e.fragments,function(a,o){if(t(a).hasClass("widget_shopping_cart_content")){var i=t(o).find('.woocommerce-mini-cart-item[data-key="'+r+'"]'),n=t(o).find(".shopping-cart-widget-footer"),m=t(a).find('.woocommerce-mini-cart-item[data-key="'+r+'"]');e.cart_hash&&i.length?(m.replaceWith(i),t(".shopping-cart-widget-footer").replaceWith(n)):t(a).replaceWith(o)}else t(a.replace("_wd","")).replaceWith(o)}),woodmartThemeModule.supports_html5_storage&&(sessionStorage.setItem(m,JSON.stringify(e.fragments)),localStorage.setItem(n,e.cart_hash),sessionStorage.setItem(n,e.cart_hash),e.cart_hash&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())),woodmartThemeModule.$body.trigger("wc_fragments_refreshed"))},dataType:"json",method:"GET"})},500)})},t(document).ready(function(){woodmartThemeModule.miniCartQuantity()})}(jQuery);