@intlify/core-base
Advanced tools
Comparing version 9.9.1 to 9.10.0
/*! | ||
* core-base v9.9.1 | ||
* core-base v9.10.0 | ||
* (c) 2024 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign;function escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>{if(!isObject(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object},toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,n)=>0===n?e+r:e+t+r),"")}function incrementer(e){let t=e;return()=>++t}function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function createPosition(e,t,r){return{line:e,column:t,offset:r}}function createLocation(e,t,r){const n={start:e,end:t};return null!=r&&(n.source=r),n}const CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17};function createCompileError(e,t,r={}){const{domain:n,messages:o,args:s}=r,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=n,a}function defaultOnError(e){throw e}CompileErrorCodes.EXPECTED_TOKEN,CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,CompileErrorCodes.UNBALANCED_CLOSING_BRACE,CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,CompileErrorCodes.EMPTY_PLACEHOLDER,CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,CompileErrorCodes.INVALID_LINKED_FORMAT,CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE,CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE;const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let r=0,n=1,o=1,s=0;const a=e=>t[e]===CHAR_CR&&t[e+1]===CHAR_LF,i=e=>t[e]===CHAR_PS,c=e=>t[e]===CHAR_LS,l=e=>a(e)||(e=>t[e]===CHAR_LF)(e)||i(e)||c(e),u=e=>a(e)||i(e)||c(e)?CHAR_LF:t[e];function E(){return s=0,l(r)&&(n++,o=0),a(r)&&r++,r++,o++,t[r]}return{index:()=>r,line:()=>n,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(r),currentPeek:()=>u(r+s),next:E,peek:function(){return a(r+s)&&s++,s++,t[r+s]},reset:function(){r=0,n=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=r+s;for(;e!==r;)E();s=0}}}const EOF=void 0,DOT=".",LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const r=!1!==t.location,n=createScanner(e),o=()=>n.index(),s=()=>createPosition(n.line(),n.column(),n.index()),a=s(),i=o(),c={currentType:14,offset:i,startLoc:a,endLoc:a,lastType:14,lastOffset:i,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function E(e,t,n){e.endLoc=s(),e.currentType=t;const o={type:t};return r&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=n&&(o.value=n),o}const f=e=>E(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(CompileErrorCodes.EXPECTED_TOKEN,s(),"")}function C(e){let t="";for(;e.currentPeek()===CHAR_SP||e.currentPeek()===CHAR_LF;)t+=e.currentPeek(),e.peek();return t}function _(e){const t=C(e);return e.skipToPeek(),t}function p(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function d(e,t){const{currentType:r}=t;if(2!==r)return!1;C(e);const n=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),n}function N(e){C(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const r=(t=!1,n="",o=!1)=>{const s=e.currentPeek();return"{"===s?"%"!==n&&t:"@"!==s&&s?"%"===s?(e.peek(),r(t,"%",!0)):"|"===s?!("%"!==n&&!o)||!(n===CHAR_SP||n===CHAR_LF):s===CHAR_SP?(e.peek(),r(!0,CHAR_SP,o)):s!==CHAR_LF||(e.peek(),r(!0,CHAR_LF,o)):"%"===n||t},n=r();return t&&e.resetPeek(),n}function g(e,t){const r=e.currentChar();return r===EOF?EOF:t(r)?(e.next(),r):null}function A(e){return g(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function L(e){return g(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function O(e){return g(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function S(e){let t="",r="";for(;t=L(e);)r+=t;return r}function h(e){let t="";for(;;){const r=e.currentChar();if("{"===r||"}"===r||"@"===r||"|"===r||!r)break;if("%"===r){if(!T(e))break;t+=r,e.next()}else if(r===CHAR_SP||r===CHAR_LF)if(T(e))t+=r,e.next();else{if(N(e))break;t+=r,e.next()}else t+=r,e.next()}return t}function b(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return k(e,t,4);case"U":return k(e,t,6);default:return CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function k(e,t,r){m(e,t);let n="";for(let o=0;o<r;o++){const t=O(e);if(!t){CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}n+=t}return`\\${t}${n}`}function P(e){_(e);const t=m(e,"|");return _(e),t}function I(e,t){let r=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),r=E(t,2,"{"),_(e),t.braceNest++,r;case"}":return t.braceNest>0&&2===t.currentType&&(CompileErrorCodes.EMPTY_PLACEHOLDER,s()),e.next(),r=E(t,3,"}"),t.braceNest--,t.braceNest>0&&_(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),r;case"@":return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=M(e,t)||f(t),t.braceNest=0,r;default:let n=!0,o=!0,a=!0;if(N(e))return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=E(t,1,P(e)),t.braceNest=0,t.inLinked=!1,r;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,y(e,t);if(n=function(e,t){const{currentType:r}=t;if(2!==r)return!1;C(e);const n=p(e.currentPeek());return e.resetPeek(),n}(e,t))return r=E(t,5,function(e){_(e);let t="",r="";for(;t=A(e);)r+=t;return e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r}(e)),_(e),r;if(o=d(e,t))return r=E(t,6,function(e){_(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${S(e)}`):t+=S(e),e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),_(e),r;if(a=function(e,t){const{currentType:r}=t;if(2!==r)return!1;C(e);const n=e.currentPeek()===LITERAL_DELIMITER;return e.resetPeek(),n}(e,t))return r=E(t,7,function(e){_(e),m(e,"'");let t="",r="";const n=e=>e!==LITERAL_DELIMITER&&e!==CHAR_LF;for(;t=g(e,n);)r+="\\"===t?b(e):t;const o=e.currentChar();return o===CHAR_LF||o===EOF?(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),o===CHAR_LF&&(e.next(),m(e,"'")),r):(m(e,"'"),r)}(e)),_(e),r;if(!n&&!o&&!a)return r=E(t,13,function(e){_(e);let t="",r="";const n=e=>"{"!==e&&"}"!==e&&e!==CHAR_SP&&e!==CHAR_LF;for(;t=g(e,n);)r+=t;return r}(e)),CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,s(),r.value,_(e),r}return r}function M(e,t){const{currentType:r}=t;let n=null;const o=e.currentChar();switch(8!==r&&9!==r&&12!==r&&10!==r||o!==CHAR_LF&&o!==CHAR_SP||(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),n=E(t,8,"@"),t.inLinked=!0,n;case".":return _(e),e.next(),E(t,9,".");case":":return _(e),e.next(),E(t,10,":");default:return N(e)?(n=E(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n):function(e,t){const{currentType:r}=t;if(8!==r)return!1;C(e);const n="."===e.currentPeek();return e.resetPeek(),n}(e,t)||function(e,t){const{currentType:r}=t;if(8!==r&&12!==r)return!1;C(e);const n=":"===e.currentPeek();return e.resetPeek(),n}(e,t)?(_(e),M(e,t)):function(e,t){const{currentType:r}=t;if(9!==r)return!1;C(e);const n=p(e.currentPeek());return e.resetPeek(),n}(e,t)?(_(e),E(t,12,function(e){let t="",r="";for(;t=A(e);)r+=t;return r}(e))):function(e,t){const{currentType:r}=t;if(10!==r)return!1;const n=()=>{const t=e.currentPeek();return"{"===t?p(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===CHAR_SP||!t)&&(t===CHAR_LF?(e.peek(),n()):p(t))},o=n();return e.resetPeek(),o}(e,t)?(_(e),"{"===o?I(e,t)||n:E(t,11,function(e){const t=(r=!1,n)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&"("!==o&&")"!==o&&o?o===CHAR_SP?n:o===CHAR_LF||o===DOT?(n+=o,e.next(),t(r,n)):(n+=o,e.next(),t(!0,n)):n};return t(!1,"")}(e))):(8===r&&(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,y(e,t))}}function y(e,t){let r={type:14};if(t.braceNest>0)return I(e,t)||f(t);if(t.inLinked)return M(e,t)||f(t);switch(e.currentChar()){case"{":return I(e,t)||f(t);case"}":return CompileErrorCodes.UNBALANCED_CLOSING_BRACE,s(),e.next(),E(t,3,"}");case"@":return M(e,t)||f(t);default:if(N(e))return r=E(t,1,P(e)),t.braceNest=0,t.inLinked=!1,r;const{isModulo:n,hasSpace:o}=function(e){const t=C(e),r="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:r,hasSpace:t.length>0}}(e);if(n)return o?E(t,0,h(e)):E(t,4,function(e){_(e);const t=e.currentChar();return"%"!==t&&(CompileErrorCodes.EXPECTED_TOKEN,s()),e.next(),"%"}(e));if(T(e))return E(t,0,h(e))}return r}return{nextToken:function(){const{currentType:e,offset:t,startLoc:r,endLoc:a}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=r,c.lastEndLoc=a,c.offset=o(),c.startLoc=s(),n.currentChar()===EOF?E(c,14):y(n,c)},currentOffset:o,currentPosition:s,context:l}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,r){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||r,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:r}=e;function n(e,r,n){const o={type:e};return t&&(o.start=r,o.end=r,o.loc={start:n,end:n}),o}function o(e,r,n,o){o&&(e.type=o),t&&(e.end=r,e.loc&&(e.loc.end=n))}function s(e,t){const r=e.context(),s=n(3,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(5,s,a);return i.index=parseInt(t,10),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function i(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(4,s,a);return i.key=t,e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function c(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(9,s,a);return i.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function l(e){const t=e.context(),r=n(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(8,s,a);return 12!==t.type?(CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,r.lastStartLoc,i.value="",o(i,s,a),{nextConsumeToken:t,node:i}):(null==t.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,r.lastStartLoc,getTokenCaption(t)),i.value=t.value||"",o(i,e.currentOffset(),e.currentPosition()),{node:i})}(e);r.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=function(e,t){const r=e.context(),s=n(7,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 5:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=i(e,s.value||"");break;case 6:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=a(e,s.value||"");break;case 7:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=c(e,s.value||"");break;default:CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const l=e.context(),u=n(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),r.key=u,o(r,l.offset,l.startLoc),{nextConsumeToken:s,node:r}}return o(r,e.currentOffset(),e.currentPosition()),{node:r}}function u(e){const t=e.context(),r=n(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);r.items=[];let u=null;do{const n=u||e.nextToken();switch(u=null,n.type){case 0:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(s(e,n.value||""));break;case 6:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(a(e,n.value||""));break;case 5:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(i(e,n.value||""));break;case 7:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(c(e,n.value||""));break;case 8:const o=l(e);r.items.push(o.node),u=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(r,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),r}function E(e){const t=e.context(),{offset:r,startLoc:s}=t,a=u(e);return 14===t.currentType?a:function(e,t,r,s){const a=e.context();let i=0===s.items.length;const c=n(1,t,r);c.cases=[],c.cases.push(s);do{const t=u(e);i||(i=0===t.items.length),c.cases.push(t)}while(14!==a.currentType);return i&&CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,o(c,e.currentOffset(),e.currentPosition()),c}(e,r,s,a)}return{parse:function(r){const s=createTokenizer(r,assign({},e)),a=s.context(),i=n(0,a.offset,a.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=E(s),e.onCacheKey&&(i.cacheKey=e.onCacheKey(r)),14!==a.currentType&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,r[a.offset]),o(i,s.currentOffset(),s.currentPosition()),i}}}function getTokenCaption(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const r={ast:e,helpers:new Set};return{context:()=>r,helper:e=>(r.helpers.add(e),e)}}function traverseNodes(e,t){for(let r=0;r<e.length;r++)traverseNode(e[r],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const r=createTransformer(e);r.helper("normalize"),e.body&&traverseNode(e.body,r);const n=r.context();e.helpers=Array.from(n.helpers)}function optimize(e){const t=e.body;return 2===t.type?optimizeMessageNode(t):t.cases.forEach((e=>optimizeMessageNode(e))),e}function optimizeMessageNode(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let r=0;r<e.items.length;r++){const n=e.items[r];if(3!==n.type&&9!==n.type)break;if(null==n.value)break;t.push(n.value)}if(t.length===e.items.length){e.static=join(t);for(let t=0;t<e.items.length;t++){const r=e.items[t];3!==r.type&&9!==r.type||delete r.value}}}}function minify(e){switch(e.t=e.type,e.type){case 0:const t=e;minify(t.body),t.b=t.body,delete t.body;break;case 1:const r=e,n=r.cases;for(let e=0;e<n.length;e++)minify(n[e]);r.c=n,delete r.cases;break;case 2:const o=e,s=o.items;for(let e=0;e<s.length;e++)minify(s[e]);o.i=s,delete o.items,o.static&&(o.s=o.static,delete o.static);break;case 3:case 9:case 8:case 7:const a=e;a.value&&(a.v=a.value,delete a.value);break;case 6:const i=e;minify(i.key),i.k=i.key,delete i.key,i.modifier&&(minify(i.modifier),i.m=i.modifier,delete i.modifier);break;case 5:const c=e;c.i=c.index,delete c.index;break;case 4:const l=e;l.k=l.key,delete l.key}delete e.type}function createCodeGenerator(e,t){const{sourceMap:r,filename:n,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};a&&e.loc&&(i.source=e.loc.source);function c(e,t){i.code+=e}function l(e,t=!0){const r=t?o:"";c(s?r+" ".repeat(e):r)}return{context:()=>i,push:c,indent:function(e=!0){const t=++i.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--i.indentLevel;e&&l(t)},newline:function(){l(i.indentLevel)},helper:e=>`_${e}`,needIndent:()=>i.needIndent}}function generateLinkedNode(e,t){const{helper:r}=e;e.push(`${r("linked")}(`),generateNode(e,t.key),t.modifier?(e.push(", "),generateNode(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function generateMessageNode(e,t){const{helper:r,needIndent:n}=e;e.push(`${r("normalize")}([`),e.indent(n());const o=t.items.length;for(let s=0;s<o&&(generateNode(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(n()),e.push("])")}function generatePluralNode(e,t){const{helper:r,needIndent:n}=e;if(t.cases.length>1){e.push(`${r("plural")}([`),e.indent(n());const o=t.cases.length;for(let r=0;r<o&&(generateNode(e,t.cases[r]),r!==o-1);r++)e.push(", ");e.deindent(n()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:r}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${r("interpolate")}(${r("list")}(${t.index}))`,t);break;case 4:e.push(`${r("interpolate")}(${r("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const r=isString(t.mode)?t.mode:"normal",n=isString(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==r,i=e.helpers||[],c=createCodeGenerator(e,{mode:r,filename:n,sourceMap:o,breakLineCode:s,needIndent:a});c.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(a),i.length>0&&(c.push(`const { ${join(i.map((e=>`${e}: _${e}`)),", ")} } = ctx`),c.newline()),c.push("return "),generateNode(c,e),c.deindent(a),c.push("}"),delete e.helpers;const{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function baseCompile$1(e,t={}){const r=assign({},t),n=!!r.jit,o=!!r.minify,s=null==r.optimize||r.optimize,a=createParser(r).parse(e);return n?(s&&optimize(a),o&&minify(a),{ast:a,code:""}):(transform(a,r),generate(a,r))}const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,n,o,s,a,i,c,l=-1,u=0,E=0;const f=[];function m(){const t=e[l+1];if(5===u&&"'"===t||6===u&&'"'===t)return l++,o="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===n?n=o:n+=o},f[1]=()=>{void 0!==n&&(t.push(n),n=void 0)},f[2]=()=>{f[0](),E++},f[3]=()=>{if(E>0)E--,u=4,f[0]();else{if(E=0,void 0===n)return!1;if(n=formatSubPath(n),!1===n)return!1;f[1]()}};null!==u;)if(l++,r=e[l],"\\"!==r||!m()){if(s=getPathCharType(r),c=pathStateMachine[u],a=c[s]||c.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(i=f[a[1]],i&&(o=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const n=r.length;let o=e,s=0;for(;s<n;){const e=o[r[s]];if(void 0===e)return null;if(isFunction(o))return null;o=e,s++}return o}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],a=e.named||{};isNumber(e.pluralIndex)&&normalizeNamed(r,a);function i(t){const r=isFunction(e.messages)?e.messages(t):!!isObject(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const c=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,l=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>a[e],plural:e=>e[n(r,e.length,o)],linked:(t,...r)=>{const[n,o]=r;let s="text",a="";1===r.length?isObject(n)?(a=n.modifier||a,s=n.type||s):isString(n)&&(a=n||a):2===r.length&&(isString(n)&&(a=n||a),isString(o)&&(s=o||s));const c=i(t)(u),l="vnode"===s&&isArray(c)&&a?c[0]:c;return a?(E=a,e.modifiers?e.modifiers[E]:DEFAULT_MODIFIER)(l,s):l;var E},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:l,normalize:c,values:assign({},s,a)};return u}let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook("function:translate");function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}const code=CompileErrorCodes.__EXTEND_POINT__,inc=incrementer(code),CoreErrorCodes={INVALID_ARGUMENT:code,INVALID_DATE_ARGUMENT:inc(),INVALID_ISO_DATE_ARGUMENT:inc(),NOT_SUPPORT_NON_STRING_MESSAGE:inc(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:inc(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:inc(),NOT_SUPPORT_LOCALE_TYPE:inc(),__EXTEND_POINT__:inc()};function createCoreError(e){return createCompileError(e,null,void 0)}function getLocale(e,t){return null!=t.locale?resolveLocale(t.locale):resolveLocale(e.locale)}let _resolveLocale;function resolveLocale(e){if(isString(e))return e;if(isFunction(e)){if(e.resolvedOnce&&null!=_resolveLocale)return _resolveLocale;if("Function"===e.constructor.name){const t=e();if(isPromise(t))throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=t}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const n=isString(r)?r:DEFAULT_LOCALE,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(n);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const a=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(a)?[a]:a,isArray(e)&&appendBlockToChain(s,e,!1),o.__localeChainCache.set(n,s)}return s}function appendBlockToChain(e,t,r){let n=!0;for(let o=0;o<t.length&&isBoolean(n);o++){const s=t[o];isString(s)&&(n=appendLocaleToChain(e,t[o],r))}return n}function appendLocaleToChain(e,t,r){let n;const o=t.split("-");do{n=appendItemToChain(e,o.join("-"),r),o.splice(-1,1)}while(o.length&&!0===n);return n}function appendItemToChain(e,t,r){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray(r)||isPlainObject(r))&&r[o]&&(n=r[o])}return n}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE,CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE,CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE;const VERSION="9.9.1",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:"9.9.1",n=isString(e.locale)||isFunction(e.locale)?e.locale:DEFAULT_LOCALE,o=isFunction(n)?DEFAULT_LOCALE:n,s=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,a=isPlainObject(e.messages)?e.messages:{[o]:{}},i=isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[o]:{}},c=isPlainObject(e.numberFormats)?e.numberFormats:{[o]:{}},l=assign({},e.modifiers||{},getDefaultLinkedModifiers()),u=e.pluralRules||{},E=isFunction(e.missing)?e.missing:null,f=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,m=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,C=!!e.fallbackFormat,_=!!e.unresolving,p=isFunction(e.postTranslation)?e.postTranslation:null,d=isPlainObject(e.processor)?e.processor:null,N=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,T=!!e.escapeParameter,g=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,A=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,L=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,O=isObject(e.fallbackContext)?e.fallbackContext:void 0,S=e,h=isObject(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,b=isObject(S.__numberFormatters)?S.__numberFormatters:new Map,k=isObject(S.__meta)?S.__meta:{};_cid++;const P={version:r,cid:_cid,locale:n,fallbackLocale:s,messages:a,modifiers:l,pluralRules:u,missing:E,missingWarn:f,fallbackWarn:m,fallbackFormat:C,unresolving:_,postTranslation:p,processor:d,warnHtmlMessage:N,escapeParameter:T,messageCompiler:g,messageResolver:A,localeFallbacker:L,fallbackContext:O,onWarn:t,__meta:k};return P.datetimeFormats=i,P.numberFormats=c,P.__datetimeFormatters=h,P.__numberFormatters=b,P}function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,n,o){const{missing:s,onWarn:a}=e;if(null!==s){const n=s(e,r,t,o);return isString(n)?n:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=t.b||t.body;if(1===(r.t||r.type)){const t=r,n=t.c||t.cases;return e.plural(n.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=t.s||t.static;if(r)return"text"===e.type?r:e.normalize([r]);{const r=(t.i||t.items).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=t.t||t.type;switch(r){case 3:const n=t;return n.v||n.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const a=t;return e.interpolate(e.list(null!=a.i?a.i:a.index));case 6:const i=t,c=i.m||i.modifier;return e.linked(formatMessagePart(e,i.k||i.key),c?formatMessagePart(e,c):void 0,e.type);case 7:const l=t;return l.v||l.value;case 8:const u=t;return u.v||u.value;default:throw new Error(`unhandled node type on format message part: ${r}`)}}const defaultOnCacheKey=e=>e;let compileCache=Object.create(null);function clearCompileCache(){compileCache=Object.create(null)}const isMessageAST=e=>isObject(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);function baseCompile(e,t={}){let r=!1;const n=t.onError||defaultOnError;return t.onError=e=>{r=!0,n(e)},{...baseCompile$1(e,t),detectError:r}}const compileToFunction=(e,t)=>{if(!isString(e))throw Error(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE);{!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{code:o,detectError:s}=baseCompile(e,t),a=new Function(`return ${o}`)();return s?a:compileCache[r]=a}};function compile(e,t){if(isString(e)){!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{ast:o,detectError:s}=baseCompile(e,{...t,location:!1,jit:!0}),a=format(o);return s?a:compileCache[r]=a}{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:n,unresolving:o,messageCompiler:s,fallbackLocale:a,messages:i}=e,[c,l]=parseTranslateArgs(...t),u=isBoolean(l.missingWarn)?l.missingWarn:e.missingWarn,E=isBoolean(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=isBoolean(l.escapeParameter)?l.escapeParameter:e.escapeParameter,m=!!l.resolvedMessage,C=isString(l.default)||isBoolean(l.default)?isBoolean(l.default)?s?c:()=>c:l.default:r?s?c:()=>c:"",_=r||""!==C,p=getLocale(e,l);f&&escapeParams(l);let[d,N,T]=m?[c,p,i[p]||{}]:resolveMessageFormat(e,c,p,a,E,u),g=d,A=c;if(m||isString(g)||isMessageAST(g)||isMessageFunction(g)||_&&(g=C,A=g),!(m||(isString(g)||isMessageAST(g)||isMessageFunction(g))&&isString(N)))return o?-1:c;let L=!1;const O=isMessageFunction(g)?g:compileMessageFormat(e,c,N,g,A,(()=>{L=!0}));if(L)return g;const S=evaluateMessage(e,O,createMessageContext(getMessageContextOptions(e,N,T,l)));return n?n(S,c):S}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,n,o,s){const{messages:a,onWarn:i,messageResolver:c,localeFallbacker:l}=e,u=l(e,n,r);let E,f={},m=null;for(let C=0;C<u.length&&(E=u[C],f=a[E]||{},null===(m=c(f,t))&&(m=f[t]),!(isString(m)||isMessageAST(m)||isMessageFunction(m)));C++){const r=handleMissing(e,t,E,s,"translate");r!==t&&(m=r)}return[m,E,f]}function compileMessageFormat(e,t,r,n,o,s){const{messageCompiler:a,warnHtmlMessage:i}=e;if(isMessageFunction(n)){const e=n;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==a){const e=()=>n;return e.locale=r,e.key=t,e}const c=a(n,getCompileContext(e,r,o,n,i,s));return c.locale=r,c.key=t,c.source=n,c}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,n]=e,o={};if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?o.plural=r:isString(r)?o.default=r:isPlainObject(r)&&!isEmptyObject(r)?o.named=r:isArray(r)&&(o.list=r),isNumber(n)?o.plural=n:isString(n)?o.default=n:isPlainObject(n)&&assign(o,n),[s,o]}function getCompileContext(e,t,r,n,o,s){return{locale:t,key:r,warnHtmlMessage:o,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,n){const{modifiers:o,pluralRules:s,messageResolver:a,fallbackLocale:i,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,E={locale:t,modifiers:o,pluralRules:s,messages:n=>{let o=a(r,n);if(null==o&&u){const[,,e]=resolveMessageFormat(u,n,t,i,c,l);o=a(e,n)}if(isString(o)||isMessageAST(o)){let r=!1;const s=compileMessageFormat(e,n,t,o,n,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:s}return isMessageFunction(o)?o:NOOP_MESSAGE_FUNCTION}};return e.processor&&(E.processor=e.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),isNumber(n.plural)&&(E.pluralIndex=n.plural),E}function datetime(e,...t){const{datetimeFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[c,l,u,E]=parseDateTimeArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,C=getLocale(e,u),_=a(e,o,C);if(!isString(c)||""===c)return new Intl.DateTimeFormat(C,E).format(l);let p,d={},N=null;for(let A=0;A<_.length&&(p=_[A],d=r[p]||{},N=d[c],!isPlainObject(N));A++)handleMissing(e,c,p,f,"datetime format");if(!isPlainObject(N)||!isString(p))return n?-1:c;let T=`${p}__${c}`;isEmptyObject(E)||(T=`${T}__${JSON.stringify(E)}`);let g=i.get(T);return g||(g=new Intl.DateTimeFormat(p,assign({},N,E)),i.set(T,g)),m?g.formatToParts(l):g.format(l)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,n,o]=e,s={};let a,i={};if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();a=new Date(r);try{a.toISOString()}catch(c){throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);a=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);a=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(i=n),isPlainObject(o)&&(i=o),[s.key||"",a,s,i]}function clearDateTimeFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__datetimeFormatters.has(e)&&n.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[c,l,u,E]=parseNumberArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,C=getLocale(e,u),_=a(e,o,C);if(!isString(c)||""===c)return new Intl.NumberFormat(C,E).format(l);let p,d={},N=null;for(let A=0;A<_.length&&(p=_[A],d=r[p]||{},N=d[c],!isPlainObject(N));A++)handleMissing(e,c,p,f,"number format");if(!isPlainObject(N)||!isString(p))return n?-1:c;let T=`${p}__${c}`;isEmptyObject(E)||(T=`${T}__${JSON.stringify(E)}`);let g=i.get(T);return g||(g=new Intl.NumberFormat(p,assign({},N,E)),i.set(T,g)),m?g.formatToParts(l):g.format(l)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,n,o]=e,s={};let a={};if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?a[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(a=n),isPlainObject(o)&&(a=o),[s.key||"",i,s,a]}function clearNumberFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__numberFormatters.has(e)&&n.__numberFormatters.delete(e)}}export{CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,compileToFunction,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getLocale,getWarnMessage,handleMissing,initI18nDevTools,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveLocale,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale}; | ||
const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign;function escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>{if(!isObject(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object},toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,n)=>0===n?e+r:e+t+r),"")}function incrementer(e){let t=e;return()=>++t}function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function createPosition(e,t,r){return{line:e,column:t,offset:r}}function createLocation(e,t,r){const n={start:e,end:t};return null!=r&&(n.source=r),n}const CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17};function createCompileError(e,t,r={}){const{domain:n,messages:o,args:s}=r,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=n,a}function defaultOnError(e){throw e}CompileErrorCodes.EXPECTED_TOKEN,CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,CompileErrorCodes.UNBALANCED_CLOSING_BRACE,CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,CompileErrorCodes.EMPTY_PLACEHOLDER,CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,CompileErrorCodes.INVALID_LINKED_FORMAT,CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE,CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE;const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let r=0,n=1,o=1,s=0;const a=e=>t[e]===CHAR_CR&&t[e+1]===CHAR_LF,i=e=>t[e]===CHAR_PS,c=e=>t[e]===CHAR_LS,l=e=>a(e)||(e=>t[e]===CHAR_LF)(e)||i(e)||c(e),u=e=>a(e)||i(e)||c(e)?CHAR_LF:t[e];function E(){return s=0,l(r)&&(n++,o=0),a(r)&&r++,r++,o++,t[r]}return{index:()=>r,line:()=>n,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(r),currentPeek:()=>u(r+s),next:E,peek:function(){return a(r+s)&&s++,s++,t[r+s]},reset:function(){r=0,n=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=r+s;for(;e!==r;)E();s=0}}}const EOF=void 0,DOT=".",LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const r=!1!==t.location,n=createScanner(e),o=()=>n.index(),s=()=>createPosition(n.line(),n.column(),n.index()),a=s(),i=o(),c={currentType:14,offset:i,startLoc:a,endLoc:a,lastType:14,lastOffset:i,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function E(e,t,n){e.endLoc=s(),e.currentType=t;const o={type:t};return r&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=n&&(o.value=n),o}const f=e=>E(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(CompileErrorCodes.EXPECTED_TOKEN,s(),"")}function C(e){let t="";for(;e.currentPeek()===CHAR_SP||e.currentPeek()===CHAR_LF;)t+=e.currentPeek(),e.peek();return t}function _(e){const t=C(e);return e.skipToPeek(),t}function p(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function d(e,t){const{currentType:r}=t;if(2!==r)return!1;C(e);const n=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),n}function N(e){C(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const r=(t=!1,n="",o=!1)=>{const s=e.currentPeek();return"{"===s?"%"!==n&&t:"@"!==s&&s?"%"===s?(e.peek(),r(t,"%",!0)):"|"===s?!("%"!==n&&!o)||!(n===CHAR_SP||n===CHAR_LF):s===CHAR_SP?(e.peek(),r(!0,CHAR_SP,o)):s!==CHAR_LF||(e.peek(),r(!0,CHAR_LF,o)):"%"===n||t},n=r();return t&&e.resetPeek(),n}function g(e,t){const r=e.currentChar();return r===EOF?EOF:t(r)?(e.next(),r):null}function A(e){return g(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function L(e){return g(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function O(e){return g(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function S(e){let t="",r="";for(;t=L(e);)r+=t;return r}function h(e){let t="";for(;;){const r=e.currentChar();if("{"===r||"}"===r||"@"===r||"|"===r||!r)break;if("%"===r){if(!T(e))break;t+=r,e.next()}else if(r===CHAR_SP||r===CHAR_LF)if(T(e))t+=r,e.next();else{if(N(e))break;t+=r,e.next()}else t+=r,e.next()}return t}function b(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return k(e,t,4);case"U":return k(e,t,6);default:return CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function k(e,t,r){m(e,t);let n="";for(let o=0;o<r;o++){const t=O(e);if(!t){CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}n+=t}return`\\${t}${n}`}function P(e){_(e);const t=m(e,"|");return _(e),t}function I(e,t){let r=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),r=E(t,2,"{"),_(e),t.braceNest++,r;case"}":return t.braceNest>0&&2===t.currentType&&(CompileErrorCodes.EMPTY_PLACEHOLDER,s()),e.next(),r=E(t,3,"}"),t.braceNest--,t.braceNest>0&&_(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),r;case"@":return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=M(e,t)||f(t),t.braceNest=0,r;default:let n=!0,o=!0,a=!0;if(N(e))return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=E(t,1,P(e)),t.braceNest=0,t.inLinked=!1,r;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,y(e,t);if(n=function(e,t){const{currentType:r}=t;if(2!==r)return!1;C(e);const n=p(e.currentPeek());return e.resetPeek(),n}(e,t))return r=E(t,5,function(e){_(e);let t="",r="";for(;t=A(e);)r+=t;return e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r}(e)),_(e),r;if(o=d(e,t))return r=E(t,6,function(e){_(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${S(e)}`):t+=S(e),e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),_(e),r;if(a=function(e,t){const{currentType:r}=t;if(2!==r)return!1;C(e);const n=e.currentPeek()===LITERAL_DELIMITER;return e.resetPeek(),n}(e,t))return r=E(t,7,function(e){_(e),m(e,"'");let t="",r="";const n=e=>e!==LITERAL_DELIMITER&&e!==CHAR_LF;for(;t=g(e,n);)r+="\\"===t?b(e):t;const o=e.currentChar();return o===CHAR_LF||o===EOF?(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),o===CHAR_LF&&(e.next(),m(e,"'")),r):(m(e,"'"),r)}(e)),_(e),r;if(!n&&!o&&!a)return r=E(t,13,function(e){_(e);let t="",r="";const n=e=>"{"!==e&&"}"!==e&&e!==CHAR_SP&&e!==CHAR_LF;for(;t=g(e,n);)r+=t;return r}(e)),CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,s(),r.value,_(e),r}return r}function M(e,t){const{currentType:r}=t;let n=null;const o=e.currentChar();switch(8!==r&&9!==r&&12!==r&&10!==r||o!==CHAR_LF&&o!==CHAR_SP||(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),n=E(t,8,"@"),t.inLinked=!0,n;case".":return _(e),e.next(),E(t,9,".");case":":return _(e),e.next(),E(t,10,":");default:return N(e)?(n=E(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n):function(e,t){const{currentType:r}=t;if(8!==r)return!1;C(e);const n="."===e.currentPeek();return e.resetPeek(),n}(e,t)||function(e,t){const{currentType:r}=t;if(8!==r&&12!==r)return!1;C(e);const n=":"===e.currentPeek();return e.resetPeek(),n}(e,t)?(_(e),M(e,t)):function(e,t){const{currentType:r}=t;if(9!==r)return!1;C(e);const n=p(e.currentPeek());return e.resetPeek(),n}(e,t)?(_(e),E(t,12,function(e){let t="",r="";for(;t=A(e);)r+=t;return r}(e))):function(e,t){const{currentType:r}=t;if(10!==r)return!1;const n=()=>{const t=e.currentPeek();return"{"===t?p(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===CHAR_SP||!t)&&(t===CHAR_LF?(e.peek(),n()):p(t))},o=n();return e.resetPeek(),o}(e,t)?(_(e),"{"===o?I(e,t)||n:E(t,11,function(e){const t=(r=!1,n)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&"("!==o&&")"!==o&&o?o===CHAR_SP?n:o===CHAR_LF||o===DOT?(n+=o,e.next(),t(r,n)):(n+=o,e.next(),t(!0,n)):n};return t(!1,"")}(e))):(8===r&&(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,y(e,t))}}function y(e,t){let r={type:14};if(t.braceNest>0)return I(e,t)||f(t);if(t.inLinked)return M(e,t)||f(t);switch(e.currentChar()){case"{":return I(e,t)||f(t);case"}":return CompileErrorCodes.UNBALANCED_CLOSING_BRACE,s(),e.next(),E(t,3,"}");case"@":return M(e,t)||f(t);default:if(N(e))return r=E(t,1,P(e)),t.braceNest=0,t.inLinked=!1,r;const{isModulo:n,hasSpace:o}=function(e){const t=C(e),r="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:r,hasSpace:t.length>0}}(e);if(n)return o?E(t,0,h(e)):E(t,4,function(e){_(e);const t=e.currentChar();return"%"!==t&&(CompileErrorCodes.EXPECTED_TOKEN,s()),e.next(),"%"}(e));if(T(e))return E(t,0,h(e))}return r}return{nextToken:function(){const{currentType:e,offset:t,startLoc:r,endLoc:a}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=r,c.lastEndLoc=a,c.offset=o(),c.startLoc=s(),n.currentChar()===EOF?E(c,14):y(n,c)},currentOffset:o,currentPosition:s,context:l}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,r){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||r,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:r}=e;function n(e,r,n){const o={type:e};return t&&(o.start=r,o.end=r,o.loc={start:n,end:n}),o}function o(e,r,n,o){o&&(e.type=o),t&&(e.end=r,e.loc&&(e.loc.end=n))}function s(e,t){const r=e.context(),s=n(3,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(5,s,a);return i.index=parseInt(t,10),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function i(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(4,s,a);return i.key=t,e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function c(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(9,s,a);return i.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function l(e){const t=e.context(),r=n(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(8,s,a);return 12!==t.type?(CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,r.lastStartLoc,i.value="",o(i,s,a),{nextConsumeToken:t,node:i}):(null==t.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,r.lastStartLoc,getTokenCaption(t)),i.value=t.value||"",o(i,e.currentOffset(),e.currentPosition()),{node:i})}(e);r.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=function(e,t){const r=e.context(),s=n(7,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 5:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=i(e,s.value||"");break;case 6:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=a(e,s.value||"");break;case 7:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=c(e,s.value||"");break;default:CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const l=e.context(),u=n(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),r.key=u,o(r,l.offset,l.startLoc),{nextConsumeToken:s,node:r}}return o(r,e.currentOffset(),e.currentPosition()),{node:r}}function u(e){const t=e.context(),r=n(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);r.items=[];let u=null;do{const n=u||e.nextToken();switch(u=null,n.type){case 0:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(s(e,n.value||""));break;case 6:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(a(e,n.value||""));break;case 5:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(i(e,n.value||""));break;case 7:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(c(e,n.value||""));break;case 8:const o=l(e);r.items.push(o.node),u=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(r,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),r}function E(e){const t=e.context(),{offset:r,startLoc:s}=t,a=u(e);return 14===t.currentType?a:function(e,t,r,s){const a=e.context();let i=0===s.items.length;const c=n(1,t,r);c.cases=[],c.cases.push(s);do{const t=u(e);i||(i=0===t.items.length),c.cases.push(t)}while(14!==a.currentType);return i&&CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,o(c,e.currentOffset(),e.currentPosition()),c}(e,r,s,a)}return{parse:function(r){const s=createTokenizer(r,assign({},e)),a=s.context(),i=n(0,a.offset,a.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=E(s),e.onCacheKey&&(i.cacheKey=e.onCacheKey(r)),14!==a.currentType&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,r[a.offset]),o(i,s.currentOffset(),s.currentPosition()),i}}}function getTokenCaption(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const r={ast:e,helpers:new Set};return{context:()=>r,helper:e=>(r.helpers.add(e),e)}}function traverseNodes(e,t){for(let r=0;r<e.length;r++)traverseNode(e[r],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const r=createTransformer(e);r.helper("normalize"),e.body&&traverseNode(e.body,r);const n=r.context();e.helpers=Array.from(n.helpers)}function optimize(e){const t=e.body;return 2===t.type?optimizeMessageNode(t):t.cases.forEach((e=>optimizeMessageNode(e))),e}function optimizeMessageNode(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let r=0;r<e.items.length;r++){const n=e.items[r];if(3!==n.type&&9!==n.type)break;if(null==n.value)break;t.push(n.value)}if(t.length===e.items.length){e.static=join(t);for(let t=0;t<e.items.length;t++){const r=e.items[t];3!==r.type&&9!==r.type||delete r.value}}}}function minify(e){switch(e.t=e.type,e.type){case 0:const t=e;minify(t.body),t.b=t.body,delete t.body;break;case 1:const r=e,n=r.cases;for(let e=0;e<n.length;e++)minify(n[e]);r.c=n,delete r.cases;break;case 2:const o=e,s=o.items;for(let e=0;e<s.length;e++)minify(s[e]);o.i=s,delete o.items,o.static&&(o.s=o.static,delete o.static);break;case 3:case 9:case 8:case 7:const a=e;a.value&&(a.v=a.value,delete a.value);break;case 6:const i=e;minify(i.key),i.k=i.key,delete i.key,i.modifier&&(minify(i.modifier),i.m=i.modifier,delete i.modifier);break;case 5:const c=e;c.i=c.index,delete c.index;break;case 4:const l=e;l.k=l.key,delete l.key}delete e.type}function createCodeGenerator(e,t){const{sourceMap:r,filename:n,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};a&&e.loc&&(i.source=e.loc.source);function c(e,t){i.code+=e}function l(e,t=!0){const r=t?o:"";c(s?r+" ".repeat(e):r)}return{context:()=>i,push:c,indent:function(e=!0){const t=++i.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--i.indentLevel;e&&l(t)},newline:function(){l(i.indentLevel)},helper:e=>`_${e}`,needIndent:()=>i.needIndent}}function generateLinkedNode(e,t){const{helper:r}=e;e.push(`${r("linked")}(`),generateNode(e,t.key),t.modifier?(e.push(", "),generateNode(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function generateMessageNode(e,t){const{helper:r,needIndent:n}=e;e.push(`${r("normalize")}([`),e.indent(n());const o=t.items.length;for(let s=0;s<o&&(generateNode(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(n()),e.push("])")}function generatePluralNode(e,t){const{helper:r,needIndent:n}=e;if(t.cases.length>1){e.push(`${r("plural")}([`),e.indent(n());const o=t.cases.length;for(let r=0;r<o&&(generateNode(e,t.cases[r]),r!==o-1);r++)e.push(", ");e.deindent(n()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:r}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${r("interpolate")}(${r("list")}(${t.index}))`,t);break;case 4:e.push(`${r("interpolate")}(${r("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const r=isString(t.mode)?t.mode:"normal",n=isString(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==r,i=e.helpers||[],c=createCodeGenerator(e,{mode:r,filename:n,sourceMap:o,breakLineCode:s,needIndent:a});c.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(a),i.length>0&&(c.push(`const { ${join(i.map((e=>`${e}: _${e}`)),", ")} } = ctx`),c.newline()),c.push("return "),generateNode(c,e),c.deindent(a),c.push("}"),delete e.helpers;const{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function baseCompile$1(e,t={}){const r=assign({},t),n=!!r.jit,o=!!r.minify,s=null==r.optimize||r.optimize,a=createParser(r).parse(e);return n?(s&&optimize(a),o&&minify(a),{ast:a,code:""}):(transform(a,r),generate(a,r))}const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,n,o,s,a,i,c,l=-1,u=0,E=0;const f=[];function m(){const t=e[l+1];if(5===u&&"'"===t||6===u&&'"'===t)return l++,o="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===n?n=o:n+=o},f[1]=()=>{void 0!==n&&(t.push(n),n=void 0)},f[2]=()=>{f[0](),E++},f[3]=()=>{if(E>0)E--,u=4,f[0]();else{if(E=0,void 0===n)return!1;if(n=formatSubPath(n),!1===n)return!1;f[1]()}};null!==u;)if(l++,r=e[l],"\\"!==r||!m()){if(s=getPathCharType(r),c=pathStateMachine[u],a=c[s]||c.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(i=f[a[1]],i&&(o=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const n=r.length;let o=e,s=0;for(;s<n;){const e=o[r[s]];if(void 0===e)return null;if(isFunction(o))return null;o=e,s++}return o}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],a=e.named||{};isNumber(e.pluralIndex)&&normalizeNamed(r,a);function i(t){const r=isFunction(e.messages)?e.messages(t):!!isObject(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const c=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,l=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>a[e],plural:e=>e[n(r,e.length,o)],linked:(t,...r)=>{const[n,o]=r;let s="text",a="";1===r.length?isObject(n)?(a=n.modifier||a,s=n.type||s):isString(n)&&(a=n||a):2===r.length&&(isString(n)&&(a=n||a),isString(o)&&(s=o||s));const c=i(t)(u),l="vnode"===s&&isArray(c)&&a?c[0]:c;return a?(E=a,e.modifiers?e.modifiers[E]:DEFAULT_MODIFIER)(l,s):l;var E},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:l,normalize:c,values:assign({},s,a)};return u}let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook("function:translate");function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}const code=CompileErrorCodes.__EXTEND_POINT__,inc=incrementer(code),CoreErrorCodes={INVALID_ARGUMENT:code,INVALID_DATE_ARGUMENT:inc(),INVALID_ISO_DATE_ARGUMENT:inc(),NOT_SUPPORT_NON_STRING_MESSAGE:inc(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:inc(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:inc(),NOT_SUPPORT_LOCALE_TYPE:inc(),__EXTEND_POINT__:inc()};function createCoreError(e){return createCompileError(e,null,void 0)}function getLocale(e,t){return null!=t.locale?resolveLocale(t.locale):resolveLocale(e.locale)}let _resolveLocale;function resolveLocale(e){if(isString(e))return e;if(isFunction(e)){if(e.resolvedOnce&&null!=_resolveLocale)return _resolveLocale;if("Function"===e.constructor.name){const t=e();if(isPromise(t))throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return _resolveLocale=t}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const n=isString(r)?r:DEFAULT_LOCALE,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(n);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const a=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(a)?[a]:a,isArray(e)&&appendBlockToChain(s,e,!1),o.__localeChainCache.set(n,s)}return s}function appendBlockToChain(e,t,r){let n=!0;for(let o=0;o<t.length&&isBoolean(n);o++){const s=t[o];isString(s)&&(n=appendLocaleToChain(e,t[o],r))}return n}function appendLocaleToChain(e,t,r){let n;const o=t.split("-");do{n=appendItemToChain(e,o.join("-"),r),o.splice(-1,1)}while(o.length&&!0===n);return n}function appendItemToChain(e,t,r){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray(r)||isPlainObject(r))&&r[o]&&(n=r[o])}return n}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE,CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE,CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE;const VERSION="9.10.0",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:VERSION,n=isString(e.locale)||isFunction(e.locale)?e.locale:DEFAULT_LOCALE,o=isFunction(n)?DEFAULT_LOCALE:n,s=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,a=isPlainObject(e.messages)?e.messages:{[o]:{}},i=isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[o]:{}},c=isPlainObject(e.numberFormats)?e.numberFormats:{[o]:{}},l=assign({},e.modifiers||{},getDefaultLinkedModifiers()),u=e.pluralRules||{},E=isFunction(e.missing)?e.missing:null,f=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,m=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,C=!!e.fallbackFormat,_=!!e.unresolving,p=isFunction(e.postTranslation)?e.postTranslation:null,d=isPlainObject(e.processor)?e.processor:null,N=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,T=!!e.escapeParameter,g=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,A=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,L=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,O=isObject(e.fallbackContext)?e.fallbackContext:void 0,S=e,h=isObject(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,b=isObject(S.__numberFormatters)?S.__numberFormatters:new Map,k=isObject(S.__meta)?S.__meta:{};_cid++;const P={version:r,cid:_cid,locale:n,fallbackLocale:s,messages:a,modifiers:l,pluralRules:u,missing:E,missingWarn:f,fallbackWarn:m,fallbackFormat:C,unresolving:_,postTranslation:p,processor:d,warnHtmlMessage:N,escapeParameter:T,messageCompiler:g,messageResolver:A,localeFallbacker:L,fallbackContext:O,onWarn:t,__meta:k};return P.datetimeFormats=i,P.numberFormats=c,P.__datetimeFormatters=h,P.__numberFormatters=b,P}function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,n,o){const{missing:s,onWarn:a}=e;if(null!==s){const n=s(e,r,t,o);return isString(n)?n:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=t.b||t.body;if(1===(r.t||r.type)){const t=r,n=t.c||t.cases;return e.plural(n.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=t.s||t.static;if(r)return"text"===e.type?r:e.normalize([r]);{const r=(t.i||t.items).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=t.t||t.type;switch(r){case 3:const n=t;return n.v||n.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const a=t;return e.interpolate(e.list(null!=a.i?a.i:a.index));case 6:const i=t,c=i.m||i.modifier;return e.linked(formatMessagePart(e,i.k||i.key),c?formatMessagePart(e,c):void 0,e.type);case 7:const l=t;return l.v||l.value;case 8:const u=t;return u.v||u.value;default:throw new Error(`unhandled node type on format message part: ${r}`)}}const defaultOnCacheKey=e=>e;let compileCache=Object.create(null);function clearCompileCache(){compileCache=Object.create(null)}const isMessageAST=e=>isObject(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);function baseCompile(e,t={}){let r=!1;const n=t.onError||defaultOnError;return t.onError=e=>{r=!0,n(e)},{...baseCompile$1(e,t),detectError:r}}const compileToFunction=(e,t)=>{if(!isString(e))throw Error(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE);{!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{code:o,detectError:s}=baseCompile(e,t),a=new Function(`return ${o}`)();return s?a:compileCache[r]=a}};function compile(e,t){if(isString(e)){!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{ast:o,detectError:s}=baseCompile(e,{...t,location:!1,jit:!0}),a=format(o);return s?a:compileCache[r]=a}{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:n,unresolving:o,messageCompiler:s,fallbackLocale:a,messages:i}=e,[c,l]=parseTranslateArgs(...t),u=isBoolean(l.missingWarn)?l.missingWarn:e.missingWarn,E=isBoolean(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=isBoolean(l.escapeParameter)?l.escapeParameter:e.escapeParameter,m=!!l.resolvedMessage,C=isString(l.default)||isBoolean(l.default)?isBoolean(l.default)?s?c:()=>c:l.default:r?s?c:()=>c:"",_=r||""!==C,p=getLocale(e,l);f&&escapeParams(l);let[d,N,T]=m?[c,p,i[p]||{}]:resolveMessageFormat(e,c,p,a,E,u),g=d,A=c;if(m||isString(g)||isMessageAST(g)||isMessageFunction(g)||_&&(g=C,A=g),!(m||(isString(g)||isMessageAST(g)||isMessageFunction(g))&&isString(N)))return o?-1:c;let L=!1;const O=isMessageFunction(g)?g:compileMessageFormat(e,c,N,g,A,(()=>{L=!0}));if(L)return g;const S=evaluateMessage(e,O,createMessageContext(getMessageContextOptions(e,N,T,l)));return n?n(S,c):S}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,n,o,s){const{messages:a,onWarn:i,messageResolver:c,localeFallbacker:l}=e,u=l(e,n,r);let E,f={},m=null;for(let C=0;C<u.length&&(E=u[C],f=a[E]||{},null===(m=c(f,t))&&(m=f[t]),!(isString(m)||isMessageAST(m)||isMessageFunction(m)));C++){const r=handleMissing(e,t,E,s,"translate");r!==t&&(m=r)}return[m,E,f]}function compileMessageFormat(e,t,r,n,o,s){const{messageCompiler:a,warnHtmlMessage:i}=e;if(isMessageFunction(n)){const e=n;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==a){const e=()=>n;return e.locale=r,e.key=t,e}const c=a(n,getCompileContext(e,r,o,n,i,s));return c.locale=r,c.key=t,c.source=n,c}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,n]=e,o={};if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?o.plural=r:isString(r)?o.default=r:isPlainObject(r)&&!isEmptyObject(r)?o.named=r:isArray(r)&&(o.list=r),isNumber(n)?o.plural=n:isString(n)?o.default=n:isPlainObject(n)&&assign(o,n),[s,o]}function getCompileContext(e,t,r,n,o,s){return{locale:t,key:r,warnHtmlMessage:o,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,n){const{modifiers:o,pluralRules:s,messageResolver:a,fallbackLocale:i,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,E={locale:t,modifiers:o,pluralRules:s,messages:n=>{let o=a(r,n);if(null==o&&u){const[,,e]=resolveMessageFormat(u,n,t,i,c,l);o=a(e,n)}if(isString(o)||isMessageAST(o)){let r=!1;const s=compileMessageFormat(e,n,t,o,n,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:s}return isMessageFunction(o)?o:NOOP_MESSAGE_FUNCTION}};return e.processor&&(E.processor=e.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),isNumber(n.plural)&&(E.pluralIndex=n.plural),E}function datetime(e,...t){const{datetimeFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[c,l,u,E]=parseDateTimeArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,C=getLocale(e,u),_=a(e,o,C);if(!isString(c)||""===c)return new Intl.DateTimeFormat(C,E).format(l);let p,d={},N=null;for(let A=0;A<_.length&&(p=_[A],d=r[p]||{},N=d[c],!isPlainObject(N));A++)handleMissing(e,c,p,f,"datetime format");if(!isPlainObject(N)||!isString(p))return n?-1:c;let T=`${p}__${c}`;isEmptyObject(E)||(T=`${T}__${JSON.stringify(E)}`);let g=i.get(T);return g||(g=new Intl.DateTimeFormat(p,assign({},N,E)),i.set(T,g)),m?g.formatToParts(l):g.format(l)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,n,o]=e,s={};let a,i={};if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();a=new Date(r);try{a.toISOString()}catch(c){throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);a=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);a=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(i=n),isPlainObject(o)&&(i=o),[s.key||"",a,s,i]}function clearDateTimeFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__datetimeFormatters.has(e)&&n.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[c,l,u,E]=parseNumberArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,C=getLocale(e,u),_=a(e,o,C);if(!isString(c)||""===c)return new Intl.NumberFormat(C,E).format(l);let p,d={},N=null;for(let A=0;A<_.length&&(p=_[A],d=r[p]||{},N=d[c],!isPlainObject(N));A++)handleMissing(e,c,p,f,"number format");if(!isPlainObject(N)||!isString(p))return n?-1:c;let T=`${p}__${c}`;isEmptyObject(E)||(T=`${T}__${JSON.stringify(E)}`);let g=i.get(T);return g||(g=new Intl.NumberFormat(p,assign({},N,E)),i.set(T,g)),m?g.formatToParts(l):g.format(l)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,n,o]=e,s={};let a={};if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?a[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(a=n),isPlainObject(o)&&(a=o),[s.key||"",i,s,a]}function clearNumberFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__numberFormatters.has(e)&&n.__numberFormatters.delete(e)}}export{CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,compileToFunction,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getLocale,getWarnMessage,handleMissing,initI18nDevTools,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveLocale,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale}; |
/*! | ||
* core-base v9.9.1 | ||
* core-base v9.10.0 | ||
* (c) 2024 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
var IntlifyCoreBase=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=(e,t,n)=>r({l:e,k:t,s:n}),r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),s=e=>"[object Date]"===N(e),a=e=>"[object RegExp]"===N(e),c=e=>L(e)&&0===Object.keys(e).length,l=Object.assign;function i(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const u=Array.isArray,f=e=>"function"==typeof e,E=e=>"string"==typeof e,_=e=>"boolean"==typeof e,m=e=>null!==e&&"object"==typeof e,d=e=>m(e)&&f(e.then)&&f(e.catch),p=Object.prototype.toString,N=e=>p.call(e),L=e=>{if(!m(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object};function T(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}function A(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function C(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const k={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17};function h(e,t,n={}){const{domain:r,messages:o,args:s}=n,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=r,a}function O(e){throw e}k.EXPECTED_TOKEN,k.INVALID_TOKEN_IN_PLACEHOLDER,k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,k.UNKNOWN_ESCAPE_SEQUENCE,k.INVALID_UNICODE_ESCAPE_SEQUENCE,k.UNBALANCED_CLOSING_BRACE,k.UNTERMINATED_CLOSING_BRACE,k.EMPTY_PLACEHOLDER,k.NOT_ALLOW_NEST_PLACEHOLDER,k.INVALID_LINKED_FORMAT,k.MUST_HAVE_MESSAGES_IN_PLURAL,k.UNEXPECTED_EMPTY_LINKED_MODIFIER,k.UNEXPECTED_EMPTY_LINKED_KEY,k.UNEXPECTED_LEXICAL_ANALYSIS,k.UNHANDLED_CODEGEN_NODE_TYPE,k.UNHANDLED_MINIFIER_NODE_TYPE;const I=" ",g="\r",S="\n",y=String.fromCharCode(8232),b=String.fromCharCode(8233);function P(e){const t=e;let n=0,r=1,o=1,s=0;const a=e=>t[e]===g&&t[e+1]===S,c=e=>t[e]===b,l=e=>t[e]===y,i=e=>a(e)||(e=>t[e]===S)(e)||c(e)||l(e),u=e=>a(e)||c(e)||l(e)?S:t[e];function f(){return s=0,i(n)&&(r++,o=0),a(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+s),next:f,peek:function(){return a(n+s)&&s++,s++,t[n+s]},reset:function(){n=0,r=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=n+s;for(;e!==n;)f();s=0}}}const D=void 0,R=".",M="'";function U(e,t={}){const n=!1!==t.location,r=P(e),o=()=>r.index(),s=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},a=s(),c=o(),l={currentType:14,offset:c,startLoc:a,endLoc:a,lastType:14,lastOffset:c,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},i=()=>l,{onError:u}=t;function f(e,t,r){e.endLoc=s(),e.currentType=t;const o={type:t};return n&&(o.loc=C(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const E=e=>f(e,14);function _(e,t){return e.currentChar()===t?(e.next(),t):(k.EXPECTED_TOKEN,s(),"")}function m(e){let t="";for(;e.currentPeek()===I||e.currentPeek()===S;)t+=e.currentPeek(),e.peek();return t}function d(e){const t=m(e);return e.skipToPeek(),t}function p(e){if(e===D)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function N(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=function(e){if(e===D)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function L(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const n=(t=!1,r="",o=!1)=>{const s=e.currentPeek();return"{"===s?"%"!==r&&t:"@"!==s&&s?"%"===s?(e.peek(),n(t,"%",!0)):"|"===s?!("%"!==r&&!o)||!(r===I||r===S):s===I?(e.peek(),n(!0,I,o)):s!==S||(e.peek(),n(!0,S,o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function A(e,t){const n=e.currentChar();return n===D?D:t(n)?(e.next(),n):null}function h(e){return A(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function O(e){return A(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function g(e){return A(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function y(e){let t="",n="";for(;t=O(e);)n+=t;return n}function b(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!T(e))break;t+=n,e.next()}else if(n===I||n===S)if(T(e))t+=n,e.next();else{if(L(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function U(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return v(e,t,4);case"U":return v(e,t,6);default:return k.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function v(e,t,n){_(e,t);let r="";for(let o=0;o<n;o++){const t=g(e);if(!t){k.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}r+=t}return`\\${t}${r}`}function F(e){d(e);const t=_(e,"|");return d(e),t}function x(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(k.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),n=f(t,2,"{"),d(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&(k.EMPTY_PLACEHOLDER,s()),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&d(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&(k.UNTERMINATED_CLOSING_BRACE,s()),n=w(e,t)||E(t),t.braceNest=0,n;default:let r=!0,o=!0,a=!0;if(L(e))return t.braceNest>0&&(k.UNTERMINATED_CLOSING_BRACE,s()),n=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return k.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,W(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){d(e);let t="",n="";for(;t=h(e);)n+=t;return e.currentChar()===D&&(k.UNTERMINATED_CLOSING_BRACE,s()),n}(e)),d(e),n;if(o=N(e,t))return n=f(t,6,function(e){d(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${y(e)}`):t+=y(e),e.currentChar()===D&&(k.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),d(e),n;if(a=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=e.currentPeek()===M;return e.resetPeek(),r}(e,t))return n=f(t,7,function(e){d(e),_(e,"'");let t="",n="";const r=e=>e!==M&&e!==S;for(;t=A(e,r);)n+="\\"===t?U(e):t;const o=e.currentChar();return o===S||o===D?(k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),o===S&&(e.next(),_(e,"'")),n):(_(e,"'"),n)}(e)),d(e),n;if(!r&&!o&&!a)return n=f(t,13,function(e){d(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&e!==I&&e!==S;for(;t=A(e,r);)n+=t;return n}(e)),k.INVALID_TOKEN_IN_PLACEHOLDER,s(),n.value,d(e),n}return n}function w(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==S&&o!==I||(k.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return d(e),e.next(),f(t,9,".");case":":return d(e),e.next(),f(t,10,":");default:return L(e)?(r=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(8!==n)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(d(e),w(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t)?(d(e),f(t,12,function(e){let t="",n="";for(;t=h(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?p(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===I||!t)&&(t===S?(e.peek(),r()):p(t))},o=r();return e.resetPeek(),o}(e,t)?(d(e),"{"===o?x(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&"("!==o&&")"!==o&&o?o===I?r:o===S||o===R?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&(k.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,W(e,t))}}function W(e,t){let n={type:14};if(t.braceNest>0)return x(e,t)||E(t);if(t.inLinked)return w(e,t)||E(t);switch(e.currentChar()){case"{":return x(e,t)||E(t);case"}":return k.UNBALANCED_CLOSING_BRACE,s(),e.next(),f(t,3,"}");case"@":return w(e,t)||E(t);default:if(L(e))return n=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:r,hasSpace:o}=function(e){const t=m(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(r)return o?f(t,0,b(e)):f(t,4,function(e){d(e);const t=e.currentChar();return"%"!==t&&(k.EXPECTED_TOKEN,s()),e.next(),"%"}(e));if(T(e))return f(t,0,b(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:a}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=a,l.offset=o(),l.startLoc=s(),r.currentChar()===D?f(l,14):W(r,l)},currentOffset:o,currentPosition:s,context:i}}const v=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function F(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function x(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e};return t&&(o.start=n,o.end=n,o.loc={start:r,end:r}),o}function o(e,n,r,o){o&&(e.type=o),t&&(e.end=n,e.loc&&(e.loc.end=r))}function s(e,t){const n=e.context(),s=r(3,n.offset,n.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(5,s,a);return c.index=parseInt(t,10),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function c(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(4,s,a);return c.key=t,e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function i(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(9,s,a);return c.value=t.replace(v,F),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function u(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(8,s,a);return 12!==t.type?(k.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,c.value="",o(c,s,a),{nextConsumeToken:t,node:c}):(null==t.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,w(t)),c.value=t.value||"",o(c,e.currentOffset(),e.currentPosition()),{node:c})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=function(e,t){const n=e.context(),s=r(7,n.offset,n.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 5:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=c(e,s.value||"");break;case 6:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=a(e,s.value||"");break;case 7:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=i(e,s.value||"");break;default:k.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const l=e.context(),u=r(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),n.key=u,o(n,l.offset,l.startLoc),{nextConsumeToken:s,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function f(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let l=null;do{const r=l||e.nextToken();switch(l=null,r.type){case 0:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(s(e,r.value||""));break;case 6:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(a(e,r.value||""));break;case 5:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(c(e,r.value||""));break;case 7:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(i(e,r.value||""));break;case 8:const o=u(e);n.items.push(o.node),l=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function E(e){const t=e.context(),{offset:n,startLoc:s}=t,a=f(e);return 14===t.currentType?a:function(e,t,n,s){const a=e.context();let c=0===s.items.length;const l=r(1,t,n);l.cases=[],l.cases.push(s);do{const t=f(e);c||(c=0===t.items.length),l.cases.push(t)}while(14!==a.currentType);return c&&k.MUST_HAVE_MESSAGES_IN_PLURAL,o(l,e.currentOffset(),e.currentPosition()),l}(e,n,s,a)}return{parse:function(n){const s=U(n,l({},e)),a=s.context(),c=r(0,a.offset,a.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=E(s),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),14!==a.currentType&&(k.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,n[a.offset]),o(c,s.currentOffset(),s.currentPosition()),c}}}function w(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function W(e,t){for(let n=0;n<e.length;n++)X(e[n],t)}function X(e,t){switch(e.type){case 1:W(e.cases,t),t.helper("plural");break;case 2:W(e.items,t);break;case 6:X(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function G(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&X(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function K(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];if(3!==r.type&&9!==r.type)break;if(null==r.value)break;t.push(r.value)}if(t.length===e.items.length){e.static=T(t);for(let t=0;t<e.items.length;t++){const n=e.items[t];3!==n.type&&9!==n.type||delete n.value}}}}function Y(e){switch(e.t=e.type,e.type){case 0:const t=e;Y(t.body),t.b=t.body,delete t.body;break;case 1:const n=e,r=n.cases;for(let e=0;e<r.length;e++)Y(r[e]);n.c=r,delete n.cases;break;case 2:const o=e,s=o.items;for(let e=0;e<s.length;e++)Y(s[e]);o.i=s,delete o.items,o.static&&(o.s=o.static,delete o.static);break;case 3:case 9:case 8:case 7:const a=e;a.value&&(a.v=a.value,delete a.value);break;case 6:const c=e;Y(c.key),c.k=c.key,delete c.key,c.modifier&&(Y(c.modifier),c.m=c.modifier,delete c.modifier);break;case 5:const l=e;l.i=l.index,delete l.index;break;case 4:const i=e;i.k=i.key,delete i.key}delete e.type}function $(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?$(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&($(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let s=0;s<o&&($(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),$(e,t.key),t.modifier?(e.push(", "),$(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const V=(e,t={})=>{const n=E(t.mode)?t.mode:"normal",r=E(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,c={filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};function l(e,t){c.code+=e}function i(e,t=!0){const n=t?o:"";l(s?n+" ".repeat(e):n)}return a&&e.loc&&(c.source=e.loc.source),{context:()=>c,push:l,indent:function(e=!0){const t=++c.indentLevel;e&&i(t)},deindent:function(e=!0){const t=--c.indentLevel;e&&i(t)},newline:function(){i(c.indentLevel)},helper:e=>`_${e}`,needIndent:()=>c.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:s,needIndent:a});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(a),c.length>0&&(l.push(`const { ${T(c.map((e=>`${e}: _${e}`)),", ")} } = ctx`),l.newline()),l.push("return "),$(l,e),l.deindent(a),l.push("}"),delete e.helpers;const{code:i,map:u}=l.context();return{ast:e,code:i,map:u?u.toJSON():void 0}};function H(e,t={}){const n=l({},t),r=!!n.jit,o=!!n.minify,s=null==n.optimize||n.optimize,a=x(n).parse(e);return r?(s&&function(e){const t=e.body;2===t.type?K(t):t.cases.forEach((e=>K(e)))}(a),o&&Y(a),{ast:a,code:""}):(G(a,n),V(a,n))}const B=[];B[0]={w:[0],i:[3,0],"[":[4],o:[7]},B[1]={w:[1],".":[2],"[":[4],o:[7]},B[2]={w:[2],i:[3,0],0:[3,0]},B[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},B[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},B[5]={"'":[4,0],o:8,l:[5,0]},B[6]={'"':[4,0],o:8,l:[6,0]};const j=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function z(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Q(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,j.test(n)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var n}function J(e){const t=[];let n,r,o,s,a,c,l,i=-1,u=0,f=0;const E=[];function _(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,o="\\"+t,E[0](),!0}for(E[0]=()=>{void 0===r?r=o:r+=o},E[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},E[2]=()=>{E[0](),f++},E[3]=()=>{if(f>0)f--,u=4,E[0]();else{if(f=0,void 0===r)return!1;if(r=Q(r),!1===r)return!1;E[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!_()){if(s=z(n),l=B[u],a=l[s]||l.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(c=E[a[1]],c&&(o=n,!1===c())))return;if(7===u)return t}}const Z=new Map;function q(e,t){return m(e)?e[t]:null}const ee=e=>e,te=e=>"",ne="text",re=e=>0===e.length?"":T(e),oe=e=>null==e?"":u(e)||L(e)&&e.toString===p?JSON.stringify(e,null,2):String(e);function se(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function ae(e={}){const t=e.locale,n=function(e){const t=o(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(o(e.named.count)||o(e.named.n))?o(e.named.count)?e.named.count:o(e.named.n)?e.named.n:t:t}(e),r=m(e.pluralRules)&&E(t)&&f(e.pluralRules[t])?e.pluralRules[t]:se,s=m(e.pluralRules)&&E(t)&&f(e.pluralRules[t])?se:void 0,a=e.list||[],c=e.named||{};o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,c);function i(t){const n=f(e.messages)?e.messages(t):!!m(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):te)}const _=L(e.processor)&&f(e.processor.normalize)?e.processor.normalize:re,d=L(e.processor)&&f(e.processor.interpolate)?e.processor.interpolate:oe,p={list:e=>a[e],named:e=>c[e],plural:e=>e[r(n,e.length,s)],linked:(t,...n)=>{const[r,o]=n;let s="text",a="";1===n.length?m(r)?(a=r.modifier||a,s=r.type||s):E(r)&&(a=r||a):2===n.length&&(E(r)&&(a=r||a),E(o)&&(s=o||s));const c=i(t)(p),l="vnode"===s&&u(c)&&a?c[0]:c;return a?(f=a,e.modifiers?e.modifiers[f]:ee)(l,s):l;var f},message:i,type:L(e.processor)&&E(e.processor.type)?e.processor.type:ne,interpolate:d,normalize:_,values:l({},a,c)};return p}let ce=null;const le=ie("function:translate");function ie(e){return t=>ce&&ce.emit(e,t)}const ue={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},fe={[ue.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[ue.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[ue.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[ue.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[ue.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[ue.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[ue.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};const Ee=k.__EXTEND_POINT__,_e=function(e){let t=e;return()=>++t}(Ee),me={INVALID_ARGUMENT:Ee,INVALID_DATE_ARGUMENT:_e(),INVALID_ISO_DATE_ARGUMENT:_e(),NOT_SUPPORT_NON_STRING_MESSAGE:_e(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:_e(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:_e(),NOT_SUPPORT_LOCALE_TYPE:_e(),__EXTEND_POINT__:_e()};function de(e,t){return null!=t.locale?Ne(t.locale):Ne(e.locale)}let pe;function Ne(e){if(E(e))return e;if(f(e)){if(e.resolvedOnce&&null!=pe)return pe;if("Function"===e.constructor.name){const t=e();if(d(t))throw Error(me.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return pe=t}throw Error(me.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(me.NOT_SUPPORT_LOCALE_TYPE)}function Le(e,t,n){return[...new Set([n,...u(t)?t:m(t)?Object.keys(t):E(t)?[t]:[n]])]}function Te(e,t,n){let r=!0;for(let o=0;o<t.length&&_(r);o++){const s=t[o];E(s)&&(r=Ae(e,t[o],n))}return r}function Ae(e,t,n){let r;const o=t.split("-");do{r=Ce(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function Ce(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(u(n)||L(n))&&n[o]&&(r=n[o])}return r}me.INVALID_ARGUMENT,me.INVALID_DATE_ARGUMENT,me.INVALID_ISO_DATE_ARGUMENT,me.NOT_SUPPORT_NON_STRING_MESSAGE,me.NOT_SUPPORT_LOCALE_PROMISE_VALUE,me.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,me.NOT_SUPPORT_LOCALE_TYPE;const ke="9.9.1",he="en-US",Oe=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let Ie,ge,Se;let ye=null;let be=null;let Pe=0;function De(e,t,n,r,o){const{missing:s,onWarn:a}=e;if(null!==s){const r=s(e,n,t,o);return E(r)?r:t}return t}function Re(e){return t=>function(e,t){const n=t.b||t.body;if(1===(n.t||n.type)){const t=n,r=t.c||t.cases;return e.plural(r.reduce(((t,n)=>[...t,Me(e,n)]),[]))}return Me(e,n)}(t,e)}function Me(e,t){const n=t.s||t.static;if(n)return"text"===e.type?n:e.normalize([n]);{const n=(t.i||t.items).reduce(((t,n)=>[...t,Ue(e,n)]),[]);return e.normalize(n)}}function Ue(e,t){const n=t.t||t.type;switch(n){case 3:const r=t;return r.v||r.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const a=t;return e.interpolate(e.list(null!=a.i?a.i:a.index));case 6:const c=t,l=c.m||c.modifier;return e.linked(Ue(e,c.k||c.key),l?Ue(e,l):void 0,e.type);case 7:const i=t;return i.v||i.value;case 8:const u=t;return u.v||u.value;default:throw new Error(`unhandled node type on format message part: ${n}`)}}const ve=e=>e;let Fe=Object.create(null);const xe=e=>m(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);function we(e,t={}){let n=!1;const r=t.onError||O;return t.onError=e=>{n=!0,r(e)},{...H(e,t),detectError:n}}const We=()=>"",Xe=e=>f(e);function Ge(e,t,n,r,o,s){const{messages:a,onWarn:c,messageResolver:l,localeFallbacker:i}=e,u=i(e,r,n);let f,_={},m=null;for(let d=0;d<u.length&&(f=u[d],_=a[f]||{},null===(m=l(_,t))&&(m=_[t]),!(E(m)||xe(m)||Xe(m)));d++){const n=De(e,t,f,0,"translate");n!==t&&(m=n)}return[m,f,_]}function Ke(e,t,r,o,s,a){const{messageCompiler:c,warnHtmlMessage:l}=e;if(Xe(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==c){const e=()=>o;return e.locale=r,e.key=t,e}const i=c(o,function(e,t,r,o,s,a){return{locale:t,key:r,warnHtmlMessage:s,onError:e=>{throw a&&a(e),e},onCacheKey:e=>n(t,r,e)}}(0,r,s,0,l,a));return i.locale=r,i.key=t,i.source=o,i}function Ye(...e){const[t,n,r]=e,s={};if(!(E(t)||o(t)||Xe(t)||xe(t)))throw Error(me.INVALID_ARGUMENT);const a=o(t)?String(t):(Xe(t),t);return o(n)?s.plural=n:E(n)?s.default=n:L(n)&&!c(n)?s.named=n:u(n)&&(s.list=n),o(r)?s.plural=r:E(r)?s.default=r:L(r)&&l(s,r),[a,s]}const $e=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Ve(...e){const[t,n,r,a]=e,c={};let l,i={};if(E(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(me.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();l=new Date(n);try{l.toISOString()}catch(u){throw Error(me.INVALID_ISO_DATE_ARGUMENT)}}else if(s(t)){if(isNaN(t.getTime()))throw Error(me.INVALID_DATE_ARGUMENT);l=t}else{if(!o(t))throw Error(me.INVALID_ARGUMENT);l=t}return E(n)?c.key=n:L(n)&&Object.keys(n).forEach((e=>{$e.includes(e)?i[e]=n[e]:c[e]=n[e]})),E(r)?c.locale=r:L(r)&&(i=r),L(a)&&(i=a),[c.key||"",l,c,i]}const He=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Be(...e){const[t,n,r,s]=e,a={};let c={};if(!o(t))throw Error(me.INVALID_ARGUMENT);const l=t;return E(n)?a.key=n:L(n)&&Object.keys(n).forEach((e=>{He.includes(e)?c[e]=n[e]:a[e]=n[e]})),E(r)?a.locale=r:L(r)&&(c=r),L(s)&&(c=s),[a.key||"",l,a,c]}return e.CompileErrorCodes=k,e.CoreErrorCodes=me,e.CoreWarnCodes=ue,e.DATETIME_FORMAT_OPTIONS_KEYS=$e,e.DEFAULT_LOCALE=he,e.DEFAULT_MESSAGE_DATA_TYPE=ne,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=He,e.VERSION=ke,e.clearCompileCache=function(){Fe=Object.create(null)},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=function(e,t){if(E(e)){!_(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||ve)(e),r=Fe[n];if(r)return r;const{ast:o,detectError:s}=we(e,{...t,location:!1,jit:!0}),a=Re(o);return s?a:Fe[n]=a}{const t=e.cacheKey;if(t){const n=Fe[t];return n||(Fe[t]=Re(e))}return Re(e)}},e.compileToFunction=(e,t)=>{if(!E(e))throw Error(me.NOT_SUPPORT_NON_STRING_MESSAGE);{!_(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||ve)(e),r=Fe[n];if(r)return r;const{code:o,detectError:s}=we(e,t),a=new Function(`return ${o}`)();return s?a:Fe[n]=a}},e.createCompileError=h,e.createCoreContext=function(e={}){const t=f(e.onWarn)?e.onWarn:A,n=E(e.version)?e.version:ke,r=E(e.locale)||f(e.locale)?e.locale:he,o=f(r)?he:r,s=u(e.fallbackLocale)||L(e.fallbackLocale)||E(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,c=L(e.messages)?e.messages:{[o]:{}},i=L(e.datetimeFormats)?e.datetimeFormats:{[o]:{}},d=L(e.numberFormats)?e.numberFormats:{[o]:{}},p=l({},e.modifiers||{},{upper:(e,t)=>"text"===t&&E(e)?e.toUpperCase():"vnode"===t&&m(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&E(e)?e.toLowerCase():"vnode"===t&&m(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&E(e)?Oe(e):"vnode"===t&&m(e)&&"__v_isVNode"in e?Oe(e.children):e}),N=e.pluralRules||{},T=f(e.missing)?e.missing:null,C=!_(e.missingWarn)&&!a(e.missingWarn)||e.missingWarn,k=!_(e.fallbackWarn)&&!a(e.fallbackWarn)||e.fallbackWarn,h=!!e.fallbackFormat,O=!!e.unresolving,I=f(e.postTranslation)?e.postTranslation:null,g=L(e.processor)?e.processor:null,S=!_(e.warnHtmlMessage)||e.warnHtmlMessage,y=!!e.escapeParameter,b=f(e.messageCompiler)?e.messageCompiler:Ie,P=f(e.messageResolver)?e.messageResolver:ge||q,D=f(e.localeFallbacker)?e.localeFallbacker:Se||Le,R=m(e.fallbackContext)?e.fallbackContext:void 0,M=e,U=m(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,v=m(M.__numberFormatters)?M.__numberFormatters:new Map,F=m(M.__meta)?M.__meta:{};Pe++;const x={version:n,cid:Pe,locale:r,fallbackLocale:s,messages:c,modifiers:p,pluralRules:N,missing:T,missingWarn:C,fallbackWarn:k,fallbackFormat:h,unresolving:O,postTranslation:I,processor:g,warnHtmlMessage:S,escapeParameter:y,messageCompiler:b,messageResolver:P,localeFallbacker:D,fallbackContext:R,onWarn:t,__meta:F};return x.datetimeFormats=i,x.numberFormats=d,x.__datetimeFormatters=U,x.__numberFormatters=v,x},e.createCoreError=function(e){return h(e,null,void 0)},e.createMessageContext=ae,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[u,f,m,d]=Ve(...t);_(m.missingWarn)?m.missingWarn:e.missingWarn,_(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const p=!!m.part,N=de(e,m),T=a(e,o,N);if(!E(u)||""===u)return new Intl.DateTimeFormat(N,d).format(f);let A,C={},k=null;for(let c=0;c<T.length&&(A=T[c],C=n[A]||{},k=C[u],!L(k));c++)De(e,u,A,0,"datetime format");if(!L(k)||!E(A))return r?-1:u;let h=`${A}__${u}`;c(d)||(h=`${h}__${JSON.stringify(d)}`);let O=i.get(h);return O||(O=new Intl.DateTimeFormat(A,l({},k,d)),i.set(h,O)),p?O.formatToParts(f):O.format(f)},e.fallbackWithLocaleChain=function(e,t,n){const r=E(n)?n:he,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let e=[n];for(;u(e);)e=Te(s,e,t);const a=u(t)||!L(t)?t:t.default?t.default:null;e=E(a)?[a]:a,u(e)&&Te(s,e,!1),o.__localeChainCache.set(r,s)}return s},e.fallbackWithSimple=Le,e.getAdditionalMeta=()=>ye,e.getDevToolsHook=function(){return ce},e.getFallbackContext=()=>be,e.getLocale=de,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&m(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(fe[e],...n)},e.handleMissing=De,e.initI18nDevTools=function(e,t,n){ce&&ce.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isMessageAST=xe,e.isMessageFunction=Xe,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[u,f,m,d]=Be(...t);_(m.missingWarn)?m.missingWarn:e.missingWarn,_(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const p=!!m.part,N=de(e,m),T=a(e,o,N);if(!E(u)||""===u)return new Intl.NumberFormat(N,d).format(f);let A,C={},k=null;for(let c=0;c<T.length&&(A=T[c],C=n[A]||{},k=C[u],!L(k));c++)De(e,u,A,0,"number format");if(!L(k)||!E(A))return r?-1:u;let h=`${A}__${u}`;c(d)||(h=`${h}__${JSON.stringify(d)}`);let O=i.get(h);return O||(O=new Intl.NumberFormat(A,l({},k,d)),i.set(h,O)),p?O.formatToParts(f):O.format(f)},e.parse=J,e.parseDateTimeArgs=Ve,e.parseNumberArgs=Be,e.parseTranslateArgs=Ye,e.registerLocaleFallbacker=function(e){Se=e},e.registerMessageCompiler=function(e){Ie=e},e.registerMessageResolver=function(e){ge=e},e.resolveLocale=Ne,e.resolveValue=function(e,t){if(!m(e))return null;let n=Z.get(t);if(n||(n=J(t),n&&Z.set(t,n)),!n)return null;const r=n.length;let o=e,s=0;for(;s<r;){const e=o[n[s]];if(void 0===e)return null;if(f(o))return null;o=e,s++}return o},e.resolveWithKeyValue=q,e.setAdditionalMeta=e=>{ye=e},e.setDevToolsHook=function(e){ce=e},e.setFallbackContext=e=>{be=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:s,messageCompiler:a,fallbackLocale:c,messages:l}=e,[f,d]=Ye(...t),p=_(d.missingWarn)?d.missingWarn:e.missingWarn,N=_(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn,L=_(d.escapeParameter)?d.escapeParameter:e.escapeParameter,T=!!d.resolvedMessage,A=E(d.default)||_(d.default)?_(d.default)?a?f:()=>f:d.default:n?a?f:()=>f:"",C=n||""!==A,k=de(e,d);L&&function(e){u(e.list)?e.list=e.list.map((e=>E(e)?i(e):e)):m(e.named)&&Object.keys(e.named).forEach((t=>{E(e.named[t])&&(e.named[t]=i(e.named[t]))}))}(d);let[h,O,I]=T?[f,k,l[k]||{}]:Ge(e,f,k,c,N,p),g=h,S=f;if(T||E(g)||xe(g)||Xe(g)||C&&(g=A,S=g),!(T||(E(g)||xe(g)||Xe(g))&&E(O)))return s?-1:f;let y=!1;const b=Xe(g)?g:Ke(e,f,O,g,S,(()=>{y=!0}));if(y)return g;const P=function(e,t,n,r){const{modifiers:s,pluralRules:a,messageResolver:c,fallbackLocale:l,fallbackWarn:i,missingWarn:u,fallbackContext:f}=e,_=r=>{let o=c(n,r);if(null==o&&f){const[,,e]=Ge(f,r,t,l,i,u);o=c(e,r)}if(E(o)||xe(o)){let n=!1;const s=Ke(e,r,t,o,r,(()=>{n=!0}));return n?We:s}return Xe(o)?o:We},m={locale:t,modifiers:s,pluralRules:a,messages:_};e.processor&&(m.processor=e.processor);r.list&&(m.list=r.list);r.named&&(m.named=r.named);o(r.plural)&&(m.pluralIndex=r.plural);return m}(e,O,I,d),D=function(e,t,n){const r=t(n);return r}(0,b,ae(P));return r?r(D,f):D},e.translateDevTools=le,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({}); | ||
var IntlifyCoreBase=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=(e,t,n)=>r({l:e,k:t,s:n}),r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),s=e=>"[object Date]"===N(e),a=e=>"[object RegExp]"===N(e),c=e=>L(e)&&0===Object.keys(e).length,l=Object.assign;function i(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const u=Array.isArray,f=e=>"function"==typeof e,E=e=>"string"==typeof e,_=e=>"boolean"==typeof e,m=e=>null!==e&&"object"==typeof e,d=e=>m(e)&&f(e.then)&&f(e.catch),p=Object.prototype.toString,N=e=>p.call(e),L=e=>{if(!m(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object};function T(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}function A(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function C(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const k={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17};function h(e,t,n={}){const{domain:r,messages:o,args:s}=n,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=r,a}function O(e){throw e}k.EXPECTED_TOKEN,k.INVALID_TOKEN_IN_PLACEHOLDER,k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,k.UNKNOWN_ESCAPE_SEQUENCE,k.INVALID_UNICODE_ESCAPE_SEQUENCE,k.UNBALANCED_CLOSING_BRACE,k.UNTERMINATED_CLOSING_BRACE,k.EMPTY_PLACEHOLDER,k.NOT_ALLOW_NEST_PLACEHOLDER,k.INVALID_LINKED_FORMAT,k.MUST_HAVE_MESSAGES_IN_PLURAL,k.UNEXPECTED_EMPTY_LINKED_MODIFIER,k.UNEXPECTED_EMPTY_LINKED_KEY,k.UNEXPECTED_LEXICAL_ANALYSIS,k.UNHANDLED_CODEGEN_NODE_TYPE,k.UNHANDLED_MINIFIER_NODE_TYPE;const I=" ",g="\r",S="\n",y=String.fromCharCode(8232),b=String.fromCharCode(8233);function P(e){const t=e;let n=0,r=1,o=1,s=0;const a=e=>t[e]===g&&t[e+1]===S,c=e=>t[e]===b,l=e=>t[e]===y,i=e=>a(e)||(e=>t[e]===S)(e)||c(e)||l(e),u=e=>a(e)||c(e)||l(e)?S:t[e];function f(){return s=0,i(n)&&(r++,o=0),a(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+s),next:f,peek:function(){return a(n+s)&&s++,s++,t[n+s]},reset:function(){n=0,r=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=n+s;for(;e!==n;)f();s=0}}}const D=void 0,R=".",M="'";function U(e,t={}){const n=!1!==t.location,r=P(e),o=()=>r.index(),s=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},a=s(),c=o(),l={currentType:14,offset:c,startLoc:a,endLoc:a,lastType:14,lastOffset:c,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},i=()=>l,{onError:u}=t;function f(e,t,r){e.endLoc=s(),e.currentType=t;const o={type:t};return n&&(o.loc=C(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const E=e=>f(e,14);function _(e,t){return e.currentChar()===t?(e.next(),t):(k.EXPECTED_TOKEN,s(),"")}function m(e){let t="";for(;e.currentPeek()===I||e.currentPeek()===S;)t+=e.currentPeek(),e.peek();return t}function d(e){const t=m(e);return e.skipToPeek(),t}function p(e){if(e===D)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function N(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=function(e){if(e===D)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function L(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const n=(t=!1,r="",o=!1)=>{const s=e.currentPeek();return"{"===s?"%"!==r&&t:"@"!==s&&s?"%"===s?(e.peek(),n(t,"%",!0)):"|"===s?!("%"!==r&&!o)||!(r===I||r===S):s===I?(e.peek(),n(!0,I,o)):s!==S||(e.peek(),n(!0,S,o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function A(e,t){const n=e.currentChar();return n===D?D:t(n)?(e.next(),n):null}function h(e){return A(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function O(e){return A(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function g(e){return A(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function y(e){let t="",n="";for(;t=O(e);)n+=t;return n}function b(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!T(e))break;t+=n,e.next()}else if(n===I||n===S)if(T(e))t+=n,e.next();else{if(L(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function U(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return v(e,t,4);case"U":return v(e,t,6);default:return k.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function v(e,t,n){_(e,t);let r="";for(let o=0;o<n;o++){const t=g(e);if(!t){k.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}r+=t}return`\\${t}${r}`}function F(e){d(e);const t=_(e,"|");return d(e),t}function x(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(k.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),n=f(t,2,"{"),d(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&(k.EMPTY_PLACEHOLDER,s()),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&d(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&(k.UNTERMINATED_CLOSING_BRACE,s()),n=w(e,t)||E(t),t.braceNest=0,n;default:let r=!0,o=!0,a=!0;if(L(e))return t.braceNest>0&&(k.UNTERMINATED_CLOSING_BRACE,s()),n=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return k.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,W(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){d(e);let t="",n="";for(;t=h(e);)n+=t;return e.currentChar()===D&&(k.UNTERMINATED_CLOSING_BRACE,s()),n}(e)),d(e),n;if(o=N(e,t))return n=f(t,6,function(e){d(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${y(e)}`):t+=y(e),e.currentChar()===D&&(k.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),d(e),n;if(a=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=e.currentPeek()===M;return e.resetPeek(),r}(e,t))return n=f(t,7,function(e){d(e),_(e,"'");let t="",n="";const r=e=>e!==M&&e!==S;for(;t=A(e,r);)n+="\\"===t?U(e):t;const o=e.currentChar();return o===S||o===D?(k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),o===S&&(e.next(),_(e,"'")),n):(_(e,"'"),n)}(e)),d(e),n;if(!r&&!o&&!a)return n=f(t,13,function(e){d(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&e!==I&&e!==S;for(;t=A(e,r);)n+=t;return n}(e)),k.INVALID_TOKEN_IN_PLACEHOLDER,s(),n.value,d(e),n}return n}function w(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==S&&o!==I||(k.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return d(e),e.next(),f(t,9,".");case":":return d(e),e.next(),f(t,10,":");default:return L(e)?(r=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(8!==n)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(d(e),w(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t)?(d(e),f(t,12,function(e){let t="",n="";for(;t=h(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?p(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===I||!t)&&(t===S?(e.peek(),r()):p(t))},o=r();return e.resetPeek(),o}(e,t)?(d(e),"{"===o?x(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&"("!==o&&")"!==o&&o?o===I?r:o===S||o===R?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&(k.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,W(e,t))}}function W(e,t){let n={type:14};if(t.braceNest>0)return x(e,t)||E(t);if(t.inLinked)return w(e,t)||E(t);switch(e.currentChar()){case"{":return x(e,t)||E(t);case"}":return k.UNBALANCED_CLOSING_BRACE,s(),e.next(),f(t,3,"}");case"@":return w(e,t)||E(t);default:if(L(e))return n=f(t,1,F(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:r,hasSpace:o}=function(e){const t=m(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(r)return o?f(t,0,b(e)):f(t,4,function(e){d(e);const t=e.currentChar();return"%"!==t&&(k.EXPECTED_TOKEN,s()),e.next(),"%"}(e));if(T(e))return f(t,0,b(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:a}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=a,l.offset=o(),l.startLoc=s(),r.currentChar()===D?f(l,14):W(r,l)},currentOffset:o,currentPosition:s,context:i}}const v=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function F(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function x(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e};return t&&(o.start=n,o.end=n,o.loc={start:r,end:r}),o}function o(e,n,r,o){o&&(e.type=o),t&&(e.end=n,e.loc&&(e.loc.end=r))}function s(e,t){const n=e.context(),s=r(3,n.offset,n.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(5,s,a);return c.index=parseInt(t,10),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function c(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(4,s,a);return c.key=t,e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function i(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(9,s,a);return c.value=t.replace(v,F),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function u(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:s,lastStartLoc:a}=n,c=r(8,s,a);return 12!==t.type?(k.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,c.value="",o(c,s,a),{nextConsumeToken:t,node:c}):(null==t.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,w(t)),c.value=t.value||"",o(c,e.currentOffset(),e.currentPosition()),{node:c})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=function(e,t){const n=e.context(),s=r(7,n.offset,n.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 5:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=c(e,s.value||"");break;case 6:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=a(e,s.value||"");break;case 7:null==s.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(s)),n.key=i(e,s.value||"");break;default:k.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const l=e.context(),u=r(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),n.key=u,o(n,l.offset,l.startLoc),{nextConsumeToken:s,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function f(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let l=null;do{const r=l||e.nextToken();switch(l=null,r.type){case 0:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(s(e,r.value||""));break;case 6:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(a(e,r.value||""));break;case 5:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(c(e,r.value||""));break;case 7:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,w(r)),n.items.push(i(e,r.value||""));break;case 8:const o=u(e);n.items.push(o.node),l=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function E(e){const t=e.context(),{offset:n,startLoc:s}=t,a=f(e);return 14===t.currentType?a:function(e,t,n,s){const a=e.context();let c=0===s.items.length;const l=r(1,t,n);l.cases=[],l.cases.push(s);do{const t=f(e);c||(c=0===t.items.length),l.cases.push(t)}while(14!==a.currentType);return c&&k.MUST_HAVE_MESSAGES_IN_PLURAL,o(l,e.currentOffset(),e.currentPosition()),l}(e,n,s,a)}return{parse:function(n){const s=U(n,l({},e)),a=s.context(),c=r(0,a.offset,a.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=E(s),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),14!==a.currentType&&(k.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,n[a.offset]),o(c,s.currentOffset(),s.currentPosition()),c}}}function w(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function W(e,t){for(let n=0;n<e.length;n++)X(e[n],t)}function X(e,t){switch(e.type){case 1:W(e.cases,t),t.helper("plural");break;case 2:W(e.items,t);break;case 6:X(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function G(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&X(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function K(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];if(3!==r.type&&9!==r.type)break;if(null==r.value)break;t.push(r.value)}if(t.length===e.items.length){e.static=T(t);for(let t=0;t<e.items.length;t++){const n=e.items[t];3!==n.type&&9!==n.type||delete n.value}}}}function Y(e){switch(e.t=e.type,e.type){case 0:const t=e;Y(t.body),t.b=t.body,delete t.body;break;case 1:const n=e,r=n.cases;for(let e=0;e<r.length;e++)Y(r[e]);n.c=r,delete n.cases;break;case 2:const o=e,s=o.items;for(let e=0;e<s.length;e++)Y(s[e]);o.i=s,delete o.items,o.static&&(o.s=o.static,delete o.static);break;case 3:case 9:case 8:case 7:const a=e;a.value&&(a.v=a.value,delete a.value);break;case 6:const c=e;Y(c.key),c.k=c.key,delete c.key,c.modifier&&(Y(c.modifier),c.m=c.modifier,delete c.modifier);break;case 5:const l=e;l.i=l.index,delete l.index;break;case 4:const i=e;i.k=i.key,delete i.key}delete e.type}function $(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?$(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&($(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let s=0;s<o&&($(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),$(e,t.key),t.modifier?(e.push(", "),$(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const V=(e,t={})=>{const n=E(t.mode)?t.mode:"normal",r=E(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,c={filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};function l(e,t){c.code+=e}function i(e,t=!0){const n=t?o:"";l(s?n+" ".repeat(e):n)}return a&&e.loc&&(c.source=e.loc.source),{context:()=>c,push:l,indent:function(e=!0){const t=++c.indentLevel;e&&i(t)},deindent:function(e=!0){const t=--c.indentLevel;e&&i(t)},newline:function(){i(c.indentLevel)},helper:e=>`_${e}`,needIndent:()=>c.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:s,needIndent:a});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(a),c.length>0&&(l.push(`const { ${T(c.map((e=>`${e}: _${e}`)),", ")} } = ctx`),l.newline()),l.push("return "),$(l,e),l.deindent(a),l.push("}"),delete e.helpers;const{code:i,map:u}=l.context();return{ast:e,code:i,map:u?u.toJSON():void 0}};function H(e,t={}){const n=l({},t),r=!!n.jit,o=!!n.minify,s=null==n.optimize||n.optimize,a=x(n).parse(e);return r?(s&&function(e){const t=e.body;2===t.type?K(t):t.cases.forEach((e=>K(e)))}(a),o&&Y(a),{ast:a,code:""}):(G(a,n),V(a,n))}const B=[];B[0]={w:[0],i:[3,0],"[":[4],o:[7]},B[1]={w:[1],".":[2],"[":[4],o:[7]},B[2]={w:[2],i:[3,0],0:[3,0]},B[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},B[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},B[5]={"'":[4,0],o:8,l:[5,0]},B[6]={'"':[4,0],o:8,l:[6,0]};const j=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function z(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Q(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,j.test(n)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var n}function J(e){const t=[];let n,r,o,s,a,c,l,i=-1,u=0,f=0;const E=[];function _(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,o="\\"+t,E[0](),!0}for(E[0]=()=>{void 0===r?r=o:r+=o},E[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},E[2]=()=>{E[0](),f++},E[3]=()=>{if(f>0)f--,u=4,E[0]();else{if(f=0,void 0===r)return!1;if(r=Q(r),!1===r)return!1;E[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!_()){if(s=z(n),l=B[u],a=l[s]||l.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(c=E[a[1]],c&&(o=n,!1===c())))return;if(7===u)return t}}const Z=new Map;function q(e,t){return m(e)?e[t]:null}const ee=e=>e,te=e=>"",ne="text",re=e=>0===e.length?"":T(e),oe=e=>null==e?"":u(e)||L(e)&&e.toString===p?JSON.stringify(e,null,2):String(e);function se(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function ae(e={}){const t=e.locale,n=function(e){const t=o(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(o(e.named.count)||o(e.named.n))?o(e.named.count)?e.named.count:o(e.named.n)?e.named.n:t:t}(e),r=m(e.pluralRules)&&E(t)&&f(e.pluralRules[t])?e.pluralRules[t]:se,s=m(e.pluralRules)&&E(t)&&f(e.pluralRules[t])?se:void 0,a=e.list||[],c=e.named||{};o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,c);function i(t){const n=f(e.messages)?e.messages(t):!!m(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):te)}const _=L(e.processor)&&f(e.processor.normalize)?e.processor.normalize:re,d=L(e.processor)&&f(e.processor.interpolate)?e.processor.interpolate:oe,p={list:e=>a[e],named:e=>c[e],plural:e=>e[r(n,e.length,s)],linked:(t,...n)=>{const[r,o]=n;let s="text",a="";1===n.length?m(r)?(a=r.modifier||a,s=r.type||s):E(r)&&(a=r||a):2===n.length&&(E(r)&&(a=r||a),E(o)&&(s=o||s));const c=i(t)(p),l="vnode"===s&&u(c)&&a?c[0]:c;return a?(f=a,e.modifiers?e.modifiers[f]:ee)(l,s):l;var f},message:i,type:L(e.processor)&&E(e.processor.type)?e.processor.type:ne,interpolate:d,normalize:_,values:l({},a,c)};return p}let ce=null;const le=ie("function:translate");function ie(e){return t=>ce&&ce.emit(e,t)}const ue={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},fe={[ue.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[ue.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[ue.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[ue.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[ue.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[ue.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[ue.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};const Ee=k.__EXTEND_POINT__,_e=function(e){let t=e;return()=>++t}(Ee),me={INVALID_ARGUMENT:Ee,INVALID_DATE_ARGUMENT:_e(),INVALID_ISO_DATE_ARGUMENT:_e(),NOT_SUPPORT_NON_STRING_MESSAGE:_e(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:_e(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:_e(),NOT_SUPPORT_LOCALE_TYPE:_e(),__EXTEND_POINT__:_e()};function de(e,t){return null!=t.locale?Ne(t.locale):Ne(e.locale)}let pe;function Ne(e){if(E(e))return e;if(f(e)){if(e.resolvedOnce&&null!=pe)return pe;if("Function"===e.constructor.name){const t=e();if(d(t))throw Error(me.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return pe=t}throw Error(me.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(me.NOT_SUPPORT_LOCALE_TYPE)}function Le(e,t,n){return[...new Set([n,...u(t)?t:m(t)?Object.keys(t):E(t)?[t]:[n]])]}function Te(e,t,n){let r=!0;for(let o=0;o<t.length&&_(r);o++){const s=t[o];E(s)&&(r=Ae(e,t[o],n))}return r}function Ae(e,t,n){let r;const o=t.split("-");do{r=Ce(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function Ce(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(u(n)||L(n))&&n[o]&&(r=n[o])}return r}me.INVALID_ARGUMENT,me.INVALID_DATE_ARGUMENT,me.INVALID_ISO_DATE_ARGUMENT,me.NOT_SUPPORT_NON_STRING_MESSAGE,me.NOT_SUPPORT_LOCALE_PROMISE_VALUE,me.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,me.NOT_SUPPORT_LOCALE_TYPE;const ke="9.10.0",he="en-US",Oe=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let Ie,ge,Se;let ye=null;let be=null;let Pe=0;function De(e,t,n,r,o){const{missing:s,onWarn:a}=e;if(null!==s){const r=s(e,n,t,o);return E(r)?r:t}return t}function Re(e){return t=>function(e,t){const n=t.b||t.body;if(1===(n.t||n.type)){const t=n,r=t.c||t.cases;return e.plural(r.reduce(((t,n)=>[...t,Me(e,n)]),[]))}return Me(e,n)}(t,e)}function Me(e,t){const n=t.s||t.static;if(n)return"text"===e.type?n:e.normalize([n]);{const n=(t.i||t.items).reduce(((t,n)=>[...t,Ue(e,n)]),[]);return e.normalize(n)}}function Ue(e,t){const n=t.t||t.type;switch(n){case 3:const r=t;return r.v||r.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const a=t;return e.interpolate(e.list(null!=a.i?a.i:a.index));case 6:const c=t,l=c.m||c.modifier;return e.linked(Ue(e,c.k||c.key),l?Ue(e,l):void 0,e.type);case 7:const i=t;return i.v||i.value;case 8:const u=t;return u.v||u.value;default:throw new Error(`unhandled node type on format message part: ${n}`)}}const ve=e=>e;let Fe=Object.create(null);const xe=e=>m(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);function we(e,t={}){let n=!1;const r=t.onError||O;return t.onError=e=>{n=!0,r(e)},{...H(e,t),detectError:n}}const We=()=>"",Xe=e=>f(e);function Ge(e,t,n,r,o,s){const{messages:a,onWarn:c,messageResolver:l,localeFallbacker:i}=e,u=i(e,r,n);let f,_={},m=null;for(let d=0;d<u.length&&(f=u[d],_=a[f]||{},null===(m=l(_,t))&&(m=_[t]),!(E(m)||xe(m)||Xe(m)));d++){const n=De(e,t,f,0,"translate");n!==t&&(m=n)}return[m,f,_]}function Ke(e,t,r,o,s,a){const{messageCompiler:c,warnHtmlMessage:l}=e;if(Xe(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==c){const e=()=>o;return e.locale=r,e.key=t,e}const i=c(o,function(e,t,r,o,s,a){return{locale:t,key:r,warnHtmlMessage:s,onError:e=>{throw a&&a(e),e},onCacheKey:e=>n(t,r,e)}}(0,r,s,0,l,a));return i.locale=r,i.key=t,i.source=o,i}function Ye(...e){const[t,n,r]=e,s={};if(!(E(t)||o(t)||Xe(t)||xe(t)))throw Error(me.INVALID_ARGUMENT);const a=o(t)?String(t):(Xe(t),t);return o(n)?s.plural=n:E(n)?s.default=n:L(n)&&!c(n)?s.named=n:u(n)&&(s.list=n),o(r)?s.plural=r:E(r)?s.default=r:L(r)&&l(s,r),[a,s]}const $e=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Ve(...e){const[t,n,r,a]=e,c={};let l,i={};if(E(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(me.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();l=new Date(n);try{l.toISOString()}catch(u){throw Error(me.INVALID_ISO_DATE_ARGUMENT)}}else if(s(t)){if(isNaN(t.getTime()))throw Error(me.INVALID_DATE_ARGUMENT);l=t}else{if(!o(t))throw Error(me.INVALID_ARGUMENT);l=t}return E(n)?c.key=n:L(n)&&Object.keys(n).forEach((e=>{$e.includes(e)?i[e]=n[e]:c[e]=n[e]})),E(r)?c.locale=r:L(r)&&(i=r),L(a)&&(i=a),[c.key||"",l,c,i]}const He=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Be(...e){const[t,n,r,s]=e,a={};let c={};if(!o(t))throw Error(me.INVALID_ARGUMENT);const l=t;return E(n)?a.key=n:L(n)&&Object.keys(n).forEach((e=>{He.includes(e)?c[e]=n[e]:a[e]=n[e]})),E(r)?a.locale=r:L(r)&&(c=r),L(s)&&(c=s),[a.key||"",l,a,c]}return e.CompileErrorCodes=k,e.CoreErrorCodes=me,e.CoreWarnCodes=ue,e.DATETIME_FORMAT_OPTIONS_KEYS=$e,e.DEFAULT_LOCALE=he,e.DEFAULT_MESSAGE_DATA_TYPE=ne,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=He,e.VERSION=ke,e.clearCompileCache=function(){Fe=Object.create(null)},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=function(e,t){if(E(e)){!_(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||ve)(e),r=Fe[n];if(r)return r;const{ast:o,detectError:s}=we(e,{...t,location:!1,jit:!0}),a=Re(o);return s?a:Fe[n]=a}{const t=e.cacheKey;if(t){const n=Fe[t];return n||(Fe[t]=Re(e))}return Re(e)}},e.compileToFunction=(e,t)=>{if(!E(e))throw Error(me.NOT_SUPPORT_NON_STRING_MESSAGE);{!_(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||ve)(e),r=Fe[n];if(r)return r;const{code:o,detectError:s}=we(e,t),a=new Function(`return ${o}`)();return s?a:Fe[n]=a}},e.createCompileError=h,e.createCoreContext=function(e={}){const t=f(e.onWarn)?e.onWarn:A,n=E(e.version)?e.version:ke,r=E(e.locale)||f(e.locale)?e.locale:he,o=f(r)?he:r,s=u(e.fallbackLocale)||L(e.fallbackLocale)||E(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:o,c=L(e.messages)?e.messages:{[o]:{}},i=L(e.datetimeFormats)?e.datetimeFormats:{[o]:{}},d=L(e.numberFormats)?e.numberFormats:{[o]:{}},p=l({},e.modifiers||{},{upper:(e,t)=>"text"===t&&E(e)?e.toUpperCase():"vnode"===t&&m(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&E(e)?e.toLowerCase():"vnode"===t&&m(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&E(e)?Oe(e):"vnode"===t&&m(e)&&"__v_isVNode"in e?Oe(e.children):e}),N=e.pluralRules||{},T=f(e.missing)?e.missing:null,C=!_(e.missingWarn)&&!a(e.missingWarn)||e.missingWarn,k=!_(e.fallbackWarn)&&!a(e.fallbackWarn)||e.fallbackWarn,h=!!e.fallbackFormat,O=!!e.unresolving,I=f(e.postTranslation)?e.postTranslation:null,g=L(e.processor)?e.processor:null,S=!_(e.warnHtmlMessage)||e.warnHtmlMessage,y=!!e.escapeParameter,b=f(e.messageCompiler)?e.messageCompiler:Ie,P=f(e.messageResolver)?e.messageResolver:ge||q,D=f(e.localeFallbacker)?e.localeFallbacker:Se||Le,R=m(e.fallbackContext)?e.fallbackContext:void 0,M=e,U=m(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,v=m(M.__numberFormatters)?M.__numberFormatters:new Map,F=m(M.__meta)?M.__meta:{};Pe++;const x={version:n,cid:Pe,locale:r,fallbackLocale:s,messages:c,modifiers:p,pluralRules:N,missing:T,missingWarn:C,fallbackWarn:k,fallbackFormat:h,unresolving:O,postTranslation:I,processor:g,warnHtmlMessage:S,escapeParameter:y,messageCompiler:b,messageResolver:P,localeFallbacker:D,fallbackContext:R,onWarn:t,__meta:F};return x.datetimeFormats=i,x.numberFormats=d,x.__datetimeFormatters=U,x.__numberFormatters=v,x},e.createCoreError=function(e){return h(e,null,void 0)},e.createMessageContext=ae,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[u,f,m,d]=Ve(...t);_(m.missingWarn)?m.missingWarn:e.missingWarn,_(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const p=!!m.part,N=de(e,m),T=a(e,o,N);if(!E(u)||""===u)return new Intl.DateTimeFormat(N,d).format(f);let A,C={},k=null;for(let c=0;c<T.length&&(A=T[c],C=n[A]||{},k=C[u],!L(k));c++)De(e,u,A,0,"datetime format");if(!L(k)||!E(A))return r?-1:u;let h=`${A}__${u}`;c(d)||(h=`${h}__${JSON.stringify(d)}`);let O=i.get(h);return O||(O=new Intl.DateTimeFormat(A,l({},k,d)),i.set(h,O)),p?O.formatToParts(f):O.format(f)},e.fallbackWithLocaleChain=function(e,t,n){const r=E(n)?n:he,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let e=[n];for(;u(e);)e=Te(s,e,t);const a=u(t)||!L(t)?t:t.default?t.default:null;e=E(a)?[a]:a,u(e)&&Te(s,e,!1),o.__localeChainCache.set(r,s)}return s},e.fallbackWithSimple=Le,e.getAdditionalMeta=()=>ye,e.getDevToolsHook=function(){return ce},e.getFallbackContext=()=>be,e.getLocale=de,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&m(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(fe[e],...n)},e.handleMissing=De,e.initI18nDevTools=function(e,t,n){ce&&ce.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isMessageAST=xe,e.isMessageFunction=Xe,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[u,f,m,d]=Be(...t);_(m.missingWarn)?m.missingWarn:e.missingWarn,_(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const p=!!m.part,N=de(e,m),T=a(e,o,N);if(!E(u)||""===u)return new Intl.NumberFormat(N,d).format(f);let A,C={},k=null;for(let c=0;c<T.length&&(A=T[c],C=n[A]||{},k=C[u],!L(k));c++)De(e,u,A,0,"number format");if(!L(k)||!E(A))return r?-1:u;let h=`${A}__${u}`;c(d)||(h=`${h}__${JSON.stringify(d)}`);let O=i.get(h);return O||(O=new Intl.NumberFormat(A,l({},k,d)),i.set(h,O)),p?O.formatToParts(f):O.format(f)},e.parse=J,e.parseDateTimeArgs=Ve,e.parseNumberArgs=Be,e.parseTranslateArgs=Ye,e.registerLocaleFallbacker=function(e){Se=e},e.registerMessageCompiler=function(e){Ie=e},e.registerMessageResolver=function(e){ge=e},e.resolveLocale=Ne,e.resolveValue=function(e,t){if(!m(e))return null;let n=Z.get(t);if(n||(n=J(t),n&&Z.set(t,n)),!n)return null;const r=n.length;let o=e,s=0;for(;s<r;){const e=o[n[s]];if(void 0===e)return null;if(f(o))return null;o=e,s++}return o},e.resolveWithKeyValue=q,e.setAdditionalMeta=e=>{ye=e},e.setDevToolsHook=function(e){ce=e},e.setFallbackContext=e=>{be=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:s,messageCompiler:a,fallbackLocale:c,messages:l}=e,[f,d]=Ye(...t),p=_(d.missingWarn)?d.missingWarn:e.missingWarn,N=_(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn,L=_(d.escapeParameter)?d.escapeParameter:e.escapeParameter,T=!!d.resolvedMessage,A=E(d.default)||_(d.default)?_(d.default)?a?f:()=>f:d.default:n?a?f:()=>f:"",C=n||""!==A,k=de(e,d);L&&function(e){u(e.list)?e.list=e.list.map((e=>E(e)?i(e):e)):m(e.named)&&Object.keys(e.named).forEach((t=>{E(e.named[t])&&(e.named[t]=i(e.named[t]))}))}(d);let[h,O,I]=T?[f,k,l[k]||{}]:Ge(e,f,k,c,N,p),g=h,S=f;if(T||E(g)||xe(g)||Xe(g)||C&&(g=A,S=g),!(T||(E(g)||xe(g)||Xe(g))&&E(O)))return s?-1:f;let y=!1;const b=Xe(g)?g:Ke(e,f,O,g,S,(()=>{y=!0}));if(y)return g;const P=function(e,t,n,r){const{modifiers:s,pluralRules:a,messageResolver:c,fallbackLocale:l,fallbackWarn:i,missingWarn:u,fallbackContext:f}=e,_=r=>{let o=c(n,r);if(null==o&&f){const[,,e]=Ge(f,r,t,l,i,u);o=c(e,r)}if(E(o)||xe(o)){let n=!1;const s=Ke(e,r,t,o,r,(()=>{n=!0}));return n?We:s}return Xe(o)?o:We},m={locale:t,modifiers:s,pluralRules:a,messages:_};e.processor&&(m.processor=e.processor);r.list&&(m.list=r.list);r.named&&(m.named=r.named);o(r.plural)&&(m.pluralIndex=r.plural);return m}(e,O,I,d),D=function(e,t,n){const r=t(n);return r}(0,b,ae(P));return r?r(D,f):D},e.translateDevTools=le,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({}); |
{ | ||
"name": "@intlify/core-base", | ||
"version": "9.9.1", | ||
"version": "9.10.0", | ||
"description": "@intlify/core-base", | ||
@@ -36,8 +36,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@intlify/message-compiler": "9.9.1", | ||
"@intlify/shared": "9.9.1" | ||
"@intlify/message-compiler": "9.10.0", | ||
"@intlify/shared": "9.10.0" | ||
}, | ||
"devDependencies": { | ||
"@intlify/devtools-if": "9.9.1", | ||
"@intlify/vue-devtools": "9.9.1" | ||
"@intlify/devtools-if": "9.10.0", | ||
"@intlify/vue-devtools": "9.10.0" | ||
}, | ||
@@ -44,0 +44,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
571042
+ Added@intlify/message-compiler@9.10.0(transitive)
+ Added@intlify/shared@9.10.0(transitive)
- Removed@intlify/message-compiler@9.9.1(transitive)
- Removed@intlify/shared@9.9.1(transitive)
Updated@intlify/shared@9.10.0