generaltranslation 6.2.1 → 6.2.2-alpha.0

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.
@@ -0,0 +1,8 @@
1
+ declare class IntlCache {
2
+ private cache;
3
+ constructor();
4
+ private _generateKey;
5
+ get<K extends keyof typeof Intl>(constructor: K, locales: string | string[], options?: {}): (InstanceType<typeof Intl[K]>);
6
+ }
7
+ export declare const intlCache: IntlCache;
8
+ export {};
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function u(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=u(0),i.throw=u(1),i.return=u(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}"function"==typeof SuppressedError&&SuppressedError;var r="en-US",o=6e4,a=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],i=function(e){try{var t=new Intl.Locale(e),n=t.language,o=t.region,i=t.script;if(e.split("-").length!==(u=1,o&&(u+=1),i&&(u+=1),u))return!1;if(new Intl.DisplayNames([r],{type:"language"}).of(n)===n)return!1;if(o)if(new Intl.DisplayNames([r],{type:"region"}).of(o)===o)return!1;if(i)if(new Intl.DisplayNames([r],{type:"script"}).of(i)===i&&!a.includes(i))return!1;return!0}catch(e){return!1}var u},u=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(t){return e}};function c(){for(var e,t,n,r,o,a,i,c,l,s,f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];try{for(var v=f.flat().map(u),d=0;d<v.length;d++)for(var y=d+1;y<v.length;y++)if(e=v[d],t=v[y],n=void 0,r=void 0,o=void 0,a=void 0,i=void 0,c=void 0,l=void 0,s=void 0,n=new Intl.Locale(e),r=n.language,o=n.region,a=n.script,i=new Intl.Locale(t),c=i.language,l=i.region,s=i.script,r!==c||o&&l&&o!==l||a&&s&&a!==s)return!1;return!0}catch(e){return console.error(e),!1}}function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{var n=e.flat().map((function(e){return new Intl.Locale(e).language}));return n.every((function(e){return e===n[0]}))}catch(e){return console.error(e),!1}}function s(r,a,i,u){return t(this,void 0,void 0,(function(){var t,c,l,s,f,p,v,d;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,c=t.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return t.abort()}),l),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/content"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:a,targetLocale:i,metadata:u}),signal:c})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(f=n.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(p=Error.bind,d=(v="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(p.apply(Error,[void 0,d.apply(v,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function f(r,a,i,u){return t(this,void 0,void 0,(function(){var t,c,l,s,f,p,v,d;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,c=t.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return t.abort()}),l),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/react"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:a,targetLocale:i,metadata:u}),signal:c})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(f=n.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(p=Error.bind,d=(v="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(p.apply(Error,[void 0,d.apply(v,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function p(r,a,i,u){return t(this,void 0,void 0,(function(){var t,c,l,s,f,p,v,d;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,c=t.signal,(l=Math.min((null==u?void 0:u.timeout)||o,o))&&setTimeout((function(){return t.abort()}),l),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/icu"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:a,targetLocale:i,metadata:u}),signal:c})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(f=n.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(p=Error.bind,d=(v="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(p.apply(Error,[void 0,d.apply(v,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function v(e,t){if(void 0===t&&(t={}),!i(e))return y;if(t[e=u(e)])return t[e];var n=new Intl.Locale(e),r=n.region;if(r&&g[r])return g[r];var o=n.maximize(),a=o.region||"";return m[o.language]||g[a]||y}var d="🌍",y=d,m={ca:d,eu:d,ku:d,bo:"🌏",ug:"🌏",gd:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",cy:"🏴󠁧󠁢󠁷󠁬󠁳󠁿",gv:"🇮🇲",grc:"🏺"},g={AF:"🇦🇫",AX:"🇦🇽",AL:"🇦🇱",DZ:"🇩🇿",AS:"🇦🇸",AD:"🇦🇩",AO:"🇦🇴",AI:"🇦🇮",AQ:"🇦🇶",AG:"🇦🇬",AR:"🇦🇷",AM:"🇦🇲",AW:"🇦🇼",AU:"🇦🇺",AT:"🇦🇹",AZ:"🇦🇿",BS:"🇧🇸",BH:"🇧🇭",BD:"🇧🇩",BB:"🇧🇧",BY:"🇧🇾",BE:"🇧🇪",BZ:"🇧🇿",BJ:"🇧🇯",BM:"🇧🇲",BT:"🇧🇹",BO:"🇧🇴",BQ:"🇧🇶",BA:"🇧🇦",BW:"🇧🇼",BV:"🇧🇻",BR:"🇧🇷",IO:"🇮🇴",BN:"🇧🇳",BG:"🇧🇬",BF:"🇧🇫",BI:"🇧🇮",CV:"🇨🇻",KH:"🇰🇭",CM:"🇨🇲",CA:"🇨🇦",KY:"🇰🇾",CF:"🇨🇫",TD:"🇹🇩",CL:"🇨🇱",CN:"🇨🇳",CX:"🇨🇽",CC:"🇨🇨",CO:"🇨🇴",KM:"🇰🇲",CD:"🇨🇩",CG:"🇨🇬",CK:"🇨🇰",CR:"🇨🇷",CI:"🇨🇮",HR:"🇭🇷",CU:"🇨🇺",CW:"🇨🇼",CY:"🇨🇾",CZ:"🇨🇿",DK:"🇩🇰",DJ:"🇩🇯",DM:"🇩🇲",DO:"🇩🇴",EC:"🇪🇨",EG:"🇪🇬",SV:"🇸🇻",GQ:"🇬🇶",ER:"🇪🇷",EE:"🇪🇪",SZ:"🇸🇿",ET:"🇪🇹",FK:"🇫🇰",FO:"🇫🇴",FJ:"🇫🇯",FI:"🇫🇮",FR:"🇫🇷",GF:"🇬🇫",PF:"🇵🇫",TF:"🇹🇫",GA:"🇬🇦",GM:"🇬🇲",GE:"🇬🇪",DE:"🇩🇪",GH:"🇬🇭",GI:"🇬🇮",GR:"🇬🇷",GL:"🇬🇱",GD:"🇬🇩",GP:"🇬🇵",GU:"🇬🇺",GT:"🇬🇹",GG:"🇬🇬",GN:"🇬🇳",GW:"🇬🇼",GY:"🇬🇾",HT:"🇭🇹",HM:"🇭🇲",VA:"🇻🇦",HN:"🇭🇳",HK:"🇭🇰",HU:"🇭🇺",IS:"🇮🇸",IN:"🇮🇳",ID:"🇮🇩",IR:"🇮🇷",IQ:"🇮🇶",IE:"🇮🇪",IM:"🇮🇲",IL:"🇮🇱",IT:"🇮🇹",JM:"🇯🇲",JP:"🇯🇵",JE:"🇯🇪",JO:"🇯🇴",KZ:"🇰🇿",KE:"🇰🇪",KI:"🇰🇮",KP:"🇰🇵",KR:"🇰🇷",KW:"🇰🇼",KG:"🇰🇬",LA:"🇱🇦",LV:"🇱🇻",LB:"🇱🇧",LS:"🇱🇸",LR:"🇱🇷",LY:"🇱🇾",LI:"🇱🇮",LT:"🇱🇹",LU:"🇱🇺",MO:"🇲🇴",MG:"🇲🇬",MW:"🇲🇼",MY:"🇲🇾",MV:"🇲🇻",ML:"🇲🇱",MT:"🇲🇹",MH:"🇲🇭",MQ:"🇲🇶",MR:"🇲🇷",MU:"🇲🇺",YT:"🇾🇹",MX:"🇲🇽",FM:"🇫🇲",MD:"🇲🇩",MC:"🇲🇨",MN:"🇲🇳",ME:"🇲🇪",MS:"🇲🇸",MA:"🇲🇦",MZ:"🇲🇿",MM:"🇲🇲",NA:"🇳🇦",NR:"🇳🇷",NP:"🇳🇵",NL:"🇳🇱",NC:"🇳🇨",NZ:"🇳🇿",NI:"🇳🇮",NE:"🇳🇪",NG:"🇳🇬",NU:"🇳🇺",NF:"🇳🇫",MK:"🇲🇰",MP:"🇲🇵",NO:"🇳🇴",OM:"🇴🇲",PK:"🇵🇰",PW:"🇵🇼",PS:"🇵🇸",PA:"🇵🇦",PG:"🇵🇬",PY:"🇵🇾",PE:"🇵🇪",PH:"🇵🇭",PN:"🇵🇳",PL:"🇵🇱",PT:"🇵🇹",PR:"🇵🇷",QA:"🇶🇦",RE:"🇷🇪",RO:"🇷🇴",RU:"🇷🇺",RW:"🇷🇼",BL:"🇧🇱",SH:"🇸🇭",KN:"🇰🇳",LC:"🇱🇨",MF:"🇲🇫",PM:"🇵🇲",VC:"🇻🇨",WS:"🇼🇸",SM:"🇸🇲",ST:"🇸🇹",SA:"🇸🇦",SN:"🇸🇳",RS:"🇷🇸",SC:"🇸🇨",SL:"🇸🇱",SG:"🇸🇬",SX:"🇸🇽",SK:"🇸🇰",SI:"🇸🇮",SB:"🇸🇧",SO:"🇸🇴",ZA:"🇿🇦",GS:"🇬🇸",SS:"🇸🇸",ES:"🇪🇸",LK:"🇱🇰",SD:"🇸🇩",SR:"🇸🇷",SJ:"🇸🇯",SE:"🇸🇪",CH:"🇨🇭",SY:"🇸🇾",TW:"🇹🇼",TJ:"🇹🇯",TZ:"🇹🇿",TH:"🇹🇭",TL:"🇹🇱",TG:"🇹🇬",TK:"🇹🇰",TO:"🇹🇴",TT:"🇹🇹",TN:"🇹🇳",TR:"🇹🇷",TM:"🇹🇲",TC:"🇹🇨",TV:"🇹🇻",UG:"🇺🇬",UA:"🇺🇦",AE:"🇦🇪",GB:"🇬🇧",US:"🇺🇸",UM:"🇺🇲",UY:"🇺🇾",UZ:"🇺🇿",VU:"🇻🇺",VE:"🇻🇪",VN:"🇻🇳",VG:"🇻🇬",VI:"🇻🇮",WF:"🇼🇫",EH:"🇪🇭",YE:"🇾🇪",ZM:"🇿🇲",ZW:"🇿🇼",EU:"🇪🇺"};function h(e,t){void 0===t&&(t=r);try{e=u(e);var n=new Intl.Locale(e),o=n.language,a=n.region,i=new Intl.Locale(e).maximize(),c=i.toString(),l=i.region||"",s=i.script||"",f=new Intl.Locale(e).minimize().toString(),p=new Intl.DisplayNames([t,e,r],{type:"language"}),d=new Intl.DisplayNames([e,t,r],{type:"language"}),y=p.of(e)||e,m=d.of(e)||e,g=p.of(c)||e,h=d.of(c)||e,b=p.of(f)||e,w=d.of(f)||e,N=p.of(o)||e,C=d.of(o)||e,S=a?"".concat(N," (").concat(a,")"):N,T=a?"".concat(C," (").concat(a,")"):C,I=new Intl.DisplayNames([t,e,r],{type:"region"}),L=new Intl.DisplayNames([e,t,r],{type:"region"}),A=I.of(l)||"",x=L.of(l)||"",M=new Intl.DisplayNames([t,e,r],{type:"script"}),E=new Intl.DisplayNames([e,t,r],{type:"script"});return{code:e,name:y,nativeName:m,maximizedCode:c,maximizedName:g,nativeMaximizedName:h,minimizedCode:f,minimizedName:b,nativeMinimizedName:w,languageCode:o,languageName:N,nativeLanguageName:C,nameWithRegionCode:S,nativeNameWithRegionCode:T,regionCode:l,regionName:A,nativeRegionName:x,scriptCode:s,scriptName:M.of(s)||"",nativeScriptName:E.of(s)||"",emoji:v(e)}}catch(t){var K=e||"",G=null==K?void 0:K.split("-");return{code:K,name:K,nativeName:K,maximizedCode:K,maximizedName:K,nativeMaximizedName:K,minimizedCode:K,minimizedName:K,nativeMinimizedName:K,languageCode:o=(null==G?void 0:G[0])||K||"",languageName:o,nativeLanguageName:o,regionCode:l=G.length>2?null==G?void 0:G[2]:(null==G?void 0:G[1])||"",regionName:l,nativeRegionName:l,scriptCode:s=(null==G?void 0:G[3])||"",scriptName:s,nativeScriptName:s,nameWithRegionCode:S=o?l?"".concat(o," (").concat(l,")"):o:"",nativeNameWithRegionCode:K,emoji:v(K)}}}function b(t,n){"string"==typeof t&&(t=[t]),t=t.filter(i),n=n.filter(i);for(var r=function(t){var r=n.filter((function(e){return l(t,e)})),o=function(e){for(var t=e.locale,n=e.languageCode,o=e.minimizedCode,a=e.regionCode,i=e.scriptCode,u=0,c=[t,"".concat(n,"-").concat(a),"".concat(n,"-").concat(i),o];u<c.length;u++){var l=c[u];if(r.includes(l))return l}return null},a=h(t),i=a.languageCode,u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(a,["languageCode"]),c=o(e({locale:t,languageCode:i},u))||o(e({locale:i},h(i)));if(c)return{value:c}},o=0,a=t;o<a.length;o++){var u=r(a[o]);if("object"==typeof u)return u.value}}function w(t){var n=t.value,o=t.locales,a=void 0===o?[r]:o,i=t.options,u=void 0===i?{}:i;return new Intl.NumberFormat(a,e({numberingSystem:"latn"},u)).format(n)}function N(t){var n=t.value,o=t.locales,a=void 0===o?[r]:o,i=t.options,u=void 0===i?{}:i;return new Intl.DateTimeFormat(a,e({calendar:"gregory",numberingSystem:"latn"},u)).format(n)}function C(t){var n=t.value,o=t.locales,a=void 0===o?[r]:o,i=t.currency,u=void 0===i?"USD":i,c=t.options,l=void 0===c?{}:c;return new Intl.NumberFormat(a,e({style:"currency",currency:u,numberingSystem:"latn"},l)).format(n)}function S(t){var n=t.value,o=t.locales,a=void 0===o?[r]:o,i=t.options,u=void 0===i?{}:i;return new Intl.ListFormat(a,e({type:"conjunction",style:"long"},u)).format(n)}var T={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function I(t){if("string"!=typeof t)throw new Error("splitStringToContent: ".concat(t," is not a string!"));for(var n,r=[],o=/{([^}]+)}/g,a=0;null!==(n=o.exec(t));){var i=n[0],u=n[1],c=n.index;if("^"!==t[c-1]){c>a&&r.push(t.slice(a,c));var l=u.split(",").map((function(e){return e.trim()})),s=l[0],f=l[1]?T[l[1]]:void 0,p=e({key:s},f&&{variable:f});r.push(p),a=c+i.length}else c-1>a&&r.push(t.slice(a,c-1)),r.push(i),a=c+i.length}return a<t.length&&r.push(t.slice(a)),r}var L=function(e){return"undefined"!=typeof process&&process.env&&process.env[e]||""},A=function(){function r(e){var t=void 0===e?{}:e,n=t.apiKey,r=void 0===n?"":n,o=t.devApiKey,a=void 0===o?"":o,i=t.sourceLocale,c=void 0===i?"":i,l=t.projectId,s=void 0===l?"":l,f=t.baseUrl,p=void 0===f?"https://api.gtx.dev":f;this.apiKey=r||L("GT_API_KEY"),this.devApiKey=a||L("GT_DEV_API_KEY"),this.projectId=s||L("GT_PROJECT_ID"),this.sourceLocale=u(c)||"",this.baseUrl=p}return r.prototype.translate=function(r,o,a){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,s(this,r,o,e({sourceLocale:this.sourceLocale},a))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateJsx=function(r,o,a){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,f(this,r,o,e({sourceLocale:this.sourceLocale},a))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateIcu=function(r,o,a){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,p(this,r,o,e({sourceLocale:this.sourceLocale},a))];case 1:return[2,t.sent()]}}))}))},r}();exports.default=A,exports.determineLocale=function(e,t){return b(e,t)},exports.formatCurrency=function(e){return C(e)},exports.formatDateTime=function(e){return N(e)},exports.formatList=function(e){return S(e)},exports.formatNum=function(e){return w(e)},exports.formatRelativeTime=function(t){return o=(n=t).value,a=n.unit,i=n.locales,u=void 0===i?[r]:i,c=n.options,l=void 0===c?{}:c,new Intl.RelativeTimeFormat(u,e({style:"long",numeric:"auto"},l)).format(o,a);var n,o,a,i,u,c,l},exports.getLocaleDirection=function(e){return function(e){var t;try{var n=new Intl.Locale(e);return"rtl"===(null===(t=null==n?void 0:n.textInfo)||void 0===t?void 0:t.direction)?"rtl":"ltr"}catch(e){return"ltr"}}(e)},exports.getLocaleEmoji=function(e,t){return v(e,t)},exports.getLocaleName=function(e,t){return void 0===t&&(t=r),function(e,t){void 0===t&&(t=r);try{return new Intl.DisplayNames([t,r],{type:"language"}).of(e)||""}catch(e){return""}}(e,t)},exports.getLocaleProperties=function(e,t){return h(e,t)},exports.isSameDialect=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.apply(void 0,e)},exports.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.apply(void 0,e)},exports.isValidLocale=function(e){return i(e)},exports.renderContentToString=function(t,n,o,a){return function(t,n,o,a){if(void 0===n&&(n=r),void 0===o&&(o={}),void 0===a&&(a={}),"string"==typeof t&&(t=I(t)),"string"==typeof t)return t;if(!Array.isArray(t))throw new Error("renderContentToString: content ".concat(t," is invalid"));return t.map((function(t){var r;if("string"==typeof t)return t;if("object"==typeof t){var i=o[t.key];return t.variable?"number"===t.variable?w({value:i,locales:n,options:a[t.key]}):"currency"===t.variable?C(e(e({value:i,locales:n},a[t.key]&&{options:a[t.key]}),(null===(r=a[t.key])||void 0===r?void 0:r.currency)&&{currency:a[t.key].currency})):"datetime"===t.variable?N(e({value:i,locales:n},a[t.key]&&{options:a[t.key]})):"list"===t.variable?S(e({value:i,locales:n},a[t.key]&&{options:a[t.key]})):i:i}})).join("")}(t,n,o,a)},exports.requiresTranslation=function(e,t,n){return function(e,t,n){return!(!i(e)||!i(t)||n&&n.some((function(e){return!i(e)}))||c(e,t)||n&&!n.some((function(e){return l(t,e)})))}(e,t,n)},exports.splitStringToContent=function(e){return I(e)},exports.standardizeLocale=function(e){return u(e)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function c(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}"function"==typeof SuppressedError&&SuppressedError;var r=new(function(){function e(){this.cache=new Map}return e.prototype._generateKey=function(e,t,n){void 0===n&&(n={});var r=Array.isArray(t)?t.join(","):t,o=n?JSON.stringify(n,Object.keys(n).sort()):"{}";return"".concat(e,":").concat(r,":").concat(o)},e.prototype.get=function(e,t,n){void 0===n&&(n={});var r=this._generateKey(e,t,n);if(!this.cache.has(r)){var o=new Intl[e](t,n);this.cache.set(r,o)}return this.cache.get(r)},e}()),o="en",a=6e4,i=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],c=function(e){try{var t=r.get("Locale",e),n=t.language,a=t.region,c=t.script;if(e.split("-").length!==(u=1,a&&(u+=1),c&&(u+=1),u))return!1;if(r.get("DisplayNames",[o],{type:"language"}).of(n)===n)return!1;if(a)if(r.get("DisplayNames",[o],{type:"region"}).of(a)===a)return!1;if(c)if(r.get("DisplayNames",[o],{type:"script"}).of(c)===c&&!i.includes(c))return!1;return!0}catch(e){return!1}var u},u=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(t){return e}};function l(){for(var e,t,n,o,a,i,c,l,s,f,p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];try{for(var d=p.flat().map(u),g=0;g<d.length;g++)for(var y=g+1;y<d.length;y++)if(e=d[g],t=d[y],n=void 0,o=void 0,a=void 0,i=void 0,c=void 0,l=void 0,s=void 0,f=void 0,n=r.get("Locale",e),o=n.language,a=n.region,i=n.script,c=r.get("Locale",t),l=c.language,s=c.region,f=c.script,o!==l||a&&s&&a!==s||i&&f&&i!==f)return!1;return!0}catch(e){return console.error(e),!1}}function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{var n=e.flat().map((function(e){return r.get("Locale",e).language}));return n.every((function(e){return e===n[0]}))}catch(e){return console.error(e),!1}}function f(r,o,i,c){return t(this,void 0,void 0,(function(){var t,u,l,s,f,p,v,d;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,u=t.signal,(l=Math.min((null==c?void 0:c.timeout)||a,a))&&setTimeout((function(){return t.abort()}),l),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/content"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:o,targetLocale:i,metadata:c}),signal:u})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(f=n.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(p=Error.bind,d=(v="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(p.apply(Error,[void 0,d.apply(v,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function p(r,o,i,c){return t(this,void 0,void 0,(function(){var t,u,l,s,f,p,v,d;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,u=t.signal,(l=Math.min((null==c?void 0:c.timeout)||a,a))&&setTimeout((function(){return t.abort()}),l),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/react"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:o,targetLocale:i,metadata:c}),signal:u})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(f=n.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(p=Error.bind,d=(v="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(p.apply(Error,[void 0,d.apply(v,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function v(r,o,i,c){return t(this,void 0,void 0,(function(){var t,u,l,s,f,p,v,d;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,u=t.signal,(l=Math.min((null==c?void 0:c.timeout)||a,a))&&setTimeout((function(){return t.abort()}),l),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,fetch("".concat(r.baseUrl).concat("/v1/translate/icu"),{method:"POST",headers:e(e({"Content-Type":"application/json"},r.apiKey&&{"x-gt-api-key":r.apiKey}),r.devApiKey&&{"x-gt-dev-api-key":r.devApiKey}),body:JSON.stringify({source:o,targetLocale:i,metadata:c}),signal:u})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(f=n.sent())?void 0:f.name))throw new Error("Translation request timed out. This has either occured due to the translation of an unusually large request or a translation failure in the API.");throw f;case 4:return s.ok?[3,6]:(p=Error.bind,d=(v="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(p.apply(Error,[void 0,d.apply(v,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function d(e,t){if(void 0===t&&(t={}),!c(e))return y;if(t[e=u(e)])return t[e];var n=r.get("Locale",e),o=n.region;if(o&&h[o])return h[o];var a=n.maximize(),i=a.region||"";return m[a.language]||h[i]||y}var g="🌍",y=g,m={ca:g,eu:g,ku:g,bo:"🌏",ug:"🌏",gd:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",cy:"🏴󠁧󠁢󠁷󠁬󠁳󠁿",gv:"🇮🇲",grc:"🏺"},h={AF:"🇦🇫",AX:"🇦🇽",AL:"🇦🇱",DZ:"🇩🇿",AS:"🇦🇸",AD:"🇦🇩",AO:"🇦🇴",AI:"🇦🇮",AQ:"🇦🇶",AG:"🇦🇬",AR:"🇦🇷",AM:"🇦🇲",AW:"🇦🇼",AU:"🇦🇺",AT:"🇦🇹",AZ:"🇦🇿",BS:"🇧🇸",BH:"🇧🇭",BD:"🇧🇩",BB:"🇧🇧",BY:"🇧🇾",BE:"🇧🇪",BZ:"🇧🇿",BJ:"🇧🇯",BM:"🇧🇲",BT:"🇧🇹",BO:"🇧🇴",BQ:"🇧🇶",BA:"🇧🇦",BW:"🇧🇼",BV:"🇧🇻",BR:"🇧🇷",IO:"🇮🇴",BN:"🇧🇳",BG:"🇧🇬",BF:"🇧🇫",BI:"🇧🇮",CV:"🇨🇻",KH:"🇰🇭",CM:"🇨🇲",CA:"🇨🇦",KY:"🇰🇾",CF:"🇨🇫",TD:"🇹🇩",CL:"🇨🇱",CN:"🇨🇳",CX:"🇨🇽",CC:"🇨🇨",CO:"🇨🇴",KM:"🇰🇲",CD:"🇨🇩",CG:"🇨🇬",CK:"🇨🇰",CR:"🇨🇷",CI:"🇨🇮",HR:"🇭🇷",CU:"🇨🇺",CW:"🇨🇼",CY:"🇨🇾",CZ:"🇨🇿",DK:"🇩🇰",DJ:"🇩🇯",DM:"🇩🇲",DO:"🇩🇴",EC:"🇪🇨",EG:"🇪🇬",SV:"🇸🇻",GQ:"🇬🇶",ER:"🇪🇷",EE:"🇪🇪",SZ:"🇸🇿",ET:"🇪🇹",FK:"🇫🇰",FO:"🇫🇴",FJ:"🇫🇯",FI:"🇫🇮",FR:"🇫🇷",GF:"🇬🇫",PF:"🇵🇫",TF:"🇹🇫",GA:"🇬🇦",GM:"🇬🇲",GE:"🇬🇪",DE:"🇩🇪",GH:"🇬🇭",GI:"🇬🇮",GR:"🇬🇷",GL:"🇬🇱",GD:"🇬🇩",GP:"🇬🇵",GU:"🇬🇺",GT:"🇬🇹",GG:"🇬🇬",GN:"🇬🇳",GW:"🇬🇼",GY:"🇬🇾",HT:"🇭🇹",HM:"🇭🇲",VA:"🇻🇦",HN:"🇭🇳",HK:"🇭🇰",HU:"🇭🇺",IS:"🇮🇸",IN:"🇮🇳",ID:"🇮🇩",IR:"🇮🇷",IQ:"🇮🇶",IE:"🇮🇪",IM:"🇮🇲",IL:"🇮🇱",IT:"🇮🇹",JM:"🇯🇲",JP:"🇯🇵",JE:"🇯🇪",JO:"🇯🇴",KZ:"🇰🇿",KE:"🇰🇪",KI:"🇰🇮",KP:"🇰🇵",KR:"🇰🇷",KW:"🇰🇼",KG:"🇰🇬",LA:"🇱🇦",LV:"🇱🇻",LB:"🇱🇧",LS:"🇱🇸",LR:"🇱🇷",LY:"🇱🇾",LI:"🇱🇮",LT:"🇱🇹",LU:"🇱🇺",MO:"🇲🇴",MG:"🇲🇬",MW:"🇲🇼",MY:"🇲🇾",MV:"🇲🇻",ML:"🇲🇱",MT:"🇲🇹",MH:"🇲🇭",MQ:"🇲🇶",MR:"🇲🇷",MU:"🇲🇺",YT:"🇾🇹",MX:"🇲🇽",FM:"🇫🇲",MD:"🇲🇩",MC:"🇲🇨",MN:"🇲🇳",ME:"🇲🇪",MS:"🇲🇸",MA:"🇲🇦",MZ:"🇲🇿",MM:"🇲🇲",NA:"🇳🇦",NR:"🇳🇷",NP:"🇳🇵",NL:"🇳🇱",NC:"🇳🇨",NZ:"🇳🇿",NI:"🇳🇮",NE:"🇳🇪",NG:"🇳🇬",NU:"🇳🇺",NF:"🇳🇫",MK:"🇲🇰",MP:"🇲🇵",NO:"🇳🇴",OM:"🇴🇲",PK:"🇵🇰",PW:"🇵🇼",PS:"🇵🇸",PA:"🇵🇦",PG:"🇵🇬",PY:"🇵🇾",PE:"🇵🇪",PH:"🇵🇭",PN:"🇵🇳",PL:"🇵🇱",PT:"🇵🇹",PR:"🇵🇷",QA:"🇶🇦",RE:"🇷🇪",RO:"🇷🇴",RU:"🇷🇺",RW:"🇷🇼",BL:"🇧🇱",SH:"🇸🇭",KN:"🇰🇳",LC:"🇱🇨",MF:"🇲🇫",PM:"🇵🇲",VC:"🇻🇨",WS:"🇼🇸",SM:"🇸🇲",ST:"🇸🇹",SA:"🇸🇦",SN:"🇸🇳",RS:"🇷🇸",SC:"🇸🇨",SL:"🇸🇱",SG:"🇸🇬",SX:"🇸🇽",SK:"🇸🇰",SI:"🇸🇮",SB:"🇸🇧",SO:"🇸🇴",ZA:"🇿🇦",GS:"🇬🇸",SS:"🇸🇸",ES:"🇪🇸",LK:"🇱🇰",SD:"🇸🇩",SR:"🇸🇷",SJ:"🇸🇯",SE:"🇸🇪",CH:"🇨🇭",SY:"🇸🇾",TW:"🇹🇼",TJ:"🇹🇯",TZ:"🇹🇿",TH:"🇹🇭",TL:"🇹🇱",TG:"🇹🇬",TK:"🇹🇰",TO:"🇹🇴",TT:"🇹🇹",TN:"🇹🇳",TR:"🇹🇷",TM:"🇹🇲",TC:"🇹🇨",TV:"🇹🇻",UG:"🇺🇬",UA:"🇺🇦",AE:"🇦🇪",GB:"🇬🇧",US:"🇺🇸",UM:"🇺🇲",UY:"🇺🇾",UZ:"🇺🇿",VU:"🇻🇺",VE:"🇻🇪",VN:"🇻🇳",VG:"🇻🇬",VI:"🇻🇮",WF:"🇼🇫",EH:"🇪🇭",YE:"🇾🇪",ZM:"🇿🇲",ZW:"🇿🇼",EU:"🇪🇺"};function b(e,t){void 0===t&&(t=o);try{e=u(e);var n=r.get("Locale",e),a=n.language,i=n.region,c=n.maximize(),l=c.toString(),s=c.region||"",f=c.script||"",p=n.minimize().toString(),v=r.get("DisplayNames",[t,e,o],{type:"language"}),g=r.get("DisplayNames",[e,t,o],{type:"language"}),y=v.of(e)||e,m=g.of(e)||e,h=v.of(l)||e,b=g.of(l)||e,N=v.of(p)||e,C=g.of(p)||e,S=v.of(a)||e,T=g.of(a)||e,L=i?"".concat(S," (").concat(i,")"):S,A=i?"".concat(T," (").concat(i,")"):T,M=r.get("DisplayNames",[t,e,o],{type:"region"}),x=r.get("DisplayNames",[e,t,o],{type:"region"}),w=M.of(s)||"",E=x.of(s)||"",K=r.get("DisplayNames",[t,e,o],{type:"script"}),O=r.get("DisplayNames",[e,t,o],{type:"script"});return{code:e,name:y,nativeName:m,maximizedCode:l,maximizedName:h,nativeMaximizedName:b,minimizedCode:p,minimizedName:N,nativeMinimizedName:C,languageCode:a,languageName:S,nativeLanguageName:T,nameWithRegionCode:L,nativeNameWithRegionCode:A,regionCode:s,regionName:w,nativeRegionName:E,scriptCode:f,scriptName:K.of(f)||"",nativeScriptName:O.of(f)||"",emoji:d(e)}}catch(t){var G=e||"",I=null==G?void 0:G.split("-");return{code:G,name:G,nativeName:G,maximizedCode:G,maximizedName:G,nativeMaximizedName:G,minimizedCode:G,minimizedName:G,nativeMinimizedName:G,languageCode:a=(null==I?void 0:I[0])||G||"",languageName:a,nativeLanguageName:a,regionCode:s=I.length>2?null==I?void 0:I[2]:(null==I?void 0:I[1])||"",regionName:s,nativeRegionName:s,scriptCode:f=(null==I?void 0:I[3])||"",scriptName:f,nativeScriptName:f,nameWithRegionCode:L=a?s?"".concat(a," (").concat(s,")"):a:"",nativeNameWithRegionCode:G,emoji:d(G)}}}function N(t,n){"string"==typeof t&&(t=[t]),t=t.filter(c),n=n.filter(c);for(var r=function(t){var r=n.filter((function(e){return s(t,e)})),o=function(e){for(var t=e.locale,n=e.languageCode,o=e.minimizedCode,a=e.regionCode,i=e.scriptCode,c=0,u=[t,"".concat(n,"-").concat(a),"".concat(n,"-").concat(i),o];c<u.length;c++){var l=u[c];if(r.includes(l))return l}return null},a=b(t),i=a.languageCode,c=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(a,["languageCode"]),u=o(e({locale:t,languageCode:i},c))||o(e({locale:i},b(i)));if(u)return{value:u}},o=0,a=t;o<a.length;o++){var i=r(a[o]);if("object"==typeof i)return i.value}}function C(t){var n=t.value,a=t.locales,i=void 0===a?[o]:a,c=t.options,u=void 0===c?{}:c;return r.get("NumberFormat",i,e({numberingSystem:"latn"},u)).format(n)}function S(t){var n=t.value,a=t.locales,i=void 0===a?[o]:a,c=t.options,u=void 0===c?{}:c;return r.get("DateTimeFormat",i,e({calendar:"gregory",numberingSystem:"latn"},u)).format(n)}function T(t){var n=t.value,a=t.locales,i=void 0===a?[o]:a,c=t.currency,u=void 0===c?"USD":c,l=t.options,s=void 0===l?{}:l;return r.get("NumberFormat",i,e({style:"currency",currency:u,numberingSystem:"latn"},s)).format(n)}function L(t){var n=t.value,a=t.locales,i=void 0===a?[o]:a,c=t.options,u=void 0===c?{}:c;return r.get("ListFormat",i,e({type:"conjunction",style:"long"},u)).format(n)}var A={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function M(t){if("string"!=typeof t)throw new Error("splitStringToContent: ".concat(t," is not a string!"));for(var n,r=[],o=/{([^}]+)}/g,a=0;null!==(n=o.exec(t));){var i=n[0],c=n[1],u=n.index;if("^"!==t[u-1]){u>a&&r.push(t.slice(a,u));var l=c.split(",").map((function(e){return e.trim()})),s=l[0],f=l[1]?A[l[1]]:void 0,p=e({key:s},f&&{variable:f});r.push(p),a=u+i.length}else u-1>a&&r.push(t.slice(a,u-1)),r.push(i),a=u+i.length}return a<t.length&&r.push(t.slice(a)),r}var x=function(e){return"undefined"!=typeof process&&process.env&&process.env[e]||""},w=function(){function r(e){var t=void 0===e?{}:e,n=t.apiKey,r=void 0===n?"":n,o=t.devApiKey,a=void 0===o?"":o,i=t.sourceLocale,c=void 0===i?"":i,l=t.projectId,s=void 0===l?"":l,f=t.baseUrl,p=void 0===f?"https://api.gtx.dev":f;this.apiKey=r||x("GT_API_KEY"),this.devApiKey=a||x("GT_DEV_API_KEY"),this.projectId=s||x("GT_PROJECT_ID"),this.sourceLocale=u(c)||"",this.baseUrl=p}return r.prototype.translate=function(r,o,a){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,f(this,r,o,e({sourceLocale:this.sourceLocale},a))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateJsx=function(r,o,a){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,p(this,r,o,e({sourceLocale:this.sourceLocale},a))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateIcu=function(r,o,a){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,v(this,r,o,e({sourceLocale:this.sourceLocale},a))];case 1:return[2,t.sent()]}}))}))},r}();exports.default=w,exports.determineLocale=function(e,t){return N(e,t)},exports.formatCurrency=function(e,t,n){return T({value:e,currency:t,locales:null==n?void 0:n.locales,options:n})},exports.formatDateTime=function(e,t){return S({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatList=function(e,t){return L({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatNum=function(e,t){return C({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatRelativeTime=function(t,n,a){return function(t){var n=t.value,a=t.unit,i=t.locales,c=void 0===i?[o]:i,u=t.options,l=void 0===u?{}:u;return r.get("RelativeTimeFormat",c,e({style:"long",numeric:"auto"},l)).format(n,a)}({value:t,unit:n,locales:null==a?void 0:a.locales,options:a})},exports.getLocaleDirection=function(e){return function(e){var t;try{var n=r.get("Locale",e);return"rtl"===(null===(t=null==n?void 0:n.textInfo)||void 0===t?void 0:t.direction)?"rtl":"ltr"}catch(e){return"ltr"}}(e)},exports.getLocaleEmoji=function(e,t){return d(e,t)},exports.getLocaleName=function(e,t){return void 0===t&&(t=o),function(e,t){void 0===t&&(t=o);try{return r.get("DisplayNames",[t,o],{type:"language"}).of(e)||""}catch(e){return""}}(e,t)},exports.getLocaleProperties=function(e,t){return b(e,t)},exports.isSameDialect=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.apply(void 0,e)},exports.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.apply(void 0,e)},exports.isValidLocale=function(e){return c(e)},exports.renderContentToString=function(t,n,r,a){return function(t,n,r,a){if(void 0===n&&(n=o),void 0===r&&(r={}),void 0===a&&(a={}),"string"==typeof t&&(t=M(t)),"string"==typeof t)return t;if(!Array.isArray(t))throw new Error("renderContentToString: content ".concat(t," is invalid"));return t.map((function(t){var o;if("string"==typeof t)return t;if("object"==typeof t){var i=r[t.key];return t.variable?"number"===t.variable?C({value:i,locales:n,options:a[t.key]}):"currency"===t.variable?T(e(e({value:i,locales:n},a[t.key]&&{options:a[t.key]}),(null===(o=a[t.key])||void 0===o?void 0:o.currency)&&{currency:a[t.key].currency})):"datetime"===t.variable?S(e({value:i,locales:n},a[t.key]&&{options:a[t.key]})):"list"===t.variable?L(e({value:i,locales:n},a[t.key]&&{options:a[t.key]})):i:i}})).join("")}(t,n,r,a)},exports.requiresTranslation=function(e,t,n){return function(e,t,n){return!(!c(e)||!c(t)||n&&n.some((function(e){return!c(e)}))||l(e,t)||n&&!n.some((function(e){return s(t,e)})))}(e,t,n)},exports.splitStringToContent=function(e){return M(e)},exports.standardizeLocale=function(e){return u(e)};
2
2
  //# sourceMappingURL=index.cjs.min.cjs.map