1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[13996],{3996:(t,s,e)=>{e.r(s),e.d(s,{default:()=>n});var i=e(9568),o=e(4049),a=e(1374);class n extends i.Z{init(){this.classList={isLoading:"product-wishlist-loading",addedState:"product-wishlist-added",notAddedState:"product-wishlist-not-added"},this.textsElement=o.Z.querySelector(this.el,".product-wishlist-btn-content",!1),this._getWishlistStorage(),this._wishlistStorage||(this.el.style.display="none",console.warn("No wishlist storage found")),this._registerEvents(),this.initStateClasses()}_getWishlistStorage(){let t=o.Z.querySelector(document,"#wishlist-basket",!1);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){if(t.preventDefault(),!this.el.classList.contains(this.classList.isLoading)){if(!window.customerLoggedInState&&window.useDefaultCookieConsent&&!(null===a.Z||void 0===a.Z?void 0:a.Z.getItem("wishlist-enabled"))){document.$emitter.publish("CookieConfiguration/requestConsent",{route:"".concat(window.router["frontend.cookie.consent.offcanvas"],"?featureName=wishlist&cookieName=wishlist-enabled"),cookieName:"wishlist-enabled"});return}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)}}n.options={texts:{add:"Add to wishlist",remove:"Remove from wishlist"}}}}]);
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.