PageSourceSearch

https://www.alphaindustries.eu/theme/76e61ef1c77642a5ca3a6ee3599ec…/acris-shop-switch.plugin.7ccebc.js

js alphaindustries.eu collected 2026-09-26 01:52:37 UTC 19,684 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["acris-shop-switch.plugin"],{709:(t,e,o)=>{o.d(e,{Z:()=>i});class s{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 o=s.toUpperCamelCase(t,e);return s.lcFirst(o)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>s.ucFirst(t.toLowerCase())).join(""):s.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class i{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!i.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 o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(o&&!1===i.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(o)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),a=s.toLowerCamelCase(n,"-");if(!i.isNode(t)){if(o)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(o)throw Error("This node doesn't support the dataset attribute!");return}let r=t.dataset[a];if(void 0===r){if(o)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return r}return s.parsePrimitive(r)}static querySelector(t,e){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(o&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelector(e)||!1;if(o&&!1===s)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return s}static querySelectorAll(t,e){let o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(o&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelectorAll(e);if(0===s.length&&(s=!1),o&&!1===s)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return s}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,o)=>{o.d(e,{Z:()=>s});class s{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var o of t.entries())e(o[1],o[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(o=>{e(t[o],o)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}},107:(t,e,o)=>{o.d(e,{Z:()=>s});class s{get(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,o);return this._sendRequest(s,null,e)}post(t,e,o){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let i=this._createPreparedRequest("POST",t,s);return this._sendRequest(i,e,o)}delete(t,e,o){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let i=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(i,e,o)}patch(t,e,o){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let i=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(i,e,o)}
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,o){return this._registerOnLoaded(t,o),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,o){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),o&&this._request.setRequestHeader("Content-type",o),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}},306:(t,e,o)=>{o.d(e,{ar:()=>l,ZP:()=>u});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 i=o(266);let n="modal-backdrop",a="modal-backdrop-open",r="no-scroll",l=350,c={ON_CLICK:"backdrop/onclick"};class d{create(t){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let e=document.body.lastChild;document.documentElement.classList.add(r),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]:l,e=this._getBackdrops();i.Z.iterate(e,t=>t.classList.remove(a)),setTimeout(this._removeExistingBackdrops.bind(this),t),document.documentElement.classList.remove(r)}_dispatchEvents(){let t=s.isTouchDevice()?"touchstart":"click";document.addEventListener(t,function(t){t.target.classList.contains(n)&&document.dispatchEvent(new CustomEvent(c.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(".".concat(n))}_removeExistingBackdrops(){if(!1===this._exists())return;let t=this._getBackdrops();i.Z.iterate(t,t=>t.remove())}_exists(){return document.querySelectorAll(".".concat(n)).length>0}_getTemplate(){return'<div class="'.concat(n,'"></div>')}constructor(){return d.instance||(d.instance=this),d.instance}}let h=Object.freeze(new d);class u{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;h.create(t)}static remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;h.remove(t)}static SELECTOR_CLASS(){return n}}},156:(t,e,o)=>{o.r(e),o.d(e,{default:()=>c});var s=o(107),i=o(709);class n{static isSupported(){return"undefined"!==document.cookie}static setItem(t,e,o){if(null==t)throw Error("You must specify a key to set a cookie");let s=new Date;s.setTime(s.getTime()+864e5*o);let i="";"https:"===location.protocol&&(i="secure"),document.cookie="".concat(t,"=").concat(e,";expires=").concat(s.toUTCString(),";path=/;sameSite=lax;").concat(i)}static getItem(t){if(!t)return!1;let e=t+"=",o=document.cookie.split(";");for(let t=0;t<o.length;t++){let s=o[t];for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(e))return s.substring(e.length,s.length)}return!1}static removeItem(t){document.cookie="".concat(t,"= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/")}static key(){return""}static clear(){}}var a=o(306);let r="js-pseudo-modal";class l{open(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.ar;this._hideExistingModal(),this._create(),setTimeout(this._open.bind(this,t),e)}close(){let t=this.getModal();this._modalInstance=bootstrap.Modal.getInstance(t),this._modalInstance.hide()}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(t,e){this._content=t,this._setModalContent(t),this.updatePosition(),"function"==typeof e&&e.bind(this)()}_hideExistingModal(){try{let t=i.Z.querySelector(document,".".concat(r," .modal"),!1);if(!t)return;let e=bootstrap.Modal.getInstance(t);if(!e)return;e.hide()}catch(t){console.warn("[PseudoModalUtil] Unable to hide existing pseudo modal before opening pseudo modal: ".concat(t.message))}}_open(t){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",t),this._modalInstance.show()}_create(){this._modalMarkupEl=i.Z.querySelector(document,this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMar
1kup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=i.Z.querySelector(document,".".concat(r),!1),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(r))}_createModalMarkup(){let t=i.Z.querySelector(this._modalWrapper,".modal",!1);if(t)return t;let e=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(e),i.Z.querySelector(this._modalWrapper,".modal")}_setModalTitle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{i.Z.querySelector(this._modalWrapper,this._templateTitleSelector).innerHTML=t}catch(t){}}_setModalContent(t){let e=i.Z.querySelector(this._modalWrapper,this._templateContentSelector);e.innerHTML=t;try{let t=i.Z.querySelector(e,this._templateTitleSelector);t&&(this._setModalTitle(t.innerHTML),t.parentNode.removeChild(t))}catch(t){}}constructor(t,e=!0,o=".".concat("js-pseudo-modal-template"),s=".".concat("js-pseudo-modal-template-content-element"),i=".".concat("js-pseudo-modal-template-title-element")){this._content=t,this._useBackdrop=e,this._templateSelector=o,this._templateContentSelector=s,this._templateTitleSelector=i}}class c extends window.PluginBaseClass{init(){(this._client=new s.Z(window.accessKey,window.contextToken),this.PluginManager=window.PluginManager,"ajax"===this.options.integrationType)?!1===this.isCookieSet(this.options.currentDomainId,this.options.cookieName)&&this.checkShopSwitchByAjaxRequest():(this.modal=this.el,this.initModal(),!1!==this.options.loadImmediately&&this.openModal())}isCookieSet(t,e){let o=n.getItem(e);return o&&-1!==o.indexOf(t)}checkShopSwitchByAjaxRequest(){this._client.get(this.options.url+"?uri="+encodeURIComponent(window.location.pathname+window.location.search)+"&route="+encodeURI(this.options.route)+"&route-params="+encodeURI(this.options.routeParams),this._onAfterGetAjaxResponse.bind(this))}_onAfterGetAjaxResponse(t){let e=this.getValidJson(t);if(!1!==e){!0===e.success&&e.redirectTo?this.setRedirect(e.redirectTo,e.currentUrl,e.countryId):!0===e.success&&this.saveConfiguration();return}this.removeModalLoadedWithoutAjax();let o=new DOMParser().parseFromString(t,"text/html");this.backdropSettings=this.setBackdropSettings(o);let s=new l(t,this.backdropSettings);s.open(()=>{window.PluginManager.initializePlugins().then(()=>{this.modal=i.Z.querySelector(document,"."+this.options.modalClass,!1),this.initModal()})});let n=s.getModal();this.options.modalClass&&n.classList.add(this.options.modalClass),this.modal=n}saveConfiguration(){this.saveConfigurationByAjaxRequest(this.options.reloadPage)}saveConfigurationByAjaxRequest(t){let e={},o=this.getSelectedCountryId();o&&(e.selectedCountryId=o),this._client.post(this.options.saveConfigurationUrl,JSON.stringify(e),e=>{("1"===t||!0===t)&&location.reload()})}getBrowserLanguage(){return navigator.language||navigator.userLanguage}initModal(){this.modal&&(this._collectModalComponents(),this._registerModalEvents(),this.hideModalCloseButton())}_collectModalComponents(){this.modalContentContainer=i.Z.querySelector(this.modal,this.options.modalContentContainerSelector,!1),this.modalButtonClose=i.Z.querySelector(this.modal,this.options.modalCloseButtonSelector,!1),this.modalBackdrop=i.Z.querySelector(document,this.options.backdropSelector,!1),this.modalContentContainer?(this.options.currentDomainUrl=this.modalContentContainer.dataset.currentdomainurl,this.options.modalCloseType=this.modalContentContainer.dataset.currentmodalclosetype,this.options.reloadPage=this.modalContentContainer.dataset.currentmodalreloadpage,this.options.externalDomains=this.collectExternalDomains(this.modalContentContainer.dataset.externaldomains)):(this.options.currentDomainUrl="",this.options.modalCloseType="",this.options.reloadPage="",this.options.externalDomains=""),this.submitButton=i.Z.querySelector(this.modal,this.options.submitButtonSelector,!1),this.countrySelect=i.Z.querySelector(this.modal,this.options.countrySelectSelector,!1),this.languageSelect=i.Z.querySelector(this.modal,this.options.languageSelectSelector,!1),this.countrySelect&&this.languageSelect&&this.onChangeCountrySelect()}_registerModalEvents(){this.submitButton&&this.submitButton.addEventListener("click",this.onSubmitSelection.bind(this)),this.countrySelect&&this.languageSelect&&this.countrySelect.addEventListener("change",this.onChangeCountrySelect.bind(this)),"close_and_switch"===this.options.modalCloseType?(this.modalButtonClose&&this.modalButtonClose.addEventListener("click",this.onSubmitSelection.bind(this)),this.modal&&this.modal.addEventListener("click",this.onClickOutsideModal.bind(this))):"close_and_remember"===this.options.modalCloseType&&(this.modalButtonClose&&this.modalButtonClose.addEventListener("click",this.onStayCurrentDomain.bind(this)),this.modal&&this.modal.addEventListener("click",this.onClickOutsideModal.bind(this)))}hideModalCloseButton(){if("disabled"===this.options.modalCloseType){let t=i.Z.querySelector(this.modal,this.options.modalCloseButtonSelector,!1);t&&t.remove()}}openModal(){void 0!==this.modal&&("disabled"===this.options.modalCloseType?new bootstrap.Modal(this.modal,{backdrop:"static",keyboard:!1}).show():new bootstrap.Modal(this.modal).show(),setTimeout(()=>{let t=i.Z.querySelector(document,".acris-cookie-consent.is--modal",!1);t&&(t.style.display="none")},"500"))}onChangeCountrySelect(){let t=this.getDomainUrlsOfElement(this.countrySelect),e=this.getCountryIsoOfElement(this.countrySelect),o=0,s=!1;for(var i=0;i<this.languageSelect.children.length;i+=1){let n=JSON.parse(this.languageSelect.children[i].dataset.domainurls),a=this.languageSelect.children[i];if(""===this.getMatchOfArrays(t,n)){if(a.disabled=!0,a.style.display="none",a.selected=!1,!0===this.isSafari()){let t=document.createElement("span");t.textContent=a.textContent,t.dataset.value=a.value,t.dataset.domainurls=a.dataset.domainurls,t.dataset.languageiso=a.dataset.languageiso,a.parentNode.replaceChild(t,a)}}else if(o||(o=i),a.disabled=!1,a.style.display="block",!1===s&&(!this.languageSelect.value||a.dataset.languageiso.includes(e))&&(s=!0,a.selected=!0),"SPAN"===a.nodeName){let t=document.createElement("option");t.textContent=a.textContent,t.dataset.value=a.value,t.dataset.domainurls=a.dataset.domainurls,t.dataset.languageiso=a.dataset.languageiso,a.parentNode.replaceChild(t,a)}}this.languageSelect.value||(this.languageSelect.children[o].selected=!0)}onSubmitSelection(){let t=this.getMatchingDomain();if(this.options.currentDomainUrl===t){this.closeModal(),this.saveConfiguration();return}
1this.setRedirect(t,this.options.currentDomainUrl,this.getSelectedCountryId())}onStayCurrentDomain(){this.closeModal(),this.saveConfiguration()}onClickOutsideModal(t){t.target.closest("div.modal-dialog")||("close_and_switch"===this.options.modalCloseType?this.onSubmitSelection():"close_and_remember"===this.options.modalCloseType&&this.onStayCurrentDomain())}getMatchingDomain(){let t=this.getDomainUrlsOfElement(this.countrySelect),e=this.getDomainUrlsOfElement(this.languageSelect);return t&&t.length>0&&e&&e.length>0?this.getMatchOfArrays(t,e):t&&t.length>0?t[0]:e&&e.length>0?e[0]:""}getDomainUrlsOfElement(t){if(t){let e=t.options[t.selectedIndex];if(e)return JSON.parse(e.dataset.domainurls)}return[]}getCountryIsoOfElement(t){if(t){let e=t.options[t.selectedIndex];if(e)return e.dataset.countryiso}return[]}getMatchOfArrays(t,e){for(var o=0;o<t.length;o+=1)for(var s=0;s<e.length;s+=1)if(t[o]===e[s])return t[o];return""}setRedirect(t,e,o){t&&(t!==e?(t=this.addSetCountryId(t,o),window.location.replace(t)):this.saveConfiguration())}addSetCountryId(t,e){return t&&!0!==this.urlInExternalDomains(t)&&(t=t.includes("?")?t+"&"+this.options.switchDoneParamName+"=1":t+"?"+this.options.switchDoneParamName+"=1",e&&(t=t+"&"+this.options.switchCountryIdParamName+"="+e)),t}urlInExternalDomains(t){let e=this.options.externalDomains,o=!1;return e&&e.forEach(function(e){t===e&&(o=!0)}),o}closeModal(){bootstrap.Modal.getInstance(this.modal).hide();let t=i.Z.querySelector(document,".acris-cookie-consent.is--modal",!1);t&&(t.style.display="")}getSelectedCountryId(){if(this.countrySelect&&this.countrySelect.options[this.countrySelect.selectedIndex]&&this.countrySelect.options[this.countrySelect.selectedIndex].dataset.countryid)return this.countrySelect.options[this.countrySelect.selectedIndex].dataset.countryid}getValidJson(t){let e="";try{e=JSON.parse(t)}catch(t){return!1}return e}setBackdropSettings(t){let e=i.Z.querySelector(t,this.options.modalContentContainerSelector,!1);if(!e)return;let o=e.dataset.currentmodalclosetype;return!o||"disabled"!==o||"static"}collectExternalDomains(t){if(t)try{return JSON.parse(t)}catch(t){}return[]}removeModalLoadedWithoutAjax(){let t=i.Z.querySelector(document,"#"+this.options.modalId,!1);t&&t.remove(),window.PluginManager.getPluginInstances("AcrisShopSwitch").forEach(t=>{t.modal=void 0})}isSafari(){let t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")&&!t.includes("android")}}c.options={cookieName:"acris_shop_switch_checked",url:"",modalClass:"acris-shop-switch-modal",modalContentContainerSelector:".acris-shop-switch-modal-content",submitButtonSelector:".acris-shop-switch-submit-btn",countrySelectSelector:".acris-shop-switch-country-select",languageSelectSelector:".acris-shop-switch-language-select",modalCloseButtonSelector:".only-close",directRedirectLinkSelector:".acris-shop-switch-direct-url",backdropSelector:".modal-backdrop",saveConfigurationUrl:"",modalCloseType:"only_close",currentDomainUrl:"",switchCountryIdParamName:"switch-country-id",switchDoneParamName:"switch-done",externalDomains:[],integrationType:"direct",currentDomainId:"",reloadPage:"",routeParams:[],route:"",loadImmediately:!0,modalId:"acrisShopSwitchModal"}}}]);

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.