1/* NM Wishlist */ 2!function(s){"use strict";var t={init:function(){var t=this;if("undefined"!=typeof nm_wp_vars){if(t.$body=s("body"),t.isLoggedIn=!!t.$body.hasClass("logged-in"),t.isSetUp=!1,t.wishlistIds=[],t.cookieName="nm-wishlist-ids",t.cookieExpires=parseInt(nm_wishlist_vars.wlCookieExpires),t.IDsUpdateAjax=!1,"0"!=nm_wishlist_vars.wlAddLocaleSuffix){var e=s("html").attr("lang").toLowerCase();e=e.replace(/-/g,"_"),t.cookieName=t.cookieName+"-"+e}"0"!=nm_wishlist_vars.wlMenuCount?(t.countEnabled=!0,t.$headerLinkLi=s(".nm-menu-wishlist"),t.$counts=s(".nm-menu-wishlist-count")):t.countEnabled=!1,t.setUp(),s(document).on("click",".nm-wishlist-button",(function(e){if(e.preventDefault(),t.isSetUp)if("0"==nm_wishlist_vars.wlLoginRequire||t.$body.hasClass("logged-in"))t.IDsUpdateAjax&&(t.IDsUpdateAjax.abort(),t.IDsUpdateAjax=!1),t.buttonToggle(this);else{var i=s("#nm-menu-account-btn");i.length&&s("#nm-login-popup-wrap").length?i.trigger("click"):window.location.replace(nm_wishlist_vars.wlLoginRedirectUrl)}else console.log("NM Wishlist: Not set-up yet, just a moment")}));var i=s("#nm-wishlist-table");i.length&&i.find(".nm-wishlist-remove").on("click",(function(e){if(e.preventDefault(),t.isSetUp){var o=s(this);o.hasClass("clicked")||(o.addClass("clicked"),t.wishlistItemRemove(o,i))}else console.log("NM Wishlist: Not set-up yet, just a moment")}))}},setUp:function(){var t=this;if(t.isLoggedIn)s.ajax({type:"POST",url:nm_wp_vars.ajaxUrl,data:{action:"nm_wishlist_get_ids"},dataType:"json",cache:!1,headers:{"cache-control":"no-cache"},success:function(s){if(s.ids){var e=s.ids;t.wishlistIds=e,Cookies.set(t.cookieName,JSON.stringify(e),{expires:t.cookieExpires}),t.countUpdate(),t.buttonsSetState()}},complete:function(){t.isSetUp=!0,t.$body.addClass("nm-wishlist-ready")}});else{if(void 0!==Cookies.getJSON)var e=Cookies.getJSON(t.cookieName);else{e=Cookies.get(t.cookieName);try{e=JSON.parse(e)}catch(s){}}e?(t.wishlistIds=e,t.countUpdate(),t.buttonsSetState()):Cookies.set(t.cookieName,"[]",{expires:t.cookieExpires}),t.isSetUp=!0,t.$body.addClass("nm-wishlist-ready")}},IDsUpdate:function(){var t=this,e=JSON.stringify(t.wishlistIds);Cookies.set(t.cookieName,e,{expires:t.cookieExpires}),t.isLoggedIn&&(t.IDsUpdateAjax=s.ajax({type:"POST",url:nm_wp_vars.ajaxUrl,data:{action:"nm_wishlist_update_ids",nonce:nm_wishlist_vars.wlNonce,ids:e},dataType:"json",cache:!1,headers:{"cache-control":"no-cache"},complete:function(){t.IDsUpdateAjax=!1}}))},buttonsSetState:function(){for(var t=this,e=0;e<t.wishlistIds.length;e++)s("#nm-wishlist-item-"+t.wishlistIds[e]+"-button").addClass("added");t.$body.addClass("wishlist-show-buttons")},buttonSetState:function(t,e){var i=s(".nm-wishlist-item-"+t+"-button");e?(i.addClass("added"),i.attr("title",nm_wishlist_vars.wlButtonTitleRemove),this.$body.trigger("wishlist_added_item")):(i.removeClass("added"),i.attr("title",nm_wishlist_vars.wlButtonTitleAdd),this.$body.trigger("wishlist_removed_item"))},buttonToggle:function(t){var e=this,i=s(t).data("product-id"),o=!0,a=s.inArray(i,e.wishlistIds);-1==a?e.wishlistIds.unshift(i):(e.wishlistIds.splice(a,1),o=!1),e.IDsUpdate(),e.countUpdate(),e.buttonSetState(i,o)},wishlistItemRemove:function(t,e){s("#nm-wishlist-overlay").addClass("show");var i=this,o=t.closest("ul"),a=o.data("product-id");o.addClass("removing");var n=s.inArray(a,i.wishlistIds);-1!=n&&i.wishlistIds.splice(n,1),i.IDsUpdate(),i.countUpdate(),setTimeout((function(){o.remove(),i.$body.trigger("wishlist_removed_item"),0==e.children("ul").length&&(s("#nm-wishlist").css("display","none"),s("#nm-wishlist-empty").addClass("show")),s("#nm-wishlist-overlay").removeClass("show")}),500)},countUpdate:function(){var s=this;s.countEnabled&&(s.wishlistIds.length?(s.$headerLinkLi.addClass("has-items"),s.$counts.text(s.wishlistIds.length).removeClass("is-zero")):(s.$headerLinkLi.removeClass("has-items"),s.$counts.text("0").addClass("is-zero")))}};s((function(){t.init()}))}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.