!function(c){woodmartThemeModule.$document.on("wdShopPageInit wdArrowsLoadProducts wdLoadMoreLoadProducts wdProductsTabsLoaded wdSearchFullScreenContentLoaded wdBackHistory wdRecentlyViewedProductLoaded",function(){woodmartThemeModule.updateWishlistButtonState()}),woodmartThemeModule.wishlist=function(){var d="woodmart_wishlist_count",i="woodmart_wishlist_products";if(woodmart_settings.is_multisite&&(d+="_"+woodmart_settings.current_blog_id,i+="_"+woodmart_settings.current_blog_id),"undefined"!=typeof Cookies){var t=Cookies.get(d),e=0;if(void 0!==t)try{e=JSON.parse(t)}catch(t){console.log("cant parse cookies json")}void 0!==woodmart_settings.wishlist_expanded&&"yes"===woodmart_settings.wishlist_expanded||n(e),woodmartThemeModule.$body.on("click",".wd-wishlist-btn a",function(t){var e=c(this);if(e.hasClass("added"))return!0;t.preventDefault();var o,t=e.data("product-id"),s=e.data("key");woodmartThemeModule.$body.hasClass("logged-in")||"undefined"==typeof Cookies?(e.addClass("loading"),void 0!==woodmart_settings.wishlist_expanded&&"yes"===woodmart_settings.wishlist_expanded&&"disable"!==woodmart_settings.wishlist_show_popup&&woodmartThemeModule.$body.hasClass("logged-in")?woodmartThemeModule.$document.trigger("wdShowWishlistGroupPopup",[t,s]):a(t,"",s)):(s={},(s=void 0!==(o=Cookies.get(i))&&o&&(o=JSON.parse(o),Object.keys(o).length)?o:s)[t]={product_id:t},n(o=Object.keys(s).length),Cookies.set(i,JSON.stringify(s),{expires:7,path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}),Cookies.set(d,o,{expires:7,path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}),l(e))}),woodmartThemeModule.$body.on("click",".wd-wishlist-remove",function(t){t.preventDefault();var e,o=c(this),t="";o.parents(".wd-wishlist-group").length&&(t=o.parents(".wd-wishlist-group").data("group-id")),o.addClass("loading"),woodmartThemeModule.$body.hasClass("logged-in")||"undefined"==typeof Cookies||1===o.parents(".wd-products").find(".wd-product").length?r(o.data("product-id"),t,o.parents(".wd-products"),function(){o.removeClass("loading")}):(o.parents(".wd-product").remove(),t={},void 0!==(e=Cookies.get(i))&&e&&(t=JSON.parse(e),Object.keys(t).length)&&delete t[o.data("product-id")],n(e=Object.keys(t).length),Cookies.set(i,JSON.stringify(t),{expires:7,path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}),Cookies.set(d,e,{expires:7,path:woodmart_settings.cookie_path,secure:woodmart_settings.cookie_secure_param}))}),woodmartThemeModule.$body.on("click",".wd-wishlist-checkbox",function(t){var e=c(this),o=e.parents(".wd-product"),e=e.parents(".wd-products-element").siblings(".wd-wishlist-bulk-action"),s=e.find(".wd-wishlist-select-all");o.toggleClass("wd-current-product"),s.hasClass("wd-selected")&&e.hasClass("wd-visible")&&!o.hasClass("wd-current-product")&&s.removeClass("wd-selected"),o.siblings(".product").length===o.siblings(".wd-current-product").length&&o.hasClass("wd-current-product")&&s.addClass("wd-selected"),o.siblings(".wd-current-product").length||!e.hasClass("wd-visible")||o.hasClass("wd-current-product")?e.addClass("wd-visible"):e.removeClass("wd-visible")}),woodmartThemeModule.$body.on("click",".wd-wishlist-remove-action > a",function(t){t.preventDefault();var e=c(this),t=e.parents(".wd-wishlist-bulk-action").siblings(".wd-products-element").find(".products"),o=t.find(".wd-current-product"),s=[],d="";o.length&&confirm(woodmart_settings.wishlist_remove_notice)&&(e.addClass("loading"),e.parents(".wd-wishlist-group").length&&(d=e.parents(".wd-wishlist-group").data("group-id")),o.each(function(){s.push(c(this).data("id"))}),r(s,d,t,function(){e.parents(".wd-wishlist-bulk-action").removeClass("wd-visible"),e.removeClass("loading")}))}),woodmartThemeModule.$body.on("click",".wd-wishlist-select-all > a",function(t){t.preventDefault();var t=c(this).parent(),e=t.parents(".wd-wishlist-bulk-action").siblings(".wd-products-element").find(".products");t.hasClass("wd-selected")?(e.find(".product").removeClass("wd-current-product").find(".wd-wishlist-checkbox").prop("checked",!1),t.removeClass("wd-selected"),t.parents(".wd-wishlist-bulk-action").removeClass("wd-visible")):(e.find(".product").addClass("wd-current-product").find(".wd-wishlist-checkbox").prop("checked",!0),t.addClass("wd-selected"))}),woodmartThemeModule.$document.on("wdAddProductToWishlist",function(t,e,o,s,d){a(e,o,s,d)}),woodmartThemeModule.$document.on("wdRemoveProductToWishlist",function(t,e,o,s,d){r(e,o,s,d)}),woodmartThemeModule.$document.on("wdUpdateWishlistContent",function(t,e){var o;e=e,o=c(".wd-wishlist-content"),n(e.count),0