7 lines
40 KiB
JavaScript
7 lines
40 KiB
JavaScript
;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="08311eaf-3acf-b811-9592-acd145c58f64")}catch(e){}}();
|
|
module.exports=[254508,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},450651,a=>{"use strict";var b,c=a.i(851899);class d extends Error{constructor(a,b){let c=a;b&&(c+=": "+b),super(c),this.code=a,b&&(this.originalMessage=b)}}var e=((b=e||{}).MISSING_MESSAGE="MISSING_MESSAGE",b.MISSING_FORMAT="MISSING_FORMAT",b.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",b.INSUFFICIENT_PATH="INSUFFICIENT_PATH",b.INVALID_MESSAGE="INVALID_MESSAGE",b.INVALID_KEY="INVALID_KEY",b.FORMATTING_ERROR="FORMATTING_ERROR",b);function f(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function g(a,b){return(0,c.memoize)(a,{cache:{create:()=>({get:a=>b[a],set(a,c){b[a]=c}})},strategy:c.strategies.variadic})}function h(a,b){return g((...b)=>new a(...b),b)}function i(a){return{getDateTimeFormat:h(Intl.DateTimeFormat,a.dateTime),getNumberFormat:h(Intl.NumberFormat,a.number),getPluralRules:h(Intl.PluralRules,a.pluralRules),getRelativeTimeFormat:h(Intl.RelativeTimeFormat,a.relativeTime),getListFormat:h(Intl.ListFormat,a.list),getDisplayNames:h(Intl.DisplayNames,a.displayNames)}}a.s(["I",()=>d,"a",()=>e,"b",()=>f,"c",()=>i,"m",()=>g])},964563,a=>{"use strict";var b,c,d,e,f,g=a.i(851899);let h=/(?:[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,i=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,j=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,k=/^(@+)?(\+|#+)?[rs]?$/g,l=/(\*)(0+)|(#+)(0+)|(0+)/g,m=/^(0+)$/;function n(a){let b={};return"r"===a[a.length-1]?b.roundingPriority="morePrecision":"s"===a[a.length-1]&&(b.roundingPriority="lessPrecision"),a.replace(k,function(a,c,d){return"string"!=typeof d?(b.minimumSignificantDigits=c.length,b.maximumSignificantDigits=c.length):"+"===d?b.minimumSignificantDigits=c.length:"#"===c[0]?b.maximumSignificantDigits=c.length:(b.minimumSignificantDigits=c.length,b.maximumSignificantDigits=c.length+("string"==typeof d?d.length:0)),""}),b}function o(a){switch(a){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 p(a){let b=o(a);return b||{}}let q=((b={})[b.literal=0]="literal",b[b.argument=1]="argument",b[b.number=2]="number",b[b.date=3]="date",b[b.time=4]="time",b[b.select=5]="select",b[b.plural=6]="plural",b[b.pound=7]="pound",b[b.tag=8]="tag",b),r=((c={})[c.number=0]="number",c[c.dateTime=1]="dateTime",c);function s(a){return a.type===q.literal}function t(a){return a.type===q.number}function u(a){return a.type===q.date}function v(a){return a.type===q.time}function w(a){return a.type===q.select}function x(a){return a.type===q.plural}function y(a){return a.type===q.tag}function z(a){return!!(a&&"object"==typeof a&&a.type===r.number)}function A(a){return!!(a&&"object"==typeof a&&a.type===r.dateTime)}let B=((d={})[d.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",d[d.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",d[d.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",d[d.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",d[d.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",d[d.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",d[d.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",d[d.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",d[d.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",d[d.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",d[d.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",d[d.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",d[d.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",d[d.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",d[d.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",d[d.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",d[d.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",d[d.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",d[d.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",d[d.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",d[d.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",d[d.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",d[d.INVALID_TAG=23]="INVALID_TAG",d[d.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",d[d.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",d[d.UNCLOSED_TAG=27]="UNCLOSED_TAG",d),C=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,D={"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"],GS:["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"],"ku-SY":["H","hB"],"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"]},E=RegExp(`^${C.source}*`),F=RegExp(`${C.source}*$`);function G(a,b){return{start:a,end:b}}let H=!!Object.fromEntries,I=!!String.prototype.trimStart,J=!!String.prototype.trimEnd,K=H?Object.fromEntries:function(a){let b={};for(let[c,d]of a)b[c]=d;return b},L=I?function(a){return a.trimStart()}:function(a){return a.replace(E,"")},M=J?function(a){return a.trimEnd()}:function(a){return a.replace(F,"")},N=RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class O{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(a,b={}){this.message=a,this.position={offset:0,line:1,column:1},this.ignoreTag=!!b.ignoreTag,this.locale=b.locale,this.requiresOtherClause=!!b.requiresOtherClause,this.shouldParseSkeletons=!!b.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(a,b,c){let d=[];for(;!this.isEOF();){let e=this.char();if(123===e){let b=this.parseArgument(a,c);if(b.err)return b;d.push(b.val)}else if(125===e&&a>0)break;else if(35===e&&("plural"===b||"selectordinal"===b)){let a=this.clonePosition();this.bump(),d.push({type:q.pound,location:G(a,this.clonePosition())})}else if(60!==e||this.ignoreTag||47!==this.peek())if(60===e&&!this.ignoreTag&&P(this.peek()||0)){let c=this.parseTag(a,b);if(c.err)return c;d.push(c.val)}else{let c=this.parseLiteral(a,b);if(c.err)return c;d.push(c.val)}else if(!c)return this.error(B.UNMATCHED_CLOSING_TAG,G(this.clonePosition(),this.clonePosition()));else break}return{val:d,err:null}}parseTag(a,b){let c=this.clonePosition();this.bump();let d=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:q.literal,value:`<${d}/>`,location:G(c,this.clonePosition())},err:null};if(!this.bumpIf(">"))return this.error(B.INVALID_TAG,G(c,this.clonePosition()));{let e=this.parseMessage(a+1,b,!0);if(e.err)return e;let f=e.val,g=this.clonePosition();if(!this.bumpIf("</"))return this.error(B.UNCLOSED_TAG,G(c,this.clonePosition()));{if(this.isEOF()||!P(this.char()))return this.error(B.INVALID_TAG,G(g,this.clonePosition()));let a=this.clonePosition();return d!==this.parseTagName()?this.error(B.UNMATCHED_CLOSING_TAG,G(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">"))?{val:{type:q.tag,value:d,children:f,location:G(c,this.clonePosition())},err:null}:this.error(B.INVALID_TAG,G(g,this.clonePosition()))}}}parseTagName(){var a;let b=this.offset();for(this.bump();!this.isEOF()&&(45===(a=this.char())||46===a||a>=48&&a<=57||95===a||a>=97&&a<=122||a>=65&&a<=90||183==a||a>=192&&a<=214||a>=216&&a<=246||a>=248&&a<=893||a>=895&&a<=8191||a>=8204&&a<=8205||a>=8255&&a<=8256||a>=8304&&a<=8591||a>=11264&&a<=12271||a>=12289&&a<=55295||a>=63744&&a<=64975||a>=65008&&a<=65533||a>=65536&&a<=983039);)this.bump();return this.message.slice(b,this.offset())}parseLiteral(a,b){let c=this.clonePosition(),d="";for(;;){let c=this.tryParseQuote(b);if(c){d+=c;continue}let e=this.tryParseUnquoted(a,b);if(e){d+=e;continue}let f=this.tryParseLeftAngleBracket();if(f){d+=f;continue}break}let e=G(c,this.clonePosition());return{val:{type:q.literal,value:d,location:e},err:null}}tryParseLeftAngleBracket(){var a;return this.isEOF()||60!==this.char()||!this.ignoreTag&&(P(a=this.peek()||0)||47===a)?null:(this.bump(),"<")}tryParseQuote(a){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"===a||"selectordinal"===a)break;return null;default:return null}this.bump();let b=[this.char()];for(this.bump();!this.isEOF();){let a=this.char();if(39===a)if(39===this.peek())b.push(39),this.bump();else{this.bump();break}else b.push(a);this.bump()}return String.fromCodePoint(...b)}tryParseUnquoted(a,b){if(this.isEOF())return null;let c=this.char();return 60===c||123===c||35===c&&("plural"===b||"selectordinal"===b)||125===c&&a>0?null:(this.bump(),String.fromCodePoint(c))}parseArgument(a,b){let c=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE,G(c,this.clonePosition()));if(125===this.char())return this.bump(),this.error(B.EMPTY_ARGUMENT,G(c,this.clonePosition()));let d=this.parseIdentifierIfPossible().value;if(!d)return this.error(B.MALFORMED_ARGUMENT,G(c,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE,G(c,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:q.argument,value:d,location:G(c,this.clonePosition())},err:null};case 44:if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE,G(c,this.clonePosition()));return this.parseArgumentOptions(a,b,d,c);default:return this.error(B.MALFORMED_ARGUMENT,G(c,this.clonePosition()))}}parseIdentifierIfPossible(){var a;let b=this.clonePosition(),c=this.offset(),d=(a=this.message,N.lastIndex=c,N.exec(a)[1]??""),e=c+d.length;return this.bumpTo(e),{value:d,location:G(b,this.clonePosition())}}parseArgumentOptions(a,b,c,d){let e=this.clonePosition(),f=this.parseIdentifierIfPossible().value,g=this.clonePosition();switch(f){case"":return this.error(B.EXPECT_ARGUMENT_TYPE,G(e,g));case"number":case"date":case"time":{this.bumpSpace();let a=null;if(this.bumpIf(",")){this.bumpSpace();let b=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;let d=M(c.val);if(0===d.length)return this.error(B.EXPECT_ARGUMENT_STYLE,G(this.clonePosition(),this.clonePosition()));a={style:d,styleLocation:G(b,this.clonePosition())}}let b=this.tryParseArgumentClose(d);if(b.err)return b;let e=G(d,this.clonePosition());if(a&&a.style.startsWith("::")){let b=L(a.style.slice(2));if("number"===f){let d=this.parseNumberSkeletonFromString(b,a.styleLocation);if(d.err)return d;return{val:{type:q.number,value:c,location:e,style:d.val},err:null}}{let d;if(0===b.length)return this.error(B.EXPECT_DATE_TIME_SKELETON,e);let g=b;this.locale&&(g=function(a,b){let c="";for(let d=0;d<a.length;d++){let e=a.charAt(d);if("j"===e){let f=0;for(;d+1<a.length&&a.charAt(d+1)===e;)f++,d++;let g=1+(1&f),h=f<2?1:3+(f>>1),i=function(a){let b,c=a.hourCycle;if(void 0===c&&a.hourCycles&&a.hourCycles.length&&(c=a.hourCycles[0]),c)switch(c){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw Error("Invalid hourCycle")}let d=a.language;return"root"!==d&&(b=a.maximize().region),(D[b||""]||D[d||""]||D[`${d}-001`]||D["001"])[0]}(b);for(("H"==i||"k"==i)&&(h=0);h-- >0;)c+="a";for(;g-- >0;)c=i+c}else"J"===e?c+="H":c+=e}return c}(b,this.locale));let i={type:r.dateTime,pattern:g,location:a.styleLocation,parsedOptions:this.shouldParseSkeletons?(d={},g.replace(h,a=>{let b=a.length;switch(a[0]){case"G":d.era=4===b?"long":5===b?"narrow":"short";break;case"y":d.year=2===b?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":d.month=["numeric","2-digit","short","long","narrow"][b-1];break;case"w":case"W":throw RangeError("`w/W` (week) patterns are not supported");case"d":d.day=["numeric","2-digit"][b-1];break;case"D":case"F":case"g":throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":d.weekday=4===b?"long":5===b?"narrow":"short";break;case"e":if(b<4)throw RangeError("`e..eee` (weekday) patterns are not supported");d.weekday=["short","long","narrow","short"][b-4];break;case"c":if(b<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");d.weekday=["short","long","narrow","short"][b-4];break;case"a":d.hour12=!0;break;case"b":case"B":throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":d.hourCycle="h12",d.hour=["numeric","2-digit"][b-1];break;case"H":d.hourCycle="h23",d.hour=["numeric","2-digit"][b-1];break;case"K":d.hourCycle="h11",d.hour=["numeric","2-digit"][b-1];break;case"k":d.hourCycle="h24",d.hour=["numeric","2-digit"][b-1];break;case"j":case"J":case"C":throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":d.minute=["numeric","2-digit"][b-1];break;case"s":d.second=["numeric","2-digit"][b-1];break;case"S":case"A":throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":d.timeZoneName=b<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),d):{}};return{val:{type:"date"===f?q.date:q.time,value:c,location:e,style:i},err:null}}}return{val:{type:"number"===f?q.number:"date"===f?q.date:q.time,value:c,location:e,style:a?.style??null},err:null}}case"plural":case"selectordinal":case"select":{let e=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(B.EXPECT_SELECT_ARGUMENT_OPTIONS,G(e,{...e}));this.bumpSpace();let g=this.parseIdentifierIfPossible(),h=0;if("select"!==f&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(B.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,G(this.clonePosition(),this.clonePosition()));this.bumpSpace();let a=this.tryParseDecimalInteger(B.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,B.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(a.err)return a;this.bumpSpace(),g=this.parseIdentifierIfPossible(),h=a.val}let i=this.tryParsePluralOrSelectOptions(a,f,b,g);if(i.err)return i;let j=this.tryParseArgumentClose(d);if(j.err)return j;let k=G(d,this.clonePosition());if("select"===f)return{val:{type:q.select,value:c,options:K(i.val),location:k},err:null};return{val:{type:q.plural,value:c,options:K(i.val),offset:h,pluralType:"plural"===f?"cardinal":"ordinal",location:k},err:null}}default:return this.error(B.INVALID_ARGUMENT_TYPE,G(e,g))}}tryParseArgumentClose(a){return this.isEOF()||125!==this.char()?this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE,G(a,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let a=0,b=this.clonePosition();for(;!this.isEOF();)switch(this.char()){case 39:{this.bump();let a=this.clonePosition();if(!this.bumpUntil("'"))return this.error(B.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,G(a,this.clonePosition()));this.bump();break}case 123:a+=1,this.bump();break;case 125:if(!(a>0))return{val:this.message.slice(b.offset,this.offset()),err:null};a-=1;break;default:this.bump()}return{val:this.message.slice(b.offset,this.offset()),err:null}}parseNumberSkeletonFromString(a,b){let c=[];try{c=function(a){if(0===a.length)throw Error("Number skeleton cannot be empty");let b=a.split(i).filter(a=>a.length>0),c=[];for(let a of b){let b=a.split("/");if(0===b.length)throw Error("Invalid number skeleton");let[d,...e]=b;for(let a of e)if(0===a.length)throw Error("Invalid number skeleton");c.push({stem:d,options:e})}return c}(a)}catch{return this.error(B.INVALID_NUMBER_SKELETON,b)}return{val:{type:r.number,tokens:c,location:b,parsedOptions:this.shouldParseSkeletons?function(a){let b={};for(let c of a){switch(c.stem){case"percent":case"%":b.style="percent";continue;case"%x100":b.style="percent",b.scale=100;continue;case"currency":b.style="currency",b.currency=c.options[0];continue;case"group-off":case",_":b.useGrouping=!1;continue;case"precision-integer":case".":b.maximumFractionDigits=0;continue;case"measure-unit":case"unit":b.style="unit",b.unit=c.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":b.notation="compact",b.compactDisplay="short";continue;case"compact-long":case"KK":b.notation="compact",b.compactDisplay="long";continue;case"scientific":b={...b,notation:"scientific",...c.options.reduce((a,b)=>({...a,...p(b)}),{})};continue;case"engineering":b={...b,notation:"engineering",...c.options.reduce((a,b)=>({...a,...p(b)}),{})};continue;case"notation-simple":b.notation="standard";continue;case"unit-width-narrow":b.currencyDisplay="narrowSymbol",b.unitDisplay="narrow";continue;case"unit-width-short":b.currencyDisplay="code",b.unitDisplay="short";continue;case"unit-width-full-name":b.currencyDisplay="name",b.unitDisplay="long";continue;case"unit-width-iso-code":b.currencyDisplay="symbol";continue;case"scale":b.scale=parseFloat(c.options[0]);continue;case"rounding-mode-floor":b.roundingMode="floor";continue;case"rounding-mode-ceiling":b.roundingMode="ceil";continue;case"rounding-mode-down":b.roundingMode="trunc";continue;case"rounding-mode-up":b.roundingMode="expand";continue;case"rounding-mode-half-even":b.roundingMode="halfEven";continue;case"rounding-mode-half-down":b.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":b.roundingMode="halfExpand";continue;case"integer-width":if(c.options.length>1)throw RangeError("integer-width stems only accept a single optional option");c.options[0].replace(l,function(a,c,d,e,f,g){if(c)b.minimumIntegerDigits=d.length;else if(e&&f)throw Error("We currently do not support maximum integer digits");else if(g)throw Error("We currently do not support exact integer digits");return""});continue}if(m.test(c.stem)){b.minimumIntegerDigits=c.stem.length;continue}if(j.test(c.stem)){if(c.options.length>1)throw RangeError("Fraction-precision stems only accept a single optional option");c.stem.replace(j,function(a,c,d,e,f,g){return"*"===d?b.minimumFractionDigits=c.length:e&&"#"===e[0]?b.maximumFractionDigits=e.length:f&&g?(b.minimumFractionDigits=f.length,b.maximumFractionDigits=f.length+g.length):(b.minimumFractionDigits=c.length,b.maximumFractionDigits=c.length),""});let a=c.options[0];"w"===a?b={...b,trailingZeroDisplay:"stripIfInteger"}:a&&(b={...b,...n(a)});continue}if(k.test(c.stem)){b={...b,...n(c.stem)};continue}let a=o(c.stem);a&&(b={...b,...a});let d=function(a){let b;if("E"===a[0]&&"E"===a[1]?(b={notation:"engineering"},a=a.slice(2)):"E"===a[0]&&(b={notation:"scientific"},a=a.slice(1)),b){let c=a.slice(0,2);if("+!"===c?(b.signDisplay="always",a=a.slice(2)):"+?"===c&&(b.signDisplay="exceptZero",a=a.slice(2)),!m.test(a))throw Error("Malformed concise eng/scientific notation");b.minimumIntegerDigits=a.length}return b}(c.stem);d&&(b={...b,...d})}return b}(c):{}},err:null}}tryParsePluralOrSelectOptions(a,b,c,d){let e=!1,f=[],g=new Set,{value:h,location:i}=d;for(;;){if(0===h.length){let a=this.clonePosition();if("select"!==b&&this.bumpIf("=")){let b=this.tryParseDecimalInteger(B.EXPECT_PLURAL_ARGUMENT_SELECTOR,B.INVALID_PLURAL_ARGUMENT_SELECTOR);if(b.err)return b;i=G(a,this.clonePosition()),h=this.message.slice(a.offset,this.offset())}else break}if(g.has(h))return this.error("select"===b?B.DUPLICATE_SELECT_ARGUMENT_SELECTOR:B.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,i);"other"===h&&(e=!0),this.bumpSpace();let d=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===b?B.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:B.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,G(this.clonePosition(),this.clonePosition()));let j=this.parseMessage(a+1,b,c);if(j.err)return j;let k=this.tryParseArgumentClose(d);if(k.err)return k;f.push([h,{value:j.val,location:G(d,this.clonePosition())}]),g.add(h),this.bumpSpace(),{value:h,location:i}=this.parseIdentifierIfPossible()}return 0===f.length?this.error("select"===b?B.EXPECT_SELECT_ARGUMENT_SELECTOR:B.EXPECT_PLURAL_ARGUMENT_SELECTOR,G(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!e?this.error(B.MISSING_OTHER_CLAUSE,G(this.clonePosition(),this.clonePosition())):{val:f,err:null}}tryParseDecimalInteger(a,b){let c=1,d=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(c=-1);let e=!1,f=0;for(;!this.isEOF();){let a=this.char();if(a>=48&&a<=57)e=!0,f=10*f+(a-48),this.bump();else break}let g=G(d,this.clonePosition());return e?Number.isSafeInteger(f*=c)?{val:f,err:null}:this.error(b,g):this.error(a,g)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){let a=this.position.offset;if(a>=this.message.length)throw Error("out of bound");let b=this.message.codePointAt(a);if(void 0===b)throw Error(`Offset ${a} is at invalid UTF-16 code unit boundary`);return b}error(a,b){return{val:null,err:{kind:a,message:this.message,location:b}}}bump(){if(this.isEOF())return;let a=this.char();10===a?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=a<65536?1:2)}bumpIf(a){if(this.message.startsWith(a,this.offset())){for(let b=0;b<a.length;b++)this.bump();return!0}return!1}bumpUntil(a){let b=this.offset(),c=this.message.indexOf(a,b);return c>=0?(this.bumpTo(c),!0):(this.bumpTo(this.message.length),!1)}bumpTo(a){if(this.offset()>a)throw Error(`targetOffset ${a} must be greater than or equal to the current offset ${this.offset()}`);for(a=Math.min(a,this.message.length);;){let b=this.offset();if(b===a)break;if(b>a)throw Error(`targetOffset ${a} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(var a;!this.isEOF()&&((a=this.char())>=9&&a<=13||32===a||133===a||a>=8206&&a<=8207||8232===a||8233===a);)this.bump()}peek(){if(this.isEOF())return null;let a=this.char(),b=this.offset();return this.message.charCodeAt(b+(a>=65536?2:1))??null}}function P(a){return a>=97&&a<=122||a>=65&&a<=90}function Q(a,b={}){let c=new O(a,b={shouldParseSkeletons:!0,requiresOtherClause:!0,...b}).parse();if(c.err){let a=SyntaxError(B[c.err.kind]);throw a.location=c.err.location,a.originalMessage=c.err.message,a}return b?.captureLocation||function a(b){b.forEach(b=>{if(delete b.location,w(b)||x(b))for(let c in b.options)delete b.options[c].location,a(b.options[c].value);else t(b)&&z(b.style)||(u(b)||v(b))&&A(b.style)?delete b.style.location:y(b)&&a(b.children)})}(c.val),c.val}let R=((e={}).MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e);class S extends Error{code;originalMessage;constructor(a,b,c){super(a),this.code=b,this.originalMessage=c}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class T extends S{constructor(a,b,c,d){super(`Invalid values for "${a}": "${b}". Options are "${Object.keys(c).join('", "')}"`,R.INVALID_VALUE,d)}}class U extends S{constructor(a,b,c){super(`Value for "${a}" must be of type ${b}`,R.INVALID_VALUE,c)}}class V extends S{constructor(a,b){super(`The intl string context variable "${a}" was not provided to the string "${b}"`,R.MISSING_VALUE,b)}}let W=((f={})[f.literal=0]="literal",f[f.object=1]="object",f);function X(a){return{create:()=>({get:b=>a[b],set(b,c){a[b]=c}})}}class Y{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(a,b=Y.defaultLocale,c,d){if(this.locales=b,this.resolvedLocale=Y.resolveLocale(b),"string"==typeof a){if(this.message=a,!Y.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...b}=d||{};this.ast=Y.__parse(a,{...b,locale:this.resolvedLocale})}else this.ast=a;if(!Array.isArray(this.ast))throw TypeError("A message must be provided as a String or AST.");this.formats=function(a,b){return b?Object.keys(a).reduce((c,d)=>{var e,f;return c[d]=(e=a[d],(f=b[d])?{...e,...f,...Object.keys(e).reduce((a,b)=>(a[b]={...e[b],...f[b]},a),{})}:e),c},{...a}):a}(Y.formats,c),this.formatters=d&&d.formatters||function(a={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:(0,g.memoize)((...a)=>new Intl.NumberFormat(...a),{cache:X(a.number),strategy:g.strategies.variadic}),getDateTimeFormat:(0,g.memoize)((...a)=>new Intl.DateTimeFormat(...a),{cache:X(a.dateTime),strategy:g.strategies.variadic}),getPluralRules:(0,g.memoize)((...a)=>new Intl.PluralRules(...a),{cache:X(a.pluralRules),strategy:g.strategies.variadic})}}(this.formatterCache)}format=a=>{let b=this.formatToParts(a);if(1===b.length)return b[0].value;let c=b.reduce((a,b)=>(a.length&&b.type===W.literal&&"string"==typeof a[a.length-1]?a[a.length-1]+=b.value:a.push(b.value),a),[]);return c.length<=1?c[0]||"":c};formatToParts=a=>(function a(b,c,d,e,f,g,h){if(1===b.length&&s(b[0]))return[{type:W.literal,value:b[0].value}];let i=[];for(let j of b){if(s(j)){i.push({type:W.literal,value:j.value});continue}if(j.type===q.pound){"number"==typeof g&&i.push({type:W.literal,value:d.getNumberFormat(c).format(g)});continue}let{value:b}=j;if(!(f&&b in f))throw new V(b,h);let k=f[b];if(j.type===q.argument){k&&"string"!=typeof k&&"number"!=typeof k&&"bigint"!=typeof k||(k="string"==typeof k||"number"==typeof k||"bigint"==typeof k?String(k):""),i.push({type:"string"==typeof k?W.literal:W.object,value:k});continue}if(u(j)){let a="string"==typeof j.style?e.date[j.style]:A(j.style)?j.style.parsedOptions:void 0;i.push({type:W.literal,value:d.getDateTimeFormat(c,a).format(k)});continue}if(v(j)){let a="string"==typeof j.style?e.time[j.style]:A(j.style)?j.style.parsedOptions:e.time.medium;i.push({type:W.literal,value:d.getDateTimeFormat(c,a).format(k)});continue}if(t(j)){let a="string"==typeof j.style?e.number[j.style]:z(j.style)?j.style.parsedOptions:void 0;if(a&&a.scale){let b=a.scale||1;if("bigint"==typeof k){if(!Number.isInteger(b))throw TypeError(`Cannot apply fractional scale ${b} to bigint value. Scale must be an integer when formatting bigint.`);k*=BigInt(b)}else k*=b}i.push({type:W.literal,value:d.getNumberFormat(c,a).format(k)});continue}if(y(j)){let{children:b,value:k}=j,l=f[k];if("function"!=typeof l)throw new U(k,"function",h);let m=l(a(b,c,d,e,f,g).map(a=>a.value));Array.isArray(m)||(m=[m]),i.push(...m.map(a=>({type:"string"==typeof a?W.literal:W.object,value:a})))}if(w(j)){let b=k,g=(Object.prototype.hasOwnProperty.call(j.options,b)?j.options[b]:void 0)||j.options.other;if(!g)throw new T(j.value,k,Object.keys(j.options),h);i.push(...a(g.value,c,d,e,f));continue}if(x(j)){let b=`=${k}`,g=Object.prototype.hasOwnProperty.call(j.options,b)?j.options[b]:void 0;if(!g){if(!Intl.PluralRules)throw new S(`Intl.PluralRules is not available in this environment.
|
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
`,R.MISSING_INTL_API,h);let a="bigint"==typeof k?Number(k):k,b=d.getPluralRules(c,{type:j.pluralType}).select(a-(j.offset||0));g=(Object.prototype.hasOwnProperty.call(j.options,b)?j.options[b]:void 0)||j.options.other}if(!g)throw new T(j.value,k,Object.keys(j.options),h);let l="bigint"==typeof k?Number(k):k;i.push(...a(g.value,c,d,e,f,l-(j.offset||0)));continue}}return i.length<2?i:i.reduce((a,b)=>{let c=a[a.length-1];return c&&c.type===W.literal&&b.type===W.literal?c.value+=b.value:a.push(b),a},[])})(this.ast,this.locales,this.formatters,this.formats,a,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return Y.memoizedDefaultLocale||(Y.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),Y.memoizedDefaultLocale}static resolveLocale=a=>{if(void 0===Intl.Locale)return;let b=Intl.NumberFormat.supportedLocalesOf(a);return new Intl.Locale(b.length>0?b[0]:"string"==typeof a?a:a[0])};static __parse=Q;static 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"}}}}a.s(["IntlMessageFormat",()=>Y],964563)},188876,a=>{"use strict";var b=a.i(783505),c=a.i(450651),d=a.i(686122),e=(0,b.cache)(function(a,b){return function({_cache:a=(0,c.b)(),_formatters:b=(0,c.c)(a),getMessageFallback:e=d.d,messages:f,namespace:g,onError:h=d.b,...i}){return function({messages:a,namespace:b,...c},e){return a=a["!"],b=(0,d.r)(b,"!"),(0,d.a)({...c,messages:a,namespace:b})}({...i,onError:h,cache:a,formatters:b,getMessageFallback:e,messages:{"!":f},namespace:g?`!.${g}`:"!"},0)}({...a,namespace:b})});a.s(["default",()=>e],188876)},146319,686122,a=>{"use strict";var b=a.i(783505),c=a.i(964563),d=a.i(450651);function e(...[a,f,g,h]){let i;if(Array.isArray(f))throw new d.I(d.a.INVALID_MESSAGE,void 0);if("object"==typeof f)throw new d.I(d.a.INSUFFICIENT_PATH,void 0);if("string"==typeof f){let a=g||/'[{}]/.test(f)?void 0:f;if(a)return a}let{cache:j,formats:k,formatters:l,globalFormats:m,locale:n,timeZone:o}=h;l.getMessageFormat||(l.getMessageFormat=(0,d.m)((...a)=>new c.IntlMessageFormat(a[0],a[1],a[2],{formatters:l,...a[3]}),j.message));try{let a,b,d,e;i=l.getMessageFormat(f,n,(a=c.IntlMessageFormat.formats.date,b=c.IntlMessageFormat.formats.time,d={...m?.dateTime,...k?.dateTime},e={date:{...a,...d},time:{...b,...d},number:{...m?.number,...k?.number}},o&&["date","time"].forEach(a=>{let b=e[a];for(let[a,c]of Object.entries(b))b[a]={timeZone:o,...c}}),e),{formatters:{...l,getDateTimeFormat:(a,b)=>l.getDateTimeFormat(a,{...b,timeZone:b?.timeZone??o})}})}catch(a){throw new d.I(d.a.INVALID_MESSAGE,void 0)}let p=i.format(g);return(0,b.isValidElement)(p)||Array.isArray(p)||"string"==typeof p?p:String(p)}function f(...a){return a.filter(Boolean).join(".")}function g(a){return f(a.namespace,a.key)}function h(a){console.error(a)}function i(a,b,c,d){let e=f(d,c);if(!b)throw Error(e);let g=b;return c.split(".").forEach(b=>{let c=g[b];if(null==b||null==c)throw Error(e+` (${a})`);g=c}),g}function j(a){let c=function(a,b,c){try{if(!b)throw Error(void 0);let d=c?i(a,b,c):b;if(!d)throw Error(c);return d}catch(a){return new d.I(d.a.MISSING_MESSAGE,a.message)}}(a.locale,a.messages,a.namespace);return function({cache:a,formats:c,formatters:h,getMessageFallback:j=g,locale:k,messagesOrError:l,namespace:m,onError:n,timeZone:o}){let p=l instanceof d.I;function q(a,b,c,e){let f=new d.I(b,c);return n(f),e??j({error:f,key:a,namespace:m})}function r(g,r,s,t){let u;if(p){if(!t)return n(l),j({error:l,key:g,namespace:m});u=t}else try{u=i(k,l,g,m)}catch(a){if(!t)return q(g,d.a.MISSING_MESSAGE,a.message,t);u=t}try{let d,i=f(m,g);return e(i,u,r?(d={},Object.keys(r).forEach(a=>{let c,e=0,f=r[a];c="function"==typeof f?c=>{let d=f(c);return(0,b.isValidElement)(d)?(0,b.cloneElement)(d,{key:a+e++}):d}:f,d[a]=c}),d):r,{cache:a,formatters:h,globalFormats:c,formats:s,locale:k,timeZone:o})}catch(c){let a,b;return c instanceof d.I?(a=c.code,b=c.originalMessage):(a=d.a.FORMATTING_ERROR,b=c.message),q(g,a,b,t)}}function s(a,b,c,e){let f=r(a,b,c,e);return"string"!=typeof f?q(a,d.a.INVALID_MESSAGE,void 0):f}return s.rich=r,s.markup=(a,b,c,d)=>r(a,b,c,d),s.raw=a=>{if(p)return n(l),j({error:l,key:a,namespace:m});try{return i(k,l,a,m)}catch(b){return q(a,d.a.MISSING_MESSAGE,b.message)}},s.has=a=>{if(p)return!1;try{return i(k,l,a,m),!0}catch{return!1}},s}({...a,messagesOrError:c})}function k(a,b){return a===b?void 0:a.slice((b+".").length)}function l({formats:a,getMessageFallback:b,messages:c,onError:d,...e}){return{...e,formats:a||void 0,messages:c||void 0,onError:d||h,getMessageFallback:b||g}}e.raw=!0,a.s(["a",()=>j,"b",()=>h,"d",()=>g,"i",()=>l,"r",()=>k],686122);var m=a.i(294403),n=a.i(393001),o=a.i(78490),p=a.i(888128);let q=(0,b.cache)(async function(){let a=(0,n.headers)();return(0,m.isPromise)(a)?await a:a}),r=(0,b.cache)(async function(){let a;try{a=(await q()).get(o.HEADER_LOCALE_NAME)||void 0}catch(a){if(a instanceof Error&&"DYNAMIC_SERVER_USAGE"===a.digest){let b=Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/routing/setup#static-rendering",{cause:a});throw b.digest=a.digest,b}throw a}return a});async function s(){return(0,p.getCachedRequestLocale)()||await r()}var t=a.i(796653),u=a.i(810246);let v=(0,t.getRequestConfig)(async({requestLocale:b})=>{let c,d=await b,e=["en","de"],f="string"==typeof d&&e.includes(d)?d:"de";d&&e.includes(d),console.log(`[i18n] Resolved locale: ${f}`);try{c=(await a.f({"../messages/de.json":{id:()=>65575,module:()=>a.A(65575)},"../messages/en.json":{id:()=>17741,module:()=>a.A(17741)}}).import(`../messages/${f}.json`)).default,console.log(`[i18n] Loaded messages for ${f}`)}catch(a){console.error(`[i18n] Error loading messages for ${f}:`,a),c={}}return{locale:f,messages:c,onError(a){"MISSING_MESSAGE"===a.code?console.error("[i18n] Missing message:",a.message):console.error("[i18n] Error:",a),u.captureException(a)},getMessageFallback({namespace:a,key:b,error:c}){let d=[a,b].filter(a=>null!=a).join(".");return"MISSING_MESSAGE"===c.code?d:"fallback"}}}),w=(0,b.cache)(function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}),x=(0,b.cache)(async function(a,b){let c=a({locale:b,get requestLocale(){return b?Promise.resolve(b):s()}});if((0,m.isPromise)(c)&&(c=await c),!c.locale)throw Error("No locale was returned from `getRequestConfig`.\n\nSee https://next-intl.dev/docs/usage/configuration#i18n-request");return c}),y=(0,b.cache)(d.c),z=(0,b.cache)(d.b),A=(0,b.cache)(async function(a){let b=await x(v,a);return{...l(b),_formatters:y(z()),timeZone:b.timeZone||w()}});a.s(["default",()=>A],146319)},183751,a=>{"use strict";var b=a.i(783505),c=a.i(146319),d=a.i(188876),e=(0,b.cache)(async function(a){let b,e;"string"==typeof a?b=a:a&&(e=a.locale,b=a.namespace);let f=await (0,c.default)(e);return(0,d.default)(f,b)});a.s(["getTranslations",()=>e],183751)}];
|
|
|
|
//# debugId=08311eaf-3acf-b811-9592-acd145c58f64
|
|
//# sourceMappingURL=node_modules__pnpm_110e1c00._.js.map
|