generaltranslation 3.3.3 â 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/id.cjs.min.cjs +2 -0
- package/dist/id.cjs.min.cjs.map +1 -0
- package/dist/id.d.ts +7 -0
- package/dist/id.esm.min.mjs +2 -0
- package/dist/id.esm.min.mjs.map +1 -0
- package/dist/index.cjs.min.cjs +1 -1
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +100 -79
- package/dist/index.esm.min.mjs +1 -1
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/internal.cjs.min.cjs +1 -1
- package/dist/internal.cjs.min.cjs.map +1 -1
- package/dist/internal.d.ts +8 -8
- package/dist/internal.esm.min.mjs +1 -1
- package/dist/internal.esm.min.mjs.map +1 -1
- package/dist/locales/_determineLocale.d.ts +1 -0
- package/dist/locales/_getLocaleDirection.d.ts +1 -0
- package/dist/locales/_getLocaleEmoji.d.ts +1 -0
- package/dist/locales/_getLocaleName.d.ts +1 -0
- package/dist/locales/_getLocaleProperties.d.ts +1 -0
- package/dist/locales/_isSameLanguage.d.ts +1 -0
- package/dist/locales/_isValidLocale.d.ts +1 -0
- package/dist/locales/_requiresTranslation.d.ts +1 -0
- package/dist/projects/_getProjectLocales.d.ts +1 -0
- package/dist/settings/defaultAPIRoutes.d.ts +1 -1
- package/dist/settings/libraryDefaultLanguage.d.ts +1 -1
- package/dist/settings/libraryDefaultLocale.d.ts +2 -0
- package/dist/types/types.d.ts +5 -5
- package/package.json +13 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"id.cjs.min.cjs","sources":["../src/id.ts"],"sourcesContent":["// Functions provided to other GT libraries\n\nimport XXH from 'xxhashjs';\n\n/**\n * Calculates a unique hash for a given string using xxhash.\n * \n * @param {string} string - The string to be hashed.\n * @returns {string} - The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return XXH.h64().update(string).digest().toString(16);\n}\n"],"names":["string","XXH","h64","update","digest","toString"],"mappings":"0DAUM,SAAqBA,GACvB,OAAOC,EAAIC,MAAMC,OAAOH,GAAQI,SAASC,SAAS,GACtD"}
|
package/dist/id.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"id.esm.min.mjs","sources":["../src/id.ts"],"sourcesContent":["// Functions provided to other GT libraries\n\nimport XXH from 'xxhashjs';\n\n/**\n * Calculates a unique hash for a given string using xxhash.\n * \n * @param {string} string - The string to be hashed.\n * @returns {string} - The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return XXH.h64().update(string).digest().toString(16);\n}\n"],"names":["hashString","string","XXH","h64","update","digest","toString"],"mappings":"wBAUM,SAAUA,EAAWC,GACvB,OAAOC,EAAIC,MAAMC,OAAOH,GAAQI,SAASC,SAAS,GACtD"}
|
package/dist/index.cjs.min.cjs
CHANGED
@@ -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 a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(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,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[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]&&(o=0)),o;)try{if(n=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=a=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="/v1/translate/batch",a="/v1/translate/react",o="/v1/translate/content",i="/v1/project/dictionary/update",u="/v1/project/languages";function c(e,a){return t(this,void 0,void 0,(function(){var t,o,i,u,c,s,l,f,p;return n(this,(function(n){switch(n.label){case 0:return t=new AbortController,o=t.signal,(null===(p=null===(f=null===(l=a[0])||void 0===l?void 0:l.data)||void 0===f?void 0:f.metadata)||void 0===p?void 0:p.timeout)&&setTimeout((function(){return t.abort()}),a[0].data.metadata.timeout),[4,fetch("".concat(e.baseURL).concat(r),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify(a),signal:o})];case 1:return(i=n.sent()).ok?[3,3]:(u=Error.bind,s=(c="".concat(i.status,": ")).concat,[4,i.text()]);case 2:throw new(u.apply(Error,[void 0,s.apply(c,[n.sent()])]));case 3:return[4,i.json()];case 4:return[2,n.sent()]}}))}))}var s="en",l=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],f=function(e){try{var t=new Intl.Locale(e),n=t.language,r=t.region,a=t.script;if(new Intl.DisplayNames([s],{type:"language"}).of(n)===n)return!1;if(r)if(new Intl.DisplayNames([s],{type:"region"}).of(r)===r)return!1;if(a)if(new Intl.DisplayNames([s],{type:"script"}).of(a)===a&&!l.includes(a))return!1;return!0}catch(e){return!1}},p=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(e){return""}};function g(){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 d(e,r,a,i){return t(this,void 0,void 0,(function(){var t,u,c,s,l,f;return n(this,(function(n){switch(n.label){case 0:return t=new AbortController,u=t.signal,i.timeout&&setTimeout((function(){return t.abort()}),i.timeout),[4,fetch("".concat(e.baseURL).concat(o),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify({content:r,targetLanguage:a,metadata:i}),signal:u})];case 1:return(c=n.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(c.status,": ")).concat,[4,c.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[n.sent()])]));case 3:return[4,c.json()];case 4:return[2,n.sent()]}}))}))}function v(e,r,o,i){return t(this,void 0,void 0,(function(){var t,u,c,s,l,f;return n(this,(function(n){switch(n.label){case 0:return t=new AbortController,u=t.signal,i.timeout&&setTimeout((function(){return t.abort()}),i.timeout),[4,fetch("".concat(e.baseURL).concat(a),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify({children:r,targetLanguage:o,metadata:i}),signal:u})];case 1:return(c=n.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(c.status,": ")).concat,[4,c.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[n.sent()])]));case 3:return[4,c.json()];case 4:return[2,n.sent()]}}))}))}function m(e,r,a,o){return t(this,void 0,void 0,(function(){var t,u,c,s,l;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat(e.baseURL).concat(i),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify({updates:r,languages:a,options:o})})];case 1:return(t=n.sent()).ok?[3,3]:(u=Error.bind,s=(c="".concat(t.status,": ")).concat,[4,t.text()]);case 2:throw new(u.apply(Error,[void 0,s.apply(c,[n.sent()])]));case 3:return[4,t.json()];case 4:return[2,null==(l=n.sent())?void 0:l.languages]}}))}))}function y(e,r){return t(this,void 0,void 0,(function(){var t,a,o,i,c;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat(e.baseURL).concat(u,"?projectID=").concat(r),{method:"GET",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey}})];case 1:return(t=n.sent()).ok?[3,3]:(a=Error.bind,i=(o="".concat(t.status,": ")).concat,[4,t.text()]);case 2:throw new(a.apply(Error,[void 0,i.apply(o,[n.sent()])]));case 3:return[4,t.json()];case 4:return[2,null==(c=n.sent())?void 0:c.languages]}}))}))}function h(t){var n=t.value,r=t.languages,a=void 0===r?[s]:r,o=t.options,i=void 0===o?{}:o;return new Intl.NumberFormat(a,e({numberingSystem:"latn"},i)).format(n)}function b(t){var n=t.value,r=t.languages,a=void 0===r?[s]:r,o=t.options,i=void 0===o?{}:o;return new Intl.DateTimeFormat(a,e({calendar:"gregory",numberingSystem:"latn"},i)).format(n)}function N(t){var n=t.value,r=t.languages,a=void 0===r?[s]:r,o=t.currency,i=void 0===o?"USD":o,u=t.options,c=void 0===u?{}:u;return new Intl.NumberFormat(a,e({style:"currency",currency:i,numberingSystem:"latn"},c)).format(n)}function w(t){var n=t.value,r=t.languages,a=void 0===r?[s]:r,o=t.options,i=void 0===o?{}:o;return new Intl.ListFormat(a,e({type:"conjunction",style:"long"},i)).format(n)}var L={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function C(t){if("string"!=typeof t)throw new Error("splitStringToContent: ".concat(t," is not a string!"));for(var n,r=[],a=/{([^}]+)}/g,o=0;null!==(n=a.exec(t));){var i=n[0],u=n[1],c=n.index;if("^"!==t[c-1]){c>o&&r.push(t.slice(o,c));var s=u.split(",").map((function(e){return e.trim()})),l=s[0],f=s[1]?L[s[1]]:void 0,p=e({key:l},f&&{variable:f});r.push(p),o=c+i.length}else c-1>o&&r.push(t.slice(o,c-1)),r.push(i),o=c+i.length}return o<t.length&&r.push(t.slice(o)),r}function S(e,t){if(void 0===t&&(t={}),!f(e))return I;var n=new Intl.Locale(e);if(t[e=n.toString()])return t[e];var r=n.region;if(r&&M[r])return M[r];var a=n.maximize(),o=a.region||"";return x[a.language]||M[o]||I}var T="đ",I=T,x={ca:T,eu:T,ku:T,bo:"đ",ug:"đ",gd:"đ´ó §ó ˘ó łó Łó ´ó ż",cy:"đ´ó §ó ˘ó ˇó Źó łó ż",gv:"đŽđ˛",grc:"đş"},M={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:"đŞđş"};var E=function(e){return"undefined"!=typeof process&&process.env&&process.env[e]||""},R=function(){function r(e){var t=void 0===e?{}:e,n=t.apiKey,r=void 0===n?"":n,a=t.defaultLanguage,o=void 0===a?s:a,i=t.projectID,u=void 0===i?"":i,c=t.baseURL,l=void 0===c?"https://prod.gtx.dev":c;this.apiKey=r||E("GT_API_KEY"),this.projectID=u||E("GT_PROJECT_ID"),this.defaultLanguage=o.toLowerCase(),this.baseURL=l}return r.prototype.translate=function(r,a,o){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,d(this,r,a,e({defaultLanguage:this.defaultLanguage},o))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateReact=function(r,a,o){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,v(this,r,a,e({defaultLanguage:this.defaultLanguage},o))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateBatch=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,c(this,e)]}))}))},r.prototype.updateProjectDictionary=function(e){return t(this,arguments,void 0,(function(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r={}),n(this,(function(n){return[2,m(this,e,t,r)]}))}))},r.prototype.getProjectLanguages=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,y(this,e||this.projectID)]}))}))},r}();exports.default=R,exports.determineLanguage=function(e,t){return function(e,t){if("string"==typeof e&&(e=[e]),!t)return e[0];for(var n=function(e){var n=t.find((function(t){return t===e}));if(n)return{value:n};var r=t.find((function(t){return g(t,e)}));return r?{value:r}:void 0},r=0,a=e;r<a.length;r++){var o=n(a[r]);if("object"==typeof o)return o.value}}(e,t)},exports.formatCurrency=function(e){return N(e)},exports.formatDateTime=function(e){return b(e)},exports.formatList=function(e){return w(e)},exports.formatNum=function(e){return h(e)},exports.formatRelativeTime=function(t){return r=(n=t).value,a=n.unit,o=n.languages,i=void 0===o?[s]:o,u=n.options,c=void 0===u?{}:u,new Intl.RelativeTimeFormat(i,e({style:"long",numeric:"auto"},c)).format(r,a);var n,r,a,o,i,u,c},exports.getLanguageDirection=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.getLanguageEmoji=function(e,t){return S(e,t)},exports.getLanguageName=function(e,t){return void 0===t&&(t=s),function(e,t){void 0===t&&(t=s);try{return new Intl.DisplayNames([t,s],{type:"language"}).of(e)||""}catch(e){return""}}(e,t)},exports.getLanguageNames=function(e,t){return function(e,t){void 0===t&&(t=s);try{var n=new Intl.Locale(e);e=n.toString();var r=n.language,a=n.region,o=new Intl.Locale(e).maximize(),i=o.toString(),u=o.region||"",c=o.script||"",l=new Intl.Locale(e).minimize().toString(),f=new Intl.DisplayNames([t,e,s],{type:"language"}),p=new Intl.DisplayNames([e,t,s],{type:"language"}),g=f.of(e)||e,d=p.of(e)||e,v=f.of(i)||e,m=p.of(i)||e,y=f.of(l)||e,h=p.of(l)||e,b=f.of(r)||e,N=p.of(r)||e,w=a?"".concat(b," (").concat(a,")"):b,L=a?"".concat(N," (").concat(a,")"):N,C=new Intl.DisplayNames([t,e,s],{type:"region"}),T=new Intl.DisplayNames([e,t,s],{type:"region"}),I=C.of(u)||"",x=T.of(u)||"",M=new Intl.DisplayNames([t,e,s],{type:"script"}),E=new Intl.DisplayNames([e,t,s],{type:"script"});return{code:e,name:g,nativeName:d,maximizedCode:i,maximizedName:v,nativeMaximizedName:m,minimizedCode:l,minimizedName:y,nativeMinimizedName:h,languageCode:r,languageName:b,nativeLanguageName:N,nameWithRegionCode:w,nativeNameWithRegionCode:L,regionCode:u,regionName:I,nativeRegionName:x,scriptCode:c,scriptName:M.of(c)||"",nativeScriptName:E.of(c)||"",emoji:S(e)}}catch(t){e||(e="");var R=null==e?void 0:e.split("-");return{code:e,name:e,nativeName:e,maximizedCode:e,maximizedName:e,nativeMaximizedName:e,minimizedCode:e,minimizedName:e,nativeMinimizedName:e,languageCode:r=(null==R?void 0:R[0])||e||"",languageName:r,nativeLanguageName:r,regionCode:u=R.length>2?null==R?void 0:R[2]:(null==R?void 0:R[1])||"",regionName:u,nativeRegionName:u,scriptCode:c=(null==R?void 0:R[3])||"",scriptName:c,nativeScriptName:c,nameWithRegionCode:w=r?u?"".concat(r," (").concat(u,")"):r:"",nativeNameWithRegionCode:e,emoji:S(e)}}}(e,t)},exports.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.apply(void 0,e)},exports.isValidLanguageCode=function(e){return f(e)},exports.renderContentToString=function(t,n,r,a){return function(t,n,r,a){if(void 0===n&&(n=s),void 0===r&&(r={}),void 0===a&&(a={}),"string"==typeof t&&(t=C(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?h({value:i,languages:n,options:a[t.key]}):"currency"===t.variable?N(e(e({value:i,languages: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?b(e({value:i,languages:n},a[t.key]&&{options:a[t.key]})):"list"===t.variable?w(e({value:i,languages: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){if(!t)return!1;if(p(t)===p(e))return!1;var r=new Intl.Locale(e),a=r.language,o=r.region,i=new Intl.Locale(t),u=i.language,c=i.region;return!(!(o&&c||!g(a,u))||n&&!n.some((function(e){return g(t,e)})))}(e,t,n)},exports.splitStringToContent=function(e){return C(e)},exports.standardizeLanguageCode=function(e){return p(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,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(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(a,c)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)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 i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}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="/v1/translate/batch",o="/v1/translate/react",i="/v1/translate/content",a="/v1/project/dictionary/update",c="/v1/project/locales";function u(e,o){return t(this,void 0,void 0,(function(){var t,i,a,c,u,s,l,f,p;return n(this,(function(n){switch(n.label){case 0:return t=new AbortController,i=t.signal,(null===(p=null===(f=null===(l=o[0])||void 0===l?void 0:l.data)||void 0===f?void 0:f.metadata)||void 0===p?void 0:p.timeout)&&setTimeout((function(){return t.abort()}),o[0].data.metadata.timeout),[4,fetch("".concat(e.baseURL).concat(r),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify(o),signal:i})];case 1:return(a=n.sent()).ok?[3,3]:(c=Error.bind,s=(u="".concat(a.status,": ")).concat,[4,a.text()]);case 2:throw new(c.apply(Error,[void 0,s.apply(u,[n.sent()])]));case 3:return[4,a.json()];case 4:return[2,n.sent()]}}))}))}function s(){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}}var l="en-US",f=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],p=function(e){try{var t=new Intl.Locale(e),n=t.language,r=t.region,o=t.script;if(new Intl.DisplayNames([l],{type:"language"}).of(n)===n)return!1;if(r)if(new Intl.DisplayNames([l],{type:"region"}).of(r)===r)return!1;if(o)if(new Intl.DisplayNames([l],{type:"script"}).of(o)===o&&!f.includes(o))return!1;return!0}catch(e){return!1}},v=function(e){return Intl.getCanonicalLocales(e)[0]};function d(){for(var e,t,n,r,o,i,a,c,u,s,l=[],f=0;f<arguments.length;f++)l[f]=arguments[f];try{for(var p=l.flat().map(v),d=0;d<p.length;d++)for(var m=d+1;m<p.length;m++)if(e=p[d],t=p[m],n=void 0,r=void 0,o=void 0,i=void 0,a=void 0,c=void 0,u=void 0,s=void 0,n=new Intl.Locale(e),r=n.language,o=n.region,i=n.script,a=new Intl.Locale(t),c=a.language,u=a.region,s=a.script,r!==c||o&&u&&o!==u||i&&s&&i!==s)return!1;return!0}catch(e){return console.error(e),!1}}function m(e,r,o,a){return t(this,void 0,void 0,(function(){var t,c,u,s,l,f;return n(this,(function(n){switch(n.label){case 0:return t=new AbortController,c=t.signal,a.timeout&&setTimeout((function(){return t.abort()}),a.timeout),[4,fetch("".concat(e.baseURL).concat(i),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify({content:r,targetLocale:o,metadata:a}),signal:c})];case 1:return(u=n.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(u.status,": ")).concat,[4,u.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[n.sent()])]));case 3:return[4,u.json()];case 4:return[2,n.sent()]}}))}))}function y(e,r,i,a){return t(this,void 0,void 0,(function(){var t,c,u,s,l,f;return n(this,(function(n){switch(n.label){case 0:return t=new AbortController,c=t.signal,a.timeout&&setTimeout((function(){return t.abort()}),a.timeout),[4,fetch("".concat(e.baseURL).concat(o),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify({children:r,targetLocale:i,metadata:a}),signal:c})];case 1:return(u=n.sent()).ok?[3,3]:(s=Error.bind,f=(l="".concat(u.status,": ")).concat,[4,u.text()]);case 2:throw new(s.apply(Error,[void 0,f.apply(l,[n.sent()])]));case 3:return[4,u.json()];case 4:return[2,n.sent()]}}))}))}function g(e,r,o,i){return t(this,void 0,void 0,(function(){var t,c,u,s,l;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat(e.baseURL).concat(a),{method:"POST",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey},body:JSON.stringify({updates:r,locales:o,options:i})})];case 1:return(t=n.sent()).ok?[3,3]:(c=Error.bind,s=(u="".concat(t.status,": ")).concat,[4,t.text()]);case 2:throw new(c.apply(Error,[void 0,s.apply(u,[n.sent()])]));case 3:return[4,t.json()];case 4:return[2,null==(l=n.sent())?void 0:l.locales]}}))}))}function h(e,r){return t(this,void 0,void 0,(function(){var t,o,i,a;return n(this,(function(n){switch(n.label){case 0:return[4,fetch("".concat(e.baseURL).concat(c,"?projectID=").concat(r),{method:"GET",headers:{"Content-Type":"application/json","gtx-api-key":e.apiKey}})];case 1:return(t=n.sent()).ok?[3,3]:(o=Error.bind,a=(i="".concat(t.status,": ")).concat,[4,t.text()]);case 2:throw new(o.apply(Error,[void 0,a.apply(i,[n.sent()])]));case 3:return[4,t.json()];case 4:return[2,n.sent()]}}))}))}function b(t){var n=t.value,r=t.locales,o=void 0===r?[l]:r,i=t.options,a=void 0===i?{}:i;return new Intl.NumberFormat(o,e({numberingSystem:"latn"},a)).format(n)}function N(t){var n=t.value,r=t.locales,o=void 0===r?[l]:r,i=t.options,a=void 0===i?{}:i;return new Intl.DateTimeFormat(o,e({calendar:"gregory",numberingSystem:"latn"},a)).format(n)}function w(t){var n=t.value,r=t.locales,o=void 0===r?[l]:r,i=t.currency,a=void 0===i?"USD":i,c=t.options,u=void 0===c?{}:c;return new Intl.NumberFormat(o,e({style:"currency",currency:a,numberingSystem:"latn"},u)).format(n)}function L(t){var n=t.value,r=t.locales,o=void 0===r?[l]:r,i=t.options,a=void 0===i?{}:i;return new Intl.ListFormat(o,e({type:"conjunction",style:"long"},a)).format(n)}var S={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function C(t){if("string"!=typeof t)throw new Error("splitStringToContent: ".concat(t," is not a string!"));for(var n,r=[],o=/{([^}]+)}/g,i=0;null!==(n=o.exec(t));){var a=n[0],c=n[1],u=n.index;if("^"!==t[u-1]){u>i&&r.push(t.slice(i,u));var s=c.split(",").map((function(e){return e.trim()})),l=s[0],f=s[1]?S[s[1]]:void 0,p=e({key:l},f&&{variable:f});r.push(p),i=u+a.length}else u-1>i&&r.push(t.slice(i,u-1)),r.push(a),i=u+a.length}return i<t.length&&r.push(t.slice(i)),r}function T(e,t){if(void 0===t&&(t={}),!p(e))return x;if(t[e=v(e)])return t[e];var n=new Intl.Locale(e),r=n.region;if(r&&E[r])return E[r];var o=n.maximize(),i=o.region||"";return M[o.language]||E[i]||x}var I="đ",x=I,M={ca:I,eu:I,ku:I,bo:"đ",ug:"đ",gd:"đ´ó §ó ˘ó łó Łó ´ó ż",cy:"đ´ó §ó ˘ó ˇó Źó łó ż",gv:"đŽđ˛",grc:"đş"},E={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:"đŞđş"};var R=function(e){return"undefined"!=typeof process&&process.env&&process.env[e]||""},G=function(){function r(e){var t=void 0===e?{}:e,n=t.apiKey,r=void 0===n?"":n,o=t.defaultLocale,i=void 0===o?l:o,a=t.projectID,c=void 0===a?"":a,u=t.baseURL,s=void 0===u?"https://prod.gtx.dev":u;this.apiKey=r||R("GT_API_KEY"),this.projectID=c||R("GT_PROJECT_ID"),this.defaultLocale=v(i)||l,this.baseURL=s}return r.prototype.translate=function(r,o,i){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,m(this,r,o,e({defaultLocale:this.defaultLocale},i))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateReact=function(r,o,i){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,y(this,r,o,e({defaultLocale:this.defaultLocale},i))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateBatch=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,u(this,e)]}))}))},r.prototype.updateProjectDictionary=function(e){return t(this,arguments,void 0,(function(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r={}),n(this,(function(n){return[2,g(this,e,t,r)]}))}))},r.prototype.getProjectLocales=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,h(this,e||this.projectID)]}))}))},r}();function D(e){return v(e)}exports.default=G,exports.determineLocale=function(e,t){return function(e,t){if("string"==typeof e&&(e=[e]),!t)return e[0];for(var n=function(e){for(var n=v(e),r=[],o=0,i=t;o<i.length;o++){var a=i[o],c=v(a);if(n===c)return{value:c};s(n,c)&&r.push(c)}if(r.length)return{value:r.find((function(e){return d(n,e)}))||r[0]}},r=0,o=e;r<o.length;r++){var i=n(o[r]);if("object"==typeof i)return i.value}}(e,t)},exports.formatCurrency=function(e){return w(e)},exports.formatDateTime=function(e){return N(e)},exports.formatList=function(e){return L(e)},exports.formatNum=function(e){return b(e)},exports.formatRelativeTime=function(t){return r=(n=t).value,o=n.unit,i=n.locales,a=void 0===i?[l]:i,c=n.options,u=void 0===c?{}:c,new Intl.RelativeTimeFormat(a,e({style:"long",numeric:"auto"},u)).format(r,o);var n,r,o,i,a,c,u},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 T(e,t)},exports.getLocaleName=function(e,t){return void 0===t&&(t=l),function(e,t){void 0===t&&(t=l);try{return new Intl.DisplayNames([t,l],{type:"language"}).of(e)||""}catch(e){return""}}(e,t)},exports.getLocaleProperties=function(e,t){return function(e,t){void 0===t&&(t=l);try{e=D(e);var n=new Intl.Locale(e),r=n.language,o=n.region,i=new Intl.Locale(e).maximize(),a=i.toString(),c=i.region||"",u=i.script||"",s=new Intl.Locale(e).minimize().toString(),f=new Intl.DisplayNames([t,e,l],{type:"language"}),p=new Intl.DisplayNames([e,t,l],{type:"language"}),v=f.of(e)||e,d=p.of(e)||e,m=f.of(a)||e,y=p.of(a)||e,g=f.of(s)||e,h=p.of(s)||e,b=f.of(r)||e,N=p.of(r)||e,w=o?"".concat(b," (").concat(o,")"):b,L=o?"".concat(N," (").concat(o,")"):N,S=new Intl.DisplayNames([t,e,l],{type:"region"}),C=new Intl.DisplayNames([e,t,l],{type:"region"}),I=S.of(c)||"",x=C.of(c)||"",M=new Intl.DisplayNames([t,e,l],{type:"script"}),E=new Intl.DisplayNames([e,t,l],{type:"script"});return{code:e,name:v,nativeName:d,maximizedCode:a,maximizedName:m,nativeMaximizedName:y,minimizedCode:s,minimizedName:g,nativeMinimizedName:h,languageCode:r,languageName:b,nativeLanguageName:N,nameWithRegionCode:w,nativeNameWithRegionCode:L,regionCode:c,regionName:I,nativeRegionName:x,scriptCode:u,scriptName:M.of(u)||"",nativeScriptName:E.of(u)||"",emoji:T(e)}}catch(t){var R=e||"",G=null==R?void 0:R.split("-");return{code:R,name:R,nativeName:R,maximizedCode:R,maximizedName:R,nativeMaximizedName:R,minimizedCode:R,minimizedName:R,nativeMinimizedName:R,languageCode:r=(null==G?void 0:G[0])||R||"",languageName:r,nativeLanguageName:r,regionCode:c=G.length>2?null==G?void 0:G[2]:(null==G?void 0:G[1])||"",regionName:c,nativeRegionName:c,scriptCode:u=(null==G?void 0:G[3])||"",scriptName:u,nativeScriptName:u,nameWithRegionCode:w=r?c?"".concat(r," (").concat(c,")"):r:"",nativeNameWithRegionCode:R,emoji:T(R)}}}(e,t)},exports.isSameDialect=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d.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 p(e)},exports.renderContentToString=function(t,n,r,o){return function(t,n,r,o){if(void 0===n&&(n=l),void 0===r&&(r={}),void 0===o&&(o={}),"string"==typeof t&&(t=C(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 i;if("string"==typeof t)return t;if("object"==typeof t){var a=r[t.key];return t.variable?"number"===t.variable?b({value:a,locales:n,options:o[t.key]}):"currency"===t.variable?w(e(e({value:a,locales:n},o[t.key]&&{options:o[t.key]}),(null===(i=o[t.key])||void 0===i?void 0:i.currency)&&{currency:o[t.key].currency})):"datetime"===t.variable?N(e({value:a,locales:n},o[t.key]&&{options:o[t.key]})):"list"===t.variable?L(e({value:a,locales:n},o[t.key]&&{options:o[t.key]})):a:a}})).join("")}(t,n,r,o)},exports.requiresTranslation=function(e,t,n){return function(e,t,n){return!(!p(e)||!p(t)||n&&n.some((function(e){return!p(e)}))||d(e,t)||n&&!n.some((function(e){return s(t,e)})))}(e,t,n)},exports.splitStringToContent=function(e){return C(e)},exports.standardizeLocale=D;
|
2
2
|
//# sourceMappingURL=index.cjs.min.cjs.map
|