!function(a){"use strict";var t=function(){setTimeout((function(){rey.hooks.doAction("minicart/open")}),500)};a(document.body).on("added_to_cart",(function(e,o,r,n){if("yes"!==wc_add_to_cart_params.cart_redirect_after_add&&"popup"===reyParams.after_add_to_cart){if(void 0!==n)if(n.closest(".product").is("li")&&!1===reyParams.after_add_to_cart_popup_config.show_in_loop||n.closest(".product").hasClass("--prevent-aatc"))return void t();!function(e){if(e||(e=a(".single_add_to_cart_button:not(.disabled)")),e.hasClass("--prevent-aatc"))t();else{var o=e.attr("data-product_id")||e.val()||e.closest("form.cart").find('input[name="product_id"]').val()||"";o?"undefined"!=typeof ReyModal&&new ReyModal({linkAttributeName:!1,catchFocus:!1,closeOnEsc:!0,backscroll:!0,beforeOpen:function(t){t._exists||rey.ajax.request("after_add_to_cart_popup",{data:{product_id:o},cb:function(e){var o=a(".rey-acPopup-content",t.$content);if(a(".reymodal__loader",t.$content).fadeOut("fast"),e.data){var r=o.html(e.data),n=a("ul.products",r),c=a("li.product",r),d=parseInt(r.attr("data-cols"))||4;if(rey.vars.is_tablet?d=3:rey.vars.is_mobile&&(d=2),n.length)if(rey.hooks.doAction("product/loaded",n[0].querySelectorAll("li.product")),a(".add_to_cart_button",r).addClass("--prevent-aatc"),n.hasClass("--carousel")&&c.length>d){var s=rey.vars.is_rtl?{left:50}:{right:50},i={type:"slide",autoplay:reyParams.after_add_to_cart_popup_config.autoplay,interval:parseInt(reyParams.after_add_to_cart_popup_config.autoplay_speed),perPage:d,rewind:!0,arrows:!1,pagination:!1,padding:s,breakpoints:{1024:{perPage:3},767:{perPage:2}}};rey.components.slider({element:n[0],config:i,createArrows:{navSelector:"rey-acPopup-nav",appendTo:a(".rey-acPopup-header",t.$content)},markup:{selector:"acPopup-carousel"}})}else c.each((function(t,e){setTimeout((function(){a(e).addClass("--animated-in")}),30)}))}else o.html("Couldn't retrieve data!")}})}}).init().open({width:1200,content:".rey-acPopup",wrapperClass:"rey-acPopup-modal",id:"aatc-"+o}):t()}}(n)}}))}(jQuery);