1"use strict";(self.webpackChunkacris_filter_c_s=self.webpackChunkacris_filter_c_s||[]).push([[79467],{59(e,t,i){i.d(t,{A:()=>r});class r{static debounce(e,t){let i,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var s=arguments.length,n=Array(s),a=0;a<s;a++)n[a]=arguments[a];r&&!i&&setTimeout(e.bind(e,...n),0),clearTimeout(i),i=setTimeout(e.bind(e,...n),t)}}}},68(e,t,i){i.d(t,{A:()=>r});class r{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",e,i);return this._sendRequest(r,null,t)}post(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let s=this._createPreparedRequest("POST",e,r);return this._sendRequest(s,t,i)}delete(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let s=this._createPreparedRequest("DELETE",e,r);return this._sendRequest(s,t,i)}patch(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let s=this._createPreparedRequest("PATCH",e,r);return this._sendRequest(s,t,i)}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,i){return this._registerOnLoaded(e,i),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,i){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}},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!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l(Array.isArray(e)?[]:{},e,t):e}function s(e,t,i){return e.concat(t).map(function(e){return r(e,i)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function l(e,i,o){(o=o||{}).arrayMerge=o.arrayMerge||s,o.isMergeableObject=o.isMergeableObject||t,o.cloneUnlessOtherwiseSpecified=r;var c,h,u=Array.isArray(i);return u!==Array.isArray(e)?r(i,o):u?o.arrayMerge(e,i,o):(h={},(c=o).isMergeableObject(e)&&n(e).forEach(function(t){h[t]=r(e[t],c)}),n(i).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(i[t])?h[t]=(function(e,t){if(!t.customMerge)return l;var i=t.customMerge(e);return"function"==typeof i?i:l})(t,c)(e[t],i[t],c):h[t]=r(i[t],c))}),h)}l.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return l(e,i,t)},{})},e.exports=l},220(e,t,i){i.d(t,{A:()=>l});var r=i(156),s=i.n(r),n=i(707),a=i(308);class l{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new a.A(this.el),this._pluginName=this._getPluginName(i),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(){}destroy(){}
1_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()),s().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.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}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}}},308(e,t,i){i.d(t,{A:()=>r});class r{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,s=e.split("."),n=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=n;n=function(i){r.unsubscribe(e),t(i)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:i,cb:n}),!0}unsubscribe(e){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${e}.MyCustomPlugin"`);let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),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}}},467(e,t,i){i.r(t),i.d(t,{default:()=>d});var r=i(220),s=i(701),n=i(156),a=i.n(n);class l extends s.A{static #e=this.options=a()(s.A.options,{page:1,paginationItemSelector:".pagination .page-link",paginationNavSelector:".pagination-nav"});init(){this._initButtons(),this.tempValue=null,this._pageChanged=!1}_initButtons(){this.buttons=this.el.querySelectorAll(this.options.paginationItemSelector),this.buttons&&this._registerButtonEvents()}_registerButtonEvents(){this.buttons.forEach(e=>{e.addEventListener("click",this.onChangePage.bind(this))})}onChangePage(e){e.preventDefault(),this.tempValue=this._getPageNumber(e.currentTarget.dataset.page),this._saveFocusState(e.currentTarget),this._pageChanged=!0,this.listing.changeListing(),this._updateCanonicalUrl(this.tempValue),this.tempValue=null}_saveFocusState(e){let t=e.closest(this.options.paginationNavSelector).dataset.paginationLocation;this.listing.options.scrollTopListingWrapper&&(t="top"),window.focusHandler.saveFocusState("listing-pagination",`[data-pagination-location="${t}"] [data-focus-id="${e.dataset.focusId}"]`)}_resumeFocusState(){window.focusHandler.resumeFocusState("listing-pagination",{preventScroll:!0})}reset(){}resetAll(){}getValues(){return null!==this.tempValue?{p:this.tempValue}:{p:1}}afterContentChange(){this._initButtons(),this.buttons&&this._pageChanged&&this._resumeFocusState(),this._pageChanged=!1}getLabels(){return[]}setValuesFromUrl(e){let t=!1;if(this.tempValue=1,e.p){let i=this._getPageNumber(e.p);i!==this.tempValue&&(this.tempValue=i,t=!0)}return t}_updateCanonicalUrl(e){let t=document.querySelector('link[rel="canonical"]');if(t?.href){let i=new URL(t.href);e>1?i.searchParams.set("p",e):i.searchParams.delete("p"),t.href=i.href}}_getPageNumber(e){let t=parseInt(e,10);return Number.isInteger(t)?t:1}}var o=i(68);let c=Object.freeze(new class{constructor(){this._domParser=new DOMParser}replaceFromMarkup(e,t){let i=e;"string"==typeof i&&(i=this._createMarkupFromString(i)),"string"==typeof t&&(t=[t]),this._replaceSelectors(i,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=>
1{e.forEach(e=>{e.innerHTML&&e.className===t.className&&(t.innerHTML=e.innerHTML)})}),!0):e instanceof NodeList&&e.length?(e.forEach((e,i)=>{e.innerHTML&&(t[i].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 i=e.querySelectorAll(t),r=document.querySelectorAll(t);this.replaceElement(i,r)})}_createMarkupFromString(e){return this._domParser.parseFromString(e,"text/html")}});class h{static replaceFromMarkup(e,t){c.replaceFromMarkup(e,t)}static replaceElement(e,t){return c.replaceElement(e,t)}}var u=i(59);class p extends r.A{static #e=this.options={dataUrl:"",filterUrl:"",params:{},filterPanelSelector:".filter-panel",cmsProductListingSelector:".cms-element-product-listing",cmsProductListingWrapperSelector:".cms-element-product-listing-wrapper",cmsProductListingResultsSelector:".js-listing-wrapper",activeFilterContainerSelector:".filter-panel-active-container",activeFilterLabelClasses:"filter-active btn",activeFilterLabelSelector:".filter-active",activeFilterLabelPreviewClass:"filter-active-preview",resetAllFilterButtonClasses:"filter-reset-all btn btn-outline-danger",resetAllFilterButtonSelector:".filter-reset-all",loadingIndicatorClass:"is-loading",loadingElementLoaderClass:"has-element-loader",ariaLiveSelector:".filter-panel-aria-live",ariaLiveUpdates:!0,disableEmptyFilter:!1,snippets:{resetAllButtonText:"Reset all",resetAllFiltersAriaLabel:"Reset all filters",removeFilterAriaLabel:"Remove filter"},scrollTopListingWrapper:!0,scrollOffset:15,ignoreHashOnlyPopstate:!0};init(){this._registry=[],this.httpClient=new o.A,this._urlFilterParams=Object.fromEntries(new URLSearchParams(window.location.search).entries()),this._filterPanel=document.querySelector(this.options.filterPanelSelector),this._filterPanelActive=!!this._filterPanel,this._filterPanelActive&&(this._showResetAll=!1,this.activeFilterContainer=document.querySelector(this.options.activeFilterContainerSelector),this.ariaLiveContainer=document.querySelector(this.options.ariaLiveSelector)),this._cmsProductListingWrapper=document.querySelector(this.options.cmsProductListingWrapperSelector),this._cmsProductListingWrapperActive=!!this._cmsProductListingWrapper,this._allFiltersInitializedDebounce=u.A.debounce(this.sendDisabledFiltersRequest.bind(this),100),this._lastPathWithoutHash=this._getPathWithoutHash(),this._registerEvents()}refreshRegistry(){let e=this._registry.filter(e=>document.body.contains(e.el));this.init(),this._registry=e,window.PluginManager.initializePlugins()}changeListing(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._buildRequest(e,t),this._filterPanelActive&&this._buildLabels()}registerFilter(e){this._registry.push(e),this._setFilterState(e),this.options.disableEmptyFilter&&this._allFiltersInitializedDebounce()}_setFilterState(e){Object.keys(this._urlFilterParams).length>0&&"function"==typeof e.setValuesFromUrl&&e.setValuesFromUrl(this._urlFilterParams)&&this._filterPanelActive&&(this._showResetAll=!0,this._buildLabels())}deregisterFilter(e){this._registry=this._registry.filter(t=>t!==e)}_callFilterPlugin(e,t,i){for(var r=arguments.length,s=Array(r>3?r-3:0),n=3;n<r;n++)s[n-3]=arguments[n];if("function"!=typeof e[t])return i;try{return e[t](...s)}catch(e){return console.warn(`Listing filter plugin threw from ${t}(); skipping.`,e),i}}_getPrioritisedRegistry(){let e=[],t=[];return this._registry.forEach(i=>{(i instanceof l?t:e).push(i)}),[...e,...t]}_fetchValuesOfRegisteredFilters(){let e={};return this._getPrioritisedRegistry().forEach(t=>{let i=this._callFilterPlugin(t,"getValues",null);
1i&&Object.keys(i).forEach(t=>{let r;let s=i[t];r=Array.isArray(s)?s:null!==s&&"object"==typeof s?Object.values(s):null!=s?[s]:[],Object.prototype.hasOwnProperty.call(e,t)||(e[t]=[]),r.forEach(i=>{null!=i&&""!==i&&e[t].push(i)})})}),e}_mapFilters(e){let t=new Set(["p","order","limit","rating","shipping-free","min-price","max-price"]),i={};return Object.keys(e).forEach(r=>{let s;let n=e[r];if(Array.isArray(n)){if(0===n.length)return;if(t.has(r)){let e=n[n.length-1];s=null==e?"":String(e)}else s=n.join("|")}else{if(null==n)return;s=t.has(r)?String(n):n}`${s}`.length&&(i[r]=s)}),i}_buildRequest(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this._fetchValuesOfRegisteredFilters(),r=this._mapFilters(i);this._filterPanelActive&&(this._showResetAll=!!Object.keys(r).length),this.options.params&&Object.keys(this.options.params).forEach(e=>{r[e]=this.options.params[e]}),Object.entries(t).forEach(e=>{let[t,i]=e;r[t]=i});let s=new URLSearchParams(r);this.sendDataRequest(s),delete r.slots,delete r["no-aggregations"],delete r["reduce-aggregations"],delete r["only-aggregations"],s=new URLSearchParams(r),e&&this._updateHistory(s),this.options.scrollTopListingWrapper&&this._scrollTopOfListing()}_scrollTopOfListing(){let e=this._cmsProductListingWrapper.getBoundingClientRect();if(e.top>=0)return;let t=e.top+window.scrollY-this.options.scrollOffset;window.scrollTo({top:t,behavior:"smooth"})}_getDisabledFiltersParamsFromParams(e){let t=Object.assign({},{"only-aggregations":1,"reduce-aggregations":1},e);return delete t.p,delete t.order,delete t["no-aggregations"],new URLSearchParams(t)}_updateHistory(e){let t=this._buildUrl(window.location.pathname,e);window.history.pushState({},"",t),this._lastPathWithoutHash=this._getPathWithoutHash()}_buildLabels(){let e="";this._registry.forEach(t=>{let i=this._callFilterPlugin(t,"getLabels",[]);i.length&&i.forEach(t=>{e+=this.getLabelTemplate(t)})}),this.activeFilterContainer.innerHTML=e;let t=this.activeFilterContainer.querySelectorAll(this.options.activeFilterLabelSelector);e.length&&(this._registerLabelEvents(t),this.createResetAllButton())}_registerLabelEvents(e){e.forEach(e=>{e.addEventListener("click",()=>this.resetFilter(e))})}createResetAllButton(){this.activeFilterContainer.insertAdjacentHTML("beforeend",this.getResetAllButtonTemplate());let e=this.activeFilterContainer.querySelector(this.options.resetAllFilterButtonSelector);this._boundResetAllFilter||(this._boundResetAllFilter=this.resetAllFilter.bind(this)),e.removeEventListener("click",this._boundResetAllFilter),e.addEventListener("click",this._boundResetAllFilter),this._showResetAll||e.remove()}resetFilter(e){this._registry.forEach(t=>{this._callFilterPlugin(t,"reset",void 0,e.dataset.id)}),this._buildRequest(),this._buildLabels()}resetAllFilter(){this._registry.forEach(e=>{this._callFilterPlugin(e,"resetAll",void 0)}),this._buildRequest(),this._buildLabels()}getLabelTemplate(e){return` 2 <button 3 class="${this.options.activeFilterLabelClasses}" 4 data-id="${e.id}" 5 title="${this.options.snippets.removeFilterAriaLabel}: ${e.label}" 6 aria-label="${this.options.snippets.removeFilterAriaLabel}: ${e.label}"> 7 ${this.getLabelPreviewTemplate(e)} 8 ${e.label} 9 <span aria-hidden="true" class="ms-1 fs-4">×</span> 10 </button> 11 `}getLabelPreviewTemplate(e){let t=this.options.activeFilterLabelPreviewClass;return e.previewHex?` 12 <span class="${t}" style="background-color: ${e.previewHex};"></span> 13 `:e.previewImageUrl?` 14 <span class="${t}" style="background-image: url('${e.previewImageUrl}');"></span> 15 `:""}getResetAllButtonTemplate(){return` 16 <button class="${this.options.resetAllFilterButtonClasses}" aria-label="${this.options.snippets.resetAllFiltersAriaLabel}"> 17 ${this.options.snippets.resetAllButtonText} 18 </button> 19 `}addLoadingIndicatorClass(){this._filterPanel.classList.add(this.options.loadingIndicatorClass)}removeLoadingIndicatorClass(){this._filterPanel.classList.remove(this.options.loadingIndicatorClass)}addLoadingElementLoaderClass(){this._cmsProductListingWrapper.classList.add(this.options.loadingElementLoaderClass)}removeLoadingElementLoaderClass(){this._cmsProductListingWrapper.classList.remove(this.options.loadingElementLoaderClass)}sendDataRequest(e){this._filterPanelActive&&this.addLoadingIndicatorClass(),this._cmsProductListingWrapperActive&&this.addLoadingElementLoaderClass(),this.options.disableEmptyFilter&&this.sendDisabledFiltersRequest(),fetch(this._buildUrl(this.options.dataUrl,e),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>{if(e.ok)return e.text();let t=Error("Could not fetch listing data.");throw t.response=e,t}).then(e=>{this.renderResponse(e)}).catch(t=>{if(t.response?.status===403){let t=this._getLoginPageUrl(e);t&&this._navigateTo(t);return}throw t}).finally(()=>{this._filterPanelActive&&(this.removeLoadingIndicatorClass(),this._updateAriaLive()),this._cmsProductListingWrapperActive&&this.removeLoadingElementLoaderClass()})}sendDisabledFiltersRequest(){let e=this._fetchValuesOfRegisteredFilters(),t=this._mapFilters(e);
19this.options.params&&Object.keys(this.options.params).forEach(e=>{t[e]=this.options.params[e]}),this._allFiltersInitializedDebounce=()=>{};let i=this._getDisabledFiltersParamsFromParams(t);fetch(this._buildUrl(this.options.filterUrl,i),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.json()).then(e=>{this._registry.forEach(t=>{"function"==typeof t.refreshDisabledState&&t.refreshDisabledState(e,i)})})}renderResponse(e){h.replaceFromMarkup(e,this.options.cmsProductListingSelector),this._registry.forEach(e=>{"function"==typeof e.afterContentChange&&e.afterContentChange()}),window.PluginManager.initializePlugins(),this.$emitter.publish("Listing/afterRenderResponse",{response:e})}_updateAriaLive(){if(!this.options.ariaLiveUpdates||!this.ariaLiveContainer)return;let e=this.el.querySelector(this.options.cmsProductListingResultsSelector);this.ariaLiveContainer.innerHTML=e.dataset.ariaLiveText}_registerEvents(){window.onpopstate=this._onWindowPopstate.bind(this)}_onWindowPopstate(){if(this.options.ignoreHashOnlyPopstate&&this._lastPathWithoutHash){let e=this._getPathWithoutHash();if(this._lastPathWithoutHash===e)return}this.refreshRegistry(),this._registry.forEach(e=>{0===Object.keys(this._urlFilterParams).length&&(this._urlFilterParams.p=1),this._setFilterState(e)}),this.options.disableEmptyFilter&&this._allFiltersInitializedDebounce(),this.changeListing(!1)}_getPathWithoutHash(){return window.location.pathname+window.location.search}_buildUrl(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.origin,r=new URL(e,i);return t.size>0&&t.forEach((e,t)=>{r.searchParams.append(t,e)}),r.toString()}_getLoginPageUrl(e){let t=window.router?.["frontend.account.login.page"],i=new URLSearchParams;return t?window.activeRoute?(i.set("redirectTo",window.activeRoute),i.set("redirectParameters",JSON.stringify(this._getLoginRedirectParameters(e))),`${t}?${i.toString()}`):t:null}_getLoginRedirectParameters(e){let t={};try{t=JSON.parse(window.activeRouteParameters||"{}")}catch{t={}}return{...t,...Object.fromEntries(e.entries())}}_navigateTo(e){window.location.href=e}}class d extends p{static #e=this.options={...super.options,reloadCurrentUrlRequired:!1,excludeKeys:["shipping-free","availability","min-price","max-price","p","order","rating"]};_fetchValuesOfRegisteredFilters(){let e={};return this._registry.forEach(t=>{let i=t.getValues(),r=t.getLabels();
19Object.keys(i).forEach(s=>{if(Object.prototype.hasOwnProperty.call(e,s)){let n=this.encodeText(t.options.propertyName);Object.values(i[s]).forEach(t=>{let i=r.find(e=>e.id===t);e[n]&&i&&e[n].push(this.encodeText(i.label))})}else if(["manufacturer","properties","categories"].includes(s)){let n=[],a="";t?.options?.propertyName&&(a=this.encodeText(t.options.propertyName)),Object.values(i[s]).forEach(e=>{let t=r.find(t=>t.id===e);t&&n.push(this.encodeText(t.label))}),"properties"===s?e[a]=n:"manufacturer"===s?e[this.encodeText(t.options.displayName)]=n:"categories"===s?e[this.encodeText(t.options.name)]=n:e[s]=n}else e[s]=i[s]})}),this._keepPreselectedBooleanFiltersSwitchable(e),this.options.reloadCurrentUrlRequired&&this.reloadCurrentUrlIfRequired(e),e}_keepPreselectedBooleanFiltersSwitchable(e){document.querySelectorAll("[data-filter-boolean]").forEach(t=>{let i;try{i=JSON.parse(t.getAttribute("data-filter-boolean-options")||"{}")}catch(e){return}if(!i.defaultActivated||!i.name)return;let r=t.querySelector(".filter-boolean-input");r&&!r.checked&&(e[i.name]||(e[i.name]="0"))})}_buildRequest(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this._fetchValuesOfRegisteredFilters(),r=this._mapFilters(i);this._filterPanelActive&&(this._showResetAll=!!Object.keys(r).length),this.options.params&&Object.keys(this.options.params).forEach(e=>{r[e]=this.options.params[e]}),Object.entries(t).forEach(e=>{let[t,i]=e;r[t]=i});let s=new URLSearchParams(r);this.sendDataRequest(s),delete r.slots,delete r["no-aggregations"],delete r["reduce-aggregations"],delete r["only-aggregations"];let n=(s=new URLSearchParams(r).toString()).replace(/([^=&]+)=([^&]*)/g,(e,t,i)=>this.options.excludeKeys.includes(t)?e:`${t}=${decodeURIComponent(i)}`);e&&this._updateHistory(new URLSearchParams(n)),this.options.scrollTopListingWrapper&&this._scrollTopOfListing()}_registerEvents(){let e=new URL(window.location.href),t=e.searchParams.get("properties"),i=e.searchParams.get("manufacturer"),r=e.searchParams.get("categories");t&&t.length>0||i&&i.length>0&&this.splitAndCheckType(i)||r&&r.length>0&&this.splitAndCheckType(r)?this.options.reloadCurrentUrlRequired=!0:this.getLabelsFormName(),super._registerEvents()}splitAndCheckType(e){return e.split("|").some(e=>this.isUUID(e))}isUUID(e){return/^[a-f0-9]{32}$/.test(e)}encodeText(e){return encodeURIComponent(e)}parseFilterOptions(e){if(!e)return null;try{let t=JSON.parse(e);return"object"==typeof t&&null!==t?t:null}catch(e){return null}}reloadCurrentUrlIfRequired(e){let t=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return!this.options.excludeKeys.includes(t)})),i=[];for(let[e,r]of Object.entries(t))Array.isArray(r)&&r.length>0&&i.push(`${e}=${r.join("|")}`);let r=i.join("&"),s=new URL(window.location.href),n=new URLSearchParams(s.search);n.delete("properties"),n.delete("manufacturer"),n.delete("categories");let a=n.toString(),l="";a&&r?l=`${a}&${r}`:a?l=a:r&&(l=r);let o=l?`${s.origin}${s.pathname}?${l}`:`${s.origin}${s.pathname}`;history.replaceState(null,"",o)}getLabelsFormName(){let e=this.options.excludeKeys,t=Object.fromEntries(Object.entries(this._urlFilterParams).filter(t=>{let[i]=t;return!e.includes(i)}));if(Object.keys(t).length<=0)return 0;let i={},r=document.querySelectorAll('[data-filter-property-select="true"]');r.length>0&&r.forEach(e=>{let t=this.parseFilterOptions(e.getAttribute("data-filter-property-select-options"));if(!t)return;let r=this.encodeText(t.propertyName).toLowerCase();Object.prototype.hasOwnProperty.call(i,r)||(i[r]={}),e.querySelectorAll(".filter-property-select-checkbox, .filter-multi-select-checkbox").forEach(e=>{let t=e.id,s=(e.getAttribute("data-label")||"").toLowerCase();t&&s&&(i[r][t]=s)})});let s={},n=document.querySelectorAll('[data-filter-multi-select="true"]');n.length>0&&n.forEach(e=>{let t=this.parseFilterOptions(e.getAttribute("data-filter-multi-select-options"));t&&"manufacturer"===t.name&&e.querySelectorAll(".filter-multi-select-checkbox").forEach(e=>{let t=e.id,i=(e.getAttribute("data-label")||"").toLowerCase();t&&i&&(s[t]=i)})});let a={},l=document.querySelectorAll('[data-filter-multi-select="true"]');l.length>
190&&l.forEach(e=>{let t=this.parseFilterOptions(e.getAttribute("data-filter-multi-select-options"));t&&"categories"===t.name&&e.querySelectorAll(".filter-multi-select-checkbox").forEach(e=>{let t=e.id,i=(e.getAttribute("data-label")||"").toLowerCase();t&&i&&(a[t]=i)})});let o="",c="",h="";Object.entries(t).forEach(e=>{let[t,r]=e;if(i[t=t.toLowerCase()]&&Object.keys(i[t]).length>0){let e=r.split("|");for(let[r,s]of(e=e.map(e=>e.toLowerCase()),Object.entries(i[t])))e.includes(s)&&(o?o+="|"+r:o=r)}if("manufacturer"===t){let e=r.split("|");for(let[t,i]of(e=e.map(e=>e.toLowerCase()),Object.entries(s)))e.includes(i)&&(c?c+="|"+t:c=t)}if("categories"===t){let e=r.split("|");for(let[t,i]of(e=e.map(e=>e.toLowerCase()),Object.entries(a)))e.includes(i)&&(h?h+="|"+t:h=t)}});let u={};for(let[t,i]of Object.entries(this._urlFilterParams))e.includes(t)&&(u[t]=i);u.manufacturer=c,u.properties=o,u.categories=h,this._urlFilterParams=u}}},701(e,t,i){i.d(t,{A:()=>s});var r=i(220);class s extends r.A{static #e=this.options={parentFilterPanelSelector:".cms-element-product-listing-wrapper",dropdownSelector:".filter-panel-item-dropdown"};_init(){super._init(),this._validateMethods();let e=document.querySelector(this.options.parentFilterPanelSelector);this.listing=window.PluginManager.getPluginInstanceFromElement(e,"Listing"),this.listing.registerFilter(this),this._setReady(),this._preventDropdownClose()}_setReady(){this.el.removeAttribute("aria-busy"),this.el.querySelectorAll("[data-filter-loading]").forEach(e=>{e.removeAttribute("disabled"),e.removeAttribute("data-filter-loading")})}_preventDropdownClose(){let e=this.el.querySelector(this.options.dropdownSelector);e&&e.addEventListener("click",e=>{e.stopPropagation()})}_validateMethods(){if("function"!=typeof this.getValues)throw Error(`[${this._pluginName}] Needs the method "getValues"'`);if("function"!=typeof this.getLabels)throw Error(`[${this._pluginName}] Needs the method "getLabels"'`);if("function"!=typeof this.reset)throw Error(`[${this._pluginName}] Needs the method "reset"'`);if("function"!=typeof this.resetAll)throw Error(`[${this._pluginName}] Needs the method "resetAll"'`)}}},707(e,t,i){i.d(t,{A:()=>r});class r{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 i=r.toUpperCamelCase(e,t);return r.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>r.ucFirst(e.toLowerCase())).join(""):r.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}}}]);
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.