jQuery(function(d){function a(){"undefined"!=typeof d.fn.selectBox&&d("select.selectBox").filter(":visible").not(".enhanced").selectBox().addClass("enhanced")}function e(){var t,e,i,n;"undefined"!=typeof d.prettyPhoto&&(t={hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,overlay_gallery:!1,default_width:500,changepicturecallback:function(){a(),d(".wishlist-select").filter(":visible").change(),d(document).trigger("yith_wcwl_popup_opened",[this])},markup:'
 
'},d('a[data-rel^="prettyPhoto[add_to_wishlist_"]').add('a[data-rel="prettyPhoto[ask_an_estimate]"]').add('a[data-rel="prettyPhoto[create_wishlist]"]').off("click").prettyPhoto(t),d('a[data-rel="prettyPhoto[move_to_another_wishlist]"]').on("click",function(){var t=d(this),e=d("#move_to_another_wishlist").find("form"),i=e.find(".row-id"),t=t.closest("[data-row-id]").data("row-id");i.length&&i.remove(),e.append('')}).prettyPhoto(t),e=function(t,e){"undefined"!=typeof t.classList&&t.classList.contains("yith-wcwl-overlay")&&(e="remove"===e?"removeClass":"addClass",d("body")[e]("yith-wcwl-with-pretty-photo"))},i=function(t){e(t,"add")},n=function(t){e(t,"remove")},new MutationObserver(function(t){for(var e in t){e=t[e];"childList"===e.type&&("undefined"!=typeof e.addedNodes&&"function"==typeof e.addedNodes.forEach&&e.addedNodes.forEach(i),"undefined"!=typeof e.removedNodes&&"function"==typeof e.addedNodes.forEach&&e.removedNodes.forEach(n))}}).observe(document.body,{childList:!0}))}function i(){d(".wishlist_table").find('.product-checkbox input[type="checkbox"]').off("change").on("change",function(){var t=d(this);t.parent().removeClass("checked").removeClass("unchecked").addClass(t.is(":checked")?"checked":"unchecked")}).trigger("change")}function n(){d(".add_to_cart").filter("[data-icon]").not(".icon-added").each(function(){var t=d(this),e=t.data("icon"),e=e.match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?d("",{src:e}):d("",{"class":"fa "+e});t.prepend(e).addClass("icon-added")})}function c(){a(),e(),i(),n(),r(),o(),f(),_(),h(),w(),d(document).trigger("yith_wcwl_init_after_ajax")}function o(){yith_wcwl_l10n.enable_tooltip&&d(".yith-wcwl-add-to-wishlist").find("[data-title]").each(function(){var t=d(this);t.hasClass("tooltip-added")||(t.on("mouseenter",function(){var t,e=d(this),i=null,n=e.outerWidth(),a=0,i=d("",{"class":"yith-wcwl-tooltip",text:e.data("title")});e.append(i),t=i.outerWidth()+6,i.outerWidth(t),a=(n-t)/2,i.css({left:a.toFixed(0)+"px"}).fadeIn(200),e.addClass("with-tooltip")}).on("mouseleave",function(){var t=d(this);t.find(".yith-wcwl-tooltip").fadeOut(200,function(){t.removeClass("with-tooltip").find(".yith-wcwl-tooltip").remove()})}),t.addClass("tooltip-added"))})}function r(){d(".yith-wcwl-add-button").filter(".with-dropdown").on("mouseleave",function(){var t=d(this).find(".yith-wcwl-dropdown");t.length&&t.fadeOut(200)}).children("a").on("mouseenter",function(){var t=d(this).closest(".with-dropdown"),e=t.find(".yith-wcwl-dropdown");e.length&&e.children().length&&t.find(".yith-wcwl-dropdown").fadeIn(200)})}function _(){"undefined"!=typeof yith_wcwl_l10n.enable_drag_n_drop&&yith_wcwl_l10n.enable_drag_n_drop&&d(".wishlist_table").filter(".sortable").not(".no-interactions").each(function(){var n=d(this),a=!1;n.sortable({items:"[data-row-id]",scroll:!0,helper:function(t,e){return e.children().each(function(){d(this).width(d(this).width())}),e},update:function(){var t=n.find("[data-row-id]"),e=[],i=0;t.length&&(a&&a.abort(),t.each(function(){var t=d(this);t.find('input[name*="[position]"]').val(i++),e.push(t.data("row-id"))}),a=d.ajax({data:{action:yith_wcwl_l10n.actions.sort_wishlist_items,nonce:yith_wcwl_l10n.nonce.sort_wishlist_items_nonce,context:"frontend",positions:e,wishlist_token:n.data("token"),page:n.data("page"),per_page:n.data("per-page")},method:"POST",url:yith_wcwl_l10n.ajax_url}))}})})}function h(){var o,s;d(".wishlist_table").on("change",".product-quantity :input",function(){var t=d(this),e=t.closest("[data-row-id]"),i=e.data("row-id"),n=t.closest(".wishlist_table"),a=n.data("token");clearTimeout(s),e.find(".add_to_cart").attr("data-quantity",t.val()),s=setTimeout(function(){o&&o.abort(),o=d.ajax({beforeSend:function(){j(n)},complete:function(){C(n)},data:{action:yith_wcwl_l10n.actions.update_item_quantity,nonce:yith_wcwl_l10n.nonce.update_item_quantity_nonce,context:"frontend",product_id:i,wishlist_token:a,quantity:t.val()},method:"POST",url:yith_wcwl_l10n.ajax_url})},1e3)})}function w(){d(".copy-trigger").on("click",function(){var t=d(".copy-target");0",{val:t.text(),type:"text"}),d("body").append(t),s()?t[0].setSelectionRange(0,9999):t.select(),document.execCommand("copy"),t.remove()))})}function f(){d(".wishlist_table").filter(".images_grid").not(".enhanced").on("click","[data-row-id] .product-thumbnail a",function(t){var e,i,n;yith_wcwl_l10n.disable_popup_grid_view||(i=(e=d(this).closest("[data-row-id]")).siblings("[data-row-id]"),n=e.find(".item-details"),t.preventDefault(),n.length&&(i.removeClass("show"),e.toggleClass("show")))}).on("click","[data-row-id] a.close",function(t){var e=d(this).closest("[data-row-id]"),i=e.find(".item-details");t.preventDefault(),i.length&&e.removeClass("show")}).on("click","[data-row-id] a.remove_from_wishlist",function(t){var e=d(this);return t.stopPropagation(),u(e),!1}).addClass("enhanced"),d(document).on("click",function(t){d(t.target).closest("[data-row-id]").length||d(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")}).on("added_to_cart",function(){d(".wishlist_table").filter(".images_grid").find(".show").removeClass("show")})}function p(e,t,i){e.action=yith_wcwl_l10n.actions.move_to_another_wishlist_action,e.nonce=yith_wcwl_l10n.nonce.move_to_another_wishlist_nonce,e.context="frontend",""!==e.wishlist_token&&""!==e.destination_wishlist_token&&""!==e.item_id&&d.ajax({beforeSend:t,url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",method:"post",success:function(t){i(t),c(),d("body").trigger("moved_to_another_wishlist",[d(this),e.item_id])}})}function u(e){var t=e.parents(".cart.wishlist_table"),i=e.parents("[data-row-id]"),n=i.data("row-id"),a=t.data("id"),o=t.data("token"),n={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,nonce:yith_wcwl_l10n.nonce.remove_from_wishlist_nonce,context:"frontend",remove_from_wishlist:n,wishlist_id:a,wishlist_token:o,fragments:S(n)};d.ajax({beforeSend:function(){j(t)},complete:function(){C(t)},data:n,method:"post",success:function(t){"undefined"!=typeof t.fragments&&O(t.fragments),c(),d("body").trigger("removed_from_wishlist",[e,i])},url:yith_wcwl_l10n.ajax_url})}function m(t){var e=d(this),i=e.closest(".wishlist_table"),n=null;t.preventDefault(),(n=i.length?e.closest("[data-wishlist-id]").find(".wishlist-title"):e.parents(".wishlist-title")).next().css("display","inline-block").find('input[type="text"]').focus(),n.hide()}function y(t){var e=d(this);t.preventDefault(),e.parents(".hidden-title-form").hide(),e.parents(".hidden-title-form").prev().show()}function v(t){var e=d(this),i=e.closest(".hidden-title-form"),n=e.closest("[data-wishlist-id]").data("wishlist-id"),a=i.find('input[type="text"]'),o=a.val(),e={};if(t.preventDefault(),!o)return i.addClass("woocommerce-invalid"),void a.focus();n=n||d("#wishlist_id").val(),e={action:yith_wcwl_l10n.actions.save_title_action,nonce:yith_wcwl_l10n.nonce.save_title_nonce,context:"frontend",wishlist_id:n,title:o,fragments:S()},d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",beforeSend:function(){j(i)},complete:function(){C(i)},success:function(t){var e=t.fragments;t.result?(i.hide(),i.prev().find(".wishlist-anchor, h1, h2").text(o).end().show()):(i.addClass("woocommerce-invalid"),a.focus()),void 0!==e&&O(e)}})}function g(){var t=d(this),e=t.val(),t=t.closest("[data-wishlist-id]").data("wishlist-id"),e={action:yith_wcwl_l10n.actions.save_privacy_action,nonce:yith_wcwl_l10n.nonce.save_privacy_nonce,context:"frontend",wishlist_id:t,privacy:e,fragments:S()};d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:e,dataType:"json",success:function(t){t=t.fragments;void 0!==t&&O(t)}})}function b(t,e){if("undefined"!=typeof d.prettyPhoto&&"undefined"!=typeof d.prettyPhoto.close)if(void 0!==t){var i,n=d(".pp_content_container"),a=n.find(".pp_content"),o=n.find(".yith-wcwl-popup-form"),n=o.closest(".pp_pic_holder");o.length&&((i=d("
",{"class":"yith-wcwl-popup-feedback"})).append(d("",{"class":"fa heading-icon "+("error"===e?"fa-exclamation-triangle":"fa-check")})),i.append(d("

",{"class":"feedback",html:t})),i.css("display","none"),a.css("height","auto"),o.after(i),o.fadeOut(200,function(){i.fadeIn()}),n.addClass("feedback"),n.css("left",d(window).innerWidth()/2-n.outerWidth()/2+"px"),"undefined"!=typeof yith_wcwl_l10n.auto_close_popup&&!yith_wcwl_l10n.auto_close_popup||setTimeout(b,yith_wcwl_l10n.popup_timeout))}else try{d.prettyPhoto.close()}catch(s){}}function x(t){var e=d("#yith-wcwl-popup-message"),i=d("#yith-wcwl-message"),n="undefined"!=typeof yith_wcwl_l10n.popup_timeout?yith_wcwl_l10n.popup_timeout:3e3;"undefined"!=typeof yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices||(i.html(t),e.css("margin-left","-"+d(e).width()+"px").fadeIn(),window.setTimeout(function(){e.fadeOut()},n))}function k(o){var t=d("select.wishlist-select"),e=d("ul.yith-wcwl-dropdown");t.each(function(){var i=d(this),t=i.find("option"),e=t.filter('[value="new"]');t.not(e).remove(),d.each(o,function(t,e){d("

  • ").append(d("",{rel:"nofollow",html:e.wishlist_name,"class":"add_to_wishlist",href:e.add_to_this_wishlist_url,"data-product-id":n,"data-product-type":a,"data-wishlist-id":e.id})).appendTo(i)})})}function j(t){"undefined"!=typeof d.fn.block&&t.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"40px 40px",opacity:1}})}function C(t){"undefined"!=typeof d.fn.unblock&&t.stop(!0).css("opacity","1").unblock()}function T(){if(navigator.cookieEnabled)return 1;document.cookie="cookietest=1";var t=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}function S(t){var i={},e=null;return t?"object"==typeof t?(e=(t=d.extend({fragments:null,s:"",container:d(document),firstLoad:!1},t)).fragments||t.container.find(".wishlist-fragment"),t.s&&(e=e.not("[data-fragment-ref]").add(e.filter('[data-fragment-ref="'+t.s+'"]'))),t.firstLoad&&(e=e.filter(".on-first-load"))):(e=d(".wishlist-fragment"),"string"!=typeof t&&"number"!=typeof t||(e=e.not("[data-fragment-ref]").add(e.filter('[data-fragment-ref="'+t+'"]')))):e=d(".wishlist-fragment"),e.length?(e.each(function(){var t=d(this),e=t.attr("class").split(" ").filter(t=>t.length&&"exists"!==t).join(yith_wcwl_l10n.fragments_index_glue);i[e]=t.data("fragment-options")}),i):null}function P(e){var i=S(e=d.extend({firstLoad:!0},e));i&&d.ajax({data:{action:yith_wcwl_l10n.actions.load_fragments,nonce:yith_wcwl_l10n.nonce.load_fragments_nonce,context:"frontend",fragments:i},method:"post",success:function(t){"undefined"!=typeof t.fragments&&(O(t.fragments),c(),d(document).trigger("yith_wcwl_fragments_loaded",[i,t.fragments,e.firstLoad]))},url:yith_wcwl_l10n.ajax_url})}function O(t){d.each(t,function(t,e){var i="."+t.split(yith_wcwl_l10n.fragments_index_glue).filter(t=>t.length&&"exists"!==t&&"with-count"!==t).join("."),n=d(i),t=d(e).filter(i);t.length||(t=d(e).find(i)),n.length&&t.length&&n.replaceWith(t)})}function s(){return navigator.userAgent.match(/ipad|iphone/i)}function D(t){return!0===t||"yes"===t||"1"===t||1===t}d(document).on("yith_wcwl_init",function(){var l,t=d(this),s="undefined"!=typeof wc_add_to_cart_params&&null!==wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"";t.on("click",".add_to_wishlist",function(t){var n=d(this),e=n.attr("data-product-id"),a=d(".add-to-wishlist-"+e),i=null,o={action:yith_wcwl_l10n.actions.add_to_wishlist_action,nonce:yith_wcwl_l10n.nonce.add_to_wishlist_nonce,context:"frontend",add_to_wishlist:e,product_type:n.data("product-type"),wishlist_id:n.data("wishlist-id"),fragments:S(e)};if((i=d(document).triggerHandler("yith_wcwl_add_to_wishlist_data",[n,o]))&&(o=i),t.preventDefault(),jQuery(document.body).trigger("adding_to_wishlist"),yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.modal_enable){e=n.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),i=e.find(".wishlist-select"),t=e.find(".wishlist-name"),e=e.find(".wishlist-visibility").filter(":checked");if(o.wishlist_id=i.is(":visible")?i.val():"new",o.wishlist_name=t.val(),o.wishlist_visibility=e.val(),"new"===o.wishlist_id&&!o.wishlist_name)return t.closest("p").addClass("woocommerce-invalid"),!1;t.closest("p").removeClass("woocommerce-invalid")}if(T())return d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:o,dataType:"json",beforeSend:function(){j(n)},complete:function(){C(n)},success:function(t){var e=t.result,i=t.message;yith_wcwl_l10n.multi_wishlist?(b(i,e),"undefined"!=typeof t.user_wishlists&&k(t.user_wishlists)):x(i),"true"!==e&&"exists"!==e||("undefined"!=typeof t.fragments&&O(t.fragments),yith_wcwl_l10n.multi_wishlist&&!yith_wcwl_l10n.hide_add_button||a.find(".yith-wcwl-add-button").remove(),a.addClass("exists")),c(),d("body").trigger("added_to_wishlist",[n,a])}}),!1;window.alert(yith_wcwl_l10n.labels.cookie_disabled)}),t.on("click",".wishlist_table .remove_from_wishlist",function(t){var e=d(this);return t.preventDefault(),u(e),!1}),t.on("adding_to_cart","body",function(t,e,i){void 0!==e&&void 0!==i&&e.closest(".wishlist_table").length&&(i.remove_from_wishlist_after_add_to_cart=e.closest("[data-row-id]").data("row-id"),i.wishlist_id=e.closest(".wishlist_table").data("id"),"undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=D(yith_wcwl_l10n.redirect_to_cart)))}),t.on("added_to_cart","body",function(t,e,i,n){var a,o;void 0!==n&&n.closest(".wishlist_table").length&&("undefined"!=typeof wc_add_to_cart_params&&(wc_add_to_cart_params.cart_redirect_after_add=s),"undefined"!=typeof yith_wccl_general&&(yith_wccl_general.cart_redirect=D(s)),o=(a=n.closest("[data-row-id]")).closest(".wishlist-fragment").data("fragment-options"),n.removeClass("added"),a.find(".added_to_cart").remove(),yith_wcwl_l10n.remove_from_wishlist_after_add_to_cart&&o.is_user_owner&&a.remove())}),t.on("added_to_cart","body",function(){var t=d(".woocommerce-message");0===t.length?d("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):t.fadeOut(300,function(){d(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}),t.on("cart_page_refreshed","body",c),t.on("click",".show-title-form",m),t.on("click",".wishlist-title-with-form h2",m),t.on("click",".remove_from_all_wishlists",function(t){var e=d(this),i=e.attr("data-product-id"),n=e.data("wishlist-id"),a=e.closest(".content"),i={action:yith_wcwl_l10n.actions.remove_from_all_wishlists,nonce:yith_wcwl_l10n.nonce.remove_from_all_wishlists_nonce,context:"frontend",prod_id:i,wishlist_id:n,fragments:S(i)};t.preventDefault(),d.ajax({beforeSend:function(){j(a)},complete:function(){C(a)},data:i,dataType:"json",method:"post",success:function(t){"undefined"!=typeof t.fragments&&O(t.fragments),c()},url:yith_wcwl_l10n.ajax_url})}),t.on("click",".hide-title-form",y),t.on("click",".save-title-form",v),t.on("change",".wishlist_manage_table .wishlist-visibility",g),t.on("change",".change-wishlist",function(){var t=d(this),e=t.parents(".cart.wishlist_table"),i=e.data("token"),n=t.parents("[data-row-id]").data("row-id");p({wishlist_token:i,destination_wishlist_token:t.val(),item_id:n,fragments:S()},function(){j(e)},function(t){"undefined"!=typeof t.fragments&&O(t.fragments),C(e)})}),t.on("click",".yith-wcwl-popup-footer .move_to_wishlist",function(){var i=d(this),t=i.attr("data-product-id"),e=i.data("origin-wishlist-id"),n=i.closest("form"),a=n.find(".wishlist-select").val(),o=n.find(".wishlist-name"),s=o.val(),n=n.find(".wishlist-visibility").filter(":checked").val();if("new"===a&&!s)return o.closest("p").addClass("woocommerce-invalid"),!1;o.closest("p").removeClass("woocommerce-invalid"),p({wishlist_token:e,destination_wishlist_token:a,item_id:t,wishlist_name:s,wishlist_visibility:n,fragments:S(t)},function(){j(i)},function(t){var e=t.message;yith_wcwl_l10n.multi_wishlist?(b(e),"undefined"!=typeof t.user_wishlists&&k(t.user_wishlists)):x(e),"undefined"!=typeof t.fragments&&O(t.fragments),c(),C(i)})}),t.on("click",".delete_item",function(){var i=d(this),t=i.attr("data-product-id"),e=i.data("item-id"),n=d(".add-to-wishlist-"+t),t={action:yith_wcwl_l10n.actions.delete_item_action,nonce:yith_wcwl_l10n.nonce.delete_item_nonce,context:"frontend",item_id:e,fragments:S(t)};return d.ajax({url:yith_wcwl_l10n.ajax_url,data:t,dataType:"json",beforeSend:function(){j(i)},complete:function(){C(i)},method:"post",success:function(t){var e=t.fragments,t=t.message;yith_wcwl_l10n.multi_wishlist&&b(t),i.closest(".yith-wcwl-remove-button").length||x(t),void 0!==e&&O(e),c(),d("body").trigger("removed_from_wishlist",[i,n])}}),!1}),t.on("change",".yith-wcwl-popup-content .wishlist-select",function(){var t=d(this);"new"===t.val()?t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").show():t.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()}),t.on("change","#bulk_add_to_cart",function(){var t=d(this),e=t.closest(".wishlist_table").find("[data-row-id]").find('input[type="checkbox"]:not(:disabled)');(t.is(":checked")?e.prop("checked","checked"):e.prop("checked",!1)).change()}),t.on("submit",".wishlist-ask-an-estimate-popup",function(){var t=d(this),i=t.closest("form"),n=t.closest(".pp_content"),t=i.serializeArray().reduce((t,e)=>(t[e.name]=e.value,t),{});return t.action=yith_wcwl_l10n.actions.ask_an_estimate,t.nonce=yith_wcwl_l10n.noce.ask_an_estimate_nonce,t.context="frontend",d.ajax({beforeSend:function(){j(i)},complete:function(){C(i)},data:t,dataType:"json",method:"post",success:function(t){var e;"undefined"!=typeof t.result&&t.result?void 0!==(e=t.template)&&(i.replaceWith(e),n.css("height","auto"),setTimeout(b,yith_wcwl_l10n.time_to_close_prettyphoto)):"undefined"!=typeof t.message&&(i.find(".woocommerce-error").remove(),i.find(".popup-description").after(d("
    ",{text:t.message,"class":"woocommerce-error"})))},url:yith_wcwl_l10n.ajax_url}),!1}),t.on("click",".yith-wfbt-add-wishlist",function(t){t.preventDefault();var e=d(this),t=d("#yith-wcwl-form");d("html, body").animate({scrollTop:t.offset().top},500),function(t,i){var e=t.attr("data-product-id"),n=d(document).find(".cart.wishlist_table"),a=n.data("pagination"),o=n.data("per-page"),s=n.data("id"),l=n.data("token"),t={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,nonce:yith_wcwl_l10n.nonce.reload_wishlist_and_adding_elem_nonce,context:"frontend",pagination:a,per_page:o,wishlist_id:s,wishlist_token:l,add_to_wishlist:e,product_type:t.data("product-type")};if(!T())return window.alert(yith_wcwl_l10n.labels.cookie_disabled);d.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:t,dataType:"html",beforeSend:function(){j(n)},complete:function(){C(n)},success:function(t){var e=d(t),t=e.find("#yith-wcwl-form"),e=e.find(".yith-wfbt-slider-wrapper");i.replaceWith(t),d(".yith-wfbt-slider-wrapper").replaceWith(e),c(),d(document).trigger("yith_wcwl_reload_wishlist_from_frequently")}})}(e,t)}),t.on("submit",".yith-wcwl-popup-form",function(){return!1}),t.on("yith_infs_added_elem",function(){e()}),t.on("found_variation",function(t,e){var i=d(t.target).data("product_id"),n=e.variation_id,t=d(".yith-wcwl-add-to-wishlist").find('[data-product-id="'+i+'"]'),e=d(".yith-wcwl-add-to-wishlist").find('[data-original-product-id="'+i+'"]'),t=t.add(e),e=t.closest(".wishlist-fragment").filter(":visible");i&&n&&t.length&&(t.each(function(){var t=d(this),e=t.closest(".yith-wcwl-add-to-wishlist");t.attr("data-original-product-id",i),t.attr("data-product-id",n),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=n,e.data("fragment-options",t)),e.removeClass(function(t,e){return e.match(/add-to-wishlist-\S+/g).join(" ")}).addClass("add-to-wishlist-"+n).attr("data-fragment-ref",n))}),yith_wcwl_l10n.reload_on_found_variation&&(j(e),P({fragments:e,firstLoad:!1})))}),t.on("reset_data",function(t){var n=d(t.target).data("product_id"),e=d('[data-original-product-id="'+n+'"]'),t=e.closest(".wishlist-fragment").filter(":visible");n&&e.length&&(e.each(function(){var t=d(this),e=t.closest(".yith-wcwl-add-to-wishlist"),i=t.attr("data-product-id");t.attr("data-product-id",n),t.attr("data-original-product-id",""),e.length&&(void 0!==(t=e.data("fragment-options"))&&(t.product_id=n,e.data("fragment-options",t)),e.removeClass("add-to-wishlist-"+i).addClass("add-to-wishlist-"+n).attr("data-fragment-ref",n))}),yith_wcwl_l10n.reload_on_found_variation&&(j(t),P({fragments:t,firstLoad:!1})))}),t.on("yith_wcwl_reload_fragments",P),t.on("yith_infs_added_elem",function(t,e){P({container:e,firstLoad:!1})}),t.on("yith_wcwl_fragments_loaded",function(t,e,i,n){n&&d(".variations_form").find(".variations select").last().change()}),t.on("click",".yith-wcwl-popup-feedback .close-popup",function(t){t.preventDefault(),b()}),"undefined"!=typeof yith_wcwl_l10n.enable_notices&&!yith_wcwl_l10n.enable_notices||!d(".yith-wcwl-add-to-wishlist").length||d("#yith-wcwl-popup-message").length||(t=d("
    ").attr("id","yith-wcwl-message"),t=d("
    ").attr("id","yith-wcwl-popup-message").html(t).hide(),d("body").prepend(t)),o(),r(),_(),h(),f(),d(document).on("click",".show-tab",function(t){var e=d(this),i=e.closest(".yith-wcwl-popup-content"),n=e.data("tab"),a=i.find(".tab").filter("."+n);if(t.preventDefault(),!a.length)return!1;e.addClass("active").siblings(".show-tab").removeClass("active"),a.show().siblings(".tab").hide(),"create"===n?i.prepend(''):i.find("#new_wishlist_selector").remove()}),d(document).on("change",".wishlist-select",function(){var t=d(this),e=t.closest(".yith-wcwl-popup-content"),i=t.closest(".tab"),n=e.find(".tab.create"),a=e.find(".show-tab"),e=a.filter('[data-tab="create"]');"new"===t.val()&&n.length&&(i.hide(),n.show(),a.removeClass("active"),e.addClass("active"),t.find("option").removeProp("selected"),t.change())}),a(),i(),e(),n(),l=!1,yith_wcwl_l10n.is_wishlist_responsive&&d(window).on("resize",function(){var t=d(".wishlist_table.responsive"),e=t.is(".mobile"),i=window.matchMedia("(max-width: "+yith_wcwl_l10n.mobile_media_query+"px)"),n=t.closest("form"),a=n.attr("class"),o=n.data("fragment-options"),s={},n=!1;t.length&&(i.matches&&t&&!e?(o.is_mobile="yes",n=!0):!i.matches&&t&&e&&(o.is_mobile="no",n=!0),n&&(l&&l.abort(),s[a.split(" ").join(yith_wcwl_l10n.fragments_index_glue)]=o,l=d.ajax({beforeSend:function(){j(t)},complete:function(){C(t)},data:{action:yith_wcwl_l10n.actions.load_mobile_action,nonce:yith_wcwl_l10n.nonce.load_mobile_nonce,context:"frontend",fragments:s},method:"post",success:function(t){"undefined"!=typeof t.fragments&&(O(t.fragments),c(),d(document).trigger("yith_wcwl_responsive_template",[e,t.fragments]))},url:yith_wcwl_l10n.ajax_url})))}),w(),yith_wcwl_l10n.enable_ajax_loading&&P()}).trigger("yith_wcwl_init")});