generaltranslation 6.3.2 → 7.0.0-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.
@@ -1,2 +1,2 @@
1
- "use strict";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{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}l((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=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)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 i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}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,l])}}}"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",i=6e4,a=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],u=function(e){try{var t=r.get("Locale",e),n=t.language,i=t.region,u=t.script;if(e.split("-").length!==(l=1,i&&(l+=1),u&&(l+=1),l))return!1;if(r.get("DisplayNames",[o],{type:"language"}).of(n)===n&&!function(e){return e>="qaa"&&e<="qtz"}(n))return!1;if(i)if(r.get("DisplayNames",[o],{type:"region"}).of(i)===i)return!1;if(u)if(r.get("DisplayNames",[o],{type:"script"}).of(u)===u&&!a.includes(u))return!1;return!0}catch(e){return!1}var l},l=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(t){return e}};function c(){for(var e,t,n,o,i,a,u,c,s,v,d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];try{for(var f=d.flat().map(l),g=0;g<f.length;g++)for(var m=g+1;m<f.length;m++)if(e=f[g],t=f[m],n=void 0,o=void 0,i=void 0,a=void 0,u=void 0,c=void 0,s=void 0,v=void 0,n=r.get("Locale",e),o=n.language,i=n.region,a=n.script,u=r.get("Locale",t),c=u.language,s=u.region,v=u.script,o!==c||i&&s&&i!==s||a&&v&&a!==v)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 v(r,o,a,u){return t(this,void 0,void 0,(function(){var t,l,c,s,v,d,p,f;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,l=t.signal,(c=Math.min((null==u?void 0:u.timeout)||i,i))&&setTimeout((function(){return t.abort()}),c),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:a,metadata:u}),signal:l})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(v=n.sent())?void 0:v.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 v;case 4:return s.ok?[3,6]:(d=Error.bind,f=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(d.apply(Error,[void 0,f.apply(p,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function d(r,o,a,u){return t(this,void 0,void 0,(function(){var t,l,c,s,v,d,p,f;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,l=t.signal,(c=Math.min((null==u?void 0:u.timeout)||i,i))&&setTimeout((function(){return t.abort()}),c),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:a,metadata:u}),signal:l})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(v=n.sent())?void 0:v.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 v;case 4:return s.ok?[3,6]:(d=Error.bind,f=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(d.apply(Error,[void 0,f.apply(p,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}function p(r,o,a,u){return t(this,void 0,void 0,(function(){var t,l,c,s,v,d,p,f;return n(this,(function(n){switch(n.label){case 0:t=new AbortController,l=t.signal,(c=Math.min((null==u?void 0:u.timeout)||i,i))&&setTimeout((function(){return t.abort()}),c),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:a,metadata:u}),signal:l})];case 2:return s=n.sent(),[3,4];case 3:if("AbortError"===(null==(v=n.sent())?void 0:v.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 v;case 4:return s.ok?[3,6]:(d=Error.bind,f=(p="".concat(s.status,": ")).concat,[4,s.text()]);case 5:throw new(d.apply(Error,[void 0,f.apply(p,[n.sent()])]));case 6:return[4,s.json()];case 7:return[2,n.sent()]}}))}))}var f=function(e,t,n){if(null==e?void 0:e[t])return"string"==typeof e[t]?"name"===n?e[t]:void 0:e[t][n]};function g(e,t){try{var n=l(e),o=r.get("Locale",n),i=o.language,a=o.region;if(t)for(var u=0,c=[e,n,i];u<c.length;u++){var s=f(t,c[u],"emoji");if(s)return s}if(a&&N[a])return N[a];var v=o.maximize(),d=v.region||"";return h[v.language]||N[d]||y}catch(e){return y}}var m="🌍",y=m,h={ca:m,eu:m,ku:m,bo:"🌏",ug:"🌏",gd:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",cy:"🏴󠁧󠁢󠁷󠁬󠁳󠁿",gv:"🇮🇲",grc:"🏺"},N={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 C(t,n){if(n){for(var r={},o=0,i=t;o<i.length;o++){var a=n[i[o]];a&&("string"==typeof a?r.name||(r.name=a):a&&(r=e(e({},a),r)))}return r}}function b(e,t,n){void 0===t&&(t=o),t||(t=o);try{var i=l(e),a=r.get("Locale",e),c=C([e,i,W=a.language],n),s=a.region,v=a.maximize(),d=v.toString(),p=a.region||(null==c?void 0:c.regionCode)||v.region||"",f=a.script||(null==c?void 0:c.scriptCode)||v.script||"",m=a.minimize().toString(),h=[t,e,o],N=[e,t,o],b=r.get("DisplayNames",h,{type:"language"}),L=r.get("DisplayNames",N,{type:"language"}),S=null==c?void 0:c.name,T=(null==c?void 0:c.nativeName)||(null==c?void 0:c.name),M=S||b.of(e)||e,x=T||L.of(e)||e,A=(null==c?void 0:c.maximizedName)||S||b.of(d)||e,E=(null==c?void 0:c.nativeMaximizedName)||T||L.of(d)||e,w=(null==c?void 0:c.minimizedName)||S||b.of(m)||e,K=(null==c?void 0:c.nativeMinimizedName)||T||L.of(m)||e,G=(null==c?void 0:c.languageName)||S||b.of(W)||e,O=(null==c?void 0:c.nativeLanguageName)||T||L.of(W)||e,I=(null==c?void 0:c.nameWithRegionCode)||s?"".concat(G," (").concat(s,")"):G,P=(null==c?void 0:c.nativeNameWithRegionCode)||(s?"".concat(O," (").concat(s,")"):O)||I,R=r.get("DisplayNames",h,{type:"region"}),D=r.get("DisplayNames",N,{type:"region"}),j=(null==c?void 0:c.regionName)||(p?R.of(p):"")||"",z=(null==c?void 0:c.nativeRegionName)||(p?D.of(p):"")||"",k=r.get("DisplayNames",h,{type:"script"}),B=r.get("DisplayNames",N,{type:"script"});return{code:i,name:M,nativeName:x,maximizedCode:d,maximizedName:A,nativeMaximizedName:E,minimizedCode:m,minimizedName:w,nativeMinimizedName:K,languageCode:W,languageName:G,nativeLanguageName:O,nameWithRegionCode:I,nativeNameWithRegionCode:P,regionCode:p,regionName:j,nativeRegionName:z,scriptCode:f,scriptName:J=(null==c?void 0:c.scriptName)||(f?k.of(f):"")||"",nativeScriptName:H=(null==c?void 0:c.nativeScriptName)||(f?B.of(f):"")||"",emoji:(null==c?void 0:c.emoji)||g(i,n)}}catch(t){var U=u(e)?l(e):e,F=null==U?void 0:U.split("-"),W=(null==F?void 0:F[0])||U||"";p=F.length>2?null==F?void 0:F[2]:(null==F?void 0:F[1])||"",f=(null==F?void 0:F[3])||"";U=(null==(c=C([U,W],n))?void 0:c.code)||U;M=(null==c?void 0:c.name)||U,x=(null==c?void 0:c.nativeName)||M,d=(null==c?void 0:c.maximizedCode)||U,A=(null==c?void 0:c.maximizedName)||M,E=(null==c?void 0:c.nativeMaximizedName)||x,m=(null==c?void 0:c.minimizedCode)||U,w=(null==c?void 0:c.minimizedName)||M,K=(null==c?void 0:c.nativeMinimizedName)||x;W=(null==c?void 0:c.languageCode)||W;G=(null==c?void 0:c.languageName)||M,O=(null==c?void 0:c.nativeLanguageName)||x;p=(null==c?void 0:c.regionCode)||p;j=(null==c?void 0:c.regionName)||"",z=(null==c?void 0:c.nativeRegionName)||"";f=(null==c?void 0:c.scriptCode)||f;var J=(null==c?void 0:c.scriptName)||"",H=(null==c?void 0:c.nativeScriptName)||"";return{code:U,name:M,nativeName:x,maximizedCode:d,maximizedName:A,nativeMaximizedName:E,minimizedCode:m,minimizedName:w,nativeMinimizedName:K,languageCode:W,languageName:G,nativeLanguageName:O,nameWithRegionCode:I=(null==c?void 0:c.nameWithRegionCode)||(j?"".concat(M," (").concat(j,")"):M),nativeNameWithRegionCode:P=(null==c?void 0:c.nativeNameWithRegionCode)||(z?"".concat(x," (").concat(z,")"):x),regionCode:p,regionName:j,nativeRegionName:z,scriptCode:f,scriptName:J,nativeScriptName:H,emoji:(null==c?void 0:c.emoji)||y}}}function L(t,n){"string"==typeof t&&(t=[t]),t=t.filter(u).map(l),n=n.filter(u).map(l);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,i=e.regionCode,a=e.scriptCode,u=0,l=[t,"".concat(n,"-").concat(i),"".concat(n,"-").concat(a),o];u<l.length;u++){var c=l[u];if(r.includes(c))return c}return null},i=b(t),a=i.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}(i,["languageCode"]),l=o(e({locale:t,languageCode:a},u))||o(e({locale:a},b(a)));if(l)return{value:l}},o=0,i=t;o<i.length;o++){var a=r(i[o]);if("object"==typeof a)return a.value}}function S(t){var n=t.value,i=t.locales,a=void 0===i?[o]:i,u=t.options,l=void 0===u?{}:u;return r.get("NumberFormat",a,e({numberingSystem:"latn"},l)).format(n)}function T(t){var n=t.value,i=t.locales,a=void 0===i?[o]:i,u=t.options,l=void 0===u?{}:u;return r.get("DateTimeFormat",a,e({calendar:"gregory",numberingSystem:"latn"},l)).format(n)}function M(t){var n=t.value,i=t.locales,a=void 0===i?[o]:i,u=t.currency,l=void 0===u?"USD":u,c=t.options,s=void 0===c?{}:c;return r.get("NumberFormat",a,e({style:"currency",currency:l,numberingSystem:"latn"},s)).format(n)}function x(t){var n=t.value,i=t.locales,a=void 0===i?[o]:i,u=t.options,l=void 0===u?{}:u;return r.get("ListFormat",a,e({type:"conjunction",style:"long"},l)).format(n)}var A={var:"variable",num:"number",datetime:"datetime",currency:"currency"};function E(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],u=n[1],l=n.index;if("^"!==t[l-1]){l>i&&r.push(t.slice(i,l));var c=u.split(",").map((function(e){return e.trim()})),s=c[0],v=c[1]?A[c[1]]:void 0,d=e({key:s},v&&{variable:v});r.push(d),i=l+a.length}else l-1>i&&r.push(t.slice(i,l-1)),r.push(a),i=l+a.length}return i<t.length&&r.push(t.slice(i)),r}function w(e,t,n){void 0===t&&(t=o),t||(t=o);try{var i=l(e);if(n)for(var a=0,u=[e,i,r.get("Locale",i).language];a<u.length;a++){var c=f(n,u[a],"name");if(c)return c}return r.get("DisplayNames",[t,i,o],{type:"language"}).of(i)||""}catch(e){return""}}var K=function(){function r(e){var t,n,r,o=void 0===e?{}:e,i=o.apiKey,a=void 0===i?"":i,u=o.devApiKey,c=void 0===u?"":u,s=o.sourceLocale,v=void 0===s?"":s,d=o.projectId,p=void 0===d?"":d,f=o.baseUrl,g=void 0===f?"https://api.gtx.dev":f,m=o.customMapping,y=void 0===m?{}:m,h="undefined"!=typeof process;this.apiKey=a||h&&(null===(t=process.env)||void 0===t?void 0:t.GT_API_KEY)||"",this.devApiKey=c||h&&(null===(n=process.env)||void 0===n?void 0:n.GT_DEV_API_KEY)||"",this.projectId=p||h&&(null===(r=process.env)||void 0===r?void 0:r.GT_PROJECT_ID)||"",this.sourceLocale=l(v)||"",this.baseUrl=g,this.customMapping=y}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,v(this,r,o,e({sourceLocale:this.sourceLocale},i))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateJsx=function(r,o,i){return t(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,d(this,r,o,e({sourceLocale:this.sourceLocale},i))];case 1:return[2,t.sent()]}}))}))},r.prototype.translateIcu=function(r,o,i){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},i))];case 1:return[2,t.sent()]}}))}))},r.prototype.getLocaleName=function(e){return w(e,this.sourceLocale,this.customMapping)},r.prototype.getLocaleEmoji=function(e){return g(e,this.customMapping)},r.prototype.getLocaleProperties=function(e){return b(e,this.sourceLocale,this.customMapping)},r}();exports.GT=K,exports.determineLocale=function(e,t){return L(e,t)},exports.formatCurrency=function(e,t,n){return M({value:e,currency:t,locales:null==n?void 0:n.locales,options:n})},exports.formatDateTime=function(e,t){return T({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatList=function(e,t){return x({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatNum=function(e,t){return S({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatRelativeTime=function(t,n,i){return function(t){var n=t.value,i=t.unit,a=t.locales,u=void 0===a?[o]:a,l=t.options,c=void 0===l?{}:l;return r.get("RelativeTimeFormat",u,e({style:"long",numeric:"auto"},c)).format(n,i)}({value:t,unit:n,locales:null==i?void 0:i.locales,options:i})},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 g(e,t)},exports.getLocaleName=function(e,t,n){return void 0===t&&(t=o),w(e,t,n)},exports.getLocaleProperties=function(e,t,n){return b(e,t,n)},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 s.apply(void 0,e)},exports.isSupersetLocale=function(e,t){return function(e,t){try{var n=r.get("Locale",l(e)),o=n.language,i=n.region,a=n.script,u=r.get("Locale",l(t)),c=u.language,s=u.region,v=u.script;return!(o!==c||i&&i!==s||a&&a!==v)}catch(e){return console.error(e),!1}}(e,t)},exports.isValidLocale=function(e){return u(e)},exports.renderContentToString=function(t,n,r,i){return function(t,n,r,i){if(void 0===n&&(n=o),void 0===r&&(r={}),void 0===i&&(i={}),"string"==typeof t&&(t=E(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 a=r[t.key];return t.variable?"number"===t.variable?S({value:a,locales:n,options:i[t.key]}):"currency"===t.variable?M(e(e({value:a,locales:n},i[t.key]&&{options:i[t.key]}),(null===(o=i[t.key])||void 0===o?void 0:o.currency)&&{currency:i[t.key].currency})):"datetime"===t.variable?T(e({value:a,locales:n},i[t.key]&&{options:i[t.key]})):"list"===t.variable?x(e({value:a,locales:n},i[t.key]&&{options:i[t.key]})):a:a}})).join("")}(t,n,r,i)},exports.requiresTranslation=function(e,t,n){return function(e,t,n){return!(!u(e)||!u(t)||n&&n.some((function(e){return!u(e)}))||c(e,t)||n&&!n.some((function(e){return s(t,e)})))}(e,t,n)},exports.splitStringToContent=function(e){return E(e)},exports.standardizeLocale=function(e){return l(e)};
1
+ "use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function n(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function i(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var o=new(function(){function e(){this.cache=new Map}return e.prototype._generateKey=function(e,t,r){void 0===r&&(r={});var n=Array.isArray(t)?t.join(","):t,i=r?JSON.stringify(r,Object.keys(r).sort()):"{}";return"".concat(e,":").concat(n,":").concat(i)},e.prototype.get=function(e,t,r){void 0===r&&(r={});var n=this._generateKey(e,t,r);if(!this.cache.has(n)){var i=new Intl[e](t,r);this.cache.set(n,i)}return this.cache.get(n)},e}()),a="en",s=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],h=function(e){try{var t=o.get("Locale",e),r=t.language,n=t.region,i=t.script;if(e.split("-").length!==(h=1,n&&(h+=1),i&&(h+=1),h))return!1;if(o.get("DisplayNames",[a],{type:"language"}).of(r)===r&&!function(e){return e>="qaa"&&e<="qtz"}(r))return!1;if(n)if(o.get("DisplayNames",[a],{type:"region"}).of(n)===n)return!1;if(i)if(o.get("DisplayNames",[a],{type:"script"}).of(i)===i&&!s.includes(i))return!1;return!0}catch(e){return!1}var h},u=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(t){return e}};function l(e,t){var r=o.get("Locale",e),n=r.language,i=r.region,a=r.script,s=o.get("Locale",t),h=s.language,u=s.region,l=s.script;return n===h&&((!i||!u||i===u)&&(!a||!l||a===l))}function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{for(var r=e.flat().map(u),n=0;n<r.length;n++)for(var i=n+1;i<r.length;i++)if(!l(r[n],r[i]))return!1;return!0}catch(e){return console.error(e),!1}}function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{var r=e.flat().map((function(e){return o.get("Locale",e).language}));return r.every((function(e){return e===r[0]}))}catch(e){return console.error(e),!1}}function f(e,t,r){return!(!h(e)||!h(t)||r&&r.some((function(e){return!h(e)})))&&(!c(e,t)&&!(r&&!r.some((function(e){return p(t,e)}))))}var m=function(e,t,r){if(null==e?void 0:e[t])return"string"==typeof e[t]?"name"===r?e[t]:void 0:e[t][r]};function g(e,t){try{var r=u(e),n=o.get("Locale",r),i=n.language,a=n.region;if(t)for(var s=0,h=[e,r,i];s<h.length;s++){var l=m(t,h[s],"emoji");if(l)return l}if(a&&y[a])return y[a];var c=n.maximize(),p=c.region||"";return d[c.language]||y[p]||E}catch(e){return E}}var v="🌍",E=v,d={ca:v,eu:v,ku:v,bo:"🌏",ug:"🌏",gd:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",cy:"🏴󠁧󠁢󠁷󠁬󠁳󠁿",gv:"🇮🇲",grc:"🏺"},y={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){if(t){for(var n={},i=0,o=e;i<o.length;i++){var a=t[o[i]];a&&("string"==typeof a?n.name||(n.name=a):a&&(n=r(r({},a),n)))}return n}}function T(e,t,r){void 0===t&&(t=a),t||(t=a);try{var n=u(e),i=o.get("Locale",e),s=b([e,n,x=i.language],r),l=i.region,c=i.maximize(),p=c.toString(),f=i.region||(null==s?void 0:s.regionCode)||c.region||"",m=i.script||(null==s?void 0:s.scriptCode)||c.script||"",v=i.minimize().toString(),d=[t,e,a],y=[e,t,a],T=o.get("DisplayNames",d,{type:"language"}),H=o.get("DisplayNames",y,{type:"language"}),L=null==s?void 0:s.name,B=(null==s?void 0:s.nativeName)||(null==s?void 0:s.name),N=L||T.of(e)||e,A=B||H.of(e)||e,_=(null==s?void 0:s.maximizedName)||L||T.of(p)||e,S=(null==s?void 0:s.nativeMaximizedName)||B||H.of(p)||e,C=(null==s?void 0:s.minimizedName)||L||T.of(v)||e,P=(null==s?void 0:s.nativeMinimizedName)||B||H.of(v)||e,I=(null==s?void 0:s.languageName)||L||T.of(x)||e,M=(null==s?void 0:s.nativeLanguageName)||B||H.of(x)||e,R=(null==s?void 0:s.nameWithRegionCode)||l?"".concat(I," (").concat(l,")"):I,G=(null==s?void 0:s.nativeNameWithRegionCode)||(l?"".concat(M," (").concat(l,")"):M)||R,O=o.get("DisplayNames",d,{type:"region"}),U=o.get("DisplayNames",y,{type:"region"}),D=(null==s?void 0:s.regionName)||(f?O.of(f):"")||"",w=(null==s?void 0:s.nativeRegionName)||(f?U.of(f):"")||"",F=o.get("DisplayNames",d,{type:"script"}),K=o.get("DisplayNames",y,{type:"script"});return{code:n,name:N,nativeName:A,maximizedCode:p,maximizedName:_,nativeMaximizedName:S,minimizedCode:v,minimizedName:C,nativeMinimizedName:P,languageCode:x,languageName:I,nativeLanguageName:M,nameWithRegionCode:R,nativeNameWithRegionCode:G,regionCode:f,regionName:D,nativeRegionName:w,scriptCode:m,scriptName:X=(null==s?void 0:s.scriptName)||(m?F.of(m):"")||"",nativeScriptName:j=(null==s?void 0:s.nativeScriptName)||(m?K.of(m):"")||"",emoji:(null==s?void 0:s.emoji)||g(n,r)}}catch(t){var V=h(e)?u(e):e,k=null==V?void 0:V.split("-"),x=(null==k?void 0:k[0])||V||"";f=k.length>2?null==k?void 0:k[2]:(null==k?void 0:k[1])||"",m=(null==k?void 0:k[3])||"";V=(null==(s=b([V,x],r))?void 0:s.code)||V;N=(null==s?void 0:s.name)||V,A=(null==s?void 0:s.nativeName)||N,p=(null==s?void 0:s.maximizedCode)||V,_=(null==s?void 0:s.maximizedName)||N,S=(null==s?void 0:s.nativeMaximizedName)||A,v=(null==s?void 0:s.minimizedCode)||V,C=(null==s?void 0:s.minimizedName)||N,P=(null==s?void 0:s.nativeMinimizedName)||A;x=(null==s?void 0:s.languageCode)||x;I=(null==s?void 0:s.languageName)||N,M=(null==s?void 0:s.nativeLanguageName)||A;f=(null==s?void 0:s.regionCode)||f;D=(null==s?void 0:s.regionName)||"",w=(null==s?void 0:s.nativeRegionName)||"";m=(null==s?void 0:s.scriptCode)||m;var X=(null==s?void 0:s.scriptName)||"",j=(null==s?void 0:s.nativeScriptName)||"";return{code:V,name:N,nativeName:A,maximizedCode:p,maximizedName:_,nativeMaximizedName:S,minimizedCode:v,minimizedName:C,nativeMinimizedName:P,languageCode:x,languageName:I,nativeLanguageName:M,nameWithRegionCode:R=(null==s?void 0:s.nameWithRegionCode)||(D?"".concat(N," (").concat(D,")"):N),nativeNameWithRegionCode:G=(null==s?void 0:s.nativeNameWithRegionCode)||(w?"".concat(A," (").concat(w,")"):A),regionCode:f,regionName:D,nativeRegionName:w,scriptCode:m,scriptName:X,nativeScriptName:j,emoji:(null==s?void 0:s.emoji)||E}}}function H(e,t){"string"==typeof e&&(e=[e]),e=e.filter(h).map(u),t=t.filter(h).map(u);for(var i=function(e){var i=t.filter((function(t){return p(e,t)})),o=function(e){for(var t=e.locale,r=e.languageCode,n=e.minimizedCode,o=e.regionCode,a=e.scriptCode,s=0,h=[t,"".concat(r,"-").concat(o),"".concat(r,"-").concat(a),n];s<h.length;s++){var u=h[s];if(i.includes(u))return u}return null},a=T(e),s=a.languageCode,h=n(a,["languageCode"]),u=o(r({locale:e,languageCode:s},h))||o(r({locale:s},T(s)));if(u)return{value:u}},o=0,a=e;o<a.length;o++){var s=i(a[o]);if("object"==typeof s)return s.value}}function L(e,t){var r=t&&t.cache?t.cache:R,n=t&&t.serializer?t.serializer:I;return(t&&t.strategy?t.strategy:_)(e,{cache:r,serializer:n})}function B(e,t,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),a=t.get(o);return void 0===a&&(a=e.call(this,n),t.set(o,a)),a}function N(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return void 0===o&&(o=e.apply(this,n),t.set(i,o)),o}function A(e,t,r,n,i){return r.bind(t,e,n,i)}function _(e,t){return A(e,this,1===e.length?B:N,t.cache.create(),t.serializer)}var S,C,P,I=function(){return JSON.stringify(arguments)},M=function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(e){return this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e}(),R={create:function(){return new M}},G={variadic:function(e,t){return A(e,this,N,t.cache.create(),t.serializer)}};function O(e){return e.type===C.literal}function U(e){return e.type===C.argument}function D(e){return e.type===C.number}function w(e){return e.type===C.date}function F(e){return e.type===C.time}function K(e){return e.type===C.select}function V(e){return e.type===C.plural}function k(e){return e.type===C.pound}function x(e){return e.type===C.tag}function X(e){return!(!e||"object"!=typeof e||e.type!==P.number)}function j(e){return!(!e||"object"!=typeof e||e.type!==P.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(S||(S={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(C||(C={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(P||(P={}));var z=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Y=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function W(e){var t={};return e.replace(Y,(function(e){var r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var Z=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var J=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Q=/^(@+)?(\+|#+)?[rs]?$/g,q=/(\*)(0+)|(#+)(0+)|(0+)/g,$=/^(0+)$/;function ee(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Q,(function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),t}function te(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function re(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!$.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function ne(e){var t=te(e);return t||{}}function ie(e){for(var t={},n=0,i=e;n<i.length;n++){var o=i[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=r(r(r({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return r(r({},e),ne(t))}),{}));continue;case"engineering":t=r(r(r({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return r(r({},e),ne(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(q,(function(e,r,n,i,o,a){if(r)t.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if($.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(J.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(J,(function(e,r,n,i,o,a){return"*"===n?t.minimumFractionDigits=r.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&a?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+a.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""}));var a=o.options[0];"w"===a?t=r(r({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=r(r({},t),ee(a)))}else if(Q.test(o.stem))t=r(r({},t),ee(o.stem));else{var s=te(o.stem);s&&(t=r(r({},t),s));var h=re(o.stem);h&&(t=r(r({},t),h))}}return t}var oe,ae={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function se(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(ae[r||""]||ae[n||""]||ae["".concat(n,"-001")]||ae["001"])[0]}var he=new RegExp("^".concat(z.source,"*")),ue=new RegExp("".concat(z.source,"*$"));function le(e,t){return{start:e,end:t}}var ce=!!String.prototype.startsWith&&"_a".startsWith("a",1),pe=!!String.fromCodePoint,fe=!!Object.fromEntries,me=!!String.prototype.codePointAt,ge=!!String.prototype.trimStart,ve=!!String.prototype.trimEnd,Ee=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},de=!0;try{de="a"===(null===(oe=Ae("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===oe?void 0:oe[0])}catch(e){de=!1}var ye,be=ce?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},Te=pe?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",i=e.length,o=0;i>o;){if((r=e[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},He=fe?Object.fromEntries:function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o=i[0],a=i[1];t[o]=a}return t},Le=me?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,i=e.charCodeAt(t);return i<55296||i>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},Be=ge?function(e){return e.trimStart()}:function(e){return e.replace(he,"")},Ne=ve?function(e){return e.trimEnd()}:function(e){return e.replace(ue,"")};function Ae(e,t){return new RegExp(e,t)}if(de){var _e=Ae("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ye=function(e,t){var r;return _e.lastIndex=t,null!==(r=_e.exec(e)[1])&&void 0!==r?r:""}}else ye=function(e,t){for(var r=[];;){var n=Le(e,t);if(void 0===n||Ie(n)||Me(n))break;r.push(n),t+=n>=65536?2:1}return Te.apply(void 0,r)};var Se,Ce=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((o=this.parseArgument(e,r)).err)return o;n.push(o.val)}else{if(125===i&&e>0)break;if(35!==i||"plural"!==t&&"selectordinal"!==t){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(S.UNMATCHED_CLOSING_TAG,le(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&Pe(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;n.push(o.val)}}else{var a=this.clonePosition();this.bump(),n.push({type:C.pound,location:le(a,this.clonePosition())})}}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:C.literal,value:"<".concat(n,"/>"),location:le(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Pe(this.char()))return this.error(S.INVALID_TAG,le(a,this.clonePosition()));var s=this.clonePosition();return n!==this.parseTagName()?this.error(S.UNMATCHED_CLOSING_TAG,le(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:C.tag,value:n,children:o,location:le(r,this.clonePosition())},err:null}:this.error(S.INVALID_TAG,le(a,this.clonePosition())))}return this.error(S.UNCLOSED_TAG,le(r,this.clonePosition()))}return this.error(S.INVALID_TAG,le(r,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(t);if(i)n+=i;else{var o=this.tryParseUnquoted(e,t);if(o)n+=o;else{var a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}}}var s=le(r,this.clonePosition());return{val:{type:C.literal,value:n,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Pe(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(r);this.bump()}return Te.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),Te(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(S.EXPECT_ARGUMENT_CLOSING_BRACE,le(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(S.EMPTY_ARGUMENT,le(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(S.MALFORMED_ARGUMENT,le(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(S.EXPECT_ARGUMENT_CLOSING_BRACE,le(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:C.argument,value:n,location:le(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(S.EXPECT_ARGUMENT_CLOSING_BRACE,le(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(S.MALFORMED_ARGUMENT,le(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=ye(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:le(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,i){var o,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,h=this.clonePosition();switch(s){case"":return this.error(S.EXPECT_ARGUMENT_TYPE,le(a,h));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((d=this.parseSimpleArgStyleIfPossible()).err)return d;if(0===(m=Ne(d.val)).length)return this.error(S.EXPECT_ARGUMENT_STYLE,le(this.clonePosition(),this.clonePosition()));u={style:m,styleLocation:le(l,this.clonePosition())}}if((y=this.tryParseArgumentClose(i)).err)return y;var c=le(i,this.clonePosition());if(u&&be(null==u?void 0:u.style,"::",0)){var p=Be(u.style.slice(2));if("number"===s)return(d=this.parseNumberSkeletonFromString(p,u.styleLocation)).err?d:{val:{type:C.number,value:n,location:c,style:d.val},err:null};if(0===p.length)return this.error(S.EXPECT_DATE_TIME_SKELETON,c);var f=p;this.locale&&(f=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e.charAt(n);if("j"===i){for(var o=0;n+1<e.length&&e.charAt(n+1)===i;)o++,n++;var a=1+(1&o),s=o<2?1:3+(o>>1),h=se(t);for("H"!=h&&"k"!=h||(s=0);s-- >0;)r+="a";for(;a-- >0;)r=h+r}else r+="J"===i?"H":i}return r}(p,this.locale));var m={type:P.dateTime,pattern:f,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?W(f):{}};return{val:{type:"date"===s?C.date:C.time,value:n,location:c,style:m},err:null}}return{val:{type:"number"===s?C.number:"date"===s?C.date:C.time,value:n,location:c,style:null!==(o=null==u?void 0:u.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var g=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(S.EXPECT_SELECT_ARGUMENT_OPTIONS,le(g,r({},g)));this.bumpSpace();var v=this.parseIdentifierIfPossible(),E=0;if("select"!==s&&"offset"===v.value){if(!this.bumpIf(":"))return this.error(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,le(this.clonePosition(),this.clonePosition()));var d;if(this.bumpSpace(),(d=this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,S.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return d;this.bumpSpace(),v=this.parseIdentifierIfPossible(),E=d.val}var y,b=this.tryParsePluralOrSelectOptions(e,s,t,v);if(b.err)return b;if((y=this.tryParseArgumentClose(i)).err)return y;var T=le(i,this.clonePosition());return"select"===s?{val:{type:C.select,value:n,options:He(b.val),location:T},err:null}:{val:{type:C.plural,value:n,options:He(b.val),offset:E,pluralType:"plural"===s?"cardinal":"ordinal",location:T},err:null};default:return this.error(S.INVALID_ARGUMENT_TYPE,le(a,h))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(S.EXPECT_ARGUMENT_CLOSING_BRACE,le(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(S.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,le(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],r=0,n=e.split(Z).filter((function(e){return e.length>0}));r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],a=i.slice(1),s=0,h=a;s<h.length;s++)if(0===h[s].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:a})}return t}(e)}catch(e){return this.error(S.INVALID_NUMBER_SKELETON,t)}return{val:{type:P.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?ie(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var i,o=!1,a=[],s=new Set,h=n.value,u=n.location;;){if(0===h.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var c=this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_SELECTOR,S.INVALID_PLURAL_ARGUMENT_SELECTOR);if(c.err)return c;u=le(l,this.clonePosition()),h=this.message.slice(l.offset,this.offset())}if(s.has(h))return this.error("select"===t?S.DUPLICATE_SELECT_ARGUMENT_SELECTOR:S.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===h&&(o=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?S.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:S.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,le(this.clonePosition(),this.clonePosition()));var f=this.parseMessage(e+1,t,r);if(f.err)return f;var m=this.tryParseArgumentClose(p);if(m.err)return m;a.push([h,{value:f.val,location:le(p,this.clonePosition())}]),s.add(h),this.bumpSpace(),h=(i=this.parseIdentifierIfPossible()).value,u=i.location}return 0===a.length?this.error("select"===t?S.EXPECT_SELECT_ARGUMENT_SELECTOR:S.EXPECT_PLURAL_ARGUMENT_SELECTOR,le(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(S.MISSING_OTHER_CLAUSE,le(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,o=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;i=!0,o=10*o+(a-48),this.bump()}var s=le(n,this.clonePosition());return i?Ee(o*=r)?{val:o,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Le(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(be(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ie(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function Pe(e){return e>=97&&e<=122||e>=65&&e<=90}function Ie(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Me(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Re(e){e.forEach((function(e){if(delete e.location,K(e)||V(e))for(var t in e.options)delete e.options[t].location,Re(e.options[t].value);else D(e)&&X(e.style)||(w(e)||F(e))&&j(e.style)?delete e.style.location:x(e)&&Re(e.children)}))}function Ge(e,t){void 0===t&&(t={}),t=r({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Ce(e,t).parse();if(n.err){var i=SyntaxError(S[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return(null==t?void 0:t.captureLocation)||Re(n.val),n.val}!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Se||(Se={}));var Oe,Ue=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.code=r,i.originalMessage=n,i}return t(r,e),r.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},r}(Error),De=function(e){function r(t,r,n,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Se.INVALID_VALUE,i)||this}return t(r,e),r}(Ue),we=function(e){function r(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),Se.INVALID_VALUE,n)||this}return t(r,e),r}(Ue),Fe=function(e){function r(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),Se.MISSING_VALUE,r)||this}return t(r,e),r}(Ue);function Ke(e){return"function"==typeof e}function Ve(e,t,r,n,i,o,a){if(1===e.length&&O(e[0]))return[{type:Oe.literal,value:e[0].value}];for(var s=[],h=0,u=e;h<u.length;h++){var l=u[h];if(O(l))s.push({type:Oe.literal,value:l.value});else if(k(l))"number"==typeof o&&s.push({type:Oe.literal,value:r.getNumberFormat(t).format(o)});else{var c=l.value;if(!i||!(c in i))throw new Fe(c,a);var p=i[c];if(U(l))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?Oe.literal:Oe.object,value:p});else if(w(l)){var f="string"==typeof l.style?n.date[l.style]:j(l.style)?l.style.parsedOptions:void 0;s.push({type:Oe.literal,value:r.getDateTimeFormat(t,f).format(p)})}else if(F(l)){f="string"==typeof l.style?n.time[l.style]:j(l.style)?l.style.parsedOptions:n.time.medium;s.push({type:Oe.literal,value:r.getDateTimeFormat(t,f).format(p)})}else if(D(l)){(f="string"==typeof l.style?n.number[l.style]:X(l.style)?l.style.parsedOptions:void 0)&&f.scale&&(p*=f.scale||1),s.push({type:Oe.literal,value:r.getNumberFormat(t,f).format(p)})}else{if(x(l)){var m=l.children,g=l.value,v=i[g];if(!Ke(v))throw new we(g,"function",a);var E=v(Ve(m,t,r,n,i,o).map((function(e){return e.value})));Array.isArray(E)||(E=[E]),s.push.apply(s,E.map((function(e){return{type:"string"==typeof e?Oe.literal:Oe.object,value:e}})))}if(K(l)){if(!(d=l.options[p]||l.options.other))throw new De(l.value,p,Object.keys(l.options),a);s.push.apply(s,Ve(d.value,t,r,n,i))}else if(V(l)){var d;if(!(d=l.options["=".concat(p)])){if(!Intl.PluralRules)throw new Ue('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Se.MISSING_INTL_API,a);var y=r.getPluralRules(t,{type:l.pluralType}).select(p-(l.offset||0));d=l.options[y]||l.options.other}if(!d)throw new De(l.value,p,Object.keys(l.options),a);s.push.apply(s,Ve(d.value,t,r,n,i,p-(l.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var r=e[e.length-1];return r&&r.type===Oe.literal&&t.type===Oe.literal?r.value+=t.value:e.push(t),e}),[])}(s)}function ke(e,t){return t?Object.keys(e).reduce((function(n,i){var o,a;return n[i]=(o=e[i],(a=t[i])?r(r(r({},o||{}),a||{}),Object.keys(o).reduce((function(e,t){return e[t]=r(r({},o[t]),a[t]||{}),e}),{})):o),n}),r({},e)):e}function xe(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Oe||(Oe={}));var Xe=function(){function e(t,o,a,s){void 0===o&&(o=e.defaultLocale);var h,u=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=u.formatToParts(e);if(1===t.length)return t[0].value;var r=t.reduce((function(e,t){return e.length&&t.type===Oe.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return Ve(u.ast,u.locales,u.formatters,u.formats,e,void 0,u.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=u.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(u.locales)[0]}},this.getAst=function(){return u.ast},this.locales=o,this.resolvedLocale=e.resolveLocale(o),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var l=s||{};l.formatters;var c=n(l,["formatters"]);this.ast=e.__parse(t,r(r({},c),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=ke(e.formats,a),this.formatters=s&&s.formatters||(void 0===(h=this.formatterCache)&&(h={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:L((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,i([void 0],t,!1)))}),{cache:xe(h.number),strategy:G.variadic}),getDateTimeFormat:L((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,i([void 0],t,!1)))}),{cache:xe(h.dateTime),strategy:G.variadic}),getPluralRules:L((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,i([void 0],t,!1)))}),{cache:xe(h.pluralRules),strategy:G.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Ge,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function je(e){var t=e.value,n=e.locales,i=void 0===n?[a]:n,s=e.options,h=void 0===s?{}:s;return o.get("ListFormat",i,r({type:"conjunction",style:"long"},h)).format(t)}function ze(e,t,r){void 0===t&&(t=a),t||(t=a);try{var n=u(e);if(r)for(var i=0,s=[e,n,o.get("Locale",n).language];i<s.length;i++){var h=m(r,s[i],"name");if(h)return h}return o.get("DisplayNames",[t,n,a],{type:"language"}).of(n)||""}catch(e){return""}}var Ye=function(e){return"GT error: Cannot call `".concat(e,"` without a specified locale. Either pass a locale to the `").concat(e,"` function or specify a targetLocale in the GT constructor.")},We=function(e){return"GT error: Invalid locale: ".concat(e,".")},Ze=function(){function e(e){var t,r,n,i=void 0===e?{}:e,o=i.apiKey,s=i.devApiKey,l=i.sourceLocale,c=i.targetLocale,p=i.locales,f=i.projectId,m=i.customMapping,g=i.baseUrl,v=void 0===g?"https://api.gtx.dev":g;if(this.apiKey=o,this.devApiKey=s,this.projectId=f,"undefined"!=typeof process&&(this.apiKey||(this.apiKey=null===(t=process.env)||void 0===t?void 0:t.GT_API_KEY),this.devApiKey||(this.devApiKey=null===(r=process.env)||void 0===r?void 0:r.GT_DEV_API_KEY),this.projectId||(this.projectId=null===(n=process.env)||void 0===n?void 0:n.GT_PROJECT_ID)),this._renderingLocales=[],l){if(this.sourceLocale=u(l),!h(this.sourceLocale))throw new Error(We(this.sourceLocale));this._renderingLocales.push(this.sourceLocale)}if(c){if(this.targetLocale=u(c),!h(this.targetLocale))throw new Error(We(this.targetLocale));this._renderingLocales.push(this.targetLocale)}if(p){var E=[],d=[];if(p.forEach((function(e){var t=u(e);h(t)?E.push(t):d.push(e)})),d.length>0)throw new Error(function(e){return"GT error: Invalid locales: ".concat(e.join(", "),".")}(d));this.locales=E}this._renderingLocales.push(a),this.baseUrl=v,this.customMapping=m}return e.prototype.translatef=function(){},e.prototype.mtranslatef=function(){},e.prototype.formatMessage=function(t,n){return e.formatMessage(t,r({locales:this._renderingLocales},n))},e.prototype.formatNum=function(t,n){return e.formatNum(t,r({locales:this._renderingLocales},n))},e.prototype.formatDateTime=function(t,n){return e.formatDateTime(t,r({locales:this._renderingLocales},n))},e.prototype.formatCurrency=function(t,n,i){return e.formatCurrency(t,n,r({locales:this._renderingLocales},i))},e.prototype.formatList=function(e,t){return je({value:e,locales:(null==t?void 0:t.locales)||this._renderingLocales,options:t})},e.prototype.formatRelativeTime=function(t,n,i){return e.formatRelativeTime(t,n,r({locales:this._renderingLocales},i))},e.prototype.getLocaleName=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Ye("getLocaleName"));return ze(e,this.sourceLocale,this.customMapping)},e.prototype.getLocaleEmoji=function(t){if(void 0===t&&(t=this.targetLocale),!t)throw new Error(Ye("getLocaleEmoji"));return e.getLocaleEmoji(t,this.customMapping)},e.getLocaleEmoji=function(e,t){return g(e,t)},e.prototype.getLocaleProperties=function(t){if(void 0===t&&(t=this.targetLocale),!t)throw new Error(Ye("getLocaleProperties"));return e.getLocaleProperties(t,this.sourceLocale,this.customMapping)},e.prototype.requiresTranslation=function(e,t,r){if(void 0===e&&(e=this.sourceLocale),void 0===t&&(t=this.targetLocale),void 0===r&&(r=this.locales),!e)throw new Error("GT error: Cannot call `".concat(n="requiresTranslation","` without a specified locale. Either pass a locale to the `").concat(n,"` function or specify a targetLocale in the GT constructor."));var n;if(!t)throw new Error(Ye("requiresTranslation"));return f(e,t,r)},e.prototype.determineLocale=function(e,t){return void 0===t&&(t=this.locales||[]),H(e,t)},e.prototype.getLocaleDirection=function(t){if(void 0===t&&(t=this.targetLocale),!t)throw new Error(Ye("getLocaleDirection"));return e.getLocaleDirection(t)},e.prototype.isValidLocale=function(t){if(void 0===t&&(t=this.targetLocale),!t)throw new Error(Ye("isValidLocale"));return e.isValidLocale(t)},e.prototype.standardizeLocale=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Ye("standardizeLocale"));return u(e)},e.prototype.isSameDialect=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.isSameDialect.apply(e,t)},e.prototype.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.apply(void 0,e)},e.prototype.isSupersetLocale=function(t,r){return e.isSupersetLocale(t,r)},e.formatMessage=function(e,t){return function(e,t,r){return void 0===t&&(t=a),void 0===r&&(r={}),new Xe(e,t).format(r)}(e,null==t?void 0:t.locales,null==t?void 0:t.variables)},e.formatNum=function(e,t){return function(e){var t=e.value,n=e.locales,i=void 0===n?[a]:n,s=e.options,h=void 0===s?{}:s;return o.get("NumberFormat",i,r({numberingSystem:"latn"},h)).format(t)}({value:e,locales:t.locales,options:t})},e.formatDateTime=function(e,t){return function(e){var t=e.value,n=e.locales,i=void 0===n?[a]:n,s=e.options,h=void 0===s?{}:s;return o.get("DateTimeFormat",i,r({calendar:"gregory",numberingSystem:"latn"},h)).format(t)}({value:e,locales:null==t?void 0:t.locales,options:t})},e.formatCurrency=function(e,t,n){return function(e){var t=e.value,n=e.locales,i=void 0===n?[a]:n,s=e.currency,h=void 0===s?"USD":s,u=e.options,l=void 0===u?{}:u;return o.get("NumberFormat",i,r({style:"currency",currency:h,numberingSystem:"latn"},l)).format(t)}({value:e,currency:t,locales:n.locales,options:n})},e.formatList=function(e,t){return je({value:e,locales:t.locales,options:t})},e.formatRelativeTime=function(e,t,n){return function(e){var t=e.value,n=e.unit,i=e.locales,s=void 0===i?[a]:i,h=e.options,u=void 0===h?{}:h;return o.get("RelativeTimeFormat",s,r({style:"long",numeric:"auto"},u)).format(t,n)}({value:e,unit:t,locales:n.locales,options:n})},e.getLocaleName=function(e,t,r){return ze(e,t,r)},e.getLocaleProperties=function(e,t,r){return T(e,t,r)},e.requiresTranslation=function(e,t,r){return f(e,t,r)},e.determineLocale=function(e,t){return void 0===t&&(t=[]),H(e,t)},e.getLocaleDirection=function(e){return function(e){var t;try{var r=o.get("Locale",e);return"rtl"===(null===(t=null==r?void 0:r.textInfo)||void 0===t?void 0:t.direction)?"rtl":"ltr"}catch(e){return"ltr"}}(e)},e.isValidLocale=function(e){return h(e)},e.standardizeLocale=function(e){return u(e)},e.isSameDialect=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.apply(void 0,e)},e.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.apply(void 0,e)},e.isSupersetLocale=function(e,t){return function(e,t){try{var r=o.get("Locale",u(e)),n=r.language,i=r.region,a=r.script,s=o.get("Locale",u(t)),h=s.language,l=s.region,c=s.script;return!(n!==h||i&&i!==l||a&&a!==c)}catch(e){return console.error(e),!1}}(e,t)},e}();module.exports=Ze;
2
2
  //# sourceMappingURL=index.cjs.min.cjs.map