1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[83347],{3347:(t,s,i)=>{i.r(s),i.d(s,{default:()=>o});var e=i(4335);class o extends e.A{static #t=this.options={texts:{add:"Add to wishlist",remove:"Remove from wishlist"}};init(){this.classList={isLoading:"product-wishlist-loading",addedState:"product-wishlist-added",notAddedState:"product-wishlist-not-added"},this.textsElement=this.el.querySelector(".product-wishlist-btn-content"),this._getWishlistStorage(),this._wishlistStorage||(this.el.style.display="none",console.warn("No wishlist storage found")),this._registerEvents(),this.initStateClasses()}_getWishlistStorage(){let t=document.querySelector("#wishlist-basket");t&&(this._wishlistStorage=window.PluginManager.getPluginInstanceFromElement(t,"WishlistStorage"))}_registerEvents(){this.el.addEventListener("click",this._onClick.bind(this)),this._wishlistStorage.$emitter.subscribe("Wishlist/onLoginRedirect",this.initStateClasses.bind(this))}initStateClasses(){this._wishlistStorage.has(this.options.productId)?this._addActiveState():this._removeActiveState(),this.el.classList.remove(this.classList.isLoading)}_onClick(t){t.preventDefault(),this.el.classList.contains(this.classList.isLoading)||(this.el.classList.add(this.classList.isLoading),this._wishlistStorage.has(this.options.productId)?this._wishlistStorage.remove(this.options.productId,this.options.router.remove):this._wishlistStorage.add(this.options.productId,this.options.router.add))}_addActiveState(){this.el.classList.remove(this.classList.notAddedState),this.el.classList.add(this.classList.addedState),this.el.setAttribute("title",this.options.texts.remove),this.textsElement&&(this.textsElement.innerHTML=this.options.texts.remove)}_removeActiveState(){this.el.classList.remove(this.classList.addedState),this.el.classList.add(this.classList.notAddedState),this.el.setAttribute("title",this.options.texts.add),this.textsElement&&(this.textsElement.innerHTML=this.options.texts.add)}}}}]);
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.