import{b as i}from"./chunk.4XDRYWQQ.js";import{a as s}from"./chunk.6EV4YU6C.js";var a=class extends i{constructor(t){super(t);this._instanceTranslations=null}get instanceTranslations(){return this._instanceTranslations}set instanceTranslations(t){this._instanceTranslations=t,this.host.requestUpdate()}hostConnected(){super.hostConnected(),this.setCustomLocalizationFromData(),new MutationObserver(()=>this.setCustomLocalizationFromData()).observe(this.host,{attributes:!0,attributeFilter:["data-custom-localization"]})}hostDisconnected(){super.hostDisconnected()}setCustomLocalizationFromData(){let t=this.host.dataset.customLocalization;if(t)try{this.setCustomLocalization(JSON.parse(t))}catch(n){console.error("Error parsing custom-localization attribute:",n)}}term(t,...n){var e;let r=(e=this.instanceTranslations)==null?void 0:e[t];return r?typeof r=="function"?r(...n):r:super.term(t,...n)}setCustomLocalization(t){this.instanceTranslations=s(s({},this.instanceTranslations),t)}};export{a};
