($=>{const t=$(".single_add_to_cart_button");t.on("click",(function(t){const a=$(t.currentTarget);if(a.siblings("#yith-wapo-container").length)return;t.preventDefault();var d={};if($.each(a.data(),(function(t,a){d[t]=a})),$.each(a[0].dataset,(function(t,a){d[t]=a})),!d.product_name){const t=a.siblings("input.lqd-product-name");t.length&&(d.product_name=t.val())}$(document.body).trigger("adding_to_cart",[a,d]);const i=$("div.header-quickcart"),n=$(".lqd-woo-added-msg"),e=$("input[name=product_id]").val()||a.val(),o=$('input[name="variation_id"]').val(),c=$('input[name="quantity"]').val();let r="action=liquid_add_cart_single&product_id="+e+"&quantity="+c;o&&""!=o&&(r="action=liquid_add_cart_single&product_id="+e+"&variation_id="+o+"&quantity="+c),a.addClass("adding-to-cart loading"),n.fadeIn().addClass("adding-to-cart").removeClass("added-to-cart"),$.ajax({url:liquid_ajax_object.ajax_url,type:"POST",data:r,success:function(t){n.removeClass("adding-to-cart").addClass("added-to-cart"),i.empty().append(t),$(".header-cart-fragments").html($(".item-count",i).first().html()),a.removeClass("adding-to-cart loading"),setTimeout((function(){n.fadeOut()}),6e3),$(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,a])}})})),$(document).ajaxComplete((function(a){$(a.target.activeElement).is("a.button.yith-wcqv-button")&&t.on("click",(function(a){const d=$(this);if(d.siblings("#yith-wapo-container").length)return;a.preventDefault();const i=$("div.header-quickcart"),n=$(".lqd-woo-added-msg"),e=$("input[name=product_id]").val()||d.val(),o=$('input[name="variation_id"]').val(),c=$('input[name="quantity"]').val();let r="action=liquid_add_cart_single&product_id="+e+"&quantity="+c;o&&""!=o&&(r="action=liquid_add_cart_single&product_id="+e+"&variation_id="+o+"&quantity="+c),d.addClass("adding-to-cart"),n.fadeIn().addClass("adding-to-cart").removeClass("added-to-cart"),$.ajax({url:liquid_ajax_object.ajax_url,type:"POST",data:r,success:function(a){n.removeClass("adding-to-cart").addClass("added-to-cart"),i.empty().append(a),$(".header-cart-fragments").html($(".item-count",i).first().html()),t.removeClass("adding-to-cart"),setTimeout((function(){$("#yith-quick-view-modal").removeClass("open")}),6e3)}})}))}))})(jQuery);