gc_i18n 1.1.0 → 1.1.2
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/lib/gc_i18n.css +1 -1
- package/lib/gc_i18n.js +2170 -2840
- package/lib/gc_i18n.umd.cjs +10 -12
- package/package.json +3 -1
- package/packages/components/config.vue +147 -124
- package/packages/index.js +39 -6
- package/src/main.js +2 -3
- package/src/view/BOATNOTICE.vue +1 -1
- package/src/view/Home.vue +4 -2
- package/vite.config.js +10 -2
package/lib/gc_i18n.umd.cjs
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var y=function(){function o(m){s(this,o),this.sourceStr=m,this.subCombos=o.parseComboStr(m),this.keyNames=this.subCombos.reduce(function(l,u){return l.concat(u)},[])}return r(o,[{key:"check",value:function(l){for(var u=0,_=0;_<this.subCombos.length;_+=1)if(u=this._checkSubCombo(this.subCombos[_],u,l),u===-1)return!1;return!0}},{key:"isEqual",value:function(l){if(!l||typeof l!="string"&&n(l)!=="object"||(typeof l=="string"&&(l=new o(l)),this.subCombos.length!==l.subCombos.length))return!1;for(var u=0;u<this.subCombos.length;u+=1)if(this.subCombos[u].length!==l.subCombos[u].length)return!1;for(var _=0;_<this.subCombos.length;_+=1){for(var E=this.subCombos[_],p=l.subCombos[_].slice(0),I=0;I<E.length;I+=1){var R=E[I],w=p.indexOf(R);w>-1&&p.splice(w,1)}if(p.length!==0)return!1}return!0}},{key:"_checkSubCombo",value:function(l,u,_){l=l.slice(0),_=_.slice(u);for(var E=u,p=0;p<l.length;p+=1){var I=l[p];if(I[0]==="\\"){var R=I.slice(1);(R===o.comboDeliminator||R===o.keyDeliminator)&&(I=R)}var w=_.indexOf(I);if(w>-1&&(l.splice(p,1),p-=1,w>E&&(E=w),l.length===0))return E}return-1}}]),o}();y.comboDeliminator=">",y.keyDeliminator="+",y.parseComboStr=function(o){for(var m=y._splitStr(o,y.comboDeliminator),l=[],u=0;u<m.length;u+=1)l.push(y._splitStr(m[u],y.keyDeliminator));return l},y._splitStr=function(o,m){for(var l=o,u=m,_="",E=[],p=0;p<l.length;p+=1)p>0&&l[p]===u&&l[p-1]!=="\\"&&(E.push(_.trim()),_="",p+=1),_+=l[p];return _&&E.push(_.trim()),E};var O=function(){function o(m){s(this,o),this.localeName=m,this.activeTargetKeys=[],this.pressedKeys=[],this._appliedMacros=[],this._keyMap={},this._killKeyCodes=[],this._macros=[]}return r(o,[{key:"bindKeyCode",value:function(l,u){typeof u=="string"&&(u=[u]),this._keyMap[l]=u}},{key:"bindMacro",value:function(l,u){typeof u=="string"&&(u=[u]);var _=null;typeof u=="function"&&(_=u,u=null);var E={keyCombo:new y(l),keyNames:u,handler:_};this._macros.push(E)}},{key:"getKeyCodes",value:function(l){var u=[];for(var _ in this._keyMap){var E=this._keyMap[_].indexOf(l);E>-1&&u.push(_|0)}return u}},{key:"getKeyNames",value:function(l){return this._keyMap[l]||[]}},{key:"setKillKey",value:function(l){if(typeof l=="string"){for(var u=this.getKeyCodes(l),_=0;_<u.length;_+=1)this.setKillKey(u[_]);return}this._killKeyCodes.push(l)}},{key:"pressKey",value:function(l){if(typeof l=="string"){for(var u=this.getKeyCodes(l),_=0;_<u.length;_+=1)this.pressKey(u[_]);return}this.activeTargetKeys.length=0;for(var E=this.getKeyNames(l),p=0;p<E.length;p+=1)this.activeTargetKeys.push(E[p]),this.pressedKeys.indexOf(E[p])===-1&&this.pressedKeys.push(E[p]);this._applyMacros()}},{key:"releaseKey",value:function(l){if(typeof l=="string")for(var u=this.getKeyCodes(l),_=0;_<u.length;_+=1)this.releaseKey(u[_]);else{var E=this.getKeyNames(l),p=this._killKeyCodes.indexOf(l);if(p!==-1)this.pressedKeys.length=0;else for(var I=0;I<E.length;I+=1){var R=this.pressedKeys.indexOf(E[I]);R>-1&&this.pressedKeys.splice(R,1)}this.activeTargetKeys.length=0,this._clearMacros()}}},{key:"_applyMacros",value:function(){for(var l=this._macros.slice(0),u=0;u<l.length;u+=1){var _=l[u];if(_.keyCombo.check(this.pressedKeys)){_.handler&&(_.keyNames=_.handler(this.pressedKeys));for(var E=0;E<_.keyNames.length;E+=1)this.pressedKeys.indexOf(_.keyNames[E])===-1&&this.pressedKeys.push(_.keyNames[E]);this._appliedMacros.push(_)}}}},{key:"_clearMacros",value:function(){for(var l=0;l<this._appliedMacros.length;l+=1){var u=this._appliedMacros[l];if(!u.keyCombo.check(this.pressedKeys)){for(var _=0;_<u.keyNames.length;_+=1){var E=this.pressedKeys.indexOf(u.keyNames[_]);E>-1&&this.pressedKeys.splice(E,1)}u.handler&&(u.keyNames=null),this._appliedMacros.splice(l,1),l-=1}}}}]),o}(),P=function(){function o(m,l,u,_){s(this,o),this._locale=null,this._currentContext="",this._contexts={},this._listeners=[],this._appliedListeners=[],this._locales={},this._targetElement=null,this._targetWindow=null,this._targetPlatform="",this._targetUserAgent="",this._isModernBrowser=!1,this._targetKeyDownBinding=null,this._targetKeyUpBinding=null,this._targetResetBinding=null,this._paused=!1,this._contexts.global={listeners:this._listeners,targetWindow:m,targetElement:l,targetPlatform:u,targetUserAgent:_},this.setContext("global")}return r(o,[{key:"setLocale",value:function(l,u){var _=null;return typeof l=="string"?u?(_=new O(l),u(_,this._targetPlatform,this._targetUserAgent)):_=this._locales[l]||null:(_=l,l=_._localeName),this._locale=_,this._locales[l]=_,_&&(this._locale.pressedKeys=_.pressedKeys),this}},{key:"getLocale",value:function(l){return l||(l=this._locale.localeName),this._locales[l]||null}},{key:"bind",value:function(l,u,_,E){if((l===null||typeof l=="function")&&(E=_,_=u,u=l,l=null),l&&n(l)==="object"&&typeof l.length=="number"){for(var p=0;p<l.length;p+=1)this.bind(l[p],u,_);return this}return this._listeners.push({keyCombo:l?new y(l):null,pressHandler:u||null,releaseHandler:_||null,preventRepeat:!1,preventRepeatByDefault:E||!1,executingHandler:!1}),this}},{key:"addListener",value:function(l,u,_,E){return this.bind(l,u,_,E)}},{key:"on",value:function(l,u,_,E){return this.bind(l,u,_,E)}},{key:"bindPress",value:function(l,u,_){return this.bind(l,u,null,_)}},{key:"bindRelease",value:function(l,u){return this.bind(l,null,u,preventRepeatByDefault)}},{key:"unbind",value:function(l,u,_){if((l===null||typeof l=="function")&&(_=u,u=l,l=null),l&&n(l)==="object"&&typeof l.length=="number"){for(var E=0;E<l.length;E+=1)this.unbind(l[E],u,_);return this}for(var p=0;p<this._listeners.length;p+=1){var I=this._listeners[p],R=!l&&!I.keyCombo||I.keyCombo&&I.keyCombo.isEqual(l),w=!u&&!_||!u&&!I.pressHandler||u===I.pressHandler,H=!u&&!_||!_&&!I.releaseHandler||_===I.releaseHandler;R&&w&&H&&(this._listeners.splice(p,1),p-=1)}return this}},{key:"removeListener",value:function(l,u,_){return this.unbind(l,u,_)}},{key:"off",value:function(l,u,_){return this.unbind(l,u,_)}},{key:"setContext",value:function(l){if(this._locale&&this.releaseAllKeys(),!this._contexts[l]){var u=this._contexts.global;this._contexts[l]={listeners:[],targetWindow:u.targetWindow,targetElement:u.targetElement,targetPlatform:u.targetPlatform,targetUserAgent:u.targetUserAgent}}var _=this._contexts[l];return this._currentContext=l,this._listeners=_.listeners,this.stop(),this.watch(_.targetWindow,_.targetElement,_.targetPlatform,_.targetUserAgent),this}},{key:"getContext",value:function(){return this._currentContext}},{key:"withContext",value:function(l,u){var _=this.getContext();return this.setContext(l),u(),this.setContext(_),this}},{key:"watch",value:function(l,u,_,E){var p=this;this.stop();var I=typeof globalThis<"u"?globalThis:typeof zt<"u"?zt:typeof window<"u"?window:{};if(!l){if(!I.addEventListener&&!I.attachEvent){if(this._currentContext==="global")return;throw new Error("Cannot find window functions addEventListener or attachEvent.")}l=I}if(typeof l.nodeType=="number"&&(E=_,_=u,u=l,l=I),!l.addEventListener&&!l.attachEvent)throw new Error("Cannot find addEventListener or attachEvent methods on targetWindow.");this._isModernBrowser=!!l.addEventListener;var R=l.navigator&&l.navigator.userAgent||"",w=l.navigator&&l.navigator.platform||"";u&&u!==null||(u=l.document),_&&_!==null||(_=w),E&&E!==null||(E=R),this._targetKeyDownBinding=function($){p.pressKey($.keyCode,$),p._handleCommandBug($,w)},this._targetKeyUpBinding=function($){p.releaseKey($.keyCode,$)},this._targetResetBinding=function($){p.releaseAllKeys($)},this._bindEvent(u,"keydown",this._targetKeyDownBinding),this._bindEvent(u,"keyup",this._targetKeyUpBinding),this._bindEvent(l,"focus",this._targetResetBinding),this._bindEvent(l,"blur",this._targetResetBinding),this._targetElement=u,this._targetWindow=l,this._targetPlatform=_,this._targetUserAgent=E;var H=this._contexts[this._currentContext];return H.targetWindow=this._targetWindow,H.targetElement=this._targetElement,H.targetPlatform=this._targetPlatform,H.targetUserAgent=this._targetUserAgent,this}},{key:"stop",value:function(){if(!(!this._targetElement||!this._targetWindow))return this._unbindEvent(this._targetElement,"keydown",this._targetKeyDownBinding),this._unbindEvent(this._targetElement,"keyup",this._targetKeyUpBinding),this._unbindEvent(this._targetWindow,"focus",this._targetResetBinding),this._unbindEvent(this._targetWindow,"blur",this._targetResetBinding),this._targetWindow=null,this._targetElement=null,this}},{key:"pressKey",value:function(l,u){if(this._paused)return this;if(!this._locale)throw new Error("Locale not set");return this._locale.pressKey(l),this._applyBindings(u),this}},{key:"releaseKey",value:function(l,u){if(this._paused)return this;if(!this._locale)throw new Error("Locale not set");return this._locale.releaseKey(l),this._clearBindings(u),this}},{key:"releaseAllKeys",value:function(l){if(this._paused)return this;if(!this._locale)throw new Error("Locale not set");return this._locale.pressedKeys.length=0,this._clearBindings(l),this}},{key:"pause",value:function(){return this._paused?this:(this._locale&&this.releaseAllKeys(),this._paused=!0,this)}},{key:"resume",value:function(){return this._paused=!1,this}},{key:"reset",value:function(){return this.releaseAllKeys(),this._listeners.length=0,this}},{key:"_bindEvent",value:function(l,u,_){return this._isModernBrowser?l.addEventListener(u,_,!1):l.attachEvent("on"+u,_)}},{key:"_unbindEvent",value:function(l,u,_){return this._isModernBrowser?l.removeEventListener(u,_,!1):l.detachEvent("on"+u,_)}},{key:"_getGroupedListeners",value:function(){var l=[],u=[],_=this._listeners;return this._currentContext!=="global"&&(_=[].concat(i(_),i(this._contexts.global.listeners))),_.sort(function(E,p){return(p.keyCombo?p.keyCombo.keyNames.length:0)-(E.keyCombo?E.keyCombo.keyNames.length:0)}).forEach(function(E){for(var p=-1,I=0;I<u.length;I+=1)(u[I]===null&&E.keyCombo===null||u[I]!==null&&u[I].isEqual(E.keyCombo))&&(p=I);p===-1&&(p=u.length,u.push(E.keyCombo)),l[p]||(l[p]=[]),l[p].push(E)}),l}},{key:"_applyBindings",value:function(l){var u=this,_=!1;l||(l={}),l.preventRepeat=function(){_=!0},l.pressedKeys=this._locale.pressedKeys.slice(0);for(var E=this._locale.activeTargetKeys,p=this._locale.pressedKeys.slice(0),I=this._getGroupedListeners(),R=function($){var _e=I[$],me=_e[0].keyCombo;if(me===null||me.check(p)&&E.some(function(Xe){return me.keyNames.includes(Xe)})){for(var Se=0;Se<_e.length;Se+=1){var re=_e[Se];!re.executingHandler&&re.pressHandler&&!re.preventRepeat&&(re.executingHandler=!0,re.pressHandler.call(u,l),re.executingHandler=!1,(_||re.preventRepeatByDefault)&&(re.preventRepeat=!0,_=!1)),u._appliedListeners.indexOf(re)===-1&&u._appliedListeners.push(re)}if(me)for(var ve=0;ve<me.keyNames.length;ve+=1){var Ue=p.indexOf(me.keyNames[ve]);Ue!==-1&&(p.splice(Ue,1),ve-=1)}}},w=0;w<I.length;w+=1)R(w)}},{key:"_clearBindings",value:function(l){l||(l={}),l.pressedKeys=this._locale.pressedKeys.slice(0);for(var u=0;u<this._appliedListeners.length;u+=1){var _=this._appliedListeners[u],E=_.keyCombo;(E===null||!E.check(this._locale.pressedKeys))&&(_.preventRepeat=!1,(E!==null||l.pressedKeys.length===0)&&(this._appliedListeners.splice(u,1),u-=1),!_.executingHandler&&_.releaseHandler&&(_.executingHandler=!0,_.releaseHandler.call(this,l),_.executingHandler=!1))}}},{key:"_handleCommandBug",value:function(l,u){var _=["shift","ctrl","alt","capslock","tab","command"];u.match("Mac")&&this._locale.pressedKeys.includes("command")&&!_.includes(this._locale.getKeyNames(l.keyCode)[0])&&this._targetKeyUpBinding(l)}}]),o}();function S(o,m,l){o.bindKeyCode(3,["cancel"]),o.bindKeyCode(8,["backspace"]),o.bindKeyCode(9,["tab"]),o.bindKeyCode(12,["clear"]),o.bindKeyCode(13,["enter"]),o.bindKeyCode(16,["shift"]),o.bindKeyCode(17,["ctrl"]),o.bindKeyCode(18,["alt","menu"]),o.bindKeyCode(19,["pause","break"]),o.bindKeyCode(20,["capslock"]),o.bindKeyCode(27,["escape","esc"]),o.bindKeyCode(32,["space","spacebar"]),o.bindKeyCode(33,["pageup"]),o.bindKeyCode(34,["pagedown"]),o.bindKeyCode(35,["end"]),o.bindKeyCode(36,["home"]),o.bindKeyCode(37,["left"]),o.bindKeyCode(38,["up"]),o.bindKeyCode(39,["right"]),o.bindKeyCode(40,["down"]),o.bindKeyCode(41,["select"]),o.bindKeyCode(42,["printscreen"]),o.bindKeyCode(43,["execute"]),o.bindKeyCode(44,["snapshot"]),o.bindKeyCode(45,["insert","ins"]),o.bindKeyCode(46,["delete","del"]),o.bindKeyCode(47,["help"]),o.bindKeyCode(145,["scrolllock","scroll"]),o.bindKeyCode(188,["comma",","]),o.bindKeyCode(190,["period","."]),o.bindKeyCode(191,["slash","forwardslash","/"]),o.bindKeyCode(192,["graveaccent","`"]),o.bindKeyCode(219,["openbracket","["]),o.bindKeyCode(220,["backslash","\\"]),o.bindKeyCode(221,["closebracket","]"]),o.bindKeyCode(222,["apostrophe","'"]),o.bindKeyCode(48,["zero","0"]),o.bindKeyCode(49,["one","1"]),o.bindKeyCode(50,["two","2"]),o.bindKeyCode(51,["three","3"]),o.bindKeyCode(52,["four","4"]),o.bindKeyCode(53,["five","5"]),o.bindKeyCode(54,["six","6"]),o.bindKeyCode(55,["seven","7"]),o.bindKeyCode(56,["eight","8"]),o.bindKeyCode(57,["nine","9"]),o.bindKeyCode(96,["numzero","num0"]),o.bindKeyCode(97,["numone","num1"]),o.bindKeyCode(98,["numtwo","num2"]),o.bindKeyCode(99,["numthree","num3"]),o.bindKeyCode(100,["numfour","num4"]),o.bindKeyCode(101,["numfive","num5"]),o.bindKeyCode(102,["numsix","num6"]),o.bindKeyCode(103,["numseven","num7"]),o.bindKeyCode(104,["numeight","num8"]),o.bindKeyCode(105,["numnine","num9"]),o.bindKeyCode(106,["nummultiply","num*"]),o.bindKeyCode(107,["numadd","num+"]),o.bindKeyCode(108,["numenter"]),o.bindKeyCode(109,["numsubtract","num-"]),o.bindKeyCode(110,["numdecimal","num."]),o.bindKeyCode(111,["numdivide","num/"]),o.bindKeyCode(144,["numlock","num"]),o.bindKeyCode(112,["f1"]),o.bindKeyCode(113,["f2"]),o.bindKeyCode(114,["f3"]),o.bindKeyCode(115,["f4"]),o.bindKeyCode(116,["f5"]),o.bindKeyCode(117,["f6"]),o.bindKeyCode(118,["f7"]),o.bindKeyCode(119,["f8"]),o.bindKeyCode(120,["f9"]),o.bindKeyCode(121,["f10"]),o.bindKeyCode(122,["f11"]),o.bindKeyCode(123,["f12"]),o.bindKeyCode(124,["f13"]),o.bindKeyCode(125,["f14"]),o.bindKeyCode(126,["f15"]),o.bindKeyCode(127,["f16"]),o.bindKeyCode(128,["f17"]),o.bindKeyCode(129,["f18"]),o.bindKeyCode(130,["f19"]),o.bindKeyCode(131,["f20"]),o.bindKeyCode(132,["f21"]),o.bindKeyCode(133,["f22"]),o.bindKeyCode(134,["f23"]),o.bindKeyCode(135,["f24"]),o.bindMacro("shift + `",["tilde","~"]),o.bindMacro("shift + 1",["exclamation","exclamationpoint","!"]),o.bindMacro("shift + 2",["at","@"]),o.bindMacro("shift + 3",["number","#"]),o.bindMacro("shift + 4",["dollar","dollars","dollarsign","$"]),o.bindMacro("shift + 5",["percent","%"]),o.bindMacro("shift + 6",["caret","^"]),o.bindMacro("shift + 7",["ampersand","and","&"]),o.bindMacro("shift + 8",["asterisk","*"]),o.bindMacro("shift + 9",["openparen","("]),o.bindMacro("shift + 0",["closeparen",")"]),o.bindMacro("shift + -",["underscore","_"]),o.bindMacro("shift + =",["plus","+"]),o.bindMacro("shift + [",["opencurlybrace","opencurlybracket","{"]),o.bindMacro("shift + ]",["closecurlybrace","closecurlybracket","}"]),o.bindMacro("shift + \\",["verticalbar","|"]),o.bindMacro("shift + ;",["colon",":"]),o.bindMacro("shift + '",["quotationmark","'"]),o.bindMacro("shift + !,",["openanglebracket","<"]),o.bindMacro("shift + .",["closeanglebracket",">"]),o.bindMacro("shift + /",["questionmark","?"]),m.match("Mac")?o.bindMacro("command",["mod","modifier"]):o.bindMacro("ctrl",["mod","modifier"]);for(var u=65;u<=90;u+=1){var _=String.fromCharCode(u+32),E=String.fromCharCode(u);o.bindKeyCode(u,_),o.bindMacro("shift + "+_,E),o.bindMacro("capslock + "+_,E)}var p=l.match("Firefox")?59:186,I=l.match("Firefox")?173:189,R=l.match("Firefox")?61:187,w,H;m.match("Mac")&&(l.match("Safari")||l.match("Chrome"))?(w=91,H=93):m.match("Mac")&&l.match("Opera")?(w=17,H=17):m.match("Mac")&&l.match("Firefox")&&(w=224,H=224),o.bindKeyCode(p,["semicolon",";"]),o.bindKeyCode(I,["dash","-"]),o.bindKeyCode(R,["equal","equalsign","="]),o.bindKeyCode(w,["command","windows","win","super","leftcommand","leftwindows","leftwin","leftsuper"]),o.bindKeyCode(H,["command","windows","win","super","rightcommand","rightwindows","rightwin","rightsuper"]),o.setKillKey("command")}var k=new P;return k.setLocale("us",S),k.Keyboard=P,k.Locale=O,k.KeyCombo=y,k})}(ze)),ze.exports}var Cs=Ls();const Os=en(Cs);/*!
|
|
1
|
+
(function(ae,Z){typeof exports=="object"&&typeof module<"u"?module.exports=Z(require("keyboardjs"),require("view-ui-plus"),require("vue"),require("lodash-es"),require("axios"),require("store2"),require("jsrsasign")):typeof define=="function"&&define.amd?define(["keyboardjs","view-ui-plus","vue","lodash-es","axios","store2","jsrsasign"],Z):(ae=typeof globalThis<"u"?globalThis:ae||self,ae.gc_i18n=Z(ae.keyboardJS,ae.iview,ae.Vue,ae._,ae.Axios,ae.store2,ae.jsrsasign))})(this,function(ae,Z,O,w,Le,Ee,hs){"use strict";/*!
|
|
3
2
|
* shared v11.1.3
|
|
4
3
|
* (c) 2025 kazuya kawaguchi
|
|
5
4
|
* Released under the MIT License.
|
|
6
|
-
*/const le=typeof window<"u";let
|
|
7
|
-
`)}function
|
|
5
|
+
*/const le=typeof window<"u";let se,Oe;if(process.env.NODE_ENV!=="production"){const e=le&&window.performance;e&&e.mark&&e.measure&&e.clearMarks&&e.clearMeasures&&(se=t=>{e.mark(t)},Oe=(t,n,s)=>{e.measure(t,n,s),e.clearMarks(n),e.clearMarks(s)})}const Ns=/\{([0-9a-zA-Z]+)\}/g;function Xe(e,...t){return t.length===1&&F(t[0])&&(t=t[0]),(!t||!t.hasOwnProperty)&&(t={}),e.replace(Ns,(n,s)=>t.hasOwnProperty(s)?t[s]:"")}const ue=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Ts=(e,t,n)=>Ls({l:e,k:t,s:n}),Ls=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),X=e=>typeof e=="number"&&isFinite(e),Os=e=>ot(e)==="[object Date]",De=e=>ot(e)==="[object RegExp]",Je=e=>M(e)&&Object.keys(e).length===0,J=Object.assign,bs=Object.create,W=(e=null)=>bs(e);let Qt;const be=()=>Qt||(Qt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:W());function Zt(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const Is=Object.prototype.hasOwnProperty;function ie(e,t){return Is.call(e,t)}const H=Array.isArray,G=e=>typeof e=="function",I=e=>typeof e=="string",V=e=>typeof e=="boolean",F=e=>e!==null&&typeof e=="object",Cs=e=>F(e)&&G(e.then)&&G(e.catch),zt=Object.prototype.toString,ot=e=>zt.call(e),M=e=>ot(e)==="[object Object]",ys=e=>e==null?"":H(e)||M(e)&&e.toString===zt?JSON.stringify(e,null,2):String(e);function lt(e,t=""){return e.reduce((n,s,a)=>a===0?n+s:n+t+s,"")}const en=2;function As(e,t=0,n=e.length){const s=e.split(/\r?\n/);let a=0;const r=[];for(let o=0;o<s.length;o++)if(a+=s[o].length+1,a>=t){for(let l=o-en;l<=o+en||n>a;l++){if(l<0||l>=s.length)continue;const u=l+1;r.push(`${u}${" ".repeat(3-String(u).length)}| ${s[l]}`);const _=s[l].length;if(l===o){const N=t-(a-_)+1,T=Math.max(1,n>a?_-N:n-t);r.push(" | "+" ".repeat(N)+"^".repeat(T))}else if(l>o){if(n>a){const N=Math.max(Math.min(n-a,_),1);r.push(" | "+"^".repeat(N))}a+=_+1}}break}return r.join(`
|
|
6
|
+
`)}function pe(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const tn={};function it(e){tn[e]||(tn[e]=!0,pe(e))}function ct(){const e=new Map;return{events:e,on(n,s){const a=e.get(n);a&&a.push(s)||e.set(n,[s])},off(n,s){const a=e.get(n);a&&a.splice(a.indexOf(s)>>>0,1)},emit(n,s){(e.get(n)||[]).slice().map(a=>a(s)),(e.get("*")||[]).slice().map(a=>a(n,s))}}}const qe=e=>!F(e)||H(e);function Qe(e,t){if(qe(e)||qe(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:a}=n.pop();Object.keys(s).forEach(r=>{r!=="__proto__"&&(F(s[r])&&!F(a[r])&&(a[r]=Array.isArray(s[r])?[]:W()),qe(a[r])||qe(s[r])?a[r]=s[r]:n.push({src:s[r],des:a[r]}))})}}/*!
|
|
8
7
|
* message-compiler v11.1.3
|
|
9
8
|
* (c) 2025 kazuya kawaguchi
|
|
10
9
|
* Released under the MIT License.
|
|
11
|
-
*/function
|
|
12
|
-
`,Gs="\u2028",Bs="\u2029";function Ys(e){const t=e;let n=0,s=1,a=1,r=0;const i=p=>t[p]===Ws&&t[p+1]===te,c=p=>t[p]===te,f=p=>t[p]===Bs,g=p=>t[p]===Gs,N=p=>i(p)||c(p)||f(p)||g(p),v=()=>n,y=()=>s,O=()=>a,P=()=>r,S=p=>i(p)||f(p)||g(p)?te:t[p],k=()=>S(n),o=()=>S(n+r);function m(){return r=0,N(n)&&(s++,a=0),i(n)&&n++,n++,a++,t[n]}function l(){return i(n+r)&&r++,r++,t[n+r]}function u(){n=0,s=1,a=1,r=0}function _(p=0){r=p}function E(){const p=n+r;for(;p!==n;)m();r=0}return{index:v,line:y,column:O,peekOffset:P,charAt:S,currentChar:k,currentPeek:o,next:m,peek:l,reset:u,resetPeek:_,skipToPeek:E}}const be=void 0,Hs=".",ln="'",js="tokenizer";function Xs(e,t={}){const n=t.location!==!1,s=Ys(e),a=()=>s.index(),r=()=>Fs(s.line(),s.column(),s.index()),i=r(),c=a(),f={currentType:13,offset:c,startLoc:i,endLoc:i,lastType:13,lastOffset:c,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},g=()=>f,{onError:N}=t;function v(d,h,T,...D){const q=g();if(h.column+=T,h.offset+=T,N){const J=n?pt(q.startLoc,h):null,V=Me(d,J,{domain:js,args:D});N(V)}}function y(d,h,T){d.endLoc=r(),d.currentType=h;const D={type:h};return n&&(D.loc=pt(d.startLoc,d.endLoc)),T!=null&&(D.value=T),D}const O=d=>y(d,13);function P(d,h){return d.currentChar()===h?(d.next(),h):(v(M.EXPECTED_TOKEN,r(),0,h),"")}function S(d){let h="";for(;d.currentPeek()===he||d.currentPeek()===te;)h+=d.currentPeek(),d.peek();return h}function k(d){const h=S(d);return d.skipToPeek(),h}function o(d){if(d===be)return!1;const h=d.charCodeAt(0);return h>=97&&h<=122||h>=65&&h<=90||h===95}function m(d){if(d===be)return!1;const h=d.charCodeAt(0);return h>=48&&h<=57}function l(d,h){const{currentType:T}=h;if(T!==2)return!1;S(d);const D=o(d.currentPeek());return d.resetPeek(),D}function u(d,h){const{currentType:T}=h;if(T!==2)return!1;S(d);const D=d.currentPeek()==="-"?d.peek():d.currentPeek(),q=m(D);return d.resetPeek(),q}function _(d,h){const{currentType:T}=h;if(T!==2)return!1;S(d);const D=d.currentPeek()===ln;return d.resetPeek(),D}function E(d,h){const{currentType:T}=h;if(T!==7)return!1;S(d);const D=d.currentPeek()===".";return d.resetPeek(),D}function p(d,h){const{currentType:T}=h;if(T!==8)return!1;S(d);const D=o(d.currentPeek());return d.resetPeek(),D}function I(d,h){const{currentType:T}=h;if(!(T===7||T===11))return!1;S(d);const D=d.currentPeek()===":";return d.resetPeek(),D}function R(d,h){const{currentType:T}=h;if(T!==9)return!1;const D=()=>{const J=d.currentPeek();return J==="{"?o(d.peek()):J==="@"||J==="|"||J===":"||J==="."||J===he||!J?!1:J===te?(d.peek(),D()):H(d,!1)},q=D();return d.resetPeek(),q}function w(d){S(d);const h=d.currentPeek()==="|";return d.resetPeek(),h}function H(d,h=!0){const T=(q=!1,J="")=>{const V=d.currentPeek();return V==="{"||V==="@"||!V?q:V==="|"?!(J===he||J===te):V===he?(d.peek(),T(!0,he)):V===te?(d.peek(),T(!0,te)):!0},D=T();return h&&d.resetPeek(),D}function $(d,h){const T=d.currentChar();return T===be?be:h(T)?(d.next(),T):null}function _e(d){const h=d.charCodeAt(0);return h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===95||h===36}function me(d){return $(d,_e)}function Se(d){const h=d.charCodeAt(0);return h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===95||h===36||h===45}function re(d){return $(d,Se)}function ve(d){const h=d.charCodeAt(0);return h>=48&&h<=57}function Ue(d){return $(d,ve)}function Xe(d){const h=d.charCodeAt(0);return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}function pe(d){return $(d,Xe)}function qe(d){let h="",T="";for(;h=Ue(d);)T+=h;return T}function Gt(d){let h="";for(;;){const T=d.currentChar();if(T==="{"||T==="}"||T==="@"||T==="|"||!T)break;if(T===he||T===te)if(H(d))h+=T,d.next();else{if(w(d))break;h+=T,d.next()}else h+=T,d.next()}return h}function Bt(d){k(d);let h="",T="";for(;h=re(d);)T+=h;return d.currentChar()===be&&v(M.UNTERMINATED_CLOSING_BRACE,r(),0),T}function Yt(d){k(d);let h="";return d.currentChar()==="-"?(d.next(),h+=`-${qe(d)}`):h+=qe(d),d.currentChar()===be&&v(M.UNTERMINATED_CLOSING_BRACE,r(),0),h}function Ht(d){return d!==ln&&d!==te}function Ns(d){k(d),P(d,"'");let h="",T="";for(;h=$(d,Ht);)h==="\\"?T+=jt(d):T+=h;const D=d.currentChar();return D===te||D===be?(v(M.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),D===te&&(d.next(),P(d,"'")),T):(P(d,"'"),T)}function jt(d){const h=d.currentChar();switch(h){case"\\":case"'":return d.next(),`\\${h}`;case"u":return ft(d,h,4);case"U":return ft(d,h,6);default:return v(M.UNKNOWN_ESCAPE_SEQUENCE,r(),0,h),""}}function ft(d,h,T){P(d,h);let D="";for(let q=0;q<T;q++){const J=pe(d);if(!J){v(M.INVALID_UNICODE_ESCAPE_SEQUENCE,r(),0,`\\${h}${D}${d.currentChar()}`);break}D+=J}return`\\${h}${D}`}function Xt(d){return d!=="{"&&d!=="}"&&d!==he&&d!==te}function qt(d){k(d);let h="",T="";for(;h=$(d,Xt);)T+=h;return T}function Jt(d){let h="",T="";for(;h=me(d);)T+=h;return T}function Qt(d){const h=T=>{const D=d.currentChar();return D==="{"||D==="@"||D==="|"||D==="("||D===")"||!D||D===he?T:(T+=D,d.next(),h(T))};return h("")}function Je(d){k(d);const h=P(d,"|");return k(d),h}function Qe(d,h){let T=null;switch(d.currentChar()){case"{":return h.braceNest>=1&&v(M.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),d.next(),T=y(h,2,"{"),k(d),h.braceNest++,T;case"}":return h.braceNest>0&&h.currentType===2&&v(M.EMPTY_PLACEHOLDER,r(),0),d.next(),T=y(h,3,"}"),h.braceNest--,h.braceNest>0&&k(d),h.inLinked&&h.braceNest===0&&(h.inLinked=!1),T;case"@":return h.braceNest>0&&v(M.UNTERMINATED_CLOSING_BRACE,r(),0),T=ke(d,h)||O(h),h.braceNest=0,T;default:{let q=!0,J=!0,V=!0;if(w(d))return h.braceNest>0&&v(M.UNTERMINATED_CLOSING_BRACE,r(),0),T=y(h,1,Je(d)),h.braceNest=0,h.inLinked=!1,T;if(h.braceNest>0&&(h.currentType===4||h.currentType===5||h.currentType===6))return v(M.UNTERMINATED_CLOSING_BRACE,r(),0),h.braceNest=0,Ze(d,h);if(q=l(d,h))return T=y(h,4,Bt(d)),k(d),T;if(J=u(d,h))return T=y(h,5,Yt(d)),k(d),T;if(V=_(d,h))return T=y(h,6,Ns(d)),k(d),T;if(!q&&!J&&!V)return T=y(h,12,qt(d)),v(M.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,T.value),k(d),T;break}}return T}function ke(d,h){const{currentType:T}=h;let D=null;const q=d.currentChar();switch((T===7||T===8||T===11||T===9)&&(q===te||q===he)&&v(M.INVALID_LINKED_FORMAT,r(),0),q){case"@":return d.next(),D=y(h,7,"@"),h.inLinked=!0,D;case".":return k(d),d.next(),y(h,8,".");case":":return k(d),d.next(),y(h,9,":");default:return w(d)?(D=y(h,1,Je(d)),h.braceNest=0,h.inLinked=!1,D):E(d,h)||I(d,h)?(k(d),ke(d,h)):p(d,h)?(k(d),y(h,11,Jt(d))):R(d,h)?(k(d),q==="{"?Qe(d,h)||D:y(h,10,Qt(d))):(T===7&&v(M.INVALID_LINKED_FORMAT,r(),0),h.braceNest=0,h.inLinked=!1,Ze(d,h))}}function Ze(d,h){let T={type:13};if(h.braceNest>0)return Qe(d,h)||O(h);if(h.inLinked)return ke(d,h)||O(h);switch(d.currentChar()){case"{":return Qe(d,h)||O(h);case"}":return v(M.UNBALANCED_CLOSING_BRACE,r(),0),d.next(),y(h,3,"}");case"@":return ke(d,h)||O(h);default:{if(w(d))return T=y(h,1,Je(d)),h.braceNest=0,h.inLinked=!1,T;if(H(d))return y(h,0,Gt(d));break}}return T}function Zt(){const{currentType:d,offset:h,startLoc:T,endLoc:D}=f;return f.lastType=d,f.lastOffset=h,f.lastStartLoc=T,f.lastEndLoc=D,f.offset=a(),f.startLoc=r(),s.currentChar()===be?y(f,13):Ze(s,f)}return{nextToken:Zt,currentOffset:a,currentPosition:r,context:g}}const qs="parser",Js=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Qs(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function Zs(e={}){const t=e.location!==!1,{onError:n}=e;function s(o,m,l,u,..._){const E=o.currentPosition();if(E.offset+=u,E.column+=u,n){const p=t?pt(l,E):null,I=Me(m,p,{domain:qs,args:_});n(I)}}function a(o,m,l){const u={type:o};return t&&(u.start=m,u.end=m,u.loc={start:l,end:l}),u}function r(o,m,l,u){t&&(o.end=m,o.loc&&(o.loc.end=l))}function i(o,m){const l=o.context(),u=a(3,l.offset,l.startLoc);return u.value=m,r(u,o.currentOffset(),o.currentPosition()),u}function c(o,m){const l=o.context(),{lastOffset:u,lastStartLoc:_}=l,E=a(5,u,_);return E.index=parseInt(m,10),o.nextToken(),r(E,o.currentOffset(),o.currentPosition()),E}function f(o,m){const l=o.context(),{lastOffset:u,lastStartLoc:_}=l,E=a(4,u,_);return E.key=m,o.nextToken(),r(E,o.currentOffset(),o.currentPosition()),E}function g(o,m){const l=o.context(),{lastOffset:u,lastStartLoc:_}=l,E=a(9,u,_);return E.value=m.replace(Js,Qs),o.nextToken(),r(E,o.currentOffset(),o.currentPosition()),E}function N(o){const m=o.nextToken(),l=o.context(),{lastOffset:u,lastStartLoc:_}=l,E=a(8,u,_);return m.type!==11?(s(o,M.UNEXPECTED_EMPTY_LINKED_MODIFIER,l.lastStartLoc,0),E.value="",r(E,u,_),{nextConsumeToken:m,node:E}):(m.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,l.lastStartLoc,0,fe(m)),E.value=m.value||"",r(E,o.currentOffset(),o.currentPosition()),{node:E})}function v(o,m){const l=o.context(),u=a(7,l.offset,l.startLoc);return u.value=m,r(u,o.currentOffset(),o.currentPosition()),u}function y(o){const m=o.context(),l=a(6,m.offset,m.startLoc);let u=o.nextToken();if(u.type===8){const _=N(o);l.modifier=_.node,u=_.nextConsumeToken||o.nextToken()}switch(u.type!==9&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(u)),u=o.nextToken(),u.type===2&&(u=o.nextToken()),u.type){case 10:u.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(u)),l.key=v(o,u.value||"");break;case 4:u.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(u)),l.key=f(o,u.value||"");break;case 5:u.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(u)),l.key=c(o,u.value||"");break;case 6:u.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(u)),l.key=g(o,u.value||"");break;default:{s(o,M.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const _=o.context(),E=a(7,_.offset,_.startLoc);return E.value="",r(E,_.offset,_.startLoc),l.key=E,r(l,_.offset,_.startLoc),{nextConsumeToken:u,node:l}}}return r(l,o.currentOffset(),o.currentPosition()),{node:l}}function O(o){const m=o.context(),l=m.currentType===1?o.currentOffset():m.offset,u=m.currentType===1?m.endLoc:m.startLoc,_=a(2,l,u);_.items=[];let E=null;do{const R=E||o.nextToken();switch(E=null,R.type){case 0:R.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(R)),_.items.push(i(o,R.value||""));break;case 5:R.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(R)),_.items.push(c(o,R.value||""));break;case 4:R.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(R)),_.items.push(f(o,R.value||""));break;case 6:R.value==null&&s(o,M.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,fe(R)),_.items.push(g(o,R.value||""));break;case 7:{const w=y(o);_.items.push(w.node),E=w.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const p=m.currentType===1?m.lastOffset:o.currentOffset(),I=m.currentType===1?m.lastEndLoc:o.currentPosition();return r(_,p,I),_}function P(o,m,l,u){const _=o.context();let E=u.items.length===0;const p=a(1,m,l);p.cases=[],p.cases.push(u);do{const I=O(o);E||(E=I.items.length===0),p.cases.push(I)}while(_.currentType!==13);return E&&s(o,M.MUST_HAVE_MESSAGES_IN_PLURAL,l,0),r(p,o.currentOffset(),o.currentPosition()),p}function S(o){const m=o.context(),{offset:l,startLoc:u}=m,_=O(o);return m.currentType===13?_:P(o,l,u,_)}function k(o){const m=Xs(o,z({},e)),l=m.context(),u=a(0,l.offset,l.startLoc);return t&&u.loc&&(u.loc.source=o),u.body=S(m),e.onCacheKey&&(u.cacheKey=e.onCacheKey(o)),l.currentType!==13&&s(m,M.UNEXPECTED_LEXICAL_ANALYSIS,l.lastStartLoc,0,o[l.offset]||""),r(u,m.currentOffset(),m.currentPosition()),u}return{parse:k}}function fe(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function zs(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:r=>(n.helpers.add(r),r)}}function cn(e,t){for(let n=0;n<e.length;n++)Et(e[n],t)}function Et(e,t){switch(e.type){case 1:cn(e.cases,t),t.helper("plural");break;case 2:cn(e.items,t);break;case 6:{Et(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function er(e,t={}){const n=zs(e);n.helper("normalize"),e.body&&Et(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function tr(e){const t=e.body;return t.type===2?un(t):t.cases.forEach(n=>un(n)),e}function un(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=mt(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}const nr="minifier";function we(e){switch(e.t=e.type,e.type){case 0:{const t=e;we(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)we(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)we(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;we(t.key),t.k=t.key,delete t.key,t.modifier&&(we(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}default:if(process.env.NODE_ENV!=="production")throw Me(M.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:nr,args:[e.type]})}delete e.type}const sr="parser";function rr(e,t){const{filename:n,breakLineCode:s,needIndent:a}=t,r=t.location!==!1,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:a,indentLevel:0};r&&e.loc&&(i.source=e.loc.source);const c=()=>i;function f(S,k){i.code+=S}function g(S,k=!0){const o=k?s:"";f(a?o+" ".repeat(S):o)}function N(S=!0){const k=++i.indentLevel;S&&g(k)}function v(S=!0){const k=--i.indentLevel;S&&g(k)}function y(){g(i.indentLevel)}return{context:c,push:f,indent:N,deindent:v,newline:y,helper:S=>`_${S}`,needIndent:()=>i.needIndent}}function ar(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Fe(e,t.key),t.modifier?(e.push(", "),Fe(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function ir(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const a=t.items.length;for(let r=0;r<a&&(Fe(e,t.items[r]),r!==a-1);r++)e.push(", ");e.deindent(s()),e.push("])")}function or(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const a=t.cases.length;for(let r=0;r<a&&(Fe(e,t.cases[r]),r!==a-1);r++)e.push(", ");e.deindent(s()),e.push("])")}}function lr(e,t){t.body?Fe(e,t.body):e.push("null")}function Fe(e,t){const{helper:n}=e;switch(t.type){case 0:lr(e,t);break;case 1:or(e,t);break;case 2:ir(e,t);break;case 6:ar(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break;default:if(process.env.NODE_ENV!=="production")throw Me(M.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:sr,args:[t.type]})}}const cr=(e,t={})=>{const n=A(t.mode)?t.mode:"normal",s=A(t.filename)?t.filename:"message.intl";t.sourceMap;const a=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
13
|
-
`,r=t.needIndent?t.needIndent:n!=="arrow",
|
|
10
|
+
*/function Ss(e,t,n){return{line:e,column:t,offset:n}}function ut(e,t,n){return{start:e,end:t}}const P={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},Ds=17,ks={[P.EXPECTED_TOKEN]:"Expected token: '{0}'",[P.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[P.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[P.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[P.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[P.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[P.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[P.EMPTY_PLACEHOLDER]:"Empty placeholder",[P.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[P.INVALID_LINKED_FORMAT]:"Invalid linked format",[P.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[P.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[P.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[P.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[P.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[P.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function ke(e,t,n={}){const{domain:s,messages:a,args:r}=n,o=process.env.NODE_ENV!=="production"?Xe((a||ks)[e]||"",...r||[]):e,l=new SyntaxError(String(o));return l.code=e,t&&(l.location=t),l.domain=s,l}function vs(e){throw e}const Ps=/<\/?[\w\s="/.':;#-\/]+>/,Rs=e=>Ps.test(e),me=" ",Ms="\r",ee=`
|
|
11
|
+
`,Fs="\u2028",Vs="\u2029";function ws(e){const t=e;let n=0,s=1,a=1,r=0;const o=p=>t[p]===Ms&&t[p+1]===ee,l=p=>t[p]===ee,u=p=>t[p]===Vs,_=p=>t[p]===Fs,N=p=>o(p)||l(p)||u(p)||_(p),T=()=>n,E=()=>s,A=()=>a,k=()=>r,S=p=>o(p)||u(p)||_(p)?ee:t[p],D=()=>S(n),f=()=>S(n+r);function d(){return r=0,N(n)&&(s++,a=0),o(n)&&n++,n++,a++,t[n]}function b(){return o(n+r)&&r++,r++,t[n+r]}function g(){n=0,s=1,a=1,r=0}function C(p=0){r=p}function y(){const p=n+r;for(;p!==n;)d();r=0}return{index:T,line:E,column:A,peekOffset:k,charAt:S,currentChar:D,currentPeek:f,next:d,peek:b,reset:g,resetPeek:C,skipToPeek:y}}const he=void 0,Us=".",nn="'",xs="tokenizer";function $s(e,t={}){const n=t.location!==!1,s=ws(e),a=()=>s.index(),r=()=>Ss(s.line(),s.column(),s.index()),o=r(),l=a(),u={currentType:13,offset:l,startLoc:o,endLoc:o,lastType:13,lastOffset:l,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},_=()=>u,{onError:N}=t;function T(i,c,h,...v){const B=_();if(c.column+=h,c.offset+=h,N){const K=n?ut(B.startLoc,c):null,U=ke(i,K,{domain:xs,args:v});N(U)}}function E(i,c,h){i.endLoc=r(),i.currentType=c;const v={type:c};return n&&(v.loc=ut(i.startLoc,i.endLoc)),h!=null&&(v.value=h),v}const A=i=>E(i,13);function k(i,c){return i.currentChar()===c?(i.next(),c):(T(P.EXPECTED_TOKEN,r(),0,c),"")}function S(i){let c="";for(;i.currentPeek()===me||i.currentPeek()===ee;)c+=i.currentPeek(),i.peek();return c}function D(i){const c=S(i);return i.skipToPeek(),c}function f(i){if(i===he)return!1;const c=i.charCodeAt(0);return c>=97&&c<=122||c>=65&&c<=90||c===95}function d(i){if(i===he)return!1;const c=i.charCodeAt(0);return c>=48&&c<=57}function b(i,c){const{currentType:h}=c;if(h!==2)return!1;S(i);const v=f(i.currentPeek());return i.resetPeek(),v}function g(i,c){const{currentType:h}=c;if(h!==2)return!1;S(i);const v=i.currentPeek()==="-"?i.peek():i.currentPeek(),B=d(v);return i.resetPeek(),B}function C(i,c){const{currentType:h}=c;if(h!==2)return!1;S(i);const v=i.currentPeek()===nn;return i.resetPeek(),v}function y(i,c){const{currentType:h}=c;if(h!==7)return!1;S(i);const v=i.currentPeek()===".";return i.resetPeek(),v}function p(i,c){const{currentType:h}=c;if(h!==8)return!1;S(i);const v=f(i.currentPeek());return i.resetPeek(),v}function R(i,c){const{currentType:h}=c;if(!(h===7||h===11))return!1;S(i);const v=i.currentPeek()===":";return i.resetPeek(),v}function x(i,c){const{currentType:h}=c;if(h!==9)return!1;const v=()=>{const K=i.currentPeek();return K==="{"?f(i.peek()):K==="@"||K==="|"||K===":"||K==="."||K===me||!K?!1:K===ee?(i.peek(),v()):ce(i,!1)},B=v();return i.resetPeek(),B}function q(i){S(i);const c=i.currentPeek()==="|";return i.resetPeek(),c}function ce(i,c=!0){const h=(B=!1,K="")=>{const U=i.currentPeek();return U==="{"||U==="@"||!U?B:U==="|"?!(K===me||K===ee):U===me?(i.peek(),h(!0,me)):U===ee?(i.peek(),h(!0,ee)):!0},v=h();return c&&i.resetPeek(),v}function Q(i,c){const h=i.currentChar();return h===he?he:c(h)?(i.next(),h):null}function Me(i){const c=i.charCodeAt(0);return c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===95||c===36}function Ft(i){return Q(i,Me)}function Vt(i){const c=i.charCodeAt(0);return c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===95||c===36||c===45}function wt(i){return Q(i,Vt)}function Ut(i){const c=i.charCodeAt(0);return c>=48&&c<=57}function xt(i){return Q(i,Ut)}function $t(i){const c=i.charCodeAt(0);return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}function ge(i){return Q(i,$t)}function He(i){let c="",h="";for(;c=xt(i);)h+=c;return h}function Wt(i){let c="";for(;;){const h=i.currentChar();if(h==="{"||h==="}"||h==="@"||h==="|"||!h)break;if(h===me||h===ee)if(ce(i))c+=h,i.next();else{if(q(i))break;c+=h,i.next()}else c+=h,i.next()}return c}function Gt(i){D(i);let c="",h="";for(;c=wt(i);)h+=c;return i.currentChar()===he&&T(P.UNTERMINATED_CLOSING_BRACE,r(),0),h}function Yt(i){D(i);let c="";return i.currentChar()==="-"?(i.next(),c+=`-${He(i)}`):c+=He(i),i.currentChar()===he&&T(P.UNTERMINATED_CLOSING_BRACE,r(),0),c}function Ht(i){return i!==nn&&i!==ee}function Es(i){D(i),k(i,"'");let c="",h="";for(;c=Q(i,Ht);)c==="\\"?h+=Bt(i):h+=c;const v=i.currentChar();return v===ee||v===he?(T(P.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),v===ee&&(i.next(),k(i,"'")),h):(k(i,"'"),h)}function Bt(i){const c=i.currentChar();switch(c){case"\\":case"'":return i.next(),`\\${c}`;case"u":return at(i,c,4);case"U":return at(i,c,6);default:return T(P.UNKNOWN_ESCAPE_SEQUENCE,r(),0,c),""}}function at(i,c,h){k(i,c);let v="";for(let B=0;B<h;B++){const K=ge(i);if(!K){T(P.INVALID_UNICODE_ESCAPE_SEQUENCE,r(),0,`\\${c}${v}${i.currentChar()}`);break}v+=K}return`\\${c}${v}`}function Kt(i){return i!=="{"&&i!=="}"&&i!==me&&i!==ee}function jt(i){D(i);let c="",h="";for(;c=Q(i,Kt);)h+=c;return h}function Xt(i){let c="",h="";for(;c=Ft(i);)h+=c;return h}function Jt(i){const c=h=>{const v=i.currentChar();return v==="{"||v==="@"||v==="|"||v==="("||v===")"||!v||v===me?h:(h+=v,i.next(),c(h))};return c("")}function Be(i){D(i);const c=k(i,"|");return D(i),c}function Ke(i,c){let h=null;switch(i.currentChar()){case"{":return c.braceNest>=1&&T(P.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),i.next(),h=E(c,2,"{"),D(i),c.braceNest++,h;case"}":return c.braceNest>0&&c.currentType===2&&T(P.EMPTY_PLACEHOLDER,r(),0),i.next(),h=E(c,3,"}"),c.braceNest--,c.braceNest>0&&D(i),c.inLinked&&c.braceNest===0&&(c.inLinked=!1),h;case"@":return c.braceNest>0&&T(P.UNTERMINATED_CLOSING_BRACE,r(),0),h=ye(i,c)||A(c),c.braceNest=0,h;default:{let B=!0,K=!0,U=!0;if(q(i))return c.braceNest>0&&T(P.UNTERMINATED_CLOSING_BRACE,r(),0),h=E(c,1,Be(i)),c.braceNest=0,c.inLinked=!1,h;if(c.braceNest>0&&(c.currentType===4||c.currentType===5||c.currentType===6))return T(P.UNTERMINATED_CLOSING_BRACE,r(),0),c.braceNest=0,je(i,c);if(B=b(i,c))return h=E(c,4,Gt(i)),D(i),h;if(K=g(i,c))return h=E(c,5,Yt(i)),D(i),h;if(U=C(i,c))return h=E(c,6,Es(i)),D(i),h;if(!B&&!K&&!U)return h=E(c,12,jt(i)),T(P.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,h.value),D(i),h;break}}return h}function ye(i,c){const{currentType:h}=c;let v=null;const B=i.currentChar();switch((h===7||h===8||h===11||h===9)&&(B===ee||B===me)&&T(P.INVALID_LINKED_FORMAT,r(),0),B){case"@":return i.next(),v=E(c,7,"@"),c.inLinked=!0,v;case".":return D(i),i.next(),E(c,8,".");case":":return D(i),i.next(),E(c,9,":");default:return q(i)?(v=E(c,1,Be(i)),c.braceNest=0,c.inLinked=!1,v):y(i,c)||R(i,c)?(D(i),ye(i,c)):p(i,c)?(D(i),E(c,11,Xt(i))):x(i,c)?(D(i),B==="{"?Ke(i,c)||v:E(c,10,Jt(i))):(h===7&&T(P.INVALID_LINKED_FORMAT,r(),0),c.braceNest=0,c.inLinked=!1,je(i,c))}}function je(i,c){let h={type:13};if(c.braceNest>0)return Ke(i,c)||A(c);if(c.inLinked)return ye(i,c)||A(c);switch(i.currentChar()){case"{":return Ke(i,c)||A(c);case"}":return T(P.UNBALANCED_CLOSING_BRACE,r(),0),i.next(),E(c,3,"}");case"@":return ye(i,c)||A(c);default:{if(q(i))return h=E(c,1,Be(i)),c.braceNest=0,c.inLinked=!1,h;if(ce(i))return E(c,0,Wt(i));break}}return h}function qt(){const{currentType:i,offset:c,startLoc:h,endLoc:v}=u;return u.lastType=i,u.lastOffset=c,u.lastStartLoc=h,u.lastEndLoc=v,u.offset=a(),u.startLoc=r(),s.currentChar()===he?E(u,13):je(s,u)}return{nextToken:qt,currentOffset:a,currentPosition:r,context:_}}const Ws="parser",Gs=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Ys(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function Hs(e={}){const t=e.location!==!1,{onError:n}=e;function s(f,d,b,g,...C){const y=f.currentPosition();if(y.offset+=g,y.column+=g,n){const p=t?ut(b,y):null,R=ke(d,p,{domain:Ws,args:C});n(R)}}function a(f,d,b){const g={type:f};return t&&(g.start=d,g.end=d,g.loc={start:b,end:b}),g}function r(f,d,b,g){t&&(f.end=d,f.loc&&(f.loc.end=b))}function o(f,d){const b=f.context(),g=a(3,b.offset,b.startLoc);return g.value=d,r(g,f.currentOffset(),f.currentPosition()),g}function l(f,d){const b=f.context(),{lastOffset:g,lastStartLoc:C}=b,y=a(5,g,C);return y.index=parseInt(d,10),f.nextToken(),r(y,f.currentOffset(),f.currentPosition()),y}function u(f,d){const b=f.context(),{lastOffset:g,lastStartLoc:C}=b,y=a(4,g,C);return y.key=d,f.nextToken(),r(y,f.currentOffset(),f.currentPosition()),y}function _(f,d){const b=f.context(),{lastOffset:g,lastStartLoc:C}=b,y=a(9,g,C);return y.value=d.replace(Gs,Ys),f.nextToken(),r(y,f.currentOffset(),f.currentPosition()),y}function N(f){const d=f.nextToken(),b=f.context(),{lastOffset:g,lastStartLoc:C}=b,y=a(8,g,C);return d.type!==11?(s(f,P.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),y.value="",r(y,g,C),{nextConsumeToken:d,node:y}):(d.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,fe(d)),y.value=d.value||"",r(y,f.currentOffset(),f.currentPosition()),{node:y})}function T(f,d){const b=f.context(),g=a(7,b.offset,b.startLoc);return g.value=d,r(g,f.currentOffset(),f.currentPosition()),g}function E(f){const d=f.context(),b=a(6,d.offset,d.startLoc);let g=f.nextToken();if(g.type===8){const C=N(f);b.modifier=C.node,g=C.nextConsumeToken||f.nextToken()}switch(g.type!==9&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(g)),g=f.nextToken(),g.type===2&&(g=f.nextToken()),g.type){case 10:g.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(g)),b.key=T(f,g.value||"");break;case 4:g.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(g)),b.key=u(f,g.value||"");break;case 5:g.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(g)),b.key=l(f,g.value||"");break;case 6:g.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(g)),b.key=_(f,g.value||"");break;default:{s(f,P.UNEXPECTED_EMPTY_LINKED_KEY,d.lastStartLoc,0);const C=f.context(),y=a(7,C.offset,C.startLoc);return y.value="",r(y,C.offset,C.startLoc),b.key=y,r(b,C.offset,C.startLoc),{nextConsumeToken:g,node:b}}}return r(b,f.currentOffset(),f.currentPosition()),{node:b}}function A(f){const d=f.context(),b=d.currentType===1?f.currentOffset():d.offset,g=d.currentType===1?d.endLoc:d.startLoc,C=a(2,b,g);C.items=[];let y=null;do{const x=y||f.nextToken();switch(y=null,x.type){case 0:x.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(x)),C.items.push(o(f,x.value||""));break;case 5:x.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(x)),C.items.push(l(f,x.value||""));break;case 4:x.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(x)),C.items.push(u(f,x.value||""));break;case 6:x.value==null&&s(f,P.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,fe(x)),C.items.push(_(f,x.value||""));break;case 7:{const q=E(f);C.items.push(q.node),y=q.nextConsumeToken||null;break}}}while(d.currentType!==13&&d.currentType!==1);const p=d.currentType===1?d.lastOffset:f.currentOffset(),R=d.currentType===1?d.lastEndLoc:f.currentPosition();return r(C,p,R),C}function k(f,d,b,g){const C=f.context();let y=g.items.length===0;const p=a(1,d,b);p.cases=[],p.cases.push(g);do{const R=A(f);y||(y=R.items.length===0),p.cases.push(R)}while(C.currentType!==13);return y&&s(f,P.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),r(p,f.currentOffset(),f.currentPosition()),p}function S(f){const d=f.context(),{offset:b,startLoc:g}=d,C=A(f);return d.currentType===13?C:k(f,b,g,C)}function D(f){const d=$s(f,J({},e)),b=d.context(),g=a(0,b.offset,b.startLoc);return t&&g.loc&&(g.loc.source=f),g.body=S(d),e.onCacheKey&&(g.cacheKey=e.onCacheKey(f)),b.currentType!==13&&s(d,P.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,f[b.offset]||""),r(g,d.currentOffset(),d.currentPosition()),g}return{parse:D}}function fe(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function Bs(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:r=>(n.helpers.add(r),r)}}function sn(e,t){for(let n=0;n<e.length;n++)ft(e[n],t)}function ft(e,t){switch(e.type){case 1:sn(e.cases,t),t.helper("plural");break;case 2:sn(e.items,t);break;case 6:{ft(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function Ks(e,t={}){const n=Bs(e);n.helper("normalize"),e.body&&ft(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function js(e){const t=e.body;return t.type===2?an(t):t.cases.forEach(n=>an(n)),e}function an(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=lt(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}const Xs="minifier";function ve(e){switch(e.t=e.type,e.type){case 0:{const t=e;ve(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)ve(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)ve(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;ve(t.key),t.k=t.key,delete t.key,t.modifier&&(ve(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}default:if(process.env.NODE_ENV!=="production")throw ke(P.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:Xs,args:[e.type]})}delete e.type}const Js="parser";function qs(e,t){const{filename:n,breakLineCode:s,needIndent:a}=t,r=t.location!==!1,o={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:a,indentLevel:0};r&&e.loc&&(o.source=e.loc.source);const l=()=>o;function u(S,D){o.code+=S}function _(S,D=!0){const f=D?s:"";u(a?f+" ".repeat(S):f)}function N(S=!0){const D=++o.indentLevel;S&&_(D)}function T(S=!0){const D=--o.indentLevel;S&&_(D)}function E(){_(o.indentLevel)}return{context:l,push:u,indent:N,deindent:T,newline:E,helper:S=>`_${S}`,needIndent:()=>o.needIndent}}function Qs(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Pe(e,t.key),t.modifier?(e.push(", "),Pe(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function Zs(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const a=t.items.length;for(let r=0;r<a&&(Pe(e,t.items[r]),r!==a-1);r++)e.push(", ");e.deindent(s()),e.push("])")}function zs(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const a=t.cases.length;for(let r=0;r<a&&(Pe(e,t.cases[r]),r!==a-1);r++)e.push(", ");e.deindent(s()),e.push("])")}}function ea(e,t){t.body?Pe(e,t.body):e.push("null")}function Pe(e,t){const{helper:n}=e;switch(t.type){case 0:ea(e,t);break;case 1:zs(e,t);break;case 2:Zs(e,t);break;case 6:Qs(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break;default:if(process.env.NODE_ENV!=="production")throw ke(P.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Js,args:[t.type]})}}const ta=(e,t={})=>{const n=I(t.mode)?t.mode:"normal",s=I(t.filename)?t.filename:"message.intl";t.sourceMap;const a=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
|
12
|
+
`,r=t.needIndent?t.needIndent:n!=="arrow",o=e.helpers||[],l=qs(e,{filename:s,breakLineCode:a,needIndent:r});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(r),o.length>0&&(l.push(`const { ${lt(o.map(N=>`${N}: _${N}`),", ")} } = ctx`),l.newline()),l.push("return "),Pe(l,e),l.deindent(r),l.push("}"),delete e.helpers;const{code:u,map:_}=l.context();return{ast:e,code:u,map:_?_.toJSON():void 0}};function na(e,t={}){const n=J({},t),s=!!n.jit,a=!!n.minify,r=n.optimize==null?!0:n.optimize,l=Hs(n).parse(e);return s?(r&&js(l),a&&ve(l),{ast:l,code:""}):(Ks(l,n),ta(l,n))}/*!
|
|
14
13
|
* core-base v11.1.3
|
|
15
14
|
* (c) 2025 kazuya kawaguchi
|
|
16
15
|
* Released under the MIT License.
|
|
17
|
-
*/function fr(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ce().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ce().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ie(e){return K(e)&&bt(e)===0&&(ce(e,"b")||ce(e,"body"))}const fn=["b","body"];function dr(e){return ye(e,fn)}const dn=["c","cases"];function _r(e){return ye(e,dn,[])}const _n=["s","static"];function mr(e){return ye(e,_n)}const mn=["i","items"];function hr(e){return ye(e,mn,[])}const hn=["t","type"];function bt(e){return ye(e,hn)}const gn=["v","value"];function rt(e,t){const n=ye(e,gn);if(n!=null)return n;throw xe(t)}const pn=["m","modifier"];function gr(e){return ye(e,pn)}const En=["k","key"];function pr(e){const t=ye(e,En);if(t)return t;throw xe(6)}function ye(e,t,n){for(let s=0;s<t.length;s++){const a=t[s];if(ce(e,a)&&e[a]!=null)return e[a]}return n}const bn=[...fn,...dn,..._n,...mn,...En,...pn,...gn,...hn];function xe(e){return new Error(`unhandled node type: ${e}`)}function yt(e){return n=>Er(n,e)}function Er(e,t){const n=dr(t);if(n==null)throw xe(0);if(bt(n)===1){const r=_r(n);return e.plural(r.reduce((i,c)=>[...i,yn(e,c)],[]))}else return yn(e,n)}function yn(e,t){const n=mr(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=hr(t).reduce((a,r)=>[...a,Nt(e,r)],[]);return e.normalize(s)}}function Nt(e,t){const n=bt(t);switch(n){case 3:return rt(t,n);case 9:return rt(t,n);case 4:{const s=t;if(ce(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ce(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw xe(n)}case 5:{const s=t;if(ce(s,"i")&&Z(s.i))return e.interpolate(e.list(s.i));if(ce(s,"index")&&Z(s.index))return e.interpolate(e.list(s.index));throw xe(n)}case 6:{const s=t,a=gr(s),r=pr(s);return e.linked(Nt(e,r),a?Nt(e,a):void 0,e.type)}case 7:return rt(t,n);case 8:return rt(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const br="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function yr(e,t){t&&$s(e)&&Ee(et(br,{source:e}))}const Nr=e=>e;let at=G();function vr(e,t={}){let n=!1;const s=t.onError||Vs;return t.onError=a=>{n=!0,s(a)},{...ur(e,t),detectError:n}}function Tr(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&A(e)){const n=U(t.warnHtmlMessage)?t.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&yr(e,n);const a=(t.onCacheKey||Nr)(e),r=at[a];if(r)return r;const{ast:i,detectError:c}=vr(e,{...t,location:process.env.NODE_ENV!=="production",jit:!0}),f=yt(i);return c?f:at[a]=f}else{if(process.env.NODE_ENV!=="production"&&!ie(e))return Ee(`the message that is resolve with key '${t.key}' is not supported for jit compilation`),()=>e;const n=e.cacheKey;if(n){const s=at[n];return s||(at[n]=yt(e))}else return yt(e)}}let $e=null;function Lr(e){$e=e}function Cr(e,t,n){$e&&$e.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Or=Ir("function:translate");function Ir(e){return t=>$e&&$e.emit(e,t)}const ee={INVALID_ARGUMENT:Ks,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Ar=24;function ge(e){return Me(e,null,process.env.NODE_ENV!=="production"?{messages:Sr}:void 0)}const Sr={[ee.INVALID_ARGUMENT]:"Invalid arguments",[ee.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[ee.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[ee.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[ee.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[ee.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[ee.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function vt(e,t){return t.locale!=null?Nn(t.locale):Nn(e.locale)}let Tt;function Nn(e){if(A(e))return e;if(B(e)){if(e.resolvedOnce&&Tt!=null)return Tt;if(e.constructor.name==="Function"){const t=e();if(Rs(t))throw ge(ee.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Tt=t}else throw ge(ee.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw ge(ee.NOT_SUPPORT_LOCALE_TYPE)}function kr(e,t,n){return[...new Set([n,...X(t)?t:K(t)?Object.keys(t):A(t)?[t]:[n]])]}function vn(e,t,n){const s=A(n)?n:We,a=e;a.__localeChainCache||(a.__localeChainCache=new Map);let r=a.__localeChainCache.get(s);if(!r){r=[];let i=[n];for(;X(i);)i=Tn(r,i,t);const c=X(t)||!F(t)?t:t.default?t.default:null;i=A(c)?[c]:c,X(i)&&Tn(r,i,!1),a.__localeChainCache.set(s,r)}return r}function Tn(e,t,n){let s=!0;for(let a=0;a<t.length&&U(s);a++){const r=t[a];A(r)&&(s=Dr(e,t[a],n))}return s}function Dr(e,t,n){let s;const a=t.split("-");do{const r=a.join("-");s=Pr(e,r,n),a.splice(-1,1)}while(a.length&&s===!0);return s}function Pr(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const a=t.replace(/!/g,"");e.push(a),(X(n)||F(n))&&n[a]&&(s=n[a])}return s}const Ne=[];Ne[0]={w:[0],i:[3,0],"[":[4],o:[7]},Ne[1]={w:[1],".":[2],"[":[4],o:[7]},Ne[2]={w:[2],i:[3,0],0:[3,0]},Ne[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Ne[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Ne[5]={"'":[4,0],o:8,l:[5,0]},Ne[6]={'"':[4,0],o:8,l:[6,0]};const Rr=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Mr(e){return Rr.test(e)}function wr(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function Fr(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Kr(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:Mr(t)?wr(t):"*"+t}function Ur(e){const t=[];let n=-1,s=0,a=0,r,i,c,f,g,N,v;const y=[];y[0]=()=>{i===void 0?i=c:i+=c},y[1]=()=>{i!==void 0&&(t.push(i),i=void 0)},y[2]=()=>{y[0](),a++},y[3]=()=>{if(a>0)a--,s=4,y[0]();else{if(a=0,i===void 0||(i=Kr(i),i===!1))return!1;y[1]()}};function O(){const P=e[n+1];if(s===5&&P==="'"||s===6&&P==='"')return n++,c="\\"+P,y[0](),!0}for(;s!==null;)if(n++,r=e[n],!(r==="\\"&&O())){if(f=Fr(r),v=Ne[s],g=v[f]||v.l||8,g===8||(s=g[0],g[1]!==void 0&&(N=y[g[1]],N&&(c=r,N()===!1))))return;if(s===7)return t}}const Ln=new Map;function Vr(e,t){return K(e)?e[t]:null}function xr(e,t){if(!K(e))return null;let n=Ln.get(t);if(n||(n=Ur(t),n&&Ln.set(t,n)),!n)return null;const s=n.length;let a=e,r=0;for(;r<s;){const i=n[r];if(bn.includes(i)&&ie(a))return null;const c=a[i];if(c===void 0||B(a))return null;a=c,r++}return a}const ne={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},$r=8,Wr={[ne.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[ne.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[ne.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[ne.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[ne.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[ne.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[ne.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Oe(e,...t){return et(Wr[e],...t)}const Gr="11.1.3",it=-1,We="en-US",ot="",Cn=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function Br(){return{upper:(e,t)=>t==="text"&&A(e)?e.toUpperCase():t==="vnode"&&K(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&A(e)?e.toLowerCase():t==="vnode"&&K(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&A(e)?Cn(e):t==="vnode"&&K(e)&&"__v_isVNode"in e?Cn(e.children):e}}let On;function Yr(e){On=e}let In;function Hr(e){In=e}let An;function jr(e){An=e}let Sn=null;const Xr=e=>{Sn=e},qr=()=>Sn;let kn=null;const Dn=e=>{kn=e},Jr=()=>kn;let Pn=0;function Qr(e={}){const t=B(e.onWarn)?e.onWarn:Ee,n=A(e.version)?e.version:Gr,s=A(e.locale)||B(e.locale)?e.locale:We,a=B(s)?We:s,r=X(e.fallbackLocale)||F(e.fallbackLocale)||A(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a,i=F(e.messages)?e.messages:Lt(a),c=F(e.datetimeFormats)?e.datetimeFormats:Lt(a),f=F(e.numberFormats)?e.numberFormats:Lt(a),g=z(G(),e.modifiers,Br()),N=e.pluralRules||G(),v=B(e.missing)?e.missing:null,y=U(e.missingWarn)||Re(e.missingWarn)?e.missingWarn:!0,O=U(e.fallbackWarn)||Re(e.fallbackWarn)?e.fallbackWarn:!0,P=!!e.fallbackFormat,S=!!e.unresolving,k=B(e.postTranslation)?e.postTranslation:null,o=F(e.processor)?e.processor:null,m=U(e.warnHtmlMessage)?e.warnHtmlMessage:!0,l=!!e.escapeParameter,u=B(e.messageCompiler)?e.messageCompiler:On;process.env.NODE_ENV!=="production"&&B(e.messageCompiler)&&ht(Oe(ne.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const _=B(e.messageResolver)?e.messageResolver:In||Vr,E=B(e.localeFallbacker)?e.localeFallbacker:An||kr,p=K(e.fallbackContext)?e.fallbackContext:void 0,I=e,R=K(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,w=K(I.__numberFormatters)?I.__numberFormatters:new Map,H=K(I.__meta)?I.__meta:{};Pn++;const $={version:n,cid:Pn,locale:s,fallbackLocale:r,messages:i,modifiers:g,pluralRules:N,missing:v,missingWarn:y,fallbackWarn:O,fallbackFormat:P,unresolving:S,postTranslation:k,processor:o,warnHtmlMessage:m,escapeParameter:l,messageCompiler:u,messageResolver:_,localeFallbacker:E,fallbackContext:p,onWarn:t,__meta:H};return $.datetimeFormats=c,$.numberFormats=f,$.__datetimeFormatters=R,$.__numberFormatters=w,process.env.NODE_ENV!=="production"&&($.__v_emitter=I.__v_emitter!=null?I.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&Cr($,n,H),$}const Lt=e=>({[e]:G()});function lt(e,t){return e instanceof RegExp?e.test(t):e}function Rn(e,t){return e instanceof RegExp?e.test(t):e}function Ct(e,t,n,s,a){const{missing:r,onWarn:i}=e;if(process.env.NODE_ENV!=="production"){const c=e.__v_emitter;c&&c.emit("missing",{locale:n,key:t,type:a,groupId:`${a}:${t}`})}if(r!==null){const c=r(e,n,t,a);return A(c)?c:t}else return process.env.NODE_ENV!=="production"&&Rn(s,t)&&i(Oe(ne.NOT_FOUND_KEY,{key:t,locale:n})),t}function Ge(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Mn(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function Zr(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(Mn(e,t[s]))return!0;return!1}const wn=typeof Intl<"u",Fn={dateTimeFormat:wn&&typeof Intl.DateTimeFormat<"u",numberFormat:wn&&typeof Intl.NumberFormat<"u"};function Kn(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:a,onWarn:r,localeFallbacker:i}=e,{__datetimeFormatters:c}=e;if(process.env.NODE_ENV!=="production"&&!Fn.dateTimeFormat)return r(Oe(ne.CANNOT_FORMAT_DATE)),ot;const[f,g,N,v]=Ot(...t),y=U(N.missingWarn)?N.missingWarn:e.missingWarn,O=U(N.fallbackWarn)?N.fallbackWarn:e.fallbackWarn,P=!!N.part,S=vt(e,N),k=i(e,a,S);if(!A(f)||f==="")return new Intl.DateTimeFormat(S,v).format(g);let o={},m,l=null,u=S,_=null;const E="datetime format";for(let R=0;R<k.length;R++){if(m=_=k[R],process.env.NODE_ENV!=="production"&&S!==m&<(O,f)&&r(Oe(ne.FALLBACK_TO_DATE_FORMAT,{key:f,target:m})),process.env.NODE_ENV!=="production"&&S!==m){const w=e.__v_emitter;w&&w.emit("fallback",{type:E,key:f,from:u,to:_,groupId:`${E}:${f}`})}if(o=n[m]||{},l=o[f],F(l))break;Ct(e,f,m,y,E),u=_}if(!F(l)||!A(m))return s?it:f;let p=`${m}__${f}`;tt(v)||(p=`${p}__${JSON.stringify(v)}`);let I=c.get(p);return I||(I=new Intl.DateTimeFormat(m,z({},l,v)),c.set(p,I)),P?I.formatToParts(g):I.format(g)}const Un=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Ot(...e){const[t,n,s,a]=e,r=G();let i=G(),c;if(A(t)){const f=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!f)throw ge(ee.INVALID_ISO_DATE_ARGUMENT);const g=f[3]?f[3].trim().startsWith("T")?`${f[1].trim()}${f[3].trim()}`:`${f[1].trim()}T${f[3].trim()}`:f[1].trim();c=new Date(g);try{c.toISOString()}catch{throw ge(ee.INVALID_ISO_DATE_ARGUMENT)}}else if(ks(t)){if(isNaN(t.getTime()))throw ge(ee.INVALID_DATE_ARGUMENT);c=t}else if(Z(t))c=t;else throw ge(ee.INVALID_ARGUMENT);return A(n)?r.key=n:F(n)&&Object.keys(n).forEach(f=>{Un.includes(f)?i[f]=n[f]:r[f]=n[f]}),A(s)?r.locale=s:F(s)&&(i=s),F(a)&&(i=a),[r.key||"",c,r,i]}function Vn(e,t,n){const s=e;for(const a in n){const r=`${t}__${a}`;s.__datetimeFormatters.has(r)&&s.__datetimeFormatters.delete(r)}}function xn(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:a,onWarn:r,localeFallbacker:i}=e,{__numberFormatters:c}=e;if(process.env.NODE_ENV!=="production"&&!Fn.numberFormat)return r(Oe(ne.CANNOT_FORMAT_NUMBER)),ot;const[f,g,N,v]=It(...t),y=U(N.missingWarn)?N.missingWarn:e.missingWarn,O=U(N.fallbackWarn)?N.fallbackWarn:e.fallbackWarn,P=!!N.part,S=vt(e,N),k=i(e,a,S);if(!A(f)||f==="")return new Intl.NumberFormat(S,v).format(g);let o={},m,l=null,u=S,_=null;const E="number format";for(let R=0;R<k.length;R++){if(m=_=k[R],process.env.NODE_ENV!=="production"&&S!==m&<(O,f)&&r(Oe(ne.FALLBACK_TO_NUMBER_FORMAT,{key:f,target:m})),process.env.NODE_ENV!=="production"&&S!==m){const w=e.__v_emitter;w&&w.emit("fallback",{type:E,key:f,from:u,to:_,groupId:`${E}:${f}`})}if(o=n[m]||{},l=o[f],F(l))break;Ct(e,f,m,y,E),u=_}if(!F(l)||!A(m))return s?it:f;let p=`${m}__${f}`;tt(v)||(p=`${p}__${JSON.stringify(v)}`);let I=c.get(p);return I||(I=new Intl.NumberFormat(m,z({},l,v)),c.set(p,I)),P?I.formatToParts(g):I.format(g)}const $n=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function It(...e){const[t,n,s,a]=e,r=G();let i=G();if(!Z(t))throw ge(ee.INVALID_ARGUMENT);const c=t;return A(n)?r.key=n:F(n)&&Object.keys(n).forEach(f=>{$n.includes(f)?i[f]=n[f]:r[f]=n[f]}),A(s)?r.locale=s:F(s)&&(i=s),F(a)&&(i=a),[r.key||"",c,r,i]}function Wn(e,t,n){const s=e;for(const a in n){const r=`${t}__${a}`;s.__numberFormatters.has(r)&&s.__numberFormatters.delete(r)}}const zr=e=>e,ea=e=>"",ta="text",na=e=>e.length===0?"":mt(e),sa=Ms;function Gn(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function ra(e){const t=Z(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Z(e.named.count)||Z(e.named.n))?Z(e.named.count)?e.named.count:Z(e.named.n)?e.named.n:t:t}function aa(e,t){t.count||(t.count=e),t.n||(t.n=e)}function ia(e={}){const t=e.locale,n=ra(e),s=K(e.pluralRules)&&A(t)&&B(e.pluralRules[t])?e.pluralRules[t]:Gn,a=K(e.pluralRules)&&A(t)&&B(e.pluralRules[t])?Gn:void 0,r=o=>o[s(n,o.length,a)],i=e.list||[],c=o=>i[o],f=e.named||G();Z(e.pluralIndex)&&aa(n,f);const g=o=>f[o];function N(o,m){const l=B(e.messages)?e.messages(o,!!m):K(e.messages)?e.messages[o]:!1;return l||(e.parent?e.parent.message(o):ea)}const v=o=>e.modifiers?e.modifiers[o]:zr,y=F(e.processor)&&B(e.processor.normalize)?e.processor.normalize:na,O=F(e.processor)&&B(e.processor.interpolate)?e.processor.interpolate:sa,P=F(e.processor)&&A(e.processor.type)?e.processor.type:ta,k={list:c,named:g,plural:r,linked:(o,...m)=>{const[l,u]=m;let _="text",E="";m.length===1?K(l)?(E=l.modifier||E,_=l.type||_):A(l)&&(E=l||E):m.length===2&&(A(l)&&(E=l||E),A(u)&&(_=u||_));const p=N(o,!0)(k),I=_==="vnode"&&X(p)&&E?p[0]:p;return E?v(E)(I,_):I},message:N,type:P,interpolate:O,normalize:y,values:z(G(),i,f)};return k}const Bn=()=>"",oe=e=>B(e);function Yn(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:a,messageCompiler:r,fallbackLocale:i,messages:c}=e,[f,g]=At(...t),N=U(g.missingWarn)?g.missingWarn:e.missingWarn,v=U(g.fallbackWarn)?g.fallbackWarn:e.fallbackWarn,y=U(g.escapeParameter)?g.escapeParameter:e.escapeParameter,O=!!g.resolvedMessage,P=A(g.default)||U(g.default)?U(g.default)?r?f:()=>f:g.default:n?r?f:()=>f:null,S=n||P!=null&&(A(P)||B(P)),k=vt(e,g);y&&oa(g);let[o,m,l]=O?[f,k,c[k]||G()]:Hn(e,f,k,i,v,N),u=o,_=f;if(!O&&!(A(u)||ie(u)||oe(u))&&S&&(u=P,_=u),!O&&(!(A(u)||ie(u)||oe(u))||!A(m)))return a?it:f;if(process.env.NODE_ENV!=="production"&&A(u)&&e.messageCompiler==null)return Ee(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${f}'.`),f;let E=!1;const p=()=>{E=!0},I=oe(u)?u:jn(e,f,m,u,_,p);if(E)return u;const R=fa(e,m,l,g),w=ia(R),H=la(e,I,w),$=s?s(H,f):H;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const _e={timestamp:Date.now(),key:A(f)?f:oe(u)?u.key:"",locale:m||(oe(u)?u.locale:""),format:A(u)?u:oe(u)?u.source:"",message:$};_e.meta=z({},e.__meta,qr()||{}),Or(_e)}return $}function oa(e){X(e.list)?e.list=e.list.map(t=>A(t)?sn(t):t):K(e.named)&&Object.keys(e.named).forEach(t=>{A(e.named[t])&&(e.named[t]=sn(e.named[t]))})}function Hn(e,t,n,s,a,r){const{messages:i,onWarn:c,messageResolver:f,localeFallbacker:g}=e,N=g(e,s,n);let v=G(),y,O=null,P=n,S=null;const k="translate";for(let o=0;o<N.length;o++){if(y=S=N[o],process.env.NODE_ENV!=="production"&&n!==y&&!Mn(n,y)&<(a,t)&&c(Oe(ne.FALLBACK_TO_TRANSLATE,{key:t,target:y})),process.env.NODE_ENV!=="production"&&n!==y){const _=e.__v_emitter;_&&_.emit("fallback",{type:k,key:t,from:P,to:S,groupId:`${k}:${t}`})}v=i[y]||G();let m=null,l,u;if(process.env.NODE_ENV!=="production"&&le&&(m=window.performance.now(),l="intlify-message-resolve-start",u="intlify-message-resolve-end",ae&&ae(l)),(O=f(v,t))===null&&(O=v[t]),process.env.NODE_ENV!=="production"&&le){const _=window.performance.now(),E=e.__v_emitter;E&&m&&O&&E.emit("message-resolve",{type:"message-resolve",key:t,message:O,time:_-m,groupId:`${k}:${t}`}),l&&u&&ae&&Le&&(ae(u),Le("intlify message resolve",l,u))}if(A(O)||ie(O)||oe(O))break;if(!Zr(y,N)){const _=Ct(e,t,y,r,k);_!==t&&(O=_)}P=S}return[O,y,v]}function jn(e,t,n,s,a,r){const{messageCompiler:i,warnHtmlMessage:c}=e;if(oe(s)){const y=s;return y.locale=y.locale||n,y.key=y.key||t,y}if(i==null){const y=()=>s;return y.locale=n,y.key=t,y}let f=null,g,N;process.env.NODE_ENV!=="production"&&le&&(f=window.performance.now(),g="intlify-message-compilation-start",N="intlify-message-compilation-end",ae&&ae(g));const v=i(s,ca(e,n,a,s,c,r));if(process.env.NODE_ENV!=="production"&&le){const y=window.performance.now(),O=e.__v_emitter;O&&f&&O.emit("message-compilation",{type:"message-compilation",message:s,time:y-f,groupId:`translate:${t}`}),g&&N&&ae&&Le&&(ae(N),Le("intlify message compilation",g,N))}return v.locale=n,v.key=t,v.source=s,v}function la(e,t,n){let s=null,a,r;process.env.NODE_ENV!=="production"&&le&&(s=window.performance.now(),a="intlify-message-evaluation-start",r="intlify-message-evaluation-end",ae&&ae(a));const i=t(n);if(process.env.NODE_ENV!=="production"&&le){const c=window.performance.now(),f=e.__v_emitter;f&&s&&f.emit("message-evaluation",{type:"message-evaluation",value:i,time:c-s,groupId:`translate:${t.key}`}),a&&r&&ae&&Le&&(ae(r),Le("intlify message evaluation",a,r))}return i}function At(...e){const[t,n,s]=e,a=G();if(!A(t)&&!Z(t)&&!oe(t)&&!ie(t))throw ge(ee.INVALID_ARGUMENT);const r=Z(t)?String(t):(oe(t),t);return Z(n)?a.plural=n:A(n)?a.default=n:F(n)&&!tt(n)?a.named=n:X(n)&&(a.list=n),Z(s)?a.plural=s:A(s)?a.default=s:F(s)&&z(a,s),[r,a]}function ca(e,t,n,s,a,r){return{locale:t,key:n,warnHtmlMessage:a,onError:i=>{if(r&&r(i),process.env.NODE_ENV!=="production"){const c=ua(s),f=`Message compilation error: ${i.message}`,g=i.location&&c&&ws(c,i.location.start.offset,i.location.end.offset),N=e.__v_emitter;N&&c&&N.emit("compile-error",{message:c,error:i.message,start:i.location&&i.location.start.offset,end:i.location&&i.location.end.offset,groupId:`translate:${n}`}),console.error(g?`${f}
|
|
18
|
-
${
|
|
16
|
+
*/function sa(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(be().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(be().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function re(e){return F(e)&&_t(e)===0&&(ie(e,"b")||ie(e,"body"))}const rn=["b","body"];function aa(e){return Ne(e,rn)}const on=["c","cases"];function ra(e){return Ne(e,on,[])}const ln=["s","static"];function oa(e){return Ne(e,ln)}const cn=["i","items"];function la(e){return Ne(e,cn,[])}const un=["t","type"];function _t(e){return Ne(e,un)}const fn=["v","value"];function Ze(e,t){const n=Ne(e,fn);if(n!=null)return n;throw Ve(t)}const _n=["m","modifier"];function ia(e){return Ne(e,_n)}const mn=["k","key"];function ca(e){const t=Ne(e,mn);if(t)return t;throw Ve(6)}function Ne(e,t,n){for(let s=0;s<t.length;s++){const a=t[s];if(ie(e,a)&&e[a]!=null)return e[a]}return n}const dn=[...rn,...on,...ln,...cn,...mn,..._n,...fn,...un];function Ve(e){return new Error(`unhandled node type: ${e}`)}function mt(e){return n=>ua(n,e)}function ua(e,t){const n=aa(t);if(n==null)throw Ve(0);if(_t(n)===1){const r=ra(n);return e.plural(r.reduce((o,l)=>[...o,gn(e,l)],[]))}else return gn(e,n)}function gn(e,t){const n=oa(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=la(t).reduce((a,r)=>[...a,dt(e,r)],[]);return e.normalize(s)}}function dt(e,t){const n=_t(t);switch(n){case 3:return Ze(t,n);case 9:return Ze(t,n);case 4:{const s=t;if(ie(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(ie(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Ve(n)}case 5:{const s=t;if(ie(s,"i")&&X(s.i))return e.interpolate(e.list(s.i));if(ie(s,"index")&&X(s.index))return e.interpolate(e.list(s.index));throw Ve(n)}case 6:{const s=t,a=ia(s),r=ca(s);return e.linked(dt(e,r),a?dt(e,a):void 0,e.type)}case 7:return Ze(t,n);case 8:return Ze(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const fa="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function _a(e,t){t&&Rs(e)&&pe(Xe(fa,{source:e}))}const ma=e=>e;let ze=W();function da(e,t={}){let n=!1;const s=t.onError||vs;return t.onError=a=>{n=!0,s(a)},{...na(e,t),detectError:n}}function ga(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&I(e)){const n=V(t.warnHtmlMessage)?t.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&_a(e,n);const a=(t.onCacheKey||ma)(e),r=ze[a];if(r)return r;const{ast:o,detectError:l}=da(e,{...t,location:process.env.NODE_ENV!=="production",jit:!0}),u=mt(o);return l?u:ze[a]=u}else{if(process.env.NODE_ENV!=="production"&&!re(e))return pe(`the message that is resolve with key '${t.key}' is not supported for jit compilation`),()=>e;const n=e.cacheKey;if(n){const s=ze[n];return s||(ze[n]=mt(e))}else return mt(e)}}let we=null;function Ea(e){we=e}function pa(e,t,n){we&&we.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const ha=Na("function:translate");function Na(e){return t=>we&&we.emit(e,t)}const z={INVALID_ARGUMENT:Ds,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Ta=24;function de(e){return ke(e,null,process.env.NODE_ENV!=="production"?{messages:La}:void 0)}const La={[z.INVALID_ARGUMENT]:"Invalid arguments",[z.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[z.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[z.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[z.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[z.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[z.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function gt(e,t){return t.locale!=null?En(t.locale):En(e.locale)}let Et;function En(e){if(I(e))return e;if(G(e)){if(e.resolvedOnce&&Et!=null)return Et;if(e.constructor.name==="Function"){const t=e();if(Cs(t))throw de(z.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Et=t}else throw de(z.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw de(z.NOT_SUPPORT_LOCALE_TYPE)}function Oa(e,t,n){return[...new Set([n,...H(t)?t:F(t)?Object.keys(t):I(t)?[t]:[n]])]}function pn(e,t,n){const s=I(n)?n:Ue,a=e;a.__localeChainCache||(a.__localeChainCache=new Map);let r=a.__localeChainCache.get(s);if(!r){r=[];let o=[n];for(;H(o);)o=hn(r,o,t);const l=H(t)||!M(t)?t:t.default?t.default:null;o=I(l)?[l]:l,H(o)&&hn(r,o,!1),a.__localeChainCache.set(s,r)}return r}function hn(e,t,n){let s=!0;for(let a=0;a<t.length&&V(s);a++){const r=t[a];I(r)&&(s=ba(e,t[a],n))}return s}function ba(e,t,n){let s;const a=t.split("-");do{const r=a.join("-");s=Ia(e,r,n),a.splice(-1,1)}while(a.length&&s===!0);return s}function Ia(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const a=t.replace(/!/g,"");e.push(a),(H(n)||M(n))&&n[a]&&(s=n[a])}return s}const Te=[];Te[0]={w:[0],i:[3,0],"[":[4],o:[7]},Te[1]={w:[1],".":[2],"[":[4],o:[7]},Te[2]={w:[2],i:[3,0],0:[3,0]},Te[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Te[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Te[5]={"'":[4,0],o:8,l:[5,0]},Te[6]={'"':[4,0],o:8,l:[6,0]};const Ca=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function ya(e){return Ca.test(e)}function Aa(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function Sa(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Da(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:ya(t)?Aa(t):"*"+t}function ka(e){const t=[];let n=-1,s=0,a=0,r,o,l,u,_,N,T;const E=[];E[0]=()=>{o===void 0?o=l:o+=l},E[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},E[2]=()=>{E[0](),a++},E[3]=()=>{if(a>0)a--,s=4,E[0]();else{if(a=0,o===void 0||(o=Da(o),o===!1))return!1;E[1]()}};function A(){const k=e[n+1];if(s===5&&k==="'"||s===6&&k==='"')return n++,l="\\"+k,E[0](),!0}for(;s!==null;)if(n++,r=e[n],!(r==="\\"&&A())){if(u=Sa(r),T=Te[s],_=T[u]||T.l||8,_===8||(s=_[0],_[1]!==void 0&&(N=E[_[1]],N&&(l=r,N()===!1))))return;if(s===7)return t}}const Nn=new Map;function va(e,t){return F(e)?e[t]:null}function Pa(e,t){if(!F(e))return null;let n=Nn.get(t);if(n||(n=ka(t),n&&Nn.set(t,n)),!n)return null;const s=n.length;let a=e,r=0;for(;r<s;){const o=n[r];if(dn.includes(o)&&re(a))return null;const l=a[o];if(l===void 0||G(a))return null;a=l,r++}return a}const te={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},Ra=8,Ma={[te.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[te.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[te.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[te.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[te.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[te.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[te.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Ie(e,...t){return Xe(Ma[e],...t)}const Fa="11.1.3",et=-1,Ue="en-US",tt="",Tn=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function Va(){return{upper:(e,t)=>t==="text"&&I(e)?e.toUpperCase():t==="vnode"&&F(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&I(e)?e.toLowerCase():t==="vnode"&&F(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&I(e)?Tn(e):t==="vnode"&&F(e)&&"__v_isVNode"in e?Tn(e.children):e}}let Ln;function wa(e){Ln=e}let On;function Ua(e){On=e}let bn;function xa(e){bn=e}let In=null;const $a=e=>{In=e},Wa=()=>In;let Cn=null;const yn=e=>{Cn=e},Ga=()=>Cn;let An=0;function Ya(e={}){const t=G(e.onWarn)?e.onWarn:pe,n=I(e.version)?e.version:Fa,s=I(e.locale)||G(e.locale)?e.locale:Ue,a=G(s)?Ue:s,r=H(e.fallbackLocale)||M(e.fallbackLocale)||I(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a,o=M(e.messages)?e.messages:pt(a),l=M(e.datetimeFormats)?e.datetimeFormats:pt(a),u=M(e.numberFormats)?e.numberFormats:pt(a),_=J(W(),e.modifiers,Va()),N=e.pluralRules||W(),T=G(e.missing)?e.missing:null,E=V(e.missingWarn)||De(e.missingWarn)?e.missingWarn:!0,A=V(e.fallbackWarn)||De(e.fallbackWarn)?e.fallbackWarn:!0,k=!!e.fallbackFormat,S=!!e.unresolving,D=G(e.postTranslation)?e.postTranslation:null,f=M(e.processor)?e.processor:null,d=V(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter,g=G(e.messageCompiler)?e.messageCompiler:Ln;process.env.NODE_ENV!=="production"&&G(e.messageCompiler)&&it(Ie(te.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const C=G(e.messageResolver)?e.messageResolver:On||va,y=G(e.localeFallbacker)?e.localeFallbacker:bn||Oa,p=F(e.fallbackContext)?e.fallbackContext:void 0,R=e,x=F(R.__datetimeFormatters)?R.__datetimeFormatters:new Map,q=F(R.__numberFormatters)?R.__numberFormatters:new Map,ce=F(R.__meta)?R.__meta:{};An++;const Q={version:n,cid:An,locale:s,fallbackLocale:r,messages:o,modifiers:_,pluralRules:N,missing:T,missingWarn:E,fallbackWarn:A,fallbackFormat:k,unresolving:S,postTranslation:D,processor:f,warnHtmlMessage:d,escapeParameter:b,messageCompiler:g,messageResolver:C,localeFallbacker:y,fallbackContext:p,onWarn:t,__meta:ce};return Q.datetimeFormats=l,Q.numberFormats=u,Q.__datetimeFormatters=x,Q.__numberFormatters=q,process.env.NODE_ENV!=="production"&&(Q.__v_emitter=R.__v_emitter!=null?R.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&pa(Q,n,ce),Q}const pt=e=>({[e]:W()});function nt(e,t){return e instanceof RegExp?e.test(t):e}function Sn(e,t){return e instanceof RegExp?e.test(t):e}function ht(e,t,n,s,a){const{missing:r,onWarn:o}=e;if(process.env.NODE_ENV!=="production"){const l=e.__v_emitter;l&&l.emit("missing",{locale:n,key:t,type:a,groupId:`${a}:${t}`})}if(r!==null){const l=r(e,n,t,a);return I(l)?l:t}else return process.env.NODE_ENV!=="production"&&Sn(s,t)&&o(Ie(te.NOT_FOUND_KEY,{key:t,locale:n})),t}function xe(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Dn(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function Ha(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(Dn(e,t[s]))return!0;return!1}const kn=typeof Intl<"u",vn={dateTimeFormat:kn&&typeof Intl.DateTimeFormat<"u",numberFormat:kn&&typeof Intl.NumberFormat<"u"};function Pn(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:a,onWarn:r,localeFallbacker:o}=e,{__datetimeFormatters:l}=e;if(process.env.NODE_ENV!=="production"&&!vn.dateTimeFormat)return r(Ie(te.CANNOT_FORMAT_DATE)),tt;const[u,_,N,T]=Nt(...t),E=V(N.missingWarn)?N.missingWarn:e.missingWarn,A=V(N.fallbackWarn)?N.fallbackWarn:e.fallbackWarn,k=!!N.part,S=gt(e,N),D=o(e,a,S);if(!I(u)||u==="")return new Intl.DateTimeFormat(S,T).format(_);let f={},d,b=null,g=S,C=null;const y="datetime format";for(let x=0;x<D.length;x++){if(d=C=D[x],process.env.NODE_ENV!=="production"&&S!==d&&nt(A,u)&&r(Ie(te.FALLBACK_TO_DATE_FORMAT,{key:u,target:d})),process.env.NODE_ENV!=="production"&&S!==d){const q=e.__v_emitter;q&&q.emit("fallback",{type:y,key:u,from:g,to:C,groupId:`${y}:${u}`})}if(f=n[d]||{},b=f[u],M(b))break;ht(e,u,d,E,y),g=C}if(!M(b)||!I(d))return s?et:u;let p=`${d}__${u}`;Je(T)||(p=`${p}__${JSON.stringify(T)}`);let R=l.get(p);return R||(R=new Intl.DateTimeFormat(d,J({},b,T)),l.set(p,R)),k?R.formatToParts(_):R.format(_)}const Rn=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Nt(...e){const[t,n,s,a]=e,r=W();let o=W(),l;if(I(t)){const u=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!u)throw de(z.INVALID_ISO_DATE_ARGUMENT);const _=u[3]?u[3].trim().startsWith("T")?`${u[1].trim()}${u[3].trim()}`:`${u[1].trim()}T${u[3].trim()}`:u[1].trim();l=new Date(_);try{l.toISOString()}catch{throw de(z.INVALID_ISO_DATE_ARGUMENT)}}else if(Os(t)){if(isNaN(t.getTime()))throw de(z.INVALID_DATE_ARGUMENT);l=t}else if(X(t))l=t;else throw de(z.INVALID_ARGUMENT);return I(n)?r.key=n:M(n)&&Object.keys(n).forEach(u=>{Rn.includes(u)?o[u]=n[u]:r[u]=n[u]}),I(s)?r.locale=s:M(s)&&(o=s),M(a)&&(o=a),[r.key||"",l,r,o]}function Mn(e,t,n){const s=e;for(const a in n){const r=`${t}__${a}`;s.__datetimeFormatters.has(r)&&s.__datetimeFormatters.delete(r)}}function Fn(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:a,onWarn:r,localeFallbacker:o}=e,{__numberFormatters:l}=e;if(process.env.NODE_ENV!=="production"&&!vn.numberFormat)return r(Ie(te.CANNOT_FORMAT_NUMBER)),tt;const[u,_,N,T]=Tt(...t),E=V(N.missingWarn)?N.missingWarn:e.missingWarn,A=V(N.fallbackWarn)?N.fallbackWarn:e.fallbackWarn,k=!!N.part,S=gt(e,N),D=o(e,a,S);if(!I(u)||u==="")return new Intl.NumberFormat(S,T).format(_);let f={},d,b=null,g=S,C=null;const y="number format";for(let x=0;x<D.length;x++){if(d=C=D[x],process.env.NODE_ENV!=="production"&&S!==d&&nt(A,u)&&r(Ie(te.FALLBACK_TO_NUMBER_FORMAT,{key:u,target:d})),process.env.NODE_ENV!=="production"&&S!==d){const q=e.__v_emitter;q&&q.emit("fallback",{type:y,key:u,from:g,to:C,groupId:`${y}:${u}`})}if(f=n[d]||{},b=f[u],M(b))break;ht(e,u,d,E,y),g=C}if(!M(b)||!I(d))return s?et:u;let p=`${d}__${u}`;Je(T)||(p=`${p}__${JSON.stringify(T)}`);let R=l.get(p);return R||(R=new Intl.NumberFormat(d,J({},b,T)),l.set(p,R)),k?R.formatToParts(_):R.format(_)}const Vn=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Tt(...e){const[t,n,s,a]=e,r=W();let o=W();if(!X(t))throw de(z.INVALID_ARGUMENT);const l=t;return I(n)?r.key=n:M(n)&&Object.keys(n).forEach(u=>{Vn.includes(u)?o[u]=n[u]:r[u]=n[u]}),I(s)?r.locale=s:M(s)&&(o=s),M(a)&&(o=a),[r.key||"",l,r,o]}function wn(e,t,n){const s=e;for(const a in n){const r=`${t}__${a}`;s.__numberFormatters.has(r)&&s.__numberFormatters.delete(r)}}const Ba=e=>e,Ka=e=>"",ja="text",Xa=e=>e.length===0?"":lt(e),Ja=ys;function Un(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function qa(e){const t=X(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(X(e.named.count)||X(e.named.n))?X(e.named.count)?e.named.count:X(e.named.n)?e.named.n:t:t}function Qa(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Za(e={}){const t=e.locale,n=qa(e),s=F(e.pluralRules)&&I(t)&&G(e.pluralRules[t])?e.pluralRules[t]:Un,a=F(e.pluralRules)&&I(t)&&G(e.pluralRules[t])?Un:void 0,r=f=>f[s(n,f.length,a)],o=e.list||[],l=f=>o[f],u=e.named||W();X(e.pluralIndex)&&Qa(n,u);const _=f=>u[f];function N(f,d){const b=G(e.messages)?e.messages(f,!!d):F(e.messages)?e.messages[f]:!1;return b||(e.parent?e.parent.message(f):Ka)}const T=f=>e.modifiers?e.modifiers[f]:Ba,E=M(e.processor)&&G(e.processor.normalize)?e.processor.normalize:Xa,A=M(e.processor)&&G(e.processor.interpolate)?e.processor.interpolate:Ja,k=M(e.processor)&&I(e.processor.type)?e.processor.type:ja,D={list:l,named:_,plural:r,linked:(f,...d)=>{const[b,g]=d;let C="text",y="";d.length===1?F(b)?(y=b.modifier||y,C=b.type||C):I(b)&&(y=b||y):d.length===2&&(I(b)&&(y=b||y),I(g)&&(C=g||C));const p=N(f,!0)(D),R=C==="vnode"&&H(p)&&y?p[0]:p;return y?T(y)(R,C):R},message:N,type:k,interpolate:A,normalize:E,values:J(W(),o,u)};return D}const xn=()=>"",oe=e=>G(e);function $n(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:a,messageCompiler:r,fallbackLocale:o,messages:l}=e,[u,_]=Lt(...t),N=V(_.missingWarn)?_.missingWarn:e.missingWarn,T=V(_.fallbackWarn)?_.fallbackWarn:e.fallbackWarn,E=V(_.escapeParameter)?_.escapeParameter:e.escapeParameter,A=!!_.resolvedMessage,k=I(_.default)||V(_.default)?V(_.default)?r?u:()=>u:_.default:n?r?u:()=>u:null,S=n||k!=null&&(I(k)||G(k)),D=gt(e,_);E&&za(_);let[f,d,b]=A?[u,D,l[D]||W()]:Wn(e,u,D,o,T,N),g=f,C=u;if(!A&&!(I(g)||re(g)||oe(g))&&S&&(g=k,C=g),!A&&(!(I(g)||re(g)||oe(g))||!I(d)))return a?et:u;if(process.env.NODE_ENV!=="production"&&I(g)&&e.messageCompiler==null)return pe(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${u}'.`),u;let y=!1;const p=()=>{y=!0},R=oe(g)?g:Gn(e,u,d,g,C,p);if(y)return g;const x=sr(e,d,b,_),q=Za(x),ce=er(e,R,q),Q=s?s(ce,u):ce;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const Me={timestamp:Date.now(),key:I(u)?u:oe(g)?g.key:"",locale:d||(oe(g)?g.locale:""),format:I(g)?g:oe(g)?g.source:"",message:Q};Me.meta=J({},e.__meta,Wa()||{}),ha(Me)}return Q}function za(e){H(e.list)?e.list=e.list.map(t=>I(t)?Zt(t):t):F(e.named)&&Object.keys(e.named).forEach(t=>{I(e.named[t])&&(e.named[t]=Zt(e.named[t]))})}function Wn(e,t,n,s,a,r){const{messages:o,onWarn:l,messageResolver:u,localeFallbacker:_}=e,N=_(e,s,n);let T=W(),E,A=null,k=n,S=null;const D="translate";for(let f=0;f<N.length;f++){if(E=S=N[f],process.env.NODE_ENV!=="production"&&n!==E&&!Dn(n,E)&&nt(a,t)&&l(Ie(te.FALLBACK_TO_TRANSLATE,{key:t,target:E})),process.env.NODE_ENV!=="production"&&n!==E){const C=e.__v_emitter;C&&C.emit("fallback",{type:D,key:t,from:k,to:S,groupId:`${D}:${t}`})}T=o[E]||W();let d=null,b,g;if(process.env.NODE_ENV!=="production"&&le&&(d=window.performance.now(),b="intlify-message-resolve-start",g="intlify-message-resolve-end",se&&se(b)),(A=u(T,t))===null&&(A=T[t]),process.env.NODE_ENV!=="production"&&le){const C=window.performance.now(),y=e.__v_emitter;y&&d&&A&&y.emit("message-resolve",{type:"message-resolve",key:t,message:A,time:C-d,groupId:`${D}:${t}`}),b&&g&&se&&Oe&&(se(g),Oe("intlify message resolve",b,g))}if(I(A)||re(A)||oe(A))break;if(!Ha(E,N)){const C=ht(e,t,E,r,D);C!==t&&(A=C)}k=S}return[A,E,T]}function Gn(e,t,n,s,a,r){const{messageCompiler:o,warnHtmlMessage:l}=e;if(oe(s)){const E=s;return E.locale=E.locale||n,E.key=E.key||t,E}if(o==null){const E=()=>s;return E.locale=n,E.key=t,E}let u=null,_,N;process.env.NODE_ENV!=="production"&&le&&(u=window.performance.now(),_="intlify-message-compilation-start",N="intlify-message-compilation-end",se&&se(_));const T=o(s,tr(e,n,a,s,l,r));if(process.env.NODE_ENV!=="production"&&le){const E=window.performance.now(),A=e.__v_emitter;A&&u&&A.emit("message-compilation",{type:"message-compilation",message:s,time:E-u,groupId:`translate:${t}`}),_&&N&&se&&Oe&&(se(N),Oe("intlify message compilation",_,N))}return T.locale=n,T.key=t,T.source=s,T}function er(e,t,n){let s=null,a,r;process.env.NODE_ENV!=="production"&&le&&(s=window.performance.now(),a="intlify-message-evaluation-start",r="intlify-message-evaluation-end",se&&se(a));const o=t(n);if(process.env.NODE_ENV!=="production"&&le){const l=window.performance.now(),u=e.__v_emitter;u&&s&&u.emit("message-evaluation",{type:"message-evaluation",value:o,time:l-s,groupId:`translate:${t.key}`}),a&&r&&se&&Oe&&(se(r),Oe("intlify message evaluation",a,r))}return o}function Lt(...e){const[t,n,s]=e,a=W();if(!I(t)&&!X(t)&&!oe(t)&&!re(t))throw de(z.INVALID_ARGUMENT);const r=X(t)?String(t):(oe(t),t);return X(n)?a.plural=n:I(n)?a.default=n:M(n)&&!Je(n)?a.named=n:H(n)&&(a.list=n),X(s)?a.plural=s:I(s)?a.default=s:M(s)&&J(a,s),[r,a]}function tr(e,t,n,s,a,r){return{locale:t,key:n,warnHtmlMessage:a,onError:o=>{if(r&&r(o),process.env.NODE_ENV!=="production"){const l=nr(s),u=`Message compilation error: ${o.message}`,_=o.location&&l&&As(l,o.location.start.offset,o.location.end.offset),N=e.__v_emitter;N&&l&&N.emit("compile-error",{message:l,error:o.message,start:o.location&&o.location.start.offset,end:o.location&&o.location.end.offset,groupId:`translate:${n}`}),console.error(_?`${u}
|
|
17
|
+
${_}`:u)}else throw o},onCacheKey:o=>Ts(t,n,o)}}function nr(e){if(I(e))return e;if(e.loc&&e.loc.source)return e.loc.source}function sr(e,t,n,s){const{modifiers:a,pluralRules:r,messageResolver:o,fallbackLocale:l,fallbackWarn:u,missingWarn:_,fallbackContext:N}=e,E={locale:t,modifiers:a,pluralRules:r,messages:(A,k)=>{let S=o(n,A);if(S==null&&(N||k)){const[,,D]=Wn(N||e,A,t,l,u,_);S=o(D,A)}if(I(S)||re(S)){let D=!1;const d=Gn(e,A,t,S,A,()=>{D=!0});return D?xn:d}else return oe(S)?S:xn}};return e.processor&&(E.processor=e.processor),s.list&&(E.list=s.list),s.named&&(E.named=s.named),X(s.plural)&&(E.pluralIndex=s.plural),E}sa();function ar(){return Yn().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Yn(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const rr=typeof Proxy=="function",or="devtools-plugin:setup",lr="plugin:settings:set";let Re,Ot;function ir(){var e;return Re!==void 0||(typeof window<"u"&&window.performance?(Re=!0,Ot=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Re=!0,Ot=globalThis.perf_hooks.performance):Re=!1),Re}function cr(){return ir()?Ot.now():Date.now()}class ur{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const s={};if(t.settings)for(const o in t.settings){const l=t.settings[o];s[o]=l.defaultValue}const a=`__vue-devtools-plugin-settings__${t.id}`;let r=Object.assign({},s);try{const o=localStorage.getItem(a),l=JSON.parse(o);Object.assign(r,l)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(a,JSON.stringify(o))}catch{}r=o},now(){return cr()}},n&&n.on(lr,(o,l)=>{o===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(o,l)=>this.target?this.target.on[l]:(...u)=>{this.onQueue.push({method:l,args:u})}}),this.proxiedTarget=new Proxy({},{get:(o,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...u)=>(this.targetQueue.push({method:l,args:u,resolve:()=>{}}),this.fallbacks[l](...u)):(...u)=>new Promise(_=>{this.targetQueue.push({method:l,args:u,resolve:_})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function fr(e,t){const n=e,s=Yn(),a=ar(),r=rr&&n.enableEarlyProxy;if(a&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))a.emit(or,e,t);else{const o=r?new ur(n,a):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:o}),o&&t(o.proxiedTarget)}}/*!
|
|
19
18
|
* vue-i18n v11.1.3
|
|
20
19
|
* (c) 2025 kazuya kawaguchi
|
|
21
20
|
* Released under the MIT License.
|
|
22
|
-
*/const
|
|
23
|
-
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[de.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function Ye(e,...t){return et(Ta[e],...t)}function He(e){if(!K(e)||ie(e))return e;for(const t in e)if(ce(e,t))if(!t.includes("."))K(e[t])&&He(e[t]);else{const n=t.split("."),s=n.length-1;let a=e,r=!1;for(let i=0;i<s;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in a||(a[n[i]]=G()),!K(a[n[i]])){process.env.NODE_ENV!=="production"&&Ee(Ye(de.IGNORE_OBJ_FLATTEN,{key:n[i]})),r=!0;break}a=a[n[i]]}if(r||(ie(a)?bn.includes(n[s])||delete e[t]:(a[n[s]]=e[t],delete e[t])),!ie(a)){const i=a[n[s]];K(i)&&He(i)}}return e}function Mt(e,t){const{messages:n,__i18n:s,messageResolver:a,flatJson:r}=t,i=F(n)?n:X(s)?G():{[e]:G()};if(X(s)&&s.forEach(c=>{if("locale"in c&&"resource"in c){const{locale:f,resource:g}=c;f?(i[f]=i[f]||G(),st(g,i[f])):st(g,i)}else A(c)&&st(JSON.parse(c),i)}),a==null&&r)for(const c in i)ce(i,c)&&He(i[c]);return i}function Qn(e){return e.type}function Zn(e,t,n){let s=K(t.messages)?t.messages:G();"__i18nGlobal"in n&&(s=Mt(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const a=Object.keys(s);a.length&&a.forEach(r=>{e.mergeLocaleMessage(r,s[r])});{if(K(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(i=>{e.mergeDateTimeFormat(i,t.datetimeFormats[i])})}if(K(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(i=>{e.mergeNumberFormat(i,t.numberFormats[i])})}}}function zn(e){return C.createVNode(C.Text,null,e,0)}const es="__INTLIFY_META__",ts=()=>[],La=()=>!1;let ns=0;function ss(e){return(t,n,s,a)=>e(n,s,C.getCurrentInstance()||void 0,a)}const Ca=()=>{const e=C.getCurrentInstance();let t=null;return e&&(t=Qn(e)[es])?{[es]:t}:null};function wt(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,a=e.flatJson,r=le?C.ref:C.shallowRef;let i=U(e.inheritLocale)?e.inheritLocale:!0;const c=r(t&&i?t.locale.value:A(e.locale)?e.locale:We),f=r(t&&i?t.fallbackLocale.value:A(e.fallbackLocale)||X(e.fallbackLocale)||F(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),g=r(Mt(c.value,e)),N=r(F(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),v=r(F(e.numberFormats)?e.numberFormats:{[c.value]:{}});let y=t?t.missingWarn:U(e.missingWarn)||Re(e.missingWarn)?e.missingWarn:!0,O=t?t.fallbackWarn:U(e.fallbackWarn)||Re(e.fallbackWarn)?e.fallbackWarn:!0,P=t?t.fallbackRoot:U(e.fallbackRoot)?e.fallbackRoot:!0,S=!!e.fallbackFormat,k=B(e.missing)?e.missing:null,o=B(e.missing)?ss(e.missing):null,m=B(e.postTranslation)?e.postTranslation:null,l=t?t.warnHtmlMessage:U(e.warnHtmlMessage)?e.warnHtmlMessage:!0,u=!!e.escapeParameter;const _=t?t.modifiers:F(e.modifiers)?e.modifiers:{};let E=e.pluralRules||t&&t.pluralRules,p;p=(()=>{s&&Dn(null);const b={version:ya,locale:c.value,fallbackLocale:f.value,messages:g.value,modifiers:_,pluralRules:E,missing:o===null?void 0:o,missingWarn:y,fallbackWarn:O,fallbackFormat:S,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:l,escapeParameter:u,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};b.datetimeFormats=N.value,b.numberFormats=v.value,b.__datetimeFormatters=F(p)?p.__datetimeFormatters:void 0,b.__numberFormatters=F(p)?p.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(b.__v_emitter=F(p)?p.__v_emitter:void 0);const L=Qr(b);return s&&Dn(L),L})(),Ge(p,c.value,f.value);function R(){return[c.value,f.value,g.value,N.value,v.value]}const w=C.computed({get:()=>c.value,set:b=>{p.locale=b,c.value=b}}),H=C.computed({get:()=>f.value,set:b=>{p.fallbackLocale=b,f.value=b,Ge(p,c.value,b)}}),$=C.computed(()=>g.value),_e=C.computed(()=>N.value),me=C.computed(()=>v.value);function Se(){return B(m)?m:null}function re(b){m=b,p.postTranslation=b}function ve(){return k}function Ue(b){b!==null&&(o=ss(b)),k=b,p.missing=o}function Xe(b,L){return b!=="translate"||!L.resolvedMessage}const pe=(b,L,x,Q,De,dt)=>{R();let Ve;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(p.fallbackContext=t?Jr():void 0),Ve=b(p)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(p.fallbackContext=void 0)}if(x!=="translate exists"&&Z(Ve)&&Ve===it||x==="translate exists"&&!Ve){const[Pe,Ei]=L();if(process.env.NODE_ENV!=="production"&&t&&A(Pe)&&Xe(x,Ei)&&(P&&(lt(O,Pe)||Rn(y,Pe))&&Ee(Ye(de.FALLBACK_TO_ROOT,{key:Pe,type:x})),process.env.NODE_ENV!=="production")){const{__v_emitter:vs}=p;vs&&P&&vs.emit("fallback",{type:x,key:Pe,to:"global",groupId:`${x}:${Pe}`})}return t&&P?Q(t):De(Pe)}else{if(dt(Ve))return Ve;throw se(Y.UNEXPECTED_RETURN_TYPE)}};function qe(...b){return pe(L=>Reflect.apply(Yn,null,[L,...b]),()=>At(...b),"translate",L=>Reflect.apply(L.t,L,[...b]),L=>L,L=>A(L))}function Gt(...b){const[L,x,Q]=b;if(Q&&!K(Q))throw se(Y.INVALID_ARGUMENT);return qe(L,x,z({resolvedMessage:!0},Q||{}))}function Bt(...b){return pe(L=>Reflect.apply(Kn,null,[L,...b]),()=>Ot(...b),"datetime format",L=>Reflect.apply(L.d,L,[...b]),()=>ot,L=>A(L))}function Yt(...b){return pe(L=>Reflect.apply(xn,null,[L,...b]),()=>It(...b),"number format",L=>Reflect.apply(L.n,L,[...b]),()=>ot,L=>A(L))}function Ht(b){return b.map(L=>A(L)||Z(L)||U(L)?zn(String(L)):L)}const jt={normalize:Ht,interpolate:b=>b,type:"vnode"};function ft(...b){return pe(L=>{let x;const Q=L;try{Q.processor=jt,x=Reflect.apply(Yn,null,[Q,...b])}finally{Q.processor=null}return x},()=>At(...b),"translate",L=>L[kt](...b),L=>[zn(L)],L=>X(L))}function Xt(...b){return pe(L=>Reflect.apply(xn,null,[L,...b]),()=>It(...b),"number format",L=>L[Pt](...b),ts,L=>A(L)||X(L))}function qt(...b){return pe(L=>Reflect.apply(Kn,null,[L,...b]),()=>Ot(...b),"datetime format",L=>L[Dt](...b),ts,L=>A(L)||X(L))}function Jt(b){E=b,p.pluralRules=E}function Qt(b,L){return pe(()=>{if(!b)return!1;const x=A(L)?L:c.value,Q=ke(x),De=p.messageResolver(Q,b);return ie(De)||oe(De)||A(De)},()=>[b],"translate exists",x=>Reflect.apply(x.te,x,[b,L]),La,x=>U(x))}function Je(b){let L=null;const x=vn(p,f.value,c.value);for(let Q=0;Q<x.length;Q++){const De=g.value[x[Q]]||{},dt=p.messageResolver(De,b);if(dt!=null){L=dt;break}}return L}function Qe(b){const L=Je(b);return L??(t?t.tm(b)||{}:{})}function ke(b){return g.value[b]||{}}function Ze(b,L){if(a){const x={[b]:L};for(const Q in x)ce(x,Q)&&He(x[Q]);L=x[b]}g.value[b]=L,p.messages=g.value}function Zt(b,L){g.value[b]=g.value[b]||{};const x={[b]:L};if(a)for(const Q in x)ce(x,Q)&&He(x[Q]);L=x[b],st(L,g.value[b]),p.messages=g.value}function d(b){return N.value[b]||{}}function h(b,L){N.value[b]=L,p.datetimeFormats=N.value,Vn(p,b,L)}function T(b,L){N.value[b]=z(N.value[b]||{},L),p.datetimeFormats=N.value,Vn(p,b,L)}function D(b){return v.value[b]||{}}function q(b,L){v.value[b]=L,p.numberFormats=v.value,Wn(p,b,L)}function J(b,L){v.value[b]=z(v.value[b]||{},L),p.numberFormats=v.value,Wn(p,b,L)}ns++,t&&le&&(C.watch(t.locale,b=>{i&&(c.value=b,p.locale=b,Ge(p,c.value,f.value))}),C.watch(t.fallbackLocale,b=>{i&&(f.value=b,p.fallbackLocale=b,Ge(p,c.value,f.value))}));const V={id:ns,locale:w,fallbackLocale:H,get inheritLocale(){return i},set inheritLocale(b){i=b,b&&t&&(c.value=t.locale.value,f.value=t.fallbackLocale.value,Ge(p,c.value,f.value))},get availableLocales(){return Object.keys(g.value).sort()},messages:$,get modifiers(){return _},get pluralRules(){return E||{}},get isGlobal(){return s},get missingWarn(){return y},set missingWarn(b){y=b,p.missingWarn=y},get fallbackWarn(){return O},set fallbackWarn(b){O=b,p.fallbackWarn=O},get fallbackRoot(){return P},set fallbackRoot(b){P=b},get fallbackFormat(){return S},set fallbackFormat(b){S=b,p.fallbackFormat=S},get warnHtmlMessage(){return l},set warnHtmlMessage(b){l=b,p.warnHtmlMessage=b},get escapeParameter(){return u},set escapeParameter(b){u=b,p.escapeParameter=b},t:qe,getLocaleMessage:ke,setLocaleMessage:Ze,mergeLocaleMessage:Zt,getPostTranslationHandler:Se,setPostTranslationHandler:re,getMissingHandler:ve,setMissingHandler:Ue,[qn]:Jt};return V.datetimeFormats=_e,V.numberFormats=me,V.rt=Gt,V.te=Qt,V.tm=Qe,V.d=Bt,V.n=Yt,V.getDateTimeFormat=d,V.setDateTimeFormat=h,V.mergeDateTimeFormat=T,V.getNumberFormat=D,V.setNumberFormat=q,V.mergeNumberFormat=J,V[Jn]=n,V[kt]=ft,V[Dt]=qt,V[Pt]=Xt,process.env.NODE_ENV!=="production"&&(V[Ie]=b=>{p.__v_emitter=b},V[Be]=()=>{p.__v_emitter=void 0}),V}const rs="vue-i18n: composer properties",Ft={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},Oa={"vue-i18n-resource-inspector":"Search for scopes ..."},Ia={"vue-i18n-timeline":16764185};let Kt;async function Aa(e,t){return new Promise((n,s)=>{try{ba({id:"vue-devtools-plugin-vue-i18n",label:Ft["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[rs],app:e},a=>{Kt=a,a.on.visitComponentTree(({componentInstance:i,treeNode:c})=>{Sa(i,c,t)}),a.on.inspectComponent(({componentInstance:i,instanceData:c})=>{i.vnode.el&&i.vnode.el.__VUE_I18N__&&c&&(t.mode==="legacy"?i.vnode.el.__VUE_I18N__!==t.global.__composer&&is(c,i.vnode.el.__VUE_I18N__):is(c,i.vnode.el.__VUE_I18N__))}),a.addInspector({id:"vue-i18n-resource-inspector",label:Ft["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:Oa["vue-i18n-resource-inspector"]}),a.on.getInspectorTree(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&Ma(i,t)});const r=new Map;a.on.getInspectorState(async i=>{if(i.app===e&&i.inspectorId==="vue-i18n-resource-inspector")if(a.unhighlightElement(),Fa(i,t),i.nodeId==="global"){if(!r.has(i.app)){const[c]=await a.getComponentInstances(i.app);r.set(i.app,c)}a.highlightElement(r.get(i.app))}else{const c=wa(i.nodeId,t);c&&a.highlightElement(c)}}),a.on.editInspectorState(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&Ua(i,t)}),a.addTimelineLayer({id:"vue-i18n-timeline",label:Ft["vue-i18n-timeline"],color:Ia["vue-i18n-timeline"]}),n(!0)})}catch(a){console.error(a),s(!1)}})}function as(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function Sa(e,t,n){const s=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==s){const a={label:`i18n (${as(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(a)}}function is(e,t){const n=rs;e.state.push({type:n,key:"locale",editable:!0,value:t.locale.value}),e.state.push({type:n,key:"availableLocales",editable:!1,value:t.availableLocales}),e.state.push({type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),e.state.push({type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}),e.state.push({type:n,key:"messages",editable:!1,value:Ut(t.messages.value)}),e.state.push({type:n,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),e.state.push({type:n,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function Ut(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];B(s)&&"source"in s?t[n]=Ra(s):ie(s)&&s.loc&&s.loc.source?t[n]=s.loc.source:K(s)?t[n]=Ut(s):t[n]=s}),t}const ka={"<":"<",">":">",'"':""","&":"&"};function Da(e){return e.replace(/[<>"&]/g,Pa)}function Pa(e){return ka[e]||e}function Ra(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${Da(e.source)}")`:"(?)"}`}}}function Ma(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[s,a]of t.__instances){const r=t.mode==="composition"?a:a.__composer;n!==r&&e.rootNodes.push({id:r.id.toString(),label:`${as(s)} Scope`})}}function wa(e,t){let n=null;if(e!=="global"){for(const[s,a]of t.__instances.entries())if(a.id.toString()===e){n=s;break}}return n}function os(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(s=>s.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function Fa(e,t){const n=os(e.nodeId,t);return n&&(e.state=Ka(n)),null}function Ka(e){const t={},n="Locale related info",s=[{type:n,key:"locale",editable:!0,value:e.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:e.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}];t[n]=s;const a="Locale messages info",r=[{type:a,key:"messages",editable:!1,value:Ut(e.messages.value)}];t[a]=r;{const i="Datetime formats info",c=[{type:i,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[i]=c;const f="Datetime formats info",g=[{type:f,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[f]=g}return t}function je(e,t){if(Kt){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),Kt.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:e,groupId:n,time:Date.now(),meta:{},data:t||{},logType:e==="compile-error"?"error":e==="fallback"||e==="missing"?"warning":"default"}})}}function Ua(e,t){const n=os(e.nodeId,t);if(n){const[s]=e.path;s==="locale"&&A(e.state.value)?n.locale.value=e.state.value:s==="fallbackLocale"&&(A(e.state.value)||X(e.state.value)||K(e.state.value))?n.fallbackLocale.value=e.state.value:s==="inheritLocale"&&U(e.state.value)&&(n.inheritLocale=e.state.value)}}function Va(e){const t=A(e.locale)?e.locale:We,n=A(e.fallbackLocale)||X(e.fallbackLocale)||F(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=B(e.missing)?e.missing:void 0,a=U(e.silentTranslationWarn)||Re(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=U(e.silentFallbackWarn)||Re(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,i=U(e.fallbackRoot)?e.fallbackRoot:!0,c=!!e.formatFallbackMessages,f=F(e.modifiers)?e.modifiers:{},g=e.pluralizationRules,N=B(e.postTranslation)?e.postTranslation:void 0,v=A(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,y=!!e.escapeParameterHtml,O=U(e.sync)?e.sync:!0;let P=e.messages;if(F(e.sharedMessages)){const _=e.sharedMessages;P=Object.keys(_).reduce((p,I)=>{const R=p[I]||(p[I]={});return z(R,_[I]),p},P||{})}const{__i18n:S,__root:k,__injectWithOption:o}=e,m=e.datetimeFormats,l=e.numberFormats,u=e.flatJson;return{locale:t,fallbackLocale:n,messages:P,flatJson:u,datetimeFormats:m,numberFormats:l,missing:s,missingWarn:a,fallbackWarn:r,fallbackRoot:i,fallbackFormat:c,modifiers:f,pluralRules:g,postTranslation:N,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,inheritLocale:O,__i18n:S,__root:k,__injectWithOption:o}}function Vt(e={}){const t=wt(Va(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(a){t.locale.value=a},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(a){t.fallbackLocale.value=a},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(a){t.setMissingHandler(a)},get silentTranslationWarn(){return U(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(a){t.missingWarn=U(a)?!a:a},get silentFallbackWarn(){return U(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(a){t.fallbackWarn=U(a)?!a:a},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(a){t.fallbackFormat=a},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(a){t.setPostTranslationHandler(a)},get sync(){return t.inheritLocale},set sync(a){t.inheritLocale=a},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(a){t.warnHtmlMessage=a!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(a){t.escapeParameter=a},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...a){return Reflect.apply(t.t,t,[...a])},rt(...a){return Reflect.apply(t.rt,t,[...a])},te(a,r){return t.te(a,r)},tm(a){return t.tm(a)},getLocaleMessage(a){return t.getLocaleMessage(a)},setLocaleMessage(a,r){t.setLocaleMessage(a,r)},mergeLocaleMessage(a,r){t.mergeLocaleMessage(a,r)},d(...a){return Reflect.apply(t.d,t,[...a])},getDateTimeFormat(a){return t.getDateTimeFormat(a)},setDateTimeFormat(a,r){t.setDateTimeFormat(a,r)},mergeDateTimeFormat(a,r){t.mergeDateTimeFormat(a,r)},n(...a){return Reflect.apply(t.n,t,[...a])},getNumberFormat(a){return t.getNumberFormat(a)},setNumberFormat(a,r){t.setNumberFormat(a,r)},mergeNumberFormat(a,r){t.mergeNumberFormat(a,r)}};return s.__extender=n,process.env.NODE_ENV!=="production"&&(s.__enableEmitter=a=>{const r=t;r[Ie]&&r[Ie](a)},s.__disableEmitter=()=>{const a=t;a[Be]&&a[Be]()}),s}function xa(e,t,n){return{beforeCreate(){const s=C.getCurrentInstance();if(!s)throw se(Y.UNEXPECTED_ERROR);const a=this.$options;if(a.i18n){const r=a.i18n;if(a.__i18n&&(r.__i18n=a.__i18n),r.__root=t,this===this.$root)this.$i18n=ls(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=Vt(r);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(a.__i18n)if(this===this.$root)this.$i18n=ls(e,a);else{this.$i18n=Vt({__i18n:a.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;a.__i18nGlobal&&Zn(t,a,a),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$te=(r,i)=>this.$i18n.te(r,i),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(s,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const s=this.$i18n;this.$el.__VUE_I18N__=s.__composer;const a=this.__v_emitter=gt();s.__enableEmitter&&s.__enableEmitter(a),a.on("*",je)}},unmounted(){const s=C.getCurrentInstance();if(!s)throw se(Y.UNEXPECTED_ERROR);const a=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",je),delete this.__v_emitter),this.$i18n&&(a.__disableEmitter&&a.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,a.__disposer&&(a.__disposer(),delete a.__disposer,delete a.__extender),n.__deleteInstance(s),delete this.$i18n}}}function ls(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[qn](t.pluralizationRules||e.pluralizationRules);const n=Mt(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const xt={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function $a({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,a)=>[...s,...a.type===C.Fragment?a.children:[a]],[]):t.reduce((n,s)=>{const a=e[s];return a&&(n[s]=a()),n},G())}function cs(){return C.Fragment}const us=C.defineComponent({name:"i18n-t",props:z({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Z(e)||!isNaN(e)}},xt),setup(e,t){const{slots:n,attrs:s}=t,a=e.i18n||$t({useScope:e.scope,__useComponent:!0});return()=>{const r=Object.keys(n).filter(v=>v!=="_"),i=G();e.locale&&(i.locale=e.locale),e.plural!==void 0&&(i.plural=A(e.plural)?+e.plural:e.plural);const c=$a(t,r),f=a[kt](e.keypath,c,i),g=z(G(),s),N=A(e.tag)||K(e.tag)?e.tag:cs();return C.h(N,g,f)}}});function Wa(e){return X(e)&&!A(e[0])}function fs(e,t,n,s){const{slots:a,attrs:r}=t;return()=>{const i={part:!0};let c=G();e.locale&&(i.locale=e.locale),A(e.format)?i.key=e.format:K(e.format)&&(A(e.format.key)&&(i.key=e.format.key),c=Object.keys(e.format).reduce((y,O)=>n.includes(O)?z(G(),y,{[O]:e.format[O]}):y,G()));const f=s(e.value,i,c);let g=[i.key];X(f)?g=f.map((y,O)=>{const P=a[y.type],S=P?P({[y.type]:y.value,index:O,parts:f}):[y.value];return Wa(S)&&(S[0].key=`${y.type}-${O}`),S}):A(f)&&(g=[f]);const N=z(G(),r),v=A(e.tag)||K(e.tag)?e.tag:cs();return C.h(v,N,g)}}const ds=C.defineComponent({name:"i18n-n",props:z({value:{type:Number,required:!0},format:{type:[String,Object]}},xt),setup(e,t){const n=e.i18n||$t({useScope:e.scope,__useComponent:!0});return fs(e,t,$n,(...s)=>n[Pt](...s))}});function Ga(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function Ba(e){const t=i=>{process.env.NODE_ENV!=="production"&&ht(Ye(de.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:c,value:f}=i;if(!c||!c.$)throw se(Y.UNEXPECTED_ERROR);const g=Ga(e,c.$),N=_s(f);return[Reflect.apply(g.t,g,[...ms(N)]),g]};return{created:(i,c)=>{const[f,g]=t(c);le&&e.global===g&&(i.__i18nWatcher=C.watch(g.locale,()=>{c.instance&&c.instance.$forceUpdate()})),i.__composer=g,i.textContent=f},unmounted:i=>{le&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:c})=>{if(i.__composer){const f=i.__composer,g=_s(c);i.textContent=Reflect.apply(f.t,f,[...ms(g)])}},getSSRProps:i=>{const[c]=t(i);return{textContent:c}}}}function _s(e){if(A(e))return{path:e};if(F(e)){if(!("path"in e))throw se(Y.REQUIRED_VALUE,"path");return e}else throw se(Y.INVALID_VALUE)}function ms(e){const{path:t,locale:n,args:s,choice:a,plural:r}=e,i={},c=s||{};return A(n)&&(i.locale=n),Z(a)&&(i.plural=a),Z(r)&&(i.plural=r),[t,c,i]}function Ya(e,t,...n){const s=F(n[0])?n[0]:{};(U(s.globalInstall)?s.globalInstall:!0)&&([us.name,"I18nT"].forEach(r=>e.component(r,us)),[ds.name,"I18nN"].forEach(r=>e.component(r,ds)),[gs.name,"I18nD"].forEach(r=>e.component(r,gs))),e.directive("t",Ba(t))}const Ha=ue("global-vue-i18n");function ja(e={}){const t=__VUE_I18N_LEGACY_API__&&U(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&t&&ht(Ye(de.DEPRECATE_LEGACY_MODE));const n=U(e.globalInjection)?e.globalInjection:!0,s=new Map,[a,r]=Xa(e,t),i=ue(process.env.NODE_ENV!=="production"?"vue-i18n":"");function c(v){return s.get(v)||null}function f(v,y){s.set(v,y)}function g(v){s.delete(v)}const N={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(v,...y){if(process.env.NODE_ENV!=="production"&&(v.__VUE_I18N__=N),v.__VUE_I18N_SYMBOL__=i,v.provide(v.__VUE_I18N_SYMBOL__,N),F(y[0])){const S=y[0];N.__composerExtend=S.__composerExtend,N.__vueI18nExtend=S.__vueI18nExtend}let O=null;!t&&n&&(O=ni(v,N.global)),__VUE_I18N_FULL_INSTALL__&&Ya(v,N,...y),__VUE_I18N_LEGACY_API__&&t&&v.mixin(xa(r,r.__composer,N));const P=v.unmount;if(v.unmount=()=>{O&&O(),N.dispose(),P()},process.env.NODE_ENV!=="production"){if(!await Aa(v,N))throw se(Y.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const k=gt();if(t){const o=r;o.__enableEmitter&&o.__enableEmitter(k)}else{const o=r;o[Ie]&&o[Ie](k)}k.on("*",je)}},get global(){return r},dispose(){a.stop()},__instances:s,__getInstance:c,__setInstance:f,__deleteInstance:g};return N}function $t(e={}){const t=C.getCurrentInstance();if(t==null)throw se(Y.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw se(Y.NOT_INSTALLED);const n=qa(t),s=Qa(n),a=Qn(t),r=Ja(e,a);if(r==="global")return Zn(s,e,a),s;if(r==="parent"){let f=Za(n,t,e.__useComponent);return f==null&&(process.env.NODE_ENV!=="production"&&Ee(Ye(de.NOT_FOUND_PARENT_SCOPE)),f=s),f}const i=n;let c=i.__getInstance(t);if(c==null){const f=z({},e);"__i18n"in a&&(f.__i18n=a.__i18n),s&&(f.__root=s),c=wt(f),i.__composerExtend&&(c[Rt]=i.__composerExtend(c)),ei(i,t,c),i.__setInstance(t,c)}return c}function Xa(e,t){const n=C.effectScope(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Vt(e)):n.run(()=>wt(e));if(s==null)throw se(Y.UNEXPECTED_ERROR);return[n,s]}function qa(e){const t=C.inject(e.isCE?Ha:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw se(e.isCE?Y.NOT_INSTALLED_WITH_PROVIDE:Y.UNEXPECTED_ERROR);return t}function Ja(e,t){return tt(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Qa(e){return e.mode==="composition"?e.global:e.global.__composer}function Za(e,t,n=!1){let s=null;const a=t.root;let r=za(t,n);for(;r!=null;){const i=e;if(e.mode==="composition")s=i.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const c=i.__getInstance(r);c!=null&&(s=c.__composer,n&&s&&!s[Jn]&&(s=null))}if(s!=null||a===r)break;r=r.parent}return s}function za(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function ei(e,t,n){let s=null;C.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,s=gt();const a=n;a[Ie]&&a[Ie](s),s.on("*",je)}},t),C.onUnmounted(()=>{const a=n;process.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(s&&s.off("*",je),a[Be]&&a[Be](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const r=a[Rt];r&&(r(),delete a[Rt])},t)}const ti=["locale","fallbackLocale","availableLocales"],hs=["t","rt","d","n","tm","te"];function ni(e,t){const n=Object.create(null);return ti.forEach(a=>{const r=Object.getOwnPropertyDescriptor(t,a);if(!r)throw se(Y.UNEXPECTED_ERROR);const i=C.isRef(r.value)?{get(){return r.value.value},set(c){r.value.value=c}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,a,i)}),e.config.globalProperties.$i18n=n,hs.forEach(a=>{const r=Object.getOwnPropertyDescriptor(t,a);if(!r||!r.value)throw se(Y.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${a}`,r)}),()=>{delete e.config.globalProperties.$i18n,hs.forEach(a=>{delete e.config.globalProperties[`$${a}`]})}}const gs=C.defineComponent({name:"i18n-d",props:z({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},xt),setup(e,t){const n=e.i18n||$t({useScope:e.scope,__useComponent:!0});return fs(e,t,Un,(...s)=>n[Dt](...s))}});if(Na(),Yr(Tr),Hr(xr),jr(vn),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=Ce();e.__INTLIFY__=!0,Lr(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;var ct={exports:{}};/*! store2 - v2.14.4 - 2024-12-26
|
|
24
|
-
* Copyright (c) 2024 Nathan Bubna; Licensed MIT */var Wt=ct.exports,ps;function si(){return ps||(ps=1,function(e){(function(t,n){var s={version:"2.14.4",areas:{},apis:{},nsdelim:".",inherit:function(r,i){for(var c in r)i.hasOwnProperty(c)||Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(r,c));return i},stringify:function(r,i){return r===void 0||typeof r=="function"?r+"":JSON.stringify(r,i||s.replace)},parse:function(r,i){try{return JSON.parse(r,i||s.revive)}catch{return r}},fn:function(r,i){s.storeAPI[r]=i;for(var c in s.apis)s.apis[c][r]=i},get:function(r,i){return r.getItem(i)},set:function(r,i,c){r.setItem(i,c)},remove:function(r,i){r.removeItem(i)},key:function(r,i){return r.key(i)},length:function(r){return r.length},clear:function(r){r.clear()},Store:function(r,i,c){var f=s.inherit(s.storeAPI,function(N,v,y){return arguments.length===0?f.getAll():typeof v=="function"?f.transact(N,v,y):v!==void 0?f.set(N,v,y):typeof N=="string"||typeof N=="number"?f.get(N):typeof N=="function"?f.each(N):N?f.setAll(N,v):f.clear()});f._id=r;try{var g="__store2_test";i.setItem(g,"ok"),f._area=i,i.removeItem(g)}catch{f._area=s.storage("fake")}return f._ns=c||"",s.areas[r]||(s.areas[r]=f._area),s.apis[f._ns+f._id]||(s.apis[f._ns+f._id]=f),f},storeAPI:{area:function(r,i){var c=this[r];return(!c||!c.area)&&(c=s.Store(r,i,this._ns),this[r]||(this[r]=c)),c},namespace:function(r,i,c){if(c=c||this._delim||s.nsdelim,!r)return this._ns?this._ns.substring(0,this._ns.length-c.length):"";var f=r,g=this[f];if((!g||!g.namespace)&&(g=s.Store(this._id,this._area,this._ns+f+c),g._delim=c,this[f]||(this[f]=g),!i))for(var N in s.areas)g.area(N,s.areas[N]);return g},isFake:function(r){return r?(this._real=this._area,this._area=s.storage("fake")):r===!1&&(this._area=this._real||this._area),this._area.name==="fake"},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(r){return this._area.has?this._area.has(this._in(r)):this._in(r)in this._area},size:function(){return this.keys().length},each:function(r,i){for(var c=0,f=s.length(this._area);c<f;c++){var g=this._out(s.key(this._area,c));if(g!==void 0&&r.call(this,g,this.get(g),i)===!1)break;f>s.length(this._area)&&(f--,c--)}return i||this},keys:function(r){return this.each(function(i,c,f){f.push(i)},r||[])},get:function(r,i){var c=s.get(this._area,this._in(r)),f;return typeof i=="function"&&(f=i,i=null),c!==null?s.parse(c,f):i??c},getAll:function(r){return this.each(function(i,c,f){f[i]=c},r||{})},transact:function(r,i,c){var f=this.get(r,c),g=i(f);return this.set(r,g===void 0?f:g),this},set:function(r,i,c){var f=this.get(r),g;return f!=null&&c===!1?i:(typeof c=="function"&&(g=c,c=void 0),s.set(this._area,this._in(r),s.stringify(i,g),c)||f)},setAll:function(r,i){var c,f;for(var g in r)f=r[g],this.set(g,f,i)!==f&&(c=!0);return c},add:function(r,i,c){var f=this.get(r);if(f instanceof Array)i=f.concat(i);else if(f!==null){var g=typeof f;if(g===typeof i&&g==="object"){for(var N in i)f[N]=i[N];i=f}else i=f+i}return s.set(this._area,this._in(r),s.stringify(i,c)),i},remove:function(r,i){var c=this.get(r,i);return s.remove(this._area,this._in(r)),c},clear:function(){return this._ns?this.each(function(r){s.remove(this._area,this._in(r))},1):s.clear(this._area),this},clearAll:function(){var r=this._area;for(var i in s.areas)s.areas.hasOwnProperty(i)&&(this._area=s.areas[i],this.clear());return this._area=r,this},_in:function(r){return typeof r!="string"&&(r=s.stringify(r)),this._ns?this._ns+r:r},_out:function(r){return this._ns?r&&r.indexOf(this._ns)===0?r.substring(this._ns.length):void 0:r}},storage:function(r){return s.inherit(s.storageAPI,{items:{},name:r})},storageAPI:{length:0,has:function(r){return this.items.hasOwnProperty(r)},key:function(r){var i=0;for(var c in this.items)if(this.has(c)&&r===i++)return c},setItem:function(r,i){this.has(r)||this.length++,this.items[r]=i},removeItem:function(r){this.has(r)&&(delete this.items[r],this.length--)},getItem:function(r){return this.has(r)?this.items[r]:null},clear:function(){for(var r in this.items)this.removeItem(r)}}},a=s.Store("local",function(){try{return localStorage}catch{}}());a.local=a,a._=s,a.area("session",function(){try{return sessionStorage}catch{}}()),a.area("page",s.storage("page")),typeof n=="function"&&n.amd!==void 0?n("store2",[],function(){return a}):e.exports?e.exports=a:(t.store&&(s.conflict=t.store),t.store=a)})(Wt,Wt&&Wt.define)}(ct)),ct.exports}var ri=si();const Ae=en(ri),ai=e=>{const t={};for(const n of e)t[n.key]=n.value;return t},ii=(e,t)=>(t.forEach(n=>{const s=W.find(e,{key:n.key});s?W.merge(s,n):e.push(n)}),e),ut="https://test.ihotel.cn",oi=async e=>Te.get(ut+"/i18n-web/sysoption/getsupportedlangs",{headers:{Authorization:e}}),Es=async({appCode:e,language:t="zh-CN",page:n,lastPullDate:s,token:a})=>new Promise(async(r,i)=>{const c=ut+"/i18n-web/kv_translate/kv_translates",f=s?c+"?lastPullDate="+s:c,g=await Te({url:f,method:"GET",headers:{appCode:e,page:n,language:t,Authorization:a}});g.data&&g.data.result==0?r(g.data.retVal):r(g)}),bs=async(e,t)=>Te({url:ut+"/i18n-web/kv_translate/kv_translates",method:"POST",data:e,headers:{Authorization:t}}),li=async(e,t)=>Te({url:ut+"/i18n-web/kv_translate/batch",method:"POST",data:e,headers:{Authorization:t}}),ci=async({appCode:e,language:t="zh-CN",token:n})=>new Promise(async(s,a)=>{const r=Ae.namespace(`I18N_${W.toUpper(e)}`),i={appCode:e,language:t,token:n},c=r.get(t);if(!c||!c.lastPullDate){const f=await Es(i);f&&(r.set(t,f),s(f.translatesDTOs))}else{const{lastPullDate:f}=c,g=await Es({...i,lastPullDate:f});if(g){const N=W.get(c,"translatesDTOs");if(W.isEmpty(g.translatesDTOs))s(N);else{const v=ii(N,g.translatesDTOs),y={lastPullDate:g.lastPullDate,translatesDTOs:v};Ae.namespace(`I18N_${W.toUpper(e)}`).set(t,y,":"),s(v)}}}}),ui={data(){return{isModalVisible:!1,searchText:"",name:"",type:"pageData",languages:[],mySaveData:[],pageData:[],pageDataShow:[],page:{pageSize:10,firstResult:0},data:[]}},computed:{firstResult(){return this.page.firstResult/this.page.pageSize+1},columns(){let e=this.type==="pageData"?[{title:"字典键",width:150,key:"dictKey"},{title:"状态",width:90,key:"icon",fixed:"left",render:(t,{row:n})=>n.localhost?C.createVNode("span",{style:{color:"red"}},[C.createVNode("span",{style:{marginRight:"2px"}},[C.createTextVNode("本地")]),C.createVNode(C.resolveComponent("Tooltip"),{content:"该字段未在翻译数据库中",placement:"top",transfer:!0},{default:()=>[C.createVNode(C.resolveComponent("Icon"),{type:"ios-alert-outline"},null)]})]):C.createVNode("span",{style:{color:"green"}},[C.createTextVNode("正常")])}]:[{title:"页面",fixed:"left",width:150,key:"page",render:(t,{row:n})=>t("span",{},n.page==="common"?"全局":n.page)}];return W.map(this.languages,t=>{const n=t.code;return e.push({title:t.name,fixed:t.name==="中文"?"left":"",key:n,render:(s,{row:a,index:r})=>{const i=a[n];return C.createVNode(C.resolveComponent("Input"),{modelValue:i,onOnChange:c=>{const f=c.target.value;this.type==="pageData"?this.pageData[r][n]=f:this.data[r]={...this.data[r],[n]:f};const{dictKey:g,page:N}=a,v=W.findIndex(this.mySaveData,{key:g,lang:t.code});console.log("page",N),g&&v===-1?this.mySaveData.push({page:N||this.name,key:g,lang:t.code,value:f}):this.mySaveData[v].value=f,W.findIndex(this.mySaveData,{key:g,page:this.name,lang:"zh-CN"})==-1&&a["zh-CN"]===g&&this.mySaveData.push({page:this.name,key:g,lang:"zh-CN",value:W.get(W.find(this.initialData,{dictKey:g}),"zh-CN",g)}),console.log(" this.mySaveData",this.mySaveData)}},null)}})}),e}},props:{appCode:String,setLanguage:Function,token:String,translationKeys:Array},methods:{closeModal(){this.searchText="",this.isModalVisible=!1},openModal({name:e}){this.isModalVisible||(this.isModalVisible=!0,this.name=e,this.init())},findShallowStringDiff(e){return W.find(e,["_isEdit",!0])},async saveData({msg:e="保存成功"},t=!0){console.log("this.mySaveData",this.mySaveData);const n=await li({appCode:this.appCode,data:this.mySaveData},this.token);n&&n.data.result===0?(j.Message.success({content:e||n.data.msg}),this.setLanguage(),this.initialData=W.cloneDeep(this.data.datas),t&&this.closeModal(),this.mySaveData=[]):j.Message.error({content:n.data.msg||"保存失败"})},async saveNoEqual(){W.isEmpty(this.mySaveData)||this.saveData({msg:"已为您自动保存"},!1)},changePage(e){this.saveNoEqual(),this.type==="pageData"?this.getPageData(e):this.search({firstResult:(e-1)*this.page.pageSize})},async getPageData(e=1){const t=await bs({appCode:this.appCode,searchBlur:this.searchText,commaSeparatedKeys:this.translationKeys.toString(),commaSeparatedLangs:W.map(this.languages,"code").toString(),firstResult:0,pageSize:99999},this.token);if(t){let n=[];W.forEach(this.translationKeys,s=>{const a=W.find(t.data.retVal.datas,{dictKey:s,page:this.name});if(a)n.push(a);else{const r=W.find(t.data.retVal.datas,{dictKey:s,page:"common"});r?n.push(r):n.push({dictKey:s,page:this.name,"zh-CN":s,localhost:!0})}}),this.pageData=W.cloneDeep(n),this.pageDataShow=n.slice((e-1)*this.page.pageSize,e*this.page.pageSize)}},async search(e,t){const n=await bs({appCode:this.appCode,searchBlur:this.searchText,commaSeparatedLangs:W.map(this.languages,"code").toString(),firstResult:0,pageSize:10,...e},this.token);n&&(this.initialData=W.cloneDeep(n.data.retVal.datas),this.data=W.cloneDeep(n.data.retVal.datas),this.page={firstResult:n.data.retVal.firstResult,pageSize:n.data.retVal.pageSize,totalRows:n.data.retVal.totalRows})},changeTab(e){this.type=e,e==="data"?this.search():this.getPageData()},async init(){const e=await oi(this.token);e&&e.data.result==0?(this.languages=e.data.retVal,this.getPageData()):j.Message.error("获取语言失败,出错了")}}},fi=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},di={key:0,class:"extra"},_i={class:"gc_i18n_page"},mi={style:{display:"flex"}};function hi(e,t,n,s,a,r){const i=C.resolveComponent("Table"),c=C.resolveComponent("TabPane"),f=C.resolveComponent("Input"),g=C.resolveComponent("Tabs"),N=C.resolveComponent("Page"),v=C.resolveComponent("Button"),y=C.resolveComponent("Modal");return C.openBlock(),C.createBlock(y,{modelValue:a.isModalVisible,"onUpdate:modelValue":t[4]||(t[4]=O=>a.isModalVisible=O),"mask-closable":!1,width:70,title:"多语言管理中心","footer-hide":""},{default:C.withCtx(()=>[C.createVNode(g,{modelValue:a.type,"onUpdate:modelValue":t[1]||(t[1]=O=>a.type=O),type:"card",class:"gc_i18n_tabs",onOnClick:r.changeTab},{extra:C.withCtx(()=>[a.type==="data"?(C.openBlock(),C.createElementBlock("div",di,[C.createVNode(f,{prefix:"ios-search",placeholder:"请输入搜索内容",modelValue:a.searchText,"onUpdate:modelValue":t[0]||(t[0]=O=>a.searchText=O),clearable:"",onOnEnter:r.search,onOnClear:r.search},null,8,["modelValue","onOnEnter","onOnClear"])])):C.createCommentVNode("",!0)]),default:C.withCtx(()=>[C.createVNode(c,{name:"pageData",label:"当前页面"},{default:C.withCtx(()=>[C.createVNode(i,{border:"",height:380,columns:r.columns,data:a.pageDataShow},null,8,["columns","data"])]),_:1}),C.createVNode(c,{name:"data",label:"当前应用"},{default:C.withCtx(()=>[C.createVNode(i,{border:"",height:380,columns:r.columns,data:a.data},null,8,["columns","data"])]),_:1})]),_:1},8,["modelValue","onOnClick"]),C.createElementVNode("div",_i,[C.createElementVNode("div",mi,[a.type==="pageData"?(C.openBlock(),C.createBlock(N,{key:0,modelValue:r.firstResult,"onUpdate:modelValue":t[2]||(t[2]=O=>r.firstResult=O),total:n.translationKeys.length,"page-size":10,simple:"","show-total":"",onOnChange:r.changePage},null,8,["modelValue","total","onOnChange"])):(C.openBlock(),C.createBlock(N,{key:1,modelValue:r.firstResult,"onUpdate:modelValue":t[3]||(t[3]=O=>r.firstResult=O),total:a.page.totalRows,"page-size":10,simple:"","show-total":"",onOnChange:r.changePage},null,8,["modelValue","total","onOnChange"])),C.createElementVNode("div",null," 共 "+C.toDisplayString(a.type==="pageData"?n.translationKeys.length:a.page.totalRows)+" 项数据 ",1)]),C.createElementVNode("div",null,[C.createVNode(v,{style:{"margin-right":"10px"},onClick:r.closeModal},{default:C.withCtx(()=>t[5]||(t[5]=[C.createTextVNode("关闭")])),_:1},8,["onClick"]),C.createVNode(v,{type:"primary",onClick:r.saveData},{default:C.withCtx(()=>t[6]||(t[6]=[C.createTextVNode("保存")])),_:1},8,["onClick"])])])]),_:1},8,["modelValue"])}const gi=fi(ui,[["render",hi]]);function ys(e){const t=[],n=/(?:\$t|_ctx\.\$t)\s*\(\s*(['"])([^'"]+?)\1/gs;if(e.template){let s;for(;(s=n.exec(e.template))!==null;)t.push(s[2])}if(e.render){const s=e.render.toString();let a;for(;(a=n.exec(s))!==null;)t.push(a[2])}if(e.setup){const s=e.setup.toString();let a;for(;(a=n.exec(s))!==null;)t.push(a[2])}if(e.methods)for(const s in e.methods){const a=e.methods[s].toString();let r;for(;(r=n.exec(a))!==null;)t.push(r[2])}if(e.components)for(const s in e.components){const a=e.components[s];t.push(...ys(a))}return[...new Set(t)]}j.Message.config({duration:3}),Te.defaults.timeout=6e4,Te.interceptors.request.use(e=>(e.headers["Content-Type"]="application/json",e),e=>(j.Message.error({content:"请求超时!"}),Promise.resolve(e))),Te.interceptors.response.use(e=>{const{nomsg:t}=e.config.headers;return e.status&&e.status!=200?t||j.Message.error({content:e.data.message||"未知错误"}):e.data.success=!0,e},e=>(e.response?e.response.status==504||e.response.status==404?j.Message.error({content:"服务器被吃了⊙﹏⊙∥"}):e.response.status==403?j.Message.error({content:"权限不足,请联系管理员!"}):j.Message.error({content:`${e.response.status}:${e.response.statusText||e.response.error}`}):e.code==="ECONNABORTED"&&e.message.indexOf("timeout")!==-1?j.Message.error({content:"请求超时!"}):j.Message.error({content:e.message||"未知错误!"}),Promise.resolve(e)));class pi{constructor(t={}){const{router:n,appCode:s,messages:a,token:r,locale:i}=t;this.token=r||Ae.get("token"),this.appCode=s,this.router=n,this.locale=Ae.get("I18N_LANGUAGE")||navigator.language||"zh-CN",this.modalLoad=!1,this.name="",this.messages=a||{},this.translationKeys=[],this.initRouterGuards(),this.initI18n(t),this.router.isReady().then(async()=>{await this.setLanguage(this.locale),this.createModal()}).catch(c=>{console.error("路由首次加载出错:",c)}),Os.bind("shift > t",c=>{this.configInstance.openModal({name:this.name})}),this.setupLanguageChangeListener()}setupLanguageChangeListener(){"onlanguagechange"in window&&window.addEventListener("languagechange",()=>{const t=navigator.language;t!==this.locale&&this.setLanguage(t)})}initRouterGuards(){this.router.beforeEach(async(t,n,s)=>{const{language:a,token:r}=t.query;if(this.configInstance&&this.configInstance.closeModal(),this.name=t.name,r&&this.setToken(r),t.matched.length>0){let i=t.matched[0].components.default;if(typeof i=="function"&&i.toString().includes("import("))try{i=await i(),i=i.default}catch(c){console.error("加载异步组件时出错:",c),s();return}this.translationKeys=ys(i)}s()})}initI18n(t){this.i18n=ja({locale:this.locale,globalInjection:!0,legacy:!1,silentTranslationWarn:!0,silentFallbackWarn:!0,missingWarn:!1,fallbackWarn:!1,...t});const n=this.i18n.global.t;globalThis.$deepScan=function(s){return s},globalThis.$t=this.i18n.global.t=(s,a,r)=>{var f,g,N;const i=W.toUpper((N=(g=(f=this.router)==null?void 0:f.currentRoute)==null?void 0:g.value)==null?void 0:N.name),c=n(s,a);if((c===s||c===a)&&i){const v=`${i}.${s}`,y=n(v,a);if(y!==v&&y!==a)return y;{const O=`common.${s}`,P=n(O,a);return P!==O?P:r?(console.log(`找不到"${s}",使用"${r}"`),r):s}}return c},globalThis.$$t=(s,a,r)=>{const i=Ae.namespace(`I18N_${W.toUpper(this.appCode)}`),c=W.get(i.get(this.locale),"translatesDTOs"),f=W.find(c,g=>`common.${s}`===g.key);return W.get(f,"value",a)},globalThis.$changeLocale=this.changeLocale=this.i18n.global.changeLocale=async s=>{await this.setLanguage(s||this.locale)}}setToken(t){this.token=t}getLanguage(t){return Ae.get("I18N_TEST.zh-TW")}async setLanguage(t){return new Promise(async(n,s)=>{const a=await ci({appCode:this.appCode,language:t||this.locale,token:this.token});if(a){const r=ai(a),i=W.assign({},W.get(this.messages,t),r);this.i18n.global.setLocaleMessage(t,i)}this.locale=t,this.i18n.global.locale.value=t,Ae.set("I18N_LANGUAGE",t),n(!0)})}createModal(t){this.modalLoad=!0,this.configInstance=C.createApp(gi,{appCode:this.appCode,token:this.token,setLanguage:this.setLanguage.bind(this,this.locale),name:this.name,translationKeys:this.translationKeys}).use(j).mount(document.createElement("div"))}install(t,n={}){t.use(j,{i18n:this.i18n}),t.use(this.i18n)}}return pi});
|
|
21
|
+
*/const _r="11.1.3";function mr(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(be().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(be().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(be().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(be().__INTLIFY_PROD_DEVTOOLS__=!1)}const Y={UNEXPECTED_RETURN_TYPE:Ta,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function ne(e,...t){return ke(e,null,process.env.NODE_ENV!=="production"?{messages:dr,args:t}:void 0)}const dr={[Y.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Y.INVALID_ARGUMENT]:"Invalid argument",[Y.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Y.NOT_INSTALLED]:"Need to install with `app.use` function",[Y.UNEXPECTED_ERROR]:"Unexpected error",[Y.REQUIRED_VALUE]:"Required in value: {0}",[Y.INVALID_VALUE]:"Invalid value",[Y.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Y.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Y.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Y.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},bt=ue("__translateVNode"),It=ue("__datetimeParts"),Ct=ue("__numberParts"),Ce=ue("__enableEmitter"),$e=ue("__disableEmitter"),Hn=ue("__setPluralRules"),Bn=ue("__injectWithOption"),yt=ue("__dispose"),_e={FALLBACK_TO_ROOT:Ra,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},gr={[_e.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[_e.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[_e.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[_e.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
|
|
22
|
+
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[_e.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function We(e,...t){return Xe(gr[e],...t)}function Ge(e){if(!F(e)||re(e))return e;for(const t in e)if(ie(e,t))if(!t.includes("."))F(e[t])&&Ge(e[t]);else{const n=t.split("."),s=n.length-1;let a=e,r=!1;for(let o=0;o<s;o++){if(n[o]==="__proto__")throw new Error(`unsafe key: ${n[o]}`);if(n[o]in a||(a[n[o]]=W()),!F(a[n[o]])){process.env.NODE_ENV!=="production"&&pe(We(_e.IGNORE_OBJ_FLATTEN,{key:n[o]})),r=!0;break}a=a[n[o]]}if(r||(re(a)?dn.includes(n[s])||delete e[t]:(a[n[s]]=e[t],delete e[t])),!re(a)){const o=a[n[s]];F(o)&&Ge(o)}}return e}function At(e,t){const{messages:n,__i18n:s,messageResolver:a,flatJson:r}=t,o=M(n)?n:H(s)?W():{[e]:W()};if(H(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:u,resource:_}=l;u?(o[u]=o[u]||W(),Qe(_,o[u])):Qe(_,o)}else I(l)&&Qe(JSON.parse(l),o)}),a==null&&r)for(const l in o)ie(o,l)&&Ge(o[l]);return o}function Kn(e){return e.type}function jn(e,t,n){let s=F(t.messages)?t.messages:W();"__i18nGlobal"in n&&(s=At(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const a=Object.keys(s);a.length&&a.forEach(r=>{e.mergeLocaleMessage(r,s[r])});{if(F(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(o=>{e.mergeDateTimeFormat(o,t.datetimeFormats[o])})}if(F(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(o=>{e.mergeNumberFormat(o,t.numberFormats[o])})}}}function Xn(e){return O.createVNode(O.Text,null,e,0)}const Jn="__INTLIFY_META__",qn=()=>[],Er=()=>!1;let Qn=0;function Zn(e){return(t,n,s,a)=>e(n,s,O.getCurrentInstance()||void 0,a)}const pr=()=>{const e=O.getCurrentInstance();let t=null;return e&&(t=Kn(e)[Jn])?{[Jn]:t}:null};function St(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,a=e.flatJson,r=le?O.ref:O.shallowRef;let o=V(e.inheritLocale)?e.inheritLocale:!0;const l=r(t&&o?t.locale.value:I(e.locale)?e.locale:Ue),u=r(t&&o?t.fallbackLocale.value:I(e.fallbackLocale)||H(e.fallbackLocale)||M(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),_=r(At(l.value,e)),N=r(M(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),T=r(M(e.numberFormats)?e.numberFormats:{[l.value]:{}});let E=t?t.missingWarn:V(e.missingWarn)||De(e.missingWarn)?e.missingWarn:!0,A=t?t.fallbackWarn:V(e.fallbackWarn)||De(e.fallbackWarn)?e.fallbackWarn:!0,k=t?t.fallbackRoot:V(e.fallbackRoot)?e.fallbackRoot:!0,S=!!e.fallbackFormat,D=G(e.missing)?e.missing:null,f=G(e.missing)?Zn(e.missing):null,d=G(e.postTranslation)?e.postTranslation:null,b=t?t.warnHtmlMessage:V(e.warnHtmlMessage)?e.warnHtmlMessage:!0,g=!!e.escapeParameter;const C=t?t.modifiers:M(e.modifiers)?e.modifiers:{};let y=e.pluralRules||t&&t.pluralRules,p;p=(()=>{s&&yn(null);const m={version:_r,locale:l.value,fallbackLocale:u.value,messages:_.value,modifiers:C,pluralRules:y,missing:f===null?void 0:f,missingWarn:E,fallbackWarn:A,fallbackFormat:S,unresolving:!0,postTranslation:d===null?void 0:d,warnHtmlMessage:b,escapeParameter:g,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};m.datetimeFormats=N.value,m.numberFormats=T.value,m.__datetimeFormatters=M(p)?p.__datetimeFormatters:void 0,m.__numberFormatters=M(p)?p.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(m.__v_emitter=M(p)?p.__v_emitter:void 0);const L=Ya(m);return s&&yn(L),L})(),xe(p,l.value,u.value);function x(){return[l.value,u.value,_.value,N.value,T.value]}const q=O.computed({get:()=>l.value,set:m=>{p.locale=m,l.value=m}}),ce=O.computed({get:()=>u.value,set:m=>{p.fallbackLocale=m,u.value=m,xe(p,l.value,m)}}),Q=O.computed(()=>_.value),Me=O.computed(()=>N.value),Ft=O.computed(()=>T.value);function Vt(){return G(d)?d:null}function wt(m){d=m,p.postTranslation=m}function Ut(){return D}function xt(m){m!==null&&(f=Zn(m)),D=m,p.missing=f}function $t(m,L){return m!=="translate"||!L.resolvedMessage}const ge=(m,L,$,j,Ae,rt)=>{x();let Fe;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(p.fallbackContext=t?Ga():void 0),Fe=m(p)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(p.fallbackContext=void 0)}if($!=="translate exists"&&X(Fe)&&Fe===et||$==="translate exists"&&!Fe){const[Se,co]=L();if(process.env.NODE_ENV!=="production"&&t&&I(Se)&&$t($,co)&&(k&&(nt(A,Se)||Sn(E,Se))&&pe(We(_e.FALLBACK_TO_ROOT,{key:Se,type:$})),process.env.NODE_ENV!=="production")){const{__v_emitter:ps}=p;ps&&k&&ps.emit("fallback",{type:$,key:Se,to:"global",groupId:`${$}:${Se}`})}return t&&k?j(t):Ae(Se)}else{if(rt(Fe))return Fe;throw ne(Y.UNEXPECTED_RETURN_TYPE)}};function He(...m){return ge(L=>Reflect.apply($n,null,[L,...m]),()=>Lt(...m),"translate",L=>Reflect.apply(L.t,L,[...m]),L=>L,L=>I(L))}function Wt(...m){const[L,$,j]=m;if(j&&!F(j))throw ne(Y.INVALID_ARGUMENT);return He(L,$,J({resolvedMessage:!0},j||{}))}function Gt(...m){return ge(L=>Reflect.apply(Pn,null,[L,...m]),()=>Nt(...m),"datetime format",L=>Reflect.apply(L.d,L,[...m]),()=>tt,L=>I(L))}function Yt(...m){return ge(L=>Reflect.apply(Fn,null,[L,...m]),()=>Tt(...m),"number format",L=>Reflect.apply(L.n,L,[...m]),()=>tt,L=>I(L))}function Ht(m){return m.map(L=>I(L)||X(L)||V(L)?Xn(String(L)):L)}const Bt={normalize:Ht,interpolate:m=>m,type:"vnode"};function at(...m){return ge(L=>{let $;const j=L;try{j.processor=Bt,$=Reflect.apply($n,null,[j,...m])}finally{j.processor=null}return $},()=>Lt(...m),"translate",L=>L[bt](...m),L=>[Xn(L)],L=>H(L))}function Kt(...m){return ge(L=>Reflect.apply(Fn,null,[L,...m]),()=>Tt(...m),"number format",L=>L[Ct](...m),qn,L=>I(L)||H(L))}function jt(...m){return ge(L=>Reflect.apply(Pn,null,[L,...m]),()=>Nt(...m),"datetime format",L=>L[It](...m),qn,L=>I(L)||H(L))}function Xt(m){y=m,p.pluralRules=y}function Jt(m,L){return ge(()=>{if(!m)return!1;const $=I(L)?L:l.value,j=ye($),Ae=p.messageResolver(j,m);return re(Ae)||oe(Ae)||I(Ae)},()=>[m],"translate exists",$=>Reflect.apply($.te,$,[m,L]),Er,$=>V($))}function Be(m){let L=null;const $=pn(p,u.value,l.value);for(let j=0;j<$.length;j++){const Ae=_.value[$[j]]||{},rt=p.messageResolver(Ae,m);if(rt!=null){L=rt;break}}return L}function Ke(m){const L=Be(m);return L??(t?t.tm(m)||{}:{})}function ye(m){return _.value[m]||{}}function je(m,L){if(a){const $={[m]:L};for(const j in $)ie($,j)&&Ge($[j]);L=$[m]}_.value[m]=L,p.messages=_.value}function qt(m,L){_.value[m]=_.value[m]||{};const $={[m]:L};if(a)for(const j in $)ie($,j)&&Ge($[j]);L=$[m],Qe(L,_.value[m]),p.messages=_.value}function i(m){return N.value[m]||{}}function c(m,L){N.value[m]=L,p.datetimeFormats=N.value,Mn(p,m,L)}function h(m,L){N.value[m]=J(N.value[m]||{},L),p.datetimeFormats=N.value,Mn(p,m,L)}function v(m){return T.value[m]||{}}function B(m,L){T.value[m]=L,p.numberFormats=T.value,wn(p,m,L)}function K(m,L){T.value[m]=J(T.value[m]||{},L),p.numberFormats=T.value,wn(p,m,L)}Qn++,t&&le&&(O.watch(t.locale,m=>{o&&(l.value=m,p.locale=m,xe(p,l.value,u.value))}),O.watch(t.fallbackLocale,m=>{o&&(u.value=m,p.fallbackLocale=m,xe(p,l.value,u.value))}));const U={id:Qn,locale:q,fallbackLocale:ce,get inheritLocale(){return o},set inheritLocale(m){o=m,m&&t&&(l.value=t.locale.value,u.value=t.fallbackLocale.value,xe(p,l.value,u.value))},get availableLocales(){return Object.keys(_.value).sort()},messages:Q,get modifiers(){return C},get pluralRules(){return y||{}},get isGlobal(){return s},get missingWarn(){return E},set missingWarn(m){E=m,p.missingWarn=E},get fallbackWarn(){return A},set fallbackWarn(m){A=m,p.fallbackWarn=A},get fallbackRoot(){return k},set fallbackRoot(m){k=m},get fallbackFormat(){return S},set fallbackFormat(m){S=m,p.fallbackFormat=S},get warnHtmlMessage(){return b},set warnHtmlMessage(m){b=m,p.warnHtmlMessage=m},get escapeParameter(){return g},set escapeParameter(m){g=m,p.escapeParameter=m},t:He,getLocaleMessage:ye,setLocaleMessage:je,mergeLocaleMessage:qt,getPostTranslationHandler:Vt,setPostTranslationHandler:wt,getMissingHandler:Ut,setMissingHandler:xt,[Hn]:Xt};return U.datetimeFormats=Me,U.numberFormats=Ft,U.rt=Wt,U.te=Jt,U.tm=Ke,U.d=Gt,U.n=Yt,U.getDateTimeFormat=i,U.setDateTimeFormat=c,U.mergeDateTimeFormat=h,U.getNumberFormat=v,U.setNumberFormat=B,U.mergeNumberFormat=K,U[Bn]=n,U[bt]=at,U[It]=jt,U[Ct]=Kt,process.env.NODE_ENV!=="production"&&(U[Ce]=m=>{p.__v_emitter=m},U[$e]=()=>{p.__v_emitter=void 0}),U}const zn="vue-i18n: composer properties",Dt={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},hr={"vue-i18n-resource-inspector":"Search for scopes ..."},Nr={"vue-i18n-timeline":16764185};let kt;async function Tr(e,t){return new Promise((n,s)=>{try{fr({id:"vue-devtools-plugin-vue-i18n",label:Dt["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[zn],app:e},a=>{kt=a,a.on.visitComponentTree(({componentInstance:o,treeNode:l})=>{Lr(o,l,t)}),a.on.inspectComponent(({componentInstance:o,instanceData:l})=>{o.vnode.el&&o.vnode.el.__VUE_I18N__&&l&&(t.mode==="legacy"?o.vnode.el.__VUE_I18N__!==t.global.__composer&&ts(l,o.vnode.el.__VUE_I18N__):ts(l,o.vnode.el.__VUE_I18N__))}),a.addInspector({id:"vue-i18n-resource-inspector",label:Dt["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:hr["vue-i18n-resource-inspector"]}),a.on.getInspectorTree(o=>{o.app===e&&o.inspectorId==="vue-i18n-resource-inspector"&&yr(o,t)});const r=new Map;a.on.getInspectorState(async o=>{if(o.app===e&&o.inspectorId==="vue-i18n-resource-inspector")if(a.unhighlightElement(),Sr(o,t),o.nodeId==="global"){if(!r.has(o.app)){const[l]=await a.getComponentInstances(o.app);r.set(o.app,l)}a.highlightElement(r.get(o.app))}else{const l=Ar(o.nodeId,t);l&&a.highlightElement(l)}}),a.on.editInspectorState(o=>{o.app===e&&o.inspectorId==="vue-i18n-resource-inspector"&&kr(o,t)}),a.addTimelineLayer({id:"vue-i18n-timeline",label:Dt["vue-i18n-timeline"],color:Nr["vue-i18n-timeline"]}),n(!0)})}catch(a){console.error(a),s(!1)}})}function es(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function Lr(e,t,n){const s=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==s){const a={label:`i18n (${es(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(a)}}function ts(e,t){const n=zn;e.state.push({type:n,key:"locale",editable:!0,value:t.locale.value}),e.state.push({type:n,key:"availableLocales",editable:!1,value:t.availableLocales}),e.state.push({type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),e.state.push({type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}),e.state.push({type:n,key:"messages",editable:!1,value:vt(t.messages.value)}),e.state.push({type:n,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),e.state.push({type:n,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function vt(e){const t={};return Object.keys(e).forEach(n=>{const s=e[n];G(s)&&"source"in s?t[n]=Cr(s):re(s)&&s.loc&&s.loc.source?t[n]=s.loc.source:F(s)?t[n]=vt(s):t[n]=s}),t}const Or={"<":"<",">":">",'"':""","&":"&"};function br(e){return e.replace(/[<>"&]/g,Ir)}function Ir(e){return Or[e]||e}function Cr(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${br(e.source)}")`:"(?)"}`}}}function yr(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[s,a]of t.__instances){const r=t.mode==="composition"?a:a.__composer;n!==r&&e.rootNodes.push({id:r.id.toString(),label:`${es(s)} Scope`})}}function Ar(e,t){let n=null;if(e!=="global"){for(const[s,a]of t.__instances.entries())if(a.id.toString()===e){n=s;break}}return n}function ns(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(s=>s.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function Sr(e,t){const n=ns(e.nodeId,t);return n&&(e.state=Dr(n)),null}function Dr(e){const t={},n="Locale related info",s=[{type:n,key:"locale",editable:!0,value:e.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:e.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}];t[n]=s;const a="Locale messages info",r=[{type:a,key:"messages",editable:!1,value:vt(e.messages.value)}];t[a]=r;{const o="Datetime formats info",l=[{type:o,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[o]=l;const u="Datetime formats info",_=[{type:u,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[u]=_}return t}function Ye(e,t){if(kt){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),kt.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:e,groupId:n,time:Date.now(),meta:{},data:t||{},logType:e==="compile-error"?"error":e==="fallback"||e==="missing"?"warning":"default"}})}}function kr(e,t){const n=ns(e.nodeId,t);if(n){const[s]=e.path;s==="locale"&&I(e.state.value)?n.locale.value=e.state.value:s==="fallbackLocale"&&(I(e.state.value)||H(e.state.value)||F(e.state.value))?n.fallbackLocale.value=e.state.value:s==="inheritLocale"&&V(e.state.value)&&(n.inheritLocale=e.state.value)}}function vr(e){const t=I(e.locale)?e.locale:Ue,n=I(e.fallbackLocale)||H(e.fallbackLocale)||M(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=G(e.missing)?e.missing:void 0,a=V(e.silentTranslationWarn)||De(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=V(e.silentFallbackWarn)||De(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,o=V(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,u=M(e.modifiers)?e.modifiers:{},_=e.pluralizationRules,N=G(e.postTranslation)?e.postTranslation:void 0,T=I(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,E=!!e.escapeParameterHtml,A=V(e.sync)?e.sync:!0;let k=e.messages;if(M(e.sharedMessages)){const C=e.sharedMessages;k=Object.keys(C).reduce((p,R)=>{const x=p[R]||(p[R]={});return J(x,C[R]),p},k||{})}const{__i18n:S,__root:D,__injectWithOption:f}=e,d=e.datetimeFormats,b=e.numberFormats,g=e.flatJson;return{locale:t,fallbackLocale:n,messages:k,flatJson:g,datetimeFormats:d,numberFormats:b,missing:s,missingWarn:a,fallbackWarn:r,fallbackRoot:o,fallbackFormat:l,modifiers:u,pluralRules:_,postTranslation:N,warnHtmlMessage:T,escapeParameter:E,messageResolver:e.messageResolver,inheritLocale:A,__i18n:S,__root:D,__injectWithOption:f}}function Pt(e={}){const t=St(vr(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(a){t.locale.value=a},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(a){t.fallbackLocale.value=a},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(a){t.setMissingHandler(a)},get silentTranslationWarn(){return V(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(a){t.missingWarn=V(a)?!a:a},get silentFallbackWarn(){return V(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(a){t.fallbackWarn=V(a)?!a:a},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(a){t.fallbackFormat=a},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(a){t.setPostTranslationHandler(a)},get sync(){return t.inheritLocale},set sync(a){t.inheritLocale=a},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(a){t.warnHtmlMessage=a!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(a){t.escapeParameter=a},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...a){return Reflect.apply(t.t,t,[...a])},rt(...a){return Reflect.apply(t.rt,t,[...a])},te(a,r){return t.te(a,r)},tm(a){return t.tm(a)},getLocaleMessage(a){return t.getLocaleMessage(a)},setLocaleMessage(a,r){t.setLocaleMessage(a,r)},mergeLocaleMessage(a,r){t.mergeLocaleMessage(a,r)},d(...a){return Reflect.apply(t.d,t,[...a])},getDateTimeFormat(a){return t.getDateTimeFormat(a)},setDateTimeFormat(a,r){t.setDateTimeFormat(a,r)},mergeDateTimeFormat(a,r){t.mergeDateTimeFormat(a,r)},n(...a){return Reflect.apply(t.n,t,[...a])},getNumberFormat(a){return t.getNumberFormat(a)},setNumberFormat(a,r){t.setNumberFormat(a,r)},mergeNumberFormat(a,r){t.mergeNumberFormat(a,r)}};return s.__extender=n,process.env.NODE_ENV!=="production"&&(s.__enableEmitter=a=>{const r=t;r[Ce]&&r[Ce](a)},s.__disableEmitter=()=>{const a=t;a[$e]&&a[$e]()}),s}function Pr(e,t,n){return{beforeCreate(){const s=O.getCurrentInstance();if(!s)throw ne(Y.UNEXPECTED_ERROR);const a=this.$options;if(a.i18n){const r=a.i18n;if(a.__i18n&&(r.__i18n=a.__i18n),r.__root=t,this===this.$root)this.$i18n=ss(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=Pt(r);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(a.__i18n)if(this===this.$root)this.$i18n=ss(e,a);else{this.$i18n=Pt({__i18n:a.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;a.__i18nGlobal&&jn(t,a,a),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$te=(r,o)=>this.$i18n.te(r,o),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(s,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const s=this.$i18n;this.$el.__VUE_I18N__=s.__composer;const a=this.__v_emitter=ct();s.__enableEmitter&&s.__enableEmitter(a),a.on("*",Ye)}},unmounted(){const s=O.getCurrentInstance();if(!s)throw ne(Y.UNEXPECTED_ERROR);const a=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",Ye),delete this.__v_emitter),this.$i18n&&(a.__disableEmitter&&a.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,a.__disposer&&(a.__disposer(),delete a.__disposer,delete a.__extender),n.__deleteInstance(s),delete this.$i18n}}}function ss(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[Hn](t.pluralizationRules||e.pluralizationRules);const n=At(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const Rt={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Rr({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,a)=>[...s,...a.type===O.Fragment?a.children:[a]],[]):t.reduce((n,s)=>{const a=e[s];return a&&(n[s]=a()),n},W())}function as(){return O.Fragment}const rs=O.defineComponent({name:"i18n-t",props:J({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>X(e)||!isNaN(e)}},Rt),setup(e,t){const{slots:n,attrs:s}=t,a=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return()=>{const r=Object.keys(n).filter(T=>T!=="_"),o=W();e.locale&&(o.locale=e.locale),e.plural!==void 0&&(o.plural=I(e.plural)?+e.plural:e.plural);const l=Rr(t,r),u=a[bt](e.keypath,l,o),_=J(W(),s),N=I(e.tag)||F(e.tag)?e.tag:as();return O.h(N,_,u)}}});function Mr(e){return H(e)&&!I(e[0])}function os(e,t,n,s){const{slots:a,attrs:r}=t;return()=>{const o={part:!0};let l=W();e.locale&&(o.locale=e.locale),I(e.format)?o.key=e.format:F(e.format)&&(I(e.format.key)&&(o.key=e.format.key),l=Object.keys(e.format).reduce((E,A)=>n.includes(A)?J(W(),E,{[A]:e.format[A]}):E,W()));const u=s(e.value,o,l);let _=[o.key];H(u)?_=u.map((E,A)=>{const k=a[E.type],S=k?k({[E.type]:E.value,index:A,parts:u}):[E.value];return Mr(S)&&(S[0].key=`${E.type}-${A}`),S}):I(u)&&(_=[u]);const N=J(W(),r),T=I(e.tag)||F(e.tag)?e.tag:as();return O.h(T,N,_)}}const ls=O.defineComponent({name:"i18n-n",props:J({value:{type:Number,required:!0},format:{type:[String,Object]}},Rt),setup(e,t){const n=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return os(e,t,Vn,(...s)=>n[Ct](...s))}});function Fr(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function Vr(e){const t=o=>{process.env.NODE_ENV!=="production"&&it(We(_e.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:l,value:u}=o;if(!l||!l.$)throw ne(Y.UNEXPECTED_ERROR);const _=Fr(e,l.$),N=is(u);return[Reflect.apply(_.t,_,[...cs(N)]),_]};return{created:(o,l)=>{const[u,_]=t(l);le&&e.global===_&&(o.__i18nWatcher=O.watch(_.locale,()=>{l.instance&&l.instance.$forceUpdate()})),o.__composer=_,o.textContent=u},unmounted:o=>{le&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:l})=>{if(o.__composer){const u=o.__composer,_=is(l);o.textContent=Reflect.apply(u.t,u,[...cs(_)])}},getSSRProps:o=>{const[l]=t(o);return{textContent:l}}}}function is(e){if(I(e))return{path:e};if(M(e)){if(!("path"in e))throw ne(Y.REQUIRED_VALUE,"path");return e}else throw ne(Y.INVALID_VALUE)}function cs(e){const{path:t,locale:n,args:s,choice:a,plural:r}=e,o={},l=s||{};return I(n)&&(o.locale=n),X(a)&&(o.plural=a),X(r)&&(o.plural=r),[t,l,o]}function wr(e,t,...n){const s=M(n[0])?n[0]:{};(V(s.globalInstall)?s.globalInstall:!0)&&([rs.name,"I18nT"].forEach(r=>e.component(r,rs)),[ls.name,"I18nN"].forEach(r=>e.component(r,ls)),[fs.name,"I18nD"].forEach(r=>e.component(r,fs))),e.directive("t",Vr(t))}const Ur=ue("global-vue-i18n");function xr(e={}){const t=__VUE_I18N_LEGACY_API__&&V(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&t&&it(We(_e.DEPRECATE_LEGACY_MODE));const n=V(e.globalInjection)?e.globalInjection:!0,s=new Map,[a,r]=$r(e,t),o=ue(process.env.NODE_ENV!=="production"?"vue-i18n":"");function l(T){return s.get(T)||null}function u(T,E){s.set(T,E)}function _(T){s.delete(T)}const N={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(T,...E){if(process.env.NODE_ENV!=="production"&&(T.__VUE_I18N__=N),T.__VUE_I18N_SYMBOL__=o,T.provide(T.__VUE_I18N_SYMBOL__,N),M(E[0])){const S=E[0];N.__composerExtend=S.__composerExtend,N.__vueI18nExtend=S.__vueI18nExtend}let A=null;!t&&n&&(A=Xr(T,N.global)),__VUE_I18N_FULL_INSTALL__&&wr(T,N,...E),__VUE_I18N_LEGACY_API__&&t&&T.mixin(Pr(r,r.__composer,N));const k=T.unmount;if(T.unmount=()=>{A&&A(),N.dispose(),k()},process.env.NODE_ENV!=="production"){if(!await Tr(T,N))throw ne(Y.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const D=ct();if(t){const f=r;f.__enableEmitter&&f.__enableEmitter(D)}else{const f=r;f[Ce]&&f[Ce](D)}D.on("*",Ye)}},get global(){return r},dispose(){a.stop()},__instances:s,__getInstance:l,__setInstance:u,__deleteInstance:_};return N}function Mt(e={}){const t=O.getCurrentInstance();if(t==null)throw ne(Y.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ne(Y.NOT_INSTALLED);const n=Wr(t),s=Yr(n),a=Kn(t),r=Gr(e,a);if(r==="global")return jn(s,e,a),s;if(r==="parent"){let u=Hr(n,t,e.__useComponent);return u==null&&(process.env.NODE_ENV!=="production"&&pe(We(_e.NOT_FOUND_PARENT_SCOPE)),u=s),u}const o=n;let l=o.__getInstance(t);if(l==null){const u=J({},e);"__i18n"in a&&(u.__i18n=a.__i18n),s&&(u.__root=s),l=St(u),o.__composerExtend&&(l[yt]=o.__composerExtend(l)),Kr(o,t,l),o.__setInstance(t,l)}return l}function $r(e,t){const n=O.effectScope(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Pt(e)):n.run(()=>St(e));if(s==null)throw ne(Y.UNEXPECTED_ERROR);return[n,s]}function Wr(e){const t=O.inject(e.isCE?Ur:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ne(e.isCE?Y.NOT_INSTALLED_WITH_PROVIDE:Y.UNEXPECTED_ERROR);return t}function Gr(e,t){return Je(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Yr(e){return e.mode==="composition"?e.global:e.global.__composer}function Hr(e,t,n=!1){let s=null;const a=t.root;let r=Br(t,n);for(;r!=null;){const o=e;if(e.mode==="composition")s=o.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const l=o.__getInstance(r);l!=null&&(s=l.__composer,n&&s&&!s[Bn]&&(s=null))}if(s!=null||a===r)break;r=r.parent}return s}function Br(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Kr(e,t,n){let s=null;O.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,s=ct();const a=n;a[Ce]&&a[Ce](s),s.on("*",Ye)}},t),O.onUnmounted(()=>{const a=n;process.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(s&&s.off("*",Ye),a[$e]&&a[$e](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const r=a[yt];r&&(r(),delete a[yt])},t)}const jr=["locale","fallbackLocale","availableLocales"],us=["t","rt","d","n","tm","te"];function Xr(e,t){const n=Object.create(null);return jr.forEach(a=>{const r=Object.getOwnPropertyDescriptor(t,a);if(!r)throw ne(Y.UNEXPECTED_ERROR);const o=O.isRef(r.value)?{get(){return r.value.value},set(l){r.value.value=l}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,a,o)}),e.config.globalProperties.$i18n=n,us.forEach(a=>{const r=Object.getOwnPropertyDescriptor(t,a);if(!r||!r.value)throw ne(Y.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${a}`,r)}),()=>{delete e.config.globalProperties.$i18n,us.forEach(a=>{delete e.config.globalProperties[`$${a}`]})}}const fs=O.defineComponent({name:"i18n-d",props:J({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rt),setup(e,t){const n=e.i18n||Mt({useScope:e.scope,__useComponent:!0});return os(e,t,Rn,(...s)=>n[It](...s))}});if(mr(),wa(ga),Ua(Pa),xa(pn),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=be();e.__INTLIFY__=!0,Ea(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const Jr=e=>{const t={};for(const n of e)t[n.key]=n.value;return t},qr=(e,t)=>(t.forEach(n=>{const s=w.find(e,{key:n.key});s?w.merge(s,n):e.push(n)}),e),st="https://test.ihotel.cn",_s=async e=>Le.get(st+"/i18n-web/sysoption/getsupportedlangs",{headers:{Authorization:e}}),ms=async({appCode:e,language:t="zh-CN",page:n,lastPullDate:s,token:a})=>new Promise(async(r,o)=>{const l=st+"/i18n-web/kv_translate/kv_translates",u=s?l+"?lastPullDate="+s:l,_=await Le({url:u,method:"GET",headers:{appCode:e,page:n,language:t,Authorization:a}});_.data&&_.data.result==0?r(_.data.retVal):r(_)}),ds=async(e,t)=>Le({url:st+"/i18n-web/kv_translate/kv_translates",method:"POST",data:e,headers:{Authorization:t}}),Qr=async(e,t)=>Le({url:st+"/i18n-web/kv_translate/batch",method:"POST",data:e,headers:{Authorization:t}}),Zr=async({appCode:e,language:t="zh-CN",token:n})=>new Promise(async(s,a)=>{const r=Ee.namespace(`I18N_${w.toUpper(e)}`),o={appCode:e,language:t,token:n},l=r.get(t);if(!l||!l.lastPullDate){const u=await ms(o);u&&(r.set(t,u),s(u.translatesDTOs))}else{const{lastPullDate:u}=l,_=await ms({...o,lastPullDate:u});if(_){const N=w.get(l,"translatesDTOs");if(w.isEmpty(_.translatesDTOs))s(N);else{const T=qr(N,_.translatesDTOs),E={lastPullDate:_.lastPullDate,translatesDTOs:T};Ee.namespace(`I18N_${w.toUpper(e)}`).set(t,E,":"),s(T)}}}}),zr={data(){return{isModalVisible:!1,loading:!1,searchText:"",name:"",type:"pageData",languages:[],mySaveData:[],pageData:[],pageDataShow:[],page:{pageSize:10,firstResult:0},data:[]}},computed:{firstResult(){return this.page.firstResult/this.page.pageSize+1},columns(){let e=this.type==="pageData"?[{title:"字典键",width:150,key:"dictKey"},{title:"状态",width:90,key:"icon",fixed:"left",render:(t,{row:n})=>n.localhost?O.createVNode("span",{style:{color:"red"}},[O.createVNode("span",{style:{marginRight:"2px"}},[O.createTextVNode("本地")]),O.createVNode(O.resolveComponent("Tooltip"),{content:"该字段未在翻译数据库中",placement:"top",transfer:!0},{default:()=>[O.createVNode(O.resolveComponent("Icon"),{type:"ios-alert-outline"},null)]})]):O.createVNode("span",{style:{color:"green"}},[n.common?"全局":"当前页"])}]:[{title:"页面",fixed:"left",width:150,key:"page",render:(t,{row:n})=>t("span",{},n.page==="common"?"全局":n.page)}];return w.map(this.languages,t=>{const n=t.code;return e.push({title:t.name,fixed:t.name==="中文"?"left":"",key:n,render:(s,{row:a,index:r})=>{const o=a[n];return O.createVNode(O.resolveComponent("Input"),{modelValue:o,onOnChange:l=>{const u=l.target.value,{dictKey:_}=a,N=w.findIndex(this.mySaveData,{dictKey:_});N>-1?this.mySaveData[N][n]=u:this.mySaveData.push({...a,[n]:u,page:this.type==="pageData"?this.name:"common"})}},null)}})}),e}},props:{appCode:String,setLanguage:Function,token:String,translationKeys:Array},methods:{closeModal(){this.searchText="",this.type="pageData",this.isModalVisible=!1},openModal({name:e}){this.isModalVisible||(this.isModalVisible=!0,this.name=e,this.init())},findShallowStringDiff(e){return w.find(e,["_isEdit",!0])},async saveData({msg:e="保存成功"},t=!0){const n=this.mySaveData.map(r=>w.map(this.languages,o=>{if(!w.isEmpty(r[o.code]))return{key:r.dictKey,page:r.page,lang:o.code,value:r[o.code]}})),s=w.compact(n[0]);if(w.isEmpty(s)){Z.Message.error({content:"没有需要保存的数据"});return}const a=await Qr({appCode:this.appCode,data:s},this.token);a&&a.data.result===0?(Z.Message.success({content:e||a.data.msg}),this.setLanguage(),this.initialData=w.cloneDeep(this.data.datas),t&&this.closeModal(),this.mySaveData=[]):Z.Message.error({content:a.data.msg||"保存失败"})},async saveNoEqual(){w.isEmpty(this.mySaveData)||this.saveData({msg:"已为您自动保存"},!1)},changePage(e){this.saveNoEqual(),this.type==="pageData"?this.getPageData(e):this.search({firstResult:(e-1)*this.page.pageSize})},async getPageData(e=1){this.loading=!0;const t=await ds({appCode:this.appCode,searchBlur:this.searchText,commaSeparatedKeys:this.translationKeys.toString(),commaSeparatedLangs:w.map(this.languages,"code").toString(),firstResult:0,pageSize:99999},this.token);if(t){let n=[];w.forEach(this.translationKeys,s=>{const a=w.find(t.data.retVal.datas,{dictKey:s,page:this.name});if(a)n.push(a);else{const r=w.find(t.data.retVal.datas,{dictKey:s,page:"common"});r?n.push({...r,page:this.name,common:!0}):n.push({dictKey:s,page:this.name,"zh-CN":s,localhost:!0})}}),this.pageData=w.cloneDeep(n),this.initialData=w.cloneDeep(this.pageData),this.pageDataShow=n.slice((e-1)*this.page.pageSize,e*this.page.pageSize),this.loading=!1}},async search(e,t){this.loading=!0;const n=await ds({appCode:this.appCode,searchBlur:this.searchText,commaSeparatedLangs:w.map(this.languages,"code").toString(),firstResult:0,pageSize:10,...e},this.token);n&&(this.initialData=w.cloneDeep(n.data.retVal.datas),this.data=w.cloneDeep(n.data.retVal.datas),this.page={firstResult:n.data.retVal.firstResult,pageSize:n.data.retVal.pageSize,totalRows:n.data.retVal.totalRows}),this.loading=!1},changeTab(e){this.type=e,e==="data"?this.search():this.getPageData()},async init(){const e=await _s(this.token);e&&e.data.result==0?(this.languages=e.data.retVal,this.getPageData()):Z.Message.error("获取语言失败,出错了")}}},eo=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},to={key:0},no={key:0,class:"extra"},so={class:"gc_i18n_page"},ao={style:{display:"flex"}};function ro(e,t,n,s,a,r){const o=O.resolveComponent("Spin"),l=O.resolveComponent("Table"),u=O.resolveComponent("TabPane"),_=O.resolveComponent("Input"),N=O.resolveComponent("Tabs"),T=O.resolveComponent("Page"),E=O.resolveComponent("Button"),A=O.resolveComponent("Modal");return O.openBlock(),O.createBlock(A,{modelValue:a.isModalVisible,"onUpdate:modelValue":t[4]||(t[4]=k=>a.isModalVisible=k),"mask-closable":!1,width:70,title:"多语言管理中心","footer-hide":"",onOnCancel:r.closeModal},{default:O.withCtx(()=>[a.isModalVisible?(O.openBlock(),O.createElementBlock("div",to,[O.createVNode(N,{modelValue:a.type,"onUpdate:modelValue":t[1]||(t[1]=k=>a.type=k),type:"card",class:"gc_i18n_tabs",onOnClick:r.changeTab},{extra:O.withCtx(()=>[a.type==="data"?(O.openBlock(),O.createElementBlock("div",no,[O.createVNode(_,{prefix:"ios-search",placeholder:"请输入搜索内容",modelValue:a.searchText,"onUpdate:modelValue":t[0]||(t[0]=k=>a.searchText=k),clearable:"",onOnEnter:r.search,onOnClear:r.search},null,8,["modelValue","onOnEnter","onOnClear"])])):O.createCommentVNode("",!0)]),default:O.withCtx(()=>[O.createVNode(u,{name:"pageData",label:"当前页面"},{default:O.withCtx(()=>[a.loading?(O.openBlock(),O.createBlock(o,{key:0,class:"gc_i18n_spin"})):(O.openBlock(),O.createBlock(l,{key:1,border:"",height:380,columns:r.columns,data:a.pageDataShow},null,8,["columns","data"]))]),_:1}),O.createVNode(u,{name:"data",label:"当前应用"},{default:O.withCtx(()=>[a.loading?(O.openBlock(),O.createBlock(o,{key:0,class:"gc_i18n_spin"})):(O.openBlock(),O.createBlock(l,{key:1,border:"",height:380,columns:r.columns,data:a.data},null,8,["columns","data"]))]),_:1})]),_:1},8,["modelValue","onOnClick"]),O.createElementVNode("div",so,[O.createElementVNode("div",ao,[a.type==="pageData"?(O.openBlock(),O.createBlock(T,{key:0,modelValue:r.firstResult,"onUpdate:modelValue":t[2]||(t[2]=k=>r.firstResult=k),total:n.translationKeys.length,"page-size":10,simple:"","show-total":"",onOnChange:r.changePage},null,8,["modelValue","total","onOnChange"])):(O.openBlock(),O.createBlock(T,{key:1,modelValue:r.firstResult,"onUpdate:modelValue":t[3]||(t[3]=k=>r.firstResult=k),total:a.page.totalRows,"page-size":10,simple:"","show-total":"",onOnChange:r.changePage},null,8,["modelValue","total","onOnChange"])),O.createElementVNode("div",null," 共 "+O.toDisplayString(a.type==="pageData"?n.translationKeys.length:a.page.totalRows)+" 项数据 ",1)]),O.createElementVNode("div",null,[O.createVNode(E,{style:{"margin-right":"10px"},onClick:r.closeModal},{default:O.withCtx(()=>t[5]||(t[5]=[O.createTextVNode("关闭")])),_:1},8,["onClick"]),O.createVNode(E,{type:"primary",onClick:r.saveData},{default:O.withCtx(()=>t[6]||(t[6]=[O.createTextVNode("保存")])),_:1},8,["onClick"])])])])):O.createCommentVNode("",!0)]),_:1},8,["modelValue","onOnCancel"])}const oo=eo(zr,[["render",ro],["__scopeId","data-v-4c99c88b"]]);function gs(e){const t=[],n=/(?:\$t|_ctx\.\$t)\s*\(\s*(['"])([^'"]+?)\1/gs;if(e.template){let s;for(;(s=n.exec(e.template))!==null;)t.push(s[2])}if(e.render){const s=e.render.toString();let a;for(;(a=n.exec(s))!==null;)t.push(a[2])}if(e.setup){const s=e.setup.toString();let a;for(;(a=n.exec(s))!==null;)t.push(a[2])}if(e.methods)for(const s in e.methods){const a=e.methods[s].toString();let r;for(;(r=n.exec(a))!==null;)t.push(r[2])}if(e.components)for(const s in e.components){const a=e.components[s];t.push(...gs(a))}return[...new Set(t)]}Z.Message.config({duration:3}),Le.defaults.timeout=6e4,Le.interceptors.request.use(e=>(e.headers["Content-Type"]="application/json",e),e=>(Z.Message.error({content:"请求超时!"}),Promise.resolve(e))),Le.interceptors.response.use(e=>{const{nomsg:t}=e.config.headers;return e.status&&e.status!=200?t||Z.Message.error({content:e.data.message||"未知错误"}):e.data.success=!0,e},e=>(e.response?e.response.status==504||e.response.status==404?Z.Message.error({content:"服务器被吃了⊙﹏⊙∥"}):e.response.status==403?Z.Message.error({content:"权限不足,请联系管理员!"}):Z.Message.error({content:`${e.response.status}:${e.response.statusText||e.response.error}`}):e.code==="ECONNABORTED"&&e.message.indexOf("timeout")!==-1?Z.Message.error({content:"请求超时!"}):Z.Message.error({content:e.message||"未知错误!"}),Promise.resolve(e)));function lo(e){const t={alg:"HS512"},n={orgCode:e},s=JSON.stringify(t),a=JSON.stringify(n);return hs.jws.JWS.sign("HS512",s,a,"")}class io{constructor(t={}){const{router:n,appCode:s,messages:a,token:r,orgCode:o}=t;this.token=r||lo(o),this.appCode=s,this.router=n,this.locale=Ee.get("I18N_LANGUAGE")||navigator.language||"zh-CN",this.modalLoad=!1,this.name="",this.messages=a||{},this.translationKeys=[],this.initRouterGuards(),this.initI18n(t),this.router.isReady().then(async()=>{await this.setLanguage(this.locale),this.createModal()}).catch(l=>{console.error("路由首次加载出错:",l)}),ae.bind("shift > t",l=>{this.configInstance.openModal({name:this.name})}),this.setupLanguageChangeListener()}setupLanguageChangeListener(){"onlanguagechange"in window&&window.addEventListener("languagechange",()=>{const t=navigator.language;t!==this.locale&&this.setLanguage(t)})}initRouterGuards(){this.router.beforeEach(async(t,n,s)=>{const{language:a,token:r}=t.query;if(this.configInstance&&this.configInstance.closeModal(),this.name=t.name,r&&this.setToken(r),t.matched.length>0){let o=t.matched[0].components.default;if(typeof o=="function"&&o.toString().includes("import("))try{o=await o(),o=o.default}catch(l){console.error("加载异步组件时出错:",l),s();return}this.translationKeys=gs(o)}s()})}initI18n(t){this.i18n=xr({locale:this.locale,globalInjection:!0,legacy:!1,silentTranslationWarn:!0,silentFallbackWarn:!0,missingWarn:!1,fallbackWarn:!1,...t});const n=this.i18n.global.t;globalThis.$t=this.i18n.global.t=(s,a,r)=>{var u,_,N;const o=w.toUpper((N=(_=(u=this.router)==null?void 0:u.currentRoute)==null?void 0:_.value)==null?void 0:N.name),l=n(s,a);if((l===s||l===a)&&o){const T=`${o}.${s}`,E=n(T,a);if(E!==T&&E!==a)return E;{const A=`common.${s}`,k=n(A,a);return k!==A?k:r?(console.log(`找不到"${s}",使用"${r}"`),r):s}}return l},globalThis.$deepScan=function(s){return s},globalThis.$t=(s,a,r)=>{const o=Ee.namespace(`I18N_${w.toUpper(this.appCode)}`),l=w.get(o.get(this.locale),"translatesDTOs"),u=w.find(l,_=>`common.${s}`===_.key);return w.get(u,"value",a)},globalThis.$changeLocale=this.changeLocale=this.i18n.global.changeLocale=async s=>{await this.setLanguage(s||this.locale)}}setToken(t){this.token=t}getLanguage(t){return Ee.get("I18N_TEST.zh-TW")}async getLanguages(t=!1){const n=Ee.get("I18N_LANGUAGES");if(n&&!t)return n;{const s=await _s({appCode:this.appCode,token:this.token});if(s.data){const a=w.get(s.data,"retVal");return Ee.set("I18N_LANGUAGES",a),a}}}async setLanguage(t){return new Promise(async(n,s)=>{const a=await Zr({appCode:this.appCode,language:t||this.locale,token:this.token});if(a){const r=Jr(a),o=w.assign({},w.get(this.messages,t),r);this.i18n.global.setLocaleMessage(t,o)}this.locale=t,this.i18n.global.locale.value=t,Ee.set("I18N_LANGUAGE",t),n(!0)})}createModal(t){this.modalLoad=!0,this.configInstance=O.createApp(oo,{appCode:this.appCode,token:this.token,setLanguage:this.setLanguage.bind(this,this.locale),name:this.name,translationKeys:this.translationKeys}).use(Z).mount(document.createElement("div"))}install(t,n={}){t.use(Z,{i18n:this.i18n}),t.use(this.i18n)}}return io});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gc_i18n",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"gc_i18n": {
|
|
5
5
|
"appCode": "TEST"
|
|
6
6
|
},
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"axios": "^1.7.9",
|
|
18
|
+
"jose": "^6.0.11",
|
|
19
|
+
"jsrsasign": "^11.1.0",
|
|
18
20
|
"keyboardjs": "^2.7.0",
|
|
19
21
|
"lodash-es": "^4.17.21",
|
|
20
22
|
"store2": "^2.14.4",
|