PageSourceSearch

https://www.toplicht.de/theme/d60ccf83309a25cc46e83c9acfcd61ad/js/…/coe-wishlist-sw6.js?1790928603

js toplicht.de collected 2026-10-02 11:05:34 UTC 32,762 bytes, 1 lines download raw bytes

1(()=>{"use strict";var t={857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function o(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=s;var d,c,h=Array.isArray(i);return h!==Array.isArray(t)?s(i,l):h?l.arrayMerge(t,i,l):(c={},(d=l).isMergeableObject(t)&&n(t).forEach(function(e){c[e]=s(t[e],d)}),n(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&d.isMergeableObject(i[e])?c[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,d)(t[e],i[e],d):c[e]=s(i[e],d))}),c)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}(()=>{i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e}})(),(()=>{i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})}})(),(()=>{i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{var t=i(857),e=i.n(t);class s{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=s.toUpperCamelCase(t,e);return s.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>s.ucFirst(t.toLowerCase())).join(""):s.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class r{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!r.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===r.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),o=s.toLowerCamelCase(n,"-");if(!r.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let a=t.dataset[o];if(void 0===a){if(i)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return a}return s.parsePrimitive(a)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!r.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelector(e)||!1;if(i&&!1===s)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return s}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!r.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelectorAll(e);if(0===s.length&&(s=!1),i&&!1===s)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return s}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not
1([tabindex^="-"]):not([disabled])\n        ')}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}class n{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,r=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:i,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class o{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let i=s.toDashCase(this._pluginName),n=r.getDataAttribute(this.el,"data-".concat(i,"-config"),!1),o=r.getAttribute(this.el,"data-".concat(i,"-options"),!1),a=[this.constructor.options,this.options,t];n&&a.push(window.PluginConfigManager.get(this._pluginName,n));try{o&&a.push(JSON.parse(o))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(i,'-options" could not be parsed to json: ').concat(t.message))}return e().all(a.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},i=!1){if(!r.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new n(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}class a{get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,i);return this._sendRequest(s,null,e)}post(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let r=this._createPreparedRequest("POST",t,s);return this._sendRequest(r,e,i)}delete(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let r=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(r,e,i)}patch(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let r=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(r,e,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn("the request to ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}class l extends o{init(){if(!this.options.countUrl)throw Error("countURL missing");if(!this.options.productIdsUrl)throw Error("productIdsUrl missing");this._requestCount(),this._requestProductIds(),this._reregisterAjaxModal(),document.$emitter.subscribe("afterNoteAdded",t=>{this._requestCount(),this._updateProduct(t.detail)}),document.$emitter.subscribe("afterListedDeleted",()=>{this._requestCount()}),document.$emitter.subscribe("afterNoteDeleted",()=>{this._requestCount()})}_reregisterAjaxModal(){let t=r.querySelector(document,".cms-element-product-listing-wrapper",!1);t&&window.PluginManager.getPluginInstanceFromElement(t,"Listing").$emitter.subscribe("Listing/afterRenderResponse",()=>{PluginManager.initializePlugin("AjaxModal",'[data-toggle="modal"][data-url]'),this._requestProductIds()})}_updateProduct(t){if(!t.pid)return;let e=document.querySelector("[data-pid='"+t.pid+"']");!(!e||e.classList.contains("wishlist-added"))&&(e.classList.add("wishlist-added"),"1"==this.options.marks&&(e.innerHTML+="<span class='coe-wishlist-checkmark'>✓</span>"))}_requestCount(){new a(window.accessKey,window.contextToken).get(this.options.countUrl,t=>this._createBubble(t))}_requestProductIds(){new a(window.accessKey,window.contextToken).get(this.options.productIdsUrl,t=>this._updateProducts(t))}_createBubble(t){this.el.classList.contains("badge")||this.el.classList.add("badge"),this.el.classList.contains("badge-primary")||this.el.classList.add("badge-primary"),this.el.classList.contains("d-none")&&this.el.classList.remove("d-none"),isNaN(parseInt(t))||(this.el.
1innerText=t),0==t&&this.options.hideZero&&this.el.classList.add("d-none")}_updateProducts(t){try{t=JSON.parse(t)}catch(t){return!1}for(let[e,i]of Object.entries(t))this._updateProduct({pid:i})}}l.options={hideZero:!1,countUrl:"",productIdsUrl:"",marks:""};class d{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return d.isIPhoneDevice()||d.isIPadDevice()}static isNativeWindowsBrowser(){return d.isIEBrowser()||d.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":d.isTouchDevice(),"is-ios":d.isIOSDevice(),"is-native-windows":d.isNativeWindowsBrowser(),"is-iphone":d.isIPhoneDevice(),"is-ipad":d.isIPadDevice(),"is-ie":d.isIEBrowser(),"is-edge":d.isEdgeBrowser()}}}class c extends o{init(){if(!this.options.type)throw Error("Type (list or note) is missing");"list"===this.options.type&&this._initListCallbacks(),"note"===this.options.type&&(this._initNoteCallbacks(),this._registerNoteEvents())}_registerNoteEvents(){let t=(d.isTouchDevice(),"click");r.querySelector(this.el,"#tab-existing-list").addEventListener(t,()=>{r.querySelector(this.el,"input[name='addNewList']").value=!1}),r.querySelector(this.el,"#tab-new-list").addEventListener(t,()=>{r.querySelector(this.el,"input[name='addNewList']").value=!0})}_initNoteCallbacks(){let t=window.PluginManager.getPluginInstanceFromElement(this.el,"FormAjaxSubmit");t&&t.addCallback(()=>{this._hideModal();let t=document.querySelector("input[name='productId']").value;document.$emitter.publish("afterNoteAdded",{pid:t})})}_initListCallbacks(){let t=window.PluginManager.getPluginInstanceFromElement(this.el,"FormAjaxSubmit");t&&t.addCallback(()=>{this._hideModal(),window.location.reload()})}_hideModal(){bootstrap.Modal.getInstance(document.querySelector(".js-pseudo-modal .modal")).hide()}}c.options={type:""};class h{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var i of t.entries())e(i[1],i[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(i=>{e(t[i],i)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}let u="loader",p={BEFORE:"before",INNER:"inner"};class m{create(){if(!this.exists()){if(this.position===p.INNER){this.parent.innerHTML=m.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),m.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(u));h.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(u)).length>0}_getPosition(){return this.position===p.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(u,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return u}constructor(t,e=p.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}let g="element-loader-backdrop";class b extends m{static create(t){t.classList.add("has-element-loader"),b.exists(t)||(b.appendLoader(t),setTimeout(()=>{let e=t.querySelector(".".concat(g));e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(".".concat(g));e&&e.remove()}static exists(t){return t.querySelectorAll(".".concat(g)).length>0}static getTemplate(){return'\n        <div class="'.concat(g,'">\n            <div class="loader" role="status">\n                <span class="').concat("visually-hidden",'">Loading...</span>\n            </div>\n        </div>\n        ')}static appendLoader(t){t.insertAdjacentHTML("beforeend",b.getTemplate())}}class y extends o{init(){if(!this.options.id||!this.options.postUrl||!this.options.type)throw Error("id, postUrl or type missing");this._registerEventListeners()}_registerEventListeners(){let t=(d.isTouchDevice(),"click");this.el.addEventListener(t,this._onClickDelete.bind(this))}_onClickDelete(t){t.preventDefault(),"list"===this.options.type?(this.options.useModal?this.anchorElement=document.querySelector("[data-nav-list-id='"+this.options.id+"']"):this.anchorElement=this.el.closest("a"),this.contentElement=document.querySelector(this.options.listContentSelector),this._createLoadingIndicator(this.contentElement),this._createLoadingIndicator(this.anchorElement),this._tryCloseModal()):(this.anchorElement=this.el.closest("[data-wishlist-note-id]"),this._createLoadingIndicator(this.anchorElement)),this._sendRequest()}_createLoadingIndicator(t){b.create(t)}_tryCloseModal(){let t=document.querySelector("[data-cancel-delete]");t&&t.click()}_removeLoadingIndicator(t){b.remove(t)}_sendRequest(){var t={};"list"===this.options.type?t.listId=this.options.id:t.noteId=this.options.id,new a(window.accessKey,window.contextToken).post(this.options.postUrl,JSON.stringify(t),t=>this._afterDelete(t))}_afterDelete(t){this._removeLoadingIndicator(this.anchorElement);try{t=JSON.parse(t)}catch(t){return!1}t.success&&("list"===this.options.type?(document.$emitter.publish("afterListedDeleted",{response:t}),this._modifyDomAfterListDelete()):(document.$emitter.publish("afterNoteDeleted",{response:t}),this._modifyDomAfterNoteDelete()))}_modifyDomAfterListDelete(){this.anchorElement.remove(),document.querySelector(this.options.listContentSelector).getAttribute("data-wishlist-id")===this.options.id?window.location.href=this.options.baseUrl:this._removeLoadingIndicator(this.contentElement)}_modifyDomAfterNoteDelete(){this.anchorElement.remove();let t=document.querySelector("[data-wishlist-list] .nav-link.active .list-name-count");null!==t&&(t.innerText=parseInt(t.innerText)-1)}}y.options={id:"",postUrl:"",baseUrl:"",type:"",useModal:"",listContentSelector:"[data-wishlist-id]",listListSelector:"[data-wishlist-list]"};class _ extends o{init(){if(!this.options.listId||!this.options.postUrl)throw Error("listId missing");this.currentVisibility=this.el.getAttribute("data-wishlist-visibility"),this.newVisibility="public"==this.currentVisibility?"private":"public",this.anchorElement=this.el.closest("a"),this.socialMediaContentSelector=document.querySelector(this.options.socialMediaContentSelector),this._registerEventListeners()}_registerEventListeners(){let t=(d.isTouchDevice(),"click");this.el.addEventListener(t,this._onClickChangeVisibility.bind(this))}_onClickChangeVisibility(t){t.preventDefault(),this._createLoadingIndicator(this.anchorElement),this._sendRequest()}_sendRequest(){var t={listId:this.options.listId,public:"public"===this.newVisibility?1:0};new a(window.accessKey,window.contextToken).post(this.options.postUrl,JSON.stringify(t),t=>this._afterChangeList(t))}_createLoadingIndicator(t){b.create(t)}_removeLoadingIndicator(t){b.remove(t)}_afterChangeList(t){this._removeLoadingIndicator(this.anchorElement);try{t=JSON.parse(t)}catch(t){return!1}t.success&&(document.$emitter.publish("afterListedVisibilityChanged"),this._toggleIcon(),this._toggleSocialMediaIcons(),document.querySelector(this.options.listContentSelector).getAttribute("data-wishlist-id")===this.options.listId&&this._toggleInfoText())}_toggleIcon(){var t=this.el.parentElement,e=t.querySelector("[data-wishlist-visibility='public']"),i=t.querySelector("[data-wishlist-visibility='private']");"public"==this.newVisibility&&(e.classList.remove("d-none"),i.classList.add("d-none")),"private"==this.newVisibility&&(e.classList.add("d-none"),i.classList.remove("d-none"))}_toggleSocialMediaIcons(){this.socialMediaContentSelector&&("public"==this.newVisibility?this.socialMediaContentSelector.classList.remove("d-none"):this.socialMediaContentSelector.classList.add("d-none"))}_toggleInfoText(){var t=document.querySelector("[data-wishlist-visibility-info]");null!==t&&("public"==this.newVisibility?t.classList.remove("d-none"):t.classList.add("d-none"))}}_.options={listId:"",postUrl:"",baseUrl:"",listContentSelector:"[data-wishlist-id]",socialMediaContentSelector:"[data-wishlist-share]"};class f extends o{init(){if(!this.options.listId||!this.options.postUrl)throw Error("listId missing");this.anchorElement=this.el.closest("a"),this.htmlListItem=this.anchorElement.querySelector(".list-name-text"),this.htmlInputWrapper=this.anchorElement.querySelector(".list-name-input"),this.htmlInputField=this.htmlInputWrapper.querySelector("input"),this.htmlHeadlineItem=document.querySelector("#wishlist-list-headline"),this._registerEventListeners()}_registerEventListeners(){let t=(d.isTouchDevice(),"click");this.el.addEventListener(t,this._onClickRename.bind(this)),document.addEventListener("keypress",this._onKeyPress.bind(this))}_onClickRename(t){if(t.preventDefault(),t.stopPropagation(),this.htmlInputWrapper.classList.contains("d-none"))this._saveOriginalHref(),this._toggleFormField();else{if(this._restoreOriginalHref(),this._toggleFormField(),this.newName=this.htmlInputField.value.trim(),this.oldName=this.htmlListItem.childNodes[0].nodeValue.trim(),this.newName===this.oldName||""===this.newName)return;this._renameInDom(),this._sendRequest()}}_onKeyPress(t){this.htmlInputWrapper.classList.contains("d-none")||("Enter"===t.key&&this.el.click(),"Escape"===t.key&&this._toggleFormField())}_sendRequest(){var t={listId:this.options.listId,listName:this.htmlInputField.value};new a(window.accessKey,window.contextToken).post(this.options.postUrl,JSON.stringify(t),t=>this._afterRenameList(t))}_renameInDom(){this.htmlListItem.childNodes[0].nodeValue=this.newName,document.querySelector(this.options.listContentSelector).getAttribute("data-wishlist-id")===this.options.listId&&(this.htmlHeadlineItem.innerText=this.newName)}
1_afterRenameList(t){try{t=JSON.parse(t)}catch(t){return!1}t.success&&document.$emitter.publish("afterListRenamed")}_toggleFormField(){this.htmlListItem.classList.contains("d-none")?(this.htmlListItem.classList.remove("d-none"),this.htmlInputWrapper.classList.add("d-none"),this.el.querySelector(".non-edit-mode").classList.remove("d-none"),this.el.querySelector(".edit-mode").classList.add("d-none")):(this.htmlListItem.classList.add("d-none"),this.htmlInputWrapper.classList.remove("d-none"),this.el.querySelector(".non-edit-mode").classList.add("d-none"),this.el.querySelector(".edit-mode").classList.remove("d-none"),this.htmlInputField.focus())}_saveOriginalHref(){this.originalHref=this.anchorElement.getAttribute("href"),this.anchorElement.removeAttribute("href")}_restoreOriginalHref(){if(null==this.originalHref)throw Error("Save original href first before restoring it");this.anchorElement.setAttribute("href",this.originalHref)}}f.options={listId:"",postUrl:"",listContentSelector:"[data-wishlist-id]"};class v extends o{init(){if("FORM"!==this.el.tagName)throw Error("WishlistExport Plug-In needs to be initialized on a form");this._registerEventListeners()}_registerEventListeners(){let t=(d.isTouchDevice(),"click");this.el.querySelector(".wishlist-action-btn").addEventListener(t,this._onClickExport.bind(this))}_onClickExport(t){t.preventDefault(),this.el.submit()}}v.options={};class w{static serialize(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==t.nodeName){if(e)throw Error("The passed element is not a form!");return{}}return new FormData(t)}static serializeJson(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=w.serialize(t,e);if(0===Object.keys(i).length)return{};let s={};return h.iterate(i,(t,e)=>s[e]=t),s}}class E extends o{init(){if("FORM"!==this.el.tagName)throw Error("WishlistImport Plug-In needs to be initialized on a form");if(this.fileUploadInput=this.el.querySelector("input[type='file']"),!this.fileUploadInput)throw Error("WishlistImport needs an invisible Input file form field");this.list=document.querySelector("[data-wishlist-list]"),this._registerEventListeners()}_registerEventListeners(){let t=(d.isTouchDevice(),"click");this.el.querySelector(".wishlist-action-btn").addEventListener(t,this._onClickImport.bind(this)),this.fileUploadInput.addEventListener("change",this._onImportFileSelected.bind(this))}_onClickImport(t){t.preventDefault(),this.fileUploadInput.click()}_onImportFileSelected(){null!==this.list&&this._createLoadingIndicator(this.list),this._sendRequest()}_sendRequest(){new a(window.accessKey,window.contextToken).post(this.el.getAttribute("action"),this._getFormData(),t=>this._afterListImported(t))}_afterListImported(t){null!==this.list&&this._removeLoadingIndicator(this.list);try{t=JSON.parse(t)}catch(t){return window.location.reload(),!1}if(!t.success){window.location.reload();return}document.$emitter.publish("afterListImported"),window.location.reload()}_getFormData(){return w.serialize(this.el)}_createLoadingIndicator(t){b.create(t)}_removeLoadingIndicator(t){b.remove(t)}}E.options={};class I extends o{init(){if(this.options.disable)return!0;if(!this.options.noteId||!this.options.postUrl||!this.options.productId)throw Error("noteId, productId or PostUrl missing");this.anchorElement=this.el.closest("[data-wishlist-note-id]"),this._registerEventListeners()}_registerEventListeners(){this.el.addEventListener("change",this._onChangeQuantity.bind(this))}_onChangeQuantity(){this._createLoadingIndicator(this.anchorElement),this._sendRequest()}_sendRequest(){var t={noteId:this.options.noteId,productId:this.options.productId,quantity:this.el.value.trim()};new a(window.accessKey,window.contextToken).post(this.options.postUrl,JSON.stringify(t),t=>this._afterChangeQuantity(t))}_afterChangeQuantity(t){this._removeLoadingIndicator(this.anchorElement);try{t=JSON.parse(t)}catch(t){return!1}if(t.success){if(document.$emitter.publish("afterWishlistNoteQuantityChanged",{response:t}),null===t.data.priceQty||"true"===this.options.reload)window.location.reload();else{let e=t.data.priceQty,i=t.data.priceSum;this.anchorElement.querySelector('[data-price-type="unit-price"] span').innerHTML=e,this.anchorElement.querySelector('[data-price-type="total-price"] span').innerHTML=i}}}_createLoadingIndicator(t){b.create(t)}_removeLoadingIndicator(t){b.remove(t)}}I.options={noteId:"",postUrl:"",productId:"",reload:"false",disable:!1};class L extends o{init(){this._registerEventListeners()}_registerEventListeners(){"all"===this.options.selectionType?this.el.addEventListener("change",this._onChangeSelectionAllCheckbox.bind(this)):this.el.addEventListener("change",this._onChangeSelectionCheckbox.bind(this))}_onChangeSelectionCheckbox(){this.el.checked?this._addNoteToForm(this.options.productId,this.options.noteId,this._getQuantity(this.options.noteId)):this._removeNoteFromFormByProductId(this.options.productId),this._handleButtonVisibility()}
1_onChangeSelectionAllCheckbox(){this.el.checked?(this._clearCartForm(),this._addAllNotesToCartForm(),this._checkBoxes(!0)):(this._clearCartForm(),this._checkBoxes(!1)),this._handleButtonVisibility()}_handleButtonVisibility(){var t=document.querySelector(this.options.addToCartFormSelector).querySelector(".btn-buy");this._hasElementsInForm()?(t.classList.remove("disabled"),t.removeAttribute("disabled")):(t.classList.add("disabled"),t.setAttribute("disabled","disabled"))}_addAllNotesToCartForm(){document.querySelectorAll("[data-wishlist-note-id]").forEach(function(t){if(!t.querySelector("[data-wishlist-note-selection]"))return;let e=t.getAttribute("data-wishlist-note-id"),i=t.getAttribute("data-wishlist-product-id"),s=this._getQuantity(e);this._addNoteToForm(i,e,s)},this)}_checkBoxes(t){document.querySelectorAll(this.options.allCheckboxSelector).forEach(e=>e.checked=t)}_removeNoteFromFormByProductId(t){document.querySelector(this.options.addToCartFormSelector).querySelectorAll('input[name^="lineItems['+t+']"]').forEach(t=>t.parentNode.removeChild(t))}_addNoteToForm(t,e,i){var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("name","lineItems["+t+"][id]"),s.setAttribute("data-wishlist-cart-note",e),s.setAttribute("value",t);var r=document.createElement("input");r.setAttribute("type","hidden"),r.setAttribute("name","lineItems["+t+"][referencedId]"),r.setAttribute("data-wishlist-cart-note",e),r.setAttribute("value",t);var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name","lineItems["+t+"][type]"),n.setAttribute("data-wishlist-cart-note",e),n.setAttribute("value","product");var o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("name","lineItems["+t+"][quantity]"),o.setAttribute("data-wishlist-cart-note",e),o.setAttribute("value",i);var a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","lineItems["+t+"][stackable]"),a.setAttribute("value",!0);var l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name","lineItems["+t+"][removable]"),l.setAttribute("value",!0);var d=document.querySelector(this.options.addToCartFormSelector);d.appendChild(s),d.appendChild(r),d.appendChild(n),d.appendChild(o),d.appendChild(a),d.appendChild(l)}_getQuantity(t){var e=document.querySelector("[data-wishlist-note-id='"+t+"']");if(!e)return 1;var i=e.querySelector("[data-wishlist-quantity]");return i?i.value:1}_getProductIdByNoteId(t){return document.querySelector("[data-wishlist-note-id='"+t+"']").getAttribute("data-wishlist-product-id")}_isNoteInCart(t){return null!==document.querySelector(this.options.addToCartFormSelector).querySelector("input[data-wishlist-cart-note='"+t+"']")}_hasElementsInForm(){return null!==document.querySelector(this.options.addToCartFormSelector).querySelector("input[data-wishlist-cart-note]")}_clearCartForm(){document.querySelector(this.options.addToCartFormSelector).querySelectorAll("input[data-wishlist-cart-note]").forEach(t=>t.parentNode.removeChild(t))}reloadNoteInCartForm(){this._isNoteInCart(this.options.noteId)&&(this.removeNoteFromFormByNoteId(this.options.noteId),this._addNoteToForm(this.options.productId,this.options.noteId,this._getQuantity(this.options.noteId)))}removeNoteFromFormByNoteId(t){document.querySelector(this.options.addToCartFormSelector).querySelectorAll("input[data-wishlist-cart-note='"+t+"']").forEach(t=>t.parentNode.removeChild(t))}}L.options={selectionType:"note",allCheckboxSelector:"[data-wishlist-note-selection]",addToCartFormSelector:"[data-wishlist-id] [data-add-to-cart]",productId:"",noteId:""};class S extends o{init(){document.$emitter.subscribe("afterNoteDeleted",t=>{t.detail.response.data&&this._removeFromAddToCartForm(t.detail.response.data.noteId)}),document.$emitter.subscribe("afterWishlistNoteQuantityChanged",t=>{t.detail.response.data&&this._updateCartFormNotes(t.detail.response.data.noteId)})}_getCheckbox(t){return document.querySelector("[data-wishlist-note-id='"+t+"']").querySelector("[data-wishlist-note-selection]")}_updateCartFormNotes(t){var e=this._getCheckbox(t);window.PluginManager.getPluginInstanceFromElement(e,"WishlistNoteSelection").reloadNoteInCartForm()}_removeFromAddToCartForm(t){document.querySelector(this.options.addToCartFormSelector).querySelectorAll("input[data-wishlist-cart-note='"+t+"']").forEach(t=>t.parentNode.removeChild(t))}}S.options={addToCartFormSelector:"[data-wishlist-id] [data-add-to-cart]"};class q extends o{init(){this.successMessageElement=r.querySelector(this.el,this.options.successIdentifier),this.errorMessageElement=r.querySelector(this.el,this.options.errorIdentifier),this.skuFormField=r.querySelector(this.el,this.options.skuFormFieldIdentifier),this.quantityFormField=r.querySelector(this.el,this.options.quantityFormFieldIdentifier),this._registerAjaxCallbacks()}_registerAjaxCallbacks(){if(PluginManager.getPluginInstanceFromElement(this.el,"FormAjaxSubmit")){let t=document.getElementById("submit-add-manual-form-btn");this.$emitter.subscribe("beforeSubmit",()=>{b.create(t)}),this.$emitter.subscribe("onAfterAjaxSubmit",e=>{this._handleResponse(e.detail.response),b.remove(t)})}}_handleResponse(t){try{t=JSON.parse(t)}catch(t){return this._addedError()}if(t.success&&"true"==this.el.getAttribute("data-wishlist-add-manual-note-autorefresh")){window.location.reload();return}return t.success?this._addedSuccess():this._addedError()}_addedSuccess(){this.successMessageElement.classList.remove("d-none"),this.errorMessageElement.classList.add("d-none"),this._clearForm()}_addedError(){this.successMessageElement.classList.add("d-none"),this.errorMessageElement.classList.remove("d-none"),this._focusSkuFormField()}_clearForm(){this.quantityFormField.value="",this.skuFormField.value="",this._focusSkuFormField()}_focusSkuFormField(){this.skuFormField.focus()}}q.options={successIdentifier:"#add-manual-success",errorIdentifier:"#add-manual-error",skuFormFieldIdentifier:"input[name='sku']",quantityFormFieldIdentifier:"input[name='quantity']"};class C extends o{init(){if(null===this.options.url)throw Error("Missing required parameter 'url'");b.create(this.el),this._fetch()}_fetch(){new a(window.accessKey,window.contextToken).get(this.options.url,t=>this._postProcessResult(t))}_postProcessResult(t){b.remove(this.el),this.el.outerHTML=t,window.PluginManager.initializePlugins()}}C.options={url:null};let F=window.PluginManager;F.register("WishlistBubble",l,"[data-wishlist-bubble]"),F.register("WishlistModalCallbacks",c,"[data-wishlist-modal-callbacks]"),F.register("WishlistDelete",y,"[data-wishlist-delete]"),F.register("WishlistVisibility",_,"[data-wishlist-visibility]"),F.register("WishlistQuantity",I,"[data-wishlist-quantity]"),F.register("WishlistRename",f,"[data-wishlist-rename]"),F.register("WishlistExport",v,"[data-wishlist-export]"),F.register("WishlistImport",E,"[data-wishlist-import]"),F.register("WishlistNoteSelection",L,"[data-wishlist-note-selection]"),F.register("WishlistCartCallbacks",S,"[data-wishlist-cart-callbacks]"),F.register("WishlistAddManualNotePlugin",q,"[data-wishlist-add-manual-note]"),F.register("WishlistProductLoader",C,"[data-wishlist-product-loader]")})()})();

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.