1(()=>{"use strict";var e={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 n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function s(e,t,i){return e.concat(t).map(function(e){return n(e,i)})}function r(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 o(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c,d,h=Array.isArray(i);return h!==Array.isArray(e)?n(i,l):h?l.arrayMerge(e,i,l):(d={},(c=l).isMergeableObject(e)&&r(e).forEach(function(t){d[t]=n(e[t],c)}),r(i).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&c.isMergeableObject(i[t])?d[t]=(function(e,t){if(!t.customMerge)return o;var i=t.customMerge(e);return"function"==typeof i?i:o})(t,c)(e[t],i[t],c):d[t]=n(i[t],c))}),d)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return o(e,i,t)},{})},e.exports=o}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n=i(156),s=i.n(n);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()}}}class a{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],n=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(n),n}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,s=e.split("."),r=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=r;r=function(i){n.unsubscribe(e),t(i)}}return this.el.addEventListener(s[0],r),this.listeners.push({splitEventName:s,opts:i,cb:r}),!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}}class o{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(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=r.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=r.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}}let l="[data-tcinn-ac-payment-outside]",c=["_initAccordions","_syncPaymentShippingToForm","_initMethodCandidates","_initPaymentButtonSwap"];function d(e){let t=!1;[".checkout-aside",".tcinn-ac-mobile-summary"].forEach(i=>{let n=document.querySelector(i),s=e.querySelector(i);n&&s&&("DETAILS"===n.tagName&&"DETAILS"===s.tagName&&(s.open=n.open),n.replaceWith(s),t=!0)});let i=document.querySelector("#tcinn-ac-checkout-state"),n=e.querySelector("#tcinn-ac-checkout-state");return i&&n&&(i.textContent=n.textContent),t}class h extends o{static #e=this.options={containerSelectors:[".checkout-aside-product-list",".confirm-product .card-body",".offcanvas-cart-items"],stickyContainerSelectors:[".offcanvas-cart-items"],indicatorClass:"tcinn-ac-scroll-indicator",hasMoreClass:"has-more-items"};init(){this._containers=[],this._indicators=[],this._handlers=[],this.options.containerSelectors.forEach(e=>{let t=this.el.querySelector(e);t&&t.scrollHeight>t.clientHeight&&this._setupIndicator(t)})}_setupIndicator(e){let t=document.createElement("div");t.classList.add(this.options.indicatorClass,this.options.hasMoreClass);let i=this.el.dataset.tcinnAcScrollIndicatorText||"";t.innerHTML=`<span class="tcinn-ac-scroll-indicator-badge">▾ ${i} ▾</span>`,this.options.stickyContainerSelectors.some(t=>e.matches(t))?(t.classList.add("tcinn-ac-scroll-indicator--sticky"),e.appendChild(t)):(e.parentNode.style.position="relative",e.parentNode.appendChild(t));let n=()=>this._handleScroll(e,t);e.addEventListener("scroll",n,{passive:!0}),this._containers.push(e),this._indicators.push(t),this._handlers.push(n),this._handleScroll(e,t)}_handleScroll(e,t){let i=e.scrollTop+e.clientHeight>=e.scrollHeight-10;t.classList.toggle(this.options.hasMoreClass,!i)}destroy(){this._containers.forEach((e,t)=>{e.removeEventListener("scroll",this._handlers[t]),this._indicators[t]?.remove()}),this._containers=[],this._indicators=[],this._handlers=[]}}class u extends o{static #e=this.options={storageKey:"tcinnAdvancedCheckoutCartExpireTime",displaySelector:"#tcinn-ac-cart-timer-display",textSelector:"#tcinn-ac-cart-timer-text",expiredClass:"tcinn-ac-cart-timer-expired"};init(){if("true"===this.el.dataset.tcinnAcAgentHide&&navigator.webdriver){this.el.style.display="none";return}if(this._display=document.querySelector(this.options.displaySelector),this._textEl=document.querySelector(this.options.textSelector),!this._display||!this._textEl)return;let e=this.el.dataset.tcinnAcCartTimer;this._expiredText=this.el.dataset.tcinnAcCartTimerExpired;let t=this._parseDurationToMs(e);if(t<=0)return;let i=Date.now(),n=parseInt(localStorage.getItem(this.options.storageKey)||"0",10);(!n||n<=i)&&(n=i+t,localStorage.setItem(this.options.storageKey,String(n))),this._expireTime=n,this._update(),this._interval=setInterval(()=>this._update(),1e3)}destroy(){this._interval&&(clearInterval(this._interval),this._interval=null)}_update(){let e=this._expireTime-Date.now();if(e<=0){clearInterval(this._interval),this._interval=null,localStorage.removeItem(this.options.storageKey),this._textEl.textContent=this._expiredText,this.el.classList.add(this.options.expiredClass);let e=document.getElementById("tcinn-ac-cart-timer-live");e&&(e.textContent=this._expiredText);return}let t=Math.floor(e/1e3),i=Math.floor(t/60);this._display.textContent=String(i).padStart(2,"0")+":"+String(t%60).padStart(2,"0")}_parseDurationToMs(e){let t;let i=String(e).trim();if(/^\d+$/.test(i))return 1e3*parseInt(i,10);let n=i.split(":").map(Number);if(n.some(e=>Number.isNaN(e)))return 0;if(2===n.length)t=60*n[0]+n[1];else{if(3!==n.length)return 0;t=3600*n[0]+60*n[1]+n[2]}return 1e3*t}}let m="tcinnAcFormPersistence",p=/pass(word)?|captcha|csrf|_token|cc[-_]|card|cvv|cvc|cvn|securitycode|iban|bic|sepa|bankname|accountholder|tos|revocation|newsletter/i,_=/^cc-/i,g='input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea';class f extends o{static #e=this.presets={subtle:{interval:45e3,visible:8e3},balanced:{interval:25e3,visible:12e3},active:{interval:14e3,visible:15e3}};init(){let e=this.el.dataset;this._mode="live"===e.mode?"live":"random",this._randomType="base"===e.randomType?"base":"range",this._min=this._int(e.min,3),this._max=this._int(e.max,12),this._base=this._int(e.base,8),this._variance=this._int(e.variance,3),this._pingUrl=e.pingUrl||"",this._message=e.message||"%count%",this._messageSingular=e.messageSingular||this._message;let t=this.constructor.presets[e.preset]||this.constructor.presets.balanced;this._interval=t.interval,this._visible=t.visible,this._textEl=this.el.querySelector(".tcinn-ac-social-proof-text"),this._timers=[],this._footerVisible=!1;let i=document.querySelector(".tcinn-ac-cart-minimal-footer")||document.querySelector(".footer-main")||document.querySelector("footer");i&&"IntersectionObserver"in window&&(this._footerObserver=new IntersectionObserver(e=>{this._footerVisible=e.some(e=>e.isIntersecting),this._footerVisible&&this.el.classList.remove("is-visible")},{threshold:0}),this._footerObserver.observe(i)),this._schedule(this._showCycle.bind(this),4e3)}_int(e,t){let i=parseInt(e,10);return Number.isFinite(i)?i:t}_schedule(e,t){this._timers.push(window.setTimeout(e,t))}async _showCycle(){let e=await this._resolveCount();e&&e>=1&&!this._footerVisible?(this._render(e),this.el.classList.add("is-visible"),this._schedule(()=>{this.el.classList.remove("is-visible"),this._schedule(this._showCycle.bind(this),this._interval)},this._visible)):this._schedule(this._showCycle.bind(this),this._interval)}_render(e){let t=1===e?this._messageSingular:this._message;this._textEl&&(this._textEl.textContent=t.replace("%count%",String(e)))}
1_resolveCount(){return"live"===this._mode?this._fetchLiveCount():Promise.resolve(this._randomCount())}_randomCount(){if("base"===this._randomType){let e=Math.floor(Math.random()*(2*this._variance+1))-this._variance;return Math.max(1,this._base+e)}let e=Math.min(this._min,this._max);return Math.floor(Math.random()*(Math.max(this._min,this._max)-e+1))+e}async _fetchLiveCount(){if(!this._pingUrl)return 0;try{let e=await fetch(this._pingUrl,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({token:this._token()})});if(!e.ok)return 0;let t=await e.json();return this._int(t.count,0)}catch(e){return 0}}_token(){try{let e=window.sessionStorage.getItem("tcinnAcSpToken");return e||(e=`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`,window.sessionStorage.setItem("tcinnAcSpToken",e)),e}catch(e){return`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}}destroy(){this._timers.forEach(e=>window.clearTimeout(e)),this._timers=[],this._footerObserver&&this._footerObserver.disconnect(),this.el.classList.remove("is-visible")}}class y{static isSupported(){return"undefined"!==document.cookie}static setItem(e,t,i){if(null==e)throw Error("You must specify a key to set a cookie");let n=new Date;n.setTime(n.getTime()+864e5*i);let s="";"https:"===location.protocol&&(s="secure"),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/;sameSite=lax;${s}`}static getItem(e){if(!e)return!1;let t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let n=i[e];for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return!1}static removeItem(e){document.cookie=`${e}= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/`}static key(){return""}static clear(){}}let v="CookieConfiguration_Update",b='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',S=b+' © <a href="https://carto.com/attributions">CARTO</a>';class w extends o{static #e=this.options={mapLibreVersion:"5.24.0",mapLibreCss:"https://unpkg.com/[email protected]/dist/maplibre-gl.css",mapLibreJs:"https://unpkg.com/[email protected]/dist/maplibre-gl.js",mapLibreCssSri:"sha256-qx5w1Z7EBGW65+cDDaLzzPKBM/1QLmK9WY7vut/XpzI=",mapLibreJsSri:"sha256-RamwepGJzlYFTGIKlHzPQeKR5YyV6bYVM7dAqqZe5cs=",nominatimUrl:"https://nominatim.openstreetmap.org/search",zoom:14,cookieName:"tcinn-ac-finish-map",mapStyles:{liberty:{styleUrl:"https://tiles.openfreemap.org/styles/liberty"},bright:{styleUrl:"https://tiles.openfreemap.org/styles/bright"},voyager:{rasterUrl:"https://a.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{ratio}.png",attribution:S,maxZoom:20,needsCartoKey:!0},positron:{rasterUrl:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{ratio}.png",attribution:S,maxZoom:20,needsCartoKey:!0},osm:{rasterUrl:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:b,maxZoom:19}}};init(){if(this.query=(this.el.dataset.tcinnAcMapQuery||"").trim(),this.fallbackQuery=(this.el.dataset.tcinnAcMapFallback||"").trim(),this.label=(this.el.dataset.tcinnAcMapLabel||"").trim(),this.cookieName=this.el.dataset.tcinnAcMapCookie||this.options.cookieName,this.mapStyle=(this.el.dataset.tcinnAcMapStyle||"liberty").trim(),this.cartoKey=(this.el.dataset.tcinnAcMapCartoKey||"").trim(),this.customTileUrl=(this.el.dataset.tcinnAcMapTileUrl||"").trim(),this.customAttribution=(this.el.dataset.tcinnAcMapAttribution||"").trim(),this.locale=this._parseLocale(this.el.dataset.tcinnAcMapLocale),this.consentBox=this.el.querySelector("[data-tcinn-ac-map-consent-box]"),this.settingsBtn=this.el.querySelector("[data-tcinn-ac-map-settings]"),this.canvas=this.el.querySelector("[data-tcinn-ac-map-canvas]"),this.errorEl=this.el.querySelector("[data-tcinn-ac-map-error]"),this.canvas&&this.query){if(!this._hasWebGl()){(this.el.closest(".tcinn-ac-finish-map-section")||this.el).hidden=!0;return}this.settingsBtn&&(this._openCookieSettings=this._openCookieSettings.bind(this),this.settingsBtn.addEventListener("click",this._openCookieSettings)),this._onConsentUpdate=this._onConsentUpdate.bind(this),document.$emitter.subscribe(v,this._onConsentUpdate),this._isConsented()&&this._loadMap()}}_isConsented(){return!!y.getItem(this.cookieName)}_onConsentUpdate(){this._isConsented()&&this._loadMap()}_openCookieSettings(){let e=document.querySelector("[data-cookie-permission]");if(!e||!window.PluginManager)return;let t=window.PluginManager.getPluginInstanceFromElement(e,"CookieConfiguration");t&&"function"==typeof t.openOffCanvas&&t.openOffCanvas()}_hasWebGl(){try{let e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");
1if(!t)return!1;let i=t.getExtension("WEBGL_lose_context");return i&&i.loseContext(),!0}catch(e){return!1}}async _loadMap(){if(!this._loaded&&!this._loading){this._loading=!0,this.el.classList.add("is-loading");try{await this._ensureMapLibre();let e=[this.query,this.fallbackQuery].filter(Boolean).filter((e,t,i)=>i.indexOf(e)===t),t=null;for(let i of e)if(t=await this._geocode(i))break;if(!t)throw Error("geocode-empty");this._renderMap(t),this.consentBox&&(this.consentBox.hidden=!0),this.el.classList.add("is-loaded"),this._loaded=!0}catch(e){this._showError()}finally{this._loading=!1,this.el.classList.remove("is-loading")}}}_ensureMapLibre(){return window.maplibregl?Promise.resolve():(window.tcinnAcMapLibrePromise||(window.tcinnAcMapLibrePromise=new Promise((e,t)=>{if(!document.querySelector("link[data-tcinn-ac-maplibre-css]")){let e=document.createElement("link");e.rel="stylesheet",e.href=this.options.mapLibreCss,e.integrity=this.options.mapLibreCssSri,e.crossOrigin="anonymous",e.setAttribute("data-tcinn-ac-maplibre-css","true"),document.head.appendChild(e)}let i=document.createElement("script");i.src=this.options.mapLibreJs,i.integrity=this.options.mapLibreJsSri,i.crossOrigin="anonymous",i.onload=()=>e(),i.onerror=()=>{delete window.tcinnAcMapLibrePromise,i.remove(),t(Error("maplibre-load"))},document.head.appendChild(i)})),window.tcinnAcMapLibrePromise)}async _geocode(e){let t="tcinn-ac-geo:"+e,i=this._readSessionCache(t);if(i)return i;let n=`${this.options.nominatimUrl}?format=json&limit=1&addressdetails=0&q=${encodeURIComponent(e)}`,s=await fetch(n,{headers:{Accept:"application/json"}});if(!s.ok)throw Error(`nominatim-${s.status}`);let r=await s.json();if(Array.isArray(r)&&r.length>0&&r[0].lat&&r[0].lon){let e={lat:parseFloat(r[0].lat),lon:parseFloat(r[0].lon)};return this._writeSessionCache(t,e),e}return null}_readSessionCache(e){try{let t=window.sessionStorage.getItem(e),i=t?JSON.parse(t):null;return i&&Number.isFinite(i.lat)&&Number.isFinite(i.lon)?i:null}catch(e){return null}}_writeSessionCache(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){}}_renderMap(e){let{lat:t,lon:i}=e,n=window.maplibregl,s=new n.Map({container:this.canvas,style:this._resolveStyle(),center:[i,t],zoom:this.options.zoom,scrollZoom:!1,dragRotate:!1,pitchWithRotate:!1,touchPitch:!1,cooperativeGestures:!0,locale:this.locale});s.touchZoomRotate.disableRotation(),s.keyboard.disableRotation(),this.map=s;let r=!1;s.once("load",()=>{r=!0,this._collapseAttributionOnNarrowMap(),this._hideTransitLabels(s)}),s.on("error",e=>{r||e&&e.sourceId||this._showError()});let a=new n.Marker({element:this._buildMarkerElement(),anchor:"bottom"}).setLngLat([i,t]).addTo(s);this.label&&(a.setPopup(new n.Popup({offset:46,closeOnClick:!1,focusAfterOpen:!1}).setText(this.label)),a.togglePopup()),window.setTimeout(()=>s.resize(),120)}_resolveStyle(){if("custom"===this.mapStyle&&this.customTileUrl)return/\{(z|x|y|quadkey|bbox-epsg-3857)\}/.test(this.customTileUrl)?this._rasterStyle(this.customTileUrl,this.customAttribution||b,20):this.customTileUrl;let e=this.options.mapStyles[this.mapStyle]||this.options.mapStyles.liberty;if(e.styleUrl)return e.styleUrl;let t=e.rasterUrl;return e.needsCartoKey&&this.cartoKey&&(t+=(t.includes("?")?"&":"?")+"key="+encodeURIComponent(this.cartoKey)),this._rasterStyle(t,e.attribution,e.maxZoom)}_rasterStyle(e,t,i){return{version:8,sources:{"tcinn-ac-raster":{type:"raster",tiles:[e.replace(/\{s\}/g,"a").replace(/\{r\}/g,"{ratio}")],tileSize:256,maxzoom:i,attribution:t}},layers:[{id:"tcinn-ac-raster",type:"raster",source:"tcinn-ac-raster"}]}}_parseLocale(e){try{let t=e?JSON.parse(e):null;return t&&"object"==typeof t?t:void 0}catch(e){return}}_hideTransitLabels(e){try{e.getLayer("poi_transit")&&e.setLayoutProperty("poi_transit","visibility","none")}catch(e){}}_collapseAttributionOnNarrowMap(){let e=this.el.querySelector(".maplibregl-ctrl-attrib");e&&!(this.canvas.offsetWidth>640)&&e.classList.contains("maplibregl-compact")&&(e.classList.remove("maplibregl-compact-show"),e.removeAttribute("open"))}_buildMarkerElement(){let e=document.querySelector(".tcinn-ac-checkout-section-headline"),t=e&&getComputedStyle(e).color||"#0c72a7",i=document.createElement("div");return i.className="tcinn-ac-finish-map-marker",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="34" height="46" viewBox="0 0 24 32" aria-hidden="true"><path d="M12 0a12 12 0 0 0-12 12c0 9 12 20 12 20s12-11 12-20A12 12 0 0 0 12 0z" fill="'+t+'"/><circle cx="12" cy="12" r="4.5" fill="#ffffff"/></svg>',i}_showError(){this.el.classList.add("has-error"),this.errorEl&&(this.errorEl.hidden=!1)}destroy(){this._onConsentUpdate&&document.$emitter.unsubscribe(v,this._onConsentUpdate),this.settingsBtn&&this._openCookieSettings&&this.settingsBtn.removeEventListener("click",this._openCookieSettings),this.map&&(this.map.remove(),this.map=null),super.destroy()}}let A="tcinnAcExitIntentShown",E="tcinnAcExitRestore";class k{constructor(){this._storage={}}setItem(e,t){return this._storage[e]=t}getItem(e){return Object.prototype.hasOwnProperty.call(this._storage,e)?this._storage[e]:null}removeItem(e){return delete this._storage[e]}key(e){return Object.values(this._storage)[e]||null}clear(){return this._storage={}}}class C{constructor(){this._storage=null,this._chooseStorage(),this._val
1idateStorage()}_chooseStorage(){return C._isSupported("localStorage")?this._storage=window.localStorage:C._isSupported("sessionStorage")?this._storage=window.sessionStorage:y.isSupported()?this._storage=y:this._storage=new k}static _isSupported(e){try{let t="__storage_test";return window[e].setItem(t,"1"),window[e].removeItem(t),!0}catch(e){return!1}}_validateStorage(){if("function"!=typeof this._storage.setItem)throw Error('The storage must have a "setItem" function');if("function"!=typeof this._storage.getItem)throw Error('The storage must have a "getItem" function');if("function"!=typeof this._storage.removeItem)throw Error('The storage must have a "removeItem" function');if("function"!=typeof this._storage.key)throw Error('The storage must have a "key" function');if("function"!=typeof this._storage.clear)throw Error('The storage must have a "clear" function')}getStorage(){return this._storage}}let L=Object.freeze(new C).getStorage(),q=".line-item, .tcinn-ac-line-item-row",x=".tcinn-ac-line-item-foreign-fields",I="tcinn-ac-offcanvas-sticky",T="tcinn-ac-sticky-ready",M="--tcinn-ac-sticky-main-top",P="--tcinn-ac-sticky-aside-top",F=".address-manager-modal",O=!1,N=!1;function $(e){let t=e.target;if(!(t&&t.closest?t.closest("[data-address-manager]"):null))return;if(N||document.querySelector(F)){e.preventDefault(),e.stopImmediatePropagation();return}N=!0;let i=()=>{N=!1,n.disconnect(),window.clearTimeout(s)},n=new MutationObserver(()=>{document.querySelector(F)&&i()});n.observe(document.body,{childList:!0,subtree:!0});let s=window.setTimeout(i,6e3)}let D="tcinnAcDeliveryDate",B="Y-m-d",R=["text","email","tel","search"],z={company:"company",department:"company",street:"street",additionalAddressLine1:"additional",additionalAddressLine2:"additional",zipcode:"zipcode",city:"city",phoneNumber:"phone",email:"email"},V=["firstName","lastName"],U="tcinnAcLengthInvalid",j="tcinnAcLengthPriorInvalid",W="tcinnAcLengthClearPending",H=/(^|\[)(street|zipcode|city)\]?$/;function K(e){if(!e.id||!H.test(e.name||"")||"none"!==getComputedStyle(e).display)return null;for(let t=e.nextElementSibling;t;t=t.nextElementSibling){let i=t.matches(".form-control")?t:t.querySelector(":scope > .form-control");if(i&&i.id.startsWith(`${e.id}-`))return i}return null}function J(e,t,i,n){n&&!e.classList.contains(t)?(e.classList.add(t),e.dataset[i]="true"):n||"true"!==e.dataset[i]||(delete e.dataset[i],e.classList.remove(t))}let G=["text","email","tel"],Z=["street","zipcode","city"],X=/(^|\[)(street|zipcode|city|countryStateId)\]?$/,Y="tcinnAcValidMark",Q='select[name="salutationId"], select[name$="[salutationId]"]',ee="tcinnAcSalutationChoice",et="tcinn-ac-salutation-message",ei="tcinn-ac-segment-control--invalid",en=".country-and-state-form-elements",es=/(?:^|\[)([a-zA-Z0-9]+)\]?$/,er=[{when:()=>!document.querySelector("#wishlist-basket, [data-wishlist-storage]"),cleanup:()=>document.querySelectorAll("[data-add-to-wishlist]").forEach(e=>e.remove())}],ea=window.PluginManager;document.querySelector("[data-tcinn-ac-checkout]")&&er.forEach(e=>{e.when()&&e.cleanup()}),ea.register("TcinnAdvancedCheckoutSalutationChoicePlugin",class extends o{init(){this._settings=this._readSettings(),this._keepers=new Map,document.querySelectorAll(Q).forEach(e=>this._prepare(e)),this._watchLoadedForms(),this._settings.required&&(this._onSubmit=e=>this._handleSubmit(e),this._onChange=e=>this._handleChange(e.target),document.addEventListener("submit",this._onSubmit,!0),document.addEventListener("change",this._onChange))}destroy(){this._formObserver&&this._formObserver.disconnect(),this._onSubmit&&(document.removeEventListener("submit",this._onSubmit,!0),document.removeEventListener("change",this._onChange)),this._keepers&&(this._keepers.forEach(e=>e.disconnect()),this._keepers.clear())}_readSettings(){try{let e=JSON.parse(this.el.getAttribute("data-tcinn-ac-salutation-choice-options")||"{}");return{required:!!e.required,texts:{...e.texts}}}catch(e){return{required:!1,texts:{}}}}_watchLoadedForms(){this._formObserver=new MutationObserver(e=>{e.forEach(e=>e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches(Q)&&this._prepare(e),e.querySelectorAll(Q).forEac
1h(e=>this._prepare(e)))}))}),this._formObserver.observe(document.body,{childList:!0,subtree:!0})}_prepare(e){if("true"===e.dataset[ee])return;let t=Array.from(e.options);if(!t.some(e=>e.defaultSelected&&""!==e.value)){if(!t.some(e=>""===e.value)){let t=new Option(this._settings.texts.placeholder||"","",!0,!0);e.insertBefore(t,e.firstChild),e.value=""}e.dataset[ee]="true",this._settings.required&&this._markRequired(e)}}_markRequired(e){e.setAttribute("aria-required","true");let t=e.id?document.querySelector(`label[for="${CSS.escape(e.id)}"]`):null;if(!t||t.querySelector(".form-required-label"))return;let i=document.createElement("span");i.className="form-required-label",i.setAttribute("aria-hidden","true"),i.textContent="*",t.append(" ",i)}_handleSubmit(e){let t=e.target;if(!(t instanceof HTMLFormElement))return;let i=Array.from(t.querySelectorAll(Q)).filter(e=>"true"===e.dataset[ee]&&!e.disabled&&""===e.value);if(0===i.length)return;e.preventDefault(),e.stopPropagation(),this._markCoreFields(t),i.forEach(e=>this._markMissing(e));let n=i[0],s=n.previousElementSibling,r=s&&s.classList.contains("tcinn-ac-segment-control")?s:n;r.scrollIntoView({block:"center",behavior:"smooth"});let a=r.matches("select")?r:r.querySelector("input");a&&a.focus({preventScroll:!0})}_markCoreFields(e){let t=window.formValidation;e.querySelector("[data-validation]")&&t&&"function"==typeof t.validateForm?t.validateForm(e):e.hasAttribute("data-form-validation")&&e.classList.add("was-validated")}_feedbackContainer(e){let t=(e.getAttribute("aria-describedby")||"").split(" ").find(e=>e.includes("feedback")),i=t?document.getElementById(t):null;return i&&i.parentElement===e.parentElement?i:null}_findMessage(e){let t=this._feedbackContainer(e);return t?t.querySelector(`.${et}`):e.parentElement.querySelector(`:scope > .${et}`)}_markMissing(e){e.classList.add("is-invalid");let t=this._findMessage(e)||this._createMessage(e),i=e.previousElementSibling;i&&i.classList.contains("tcinn-ac-segment-control")&&(i.classList.add(ei),i.setAttribute("aria-invalid","true"),i.setAttribute("aria-describedby",t.id)),this._keepMessage(e,t)}_createMessage(e){let t=document.createElement("div");t.className=`invalid-feedback d-block ${et}`,t.id=`${e.id||e.name.replace(/\W/g,"-")}-tcinn-ac-salutation-message`,t.setAttribute("role","alert"),t.textContent=this._settings.texts.required||"";let i=this._feedbackContainer(e);return i?i.append(t):e.after(t),t}_keepMessage(e,t){let i=this._feedbackContainer(e);if(!i||this._keepers.has(e))return;let n=new MutationObserver(()=>{""!==e.value||i.contains(t)||i.append(t)});n.observe(i,{childList:!0}),this._keepers.set(e,n)}_handleChange(e){if(!(e instanceof HTMLSelectElement)||"true"!==e.dataset[ee]||""===e.value)return;e.classList.remove("is-invalid");let t=this._keepers.get(e);t&&(t.disconnect(),this._keepers.delete(e));let i=e.previousElementSibling;i&&(i.classList.remove(ei),i.removeAttribute("aria-invalid"),i.removeAttribute("aria-describedby"));let n=this._findMessage(e);n&&n.remove()}},"[data-tcinn-ac-salutation-choice]"),ea.register("TcinnAdvancedCheckoutAddressCountryFirstPlugin",class extends o{init(){this._arrange(document),this._observer=new MutationObserver(e=>{e.forEach(e=>e.addedNodes.forEach(e=>{e instanceof Element&&this._arrange(e)}))}),this._observer.observe(document.body,{childList:!0,subtree:!0})}destroy(){this._observer&&this._observer.disconnect()}_arrange(e){let t=e.matches&&e.matches(en)?[e]:[];t.push(...e.querySelectorAll(en)),t.forEach(e=>this._moveBeforeStreet(e))}_moveBeforeStreet(e){let t=e.parentElement;if(!t)return;let i=Array.from(t.children).find(t=>t!==e&&t.querySelector('input[name="street"], input[name$="[street]"]'));i&&i.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&t.insertBefore(e,i)}},"[data-tcinn-ac-country-first]"),ea.register("TcinnAdvancedCheckoutQuantityRemovePlugin",class extends o{init(){this.assets=this._assets(),this.dialog=this._dialogVorbereiten(),this._onKeydown=this._onKeydown.bind(this),this._auslöser=null,this._quellForm=null,this._bindDialog(),this._bindMobileTrigger(),this._syncAll(),["input","change"].forEach(e
1=>{this.el.addEventListener(e,e=>{e.target.classList?.contains("js-quantity-selector")&&this._syncAll()})}),this._onCartUpdated=()=>this._syncAll(),document.addEventListener("tcinn-ac-cart-updated",this._onCartUpdated)}destroy(){this._onCartUpdated&&document.removeEventListener("tcinn-ac-cart-updated",this._onCartUpdated)}_gruppen(){return this.el.querySelectorAll(".line-item-quantity-group")}_assets(){return this.el.querySelector("[data-tcinn-ac-qty-remove-assets]")}_dialogVorbereiten(){return this.el.querySelector("[data-tcinn-ac-quantity-remove-dialog]")}_syncAll(){this._gruppen().forEach(e=>this._sync(e))}_sync(e){let t=e.querySelector(".js-btn-minus"),i=e.querySelector(".js-quantity-selector");if(!t||!i)return;let n=parseInt(i.value,10),s=parseInt(i.min,10)||1,r=parseInt(i.step,10)||1;if(!(!Number.isNaN(n)&&n-r<s)){this._normalzustand(t);return}this.assets&&this._entfernenForm(e)?this._entfernenZustand(t,e):this._deaktiviert(t)}_normalzustand(e){e.disabled=!1,e.removeAttribute("aria-disabled"),e.classList.remove("tcinn-ac-qty-remove","tcinn-ac-qty-at-min"),e.dataset.tcinnAcOrigLabel&&e.setAttribute("aria-label",e.dataset.tcinnAcOrigLabel),void 0!==e.dataset.tcinnAcOrigTitle&&(e.dataset.tcinnAcOrigTitle?e.setAttribute("title",e.dataset.tcinnAcOrigTitle):e.removeAttribute("title")),e.tcinnAcOrigIcon&&(e.replaceChildren(...e.tcinnAcOrigIcon.map(e=>e.cloneNode(!0))),delete e.tcinnAcOrigIcon)}_deaktiviert(e){e.disabled=!0,e.setAttribute("aria-disabled","true"),e.classList.add("tcinn-ac-qty-at-min")}_entfernenZustand(e,t){if(e.classList.contains("tcinn-ac-qty-remove"))return;e.dataset.tcinnAcOrigLabel||(e.dataset.tcinnAcOrigLabel=e.getAttribute("aria-label")||""),void 0===e.dataset.tcinnAcOrigTitle&&(e.dataset.tcinnAcOrigTitle=e.getAttribute("title")||""),e.tcinnAcOrigIcon=[...e.childNodes].map(e=>e.cloneNode(!0)),e.disabled=!1,e.removeAttribute("aria-disabled"),e.classList.add("tcinn-ac-qty-remove");let i=this.assets.querySelector("[data-tcinn-ac-remove-icon]");i?.content&&e.replaceChildren(i.content.cloneNode(!0));let n=this._produktname(t),s=(this.assets.dataset.tcinnAcRemoveLabel||"").replace("%product%",n);s&&e.setAttribute("aria-label",s);let r=this.assets.dataset.tcinnAcRemoveTitle||"";r&&e.setAttribute("title",r),e.dataset.tcinnAcRemoveBound||(e.dataset.tcinnAcRemoveBound="true",e.addEventListener("click",i=>{if(!e.classList.contains("tcinn-ac-qty-remove"))return;i.preventDefault(),i.stopPropagation();let n=this._entfernenForm(t);this.dialog?this._öffnen(e,n,this._produktname(t)):this._absenden(n)}))}_zeile(e){let t=e.closest(x);return t&&t.closest(q)||e.closest(q)}_entfernenForm(e){let t=this._zeile(e);if(!t)return null;let i=!!e.closest(x);return[...t.querySelectorAll('form[action*="delete"], .js-offcanvas-cart-remove-product, [data-tcinn-ac-remove-form]')].find(e=>!i||!e.closest(x))||null}_absenden(e){if(!e)return;let t=e.querySelector('button[type="submit"], input[type="submit"]');if(t){t.click();return}"function"==typeof e.requestSubmit?e.requestSubmit():e.submit()}_produktname(e){return this._zeile(e)?.querySelector(".line-item-label")?.textContent?.trim()||""}_bindMobileTrigger(){this.dialog&&this.el.querySelectorAll("[data-tcinn-ac-qty-remove-trigger]").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),this._quellForm=null,this._öffnenMit(e,e.dataset.tcinnAcRemoveUrl,e.dataset.tcinnAcRemoveProduct||"")})})}_bindDialog(){this.dialog&&!this.dialog.dataset.tcinnAcBound&&(this.dialog.dataset.tcinnAcBound="true",this.dialog.querySelectorAll("[data-tcinn-ac-quantity-remove-cancel]").forEach(e=>{e.addEventListener("click",()=>this._schlieÃen())}),this.dialog.addEventListener("click",e=>{e.target===this.dialog&&this._schlieÃen()}),this.dialog.querySelector("[data-tcinn-ac-quantity-remove-form]")?.addEventListener("submit",e=>{if(!this._quellForm)return;e.preventDefault();let t=this._quellForm;this._schlieÃen(),this._absenden(t)}))}_öffnen(e,t,i){this._quellForm=t,this._öffnenMit(e,t?.getAttribute("action"),i)}_öffnenMit(e,t,i){if(!t||!this.dialog)return;this._auslöser=e;let n=this.dialog.querySelector("[data-tcinn-ac-quantity-remove-form]");n&&n.setAttribute("action",t);let s=this.dialog.querySelector("[data-tcinn-ac-quantity-remove-name]");s&&(s.textContent=i),this.dialog.hidden=!1,this.dialog.classList.add("is-open"),this.dialog.addEventListener("keydown",this._onKeydown);let r=this.dialog.querySelector("[data-tcinn-ac-quantity-remove-cancel]");r?.focus()}_schlieÃen(){this.dialog&&(this.dialog.hidden=!0,this.dialog.classList.remove("is-open"),this.dialog.removeEventListener("keydown",this._onKeydown),this._auslöser?.focus(),this._auslöser=null)}_onKeydown(e){if("Escape"===e.key){e.stopPropagation(),this._schlieÃen();return}if("Tab"!==e.key)return;let t=this.dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not
1([tabindex="-1"])');if(!t.length)return;let i=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===i?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),i.focus())}},"[data-tcinn-ac-checkout], [data-tcinn-ac-qty-remove]"),ea.register("TcinnAdvancedCheckoutOffcanvasStickyPlugin",class extends o{init(){this.mindesthoehe=parseInt(this.el.dataset.tcinnAcStickyMinHeight,10)||0,this.mindesthoehe&&(this._pruefen=this._pruefen.bind(this),this._pruefen(),window.addEventListener("resize",this._pruefen),"undefined"!=typeof ResizeObserver&&(this.beobachter=new ResizeObserver(()=>this._pruefen()),this.beobachter.observe(this.el)))}destroy(){window.removeEventListener("resize",this._pruefen),this.beobachter&&(this.beobachter.disconnect(),this.beobachter=null)}_pruefen(){let e=this.el.closest(".offcanvas-body")||this.el.parentElement,t=this.el.querySelector(".offcanvas-cart-items");if(e&&e.clientHeight&&t){if(this.el.classList.contains(I)){t.clientHeight<this.mindesthoehe&&(this.el.classList.remove(I),this._abgeschaltetBei=e.clientHeight);return}this._abgeschaltetBei&&e.clientHeight>this._abgeschaltetBei+40&&(this.el.classList.add(I),this._abgeschaltetBei=null)}}},"[data-tcinn-ac-sticky-min-height]"),ea.register("TcinnAdvancedCheckoutStickyColumnsPlugin",class extends o{init(){this.raster=this.el.querySelector(":scope > .tcinn-ac-checkout-container"),this.main=this.raster?this.raster.querySelector(":scope > .checkout-main"):null,this.aside=this.raster?this.raster.querySelector(":scope > .checkout-aside .checkout-aside-container"):null,this.main&&(this.medien=window.matchMedia("(min-width: 768px)"),this._einplanen=this._einplanen.bind(this),this.el.classList.add(T),this._messen(),window.addEventListener("scroll",this._einplanen,{passive:!0}),window.addEventListener("resize",this._einplanen),this.medien.addEventListener("change",this._einplanen),"undefined"!=typeof ResizeObserver&&(this.beobachter=new ResizeObserver(this._einplanen),[this.raster,this.main,this.aside].filter(Boolean).forEach(e=>this.beobachter.observe(e))))}destroy(){window.removeEventListener("scroll",this._einplanen),window.removeEventListener("resize",this._einplanen),this.medien&&this.medien.removeEventListener("change",this._einplanen),this.beobachter&&(this.beobachter.disconnect(),this.beobachter=null),this.rahmen&&cancelAnimationFrame(this.rahmen),this.el.classList.remove(T),this.el.style.removeProperty(M),this.el.style.removeProperty(P)}_einplanen(){this.rahmen||(this.rahmen=requestAnimationFrame(()=>{this.rahmen=null,this._messen()}))}_messen(){if(!this.medien.matches){this.el.style.removeProperty(M),this.el.style.removeProperty(P);return}let e=window.innerHeight;if(this.el.style.setProperty(M,`${Math.round(this._abstandMain(e))}px`),this.aside){let t=this.aside.offsetHeight;t>e?this.el.style.setProperty(P,`${e-t}px`):this.el.style.removeProperty(P)}}_abstandMain(e){let t=this.main.offsetHeight,i=t>e?e-t:0,n=parseFloat(getComputedStyle(this.raster).gridTemplateRows.split(" ")[0]);return Number.isFinite(n)?Math.min(i,this.raster.getBoundingClientRect().top+n-t):i}},"[data-tcinn-ac-sticky-columns]"),ea.register("TcinnAdvancedCheckoutFormPersistencePlugin",class extends o{init(){this._listeners=[],this._debounceTimer=null;try{localStorage.removeItem(m)}catch(e){}if(this._isFinishPage()){this._clear();return}if("true"!==this.el.dataset.tcinnAcOneView||(this._form=document.querySelector("form.register-form"),!this._form))return;this._restore();let e=()=>this._scheduleSave();this._form.querySelectorAll(g).forEach(t=>{this._isDenied(t)||(t.addEventListener("input",e),t.addEventListener("change",e),this._listeners.push({field:t,handler:e}))});let t=this._accountToggle();if(t){let e=()=>{this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=null,this._save()};t.addEventListener("change",e),this._listeners.push({field:t,handler:e})}}_accountToggle(){return this._form?this._form.querySelector('input[type="checkbox"][name="createCustomerAccount"]'):null}destroy(){this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null),this._listeners.forEac
1h(e=>{let{field:t,handler:i}=e;t.removeEventListener("input",i),t.removeEventListener("change",i)}),this._listeners=[]}_isFinishPage(){return/\/checkout\/finish/.test(window.location.pathname)}_isDenied(e){let t=(e.type||"").toLowerCase();if("password"===t||"hidden"===t||"file"===t)return!0;let i=e.name||e.id||"";return!!(p.test(i)||_.test(e.getAttribute("autocomplete")||""))}_scheduleSave(){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._save(),800)}_save(){let e={};this._form.querySelectorAll(g).forEach(t=>{if(this._isDenied(t))return;let i=t.name||t.id;i&&""!==t.value&&null!=t.value&&(e[i]=t.value)});let t=this._accountToggle(),i=t?t.checked:null;try{sessionStorage.setItem(m,JSON.stringify({savedAt:Date.now(),fields:e,createAccount:i}))}catch(e){}}_restore(){let e=null;try{e=JSON.parse(sessionStorage.getItem(m)||"null")}catch(t){e=null}if(!e||!e.fields)return;if(!e.savedAt||Date.now()-e.savedAt>36e5){this._clear();return}let t=[],i=0;this._form.querySelectorAll(g).forEach(n=>{if(this._isDenied(n))return;let s=n.name||n.id;if(s&&s in e.fields){if("SELECT"===n.tagName){t.push({field:n,value:e.fields[s]});return}(""===n.value||null==n.value)&&(n.value=e.fields[s],i++)}});let n=this._accountToggle();n&&"true"!==n.dataset.tcinnAcServerState&&"boolean"==typeof e.createAccount&&n.checked!==e.createAccount&&(n.checked=e.createAccount,n.dispatchEvent(new Event("change",{bubbles:!0}))),0!==i&&t.forEach(e=>{let{field:t,value:i}=e;t.value!==i&&Array.from(t.options).some(e=>e.value===i)&&(t.value=i,t.dispatchEvent(new Event("change",{bubbles:!0})))})}_clear(){try{sessionStorage.removeItem(m)}catch(e){}}},"[data-tcinn-ac-checkout]"),ea.register("TcinnAdvancedCheckoutAccordionPlugin",class extends o{init(){if(this._listeners=[],this._observers=[],/\/checkout\/finish/.test(window.location.pathname))try{localStorage.removeItem("tcinnAdvancedCheckoutCartExpireTime")}catch(e){}["_initPayPalButtonSwap","_initAccordions","_initExpandedSelects","_optimizeAddressFields","_initBillingAddressToggle","_initSectionOrder","_placeKlarnaPaymentWidget","_initConfirmBillingToggle","_initCrossSellingVariants","_initAdditionalInfoPosition","_initTosShake","_initConsentShake","_initSubmitGuard","_initTransitionFocus","_initMobileSubmitReorder","_initRegisterConsentValidation","_initExpressLogin","_syncPaymentShippingToForm","_initMethodCandidates","_initPaymentButtonSwap","_initPaymentSelectionPolicy","_initDeliveryCountryReload","_hideDuplicatePayPalButtons","_fixAmazonPayButtonWidth","_initFooterSeparators"].forEach(e=>{try{this[e]()}catch(t){console.error(`[TcinnAdvancedCheckout] ${e} abgebrochen:`,t)}})}destroy(){this._listeners.forEach(e=>{let{target:t,type:i,handler:n,options:s}=e;t.removeEventListener(i,n,s)}),this._listeners=[],this._observers.forEach(e=>e.disconnect()),this._observers=[],this._payPalFrame&&(window.cancelAnimationFrame(this._payPalFrame),this._payPalFrame=null)}_on(e,t,i,n){e.addEventListener(t,i,n),this._listeners.push({target:e,type:t,handler:i,options:n})}_getConfigureUrl(){return this.el.dataset.tcinnAcConfigureUrl||"/checkout/configure"}_initPaymentSelectionPolicy(){let e=Array.from(document.querySelectorAll('.tcinn-ac-checkout-payment-methods input[name="paymentMethodId"]'));if(0===e.length||e.some(e=>e.checked))return;let t="";try{let e=document.querySelector("#tcinn-ac-checkout-state");e&&(t=(JSON.parse(e.textContent).payment||{}).selectedId||"")}catch(e){}let i=e.find(e=>e.value===t);i&&(i.checked=!0)}_initExpandedSelects(){"true"===this.el.dataset.tcinnAcExpandSelects&&(["accountType","salutationId"].forEach(e=>{this.el.querySelectorAll(`select[name="${e}"]`).forEach(e=>{"true"!==e.dataset.tcinnAcSegmented&&this._segmentSelect(e)})}),this._pairSegmentedFields())}_pairSegmentedFields(){let e=this.el.querySelector('select[name="accountType"][data-tcinn-ac-segmented="true"]'),t=this.el.querySelector('select[name="salutationId"][data-tcinn-ac-segmented="true"]');if(!e||!t)return;let i=e.closest(".tcinn-ac-segmented-field"),n=t.closest(".tcinn-ac-segmented-field");if(!i||!n||i===n||i.closest(".tcinn-ac-segmented-pair"))return;let s=document.createElement("div");s.className="tcinn-ac-segmented-pair",i.parentNode.insertBefore(s,i),s.appendChild(i),s.appendChild(n)}_segmentSelect(e){let t=document.createElement("div");t.className="tcinn-ac-segment-control",t.setAttribute("role","radiogroup");let i=e.id?document.querySelector(`label[for="${e.id}"]`):null;i&&t.setAttribute("aria-label",i.textContent.replace("*","").trim()),(e.required||"true"===e.getAttribute("aria-required"))&&t.setAttribute("aria-required","true");let n=`tcinn-ac-seg-${e.name}-${Math.abs(this._hash(e.id||e.name))}
1`,s="true"===e.dataset.tcinnAcSalutationChoice;Array.from(e.options).filter(e=>!(s&&""===e.value)).forEach(i=>{let s=document.createElement("label");s.className="tcinn-ac-segment-option";let r=document.createElement("input");r.type="radio",r.className="tcinn-ac-segment-radio",r.name=n,r.value=i.value,r.checked=i.selected;let a=document.createElement("span");a.className="tcinn-ac-segment-label",a.textContent=i.textContent.trim(),s.appendChild(r),s.appendChild(a),t.appendChild(s),this._on(r,"change",()=>{e.value!==i.value&&(e.value=i.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),this._syncSegments(t)})}),e.classList.add("tcinn-ac-segment-source"),e.setAttribute("tabindex","-1"),e.setAttribute("aria-hidden","true"),e.dataset.tcinnAcSegmented="true",e.parentNode.insertBefore(t,e),this._syncSegments(t);let r=e.closest('[class*="col-"]');r&&r.classList.add("tcinn-ac-segmented-field"),this._on(e,"change",()=>{let i=t.querySelector(`input[value="${CSS.escape(e.value)}"]`);i&&!i.checked&&(i.checked=!0,this._syncSegments(t))})}_syncSegments(e){e.querySelectorAll(".tcinn-ac-segment-option").forEach(e=>{let t=e.querySelector("input");e.classList.toggle("is-active",!!t&&t.checked)})}_hash(e){let t=0;for(let i=0;i<e.length;i+=1)t=(t<<5)-t+e.charCodeAt(i)|0;return t}_addressOptimizeWrap(){return this.el.querySelector(".tcinn-ac-address-optimized")||this.el.closest(".tcinn-ac-address-even")||this.el.querySelector(".tcinn-ac-address-even")}_optimizeAddressFields(){let e=this._addressOptimizeWrap();if(!e)return;let t=[...e.querySelectorAll('input[name="title"], input[name$="[title]"]')].map(e=>e.closest('[class*="col-"]')).filter(Boolean),i=[...e.querySelectorAll('input[name="firstName"], input[name$="[firstName]"]')];t.forEach(e=>{if(e.classList.contains("tcinn-ac-title-col"))return;let t=i.find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING),n=t&&t.closest('[class*="col-"]');n&&n.parentElement&&(n.parentElement.insertBefore(e,n),n.parentElement.classList.add("tcinn-ac-name-row"),e.classList.add("tcinn-ac-title-col"))}),this._pullUpLonelyAddressField(e),"complete"!==document.readyState&&this._on(window,"load",()=>this._pullUpLonelyAddressField(e),{once:!0})}_pullUpLonelyAddressField(e){[...e.querySelectorAll('input[name="phoneNumber"], input[name$="[phoneNumber]"]')].forEach(e=>{let t=e.closest('[class*="col-"]');if(!t||!t.offsetParent)return;let i=t.parentElement;if(!i||!i.classList.contains("row")||1!==i.children.length)return;let n=this._findPullUpTargetRow(i);if(!n)return;let s=this._lastVisibleChild(n);n.appendChild(t),t.getBoundingClientRect().top>s.getBoundingClientRect().top+1&&i.appendChild(t)})}_findPullUpTargetRow(e){let t=e.previousElementSibling;for(;t&&t.classList.contains("row");){if(!(t.classList.contains("country-and-state-form-elements")||t.querySelector('select[name="countryId"], select[name$="[countryId]"]'))&&this._lastVisibleChild(t))return t;t=t.previousElementSibling}return null}_lastVisibleChild(e){return[...e.children].reverse().find(e=>e.offsetParent)||null}_initAccordions(){document.querySelectorAll('[data-tcinn-ac-accordion="true"]').forEach(e=>{e.querySelectorAll('input[type="radio"]').forEach(t=>{this._on(t,"change",()=>{e.querySelectorAll(".tcinn-ac-payment-method-item").forEach(e=>{e.classList.remove("active")});let i=t.closest(".tcinn-ac-payment-method-item");i&&i.classList.add("active")})})}),document.querySelectorAll(".tcinn-ac-native-methods .tcinn-ac-payment-shipping-container").forEach(e=>{e.querySelectorAll(".payment-method-input, .shipping-method-input").forEach(t=>{if(t.checked){let e=t.closest(".payment-method, .shipping-method");e&&e.classList.add("tcinn-ac-active")}this._on(t,"change",()=>{e.querySelectorAll(".payment-method, .shipping-method").forEach(e=>{e.classList.remove("tcinn-ac-active")});let i=t.closest(".payment-method, .shipping-method");i&&i.classList.add("tcinn-ac-active")})})})}_initBillingAddressToggle(){let e=document.querySelector("[data-tcinn-ac-billing-checkbox]");if(!e)return;let t=document.querySelector("[data-tcinn-ac-shipping-source]"),i=document.querySelector("[data-tcinn-ac-billing-form]");if(t&&i){for(;t.firstChild;)i.appendChild(t.firstChild);this.el?.dataset?.tcinnAcExpandSelects==="true"&&i.querySelectorAll('select[name$="[salutationId]"]').forEach(e
1=>{"true"!==e.dataset.tcinnAcSegmented&&this._segmentSelect(e)})}let n=i&&i.querySelector('input[name^="shippingAddress"], select[name^="shippingAddress"]');if(!i||!n){let t=e.closest(".tcinn-ac-billing-toggle");t&&(t.style.display="none");return}let s=i.querySelector('input[name="differentShippingAddress"][data-form-field-toggle]'),r=i.querySelector("#tcinnAcDifferentShipping"),a=i.querySelector("legend");a&&(a.style.display="none");let o=e=>{e?(i.style.display="block",s&&(s.checked=!0,s.dispatchEvent(new Event("change",{bubbles:!0}))),r&&(r.checked=!0),i.querySelectorAll("fieldset[disabled]").forEach(e=>e.removeAttribute("disabled")),i.querySelectorAll("input[disabled], select[disabled]").forEach(e=>e.removeAttribute("disabled")),this._addressOptimizeWrap()&&this._pullUpLonelyAddressField(i)):(i.style.display="none",s&&(s.checked=!1,s.dispatchEvent(new Event("change",{bubbles:!0}))),r&&(r.checked=!1))};this._on(e,"change",()=>o(e.checked)),o(e.checked)}_initMethodCandidates(){let e=document.querySelectorAll("[data-tcinn-ac-candidate]");if(!e.length)return;let t=e=>"tcinnAcDesiredPaymentMethodId"===e?"paymentMethodId":"shippingMethodId",i=e=>"paymentMethodId"===e?"tcinnAcDesiredPaymentMethodId":"tcinnAcDesiredShippingMethodId";e.forEach(e=>{this._on(e,"change",()=>{e.checked&&document.querySelectorAll(`input[name="${t(e.name)}"]`).forEach(e=>{e.checked=!1})})}),document.querySelectorAll('input[name="paymentMethodId"], input[name="shippingMethodId"]').forEach(e=>{this._on(e,"change",()=>{e.checked&&document.querySelectorAll(`input[name="${i(e.name)}"]`).forEach(e=>{e.checked=!1})})})}_initSectionOrder(){let e=document.querySelector("[data-tcinn-ac-payment-outside]");if(!e)return;let t=this.el?.dataset?.tcinnAcOneView==="true",i=document.querySelector(".tcinn-ac-checkout-submit"),n=document.querySelector(".tcinn-ac-checkout-billing-address");t&&i?i.parentNode.insertBefore(e,i):n?n.parentNode.insertBefore(e,n):i&&i.parentNode.insertBefore(e,i)}_placeKlarnaPaymentWidget(){let e=document.querySelector(".klarna-payment"),t=document.querySelector(".tcinn-ac-checkout-submit");e&&t&&t.parentNode&&t.parentNode.insertBefore(e,t)}_initConfirmBillingToggle(){let e=document.querySelector(".tcinn-ac-checkout-billing-address[data-tcinn-ac-billing-address-id]");if(!e)return;let t=e.querySelector("[data-tcinn-ac-billing-revert]");if(!t)return;let i=t.dataset.tcinnAcRevertField,n=t.dataset.tcinnAcRevertId;this._on(t,"click",()=>{if(!i||!n)return;t.disabled=!0;let e=new FormData;e.append(i,n),fetch(this._getConfigureUrl(),{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:e}).then(()=>{window.location.reload()}).catch(()=>{t.disabled=!1})})}_initPayPalButtonSwap(){let e=document.querySelector("#tcinn-ac-confirm-form-target"),t=document.querySelector(".checkout-aside-action");e&&t&&(e.contains(t)||(e.appendChild(t),t.style.display="block"))}_syncPaymentShippingToForm(){if(document.querySelector("#confirmOrderForm"))return;let e={},t={},i=e=>{let i=document.querySelector(`input[name="${e}"]:checked`);i&&(t[e]=i.value)};i("paymentMethodId"),i("shippingMethodId");let n=e=>{let i=t[e];if(!i)return;let n=document.querySelector(`input[name="${e}"][value="${i}"]`);n&&(n.checked=!0)},s=(i,s)=>{e[i]&&e[i].abort(),e[i]=new AbortController;let r=new FormData;r.append(i,s),fetch(this._getConfigureUrl(),{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:r,signal:e[i].signal}).then(e=>{if(!e.ok)throw Error(`configure failed: ${e.status}`);t[i]=s,this._refreshOrderSummary()}).catch(e=>{e&&"AbortError"===e.name||n(i)})};document.querySelectorAll('.tcinn-ac-checkout-payment-methods input[name="paymentMethodId"]').forEach(e=>{this._on(e,"change",()=>s("paymentMethodId",e.value))}),document.querySelectorAll('.tcinn-ac-checkout-shipping-methods input[name="shippingMethodId"]').forEach(e=>{this._on(e,"change",()=>s("shippingMethodId",e.value))})}_refreshOrderSummary(){fetch(this._tcinnAcPageUrl||window.location.href).then(e=>e.ok?e.text():Promise.reject(Error(`${e.status}`))).then(e=>{d(new DOMParser().parseFromString(e,"text/html"))&&window.PluginManager&&window.PluginManager.initializePlugins()}).catch(e=>{console.warn("[TcinnAdvancedCheckout] Bestellsumme nicht aktualisiert:",e)})}_initDeliveryCountryReload(){!function(e){if(document.querySelector("#confirmOrderForm")||document.querySelector(l)?.dataset.tcinnAcFollowAddress!=="true")return;let t=e.el?.dataset||{},i="false"!==t.tcinnAcSwapAddresses,n=document.querySelector("[data-tcinn-ac-billing-checkbox]"),s=e=>document.querySelector(`select[name="${e}"]`),r=()=>{let e=!!n?.checked,t=!i&&e?"shippingAddress":"billingAddress",r=s(`${t}[countryStateId]`);return{countryId:s(`${t}[countryId]`)?.value||"",stateId:r&&!r.disabled?r.value:"",billingCountryId:s(`${i&&e?"shippingAddress":"billingAddress"}[countryId]`)?.value||"",accountType:s("accountType")?.value||""}},a=`${t.tcinnAcContextCountryId||""}|`,o="true"===document.querySelector(l).dataset.tcinnAcCompanyUnresolved,h=`${t.tcinnAcContextCountryId||""}
1|${o?"":r().accountType}`,u=null,m=e=>{let{billingCountryId:t,accountType:i}=e,n=new URL(window.location.href);return n.searchParams.delete("tcinnAcBillingCountryId"),n.searchParams.delete("tcinnAcAccountType"),t&&n.searchParams.set("tcinnAcBillingCountryId",t),i&&n.searchParams.set("tcinnAcAccountType",i),n.toString()},p=()=>{let t=r();if(!t.countryId)return;let i=`${t.countryId}|${t.stateId}`,n=`${t.billingCountryId||t.countryId}|${t.accountType}`,s=i!==a;if(!s&&n===h)return;a=i,h=n,u&&u.abort();let o=new AbortController;u=o;let{signal:p}=o,_=document.querySelector(l);_?.classList.add("tcinn-ac-methods-loading"),_?.setAttribute("aria-busy","true");let g=new FormData;g.append("countryId",t.countryId),t.stateId&&g.append("countryStateId",t.stateId);let f=m(t);e._tcinnAcPageUrl=f,(s?fetch(e._getConfigureUrl(),{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:g,signal:p}):Promise.resolve({ok:!0})).then(e=>e.ok?fetch(f,{signal:p}):Promise.reject(Error(`${e.status}`))).then(e=>e.ok?e.text():Promise.reject(Error(`${e.status}`))).then(t=>(function(e,t){let i=document.querySelector(l),n=t.querySelector(l);if(!i||!n)return;let s=[...i.querySelectorAll("[data-tcinn-ac-candidate]:checked")].map(e=>({name:e.name,value:e.value}));i.replaceChildren(...n.childNodes),d(t),c.forEach(t=>{try{e[t]()}catch(e){console.error(`[TcinnAdvancedCheckout] ${t} abgebrochen:`,e)}}),s.forEach(e=>{let{name:t,value:n}=e,s=i.querySelector(`[data-tcinn-ac-candidate][name="${t}"][value="${n}"]`);s&&(s.checked=!0,s.dispatchEvent(new Event("change",{bubbles:!0})))}),window.PluginManager&&window.PluginManager.initializePlugins()})(e,new DOMParser().parseFromString(t,"text/html"))).catch(e=>{e?.name!=="AbortError"&&(a=null,h=null)}).finally(()=>{u===o&&(_?.classList.remove("tcinn-ac-methods-loading"),_?.removeAttribute("aria-busy"))})};e._on(document,"change",e=>{let t=e.target;(t===n||t?.matches?.('select[name$="[countryId]"], select[name$="[countryStateId]"], select[name="accountType"]'))&&p()}),p()}(this)}_initPaymentButtonSwap(){let e=document.querySelector("#tcinn-ac-checkout-submit-btn"),t=document.querySelector("#tcinn-ac-paypal-submit-btn"),i=document.querySelector("#tcinn-ac-amazon-submit-btn");if(!e)return;let n=document.querySelectorAll('.tcinn-ac-checkout-payment-methods input[name="paymentMethodId"]');if(0===n.length)return;let s=e=>{let t=e.closest(".payment-method"),i=t?.querySelector(".payment-method-description")?.dataset.tcinnAcHandler||"";if(i.includes("paypalpaymenthandler")){let e=t?.querySelector(".payment-method-description strong")?.textContent?.trim()?.toLowerCase()||"";return e.includes("pay later")||e.includes("paylater")||e.includes("später")?"paylater":"paypal"}return i.includes("amazonpay")?"amazon":null},r=e=>(e.querySelector("iframe[title]")?.title||"").toLowerCase().includes("paylater"),a=e=>{if(!t)return!1;let i=[...t.querySelectorAll(".paypal-buttons")];return 0===i.length?"paypal"===e&&!!t.querySelector("iframe"):i.some(t=>!!t.querySelector("iframe")&&r(t)===("paylater"===e))},o=e=>{if(!t)return;let i=t.querySelector("[data-swag-paypal-express-button]");i&&i.querySelectorAll(".paypal-buttons").forEach(t=>{t.style.display=r(t)===("paylater"===e)?"":"none"})},l=()=>{let n=document.querySelector('.tcinn-ac-checkout-payment-methods input[name="paymentMethodId"]:checked'),r=n?s(n):null;e.style.display="none",t&&(t.style.display="none"),i&&(i.style.display="none");let l=!!i?.querySelector('iframe, .amazonpay-button-container, [class*="amazonpay"]');("paypal"===r||"paylater"===r)&&a(r)?(t.style.display="block",o(r)):"amazon"===r&&l?i.style.display="block":e.style.display=""};if(n.forEach(e=>this._on(e,"change",l)),t){let e=new MutationObserver(()=>{this._payPalFrame||(this._payPalFrame=window.requestAnimationFrame(()=>{this._payPalFrame=null,l()}))});e.observe(t,{childList:!0,subtree:!0}),this._observers.push(e),l()}else l()}_hideDuplicatePayPalButtons(){let e=document.querySelector(".tcinn-ac-express-checkout");e&&document.querySelectorAll("[data-swag-paypal-express-button]").forEach(t=>{if(!e.contains(t)){let e=t.closest(".row");(e&&1===e.children.length?e:t).style.display="none"}})}_initExpressLogin(){let e=document.querySelector("[data-tcinn-ac-express-login]"),t=document.querySelector("[data-tcinn-ac-login-form]"),i=document.querySelector("[data-tcinn-ac-back-to-register]"),n=document.querySelector(".tcinn-ac-checkout .checkout-main");e&&t&&n&&("none"!==t.style.display&&n.classList.add("tcinn-ac-checkout-login-mode"),this._on(e,"click",()=>{t.style.display="block",n.classList.add("tcinn-ac-checkout-login-mode")}),i&&this._on(i,"click",()=>{t.style.display="none",n.classList.remove("tcinn-ac-checkout-login-mode")}))}_initSubmitGuard(){let e=this.el.dataset.tcinnAcCtaLoadingText||"";[document.querySelector("#tcinn-ac-checkout-submit-btn"),document.querySelector('#confirmFormSubmit, button[form="confirmOrderForm"]')].filter(
1Boolean).forEach(t=>{let i=t.form||t.closest("form");if(!i)return;let n=!1,s=Array.from(t.childNodes).map(e=>e.cloneNode(!0)),r=()=>{n=!1,t.disabled=!1,t.removeAttribute("aria-busy"),t.classList.remove("tcinn-ac-cta-loading"),t.replaceChildren(...s.map(e=>e.cloneNode(!0)))};this._on(i,"submit",s=>{if(n){s.preventDefault();return}("function"!=typeof i.checkValidity||i.checkValidity())&&(n=!0,window.setTimeout(()=>{if(e){let i=document.createElement("span");i.className="tcinn-ac-cta-spinner",i.setAttribute("aria-hidden","true"),t.replaceChildren(i,document.createTextNode(e))}t.setAttribute("aria-busy","true"),t.classList.add("tcinn-ac-cta-loading"),t.disabled=!0},0))}),this._on(window,"pageshow",e=>{e.persisted&&r()})})}_initTransitionFocus(){if(this.el?.dataset?.tcinnAcOneView!=="true"||"confirm"!==this.el.dataset.tcinnAcOneViewStage)return;let e=document.getElementById("tcinn-ac-section4-headline");if(e)try{e.focus({preventScroll:!0})}catch(t){e.focus()}}_shake(e){e&&(e.classList.remove("tcinn-ac-shake"),e.offsetWidth,e.classList.add("tcinn-ac-shake"),e.addEventListener("animationend",()=>{e.classList.remove("tcinn-ac-shake")},{once:!0}))}_flagConsent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._shake(e.closest(".form-check")||e.parentElement),e.setAttribute("aria-invalid","true"),!t){e.focus();return}
1e.focus({preventScroll:!0}),e.scrollIntoView({block:"center",behavior:"smooth"})}_clearConsent(e,t){e.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"),t&&t.querySelectorAll(".invalid-feedback").forEach(e=>e.remove())}_initTosShake(){let e=document.querySelector('#confirmFormSubmit, button[form="confirmOrderForm"]');if(!e)return;this._on(e,"click",()=>{let e=document.querySelector("#tos");e&&!e.checked&&(this._flagConsent(e),setTimeout(()=>{let t=document.getElementById("tcinn-ac-tos-feedback");if(!t||t.firstElementChild)return;let i=e.getAttribute("data-form-validation-error-message");if(!i)return;let n=document.createElement("div");n.className="invalid-feedback",n.textContent=i,t.appendChild(n)},150))});let t=document.querySelector("#tos");t&&this._on(t,"change",()=>{t.checked&&this._clearConsent(t,document.getElementById("tcinn-ac-tos-feedback"))})}_initConsentShake(){let e=document.querySelector('#confirmFormSubmit, button[form="confirmOrderForm"]'),t=document.getElementById("tcinnAcCustomConsent");e&&t&&t.required&&(this._on(e,"click",()=>{t.checked||this._flagConsent(t)}),this._on(t,"change",()=>{t.checked&&this._clearConsent(t,document.getElementById("tcinn-ac-custom-consent-feedback"))}))}_initRegisterConsentValidation(){let e=document.getElementById("tcinn-ac-checkout-submit-btn"),t=document.getElementById("acceptedDataProtection");if(!e||!t)return;let i=document.getElementById("acceptedDataProtection-feedback"),n=t.closest(".register-privacy-wrapper"),s=n&&n.getAttribute("data-tcinn-ac-consent-error")||"";this._on(e,"click",e=>{if(!t.closest("form")&&!t.checked){if(e.preventDefault(),t.classList.add("is-invalid"),i&&s&&!i.querySelector(".invalid-feedback")){let e=document.createElement("div");e.className="invalid-feedback js-validation-message",e.textContent=s,i.appendChild(e)}this._flagConsent(t,!0)}}),this._on(t,"change",()=>{t.checked&&this._clearConsent(t,i)})}_initAdditionalInfoPosition(){let e=document.querySelector(".checkout-additional"),t=document.querySelector(".tcinn-ac-checkout-submit");if(!e||!t)return;let i=t.parentElement;i&&i.insertBefore(e,t)}_initMobileSubmitReorder(){let e=document.querySelector(".tcinn-ac-checkout-submit"),t=document.querySelector(".tcinn-ac-checkout-container"),i=t?.querySelector(".checkout-aside"),n=t?.querySelector(".tcinn-ac-cart-minimal-footer"),s=i?.querySelector(".tcinn-ac-trust-elements"),r=this.el?.dataset?.tcinnAcOneView==="true"?i?.querySelector(".tcinn-ac-cross-selling"):null;if(!e||!t||!i)return;let a=!!e.closest("form"),o=t.classList.contains("tcinn-ac-trust-mobile-first"),l=e.parentElement,c=e.nextElementSibling,d=s?.parentElement||null,h=s?.nextElementSibling||null,u=r?.parentElement||null,m=r?.nextElementSibling||null,p=e=>{e&&e.parentElement!==t&&(n&&n.parentElement===t?t.insertBefore(e,n):t.appendChild(e))},_=(e,t,i)=>{e&&t&&e.parentElement!==t&&(i&&i.parentElement===t?t.insertBefore(e,i):t.appendChild(e))},g=()=>{window.innerWidth<768?(a||p(e),a&&o&&s&&e.parentElement?e.parentElement.insertBefore(s,e):p(s),p(r)):(_(e,l,c),_(s,d,h),_(r,u,m))};g();let f=null;this._on(window,"resize",()=>{window.clearTimeout(f),f=window.setTimeout(g,150)})}_initCrossSellingVariants(){document.querySelectorAll('[data-tcinn-ac-cross-selling-item="true"]').forEach(e=>{let t=e.querySelector('[data-tcinn-ac-variant-select="true"]'),i=e.querySelector('[data-tcinn-ac-variant-add="true"]'),n=e.querySelector('[data-tcinn-ac-variant-fields="true"]');if(t&&i&&n){let s=s=>{let r=t.value;if(!r){i.disabled=!0,n.replaceChildren();return}i.disabled=!1,n.replaceChildren(...Object.entries({id:r,referencedId:r,type:"product",stackable:"1",removable:"1",quantity:"1"}).map(e=>{let[t,i]=e,n=document.createElement("input");return n.type="hidden",n.name=`lineItems[${r}][${t}]`,n.value=i,n})),s&&function(e,t){let i=t.dataset.priceFormatted;if(i){let t=e.querySelector(".tcinn-ac-cross-selling-item-price");t&&(t.textContent=i)}let n=e.querySelector("[data-tcinn-ac-xs-list-price]");if(!n)return;let s=t.dataset.listPriceFormatted||"",r=t.dataset.listPricePercentage||"",a=n.querySelector("[data-tcinn-ac-xs-list-price-value]"),o=n.querySelector("[data-tcinn-ac-xs-list-price-percentage]");a&&(a.textContent=s),o&&(o.textContent=r),n.hidden=!(s||r)}(e,t.options[t.selectedIndex])};t.disabled=!1,s(!1),this._on(t,"change",()=>s(!0))}})}_fixAmazonPayButtonWidth(){let e=document.querySelectorAll(".swag-amazon-pay-button-container");if(0===e.length)return;let t=0,i=()=>{let n=!0;
1e.forEach(e=>{if(!e.shadowRoot){n=!1;return}if(e.shadowRoot.querySelector("style[data-tcinn-ac-patched]"))return;let t=document.createElement("style");t.setAttribute("data-tcinn-ac-patched","true"),t.textContent=".amazonpay-button-container { max-width: 100% !important; }",e.shadowRoot.appendChild(t)}),t++,!n&&t<20&&setTimeout(i,500)};i()}_initFooterSeparators(){let e=this.el.querySelector(".tcinn-ac-cart-minimal-footer.tcinn-ac-footer-sep-pipe, .tcinn-ac-cart-minimal-footer.tcinn-ac-footer-sep-dot");if(!e)return;let t=e.querySelector(".tcinn-ac-cart-minimal-footer-content ul");if(!t)return;let i=()=>{let e=Array.from(t.children).filter(e=>"LI"===e.tagName);if(!e.length)return;e.forEach(e=>e.classList.remove("tcinn-ac-sep-wrap"));let i=e.map(e=>e.offsetTop);e.forEach((t,n)=>{n+1<e.length&&i[n+1]>i[n]&&t.classList.add("tcinn-ac-sep-wrap")})};if(i(),"complete"===document.readyState?window.requestAnimationFrame(i):this._on(window,"load",i),document.fonts&&document.fonts.ready&&document.fonts.ready.then(i).catch(()=>{}),window.ResizeObserver){let e=new ResizeObserver(i);e.observe(t),this._observers.push(e)}let n=null;this._on(window,"resize",()=>{window.clearTimeout(n),n=window.setTimeout(i,150)})}},"[data-tcinn-ac-checkout]"),ea.register("TcinnAdvancedCheckoutAgentSemanticsPlugin",class extends o{init(){this._fixAutocompleteSemantics(),this._wireMethodDescriptions(),this._markSummaryLiveRegion()}destroy(){}_fixAutocompleteSemantics(){if("true"!==this.el.dataset.tcinnAcSwapAddresses)return;let e=(e,t,i)=>{let n=e.getAttribute("autocomplete");n&&n.includes(t)&&e.setAttribute("autocomplete",n.replace(t,i))};this.el.querySelectorAll('[name^="billingAddress["][autocomplete]').forEach(t=>{e(t,"billing","shipping")}),this.el.querySelectorAll('[name^="shippingAddress["][autocomplete]').forEach(t=>{e(t,"shipping","billing")})}_wireMethodDescriptions(){this.el.querySelectorAll(".tcinn-ac-native-methods .payment-method, .tcinn-ac-native-methods .shipping-method").forEach((e,t)=>{let i=e.querySelector(".payment-method-input, .shipping-method-input"),n=e.querySelector(".payment-method-description, .shipping-method-description");if(!i||!n)return;n.id||(n.id=`tcinn-ac-method-description-${i.id||t}`);let s=i.getAttribute("aria-describedby");s?s.split(/\s+/).includes(n.id)||i.setAttribute("aria-describedby",`${s} ${n.id}`):i.setAttribute("aria-describedby",n.id)})}_markSummaryLiveRegion(){this.el.querySelectorAll(".checkout-aside-summary-total").forEach(e=>{e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true")})}},"[data-tcinn-ac-checkout]"),ea.register("TcinnAdvancedCheckoutScrollIndicatorPlugin",h,"[data-tcinn-ac-scroll-indicator]"),ea.register("TcinnAdvancedCheckoutCartTimerPlugin",u,"[data-tcinn-ac-cart-timer]"),ea.register("TcinnAdvancedCheckoutSocialProofPlugin",f,"[data-tcinn-ac-social-proof]"),ea.register("TcinnAdvancedCheckoutInsightsPulsePlugin",class extends o{init(){let e=this.el.dataset;this._url=e.pingUrl||"",this._step=e.step||"",this._interval=this._int(e.interval,3e4),this._timer=null,this._onVisibility=this._handleVisibility.bind(this),this._url&&this._step&&(this._ping(),this._start(),document.addEventListener("visibilitychange",this._onVisibility))}_int(e,t){let i=parseInt(e,10);return Number.isFinite(i)?i:t}_start(){null!==this._timer||document.hidden||(this._timer=window.setInterval(this._ping.bind(this),this._interval))}_stop(){null!==this._timer&&(window.clearInterval(this._timer),this._timer=null)}_handleVisibility(){document.hidden?this._stop():(this._ping(),this._start())}_ping(){if(!document.hidden&&this._url)try{fetch(this._url,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({step:this._step}),keepalive:!0}).catch(()=>{})}catch(e){}}destroy(){this._stop(),document.removeEventListener("visibilitychange",this._onVisibility)}},"[data-tcinn-ac-insights-pulse]"),ea.register("TcinnAdvancedCheckoutFinishMapPlugin",w,"[data-tcinn-ac-finish-map]"),ea.register("TcinnAdvancedCheckoutIdentityPlugin",class extends o{init(){let e=(this.el.dataset.tcinnAc||"").trim();document.body.classList.add("tcinn-ac-checkout-active"),document.documentElement.hasAttribute("data-tcinn-ac")||document.documentElement.setAttribute("data-tcinn-ac",e||"on"),window.tcinnAdvancedCheckout||(window.tcinnAdvancedCheckout={version:e||null})}},"[data-tcinn-ac-checkout]"),ea.register("TcinnAdvancedCheckoutCutoffPlugin",class extends o{init(){this.messageEl=this.el.querySelector(".tcinn-ac-cutoff-message"),this.template=this.el.dataset.text||"Order within %time%";let e=(this.el.dataset.cutoffTime||"").split(":");this.hour=parseInt(e[0],10),this.minute=parseInt(e[1],10),!this.messageEl||Number.isNaN(this.hour)||Number.isNaN(this.minute)||this.hour<0||this.hour>23||this.minute<0||this.minute>59||(this._tick=this._tick.bind(this),this._tick(),this._interval=window.setInterval(this._tick,1e3))}_tick(){let e=new Date,t=new Date(e);t.setHours(this.hour,this.minute,0,0);let i=t.getTime()-e.getTime();if(i<=0){this.el.classList.remove("is-visible"),window.clearInterval(this._interval);return}let n=Math.floor(i/36e5),s=Math.floor(i%36e5/6e4),r=Math.floor(i%6e4/1e3),a=e=>String(e).padStart(2,"0"),o=`${a(n)}:${a(s)}:${a(r)}
1`;this.messageEl.textContent="",this.messageEl.appendChild(document.createTextNode(this.template.split("%time%")[0]));let l=document.createElement("span");l.className="tcinn-ac-cutoff-time",l.textContent=o,this.messageEl.appendChild(l),this.messageEl.appendChild(document.createTextNode(this.template.split("%time%")[1]||"")),this.el.classList.add("is-visible")}destroy(){this._interval&&window.clearInterval(this._interval)}},"[data-tcinn-ac-cutoff]"),ea.register("TcinnAdvancedCheckoutCelebrationPlugin",class extends o{init(){let e=this.el.dataset.tcinnAcCelebration,t=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;"confetti"!==e||t||this._confetti()}_confetti(){let e=document.createElement("canvas");e.className="tcinn-ac-celebration-canvas",this.el.appendChild(e);let t=e.getContext("2d");if(!t)return;e.width=window.innerWidth,e.height=window.innerHeight;let i=["#0c72a7","#2ecc71","#f1c40f","#e74c3c","#9b59b6"],n=Array.from({length:130},(t,n)=>({x:53*n%100/100*e.width,y:-20-31*n%100/100*e.height*.6,size:5+n%4,color:i[n%i.length],vx:-2+17*n%40/10,vy:2+7*n%30/10,rot:n%12/12*Math.PI,vr:-.1+13*n%20/100})),s=performance.now(),r=i=>{let a=i-s;t.clearRect(0,0,e.width,e.height),n.forEach(e=>{e.x+=e.vx,e.y+=e.vy,e.vy+=.05,e.rot+=e.vr,t.save(),t.translate(e.x,e.y),t.rotate(e.rot),t.fillStyle=e.color,t.globalAlpha=Math.max(0,1-a/2600),t.fillRect(-e.size/2,-e.size/2,e.size,e.size),t.restore()}),a<2600?this._raf=window.requestAnimationFrame(r):e.remove()};this._raf=window.requestAnimationFrame(r)}destroy(){this._raf&&window.cancelAnimationFrame(this._raf)}},"[data-tcinn-ac-celebration]"),ea.register("TcinnAdvancedCheckoutExitIntentPlugin",class extends o{init(){if(this._restoreFormValues(),window.matchMedia&&window.matchMedia("(min-width: 768px) and (pointer: fine)").matches){try{if(window.sessionStorage.getItem(A))return}catch(e){}this.dialog=this.el.querySelector(".tcinn-ac-exit-intent-dialog"),this._onMouseLeave=this._onMouseLeave.bind(this),this._onKeydown=this._onKeydown.bind(this),this._close=this._close.bind(this),this.el.querySelectorAll("[data-tcinn-ac-exit-close]").forEach(e=>{e.addEventListener("click",this._close)}),this.copyBtn=this.el.querySelector("[data-tcinn-ac-exit-copy]"),this.copyBtn&&(this._onCopy=this._onCopy.bind(this),this.copyBtn.addEventListener("click",this._onCopy)),this.restoreForm=this.el.querySelector("[data-tcinn-ac-exit-restore]"),this.restoreForm&&(this._onRedeemSubmit=()=>
1this._saveFormValues(),this.restoreForm.addEventListener("submit",this._onRedeemSubmit)),this._armTimer=window.setTimeout(()=>{document.addEventListener("mouseleave",this._onMouseLeave)},2e3)}}_onMouseLeave(e){e.clientY>0||this._open()}_open(){if(!this._opened){this._opened=!0;try{window.sessionStorage.setItem(A,"1")}catch(e){}document.removeEventListener("mouseleave",this._onMouseLeave),this._lastFocus=document.activeElement,this.el.hidden=!1,this.el.offsetWidth,this.el.classList.add("is-open"),document.addEventListener("keydown",this._onKeydown),this.dialog.focus()}}_close(){this.el.classList.remove("is-open"),document.removeEventListener("keydown",this._onKeydown),window.setTimeout(()=>{this.el.hidden=!0},260),this._lastFocus&&"function"==typeof this._lastFocus.focus&&this._lastFocus.focus()}_onKeydown(e){if("Escape"===e.key){this._close();return}if("Tab"!==e.key)return;let t=this.dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!t.length)return;let i=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===i?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),i.focus())}_onCopy(){let e=this.copyBtn.getAttribute("data-tcinn-ac-exit-copy")||"",t=()=>{let e=this.copyBtn.dataset.copiedLabel||"Kopiert!",t=this.copyBtn.dataset.copyLabel||this.copyBtn.textContent;this.copyBtn.textContent=e,this.copyBtn.classList.add("is-copied"),window.clearTimeout(this._copyTimer),this._copyTimer=window.setTimeout(()=>{this.copyBtn.textContent=t,this.copyBtn.classList.remove("is-copied")},1600)};navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(t).catch(()=>this._fallbackCopy(e,t)):this._fallbackCopy(e,t)}_saveFormValues(){let e=[];document.querySelectorAll("form input[name], form select[name], form textarea[name]").forEach(t=>{if(t.closest("[data-tcinn-ac-exit-intent]"))return;let i=(t.type||"").toLowerCase();if(!["password","hidden","submit","button","file"].includes(i)){if("checkbox"===i||"radio"===i){t.checked&&e.push({name:t.name,value:t.value,kind:"check"});return}""!==t.value&&e.push({name:t.name,value:t.value,kind:"value"})}});try{window.sessionStorage.setItem(E,JSON.stringify(e))}catch(e){}}_restoreFormValues(){let e;try{let t=window.sessionStorage.getItem(E);if(!t)return;window.sessionStorage.removeItem(E),e=JSON.parse(t)}catch(e){return}Array.isArray(e)&&e.forEach(e=>{let t=Array.from(document.querySelectorAll(`[name="${CSS.escape(e.name)}"]`)).filter(e=>!e.closest("[data-tcinn-ac-exit-intent]"));if(!t.length)return;if("check"===e.kind){let i=t.find(t=>t.value===e.value)||t[0];i.checked=!0,i.dispatchEvent(new Event("change",{bubbles:!0}));return}let i=t[0];i.value=e.value,i.dispatchEvent(new Event("SELECT"===i.tagName?"change":"input",{bubbles:!0}))})}_fallbackCopy(e,t){try{let i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i),t()}catch(e){}}destroy(){window.clearTimeout(this._armTimer),window.clearTimeout(this._copyTimer),document.removeEventListener("mouseleave",this._onMouseLeave),document.removeEventListener("keydown",this._onKeydown),this.restoreForm&&this._onRedeemSubmit&&this.restoreForm.removeEventListener("submit",this._onRedeemSubmit)}},"[data-tcinn-ac-exit-intent]"),ea.register("TcinnAdvancedCheckoutConsentGuardPlugin",class extends o{init(){this.el.querySelectorAll('input[type="checkbox"][data-tcinn-ac-consent]').forEach(e=>{if(e.name){let t=e.getAttribute("form")||e.form&&e.form.id||"confirmOrderForm";L.removeItem(`${t}.${e.name}`)}e.checked=!1})}},"[data-tcinn-ac-consent-guard]"),ea.register("TcinnAdvancedCheckoutProductPreviewPlugin",class extends o{init(){if(this.dialog=this.el.querySelector(".tcinn-ac-product-preview-dialog"),this.el.id){let e=document.body.querySelector(`:scope > #${CSS.escape(this.el.id)}`);e&&e!==this.el&&e.remove()}document.body.appendChild(this.el),this._onKeydown=this._onKeydown.bind(this),this._open=this._open.bind(this),this._close=this._close.bind(this),document.querySelectorAll(`[data-tcinn-ac-product-preview-target="${this.el.id}
1"]`).forEach(e=>e.addEventListener("click",this._open)),this.el.querySelectorAll("[data-tcinn-ac-product-preview-close]").forEach(e=>{e.addEventListener("click",this._close)}),this._initGallery()}_initGallery(){if(this.galleryImages=Array.from(this.el.querySelectorAll(".tcinn-ac-product-preview-gallery-image")),this.galleryDots=Array.from(this.el.querySelectorAll("[data-tcinn-ac-product-preview-gallery-dot]")),this.galleryIndex=0,this.galleryImages.length<2)return;let e=this.el.querySelector("[data-tcinn-ac-product-preview-gallery-prev]"),t=this.el.querySelector("[data-tcinn-ac-product-preview-gallery-next]");e&&e.addEventListener("click",()=>this._showGalleryImage(this.galleryIndex-1)),t&&t.addEventListener("click",()=>this._showGalleryImage(this.galleryIndex+1)),this.galleryDots.forEach((e,t)=>{e.addEventListener("click",()=>this._showGalleryImage(t))})}_showGalleryImage(e){let t=this.galleryImages.length;this.galleryIndex=(e%t+t)%t,this.galleryImages.forEach((e,t)=>{e.classList.toggle("is-active",t===this.galleryIndex)}),this.galleryDots.forEach((e,t)=>{e.classList.toggle("is-active",t===this.galleryIndex)})}_open(e){e.preventDefault(),this._lastFocus=document.activeElement,this.el.hidden=!1,this.el.offsetWidth,this.el.classList.add("is-open"),document.addEventListener("keydown",this._onKeydown);let t=this.dialog.querySelector("button, [href], input, [tabindex]");t&&t.focus()}_close(){this.el.classList.remove("is-open"),document.removeEventListener("keydown",this._onKeydown),window.setTimeout(()=>{this.el.hidden=!0},260),this._lastFocus&&"function"==typeof this._lastFocus.focus&&this._lastFocus.focus()}_onKeydown(e){if("Escape"===e.key){this._close();return}if(this.galleryImages&&this.galleryImages.length>1){if("ArrowLeft"===e.key){this._showGalleryImage(this.galleryIndex-1);return}if("ArrowRight"===e.key){this._showGalleryImage(this.galleryIndex+1);return}}if("Tab"!==e.key)return;let t=this.dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!t.length)return;let i=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===i?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),i.focus())}destroy(){document.removeEventListener("keydown",this._onKeydown),this.el.remove()}},"[data-tcinn-ac-product-preview]"),ea.register("TcinnAdvancedCheckoutDeliveryDatePlugin",class extends o{init(){this._input=this.el.querySelector("[data-tcinn-ac-delivery-date-input]"),this._input&&(this._settings=this._readSettings(),this._selectable=new Set(this._settings.selectableDates),this._clearButton=this.el.querySelector("[data-tcinn-ac-delivery-date-clear]"),this._feedback=this.el.querySelector("#tcinn-ac-delivery-date-feedback"),this._locale=document.documentElement.lang||"de-DE",this._picker=null,this._input.required=!1,this._restoreValue(),this._registerNativeEvents(),this._registerRequiredCheck(),this._syncState(),this._initCalendar())}_readSettings(){let e={selectableDates:[],minDate:null,maxDate:null,weekNumbers:!1,required:!1,requiredMessage:""};try{return{...e,...JSON.parse(this.el.getAttribute("data-tcinn-ac-delivery-date-options")||"{}")}}catch(t){return e}}async _initCalendar(){let e=window.PluginManager;if(!e||"function"!=typeof e.initializePlugin)return;try{await e.initializePlugin("DatePicker",this._input,{dateFormat:B,altInput:!0,altInputClass:this._input.className,enableTime:!1,noCalendar:!1,allowInput:!1,weekNumbers:!!this._settings.weekNumbers,minDate:this._settings.minDate,maxDate:this._settings.maxDate,enable:this._settings.selectableDates,disableMobile:!0,position:"below",monthSelectorType:"static",locale:this._locale})}catch(e){return}let t=this._input._flatpickr;if(!t)return;this._picker=t;let i=new Intl.DateTimeFormat(this._locale,{weekday:"short",day:"numeric",month:"long",year:"numeric"}),n=new Intl.DateTimeFormat(this._locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),s=t.config.ariaDateFormat;t.set({formatDate:(e,t)=>t===B?this._toIso(e):t===s?n.format(e):i.format(e),locale:{...t.l10n,firstDayOfWeek:1}}),t.config.onChange.push(()=>this._onValueChange()),t.config.onOpen.push(()=>this._onCalendarOpen()),t.calendarContainer&&t.calendarContainer.classList.add("tcinn-ac-delivery-date-calendar"),this._decorateAltInput(t.altInput),this._syncState()}_decorateAltInput(e){e&&(e.id=this._input.id,this._input.removeAttribute("id"),["aria-describedby","aria-required","aria-invalid"].forEach(t=>{let i=this._input.getAttribute(t);null!==i&&e.setAttribute(t,i)}),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("form","confirmOrderForm"),this._settings.required?(e.readOnly=!1,e.required=!0,e.setAttribute("inputmode","none"),e.setAttribute("data-form-validation-error-message",this._settings.requiredMessage),["beforeinput","paste","drop"].forEach(t=>{e.addEventListener(t,e=>e.preventDefault())})):e.removeAttribute("required"),e.addEventListener("keydown",e=>
1{(" "===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),this._picker.open())}))}_onCalendarOpen(){let e=this._picker,t=e.calendarContainer,i=this._visibleInput().offsetWidth,n=i>0&&i<420;t.classList.toggle("tcinn-ac-delivery-date-calendar--fluid",n),n?(t.style.width=`${Math.max(i,280)}px`,e.daysContainer&&(e.daysContainer.style.width="")):this._fluidApplied&&(t.style.width="","function"==typeof e.redraw&&e.redraw()),this._fluidApplied=n,"function"==typeof e._positionCalendar&&e._positionCalendar();let s=t.getBoundingClientRect(),r=s.bottom+16-window.innerHeight;r>0&&window.scrollBy({top:Math.min(r,s.top-16),behavior:"smooth"})}_registerNativeEvents(){this._input.addEventListener("change",()=>this._onValueChange()),this._clearButton&&this._clearButton.addEventListener("click",()=>{this._picker?this._picker.clear():this._input.value="",this._onValueChange(),this._visibleInput().focus()});let e=document.getElementById("confirmOrderForm");e&&e.addEventListener("submit",()=>this._forgetValue())}_registerRequiredCheck(){this._settings.required&&document.querySelectorAll('#confirmFormSubmit, button[form="confirmOrderForm"]').forEach(e=>{e.addEventListener("click",e=>{this._input.value||(e.preventDefault(),this._showError(this._settings.requiredMessage))})})}_showError(e){let t=this._visibleInput();if(t.classList.add("is-invalid"),t.setAttribute("aria-invalid","true"),this._feedback&&e){let t=document.createElement("div");t.className="invalid-feedback",t.textContent=e,this._feedback.replaceChildren(t)}this.el.classList.remove("tcinn-ac-shake"),this.el.offsetWidth,this.el.classList.add("tcinn-ac-shake"),this.el.addEventListener("animationend",()=>this.el.classList.remove("tcinn-ac-shake"),{once:!0}),this.el.scrollIntoView({block:"center",behavior:"smooth"})}_onValueChange(){let e=this._input.value;if(e){let e=this._visibleInput();e.classList.remove("is-invalid"),e.setAttribute("aria-invalid","false"),this._feedback&&this._feedback.replaceChildren()}this._rememberValue(e),this._syncState()}_syncState(){let e=""!==this._input.value;this.el.classList.toggle("is-filled",e),this._clearButton&&(this._clearButton.hidden=!e)}_visibleInput(){return this._picker&&this._picker.altInput||this._input}_restoreValue(){if(!this._input.value)try{let e=JSON.parse(window.sessionStorage.getItem(D)||"null");e&&Date.now()-e.savedAt<36e5&&this._selectable.has(e.date)&&(this._input.value=e.date)}catch(e){}}_rememberValue(e){try{e&&this._selectable.has(e)?window.sessionStorage.setItem(D,JSON.stringify({date:e,savedAt:Date.now()})):window.sessionStorage.removeItem(D)}catch(e){}}_forgetValue(){try{window.sessionStorage.removeItem(D)}catch(e){}}_toIso(e){let t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}},"[data-tcinn-ac-delivery-date]"),ea.register("TcinnAdvancedCheckoutAddressManagerGuardPlugin",class extends o{init(){O||(O=!0,document.addEventListener("click",$,!0))}destroy(){}},"[data-address-manager]"),ea.register("TcinnAdvancedCheckoutAddressLengthLimitPlugin",class extends o{init(){this._settings=this._readSettings(),0!==Object.keys(this._settings.limits).length&&(this._onInput=e=>this._handleField(e.target),this._onSubmit=e=>this._handleSubmit(e),this._onClick=e=>this._handleJump(e),this._watched=new WeakSet,this._observers=[],this._timers=new Set,document.addEventListener("input",this._onInput),document.addEventListener("change",this._onInput),document.addEventListener("focusin",this._onInput),document.addEventListener("submit",this._onSubmit,!0),document.addEventListener("click",this._onClick))}destroy(){this._onInput&&(document.removeEventListener("input",this._onInput),document.removeEventListener("change",this._onInput),document.removeEventListener("focusin",this._onInput),document.removeEventListener("submit",this._onSubmit,!0),document.removeEventListener("click",this._onClick),this._observers.forEach(e=>e.disconnect()),this._observers=[],this._timers.forEach(e=>window.clearTimeout(e)),this._timers.clear())}_readSettings(){try{let e=JSON.parse(this.el.getAttribute("data-tcinn-ac-address-limits-options")||"{}");return{limits:{...e.limits},texts:{...e.texts}}}catch(e){return{limits:{},texts:{}}}}_parseName(e){let t=/^(.*?)\[?([A-Za-z0-9]+)\]?$/.exec(e||"");return t?{prefix:t[1],field:t[2]}:null}_isTextInput(e){return e instanceof HTMLInputElement&&R.includes(e.type)&&!e.disabled}_sibling(e,t,i){let n=e.form||document,s=t?`${t}[${i}]`:i;return n.querySelector(`input[name="${CSS.escape(s)}"]`)}_isAddressForm(e){let t=e.form;return!!t&&!!t.querySelector('input[name="street"], input[name$="[street]"]')}_resolve(e){if(!this._isTextInput(e)||!this._isAddressForm(e))return null;let t=this._parseName(e.name);if(!t)return null;if(V.includes(t.field)){let i=this._settings.limits.name,n=this._sibling(e,t.prefix,"lastName"),s=this._sibling(e,t.prefix,"firstName");if(!i||!n)return null;let r=`${(s&&s.value||"").trim()} ${n.value.trim()}`.trim();return{target:n,partner:s,value:r,max:i,kind:"name",prefix:t.prefix}}let i=z[t.field],n=i&&this._settings.limits[i];return n?{target:e,value:e.value.trim(),max:n,kind:t.field,prefix:t.prefix}:null}_handleField(e){if(e instanceof HTMLSelectElement&&/(^|\[)countryId\]?$/.test(e.name||"")){this._afterCountryChange(e.form);return}let t=this._resolve(e);t&&this._render(t)}_afterCountryChange(e){if(!e)return;let t=()=>
1e.querySelectorAll("input[name]").forEach(e=>{let t=this._resolve(e);t&&""!==t.value&&this._render(t)});[350,1050].forEach(e=>{let i=window.setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.add(i)})}_length(e){return[...e].length}_render(e){let{target:t,partner:i,value:n,max:s}=e,r=this._length(n),a=this._box(t);if(r>s&&!i&&this._hasFormatError(t)){this._clearInvalid(t),a.removeAttribute("role"),a.replaceChildren();return}if(r>s){let n="name"===e.kind?this._settings.texts.nameTooLong:this._settings.texts.tooLong,o=this._format(n,{over:r-s,max:s});a.replaceChildren(this._span("tcinn-ac-length-message",o));let l="street"===e.kind?this._streetTip(t,e.prefix):"";l&&a.appendChild(this._span("tcinn-ac-length-tip",l)),a.setAttribute("role","status"),this._setInvalid(t,o),i&&(this._setInvalid(i,o),this._describe(i,a.id));return}this._clearInvalid(t),i&&this._clearInvalid(i),a.removeAttribute("role");let o=s-r;if(r>0&&o>0&&r>=Math.ceil(.8*s)&&!this._hasForeignError(t)){let e=this._span("tcinn-ac-length-counter",this._format(this._settings.texts.remaining,{count:o}));a.replaceChildren(e)}else a.replaceChildren()}_hasFormatError(e){let{patternMismatch:t,typeMismatch:i,badInput:n}=e.validity;return t||i||n}_hasForeignError(e){return this._hasFormatError(e)||e.classList.contains("is-invalid")&&"true"!==e.dataset[U]}_streetTip(e,t){let i=this._sibling(e,t,"additionalAddressLine1");if(!i||!this._settings.texts.streetTip||null===i.offsetParent)return"";let n=i.id?document.querySelector(`label[for="${CSS.escape(i.id)}"]`):null,s=n?n.textContent.replace("*","").trim():"";return s?this._format(this._settings.texts.streetTip,{field:s}):""}_box(e){let t=`${e.id||e.name.replace(/\W+/g,"-")}-tcinn-ac-length`,i=document.getElementById(t);return i||((i=document.createElement("div")).className="tcinn-ac-length",i.id=t,(e.parentElement&&e.parentElement.querySelector(":scope > .form-field-feedback")||e).after(i),this._describe(e,t)),i}_describe(e,t){let i=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);i.includes(t)||e.setAttribute("aria-describedby",[...i,t].join(" "))}_setInvalid(e,t){if("true"!==e.dataset[U]){let t="true"===e.dataset[W];e.dataset[j]=String(e.classList.contains("is-invalid")&&!t),delete e.dataset[W]}e.classList.remove("is-valid"),e.classList.add("is-invalid"),e.setAttribute("aria-invalid","true"),e.setCustomValidity(t),e.dataset[U]="true",this._keepInvalidClass(e)}_keepInvalidClass(e){if(this._watched.has(e))return;this._watched.add(e);let t=new MutationObserver(()=>{"true"===e.dataset[U]&&(e.classList.contains("is-invalid")||e.classList.add("is-invalid"),"true"!==e.getAttribute("aria-invalid")&&e.setAttribute("aria-invalid","true"))});t.observe(e,{attributes:!0,attributeFilter:["class","aria-invalid"]}),this._observers.push(t)}_clearInvalid(e){let t="true"===e.dataset[W];if("true"!==e.dataset[U]&&!t)return;let i="true"===e.dataset[j];if(delete e.dataset[U],delete e.dataset[j],e.setCustomValidity(""),!e.validity.valid||i&&this._isRequiredEmpty(e)){i||(e.dataset[W]="true");return}delete e.dataset[W],e.classList.remove("is-invalid"),e.removeAttribute("aria-invalid")}_isRequiredEmpty(e){return""===e.value.trim()&&(e.required||"true"===e.getAttribute("aria-required")||(e.dataset.validation||"").includes("required")||e.hasAttribute("data-form-validation-required"))}_handleSubmit(e){let t=e.target;if(!(t instanceof HTMLFormElement))return;if("confirmOrderForm"===t.id&&document.querySelector("[data-tcinn-ac-address-length-block]")){this._stop(e),this._jumpToAddresses();return}let i=null;t.querySelectorAll("input[name]").forEach(e=>{let t=this._resolve(e);if(!t)return;this._render(t);let n=!t.partner&&this._hasFormatError(t.target);!i&&!n&&this._length(t.value)>t.max&&(i=t.target)}),i&&(this._stop(e),i.scrollIntoView({block:"center",behavior:"smooth"}),i.focus({preventScroll:!0}))}_handleJump(e){(e.target instanceof Element?e.target.closest("[data-tcinn-ac-address-length-jump]"):null)&&(e.preventDefault(),this._jumpToAddresses())}_jumpToAddresses(){let e=document.querySelector("[data-tcinn-ac-address-length-hint]");if(!e)return;let t=e.closest(".tcinn-ac-address-display, .tcinn-ac-checkout-billing-address")||e.parentElement,i=t&&t.querySelector(".tcinn-ac-billing-address-change-link");
1e.scrollIntoView({block:"center",behavior:"smooth"}),i&&i.focus({preventScroll:!0})}_stop(e){e.preventDefault(),e.stopPropagation()}_span(e,t){let i=document.createElement("span");return i.className=e,i.textContent=t,i}_format(e,t){let i=e||"",n=t.count??t.over;if(i.includes("|")&&void 0!==n){let[e,t]=i.split("|");i=1===Number(n)?e:t}return Object.entries(t).reduce((e,t)=>{let[i,n]=t;return e.split(`%${i}%`).join(String(n))},i).trim()}},"[data-tcinn-ac-address-limits]"),ea.register("TcinnAdvancedCheckoutAddressInvalidRestorePlugin",class extends o{init(){this._edited=new WeakSet,this._watched=new WeakSet,this._observers=[],this._timers=new Set,this._onInput=e=>{this._isAddressField(e.target)&&(this._edited.add(e.target),this._mirrorWatched(e.target))},this._onFocus=e=>this._watchForm(e.target.form||e.target.closest?.("form")),this._onLeave=e=>{this._restore(e.target),this._mirrorWatched(e.target)},this._onSubmit=e=>this._afterSubmit(e.target),this._onChange=e=>{!e.isTrusted&&this._isStaleError(e.target)&&this._revalidate(e.target),this._mirrorWatched(e.target)},document.addEventListener("input",this._onInput),document.addEventListener("focusin",this._onFocus),document.addEventListener("focusout",this._onLeave),document.addEventListener("submit",this._onSubmit,!0),document.addEventListener("change",this._onChange,!0)}destroy(){document.removeEventListener("input",this._onInput),document.removeEventListener("focusin",this._onFocus),document.removeEventListener("focusout",this._onLeave),document.removeEventListener("submit",this._onSubmit,!0),document.removeEventListener("change",this._onChange,!0),this._observers.forEach(e=>e.disconnect()),this._observers=[],this._timers.forEach(e=>window.clearTimeout(e)),this._timers.clear()}_isAddressField(e){return e instanceof HTMLInputElement&&H.test(e.name||"")}_addressFields(e){return e instanceof HTMLFormElement?[...e.querySelectorAll("input")].filter(e=>this._isAddressField(e)):[]}_watchForm(e){this._addressFields(e).forEach(e=>{if(this._watched.has(e)||!K(e))return;this._watched.add(e);let t=new MutationObserver(()=>this._mirror(e));t.observe(e,{attributes:!0,attributeFilter:["class"]}),this._observers.push(t),this._mirror(e)})}_mirror(e){let t=K(e);t&&J(t,"is-invalid","tcinnAcInvalidMark",e.classList.contains("is-invalid")||!!e.form&&e.form.classList.contains("was-validated")&&!e.validity.valid)}_mirrorWatched(e){if(!(e instanceof HTMLInputElement)||!this._watched.has(e))return;this._mirror(e);let t=window.setTimeout(()=>{this._timers.delete(t),this._mirror(e)},0);this._timers.add(t)}_afterSubmit(e){this._watchForm(e);let t=()=>this._addressFields(e).forEach(e=>{!e.disabled&&!e.classList.contains("is-invalid")&&this._hasCoreMessage(e)&&this._revalidate(e),this._watched.has(e)&&this._mirror(e)});[0,300].forEach(e=>{let i=window.setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.add(i)})}_restore(e){this._isAddressField(e)&&this._edited.has(e)&&(""!==e.value.trim()||e.disabled||e.classList.contains("is-invalid")||this._revalidate(e))}_isStaleError(e){return!!this._isAddressField(e)&&!e.disabled&&!e.readOnly&&""!==e.value.trim()&&(e.classList.contains("is-invalid")||this._hasCoreMessage(e))}_hasCoreMessage(e){let t=(e.getAttribute("aria-describedby")||"").split(" ").find(e=>e.includes("feedback")),i=t?document.getElementById(t):null;return!!(i&&""!==i.textContent.trim())}_revalidate(e){let t=window.formValidation,i=window.PluginManager;if(!t||"function"!=typeof t.validateField||!i||!e.form)return;let n=i.getPluginInstanceFromElement(e.form,"FormHandler");n&&n.options?.validation===!0&&[...n.formFields||[]].includes(e)&&t.validateField(e)}},"[data-tcinn-ac-address-invalid-restore]"),ea.register("TcinnAdvancedCheckoutAddressValidMarkPlugin",class extends o{init(){this._onLeave=e=>this._leave(e.target),this._onChange=e=>this._change(e),this._onInput=e=>this._input(e.target),this._watched=new WeakSet,this._touched=new WeakSet,this._standIns=new WeakMap,this._observers=[],this._timers=new Set,document.addEventListener("focusout",this._onLeave),document.addEventListener("change",this._onChange,!0),document.addEventListener("input",this._onInput)}destroy(){this._observers&&(document.removeEventListener("focusout",this._onLeave),document.removeEventListener("change",this._onChange,!0),document.removeEventListener("input",this._onInput),this._observers.forEac
1h(e=>e.disconnect()),this._observers=[],this._timers.forEach(e=>window.clearTimeout(e)),this._timers.clear())}_later(e,t){let i=window.setTimeout(()=>{this._timers.delete(i),e()},t);this._timers.add(i)}_observe(e,t){let i=new MutationObserver(t);i.observe(e,{attributes:!0,attributeFilter:["class"]}),this._observers.push(i)}_change(e){let t=e.target;if(t instanceof HTMLSelectElement&&/(^|\[)countryId\]?$/.test(t.name||"")){this._afterCountryChange(t.form);return}if(t instanceof HTMLSelectElement&&/(^|\[)countryStateId\]?$/.test(t.name||"")){this._syncCountry(t);return}this._leave(t)}_afterCountryChange(e){if(!e||!e.querySelector('input[name="street"], input[name$="[street]"]'))return;let t=()=>e.querySelectorAll("input").forEach(e=>{this._touched.has(e)&&document.activeElement!==e&&this._evaluate(e,!0)});[350,1050].forEach(e=>this._later(t,e))}_revalidateCore(e){let t=window.formValidation,i=window.PluginManager;if(!t||"function"!=typeof t.validateField||!i)return;let n=i.getPluginInstanceFromElement(e.form,"FormHandler");n&&n.options?.validation===!0&&[...n.formFields||[]].includes(e)&&t.validateField(e)}_applies(e){return e instanceof HTMLInputElement&&G.includes(e.type)&&!e.disabled&&!e.readOnly&&!!e.form&&!!e.form.querySelector('input[name="street"], input[name$="[street]"]')}_revalidateConfirmation(e,t){let i=e.id?document.getElementById(`${e.id}Confirmation`):null;if(!this._applies(i)||i.form!==e.form||""===i.value.trim())return;let n=i.classList.contains("is-invalid");(t?n:n||this._touched.has(i))&&(this._revalidateCore(i),this._evaluate(i,!0),this._later(()=>this._evaluate(i,!0),350))}_leave(e){this._applies(e)&&(this._touched.add(e),this._revalidateConfirmation(e,!1),this._evaluate(e,!0),this._later(()=>{document.activeElement!==e&&this._evaluate(e,!0)},350))}_input(e){this._applies(e)&&(this._evaluate(e,!1),this._revalidateConfirmation(e,!0),e.form.querySelectorAll("input").forEach(t=>{t!==e&&this._touched.has(t)&&this._evaluate(t,!0)}))}_evaluate(e,t){this._applies(e)&&(this._isValid(e)&&t?e.classList.contains("is-valid")||(e.classList.add("is-valid"),e.dataset[Y]="true",this._keepValidClass(e)):this._isValid(e)||"true"!==e.dataset[Y]||(delete e.dataset[Y],e.classList.remove("is-valid")),this._syncStandIn(e),this._syncCountry(e))}_syncCountry(e){let t=e.name||"";if(!X.test(t)||!e.form)return;let i=t.replace(X,""),n=t=>e.form.querySelector(i?`[name="${i}[${t}]"]`:`[name="${t}"]`),s=n("countryId");if(!(s instanceof HTMLSelectElement)||s.disabled)return;let r=Z.every(e=>{let t=n(e);return!(t instanceof HTMLInputElement)||t.classList.contains("is-valid")||""===t.value.trim()&&!this._isRequired(t)}),a=n("countryStateId"),o=!(a instanceof HTMLSelectElement)||a.disabled||!this._isRequired(a)||""!==a.value;J(s,"is-valid",Y,r&&o&&""!==s.value&&!s.classList.contains("is-invalid"))}_isRequired(e){return e.required||(e.getAttribute("data-validation")||"").split(",").includes("required")}_syncStandIn(e){let t=this._standIns.get(e),i=K(e);t&&t!==i&&(J(t,"is-valid",Y,!1),this._standIns.delete(e)),i&&(this._standIns.set(e,i),J(i,"is-valid",Y,"true"===e.dataset[Y]&&e.classList.contains("is-valid")))}_isValid(e){return""!==e.value.trim()&&e.validity.valid&&!e.classList.contains("is-invalid")&&!this._confirmationDiffers(e)}_confirmationDiffers(e){if(!e.id||!e.id.endsWith("Confirmation"))return!1;let t=document.getElementById(e.id.replace(/Confirmation$/,""));return!!t&&t.value.trim()!==e.value.trim()}_keepValidClass(e){this._watched.has(e)||(this._watched.add(e),this._observe(e,()=>{"true"!==e.dataset[Y]||e.classList.contains("is-valid")||(this._isValid(e)?e.classList.add("is-valid"):delete e.dataset[Y],this._syncStandIn(e))}))}},"[data-tcinn-ac-address-valid-mark]"),ea.register("TcinnAdvancedCheckoutFieldMaxLengthPlugin",class extends o{init(){this._limits=this._readLimits(),0!==Object.keys(this._limits).length&&(this._apply(document),this._observer=new MutationObserver(e=>{e.forEach(e=>e.addedNodes.forEach(e=>{e instanceof Element&&this._apply(e)}))}),this._observer.observe(document.body,{childList:!0,subtree:!0}))}destroy(){this._observer&&this._observer.disconnect()}_readLimits(){try{let e=JSON.parse(this.el.getAttribute("data-tcinn-ac-field-max-length")||"{}");return Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return Number.isInteger(t)&&t>0}))}catch(e){return{}}}_apply(e){(e.matches&&e.matches("input[name]")?[e]:e.querySelectorAll("input[name]")).forEac
1h(e=>{if(!["text","email","tel","search",""].includes(e.getAttribute("type")||""))return;let t=e.name.match(es),i=t?this._limits[t[1]]:void 0;if(!i)return;let n=parseInt(e.getAttribute("maxlength"),10);!Number.isNaN(n)&&n>0&&n<=i||e.setAttribute("maxlength",String(i))})}},"[data-tcinn-ac-field-max-length]")})();
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.