PageSourceSearch

https://epowerfun.de/theme/4dd8da1a399ad0e40f3e3251a279ac73/js/sho…/shopping-list.listing.plugin.f59a05.js

js epowerfun.de collected 2026-09-24 12:20:59 UTC 19,452 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8184],{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!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function s(t,e,r){return t.concat(e).map(function(t){return i(t,r)})}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,r,c){(c=c||{}).arrayMerge=c.arrayMerge||s,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=i;var d,l,u=Array.isArray(r);return u!==Array.isArray(t)?i(r,c):u?c.arrayMerge(t,r,c):(l={},(d=c).isMergeableObject(t)&&n(t).forEach(function(e){l[e]=i(t[e],d)}),n(r).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&d.isMergeableObject(r[e])?l[e]=(function(t,e){if(!e.customMerge)return a;var r=e.customMerge(t);return"function"==typeof r?r:a})(e,d)(t[e],r[e],d):l[e]=i(r[e],d))}),l)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return a(t,r,e)},{})},t.exports=a},49:(t,e,r)=>{r.d(e,{Z:()=>s});var i=r(140);class s{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!s.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 r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===s.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),o=i.Z.toLowerCamelCase(n,"-");if(!s.isNode(t)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let a=t.dataset[o];if(void 0===a){if(r)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return a}return i.Z.parsePrimitive(a)}static querySelector(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let i=t.querySelector(e)||!1;if(r&&!1===i)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return i}static querySelectorAll(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!s.isNode(t))throw Error("The parent node is not a valid HTML Node!");let i=t.querySelectorAll(e);if(0===i.length&&(i=!1),r&&!1===i)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return i}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([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]}}},266:(t,e,r)=>{r.d(e,{Z:()=>i});class i{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var r of t.entries())e(r[1],r[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(r=>{e(t[r],r)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}},140:(t,e,r)=>{r.d(e,{Z:()=>i});
1class i{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 r=i.toUpperCamelCase(t,e);return i.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>i.ucFirst(t.toLowerCase())).join(""):i.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},293:(t,e,r)=>{r.d(e,{Z:()=>c});var i=r(857),s=r.n(i),n=r(49),o=r(140);class a{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(i),i}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,s=t.split("."),n=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=n;n=function(r){i.unsubscribe(t),e(r)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:r,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),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 c{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 e=o.Z.toDashCase(this._pluginName),r=n.Z.getDataAttribute(this.el,"data-".concat(e,"-config"),!1),i=n.Z.getAttribute(this.el,"data-".concat(e,"-options"),!1),a=[this.constructor.options,this.options,t];r&&a.push(window.PluginConfigManager.get(this._pluginName,r));try{i&&a.push(JSON.parse(i))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(e,'-options" could not be parsed to json: ').concat(t.message))}return s().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={},r=!1){if(!n.Z.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}},107:(t,e,r)=>{r.d(e,{Z:()=>i});class i{get(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",t,r);return this._sendRequest(i,null,e)}post(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let s=this._createPreparedRequest("POST",t,i);return this._sendRequest(s,e,r)}delete(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let s=this._createPreparedRequest("DELETE",t,i);return this._sendRequest(s,e,r)}patch(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let s=this._createPreparedRequest("PATCH",t,i);return this._sendRequest(s,e,r)}
1abort(){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,r){return this._registerOnLoaded(t,r),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,r){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}},363:(t,e,r)=>{r.d(e,{Z:()=>o});var i=r(266);let s="loader",n={BEFORE:"before",INNER:"inner"};class o{create(){if(!this.exists()){if(this.position===n.INNER){this.parent.innerHTML=o.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),o.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(s));i.Z.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(s)).length>0}_getPosition(){return this.position===n.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(s,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return s}constructor(t,e=n.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}},551:(t,e,r)=>{r.d(e,{Z:()=>b});var i=r(363);class s{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return s.isIPhoneDevice()||s.isIPadDevice()}static isNativeWindowsBrowser(){return s.isIEBrowser()||s.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":s.isTouchDevice(),"is-ios":s.isIOSDevice(),"is-native-windows":s.isNativeWindowsBrowser(),"is-iphone":s.isIPhoneDevice(),"is-ipad":s.isIPadDevice(),"is-ie":s.isIEBrowser(),"is-edge":s.isEdgeBrowser()}}}var n=r(266);let o="modal-backdrop",a="modal-backdrop-open",c="no-scroll",d={ON_CLICK:"backdrop/onclick"};class l{create(t){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let e=document.body.lastChild;document.documentElement.classList.add(c),setTimeout(function(){e.classList.add(a),"function"==typeof t&&t()},75),this._dispatchEvents()}remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350,e=this._getBackdrops();n.Z.iterate(e,t=>t.classList.remove(a)),setTimeout(this._removeExistingBackdrops.bind(this),t),document.documentElement.classList.remove(c)}_dispatchEvents(){let t=s.isTouchDevice()?"touchstart":"click";document.addEventListener(t,function(t){t.target.classList.contains(o)&&document.dispatchEvent(new CustomEvent(d.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(".".concat(o))}_removeExistingBackdrops(){if(!1===this._exists())return;let t=this._getBackdrops();n.Z.iterate(t,t=>t.remove())}_exists(){return document.querySelectorAll(".".concat(o)).length>0}_getTemplate(){return'<div class="'.concat(o,'"></div>')}constructor(){return l.instance||(l.instance=this),l.instance}}let u=Object.freeze(new l);class h{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.create(t)}static remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;u.remove(t)}static SELECTOR_CLASS(){return o}}class p extends i.Z{create(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&t&&(h.create(),document.querySelector(".".concat(h.SELECTOR_CLASS())).insertAdjacentHTML("beforeend",i.Z.getTemplate()))}remove(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),t&&h.remove()}constructor(){super(document.body)}}let m=Object.freeze(new p);class b{static create(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];m.create(t)}static remove(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];m.remove(t)}}},184:(t,e,r)=>{r.r(e),r.d(e,{default:()=>c});var i=r(293),s=r(107),n=r(266),o=r(551);class a extends i.Z{init(){this._addToCartModal=this.el.querySelector(this.options.addToCartModal),this._buttonAddToCart=this.el.querySelector(this.options.buttonAddToCart),this._buttonConfirmAddToCart=this.el.querySelector(this.options.buttonConfirmAddToCart),this._removeListModal=this.el.querySelector(this.options.removeListModal),this._buttonRemoveList=this.el.querySelector(this.options.buttonRemoveList),this._buttonConfirmRemove=this.el.querySelector(this.options.buttonConfirmRemove),this._buttonUploadCSV=this.el.querySelector(this.options.buttonUploadCSV),this._emptyRow=this.el.querySelector(".".concat(this.options.emptyItemClassName)).cloneNode(!0),this._notFoundItemsAlert=this.el.querySelector(this.options.notFoundItemsAlert).cloneNode(!0),this._duplicatedItemAlert=this.el.querySelector(this.options.duplicatedItemAlert).cloneNode(!0),this._client=new s.Z,this._getBaseQuickOrder(),this._registerEvents()}_registerEvents(){this._buttonConfirmAddToCart.addEventListener("click",this._handleAddToCart.bind(this)),this._buttonConfirmRemove.addEventListener("click",this._clearList.bind(this)),document.$emitter.subscribe("QuickOrder/onProductsLoaded",this._renderProductList.bind(this)),this.$emitter.subscribe("QuickOrder/updateNotFoundProducts",this._showNotFoundItems.bind(this)),this.$emitter.subscribe("QuickOrder/updateDuplicatedItem",this._showDuplicatedItem.bind(this)),window.addEventListener("beforeunload",this._beforeUnloadListener.bind(this))}_beforeUnloadListener(t){if(!this._baseQuickOrder.products.length)return;t.preventDefault();let e=this.options.reloadPageMessage;return o.Z.remove(),t.returnValue=e,e}_hideNotFoundItemsAlert(){let t=document.querySelector(this.options.notFoundItemsAlert);t&&!t.classList.contains("d-none")&&t.classList.add("d-none")}_hideDuplicatedItemAlert(){let t=document.querySelector(this.options.duplicatedItemAlert);t&&!t.classList.contains("d-none")&&t.classList.add("d-none")}_showNotFoundItems(t){let e=t.detail.notFoundProducts;if(!e.length){this._hideNotFoundItemsAlert();return}let r=document.querySelector(this.options.notFoundItemsAlert);if(!r){let t=document.querySelector(".quick-order-alert");t.appendChild(this._notFoundItemsAlert.cloneNode(!0)),r=t.querySelector(this.options.notFoundItemsAlert)}r.classList.remove("d-none"),r.querySelector(".alert-content-content").textContent=e.join(", "),r.addEventListener("closed.bs.alert",()=>{this._baseQuickOrder.updateNotFoundProducts([])})}_showDuplicatedItem(t){let e=t.detail.duplicatedItem;if(!e){this._hideDuplicatedItemAlert();return}let r=document.querySelector(this.options.duplicatedItemAlert);if(!r){let t=document.querySelector(".quick-order-alert");t.appendChild(this._duplicatedItemAlert.cloneNode(!0)),r=t.querySelector(this.options.duplicatedItemAlert)}r.classList.remove("d-none"),r.querySelector(".alert-content-content").textContent=e,r.addEventListener("closed.bs.alert",()=>{this._baseQuickOrder.updateDuplicatedItem("")})}_clearList(){this._handleRemoveList(),this._hideNotFoundItemsAlert(),this._hideDuplicatedItemAlert()}_handleRemoveList(){this._baseQuickOrder.resetProductList(),bootstrap.Modal.getInstance(this._removeListModal).hide()}_handleAddToCart(){bootstrap.Modal.getInstance(this._addToCartModal).hide(),this._confirmAddToCart()}_onAfterAjaxSubmit(){o.Z.remove(),this._openOffCanvasCarts()}_openOffCanvasCarts(){let t=window.PluginManager.getPluginInstances("OffCanvasCart");n.Z.iterate(t,t=>this._openOffCanvasCart(t)),this._baseQuickOrder.resetProductList()}_openOffCanvasCart(t){t.openOffCanvas(this.options.openCartOffCanvasUrl,!1,()=>{this.$emitter.publish("openOffCanvasCart")})}_convertArrayToObject(){let t={};
1return this._baseQuickOrder.products.forEach(e=>{t[e.id]={id:e.id,quantity:e.quantity,referencedId:e.id,stackable:!0,removable:!0,type:"product"}}),t}_confirmAddToCart(){o.Z.create();let t=this._convertArrayToObject();this._client.post(this.options.addToCartUrl,JSON.stringify({lineItems:t}),this._onAfterAjaxSubmit.bind(this))}_renderProductList(t){let e=t.detail.products,r=this.el.querySelector(this.options.productItemsList);if(r.innerHTML="",this._resetEmptyLine(),0===e.length){this._buttonAddToCart.disabled=!0,this._buttonRemoveList.disabled=!0,this._baseQuickOrder.products=[],window.PluginManager.initializePlugins();return}e.map(t=>{let e=this._emptyRow.cloneNode(!0);e.classList.remove(this.options.emptyItemClassName);let i=e.querySelector(this.options.itemNameInput),s=e.querySelector(this.options.itemQuantityInput),n=e.querySelector(this.options.itemQuantityGroup);e.querySelector(this.options.itemAction).classList.remove("d-none"),n.removeAttribute("disabled"),s.tabIndex=0,i.innerHTML="<strong>".concat(t.productNumber,"</strong> - ").concat(t.name),s.value=t.quantity,e.setAttribute("data-id",t.id),s.setAttribute("min",t.minPurchase),s.setAttribute("max",t.calculatedMaxPurchase),s.setAttribute("step",t.purchaseSteps),r.appendChild(e)}),window.PluginManager.initializePlugins(),this._buttonAddToCart.disabled=!1,this._buttonRemoveList.disabled=!1}_resetEmptyLine(){this.el.querySelector(".".concat(this.options.emptyItemClassName)).replaceWith(this._emptyRow.cloneNode(!0)),this.el.querySelector(".".concat(this.options.emptyItemClassName," ").concat(this.options.itemNameInput)).focus()}_getBaseQuickOrder(){this._baseQuickOrder=window.PluginManager.getPluginInstanceFromElement(document.querySelector('[data-b2b-base-quick-order="true"]'),"B2bBaseQuickOrder")}}a.options={productItemsList:".quick-order-content-list",productItem:".quick-order-line-item",emptyItemClassName:"quick-order-empty-item",buttonConfirmAddToCart:".btn-confirm-add-to-cart",buttonAddToCart:".btn-add-to-cart",buttonRemoveList:".btn-clear-list",buttonConfirmRemove:".btn-confirm-remove",buttonUploadCSV:".btn-csv-upload",addToCartModal:".add-to-cart-modal",removeListModal:".remove-list-modal",notFoundItemsAlert:"#notFoundItemsAlert",duplicatedItemAlert:"#duplicatedItemAlert",itemAction:".quick-order-item-action",itemNameInput:".input-product-name",itemQuantityInput:".input-product-quantity",itemQuantityGroup:".line-item-quantity-group"};class c extends a{init(){super.init(),this.buttonAddToList=this.el.querySelector(this.options.buttonAddToList)}_renderProductList(t){if(super._renderProductList(t),null!==this.buttonAddToList){if(0===t.detail.products.length){this.buttonAddToList.disabled=!0;return}this.buttonAddToList.disabled=!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.