@intlify/core 9.3.0-beta.1 → 9.3.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +0,0 @@
1
- /*!
2
- * core v9.3.0-beta.1
3
- * (c) 2022 kazuya kawaguchi
4
- * Released under the MIT License.
5
- */
6
- const e="undefined"!=typeof window;let t,n;{const r=e&&window.performance;r&&r.mark&&r.measure&&r.clearMarks&&r.clearMeasures&&(t=e=>r.mark(e),n=(e,t,n)=>{r.measure(e,t,n),r.clearMarks(t),r.clearMarks(n)})}const r=/\{([0-9a-zA-Z]+)\}/g;function o(e,...t){return 1===t.length&&E(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(r,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}const a=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),s=e=>"number"==typeof e&&isFinite(e),c=e=>"[object RegExp]"===L(e),l=e=>A(e)&&0===Object.keys(e).length;function i(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const u=Object.assign;function f(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const m=Array.isArray,_=e=>"function"==typeof e,p=e=>"string"==typeof e,d=e=>"boolean"==typeof e,E=e=>null!==e&&"object"==typeof e,N=Object.prototype.toString,L=e=>N.call(e),A=e=>"[object Object]"===L(e);const T={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,__EXTEND_POINT__:15},k={[T.EXPECTED_TOKEN]:"Expected token: '{0}'",[T.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[T.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[T.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[T.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[T.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[T.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[T.EMPTY_PLACEHOLDER]:"Empty placeholder",[T.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[T.INVALID_LINKED_FORMAT]:"Invalid linked format",[T.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[T.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[T.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[T.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'"};function g(e,t,n={}){const{domain:r,messages:a,args:s}=n,c=o((a||k)[e]||"",...s||[]),l=new SyntaxError(String(c));return l.code=e,t&&(l.location=t),l.domain=r,l}function h(e){throw e}function I(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const C=String.fromCharCode(8232),y=String.fromCharCode(8233);function b(e){const t=e;let n=0,r=1,o=1,a=0;const s=e=>"\r"===t[e]&&"\n"===t[e+1],c=e=>t[e]===y,l=e=>t[e]===C,i=e=>s(e)||(e=>"\n"===t[e])(e)||c(e)||l(e),u=e=>s(e)||c(e)||l(e)?"\n":t[e];function f(){return a=0,i(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>a,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+a),next:f,peek:function(){return s(n+a)&&a++,a++,t[n+a]},reset:function(){n=0,r=1,o=1,a=0},resetPeek:function(e=0){a=e},skipToPeek:function(){const e=n+a;for(;e!==n;)f();a=0}}}const O=void 0;function D(e,t={}){const n=!1!==t.location,r=b(e),o=()=>r.index(),a=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=a(),c=o(),l={currentType:14,offset:c,startLoc:s,endLoc:s,lastType:14,lastOffset:c,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},i=()=>l,{onError:u}=t;function f(e,t,n,...r){const o=i();if(t.column+=n,t.offset+=n,u){const n=g(e,I(o.startLoc,t),{domain:"tokenizer",args:r});u(n)}}function m(e,t,r){e.endLoc=a(),e.currentType=t;const o={type:t};return n&&(o.loc=I(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const _=e=>m(e,14);function p(e,t){return e.currentChar()===t?(e.next(),t):(f(T.EXPECTED_TOKEN,a(),0,t),"")}function d(e){let t="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)t+=e.currentPeek(),e.peek();return t}function E(e){const t=d(e);return e.skipToPeek(),t}function N(e){if(e===O)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function L(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===O)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function A(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function k(e,t=!0){const n=(t=!1,r="",o=!1)=>{const a=e.currentPeek();return"{"===a?"%"!==r&&t:"@"!==a&&a?"%"===a?(e.peek(),n(t,"%",!0)):"|"===a?!("%"!==r&&!o)||!(" "===r||"\n"===r):" "===a?(e.peek(),n(!0," ",o)):"\n"!==a||(e.peek(),n(!0,"\n",o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function h(e,t){const n=e.currentChar();return n===O?O:t(n)?(e.next(),n):null}function C(e){return h(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 y(e){return h(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function D(e){return h(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="",n="";for(;t=y(e);)n+=t;return n}function P(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!k(e))break;t+=n,e.next()}else if(" "===n||"\n"===n)if(k(e))t+=n,e.next();else{if(A(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function v(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return M(e,t,4);case"U":return M(e,t,6);default:return f(T.UNKNOWN_ESCAPE_SEQUENCE,a(),0,t),""}}function M(e,t,n){p(e,t);let r="";for(let o=0;o<n;o++){const n=D(e);if(!n){f(T.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),0,`\\${t}${r}${e.currentChar()}`);break}r+=n}return`\\${t}${r}`}function R(e){E(e);const t=p(e,"|");return E(e),t}function w(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&f(T.NOT_ALLOW_NEST_PLACEHOLDER,a(),0),e.next(),n=m(t,2,"{"),E(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&f(T.EMPTY_PLACEHOLDER,a(),0),e.next(),n=m(t,3,"}"),t.braceNest--,t.braceNest>0&&E(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&f(T.UNTERMINATED_CLOSING_BRACE,a(),0),n=x(e,t)||_(t),t.braceNest=0,n;default:let r=!0,o=!0,s=!0;if(A(e))return t.braceNest>0&&f(T.UNTERMINATED_CLOSING_BRACE,a(),0),n=m(t,1,R(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return f(T.UNTERMINATED_CLOSING_BRACE,a(),0),t.braceNest=0,U(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=N(e.currentPeek());return e.resetPeek(),r}(e,t))return n=m(t,5,function(e){E(e);let t="",n="";for(;t=C(e);)n+=t;return e.currentChar()===O&&f(T.UNTERMINATED_CLOSING_BRACE,a(),0),n}(e)),E(e),n;if(o=L(e,t))return n=m(t,6,function(e){E(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${S(e)}`):t+=S(e),e.currentChar()===O&&f(T.UNTERMINATED_CLOSING_BRACE,a(),0),t}(e)),E(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,t))return n=m(t,7,function(e){E(e),p(e,"'");let t="",n="";const r=e=>"'"!==e&&"\n"!==e;for(;t=h(e,r);)n+="\\"===t?v(e):t;const o=e.currentChar();return"\n"===o||o===O?(f(T.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),0),"\n"===o&&(e.next(),p(e,"'")),n):(p(e,"'"),n)}(e)),E(e),n;if(!r&&!o&&!s)return n=m(t,13,function(e){E(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;t=h(e,r);)n+=t;return n}(e)),f(T.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n.value),E(e),n}return n}function x(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||"\n"!==o&&" "!==o||f(T.INVALID_LINKED_FORMAT,a(),0),o){case"@":return e.next(),r=m(t,8,"@"),t.inLinked=!0,r;case".":return E(e),e.next(),m(t,9,".");case":":return E(e),e.next(),m(t,10,":");default:return A(e)?(r=m(t,1,R(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(8!==n)return!1;d(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;d(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(E(e),x(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=N(e.currentPeek());return e.resetPeek(),r}(e,t)?(E(e),m(t,12,function(e){let t="",n="";for(;t=C(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?N(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||" "===t||!t)&&("\n"===t?(e.peek(),r()):N(t))},o=r();return e.resetPeek(),o}(e,t)?(E(e),"{"===o?w(e,t)||r:m(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?" "===o?r:"\n"===o?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&f(T.INVALID_LINKED_FORMAT,a(),0),t.braceNest=0,t.inLinked=!1,U(e,t))}}function U(e,t){let n={type:14};if(t.braceNest>0)return w(e,t)||_(t);if(t.inLinked)return x(e,t)||_(t);switch(e.currentChar()){case"{":return w(e,t)||_(t);case"}":return f(T.UNBALANCED_CLOSING_BRACE,a(),0),e.next(),m(t,3,"}");case"@":return x(e,t)||_(t);default:if(A(e))return n=m(t,1,R(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:r,hasSpace:o}=function(e){const t=d(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(r)return o?m(t,0,P(e)):m(t,4,function(e){E(e);const t=e.currentChar();return"%"!==t&&f(T.EXPECTED_TOKEN,a(),0,t),e.next(),"%"}(e));if(k(e))return m(t,0,P(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=s,l.offset=o(),l.startLoc=a(),r.currentChar()===O?m(l,14):U(r,l)},currentOffset:o,currentPosition:a,context:i}}const S=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function P(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 v(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,t,r,o,...a){const s=e.currentPosition();if(s.offset+=o,s.column+=o,n){const e=g(t,I(r,s),{domain:"parser",args:a});n(e)}}function o(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function a(e,n,r,o){e.end=n,o&&(e.type=o),t&&e.loc&&(e.loc.end=r)}function s(e,t){const n=e.context(),r=o(3,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function c(e,t){const n=e.context(),{lastOffset:r,lastStartLoc:s}=n,c=o(5,r,s);return c.index=parseInt(t,10),e.nextToken(),a(c,e.currentOffset(),e.currentPosition()),c}function l(e,t){const n=e.context(),{lastOffset:r,lastStartLoc:s}=n,c=o(4,r,s);return c.key=t,e.nextToken(),a(c,e.currentOffset(),e.currentPosition()),c}function i(e,t){const n=e.context(),{lastOffset:r,lastStartLoc:s}=n,c=o(9,r,s);return c.value=t.replace(S,P),e.nextToken(),a(c,e.currentOffset(),e.currentPosition()),c}function f(e){const t=e.context(),n=o(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:c}=n,l=o(8,s,c);return 12!==t.type?(r(e,T.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,0),l.value="",a(l,s,c),{nextConsumeToken:t,node:l}):(null==t.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,M(t)),l.value=t.value||"",a(l,e.currentOffset(),e.currentPosition()),{node:l})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(s)),n.key=function(e,t){const n=e.context(),r=o(7,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}(e,s.value||"");break;case 5:null==s.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(s)),n.key=l(e,s.value||"");break;case 6:null==s.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(s)),n.key=c(e,s.value||"");break;case 7:null==s.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(s)),n.key=i(e,s.value||"");break;default:r(e,T.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);const u=e.context(),f=o(7,u.offset,u.startLoc);return f.value="",a(f,u.offset,u.startLoc),n.key=f,a(n,u.offset,u.startLoc),{nextConsumeToken:s,node:n}}return a(n,e.currentOffset(),e.currentPosition()),{node:n}}function m(e){const t=e.context(),n=o(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let u=null;do{const o=u||e.nextToken();switch(u=null,o.type){case 0:null==o.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(o)),n.items.push(s(e,o.value||""));break;case 6:null==o.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(o)),n.items.push(c(e,o.value||""));break;case 5:null==o.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(o)),n.items.push(l(e,o.value||""));break;case 7:null==o.value&&r(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,M(o)),n.items.push(i(e,o.value||""));break;case 8:const a=f(e);n.items.push(a.node),u=a.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return a(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function _(e){const t=e.context(),{offset:n,startLoc:s}=t,c=m(e);return 14===t.currentType?c:function(e,t,n,s){const c=e.context();let l=0===s.items.length;const i=o(1,t,n);i.cases=[],i.cases.push(s);do{const t=m(e);l||(l=0===t.items.length),i.cases.push(t)}while(14!==c.currentType);return l&&r(e,T.MUST_HAVE_MESSAGES_IN_PLURAL,n,0),a(i,e.currentOffset(),e.currentPosition()),i}(e,n,s,c)}return{parse:function(n){const s=D(n,u({},e)),c=s.context(),l=o(0,c.offset,c.startLoc);return t&&l.loc&&(l.loc.source=n),l.body=_(s),14!==c.currentType&&r(s,T.UNEXPECTED_LEXICAL_ANALYSIS,c.lastStartLoc,0,n[c.offset]||""),a(l,s.currentOffset(),s.currentPosition()),l}}}function M(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 R(e,t){for(let n=0;n<e.length;n++)w(e[n],t)}function w(e,t){switch(e.type){case 1:R(e.cases,t),t.helper("plural");break;case 2:R(e.items,t);break;case 6:w(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 x(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&&w(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function U(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?U(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&&(U(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 n=0;n<o&&(U(e,t.items[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),U(e,t.key),t.modifier?(e.push(", "),U(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);break;default:throw new Error(`unhandled codegen node type: ${t.type}`)}}function F(e,t={}){const n=u({},t),r=v(n).parse(e);return x(r,n),((e,t={})=>{const n=p(t.mode)?t.mode:"normal",r=p(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,a=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:a}=t,s={source:e.loc.source,filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:a,indentLevel:0};function c(e,t){s.code+=e}function l(e,t=!0){const n=t?o:"";c(a?n+" ".repeat(e):n)}return{context:()=>s,push:c,indent:function(e=!0){const t=++s.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--s.indentLevel;e&&l(t)},newline:function(){l(s.indentLevel)},helper:e=>`_${e}`,needIndent:()=>s.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:a,needIndent:s});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),c.length>0&&(l.push(`const { ${c.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),l.newline()),l.push("return "),U(l,e),l.deindent(s),l.push("}");const{code:i,map:u}=l.context();return{ast:e,code:i,map:u?u.toJSON():void 0}})(r,n)}const $=[];$[0]={w:[0],i:[3,0],"[":[4],o:[7]},$[1]={w:[1],".":[2],"[":[4],o:[7]},$[2]={w:[2],i:[3,0],0:[3,0]},$[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},$[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},$[5]={"'":[4,0],o:8,l:[5,0]},$[6]={'"':[4,0],o:8,l:[6,0]};const W=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function X(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 K(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,W.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 B(e){const t=[];let n,r,o,a,s,c,l,i=-1,u=0,f=0;const m=[];function _(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,o="\\"+t,m[0](),!0}for(m[0]=()=>{void 0===r?r=o:r+=o},m[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},m[2]=()=>{m[0](),f++},m[3]=()=>{if(f>0)f--,u=4,m[0]();else{if(f=0,void 0===r)return!1;if(r=K(r),!1===r)return!1;m[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!_()){if(a=X(n),l=$[u],s=l[a]||l.l||8,8===s)return;if(u=s[0],void 0!==s[1]&&(c=m[s[1]],c&&(o=n,!1===c())))return;if(7===u)return t}}const G=new Map;function Y(e,t){return E(e)?e[t]:null}function V(e,t){if(!E(e))return null;let n=G.get(t);if(n||(n=B(t),n&&G.set(t,n)),!n)return null;const r=n.length;let o=e,a=0;for(;a<r;){const e=o[n[a]];if(void 0===e)return null;o=e,a++}return o}const H=e=>e,j=e=>"",Q="text",z=e=>0===e.length?"":e.join(""),J=e=>null==e?"":m(e)||A(e)&&e.toString===N?JSON.stringify(e,null,2):String(e);function q(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function Z(e={}){const t=e.locale,n=function(e){const t=s(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(s(e.named.count)||s(e.named.n))?s(e.named.count)?e.named.count:s(e.named.n)?e.named.n:t:t}(e),r=E(e.pluralRules)&&p(t)&&_(e.pluralRules[t])?e.pluralRules[t]:q,o=E(e.pluralRules)&&p(t)&&_(e.pluralRules[t])?q:void 0,a=e.list||[],c=e.named||{};s(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,c);function l(t){const n=_(e.messages)?e.messages(t):!!E(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):j)}const i=A(e.processor)&&_(e.processor.normalize)?e.processor.normalize:z,u=A(e.processor)&&_(e.processor.interpolate)?e.processor.interpolate:J,f={list:e=>a[e],named:e=>c[e],plural:e=>e[r(n,e.length,o)],linked:(t,...n)=>{const[r,o]=n;let a="text",s="";1===n.length?E(r)?(s=r.modifier||s,a=r.type||a):p(r)&&(s=r||s):2===n.length&&(p(r)&&(s=r||s),p(o)&&(a=o||a));let c=l(t)(f);return"vnode"===a&&m(c)&&s&&(c=c[0]),s?(i=s,e.modifiers?e.modifiers[i]:H)(c,a):c;var i},message:l,type:A(e.processor)&&p(e.processor.type)?e.processor.type:"text",interpolate:u,normalize:i};return f}const ee="i18n:init";let te=null;function ne(e){te=e}function re(){return te}function oe(e,t,n){te&&te.emit(ee,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const ae=se("function:translate");function se(e){return t=>te&&te.emit(e,t)}const ce={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,__EXTEND_POINT__:7},le={[ce.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[ce.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[ce.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[ce.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[ce.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[ce.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale."};function ie(e,...t){return o(le[e],...t)}function ue(e,t,n){return[...new Set([n,...m(t)?t:E(t)?Object.keys(t):p(t)?[t]:[n]])]}function fe(e,t,n){const r=p(n)?n:Ne,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let a=o.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;m(e);)e=me(a,e,t);const s=m(t)||!A(t)?t:t.default?t.default:null;e=p(s)?[s]:s,m(e)&&me(a,e,!1),o.__localeChainCache.set(r,a)}return a}function me(e,t,n){let r=!0;for(let o=0;o<t.length&&d(r);o++){const a=t[o];p(a)&&(r=_e(e,t[o],n))}return r}function _e(e,t,n){let r;const o=t.split("-");do{r=pe(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function pe(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),(m(n)||A(n))&&n[o]&&(r=n[o])}return r}const de="9.3.0-beta.1",Ee=-1,Ne="en-US",Le="",Ae=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let Te,ke,ge;function he(e){Te=e}function Ie(e){ke=e}function Ce(e){ge=e}let ye=null;const be=e=>{ye=e},Oe=()=>ye;let De=null;const Se=e=>{De=e},Pe=()=>De;let ve=0;function Me(e={}){const t=p(e.version)?e.version:"9.3.0-beta.1",n=p(e.locale)?e.locale:Ne,r=m(e.fallbackLocale)||A(e.fallbackLocale)||p(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,o=A(e.messages)?e.messages:{[n]:{}},a=A(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},s=A(e.numberFormats)?e.numberFormats:{[n]:{}},l=u({},e.modifiers||{},{upper:(e,t)=>"text"===t&&p(e)?e.toUpperCase():"vnode"===t&&E(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&p(e)?e.toLowerCase():"vnode"===t&&E(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&p(e)?Ae(e):"vnode"===t&&E(e)&&"__v_isVNode"in e?Ae(e.children):e}),f=e.pluralRules||{},N=_(e.missing)?e.missing:null,L=!d(e.missingWarn)&&!c(e.missingWarn)||e.missingWarn,T=!d(e.fallbackWarn)&&!c(e.fallbackWarn)||e.fallbackWarn,k=!!e.fallbackFormat,g=!!e.unresolving,h=_(e.postTranslation)?e.postTranslation:null,I=A(e.processor)?e.processor:null,C=!d(e.warnHtmlMessage)||e.warnHtmlMessage,y=!!e.escapeParameter,b=_(e.messageCompiler)?e.messageCompiler:Te,O=_(e.messageResolver)?e.messageResolver:ke||Y,D=_(e.localeFallbacker)?e.localeFallbacker:ge||ue,S=E(e.fallbackContext)?e.fallbackContext:void 0,P=_(e.onWarn)?e.onWarn:i,v=e,M=E(v.__datetimeFormatters)?v.__datetimeFormatters:new Map,R=E(v.__numberFormatters)?v.__numberFormatters:new Map,w=E(v.__meta)?v.__meta:{};ve++;const x={version:t,cid:ve,locale:n,fallbackLocale:r,messages:o,modifiers:l,pluralRules:f,missing:N,missingWarn:L,fallbackWarn:T,fallbackFormat:k,unresolving:g,postTranslation:h,processor:I,warnHtmlMessage:C,escapeParameter:y,messageCompiler:b,messageResolver:O,localeFallbacker:D,fallbackContext:S,onWarn:P,__meta:w};return x.datetimeFormats=a,x.numberFormats=s,x.__datetimeFormatters=M,x.__numberFormatters=R,x.__v_emitter=null!=v.__v_emitter?v.__v_emitter:void 0,oe(x,t,w),x}function Re(e,t){return e instanceof RegExp?e.test(t):e}function we(e,t){return e instanceof RegExp?e.test(t):e}function xe(e,t,n,r,o){const{missing:a,onWarn:s}=e;{const r=e.__v_emitter;r&&r.emit("missing",{locale:n,key:t,type:o,groupId:`${o}:${t}`})}if(null!==a){const r=a(e,n,t,o);return p(r)?r:t}return we(r,t)&&s(ie(ce.NOT_FOUND_KEY,{key:t,locale:n})),t}function Ue(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}const Fe=/<\/?[\w\s="/.':;#-\/]+>/;const $e=e=>e;let We=Object.create(null);function Xe(){We=Object.create(null)}function Ke(e,t={}){{!function(e,t){(!d(t.warnHtmlMessage)||t.warnHtmlMessage)&&Fe.test(e)&&i(o("Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.",{source:e}))}(e,t);const n=(t.onCacheKey||$e)(e),r=We[n];if(r)return r;let a=!1;const s=t.onError||h;t.onError=e=>{a=!0,s(e)};const{code:c}=F(e,t),l=new Function(`return ${c}`)();return a?l:We[n]=l}}let Be=T.__EXTEND_POINT__;const Ge=()=>++Be,Ye={INVALID_ARGUMENT:Be,INVALID_DATE_ARGUMENT:Ge(),INVALID_ISO_DATE_ARGUMENT:Ge(),__EXTEND_POINT__:Ge()};function Ve(e){return g(e,null,{messages:He})}const He={[Ye.INVALID_ARGUMENT]:"Invalid arguments",[Ye.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Ye.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string"},je=()=>"",Qe=e=>_(e);function ze(r,...o){const{fallbackFormat:a,postTranslation:c,unresolving:l,messageCompiler:_,fallbackLocale:N,messages:L}=r,[A,T]=Ze(...o),k=d(T.missingWarn)?T.missingWarn:r.missingWarn,g=d(T.fallbackWarn)?T.fallbackWarn:r.fallbackWarn,h=d(T.escapeParameter)?T.escapeParameter:r.escapeParameter,I=!!T.resolvedMessage,C=p(T.default)||d(T.default)?d(T.default)?_?A:()=>A:T.default:a?_?A:()=>A:"",y=a||""!==C,b=p(T.locale)?T.locale:r.locale;h&&function(e){m(e.list)?e.list=e.list.map((e=>p(e)?f(e):e)):E(e.named)&&Object.keys(e.named).forEach((t=>{p(e.named[t])&&(e.named[t]=f(e.named[t]))}))}(T);let[O,D,S]=I?[A,b,L[b]||{}]:Je(r,A,b,N,g,k),P=O,v=A;if(I||p(P)||Qe(P)||y&&(P=C,v=P),!(I||(p(P)||Qe(P))&&p(D)))return l?-1:A;if(p(P)&&null==r.messageCompiler)return i(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${A}'.`),A;let M=!1;const R=Qe(P)?P:qe(r,A,D,P,v,(()=>{M=!0}));if(M)return P;const w=function(e,t,n,r){const{modifiers:o,pluralRules:a,messageResolver:c,fallbackLocale:l,fallbackWarn:i,missingWarn:u,fallbackContext:f}=e,m=r=>{let o=c(n,r);if(null==o&&f){const[,,e]=Je(f,r,t,l,i,u);o=c(e,r)}if(p(o)){let n=!1;const a=qe(e,r,t,o,r,(()=>{n=!0}));return n?je:a}return Qe(o)?o:je},_={locale:t,modifiers:o,pluralRules:a,messages:m};e.processor&&(_.processor=e.processor);r.list&&(_.list=r.list);r.named&&(_.named=r.named);s(r.plural)&&(_.pluralIndex=r.plural);return _}(r,D,S,T),x=function(r,o,a){let s,c,l=null;e&&(l=window.performance.now(),s="intlify-message-evaluation-start",c="intlify-message-evaluation-end",t&&t(s));const i=o(a);if(e){const e=window.performance.now(),a=r.__v_emitter;a&&l&&a.emit("message-evaluation",{type:"message-evaluation",value:i,time:e-l,groupId:`translate:${o.key}`}),s&&c&&t&&n&&(t(c),n("intlify message evaluation",s,c))}return i}(r,R,Z(w)),U=c?c(x,A):x;{const e={timestamp:Date.now(),key:p(A)?A:Qe(P)?P.key:"",locale:D||(Qe(P)?P.locale:""),format:p(P)?P:Qe(P)?P.source:"",message:U};e.meta=u({},r.__meta,Oe()||{}),ae(e)}return U}function Je(r,o,a,s,c,l){const{messages:i,onWarn:u,messageResolver:f,localeFallbacker:m}=r,d=m(r,s,a);let E,N={},L=null,A=a,T=null;const k="translate";for(let s=0;s<d.length;s++){if(E=T=d[s],a!==E&&Re(c,o)&&u(ie(ce.FALLBACK_TO_TRANSLATE,{key:o,target:E})),a!==E){const e=r.__v_emitter;e&&e.emit("fallback",{type:k,key:o,from:A,to:T,groupId:`${k}:${o}`})}N=i[E]||{};let m,g,h=null;if(e&&(h=window.performance.now(),m="intlify-message-resolve-start",g="intlify-message-resolve-end",t&&t(m)),null===(L=f(N,o))&&(L=N[o]),e){const e=window.performance.now(),a=r.__v_emitter;a&&h&&L&&a.emit("message-resolve",{type:"message-resolve",key:o,message:L,time:e-h,groupId:`${k}:${o}`}),m&&g&&t&&n&&(t(g),n("intlify message resolve",m,g))}if(p(L)||_(L))break;const I=xe(r,o,E,l,k);I!==o&&(L=I),A=T}return[L,E,N]}function qe(r,o,s,c,l,i){const{messageCompiler:u,warnHtmlMessage:f}=r;if(Qe(c)){const e=c;return e.locale=e.locale||s,e.key=e.key||o,e}if(null==u){const e=()=>c;return e.locale=s,e.key=o,e}let m,_,p=null;e&&(p=window.performance.now(),m="intlify-message-compilation-start",_="intlify-message-compilation-end",t&&t(m));const d=u(c,function(e,t,n,r,o,s){return{warnHtmlMessage:o,onError:t=>{s&&s(t);{const o=`Message compilation error: ${t.message}`,a=t.location&&function(e,t=0,n=e.length){const r=e.split(/\r?\n/);let o=0;const a=[];for(let e=0;e<r.length;e++)if(o+=r[e].length+1,o>=t){for(let s=e-2;s<=e+2||n>o;s++){if(s<0||s>=r.length)continue;const c=s+1;a.push(`${c}${" ".repeat(3-String(c).length)}| ${r[s]}`);const l=r[s].length;if(s===e){const e=t-(o-l)+1,r=Math.max(1,n>o?l-e:n-t);a.push(" | "+" ".repeat(e)+"^".repeat(r))}else if(s>e){if(n>o){const e=Math.max(Math.min(n-o,l),1);a.push(" | "+"^".repeat(e))}o+=l+1}}break}return a.join("\n")}(r,t.location.start.offset,t.location.end.offset),s=e.__v_emitter;s&&s.emit("compile-error",{message:r,error:t.message,start:t.location&&t.location.start.offset,end:t.location&&t.location.end.offset,groupId:`translate:${n}`}),console.error(a?`${o}\n${a}`:o)}},onCacheKey:e=>((e,t,n)=>a({l:e,k:t,s:n}))(t,n,e)}}(r,s,l,c,f,i));if(e){const e=window.performance.now(),a=r.__v_emitter;a&&p&&a.emit("message-compilation",{type:"message-compilation",message:c,time:e-p,groupId:`translate:${o}`}),m&&_&&t&&n&&(t(_),n("intlify message compilation",m,_))}return d.locale=s,d.key=o,d.source=c,d}function Ze(...e){const[t,n,r]=e,o={};if(!p(t)&&!s(t)&&!Qe(t))throw Ve(Ye.INVALID_ARGUMENT);const a=s(t)?String(t):(Qe(t),t);return s(n)?o.plural=n:p(n)?o.default=n:A(n)&&!l(n)?o.named=n:m(n)&&(o.list=n),s(r)?o.plural=r:p(r)?o.default=r:A(r)&&u(o,r),[a,o]}const et="undefined"!=typeof Intl,tt=et&&void 0!==Intl.DateTimeFormat,nt=et&&void 0!==Intl.NumberFormat;function rt(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__datetimeFormatters:c}=e;if(!tt)return a(ie(ce.CANNOT_FORMAT_DATE)),"";const[i,f,m,_]=at(...t),E=d(m.missingWarn)?m.missingWarn:e.missingWarn,N=d(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn,L=!!m.part,T=p(m.locale)?m.locale:e.locale,k=s(e,o,T);if(!p(i)||""===i)return new Intl.DateTimeFormat(T,_).format(f);let g,h={},I=null,C=T,y=null;const b="datetime format";for(let t=0;t<k.length;t++){if(g=y=k[t],T!==g&&Re(N,i)&&a(ie(ce.FALLBACK_TO_DATE_FORMAT,{key:i,target:g})),T!==g){const t=e.__v_emitter;t&&t.emit("fallback",{type:b,key:i,from:C,to:y,groupId:`${b}:${i}`})}if(h=n[g]||{},I=h[i],A(I))break;xe(e,i,g,E,b),C=y}if(!A(I)||!p(g))return r?-1:i;let O=`${g}__${i}`;l(_)||(O=`${O}__${JSON.stringify(_)}`);let D=c.get(O);return D||(D=new Intl.DateTimeFormat(g,u({},I,_)),c.set(O,D)),L?D.formatToParts(f):D.format(f)}const ot=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function at(...e){const[t,n,r,o]=e,a={};let c,l={};if(p(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Ve(Ye.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();c=new Date(n);try{c.toISOString()}catch(e){throw Ve(Ye.INVALID_ISO_DATE_ARGUMENT)}}else if("[object Date]"===L(t)){if(isNaN(t.getTime()))throw Ve(Ye.INVALID_DATE_ARGUMENT);c=t}else{if(!s(t))throw Ve(Ye.INVALID_ARGUMENT);c=t}return p(n)?a.key=n:A(n)&&Object.keys(n).forEach((e=>{ot.includes(e)?l[e]=n[e]:a[e]=n[e]})),p(r)?a.locale=r:A(r)&&(l=r),A(o)&&(l=o),[a.key||"",c,a,l]}function st(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function ct(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__numberFormatters:c}=e;if(!nt)return a(ie(ce.CANNOT_FORMAT_NUMBER)),"";const[i,f,m,_]=it(...t),E=d(m.missingWarn)?m.missingWarn:e.missingWarn,N=d(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn,L=!!m.part,T=p(m.locale)?m.locale:e.locale,k=s(e,o,T);if(!p(i)||""===i)return new Intl.NumberFormat(T,_).format(f);let g,h={},I=null,C=T,y=null;const b="number format";for(let t=0;t<k.length;t++){if(g=y=k[t],T!==g&&Re(N,i)&&a(ie(ce.FALLBACK_TO_NUMBER_FORMAT,{key:i,target:g})),T!==g){const t=e.__v_emitter;t&&t.emit("fallback",{type:b,key:i,from:C,to:y,groupId:`${b}:${i}`})}if(h=n[g]||{},I=h[i],A(I))break;xe(e,i,g,E,b),C=y}if(!A(I)||!p(g))return r?-1:i;let O=`${g}__${i}`;l(_)||(O=`${O}__${JSON.stringify(_)}`);let D=c.get(O);return D||(D=new Intl.NumberFormat(g,u({},I,_)),c.set(O,D)),L?D.formatToParts(f):D.format(f)}const lt=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function it(...e){const[t,n,r,o]=e,a={};let c={};if(!s(t))throw Ve(Ye.INVALID_ARGUMENT);const l=t;return p(n)?a.key=n:A(n)&&Object.keys(n).forEach((e=>{lt.includes(e)?c[e]=n[e]:a[e]=n[e]})),p(r)?a.locale=r:A(r)&&(c=r),A(o)&&(c=o),[a.key||"",l,a,c]}function ut(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}he(Ke),Ie(V),Ce(fe);export{T as CompileErrorCodes,Ye as CoreErrorCodes,ce as CoreWarnCodes,ot as DATETIME_FORMAT_OPTIONS_KEYS,Ne as DEFAULT_LOCALE,Q as DEFAULT_MESSAGE_DATA_TYPE,Le as MISSING_RESOLVE_VALUE,Ee as NOT_REOSLVED,lt as NUMBER_FORMAT_OPTIONS_KEYS,de as VERSION,Xe as clearCompileCache,st as clearDateTimeFormat,ut as clearNumberFormat,Ke as compileToFunction,g as createCompileError,Me as createCoreContext,Ve as createCoreError,Z as createMessageContext,rt as datetime,fe as fallbackWithLocaleChain,ue as fallbackWithSimple,Oe as getAdditionalMeta,re as getDevToolsHook,Pe as getFallbackContext,ie as getWarnMessage,xe as handleMissing,oe as initI18nDevTools,Qe as isMessageFunction,Re as isTranslateFallbackWarn,we as isTranslateMissingWarn,ct as number,B as parse,at as parseDateTimeArgs,it as parseNumberArgs,Ze as parseTranslateArgs,Ce as registerLocaleFallbacker,he as registerMessageCompiler,Ie as registerMessageResolver,V as resolveValue,Y as resolveWithKeyValue,be as setAdditionalMeta,ne as setDevToolsHook,Se as setFallbackContext,ze as translate,ae as translateDevTools,Ue as updateFallbackLocale};
@@ -1,6 +0,0 @@
1
- /*!
2
- * core v9.3.0-beta.1
3
- * (c) 2022 kazuya kawaguchi
4
- * Released under the MIT License.
5
- */
6
- const e="undefined"!=typeof window;let t,n;{const a=e&&window.performance;a&&a.mark&&a.measure&&a.clearMarks&&a.clearMeasures&&(t=e=>a.mark(e),n=(e,t,n)=>{a.measure(e,t,n),a.clearMarks(t),a.clearMarks(n)})}const a=/\{([0-9a-zA-Z]+)\}/g;function r(e,...t){return 1===t.length&&g(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(a,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}const o=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),l=e=>"number"==typeof e&&isFinite(e),s=e=>"[object RegExp]"===N(e),i=e=>A(e)&&0===Object.keys(e).length;function c(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const m=Object.assign;function u(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const _=Array.isArray,f=e=>"function"==typeof e,p=e=>"string"==typeof e,d=e=>"boolean"==typeof e,g=e=>null!==e&&"object"==typeof e,E=Object.prototype.toString,N=e=>E.call(e),A=e=>"[object Object]"===N(e);const T={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,__EXTEND_POINT__:15},I={[T.EXPECTED_TOKEN]:"Expected token: '{0}'",[T.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[T.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[T.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[T.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[T.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[T.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[T.EMPTY_PLACEHOLDER]:"Empty placeholder",[T.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[T.INVALID_LINKED_FORMAT]:"Invalid linked format",[T.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[T.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[T.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[T.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'"};function k(e,t,n={}){const{domain:a,messages:o,args:l}=n,s=r((o||I)[e]||"",...l||[]),i=new SyntaxError(String(s));return i.code=e,t&&(i.location=t),i.domain=a,i}const y=[];y[0]={w:[0],i:[3,0],"[":[4],o:[7]},y[1]={w:[1],".":[2],"[":[4],o:[7]},y[2]={w:[2],i:[3,0],0:[3,0]},y[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},y[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},y[5]={"'":[4,0],o:8,l:[5,0]},y[6]={'"':[4,0],o:8,l:[6,0]};const L=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function D(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 b(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,L.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 O(e){const t=[];let n,a,r,o,l,s,i,c=-1,m=0,u=0;const _=[];function f(){const t=e[c+1];if(5===m&&"'"===t||6===m&&'"'===t)return c++,r="\\"+t,_[0](),!0}for(_[0]=()=>{void 0===a?a=r:a+=r},_[1]=()=>{void 0!==a&&(t.push(a),a=void 0)},_[2]=()=>{_[0](),u++},_[3]=()=>{if(u>0)u--,m=4,_[0]();else{if(u=0,void 0===a)return!1;if(a=b(a),!1===a)return!1;_[1]()}};null!==m;)if(c++,n=e[c],"\\"!==n||!f()){if(o=D(n),i=y[m],l=i[o]||i.l||8,8===l)return;if(m=l[0],void 0!==l[1]&&(s=_[l[1]],s&&(r=n,!1===s())))return;if(7===m)return t}}const h=new Map;function C(e,t){return g(e)?e[t]:null}function M(e,t){if(!g(e))return null;let n=h.get(t);if(n||(n=O(t),n&&h.set(t,n)),!n)return null;const a=n.length;let r=e,o=0;for(;o<a;){const e=r[n[o]];if(void 0===e)return null;r=e,o++}return r}const R=e=>e,F=e=>"",v="text",w=e=>0===e.length?"":e.join(""),S=e=>null==e?"":_(e)||A(e)&&e.toString===E?JSON.stringify(e,null,2):String(e);function U(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function P(e={}){const t=e.locale,n=function(e){const t=l(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(l(e.named.count)||l(e.named.n))?l(e.named.count)?e.named.count:l(e.named.n)?e.named.n:t:t}(e),a=g(e.pluralRules)&&p(t)&&f(e.pluralRules[t])?e.pluralRules[t]:U,r=g(e.pluralRules)&&p(t)&&f(e.pluralRules[t])?U:void 0,o=e.list||[],s=e.named||{};l(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,s);function i(t){const n=f(e.messages)?e.messages(t):!!g(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):F)}const c=A(e.processor)&&f(e.processor.normalize)?e.processor.normalize:w,m=A(e.processor)&&f(e.processor.interpolate)?e.processor.interpolate:S,u={list:e=>o[e],named:e=>s[e],plural:e=>e[a(n,e.length,r)],linked:(t,...n)=>{const[a,r]=n;let o="text",l="";1===n.length?g(a)?(l=a.modifier||l,o=a.type||o):p(a)&&(l=a||l):2===n.length&&(p(a)&&(l=a||l),p(r)&&(o=r||o));let s=i(t)(u);return"vnode"===o&&_(s)&&l&&(s=s[0]),l?(c=l,e.modifiers?e.modifiers[c]:R)(s,o):s;var c},message:i,type:A(e.processor)&&p(e.processor.type)?e.processor.type:"text",interpolate:m,normalize:c};return u}const W="i18n:init";let $=null;function x(e){$=e}function K(){return $}function V(e,t,n){$&&$.emit(W,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const B=G("function:translate");function G(e){return t=>$&&$.emit(e,t)}const j={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,__EXTEND_POINT__:7},H={[j.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[j.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[j.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[j.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[j.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[j.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale."};function X(e,...t){return r(H[e],...t)}function Y(e,t,n){return[...new Set([n,..._(t)?t:g(t)?Object.keys(t):p(t)?[t]:[n]])]}function Q(e,t,n){const a=p(n)?n:te,r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(a);if(!o){o=[];let e=[n];for(;_(e);)e=z(o,e,t);const l=_(t)||!A(t)?t:t.default?t.default:null;e=p(l)?[l]:l,_(e)&&z(o,e,!1),r.__localeChainCache.set(a,o)}return o}function z(e,t,n){let a=!0;for(let r=0;r<t.length&&d(a);r++){const o=t[r];p(o)&&(a=q(e,t[r],n))}return a}function q(e,t,n){let a;const r=t.split("-");do{a=J(e,r.join("-"),n),r.splice(-1,1)}while(r.length&&!0===a);return a}function J(e,t,n){let a=!1;if(!e.includes(t)&&(a=!0,t)){a="!"!==t[t.length-1];const r=t.replace(/!/g,"");e.push(r),(_(n)||A(n))&&n[r]&&(a=n[r])}return a}const Z="9.3.0-beta.1",ee=-1,te="en-US",ne="",ae=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let re,oe,le;function se(e){re=e}function ie(e){oe=e}function ce(e){le=e}let me=null;const ue=e=>{me=e},_e=()=>me;let fe=null;const pe=e=>{fe=e},de=()=>fe;let ge=0;function Ee(e={}){const t=p(e.version)?e.version:"9.3.0-beta.1",n=p(e.locale)?e.locale:te,a=_(e.fallbackLocale)||A(e.fallbackLocale)||p(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,r=A(e.messages)?e.messages:{[n]:{}},o=A(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},l=A(e.numberFormats)?e.numberFormats:{[n]:{}},i=m({},e.modifiers||{},{upper:(e,t)=>"text"===t&&p(e)?e.toUpperCase():"vnode"===t&&g(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&p(e)?e.toLowerCase():"vnode"===t&&g(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&p(e)?ae(e):"vnode"===t&&g(e)&&"__v_isVNode"in e?ae(e.children):e}),u=e.pluralRules||{},E=f(e.missing)?e.missing:null,N=!d(e.missingWarn)&&!s(e.missingWarn)||e.missingWarn,T=!d(e.fallbackWarn)&&!s(e.fallbackWarn)||e.fallbackWarn,I=!!e.fallbackFormat,k=!!e.unresolving,y=f(e.postTranslation)?e.postTranslation:null,L=A(e.processor)?e.processor:null,D=!d(e.warnHtmlMessage)||e.warnHtmlMessage,b=!!e.escapeParameter,O=f(e.messageCompiler)?e.messageCompiler:re,h=f(e.messageResolver)?e.messageResolver:oe||C,M=f(e.localeFallbacker)?e.localeFallbacker:le||Y,R=g(e.fallbackContext)?e.fallbackContext:void 0,F=f(e.onWarn)?e.onWarn:c,v=e,w=g(v.__datetimeFormatters)?v.__datetimeFormatters:new Map,S=g(v.__numberFormatters)?v.__numberFormatters:new Map,U=g(v.__meta)?v.__meta:{};ge++;const P={version:t,cid:ge,locale:n,fallbackLocale:a,messages:r,modifiers:i,pluralRules:u,missing:E,missingWarn:N,fallbackWarn:T,fallbackFormat:I,unresolving:k,postTranslation:y,processor:L,warnHtmlMessage:D,escapeParameter:b,messageCompiler:O,messageResolver:h,localeFallbacker:M,fallbackContext:R,onWarn:F,__meta:U};return P.datetimeFormats=o,P.numberFormats=l,P.__datetimeFormatters=w,P.__numberFormatters=S,P.__v_emitter=null!=v.__v_emitter?v.__v_emitter:void 0,V(P,t,U),P}function Ne(e,t){return e instanceof RegExp?e.test(t):e}function Ae(e,t){return e instanceof RegExp?e.test(t):e}function Te(e,t,n,a,r){const{missing:o,onWarn:l}=e;{const a=e.__v_emitter;a&&a.emit("missing",{locale:n,key:t,type:r,groupId:`${r}:${t}`})}if(null!==o){const a=o(e,n,t,r);return p(a)?a:t}return Ae(a,t)&&l(X(j.NOT_FOUND_KEY,{key:t,locale:n})),t}function Ie(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function ke(){}function ye(e,t={}){return c("Runtime compilation is not supported in core.runtime.esm-browser.mjs."),()=>e}let Le=T.__EXTEND_POINT__;const De=()=>++Le,be={INVALID_ARGUMENT:Le,INVALID_DATE_ARGUMENT:De(),INVALID_ISO_DATE_ARGUMENT:De(),__EXTEND_POINT__:De()};function Oe(e){return k(e,null,{messages:he})}const he={[be.INVALID_ARGUMENT]:"Invalid arguments",[be.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[be.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string"},Ce=()=>"",Me=e=>f(e);function Re(a,...r){const{fallbackFormat:o,postTranslation:s,unresolving:i,messageCompiler:f,fallbackLocale:E,messages:N}=a,[A,T]=we(...r),I=d(T.missingWarn)?T.missingWarn:a.missingWarn,k=d(T.fallbackWarn)?T.fallbackWarn:a.fallbackWarn,y=d(T.escapeParameter)?T.escapeParameter:a.escapeParameter,L=!!T.resolvedMessage,D=p(T.default)||d(T.default)?d(T.default)?f?A:()=>A:T.default:o?f?A:()=>A:"",b=o||""!==D,O=p(T.locale)?T.locale:a.locale;y&&function(e){_(e.list)?e.list=e.list.map((e=>p(e)?u(e):e)):g(e.named)&&Object.keys(e.named).forEach((t=>{p(e.named[t])&&(e.named[t]=u(e.named[t]))}))}(T);let[h,C,M]=L?[A,O,N[O]||{}]:Fe(a,A,O,E,k,I),R=h,F=A;if(L||p(R)||Me(R)||b&&(R=D,F=R),!(L||(p(R)||Me(R))&&p(C)))return i?-1:A;if(p(R)&&null==a.messageCompiler)return c(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${A}'.`),A;let v=!1;const w=Me(R)?R:ve(a,A,C,R,F,(()=>{v=!0}));if(v)return R;const S=function(e,t,n,a){const{modifiers:r,pluralRules:o,messageResolver:s,fallbackLocale:i,fallbackWarn:c,missingWarn:m,fallbackContext:u}=e,_=a=>{let r=s(n,a);if(null==r&&u){const[,,e]=Fe(u,a,t,i,c,m);r=s(e,a)}if(p(r)){let n=!1;const o=ve(e,a,t,r,a,(()=>{n=!0}));return n?Ce:o}return Me(r)?r:Ce},f={locale:t,modifiers:r,pluralRules:o,messages:_};e.processor&&(f.processor=e.processor);a.list&&(f.list=a.list);a.named&&(f.named=a.named);l(a.plural)&&(f.pluralIndex=a.plural);return f}(a,C,M,T),U=function(a,r,o){let l,s,i=null;e&&(i=window.performance.now(),l="intlify-message-evaluation-start",s="intlify-message-evaluation-end",t&&t(l));const c=r(o);if(e){const e=window.performance.now(),o=a.__v_emitter;o&&i&&o.emit("message-evaluation",{type:"message-evaluation",value:c,time:e-i,groupId:`translate:${r.key}`}),l&&s&&t&&n&&(t(s),n("intlify message evaluation",l,s))}return c}(a,w,P(S)),W=s?s(U,A):U;{const e={timestamp:Date.now(),key:p(A)?A:Me(R)?R.key:"",locale:C||(Me(R)?R.locale:""),format:p(R)?R:Me(R)?R.source:"",message:W};e.meta=m({},a.__meta,_e()||{}),B(e)}return W}function Fe(a,r,o,l,s,i){const{messages:c,onWarn:m,messageResolver:u,localeFallbacker:_}=a,d=_(a,l,o);let g,E={},N=null,A=o,T=null;const I="translate";for(let l=0;l<d.length;l++){if(g=T=d[l],o!==g&&Ne(s,r)&&m(X(j.FALLBACK_TO_TRANSLATE,{key:r,target:g})),o!==g){const e=a.__v_emitter;e&&e.emit("fallback",{type:I,key:r,from:A,to:T,groupId:`${I}:${r}`})}E=c[g]||{};let _,k,y=null;if(e&&(y=window.performance.now(),_="intlify-message-resolve-start",k="intlify-message-resolve-end",t&&t(_)),null===(N=u(E,r))&&(N=E[r]),e){const e=window.performance.now(),o=a.__v_emitter;o&&y&&N&&o.emit("message-resolve",{type:"message-resolve",key:r,message:N,time:e-y,groupId:`${I}:${r}`}),_&&k&&t&&n&&(t(k),n("intlify message resolve",_,k))}if(p(N)||f(N))break;const L=Te(a,r,g,i,I);L!==r&&(N=L),A=T}return[N,g,E]}function ve(a,r,l,s,i,c){const{messageCompiler:m,warnHtmlMessage:u}=a;if(Me(s)){const e=s;return e.locale=e.locale||l,e.key=e.key||r,e}if(null==m){const e=()=>s;return e.locale=l,e.key=r,e}let _,f,p=null;e&&(p=window.performance.now(),_="intlify-message-compilation-start",f="intlify-message-compilation-end",t&&t(_));const d=m(s,function(e,t,n,a,r,l){return{warnHtmlMessage:r,onError:t=>{l&&l(t);{const r=`Message compilation error: ${t.message}`,o=t.location&&function(e,t=0,n=e.length){const a=e.split(/\r?\n/);let r=0;const o=[];for(let e=0;e<a.length;e++)if(r+=a[e].length+1,r>=t){for(let l=e-2;l<=e+2||n>r;l++){if(l<0||l>=a.length)continue;const s=l+1;o.push(`${s}${" ".repeat(3-String(s).length)}| ${a[l]}`);const i=a[l].length;if(l===e){const e=t-(r-i)+1,a=Math.max(1,n>r?i-e:n-t);o.push(" | "+" ".repeat(e)+"^".repeat(a))}else if(l>e){if(n>r){const e=Math.max(Math.min(n-r,i),1);o.push(" | "+"^".repeat(e))}r+=i+1}}break}return o.join("\n")}(a,t.location.start.offset,t.location.end.offset),l=e.__v_emitter;l&&l.emit("compile-error",{message:a,error:t.message,start:t.location&&t.location.start.offset,end:t.location&&t.location.end.offset,groupId:`translate:${n}`}),console.error(o?`${r}\n${o}`:r)}},onCacheKey:e=>((e,t,n)=>o({l:e,k:t,s:n}))(t,n,e)}}(a,l,i,s,u,c));if(e){const e=window.performance.now(),o=a.__v_emitter;o&&p&&o.emit("message-compilation",{type:"message-compilation",message:s,time:e-p,groupId:`translate:${r}`}),_&&f&&t&&n&&(t(f),n("intlify message compilation",_,f))}return d.locale=l,d.key=r,d.source=s,d}function we(...e){const[t,n,a]=e,r={};if(!p(t)&&!l(t)&&!Me(t))throw Oe(be.INVALID_ARGUMENT);const o=l(t)?String(t):(Me(t),t);return l(n)?r.plural=n:p(n)?r.default=n:A(n)&&!i(n)?r.named=n:_(n)&&(r.list=n),l(a)?r.plural=a:p(a)?r.default=a:A(a)&&m(r,a),[o,r]}const Se="undefined"!=typeof Intl,Ue=Se&&void 0!==Intl.DateTimeFormat,Pe=Se&&void 0!==Intl.NumberFormat;function We(e,...t){const{datetimeFormats:n,unresolving:a,fallbackLocale:r,onWarn:o,localeFallbacker:l}=e,{__datetimeFormatters:s}=e;if(!Ue)return o(X(j.CANNOT_FORMAT_DATE)),"";const[c,u,_,f]=xe(...t),g=d(_.missingWarn)?_.missingWarn:e.missingWarn,E=d(_.fallbackWarn)?_.fallbackWarn:e.fallbackWarn,N=!!_.part,T=p(_.locale)?_.locale:e.locale,I=l(e,r,T);if(!p(c)||""===c)return new Intl.DateTimeFormat(T,f).format(u);let k,y={},L=null,D=T,b=null;const O="datetime format";for(let t=0;t<I.length;t++){if(k=b=I[t],T!==k&&Ne(E,c)&&o(X(j.FALLBACK_TO_DATE_FORMAT,{key:c,target:k})),T!==k){const t=e.__v_emitter;t&&t.emit("fallback",{type:O,key:c,from:D,to:b,groupId:`${O}:${c}`})}if(y=n[k]||{},L=y[c],A(L))break;Te(e,c,k,g,O),D=b}if(!A(L)||!p(k))return a?-1:c;let h=`${k}__${c}`;i(f)||(h=`${h}__${JSON.stringify(f)}`);let C=s.get(h);return C||(C=new Intl.DateTimeFormat(k,m({},L,f)),s.set(h,C)),N?C.formatToParts(u):C.format(u)}const $e=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function xe(...e){const[t,n,a,r]=e,o={};let s,i={};if(p(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Oe(be.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();s=new Date(n);try{s.toISOString()}catch(e){throw Oe(be.INVALID_ISO_DATE_ARGUMENT)}}else if("[object Date]"===N(t)){if(isNaN(t.getTime()))throw Oe(be.INVALID_DATE_ARGUMENT);s=t}else{if(!l(t))throw Oe(be.INVALID_ARGUMENT);s=t}return p(n)?o.key=n:A(n)&&Object.keys(n).forEach((e=>{$e.includes(e)?i[e]=n[e]:o[e]=n[e]})),p(a)?o.locale=a:A(a)&&(i=a),A(r)&&(i=r),[o.key||"",s,o,i]}function Ke(e,t,n){const a=e;for(const e in n){const n=`${t}__${e}`;a.__datetimeFormatters.has(n)&&a.__datetimeFormatters.delete(n)}}function Ve(e,...t){const{numberFormats:n,unresolving:a,fallbackLocale:r,onWarn:o,localeFallbacker:l}=e,{__numberFormatters:s}=e;if(!Pe)return o(X(j.CANNOT_FORMAT_NUMBER)),"";const[c,u,_,f]=Ge(...t),g=d(_.missingWarn)?_.missingWarn:e.missingWarn,E=d(_.fallbackWarn)?_.fallbackWarn:e.fallbackWarn,N=!!_.part,T=p(_.locale)?_.locale:e.locale,I=l(e,r,T);if(!p(c)||""===c)return new Intl.NumberFormat(T,f).format(u);let k,y={},L=null,D=T,b=null;const O="number format";for(let t=0;t<I.length;t++){if(k=b=I[t],T!==k&&Ne(E,c)&&o(X(j.FALLBACK_TO_NUMBER_FORMAT,{key:c,target:k})),T!==k){const t=e.__v_emitter;t&&t.emit("fallback",{type:O,key:c,from:D,to:b,groupId:`${O}:${c}`})}if(y=n[k]||{},L=y[c],A(L))break;Te(e,c,k,g,O),D=b}if(!A(L)||!p(k))return a?-1:c;let h=`${k}__${c}`;i(f)||(h=`${h}__${JSON.stringify(f)}`);let C=s.get(h);return C||(C=new Intl.NumberFormat(k,m({},L,f)),s.set(h,C)),N?C.formatToParts(u):C.format(u)}const Be=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Ge(...e){const[t,n,a,r]=e,o={};let s={};if(!l(t))throw Oe(be.INVALID_ARGUMENT);const i=t;return p(n)?o.key=n:A(n)&&Object.keys(n).forEach((e=>{Be.includes(e)?s[e]=n[e]:o[e]=n[e]})),p(a)?o.locale=a:A(a)&&(s=a),A(r)&&(s=r),[o.key||"",i,o,s]}function je(e,t,n){const a=e;for(const e in n){const n=`${t}__${e}`;a.__numberFormatters.has(n)&&a.__numberFormatters.delete(n)}}ie(M),ce(Q);export{T as CompileErrorCodes,be as CoreErrorCodes,j as CoreWarnCodes,$e as DATETIME_FORMAT_OPTIONS_KEYS,te as DEFAULT_LOCALE,v as DEFAULT_MESSAGE_DATA_TYPE,ne as MISSING_RESOLVE_VALUE,ee as NOT_REOSLVED,Be as NUMBER_FORMAT_OPTIONS_KEYS,Z as VERSION,ke as clearCompileCache,Ke as clearDateTimeFormat,je as clearNumberFormat,ye as compileToFunction,k as createCompileError,Ee as createCoreContext,Oe as createCoreError,P as createMessageContext,We as datetime,Q as fallbackWithLocaleChain,Y as fallbackWithSimple,_e as getAdditionalMeta,K as getDevToolsHook,de as getFallbackContext,X as getWarnMessage,Te as handleMissing,V as initI18nDevTools,Me as isMessageFunction,Ne as isTranslateFallbackWarn,Ae as isTranslateMissingWarn,Ve as number,O as parse,xe as parseDateTimeArgs,Ge as parseNumberArgs,we as parseTranslateArgs,ce as registerLocaleFallbacker,se as registerMessageCompiler,ie as registerMessageResolver,M as resolveValue,C as resolveWithKeyValue,ue as setAdditionalMeta,x as setDevToolsHook,pe as setFallbackContext,Re as translate,B as translateDevTools,Ie as updateFallbackLocale};
package/index.mjs DELETED
@@ -1 +0,0 @@
1
- export * from './index.js'