1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[69651],{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!==s},s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function i(e,t,s){return e.concat(t).map(function(e){return r(e,s)})}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,s,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=r;var l,u,h=Array.isArray(s);return h!==Array.isArray(e)?r(s,c):h?c.arrayMerge(e,s,c):(u={},(l=c).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=r(e[t],l)}),n(s).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&l.isMergeableObject(s[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var s=t.customMerge(e);return"function"==typeof s?s:a})(t,l)(e[t],s[t],l):u[t]=r(s[t],l))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,s){return a(e,s,t)},{})},e.exports=a},154:(e,t,s)=>{s.d(t,{A:()=>r});class r{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var s of e.entries())t(s[1],s[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(s=>{t(e[s],s)});throw Error(`The element type ${typeof e} is not iterable!`)}}},373:(e,t,s)=>{s.d(t,{A:()=>a});var r=s(156),i=s.n(r);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 s=n.toUpperCamelCase(e,t);return n.lcFirst(s)}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]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(e,{detail:t,cancelable:s});return this.el.dispatchEvent(r),r}subscribe(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,i=e.split("."),n=s.scope?t.bind(s.scope):t;if(s.once&&!0===s.once){let t=n;n=function(s){r.unsubscribe(e),t(s)}}return this.el.addEventListener(i[0],n),this.listeners.push({splitEventName:i,opts:s,cb:n}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,s)=>([...s.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):e.push(s),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={},s=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${s}".`);return}this.el=e,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(s),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),s=this.el.getAttribute(`data-${t}-config`);return s?window.PluginConfigManager.get(this._pluginName,s):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.toDashCase(this._pluginName),s=this.el.getAttribute(`data-${t}-options`);if(s)try{return JSON.parse(s)}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,s)=>{s.d(t,{A:()=>r});
1class r{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",e,s);return this._sendRequest(r,null,t)}post(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let i=this._createPreparedRequest("POST",e,r);return this._sendRequest(i,t,s)}delete(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let i=this._createPreparedRequest("DELETE",e,r);return this._sendRequest(i,t,s)}patch(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let i=this._createPreparedRequest("PATCH",e,r);return this._sendRequest(i,t,s)}abort(){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,s){return this._registerOnLoaded(e,s),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,s){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}}},683:(e,t,s)=>{s.d(t,{A:()=>n});let r="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(`.${r}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${r}`).length>0}_getPosition(){return this.position===i.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${r}" role="status"> 2 <span class="visually-hidden">Loading...</span> 3 </div>`}static SELECTOR_CLASS(){return r}}},206:(e,t,s)=>{s.d(t,{A:()=>g});var r=s(683);class i{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return i.isIPhoneDevice()||i.isIPadDevice()}static isNativeWindowsBrowser(){return i.isIEBrowser()||i.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":i.isTouchDevice(),"is-ios":i.isIOSDevice(),"is-native-windows":i.isNativeWindowsBrowser(),"is-iphone":i.isIPhoneDevice(),"is-ipad":i.isIPadDevice(),"is-ie":i.isIEBrowser(),"is-edge":i.isEdgeBrowser()}}}let n="modal-backdrop",o="modal-backdrop-open",a="no-scroll",c={ON_CLICK:"backdrop/onclick"};class l{constructor(){return l.instance||(l.instance=this),l.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(a),setTimeout(function(){t.classList.add(o),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;this._getBackdrops().forEach(e=>e.classList.remove(o)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(a)}_dispatchEvents(){let e=i.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(n)&&document.dispatchEvent(new CustomEvent(c.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${n}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEac
3h(e=>e.remove())}_exists(){return document.querySelectorAll(`.${n}`).length>0}_getTemplate(){return`<div class="${n}"></div>`}}let u=Object.freeze(new l);class h{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.create(e)}static remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;u.remove(e)}static SELECTOR_CLASS(){return n}}class d extends r.A{constructor(){super(document.body)}create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&e&&(h.create(),document.querySelector(`.${h.SELECTOR_CLASS()}`).insertAdjacentHTML("beforeend",r.A.getTemplate()))}remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),e&&h.remove()}}let p=Object.freeze(new d);class g{static create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];p.create(e)}static remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];p.remove(e)}}},651:(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});var r=s(373),i=s(206),n=s(68),o=s(154);class a extends r.A{init(){this._client=new n.A,this._registerEvents()}_registerEvents(){this.el.addEventListener("click",this._onAddToCartButtonClick.bind(this))}_openOffCanvasCarts(){let e=window.PluginManager.getPluginInstances("OffCanvasCart");o.A.iterate(e,e=>this._openOffCanvasCart(e))}_openOffCanvasCart(e){e.openOffCanvas(window.router["frontend.cart.offcanvas"],!1,()=>{this.$emitter.publish("openOffCanvasCart")})}_formatDataIds(e){let t=new Map(JSON.parse(e));if(this.options.isAddMultipleProductsToCart){let e={};return Array.from(t.keys()).forEach(s=>{let{quantity:r,productId:i}=t.get(s);e[s]={id:i,quantity:parseInt(r),referencedId:i,stackable:!0,removable:!0,type:"product"}}),{lineItems:e}}return{ids:[...t.keys()]}}_onAddToCartButtonClick(){bootstrap.Modal.getInstance(this.el)&&bootstrap.Modal.getInstance(this.el).hide(),i.A.create();let e={};this.options.lineItems&&(e={lineItems:this.options.productItems}),this.el.dataset.ids&&(e=this._formatDataIds(this.el.dataset.ids)),this.options.shoppingListId&&(e={ids:[this.options.shoppingListId]}),this._client.post(this.options.addToCartUrl,JSON.stringify(e),this._onAfterAjaxSubmit.bind(this))}_onAfterAjaxSubmit(){i.A.remove(),this._openOffCanvasCarts()}}}}]);
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.