jQuery(function(r){r("body").on("click",".quick-view-btn",function(){r(".fal",this).removeClass("fa-eye").addClass("fa-spinner-third fa-spin"),r("#postModal .summary-content").removeClass("quickajax-disable quickajax");var a={action:"load_post_by_ajax",id:r(this).data("dina-product-id"),security:dinaproduct.security};r.post(dinaproduct.ajaxurl,a,function(a){a=JSON.parse(a),r("#postModal #postModalLabel").html(a.title),r("#postModal .quick-gallery").html(a.img_gallery),r("#postModal .summary-content").html(a.content),r("#postModal .summary-content").addClass(a.quickajax),r("#postModal .carousel").carousel(),r("#postModal .variations_form").each(function(){jQuery(this).wc_variation_form()}),r("#postModal .variations_form").trigger("check_variations"),r("#postModal .variations_form").trigger("reset_image"),r("#postModal").modal({show:!0}),r(".quick-view-btn .fal").removeClass("fa-spinner-third fa-spin").addClass("fa-eye"),r("#postModal .quickajax form.cart").on("submit",function(a){a.preventDefault();var t=r(this);t.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),(a=new FormData(this)).append("add-to-cart",t.find("[name=add-to-cart]").val()),r.ajax({url:wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","dina_add_to_cart"),data:a,type:"POST",processData:!1,contentType:!1,complete:function(a){var o;(a=a.responseJSON)&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?(o=t.find(".single_add_to_cart_button"),r(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o]),r("form.cart .added_to_cart").remove(),r(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove(),t.unblock()):window.location=wc_add_to_cart_params.cart_url)}})})})}),r("body").on("click",".compare-ajax-btn",function(){r(".fal",this).removeClass("fa-random").addClass("fa-spinner-third fa-spin");var a=r(this).data("dina-compare-id"),o={action:"dina_ajax_compare",id:a,security:dinaproduct.security};prod_con=".product-"+a,r.post(dinaproduct.ajaxurl,o,function(a){a=JSON.parse(a),r(".compare-link").length&&(r(".compare-amount").html(a.conut),r(".compare-link").attr("href",a.compare_url)),r(prod_con+" .compare-ajax-btn").attr("data-original-title",a.title),r(prod_con+" .compare-ajax-btn").toggleClass("in-compare"),r(".prod-opts .compare-ajax-btn").attr("data-original-title",a.title),r(".prod-opts .compare-ajax-btn").toggleClass("in-compare"),r(".compare-ajax-btn .fal").removeClass("fa-spinner-third fa-spin").addClass("fa-random")})})});