export const __webpack_esm_id__=80099;export const __webpack_esm_ids__=[80099];export const __webpack_esm_modules__={80099(e,t,n){n.r(t),n.d(t,{translate_label:()=>r});var a=n(18072),s=n(36015);n(57154);const r=class{constructor(e){(0,a.r)(this,e),this.unsubscribeTranslationChanged=null,this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=s.T.onTranslate(this.labelKey,this.translationParameters,e=>this.translatedLabel=e)}disconnectedCallback(){this.unsubscribeTranslationChanged&&(this.unsubscribeTranslationChanged(),this.unsubscribeTranslationChanged=null)}render(){return(0,a.h)(a.a,{key:"e14ed023755becfab8af466ba80b866d896037f2"},this.translatedLabel)}};r.style=":host{display:inline}"},36015(e,t,n){n.d(t,{L:()=>s,T:()=>l,s:()=>r});var a=n(57154);class s{static get logger(){return a.Loggers.getLoggerInstance("SharedComponents")}}function r(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}class i{constructor(){this.languageContextService=a.ServiceProvider.get(a.LanguageContextService),this.translationChangedObservers={},this.logger=s.logger,this.defaultBundle=this.languageContextService.getDefaultBundle(),this.subscribeToBundleChange()}onTranslate(e,t=[],n=()=>{}){this.translationChangedObservers[e]=this.translationChangedObservers[e]||[];const a={parameters:t,callback:n};return this.translationChangedObservers[e].push(a),n(this.translate(e,t)),()=>{const t=this.translationChangedObservers[e].indexOf(a);-1!==t&&this.translationChangedObservers[e].splice(t,1)}}translate(e,t){return this.translateInLocale(e,t)}translateInLocale(e,t){let n=this.translateFromBundle(this.currentBundle,e);return n||(n=this.translateFromBundle(this.defaultBundle,e)),n?(n=this.applyParameters(n,t),r(n)):(this.logger.warn(`Missing translation for key: [${e}]`),e)}translateFromBundle(e,t){if(!e)return;let n=e[t];return"string"!=typeof n&&(n=this.translateAsJsonObject(e,t)),n}translateAsJsonObject(e,t){if(!t)return;let n=t.split(".");return this.getTranslation(e,n)}getTranslation(e,t){if(!t||!e)return;const n=e[t.splice(0,1)[0]];return 0===t.length?n:"string"!=typeof n?t.length>0?this.getTranslation(n,t):n:void 0}applyParameters(e,t){return t?t.reduce((e,t)=>i.replaceAll(e,t),e):e}static replaceAll(e,t){return t?e.split(`{{${t.key}}}`).join(t.value):e}notifyTranslationsChanged(){Object.keys(this.translationChangedObservers).forEach(e=>{(this.translationChangedObservers[e]||[]).forEach(t=>t.callback(this.translate(e,t.parameters)))})}subscribeToBundleChange(){this.languageChangeSubscription=this.languageContextService.onLanguageBundleChanged(e=>{e&&(this.currentBundle=e,this.notifyTranslationsChanged())})}destroy(){this.languageChangeSubscription&&this.languageChangeSubscription()}}const l=new i}};
//# sourceMappingURL=80099.38c7d7d2fee08540a0d5.bundle.js.map