UNPKG

@intlify/vue-i18n-core

Version:
7 lines (6 loc) 33.4 kB
/*! * vue-i18n-core v11.4.6 * (c) 2026 kazuya kawaguchi * Released under the MIT License. */ var IntlifyVueI18nCore=function(e,t){"use strict";function n(e){var t=Object.create(null);if(e)for(var n in e)t[n]=e[n];return t.default=e,Object.freeze(t)}var a=n(t);function r(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const l="undefined"!=typeof window,o=(e,t=!1)=>t?Symbol.for(e):Symbol(e),s=(e,t,n)=>i({l:e,k:t,s:n}),i=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),c=e=>"number"==typeof e&&isFinite(e),u=e=>"[object Date]"===W(e),m=e=>"[object RegExp]"===W(e),f=e=>w(e)&&0===Object.keys(e).length,_=Object.assign,p=Object.create,g=(e=null)=>p(e);function d(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}const b=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,h=/^(?:href|src|action|formaction)$/i;function v(e){return b.test(e)}function k(e,t){if(h.test(e)&&v(t))return"about:blank";const n="style"===e.toLowerCase()?function(e){const t=/url\s*\(/gi;let n,a="",r=0;for(;null!==(n=t.exec(e));){const l=n.index,o=t.lastIndex-1;let s=o+1,i=1,c=null;for(;s<e.length;s++){const t=e[s];if(c)t===c&&(c=null);else if('"'===t||"'"===t)c=t;else if("("===t)i++;else if(")"===t&&(i--,0===i))break}if(0!==i)break;const u=e.slice(o+1,s).trim(),m=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;a+=e.slice(r,l),a+=v(m)?"url(about:blank)":e.slice(l,s+1),r=s+1}return a+e.slice(r)}(t):t;return function(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(n)}const E=Object.prototype.hasOwnProperty;function y(e,t){return E.call(e,t)}const F=Array.isArray,T=e=>"function"==typeof e,L=e=>"string"==typeof e,I=e=>"boolean"==typeof e,R=e=>null!==e&&"object"==typeof e,O=e=>R(e)&&T(e.then)&&T(e.catch),N=Object.prototype.toString,W=e=>N.call(e),w=e=>"[object Object]"===W(e);const M=e=>!R(e)||F(e);function P(e,t){if(M(e)||M(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:e,des:t}=n.pop();Object.keys(e).forEach((a=>{"__proto__"!==a&&(R(e[a])&&!R(t[a])&&(t[a]=Array.isArray(e[a])?[]:g()),M(t[a])||M(e[a])?t[a]=e[a]:n.push({src:e[a],des:t[a]}))}))}}function C(e){return R(e)&&0===function(e,t,n){for(let a=0;a<t.length;a++){const n=t[a];if(y(e,n)&&null!=e[n])return e[n]}return n}(e,D)&&(y(e,"b")||y(e,"body"))}const D=["t","type"];const $=["b","body","c","cases","s","static","i","items","k","key","m","modifier","v","value",...D],S={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function A(e,t){return null!=t.locale?U(t.locale):U(e.locale)}let x;function U(e){if(L(e))return e;if(T(e)){if(e.resolvedOnce&&null!=x)return x;if("Function"===e.constructor.name){const t=e();if(O(t))throw Error(S.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return x=t}throw Error(S.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(S.NOT_SUPPORT_LOCALE_TYPE)}function j(e,t,n){return[...new Set([n,...F(t)?t:R(t)?Object.keys(t):L(t)?[t]:[n]])]}function H(e,t,n){const a=L(n)?n:B,r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let l=r.__localeChainCache.get(a);if(!l){l=[];let e=[n];for(;F(e);)e=V(l,e,t);const o=F(t)||!w(t)?t:t.default?t.default:null;e=L(o)?[o]:o,F(e)&&V(l,e,!1),r.__localeChainCache.set(a,l)}return l}function V(e,t,n){let a=!0;for(let r=0;r<t.length&&I(a);r++){const l=t[r];L(l)&&(a=G(e,t[r],n))}return a}function G(e,t,n){let a;const r=t.split("-");do{a=Y(e,r.join("-"),n),r.splice(-1,1)}while(r.length&&!0===a);return a}function Y(e,t,n){let a=!1;if(!e.includes(t)&&(a=!0,t)){a="!"!==t[t.length-1];const r=t.replace(/!/g,"");e.push(r),(F(n)||w(n))&&n[r]&&(a=n[r])}return a}function z(e,t){return R(e)?e[t]:null}const X="11.4.6",J=-1,B="en-US",q="",Z=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let K;let Q=null;const ee=e=>{Q=e},te=()=>Q;let ne=0;function ae(e={}){const t=T(e.onWarn)?e.onWarn:r,n=L(e.version)?e.version:X,a=L(e.locale)||T(e.locale)?e.locale:B,l=T(a)?B:a,o=F(e.fallbackLocale)||w(e.fallbackLocale)||L(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:l,s=w(e.messages)?e.messages:re(l),i=w(e.datetimeFormats)?e.datetimeFormats:re(l),c=w(e.numberFormats)?e.numberFormats:re(l),u=_(g(),e.modifiers,{upper:(e,t)=>"text"===t&&L(e)?e.toUpperCase():"vnode"===t&&R(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&L(e)?e.toLowerCase():"vnode"===t&&R(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&L(e)?Z(e):"vnode"===t&&R(e)&&"__v_isVNode"in e?Z(e.children):e}),f=e.pluralRules||g(),p=T(e.missing)?e.missing:null,d=!I(e.missingWarn)&&!m(e.missingWarn)||e.missingWarn,b=!I(e.fallbackWarn)&&!m(e.fallbackWarn)||e.fallbackWarn,h=!!e.fallbackFormat,v=!!e.unresolving,k=T(e.postTranslation)?e.postTranslation:null,E=w(e.processor)?e.processor:null,y=!I(e.warnHtmlMessage)||e.warnHtmlMessage,O=!!e.escapeParameter,N=T(e.messageCompiler)?e.messageCompiler:K,W=T(e.messageResolver)?e.messageResolver:z,M=T(e.localeFallbacker)?e.localeFallbacker:j,P=R(e.fallbackContext)?e.fallbackContext:void 0,C=e,D=R(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,$=R(C.__numberFormatters)?C.__numberFormatters:new Map,S=R(C.__meta)?C.__meta:{};ne++;const A={version:n,cid:ne,locale:a,fallbackLocale:o,messages:s,modifiers:u,pluralRules:f,missing:p,missingWarn:d,fallbackWarn:b,fallbackFormat:h,unresolving:v,postTranslation:k,processor:E,warnHtmlMessage:y,escapeParameter:O,messageCompiler:N,messageResolver:W,localeFallbacker:M,fallbackContext:P,onWarn:t,__meta:S};return A.datetimeFormats=i,A.numberFormats=c,A.__datetimeFormatters=D,A.__numberFormatters=$,A}const re=e=>({[e]:g()});function le(e,t,n,a,r){const{missing:l,onWarn:o}=e;if(null!==l){const a=l(e,n,t,r);return L(a)?a:t}return t}function oe(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function se(e,t){const n=t.indexOf(e);if(-1===n)return!1;for(let l=n+1;l<t.length;l++)if(a=e,r=t[l],a!==r&&a.split("-")[0]===r.split("-")[0])return!0;var a,r;return!1}function ie(e,...t){const{datetimeFormats:n,unresolving:a,fallbackLocale:r,onWarn:l,localeFallbacker:o}=e,{__datetimeFormatters:s}=e;if(!L(t[0])&&!u(t[0])&&!c(t[0]))return q;const[i,m,p,g]=ue(...t);I(p.missingWarn)?p.missingWarn:e.missingWarn;I(p.fallbackWarn)?p.fallbackWarn:e.fallbackWarn;const d=!!p.part,b=A(e,p),h=o(e,r,b);if(!L(i)||""===i){const e=new Intl.DateTimeFormat(b.replace(/!/g,""),g);return d?e.formatToParts(m):e.format(m)}let v,k={},E=null;for(let c=0;c<h.length&&(v=h[c],k=n[v]||{},E=k[i],!w(E));c++)le(e,i,v,0,"datetime format");if(!w(E)||!L(v))return a?J:i;let y=`${v}__${i}`;f(g)||(y=`${y}__${JSON.stringify(g)}`);let F=s.get(y);return F||(F=new Intl.DateTimeFormat(v,_({},E,g)),s.set(y,F)),d?F.formatToParts(m):F.format(m)}const ce=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function ue(...e){const[t,n,a,r]=e,l=g();let o,s=g();if(L(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(S.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();o=new Date(n);try{o.toISOString()}catch{throw Error(S.INVALID_ISO_DATE_ARGUMENT)}}else if(u(t)){if(isNaN(t.getTime()))throw Error(S.INVALID_DATE_ARGUMENT);o=t}else{if(!c(t))throw Error(S.INVALID_ARGUMENT);o=t}return L(n)?l.key=n:w(n)&&Object.keys(n).forEach((e=>{ce.includes(e)?s[e]=n[e]:l[e]=n[e]})),L(a)?l.locale=a:w(a)&&(s=a),w(r)&&(s=r),[l.key||"",o,l,s]}function me(e,t,n){const a=e;for(const r in n){const e=`${t}__${r}`;a.__datetimeFormatters.has(e)&&a.__datetimeFormatters.delete(e)}}function fe(e,...t){const{numberFormats:n,unresolving:a,fallbackLocale:r,onWarn:l,localeFallbacker:o}=e,{__numberFormatters:s}=e;if(!c(t[0]))return q;const[i,u,m,p]=pe(...t);I(m.missingWarn)?m.missingWarn:e.missingWarn;I(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const g=!!m.part,d=A(e,m),b=o(e,r,d);if(!L(i)||""===i){const e=new Intl.NumberFormat(d.replace(/!/g,""),p);return g?e.formatToParts(u):e.format(u)}let h,v={},k=null;for(let c=0;c<b.length&&(h=b[c],v=n[h]||{},k=v[i],!w(k));c++)le(e,i,h,0,"number format");if(!w(k)||!L(h))return a?J:i;let E=`${h}__${i}`;f(p)||(E=`${E}__${JSON.stringify(p)}`);let y=s.get(E);return y||(y=new Intl.NumberFormat(h,_({},k,p)),s.set(E,y)),g?y.formatToParts(u):y.format(u)}const _e=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function pe(...e){const[t,n,a,r]=e,l=g();let o=g();if(!c(t))throw Error(S.INVALID_ARGUMENT);const s=t;return L(n)?l.key=n:w(n)&&Object.keys(n).forEach((e=>{_e.includes(e)?o[e]=n[e]:l[e]=n[e]})),L(a)?l.locale=a:w(a)&&(o=a),w(r)&&(o=r),[l.key||"",s,l,o]}function ge(e,t,n){const a=e;for(const r in n){const e=`${t}__${r}`;a.__numberFormatters.has(e)&&a.__numberFormatters.delete(e)}}const de=e=>e,be=e=>"",he="text",ve=e=>0===e.length?"":function(e,t=""){return e.reduce(((e,n,a)=>0===a?e+n:e+t+n),"")}(e),ke=e=>null==e?"":F(e)||w(e)&&e.toString===N?JSON.stringify(e,null,2):String(e);function Ee(e,t){return e=Math.abs(e),2===t?1===e?0:1:Math.min(e,2)}function ye(e={}){const t=e.locale,n=function(e){const t=c(e.pluralIndex)?e.pluralIndex:-1;return c(e.named?.count)?e.named.count:c(e.named?.n)?e.named.n:t}(e),a=L(t)&&T(e.pluralRules?.[t])?e.pluralRules[t]:Ee,r=a===Ee?void 0:Ee,l=e.list||[],o=e.named||g();c(e.pluralIndex)&&(o.count||=e.pluralIndex,o.n||=e.pluralIndex);function s(t,n){const a=T(e.messages)?e.messages(t,!!n):!!R(e.messages)&&e.messages[t];return a||(e.parent?e.parent.message(t):be)}const i=T(e.processor?.normalize)?e.processor.normalize:ve,u=T(e.processor?.interpolate)?e.processor.interpolate:ke,m={list:e=>l[e],named:e=>o[e],plural:e=>e[a(n,e.length,r)],linked:(t,...n)=>{const[a,r]=n;let l="text",o="";1===n.length?R(a)?(o=a.modifier||o,l=a.type||l):L(a)&&(o=a||o):2===n.length&&(L(a)&&(o=a||o),L(r)&&(l=r||l));const i=s(t,!0)(m),c=""===i||void 0===i?t:i,u="vnode"===l&&F(c)&&o?c[0]:c;return o?(f=o,e.modifiers?e.modifiers[f]:de)(u,l):u;var f},message:s,type:L(e.processor?.type)?e.processor.type:he,interpolate:u,normalize:i,values:_(g(),l,o)};return m}const Fe=()=>"",Te=e=>T(e);function Le(e,...t){const{fallbackFormat:n,postTranslation:a,unresolving:r,messageCompiler:l,fallbackLocale:o,messages:s}=e,[i,u]=Oe(...t),m=I(u.missingWarn)?u.missingWarn:e.missingWarn,f=I(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,_=I(u.escapeParameter)?u.escapeParameter:e.escapeParameter,p=!!u.resolvedMessage,b=L(u.default)||I(u.default)?I(u.default)?l?i:()=>i:u.default:n?l?i:()=>i:null,h=n||null!=b&&(L(b)||T(b)),E=A(e,u);_&&function(e){F(e.list)?e.list=e.list.map((e=>L(e)?d(e):e)):R(e.named)&&Object.keys(e.named).forEach((t=>{L(e.named[t])&&(e.named[t]=d(e.named[t]))}))}(u);let[y,O,N]=p?[i,E,s[E]||g()]:Ie(e,i,E,o,f,m),W=y,w=i;if(p||L(W)||C(W)||Te(W)||h&&(W=b,w=W),!(p||(L(W)||C(W)||Te(W))&&L(O)))return r?J:i;let M=!1;const P=Te(W)?W:Re(e,i,O,W,w,(()=>{M=!0}));if(M)return W;const D=function(e,t,n,a){const{modifiers:r,pluralRules:l,messageResolver:o,fallbackLocale:s,fallbackWarn:i,missingWarn:u,fallbackContext:m}=e,f=(a,r)=>{let l=o(n,a);if(null==l&&(m||r)){const[n,,r]=Ie(m||e,a,t,s,i,u);l=n??o(r,a)}if(L(l)||C(l)){let n=!1;const r=Re(e,a,t,l,a,(()=>{n=!0}));return n?Fe:r}return Te(l)?l:Fe},_={locale:t,modifiers:r,pluralRules:l,messages:f};e.processor&&(_.processor=e.processor);a.list&&(_.list=a.list);a.named&&(_.named=a.named);c(a.plural)&&(_.pluralIndex=a.plural);return _}(e,O,N,u),$=function(e,t,n){const a=t(n);return a}(0,P,ye(D));let S=a?a($,i):$;var x;return _&&L(S)&&(x=(x=(x=S).replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,((e,t,n)=>`${t}="${k(t,n)}"`))).replace(/([\w:-]+)\s*=\s*'([^']*)'/g,((e,t,n)=>`${t}='${k(t,n)}'`)),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(x)&&(x=x.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),S=x=x.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,((e,t,n)=>v(n)?`${t}about:blank`:e))),S}function Ie(e,t,n,a,r,l){const{messages:o,onWarn:s,messageResolver:i,localeFallbacker:c}=e,u=c(e,a,n);let m,f=g(),_=null;for(let p=0;p<u.length&&(m=u[p],f=o[m]||g(),null===(_=i(f,t))&&(_=f[t]),!(L(_)||C(_)||Te(_)));p++)if(!se(m,u)){const n=le(e,t,m,0,"translate");n!==t&&(_=n)}return[_,m,f]}function Re(e,t,n,a,r,l){const{messageCompiler:o,warnHtmlMessage:i}=e;if(Te(a)){const e=a;return e.locale=e.locale||n,e.key=e.key||t,e}if(null==o){const e=()=>a;return e.locale=n,e.key=t,e}const c=o(a,function(e,t,n,a,r,l){return{locale:t,key:n,warnHtmlMessage:r,onError:e=>{throw l&&l(e),e},onCacheKey:e=>s(t,n,e)}}(0,n,r,0,i,l));return c.locale=n,c.key=t,c.source=a,c}function Oe(...e){const[t,n,a]=e,r=g();if(!(L(t)||c(t)||Te(t)||C(t)))throw Error(S.INVALID_ARGUMENT);const l=c(t)?String(t):(Te(t),t);return c(n)?r.plural=n:L(n)?r.default=n:w(n)&&!f(n)?r.named=n:F(n)&&(r.list=n),c(a)?r.plural=a:L(a)?r.default=a:w(a)&&_(r,a),[l,r]}const Ne="11.4.6",We={UNEXPECTED_RETURN_TYPE:24,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34},we=o("__translateVNode"),Me=o("__datetimeParts"),Pe=o("__numberParts"),Ce=o("__setPluralRules"),De=o("__injectWithOption"),$e=o("__dispose");function Se(e){if(!R(e))return e;if(C(e))return e;for(const t in e)if(y(e,t))if(t.includes(".")){const n=t.split("."),a=n.length-1;let r=e,l=!1;for(let e=0;e<a;e++){if("__proto__"===n[e])throw new Error(`unsafe key: ${n[e]}`);if(n[e]in r||(r[n[e]]=g()),!R(r[n[e]])){l=!0;break}r=r[n[e]]}if(l||(C(r)?$.includes(n[a])||delete e[t]:(r[n[a]]=e[t],delete e[t])),!C(r)){const e=r[n[a]];R(e)&&Se(e)}}else R(e[t])&&Se(e[t]);return e}function Ae(e,t){const{messages:n,__i18n:a,messageResolver:r,flatJson:l}=t,o=w(n)?n:F(a)?g():{[e]:g()};if(F(a)&&a.forEach((e=>{if("locale"in e&&"resource"in e){const{locale:t,resource:n}=e;t?(o[t]=o[t]||g(),P(n,o[t])):P(n,o)}else L(e)&&P(JSON.parse(e),o)})),null==r&&l)for(const s in o)y(o,s)&&Se(o[s]);return o}function xe(e){return e.type}function Ue(e,t,n){let a=R(t.messages)?t.messages:g();"__i18nGlobal"in n&&(a=Ae(e.locale.value,{messages:a,__i18n:n.__i18nGlobal}));const r=Object.keys(a);if(r.length&&r.forEach((t=>{e.mergeLocaleMessage(t,a[t])})),R(t.datetimeFormats)){const n=Object.keys(t.datetimeFormats);n.length&&n.forEach((n=>{e.mergeDateTimeFormat(n,t.datetimeFormats[n])}))}if(R(t.numberFormats)){const n=Object.keys(t.numberFormats);n.length&&n.forEach((n=>{e.mergeNumberFormat(n,t.numberFormats[n])}))}}function je(e){return t.createVNode(t.Text,null,e,0)}function He(){const e="currentInstance";return e in a?a[e]:a.getCurrentInstance()}const Ve=()=>[],Ge=()=>!1;let Ye=0;function ze(e){return(t,n,a,r)=>e(n,a,He()||void 0,r)}function Xe(e={}){const{__root:n,__injectWithOption:a}=e,r=void 0===n,o=e.flatJson,s=l?t.ref:t.shallowRef;let i=!I(e.inheritLocale)||e.inheritLocale;const u=s(n&&i?n.locale.value:L(e.locale)?e.locale:B),f=s(n&&i?n.fallbackLocale.value:L(e.fallbackLocale)||F(e.fallbackLocale)||w(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:u.value),p=s(Ae(u.value,e)),g=s(w(e.datetimeFormats)?e.datetimeFormats:{[u.value]:{}}),d=s(w(e.numberFormats)?e.numberFormats:{[u.value]:{}});let b=n?n.missingWarn:!I(e.missingWarn)&&!m(e.missingWarn)||e.missingWarn,h=n?n.fallbackWarn:!I(e.fallbackWarn)&&!m(e.fallbackWarn)||e.fallbackWarn,v=n?n.fallbackRoot:!I(e.fallbackRoot)||e.fallbackRoot,k=!!e.fallbackFormat,E=T(e.missing)?e.missing:null,O=T(e.missing)?ze(e.missing):null,N=T(e.postTranslation)?e.postTranslation:null,W=n?n.warnHtmlMessage:!I(e.warnHtmlMessage)||e.warnHtmlMessage,M=!!e.escapeParameter;const D=n?n.modifiers:w(e.modifiers)?e.modifiers:{};let $,S=e.pluralRules||n&&n.pluralRules;$=(()=>{r&&ee(null);const t={version:Ne,locale:u.value,fallbackLocale:f.value,messages:p.value,modifiers:D,pluralRules:S,missing:null===O?void 0:O,missingWarn:b,fallbackWarn:h,fallbackFormat:k,unresolving:!0,postTranslation:null===N?void 0:N,warnHtmlMessage:W,escapeParameter:M,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};t.datetimeFormats=g.value,t.numberFormats=d.value,t.__datetimeFormatters=w($)?$.__datetimeFormatters:void 0,t.__numberFormatters=w($)?$.__numberFormatters:void 0;const n=ae(t);return r&&ee(n),n})(),oe($,u.value,f.value);const A=t.computed({get:()=>u.value,set:e=>{$.locale=e,u.value=e}}),x=t.computed({get:()=>f.value,set:e=>{$.fallbackLocale=e,f.value=e,oe($,u.value,e)}}),U=t.computed((()=>p.value)),j=t.computed((()=>g.value)),V=t.computed((()=>d.value));const G=(e,t,a,l,o,s)=>{let i;u.value,f.value,p.value,g.value,d.value;try{0,r||($.fallbackContext=n?te():void 0),i=e($)}finally{r||($.fallbackContext=void 0)}if("translate exists"!==a&&c(i)&&i===J||"translate exists"===a&&!i){const[e,a]=t();return n&&v?l(n):o(e)}if(s(i))return i;throw Error(We.UNEXPECTED_RETURN_TYPE)};function Y(...e){return G((t=>Reflect.apply(Le,null,[t,...e])),(()=>Oe(...e)),"translate",(t=>Reflect.apply(t.t,t,[...e])),(e=>e),(e=>L(e)))}const z={normalize:function(e){return e.map((e=>L(e)||c(e)||I(e)?je(String(e)):e))},interpolate:e=>e,type:"vnode"};function X(e){return p.value[e]||{}}Ye++,n&&l&&(t.watch(n.locale,(e=>{i&&(u.value=e,$.locale=e,oe($,u.value,f.value))})),t.watch(n.fallbackLocale,(e=>{i&&(f.value=e,$.fallbackLocale=e,oe($,u.value,f.value))})));const Z={id:Ye,locale:A,fallbackLocale:x,get inheritLocale(){return i},set inheritLocale(e){i=e,e&&n&&(u.value=n.locale.value,f.value=n.fallbackLocale.value,oe($,u.value,f.value))},get availableLocales(){return Object.keys(p.value).sort()},messages:U,get modifiers(){return D},get pluralRules(){return S||{}},get isGlobal(){return r},get missingWarn(){return b},set missingWarn(e){b=e,$.missingWarn=b},get fallbackWarn(){return h},set fallbackWarn(e){h=e,$.fallbackWarn=h},get fallbackRoot(){return v},set fallbackRoot(e){v=e},get fallbackFormat(){return k},set fallbackFormat(e){k=e,$.fallbackFormat=k},get warnHtmlMessage(){return W},set warnHtmlMessage(e){W=e,$.warnHtmlMessage=e},get escapeParameter(){return M},set escapeParameter(e){M=e,$.escapeParameter=e},t:Y,getLocaleMessage:X,setLocaleMessage:function(e,t){if(o){const n={[e]:t};for(const e in n)y(n,e)&&Se(n[e]);t=n[e]}p.value[e]=t,$.messages=p.value},mergeLocaleMessage:function(e,t){p.value[e]=p.value[e]||{};const n={[e]:t};if(o)for(const a in n)y(n,a)&&Se(n[a]);P(t=n[e],p.value[e]),$.messages=p.value},getPostTranslationHandler:function(){return T(N)?N:null},setPostTranslationHandler:function(e){N=e,$.postTranslation=e},getMissingHandler:function(){return E},setMissingHandler:function(e){null!==e&&(O=ze(e)),E=e,$.missing=O},[Ce]:function(e){S=e,$.pluralRules=S}};return Z.datetimeFormats=j,Z.numberFormats=V,Z.rt=function(...e){const[t,n,a]=e;if(a&&!R(a))throw Error(We.INVALID_ARGUMENT);return Y(t,n,_({resolvedMessage:!0},a||{}))},Z.te=function(e,t){return G((()=>{if(!e)return!1;const n=L(t)?t:u.value,a=L(t)?[n]:H($,f.value,n);for(let t=0;t<a.length;t++){const n=X(a[t]);let r=$.messageResolver(n,e);if(null===r&&(r=n[e]),C(r)||Te(r)||L(r))return!0}return!1}),(()=>[e]),"translate exists",(n=>Reflect.apply(n.te,n,[e,t])),Ge,(e=>I(e)))},Z.tm=function(e){const t=function(e){let t=null;const n=H($,f.value,u.value);for(let a=0;a<n.length;a++){const r=p.value[n[a]]||{},l=$.messageResolver(r,e);if(null!=l){t=l;break}}return t}(e);return null!=t?t:n&&n.tm(e)||{}},Z.d=function(...e){return G((t=>Reflect.apply(ie,null,[t,...e])),(()=>ue(...e)),"datetime format",(t=>Reflect.apply(t.d,t,[...e])),(()=>q),(e=>L(e)||F(e)))},Z.n=function(...e){return G((t=>Reflect.apply(fe,null,[t,...e])),(()=>pe(...e)),"number format",(t=>Reflect.apply(t.n,t,[...e])),(()=>q),(e=>L(e)||F(e)))},Z.getDateTimeFormat=function(e){return g.value[e]||{}},Z.setDateTimeFormat=function(e,t){g.value[e]=t,$.datetimeFormats=g.value,me($,e,t)},Z.mergeDateTimeFormat=function(e,t){g.value[e]=_(g.value[e]||{},t),$.datetimeFormats=g.value,me($,e,t)},Z.getNumberFormat=function(e){return d.value[e]||{}},Z.setNumberFormat=function(e,t){d.value[e]=t,$.numberFormats=d.value,ge($,e,t)},Z.mergeNumberFormat=function(e,t){d.value[e]=_(d.value[e]||{},t),$.numberFormats=d.value,ge($,e,t)},Z[De]=a,Z[we]=function(...e){return G((t=>{let n;const a=t;try{a.processor=z,n=Reflect.apply(Le,null,[a,...e])}finally{a.processor=null}return n}),(()=>Oe(...e)),"translate",(t=>t[we](...e)),(e=>[je(e)]),(e=>F(e)))},Z[Me]=function(...e){return G((t=>Reflect.apply(ie,null,[t,...e])),(()=>ue(...e)),"datetime format",(t=>t[Me](...e)),Ve,(e=>L(e)||F(e)))},Z[Pe]=function(...e){return G((t=>Reflect.apply(fe,null,[t,...e])),(()=>pe(...e)),"number format",(t=>t[Pe](...e)),Ve,(e=>L(e)||F(e)))},Z}function Je(e={}){const t=Xe(function(e){const t=L(e.locale)?e.locale:B,n=L(e.fallbackLocale)||F(e.fallbackLocale)||w(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,a=T(e.missing)?e.missing:void 0,r=!I(e.silentTranslationWarn)&&!m(e.silentTranslationWarn)||!e.silentTranslationWarn,l=!I(e.silentFallbackWarn)&&!m(e.silentFallbackWarn)||!e.silentFallbackWarn,o=!I(e.fallbackRoot)||e.fallbackRoot,s=!!e.formatFallbackMessages,i=w(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=T(e.postTranslation)?e.postTranslation:void 0,f=!L(e.warnHtmlInMessage)||"off"!==e.warnHtmlInMessage,p=!!e.escapeParameterHtml,g=!I(e.sync)||e.sync;let d=e.messages;if(w(e.sharedMessages)){const t=e.sharedMessages;d=Object.keys(t).reduce(((e,n)=>{const a=e[n]||(e[n]={});return _(a,t[n]),e}),d||{})}const{__i18n:b,__root:h,__injectWithOption:v}=e,k=e.datetimeFormats,E=e.numberFormats;return{locale:t,fallbackLocale:n,messages:d,flatJson:e.flatJson,datetimeFormats:k,numberFormats:E,missing:a,missingWarn:r,fallbackWarn:l,fallbackRoot:o,fallbackFormat:s,modifiers:i,pluralRules:c,postTranslation:u,warnHtmlMessage:f,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:g,__i18n:b,__root:h,__injectWithOption:v}}(e)),{__extender:n}=e,a={id:t.id,get locale(){return t.locale.value},set locale(e){t.locale.value=e},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(e){t.fallbackLocale.value=e},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(e){t.setMissingHandler(e)},get silentTranslationWarn(){return I(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(e){t.missingWarn=I(e)?!e:e},get silentFallbackWarn(){return I(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(e){t.fallbackWarn=I(e)?!e:e},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(e){t.fallbackFormat=e},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(e){t.setPostTranslationHandler(e)},get sync(){return t.inheritLocale},set sync(e){t.inheritLocale=e},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(e){t.warnHtmlMessage="off"!==e},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(e){t.escapeParameter=e},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t:(...e)=>Reflect.apply(t.t,t,[...e]),rt:(...e)=>Reflect.apply(t.rt,t,[...e]),te:(e,n)=>t.te(e,n),tm:e=>t.tm(e),getLocaleMessage:e=>t.getLocaleMessage(e),setLocaleMessage(e,n){t.setLocaleMessage(e,n)},mergeLocaleMessage(e,n){t.mergeLocaleMessage(e,n)},d:(...e)=>Reflect.apply(t.d,t,[...e]),getDateTimeFormat:e=>t.getDateTimeFormat(e),setDateTimeFormat(e,n){t.setDateTimeFormat(e,n)},mergeDateTimeFormat(e,n){t.mergeDateTimeFormat(e,n)},n:(...e)=>Reflect.apply(t.n,t,[...e]),getNumberFormat:e=>t.getNumberFormat(e),setNumberFormat(e,n){t.setNumberFormat(e,n)},mergeNumberFormat(e,n){t.mergeNumberFormat(e,n)}};return a.__extender=n,a}function Be(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[Ce](t.pluralizationRules||e.pluralizationRules);const n=Ae(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach((t=>e.mergeLocaleMessage(t,n[t]))),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach((n=>e.mergeDateTimeFormat(n,t.datetimeFormats[n]))),t.numberFormats&&Object.keys(t.numberFormats).forEach((n=>e.mergeNumberFormat(n,t.numberFormats[n]))),e}const qe={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>"parent"===e||"global"===e,default:"parent"},i18n:{type:Object}};function Ze(){return t.Fragment}const Ke=t.defineComponent({name:"i18n-t",props:_({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>c(e)||!isNaN(e)}},qe),setup(e,n){const{slots:a,attrs:r}=n,l=e.i18n||st({useScope:e.scope,__useComponent:!0});return()=>{const o=()=>{const r=Object.keys(a).filter((e=>"_"!==e[0])),o=g();e.locale&&(o.locale=e.locale),void 0!==e.plural&&(o.plural=L(e.plural)?+e.plural:e.plural);const s=function({slots:e},n){if(1===n.length&&"default"===n[0])return(e.default?e.default():[]).reduce(((e,n)=>[...e,...n.type===t.Fragment?n.children:[n]]),[]);return n.reduce(((t,n)=>{const a=e[n];return a&&(t[n]=a()),t}),g())}(n,r);return l[we](e.keypath,s,o)},s=_(g(),r),i=L(e.tag)||R(e.tag)?e.tag:Ze();return R(i)?t.h(i,s,{default:o}):t.h(i,s,o())}}}),Qe=Ke;function et(e,n,a,r){const{slots:l,attrs:o}=n;return()=>{const n=()=>{const t={part:!0};let n=g();e.locale&&(t.locale=e.locale),L(e.format)?t.key=e.format:R(e.format)&&(L(e.format.key)&&(t.key=e.format.key),n=Object.keys(e.format).reduce(((t,n)=>a.includes(n)?_(g(),t,{[n]:e.format[n]}):t),g()));const o=r(e.value,t,n);let s=[t.key];return F(o)?s=o.map(((e,t)=>{const n=l[e.type],a=n?n({[e.type]:e.value,index:t,parts:o}):[e.value];var r;return F(r=a)&&!L(r[0])&&(a[0].key=`${e.type}-${t}`),a})):L(o)&&(s=[o]),s},s=_(g(),o),i=L(e.tag)||R(e.tag)?e.tag:Ze();return R(i)?t.h(i,s,{default:n}):t.h(i,s,n())}}const tt=t.defineComponent({name:"i18n-n",props:_({value:{type:Number,required:!0},format:{type:[String,Object]}},qe),setup(e,t){const n=e.i18n||st({useScope:e.scope,__useComponent:!0});return et(e,t,_e,((...e)=>n[Pe](...e)))}}),nt=tt;function at(e){const n=t=>{const{instance:n,value:a}=t;if(!n||!n.$)throw Error(We.UNEXPECTED_ERROR);const r=function(e,t){const n=e;if("composition"===e.mode)return n.__getInstance(t)||e.global;{const a=n.__getInstance(t);return null!=a?a.__composer:e.global.__composer}}(e,n.$),l=rt(a);return[Reflect.apply(r.t,r,[...lt(l)]),r]};return{created:(e,a)=>{const[r,o]=n(a);l&&(e.__i18nWatcher=t.watch(o.locale,(()=>{a.instance&&a.instance.$forceUpdate()}))),e.__composer=o,e.textContent=r},unmounted:e=>{l&&e.__i18nWatcher&&(e.__i18nWatcher(),e.__i18nWatcher=void 0,delete e.__i18nWatcher),e.__composer&&(e.__composer=void 0,delete e.__composer)},beforeUpdate:(e,{value:t})=>{if(e.__composer){const n=e.__composer,a=rt(t);e.textContent=Reflect.apply(n.t,n,[...lt(a)])}},getSSRProps:e=>{const[t]=n(e);return{textContent:t}}}}function rt(e){if(L(e))return{path:e};if(w(e)){if(!("path"in e))throw Error(We.REQUIRED_VALUE,"path");return e}throw Error(We.INVALID_VALUE)}function lt(e){const{path:t,locale:n,args:a,choice:r,plural:l}=e,o={},s=a||{};return L(n)&&(o.locale=n),c(r)&&(o.plural=r),c(l)&&(o.plural=l),[t,s,o]}const ot=o("global-vue-i18n");function st(e={}){const n=He();if(null==n)throw Error(We.MUST_BE_CALL_SETUP_TOP);if(!n.isCE&&null!=n.appContext.app&&!n.appContext.app.__VUE_I18N_SYMBOL__)throw Error(We.NOT_INSTALLED);const a=function(e){const n=t.inject(e.isCE?ot:e.appContext.app.__VUE_I18N_SYMBOL__);if(!n)throw Error(e.isCE?We.NOT_INSTALLED_WITH_PROVIDE:We.UNEXPECTED_ERROR);return n}(n),r=function(e){return"composition"===e.mode?e.global:e.global.__composer}(a),l=xe(n),o=function(e,t){return f(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}(e,l);if("global"===o)return Ue(r,e,l),r;if("parent"===o){let t=it(a,n,e.__useComponent);return null==t&&(t=r),t}if("isolated"===o){if("composition"!==a.mode)throw Error(We.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const l=a,o=_({},e),s=it(a,n);o.__root=s||r;const i=Xe(o);l.__composerExtend&&(i[$e]=l.__composerExtend(i));return t.getCurrentScope()&&t.onScopeDispose((()=>{const e=i[$e];e&&(e(),delete i[$e])})),i}const s=a;let i=s.__getInstance(n);if(null==i){const a=_({},e);"__i18n"in l&&(a.__i18n=l.__i18n),r&&(a.__root=r),i=Xe(a),s.__composerExtend&&(i[$e]=s.__composerExtend(i)),function(e,n,a){t.onMounted((()=>{}),n),t.onUnmounted((()=>{const t=a;e.__deleteInstance(n);const r=t[$e];r&&(r(),delete t[$e])}),n)}(s,n,i),s.__setInstance(n,i)}return i}function it(e,t,n=!1){let a=null;const r=t.root;let l=function(e,t=!1){if(null==e)return null;return t&&e.vnode.ctx||e.parent}(t,n);for(;null!=l;){const t=e;if("composition"===e.mode)a=t.__getInstance(l);else{const e=t.__getInstance(l);null!=e&&(a=e.__composer,n&&a&&!a[De]&&(a=null))}if(null!=a)break;if(r===l)break;l=l.parent}return a}const ct=["locale","fallbackLocale","availableLocales"],ut=["t","rt","d","n","tm","te"];const mt=t.defineComponent({name:"i18n-d",props:_({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},qe),setup(e,t){const n=e.i18n||st({useScope:e.scope,__useComponent:!0});return et(e,t,ce,((...e)=>n[Me](...e)))}}),ft=mt;return e.DatetimeFormat=mt,e.I18nD=ft,e.I18nInjectionKey=ot,e.I18nN=nt,e.I18nT=Qe,e.NumberFormat=tt,e.Translation=Ke,e.VERSION=Ne,e.createI18n=function(e={}){const n=!I(e.legacy)||e.legacy,a=!I(e.globalInjection)||e.globalInjection,r=new Map,[l,s]=function(e,n){const a=t.effectScope(),r=n?a.run((()=>Je(e))):a.run((()=>Xe(e)));if(null==r)throw Error(We.UNEXPECTED_ERROR);return[a,r]}(e,n),i=o(""),c={get mode(){return n?"legacy":"composition"},async install(e,...r){if(e.__VUE_I18N_SYMBOL__=i,e.provide(e.__VUE_I18N_SYMBOL__,c),w(r[0])){const e=r[0];c.__composerExtend=e.__composerExtend,c.__vueI18nExtend=e.__vueI18nExtend}let l=null;!n&&a&&(l=function(e,n){const a=Object.create(null);ct.forEach((e=>{const r=Object.getOwnPropertyDescriptor(n,e);if(!r)throw Error(We.UNEXPECTED_ERROR);const l=t.isRef(r.value)?{get:()=>r.value.value,set(e){r.value.value=e}}:{get:()=>r.get&&r.get()};Object.defineProperty(a,e,l)})),e.config.globalProperties.$i18n=a,ut.forEach((t=>{const a=Object.getOwnPropertyDescriptor(n,t);if(!a||!a.value)throw Error(We.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${t}`,a)}));const r=()=>{delete e.config.globalProperties.$i18n,ut.forEach((t=>{delete e.config.globalProperties[`$${t}`]}))};return r}(e,c.global)),function(e,t,...n){const a=w(n[0])?n[0]:{};(!I(a.globalInstall)||a.globalInstall)&&([Ke.name,"I18nT"].forEach((t=>e.component(t,Ke))),[tt.name,"I18nN"].forEach((t=>e.component(t,tt))),[mt.name,"I18nD"].forEach((t=>e.component(t,mt)))),e.directive("t",at(t))}(e,c,...r),n&&e.mixin(function(e,t,n){return{beforeCreate(){const a=He();if(!a)throw Error(We.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const a=r.i18n;if(r.__i18n&&(a.__i18n=r.__i18n),a.__root=t,this===this.$root)this.$i18n=Be(e,a);else{a.__injectWithOption=!0,a.__extender=n.__vueI18nExtend,this.$i18n=Je(a);const e=this.$i18n;e.__extender&&(e.__disposer=e.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=Be(e,r);else{this.$i18n=Je({__i18n:r.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const e=this.$i18n;e.__extender&&(e.__disposer=e.__extender(this.$i18n))}else this.$i18n=e;r.__i18nGlobal&&Ue(t,r,r),this.$t=(...e)=>this.$i18n.t(...e),this.$rt=(...e)=>this.$i18n.rt(...e),this.$te=(e,t)=>this.$i18n.te(e,t),this.$d=(...e)=>this.$i18n.d(...e),this.$n=(...e)=>this.$i18n.n(...e),this.$tm=e=>this.$i18n.tm(e),n.__setInstance(a,this.$i18n)},mounted(){},unmounted(){const e=He();if(!e)throw Error(We.UNEXPECTED_ERROR);const t=this.$i18n;t&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,t?.__disposer&&(t.__disposer(),delete t.__disposer,delete t.__extender),n.__deleteInstance(e),delete this.$i18n)}}}(s,s.__composer,c));const o=e.unmount;e.unmount=()=>{l&&l(),c.dispose(),o()}},get global(){return s},dispose(){l.stop()},__instances:r,__getInstance:function(e){return r.get(e)||null},__setInstance:function(e,t){r.set(e,t)},__deleteInstance:function(e){r.delete(e)}};return c},e.useI18n=st,e.vTDirective=at,e}({},Vue);