Onlife/node_modules/vue-i18n/dist/vue-i18n.runtime.global.prod.js

7 lines
33 KiB
JavaScript
Raw Normal View History

2025-04-19 15:38:48 +08:00
/*!
* vue-i18n v10.0.4
* (c) 2024 kazuya kawaguchi
* Released under the MIT License.
*/
var VueI18n=function(e,t){"use strict";const n="undefined"!=typeof window,a=(e,t=!1)=>t?Symbol.for(e):Symbol(e),r=(e,t,n)=>l({l:e,k:t,s:n}),l=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),s=e=>"[object Date]"===k(e),i=e=>"[object RegExp]"===k(e),c=e=>y(e)&&0===Object.keys(e).length,u=Object.assign;function m(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const f=Object.prototype.hasOwnProperty;function _(e,t){return f.call(e,t)}const p=Array.isArray,g=e=>"function"==typeof e,d=e=>"string"==typeof e,b=e=>"boolean"==typeof e,h=e=>null!==e&&"object"==typeof e,v=e=>h(e)&&g(e.then)&&g(e.catch),E=Object.prototype.toString,k=e=>E.call(e),y=e=>"[object Object]"===k(e);function F(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const T=e=>!h(e)||p(e);function R(e,t){if(T(e)||T(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=>{h(e[a])&&!h(t[a])&&(t[a]=Array.isArray(e[a])?[]:{}),T(t[a])||T(e[a])?t[a]=e[a]:n.push({src:e[a],des:t[a]})}))}}function L(e){return t=>function(e,t){const n=t.b||t.body;if(1===(n.t||n.type)){const t=n,a=t.c||t.cases;return e.plural(a.reduce(((t,n)=>[...t,I(e,n)]),[]))}return I(e,n)}(t,e)}function I(e,t){const n=t.s||t.static;if(null!=n)return"text"===e.type?n:e.normalize([n]);{const n=(t.i||t.items).reduce(((t,n)=>[...t,N(e,n)]),[]);return e.normalize(n)}}function N(e,t){const n=t.t||t.type;switch(n){case 3:{const e=t;return e.v||e.value}case 9:{const e=t;return e.v||e.value}case 4:{const n=t;return e.interpolate(e.named(n.k||n.key))}case 5:{const n=t;return e.interpolate(e.list(null!=n.i?n.i:n.index))}case 6:{const n=t,a=n.m||n.modifier;return e.linked(N(e,n.k||n.key),a?N(e,a):void 0,e.type)}case 7:{const e=t;return e.v||e.value}case 8:{const e=t;return e.v||e.value}default:throw new Error(`unhandled node type on format message part: ${n}`)}}let O=Object.create(null);const W=e=>h(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);const w={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function M(e,t){return null!=t.locale?P(t.locale):P(e.locale)}let C;function P(e){if(d(e))return e;if(g(e)){if(e.resolvedOnce&&null!=C)return C;if("Function"===e.constructor.name){const t=e();if(v(t))throw Error(w.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return C=t}throw Error(w.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Error(w.NOT_SUPPORT_LOCALE_TYPE)}function D(e,t,n){return[...new Set([n,...p(t)?t:h(t)?Object.keys(t):d(t)?[t]:[n]])]}function S(e,t,n){const a=d(n)?n:J,r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let l=r.__localeChainCache.get(a);if(!l){l=[];let e=[n];for(;p(e);)e=A(l,e,t);const o=p(t)||!y(t)?t:t.default?t.default:null;e=d(o)?[o]:o,p(e)&&A(l,e,!1),r.__localeChainCache.set(a,l)}return l}function A(e,t,n){let a=!0;for(let r=0;r<t.length&&b(a);r++){const l=t[r];d(l)&&(a=$(e,t[r],n))}return a}function $(e,t,n){let a;const r=t.split("-");do{a=U(e,r.join("-"),n),r.splice(-1,1)}while(r.length&&!0===a);return a}function U(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),(p(n)||y(n))&&n[r]&&(a=n[r])}return a}const x=[];x[0]={w:[0],i:[3,0],"[":[4],o:[7]},x[1]={w:[1],".":[2],"[":[4],o:[7]},x[2]={w:[2],i:[3,0],0:[3,0]},x[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},x[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},x[5]={"'":[4,0],o:8,l:[5,0]},x[6]={'"':[4,0],o:8,l:[6,0]};const j=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function H(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 V(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(pars