PageSourceSearch

https://www.nebelung.de/theme/fc6be77f01289e2dacedb59fa252fa79/js/…ng-list.shopping-list-item.plugin.c50faa.js

js nebelung.de collected 2026-10-02 10:59:01 UTC 12,320 bytes, 9 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6072],{156:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function i(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||i,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c,u,h=Array.isArray(r);return h!==Array.isArray(e)?s(r,l):h?l.arrayMerge(e,r,l):(u={},(c=l).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=s(e[t],c)}),n(r).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&c.isMergeableObject(r[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,c)(e[t],r[t],c):u[t]=s(r[t],c))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})},e.exports=a},59:(e,t,r)=>{r.d(t,{A:()=>s});class s{static debounce(e,t){let r,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var i=arguments.length,n=Array(i),o=0;o<i;o++)n[o]=arguments[o];s&&!r&&setTimeout(e.bind(e,...n),0),clearTimeout(r),r=setTimeout(e.bind(e,...n),t)}}}},749:(e,t,r)=>{r.d(t,{A:()=>i});let s=Object.freeze(new class{constructor(){this._domParser=new DOMParser}replaceFromMarkup(e,t){let r=e;"string"==typeof r&&(r=this._createMarkupFromString(r)),"string"==typeof t&&(t=[t]),this._replaceSelectors(r,t)}replaceElement(e,t){return("string"==typeof e&&(e=document.querySelectorAll(e)),"string"==typeof t&&(t=document.querySelectorAll(t)),e instanceof NodeList&&t instanceof NodeList&&t.length>e.length)?(t.forEach(t=>{e.forEach(e=>{e.innerHTML&&e.className===t.className&&(t.innerHTML=e.innerHTML)})}),!0):e instanceof NodeList&&e.length?(e.forEach((e,r)=>{e.innerHTML&&(t[r].innerHTML=e.innerHTML)}),!0):t instanceof NodeList&&t.length?(t.forEach(t=>{e.innerHTML&&(t.innerHTML=e.innerHTML)}),!0):!!t&&!!e&&!!e.innerHTML&&(t.innerHTML=e.innerHTML,!0)}_replaceSelectors(e,t){t.forEach(t=>{let r=e.querySelectorAll(t),s=document.querySelectorAll(t);this.replaceElement(r,s)})}_createMarkupFromString(e){return this._domParser.parseFromString(e,"text/html")}});
1class i{static replaceFromMarkup(e,t){s.replaceFromMarkup(e,t)}static replaceElement(e,t){return s.replaceElement(e,t)}}},373:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(156),i=r.n(s);class n{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let r=n.toUpperCamelCase(e,t);return n.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>n.ucFirst(e.toLowerCase())).join(""):n.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class o{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(s),s}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,i=e.split("."),n=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=n;n=function(r){s.unsubscribe(e),t(r)}}return this.el.addEventListener(i[0],n),this.listeners.push({splitEventName:i,opts:r,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class a{constructor(e,t={},r=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${r}".`);return}this.el=e,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),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(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),i().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${t}-config`);return r?window.PluginConfigManager.get(this._pluginName,r):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${t}-options`);if(r)try{return JSON.parse(r)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}},68:(e,t,r)=>{r.d(t,{A:()=>s});class s{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,r);return this._sendRequest(s,null,t)}post(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let i=this._createPreparedRequest("POST",e,s);return this._sendRequest(i,t,r)}delete(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let i=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(i,t,r)}patch(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let i=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(i,t,r)}
1abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,r){return this._registerOnLoaded(e,r),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,r){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}}},724:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(683);let i="element-loader-backdrop";class n extends s.A{static create(e){e.classList.add("has-element-loader"),n.exists(e)||(n.appendLoader(e),setTimeout(()=>{let t=e.querySelector(`.${i}`);t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(`.${i}`);t&&t.remove()}static exists(e){return e.querySelectorAll(`.${i}`).length>0}static getTemplate(){return`
2        <div class="${i}">
3            <div class="loader" role="status">
4                <span class="visually-hidden">Loading...</span>
5            </div>
6        </div>
7        `}static appendLoader(e){e.insertAdjacentHTML("beforeend",n.getTemplate())}}},683:(e,t,r)=>{r.d(t,{A:()=>n});let s="loader",i={BEFORE:"before",INNER:"inner"};class n{constructor(e,t=i.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===i.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=n.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),n.getTemplate())}}remove(){if(this.position===i.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${s}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${s}`).length>0}_getPosition(){return this.position===i.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${s}" role="status">
8                    <span class="visually-hidden">Loading...</span>
9                </div>`}static SELECTOR_CLASS(){return s}}},72:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(373),i=r(68),n=r(724),o=r(749),a=r(59);class l extends s.A{init(){this.httpClient=new i.A,this.removeButton=this.el.querySelector(this.options.selectors.removeButton),this.quantityButtons=this.el.querySelectorAll(this.options.selectors.quantityButton),this.quantityInput=this.el.querySelector(this.options.selectors.quantityInput),this.searchInput=document.querySelector(this.options.selectors.searchInput),this.shoppingListDetailPage=document.querySelector(this.options.selectors.shoppingListDetail),this._registerEvents()}_registerEvents(){this.removeButton&&this.removeButton.addEventListener("click",this._onRemoveLineItem.bind(this)),this.quantityButtons.length>0&&this.quantityButtons.forEach(e=>{e.addEventListener("click",this._onChangeQuantity.bind(this))}),this.quantityInput&&this.quantityInput.addEventListener("input",a.A.debounce(this._onChangeQuantity.bind(this),this.options.configurations.changeDelay))}_onRemoveLineItem(){n.A.create(this.shoppingListDetailPage),this.httpClient.delete(window.router["frontend.account.shopping-list.line-item.remove"],JSON.stringify({ids:[this.options.listItemId],forwardTo:"frontend.account.shopping-list.line-item.sub-detail",forwardParameters:{id:this.options.shoppingListId}}),this._callBackAfterRemove.bind(this))}_callBackAfterRemove(e){if(!new DOMParser().parseFromString(e,"text/html").querySelectorAll(this.options.selectors.lineItem).length)return window.location.reload();o.A.replaceFromMarkup(e,this.options.selectors.listBodyDetail,!1),e&&this.options.selectors.addToCartButtonSelector&&o.A.replaceFromMarkup(e,this.options.selectors.addToCartButtonSelector,!1),n.A.remove(this.shoppingListDetailPage);let t=document.querySelector(this.options.selectors.summaryForm);t&&t.dispatchEvent(new Event("submit",{cancelable:!0}))}_onChangeQuantity(){let e=this.el.querySelector(this.options.selectors.quantityChangeFormSelector),t=this.searchInput?.value,r=e.getAttribute("action"),s=window.router["frontend.account.shopping-list.line-item.change-quantity"].replace("/id/",`/${this.options.listItemId}/`);t&&e.setAttribute("action",`${r}&search=${t}`),this.httpClient.patch(s,JSON.stringify({quantity:this.quantityInput.value??1,forwardTo:"frontend.account.shopping-list.line-item.sub-detail",forwardParameters:{id:this.options.shoppingListId}}),this._callBackAfterChange.bind(this))}_callBackAfterChange(e){this.el.querySelector(this.options.selectors.quantityChangeFormSelector).dispatchEvent(new Event("submit",{cancelable:!0}));let t=document.querySelector(this.options.selectors.summaryForm);t&&t.dispatchEvent(new Event("submit",{cancelable:!0})),e&&this.options.selectors.addToCartButtonSelector&&o.A.replaceFromMarkup(e,this.options.selectors.addToCartButtonSelector,!1)}}}}]);

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.