vue-i18n 8.26.4 → 8.26.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/dist/vue-i18n.common.js +27 -18
- package/dist/vue-i18n.esm.browser.js +26 -15
- package/dist/vue-i18n.esm.browser.min.js +1 -1
- package/dist/vue-i18n.esm.js +27 -18
- package/dist/vue-i18n.js +27 -18
- package/dist/vue-i18n.min.js +2 -2
- package/package.json +2 -2
- package/src/extend.js +2 -5
- package/src/index.js +22 -8
- package/src/install.js +1 -1
- package/types/index.d.ts +33 -31
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
<a href="https://circleci.com/gh/kazupon/vue-i18n/tree/dev"><img src="https://circleci.com/gh/kazupon/vue-i18n/tree/dev.svg?style=shield" alt="Build Status"></a>
|
|
5
5
|
<a href="http://badge.fury.io/js/vue-i18n"><img src="https://badge.fury.io/js/vue-i18n.svg" alt="NPM version"></a>
|
|
6
6
|
<a href="https://discord.gg/4yCnk2m"><img src="https://img.shields.io/badge/Discord-join%20chat-738bd7.svg" alt="vue-i18n channel on Discord"></a>
|
|
7
|
-
<a href="https://devtoken.rocks/package/vue-i18n"><img src="https://badge.devtoken.rocks/vue-i18n" alt="vue-i18n Dev Token"></a>
|
|
8
7
|
</p>
|
|
9
8
|
|
|
10
9
|
<p align="center">Internationalization plugin for Vue.js</p>
|
|
@@ -46,6 +45,17 @@
|
|
|
46
45
|
</a>
|
|
47
46
|
</p>
|
|
48
47
|
|
|
48
|
+
<p align="center">
|
|
49
|
+
<a
|
|
50
|
+
href="https://cypress.io/"
|
|
51
|
+
target="_blank">
|
|
52
|
+
<img
|
|
53
|
+
src="https://raw.githubusercontent.com/kazupon/vue-i18n/v8.x/vuepress/.vuepress/public/patrons/cypress.svg"
|
|
54
|
+
width="240px"
|
|
55
|
+
/>
|
|
56
|
+
</a>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
49
59
|
<h3 align="center">🥈 Silver Sponsors</h3>
|
|
50
60
|
|
|
51
61
|
<h3 align="center">🥉 Bronze Sponsors</h3>
|
package/dist/vue-i18n.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v8.26.
|
|
2
|
+
* vue-i18n v8.26.8
|
|
3
3
|
* (c) 2021 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -222,13 +222,8 @@ function escapeParams(params) {
|
|
|
222
222
|
|
|
223
223
|
/* */
|
|
224
224
|
|
|
225
|
-
function extend (Vue
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* if `bridge` mode is avialable, `$i18n` is defined at `vue-i18n-bridge`
|
|
230
|
-
*/
|
|
231
|
-
if (!bridge && !Vue.prototype.hasOwnProperty('$i18n')) {
|
|
225
|
+
function extend (Vue) {
|
|
226
|
+
if (!Vue.prototype.hasOwnProperty('$i18n')) {
|
|
232
227
|
// $FlowFixMe
|
|
233
228
|
Object.defineProperty(Vue.prototype, '$i18n', {
|
|
234
229
|
get: function get () { return this._i18n }
|
|
@@ -755,7 +750,7 @@ function install (_Vue, options) {
|
|
|
755
750
|
return
|
|
756
751
|
}
|
|
757
752
|
|
|
758
|
-
extend(Vue
|
|
753
|
+
extend(Vue);
|
|
759
754
|
Vue.mixin(defineMixin(options.bridge));
|
|
760
755
|
Vue.directive('t', { bind: bind, update: update, unbind: unbind });
|
|
761
756
|
Vue.component(interpolationComponent.name, interpolationComponent);
|
|
@@ -1385,14 +1380,28 @@ VueI18n.prototype.watchI18nData = function watchI18nData () {
|
|
|
1385
1380
|
}, { deep: true })
|
|
1386
1381
|
};
|
|
1387
1382
|
|
|
1388
|
-
VueI18n.prototype.watchLocale = function watchLocale () {
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1383
|
+
VueI18n.prototype.watchLocale = function watchLocale (composer) {
|
|
1384
|
+
if (!composer) {
|
|
1385
|
+
/* istanbul ignore if */
|
|
1386
|
+
if (!this._sync || !this._root) { return null }
|
|
1387
|
+
var target = this._vm;
|
|
1388
|
+
return this._root.$i18n.vm.$watch('locale', function (val) {
|
|
1389
|
+
target.$set(target, 'locale', val);
|
|
1390
|
+
target.$forceUpdate();
|
|
1391
|
+
}, { immediate: true })
|
|
1392
|
+
} else {
|
|
1393
|
+
// deal with vue-i18n-bridge
|
|
1394
|
+
if (!this.__VUE_I18N_BRIDGE__) { return null }
|
|
1395
|
+
var self = this;
|
|
1396
|
+
var target$1 = this._vm;
|
|
1397
|
+
return this.vm.$watch('locale', function (val) {
|
|
1398
|
+
target$1.$set(target$1, 'locale', val);
|
|
1399
|
+
if (self.__VUE_I18N_BRIDGE__ && composer) {
|
|
1400
|
+
composer.locale.value = val;
|
|
1401
|
+
}
|
|
1402
|
+
target$1.$forceUpdate();
|
|
1403
|
+
}, { immediate: true })
|
|
1404
|
+
}
|
|
1396
1405
|
};
|
|
1397
1406
|
|
|
1398
1407
|
VueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {
|
|
@@ -2250,6 +2259,6 @@ Object.defineProperty(VueI18n, 'availabilities', {
|
|
|
2250
2259
|
});
|
|
2251
2260
|
|
|
2252
2261
|
VueI18n.install = install;
|
|
2253
|
-
VueI18n.version = '8.26.
|
|
2262
|
+
VueI18n.version = '8.26.8';
|
|
2254
2263
|
|
|
2255
2264
|
module.exports = VueI18n;
|
|
@@ -210,11 +210,8 @@ function escapeParams(params) {
|
|
|
210
210
|
|
|
211
211
|
/* */
|
|
212
212
|
|
|
213
|
-
function extend (Vue
|
|
214
|
-
|
|
215
|
-
* if `bridge` mode is avialable, `$i18n` is defined at `vue-i18n-bridge`
|
|
216
|
-
*/
|
|
217
|
-
if (!bridge && !Vue.prototype.hasOwnProperty('$i18n')) {
|
|
213
|
+
function extend (Vue) {
|
|
214
|
+
if (!Vue.prototype.hasOwnProperty('$i18n')) {
|
|
218
215
|
// $FlowFixMe
|
|
219
216
|
Object.defineProperty(Vue.prototype, '$i18n', {
|
|
220
217
|
get () { return this._i18n }
|
|
@@ -701,7 +698,7 @@ function install (_Vue, options = { bridge: false }) {
|
|
|
701
698
|
return
|
|
702
699
|
}
|
|
703
700
|
|
|
704
|
-
extend(Vue
|
|
701
|
+
extend(Vue);
|
|
705
702
|
Vue.mixin(defineMixin(options.bridge));
|
|
706
703
|
Vue.directive('t', { bind, update, unbind });
|
|
707
704
|
Vue.component(interpolationComponent.name, interpolationComponent);
|
|
@@ -1363,14 +1360,28 @@ class VueI18n {
|
|
|
1363
1360
|
}, { deep: true })
|
|
1364
1361
|
}
|
|
1365
1362
|
|
|
1366
|
-
watchLocale () {
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1363
|
+
watchLocale (composer) {
|
|
1364
|
+
if (!composer) {
|
|
1365
|
+
/* istanbul ignore if */
|
|
1366
|
+
if (!this._sync || !this._root) { return null }
|
|
1367
|
+
const target = this._vm;
|
|
1368
|
+
return this._root.$i18n.vm.$watch('locale', (val) => {
|
|
1369
|
+
target.$set(target, 'locale', val);
|
|
1370
|
+
target.$forceUpdate();
|
|
1371
|
+
}, { immediate: true })
|
|
1372
|
+
} else {
|
|
1373
|
+
// deal with vue-i18n-bridge
|
|
1374
|
+
if (!this.__VUE_I18N_BRIDGE__) { return null }
|
|
1375
|
+
const self = this;
|
|
1376
|
+
const target = this._vm;
|
|
1377
|
+
return this.vm.$watch('locale', (val) => {
|
|
1378
|
+
target.$set(target, 'locale', val);
|
|
1379
|
+
if (self.__VUE_I18N_BRIDGE__ && composer) {
|
|
1380
|
+
composer.locale.value = val;
|
|
1381
|
+
}
|
|
1382
|
+
target.$forceUpdate();
|
|
1383
|
+
}, { immediate: true })
|
|
1384
|
+
}
|
|
1374
1385
|
}
|
|
1375
1386
|
|
|
1376
1387
|
onComponentInstanceCreated (newI18n) {
|
|
@@ -2196,6 +2207,6 @@ Object.defineProperty(VueI18n, 'availabilities', {
|
|
|
2196
2207
|
});
|
|
2197
2208
|
|
|
2198
2209
|
VueI18n.install = install;
|
|
2199
|
-
VueI18n.version = '8.26.
|
|
2210
|
+
VueI18n.version = '8.26.8';
|
|
2200
2211
|
|
|
2201
2212
|
export default VueI18n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}const n=Array.isArray;function s(t){return null!==t&&"object"==typeof t}function r(t){return"string"==typeof t}const i=Object.prototype.toString,a="[object Object]";function o(t){return i.call(t)===a}function l(t){return null==t}function c(t){return"function"==typeof t}function h(...t){let e=null,r=null;return 1===t.length?s(t[0])||n(t[0])?r=t[0]:"string"==typeof t[0]&&(e=t[0]):2===t.length&&("string"==typeof t[0]&&(e=t[0]),(s(t[1])||n(t[1]))&&(r=t[1])),{locale:e,params:r}}function u(t){return JSON.parse(JSON.stringify(t))}function _(t,e){return!!~t.indexOf(e)}const m=Object.prototype.hasOwnProperty;function f(t,e){return m.call(t,e)}function g(t){const e=Object(t);for(let t=1;t<arguments.length;t++){const n=arguments[t];if(null!=n){let t;for(t in n)f(n,t)&&(s(n[t])?e[t]=g(e[t],n[t]):e[t]=n[t])}}return e}function p(t,e){if(t===e)return!0;const r=s(t),i=s(e);if(!r||!i)return!r&&!i&&String(t)===String(e);try{const s=n(t),r=n(e);if(s&&r)return t.length===e.length&&t.every((t,n)=>p(t,e[n]));if(s||r)return!1;{const n=Object.keys(t),s=Object.keys(e);return n.length===s.length&&n.every(n=>p(t[n],e[n]))}}catch(t){return!1}}var d={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render(t,{data:e,parent:n,props:s,slots:r}){const{$i18n:i}=n;if(!i)return;const{path:a,locale:o,places:l}=s,c=r(),h=i.i(a,o,function(t){let e;for(e in t)if("default"!==e)return!1;return Boolean(e)}(c)||l?function(t,e){const n=e?function(t){return Array.isArray(t)?t.reduce(v,{}):Object.assign({},t)}(e):{};if(!t)return n;const s=(t=t.filter(t=>t.tag||""!==t.text.trim())).every(y);return t.reduce(s?b:v,n)}(c.default,l):c),u=s.tag&&!0!==s.tag||!1===s.tag?s.tag:"span";return u?t(u,e,h):h}};function b(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function v(t,e,n){return t[n]=e,t}function y(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var F={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render(e,{props:n,parent:i,data:a}){const o=i.$i18n;if(!o)return null;let l=null,c=null;r(n.format)?l=n.format:s(n.format)&&(n.format.key&&(l=n.format.key),c=Object.keys(n.format).reduce((e,s)=>_(t,s)?Object.assign({},e,{[s]:n.format[s]}):e,null));const h=n.locale||o.locale,u=o._ntp(n.value,h,l,c),m=u.map((t,e)=>{const n=a.scopedSlots&&a.scopedSlots[t.type];return n?n({[t.type]:t.value,index:e,parts:u}):t.value}),f=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return f?e(f,{attrs:a.attrs,class:a.class,staticClass:a.staticClass},m):m}};function k(t,e,n){M(t,n)&&C(t,e,n)}function $(t,e,n,s){if(!M(t,n))return;const r=n.context.$i18n;(function(t,e){const n=e.context;return t._locale===n.$i18n.locale})(t,n)&&p(e.value,e.oldValue)&&p(t._localeMessage,r.getLocaleMessage(r.locale))||C(t,e,n)}function w(t,n,s,r){if(!s.context)return void e("Vue instance does not exists in VNode context");const i=s.context.$i18n||{};n.modifiers.preserve||i.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t._vt,t._locale=void 0,delete t._locale,t._localeMessage=void 0,delete t._localeMessage}function M(t,n){const s=n.context;return s?!!s.$i18n||(e("VueI18n instance does not exists in Vue instance"),!1):(e("Vue instance does not exists in VNode context"),!1)}function C(t,n,s){const i=n.value,{path:a,locale:l,args:c,choice:h}=function(t){let e,n,s,i;r(t)?e=t:o(t)&&(e=t.path,n=t.locale,s=t.args,i=t.choice);return{path:e,locale:n,args:s,choice:i}}(i);if(!a&&!l&&!c)return void e("value type not supported");if(!a)return void e("`path` is required in v-t directive");const u=s.context;t._vt=t.textContent=null!=h?u.$i18n.tc(a,h,...T(l,c)):u.$i18n.t(a,...T(l,c)),t._locale=u.$i18n.locale,t._localeMessage=u.$i18n.getLocaleMessage(u.$i18n.locale)}function T(t,e){const n=[];return t&&n.push(t),e&&(Array.isArray(e)||o(e))&&n.push(e),n}let I;function D(t,e={bridge:!1}){D.installed=!0;(I=t).version&&Number(I.version.split(".")[0]);!function(t,e=!1){e||t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get(){return this._i18n}}),t.prototype.$t=function(t,...e){const n=this.$i18n;return n._t(t,n.locale,n._getMessages(),this,...e)},t.prototype.$tc=function(t,e,...n){const s=this.$i18n;return s._tc(t,s.locale,s._getMessages(),this,e,...n)},t.prototype.$te=function(t,e){const n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t,...e){return this.$i18n.d(t,...e)},t.prototype.$n=function(t,...e){return this.$i18n.n(t,...e)}}(I,e.bridge),I.mixin(function(t=!1){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return t?{mounted:e}:{beforeCreate(){const t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n){if(t.i18n instanceof Q){if(t.__i18nBridge||t.__i18n)try{let e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(t=>{e=g(e,JSON.parse(t))}),Object.keys(e).forEach(n=>{t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(o(t.i18n)){const e=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?this.$root.$i18n:null;if(e&&(t.i18n.root=this.$root,t.i18n.formatter=e.formatter,t.i18n.fallbackLocale=e.fallbackLocale,t.i18n.formatFallbackMessages=e.formatFallbackMessages,t.i18n.silentTranslationWarn=e.silentTranslationWarn,t.i18n.silentFallbackWarn=e.silentFallbackWarn,t.i18n.pluralizationRules=e.pluralizationRules,t.i18n.preserveDirectiveContent=e.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{let e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(t=>{e=g(e,JSON.parse(t))}),t.i18n.messages=e}catch(t){}const{sharedMessages:n}=t.i18n;n&&o(n)&&(t.i18n.messages=g(t.i18n.messages,n)),this._i18n=new Q(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),e&&e.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Q&&(this._i18n=t.parent.$i18n)},beforeMount(){const t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?t.i18n instanceof Q?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):o(t.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Q&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy(){if(!this._i18n)return;const t=this;this.$nextTick(()=>{t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)})}}}(e.bridge)),I.directive("t",{bind:k,update:$,unbind:w}),I.component(d.name,d),I.component(F.name,F),I.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}const L=/^(?:\d)+/,O=/^(?:\w)+/;const x=0,N=1,j=2,W=3,S=0,E=4,R=5,H=6,P=7,V=8,A=[];A[S]={ws:[S],ident:[3,x],"[":[E],eof:[P]},A[1]={ws:[1],".":[2],"[":[E],eof:[P]},A[2]={ws:[2],ident:[3,x],0:[3,x],number:[3,x]},A[3]={ident:[3,x],0:[3,x],number:[3,x],ws:[1,N],".":[2,N],"[":[E,N],eof:[P,N]},A[E]={"'":[R,x],'"':[H,x],"[":[E,j],"]":[1,W],eof:V,else:[E,x]},A[R]={"'":[E,x],eof:V,else:[R,x]},A[H]={'"':[E,x],eof:V,else:[H,x]};const B=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function z(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function U(t){const e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(n=e,B.test(n)?function(t){const e=t.charCodeAt(0);return e!==t.charCodeAt(t.length-1)||34!==e&&39!==e?t:t.slice(1,-1)}(e):"*"+e);var n}class q{constructor(){this._cache=Object.create(null)}parsePath(t){let e=this._cache[t];return e||(e=function(t){const e=[];let n,s,r,i,a,o,l,c=-1,h=S,u=0;const _=[];function m(){const e=t[c+1];if(h===R&&"'"===e||h===H&&'"'===e)return c++,r="\\"+e,_[x](),!0}for(_[N]=function(){void 0!==s&&(e.push(s),s=void 0)},_[x]=function(){void 0===s?s=r:s+=r},_[j]=function(){_[x](),u++},_[W]=function(){if(u>0)u--,h=E,_[x]();else{if(u=0,void 0===s)return!1;if(!1===(s=U(s)))return!1;_[N]()}};null!==h;)if("\\"!==(n=t[++c])||!m()){if(i=z(n),(a=(l=A[h])[i]||l.else||V)===V)return;if(h=a[0],(o=_[a[1]])&&(r=void 0===(r=a[2])?n:r,!1===o()))return;if(h===P)return e}}(t))&&(this._cache[t]=e),e||[]}getPathValue(t,e){if(!s(t))return null;const n=this.parsePath(e);if(0===n.length)return null;{const e=n.length;let s=t,r=0;for(;r<e;){const t=s[n[r]];if(null==t)return null;s=t,r++}return s}}}const J=/<\/?[\w\s="/.':;#-\/]+>/,G=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|./]+|\([\w\-_|./]+\)))/g,Y=/^@(?:\.([a-z]+))?:/,X=/[()]/g,Z={upper:t=>t.toLocaleUpperCase(),lower:t=>t.toLocaleLowerCase(),capitalize:t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`},K=new class{constructor(){this._caches=Object.create(null)}interpolate(t,e){if(!e)return[t];let n=this._caches[t];return n||(n=function(t){const e=[];let n=0,s="";for(;n<t.length;){let r=t[n++];if("{"===r){s&&e.push({type:"text",value:s}),s="";let i="";for(r=t[n++];void 0!==r&&"}"!==r;)i+=r,r=t[n++];const a="}"===r,o=L.test(i)?"list":a&&O.test(i)?"named":"unknown";e.push({value:i,type:o})}else"%"===r?"{"!==t[n]&&(s+=r):s+=r}return s&&e.push({type:"text",value:s}),e}(t),this._caches[t]=n),function(t,e){const n=[];let r=0;const i=Array.isArray(e)?"list":s(e)?"named":"unknown";if("unknown"===i)return n;for(;r<t.length;){const s=t[r];switch(s.type){case"text":n.push(s.value);break;case"list":n.push(e[parseInt(s.value,10)]);break;case"named":"named"===i&&n.push(e[s.value])}r++}return n}(n,e)}};class Q{constructor(t={}){!I&&"undefined"!=typeof window&&window.Vue&&D(window.Vue);const e=t.locale||"en-US",n=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),s=t.messages||{},r=t.dateTimeFormats||t.datetimeFormats||{},i=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||K,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new q,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=((t,e)=>{const n=Object.getPrototypeOf(this);if(n&&n.getChoiceIndex){return n.getChoiceIndex.call(this,t,e)}return this.locale in this.pluralizationRules?this.pluralizationRules[this.locale].apply(this,[t,e]):((t,e)=>(t=Math.abs(t),2===e?t?t>1?1:0:1:t?Math.min(t,2):0))(t,e)}),this._exist=((t,e)=>!(!t||!e)&&(!l(this._path.getPathValue(t,e))||!!t[e])),"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(s).forEach(t=>{this._checkLocaleMessage(t,this._warnHtmlInMessage,s[t])}),this._initVM({locale:e,fallbackLocale:n,messages:s,dateTimeFormats:r,numberFormats:i})}_checkLocaleMessage(t,s,i){const a=(t,s,i,l)=>{if(o(i))Object.keys(i).forEach(e=>{const n=i[e];o(n)?(l.push(e),l.push("."),a(t,s,n,l),l.pop(),l.pop()):(l.push(e),a(t,s,n,l),l.pop())});else if(n(i))i.forEach((e,n)=>{o(e)?(l.push(`[${n}]`),l.push("."),a(t,s,e,l),l.pop(),l.pop()):(l.push(`[${n}]`),a(t,s,e,l),l.pop())});else if(r(i)){if(J.test(i)){const n=`Detected HTML in message '${i}' of keypath '${l.join("")}' at '${s}'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp`;"warn"===t?e(n):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(n)}}};a(s,t,i,[])}_initVM(t){const e=I.config.silent;I.config.silent=!0,this._vm=new I({data:t,__VUE18N__INSTANCE__:!0}),I.config.silent=e}destroyVM(){this._vm.$destroy()}subscribeDataChanging(t){this._dataListeners.add(t)}unsubscribeDataChanging(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)}watchI18nData(){return this._vm.$watch("$data",()=>{const t=function(t){const e=[];return t.forEach(t=>e.push(t)),e}(this._dataListeners);let e=t.length;for(;e--;)I.nextTick(()=>{t[e]&&t[e].$forceUpdate()})},{deep:!0})}watchLocale(){if(!this._sync||!this._root)return null;const t=this._vm;return this._root.$i18n.vm.$watch("locale",e=>{t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})}onComponentInstanceCreated(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)}get vm(){return this._vm}get messages(){return u(this._getMessages())}get dateTimeFormats(){return u(this._getDateTimeFormats())}get numberFormats(){return u(this._getNumberFormats())}get availableLocales(){return Object.keys(this.messages).sort()}get locale(){return this._vm.locale}set locale(t){this._vm.$set(this._vm,"locale",t)}get fallbackLocale(){return this._vm.fallbackLocale}set fallbackLocale(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)}get formatFallbackMessages(){return this._formatFallbackMessages}set formatFallbackMessages(t){this._formatFallbackMessages=t}get missing(){return this._missing}set missing(t){this._missing=t}get formatter(){return this._formatter}set formatter(t){this._formatter=t}get silentTranslationWarn(){return this._silentTranslationWarn}set silentTranslationWarn(t){this._silentTranslationWarn=t}get silentFallbackWarn(){return this._silentFallbackWarn}set silentFallbackWarn(t){this._silentFallbackWarn=t}get preserveDirectiveContent(){return this._preserveDirectiveContent}set preserveDirectiveContent(t){this._preserveDirectiveContent=t}get warnHtmlInMessage(){return this._warnHtmlInMessage}set warnHtmlInMessage(t){const e=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,e!==t&&("warn"===t||"error"===t)){const t=this._getMessages();Object.keys(t).forEach(e=>{this._checkLocaleMessage(e,this._warnHtmlInMessage,t[e])})}}get postTranslation(){return this._postTranslation}set postTranslation(t){this._postTranslation=t}get sync(){return this._sync}set sync(t){this._sync=t}_getMessages(){return this._vm.messages}_getDateTimeFormats(){return this._vm.dateTimeFormats}_getNumberFormats(){return this._vm.numberFormats}_warnDefault(t,e,n,s,i,a){if(!l(n))return n;if(this._missing){const n=this._missing.apply(null,[t,e,s,i]);if(r(n))return n}if(this._formatFallbackMessages){const t=h(...i);return this._render(e,a,t.params,e)}return e}_isFallbackRoot(t){return!t&&!l(this._root)&&this._fallbackRoot}_isSilentFallbackWarn(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn}_isSilentFallback(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)}_isSilentTranslationWarn(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn}_interpolate(t,e,s,i,a,h,u){if(!e)return null;const _=this._path.getPathValue(e,s);if(n(_)||o(_))return _;let m;if(l(_)){if(!o(e))return null;if(!r(m=e[s])&&!c(m))return null}else{if(!r(_)&&!c(_))return null;m=_}return r(m)&&(m.indexOf("@:")>=0||m.indexOf("@.")>=0)&&(m=this._link(t,e,m,i,"raw",h,u)),this._render(m,a,h,s)}_link(t,e,s,r,i,a,o){let l=s;const c=l.match(G);for(let s in c){if(!c.hasOwnProperty(s))continue;const h=c[s],u=h.match(Y),[m,f]=u,g=h.replace(m,"").replace(X,"");if(_(o,g))return l;o.push(g);let p=this._interpolate(t,e,g,r,"raw"===i?"string":i,"raw"===i?void 0:a,o);if(this._isFallbackRoot(p)){if(!this._root)throw Error("unexpected error");const t=this._root.$i18n;p=t._translate(t._getMessages(),t.locale,t.fallbackLocale,g,r,i,a)}p=this._warnDefault(t,g,p,r,n(a)?a:[a],i),this._modifiers.hasOwnProperty(f)?p=this._modifiers[f](p):Z.hasOwnProperty(f)&&(p=Z[f](p)),o.pop(),l=p?l.replace(h,p):l}return l}_createMessageContext(t,e,r,i){const a=n(t)?t:[],o=s(t)?t:{},l=this._getMessages(),c=this.locale;return{list:t=>a[t],named:t=>o[t],values:t,formatter:e,path:r,messages:l,locale:c,linked:t=>this._interpolate(c,l[c]||{},t,null,i,void 0,[t])}}_render(t,e,n,s){if(c(t))return t(this._createMessageContext(n,this._formatter||K,s,e));let i=this._formatter.interpolate(t,n,s);return i||(i=K.interpolate(t,n,s)),"string"!==e||r(i)?i:i.join("")}_appendItemToChain(t,e,n){let s=!1;return _(t,e)||(s=!0,e&&(s="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(s=n[e]))),s}_appendLocaleToChain(t,e,n){let s;const r=e.split("-");do{const e=r.join("-");s=this._appendItemToChain(t,e,n),r.splice(-1,1)}while(r.length&&!0===s);return s}_appendBlockToChain(t,e,n){let s=!0;for(let i=0;i<e.length&&"boolean"==typeof s;i++){const a=e[i];r(a)&&(s=this._appendLocaleToChain(t,a,n))}return s}_getLocaleChain(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});let i=this._localeChainCache[t];if(!i){e||(e=this.fallbackLocale),i=[];let a,o=[t];for(;n(o);)o=this._appendBlockToChain(i,o,e);(o=r(a=n(e)?e:s(e)?e.default?e.default:null:e)?[a]:a)&&this._appendBlockToChain(i,o,null),this._localeChainCache[t]=i}return i}_translate(t,e,n,s,r,i,a){const o=this._getLocaleChain(e,n);let c;for(let e=0;e<o.length;e++){const n=o[e];if(!l(c=this._interpolate(n,t[n],s,r,i,a,[s])))return c}return null}_t(t,e,n,s,...r){if(!t)return"";const i=h(...r);var a;this._escapeParameterHtml&&(i.params=(null!=(a=i.params)&&Object.keys(a).forEach(t=>{"string"==typeof a[t]&&(a[t]=function(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(a[t]))}),a));const o=i.locale||e;let l=this._translate(n,o,this.fallbackLocale,t,s,"string",i.params);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return this._root.$t(t,...r)}return l=this._warnDefault(o,t,l,s,r,"string"),this._postTranslation&&null!=l&&(l=this._postTranslation(l,t)),l}t(t,...e){return this._t(t,this.locale,this._getMessages(),null,...e)}_i(t,e,n,s,r){const i=this._translate(n,e,this.fallbackLocale,t,s,"raw",r);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,r)}return this._warnDefault(e,t,i,s,[r],"raw")}i(t,e,n){return t?(r(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""}_tc(t,e,n,s,r,...i){if(!t)return"";void 0===r&&(r=1);const a={count:r,n:r},o=h(...i);return o.params=Object.assign(a,o.params),i=null===o.locale?[o.params]:[o.locale,o.params],this.fetchChoice(this._t(t,e,n,s,...i),r)}fetchChoice(t,e){if(!t||!r(t))return null;const n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t}tc(t,e,...n){return this._tc(t,this.locale,this._getMessages(),null,e,...n)}_te(t,e,n,...s){const r=h(...s).locale||e;return this._exist(n[r],t)}te(t,e){return this._te(t,this.locale,this._getMessages(),e)}getLocaleMessage(t){return u(this._vm.messages[t]||{})}setLocaleMessage(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)}mergeLocaleMessage(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,g(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))}getDateTimeFormat(t){return u(this._vm.dateTimeFormats[t]||{})}setDateTimeFormat(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)}mergeDateTimeFormat(t,e){this._vm.$set(this._vm.dateTimeFormats,t,g(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)}_clearDateTimeFormat(t,e){for(let n in e){const e=`${t}__${n}`;this._dateTimeFormatters.hasOwnProperty(e)&&delete this._dateTimeFormatters[e]}}_localizeDateTime(t,e,n,s,r){let i=e,a=s[i];const o=this._getLocaleChain(e,n);for(let t=0;t<o.length;t++){const e=o[t];if(i=e,!l(a=s[e])&&!l(a[r]))break}if(l(a)||l(a[r]))return null;{const e=a[r],n=`${i}__${r}`;let s=this._dateTimeFormatters[n];return s||(s=this._dateTimeFormatters[n]=new Intl.DateTimeFormat(i,e)),s.format(t)}}_d(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);const s=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(s)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return s||""}d(t,...e){let n=this.locale,i=null;return 1===e.length?r(e[0])?i=e[0]:s(e[0])&&(e[0].locale&&(n=e[0].locale),e[0].key&&(i=e[0].key)):2===e.length&&(r(e[0])&&(i=e[0]),r(e[1])&&(n=e[1])),this._d(t,n,i)}getNumberFormat(t){return u(this._vm.numberFormats[t]||{})}setNumberFormat(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)}mergeNumberFormat(t,e){this._vm.$set(this._vm.numberFormats,t,g(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)}_clearNumberFormat(t,e){for(let n in e){const e=`${t}__${n}`;this._numberFormatters.hasOwnProperty(e)&&delete this._numberFormatters[e]}}_getNumberFormatter(t,e,n,s,r,i){let a=e,o=s[a];const c=this._getLocaleChain(e,n);for(let t=0;t<c.length;t++){const e=c[t];if(a=e,!l(o=s[e])&&!l(o[r]))break}if(l(o)||l(o[r]))return null;{const t=o[r];let e;if(i)e=new Intl.NumberFormat(a,Object.assign({},t,i));else{const n=`${a}__${r}`;(e=this._numberFormatters[n])||(e=this._numberFormatters[n]=new Intl.NumberFormat(a,t))}return e}}_n(t,e,n,s){if(!Q.availabilities.numberFormat)return"";if(!n){return(s?new Intl.NumberFormat(e,s):new Intl.NumberFormat(e)).format(t)}const r=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,s),i=r&&r.format(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},s))}return i||""}n(e,...n){let i=this.locale,a=null,o=null;return 1===n.length?r(n[0])?a=n[0]:s(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(a=n[0].key),o=Object.keys(n[0]).reduce((e,s)=>_(t,s)?Object.assign({},e,{[s]:n[0][s]}):e,null)):2===n.length&&(r(n[0])&&(a=n[0]),r(n[1])&&(i=n[1])),this._n(e,i,a,o)}_ntp(t,e,n,s){if(!Q.availabilities.numberFormat)return[];if(!n){return(s?new Intl.NumberFormat(e,s):new Intl.NumberFormat(e)).formatToParts(t)}const r=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,s),i=r&&r.formatToParts(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,s)}return i||[]}}let tt;Object.defineProperty(Q,"availabilities",{get(){if(!tt){const t="undefined"!=typeof Intl;tt={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return tt}}),Q.install=D,Q.version="8.26.4";export default Q;
|
|
1
|
+
const t=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}const n=Array.isArray;function s(t){return null!==t&&"object"==typeof t}function r(t){return"string"==typeof t}const i=Object.prototype.toString,a="[object Object]";function o(t){return i.call(t)===a}function l(t){return null==t}function c(t){return"function"==typeof t}function h(...t){let e=null,r=null;return 1===t.length?s(t[0])||n(t[0])?r=t[0]:"string"==typeof t[0]&&(e=t[0]):2===t.length&&("string"==typeof t[0]&&(e=t[0]),(s(t[1])||n(t[1]))&&(r=t[1])),{locale:e,params:r}}function u(t){return JSON.parse(JSON.stringify(t))}function _(t,e){return!!~t.indexOf(e)}const m=Object.prototype.hasOwnProperty;function f(t,e){return m.call(t,e)}function g(t){const e=Object(t);for(let t=1;t<arguments.length;t++){const n=arguments[t];if(null!=n){let t;for(t in n)f(n,t)&&(s(n[t])?e[t]=g(e[t],n[t]):e[t]=n[t])}}return e}function p(t,e){if(t===e)return!0;const r=s(t),i=s(e);if(!r||!i)return!r&&!i&&String(t)===String(e);try{const s=n(t),r=n(e);if(s&&r)return t.length===e.length&&t.every((t,n)=>p(t,e[n]));if(s||r)return!1;{const n=Object.keys(t),s=Object.keys(e);return n.length===s.length&&n.every(n=>p(t[n],e[n]))}}catch(t){return!1}}var d={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render(t,{data:e,parent:n,props:s,slots:r}){const{$i18n:i}=n;if(!i)return;const{path:a,locale:o,places:l}=s,c=r(),h=i.i(a,o,function(t){let e;for(e in t)if("default"!==e)return!1;return Boolean(e)}(c)||l?function(t,e){const n=e?function(t){return Array.isArray(t)?t.reduce(v,{}):Object.assign({},t)}(e):{};if(!t)return n;const s=(t=t.filter(t=>t.tag||""!==t.text.trim())).every(y);return t.reduce(s?b:v,n)}(c.default,l):c),u=s.tag&&!0!==s.tag||!1===s.tag?s.tag:"span";return u?t(u,e,h):h}};function b(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function v(t,e,n){return t[n]=e,t}function y(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var F={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render(e,{props:n,parent:i,data:a}){const o=i.$i18n;if(!o)return null;let l=null,c=null;r(n.format)?l=n.format:s(n.format)&&(n.format.key&&(l=n.format.key),c=Object.keys(n.format).reduce((e,s)=>_(t,s)?Object.assign({},e,{[s]:n.format[s]}):e,null));const h=n.locale||o.locale,u=o._ntp(n.value,h,l,c),m=u.map((t,e)=>{const n=a.scopedSlots&&a.scopedSlots[t.type];return n?n({[t.type]:t.value,index:e,parts:u}):t.value}),f=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return f?e(f,{attrs:a.attrs,class:a.class,staticClass:a.staticClass},m):m}};function $(t,e,n){M(t,n)&&C(t,e,n)}function k(t,e,n,s){if(!M(t,n))return;const r=n.context.$i18n;(function(t,e){const n=e.context;return t._locale===n.$i18n.locale})(t,n)&&p(e.value,e.oldValue)&&p(t._localeMessage,r.getLocaleMessage(r.locale))||C(t,e,n)}function w(t,n,s,r){if(!s.context)return void e("Vue instance does not exists in VNode context");const i=s.context.$i18n||{};n.modifiers.preserve||i.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t._vt,t._locale=void 0,delete t._locale,t._localeMessage=void 0,delete t._localeMessage}function M(t,n){const s=n.context;return s?!!s.$i18n||(e("VueI18n instance does not exists in Vue instance"),!1):(e("Vue instance does not exists in VNode context"),!1)}function C(t,n,s){const i=n.value,{path:a,locale:l,args:c,choice:h}=function(t){let e,n,s,i;r(t)?e=t:o(t)&&(e=t.path,n=t.locale,s=t.args,i=t.choice);return{path:e,locale:n,args:s,choice:i}}(i);if(!a&&!l&&!c)return void e("value type not supported");if(!a)return void e("`path` is required in v-t directive");const u=s.context;t._vt=t.textContent=null!=h?u.$i18n.tc(a,h,...T(l,c)):u.$i18n.t(a,...T(l,c)),t._locale=u.$i18n.locale,t._localeMessage=u.$i18n.getLocaleMessage(u.$i18n.locale)}function T(t,e){const n=[];return t&&n.push(t),e&&(Array.isArray(e)||o(e))&&n.push(e),n}let I;function D(t,e={bridge:!1}){D.installed=!0;(I=t).version&&Number(I.version.split(".")[0]);!function(t){t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get(){return this._i18n}}),t.prototype.$t=function(t,...e){const n=this.$i18n;return n._t(t,n.locale,n._getMessages(),this,...e)},t.prototype.$tc=function(t,e,...n){const s=this.$i18n;return s._tc(t,s.locale,s._getMessages(),this,e,...n)},t.prototype.$te=function(t,e){const n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t,...e){return this.$i18n.d(t,...e)},t.prototype.$n=function(t,...e){return this.$i18n.n(t,...e)}}(I),I.mixin(function(t=!1){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return t?{mounted:e}:{beforeCreate(){const t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n){if(t.i18n instanceof Q){if(t.__i18nBridge||t.__i18n)try{let e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(t=>{e=g(e,JSON.parse(t))}),Object.keys(e).forEach(n=>{t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(o(t.i18n)){const e=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?this.$root.$i18n:null;if(e&&(t.i18n.root=this.$root,t.i18n.formatter=e.formatter,t.i18n.fallbackLocale=e.fallbackLocale,t.i18n.formatFallbackMessages=e.formatFallbackMessages,t.i18n.silentTranslationWarn=e.silentTranslationWarn,t.i18n.silentFallbackWarn=e.silentFallbackWarn,t.i18n.pluralizationRules=e.pluralizationRules,t.i18n.preserveDirectiveContent=e.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{let e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(t=>{e=g(e,JSON.parse(t))}),t.i18n.messages=e}catch(t){}const{sharedMessages:n}=t.i18n;n&&o(n)&&(t.i18n.messages=g(t.i18n.messages,n)),this._i18n=new Q(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),e&&e.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Q&&(this._i18n=t.parent.$i18n)},beforeMount(){const t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?t.i18n instanceof Q?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):o(t.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Q&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy(){if(!this._i18n)return;const t=this;this.$nextTick(()=>{t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)})}}}(e.bridge)),I.directive("t",{bind:$,update:k,unbind:w}),I.component(d.name,d),I.component(F.name,F),I.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}const L=/^(?:\d)+/,O=/^(?:\w)+/;const x=0,N=1,j=2,W=3,E=0,S=4,R=5,V=6,H=7,P=8,A=[];A[E]={ws:[E],ident:[3,x],"[":[S],eof:[H]},A[1]={ws:[1],".":[2],"[":[S],eof:[H]},A[2]={ws:[2],ident:[3,x],0:[3,x],number:[3,x]},A[3]={ident:[3,x],0:[3,x],number:[3,x],ws:[1,N],".":[2,N],"[":[S,N],eof:[H,N]},A[S]={"'":[R,x],'"':[V,x],"[":[S,j],"]":[1,W],eof:P,else:[S,x]},A[R]={"'":[S,x],eof:P,else:[R,x]},A[V]={'"':[S,x],eof:P,else:[V,x]};const B=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function U(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function z(t){const e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(n=e,B.test(n)?function(t){const e=t.charCodeAt(0);return e!==t.charCodeAt(t.length-1)||34!==e&&39!==e?t:t.slice(1,-1)}(e):"*"+e);var n}class G{constructor(){this._cache=Object.create(null)}parsePath(t){let e=this._cache[t];return e||(e=function(t){const e=[];let n,s,r,i,a,o,l,c=-1,h=E,u=0;const _=[];function m(){const e=t[c+1];if(h===R&&"'"===e||h===V&&'"'===e)return c++,r="\\"+e,_[x](),!0}for(_[N]=function(){void 0!==s&&(e.push(s),s=void 0)},_[x]=function(){void 0===s?s=r:s+=r},_[j]=function(){_[x](),u++},_[W]=function(){if(u>0)u--,h=S,_[x]();else{if(u=0,void 0===s)return!1;if(!1===(s=z(s)))return!1;_[N]()}};null!==h;)if("\\"!==(n=t[++c])||!m()){if(i=U(n),(a=(l=A[h])[i]||l.else||P)===P)return;if(h=a[0],(o=_[a[1]])&&(r=void 0===(r=a[2])?n:r,!1===o()))return;if(h===H)return e}}(t))&&(this._cache[t]=e),e||[]}getPathValue(t,e){if(!s(t))return null;const n=this.parsePath(e);if(0===n.length)return null;{const e=n.length;let s=t,r=0;for(;r<e;){const t=s[n[r]];if(null==t)return null;s=t,r++}return s}}}const q=/<\/?[\w\s="/.':;#-\/]+>/,J=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|./]+|\([\w\-_|./]+\)))/g,Y=/^@(?:\.([a-z]+))?:/,X=/[()]/g,Z={upper:t=>t.toLocaleUpperCase(),lower:t=>t.toLocaleLowerCase(),capitalize:t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`},K=new class{constructor(){this._caches=Object.create(null)}interpolate(t,e){if(!e)return[t];let n=this._caches[t];return n||(n=function(t){const e=[];let n=0,s="";for(;n<t.length;){let r=t[n++];if("{"===r){s&&e.push({type:"text",value:s}),s="";let i="";for(r=t[n++];void 0!==r&&"}"!==r;)i+=r,r=t[n++];const a="}"===r,o=L.test(i)?"list":a&&O.test(i)?"named":"unknown";e.push({value:i,type:o})}else"%"===r?"{"!==t[n]&&(s+=r):s+=r}return s&&e.push({type:"text",value:s}),e}(t),this._caches[t]=n),function(t,e){const n=[];let r=0;const i=Array.isArray(e)?"list":s(e)?"named":"unknown";if("unknown"===i)return n;for(;r<t.length;){const s=t[r];switch(s.type){case"text":n.push(s.value);break;case"list":n.push(e[parseInt(s.value,10)]);break;case"named":"named"===i&&n.push(e[s.value])}r++}return n}(n,e)}};class Q{constructor(t={}){!I&&"undefined"!=typeof window&&window.Vue&&D(window.Vue);const e=t.locale||"en-US",n=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),s=t.messages||{},r=t.dateTimeFormats||t.datetimeFormats||{},i=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||K,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new G,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=((t,e)=>{const n=Object.getPrototypeOf(this);if(n&&n.getChoiceIndex){return n.getChoiceIndex.call(this,t,e)}return this.locale in this.pluralizationRules?this.pluralizationRules[this.locale].apply(this,[t,e]):((t,e)=>(t=Math.abs(t),2===e?t?t>1?1:0:1:t?Math.min(t,2):0))(t,e)}),this._exist=((t,e)=>!(!t||!e)&&(!l(this._path.getPathValue(t,e))||!!t[e])),"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(s).forEach(t=>{this._checkLocaleMessage(t,this._warnHtmlInMessage,s[t])}),this._initVM({locale:e,fallbackLocale:n,messages:s,dateTimeFormats:r,numberFormats:i})}_checkLocaleMessage(t,s,i){const a=(t,s,i,l)=>{if(o(i))Object.keys(i).forEach(e=>{const n=i[e];o(n)?(l.push(e),l.push("."),a(t,s,n,l),l.pop(),l.pop()):(l.push(e),a(t,s,n,l),l.pop())});else if(n(i))i.forEach((e,n)=>{o(e)?(l.push(`[${n}]`),l.push("."),a(t,s,e,l),l.pop(),l.pop()):(l.push(`[${n}]`),a(t,s,e,l),l.pop())});else if(r(i)){if(q.test(i)){const n=`Detected HTML in message '${i}' of keypath '${l.join("")}' at '${s}'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp`;"warn"===t?e(n):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(n)}}};a(s,t,i,[])}_initVM(t){const e=I.config.silent;I.config.silent=!0,this._vm=new I({data:t,__VUE18N__INSTANCE__:!0}),I.config.silent=e}destroyVM(){this._vm.$destroy()}subscribeDataChanging(t){this._dataListeners.add(t)}unsubscribeDataChanging(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)}watchI18nData(){return this._vm.$watch("$data",()=>{const t=function(t){const e=[];return t.forEach(t=>e.push(t)),e}(this._dataListeners);let e=t.length;for(;e--;)I.nextTick(()=>{t[e]&&t[e].$forceUpdate()})},{deep:!0})}watchLocale(t){if(t){if(!this.__VUE_I18N_BRIDGE__)return null;const e=this,n=this._vm;return this.vm.$watch("locale",s=>{n.$set(n,"locale",s),e.__VUE_I18N_BRIDGE__&&t&&(t.locale.value=s),n.$forceUpdate()},{immediate:!0})}{if(!this._sync||!this._root)return null;const t=this._vm;return this._root.$i18n.vm.$watch("locale",e=>{t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})}}onComponentInstanceCreated(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)}get vm(){return this._vm}get messages(){return u(this._getMessages())}get dateTimeFormats(){return u(this._getDateTimeFormats())}get numberFormats(){return u(this._getNumberFormats())}get availableLocales(){return Object.keys(this.messages).sort()}get locale(){return this._vm.locale}set locale(t){this._vm.$set(this._vm,"locale",t)}get fallbackLocale(){return this._vm.fallbackLocale}set fallbackLocale(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)}get formatFallbackMessages(){return this._formatFallbackMessages}set formatFallbackMessages(t){this._formatFallbackMessages=t}get missing(){return this._missing}set missing(t){this._missing=t}get formatter(){return this._formatter}set formatter(t){this._formatter=t}get silentTranslationWarn(){return this._silentTranslationWarn}set silentTranslationWarn(t){this._silentTranslationWarn=t}get silentFallbackWarn(){return this._silentFallbackWarn}set silentFallbackWarn(t){this._silentFallbackWarn=t}get preserveDirectiveContent(){return this._preserveDirectiveContent}set preserveDirectiveContent(t){this._preserveDirectiveContent=t}get warnHtmlInMessage(){return this._warnHtmlInMessage}set warnHtmlInMessage(t){const e=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,e!==t&&("warn"===t||"error"===t)){const t=this._getMessages();Object.keys(t).forEach(e=>{this._checkLocaleMessage(e,this._warnHtmlInMessage,t[e])})}}get postTranslation(){return this._postTranslation}set postTranslation(t){this._postTranslation=t}get sync(){return this._sync}set sync(t){this._sync=t}_getMessages(){return this._vm.messages}_getDateTimeFormats(){return this._vm.dateTimeFormats}_getNumberFormats(){return this._vm.numberFormats}_warnDefault(t,e,n,s,i,a){if(!l(n))return n;if(this._missing){const n=this._missing.apply(null,[t,e,s,i]);if(r(n))return n}if(this._formatFallbackMessages){const t=h(...i);return this._render(e,a,t.params,e)}return e}_isFallbackRoot(t){return!t&&!l(this._root)&&this._fallbackRoot}_isSilentFallbackWarn(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn}_isSilentFallback(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)}_isSilentTranslationWarn(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn}_interpolate(t,e,s,i,a,h,u){if(!e)return null;const _=this._path.getPathValue(e,s);if(n(_)||o(_))return _;let m;if(l(_)){if(!o(e))return null;if(!r(m=e[s])&&!c(m))return null}else{if(!r(_)&&!c(_))return null;m=_}return r(m)&&(m.indexOf("@:")>=0||m.indexOf("@.")>=0)&&(m=this._link(t,e,m,i,"raw",h,u)),this._render(m,a,h,s)}_link(t,e,s,r,i,a,o){let l=s;const c=l.match(J);for(let s in c){if(!c.hasOwnProperty(s))continue;const h=c[s],u=h.match(Y),[m,f]=u,g=h.replace(m,"").replace(X,"");if(_(o,g))return l;o.push(g);let p=this._interpolate(t,e,g,r,"raw"===i?"string":i,"raw"===i?void 0:a,o);if(this._isFallbackRoot(p)){if(!this._root)throw Error("unexpected error");const t=this._root.$i18n;p=t._translate(t._getMessages(),t.locale,t.fallbackLocale,g,r,i,a)}p=this._warnDefault(t,g,p,r,n(a)?a:[a],i),this._modifiers.hasOwnProperty(f)?p=this._modifiers[f](p):Z.hasOwnProperty(f)&&(p=Z[f](p)),o.pop(),l=p?l.replace(h,p):l}return l}_createMessageContext(t,e,r,i){const a=n(t)?t:[],o=s(t)?t:{},l=this._getMessages(),c=this.locale;return{list:t=>a[t],named:t=>o[t],values:t,formatter:e,path:r,messages:l,locale:c,linked:t=>this._interpolate(c,l[c]||{},t,null,i,void 0,[t])}}_render(t,e,n,s){if(c(t))return t(this._createMessageContext(n,this._formatter||K,s,e));let i=this._formatter.interpolate(t,n,s);return i||(i=K.interpolate(t,n,s)),"string"!==e||r(i)?i:i.join("")}_appendItemToChain(t,e,n){let s=!1;return _(t,e)||(s=!0,e&&(s="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(s=n[e]))),s}_appendLocaleToChain(t,e,n){let s;const r=e.split("-");do{const e=r.join("-");s=this._appendItemToChain(t,e,n),r.splice(-1,1)}while(r.length&&!0===s);return s}_appendBlockToChain(t,e,n){let s=!0;for(let i=0;i<e.length&&"boolean"==typeof s;i++){const a=e[i];r(a)&&(s=this._appendLocaleToChain(t,a,n))}return s}_getLocaleChain(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});let i=this._localeChainCache[t];if(!i){e||(e=this.fallbackLocale),i=[];let a,o=[t];for(;n(o);)o=this._appendBlockToChain(i,o,e);(o=r(a=n(e)?e:s(e)?e.default?e.default:null:e)?[a]:a)&&this._appendBlockToChain(i,o,null),this._localeChainCache[t]=i}return i}_translate(t,e,n,s,r,i,a){const o=this._getLocaleChain(e,n);let c;for(let e=0;e<o.length;e++){const n=o[e];if(!l(c=this._interpolate(n,t[n],s,r,i,a,[s])))return c}return null}_t(t,e,n,s,...r){if(!t)return"";const i=h(...r);var a;this._escapeParameterHtml&&(i.params=(null!=(a=i.params)&&Object.keys(a).forEach(t=>{"string"==typeof a[t]&&(a[t]=function(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(a[t]))}),a));const o=i.locale||e;let l=this._translate(n,o,this.fallbackLocale,t,s,"string",i.params);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return this._root.$t(t,...r)}return l=this._warnDefault(o,t,l,s,r,"string"),this._postTranslation&&null!=l&&(l=this._postTranslation(l,t)),l}t(t,...e){return this._t(t,this.locale,this._getMessages(),null,...e)}_i(t,e,n,s,r){const i=this._translate(n,e,this.fallbackLocale,t,s,"raw",r);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,r)}return this._warnDefault(e,t,i,s,[r],"raw")}i(t,e,n){return t?(r(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""}_tc(t,e,n,s,r,...i){if(!t)return"";void 0===r&&(r=1);const a={count:r,n:r},o=h(...i);return o.params=Object.assign(a,o.params),i=null===o.locale?[o.params]:[o.locale,o.params],this.fetchChoice(this._t(t,e,n,s,...i),r)}fetchChoice(t,e){if(!t||!r(t))return null;const n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t}tc(t,e,...n){return this._tc(t,this.locale,this._getMessages(),null,e,...n)}_te(t,e,n,...s){const r=h(...s).locale||e;return this._exist(n[r],t)}te(t,e){return this._te(t,this.locale,this._getMessages(),e)}getLocaleMessage(t){return u(this._vm.messages[t]||{})}setLocaleMessage(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)}mergeLocaleMessage(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,g(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))}getDateTimeFormat(t){return u(this._vm.dateTimeFormats[t]||{})}setDateTimeFormat(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)}mergeDateTimeFormat(t,e){this._vm.$set(this._vm.dateTimeFormats,t,g(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)}_clearDateTimeFormat(t,e){for(let n in e){const e=`${t}__${n}`;this._dateTimeFormatters.hasOwnProperty(e)&&delete this._dateTimeFormatters[e]}}_localizeDateTime(t,e,n,s,r){let i=e,a=s[i];const o=this._getLocaleChain(e,n);for(let t=0;t<o.length;t++){const e=o[t];if(i=e,!l(a=s[e])&&!l(a[r]))break}if(l(a)||l(a[r]))return null;{const e=a[r],n=`${i}__${r}`;let s=this._dateTimeFormatters[n];return s||(s=this._dateTimeFormatters[n]=new Intl.DateTimeFormat(i,e)),s.format(t)}}_d(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);const s=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(s)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return s||""}d(t,...e){let n=this.locale,i=null;return 1===e.length?r(e[0])?i=e[0]:s(e[0])&&(e[0].locale&&(n=e[0].locale),e[0].key&&(i=e[0].key)):2===e.length&&(r(e[0])&&(i=e[0]),r(e[1])&&(n=e[1])),this._d(t,n,i)}getNumberFormat(t){return u(this._vm.numberFormats[t]||{})}setNumberFormat(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)}mergeNumberFormat(t,e){this._vm.$set(this._vm.numberFormats,t,g(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)}_clearNumberFormat(t,e){for(let n in e){const e=`${t}__${n}`;this._numberFormatters.hasOwnProperty(e)&&delete this._numberFormatters[e]}}_getNumberFormatter(t,e,n,s,r,i){let a=e,o=s[a];const c=this._getLocaleChain(e,n);for(let t=0;t<c.length;t++){const e=c[t];if(a=e,!l(o=s[e])&&!l(o[r]))break}if(l(o)||l(o[r]))return null;{const t=o[r];let e;if(i)e=new Intl.NumberFormat(a,Object.assign({},t,i));else{const n=`${a}__${r}`;(e=this._numberFormatters[n])||(e=this._numberFormatters[n]=new Intl.NumberFormat(a,t))}return e}}_n(t,e,n,s){if(!Q.availabilities.numberFormat)return"";if(!n){return(s?new Intl.NumberFormat(e,s):new Intl.NumberFormat(e)).format(t)}const r=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,s),i=r&&r.format(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},s))}return i||""}n(e,...n){let i=this.locale,a=null,o=null;return 1===n.length?r(n[0])?a=n[0]:s(n[0])&&(n[0].locale&&(i=n[0].locale),n[0].key&&(a=n[0].key),o=Object.keys(n[0]).reduce((e,s)=>_(t,s)?Object.assign({},e,{[s]:n[0][s]}):e,null)):2===n.length&&(r(n[0])&&(a=n[0]),r(n[1])&&(i=n[1])),this._n(e,i,a,o)}_ntp(t,e,n,s){if(!Q.availabilities.numberFormat)return[];if(!n){return(s?new Intl.NumberFormat(e,s):new Intl.NumberFormat(e)).formatToParts(t)}const r=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,s),i=r&&r.formatToParts(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,s)}return i||[]}}let tt;Object.defineProperty(Q,"availabilities",{get(){if(!tt){const t="undefined"!=typeof Intl;tt={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return tt}}),Q.install=D,Q.version="8.26.8";export default Q;
|
package/dist/vue-i18n.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v8.26.
|
|
2
|
+
* vue-i18n v8.26.8
|
|
3
3
|
* (c) 2021 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -220,13 +220,8 @@ function escapeParams(params) {
|
|
|
220
220
|
|
|
221
221
|
/* */
|
|
222
222
|
|
|
223
|
-
function extend (Vue
|
|
224
|
-
if (
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* if `bridge` mode is avialable, `$i18n` is defined at `vue-i18n-bridge`
|
|
228
|
-
*/
|
|
229
|
-
if (!bridge && !Vue.prototype.hasOwnProperty('$i18n')) {
|
|
223
|
+
function extend (Vue) {
|
|
224
|
+
if (!Vue.prototype.hasOwnProperty('$i18n')) {
|
|
230
225
|
// $FlowFixMe
|
|
231
226
|
Object.defineProperty(Vue.prototype, '$i18n', {
|
|
232
227
|
get: function get () { return this._i18n }
|
|
@@ -753,7 +748,7 @@ function install (_Vue, options) {
|
|
|
753
748
|
return
|
|
754
749
|
}
|
|
755
750
|
|
|
756
|
-
extend(Vue
|
|
751
|
+
extend(Vue);
|
|
757
752
|
Vue.mixin(defineMixin(options.bridge));
|
|
758
753
|
Vue.directive('t', { bind: bind, update: update, unbind: unbind });
|
|
759
754
|
Vue.component(interpolationComponent.name, interpolationComponent);
|
|
@@ -1383,14 +1378,28 @@ VueI18n.prototype.watchI18nData = function watchI18nData () {
|
|
|
1383
1378
|
}, { deep: true })
|
|
1384
1379
|
};
|
|
1385
1380
|
|
|
1386
|
-
VueI18n.prototype.watchLocale = function watchLocale () {
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1381
|
+
VueI18n.prototype.watchLocale = function watchLocale (composer) {
|
|
1382
|
+
if (!composer) {
|
|
1383
|
+
/* istanbul ignore if */
|
|
1384
|
+
if (!this._sync || !this._root) { return null }
|
|
1385
|
+
var target = this._vm;
|
|
1386
|
+
return this._root.$i18n.vm.$watch('locale', function (val) {
|
|
1387
|
+
target.$set(target, 'locale', val);
|
|
1388
|
+
target.$forceUpdate();
|
|
1389
|
+
}, { immediate: true })
|
|
1390
|
+
} else {
|
|
1391
|
+
// deal with vue-i18n-bridge
|
|
1392
|
+
if (!this.__VUE_I18N_BRIDGE__) { return null }
|
|
1393
|
+
var self = this;
|
|
1394
|
+
var target$1 = this._vm;
|
|
1395
|
+
return this.vm.$watch('locale', function (val) {
|
|
1396
|
+
target$1.$set(target$1, 'locale', val);
|
|
1397
|
+
if (self.__VUE_I18N_BRIDGE__ && composer) {
|
|
1398
|
+
composer.locale.value = val;
|
|
1399
|
+
}
|
|
1400
|
+
target$1.$forceUpdate();
|
|
1401
|
+
}, { immediate: true })
|
|
1402
|
+
}
|
|
1394
1403
|
};
|
|
1395
1404
|
|
|
1396
1405
|
VueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {
|
|
@@ -2248,6 +2257,6 @@ Object.defineProperty(VueI18n, 'availabilities', {
|
|
|
2248
2257
|
});
|
|
2249
2258
|
|
|
2250
2259
|
VueI18n.install = install;
|
|
2251
|
-
VueI18n.version = '8.26.
|
|
2260
|
+
VueI18n.version = '8.26.8';
|
|
2252
2261
|
|
|
2253
2262
|
export default VueI18n;
|
package/dist/vue-i18n.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v8.26.
|
|
2
|
+
* vue-i18n v8.26.8
|
|
3
3
|
* (c) 2021 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -226,13 +226,8 @@
|
|
|
226
226
|
|
|
227
227
|
/* */
|
|
228
228
|
|
|
229
|
-
function extend (Vue
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* if `bridge` mode is avialable, `$i18n` is defined at `vue-i18n-bridge`
|
|
234
|
-
*/
|
|
235
|
-
if (!bridge && !Vue.prototype.hasOwnProperty('$i18n')) {
|
|
229
|
+
function extend (Vue) {
|
|
230
|
+
if (!Vue.prototype.hasOwnProperty('$i18n')) {
|
|
236
231
|
// $FlowFixMe
|
|
237
232
|
Object.defineProperty(Vue.prototype, '$i18n', {
|
|
238
233
|
get: function get () { return this._i18n }
|
|
@@ -759,7 +754,7 @@
|
|
|
759
754
|
return
|
|
760
755
|
}
|
|
761
756
|
|
|
762
|
-
extend(Vue
|
|
757
|
+
extend(Vue);
|
|
763
758
|
Vue.mixin(defineMixin(options.bridge));
|
|
764
759
|
Vue.directive('t', { bind: bind, update: update, unbind: unbind });
|
|
765
760
|
Vue.component(interpolationComponent.name, interpolationComponent);
|
|
@@ -1389,14 +1384,28 @@
|
|
|
1389
1384
|
}, { deep: true })
|
|
1390
1385
|
};
|
|
1391
1386
|
|
|
1392
|
-
VueI18n.prototype.watchLocale = function watchLocale () {
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1387
|
+
VueI18n.prototype.watchLocale = function watchLocale (composer) {
|
|
1388
|
+
if (!composer) {
|
|
1389
|
+
/* istanbul ignore if */
|
|
1390
|
+
if (!this._sync || !this._root) { return null }
|
|
1391
|
+
var target = this._vm;
|
|
1392
|
+
return this._root.$i18n.vm.$watch('locale', function (val) {
|
|
1393
|
+
target.$set(target, 'locale', val);
|
|
1394
|
+
target.$forceUpdate();
|
|
1395
|
+
}, { immediate: true })
|
|
1396
|
+
} else {
|
|
1397
|
+
// deal with vue-i18n-bridge
|
|
1398
|
+
if (!this.__VUE_I18N_BRIDGE__) { return null }
|
|
1399
|
+
var self = this;
|
|
1400
|
+
var target$1 = this._vm;
|
|
1401
|
+
return this.vm.$watch('locale', function (val) {
|
|
1402
|
+
target$1.$set(target$1, 'locale', val);
|
|
1403
|
+
if (self.__VUE_I18N_BRIDGE__ && composer) {
|
|
1404
|
+
composer.locale.value = val;
|
|
1405
|
+
}
|
|
1406
|
+
target$1.$forceUpdate();
|
|
1407
|
+
}, { immediate: true })
|
|
1408
|
+
}
|
|
1400
1409
|
};
|
|
1401
1410
|
|
|
1402
1411
|
VueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {
|
|
@@ -2254,7 +2263,7 @@
|
|
|
2254
2263
|
});
|
|
2255
2264
|
|
|
2256
2265
|
VueI18n.install = install;
|
|
2257
|
-
VueI18n.version = '8.26.
|
|
2266
|
+
VueI18n.version = '8.26.8';
|
|
2258
2267
|
|
|
2259
2268
|
return VueI18n;
|
|
2260
2269
|
|
package/dist/vue-i18n.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-i18n v8.26.
|
|
2
|
+
* vue-i18n v8.26.8
|
|
3
3
|
* (c) 2021 kazuya kawaguchi
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var t,e;t=this,e=function(){"use strict";var t=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}var n=Array.isArray;function r(t){return null!==t&&"object"==typeof t}function a(t){return"string"==typeof t}var i=Object.prototype.toString,o="[object Object]";function s(t){return i.call(t)===o}function l(t){return null==t}function c(t){return"function"==typeof t}function u(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var a=null,i=null;return 1===t.length?r(t[0])||n(t[0])?i=t[0]:"string"==typeof t[0]&&(a=t[0]):2===t.length&&("string"==typeof t[0]&&(a=t[0]),(r(t[1])||n(t[1]))&&(i=t[1])),{locale:a,params:i}}function h(t){return JSON.parse(JSON.stringify(t))}function f(t,e){return!!~t.indexOf(e)}var p=Object.prototype.hasOwnProperty;function _(t,e){return p.call(t,e)}function m(t){for(var e=arguments,n=Object(t),a=1;a<arguments.length;a++){var i=e[a];if(null!=i){var o=void 0;for(o in i)_(i,o)&&(r(i[o])?n[o]=m(n[o],i[o]):n[o]=i[o])}}return n}function g(t,e){if(t===e)return!0;var a=r(t),i=r(e);if(!a||!i)return!a&&!i&&String(t)===String(e);try{var o=n(t),s=n(e);if(o&&s)return t.length===e.length&&t.every(function(t,n){return g(t,e[n])});if(o||s)return!1;var l=Object.keys(t),c=Object.keys(e);return l.length===c.length&&l.every(function(n){return g(t[n],e[n])})}catch(t){return!1}}var v={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.data,r=e.parent,a=e.props,i=e.slots,o=r.$i18n;if(o){var s=a.path,l=a.locale,c=a.places,u=i(),h=o.i(s,l,function(t){var e;for(e in t)if("default"!==e)return!1;return Boolean(e)}(u)||c?function(t,e){var n=e?function(t){return Array.isArray(t)?t.reduce(b,{}):Object.assign({},t)}(e):{};if(!t)return n;var r=(t=t.filter(function(t){return t.tag||""!==t.text.trim()})).every(y);return t.reduce(r?d:b,n)}(u.default,c):u),f=a.tag&&!0!==a.tag||!1===a.tag?a.tag:"span";return f?t(f,n,h):h}}};function d(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function b(t,e,n){return t[n]=e,t}function y(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var F,k={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(e,n){var i=n.props,o=n.parent,s=n.data,l=o.$i18n;if(!l)return null;var c=null,u=null;a(i.format)?c=i.format:r(i.format)&&(i.format.key&&(c=i.format.key),u=Object.keys(i.format).reduce(function(e,n){var r;return f(t,n)?Object.assign({},e,((r={})[n]=i.format[n],r)):e},null));var h=i.locale||l.locale,p=l._ntp(i.value,h,c,u),_=p.map(function(t,e){var n,r=s.scopedSlots&&s.scopedSlots[t.type];return r?r(((n={})[t.type]=t.value,n.index=e,n.parts=p,n)):t.value}),m=i.tag&&!0!==i.tag||!1===i.tag?i.tag:"span";return m?e(m,{attrs:s.attrs,class:s.class,staticClass:s.staticClass},_):_}};function w(t,e,n){T(t,n)&&C(t,e,n)}function $(t,e,n,r){if(T(t,n)){var a=n.context.$i18n;(function(t,e){var n=e.context;return t._locale===n.$i18n.locale})(t,n)&&g(e.value,e.oldValue)&&g(t._localeMessage,a.getLocaleMessage(a.locale))||C(t,e,n)}}function M(t,n,r,a){if(r.context){var i=r.context.$i18n||{};n.modifiers.preserve||i.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t._vt,t._locale=void 0,delete t._locale,t._localeMessage=void 0,delete t._localeMessage}else e("Vue instance does not exists in VNode context")}function T(t,n){var r=n.context;return r?!!r.$i18n||(e("VueI18n instance does not exists in Vue instance"),!1):(e("Vue instance does not exists in VNode context"),!1)}function C(t,n,r){var i,o,l=function(t){var e,n,r,i;a(t)?e=t:s(t)&&(e=t.path,n=t.locale,r=t.args,i=t.choice);return{path:e,locale:n,args:r,choice:i}}(n.value),c=l.path,u=l.locale,h=l.args,f=l.choice;if(c||u||h)if(c){var p=r.context;t._vt=t.textContent=null!=f?(i=p.$i18n).tc.apply(i,[c,f].concat(I(u,h))):(o=p.$i18n).t.apply(o,[c].concat(I(u,h))),t._locale=p.$i18n.locale,t._localeMessage=p.$i18n.getLocaleMessage(p.$i18n.locale)}else e("`path` is required in v-t directive");else e("value type not supported")}function I(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||s(e))&&n.push(e),n}function L(t,e){void 0===e&&(e={bridge:!1}),L.installed=!0;(F=t).version&&Number(F.version.split(".")[0]);!function(t,e){void 0===e&&(e=!1),e||t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get:function(){return this._i18n}}),t.prototype.$t=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var a=this.$i18n;return a._tc.apply(a,[t,a.locale,a._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}(F,e.bridge),F.mixin(function(t){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return void 0===t&&(t=!1),t?{mounted:e}:{beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n){if(t.i18n instanceof et){if(t.__i18nBridge||t.__i18n)try{var e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(function(t){e=m(e,JSON.parse(t))}),Object.keys(e).forEach(function(n){t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(s(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{var r=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(function(t){r=m(r,JSON.parse(t))}),t.i18n.messages=r}catch(t){}var a=t.i18n.sharedMessages;a&&s(a)&&(t.i18n.messages=m(t.i18n.messages,a)),this._i18n=new et(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof et&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?t.i18n instanceof et?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):s(t.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof et&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick(function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)})}}}}(e.bridge)),F.directive("t",{bind:w,update:$,unbind:M}),F.component(v.name,v),F.component(k.name,k),F.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var D=function(){this._caches=Object.create(null)};D.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=function(t){var e=[],n=0,r="";for(;n<t.length;){var a=t[n++];if("{"===a){r&&e.push({type:"text",value:r}),r="";var i="";for(a=t[n++];void 0!==a&&"}"!==a;)i+=a,a=t[n++];var o="}"===a,s=O.test(i)?"list":o&&x.test(i)?"named":"unknown";e.push({value:i,type:s})}else"%"===a?"{"!==t[n]&&(r+=a):r+=a}return r&&e.push({type:"text",value:r}),e}(t),this._caches[t]=n),function(t,e){var n=[],a=0,i=Array.isArray(e)?"list":r(e)?"named":"unknown";if("unknown"===i)return n;for(;a<t.length;){var o=t[a];switch(o.type){case"text":n.push(o.value);break;case"list":n.push(e[parseInt(o.value,10)]);break;case"named":"named"===i&&n.push(e[o.value])}a++}return n}(n,e)};var O=/^(?:\d)+/,x=/^(?:\w)+/,j=0,N=1,W=2,S=3,E=0,R=4,H=5,P=6,V=7,A=8,B=[];B[E]={ws:[E],ident:[3,j],"[":[R],eof:[V]},B[1]={ws:[1],".":[2],"[":[R],eof:[V]},B[2]={ws:[2],ident:[3,j],0:[3,j],number:[3,j]},B[3]={ident:[3,j],0:[3,j],number:[3,j],ws:[1,N],".":[2,N],"[":[R,N],eof:[V,N]},B[R]={"'":[H,j],'"':[P,j],"[":[R,W],"]":[1,S],eof:A,else:[R,j]},B[H]={"'":[R,j],eof:A,else:[H,j]},B[P]={'"':[R,j],eof:A,else:[P,j]};var z=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function U(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function q(t){var e,n,r,a=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(r=a,z.test(r)?(n=(e=a).charCodeAt(0))!==e.charCodeAt(e.length-1)||34!==n&&39!==n?e:e.slice(1,-1):"*"+a)}var J=function(){this._cache=Object.create(null)};J.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=function(t){var e,n,r,a,i,o,s,l=[],c=-1,u=E,h=0,f=[];function p(){var e=t[c+1];if(u===H&&"'"===e||u===P&&'"'===e)return c++,r="\\"+e,f[j](),!0}for(f[N]=function(){void 0!==n&&(l.push(n),n=void 0)},f[j]=function(){void 0===n?n=r:n+=r},f[W]=function(){f[j](),h++},f[S]=function(){if(h>0)h--,u=R,f[j]();else{if(h=0,void 0===n)return!1;if(!1===(n=q(n)))return!1;f[N]()}};null!==u;)if("\\"!==(e=t[++c])||!p()){if(a=U(e),(i=(s=B[u])[a]||s.else||A)===A)return;if(u=i[0],(o=f[i[1]])&&(r=void 0===(r=i[2])?e:r,!1===o()))return;if(u===V)return l}}(t))&&(this._cache[t]=e),e||[]},J.prototype.getPathValue=function(t,e){if(!r(t))return null;var n=this.parsePath(e);if(0===n.length)return null;for(var a=n.length,i=t,o=0;o<a;){var s=i[n[o]];if(null==s)return null;i=s,o++}return i};var G,Y=/<\/?[\w\s="/.':;#-\/]+>/,X=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|./]+|\([\w\-_|./]+\)))/g,Z=/^@(?:\.([a-z]+))?:/,K=/[()]/g,Q={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},tt=new D,et=function(t){var e=this;void 0===t&&(t={}),!F&&"undefined"!=typeof window&&window.Vue&&L(window.Vue);var n=t.locale||"en-US",r=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),a=t.messages||{},i=t.dateTimeFormats||t.datetimeFormats||{},o=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||tt,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new J,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(t,n){var r=Object.getPrototypeOf(e);if(r&&r.getChoiceIndex)return r.getChoiceIndex.call(e,t,n);var a,i;return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):(a=t,i=n,a=Math.abs(a),2===i?a?a>1?1:0:1:a?Math.min(a,2):0)},this._exist=function(t,n){return!(!t||!n)&&(!l(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(a).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,a[t])}),this._initVM({locale:n,fallbackLocale:r,messages:a,dateTimeFormats:i,numberFormats:o})},nt={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};return et.prototype._checkLocaleMessage=function(t,r,i){var o=function(t,r,i,l){if(s(i))Object.keys(i).forEach(function(e){var n=i[e];s(n)?(l.push(e),l.push("."),o(t,r,n,l),l.pop(),l.pop()):(l.push(e),o(t,r,n,l),l.pop())});else if(n(i))i.forEach(function(e,n){s(e)?(l.push("["+n+"]"),l.push("."),o(t,r,e,l),l.pop(),l.pop()):(l.push("["+n+"]"),o(t,r,e,l),l.pop())});else if(a(i)){if(Y.test(i)){var c="Detected HTML in message '"+i+"' of keypath '"+l.join("")+"' at '"+r+"'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?e(c):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(c)}}};o(r,t,i,[])},et.prototype._initVM=function(t){var e=F.config.silent;F.config.silent=!0,this._vm=new F({data:t,__VUE18N__INSTANCE__:!0}),F.config.silent=e},et.prototype.destroyVM=function(){this._vm.$destroy()},et.prototype.subscribeDataChanging=function(t){this._dataListeners.add(t)},et.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)},et.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e,n,r=(e=t._dataListeners,n=[],e.forEach(function(t){return n.push(t)}),n),a=r.length;a--;)F.nextTick(function(){r[a]&&r[a].$forceUpdate()})},{deep:!0})},et.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(e){t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})},et.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},nt.vm.get=function(){return this._vm},nt.messages.get=function(){return h(this._getMessages())},nt.dateTimeFormats.get=function(){return h(this._getDateTimeFormats())},nt.numberFormats.get=function(){return h(this._getNumberFormats())},nt.availableLocales.get=function(){return Object.keys(this.messages).sort()},nt.locale.get=function(){return this._vm.locale},nt.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},nt.fallbackLocale.get=function(){return this._vm.fallbackLocale},nt.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},nt.formatFallbackMessages.get=function(){return this._formatFallbackMessages},nt.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},nt.missing.get=function(){return this._missing},nt.missing.set=function(t){this._missing=t},nt.formatter.get=function(){return this._formatter},nt.formatter.set=function(t){this._formatter=t},nt.silentTranslationWarn.get=function(){return this._silentTranslationWarn},nt.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},nt.silentFallbackWarn.get=function(){return this._silentFallbackWarn},nt.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},nt.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},nt.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},nt.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},nt.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},nt.postTranslation.get=function(){return this._postTranslation},nt.postTranslation.set=function(t){this._postTranslation=t},nt.sync.get=function(){return this._sync},nt.sync.set=function(t){this._sync=t},et.prototype._getMessages=function(){return this._vm.messages},et.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},et.prototype._getNumberFormats=function(){return this._vm.numberFormats},et.prototype._warnDefault=function(t,e,n,r,i,o){if(!l(n))return n;if(this._missing){var s=this._missing.apply(null,[t,e,r,i]);if(a(s))return s}if(this._formatFallbackMessages){var c=u.apply(void 0,i);return this._render(e,o,c.params,e)}return e},et.prototype._isFallbackRoot=function(t){return!t&&!l(this._root)&&this._fallbackRoot},et.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},et.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},et.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},et.prototype._interpolate=function(t,e,r,i,o,u,h){if(!e)return null;var f,p=this._path.getPathValue(e,r);if(n(p)||s(p))return p;if(l(p)){if(!s(e))return null;if(!a(f=e[r])&&!c(f))return null}else{if(!a(p)&&!c(p))return null;f=p}return a(f)&&(f.indexOf("@:")>=0||f.indexOf("@.")>=0)&&(f=this._link(t,e,f,i,"raw",u,h)),this._render(f,o,u,r)},et.prototype._link=function(t,e,r,a,i,o,s){var l=r,c=l.match(X);for(var u in c)if(c.hasOwnProperty(u)){var h=c[u],p=h.match(Z),_=p[0],m=p[1],g=h.replace(_,"").replace(K,"");if(f(s,g))return l;s.push(g);var v=this._interpolate(t,e,g,a,"raw"===i?"string":i,"raw"===i?void 0:o,s);if(this._isFallbackRoot(v)){if(!this._root)throw Error("unexpected error");var d=this._root.$i18n;v=d._translate(d._getMessages(),d.locale,d.fallbackLocale,g,a,i,o)}v=this._warnDefault(t,g,v,a,n(o)?o:[o],i),this._modifiers.hasOwnProperty(m)?v=this._modifiers[m](v):Q.hasOwnProperty(m)&&(v=Q[m](v)),s.pop(),l=v?l.replace(h,v):l}return l},et.prototype._createMessageContext=function(t,e,a,i){var o=this,s=n(t)?t:[],l=r(t)?t:{},c=this._getMessages(),u=this.locale;return{list:function(t){return s[t]},named:function(t){return l[t]},values:t,formatter:e,path:a,messages:c,locale:u,linked:function(t){return o._interpolate(u,c[u]||{},t,null,i,void 0,[t])}}},et.prototype._render=function(t,e,n,r){if(c(t))return t(this._createMessageContext(n,this._formatter||tt,r,e));var i=this._formatter.interpolate(t,n,r);return i||(i=tt.interpolate(t,n,r)),"string"!==e||a(i)?i:i.join("")},et.prototype._appendItemToChain=function(t,e,n){var r=!1;return f(t,e)||(r=!0,e&&(r="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(r=n[e]))),r},et.prototype._appendLocaleToChain=function(t,e,n){var r,a=e.split("-");do{var i=a.join("-");r=this._appendItemToChain(t,i,n),a.splice(-1,1)}while(a.length&&!0===r);return r},et.prototype._appendBlockToChain=function(t,e,n){for(var r=!0,i=0;i<e.length&&"boolean"==typeof r;i++){var o=e[i];a(o)&&(r=this._appendLocaleToChain(t,o,n))}return r},et.prototype._getLocaleChain=function(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});var i=this._localeChainCache[t];if(!i){e||(e=this.fallbackLocale),i=[];for(var o,s=[t];n(s);)s=this._appendBlockToChain(i,s,e);(s=a(o=n(e)?e:r(e)?e.default?e.default:null:e)?[o]:o)&&this._appendBlockToChain(i,s,null),this._localeChainCache[t]=i}return i},et.prototype._translate=function(t,e,n,r,a,i,o){for(var s,c=this._getLocaleChain(e,n),u=0;u<c.length;u++){var h=c[u];if(!l(s=this._interpolate(h,t[h],r,a,i,o,[r])))return s}return null},et.prototype._t=function(t,e,n,r){for(var a,i=[],o=arguments.length-4;o-- >0;)i[o]=arguments[o+4];if(!t)return"";var s,l=u.apply(void 0,i);this._escapeParameterHtml&&(l.params=(null!=(s=l.params)&&Object.keys(s).forEach(function(t){"string"==typeof s[t]&&(s[t]=s[t].replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))}),s));var c=l.locale||e,h=this._translate(n,c,this.fallbackLocale,t,r,"string",l.params);if(this._isFallbackRoot(h)){if(!this._root)throw Error("unexpected error");return(a=this._root).$t.apply(a,[t].concat(i))}return h=this._warnDefault(c,t,h,r,i,"string"),this._postTranslation&&null!=h&&(h=this._postTranslation(h,t)),h},et.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},et.prototype._i=function(t,e,n,r,a){var i=this._translate(n,e,this.fallbackLocale,t,r,"raw",a);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,a)}return this._warnDefault(e,t,i,r,[a],"raw")},et.prototype.i=function(t,e,n){return t?(a(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},et.prototype._tc=function(t,e,n,r,a){for(var i,o=[],s=arguments.length-5;s-- >0;)o[s]=arguments[s+5];if(!t)return"";void 0===a&&(a=1);var l={count:a,n:a},c=u.apply(void 0,o);return c.params=Object.assign(l,c.params),o=null===c.locale?[c.params]:[c.locale,c.params],this.fetchChoice((i=this)._t.apply(i,[t,e,n,r].concat(o)),a)},et.prototype.fetchChoice=function(t,e){if(!t||!a(t))return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},et.prototype.tc=function(t,e){for(var n,r=[],a=arguments.length-2;a-- >0;)r[a]=arguments[a+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},et.prototype._te=function(t,e,n){for(var r=[],a=arguments.length-3;a-- >0;)r[a]=arguments[a+3];var i=u.apply(void 0,r).locale||e;return this._exist(n[i],t)},et.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},et.prototype.getLocaleMessage=function(t){return h(this._vm.messages[t]||{})},et.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},et.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,m(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))},et.prototype.getDateTimeFormat=function(t){return h(this._vm.dateTimeFormats[t]||{})},et.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},et.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,m(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},et.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},et.prototype._localizeDateTime=function(t,e,n,r,a){for(var i=e,o=r[i],s=this._getLocaleChain(e,n),c=0;c<s.length;c++){var u=s[c];if(i=u,!l(o=r[u])&&!l(o[a]))break}if(l(o)||l(o[a]))return null;var h=o[a],f=i+"__"+a,p=this._dateTimeFormatters[f];return p||(p=this._dateTimeFormatters[f]=new Intl.DateTimeFormat(i,h)),p.format(t)},et.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},et.prototype.d=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var i=this.locale,o=null;return 1===e.length?a(e[0])?o=e[0]:r(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(o=e[0].key)):2===e.length&&(a(e[0])&&(o=e[0]),a(e[1])&&(i=e[1])),this._d(t,i,o)},et.prototype.getNumberFormat=function(t){return h(this._vm.numberFormats[t]||{})},et.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},et.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,m(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},et.prototype._clearNumberFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._numberFormatters.hasOwnProperty(r)&&delete this._numberFormatters[r]}},et.prototype._getNumberFormatter=function(t,e,n,r,a,i){for(var o=e,s=r[o],c=this._getLocaleChain(e,n),u=0;u<c.length;u++){var h=c[u];if(o=h,!l(s=r[h])&&!l(s[a]))break}if(l(s)||l(s[a]))return null;var f,p=s[a];if(i)f=new Intl.NumberFormat(o,Object.assign({},p,i));else{var _=o+"__"+a;(f=this._numberFormatters[_])||(f=this._numberFormatters[_]=new Intl.NumberFormat(o,p))}return f},et.prototype._n=function(t,e,n,r){if(!et.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var a=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=a&&a.format(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return i||""},et.prototype.n=function(e){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var o=this.locale,s=null,l=null;return 1===n.length?a(n[0])?s=n[0]:r(n[0])&&(n[0].locale&&(o=n[0].locale),n[0].key&&(s=n[0].key),l=Object.keys(n[0]).reduce(function(e,r){var a;return f(t,r)?Object.assign({},e,((a={})[r]=n[0][r],a)):e},null)):2===n.length&&(a(n[0])&&(s=n[0]),a(n[1])&&(o=n[1])),this._n(e,o,s,l)},et.prototype._ntp=function(t,e,n,r){if(!et.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var a=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=a&&a.formatToParts(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return i||[]},Object.defineProperties(et.prototype,nt),Object.defineProperty(et,"availabilities",{get:function(){if(!G){var t="undefined"!=typeof Intl;G={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return G}}),et.install=L,et.version="8.26.4",et},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e();
|
|
6
|
+
var t,e;t=this,e=function(){"use strict";var t=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}var n=Array.isArray;function r(t){return null!==t&&"object"==typeof t}function a(t){return"string"==typeof t}var i=Object.prototype.toString,o="[object Object]";function s(t){return i.call(t)===o}function l(t){return null==t}function c(t){return"function"==typeof t}function u(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var a=null,i=null;return 1===t.length?r(t[0])||n(t[0])?i=t[0]:"string"==typeof t[0]&&(a=t[0]):2===t.length&&("string"==typeof t[0]&&(a=t[0]),(r(t[1])||n(t[1]))&&(i=t[1])),{locale:a,params:i}}function h(t){return JSON.parse(JSON.stringify(t))}function f(t,e){return!!~t.indexOf(e)}var p=Object.prototype.hasOwnProperty;function _(t,e){return p.call(t,e)}function m(t){for(var e=arguments,n=Object(t),a=1;a<arguments.length;a++){var i=e[a];if(null!=i){var o=void 0;for(o in i)_(i,o)&&(r(i[o])?n[o]=m(n[o],i[o]):n[o]=i[o])}}return n}function g(t,e){if(t===e)return!0;var a=r(t),i=r(e);if(!a||!i)return!a&&!i&&String(t)===String(e);try{var o=n(t),s=n(e);if(o&&s)return t.length===e.length&&t.every(function(t,n){return g(t,e[n])});if(o||s)return!1;var l=Object.keys(t),c=Object.keys(e);return l.length===c.length&&l.every(function(n){return g(t[n],e[n])})}catch(t){return!1}}var v={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.data,r=e.parent,a=e.props,i=e.slots,o=r.$i18n;if(o){var s=a.path,l=a.locale,c=a.places,u=i(),h=o.i(s,l,function(t){var e;for(e in t)if("default"!==e)return!1;return Boolean(e)}(u)||c?function(t,e){var n=e?function(t){return Array.isArray(t)?t.reduce(b,{}):Object.assign({},t)}(e):{};if(!t)return n;var r=(t=t.filter(function(t){return t.tag||""!==t.text.trim()})).every(y);return t.reduce(r?d:b,n)}(u.default,c):u),f=a.tag&&!0!==a.tag||!1===a.tag?a.tag:"span";return f?t(f,n,h):h}}};function d(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function b(t,e,n){return t[n]=e,t}function y(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var F,k={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(e,n){var i=n.props,o=n.parent,s=n.data,l=o.$i18n;if(!l)return null;var c=null,u=null;a(i.format)?c=i.format:r(i.format)&&(i.format.key&&(c=i.format.key),u=Object.keys(i.format).reduce(function(e,n){var r;return f(t,n)?Object.assign({},e,((r={})[n]=i.format[n],r)):e},null));var h=i.locale||l.locale,p=l._ntp(i.value,h,c,u),_=p.map(function(t,e){var n,r=s.scopedSlots&&s.scopedSlots[t.type];return r?r(((n={})[t.type]=t.value,n.index=e,n.parts=p,n)):t.value}),m=i.tag&&!0!==i.tag||!1===i.tag?i.tag:"span";return m?e(m,{attrs:s.attrs,class:s.class,staticClass:s.staticClass},_):_}};function w(t,e,n){T(t,n)&&C(t,e,n)}function $(t,e,n,r){if(T(t,n)){var a=n.context.$i18n;(function(t,e){var n=e.context;return t._locale===n.$i18n.locale})(t,n)&&g(e.value,e.oldValue)&&g(t._localeMessage,a.getLocaleMessage(a.locale))||C(t,e,n)}}function M(t,n,r,a){if(r.context){var i=r.context.$i18n||{};n.modifiers.preserve||i.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t._vt,t._locale=void 0,delete t._locale,t._localeMessage=void 0,delete t._localeMessage}else e("Vue instance does not exists in VNode context")}function T(t,n){var r=n.context;return r?!!r.$i18n||(e("VueI18n instance does not exists in Vue instance"),!1):(e("Vue instance does not exists in VNode context"),!1)}function C(t,n,r){var i,o,l=function(t){var e,n,r,i;a(t)?e=t:s(t)&&(e=t.path,n=t.locale,r=t.args,i=t.choice);return{path:e,locale:n,args:r,choice:i}}(n.value),c=l.path,u=l.locale,h=l.args,f=l.choice;if(c||u||h)if(c){var p=r.context;t._vt=t.textContent=null!=f?(i=p.$i18n).tc.apply(i,[c,f].concat(I(u,h))):(o=p.$i18n).t.apply(o,[c].concat(I(u,h))),t._locale=p.$i18n.locale,t._localeMessage=p.$i18n.getLocaleMessage(p.$i18n.locale)}else e("`path` is required in v-t directive");else e("value type not supported")}function I(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||s(e))&&n.push(e),n}function D(t,e){void 0===e&&(e={bridge:!1}),D.installed=!0;(F=t).version&&Number(F.version.split(".")[0]);!function(t){t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get:function(){return this._i18n}}),t.prototype.$t=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var a=this.$i18n;return a._tc.apply(a,[t,a.locale,a._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}(F),F.mixin(function(t){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return void 0===t&&(t=!1),t?{mounted:e}:{beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n){if(t.i18n instanceof et){if(t.__i18nBridge||t.__i18n)try{var e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(function(t){e=m(e,JSON.parse(t))}),Object.keys(e).forEach(function(n){t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(s(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{var r=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(function(t){r=m(r,JSON.parse(t))}),t.i18n.messages=r}catch(t){}var a=t.i18n.sharedMessages;a&&s(a)&&(t.i18n.messages=m(t.i18n.messages,a)),this._i18n=new et(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof et&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?t.i18n instanceof et?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):s(t.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof et?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof et&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick(function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)})}}}}(e.bridge)),F.directive("t",{bind:w,update:$,unbind:M}),F.component(v.name,v),F.component(k.name,k),F.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var L=function(){this._caches=Object.create(null)};L.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=function(t){var e=[],n=0,r="";for(;n<t.length;){var a=t[n++];if("{"===a){r&&e.push({type:"text",value:r}),r="";var i="";for(a=t[n++];void 0!==a&&"}"!==a;)i+=a,a=t[n++];var o="}"===a,s=O.test(i)?"list":o&&x.test(i)?"named":"unknown";e.push({value:i,type:s})}else"%"===a?"{"!==t[n]&&(r+=a):r+=a}return r&&e.push({type:"text",value:r}),e}(t),this._caches[t]=n),function(t,e){var n=[],a=0,i=Array.isArray(e)?"list":r(e)?"named":"unknown";if("unknown"===i)return n;for(;a<t.length;){var o=t[a];switch(o.type){case"text":n.push(o.value);break;case"list":n.push(e[parseInt(o.value,10)]);break;case"named":"named"===i&&n.push(e[o.value])}a++}return n}(n,e)};var O=/^(?:\d)+/,x=/^(?:\w)+/,N=0,j=1,W=2,E=3,S=0,R=4,V=5,H=6,P=7,A=8,B=[];B[S]={ws:[S],ident:[3,N],"[":[R],eof:[P]},B[1]={ws:[1],".":[2],"[":[R],eof:[P]},B[2]={ws:[2],ident:[3,N],0:[3,N],number:[3,N]},B[3]={ident:[3,N],0:[3,N],number:[3,N],ws:[1,j],".":[2,j],"[":[R,j],eof:[P,j]},B[R]={"'":[V,N],'"':[H,N],"[":[R,W],"]":[1,E],eof:A,else:[R,N]},B[V]={"'":[R,N],eof:A,else:[V,N]},B[H]={'"':[R,N],eof:A,else:[H,N]};var U=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function z(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function G(t){var e,n,r,a=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(r=a,U.test(r)?(n=(e=a).charCodeAt(0))!==e.charCodeAt(e.length-1)||34!==n&&39!==n?e:e.slice(1,-1):"*"+a)}var q=function(){this._cache=Object.create(null)};q.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=function(t){var e,n,r,a,i,o,s,l=[],c=-1,u=S,h=0,f=[];function p(){var e=t[c+1];if(u===V&&"'"===e||u===H&&'"'===e)return c++,r="\\"+e,f[N](),!0}for(f[j]=function(){void 0!==n&&(l.push(n),n=void 0)},f[N]=function(){void 0===n?n=r:n+=r},f[W]=function(){f[N](),h++},f[E]=function(){if(h>0)h--,u=R,f[N]();else{if(h=0,void 0===n)return!1;if(!1===(n=G(n)))return!1;f[j]()}};null!==u;)if("\\"!==(e=t[++c])||!p()){if(a=z(e),(i=(s=B[u])[a]||s.else||A)===A)return;if(u=i[0],(o=f[i[1]])&&(r=void 0===(r=i[2])?e:r,!1===o()))return;if(u===P)return l}}(t))&&(this._cache[t]=e),e||[]},q.prototype.getPathValue=function(t,e){if(!r(t))return null;var n=this.parsePath(e);if(0===n.length)return null;for(var a=n.length,i=t,o=0;o<a;){var s=i[n[o]];if(null==s)return null;i=s,o++}return i};var J,Y=/<\/?[\w\s="/.':;#-\/]+>/,X=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|./]+|\([\w\-_|./]+\)))/g,Z=/^@(?:\.([a-z]+))?:/,K=/[()]/g,Q={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},tt=new L,et=function(t){var e=this;void 0===t&&(t={}),!F&&"undefined"!=typeof window&&window.Vue&&D(window.Vue);var n=t.locale||"en-US",r=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),a=t.messages||{},i=t.dateTimeFormats||t.datetimeFormats||{},o=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||tt,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new q,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(t,n){var r=Object.getPrototypeOf(e);if(r&&r.getChoiceIndex)return r.getChoiceIndex.call(e,t,n);var a,i;return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):(a=t,i=n,a=Math.abs(a),2===i?a?a>1?1:0:1:a?Math.min(a,2):0)},this._exist=function(t,n){return!(!t||!n)&&(!l(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(a).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,a[t])}),this._initVM({locale:n,fallbackLocale:r,messages:a,dateTimeFormats:i,numberFormats:o})},nt={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};return et.prototype._checkLocaleMessage=function(t,r,i){var o=function(t,r,i,l){if(s(i))Object.keys(i).forEach(function(e){var n=i[e];s(n)?(l.push(e),l.push("."),o(t,r,n,l),l.pop(),l.pop()):(l.push(e),o(t,r,n,l),l.pop())});else if(n(i))i.forEach(function(e,n){s(e)?(l.push("["+n+"]"),l.push("."),o(t,r,e,l),l.pop(),l.pop()):(l.push("["+n+"]"),o(t,r,e,l),l.pop())});else if(a(i)){if(Y.test(i)){var c="Detected HTML in message '"+i+"' of keypath '"+l.join("")+"' at '"+r+"'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?e(c):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(c)}}};o(r,t,i,[])},et.prototype._initVM=function(t){var e=F.config.silent;F.config.silent=!0,this._vm=new F({data:t,__VUE18N__INSTANCE__:!0}),F.config.silent=e},et.prototype.destroyVM=function(){this._vm.$destroy()},et.prototype.subscribeDataChanging=function(t){this._dataListeners.add(t)},et.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)},et.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e,n,r=(e=t._dataListeners,n=[],e.forEach(function(t){return n.push(t)}),n),a=r.length;a--;)F.nextTick(function(){r[a]&&r[a].$forceUpdate()})},{deep:!0})},et.prototype.watchLocale=function(t){if(t){if(!this.__VUE_I18N_BRIDGE__)return null;var e=this,n=this._vm;return this.vm.$watch("locale",function(r){n.$set(n,"locale",r),e.__VUE_I18N_BRIDGE__&&t&&(t.locale.value=r),n.$forceUpdate()},{immediate:!0})}if(!this._sync||!this._root)return null;var r=this._vm;return this._root.$i18n.vm.$watch("locale",function(t){r.$set(r,"locale",t),r.$forceUpdate()},{immediate:!0})},et.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},nt.vm.get=function(){return this._vm},nt.messages.get=function(){return h(this._getMessages())},nt.dateTimeFormats.get=function(){return h(this._getDateTimeFormats())},nt.numberFormats.get=function(){return h(this._getNumberFormats())},nt.availableLocales.get=function(){return Object.keys(this.messages).sort()},nt.locale.get=function(){return this._vm.locale},nt.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},nt.fallbackLocale.get=function(){return this._vm.fallbackLocale},nt.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},nt.formatFallbackMessages.get=function(){return this._formatFallbackMessages},nt.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},nt.missing.get=function(){return this._missing},nt.missing.set=function(t){this._missing=t},nt.formatter.get=function(){return this._formatter},nt.formatter.set=function(t){this._formatter=t},nt.silentTranslationWarn.get=function(){return this._silentTranslationWarn},nt.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},nt.silentFallbackWarn.get=function(){return this._silentFallbackWarn},nt.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},nt.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},nt.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},nt.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},nt.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},nt.postTranslation.get=function(){return this._postTranslation},nt.postTranslation.set=function(t){this._postTranslation=t},nt.sync.get=function(){return this._sync},nt.sync.set=function(t){this._sync=t},et.prototype._getMessages=function(){return this._vm.messages},et.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},et.prototype._getNumberFormats=function(){return this._vm.numberFormats},et.prototype._warnDefault=function(t,e,n,r,i,o){if(!l(n))return n;if(this._missing){var s=this._missing.apply(null,[t,e,r,i]);if(a(s))return s}if(this._formatFallbackMessages){var c=u.apply(void 0,i);return this._render(e,o,c.params,e)}return e},et.prototype._isFallbackRoot=function(t){return!t&&!l(this._root)&&this._fallbackRoot},et.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},et.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},et.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},et.prototype._interpolate=function(t,e,r,i,o,u,h){if(!e)return null;var f,p=this._path.getPathValue(e,r);if(n(p)||s(p))return p;if(l(p)){if(!s(e))return null;if(!a(f=e[r])&&!c(f))return null}else{if(!a(p)&&!c(p))return null;f=p}return a(f)&&(f.indexOf("@:")>=0||f.indexOf("@.")>=0)&&(f=this._link(t,e,f,i,"raw",u,h)),this._render(f,o,u,r)},et.prototype._link=function(t,e,r,a,i,o,s){var l=r,c=l.match(X);for(var u in c)if(c.hasOwnProperty(u)){var h=c[u],p=h.match(Z),_=p[0],m=p[1],g=h.replace(_,"").replace(K,"");if(f(s,g))return l;s.push(g);var v=this._interpolate(t,e,g,a,"raw"===i?"string":i,"raw"===i?void 0:o,s);if(this._isFallbackRoot(v)){if(!this._root)throw Error("unexpected error");var d=this._root.$i18n;v=d._translate(d._getMessages(),d.locale,d.fallbackLocale,g,a,i,o)}v=this._warnDefault(t,g,v,a,n(o)?o:[o],i),this._modifiers.hasOwnProperty(m)?v=this._modifiers[m](v):Q.hasOwnProperty(m)&&(v=Q[m](v)),s.pop(),l=v?l.replace(h,v):l}return l},et.prototype._createMessageContext=function(t,e,a,i){var o=this,s=n(t)?t:[],l=r(t)?t:{},c=this._getMessages(),u=this.locale;return{list:function(t){return s[t]},named:function(t){return l[t]},values:t,formatter:e,path:a,messages:c,locale:u,linked:function(t){return o._interpolate(u,c[u]||{},t,null,i,void 0,[t])}}},et.prototype._render=function(t,e,n,r){if(c(t))return t(this._createMessageContext(n,this._formatter||tt,r,e));var i=this._formatter.interpolate(t,n,r);return i||(i=tt.interpolate(t,n,r)),"string"!==e||a(i)?i:i.join("")},et.prototype._appendItemToChain=function(t,e,n){var r=!1;return f(t,e)||(r=!0,e&&(r="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(r=n[e]))),r},et.prototype._appendLocaleToChain=function(t,e,n){var r,a=e.split("-");do{var i=a.join("-");r=this._appendItemToChain(t,i,n),a.splice(-1,1)}while(a.length&&!0===r);return r},et.prototype._appendBlockToChain=function(t,e,n){for(var r=!0,i=0;i<e.length&&"boolean"==typeof r;i++){var o=e[i];a(o)&&(r=this._appendLocaleToChain(t,o,n))}return r},et.prototype._getLocaleChain=function(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});var i=this._localeChainCache[t];if(!i){e||(e=this.fallbackLocale),i=[];for(var o,s=[t];n(s);)s=this._appendBlockToChain(i,s,e);(s=a(o=n(e)?e:r(e)?e.default?e.default:null:e)?[o]:o)&&this._appendBlockToChain(i,s,null),this._localeChainCache[t]=i}return i},et.prototype._translate=function(t,e,n,r,a,i,o){for(var s,c=this._getLocaleChain(e,n),u=0;u<c.length;u++){var h=c[u];if(!l(s=this._interpolate(h,t[h],r,a,i,o,[r])))return s}return null},et.prototype._t=function(t,e,n,r){for(var a,i=[],o=arguments.length-4;o-- >0;)i[o]=arguments[o+4];if(!t)return"";var s,l=u.apply(void 0,i);this._escapeParameterHtml&&(l.params=(null!=(s=l.params)&&Object.keys(s).forEach(function(t){"string"==typeof s[t]&&(s[t]=s[t].replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))}),s));var c=l.locale||e,h=this._translate(n,c,this.fallbackLocale,t,r,"string",l.params);if(this._isFallbackRoot(h)){if(!this._root)throw Error("unexpected error");return(a=this._root).$t.apply(a,[t].concat(i))}return h=this._warnDefault(c,t,h,r,i,"string"),this._postTranslation&&null!=h&&(h=this._postTranslation(h,t)),h},et.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},et.prototype._i=function(t,e,n,r,a){var i=this._translate(n,e,this.fallbackLocale,t,r,"raw",a);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,a)}return this._warnDefault(e,t,i,r,[a],"raw")},et.prototype.i=function(t,e,n){return t?(a(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},et.prototype._tc=function(t,e,n,r,a){for(var i,o=[],s=arguments.length-5;s-- >0;)o[s]=arguments[s+5];if(!t)return"";void 0===a&&(a=1);var l={count:a,n:a},c=u.apply(void 0,o);return c.params=Object.assign(l,c.params),o=null===c.locale?[c.params]:[c.locale,c.params],this.fetchChoice((i=this)._t.apply(i,[t,e,n,r].concat(o)),a)},et.prototype.fetchChoice=function(t,e){if(!t||!a(t))return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},et.prototype.tc=function(t,e){for(var n,r=[],a=arguments.length-2;a-- >0;)r[a]=arguments[a+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},et.prototype._te=function(t,e,n){for(var r=[],a=arguments.length-3;a-- >0;)r[a]=arguments[a+3];var i=u.apply(void 0,r).locale||e;return this._exist(n[i],t)},et.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},et.prototype.getLocaleMessage=function(t){return h(this._vm.messages[t]||{})},et.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},et.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,m(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))},et.prototype.getDateTimeFormat=function(t){return h(this._vm.dateTimeFormats[t]||{})},et.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},et.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,m(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},et.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},et.prototype._localizeDateTime=function(t,e,n,r,a){for(var i=e,o=r[i],s=this._getLocaleChain(e,n),c=0;c<s.length;c++){var u=s[c];if(i=u,!l(o=r[u])&&!l(o[a]))break}if(l(o)||l(o[a]))return null;var h=o[a],f=i+"__"+a,p=this._dateTimeFormatters[f];return p||(p=this._dateTimeFormatters[f]=new Intl.DateTimeFormat(i,h)),p.format(t)},et.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},et.prototype.d=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var i=this.locale,o=null;return 1===e.length?a(e[0])?o=e[0]:r(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(o=e[0].key)):2===e.length&&(a(e[0])&&(o=e[0]),a(e[1])&&(i=e[1])),this._d(t,i,o)},et.prototype.getNumberFormat=function(t){return h(this._vm.numberFormats[t]||{})},et.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},et.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,m(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},et.prototype._clearNumberFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._numberFormatters.hasOwnProperty(r)&&delete this._numberFormatters[r]}},et.prototype._getNumberFormatter=function(t,e,n,r,a,i){for(var o=e,s=r[o],c=this._getLocaleChain(e,n),u=0;u<c.length;u++){var h=c[u];if(o=h,!l(s=r[h])&&!l(s[a]))break}if(l(s)||l(s[a]))return null;var f,p=s[a];if(i)f=new Intl.NumberFormat(o,Object.assign({},p,i));else{var _=o+"__"+a;(f=this._numberFormatters[_])||(f=this._numberFormatters[_]=new Intl.NumberFormat(o,p))}return f},et.prototype._n=function(t,e,n,r){if(!et.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var a=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=a&&a.format(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return i||""},et.prototype.n=function(e){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var o=this.locale,s=null,l=null;return 1===n.length?a(n[0])?s=n[0]:r(n[0])&&(n[0].locale&&(o=n[0].locale),n[0].key&&(s=n[0].key),l=Object.keys(n[0]).reduce(function(e,r){var a;return f(t,r)?Object.assign({},e,((a={})[r]=n[0][r],a)):e},null)):2===n.length&&(a(n[0])&&(s=n[0]),a(n[1])&&(o=n[1])),this._n(e,o,s,l)},et.prototype._ntp=function(t,e,n,r){if(!et.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var a=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=a&&a.formatToParts(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return i||[]},Object.defineProperties(et.prototype,nt),Object.defineProperty(et,"availabilities",{get:function(){if(!J){var t="undefined"!=typeof Intl;J={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return J}}),et.install=D,et.version="8.26.8",et},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-i18n",
|
|
3
3
|
"description": "Internationalization plugin for Vue.js",
|
|
4
|
-
"version": "8.26.
|
|
4
|
+
"version": "8.26.8",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"babel-plugin-istanbul": "^6.0.0",
|
|
37
37
|
"babel-preset-power-assert": "^3.0.0",
|
|
38
38
|
"buble": "^0.19.3",
|
|
39
|
-
"chromedriver": "^
|
|
39
|
+
"chromedriver": "^95.0.0",
|
|
40
40
|
"core-js": "^3.6.5",
|
|
41
41
|
"cross-env": "^7.0.2",
|
|
42
42
|
"cross-spawn": "^7.0.3",
|
package/src/extend.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/* @flow */
|
|
2
2
|
|
|
3
|
-
export default function extend (Vue: any
|
|
4
|
-
|
|
5
|
-
* if `bridge` mode is avialable, `$i18n` is defined at `vue-i18n-bridge`
|
|
6
|
-
*/
|
|
7
|
-
if (!bridge && !Vue.prototype.hasOwnProperty('$i18n')) {
|
|
3
|
+
export default function extend (Vue: any): void {
|
|
4
|
+
if (!Vue.prototype.hasOwnProperty('$i18n')) {
|
|
8
5
|
// $FlowFixMe
|
|
9
6
|
Object.defineProperty(Vue.prototype, '$i18n', {
|
|
10
7
|
get () { return this._i18n }
|
package/src/index.js
CHANGED
|
@@ -266,14 +266,28 @@ export default class VueI18n {
|
|
|
266
266
|
}, { deep: true })
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
watchLocale (): ?Function {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
269
|
+
watchLocale (composer?: any): ?Function {
|
|
270
|
+
if (!composer) {
|
|
271
|
+
/* istanbul ignore if */
|
|
272
|
+
if (!this._sync || !this._root) { return null }
|
|
273
|
+
const target: any = this._vm
|
|
274
|
+
return this._root.$i18n.vm.$watch('locale', (val) => {
|
|
275
|
+
target.$set(target, 'locale', val)
|
|
276
|
+
target.$forceUpdate()
|
|
277
|
+
}, { immediate: true })
|
|
278
|
+
} else {
|
|
279
|
+
// deal with vue-i18n-bridge
|
|
280
|
+
if (!this.__VUE_I18N_BRIDGE__) { return null }
|
|
281
|
+
const self = this
|
|
282
|
+
const target: any = this._vm
|
|
283
|
+
return this.vm.$watch('locale', (val) => {
|
|
284
|
+
target.$set(target, 'locale', val)
|
|
285
|
+
if (self.__VUE_I18N_BRIDGE__ && composer) {
|
|
286
|
+
composer.locale.value = val
|
|
287
|
+
}
|
|
288
|
+
target.$forceUpdate()
|
|
289
|
+
}, { immediate: true })
|
|
290
|
+
}
|
|
277
291
|
}
|
|
278
292
|
|
|
279
293
|
onComponentInstanceCreated (newI18n: I18n) {
|
package/src/install.js
CHANGED
|
@@ -24,7 +24,7 @@ export function install (_Vue, options = { bridge: false }) {
|
|
|
24
24
|
return
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
extend(Vue
|
|
27
|
+
extend(Vue)
|
|
28
28
|
Vue.mixin(defineMixin(options.bridge))
|
|
29
29
|
Vue.directive('t', { bind, update, unbind })
|
|
30
30
|
Vue.component(interpolationComponent.name, interpolationComponent)
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
export type Path = VueI18n.Path;
|
|
2
|
+
export type Locale = VueI18n.Locale;
|
|
3
|
+
export type FallbackLocale = VueI18n.FallbackLocale;
|
|
4
|
+
export type Values = VueI18n.Values;
|
|
5
|
+
export type Choice = VueI18n.Choice;
|
|
6
|
+
export type MessageContext = VueI18n.MessageContext;
|
|
7
|
+
export type MessageFunction = VueI18n.MessageFunction;
|
|
8
|
+
export type LocaleMessage = VueI18n.LocaleMessage;
|
|
9
|
+
export type LocaleMessageObject = VueI18n.LocaleMessageObject;
|
|
10
|
+
export type LocaleMessageArray = VueI18n.LocaleMessageArray;
|
|
11
|
+
export type LocaleMessages = VueI18n.LocaleMessages;
|
|
12
|
+
export type TranslateResult = VueI18n.TranslateResult;
|
|
13
|
+
export type DateTimeFormatOptions = VueI18n.DateTimeFormatOptions;
|
|
14
|
+
export type DateTimeFormat = VueI18n.DateTimeFormat;
|
|
15
|
+
export type DateTimeFormats = VueI18n.DateTimeFormats;
|
|
16
|
+
export type DateTimeFormatResult = VueI18n.DateTimeFormatResult;
|
|
17
|
+
export type NumberFormatOptions = VueI18n.NumberFormatOptions;
|
|
18
|
+
export type NumberFormat = VueI18n.NumberFormat;
|
|
19
|
+
export type NumberFormats = VueI18n.NumberFormats;
|
|
20
|
+
export type NumberFormatResult = VueI18n.NumberFormatResult;
|
|
21
|
+
export type NumberFormatToPartsResult = VueI18n.NumberFormatToPartsResult;
|
|
22
|
+
export type WarnHtmlInMessageLevel = VueI18n.WarnHtmlInMessageLevel;
|
|
23
|
+
export type Formatter = VueI18n.Formatter;
|
|
24
|
+
export type MissingHandler = VueI18n.MissingHandler;
|
|
25
|
+
export type PostTranslationHandler = VueI18n.PostTranslationHandler;
|
|
26
|
+
export type IntlAvailability = VueI18n.IntlAvailability;
|
|
27
|
+
export type I18nOptions = VueI18n.I18nOptions;
|
|
28
|
+
export type PluignOptions = VueI18n.PluignOptions
|
|
29
|
+
|
|
1
30
|
import Vue, { PluginFunction } from 'vue';
|
|
2
31
|
|
|
3
32
|
declare namespace VueI18n {
|
|
@@ -128,37 +157,10 @@ declare namespace VueI18n {
|
|
|
128
157
|
componentInstanceCreatedListener?: ComponentInstanceCreatedListener;
|
|
129
158
|
escapeParameterHtml?: boolean;
|
|
130
159
|
}
|
|
131
|
-
}
|
|
132
160
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
export type Values = VueI18n.Values;
|
|
137
|
-
export type Choice = VueI18n.Choice;
|
|
138
|
-
export type MessageContext = VueI18n.MessageContext;
|
|
139
|
-
export type MessageFunction = VueI18n.MessageFunction;
|
|
140
|
-
export type LocaleMessage = VueI18n.LocaleMessage;
|
|
141
|
-
export type LocaleMessageObject = VueI18n.LocaleMessageObject;
|
|
142
|
-
export type LocaleMessageArray = VueI18n.LocaleMessageArray;
|
|
143
|
-
export type LocaleMessages = VueI18n.LocaleMessages;
|
|
144
|
-
export type TranslateResult = VueI18n.TranslateResult;
|
|
145
|
-
export type DateTimeFormatOptions = VueI18n.DateTimeFormatOptions;
|
|
146
|
-
export type DateTimeFormat = VueI18n.DateTimeFormat;
|
|
147
|
-
export type DateTimeFormats = VueI18n.DateTimeFormats;
|
|
148
|
-
export type DateTimeFormatResult = VueI18n.DateTimeFormatResult;
|
|
149
|
-
export type NumberFormatOptions = VueI18n.NumberFormatOptions;
|
|
150
|
-
export type NumberFormat = VueI18n.NumberFormat;
|
|
151
|
-
export type NumberFormats = VueI18n.NumberFormats;
|
|
152
|
-
export type NumberFormatResult = VueI18n.NumberFormatResult;
|
|
153
|
-
export type NumberFormatToPartsResult = VueI18n.NumberFormatToPartsResult;
|
|
154
|
-
export type WarnHtmlInMessageLevel = VueI18n.WarnHtmlInMessageLevel;
|
|
155
|
-
export type Formatter = VueI18n.Formatter;
|
|
156
|
-
export type MissingHandler = VueI18n.MissingHandler;
|
|
157
|
-
export type PostTranslationHandler = VueI18n.PostTranslationHandler;
|
|
158
|
-
export type IntlAvailability = VueI18n.IntlAvailability;
|
|
159
|
-
export type I18nOptions = VueI18n.I18nOptions;
|
|
160
|
-
export type PluignOptions = {
|
|
161
|
-
bridge?: boolean
|
|
161
|
+
type PluignOptions = {
|
|
162
|
+
bridge?: boolean
|
|
163
|
+
}
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
export declare interface IVueI18n {
|
|
@@ -262,7 +264,7 @@ declare class VueI18n {
|
|
|
262
264
|
*/
|
|
263
265
|
getChoiceIndex: (choice: number, choicesLength: number) => number;
|
|
264
266
|
|
|
265
|
-
static install: PluginFunction<PluignOptions>;
|
|
267
|
+
static install: PluginFunction<VueI18n.PluignOptions>;
|
|
266
268
|
static version: string;
|
|
267
269
|
static availabilities: VueI18n.IntlAvailability;
|
|
268
270
|
}
|