/*Copyright © Vaimo Group. All rights reserved. See LICENSE_VAIMO.txt for license details.*/ define("CardLink",["jquery","ko","uiComponent","Vaimo_BauhausSe/js/resolutionProvider","touchDeviceIdentifier"],((t,e,i,s,o)=>{"use strict";const n=new class i{carousels=[];processCarousel(i){const s=t(i).parents(".card-carousel").get(0);if(!this.carousels.find((t=>t===s))){this.carousels.push(s);t(s).on("productItemsCarouselInited",(t=>t.target.querySelectorAll(this.productLinkSelector).forEach((t=>{e.cleanNode(t);e.applyBindings(null,t)}))))}}};return i.extend({defaults:{productLinkSelector:"[data-product-link]",cards:[],clickEventName:o.click},initialize:function(){this._super();window.addEventListener("breakpointsChanged",this._onBreakpointsChanged.bind(this))},_onBreakpointsChanged:function(){this.cards.filter((t=>t.active)).forEach((t=>this.toggleProductLink(t.sku,!0)))},onButtonClick:function(t){if(this._isDesktop())return!0;this.toggleProductLink(t,!0);return!0},onButtonContext:function(t){this.toggleProductLink(t);setTimeout(this.toggleProductLink.bind(this,t,!0),25);return!0 },toggleProductLink:function(t,e){this.cards.filter((e=>e.sku===t)).forEach((t=>{t.card.setAttribute("href",e?t.productUrl:t.replacementUrl);t.active=e}))},afterRender:function(t,e,i,s){this._processCard(t,e,i,s);n.processCarousel(t)},_processCard:function(e,i,s,o){const n=t(e).parents(this.productLinkSelector).get(0);this.cards.find((t=>t.card===n))||this.cards.push({sku:i,card:n,replacementUrl:s,productUrl:o})},getTemplateObj:function(t){return{name:this.template,data:{$data:this,static:t||{}}}},_isDesktop:function(){return s.getResolution().isDesktop()}})}));define("vaimo/KOTemplateFromStringComponentExtension",["Magento_Ui/js/lib/knockout/template/loader"],(function(t){return{getTemplateNameForCms:function(e,i){window.define(t.formatPath(e),[],(function(){return i||""}));return e}}}));define("PassiveSticky",["Vaimo_BauhausSe/js/resolutionProvider","vaimo/headerState"],((t,e)=>{"use strict";const i=function(t){this.options=Object.assign({nonMobResolution:"sm", headerStateEvents:["isMinicartActive","isSearchPopupOpened","isMobileMenuActive","isMinicartLoading","isModalOpened","isMyAccountOpened","isExpertService","isMontageService","isComplaintService"]},t);if(this.options.el)if(this._isDesktop())window.addEventListener("breakpointsChanged",this._initOnResize.bind(this));else{this._init();this._applyZIndex()}};i.prototype._toggleStickyness=function(){let t=!1;this.options.headerStateEvents.forEach((i=>t=t||e.getState(i)));this.options.el.classList.toggle(this.options.zIndexClass,t)};i.prototype._applyZIndex=function(){this.options.headerStateEvents.forEach((t=>e.subscribe(t,this._toggleStickyness.bind(this))));this._toggleStickyness()};i.prototype._isDesktop=function(){return t.getResolution().isSizeActive(this.options.nonMobResolution)};i.prototype._initOnResize=function(){if(!this._isDesktop()){document.removeEventListener("breakpointsChanged",this._initOnResize);this._init()}};i.prototype._init=function(){ if(!this.options.staticFixedPosition){this._onElChanged();document.addEventListener("scroll",this._setClasses.bind(this),{passive:!0});window.addEventListener("updateBuyButtonState",this._onElChanged.bind(this));window.addEventListener("BiSFormChanged",this._onElChanged.bind(this));window.addEventListener("windowResize",this._onElChanged.bind(this),{passive:!0})}};i.prototype._setClasses=function(){const t=this.position.height+this.position.y>window.pageYOffset+window.innerHeight;if(this.isSticky!==t){this.isSticky=t;this.options.el.classList.toggle(this.options.stickyClass,t);t&&(this.options.placeholder.style.height=this.position.height+"px");this._toggleDependentElClasses(t)}};i.prototype._toggleDependentElClasses=function(t){if(!this.options.dependentElSelector)return;const e=document.querySelector(this.options.dependentElSelector);if(e){if(this.findElTimeout){clearTimeout(this.findElTimeout);this.findElTimeout=null} t?e.classList.add(this.options.dependentElStickyClass):e.classList.remove(this.options.dependentElStickyClass)}else{clearTimeout(this.findElTimeout);this.findElTimeout=setTimeout((()=>this._toggleDependentElClasses(t)),3e3)}};i.prototype._onElChanged=function(){this.isSticky=void 0;this._saveElPosition();this._setClasses()};i.prototype._saveElPosition=function(){this.options.el.classList.toggle(this.options.stickyClass,!1);this.position=this.options.el.getBoundingClientRect();this.position.y=this.position.y+window.pageYOffset;this.options.placeholder.style.height=this.position.height+"px"};return i}));define("StoreLocatorStorage",["jquery","mage/cookies"],(t=>{"use strict";return class e{constructor(t,e){this.cookieName=t;this.defaultValue=e;this.val=this.getBaseValue()}getBaseValue(){return t.cookie(this.cookieName)}set(e){this.val=e;e&&t.cookie(this.cookieName,e,{expires:1})}get(){return this.val}getDefault(){return this.defaultValue}}})) ;define("StoreLocatorStorageIsolated",["StoreLocatorStorage"],(t=>class e extends t{constructor(t,e){const i=e.deliveryStoreId;super(t,i);this.val=i}getBaseValue(){return this.val}get(){return this.val}getDefault(){return this.val}}));define("vaimo/animatedInputLabel",["jquery","jquery/ui"],(t=>{"use strict";var e="animatedInputsProcess";window.triggerAnimatedInputs=function(i){var s={};i&&(s.$el=t(i));t(document.body).trigger(e,s)};t.widget("vaimo.animatedInputLabel",{options:{inputSelector:".animated-input__input",classes:{labelActive:"animated-input__label--active",labelError:"animated-input__label--error",labelFocused:"animated-input__label--focused",inputFocused:"animated-input__input--focused",inputActive:"animated-input__input--active"}},_create:function(){t(this.bindPlaceholderActions.bind(this));t(this.prepareInputLabels.bind(this));var i={};i[e]=this.prepareInputLabels.bind(this);this._on("body",i)},prepareInputLabels:function(e,i){ (i&&i.$el instanceof t?i.$el:t(this.options.inputSelector)).each(function(e,i){var s,o=t(i);s=this._$getLabelForInput(o);if(this._isLabelValid(s)&&!o.hasClass(this.options.classes.inputFocused)){this._keepLabelActive(o,s);this._keepLabelFocused(o,s);o.trigger("animatedInputsPrepared")}}.bind(this))},_isLabelValid:function(t){return 1===t.length&&1!=t.height()},bindPlaceholderActions:function(){var e=this,i=e.options.classes,s=e.options.inputSelector,o=["validation:result"];t("body").on("focus blur change validation:result",s,(function(s){var n="blur"==s.type||"focusout"==s.type,r="change"===s.type,a=t(this),l=a.hasClass("mage-error"),c=e._$getLabelForInput(a);e._keepLabelActive(a,c);c.toggleClass(i.labelError,l);if(-1==t.inArray(s.type,o)){c.toggleClass(i.labelFocused,!(n||r&&!a.val()));a.toggleClass(i.inputFocused,!(n||r&&!a.val()))}a.trigger("animatedInputsActivated")}))},_$getLabelForInput:function(e){var i=e.closest("label"),s=e.attr("id") ;return i.attr("for")===s?i:t('label[for="'+s+'"]')},_keepLabelActive:function(t,e){var i=!1;navigator.userAgent.toLowerCase().indexOf("chrome")>=0&&(i=t.is("*:-webkit-autofill"));e.toggleClass(this.options.classes.labelActive,i||!!t.val());t.toggleClass(this.options.classes.inputActive,i||!!t.val())},_keepLabelFocused:function(t,e){e.toggleClass(this.options.classes.labelFocused,!!t.val());t.toggleClass(this.options.classes.inputFocused,!!t.val())}});return t.vaimo.animatedInputLabel}));define("price-format-config",[],(()=>window.vaimoConfigs["price-format-config"]));define("postcodeUtils",[],(()=>({format:function(t){const e=[];let i=0;try{const s=this.mask.split(this.postcodeMaskSplit);if(1===s.length)return t;s.forEach((function(s){const o=parseInt(s.match(/9{(\d)*?}/)[1]);e.push(t.slice(i,i+o));i+=o}));return e.join(this.postcodeMaskSplit)}catch(s){console.error(s)}return t},mask:"9{3} 9{2}",validationLength:5,postcodeMaskSplit:" "})));define("phoneUtils",["mage/translate"],(t=>({ mask:"9{10}","validate-phone-local":{regex:/^07\d{8}$/,msg:t("Please enter a valid mobile number, for example 0721111111")},code:""})));define("cssTimeout",[],(()=>200));define("fetch",[],(()=>{"use strict";const t=/\[\]$/;function e(i,s,o){if(Array.isArray(s))s.forEach(((s,n)=>{t.test(i)?o(i,s):e(i+"["+("object"==typeof s&&null!=s?n:"")+"]",s,o)}));else if("object"==typeof s)for(let t in s)e(i+"["+t+"]",s[t],o);else o(i,s)}return function(t,i){(i=JSON.parse(JSON.stringify(i))).headers=Object.assign({"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded; charset=UTF-8",pragma:"no-cache","x-requested-with":"XMLHttpRequest"},i.headers||{});i.body&&(i.body=function s(t){let i,s=[],o=(t,e)=>{s[s.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==e?"":e)};if(Array.isArray(t))t.forEach((t=>{o(t.name,t.value)}));else for(i in t)e(i,t[i],o);return s.join("&")}(i.body));i.method=i.method||"GET";return fetch(t,i).then((t=>{ if(!t.ok)throw new Error("Network response was not ok");return t.json()}))}}));define("vaimo/geolocationHelper",[],(function(){"use strict";const t=function(){this.earthRadius=6378137;this.errorMsgTimeout=6e3};t.prototype.getUserLocation=function(t=()=>{},e=()=>{},i){navigator.geolocation.getCurrentPosition((e=>{const i={lat:e.coords.latitude,lng:e.coords.longitude};t(i)}),(t=>{e(t)}),Object.assign({timeout:this.errorMsgTimeout},i))};t.prototype.getDistance=function(t,e){const i=this.earthRadius,s=this._getRad(e.lat-t.lat),o=this._getRad(e.lng-t.lng),n=Math.sin(s/2)*Math.sin(s/2)+Math.cos(this._getRad(t.lat))*Math.cos(this._getRad(e.lat))*Math.sin(o/2)*Math.sin(o/2);return i*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))};t.prototype._getRad=function(t){return t*Math.PI/180};return new t}));define("vaimo/headerState",["jquery"],(function(t){"use strict";let e=function(){this.defaultStateValue=!1;this.states=[];this.observers={}};e.prototype.getState=function(t){ return void 0!==this.states[t]?this.states[t]:this.defaultStateValue};e.prototype.setState=function(t,e){let i=this.getState(t)!==e;this.states[t]=e;i&&this._fireStateChangedEvent(t,e);return this};e.prototype._getObservers=function(t){return void 0!==this.observers[t]?this.observers[t]:[]};e.prototype._fireStateChangedEvent=function(t,e){this._getObservers(t).forEach((i=>i(t,e)))};e.prototype.subscribe=function(t,e){void 0===this.observers[t]&&(this.observers[t]=[]);this.observers[t].push(e);return this};e.prototype._validateState=function(e,i){return"object"==typeof e?-1!==t.inArray(i,e):e===i};e.prototype.subscribeMultiply=function(e,i){t.each(e,function(t,e){this.subscribe(t,function(t,e,s){this._validateState(t,s)&&i()}.bind(this,e))}.bind(this))};return new e}));define("vaimo/lazyFactory",["jquery","jquery.lazy"],(function(t){"use strict";const e={"data-src":"src","data-srcset":"srcset"};function i(t,e,s){e(s);t.removeEventListener("load",i);t.removeEventListener("error",i) ;t.classList.add("pb-bauhaus-img__img-essence--loaded");t.classList.remove("pb-bauhaus-img__img-essence--loading")}function s(e){e.each((function(){let e=t(this),i=e.attr("data-alt");i&&e.attr("alt",i)}))}t.fn.vaimoJqueryLazyFactory=function(i){const o=this;i=i||{};if(1===o.length&&o.data("lazyFactoryApplied")&&!i.forceReload)return this;o.data("lazyFactoryApplied",!0);o.each(((o,n)=>{const r=t(n),a=r.find("["+Object.keys(e).join("],[")+"]");a.length&&(i.useComplicatedLazyLoad?function l(e,i,o){(e.is("picture")?e:i).lazy(t.extend({delay:1},o,{onFinishedAll:function(){o&&o.onFinishedAll&&"function"==typeof o.onFinishedAll&&o.onFinishedAll.apply(this,arguments);s(i)}}));i.on("load error",(function(){s(e)}))}(r,a,i):function c(i,o,n){let r=o.length;o.length||"function"!=typeof n.onFinishedAll?o.each((function(){let i=t(this);i.on("load error",(function(){s(i);--r||"function"==typeof n.onFinishedAll&&n.onFinishedAll()}));for(let t in e){let s=i.attr(t);if(s){i.attr(e[t],s);i.removeAttr(t)} }})):n.onFinishedAll()}(0,a,i))}));return this};t.lazy(["pictureLoader"],(function o(t,s){t.find("[data-srcset]").each(((t,o)=>{o.classList.add("pb-bauhaus-img__img-essence--loading");!function n(t){let i=t.getAttribute("data-srcset");i&&t.setAttribute(e["data-srcset"],i)}(o);if("IMG"===o.tagName){o.addEventListener("load",i.bind(null,o,s,!0));o.addEventListener("error",i.bind(null,o,s,!1))}}))}));return t.fn.vaimoJqueryLazyFactory}));define("vaimoJqueryLazyFactory",["vaimo/lazyFactory"],(function(){return"vaimoJqueryLazyFactory"}));define("vaimo/lazyModalInit",["jquery","Magento_Ui/js/modal/modal","touchDeviceIdentifier","jquery/ui"],(function(t,e,i){t.widget("vaimo.lazyModalInit",{options:{openButtonSelector:t()||"",contentSelector:t(),modalOptions:{}},_destroy:function(){this.$modalWidget&&this.$modalWidget.destroy();return this._super()},_initModalInstance:function(i){e(t.extend({buttons:[]},this.options.modalOptions),i);this.$modalWidget=i.data("mageModal")},_create:function(){ var e=this.options.openButtonSelector;e&&e.length||(e=this.element);var s=!1;this.$content=t(this.options.contentSelector);var o={};o[i.click]=function(){if(!s){s=!0;this._initModalInstance(this.$content)}this.$content.modal("openModal");return!1};this._on(e,o)},getContent:function(){return this.$content}});return t.vaimo.lazyModalInit}));define("vaimoUtil/numberFormat",[],(function(){"use strict";var t=",",e=3;return{formatNumber:function(i){return"number"!=typeof i?i:i.toFixed(e).replace(".",t)}}}));define("vaimo/overlay-template",[],(()=>'<div class="loader-overlay" data-overlay-content>\n <div class="loader-overlay__wrapper">\n <div class="loader-overlay__grid"><% _.each(Array.apply(1, Array(9)), ()=>{ %>\n <div class="loader-overlay__cube"></div>\n <% }) %></div>\n <p class="loader-overlay__info"><%= obj.text %>…</p>\n </div>\n</div>')) ;define("vaimo/overlay",["underscore","vaimo/overlay-template","mage/translate"],((t,e,i)=>new class s{options={visibleClass:"loader-overlay--visible",contentSelector:"[data-overlay-content]"};activeIndexes=[];activeInlineContainers=[];templateObj={text:i("Loading")};constructor(){this.template=t.template(e)}open(t){this.root||this._addRoot();t&&this.activeIndexes.length||this.root.classList.add(this.options.visibleClass);t&&this._addIndex(t)}close(t){t&&0!==this.activeIndexes.length&&this._removeIndex(t);t&&0!==this.activeIndexes.length||this.root?.classList.remove(this.options.visibleClass)}openInline(t,e){if(t?.length){if(-1!==this._getActiveElIndex(t))return;this.activeInlineContainers.push({$el:t,timeout:setTimeout(this.closeInline.bind(this,t),6e4)});const i=this._getLoaderEl();i.classList.add(e);t.append(i)}else this.open()}closeInline(t){if(t?.length){const e=this._getActiveElIndex(t);-1!==e&&this.activeInlineContainers.splice(e,1);t.find(this.options.contentSelector).remove() }else this.close()}isOpen(){return this.root?.classList?.contains(this.options.visibleClass)}_addIndex(t){this.activeIndexes.push(t)}_removeIndex(t){for(let e=0;e<this.activeIndexes.length;e++)this.activeIndexes[e]===t&&this.activeIndexes.splice(e,1)}_getActiveElIndex(t){return this.activeInlineContainers.findIndex((e=>e.$el.is(t)))}_getLoaderEl(){const t=document.createElement("template");t.innerHTML=this.template(this.templateObj);return t.content.firstChild}_addRoot(){this.root=this._getLoaderEl();document.body.appendChild(this.root)}}));define("pb-img",["jquery","vaimo/lazyFactory","domReady!"],(t=>{"use strict";t("[data-pb-img]").attr("data-loader","pictureLoader").vaimoJqueryLazyFactory({useComplicatedLazyLoad:!0,delay:-1,bind:"event"})}));define("registryChain",["uiRegistry"],(t=>function(e,i){Promise.all(e.map((e=>new Promise((i=>t.get(e,i)))))).then((t=>i.apply(null,t)))}));define("requireModule",[],(()=>class t{queue=[];set(t){this.isReady=!0;this.optionsForCb=t ;this.queue.forEach(this._runCallback.bind(this))}_runCallback(t){this.isReady?t(this.optionsForCb):this.queue.push(t)}load(t,e,i){this._runCallback(i)}}));define("saveTwitching",["jquery","Vaimo_BauhausSe/js/resolutionProvider","vaimo/headerState","domReady!"],(function(t,e,i){"use strict";const s=function(){this.ns=".saveTwitching";t(window).on("windowResize"+this.ns,this._setSize.bind(this));i.subscribe("isModalOpened",this._onAfterNoScroll.bind(this));t(document).on("afterDropdowndialogOpen"+this.ns,this._onAfterNoScroll.bind(this));t(document).on("afterOpenModal"+this.ns,this._onAfterNoScroll.bind(this));this._setSize()};s.prototype._onAfterNoScroll=function(){if(this.isProcessed)return;t(window).off(this.ns);t(document).off(this.ns);this.isProcessed=!0;const i=document.body.offsetWidth-this.sizeBeforeNoScroll,s=document.createElement("style") ;s.innerText="@media only screen and (min-width: "+e.getResolution().getDesktopSize()+"px) {body._has-modal,body.save-twitching {padding-right:"+i+"px}}";document.body.appendChild(s)};s.prototype._setSize=function(){this.sizeBeforeNoScroll=document.body.offsetWidth};return new s}));define("js/simpleDropdown",["jquery","jquery/ui"],(function(t){"use strict";var e=0;t.widget("vaimo.simpleDropdown",{options:{dialogContentClass:"",wrapperElementSelector:"",triggerTarget:"",currentOption:"",timeout:100,dropDownOverlaySelector:"",stopToggleAttr:"data-link-block-event",dropDownOverlayActiveClass:"",modalClass:"save-twitching",modalBeforeTimeout:!1,noScroll:!1},_create:function(){this.eventId="."+this.widgetFullName+e++;this.$overlay=t(this.options.dropDownOverlaySelector);this.$wrapper=t(this.options.wrapperElementSelector);this.isOpened=!1;t("body").on("click"+this.eventId,this.options.triggerTarget,function(e){const i=t(e.currentTarget) ;if(!i.attr(this.options.stopToggleAttr)&&!i.parents().attr(this.options.stopToggleAttr)){this.toggle();this.activateCurrent(i)}}.bind(this)).on("keydown"+this.eventId,function(t){27===t.keyCode&&this.close()}.bind(this));this._on(this.$overlay,{click:this.close})},_destroy:function(){t("body").off(this.eventId);this.element.removeClass(this.options.dialogContentClass);this.$wrapper.hide();this.$overlay.removeClass(this.options.dropDownOverlayActiveClass)},toggle:function(){this.isOpened?this.close():this.open()},open:function(e){if(!this.isOpened){clearTimeout(this.hideTimeout);this.element.trigger("dropdownBeforeOpen");this.element.addClass(this.options.dialogContentClass);this.$wrapper.show();this.$overlay.addClass(this.options.dropDownOverlayActiveClass);this.options.modalClass&&t("body").addClass(this.options.modalClass);this.isOpened=!0;this.element.trigger("dropdowndialogopen",{options:e});this._toggleBodyState(!0);t(document).trigger("afterDropdowndialogOpen",this.modal)}}, _toggleBodyState:function(e){this.options.noScroll&&t("body").toggleClass("no-scroll",e)},close:function(){if(this.isOpened){clearTimeout(this.hideTimeout);this.element.removeClass(this.options.dialogContentClass);this.options.modalClass&&this.options.modalBeforeTimeout&&t("body").removeClass(this.options.modalClass);this.hideTimeout=setTimeout(function(){this.options.modalClass&&!this.options.modalBeforeTimeout&&t("body").removeClass(this.options.modalClass);this.$wrapper.hide();this.element.trigger("dropdownAfterClose")}.bind(this),this.options.timeout);this.$overlay.removeClass(this.options.dropDownOverlayActiveClass);this.isOpened=!1;this.element.trigger("dropdowndialogclose");this._toggleBodyState(!1)}},activateCurrent:function(e){if(this.options.currentOption){t("["+this.options.currentOption+"]").collapsible().collapsible("deactivate");t("["+this.options.currentOption+"="+e.attr(this.options.currentOption)+"]").collapsible("activate")}}});return t.vaimo.simpleDropdown})) ;define("js/store-select",["ko","uiComponent","vaimo/storeLocatorData","uiRegistry"],(function(t,e,i,s){"use strict";return e.extend({defaults:{workingDays:["monday","tuesday","wednesday","thursday","friday"]},initialize:function(){this._super();this.observe(["currentStore","curStoreClosingTime","isClosed"]);this._updateStoreInfo();i.listenStoreChange(this._updateStoreInfo.bind(this))},_updateStoreInfo:function(){const t=i.getCurrentStoreData();if(t){this.currentStore(t);this._updateHeaderTab()}},_updateHeaderTab:function(){this.curStoreClosingTime(this._getTodayCloseTime())},_getTodayCloseTime:function(){const t=this.currentStore().opening_hours;if(!t?.length)return"";const e=this._getSpecialCloseTime();if(this.isClosed()||e)return e;const i=(new Date).toLocaleString("default",{weekday:"long"}).toLowerCase(),s=this.workingDays.includes(i),o=t.find((t=>this.workingDays.includes(t.weekday)&&s&&t.closes_at||!this.workingDays.includes(t.weekday)&&t.weekday===i));return o?.closes_at||""}, _getSpecialCloseTime:function(){const t=this.currentStore().special_hours;if(!t?.length)return"";const e=(new Date).toISOString().split("T")[0],i=t.find((t=>t.date===e));this.isClosed(i&&!i?.opens_at);return i?.closes_at},openPopup:function(){s.set("initStoreSelectPopup",!0);s.get("storeLocatorPopup",(t=>t.showStoresListPopup()))}})}));define("vaimo/storeLocatorData",["vaimo/geolocationHelper","storeLocatorRequest!"],((t,e)=>new class{constructor(){this.storesUpdatesListeners=[];this.storeChangeListeners=[];this.storage=e.storage;this._setStores(e.stores);window.addEventListener("focus",(()=>{this.setStore(this.storage.getBaseValue())}))}setStore(t){this._isStoreAvailable(t)||(t=void 0);if(parseInt(this.storage.get())!==parseInt(t)){this.storage.set(t);this.storeChangeListeners.forEach((e=>e.cb(t)))}}getStoreId(){const t=this.storage.get();return t||(this.storage.getDefault()||void 0)}getStoreDataById(t){ for(let e=0;e<this.stores.length;e++)if(parseInt(this.stores[e].i)===parseInt(t))return JSON.parse(JSON.stringify(this.stores[e]));return null}isStoreLocalAvailable(t){const e=(t=t||this.getCurrentStoreData())&&t.lo;return!e||1===parseInt(e)}getCurrentStoreName(){try{return this.getCurrentStoreData().n}catch(t){}return""}getCurrentStoreData(){return this.getStoreDataById(this.getStoreId())}getStoresTemplate(){return e.storesTemplateString}getStoresInfoTemplate(){return e.storesInfoTemplateString}getStores(){return JSON.parse(JSON.stringify(this.stores))}listenStores(t){this.storesUpdatesListeners.push(t)}listenStoreChange(t){this.storeChangeListeners.push({cb:t})}_setStores(t){this.stores=t||[];this.stores.forEach((t=>t.stock_qty=t.stock_qty||0));this.storesUpdatesListeners.forEach((t=>t(JSON.parse(JSON.stringify(this.stores)))));const e=this.getStoreId();e||this._setStoreIdByUserLocation();this.setStore(e)}updateStores(t){this.stockQtySet=!0 ;this._setStores(this.stores.reduce(((e,i)=>{for(let s=0;s<t.length;s++)if(parseInt(t[s].entity_id)===parseInt(i.i)||parseInt(t[s].i)===parseInt(i.i)){const o=Object.assign({stock_meta_info:{}},i,t[s]);e.push(o);return e}return e}),[]))}getStockQtySet(){return this.stockQtySet}_isStoreAvailable(t){for(let e=0;e<this.stores.length;e++)if(parseInt(this.stores[e].i)===parseInt(t))return!0;return!1}_setStoreIdByUserLocation(){if(e.isGeoOff||!this._getIsLocationRequestAllowed())return;t.getUserLocation((e=>{if(this.storage.get())return;let i,s;this.stores.forEach((o=>{const n=t.getDistance(e,{lat:o.lat,lng:o.lng});if(!(s<n)){s=n;i=o}}));this.setStore((i||this.stores[0]).i)}),(t=>{console.log("Geolocation error:",t);3!==t.code&&localStorage.setItem("location-request-timeout",new Date(Date.now()+864e5).toString())}))}_getIsLocationRequestAllowed(){const t=localStorage.getItem("location-request-timeout");return!(t&&!(new Date(t)<new Date))}})) ;define("storeLocatorRequest",["underscore","jquery","requireModule","uiRegistry"],((t,e,i,s)=>{"use strict";const o=new i;s.get("storeLocatorRequestData",(i=>{e.ajax({type:"GET",url:i.url,cache:!0}).done((e=>o.set(Object.assign(i,{stores:e,storesTemplateString:t.template(i.storesTemplateString),storesInfoTemplateString:t.template(i.storesInfoTemplateString),isGeoOff:i.isGeoOff}))))}));return o}));