@intlify/core-base
Advanced tools
Comparing version 9.0.0-rc.5 to 9.0.0-rc.6
/*! | ||
* @intlify/core-base v9.0.0-rc.5 | ||
* @intlify/core-base v9.0.0-rc.6 | ||
* (c) 2021 kazuya kawaguchi | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* @intlify/core-base v9.0.0-rc.5 | ||
* @intlify/core-base v9.0.0-rc.6 | ||
* (c) 2021 kazuya kawaguchi | ||
@@ -327,6 +327,5 @@ * Released under the MIT License. | ||
let format = null; | ||
let to = null; | ||
const type = 'translate'; | ||
for (let i = 0; i < locales.length; i++) { | ||
targetLocale = to = locales[i]; | ||
targetLocale = locales[i]; | ||
message = | ||
@@ -472,6 +471,5 @@ messages[targetLocale] || {}; | ||
let format = null; | ||
let to = null; | ||
const type = 'datetime format'; | ||
for (let i = 0; i < locales.length; i++) { | ||
targetLocale = to = locales[i]; | ||
targetLocale = locales[i]; | ||
datetimeFormat = | ||
@@ -582,6 +580,5 @@ datetimeFormats[targetLocale] || {}; | ||
let format = null; | ||
let to = null; | ||
const type = 'number format'; | ||
for (let i = 0; i < locales.length; i++) { | ||
targetLocale = to = locales[i]; | ||
targetLocale = locales[i]; | ||
numberFormat = | ||
@@ -588,0 +585,0 @@ numberFormats[targetLocale] || {}; |
/*! | ||
* @intlify/core-base v9.0.0-rc.5 | ||
* @intlify/core-base v9.0.0-rc.6 | ||
* (c) 2021 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
const e=/\{([0-9a-zA-Z]+)\}/g;const t=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),n=e=>"number"==typeof e&&isFinite(e),r=e=>"[object RegExp]"===m(e),o=e=>d(e)&&0===Object.keys(e).length;function c(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function s(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const a=Array.isArray,u=e=>"function"==typeof e,l=e=>"string"==typeof e,i=e=>"boolean"==typeof e,f=e=>null!==e&&"object"==typeof e,p=Object.prototype.toString,m=e=>p.call(e),d=e=>"[object Object]"===m(e),h=[];h[0]={w:[0],i:[3,0],"[":[4],o:[7]},h[1]={w:[1],".":[2],"[":[4],o:[7]},h[2]={w:[2],i:[3,0],0:[3,0]},h[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},h[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},h[5]={"'":[4,0],o:8,l:[5,0]},h[6]={'"':[4,0],o:8,l:[6,0]};const k=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function g(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)))&&(k.test(t)?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)}function y(e){const t=[];let n,r,o,c,s,a,u,l=-1,i=0,f=0;const p=[];function m(){const t=e[l+1];if(5===i&&"'"===t||6===i&&'"'===t)return l++,o="\\"+t,p[0](),!0}for(p[0]=()=>{void 0===r?r=o:r+=o},p[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),f++},p[3]=()=>{if(f>0)f--,i=4,p[0]();else{if(f=0,void 0===r)return!1;if(r=b(r),!1===r)return!1;p[1]()}};null!==i;)if(l++,n=e[l],"\\"!==n||!m()){if(c=g(n),u=h[i],s=u[c]||u.l||8,8===s)return;if(i=s[0],void 0!==s[1]&&(a=p[s[1]],a&&(o=n,!1===a())))return;if(7===i)return t}}const x=new Map;function v(e,t){if(!f(e))return null;let n=x.get(t);if(n||(n=y(t),n&&x.set(t,n)),!n)return null;const r=n.length;let o=e,c=0;for(;c<r;){const e=o[n[c]];if(void 0===e)return null;o=e,c++}return o}const w=e=>e,C=e=>"",L="text",T=e=>0===e.length?"":e.join(""),_=e=>null==e?"":a(e)||d(e)&&e.toString===p?JSON.stringify(e,null,2):String(e);function P(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function O(e={}){const t=e.locale,r=function(e){const t=n(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(n(e.named.count)||n(e.named.n))?n(e.named.count)?e.named.count:n(e.named.n)?e.named.n:t:t}(e),o=f(e.pluralRules)&&l(t)&&u(e.pluralRules[t])?e.pluralRules[t]:P,c=f(e.pluralRules)&&l(t)&&u(e.pluralRules[t])?P:void 0,s=e.list||[],a=e.named||{};n(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(r,a);function i(t){const n=u(e.messages)?e.messages(t):!!f(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):C)}const p=d(e.processor)&&u(e.processor.normalize)?e.processor.normalize:T,m=d(e.processor)&&u(e.processor.interpolate)?e.processor.interpolate:_,h={list:e=>s[e],named:e=>a[e],plural:e=>e[o(r,e.length,c)],linked:(t,n)=>{const r=i(t)(h);return l(n)?(o=n,e.modifiers?e.modifiers[o]:w)(r):r;var o},message:i,type:d(e.processor)&&l(e.processor.type)?e.processor.type:"text",interpolate:m,normalize:p};return h}function F(e,t,n={}){const{domain:r}=n,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=r,o}function N(e){throw e}function $(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const S=String.fromCharCode(8232),I=String.fromCharCode(8233);function E(e){const t=e;let n=0,r=1,o=1,c=0;const s=e=>"\r"===t[e]&&"\n"===t[e+1],a=e=>t[e]===I,u=e=>t[e]===S,l=e=>s(e)||(e=>"\n"===t[e])(e)||a(e)||u(e),i=e=>s(e)||a(e)||u(e)?"\n":t[e];function f(){return c=0,l(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>c,charAt:i,currentChar:()=>i(n),currentPeek:()=>i(n+c),next:f,peek:function(){return s(n+c)&&c++,c++,t[n+c]},reset:function(){n=0,r=1,o=1,c=0},resetPeek:function(e=0){c=e},skipToPeek:function(){const e=n+c;for(;e!==n;)f();c=0}}}const j=void 0;function W(e,t={}){const n=!1!==t.location,r=E(e),o=()=>r.index(),c=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=c(),a=o(),u={currentType:14,offset:a,startLoc:s,endLoc:s,lastType:14,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},l=()=>u,{onError:i}=t;function f(e,t,r){e.endLoc=c(),e.currentType=t;const o={type:t};return n&&(o.loc=$(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const p=e=>f(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(c(),"")}function d(e){let t="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)t+=e.currentPeek(),e.peek();return t}function h(e){const t=d(e);return e.skipToPeek(),t}function k(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90}function g(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function b(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function y(e,t=!0){const n=(t=!1,r="",o=!1)=>{const c=e.currentPeek();return"{"===c?"%"!==r&&t:"@"!==c&&c?"%"===c?(e.peek(),n(t,"%",!0)):"|"===c?!("%"!==r&&!o)||!(" "===r||"\n"===r):" "===c?(e.peek(),n(!0," ",o)):"\n"!==c||(e.peek(),n(!0,"\n",o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function x(e,t){const n=e.currentChar();return n===j?j:t(n)?(e.next(),n):null}function v(e){return x(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 w(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function C(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function L(e){let t="",n="";for(;t=w(e);)n+=t;return n}function T(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return _(e,t,4);case"U":return _(e,t,6);default:return c(),""}}function _(e,t,n){m(e,t);let r="";for(let t=0;t<n;t++){const t=C(e);if(!t){c(),e.currentChar();break}r+=t}return`\\${t}${r}`}function P(e){h(e);const t=m(e,"|");return h(e),t}function O(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&c(),e.next(),n=f(t,2,"{"),h(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&c(),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&h(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&c(),n=F(e,t)||p(t),t.braceNest=0,n;default:let r=!0,o=!0,s=!0;if(b(e))return t.braceNest>0&&c(),n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return c(),t.braceNest=0,N(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){h(e);let t="",n="";for(;t=v(e);)n+=t;return e.currentChar()===j&&c(),n}(e)),h(e),n;if(o=g(e,t))return n=f(t,6,function(e){h(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${L(e)}`):t+=L(e),e.currentChar()===j&&c(),t}(e)),h(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=f(t,7,function(e){h(e),m(e,"'");let t="",n="";const r=e=>"'"!==e&&"\n"!==e;for(;t=x(e,r);)n+="\\"===t?T(e):t;const o=e.currentChar();return"\n"===o||o===j?(c(),"\n"===o&&(e.next(),m(e,"'")),n):(m(e,"'"),n)}(e)),h(e),n;if(!r&&!o&&!s)return n=f(t,13,function(e){h(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;t=x(e,r);)n+=t;return n}(e)),c(),h(e),n}return n}function F(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||c(),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return h(e),e.next(),f(t,9,".");case":":return h(e),e.next(),f(t,10,":");default:return b(e)?(r=f(t,1,P(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)?(h(e),F(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t)?(h(e),f(t,12,function(e){let t="",n="";for(;t=v(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?k(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||" "===t||!t)&&("\n"===t?(e.peek(),r()):k(t))},o=r();return e.resetPeek(),o}(e,t)?(h(e),"{"===o?O(e,t)||r:f(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&&c(),t.braceNest=0,t.inLinked=!1,N(e,t))}}function N(e,t){let n={type:14};if(t.braceNest>0)return O(e,t)||p(t);if(t.inLinked)return F(e,t)||p(t);const r=e.currentChar();switch(r){case"{":return O(e,t)||p(t);case"}":return c(),e.next(),f(t,3,"}");case"@":return F(e,t)||p(t);default:if(b(e))return n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(y(e))return f(t,0,function(e){const t=n=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?y(e)?(n+=r,e.next(),t(n)):n:"|"===r?n:" "===r||"\n"===r?y(e)?(n+=r,e.next(),t(n)):b(e)?n:(n+=r,e.next(),t(n)):(n+=r,e.next(),t(n)):n};return t("")}(e));if("%"===r)return e.next(),f(t,4,"%")}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=u;return u.lastType=e,u.lastOffset=t,u.lastStartLoc=n,u.lastEndLoc=s,u.offset=o(),u.startLoc=c(),r.currentChar()===j?f(u,14):N(r,u)},currentOffset:o,currentPosition:c,context:l}}const A=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function M(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 R(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function o(e,n,r,o){e.end=n,o&&(e.type=o),t&&e.loc&&(e.loc.end=r)}function c(e,t){const n=e.context(),c=r(3,n.offset,n.startLoc);return c.value=t,o(c,e.currentOffset(),e.currentPosition()),c}function s(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(5,c,s);return a.index=parseInt(t,10),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function a(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(4,c,s);return a.key=t,e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function u(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(9,c,s);return a.value=t.replace(A,M),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function l(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let c=e.nextToken();if(9===c.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(8,c,s);return 12!==t.type?(a.value="",o(a,c,s),{nextConsumeToken:t,node:a}):(null==t.value&&J(t),a.value=t.value||"",o(a,e.currentOffset(),e.currentPosition()),{node:a})}(e);n.modifier=t.node,c=t.nextConsumeToken||e.nextToken()}switch(10!==c.type&&J(c),c=e.nextToken(),2===c.type&&(c=e.nextToken()),c.type){case 11:null==c.value&&J(c),n.key=function(e,t){const n=e.context(),c=r(7,n.offset,n.startLoc);return c.value=t,o(c,e.currentOffset(),e.currentPosition()),c}(e,c.value||"");break;case 5:null==c.value&&J(c),n.key=a(e,c.value||"");break;case 6:null==c.value&&J(c),n.key=s(e,c.value||"");break;case 7:null==c.value&&J(c),n.key=u(e,c.value||"");break;default:const t=e.context(),l=r(7,t.offset,t.startLoc);return l.value="",o(l,t.offset,t.startLoc),n.key=l,o(n,t.offset,t.startLoc),{nextConsumeToken:c,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function i(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 i=null;do{const t=i||e.nextToken();switch(i=null,t.type){case 0:null==t.value&&J(t),n.items.push(c(e,t.value||""));break;case 6:null==t.value&&J(t),n.items.push(s(e,t.value||""));break;case 5:null==t.value&&J(t),n.items.push(a(e,t.value||""));break;case 7:null==t.value&&J(t),n.items.push(u(e,t.value||""));break;case 8:const r=l(e);n.items.push(r.node),i=r.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 f(e){const t=e.context(),{offset:n,startLoc:c}=t,s=i(e);return 14===t.currentType?s:function(e,t,n,c){const s=e.context();let a=0===c.items.length;const u=r(1,t,n);u.cases=[],u.cases.push(c);do{const t=i(e);a||(a=0===t.items.length),u.cases.push(t)}while(14!==s.currentType);return o(u,e.currentOffset(),e.currentPosition()),u}(e,n,c,s)}return{parse:function(n){const c=W(n,{...e}),s=c.context(),a=r(0,s.offset,s.startLoc);return t&&a.loc&&(a.loc.source=n),a.body=f(c),o(a,c.currentOffset(),c.currentPosition()),a}}}function J(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 z(e,t){for(let n=0;n<e.length;n++)D(e[n],t)}function D(e,t){switch(e.type){case 1:z(e.cases,t),t.helper("plural");break;case 2:z(e.items,t);break;case 6:D(e.key,t),t.helper("linked");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function H(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&&D(e.body,n);const r=n.context();e.helpers=[...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(")")}(e,t);break;case 8:case 7: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;case 9:case 3:e.push(JSON.stringify(t.value),t)}}function K(e,t={}){const n=R({...t}).parse(e);return H(n,{...t}),((e,t={})=>{const n=l(t.mode)?t.mode:"normal",r=l(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],s=function(e,t){const{filename:n,breakLineCode:r,needIndent:o}=t,c={source:e.loc.source,filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};function s(e,t){c.code+=e}function a(e,t=!0){const n=t?r:"";s(o?n+" ".repeat(e):n)}return{context:()=>c,push:s,indent:function(e=!0){const t=++c.indentLevel;e&&a(t)},deindent:function(e=!0){const t=--c.indentLevel;e&&a(t)},newline:function(){a(c.indentLevel)},helper:e=>`_${e}`,needIndent:()=>c.needIndent}}(e,{mode:n,filename:r,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",needIndent:o});s.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),c.length>0&&(s.push(`const { ${c.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),U(s,e),s.deindent(o),s.push("}");const{code:a,map:u}=s.context();return{ast:e,code:a,map:u?u.toJSON():void 0}})(n,{...t})}const V={0:"Not found '{key}' key in '{locale}' locale messages.",1:"Fall back to translate '{key}' key with '{target}' locale.",2:"Cannot format a number value due to not supported Intl.NumberFormat.",3:"Fall back to number format '{key}' key with '{target}' locale.",4:"Cannot format a date value due to not supported Intl.DateTimeFormat.",5:"Fall back to datetime format '{key}' key with '{target}' locale."};function q(t,...n){return function(t,...n){return 1===n.length&&f(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),t.replace(e,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(V[t],...n)}const Z=-1,B="";let G;function Q(e){G=e}function X(e={}){const t=l(e.locale)?e.locale:"en-US",n=e;return{locale:t,fallbackLocale:a(e.fallbackLocale)||d(e.fallbackLocale)||l(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,messages:d(e.messages)?e.messages:{[t]:{}},datetimeFormats:d(e.datetimeFormats)?e.datetimeFormats:{[t]:{}},numberFormats:d(e.numberFormats)?e.numberFormats:{[t]:{}},modifiers:Object.assign({},e.modifiers||{},{upper:e=>l(e)?e.toUpperCase():e,lower:e=>l(e)?e.toLowerCase():e,capitalize:e=>l(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}),pluralRules:e.pluralRules||{},missing:u(e.missing)?e.missing:null,missingWarn:!i(e.missingWarn)&&!r(e.missingWarn)||e.missingWarn,fallbackWarn:!i(e.fallbackWarn)&&!r(e.fallbackWarn)||e.fallbackWarn,fallbackFormat:!!e.fallbackFormat,unresolving:!!e.unresolving,postTranslation:u(e.postTranslation)?e.postTranslation:null,processor:d(e.processor)?e.processor:null,warnHtmlMessage:!i(e.warnHtmlMessage)||e.warnHtmlMessage,escapeParameter:!!e.escapeParameter,messageCompiler:u(e.messageCompiler)?e.messageCompiler:G,onWarn:u(e.onWarn)?e.onWarn:c,__datetimeFormatters:f(n.__datetimeFormatters)?n.__datetimeFormatters:new Map,__numberFormatters:f(n.__numberFormatters)?n.__numberFormatters:new Map}}function Y(e,t){return e instanceof RegExp?e.test(t):e}function ee(e,t){return e instanceof RegExp?e.test(t):e}function te(e,t,n,r,o){const{missing:c}=e;if(null!==c){const r=c(e,n,t,o);return l(r)?r:t}return t}function ne(e,t,n){const r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(n);if(!o){o=[];let e=[n];for(;a(e);)e=re(o,e,t);const c=a(t)?t:d(t)?t.default?t.default:null:t;e=l(c)?[c]:c,a(e)&&re(o,e,!1),r.__localeChainCache.set(n,o)}return o}function re(e,t,n){let r=!0;for(let o=0;o<t.length&&i(r);o++){l(t[o])&&(r=oe(e,t[o],n))}return r}function oe(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),(a(n)||d(n))&&n[o]&&(r=n[o])}return r}function se(e,t,n){e.__localeChainCache=new Map,ne(e,n,t)}const ae=e=>e;let ue=Object.create(null);function le(){ue=Object.create(null)}function ie(e,t={}){{const n=(t.onCacheKey||ae)(e),r=ue[n];if(r)return r;let o=!1;const c=t.onError||N;t.onError=e=>{o=!0,c(e)};const{code:s}=K(e,t),a=new Function(`return ${s}`)();return o?a:ue[n]=a}}function fe(e){return F(e,null,void 0)}const pe=()=>"",me=e=>u(e);function de(e,...t){const{fallbackFormat:r,postTranslation:o,unresolving:c,fallbackLocale:p}=e,[m,d]=ke(...t),h=(i(d.missingWarn),i(d.fallbackWarn),i(d.escapeParameter)?d.escapeParameter:e.escapeParameter),k=l(d.default)||i(d.default)?i(d.default)?m:d.default:r?m:"",g=r||""!==k,b=l(d.locale)?d.locale:e.locale;h&&function(e){a(e.list)?e.list=e.list.map((e=>l(e)?s(e):e)):f(e.named)&&Object.keys(e.named).forEach((t=>{l(e.named[t])&&(e.named[t]=s(e.named[t]))}))}(d);let[y,x,w]=function(e,t,n,r,o,c){const{messages:s}=e,a=ne(e,r,n);let i,f={},p=null,m=null;const d="translate";for(let n=0;n<a.length&&(i=m=a[n],f=s[i]||{},null===(p=v(f,t))&&(p=f[t]),!l(p)&&!u(p));n++){const n=te(e,t,i,0,d);n!==t&&(p=n)}return[p,i,f]}(e,m,b,p),C=m;if(l(y)||me(y)||g&&(y=k,C=y),!l(y)&&!me(y)||!l(x))return c?-1:m;let L=!1;const T=he(e,m,x,y,C,(()=>{L=!0}));if(L)return y;const _=function(e,t,n){return t(n)}(0,T,O(function(e,t,r,o){const{modifiers:c,pluralRules:s}=e,a={locale:t,modifiers:c,pluralRules:s,messages:n=>{const o=v(r,n);if(l(o)){let r=!1;const c=he(e,n,t,o,n,(()=>{r=!0}));return r?pe:c}return me(o)?o:pe}};e.processor&&(a.processor=e.processor);o.list&&(a.list=o.list);o.named&&(a.named=o.named);n(o.plural)&&(a.pluralIndex=o.plural);return a}(e,x,w,d)));return o?o(_):_}function he(e,n,r,o,c,s){const{messageCompiler:a,warnHtmlMessage:u}=e;if(me(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||n,e}const l=a(o,function(e,n,r,o,c,s){return{warnHtmlMessage:c,onError:e=>{throw s&&s(e),e},onCacheKey:e=>((e,n,r)=>t({l:e,k:n,s:r}))(n,r,e)}}(0,r,c,0,u,s));return l.locale=r,l.key=n,l.source=o,l}function ke(...e){const[t,r,c]=e,s={};if(!l(t)&&!n(t))throw Error(14);const u=n(t)?String(t):t;return n(r)?s.plural=r:l(r)?s.default=r:d(r)&&!o(r)?s.named=r:a(r)&&(s.list=r),n(c)?s.plural=c:l(c)?s.default=c:d(c)&&Object.assign(s,c),[u,s]}function ge(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:c}=e,{__datetimeFormatters:s}=e,[a,u,f,p]=be(...t),m=(i(f.missingWarn),i(f.fallbackWarn),!!f.part),h=l(f.locale)?f.locale:e.locale,k=ne(e,c,h);if(!l(a)||""===a)return new Intl.DateTimeFormat(h).format(u);let g,b={},y=null,x=null;for(let t=0;t<k.length&&(g=x=k[t],b=n[g]||{},y=b[a],!d(y));t++)te(e,a,g,0,"datetime format");if(!d(y)||!l(g))return r?-1:a;let v=`${g}__${a}`;o(p)||(v=`${v}__${JSON.stringify(p)}`);let w=s.get(v);return w||(w=new Intl.DateTimeFormat(g,Object.assign({},y,p)),s.set(v,w)),m?w.formatToParts(u):w.format(u)}function be(...e){const[t,r,o,c]=e;let s,a={},u={};if(l(t)){if(!/\d{4}-\d{2}-\d{2}(T.*)?/.test(t))throw Error(16);s=new Date(t);try{s.toISOString()}catch(e){throw Error(16)}}else if("[object Date]"===m(t)){if(isNaN(t.getTime()))throw Error(15);s=t}else{if(!n(t))throw Error(14);s=t}return l(r)?a.key=r:d(r)&&(a=r),l(o)?a.locale=o:d(o)&&(u=o),d(c)&&(u=c),[a.key||"",s,a,u]}function ye(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function xe(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:c}=e,{__numberFormatters:s}=e,[a,u,f,p]=ve(...t),m=(i(f.missingWarn),i(f.fallbackWarn),!!f.part),h=l(f.locale)?f.locale:e.locale,k=ne(e,c,h);if(!l(a)||""===a)return new Intl.NumberFormat(h).format(u);let g,b={},y=null,x=null;for(let t=0;t<k.length&&(g=x=k[t],b=n[g]||{},y=b[a],!d(y));t++)te(e,a,g,0,"number format");if(!d(y)||!l(g))return r?-1:a;let v=`${g}__${a}`;o(p)||(v=`${v}__${JSON.stringify(p)}`);let w=s.get(v);return w||(w=new Intl.NumberFormat(g,Object.assign({},y,p)),s.set(v,w)),m?w.formatToParts(u):w.format(u)}function ve(...e){const[t,r,o,c]=e;let s={},a={};if(!n(t))throw Error(14);const u=t;return l(r)?s.key=r:d(r)&&(s=r),l(o)?s.locale=o:d(o)&&(a=o),d(c)&&(a=c),[s.key||"",u,s,a]}function we(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}const Ce={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},Le={"vue-i18n-resource-inspector":"Search for scopes ..."},Te={"vue-i18n-timeline":16764185};function _e(){const e=new Map;return{events:e,on(t,n){const r=e.get(t);r&&r.push(n)||e.set(t,[n])},off(t,n){const r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map((e=>e(n))),(e.get("*")||[]).slice().map((e=>e(t,n)))}}}export{L as DEFAULT_MESSAGE_DATA_TYPE,Ce as DevToolsLabels,Le as DevToolsPlaceholders,Te as DevToolsTimelineColors,B as MISSING_RESOLVE_VALUE,Z as NOT_REOSLVED,le as clearCompileCache,ye as clearDateTimeFormat,we as clearNumberFormat,ie as compileToFunction,F as createCompileError,X as createCoreContext,fe as createCoreError,_e as createEmitter,O as createMessageContext,ge as datetime,ne as getLocaleChain,q as getWarnMessage,te as handleMissing,Y as isTranslateFallbackWarn,ee as isTranslateMissingWarn,xe as number,y as parse,be as parseDateTimeArgs,ve as parseNumberArgs,ke as parseTranslateArgs,Q as registerMessageCompiler,v as resolveValue,de as translate,se as updateFallbackLocale}; | ||
const e=/\{([0-9a-zA-Z]+)\}/g;const t=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),n=e=>"number"==typeof e&&isFinite(e),r=e=>"[object RegExp]"===m(e),o=e=>d(e)&&0===Object.keys(e).length;function c(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function s(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const a=Array.isArray,u=e=>"function"==typeof e,l=e=>"string"==typeof e,i=e=>"boolean"==typeof e,f=e=>null!==e&&"object"==typeof e,p=Object.prototype.toString,m=e=>p.call(e),d=e=>"[object Object]"===m(e),h=[];h[0]={w:[0],i:[3,0],"[":[4],o:[7]},h[1]={w:[1],".":[2],"[":[4],o:[7]},h[2]={w:[2],i:[3,0],0:[3,0]},h[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},h[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},h[5]={"'":[4,0],o:8,l:[5,0]},h[6]={'"':[4,0],o:8,l:[6,0]};const k=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function g(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)))&&(k.test(t)?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)}function y(e){const t=[];let n,r,o,c,s,a,u,l=-1,i=0,f=0;const p=[];function m(){const t=e[l+1];if(5===i&&"'"===t||6===i&&'"'===t)return l++,o="\\"+t,p[0](),!0}for(p[0]=()=>{void 0===r?r=o:r+=o},p[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),f++},p[3]=()=>{if(f>0)f--,i=4,p[0]();else{if(f=0,void 0===r)return!1;if(r=b(r),!1===r)return!1;p[1]()}};null!==i;)if(l++,n=e[l],"\\"!==n||!m()){if(c=g(n),u=h[i],s=u[c]||u.l||8,8===s)return;if(i=s[0],void 0!==s[1]&&(a=p[s[1]],a&&(o=n,!1===a())))return;if(7===i)return t}}const x=new Map;function v(e,t){if(!f(e))return null;let n=x.get(t);if(n||(n=y(t),n&&x.set(t,n)),!n)return null;const r=n.length;let o=e,c=0;for(;c<r;){const e=o[n[c]];if(void 0===e)return null;o=e,c++}return o}const w=e=>e,C=e=>"",L="text",T=e=>0===e.length?"":e.join(""),_=e=>null==e?"":a(e)||d(e)&&e.toString===p?JSON.stringify(e,null,2):String(e);function P(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function O(e={}){const t=e.locale,r=function(e){const t=n(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(n(e.named.count)||n(e.named.n))?n(e.named.count)?e.named.count:n(e.named.n)?e.named.n:t:t}(e),o=f(e.pluralRules)&&l(t)&&u(e.pluralRules[t])?e.pluralRules[t]:P,c=f(e.pluralRules)&&l(t)&&u(e.pluralRules[t])?P:void 0,s=e.list||[],a=e.named||{};n(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(r,a);function i(t){const n=u(e.messages)?e.messages(t):!!f(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):C)}const p=d(e.processor)&&u(e.processor.normalize)?e.processor.normalize:T,m=d(e.processor)&&u(e.processor.interpolate)?e.processor.interpolate:_,h={list:e=>s[e],named:e=>a[e],plural:e=>e[o(r,e.length,c)],linked:(t,n)=>{const r=i(t)(h);return l(n)?(o=n,e.modifiers?e.modifiers[o]:w)(r):r;var o},message:i,type:d(e.processor)&&l(e.processor.type)?e.processor.type:"text",interpolate:m,normalize:p};return h}function F(e,t,n={}){const{domain:r}=n,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=r,o}function N(e){throw e}function $(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const S=String.fromCharCode(8232),I=String.fromCharCode(8233);function E(e){const t=e;let n=0,r=1,o=1,c=0;const s=e=>"\r"===t[e]&&"\n"===t[e+1],a=e=>t[e]===I,u=e=>t[e]===S,l=e=>s(e)||(e=>"\n"===t[e])(e)||a(e)||u(e),i=e=>s(e)||a(e)||u(e)?"\n":t[e];function f(){return c=0,l(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>c,charAt:i,currentChar:()=>i(n),currentPeek:()=>i(n+c),next:f,peek:function(){return s(n+c)&&c++,c++,t[n+c]},reset:function(){n=0,r=1,o=1,c=0},resetPeek:function(e=0){c=e},skipToPeek:function(){const e=n+c;for(;e!==n;)f();c=0}}}const j=void 0;function W(e,t={}){const n=!1!==t.location,r=E(e),o=()=>r.index(),c=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=c(),a=o(),u={currentType:14,offset:a,startLoc:s,endLoc:s,lastType:14,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},l=()=>u,{onError:i}=t;function f(e,t,r){e.endLoc=c(),e.currentType=t;const o={type:t};return n&&(o.loc=$(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const p=e=>f(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(c(),"")}function d(e){let t="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)t+=e.currentPeek(),e.peek();return t}function h(e){const t=d(e);return e.skipToPeek(),t}function k(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90}function g(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function b(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function y(e,t=!0){const n=(t=!1,r="",o=!1)=>{const c=e.currentPeek();return"{"===c?"%"!==r&&t:"@"!==c&&c?"%"===c?(e.peek(),n(t,"%",!0)):"|"===c?!("%"!==r&&!o)||!(" "===r||"\n"===r):" "===c?(e.peek(),n(!0," ",o)):"\n"!==c||(e.peek(),n(!0,"\n",o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function x(e,t){const n=e.currentChar();return n===j?j:t(n)?(e.next(),n):null}function v(e){return x(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 w(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function C(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function L(e){let t="",n="";for(;t=w(e);)n+=t;return n}function T(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return _(e,t,4);case"U":return _(e,t,6);default:return c(),""}}function _(e,t,n){m(e,t);let r="";for(let t=0;t<n;t++){const t=C(e);if(!t){c(),e.currentChar();break}r+=t}return`\\${t}${r}`}function P(e){h(e);const t=m(e,"|");return h(e),t}function O(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&c(),e.next(),n=f(t,2,"{"),h(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&c(),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&h(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&c(),n=F(e,t)||p(t),t.braceNest=0,n;default:let r=!0,o=!0,s=!0;if(b(e))return t.braceNest>0&&c(),n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return c(),t.braceNest=0,N(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){h(e);let t="",n="";for(;t=v(e);)n+=t;return e.currentChar()===j&&c(),n}(e)),h(e),n;if(o=g(e,t))return n=f(t,6,function(e){h(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${L(e)}`):t+=L(e),e.currentChar()===j&&c(),t}(e)),h(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=f(t,7,function(e){h(e),m(e,"'");let t="",n="";const r=e=>"'"!==e&&"\n"!==e;for(;t=x(e,r);)n+="\\"===t?T(e):t;const o=e.currentChar();return"\n"===o||o===j?(c(),"\n"===o&&(e.next(),m(e,"'")),n):(m(e,"'"),n)}(e)),h(e),n;if(!r&&!o&&!s)return n=f(t,13,function(e){h(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;t=x(e,r);)n+=t;return n}(e)),c(),h(e),n}return n}function F(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||c(),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return h(e),e.next(),f(t,9,".");case":":return h(e),e.next(),f(t,10,":");default:return b(e)?(r=f(t,1,P(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)?(h(e),F(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t)?(h(e),f(t,12,function(e){let t="",n="";for(;t=v(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?k(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||" "===t||!t)&&("\n"===t?(e.peek(),r()):k(t))},o=r();return e.resetPeek(),o}(e,t)?(h(e),"{"===o?O(e,t)||r:f(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&&c(),t.braceNest=0,t.inLinked=!1,N(e,t))}}function N(e,t){let n={type:14};if(t.braceNest>0)return O(e,t)||p(t);if(t.inLinked)return F(e,t)||p(t);const r=e.currentChar();switch(r){case"{":return O(e,t)||p(t);case"}":return c(),e.next(),f(t,3,"}");case"@":return F(e,t)||p(t);default:if(b(e))return n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(y(e))return f(t,0,function(e){const t=n=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?y(e)?(n+=r,e.next(),t(n)):n:"|"===r?n:" "===r||"\n"===r?y(e)?(n+=r,e.next(),t(n)):b(e)?n:(n+=r,e.next(),t(n)):(n+=r,e.next(),t(n)):n};return t("")}(e));if("%"===r)return e.next(),f(t,4,"%")}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=u;return u.lastType=e,u.lastOffset=t,u.lastStartLoc=n,u.lastEndLoc=s,u.offset=o(),u.startLoc=c(),r.currentChar()===j?f(u,14):N(r,u)},currentOffset:o,currentPosition:c,context:l}}const A=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function M(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 R(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function o(e,n,r,o){e.end=n,o&&(e.type=o),t&&e.loc&&(e.loc.end=r)}function c(e,t){const n=e.context(),c=r(3,n.offset,n.startLoc);return c.value=t,o(c,e.currentOffset(),e.currentPosition()),c}function s(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(5,c,s);return a.index=parseInt(t,10),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function a(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(4,c,s);return a.key=t,e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function u(e,t){const n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(9,c,s);return a.value=t.replace(A,M),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function l(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let c=e.nextToken();if(9===c.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:c,lastStartLoc:s}=n,a=r(8,c,s);return 12!==t.type?(a.value="",o(a,c,s),{nextConsumeToken:t,node:a}):(null==t.value&&J(t),a.value=t.value||"",o(a,e.currentOffset(),e.currentPosition()),{node:a})}(e);n.modifier=t.node,c=t.nextConsumeToken||e.nextToken()}switch(10!==c.type&&J(c),c=e.nextToken(),2===c.type&&(c=e.nextToken()),c.type){case 11:null==c.value&&J(c),n.key=function(e,t){const n=e.context(),c=r(7,n.offset,n.startLoc);return c.value=t,o(c,e.currentOffset(),e.currentPosition()),c}(e,c.value||"");break;case 5:null==c.value&&J(c),n.key=a(e,c.value||"");break;case 6:null==c.value&&J(c),n.key=s(e,c.value||"");break;case 7:null==c.value&&J(c),n.key=u(e,c.value||"");break;default:const t=e.context(),l=r(7,t.offset,t.startLoc);return l.value="",o(l,t.offset,t.startLoc),n.key=l,o(n,t.offset,t.startLoc),{nextConsumeToken:c,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function i(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 i=null;do{const t=i||e.nextToken();switch(i=null,t.type){case 0:null==t.value&&J(t),n.items.push(c(e,t.value||""));break;case 6:null==t.value&&J(t),n.items.push(s(e,t.value||""));break;case 5:null==t.value&&J(t),n.items.push(a(e,t.value||""));break;case 7:null==t.value&&J(t),n.items.push(u(e,t.value||""));break;case 8:const r=l(e);n.items.push(r.node),i=r.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 f(e){const t=e.context(),{offset:n,startLoc:c}=t,s=i(e);return 14===t.currentType?s:function(e,t,n,c){const s=e.context();let a=0===c.items.length;const u=r(1,t,n);u.cases=[],u.cases.push(c);do{const t=i(e);a||(a=0===t.items.length),u.cases.push(t)}while(14!==s.currentType);return o(u,e.currentOffset(),e.currentPosition()),u}(e,n,c,s)}return{parse:function(n){const c=W(n,{...e}),s=c.context(),a=r(0,s.offset,s.startLoc);return t&&a.loc&&(a.loc.source=n),a.body=f(c),o(a,c.currentOffset(),c.currentPosition()),a}}}function J(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 z(e,t){for(let n=0;n<e.length;n++)D(e[n],t)}function D(e,t){switch(e.type){case 1:z(e.cases,t),t.helper("plural");break;case 2:z(e.items,t);break;case 6:D(e.key,t),t.helper("linked");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function H(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&&D(e.body,n);const r=n.context();e.helpers=[...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(")")}(e,t);break;case 8:case 7: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;case 9:case 3:e.push(JSON.stringify(t.value),t)}}function K(e,t={}){const n=R({...t}).parse(e);return H(n,{...t}),((e,t={})=>{const n=l(t.mode)?t.mode:"normal",r=l(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],s=function(e,t){const{filename:n,breakLineCode:r,needIndent:o}=t,c={source:e.loc.source,filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};function s(e,t){c.code+=e}function a(e,t=!0){const n=t?r:"";s(o?n+" ".repeat(e):n)}return{context:()=>c,push:s,indent:function(e=!0){const t=++c.indentLevel;e&&a(t)},deindent:function(e=!0){const t=--c.indentLevel;e&&a(t)},newline:function(){a(c.indentLevel)},helper:e=>`_${e}`,needIndent:()=>c.needIndent}}(e,{mode:n,filename:r,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",needIndent:o});s.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),c.length>0&&(s.push(`const { ${c.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),U(s,e),s.deindent(o),s.push("}");const{code:a,map:u}=s.context();return{ast:e,code:a,map:u?u.toJSON():void 0}})(n,{...t})}const V={0:"Not found '{key}' key in '{locale}' locale messages.",1:"Fall back to translate '{key}' key with '{target}' locale.",2:"Cannot format a number value due to not supported Intl.NumberFormat.",3:"Fall back to number format '{key}' key with '{target}' locale.",4:"Cannot format a date value due to not supported Intl.DateTimeFormat.",5:"Fall back to datetime format '{key}' key with '{target}' locale."};function q(t,...n){return function(t,...n){return 1===n.length&&f(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),t.replace(e,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(V[t],...n)}const Z=-1,B="";let G;function Q(e){G=e}function X(e={}){const t=l(e.locale)?e.locale:"en-US",n=e;return{locale:t,fallbackLocale:a(e.fallbackLocale)||d(e.fallbackLocale)||l(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,messages:d(e.messages)?e.messages:{[t]:{}},datetimeFormats:d(e.datetimeFormats)?e.datetimeFormats:{[t]:{}},numberFormats:d(e.numberFormats)?e.numberFormats:{[t]:{}},modifiers:Object.assign({},e.modifiers||{},{upper:e=>l(e)?e.toUpperCase():e,lower:e=>l(e)?e.toLowerCase():e,capitalize:e=>l(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}),pluralRules:e.pluralRules||{},missing:u(e.missing)?e.missing:null,missingWarn:!i(e.missingWarn)&&!r(e.missingWarn)||e.missingWarn,fallbackWarn:!i(e.fallbackWarn)&&!r(e.fallbackWarn)||e.fallbackWarn,fallbackFormat:!!e.fallbackFormat,unresolving:!!e.unresolving,postTranslation:u(e.postTranslation)?e.postTranslation:null,processor:d(e.processor)?e.processor:null,warnHtmlMessage:!i(e.warnHtmlMessage)||e.warnHtmlMessage,escapeParameter:!!e.escapeParameter,messageCompiler:u(e.messageCompiler)?e.messageCompiler:G,onWarn:u(e.onWarn)?e.onWarn:c,__datetimeFormatters:f(n.__datetimeFormatters)?n.__datetimeFormatters:new Map,__numberFormatters:f(n.__numberFormatters)?n.__numberFormatters:new Map}}function Y(e,t){return e instanceof RegExp?e.test(t):e}function ee(e,t){return e instanceof RegExp?e.test(t):e}function te(e,t,n,r,o){const{missing:c}=e;if(null!==c){const r=c(e,n,t,o);return l(r)?r:t}return t}function ne(e,t,n){const r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(n);if(!o){o=[];let e=[n];for(;a(e);)e=re(o,e,t);const c=a(t)?t:d(t)?t.default?t.default:null:t;e=l(c)?[c]:c,a(e)&&re(o,e,!1),r.__localeChainCache.set(n,o)}return o}function re(e,t,n){let r=!0;for(let o=0;o<t.length&&i(r);o++){l(t[o])&&(r=oe(e,t[o],n))}return r}function oe(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),(a(n)||d(n))&&n[o]&&(r=n[o])}return r}function se(e,t,n){e.__localeChainCache=new Map,ne(e,n,t)}const ae=e=>e;let ue=Object.create(null);function le(){ue=Object.create(null)}function ie(e,t={}){{const n=(t.onCacheKey||ae)(e),r=ue[n];if(r)return r;let o=!1;const c=t.onError||N;t.onError=e=>{o=!0,c(e)};const{code:s}=K(e,t),a=new Function(`return ${s}`)();return o?a:ue[n]=a}}function fe(e){return F(e,null,void 0)}const pe=()=>"",me=e=>u(e);function de(e,...t){const{fallbackFormat:r,postTranslation:o,unresolving:c,fallbackLocale:p}=e,[m,d]=ke(...t),h=(i(d.missingWarn),i(d.fallbackWarn),i(d.escapeParameter)?d.escapeParameter:e.escapeParameter),k=l(d.default)||i(d.default)?i(d.default)?m:d.default:r?m:"",g=r||""!==k,b=l(d.locale)?d.locale:e.locale;h&&function(e){a(e.list)?e.list=e.list.map((e=>l(e)?s(e):e)):f(e.named)&&Object.keys(e.named).forEach((t=>{l(e.named[t])&&(e.named[t]=s(e.named[t]))}))}(d);let[y,x,w]=function(e,t,n,r,o,c){const{messages:s}=e,a=ne(e,r,n);let i,f={},p=null;const m="translate";for(let n=0;n<a.length&&(i=a[n],f=s[i]||{},null===(p=v(f,t))&&(p=f[t]),!l(p)&&!u(p));n++){const n=te(e,t,i,0,m);n!==t&&(p=n)}return[p,i,f]}(e,m,b,p),C=m;if(l(y)||me(y)||g&&(y=k,C=y),!l(y)&&!me(y)||!l(x))return c?-1:m;let L=!1;const T=he(e,m,x,y,C,(()=>{L=!0}));if(L)return y;const _=function(e,t,n){return t(n)}(0,T,O(function(e,t,r,o){const{modifiers:c,pluralRules:s}=e,a={locale:t,modifiers:c,pluralRules:s,messages:n=>{const o=v(r,n);if(l(o)){let r=!1;const c=he(e,n,t,o,n,(()=>{r=!0}));return r?pe:c}return me(o)?o:pe}};e.processor&&(a.processor=e.processor);o.list&&(a.list=o.list);o.named&&(a.named=o.named);n(o.plural)&&(a.pluralIndex=o.plural);return a}(e,x,w,d)));return o?o(_):_}function he(e,n,r,o,c,s){const{messageCompiler:a,warnHtmlMessage:u}=e;if(me(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||n,e}const l=a(o,function(e,n,r,o,c,s){return{warnHtmlMessage:c,onError:e=>{throw s&&s(e),e},onCacheKey:e=>((e,n,r)=>t({l:e,k:n,s:r}))(n,r,e)}}(0,r,c,0,u,s));return l.locale=r,l.key=n,l.source=o,l}function ke(...e){const[t,r,c]=e,s={};if(!l(t)&&!n(t))throw Error(14);const u=n(t)?String(t):t;return n(r)?s.plural=r:l(r)?s.default=r:d(r)&&!o(r)?s.named=r:a(r)&&(s.list=r),n(c)?s.plural=c:l(c)?s.default=c:d(c)&&Object.assign(s,c),[u,s]}function ge(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:c}=e,{__datetimeFormatters:s}=e,[a,u,f,p]=be(...t),m=(i(f.missingWarn),i(f.fallbackWarn),!!f.part),h=l(f.locale)?f.locale:e.locale,k=ne(e,c,h);if(!l(a)||""===a)return new Intl.DateTimeFormat(h).format(u);let g,b={},y=null;for(let t=0;t<k.length&&(g=k[t],b=n[g]||{},y=b[a],!d(y));t++)te(e,a,g,0,"datetime format");if(!d(y)||!l(g))return r?-1:a;let x=`${g}__${a}`;o(p)||(x=`${x}__${JSON.stringify(p)}`);let v=s.get(x);return v||(v=new Intl.DateTimeFormat(g,Object.assign({},y,p)),s.set(x,v)),m?v.formatToParts(u):v.format(u)}function be(...e){const[t,r,o,c]=e;let s,a={},u={};if(l(t)){if(!/\d{4}-\d{2}-\d{2}(T.*)?/.test(t))throw Error(16);s=new Date(t);try{s.toISOString()}catch(e){throw Error(16)}}else if("[object Date]"===m(t)){if(isNaN(t.getTime()))throw Error(15);s=t}else{if(!n(t))throw Error(14);s=t}return l(r)?a.key=r:d(r)&&(a=r),l(o)?a.locale=o:d(o)&&(u=o),d(c)&&(u=c),[a.key||"",s,a,u]}function ye(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function xe(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:c}=e,{__numberFormatters:s}=e,[a,u,f,p]=ve(...t),m=(i(f.missingWarn),i(f.fallbackWarn),!!f.part),h=l(f.locale)?f.locale:e.locale,k=ne(e,c,h);if(!l(a)||""===a)return new Intl.NumberFormat(h).format(u);let g,b={},y=null;for(let t=0;t<k.length&&(g=k[t],b=n[g]||{},y=b[a],!d(y));t++)te(e,a,g,0,"number format");if(!d(y)||!l(g))return r?-1:a;let x=`${g}__${a}`;o(p)||(x=`${x}__${JSON.stringify(p)}`);let v=s.get(x);return v||(v=new Intl.NumberFormat(g,Object.assign({},y,p)),s.set(x,v)),m?v.formatToParts(u):v.format(u)}function ve(...e){const[t,r,o,c]=e;let s={},a={};if(!n(t))throw Error(14);const u=t;return l(r)?s.key=r:d(r)&&(s=r),l(o)?s.locale=o:d(o)&&(a=o),d(c)&&(a=c),[s.key||"",u,s,a]}function we(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}const Ce={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},Le={"vue-i18n-resource-inspector":"Search for scopes ..."},Te={"vue-i18n-timeline":16764185};function _e(){const e=new Map;return{events:e,on(t,n){const r=e.get(t);r&&r.push(n)||e.set(t,[n])},off(t,n){const r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map((e=>e(n))),(e.get("*")||[]).slice().map((e=>e(t,n)))}}}export{L as DEFAULT_MESSAGE_DATA_TYPE,Ce as DevToolsLabels,Le as DevToolsPlaceholders,Te as DevToolsTimelineColors,B as MISSING_RESOLVE_VALUE,Z as NOT_REOSLVED,le as clearCompileCache,ye as clearDateTimeFormat,we as clearNumberFormat,ie as compileToFunction,F as createCompileError,X as createCoreContext,fe as createCoreError,_e as createEmitter,O as createMessageContext,ge as datetime,ne as getLocaleChain,q as getWarnMessage,te as handleMissing,Y as isTranslateFallbackWarn,ee as isTranslateMissingWarn,xe as number,y as parse,be as parseDateTimeArgs,ve as parseNumberArgs,ke as parseTranslateArgs,Q as registerMessageCompiler,v as resolveValue,de as translate,se as updateFallbackLocale}; |
/*! | ||
* @intlify/core-base v9.0.0-rc.5 | ||
* @intlify/core-base v9.0.0-rc.6 | ||
* (c) 2021 kazuya kawaguchi | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* @intlify/core-base v9.0.0-rc.5 | ||
* @intlify/core-base v9.0.0-rc.6 | ||
* (c) 2021 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
var IntlifyCoreBase=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),r=e=>"number"==typeof e&&isFinite(e),o=e=>"[object RegExp]"===d(e),s=e=>h(e)&&0===Object.keys(e).length;function c(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function a(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const u=Array.isArray,l=e=>"function"==typeof e,i=e=>"string"==typeof e,f=e=>"boolean"==typeof e,p=e=>null!==e&&"object"==typeof e,m=Object.prototype.toString,d=e=>m.call(e),h=e=>"[object Object]"===d(e),k=[];k[0]={w:[0],i:[3,0],"[":[4],o:[7]},k[1]={w:[1],".":[2],"[":[4],o:[7]},k[2]={w:[2],i:[3,0],0:[3,0]},k[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},k[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},k[5]={"'":[4,0],o:8,l:[5,0]},k[6]={'"':[4,0],o:8,l:[6,0]};const g=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function b(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 y(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(g.test(t)?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)}function x(e){const t=[];let n,r,o,s,c,a,u,l=-1,i=0,f=0;const p=[];function m(){const t=e[l+1];if(5===i&&"'"===t||6===i&&'"'===t)return l++,o="\\"+t,p[0](),!0}for(p[0]=()=>{void 0===r?r=o:r+=o},p[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),f++},p[3]=()=>{if(f>0)f--,i=4,p[0]();else{if(f=0,void 0===r)return!1;if(r=y(r),!1===r)return!1;p[1]()}};null!==i;)if(l++,n=e[l],"\\"!==n||!m()){if(s=b(n),u=k[i],c=u[s]||u.l||8,8===c)return;if(i=c[0],void 0!==c[1]&&(a=p[c[1]],a&&(o=n,!1===a())))return;if(7===i)return t}}const C=new Map;function v(e,t){if(!p(e))return null;let n=C.get(t);if(n||(n=x(t),n&&C.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;o=e,s++}return o}const T=e=>e,L=e=>"",_="text",w=e=>0===e.length?"":e.join(""),P=e=>null==e?"":u(e)||h(e)&&e.toString===m?JSON.stringify(e,null,2):String(e);function O(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function F(e={}){const t=e.locale,n=function(e){const t=r(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(r(e.named.count)||r(e.named.n))?r(e.named.count)?e.named.count:r(e.named.n)?e.named.n:t:t}(e),o=p(e.pluralRules)&&i(t)&&l(e.pluralRules[t])?e.pluralRules[t]:O,s=p(e.pluralRules)&&i(t)&&l(e.pluralRules[t])?O:void 0,c=e.list||[],a=e.named||{};r(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,a);function u(t){const n=l(e.messages)?e.messages(t):!!p(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):L)}const f=h(e.processor)&&l(e.processor.normalize)?e.processor.normalize:w,m=h(e.processor)&&l(e.processor.interpolate)?e.processor.interpolate:P,d={list:e=>c[e],named:e=>a[e],plural:e=>e[o(n,e.length,s)],linked:(t,n)=>{const r=u(t)(d);return i(n)?(o=n,e.modifiers?e.modifiers[o]:T)(r):r;var o},message:u,type:h(e.processor)&&i(e.processor.type)?e.processor.type:_,interpolate:m,normalize:f};return d}function N(e,t,n={}){const{domain:r}=n,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=r,o}function S(e){throw e}function $(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const E=" ",I="\n",A=String.fromCharCode(8232),M=String.fromCharCode(8233);function W(e){const t=e;let n=0,r=1,o=1,s=0;const c=e=>"\r"===t[e]&&t[e+1]===I,a=e=>t[e]===M,u=e=>t[e]===A,l=e=>c(e)||(e=>t[e]===I)(e)||a(e)||u(e),i=e=>c(e)||a(e)||u(e)?I:t[e];function f(){return s=0,l(n)&&(r++,o=0),c(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>s,charAt:i,currentChar:()=>i(n),currentPeek:()=>i(n+s),next:f,peek:function(){return c(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 j=void 0;function R(e,t={}){const n=!1!==t.location,r=W(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},c=s(),a=o(),u={currentType:14,offset:a,startLoc:c,endLoc:c,lastType:14,lastOffset:a,lastStartLoc:c,lastEndLoc:c,braceNest:0,inLinked:!1,text:""},l=()=>u,{onError:i}=t;function f(e,t,r){e.endLoc=s(),e.currentType=t;const o={type:t};return n&&(o.loc=$(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const p=e=>f(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(s(),"")}function d(e){let t="";for(;e.currentPeek()===E||e.currentPeek()===I;)t+=e.currentPeek(),e.peek();return t}function h(e){const t=d(e);return e.skipToPeek(),t}function k(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90}function g(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function b(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function y(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===E||r===I):s===E?(e.peek(),n(!0,E,o)):s!==I||(e.peek(),n(!0,I,o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function x(e,t){const n=e.currentChar();return n===j?j:t(n)?(e.next(),n):null}function C(e){return x(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 v(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function T(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function L(e){let t="",n="";for(;t=v(e);)n+=t;return n}function _(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return w(e,t,4);case"U":return w(e,t,6);default:return s(),""}}function w(e,t,n){m(e,t);let r="";for(let t=0;t<n;t++){const t=T(e);if(!t){s(),e.currentChar();break}r+=t}return`\\${t}${r}`}function P(e){h(e);const t=m(e,"|");return h(e),t}function O(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&s(),e.next(),n=f(t,2,"{"),h(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&s(),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&h(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&s(),n=F(e,t)||p(t),t.braceNest=0,n;default:let r=!0,o=!0,c=!0;if(b(e))return t.braceNest>0&&s(),n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return s(),t.braceNest=0,N(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){h(e);let t="",n="";for(;t=C(e);)n+=t;return e.currentChar()===j&&s(),n}(e)),h(e),n;if(o=g(e,t))return n=f(t,6,function(e){h(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${L(e)}`):t+=L(e),e.currentChar()===j&&s(),t}(e)),h(e),n;if(c=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=f(t,7,function(e){h(e),m(e,"'");let t="",n="";const r=e=>"'"!==e&&e!==I;for(;t=x(e,r);)n+="\\"===t?_(e):t;const o=e.currentChar();return o===I||o===j?(s(),o===I&&(e.next(),m(e,"'")),n):(m(e,"'"),n)}(e)),h(e),n;if(!r&&!o&&!c)return n=f(t,13,function(e){h(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&e!==E&&e!==I;for(;t=x(e,r);)n+=t;return n}(e)),s(),h(e),n}return n}function F(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==I&&o!==E||s(),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return h(e),e.next(),f(t,9,".");case":":return h(e),e.next(),f(t,10,":");default:return b(e)?(r=f(t,1,P(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)?(h(e),F(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t)?(h(e),f(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?k(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===E||!t)&&(t===I?(e.peek(),r()):k(t))},o=r();return e.resetPeek(),o}(e,t)?(h(e),"{"===o?O(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?o===E?r:o===I?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&s(),t.braceNest=0,t.inLinked=!1,N(e,t))}}function N(e,t){let n={type:14};if(t.braceNest>0)return O(e,t)||p(t);if(t.inLinked)return F(e,t)||p(t);const r=e.currentChar();switch(r){case"{":return O(e,t)||p(t);case"}":return s(),e.next(),f(t,3,"}");case"@":return F(e,t)||p(t);default:if(b(e))return n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(y(e))return f(t,0,function(e){const t=n=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?y(e)?(n+=r,e.next(),t(n)):n:"|"===r?n:r===E||r===I?y(e)?(n+=r,e.next(),t(n)):b(e)?n:(n+=r,e.next(),t(n)):(n+=r,e.next(),t(n)):n};return t("")}(e));if("%"===r)return e.next(),f(t,4,"%")}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:c}=u;return u.lastType=e,u.lastOffset=t,u.lastStartLoc=n,u.lastEndLoc=c,u.offset=o(),u.startLoc=s(),r.currentChar()===j?f(u,14):N(r,u)},currentOffset:o,currentPosition:s,context:l}}const D=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function J(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 z(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function o(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(),s=r(3,n.offset,n.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function c(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:c}=n,a=r(5,s,c);return a.index=parseInt(t,10),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function a(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:c}=n,a=r(4,s,c);return a.key=t,e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function u(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:c}=n,a=r(9,s,c);return a.value=t.replace(D,J),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function l(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:c}=n,a=r(8,s,c);return 12!==t.type?(a.value="",o(a,s,c),{nextConsumeToken:t,node:a}):(null==t.value&&U(t),a.value=t.value||"",o(a,e.currentOffset(),e.currentPosition()),{node:a})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&U(s),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&U(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&&U(s),n.key=a(e,s.value||"");break;case 6:null==s.value&&U(s),n.key=c(e,s.value||"");break;case 7:null==s.value&&U(s),n.key=u(e,s.value||"");break;default:const t=e.context(),l=r(7,t.offset,t.startLoc);return l.value="",o(l,t.offset,t.startLoc),n.key=l,o(n,t.offset,t.startLoc),{nextConsumeToken:s,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function i(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 i=null;do{const t=i||e.nextToken();switch(i=null,t.type){case 0:null==t.value&&U(t),n.items.push(s(e,t.value||""));break;case 6:null==t.value&&U(t),n.items.push(c(e,t.value||""));break;case 5:null==t.value&&U(t),n.items.push(a(e,t.value||""));break;case 7:null==t.value&&U(t),n.items.push(u(e,t.value||""));break;case 8:const r=l(e);n.items.push(r.node),i=r.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 f(e){const t=e.context(),{offset:n,startLoc:s}=t,c=i(e);return 14===t.currentType?c:function(e,t,n,s){const c=e.context();let a=0===s.items.length;const u=r(1,t,n);u.cases=[],u.cases.push(s);do{const t=i(e);a||(a=0===t.items.length),u.cases.push(t)}while(14!==c.currentType);return o(u,e.currentOffset(),e.currentPosition()),u}(e,n,s,c)}return{parse:function(n){const s=R(n,{...e}),c=s.context(),a=r(0,c.offset,c.startLoc);return t&&a.loc&&(a.loc.source=n),a.body=f(s),o(a,s.currentOffset(),s.currentPosition()),a}}}function U(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 V(e,t){for(let n=0;n<e.length;n++)H(e[n],t)}function H(e,t){switch(e.type){case 1:V(e.cases,t),t.helper("plural");break;case 2:V(e.items,t);break;case 6:H(e.key,t),t.helper("linked");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&&H(e.body,n);const r=n.context();e.helpers=[...r.helpers]}function K(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?K(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&&(K(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&&(K(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")}(`),K(e,t.key),t.modifier&&(e.push(", "),K(e,t.modifier)),e.push(")")}(e,t);break;case 8:case 7: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;case 9:case 3:e.push(JSON.stringify(t.value),t)}}function q(e,t={}){const n=z({...t}).parse(e);return G(n,{...t}),((e,t={})=>{const n=i(t.mode)?t.mode:"normal",r=i(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==n,s=e.helpers||[],c=function(e,t){const{filename:n,breakLineCode:r,needIndent:o}=t,s={source:e.loc.source,filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};function c(e,t){s.code+=e}function a(e,t=!0){const n=t?r:"";c(o?n+" ".repeat(e):n)}return{context:()=>s,push:c,indent:function(e=!0){const t=++s.indentLevel;e&&a(t)},deindent:function(e=!0){const t=--s.indentLevel;e&&a(t)},newline:function(){a(s.indentLevel)},helper:e=>`_${e}`,needIndent:()=>s.needIndent}}(e,{mode:n,filename:r,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",needIndent:o});c.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(o),s.length>0&&(c.push(`const { ${s.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),c.newline()),c.push("return "),K(c,e),c.deindent(o),c.push("}");const{code:a,map:u}=c.context();return{ast:e,code:a,map:u?u.toJSON():void 0}})(n,{...t})}const B={0:"Not found '{key}' key in '{locale}' locale messages.",1:"Fall back to translate '{key}' key with '{target}' locale.",2:"Cannot format a number value due to not supported Intl.NumberFormat.",3:"Fall back to number format '{key}' key with '{target}' locale.",4:"Cannot format a date value due to not supported Intl.DateTimeFormat.",5:"Fall back to datetime format '{key}' key with '{target}' locale."};let Y;function Z(e,t,n,r,o){const{missing:s}=e;if(null!==s){const r=s(e,n,t,o);return i(r)?r:t}return t}function Q(e,t,n){const r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(n);if(!o){o=[];let e=[n];for(;u(e);)e=X(o,e,t);const s=u(t)?t:h(t)?t.default?t.default:null:t;e=i(s)?[s]:s,u(e)&&X(o,e,!1),r.__localeChainCache.set(n,o)}return o}function X(e,t,n){let r=!0;for(let o=0;o<t.length&&f(r);o++){i(t[o])&&(r=ee(e,t[o],n))}return r}function ee(e,t,n){let r;const o=t.split("-");do{r=te(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function te(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)||h(n))&&n[o]&&(r=n[o])}return r}const ne=e=>e;let re=Object.create(null);const oe=()=>"",se=e=>l(e);function ce(e,t,r,o,s,c){const{messageCompiler:a,warnHtmlMessage:u}=e;if(se(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}const l=a(o,function(e,t,r,o,s,c){return{warnHtmlMessage:s,onError:e=>{throw c&&c(e),e},onCacheKey:e=>((e,t,r)=>n({l:e,k:t,s:r}))(t,r,e)}}(0,r,s,0,u,c));return l.locale=r,l.key=t,l.source=o,l}function ae(...e){const[t,n,o]=e,c={};if(!i(t)&&!r(t))throw Error(14);const a=r(t)?String(t):t;return r(n)?c.plural=n:i(n)?c.default=n:h(n)&&!s(n)?c.named=n:u(n)&&(c.list=n),r(o)?c.plural=o:i(o)?c.default=o:h(o)&&Object.assign(c,o),[a,c]}function ue(...e){const[t,n,o,s]=e;let c,a={},u={};if(i(t)){if(!/\d{4}-\d{2}-\d{2}(T.*)?/.test(t))throw Error(16);c=new Date(t);try{c.toISOString()}catch(e){throw Error(16)}}else if("[object Date]"===d(t)){if(isNaN(t.getTime()))throw Error(15);c=t}else{if(!r(t))throw Error(14);c=t}return i(n)?a.key=n:h(n)&&(a=n),i(o)?a.locale=o:h(o)&&(u=o),h(s)&&(u=s),[a.key||"",c,a,u]}function le(...e){const[t,n,o,s]=e;let c={},a={};if(!r(t))throw Error(14);const u=t;return i(n)?c.key=n:h(n)&&(c=n),i(o)?c.locale=o:h(o)&&(a=o),h(s)&&(a=s),[c.key||"",u,c,a]}const ie={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},fe={"vue-i18n-resource-inspector":"Search for scopes ..."},pe={"vue-i18n-timeline":16764185};return e.DEFAULT_MESSAGE_DATA_TYPE=_,e.DevToolsLabels=ie,e.DevToolsPlaceholders=fe,e.DevToolsTimelineColors=pe,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.clearCompileCache=function(){re=Object.create(null)},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}},e.compileToFunction=function(e,t={}){{const n=(t.onCacheKey||ne)(e),r=re[n];if(r)return r;let o=!1;const s=t.onError||S;t.onError=e=>{o=!0,s(e)};const{code:c}=q(e,t),a=new Function(`return ${c}`)();return o?a:re[n]=a}},e.createCompileError=N,e.createCoreContext=function(e={}){const t=i(e.locale)?e.locale:"en-US",n=e;return{locale:t,fallbackLocale:u(e.fallbackLocale)||h(e.fallbackLocale)||i(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,messages:h(e.messages)?e.messages:{[t]:{}},datetimeFormats:h(e.datetimeFormats)?e.datetimeFormats:{[t]:{}},numberFormats:h(e.numberFormats)?e.numberFormats:{[t]:{}},modifiers:Object.assign({},e.modifiers||{},{upper:e=>i(e)?e.toUpperCase():e,lower:e=>i(e)?e.toLowerCase():e,capitalize:e=>i(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}),pluralRules:e.pluralRules||{},missing:l(e.missing)?e.missing:null,missingWarn:!f(e.missingWarn)&&!o(e.missingWarn)||e.missingWarn,fallbackWarn:!f(e.fallbackWarn)&&!o(e.fallbackWarn)||e.fallbackWarn,fallbackFormat:!!e.fallbackFormat,unresolving:!!e.unresolving,postTranslation:l(e.postTranslation)?e.postTranslation:null,processor:h(e.processor)?e.processor:null,warnHtmlMessage:!f(e.warnHtmlMessage)||e.warnHtmlMessage,escapeParameter:!!e.escapeParameter,messageCompiler:l(e.messageCompiler)?e.messageCompiler:Y,onWarn:l(e.onWarn)?e.onWarn:c,__datetimeFormatters:p(n.__datetimeFormatters)?n.__datetimeFormatters:new Map,__numberFormatters:p(n.__numberFormatters)?n.__numberFormatters:new Map}},e.createCoreError=function(e){return N(e,null,void 0)},e.createEmitter=function(){const e=new Map;return{events:e,on(t,n){const r=e.get(t);r&&r.push(n)||e.set(t,[n])},off(t,n){const r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map((e=>e(n))),(e.get("*")||[]).slice().map((e=>e(t,n)))}}},e.createMessageContext=F,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o}=e,{__datetimeFormatters:c}=e,[a,u,l,p]=ue(...t),m=(f(l.missingWarn),f(l.fallbackWarn),!!l.part),d=i(l.locale)?l.locale:e.locale,k=Q(e,o,d);if(!i(a)||""===a)return new Intl.DateTimeFormat(d).format(u);let g,b={},y=null,x=null;for(let t=0;t<k.length&&(g=x=k[t],b=n[g]||{},y=b[a],!h(y));t++)Z(e,a,g,0,"datetime format");if(!h(y)||!i(g))return r?-1:a;let C=`${g}__${a}`;s(p)||(C=`${C}__${JSON.stringify(p)}`);let v=c.get(C);return v||(v=new Intl.DateTimeFormat(g,Object.assign({},y,p)),c.set(C,v)),m?v.formatToParts(u):v.format(u)},e.getLocaleChain=Q,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&p(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(B[e],...n)},e.handleMissing=Z,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}=e,{__numberFormatters:c}=e,[a,u,l,p]=le(...t),m=(f(l.missingWarn),f(l.fallbackWarn),!!l.part),d=i(l.locale)?l.locale:e.locale,k=Q(e,o,d);if(!i(a)||""===a)return new Intl.NumberFormat(d).format(u);let g,b={},y=null,x=null;for(let t=0;t<k.length&&(g=x=k[t],b=n[g]||{},y=b[a],!h(y));t++)Z(e,a,g,0,"number format");if(!h(y)||!i(g))return r?-1:a;let C=`${g}__${a}`;s(p)||(C=`${C}__${JSON.stringify(p)}`);let v=c.get(C);return v||(v=new Intl.NumberFormat(g,Object.assign({},y,p)),c.set(C,v)),m?v.formatToParts(u):v.format(u)},e.parse=x,e.parseDateTimeArgs=ue,e.parseNumberArgs=le,e.parseTranslateArgs=ae,e.registerMessageCompiler=function(e){Y=e},e.resolveValue=v,e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,fallbackLocale:c}=e,[m,d]=ae(...t),h=(f(d.missingWarn),f(d.fallbackWarn),f(d.escapeParameter)?d.escapeParameter:e.escapeParameter),k=i(d.default)||f(d.default)?f(d.default)?m:d.default:n?m:"",g=n||""!==k,b=i(d.locale)?d.locale:e.locale;h&&function(e){u(e.list)?e.list=e.list.map((e=>i(e)?a(e):e)):p(e.named)&&Object.keys(e.named).forEach((t=>{i(e.named[t])&&(e.named[t]=a(e.named[t]))}))}(d);let[y,x,C]=function(e,t,n,r,o,s){const{messages:c}=e,a=Q(e,r,n);let u,f={},p=null,m=null;const d="translate";for(let n=0;n<a.length&&(u=m=a[n],f=c[u]||{},null===(p=v(f,t))&&(p=f[t]),!i(p)&&!l(p));n++){const n=Z(e,t,u,0,d);n!==t&&(p=n)}return[p,u,f]}(e,m,b,c),T=m;if(i(y)||se(y)||g&&(y=k,T=y),!i(y)&&!se(y)||!i(x))return s?-1:m;let L=!1;const _=ce(e,m,x,y,T,(()=>{L=!0}));if(L)return y;const w=function(e,t,n){return t(n)}(0,_,F(function(e,t,n,o){const{modifiers:s,pluralRules:c}=e,a={locale:t,modifiers:s,pluralRules:c,messages:r=>{const o=v(n,r);if(i(o)){let n=!1;const s=ce(e,r,t,o,r,(()=>{n=!0}));return n?oe:s}return se(o)?o:oe}};e.processor&&(a.processor=e.processor);o.list&&(a.list=o.list);o.named&&(a.named=o.named);r(o.plural)&&(a.pluralIndex=o.plural);return a}(e,x,C,d)));return o?o(w):w},e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,Q(e,n,t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var IntlifyCoreBase=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),r=e=>"number"==typeof e&&isFinite(e),o=e=>"[object RegExp]"===d(e),s=e=>h(e)&&0===Object.keys(e).length;function c(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function a(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const u=Array.isArray,l=e=>"function"==typeof e,i=e=>"string"==typeof e,f=e=>"boolean"==typeof e,p=e=>null!==e&&"object"==typeof e,m=Object.prototype.toString,d=e=>m.call(e),h=e=>"[object Object]"===d(e),k=[];k[0]={w:[0],i:[3,0],"[":[4],o:[7]},k[1]={w:[1],".":[2],"[":[4],o:[7]},k[2]={w:[2],i:[3,0],0:[3,0]},k[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},k[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},k[5]={"'":[4,0],o:8,l:[5,0]},k[6]={'"':[4,0],o:8,l:[6,0]};const g=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function b(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 y(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(g.test(t)?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)}function x(e){const t=[];let n,r,o,s,c,a,u,l=-1,i=0,f=0;const p=[];function m(){const t=e[l+1];if(5===i&&"'"===t||6===i&&'"'===t)return l++,o="\\"+t,p[0](),!0}for(p[0]=()=>{void 0===r?r=o:r+=o},p[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),f++},p[3]=()=>{if(f>0)f--,i=4,p[0]();else{if(f=0,void 0===r)return!1;if(r=y(r),!1===r)return!1;p[1]()}};null!==i;)if(l++,n=e[l],"\\"!==n||!m()){if(s=b(n),u=k[i],c=u[s]||u.l||8,8===c)return;if(i=c[0],void 0!==c[1]&&(a=p[c[1]],a&&(o=n,!1===a())))return;if(7===i)return t}}const C=new Map;function v(e,t){if(!p(e))return null;let n=C.get(t);if(n||(n=x(t),n&&C.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;o=e,s++}return o}const T=e=>e,L=e=>"",_="text",w=e=>0===e.length?"":e.join(""),P=e=>null==e?"":u(e)||h(e)&&e.toString===m?JSON.stringify(e,null,2):String(e);function O(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function F(e={}){const t=e.locale,n=function(e){const t=r(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(r(e.named.count)||r(e.named.n))?r(e.named.count)?e.named.count:r(e.named.n)?e.named.n:t:t}(e),o=p(e.pluralRules)&&i(t)&&l(e.pluralRules[t])?e.pluralRules[t]:O,s=p(e.pluralRules)&&i(t)&&l(e.pluralRules[t])?O:void 0,c=e.list||[],a=e.named||{};r(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,a);function u(t){const n=l(e.messages)?e.messages(t):!!p(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):L)}const f=h(e.processor)&&l(e.processor.normalize)?e.processor.normalize:w,m=h(e.processor)&&l(e.processor.interpolate)?e.processor.interpolate:P,d={list:e=>c[e],named:e=>a[e],plural:e=>e[o(n,e.length,s)],linked:(t,n)=>{const r=u(t)(d);return i(n)?(o=n,e.modifiers?e.modifiers[o]:T)(r):r;var o},message:u,type:h(e.processor)&&i(e.processor.type)?e.processor.type:_,interpolate:m,normalize:f};return d}function N(e,t,n={}){const{domain:r}=n,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=r,o}function S(e){throw e}function $(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const E=" ",I="\n",A=String.fromCharCode(8232),M=String.fromCharCode(8233);function W(e){const t=e;let n=0,r=1,o=1,s=0;const c=e=>"\r"===t[e]&&t[e+1]===I,a=e=>t[e]===M,u=e=>t[e]===A,l=e=>c(e)||(e=>t[e]===I)(e)||a(e)||u(e),i=e=>c(e)||a(e)||u(e)?I:t[e];function f(){return s=0,l(n)&&(r++,o=0),c(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>s,charAt:i,currentChar:()=>i(n),currentPeek:()=>i(n+s),next:f,peek:function(){return c(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 j=void 0;function R(e,t={}){const n=!1!==t.location,r=W(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},c=s(),a=o(),u={currentType:14,offset:a,startLoc:c,endLoc:c,lastType:14,lastOffset:a,lastStartLoc:c,lastEndLoc:c,braceNest:0,inLinked:!1,text:""},l=()=>u,{onError:i}=t;function f(e,t,r){e.endLoc=s(),e.currentType=t;const o={type:t};return n&&(o.loc=$(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const p=e=>f(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(s(),"")}function d(e){let t="";for(;e.currentPeek()===E||e.currentPeek()===I;)t+=e.currentPeek(),e.peek();return t}function h(e){const t=d(e);return e.skipToPeek(),t}function k(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90}function g(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===j)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function b(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function y(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===E||r===I):s===E?(e.peek(),n(!0,E,o)):s!==I||(e.peek(),n(!0,I,o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function x(e,t){const n=e.currentChar();return n===j?j:t(n)?(e.next(),n):null}function C(e){return x(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 v(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function T(e){return x(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function L(e){let t="",n="";for(;t=v(e);)n+=t;return n}function _(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return w(e,t,4);case"U":return w(e,t,6);default:return s(),""}}function w(e,t,n){m(e,t);let r="";for(let t=0;t<n;t++){const t=T(e);if(!t){s(),e.currentChar();break}r+=t}return`\\${t}${r}`}function P(e){h(e);const t=m(e,"|");return h(e),t}function O(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&s(),e.next(),n=f(t,2,"{"),h(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&s(),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&h(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&s(),n=F(e,t)||p(t),t.braceNest=0,n;default:let r=!0,o=!0,c=!0;if(b(e))return t.braceNest>0&&s(),n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return s(),t.braceNest=0,N(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){h(e);let t="",n="";for(;t=C(e);)n+=t;return e.currentChar()===j&&s(),n}(e)),h(e),n;if(o=g(e,t))return n=f(t,6,function(e){h(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${L(e)}`):t+=L(e),e.currentChar()===j&&s(),t}(e)),h(e),n;if(c=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=f(t,7,function(e){h(e),m(e,"'");let t="",n="";const r=e=>"'"!==e&&e!==I;for(;t=x(e,r);)n+="\\"===t?_(e):t;const o=e.currentChar();return o===I||o===j?(s(),o===I&&(e.next(),m(e,"'")),n):(m(e,"'"),n)}(e)),h(e),n;if(!r&&!o&&!c)return n=f(t,13,function(e){h(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&e!==E&&e!==I;for(;t=x(e,r);)n+=t;return n}(e)),s(),h(e),n}return n}function F(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==I&&o!==E||s(),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return h(e),e.next(),f(t,9,".");case":":return h(e),e.next(),f(t,10,":");default:return b(e)?(r=f(t,1,P(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)?(h(e),F(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t)?(h(e),f(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?k(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===E||!t)&&(t===I?(e.peek(),r()):k(t))},o=r();return e.resetPeek(),o}(e,t)?(h(e),"{"===o?O(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?o===E?r:o===I?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&s(),t.braceNest=0,t.inLinked=!1,N(e,t))}}function N(e,t){let n={type:14};if(t.braceNest>0)return O(e,t)||p(t);if(t.inLinked)return F(e,t)||p(t);const r=e.currentChar();switch(r){case"{":return O(e,t)||p(t);case"}":return s(),e.next(),f(t,3,"}");case"@":return F(e,t)||p(t);default:if(b(e))return n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(y(e))return f(t,0,function(e){const t=n=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?y(e)?(n+=r,e.next(),t(n)):n:"|"===r?n:r===E||r===I?y(e)?(n+=r,e.next(),t(n)):b(e)?n:(n+=r,e.next(),t(n)):(n+=r,e.next(),t(n)):n};return t("")}(e));if("%"===r)return e.next(),f(t,4,"%")}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:c}=u;return u.lastType=e,u.lastOffset=t,u.lastStartLoc=n,u.lastEndLoc=c,u.offset=o(),u.startLoc=s(),r.currentChar()===j?f(u,14):N(r,u)},currentOffset:o,currentPosition:s,context:l}}const D=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function J(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 z(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function o(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(),s=r(3,n.offset,n.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function c(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:c}=n,a=r(5,s,c);return a.index=parseInt(t,10),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function a(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:c}=n,a=r(4,s,c);return a.key=t,e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function u(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:c}=n,a=r(9,s,c);return a.value=t.replace(D,J),e.nextToken(),o(a,e.currentOffset(),e.currentPosition()),a}function l(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:c}=n,a=r(8,s,c);return 12!==t.type?(a.value="",o(a,s,c),{nextConsumeToken:t,node:a}):(null==t.value&&U(t),a.value=t.value||"",o(a,e.currentOffset(),e.currentPosition()),{node:a})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&U(s),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&U(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&&U(s),n.key=a(e,s.value||"");break;case 6:null==s.value&&U(s),n.key=c(e,s.value||"");break;case 7:null==s.value&&U(s),n.key=u(e,s.value||"");break;default:const t=e.context(),l=r(7,t.offset,t.startLoc);return l.value="",o(l,t.offset,t.startLoc),n.key=l,o(n,t.offset,t.startLoc),{nextConsumeToken:s,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function i(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 i=null;do{const t=i||e.nextToken();switch(i=null,t.type){case 0:null==t.value&&U(t),n.items.push(s(e,t.value||""));break;case 6:null==t.value&&U(t),n.items.push(c(e,t.value||""));break;case 5:null==t.value&&U(t),n.items.push(a(e,t.value||""));break;case 7:null==t.value&&U(t),n.items.push(u(e,t.value||""));break;case 8:const r=l(e);n.items.push(r.node),i=r.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 f(e){const t=e.context(),{offset:n,startLoc:s}=t,c=i(e);return 14===t.currentType?c:function(e,t,n,s){const c=e.context();let a=0===s.items.length;const u=r(1,t,n);u.cases=[],u.cases.push(s);do{const t=i(e);a||(a=0===t.items.length),u.cases.push(t)}while(14!==c.currentType);return o(u,e.currentOffset(),e.currentPosition()),u}(e,n,s,c)}return{parse:function(n){const s=R(n,{...e}),c=s.context(),a=r(0,c.offset,c.startLoc);return t&&a.loc&&(a.loc.source=n),a.body=f(s),o(a,s.currentOffset(),s.currentPosition()),a}}}function U(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 V(e,t){for(let n=0;n<e.length;n++)H(e[n],t)}function H(e,t){switch(e.type){case 1:V(e.cases,t),t.helper("plural");break;case 2:V(e.items,t);break;case 6:H(e.key,t),t.helper("linked");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&&H(e.body,n);const r=n.context();e.helpers=[...r.helpers]}function K(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?K(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&&(K(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&&(K(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")}(`),K(e,t.key),t.modifier&&(e.push(", "),K(e,t.modifier)),e.push(")")}(e,t);break;case 8:case 7: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;case 9:case 3:e.push(JSON.stringify(t.value),t)}}function q(e,t={}){const n=z({...t}).parse(e);return G(n,{...t}),((e,t={})=>{const n=i(t.mode)?t.mode:"normal",r=i(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==n,s=e.helpers||[],c=function(e,t){const{filename:n,breakLineCode:r,needIndent:o}=t,s={source:e.loc.source,filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};function c(e,t){s.code+=e}function a(e,t=!0){const n=t?r:"";c(o?n+" ".repeat(e):n)}return{context:()=>s,push:c,indent:function(e=!0){const t=++s.indentLevel;e&&a(t)},deindent:function(e=!0){const t=--s.indentLevel;e&&a(t)},newline:function(){a(s.indentLevel)},helper:e=>`_${e}`,needIndent:()=>s.needIndent}}(e,{mode:n,filename:r,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",needIndent:o});c.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(o),s.length>0&&(c.push(`const { ${s.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),c.newline()),c.push("return "),K(c,e),c.deindent(o),c.push("}");const{code:a,map:u}=c.context();return{ast:e,code:a,map:u?u.toJSON():void 0}})(n,{...t})}const B={0:"Not found '{key}' key in '{locale}' locale messages.",1:"Fall back to translate '{key}' key with '{target}' locale.",2:"Cannot format a number value due to not supported Intl.NumberFormat.",3:"Fall back to number format '{key}' key with '{target}' locale.",4:"Cannot format a date value due to not supported Intl.DateTimeFormat.",5:"Fall back to datetime format '{key}' key with '{target}' locale."};let Y;function Z(e,t,n,r,o){const{missing:s}=e;if(null!==s){const r=s(e,n,t,o);return i(r)?r:t}return t}function Q(e,t,n){const r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(n);if(!o){o=[];let e=[n];for(;u(e);)e=X(o,e,t);const s=u(t)?t:h(t)?t.default?t.default:null:t;e=i(s)?[s]:s,u(e)&&X(o,e,!1),r.__localeChainCache.set(n,o)}return o}function X(e,t,n){let r=!0;for(let o=0;o<t.length&&f(r);o++){i(t[o])&&(r=ee(e,t[o],n))}return r}function ee(e,t,n){let r;const o=t.split("-");do{r=te(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function te(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)||h(n))&&n[o]&&(r=n[o])}return r}const ne=e=>e;let re=Object.create(null);const oe=()=>"",se=e=>l(e);function ce(e,t,r,o,s,c){const{messageCompiler:a,warnHtmlMessage:u}=e;if(se(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}const l=a(o,function(e,t,r,o,s,c){return{warnHtmlMessage:s,onError:e=>{throw c&&c(e),e},onCacheKey:e=>((e,t,r)=>n({l:e,k:t,s:r}))(t,r,e)}}(0,r,s,0,u,c));return l.locale=r,l.key=t,l.source=o,l}function ae(...e){const[t,n,o]=e,c={};if(!i(t)&&!r(t))throw Error(14);const a=r(t)?String(t):t;return r(n)?c.plural=n:i(n)?c.default=n:h(n)&&!s(n)?c.named=n:u(n)&&(c.list=n),r(o)?c.plural=o:i(o)?c.default=o:h(o)&&Object.assign(c,o),[a,c]}function ue(...e){const[t,n,o,s]=e;let c,a={},u={};if(i(t)){if(!/\d{4}-\d{2}-\d{2}(T.*)?/.test(t))throw Error(16);c=new Date(t);try{c.toISOString()}catch(e){throw Error(16)}}else if("[object Date]"===d(t)){if(isNaN(t.getTime()))throw Error(15);c=t}else{if(!r(t))throw Error(14);c=t}return i(n)?a.key=n:h(n)&&(a=n),i(o)?a.locale=o:h(o)&&(u=o),h(s)&&(u=s),[a.key||"",c,a,u]}function le(...e){const[t,n,o,s]=e;let c={},a={};if(!r(t))throw Error(14);const u=t;return i(n)?c.key=n:h(n)&&(c=n),i(o)?c.locale=o:h(o)&&(a=o),h(s)&&(a=s),[c.key||"",u,c,a]}const ie={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},fe={"vue-i18n-resource-inspector":"Search for scopes ..."},pe={"vue-i18n-timeline":16764185};return e.DEFAULT_MESSAGE_DATA_TYPE=_,e.DevToolsLabels=ie,e.DevToolsPlaceholders=fe,e.DevToolsTimelineColors=pe,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.clearCompileCache=function(){re=Object.create(null)},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}},e.compileToFunction=function(e,t={}){{const n=(t.onCacheKey||ne)(e),r=re[n];if(r)return r;let o=!1;const s=t.onError||S;t.onError=e=>{o=!0,s(e)};const{code:c}=q(e,t),a=new Function(`return ${c}`)();return o?a:re[n]=a}},e.createCompileError=N,e.createCoreContext=function(e={}){const t=i(e.locale)?e.locale:"en-US",n=e;return{locale:t,fallbackLocale:u(e.fallbackLocale)||h(e.fallbackLocale)||i(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,messages:h(e.messages)?e.messages:{[t]:{}},datetimeFormats:h(e.datetimeFormats)?e.datetimeFormats:{[t]:{}},numberFormats:h(e.numberFormats)?e.numberFormats:{[t]:{}},modifiers:Object.assign({},e.modifiers||{},{upper:e=>i(e)?e.toUpperCase():e,lower:e=>i(e)?e.toLowerCase():e,capitalize:e=>i(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}),pluralRules:e.pluralRules||{},missing:l(e.missing)?e.missing:null,missingWarn:!f(e.missingWarn)&&!o(e.missingWarn)||e.missingWarn,fallbackWarn:!f(e.fallbackWarn)&&!o(e.fallbackWarn)||e.fallbackWarn,fallbackFormat:!!e.fallbackFormat,unresolving:!!e.unresolving,postTranslation:l(e.postTranslation)?e.postTranslation:null,processor:h(e.processor)?e.processor:null,warnHtmlMessage:!f(e.warnHtmlMessage)||e.warnHtmlMessage,escapeParameter:!!e.escapeParameter,messageCompiler:l(e.messageCompiler)?e.messageCompiler:Y,onWarn:l(e.onWarn)?e.onWarn:c,__datetimeFormatters:p(n.__datetimeFormatters)?n.__datetimeFormatters:new Map,__numberFormatters:p(n.__numberFormatters)?n.__numberFormatters:new Map}},e.createCoreError=function(e){return N(e,null,void 0)},e.createEmitter=function(){const e=new Map;return{events:e,on(t,n){const r=e.get(t);r&&r.push(n)||e.set(t,[n])},off(t,n){const r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map((e=>e(n))),(e.get("*")||[]).slice().map((e=>e(t,n)))}}},e.createMessageContext=F,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o}=e,{__datetimeFormatters:c}=e,[a,u,l,p]=ue(...t),m=(f(l.missingWarn),f(l.fallbackWarn),!!l.part),d=i(l.locale)?l.locale:e.locale,k=Q(e,o,d);if(!i(a)||""===a)return new Intl.DateTimeFormat(d).format(u);let g,b={},y=null;for(let t=0;t<k.length&&(g=k[t],b=n[g]||{},y=b[a],!h(y));t++)Z(e,a,g,0,"datetime format");if(!h(y)||!i(g))return r?-1:a;let x=`${g}__${a}`;s(p)||(x=`${x}__${JSON.stringify(p)}`);let C=c.get(x);return C||(C=new Intl.DateTimeFormat(g,Object.assign({},y,p)),c.set(x,C)),m?C.formatToParts(u):C.format(u)},e.getLocaleChain=Q,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&p(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(B[e],...n)},e.handleMissing=Z,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}=e,{__numberFormatters:c}=e,[a,u,l,p]=le(...t),m=(f(l.missingWarn),f(l.fallbackWarn),!!l.part),d=i(l.locale)?l.locale:e.locale,k=Q(e,o,d);if(!i(a)||""===a)return new Intl.NumberFormat(d).format(u);let g,b={},y=null;for(let t=0;t<k.length&&(g=k[t],b=n[g]||{},y=b[a],!h(y));t++)Z(e,a,g,0,"number format");if(!h(y)||!i(g))return r?-1:a;let x=`${g}__${a}`;s(p)||(x=`${x}__${JSON.stringify(p)}`);let C=c.get(x);return C||(C=new Intl.NumberFormat(g,Object.assign({},y,p)),c.set(x,C)),m?C.formatToParts(u):C.format(u)},e.parse=x,e.parseDateTimeArgs=ue,e.parseNumberArgs=le,e.parseTranslateArgs=ae,e.registerMessageCompiler=function(e){Y=e},e.resolveValue=v,e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,fallbackLocale:c}=e,[m,d]=ae(...t),h=(f(d.missingWarn),f(d.fallbackWarn),f(d.escapeParameter)?d.escapeParameter:e.escapeParameter),k=i(d.default)||f(d.default)?f(d.default)?m:d.default:n?m:"",g=n||""!==k,b=i(d.locale)?d.locale:e.locale;h&&function(e){u(e.list)?e.list=e.list.map((e=>i(e)?a(e):e)):p(e.named)&&Object.keys(e.named).forEach((t=>{i(e.named[t])&&(e.named[t]=a(e.named[t]))}))}(d);let[y,x,C]=function(e,t,n,r,o,s){const{messages:c}=e,a=Q(e,r,n);let u,f={},p=null;const m="translate";for(let n=0;n<a.length&&(u=a[n],f=c[u]||{},null===(p=v(f,t))&&(p=f[t]),!i(p)&&!l(p));n++){const n=Z(e,t,u,0,m);n!==t&&(p=n)}return[p,u,f]}(e,m,b,c),T=m;if(i(y)||se(y)||g&&(y=k,T=y),!i(y)&&!se(y)||!i(x))return s?-1:m;let L=!1;const _=ce(e,m,x,y,T,(()=>{L=!0}));if(L)return y;const w=function(e,t,n){return t(n)}(0,_,F(function(e,t,n,o){const{modifiers:s,pluralRules:c}=e,a={locale:t,modifiers:s,pluralRules:c,messages:r=>{const o=v(n,r);if(i(o)){let n=!1;const s=ce(e,r,t,o,r,(()=>{n=!0}));return n?oe:s}return se(o)?o:oe}};e.processor&&(a.processor=e.processor);o.list&&(a.list=o.list);o.named&&(a.named=o.named);r(o.plural)&&(a.pluralIndex=o.plural);return a}(e,x,C,d)));return o?o(w):w},e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,Q(e,n,t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
{ | ||
"name": "@intlify/core-base", | ||
"version": "9.0.0-rc.5", | ||
"version": "9.0.0-rc.6", | ||
"description": "@intlify/core-base", | ||
@@ -36,6 +36,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@intlify/message-compiler": "9.0.0-rc.5", | ||
"@intlify/message-resolver": "9.0.0-rc.5", | ||
"@intlify/runtime": "9.0.0-rc.5", | ||
"@intlify/shared": "9.0.0-rc.5" | ||
"@intlify/message-compiler": "9.0.0-rc.6", | ||
"@intlify/message-resolver": "9.0.0-rc.6", | ||
"@intlify/runtime": "9.0.0-rc.6", | ||
"@intlify/shared": "9.0.0-rc.6" | ||
}, | ||
@@ -42,0 +42,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
372649
8711
+ Added@intlify/message-compiler@9.0.0-rc.6(transitive)
+ Added@intlify/message-resolver@9.0.0-rc.6(transitive)
+ Added@intlify/runtime@9.0.0-rc.6(transitive)
+ Added@intlify/shared@9.0.0-rc.6(transitive)
- Removed@intlify/message-compiler@9.0.0-rc.5(transitive)
- Removed@intlify/message-resolver@9.0.0-rc.5(transitive)
- Removed@intlify/runtime@9.0.0-rc.5(transitive)
- Removed@intlify/shared@9.0.0-rc.5(transitive)
Updated@intlify/runtime@9.0.0-rc.6
Updated@intlify/shared@9.0.0-rc.6