PageSourceSearch

https://www.nebelung.de/theme/fc6be77f01289e2dacedb59fa252fa79/js/…opping-list-fetch-dropdown.plugin.4b90d6.js

js nebelung.de collected 2026-10-02 10:59:04 UTC 7,983 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[23803],{156: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 r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function s(t,e,i){return t.concat(e).map(function(t){return r(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||s,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=r;var u,c,h=Array.isArray(i);return h!==Array.isArray(t)?r(i,l):h?l.arrayMerge(t,i,l):(c={},(u=l).isMergeableObject(t)&&n(t).forEach(function(e){c[e]=r(t[e],u)}),n(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&u.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,u)(t[e],i[e],u):c[e]=r(i[e],u))}),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},373:(t,e,i)=>{i.d(e,{A:()=>a});var r=i(156),s=i.n(r);class n{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=n.toUpperCamelCase(t,e);return n.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,s=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){r.unsubscribe(t),e(i)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,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}}class a{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),s().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return 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}}},68:(t,e,i)=>{i.d(e,{A:()=>r});
1class r{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",t,i);return this._sendRequest(r,null,e)}post(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let s=this._createPreparedRequest("POST",t,r);return this._sendRequest(s,e,i)}delete(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let s=this._createPreparedRequest("DELETE",t,r);return this._sendRequest(s,e,i)}patch(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(e,r);let s=this._createPreparedRequest("PATCH",t,r);return this._sendRequest(s,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 ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${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}}},803:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});var r=i(373),s=i(68);let n="d-none";class o extends r.A{init(){if(this.httpClient=new s.A,document.$emitter.subscribe("ShoppingList/fetchDropdownListItem",this._fetchDataHandler.bind(this)),this.options.initialFetchItems){this._fetchDataHandler();return}this.el.addEventListener("click",this._fetchDataHandler.bind(this))}_fetchDataHandler(){let t=document.querySelector(this.options.dropdownContainerSelector),e=t?.querySelector(this.options.dropdownLoadingSelector),i=t?.querySelectorAll(this.options.dropdownSelector);this.options.initialFetchItems||(this.el.disabled=!0),e?.classList.remove(n),i?.forEach(t=>{t.outerHTML=""});let[r,s]=window.router["frontend.account.shopping-lists.dropdown"].split("?"),o=this.el.dataset.productId?`${r}/${this.el.dataset.productId}${s?"?"+s:""}`:window.router["frontend.account.shopping-lists.dropdown"];this.httpClient.get(o,this._dropdownCallback.bind(this))}_dropdownCallback(t){if(t){let e=document.querySelector(this.options.dropdownContainerSelector),i=e?.querySelector(this.options.dropdownLoadingSelector);i?.classList.add(n),e?.insertAdjacentHTML("beforeend",t);let r=e?.querySelector(this.options.createListSelector);r&&(r.dataset.productId=this.el.dataset.productId,PluginManager.initializePlugin("B2bShoppingListDelegation",r))}this.options.initialFetchItems||(this.el.disabled=!1),this.options.hasWishlist&&PluginManager.initializePlugin("AddToWishlist",this.options.wishlistSelector)}}}}]);

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.