lit-intlayer 9.1.1 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/client/IntlayerBinding.cjs +1 -1
  2. package/dist/cjs/client/index.cjs +1 -1
  3. package/dist/cjs/client/installIntlayer.cjs +1 -1
  4. package/dist/cjs/client/useDictionary.cjs +1 -1
  5. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  6. package/dist/cjs/client/useIntlayer.cjs +1 -1
  7. package/dist/cjs/client/useLocale.cjs +1 -1
  8. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  9. package/dist/cjs/editor/useEditor.cjs +1 -1
  10. package/dist/cjs/format/useCompact.cjs +1 -1
  11. package/dist/cjs/format/useCurrency.cjs +1 -1
  12. package/dist/cjs/format/useDate.cjs +1 -1
  13. package/dist/cjs/format/useIntl.cjs +1 -1
  14. package/dist/cjs/format/useList.cjs +1 -1
  15. package/dist/cjs/format/useNumber.cjs +1 -1
  16. package/dist/cjs/format/usePercentage.cjs +1 -1
  17. package/dist/cjs/format/useRelativeTime.cjs +1 -1
  18. package/dist/cjs/format/useUnit.cjs +1 -1
  19. package/dist/cjs/index.cjs +1 -1
  20. package/dist/cjs/plugins.cjs +1 -1
  21. package/dist/esm/client/IntlayerBinding.mjs +1 -1
  22. package/dist/esm/client/index.mjs +1 -1
  23. package/dist/esm/client/installIntlayer.mjs +1 -1
  24. package/dist/esm/client/useDictionary.mjs +11 -8
  25. package/dist/esm/client/useDictionaryDynamic.mjs +40 -35
  26. package/dist/esm/client/useIntlayer.mjs +11 -8
  27. package/dist/esm/client/useLocale.mjs +1 -1
  28. package/dist/esm/client/useRewriteURL.mjs +1 -1
  29. package/dist/esm/editor/useEditor.mjs +1 -1
  30. package/dist/esm/format/useCompact.mjs +1 -1
  31. package/dist/esm/format/useCurrency.mjs +1 -1
  32. package/dist/esm/format/useDate.mjs +1 -1
  33. package/dist/esm/format/useIntl.mjs +1 -1
  34. package/dist/esm/format/useList.mjs +1 -1
  35. package/dist/esm/format/useNumber.mjs +1 -1
  36. package/dist/esm/format/usePercentage.mjs +1 -1
  37. package/dist/esm/format/useRelativeTime.mjs +1 -1
  38. package/dist/esm/format/useUnit.mjs +1 -1
  39. package/dist/esm/index.mjs +1 -1
  40. package/dist/esm/plugins.mjs +1 -1
  41. package/dist/{installIntlayer-DWDo9T68.mjs → installIntlayer-CJ5s-cE7.mjs} +14 -6
  42. package/dist/installIntlayer-Crmc3v8X.js +1 -0
  43. package/dist/types/client/installIntlayer.d.ts +19 -4
  44. package/dist/types/client/installIntlayer.d.ts.map +1 -1
  45. package/dist/types/client/useDictionary.d.ts.map +1 -1
  46. package/dist/types/client/useDictionaryDynamic.d.ts.map +1 -1
  47. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  48. package/package.json +7 -7
  49. package/dist/installIntlayer-DFH3THoH.js +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");var t=class{host;unsubscribeLocale=null;onConnect;onDisconnect;constructor(e,t,n){this.host=e,this.onConnect=t,this.onDisconnect=n,this.host.addController(this)}hostConnected(){let t=e.r();this.unsubscribeLocale=t.subscribe(()=>{this.host.requestUpdate()}),this.onConnect?.()}hostDisconnected(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.onDisconnect?.()}};exports.IntlayerBinding=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");var t=class{host;unsubscribeLocale=null;onConnect;onDisconnect;constructor(e,t,n){this.host=e,this.onConnect=t,this.onDisconnect=n,this.host.addController(this)}hostConnected(){let t=e.r();this.unsubscribeLocale=t.subscribe(()=>{this.host.requestUpdate()}),this.onConnect?.()}hostDisconnected(){this.unsubscribeLocale?.(),this.unsubscribeLocale=null,this.onDisconnect?.()}};exports.IntlayerBinding=t;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js"),t=require("./IntlayerBinding.cjs"),n=require("./useDictionary.cjs"),r=require("./useDictionaryDynamic.cjs"),i=require("./useIntlayer.cjs"),a=require("./useLocaleStorage.cjs"),o=require("./useLocale.cjs"),s=require("./useRewriteURL.cjs");exports.IntlayerBinding=t.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=o.LocaleController,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i,exports.localeCookie=a.localeCookie,exports.localeInStorage=a.localeInStorage,exports.setLocaleCookie=a.setLocaleCookie,exports.setLocaleInStorage=a.setLocaleInStorage,exports.useDictionary=n.useDictionary,exports.useDictionaryDynamic=r.useDictionaryDynamic,exports.useIntlayer=i.useIntlayer,exports.useLocale=o.useLocale,exports.useLocaleCookie=a.useLocaleCookie,exports.useLocaleStorage=a.useLocaleStorage,exports.useRewriteURL=s.useRewriteURL;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js"),t=require("./IntlayerBinding.cjs"),n=require("./useDictionary.cjs"),r=require("./useDictionaryDynamic.cjs"),i=require("./useIntlayer.cjs"),a=require("./useLocaleStorage.cjs"),o=require("./useLocale.cjs"),s=require("./useRewriteURL.cjs");exports.IntlayerBinding=t.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=o.LocaleController,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i,exports.localeCookie=a.localeCookie,exports.localeInStorage=a.localeInStorage,exports.setLocaleCookie=a.setLocaleCookie,exports.setLocaleInStorage=a.setLocaleInStorage,exports.useDictionary=n.useDictionary,exports.useDictionaryDynamic=r.useDictionaryDynamic,exports.useIntlayer=i.useIntlayer,exports.useLocale=o.useLocale,exports.useLocaleCookie=a.useLocaleCookie,exports.useLocaleStorage=a.useLocaleStorage,exports.useRewriteURL=s.useRewriteURL;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");exports.IntlayerClient=e.t,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");exports.IntlayerClient=e.t,exports.createIntlayerClient=e.n,exports.getIntlayerClient=e.r,exports.installIntlayer=e.i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built");var i=(i,a)=>{let o=e.r(),s=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof a==`object`&&!!a,c=s?a.locale:a,l=e=>s?t.getDictionary(i,{...a,locale:e}):t.getDictionary(i,e),u=l(c??o.locale??r.internationalization.defaultLocale);o.subscribe(e=>{u=l(c??e)});let d,f=new Proxy({},{get(e,t){if(t===`observe`)return d;if(t===Symbol.toPrimitive)return()=>u?.[Symbol.toPrimitive]?.()??``;if(t===`toString`)return()=>String(u?.toString?.()??``);if(t!==`then`&&u!=null)return u[t]}});return d=e=>(new n.IntlayerBinding(e),f),f};exports.useDictionary=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=(a,o)=>{let s=e.r(),c=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof o==`object`&&o?o.locale:o,l=e=>process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getDictionary(a,e):t.getDictionary(a,(0,i.resolveDictionaryArgument)({localeOrSelector:o,contextLocale:e,contextVariant:s.variant,dictionaryKey:a.key})),u=l(c??s.locale??r.internationalization.defaultLocale);s.subscribe(e=>{u=l(c??e)});let d,f=new Proxy({},{get(e,t){if(t===`observe`)return d;if(t===Symbol.toPrimitive)return()=>u?.[Symbol.toPrimitive]?.()??``;if(t===`toString`)return()=>String(u?.toString?.()??``);if(t!==`then`&&u!=null)return u[t]}});return d=e=>(new n.IntlayerBinding(e),f),f};exports.useDictionary=a;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=new Map,o=async(e,t)=>{if(!t)return;if(a.has(e))return a.get(e);let n=await t();return a.set(e,n),n},s=new Proxy(()=>{},{get:(e,t)=>{if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t!==`then`&&!(typeof t==`string`&&t.startsWith(`_$`))&&t!==`nodeType`&&t!==Symbol.iterator)return s},apply:()=>s,construct:()=>({})}),c=(a,c,l)=>{let u=e.r(),d=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&(0,i.isQualifiedDynamicLoaderMap)(a),{locale:f,selector:p}=process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?{locale:l,selector:void 0}:(0,i.parseDictionarySelector)(l),m=()=>f??u.locale??r.internationalization.defaultLocale,h,g=new Set,_=()=>{for(let e of g)e()},v=e=>{if(d){(0,i.resolveQualifiedDynamicContentAsync)({loaderMap:a,key:String(c),locale:e,selector:p,transform:n=>t.getDictionary(n,e)}).then(e=>{h=e,_()});return}let n=`${String(c)}.${e}`,r=a[e];o(n,r).then(n=>{n&&(h=t.getDictionary(n,e),_())})};v(m()),u.subscribe(e=>{v(f??e)});let y,b=new Proxy({},{get(e,t){if(t===`observe`)return y;if(t===Symbol.toPrimitive)return()=>void 0;if(t===`toString`)return()=>``;if(t!==`then`)return h==null?s:h[t]}});return y=e=>{let t=()=>e.requestUpdate();return g.add(t),new n.IntlayerBinding(e,()=>{h!=null&&e.requestUpdate()},()=>{g.delete(t)}),b},b};exports.useDictionaryDynamic=c;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js"),t=require("../getDictionary.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=new Map,o=async(e,t)=>{if(!t)return;if(a.has(e))return a.get(e);let n=await t();return a.set(e,n),n},s=new Proxy(()=>{},{get:(e,t)=>{if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t!==`then`&&!(typeof t==`string`&&t.startsWith(`_$`))&&t!==`nodeType`&&t!==Symbol.iterator)return s},apply:()=>s,construct:()=>({})}),c=(a,c,l)=>{let u=e.r(),d=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&(0,i.isQualifiedDynamicLoaderMap)(a),{locale:f,selector:p}=process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?{locale:l,selector:void 0}:(0,i.parseDictionarySelector)((0,i.resolveDictionaryArgument)({localeOrSelector:l,contextLocale:u.locale,contextVariant:u.variant,dictionaryKey:String(c)})),m=()=>f??u.locale??r.internationalization.defaultLocale,h,g=new Set,_=()=>{for(let e of g)e()},v=e=>{if(d){(0,i.resolveQualifiedDynamicContentAsync)({loaderMap:a,key:String(c),locale:e,selector:p,transform:n=>t.getDictionary(n,e)}).then(e=>{h=e,_()});return}let n=`${String(c)}.${e}`,r=a[e];o(n,r).then(n=>{n&&(h=t.getDictionary(n,e),_())})};v(m()),u.subscribe(e=>{v(f??e)});let y,b=new Proxy({},{get(e,t){if(t===`observe`)return y;if(t===Symbol.toPrimitive)return()=>void 0;if(t===`toString`)return()=>``;if(t!==`then`)return h==null?s:h[t]}});return y=e=>{let t=()=>e.requestUpdate();return g.add(t),new n.IntlayerBinding(e,()=>{h!=null&&e.requestUpdate()},()=>{g.delete(t)}),b},b};exports.useDictionaryDynamic=c;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js"),t=require("../getIntlayer.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built");var i=(i,a)=>{let o=e.r(),s=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof a==`object`&&!!a,c=s?a.locale:a,l=e=>s?t.getIntlayer(i,{...a,locale:e}):t.getIntlayer(i,e),u,d,f=!1,p=new Proxy({},{get(e,t){if(t===`observe`)return e=>(new n.IntlayerBinding(e),p);if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t===`then`||typeof t==`symbol`||typeof t==`string`&&t.startsWith(`_$`))return;let i=c??o.locale??r.internationalization.defaultLocale;if((!f||u!==i)&&(d=l(i),u=i,f=!0),d!=null)return d[t]}});return p};exports.useIntlayer=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js"),t=require("../getIntlayer.cjs"),n=require("./IntlayerBinding.cjs");let r=require("@intlayer/config/built"),i=require("@intlayer/core/dictionaryManipulator");var a=(a,o)=>{let s=e.r(),c=process.env.INTLAYER_DICTIONARY_SELECTOR!==`false`&&typeof o==`object`&&o?o.locale:o,l=e=>process.env.INTLAYER_DICTIONARY_SELECTOR===`false`?t.getIntlayer(a,e):t.getIntlayer(a,(0,i.resolveDictionaryArgument)({localeOrSelector:o,contextLocale:e,contextVariant:s.variant,dictionaryKey:a})),u,d,f=!1,p=new Proxy({},{get(e,t){if(t===`observe`)return e=>(new n.IntlayerBinding(e),p);if(t===Symbol.toPrimitive||t===`toString`)return()=>``;if(t===`then`||typeof t==`symbol`||typeof t==`string`&&t.startsWith(`_$`))return;let i=c??s.locale??r.internationalization.defaultLocale;if((!f||u!==i)&&(d=l(i),u=i,f=!0),d!=null)return d[t]}});return p};exports.useIntlayer=a;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js"),t=require("./useLocaleStorage.cjs");let n=require("@intlayer/config/built");var r=class{host;_isCookieEnabled;_onLocaleChange;_unsubscribe=null;locale;defaultLocale;availableLocales;constructor(t,r={}){this.host=t,this._isCookieEnabled=r.isCookieEnabled,this._onLocaleChange=r.onLocaleChange;let i=e.r(),{defaultLocale:a,locales:o}=n.internationalization??{};this.locale=i.locale,this.defaultLocale=a,this.availableLocales=o??[],t.addController(this)}setLocale=n=>{if(!this.availableLocales.map(String).includes(n)){console.error(`Locale "${n}" is not available.`);return}let r=e.r();r.setLocale(n),t.setLocaleInStorage(n,this._isCookieEnabled??r.isCookieEnabled??!0),this._onLocaleChange?.(n)};hostConnected(){let t=e.r();this._unsubscribe=t.subscribe(e=>{this.locale=e,this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=(e,t={})=>new r(e,t);exports.LocaleController=r,exports.useLocale=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js"),t=require("./useLocaleStorage.cjs");let n=require("@intlayer/config/built");var r=class{host;_isCookieEnabled;_onLocaleChange;_unsubscribe=null;locale;defaultLocale;availableLocales;constructor(t,r={}){this.host=t,this._isCookieEnabled=r.isCookieEnabled,this._onLocaleChange=r.onLocaleChange;let i=e.r(),{defaultLocale:a,locales:o}=n.internationalization??{};this.locale=i.locale,this.defaultLocale=a,this.availableLocales=o??[],t.addController(this)}setLocale=n=>{if(!this.availableLocales.map(String).includes(n)){console.error(`Locale "${n}" is not available.`);return}let r=e.r();r.setLocale(n),t.setLocaleInStorage(n,this._isCookieEnabled??r.isCookieEnabled??!0),this._onLocaleChange?.(n)};hostConnected(){let t=e.r();this._unsubscribe=t.subscribe(e=>{this.locale=e,this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=(e,t={})=>new r(e,t);exports.LocaleController=r,exports.useLocale=i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/config/built"),n=require("@intlayer/core/localization");var r=class{_host;_unsubscribe=null;constructor(e){this._host=e,e.addController(this)}_rewrite(e){let r=t.routing?.rewrite;if(typeof window>`u`||!r)return;let i=window.location.pathname,a=(0,n.getRewritePath)(i,e,r);a&&a!==i&&window.history.replaceState(window.history.state,``,a+window.location.search+window.location.hash)}hostConnected(){let t=e.r();this._rewrite(t.locale),this._unsubscribe=t.subscribe(e=>{this._rewrite(e)})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=e=>{new r(e)};exports.useRewriteURL=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/config/built"),n=require("@intlayer/core/localization");var r=class{_host;_unsubscribe=null;constructor(e){this._host=e,e.addController(this)}_rewrite(e){let r=t.routing?.rewrite;if(typeof window>`u`||!r)return;let i=window.location.pathname,a=(0,n.getRewritePath)(i,e,r);a&&a!==i&&window.history.replaceState(window.history.state,``,a+window.location.search+window.location.hash)}hostConnected(){let t=e.r();this._rewrite(t.locale),this._unsubscribe=t.subscribe(e=>{this._rewrite(e)})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},i=e=>{new r(e)};exports.useRewriteURL=i;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");exports.useEditor=e.a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");exports.useEditor=e.a;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.compact)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.compact)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCompact=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.compact)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.compact)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCompact=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.currency)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.currency)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCurrency=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.currency)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.currency)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useCurrency=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>{let n=typeof e[1]==`string`?{...t.presets[e[1]],locale:r.locale}:{...e[1],locale:e[1]?.locale??r.locale};return(0,t.date)(e[0],n)},n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>{let r=typeof n[1]==`string`?{...t.presets[n[1]],locale:e}:{...n[1],locale:n[1]?.locale??e};return(0,t.date)(n[0],r)},this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useDate=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>{let n=typeof e[1]==`string`?{...t.presets[e[1]],locale:r.locale}:{...e[1],locale:e[1]?.locale??r.locale};return(0,t.date)(e[0],n)},n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>{let r=typeof n[1]==`string`?{...t.presets[n[1]],locale:e}:{...n[1],locale:n[1]?.locale??e};return(0,t.date)(n[0],r)},this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useDate=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/utils");var n=class{host;_overrideLocale;_unsubscribe=null;value;constructor(n,r){this.host=n,this._overrideLocale=r;let i=e.r();this.value=(0,t.bindIntl)(this._overrideLocale??i.locale),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(0,t.bindIntl)(this._overrideLocale??e),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=(e,t)=>new n(e,t);exports.useIntl=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/utils");var n=class{host;_overrideLocale;_unsubscribe=null;value;constructor(n,r){this.host=n,this._overrideLocale=r;let i=e.r();this.value=(0,t.bindIntl)(this._overrideLocale??i.locale),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(0,t.bindIntl)(this._overrideLocale??e),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=(e,t)=>new n(e,t);exports.useIntl=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.list)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.list)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useList=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.list)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.list)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useList=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.number)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.number)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useNumber=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.number)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.number)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useNumber=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.percentage)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.percentage)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.usePercentage=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.percentage)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.percentage)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.usePercentage=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.relativeTime)(n[0],n[1],{...n[2],locale:n[2]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useRelativeTime=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.relativeTime)(e[0],e[1],{...e[2],locale:e[2]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.relativeTime)(n[0],n[1],{...n[2],locale:n[2]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useRelativeTime=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-DFH3THoH.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.units)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.units)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useUnit=r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../installIntlayer-Crmc3v8X.js");let t=require("@intlayer/core/formatters");var n=class{host;_unsubscribe=null;value;constructor(n){this.host=n;let r=e.r();this.value=(...e)=>(0,t.units)(e[0],{...e[1],locale:e[1]?.locale??r.locale}),n.addController(this)}hostConnected(){let n=e.r();this._unsubscribe=n.subscribe(e=>{this.value=(...n)=>(0,t.units)(n[0],{...n[1],locale:n[1]?.locale??e}),this.host.requestUpdate()})}hostDisconnected(){this._unsubscribe?.(),this._unsubscribe=null}},r=e=>new n(e);exports.useUnit=r;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../installIntlayer-DFH3THoH.js"),t=require("./plugins.cjs"),n=require("./getIntlayer.cjs"),r=require("./getDictionary.cjs"),i=require("./client/IntlayerBinding.cjs"),a=require("./client/useDictionary.cjs"),o=require("./client/useDictionaryDynamic.cjs"),s=require("./client/useIntlayer.cjs"),c=require("./client/useLocaleStorage.cjs"),l=require("./client/useLocale.cjs"),u=require("./client/useRewriteURL.cjs");require("./client/index.cjs"),exports.IntlayerBinding=i.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=l.LocaleController,exports.createIntlayerClient=e.n,exports.getDictionary=r.getDictionary,exports.getIntlayer=n.getIntlayer,exports.getIntlayerClient=e.r,exports.getPlugins=t.getPlugins,exports.htmlPlugin=t.htmlPlugin,exports.insertionPlugin=t.insertionPlugin,exports.installIntlayer=e.i,exports.intlayerNodePlugins=t.intlayerNodePlugins,exports.localeCookie=c.localeCookie,exports.localeInStorage=c.localeInStorage,exports.markdownPlugin=t.markdownPlugin,exports.markdownStringPlugin=t.markdownStringPlugin,exports.setLocaleCookie=c.setLocaleCookie,exports.setLocaleInStorage=c.setLocaleInStorage,exports.useDictionary=a.useDictionary,exports.useDictionaryDynamic=o.useDictionaryDynamic,exports.useEditor=e.a,exports.useIntlayer=s.useIntlayer,exports.useLocale=l.useLocale,exports.useLocaleCookie=c.useLocaleCookie,exports.useLocaleStorage=c.useLocaleStorage,exports.useRewriteURL=u.useRewriteURL;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../installIntlayer-Crmc3v8X.js"),t=require("./plugins.cjs"),n=require("./getIntlayer.cjs"),r=require("./getDictionary.cjs"),i=require("./client/IntlayerBinding.cjs"),a=require("./client/useDictionary.cjs"),o=require("./client/useDictionaryDynamic.cjs"),s=require("./client/useIntlayer.cjs"),c=require("./client/useLocaleStorage.cjs"),l=require("./client/useLocale.cjs"),u=require("./client/useRewriteURL.cjs");require("./client/index.cjs"),exports.IntlayerBinding=i.IntlayerBinding,exports.IntlayerClient=e.t,exports.LocaleController=l.LocaleController,exports.createIntlayerClient=e.n,exports.getDictionary=r.getDictionary,exports.getIntlayer=n.getIntlayer,exports.getIntlayerClient=e.r,exports.getPlugins=t.getPlugins,exports.htmlPlugin=t.htmlPlugin,exports.insertionPlugin=t.insertionPlugin,exports.installIntlayer=e.i,exports.intlayerNodePlugins=t.intlayerNodePlugins,exports.localeCookie=c.localeCookie,exports.localeInStorage=c.localeInStorage,exports.markdownPlugin=t.markdownPlugin,exports.markdownStringPlugin=t.markdownStringPlugin,exports.setLocaleCookie=c.setLocaleCookie,exports.setLocaleInStorage=c.setLocaleInStorage,exports.useDictionary=a.useDictionary,exports.useDictionaryDynamic=o.useDictionaryDynamic,exports.useEditor=e.a,exports.useIntlayer=s.useIntlayer,exports.useLocale=l.useLocale,exports.useLocaleCookie=c.useLocaleCookie,exports.useLocaleStorage=c.useLocaleStorage,exports.useRewriteURL=u.useRewriteURL;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./renderIntlayerNode.cjs"),l=require("../installIntlayer-DFH3THoH.js"),u=require("./markdown/runtime.cjs");let d=require("@intlayer/core/interpreter"),f=require("@intlayer/config/built"),p=require("@intlayer/core/markdown"),m=require("@intlayer/types/nodeType");m=s(m);let h=require("lit/directives/unsafe-html.js"),g=require("lit/static-html.js");var _=(e=``,t={})=>(0,p.compileWithOptions)(e,u.default,t),v=(e,t,n={})=>{let r=typeof e==`string`?(0,h.unsafeHTML)(e):e;return new Proxy(r,{get(e,r,i){if(r===`value`||r===`raw`)return t;if(r===`toString`||r===Symbol.toPrimitive)return()=>t;if(r!==Symbol.iterator)return r===`__update`?()=>{}:r===`isJSX`?!0:r in n?n[r]:Reflect.get(e,r,i)}})},y=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`),b=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),x={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,keyPath:n,dictionaryKey:r,...i})=>{if(process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled){let e=String(t??``);return v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(n??[]))}" dictionary-key="${y(String(r??``))}">${b(e)}</intlayer-content-selector-wrapper>`,e)}return c.renderIntlayerNode({...i,value:t,children:t})}},S=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?d.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:m.INSERTION}],i=e[m.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,d.isInterpolableWrapperNode)(e),transform:(e,n,r)=>{if((0,d.isInterpolableWrapperNode)(e))return i=>(0,d.transformInterpolableNode)(e,i,n,t.plugins,r);let i=r(e,{...n,children:e,plugins:(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)});return e=>{let a=(0,d.splitInsertionTemplate)(i,e),o=a.isSimple?a.parts:a.parts.join(``);return r(o,{...n,plugins:t.plugins,children:o})}}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return typeof i==`object`&&i&&`nodeType`in i&&[m.ENUMERATION,m.CONDITION].includes(i.nodeType)?e=>t=>{let n=o(t);return typeof n==`function`?n(e):n}:o}},C=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,{keyPath:a,dictionaryKey:o}=i,s=n((0,p.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>c.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),l=_(e),u=t=>{let n=_(e,{components:t});return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(a??[]))}" dictionary-key="${y(String(o??``))}">${n}</intlayer-content-selector-wrapper>`,e):v(n,e)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(a??[]))}" dictionary-key="${y(String(o??``))}">${l}</intlayer-content-selector-wrapper>`,e,{metadata:s,use:u}):v(l,e,{metadata:s,use:u})}},w=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:m.MARKDOWN}],i=e[m.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[C,...t.plugins??[]]})}},T=process.env.INTLAYER_NODE_TYPE_HTML===`false`?d.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.HTML,transform:(e,t)=>{let n=e[m.HTML],{keyPath:r,dictionaryKey:i}=t,a=(e={})=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e).map(([e,t])=>[e,e=>t(e)])),a=new Proxy(t,{get(e,t){if(typeof t==`string`&&t in e)return e[t];if(typeof t==`string`&&/^[a-z][a-z0-9]*$/.test(t))return e=>g.html`<${(0,g.unsafeStatic)(t)} ...${e}>${e.children}</${(0,g.unsafeStatic)(t)}>`}}),o=(0,d.getHTML)(n,a);return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(r??[]))}" dictionary-key="${y(String(i??``))}">${o}</intlayer-content-selector-wrapper>`,n):v(o,n)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(r??[]))}" dictionary-key="${y(String(i??``))}">${n}</intlayer-content-selector-wrapper>`,n,{use:a}):v(n,n,{use:a})}},E=new Map,D=(e,t=!0)=>{let n=e??(typeof window<`u`&&l.r()?.locale)??f.internationalization.defaultLocale,r=`${n}_${t}`;if(E.has(r))return E.get(r);let i=[(0,d.translationPlugin)(e??f.internationalization.defaultLocale,t?f.internationalization.defaultLocale:void 0),d.enumerationPlugin,(0,d.pluralPlugin)(n),d.conditionPlugin,(0,d.nestedPlugin)(n),d.filePlugin,d.genderPlugin,d.selectPlugin,x,S,w,T];return E.set(r,i),i};exports.getPlugins=D,exports.htmlPlugin=T,exports.insertionPlugin=S,exports.intlayerNodePlugins=x,exports.markdownPlugin=w,exports.markdownStringPlugin=C;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./renderIntlayerNode.cjs"),l=require("../installIntlayer-Crmc3v8X.js"),u=require("./markdown/runtime.cjs");let d=require("@intlayer/core/interpreter"),f=require("@intlayer/config/built"),p=require("@intlayer/core/markdown"),m=require("@intlayer/types/nodeType");m=s(m);let h=require("lit/directives/unsafe-html.js"),g=require("lit/static-html.js");var _=(e=``,t={})=>(0,p.compileWithOptions)(e,u.default,t),v=(e,t,n={})=>{let r=typeof e==`string`?(0,h.unsafeHTML)(e):e;return new Proxy(r,{get(e,r,i){if(r===`value`||r===`raw`)return t;if(r===`toString`||r===Symbol.toPrimitive)return()=>t;if(r!==Symbol.iterator)return r===`__update`?()=>{}:r===`isJSX`?!0:r in n?n[r]:Reflect.get(e,r,i)}})},y=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`),b=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),x={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,keyPath:n,dictionaryKey:r,...i})=>{if(process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled){let e=String(t??``);return v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(n??[]))}" dictionary-key="${y(String(r??``))}">${b(e)}</intlayer-content-selector-wrapper>`,e)}return c.renderIntlayerNode({...i,value:t,children:t})}},S=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?d.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:m.INSERTION}],i=e[m.INSERTION],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,d.isInterpolableWrapperNode)(e),transform:(e,n,r)=>{if((0,d.isInterpolableWrapperNode)(e))return i=>(0,d.transformInterpolableNode)(e,i,n,t.plugins,r);let i=r(e,{...n,children:e,plugins:(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)});return e=>{let a=(0,d.splitInsertionTemplate)(i,e),o=a.isSimple?a.parts:a.parts.join(``);return r(o,{...n,plugins:t.plugins,children:o})}}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return typeof i==`object`&&i&&`nodeType`in i&&[m.ENUMERATION,m.CONDITION].includes(i.nodeType)?e=>t=>{let n=o(t);return typeof n==`function`?n(e):n}:o}},C=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,{keyPath:a,dictionaryKey:o}=i,s=n((0,p.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>c.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),l=_(e),u=t=>{let n=_(e,{components:t});return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(a??[]))}" dictionary-key="${y(String(o??``))}">${n}</intlayer-content-selector-wrapper>`,e):v(n,e)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(a??[]))}" dictionary-key="${y(String(o??``))}">${l}</intlayer-content-selector-wrapper>`,e,{metadata:s,use:u}):v(l,e,{metadata:s,use:u})}},w=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?d.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:m.MARKDOWN}],i=e[m.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[C,...t.plugins??[]]})}},T=process.env.INTLAYER_NODE_TYPE_HTML===`false`?d.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===m.HTML,transform:(e,t)=>{let n=e[m.HTML],{keyPath:r,dictionaryKey:i}=t,a=(e={})=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e).map(([e,t])=>[e,e=>t(e)])),a=new Proxy(t,{get(e,t){if(typeof t==`string`&&t in e)return e[t];if(typeof t==`string`&&/^[a-z][a-z0-9]*$/.test(t))return e=>g.html`<${(0,g.unsafeStatic)(t)} ...${e}>${e.children}</${(0,g.unsafeStatic)(t)}>`}}),o=(0,d.getHTML)(n,a);return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(r??[]))}" dictionary-key="${y(String(i??``))}">${o}</intlayer-content-selector-wrapper>`,n):v(o,n)};return process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?v(`<intlayer-content-selector-wrapper key-path="${y(JSON.stringify(r??[]))}" dictionary-key="${y(String(i??``))}">${n}</intlayer-content-selector-wrapper>`,n,{use:a}):v(n,n,{use:a})}},E=new Map,D=(e,t=!0)=>{let n=e??(typeof window<`u`&&l.r()?.locale)??f.internationalization.defaultLocale,r=`${n}_${t}`;if(E.has(r))return E.get(r);let i=[(0,d.translationPlugin)(e??f.internationalization.defaultLocale,t?f.internationalization.defaultLocale:void 0),d.enumerationPlugin,(0,d.pluralPlugin)(n),d.conditionPlugin,(0,d.nestedPlugin)(n),d.filePlugin,d.genderPlugin,d.selectPlugin,x,S,w,T];return E.set(r,i),i};exports.getPlugins=D,exports.htmlPlugin=T,exports.insertionPlugin=S,exports.intlayerNodePlugins=x,exports.markdownPlugin=w,exports.markdownStringPlugin=C;
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  //#region src/client/IntlayerBinding.ts
3
3
  var t = class {
4
4
  host;
@@ -1,4 +1,4 @@
1
- import { i as e, n as t, r as n, t as r } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { i as e, n as t, r as n, t as r } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { IntlayerBinding as i } from "./IntlayerBinding.mjs";
3
3
  import { useDictionary as a } from "./useDictionary.mjs";
4
4
  import { useDictionaryDynamic as o } from "./useDictionaryDynamic.mjs";
@@ -1,2 +1,2 @@
1
- import { i as e, n as t, r as n, t as r } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { i as e, n as t, r as n, t as r } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  export { r as IntlayerClient, t as createIntlayerClient, n as getIntlayerClient, e as installIntlayer };
@@ -1,14 +1,17 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { getDictionary as t } from "../getDictionary.mjs";
3
3
  import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
4
4
  import { internationalization as r } from "@intlayer/config/built";
5
+ import { resolveDictionaryArgument as i } from "@intlayer/core/dictionaryManipulator";
5
6
  //#region src/client/useDictionary.ts
6
- var i = (i, a) => {
7
- let o = e(), s = process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && typeof a == "object" && !!a, c = s ? a.locale : a, l = (e) => s ? t(i, {
8
- ...a,
9
- locale: e
10
- }) : t(i, e), u = l(c ?? o.locale ?? r.defaultLocale);
11
- o.subscribe((e) => {
7
+ var a = (a, o) => {
8
+ let s = e(), c = process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && typeof o == "object" && o ? o.locale : o, l = (e) => process.env.INTLAYER_DICTIONARY_SELECTOR === "false" ? t(a, e) : t(a, i({
9
+ localeOrSelector: o,
10
+ contextLocale: e,
11
+ contextVariant: s.variant,
12
+ dictionaryKey: a.key
13
+ })), u = l(c ?? s.locale ?? r.defaultLocale);
14
+ s.subscribe((e) => {
12
15
  u = l(c ?? e);
13
16
  });
14
17
  let d, f = new Proxy({}, { get(e, t) {
@@ -20,4 +23,4 @@ var i = (i, a) => {
20
23
  return d = (e) => (new n(e), f), f;
21
24
  };
22
25
  //#endregion
23
- export { i as useDictionary };
26
+ export { a as useDictionary };
@@ -1,62 +1,67 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { getDictionary as t } from "../getDictionary.mjs";
3
3
  import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
4
4
  import { internationalization as r } from "@intlayer/config/built";
5
- import { isQualifiedDynamicLoaderMap as i, parseDictionarySelector as a, resolveQualifiedDynamicContentAsync as o } from "@intlayer/core/dictionaryManipulator";
5
+ import { isQualifiedDynamicLoaderMap as i, parseDictionarySelector as a, resolveDictionaryArgument as o, resolveQualifiedDynamicContentAsync as s } from "@intlayer/core/dictionaryManipulator";
6
6
  //#region src/client/useDictionaryDynamic.ts
7
- var s = /* @__PURE__ */ new Map(), c = async (e, t) => {
7
+ var c = /* @__PURE__ */ new Map(), l = async (e, t) => {
8
8
  if (!t) return;
9
- if (s.has(e)) return s.get(e);
9
+ if (c.has(e)) return c.get(e);
10
10
  let n = await t();
11
- return s.set(e, n), n;
12
- }, l = new Proxy(() => {}, {
11
+ return c.set(e, n), n;
12
+ }, u = new Proxy(() => {}, {
13
13
  get: (e, t) => {
14
14
  if (t === Symbol.toPrimitive || t === "toString") return () => "";
15
- if (t !== "then" && !(typeof t == "string" && t.startsWith("_$")) && t !== "nodeType" && t !== Symbol.iterator) return l;
15
+ if (t !== "then" && !(typeof t == "string" && t.startsWith("_$")) && t !== "nodeType" && t !== Symbol.iterator) return u;
16
16
  },
17
- apply: () => l,
17
+ apply: () => u,
18
18
  construct: () => ({})
19
- }), u = (s, u, d) => {
20
- let f = e(), p = process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && i(s), { locale: m, selector: h } = process.env.INTLAYER_DICTIONARY_SELECTOR === "false" ? {
21
- locale: d,
19
+ }), d = (c, d, f) => {
20
+ let p = e(), m = process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && i(c), { locale: h, selector: g } = process.env.INTLAYER_DICTIONARY_SELECTOR === "false" ? {
21
+ locale: f,
22
22
  selector: void 0
23
- } : a(d), g = () => m ?? f.locale ?? r.defaultLocale, _, v = /* @__PURE__ */ new Set(), y = () => {
24
- for (let e of v) e();
25
- }, b = (e) => {
26
- if (p) {
27
- o({
28
- loaderMap: s,
29
- key: String(u),
23
+ } : a(o({
24
+ localeOrSelector: f,
25
+ contextLocale: p.locale,
26
+ contextVariant: p.variant,
27
+ dictionaryKey: String(d)
28
+ })), _ = () => h ?? p.locale ?? r.defaultLocale, v, y = /* @__PURE__ */ new Set(), b = () => {
29
+ for (let e of y) e();
30
+ }, x = (e) => {
31
+ if (m) {
32
+ s({
33
+ loaderMap: c,
34
+ key: String(d),
30
35
  locale: e,
31
- selector: h,
36
+ selector: g,
32
37
  transform: (n) => t(n, e)
33
38
  }).then((e) => {
34
- _ = e, y();
39
+ v = e, b();
35
40
  });
36
41
  return;
37
42
  }
38
- let n = `${String(u)}.${e}`, r = s[e];
39
- c(n, r).then((n) => {
40
- n && (_ = t(n, e), y());
43
+ let n = `${String(d)}.${e}`, r = c[e];
44
+ l(n, r).then((n) => {
45
+ n && (v = t(n, e), b());
41
46
  });
42
47
  };
43
- b(g()), f.subscribe((e) => {
44
- b(m ?? e);
48
+ x(_()), p.subscribe((e) => {
49
+ x(h ?? e);
45
50
  });
46
- let x, S = new Proxy({}, { get(e, t) {
47
- if (t === "observe") return x;
51
+ let S, C = new Proxy({}, { get(e, t) {
52
+ if (t === "observe") return S;
48
53
  if (t === Symbol.toPrimitive) return () => void 0;
49
54
  if (t === "toString") return () => "";
50
- if (t !== "then") return _ == null ? l : _[t];
55
+ if (t !== "then") return v == null ? u : v[t];
51
56
  } });
52
- return x = (e) => {
57
+ return S = (e) => {
53
58
  let t = () => e.requestUpdate();
54
- return v.add(t), new n(e, () => {
55
- _ != null && e.requestUpdate();
59
+ return y.add(t), new n(e, () => {
60
+ v != null && e.requestUpdate();
56
61
  }, () => {
57
- v.delete(t);
58
- }), S;
59
- }, S;
62
+ y.delete(t);
63
+ }), C;
64
+ }, C;
60
65
  };
61
66
  //#endregion
62
- export { u as useDictionaryDynamic };
67
+ export { d as useDictionaryDynamic };
@@ -1,20 +1,23 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { getIntlayer as t } from "../getIntlayer.mjs";
3
3
  import { IntlayerBinding as n } from "./IntlayerBinding.mjs";
4
4
  import { internationalization as r } from "@intlayer/config/built";
5
+ import { resolveDictionaryArgument as i } from "@intlayer/core/dictionaryManipulator";
5
6
  //#region src/client/useIntlayer.ts
6
- var i = (i, a) => {
7
- let o = e(), s = process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && typeof a == "object" && !!a, c = s ? a.locale : a, l = (e) => s ? t(i, {
8
- ...a,
9
- locale: e
10
- }) : t(i, e), u, d, f = !1, p = new Proxy({}, { get(e, t) {
7
+ var a = (a, o) => {
8
+ let s = e(), c = process.env.INTLAYER_DICTIONARY_SELECTOR !== "false" && typeof o == "object" && o ? o.locale : o, l = (e) => process.env.INTLAYER_DICTIONARY_SELECTOR === "false" ? t(a, e) : t(a, i({
9
+ localeOrSelector: o,
10
+ contextLocale: e,
11
+ contextVariant: s.variant,
12
+ dictionaryKey: a
13
+ })), u, d, f = !1, p = new Proxy({}, { get(e, t) {
11
14
  if (t === "observe") return (e) => (new n(e), p);
12
15
  if (t === Symbol.toPrimitive || t === "toString") return () => "";
13
16
  if (t === "then" || typeof t == "symbol" || typeof t == "string" && t.startsWith("_$")) return;
14
- let i = c ?? o.locale ?? r.defaultLocale;
17
+ let i = c ?? s.locale ?? r.defaultLocale;
15
18
  if ((!f || u !== i) && (d = l(i), u = i, f = !0), d != null) return d[t];
16
19
  } });
17
20
  return p;
18
21
  };
19
22
  //#endregion
20
- export { i as useIntlayer };
23
+ export { a as useIntlayer };
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { setLocaleInStorage as t } from "./useLocaleStorage.mjs";
3
3
  import { internationalization as n } from "@intlayer/config/built";
4
4
  //#region src/client/useLocale.ts
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { routing as t } from "@intlayer/config/built";
3
3
  import { getRewritePath as n } from "@intlayer/core/localization";
4
4
  //#region src/client/useRewriteURL.ts
@@ -1,2 +1,2 @@
1
- import { a as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { a as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  export { e as useEditor };
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { compact as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useCompact.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { currency as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useCurrency.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { date as t, presets as n } from "@intlayer/core/formatters";
3
3
  //#region src/format/useDate.ts
4
4
  var r = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { bindIntl as t } from "@intlayer/core/utils";
3
3
  //#region src/format/useIntl.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { list as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useList.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { number as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useNumber.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { percentage as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/usePercentage.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { relativeTime as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useRelativeTime.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { r as e } from "../../installIntlayer-DWDo9T68.mjs";
1
+ import { r as e } from "../../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { units as t } from "@intlayer/core/formatters";
3
3
  //#region src/format/useUnit.ts
4
4
  var n = class {
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, r, t as i } from "../installIntlayer-DWDo9T68.mjs";
1
+ import { a as e, i as t, n, r, t as i } from "../installIntlayer-CJ5s-cE7.mjs";
2
2
  import { getPlugins as a, htmlPlugin as o, insertionPlugin as s, intlayerNodePlugins as c, markdownPlugin as l, markdownStringPlugin as u } from "./plugins.mjs";
3
3
  import { getIntlayer as d } from "./getIntlayer.mjs";
4
4
  import { getDictionary as f } from "./getDictionary.mjs";
@@ -1,5 +1,5 @@
1
1
  import { renderIntlayerNode as e } from "./renderIntlayerNode.mjs";
2
- import { r as t } from "../installIntlayer-DWDo9T68.mjs";
2
+ import { r as t } from "../installIntlayer-CJ5s-cE7.mjs";
3
3
  import n from "./markdown/runtime.mjs";
4
4
  import { conditionPlugin as r, enumerationPlugin as i, fallbackPlugin as a, filePlugin as o, genderPlugin as s, getHTML as c, isInterpolableWrapperNode as l, nestedPlugin as u, pluralPlugin as d, selectPlugin as f, splitInsertionTemplate as p, transformInterpolableNode as m, translationPlugin as h } from "@intlayer/core/interpreter";
5
5
  import { editor as g, internationalization as _ } from "@intlayer/config/built";
@@ -46,27 +46,35 @@ function i(e) {
46
46
  //#region src/client/installIntlayer.ts
47
47
  var a = class {
48
48
  _locale;
49
+ _variant;
49
50
  _listeners = /* @__PURE__ */ new Set();
50
51
  isCookieEnabled;
51
- constructor(n, r = !0) {
52
- let { defaultLocale: i } = e ?? {};
53
- t(), this._locale = n ?? i, this.isCookieEnabled = r;
52
+ constructor(n, r = !0, i) {
53
+ let { defaultLocale: a } = e ?? {};
54
+ t(), this._locale = n ?? a, this._variant = i, this.isCookieEnabled = r;
54
55
  }
55
56
  get locale() {
56
57
  return this._locale;
57
58
  }
59
+ get variant() {
60
+ return this._variant;
61
+ }
58
62
  setLocale(e) {
59
63
  this._locale = e;
60
64
  for (let t of this._listeners) t(e);
61
65
  }
66
+ setVariant(e) {
67
+ this._variant = e;
68
+ for (let e of this._listeners) e(this._locale);
69
+ }
62
70
  subscribe(e) {
63
71
  return this._listeners.add(e), () => {
64
72
  this._listeners.delete(e);
65
73
  };
66
74
  }
67
- }, o = null, s = (e, t = !0) => o || (o = new a(e, t), o), c = () => (o ||= new a(), o), l = ({ locale: e, isCookieEnabled: t } = {}) => {
68
- let n = s(e, t);
69
- return i(), n;
75
+ }, o = null, s = (e, t = !0, n) => o || (o = new a(e, t, n), o), c = () => (o ||= new a(), o), l = ({ locale: e, isCookieEnabled: t, variant: n } = {}) => {
76
+ let r = s(e, t, n);
77
+ return i(), r;
70
78
  };
71
79
  //#endregion
72
80
  export { i as a, l as i, s as n, c as r, a as t };
@@ -0,0 +1 @@
1
+ let e=require("@intlayer/config/built"),t=require("@intlayer/config/client"),n=require("@intlayer/editor/isEnabled");var r=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,!(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{if(this._stopped)return;let t=e(),n=c();t.currentLocale.set(n.locale),this._unsubscribeLocale=n.subscribe(e=>{t.currentLocale.set(e)})})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}};function i(e){if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)return e?void 0:()=>{};if(!e){let e=!1,t=null;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{if(e)return;let r=n(),i=c();r.currentLocale.set(i.locale),t=i.subscribe(e=>{r.currentLocale.set(e)})}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}}new r(e)}var a=class{_locale;_variant;_listeners=new Set;isCookieEnabled;constructor(n,r=!0,i){let{defaultLocale:a}=e.internationalization??{};(0,t.setIntlayerIdentifier)(),this._locale=n??a,this._variant=i,this.isCookieEnabled=r}get locale(){return this._locale}get variant(){return this._variant}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}setVariant(e){this._variant=e;for(let e of this._listeners)e(this._locale)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},o=null,s=(e,t=!0,n)=>o||(o=new a(e,t,n),o),c=()=>(o||=new a,o),l=({locale:e,isCookieEnabled:t,variant:n}={})=>{let r=s(e,t,n);return i(),r};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -1,18 +1,25 @@
1
- import { LocalesValues } from '@intlayer/types/module_augmentation';
1
+ import { LocalesValues, ProviderVariant } from '@intlayer/types/module_augmentation';
2
2
  type LocaleListener = (locale: LocalesValues) => void;
3
3
  export declare class IntlayerClient {
4
4
  private _locale;
5
+ private _variant;
5
6
  private _listeners;
6
7
  isCookieEnabled: boolean;
7
- constructor(locale?: LocalesValues, isCookieEnabled?: boolean);
8
+ constructor(locale?: LocalesValues, isCookieEnabled?: boolean, variant?: ProviderVariant);
8
9
  get locale(): LocalesValues;
10
+ /**
11
+ * Ambient variant applied to every dictionary read, the same way `locale` is.
12
+ * Overridden per call by an explicit selector.
13
+ */
14
+ get variant(): ProviderVariant | undefined;
9
15
  setLocale(newLocale: LocalesValues): void;
16
+ setVariant(newVariant: ProviderVariant | undefined): void;
10
17
  subscribe(listener: LocaleListener): () => void;
11
18
  }
12
19
  /**
13
20
  * Create and return a single IntlayerClient instance.
14
21
  */
15
- export declare const createIntlayerClient: (locale?: LocalesValues, isCookieEnabled?: boolean) => IntlayerClient;
22
+ export declare const createIntlayerClient: (locale?: LocalesValues, isCookieEnabled?: boolean, variant?: ProviderVariant) => IntlayerClient;
16
23
  /**
17
24
  * Get the current IntlayerClient instance, creating one with defaults if needed.
18
25
  */
@@ -28,6 +35,13 @@ export declare const getIntlayerClient: () => IntlayerClient;
28
35
  *
29
36
  * @param locale - Initial locale (defaults to config defaultLocale).
30
37
  * @param isCookieEnabled - Whether to persist locale in cookies/localStorage.
38
+ * @param variant - Ambient variant applied to every dictionary read — for a
39
+ * dimension fixed for the whole session (tenant, school type, plan tier…)
40
+ * that no call site should have to pass by hand. Accepts a name
41
+ * (`'school1'`), an ordered preference chain (`['school1', 'default']`), or a
42
+ * per-key map (`{ key1: 'school1', default: 'base' }`). A plain object is
43
+ * always the per-key map; nest a structured variant as
44
+ * `{ default: { id: 'prod_abc' } }`. A call-site selector always wins.
31
45
  * @param config - Optional Intlayer configuration. When provided, sets
32
46
  * `window.INTLAYER_CONFIG` with the browser-safe subset of the config so
33
47
  * the application works without a Vite/webpack plugin alias.
@@ -46,9 +60,10 @@ export declare const getIntlayerClient: () => IntlayerClient;
46
60
  * installIntlayer('en');
47
61
  * ```
48
62
  */
49
- export declare const installIntlayer: ({ locale, isCookieEnabled, }?: {
63
+ export declare const installIntlayer: ({ locale, isCookieEnabled, variant, }?: {
50
64
  locale?: LocalesValues;
51
65
  isCookieEnabled?: boolean;
66
+ variant?: ProviderVariant;
52
67
  }) => IntlayerClient;
53
68
  export {};
54
69
  //# sourceMappingURL=installIntlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/installIntlayer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGzE,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;AAEtD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,UAAU,CAAkC;IACpD,eAAe,EAAE,OAAO,CAAC;gBAEb,MAAM,CAAC,EAAE,aAAa,EAAE,eAAe,UAAO;IAU1D,IAAI,MAAM,IAAI,aAAa,CAE1B;IAED,SAAS,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAOzC,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;CAMhD;AAOD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,aAAa,EACtB,yBAAsB,KACrB,cAIF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,cAKpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe,GAAI,+BAG7B;IACD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,cAMR,CAAC"}
1
+ {"version":3,"file":"installIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/installIntlayer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;AAEtD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,UAAU,CAAkC;IACpD,eAAe,EAAE,OAAO,CAAC;gBAGvB,MAAM,CAAC,EAAE,aAAa,EACtB,eAAe,UAAO,EACtB,OAAO,CAAC,EAAE,eAAe;IAY3B,IAAI,MAAM,IAAI,aAAa,CAE1B;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,eAAe,GAAG,SAAS,CAEzC;IAED,SAAS,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAOzC,UAAU,CAAC,UAAU,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI;IAOzD,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;CAMhD;AAOD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,aAAa,EACtB,yBAAsB,EACtB,UAAU,eAAe,KACxB,cAIF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAO,cAKpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,eAAe,GAAI,wCAI7B;IACD,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,eAAe,CAAC;CACtB,KAAG,cAMR,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAEV,0BAA0B,EAC1B,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EAEtB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG3E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,CAAC,CAAC,SAAS,UAAU,GAAG,wBAAwB,EACrD,KAAK,CAAC,CAAC,SACH,eAAe,GACf,0BAA0B,CAAC,CAAC,CAAC,GAAG,eAAe,EAEnD,YAAY,CAAC,EACb,mBAAmB,CAAC,KACnB,gBAAgB,CACjB,oBAAoB,CAClB,iCAAiC,CAAC,CAAC,EAAE,CAAC,CAAC,EACvC,qBAAqB,CAAC,CAAC,CAAC,CACzB,CA4DF,CAAC"}
1
+ {"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EAEV,0BAA0B,EAC1B,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EAEtB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG3E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,CAAC,CAAC,SAAS,UAAU,GAAG,wBAAwB,EACrD,KAAK,CAAC,CAAC,SACH,eAAe,GACf,0BAA0B,CAAC,CAAC,CAAC,GAAG,eAAe,EAEnD,YAAY,CAAC,EACb,mBAAmB,CAAC,KACnB,gBAAgB,CACjB,oBAAoB,CAClB,iCAAiC,CAAC,CAAC,EAAE,CAAC,CAAC,EACvC,qBAAqB,CAAC,CAAC,CAAC,CACzB,CAmEF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDictionaryDynamic.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryDynamic.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,UAAU,EAEX,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,wBAAwB,EAExB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAkD3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,CAAC,CAAC,SAAS,UAAU,EAC1B,KAAK,CAAC,CAAC,SAAS,cAAc,EAC9B,KAAK,CAAC,CAAC,SACH,eAAe,GACf,wBAAwB,CAAC,CAAC,CAAC,GAAG,eAAe,EAEjD,mBACI,mBAAmB,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,GACrC,yBAAyB,EAC7B,KAAK,CAAC,EACN,mBAAmB,CAAC,KACnB,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CA+GrD,CAAC"}
1
+ {"version":3,"file":"useDictionaryDynamic.d.ts","sourceRoot":"","sources":["../../../src/client/useDictionaryDynamic.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,yBAAyB,EAG/B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,wBAAwB,EAExB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAkD3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,oBAAoB,GAC/B,KAAK,CAAC,CAAC,SAAS,UAAU,EAC1B,KAAK,CAAC,CAAC,SAAS,cAAc,EAC9B,KAAK,CAAC,CAAC,SACH,eAAe,GACf,wBAAwB,CAAC,CAAC,CAAC,GAAG,eAAe,EAEjD,mBACI,mBAAmB,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,GACrC,yBAAyB,EAC7B,KAAK,CAAC,EACN,mBAAmB,CAAC,KACnB,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAwHrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EAEtB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG3E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,CAAC,CAAC,SAAS,cAAc,EAC9B,KAAK,CAAC,CAAC,SACH,eAAe,GACf,wBAAwB,CAAC,CAAC,CAAC,GAAG,eAAe,EAEjD,KAAK,CAAC,EACN,mBAAmB,CAAC,KACnB,gBAAgB,CACjB,oBAAoB,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,CA8D/E,CAAC"}
1
+ {"version":3,"file":"useIntlayer.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EAEtB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG3E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,CAAC,CAAC,SAAS,cAAc,EAC9B,KAAK,CAAC,CAAC,SACH,eAAe,GACf,wBAAwB,CAAC,CAAC,CAAC,GAAG,eAAe,EAEjD,KAAK,CAAC,EACN,mBAAmB,CAAC,KACnB,gBAAgB,CACjB,oBAAoB,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAqE/E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lit-intlayer",
3
- "version": "9.1.1",
3
+ "version": "9.1.2",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Lit applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -103,11 +103,11 @@
103
103
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
104
104
  },
105
105
  "dependencies": {
106
- "@intlayer/api": "9.1.1",
107
- "@intlayer/config": "9.1.1",
108
- "@intlayer/core": "9.1.1",
109
- "@intlayer/editor": "9.1.1",
110
- "@intlayer/types": "9.1.1"
106
+ "@intlayer/api": "9.1.2",
107
+ "@intlayer/config": "9.1.2",
108
+ "@intlayer/core": "9.1.2",
109
+ "@intlayer/editor": "9.1.2",
110
+ "@intlayer/types": "9.1.2"
111
111
  },
112
112
  "devDependencies": {
113
113
  "@types/node": "26.1.2",
@@ -124,7 +124,7 @@
124
124
  "vitest": "4.1.10"
125
125
  },
126
126
  "peerDependencies": {
127
- "intlayer": "9.1.1",
127
+ "intlayer": "9.1.2",
128
128
  "lit": ">=3.0.0"
129
129
  },
130
130
  "peerDependenciesMeta": {
@@ -1 +0,0 @@
1
- let e=require("@intlayer/config/built"),t=require("@intlayer/config/client"),n=require("@intlayer/editor/isEnabled");var r=class{host;_stopped=!1;_unsubscribeLocale=null;constructor(e){this.host=e,e.addController(this)}hostConnected(){this._stopped=!1,!(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)&&import(`@intlayer/editor`).then(({initEditorClient:e})=>{if(this._stopped)return;let t=e(),n=c();t.currentLocale.set(n.locale),this._unsubscribeLocale=n.subscribe(e=>{t.currentLocale.set(e)})})}hostDisconnected(){this._stopped=!0,this._unsubscribeLocale?.(),this._unsubscribeLocale=null,import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}};function i(e){if(process.env.INTLAYER_EDITOR_ENABLED===`false`||!n.isEnabled)return e?void 0:()=>{};if(!e){let e=!1,t=null;return import(`@intlayer/editor`).then(({initEditorClient:n})=>{if(e)return;let r=n(),i=c();r.currentLocale.set(i.locale),t=i.subscribe(e=>{r.currentLocale.set(e)})}),()=>{e=!0,t?.(),import(`@intlayer/editor`).then(({stopEditorClient:e})=>{e()})}}new r(e)}var a=class{_locale;_listeners=new Set;isCookieEnabled;constructor(n,r=!0){let{defaultLocale:i}=e.internationalization??{};(0,t.setIntlayerIdentifier)(),this._locale=n??i,this.isCookieEnabled=r}get locale(){return this._locale}setLocale(e){this._locale=e;for(let t of this._listeners)t(e)}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}},o=null,s=(e,t=!0)=>o||(o=new a(e,t),o),c=()=>(o||=new a,o),l=({locale:e,isCookieEnabled:t}={})=>{let n=s(e,t);return i(),n};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});