"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6703],{25668:(t,e,n)=>{n.d(e,{x:()=>o});let o=(0,n(12115).createContext)({locale:"en",translations:{},setNamespaceTranslations:()=>{}})},76703:(t,e,n)=>{n.d(e,{v:()=>s,useClientLocale:()=>a,useClientTranslations:()=>l});var o=n(12115),i=n(25668),r=n(86696);function l(t){let e=(0,o.useContext)(i.x),n={locale:"en"===window.location.pathname.split("/")[1]||"de"===window.location.pathname.split("/")[1]?window.location.pathname.split("/")[1]:"en",translations:{Common:{loading:"Loading...",error:"Error occurred"},Auth:{UserMenu:{account:"Account",login:"Login"}},Home:{hero:{scrollIndicator:"Scroll down",scrollIndicatorMobile:"Scroll"}}},setNamespaceTranslations:()=>{}};e||console.warn("useClientTranslations used outside TranslationProvider - using fallback translations");let{translations:l={}}=e||n;return(0,o.useMemo)(()=>{let e=(e,n)=>{let o=t,i="",a=e;t.includes(".")&&(o=t.split(".")[0],(i=function(t){let e=t.split(".");return 1===e.length?"":e.slice(1).join(".")}(t))&&(a="".concat(i,".").concat(e)));let s="".concat(String(o),".").concat(String(a));if(void 0!==l[s]){let t=l[s];return"string"!=typeof t?String(t):n?c(t,n):t}let u=r.TranslationAccessService.findTranslation(l,String(o),String(a));return void 0===u?n&&"defaultValue"in n?String(n.defaultValue):String(e):"string"!=typeof u?String(u):n?c(u,n):u};return e.rich=(t,n)=>{let o=e(t);return o===String(t)?String(t):function(t,e){let n=Object.keys(e);if(0===n.length)return t;let o=[t];return n.forEach(t=>{let n="<".concat(t,">"),i="</".concat(t,">");o=o.flatMap(o=>{let r;if("string"!=typeof o)return o;let l=[],a=0;for(;-1!==(r=o.indexOf(n,a));){r>a&&l.push(o.substring(a,r));let c=r+n.length,s=o.indexOf(i,c);if(-1===s){l.push(o.substring(a)),a=o.length;break}let u=o.substring(c,s);l.push(e[t](u)),a=s+i.length}return a<o.length&&l.push(o.substring(a)),l})}),o}(o,n)},e},[t,l])}function a(){let t=(0,o.useContext)(i.x),e="en"===window.location.pathname.split("/")[1]||"de"===window.location.pathname.split("/")[1]?window.location.pathname.split("/")[1]:"en";return t?t.locale&&"string"==typeof t.locale?t.locale:(console.warn("[i18n] useClientLocale received invalid locale. Using '".concat(e,"' as fallback.")),e):(console.warn("[i18n] useClientLocale used outside TranslationProvider - using fallback locale: ".concat(e)),e)}function c(t,e){return t.replace(/{(\w+)}/g,(t,n)=>void 0!==e[n]?String(e[n]):"{".concat(n,"}"))}function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"EUR";try{return new Intl.NumberFormat(e,{style:"currency",currency:n,minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}catch(e){return console.error("Error formatting currency: ".concat(e)),"".concat(n," ").concat(t.toFixed(2))}}},86696:(t,e,n)=>{n.r(e),n.d(e,{TranslationAccessService:()=>r});var o=n(40054),i=n.n(o);class r{static getValue(t,e,n){return i().get(t,e,n)}static hasPath(t,e){return i().has(t,e)}static setValue(t,e,n){return i().set(t,e,n),t}static extractNamespace(t){return t.split(".")[0]}static createKey(t,e){return"".concat(t,".").concat(e)}static findTranslation(t,e,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(o&&(console.debug("[i18n] Looking for translation: namespace=".concat(e,", key=").concat(n)),console.debug("[i18n] Translation object structure:",Object.keys(t))),n.includes(".")){let i=n.split("."),r=t;for(let t=0;t<i.length-1;t++){let e=i[t];if(!r||"object"!=typeof r||!(e in r)){r=void 0;break}r=r[e]}if(r){let t=i[i.length-1];if(t in r&&"string"==typeof r[t]){let i=r[t];return o&&console.debug("[i18n] Found translation for ".concat(e,".").concat(n,": ").concat(i)),i}}}if(t[e]&&"object"==typeof t[e]){let o=t[e],i=this.getValue(o,n);if(void 0!==i)return i}let i=t[this.createKey(e,n)];if("string"==typeof i)return i;if(e.includes(".")){let o=e.split("."),i=o[0];if(t[i]&&"object"==typeof t[i]){let e=t[i];for(let t=1;t<o.length;t++){let n=o[t];if(!e||"object"!=typeof e||!(n in e))return;e=e[n]}if(e&&"object"==typeof e){let t=this.getValue(e,n);if(void 0!==t)return t}}}if(n.includes(".")&&t[e]&&"object"==typeof t[e]){let o=t[e],i=this.getValue(o,n);if(void 0!==i)return i}let r=t[n];if("string"==typeof r)return r;o&&console.debug("[i18n] Translation not found for ".concat(e,".").concat(n))}}}}]);