@fox-js/fox 3.0.1-10 → 3.0.1-11

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/libs/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";/*!
2
- * fox v3.0.0 Mon Nov 28 2022 08:32:30 GMT+0800 (中国标准时间)
3
- */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("vue"),wr=Array.isArray,Vr=r=>nt(r)==="[object Map]",Br=r=>nt(r)==="[object Set]",Wr=r=>r instanceof Date,S=r=>typeof r=="function",kr=r=>typeof r=="string",zr=r=>typeof r=="symbol",br=r=>r!==null&&typeof r=="object",Jr=r=>br(r)&&S(r.then)&&S(r.catch),Gr=Object.prototype.toString,nt=r=>Gr.call(r),Ze=r=>nt(r)==="[object Object]",Qr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Dt(r){return r.__esModule||Qr&&r[Symbol.toStringTag]==="Module"}const Xr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function T(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,s=!1;for(typeof e=="boolean"&&(s=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let i=r[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let f;Array.isArray(l)?f=a&&Array.isArray(a)?a:[]:f=a&&typeof a=="object"?a:{},e[o]=T(s,f,l)}else l!==void 0&&(e[o]=l)}}return e}function Oe(r,e,t=!1){if(!t)T(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let s in e){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ze(o))continue;i=Oe(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}const n=Object.getOwnPropertySymbols(e);for(let s of n){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ze(o))continue;i=Oe(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}}return r}class ee{static seed=new Date().getTime();static get(){let e=++ee.seed;return e>=Number.MAX_VALUE&&(ee.seed=0),e}}const at=Xr?Promise.resolve():null;function $e(r,...e){at!==null?e&&e.length>0?at.then(()=>{r(e)}):at.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Ut(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":Boolean(r)}function Yr(r){return typeof r=="number"?r:Number(r)}const Zr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function Le(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Zr[t]||"object"}function xr(r){return r&&typeof r=="object"&&"setInterval"in r}function Vt(r){let e=!!r&&"length"in r&&r.length,t=Le(r);return t==="function"||xr(r)?!1:t==="array"||e===0||typeof e=="number"&&e>0&&e-1 in r}function Rr(r,e){let t=+e.length,n=0,s=r.length;for(;n<t;n++)r[s++]=e[n];return r.length=s,r}function en(r,e=[]){let t=e;return r!=null&&(Vt(Object(r))?Rr(t,typeof r=="string"?[r]:r):t.push(r)),t}function tn(r,e,t){if(Vt(r))Reflect.apply([].forEach,r,[e]);else for(let n in r)if(t&&r.hasOwnProperty(n)){if(Reflect.apply(e,r,[r[n]])===!1)break}else if(Reflect.apply(e,r,[r[n]])===!1)break;return r}function et(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Le(r),n=Le(e);if(t!==n)return!1;if(t==="object"){let s=Object.keys(r),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=r[a],f=e[a];if(!et(l,f))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++){let i=r[s],o=e[s];if(!et(i,o))return!1}return!0}return!1}const tr=Symbol("idKey"),ae=Symbol("valueKey"),C=Symbol("childrenKey"),Q=Symbol("growKey");class Sr{[Q]=!0;[tr];[ae]=g.ref();[C]=new Map;constructor(e){this[tr]=e}}class rn{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[Q];let n=e[C].get(t);if(n)return Me(n);if(e[Q])return n=Wt(t),n[Q]=e[Q],e[C].set(t,n),Me(n)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[Q]=Ut(n),!0):n==null?(e[C].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[C].delete(t),!0)}}const Bt="__proxy__";function Wt(r){let e=new Sr(r);return Reflect.set(e,Bt,new Proxy(e,new rn)),e}function Me(r){return Reflect.get(r,Bt)}class Cr extends Sr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("\u53C2\u6570\u81F3\u5C11\u5305\u62EC\u4E00\u4E2A(key, value)"),!1;let n=this;for(let s=0;s<t-1;s++){let i=e[s],o;n[C].has(i)?o=n[C].get(i):(o=Wt(i),n[C].set(i,o)),n=o}return n[ae].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let s=0;s<t;s++){let i=e[s];if(n[C].has(i))n=n[C].get(i);else return}return n[ae].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[C].has(o))n=n[C].get(o);else return!1}let s=e[t-1];return n[C].has(s)?(n[C].delete(s),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[C].has(o))n=n[C].get(o);else return!1}let s=e[t-1];return n[C].has(s)}clear(){this[C].clear()}}const nn=["put","get","contains","remove","clear"];function rr(r){return nn.includes(r)}class sn{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[Q];if(t===C)return e[C];if(typeof t=="string"&&rr(t))return e[t];let n=String(t),s=e[C].get(n);if(s)return Me(s);if(e[Q])return s=Wt(n),s[Q]=e[Q],e[C].set(n,s),Me(s)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[Q]=Ut(n),!0):rr(t)?!1:n==null?(e[C].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[C].delete(t),!0)}}function on(){let r=new Cr,e=new sn,t=new Proxy(r,e);return Object.assign({put(...s){return Reflect.apply(r.put,r,s)},get(...s){return Reflect.apply(r.get,r,s)},remove(...s){return Reflect.apply(r.remove,r,s)},contains(...s){return Reflect.apply(r.contains,r,s)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,Bt,t),r}let _t=new Proxy(Cr,{construct(r,...e){let t=on();return Me(t)}});const Z="default",Pr=Symbol("sync"),I=Symbol("resolveRoute");function nr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function ln(r){let e=r.src;return new Promise((t,n)=>{const s=nr(a=>{Dt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=nr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(s,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(s,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(s,i)}})}class an{name;level;rootName;rootIndex=0;constructor(e,t,n,s){this.name=e,this.level=t,this.rootName=n,this.rootIndex=s}}class tt{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new tt(e.to,e.from),n=e.data??{};return T(!0,t.data,n),t}}class ${path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Z}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new $;return Oe(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new $;if(e==null)return t;let n=t;for(let i in e){let o=e[i];n[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)n[i]=e[i];return t}}class un{id;name;props;meta;src;component;constructor(e,t,n,s){this.id=ee.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return ln(this)}}class ir{models=[]}class ut{path;match;redirect;name;layers=[]}const D=Symbol("chainKey"),M=Symbol("cursorKey"),ft=Symbol("$persistentModeKey"),E=Symbol("statusKey"),X=Symbol("argsKey"),Ne=Symbol("exArgsKey"),fe=Symbol("successFnsKey"),Se=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),Y=Symbol("_go");class Ie{[D]=[];[M]=0;[ft]=!1;[E]="Free";[X]=[];[Ne]=[];[fe]=[];[Se]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[ft]=t}[Y](e,...t){let n=this[E];if(this[E]="Busy",this[M]+=e,this[M]<0&&(this[M]=0),this[X]=t,n==="Exception"||n==="Reject"){let a=[{session:this[ie]},...this[Ne]];for(;this[Se].length>0;)try{let l=this[Se].shift();typeof l=="function"&&$e(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[E]=n,this[D]=[],this[M]=0,this}else if(n==="Finished"||this[M]>=this[D].length){let a=[{session:this[ie]},...this[X]];for(;this[fe].length>0;){let l=this[fe].shift();typeof l=="function"&&$e(()=>{Reflect.apply(l,{},a)})}return this[E]="Free",this}if(this[M]>=this[D].length)return this[E]="Free",this;let s=this[D][this[M]];this[ft]||(this[D].splice(0,this[M]+1),this[M]=-1);let i=this[M]+1;try{let o=!1,a={go:(l,...f)=>{o||(o=!0,Reflect.apply(this[Y],this,[l,...f]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[Y],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[D].splice(i,0,l),i++)},session:this[ie]};$e(()=>{Reflect.apply(s,{},[a,...this[X]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[Y],this,[e,...t])}finish(...e){return this[E]="Finished",this[X]=e,Reflect.apply(this[Y],this,[0])}reject(...e){return this[E]="Reject",this[Ne]=e,Reflect.apply(this[Y],this,[0])}throw(...e){return this[E]="Exception",this[Ne]=e,Reflect.apply(this[Y],this,[0])}reset(...e){this[E]="Busy",this[X]=e,this[D]=[],this[M]=0;let n=[{session:this[ie]},...this[X]];for(;this[fe].length>0;){let s=this[fe].shift();$e(()=>{Reflect.apply(s,this,n)})}return this[E]="Free",this}post(e){return this[E]==="Reject"||this[E]==="Exception"?this:(Array.isArray(e)?this[D]=[...this[D],...e]:this[D].push(e),this[E]==="Busy"?this:(Reflect.apply(this[Y],this,[0,...this[X]]),this))}wait(e,t){return e&&typeof e=="function"&&this[fe].push(e),t&&typeof t=="function"&&this[Se].push(t),this[E]==="Busy"?this:(Reflect.apply(this[Y],this,[0,...this[X]]),this)}exception(e){return e&&typeof e=="function"&&this[Se].push(e),this[E]==="Busy"?this:Reflect.apply(this[Y],this,[0,...this[X]])}isFinish(){return this[E]=="Reject"||this[E]=="Free"&&this[M]>=this[D].length}}const ce=Symbol("registerKey");class fn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class qt{[ce]=new Map;constructor(){}on(e,t,n=!1){let s=this[ce].get(e);s||(s=new Array,this[ce].set(e,s));let i=n===!0?1:0,o=new fn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ce].delete(e),this;let n=this[ce].get(e);if(n){for(let s=0;s<n.length;s++)if(n[s].callback===t){n.splice(s,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(n,{},i)});return this}emit(e,...t){let n=this[ce].get(e);if(!n)return this;for(let s=0;s<n.length;){let i=n[s];if(i.policy==1?n.splice(s,1):s++,typeof i.callback=="function")try{$e(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const cn=new ee;function hn(r,e="text"){e=e.trim().toLowerCase();let t="";if(e.indexOf("application/x-www-form-urlencoded")===0)if(typeof r=="object")for(let n in r){let s=r[n];if(Array.isArray(s))for(let i=0;i<s.length;i++){let o=`${encodeURIComponent(n)}=${encodeURIComponent(s[i])}`;t.length>0&&(t+="&"),t+=o}else{let i=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`;t.length>0&&(t+="&"),t+=i}}else t=r;else e.indexOf("text")===0?typeof r=="object"?t=JSON.stringify(r):t=r:e.indexOf("application/json")===0&&typeof r=="object"?t=JSON.stringify(r):t=r;return t}function dn(r,e,t="text"){if(e==null)return r;t=t.trim().toLowerCase();let n="";if(t.indexOf("application/x-www-form-urlencoded")===0||t.indexOf("application/json")===0)if(typeof e=="object")for(let s in e){let i=e[s];if(Array.isArray(i))for(let o=0;o<i.length;o++){let a=`${encodeURIComponent(s)}=${encodeURIComponent(i[o])}`;n.length>0&&(n+="&"),n+=a}else{let o=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`;n.length>0&&(n+="&"),n+=o}}else n=e;else n=e;return n.length>0&&(r.indexOf("?")===-1?r=`${r}?${n}`:r=`${r}&${n}`),r}const yn={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},ve=new Map;async function kt(r){let{id:e,method:t="POST",url:n,headers:s={},data:i,processData:o=!0,timeout:a=-1}=r;if(e&&ve.has(e))throw new Error("resubmit");t=t.toUpperCase();const l={...yn};l.headers=l.headers??{},Object.assign(l.headers,s);const f=l.headers["Content-Type"];if(Object.assign(l,{method:t}),t==="GET"?n=dn(n,i,f):(o&&(i=hn(i,f)),l.body=i),e||a>0){e||(e=`fox_fetch_${cn.get()}`);const u=new AbortController;l.signal=u.signal;let c={timer:null,controller:u};if(a>0){const h=setTimeout(()=>{c.timer&&c.controller.abort()},a);c.timer=h}ve.set(e,c)}try{let u=await fetch(n,l),c={};u.headers.forEach((y,v)=>{c[v]=y});let h,d=c["content-type"]??"";return d.indexOf("application/json")!==-1?h=await u.json():d.indexOf("text")!=-1?h=await u.text():h=await u.blob(),{ok:u.ok,status:`${u.status}`,statusText:u.statusText,headers:c,data:h,response:u}}catch(u){throw u}finally{if(e){let u=ve.get(e);u&&(u.timer&&(clearTimeout(u.timer),u.timer=null),ve.delete(e))}}}function pn(r){let e=ve.get(r);return e?(e.timer&&(clearTimeout(e.timer),e.timer=null),e.controller.abort(),ve.delete(r),!0):!1}const Ce=Symbol("registerKey");class mn{[Ce]=new Map;constructor(){}set(e,t){this[Ce].set(e,t)}get(e){return this[Ce].get(e)}has(e){return this[Ce].has(e)}delete(e){return this[Ce].delete(e)}}const $t=Symbol("lc");function Qe(r,e=!1){let t=r,n=t[$t];if(!n)if(e)n=new mn,t[$t]=n;else return null;return n}function Ar(r,e){let t=r;for(;t!==null;){const n=t[$t];if(n&&n.has(e))return n.get(e);t=t.$parent}return null}function sr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return Qe(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function vn(r){let e=r.get(rt);e||(e=[],r.set(rt,e))}function or(r,e){let t=r.get(rt);if(t!=null)for(let n=t.length-1;n>=0;n--){let s=t[n];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var Ot=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Ot||{});class gn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function wn(r,e,t,n){let s=new gn(e,t,n);return r.push(s),!0}function bn(r,e,t,n){let s=-1;for(let i=0;i<r.length;i++){let o=r[i];if(o.type===e&&o.hook===t&&o.target===n){s=i;break}}return s!=-1?(r.splice(s,1),!0):!1}function Er(r){return(e,t)=>{let n;if(t)n=t;else{let i=g.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}n=i.proxy}let s=Ar(n,rt);if(s==null){console.warn("can not get hooks context");return}g.onUnmounted(()=>{bn(s,r,e,n)}),wn(s,r,e,n)}}let xn=Er("a"),Rn=Er("da");function Sn(){let r=new $;return r.path="",r.name="",r.params={},r.index=-1,g.shallowReactive(r)}const Lt=Symbol("routeKey");function ct(r,e){let t=r.get(Lt);if(t){let n={path:"",name:"",params:{},index:-1,session:{}};Object.assign(n,e),Object.assign(t,n)}else t=Sn(),Object.assign(t,e),r.set(Lt,t)}function Fr(r){let e=Ar(r,Lt);return e??null}const it=Symbol("rk"),ht=Symbol("vd"),lr=Symbol("rv"),dt=Symbol("rvi"),ar=Symbol("pv"),yt=Symbol("pvi");function Cn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var s="",i=t+1;i<r.length;){var o=r.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=r[i++];continue}break}if(!s)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:s}),t=i;continue}if(n==="("){var a=1,l="",i=t+1;if(r[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<r.length;){if(r[i]==="\\"){l+=r[i++]+r[i++];continue}if(r[i]===")"){if(a--,a===0){i++;break}}else if(r[i]==="("&&(a++,r[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=r[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function Tr(r,e){e===void 0&&(e={});for(var t=Cn(r),n=e.prefixes,s=n===void 0?"./":n,i="[^".concat(me(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,f="",u=function(R){if(l<t.length&&t[l].type===R)return t[l++].value},c=function(R){var q=u(R);if(q!==void 0)return q;var K=t[l],_=K.type,L=K.index;throw new TypeError("Unexpected ".concat(_," at ").concat(L,", expected ").concat(R))},h=function(){for(var R="",q;q=u("CHAR")||u("ESCAPED_CHAR");)R+=q;return R};l<t.length;){var d=u("CHAR"),y=u("NAME"),v=u("PATTERN");if(y||v){var p=d||"";s.indexOf(p)===-1&&(f+=p,p=""),f&&(o.push(f),f=""),o.push({name:y||a++,prefix:p,suffix:"",pattern:v||i,modifier:u("MODIFIER")||""});continue}var m=d||u("ESCAPED_CHAR");if(m){f+=m;continue}f&&(o.push(f),f="");var b=u("OPEN");if(b){var p=h(),j=u("NAME")||"",x=u("PATTERN")||"",P=h();c("CLOSE"),o.push({name:j||(x?a++:""),pattern:j&&!x?i:x,prefix:p,suffix:P,modifier:u("MODIFIER")||""});continue}c("END")}return o}function Pn(r,e){return An(Tr(r,e),e)}function An(r,e){e===void 0&&(e={});var t=zt(e),n=e.encode,s=n===void 0?function(l){return l}:n,i=e.validate,o=i===void 0?!0:i,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var f="",u=0;u<r.length;u++){var c=r[u];if(typeof c=="string"){f+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",y=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!y)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var v=0;v<h.length;v++){var p=s(h[v],c);if(o&&!a[u].test(p))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));f+=c.prefix+p+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var p=s(String(h),c);if(o&&!a[u].test(p))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));f+=c.prefix+p+c.suffix;continue}if(!d){var m=y?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(m))}}return f}}function En(r,e){var t=[],n=jr(r,t,e);return Fn(n,t,e)}function Fn(r,e,t){t===void 0&&(t={});var n=t.decode,s=n===void 0?function(i){return i}:n;return function(i){var o=r.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,f=Object.create(null),u=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?f[d.name]=o[h].split(d.prefix+d.suffix).map(function(y){return s(y,d)}):f[d.name]=s(o[h],d)},c=1;c<o.length;c++)u(c);return{path:a,index:l,params:f}}}function me(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function zt(r){return r&&r.sensitive?"":"i"}function Tn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=t.exec(r.source);s;)e.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(r.source);return r}function jn(r,e,t){var n=r.map(function(s){return jr(s,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),zt(t))}function Kn(r,e,t){return _n(Tr(r,t),e,t)}function _n(r,e,t){t===void 0&&(t={});for(var n=t.strict,s=n===void 0?!1:n,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,f=t.encode,u=f===void 0?function(L){return L}:f,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,y=d===void 0?"":d,v="[".concat(me(y),"]|$"),p="[".concat(me(h),"]"),m=o?"^":"",b=0,j=r;b<j.length;b++){var x=j[b];if(typeof x=="string")m+=me(u(x));else{var P=me(u(x.prefix)),R=me(u(x.suffix));if(x.pattern)if(e&&e.push(x),P||R)if(x.modifier==="+"||x.modifier==="*"){var q=x.modifier==="*"?"?":"";m+="(?:".concat(P,"((?:").concat(x.pattern,")(?:").concat(R).concat(P,"(?:").concat(x.pattern,"))*)").concat(R,")").concat(q)}else m+="(?:".concat(P,"(").concat(x.pattern,")").concat(R,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?m+="((?:".concat(x.pattern,")").concat(x.modifier,")"):m+="(".concat(x.pattern,")").concat(x.modifier);else m+="(?:".concat(P).concat(R,")").concat(x.modifier)}}if(l)s||(m+="".concat(p,"?")),m+=t.endsWith?"(?=".concat(v,")"):"$";else{var K=r[r.length-1],_=typeof K=="string"?p.indexOf(K[K.length-1])>-1:K===void 0;s||(m+="(?:".concat(p,"(?=").concat(v,"))?")),_||(m+="(?=".concat(p,"|").concat(v,")"))}return new RegExp(m,zt(t))}function jr(r,e,t){return r instanceof RegExp?Tn(r,e):Array.isArray(r)?jn(r,e,t):Kn(r,e,t)}var A=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(A||{}),Xe=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),le=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class te{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,s=!0){this.route=e,this.model=t,this.index=n,this.active=s}}class Pe{scope=null;set compensation(e){this.scope!==null&&this.scope.stop(),this.scope=g.effectScope(),this.scope.run(()=>{g.watch(this.slots,()=>{let t=!1;try{t=e()}catch(n){console.error(n)}t&&this.scope!==null&&(this.scope.stop(),this.scope=null)})})}_slots;get slots(){return this._slots==null&&(this._slots=g.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[le]=null;get name(){return this[Ye]}constructor(e,t,n){this[Ye]=e,this[G]=t,n&&(this[J]=n)}}class U{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let s=e[n];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class pt{views=[]}class qn{layers=[]}class $n{time;route}class On{forbidTime=300;submitRecorder=new $n;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const we=typeof window<"u",N=function(){return window},Ae=function(){return window.document};function Ln(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function Mn(){if(!we)return"/";let r=N().location,e=`${r.protocol}//${r.host}`;return e+=Ln(r.pathname),e}function Mt(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function It(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}let mt=Mn();class In{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let n=await kt({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(n.ok)return this.cache.set(e,n.data),n.data;throw Error(n.statusText)}remove(e){this.cache.delete(e)}}var z=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(z||{});class Nn{exports;status;id;src}class Hn{register=new Map;constructor(){}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}class Dn{head;isOldWebKit;moduleManager=new Hn;resource=new In;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=Ae();this.head=t.head||t.getElementsByTagName("head")[0]||t.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}ensure(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let f=e[l];for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}else{let f=e[l].split(",");for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}let o=new Un(t.length,(l,f)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},f)}catch(u){console.error(u.message,u)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(u){console.error(u.message,u)}}),a=new Ie;for(let l=0;l<t.length;l++){let f=new Vn(l,t[l],s,o);this.mount(a,f)}return this}remove(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){const n=Ae();if(this.isNaturePath(t.src,"js")){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src,"css")){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else if(this.isNaturePath(t.src,"html")){let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}let s=this.getFileNamePostfix(t.src);if(s==="js"||s.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(s==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else{let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}}mountHTML(e,t,n){e.post(s=>{let i=t.params.timeout??this.options.timeout??3e4,o=t.src;this.resource.get(o,i).then(a=>{n.innerHTML=a,t.progress.work(!0,t.index,a),s.resolve()},a=>{console.error(a),t.progress.work(!1,t.index,null),s.reject()})})}mountCSS(e,t,n){e.post(s=>{const i=Ae(),o=t.src,a=i.createElement("link"),l="onload"in a;if(this.isOldWebKit||!l){const u={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{n.removeChild(a)}catch(c){console.error(c.message,c)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{Kr(a,u)},1)}else a.onload=()=>{a.onload=a.onerror=null,t.progress.work(!0,t.index,t.src),s.resolve()},a.onerror=()=>{try{n.removeChild(a)}catch(u){console.error(u.message,u)}a.onload=a.onerror=null,t.progress.work(!1,t.index,null),s.reject()};let f=i.getElementById(o);f&&f.parentNode&&f.parentNode.removeChild(f),a.rel="stylesheet",a.type="text/css",a.id=o,a.href=o,n.appendChild(a)})}mountJS(e,t,n){e.post(s=>{let i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==z.Defined||o.status==z.Loaded)){if(o.exports){t.progress.work(!0,t.index,o.exports),s.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),s.resolve();return}}o=new Nn,o.id=i,o.src=i,o.status=z.Loading,this.moduleManager.put(i,o);const l=Ae().createElement("script");if("onload"in l)l.onload=()=>{l.onload=l.onerror=null,o.status==z.Loading&&(o.status=z.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{let c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==z.Loading&&(o.status=z.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;let u=N();u.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Ae(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=n.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=n.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}else{this.resource.remove(e);let i=t.htmlPoint;i||(i=n.body),i.innerHTML="";return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){let s=e[n].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){let n=this,s=function(...i){e.status=z.Defining;let o,a,l,f=i.length;f===1?(l=i[0],o=void 0):f===2?(l=i[1],Array.isArray(i[0])?(a=n.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=n.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...u)=>{typeof l=="function"?e.exports=Reflect.apply(l,e,u):e.exports=l,e.status=z.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=z.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&t!=="html"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let s=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e,t){if(this.options.nature==null)return!1;if(t==="all"||t==="js"){let n=this.options.nature.js;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="css"){let n=this.options.nature.css;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="html"){let n=this.options.nature.html;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return mt+e.slice(1);if(e.indexOf("./")==0)return mt+e.slice(2);if(t){let s=this.options.alias[e];if(!s){let i=e.indexOf("/");if(i==-1)s=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?s=a+e.slice(i):s=e}}return this.parserPath(s,!1)}return mt+e}}function Kr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.time>e.timeout?e.error():Kr(r,e)},20)}class Un{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}}isOK(){return this.status}}class Vn{index;src;params;progress;constructor(e,t,n,s){this.index=e,this.src=t,this.params=n,this.progress=s}}const ge=Symbol("_notifyChange");class Bn{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const He=Symbol("ignoreHistoryChangeOnceKey"),ur=Symbol("_navigateFirstRoute"),De=Symbol("_getRouteMark"),fr=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),Ee=Symbol("_setRouteMarkRecorder"),cr="Symbol(_fox_restore_point)";function gt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class _r{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[He]=!1;constructor(e="hash",t="",n="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??N().sessionStorage}init(e=!0){const t=N();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[He]){this[He]=!1;return}if(gt(this.historyMonitor)){const n=t.history.state;this[ge](n);try{let s=[];if(typeof n=="string"?s=JSON.parse(n):s=n,Array.isArray(s)&&s.length>0){const i=this[De]()??"/";this[Ee](i,s)}}catch{}}}),Mt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ur](),Promise.resolve()}destroy(){if(this.historyChange){const e=N();It(e,"popstate",this.historyChange)}}[ur](){let e=this[De]()??"/";const t=this.storage.getItem(cr);if(t)try{const o=JSON.parse(t);if(o.mark===e){this[ge](o.routes);return}}catch{}const n=e.indexOf("!");let s;n!=-1?s=e.substring(n+1):s=e;const i=new $;i.path=s,i.query=this[fr](),this[ge]([i])}[Ee](e,t){try{const n={mark:e,routes:t},s=JSON.stringify(n);this.storage.setItem(cr,s)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[De]()??"/";this[Ee](t,e)}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[De](){const e=N();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[fr](){return N().location.search}listen(e){this.changeHandler=e}go(e,t=!0){const n=N();this[He]=!t,n.history.go(e)}push(e){let t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||N().history.pushState(e.routes,"",t),this[Ee](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||N().history.replaceState(e.routes,"",t),this[Ee](e.currentRoute.fullPath,e.routes)}[vt](e){const t=N();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l in e.query){let f=encodeURIComponent(e.query[l]),u=`${encodeURIComponent(l)}=${f}`;a.length>0&&(a+="&"),a+=u}else a=e.query;this.query?(n=`${this.query}&${a}`,n.charAt(0)!=="?"&&(n=`?${n}`)):n=`?${a}`}const s=t.location;let i=e.fullPath;i.startsWith(Z)&&(i=i.substring(Z.length+1));let o;return n?this.mode=="path"?o=`${this.base}/${i}${n}`:o=`${s.pathname}${n}#${i}`:this.mode=="path"?o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Wn(r=!0,e=null,t="",n=!0,s=!1,i){return e!==null&&(e=N().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new _r("path",e??"",t,r,n,s,i)}function qr(r=!0,e="",t=!0,n=!1,s){return new _r("hash","",e,r,t,n,s)}class kn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}listen(e){this.changeHandler=e}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const s=this.queue[n];this[ge](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function $r(r="",e=50){return new kn(r,e)}const Ue=Symbol("_constructRouteModel"),Ve=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),hr=Symbol("_getFirstView"),se=Symbol("_removeView"),dr=Symbol("_buildPage"),yr=Symbol("_resolveComponent"),pr=Symbol("_update"),re=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),Be=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),w=Symbol("currentRoutes"),he=Symbol("current"),mr=Symbol("_addRouteRecorder"),de=Symbol("_removeRouteRecorder"),xt=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),ke=Symbol("errorCallback"),V=Symbol("registerKey"),ze=Symbol("notFoundKey"),Rt=Symbol("notFoundPathKey"),B=Symbol("forestKey"),F=Symbol("historyKey"),Fe=Symbol("beforeFiltersKey"),Te=Symbol("afterFiltersKey"),je=Symbol("destroyFiltersKey"),ye=Symbol("mainDispatcherKey"),St=Symbol("initKey"),Je=Symbol("requireKey"),oe=Symbol("readyKey"),Ct=Symbol("readyHandlersKey"),Ge=Symbol("_markReady"),vr=Symbol("_createNextFn"),Pt=Symbol("_start"),At=Symbol("_before"),Et=Symbol("_after"),gr=Symbol("_destroy"),Ft=Symbol("_load"),Ke=Symbol("_unload"),Tt=Symbol("_loadDependency"),jt=Symbol("resolvedModulesKey"),_e=Symbol("resolveDependencyKey"),qe=Symbol("routerGuardKey");function zn(r){return r.layers.length==0||r.layers[0].views.length==0}function Jn(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let s=T(!0,{},n.meta);e.push(s)}else n.meta&&e.push(n.meta)})}),e}class Gn{[V]=new Array;[ze];[Rt]="*";[oe]=!1;[Ct]=[];[B]=new qn;[F];[w]=new Array;[ke]=null;[We]=null;[Fe]=new Array;[Te]=new Array;[je]=new Array;[ye]=new Ie;[jt]=new Map;[_e]=null;[qe]=new On;[St]=!1;[he]=g.ref(null);[Je]=null;get require(){return we?(this[Je]||(this[Je]=new Dn),this[Je]):null}get current(){return this[he].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[F]=e.history:this[F]=we?qr():$r(),this[F]?.listen(async n=>{let s=!0;try{if(typeof n=="string"){let i=this[I](n);i&&await this[bt]([i])}else await this[bt](n)}catch(i){console.error(i.message,i),s=!1}this[oe]===!1&&this[Ge](s)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[ke]=="function")try{this[ke](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[F]?.init(!this[oe]),this[St]=!0)}isReady(){return this[oe]?Promise.resolve():new Promise((e,t)=>{this[Ct].push([e,t])})}[Ge](e){this[oe]=!0,this[Ct].forEach(([t,n])=>{try{e?t():n()}catch(s){console.error(s.message,s)}})}[bt](e){try{if(!e){let o=[...this[w]].reverse();return this[Ke](o),we&&N().location.reload(),Promise.resolve()}let t=null,n=[],s=[],i=0;for(;i<e.length&&i<this[w].length&&$.isSame(e[i],this[w][i]);i++)e[i].opsType===A.Open&&e[i].active===!0&&e[i].active!==this[w][i].active&&(t=e[i]);if(i<e.length&&(n=e.slice(i)),i<this[w].length&&(s=this[w].slice(i).reverse()),s.length==0&&n.length==0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Ke](s)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[O](t)}return Promise.resolve()}[Be](e){if(e)this[he].value=e;else{let t=this[w].length;t>0?this[he].value=this[w][t-1]:this[he].value=null}if(typeof this[We]=="function")try{this[We](this[he].value)}catch{}}[mr](e,t=-1){t<0||t>=this[w].length?this[w].push(e):this[w].splice(t,0,e)}[xt](){let e=[];for(let t of this[w]){let n=$.clone(t,!0);e.push(n)}return e}[de](e){if(this[w]==null)return;let t=-1;for(let n=0;n<this[w].length;n++)if($.isSame(this[w][n],e)){t=n;break}if(t!=-1){let n=this[w][t];this[w].splice(t,1),this[gr](n,n.session)}}set historyMonitor(e){this[F]&&(this[F].historyMonitor=e)}get historyMonitor(){return this[F]?this[F].historyMonitor:!1}set traceless(e){this[F]&&(this[F].traceless=e)}get traceless(){return this[F]?this[F].traceless:!1}setRestorePoint(){const e=this[xt]();this[F]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[ke]=e}beforeEach(e){this[Fe].push(e)}removeBeforeEach(e){const t=this[Fe].indexOf(e);return t!==-1?(this[Fe].splice(t,1),!0):!1}afterEach(e){this[Te].push(e)}removeAfterEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}destroyEach(e){this[je].push(e)}removeDestroyEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}setResolveDependency(e){this[_e]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Rt]){this.setNotFoundRoute(e);return}const n=this[Ue](e);if(t==-1)this[V]=[...this[V],...n];else for(let s=n.length-1;s>=0;s--)this[V].splice(t,0,n[s])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1;for(let n=0;n<this[V].length;n++){const s=this[V][n];if(t?.path&&s.path===t.path)return this[V].splice(n,1),!0;if(t?.name&&s.name===t.name)return this[V].splice(n,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1):this[V].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Rt]=e}setNotFoundRoute(e){const t=this[Ue](e);this[ze]=t[0]}getRoutes(){return[...this[V]]}[Ue](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){let a=new ut;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in n){let l=n[a];a.length===0&&(a=Z);let f=new un(a,l,e.props,e.meta);s.push(f)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ue](a);for(let f of l){let u=new ut;u.name=f.name,f.path&&f.path.length>0?t!=="/"?u.path=`${t}${f.path}`:u.path=f.path:(i=!0,u.path=t);let c=new ir;c.models=[...s],u.layers=[c,...f.layers],o.push(u)}}if(!i){let a=new ir;a.models=s;let l=new ut;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ve](e){let t=e.route;try{for(let n of this[V])if(t.path&&n.path){let s=n.match;s||(s=n.match=En(n.path));let i=s(t.path);if(!i)continue;if(n.redirect){let o=new $;T(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ve](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},T(!0,t.params,i.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let f of l){let u=f.split("=");if(u.length!==2)continue;let c=decodeURIComponent(u[0].trim()),h=decodeURIComponent(u[1].trim());a[c]=h}T(!0,t.params,a)}else typeof o=="object"&&T(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let s=Pn(n.path);return t.path=s(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new $,typeof e[0]=="object")t=$.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&T(!1,t,e[n]);else typeof e=="object"?t=$.from(e):typeof e=="string"&&(t=new $,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Z,t.opsType=t.opsType??this.options.defaultOperationType??A.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||A.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=A.Put,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=A.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=A.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ye].post(n=>{try{if(this[w].length===0){n.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[w][0].root??Z,e.all)for(let l=this[w].length-1;l>0;l--){let f=this[w][l];f.opsType===A.Append&&f.root===i&&(o.splice(0,0,f),s=l-1)}else if(e.until)for(let l=this[w].length-1;l>0;l--){let f=this[w][l];if(f.opsType===A.Append&&f.root===i){if(e.until.charAt(0)==="/"&&e.until===f.path){s=l;break}else if(e.until===f.name){s=l;break}o.splice(0,0,f)}}}else{i=Z;let l=this[hr](this[B]);l&&(i=l.name);for(let f=this[w].length-1;f>0;f--){let u=this[w][f];if(u.opsType===A.Append&&u.root===i){o.push(u),s=f-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[w].forEach(l=>{l.opsType!==A.Put&&a++}),this[Ke](o)){let l=0;this[w].forEach(u=>{u.opsType!==A.Put&&l++});const f=l-a;this[F]?.go(f,!1),n.resolve(),t(!0)}}catch(s){this[O](s),n.resolve(),t(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=A.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ye].post(t=>{try{let n=this[I](e);if(!n){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[w].length;i++){let o=this[w][i];if(o.root===n.root){if(!n.path&&!n.name){s.push(o);continue}if(n.path&&n.path===o.path){s.push(o);break}else if(n.name&&n.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Ke](s)&&this[Be](),t.resolve()}catch(n){this[O](n),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[O]("resolve route fail",t),this;console.debug("route to",t.path,t.root);let n=this[qe].acquire(t);return n==null?(this[O]("route forbid",t),this):(this[ye].post(s=>{try{let i=this[Pt](t);this[At](i),!i.session?.routeModel&&this[_e]&&this[Tt](i),this[Ft](i),this[Et](i),i.wait((o,a)=>{let l=o.session.to;try{let f=$.clone(l,!0);const u=new Bn(f,this[xt]());l.opsType===A.Replace?this[F]?.replace(u):this[F]?.push(u)}catch(f){console.error(f.message,f)}if(this[qe].release(n),this[Be](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(f){console.error(f.message,f)}this[oe]===!1&&this[Ge](!0),s.resolve()},(o,a)=>{this[qe].release(n),a!==null&&this[O](a,t),this[oe]===!1&&this[Ge](!1),s.resolve()})}catch(i){this[qe].release(n),this[O](i,t),s.resolve()}}),this)}back(e=1){this[F]?.go(-e)}[vr](e){return(t,n)=>{if(typeof t=="boolean")t?e.resolve():e.reject(n??null);else if(t){let s=this[I](t);if(s){let i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Pt](e){let t=this[w].length>0?this[w][0]:void 0,n=new tt(e,t),s={route:e,find:null};return this[Ve](s),s.find&&(n.routeModel=s.find,e.matched=Jn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new Ie(n)}[At](e){for(let t of this[Fe])e.post(n=>{let s=this[vr](n);Reflect.apply(t,{},[n.session.to,n.session.from,s,n.session])})}[Et](e){e.post(t=>{for(let n of this[Te])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[gr](e,t){for(let n of this[je])try{Reflect.apply(n,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Tt](e){let t=e.session,n=Reflect.apply(this[_e],this,[t?.to]);if(n==null)return;Array.isArray(n)||(n=[n]);let s=[];for(let i of n)this[jt].has(i)||s.push(i);s.length!==0&&e.post(i=>{this.require.ensure(s,(...o)=>{if(!o){i.reject();return}for(let a of o){if(!a)continue;let l;Dt(a)?l=a.default:l=a,Array.isArray(l)&&this.addRoutes(l)}for(let a of s)this[jt].set(a,!0);i.resolve()})})}[Ft](e){e.post(t=>{let n=t.session.to,s=t.session.routeModel;if(s==null){let o={route:n,find:null};if(this[Ve](o))s=o.find,t.session.routeModel=s;else if(this[ze])s=this[ze];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let i=tt.from(t.session);this[dr](n,s,i).then(o=>{this[B],t.resolve()},o=>{t.reject(o)})})}[Ke](e){if(e.length==0)return!0;let t=this[B],n=[];for(let s of e){let i=this[wt](t,s);i!=null&&n.push({...i,route:s})}if(n.length==0){let s="can not find view index";return this[O](s),!1}for(let s of n.reverse())this[se](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[wt](e,t){let n=t.root??Z,s;for(let i=0;i<e.layers.length;i++){let o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){let l=o.views[a];if(l[G]&&l[Ye]===n)return s={x:a,y:i},s}}return null}[hr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[se](e,t,n=null,s=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,f=i.slots.value;for(let c=f.length-1;c>=0;c--){let h=f[c];(n==null||n.indexOf(h.index)!=-1)&&(h.route&&i[G]&&(this[de](h.route),h.active===!0&&h.route.opsType==A.Append&&(l=!0)),a.push(new U(i,h.index,t.y)),f.splice(c,1))}if(f.length==0)s?i.slots.value=[...f]:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=f.length-1,h=f[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=[...f]}e.layers[t.y].views.length==0&&(o=!0);let u=t.y+1;for(;u<e.layers.length;u++){let c=e.layers[u].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let y=c[d];if(y[le]&&(o||U.include(a,y[le]))){let v=y.slots.value;for(let p=v.length-1;p>=0;p--){let m=v[p];m.route&&y[G]&&this[de](m.route),h.push(new U(y,m.index,u)),v.splice(p,1)}e.layers[u].views.splice(d,1)}}a=h,e.layers[u].views.length==0&&(o=!0)}}restore(e){if(!e||this[V].length==0){let t=this[B];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[w]=[],this[Be](),Promise.resolve()}else return new Promise((n,s)=>{for(let i=0;i<e.length;i++){let o=e[i];this[ye].post(a=>{let l=this[Pt](o);this[At](l),!l.session?.routeModel&&this[_e]&&this[Tt](l),this[Ft](l),this[Et](l),l.wait((f,u)=>{a.resolve()},(f,u)=>{u!==null&&this[O](u),a.resolve()})})}this[ye].post(i=>{i.resolve(),n()})})}[dr](e,t,n){let s=e.updateType??Xe.Part;return this[yr](t).then(()=>{this[pr](t,e,n,s)})}[yr](e){let t=[];for(let n=0;n<e.layers.length;n++){let s=e.layers[n];for(let i=0;i<s.models.length;i++){let o=s.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[pr](e,t,n,s){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multil root node)");const i=e.layers[0].models[0];let o=this[B],a=zn(o),l=t.root??Z,f;!a&&s==Xe.Part&&(f=this[wt](o,t));let u,c=0;if(f==null||f==null)if(a||s===Xe.All){if(o.layers.length==0&&(o.layers[0]=new pt),o.layers[0].views.length==0){let h=t.root??Z;u=new Pe(h,!0,null),o.layers[0].views=[u]}else u=o.layers[0].views[0];f={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let y;if(h.rootName){let v=o.layers[d-1];for(let p of v.views){if(p[G]&&p.name===h.rootName){y=new U(p,h.rootIndex??0,d-1);break}if(p[J]&&p[J].view.name===h.rootName&&p[J].index===h.rootIndex){y=p[J];break}}}if(!y)return Promise.reject("can not insert view(not find root node ref)");u=new Pe(l,!0,y),o.layers[d].views.push(u),f={x:o.layers[d].views.length-1,y:d}}else u=o.layers[f.y].views[f.x];if(c=f.y,u[G]=!0,t.opsType===A.Append){t.index=ee.get();let h=u.slots.value;if(h.length>0){let m=h[h.length-1];m.active=!1,m.route&&(m.route.active=m.active)}let d=new te(t,i,t.index,!0);u.slots.value=[...h,d];let y=c+1,v=1,p=new U(u,t.index,c);this[re](o,y,e,v,p)}else if(t.opsType===A.Open){let h=u.slots.value,d=!1;for(let y of h){if(y.route!==null&&$.isSameForRouteModel(y.route,t)){if(y.active==!0)return t.index=y.index,t.active=y.active,y.route=t,Promise.resolve();y.active=!0,d=!0,t.index=y.index,t.active=y.active,y.route=t,this[de](y.route)}else y.active=!1;y.route&&(y.route.active=y.active)}if(!d){t.index=ee.get(),t.active=!0;let y=new te(t,i,t.index,!0);h.push(y);let v=c+1,p=1,m=new U(u,t.index,c);this[re](o,v,e,p,m)}u.slots.value=[...h]}else{let h=u.slots.value;if(h.length==0){t.index=ee.get(),u.slots.value=[new te(t,i,t.index)];let d=c+1,y=1,v=new U(u,t.index,c);this[re](o,d,e,y,v)}else{let d=h[0];if(d.model!==i){this[se](o,f,null,!0),t.index=ee.get(),u.slots.value=[new te(t,i,t.index)];let y=c+1,v=1,p=new U(u,t.index,c);this[re](o,y,e,v,p)}else{d.route!==null&&this[de](d.route);let y=[];for(let j=1;j<h.length;j++)y.push(h[j].index);y.length>0&&this[se](o,f,y,!0),t.index=d.index,d.route=t;let v=[new U(u,t.index,c)],p=c+1,m=1,b=new U(u,t.index,c);for(;v.length>0&&p<o.layers.length&&m<e.layers.length;p++,m++){let j=[];for(let P=0;P<o.layers[p].views.length;P++){let R=o.layers[p].views[P];R[le]&&U.include(v,R[le])&&j.unshift(P)}let x=[];for(let P of j){let R=o.layers[p].views[P],q=e.layers[m].models,K;for(let _=0;_<q.length;_++)if(R.name===q[_].name){K=q[_];break}if(!K)this[se](o,{x:P,y:p},null,!1);else{let _=R.slots.value;if(_.length==0){let L=0;R.slots.value=[new te(null,K,L)];let W=p+1,k=m+1;this[re](o,W,e,k,b)}else{let L=_[0];if(L.model!==K){this[se](o,{x:P,y:p},null,!0),R.slots.value=[new te(null,K,0)];let W=p+1,k=m+1;this[re](o,W,e,k,b)}else{R[G]&&L.route!==null&&this[de](L.route);let W=[];for(let k=1;k<_.length;k++)W.push(_[k].index);W.length>0&&this[se](o,{x:P,y:p},W,!0),x.push(new U(R,L.index,p))}}R[G]=!1}}v=x}this[re](o,p,e,m,b)}}}if(u&&u[J]){let h=u[J];h&&(t.slot=new an(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[mr](t)}[re](e,t,n,s,i){let o=s,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let f of n.layers[o].models){let u=new Pe(f.name,!1,i),c=new te(null,f);u.slots.value=[c],l.push(u)}}for(;o<n.layers.length;o++){let l=new pt;l.views=[];for(let f of n.layers[o].models){let u=new Pe(f.name,!1,i),c=new te(null,f);u.slots.value=[c],l.views.push(u)}e.layers.push(l)}}[Pr](e,t,n,s,i,o){if(t<0||t>this[B].layers.length)return null;if(t<this[B].layers.length){let u=this[B].layers[t],c=null;for(let h of u.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&s!==-1&&(d=h[J]?.index===s)):d=h.name===e,!!d){i!==null&&(h[le]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[G]?a={view:i,index:o,level:t-1}:a=i[J],l={view:i,index:o,level:t-1});let f=new Pe(e,!0,a);if(f[le]=l,t==this[B].layers.length){let u=new pt;u.views=[f],this[B].layers.push(u)}else this[B].layers[t].views.push(f);return f}}const Qn="fox-router-view",Xn="fox-router-link";function Or(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Lr(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Yn(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Zn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ei(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function ti(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function ri(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function ni(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function ii(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function si(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function oi(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function li(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function ai(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Jt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function be(r,e){r.classList.contains(e)||r.classList.add(e)}function xe(r,e){r.classList.remove(e)}const ui=we&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Gt(r){ui(r)}function H(r,e,t){!S(e)||(r==null&&(r={}),Reflect.apply(e,r,t))}function Mr(r,e,t,n=-1,s,i,o,a){if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},s);return}const l=["animationend","transitionend"],f=u=>{l.forEach(c=>{It(e,c,f)}),Reflect.apply(i,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(u=>{Mt(e,u,f)})}if(S(o)){const l="animationcancel",f=u=>{Reflect.apply(o,r,[e,t,n]),It(e,l,f)};Mt(e,l,f)}}function Qt(r){return!we||r===null?!1:r.opsType===A.Append||r.opsType===A.Open}function Ir(r,e,t,n={},s,i=-1){if(e||Qt(s)){const o=Or(n,e);o&&be(t,o);const a=Lr(n,e);a&&be(t,a);const l=ri(n,e);H(r,l,[t,e,s,i])}}function Nr(r,e,t,n={},s,i,o,a){if(!Qt(i)&&!e){S(a)&&a(r,a,[t]);return}const l=Or(n,e),f=Lr(n,e),u=Yn(n,e),c=ni(n,e),h=ii(n,e),d=si(n,e);Gt(()=>{Mr(r,t,i,o,s,()=>{f&&xe(t,f),u&&xe(t,u),S(h)&&H(r,h,[t,e,i,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&H(r,d,[t,e,i,o])}),l&&xe(t,l),u&&be(t,u),S(c)&&H(r,c,[t,e,i,o])})}function Hr(r,e,t,n={},s,i,o,a,l){if(!Qt(o)&&!e){!e&&S(i)&&i();return}const f=Zn(n,e),u=ei(n,e),c=ti(n,e),h=oi(n,e),d=li(n,e),y=ai(n,e);f&&be(t,f),u&&be(t,u),S(h)&&H(r,h,[t,e,o,a]),Gt(()=>{Mr(r,t,o,a,s,()=>{u&&xe(t,u),c&&xe(t,c),S(d)&&H(r,d,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(i)&&i()},()=>{S(y)&&H(r,y,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(i)&&i()}),f&&xe(t,f),c&&be(t,c)})}function Nt(r,e={},t,n=-1){const s=e.mode??"default",i=Jt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Ir(r,!1,a,e,t,n)},enter:a=>{Nr(r,!1,a,e,i.enter,t,n)},leave:(a,l)=>{Hr(r,!1,a,e,i.leave,l,t,n)},clone:a=>Nt(r,e,t,n)}}function Dr(r){return r.el}function fi(r,e,t={},n,s,i,o){if(i){const a=Dr(e);if(a==null)return;const l=Jt(t);Ir(r,!0,a,t,n,s),Nr(r,!0,a,t,l.show,n,s,f=>{S(o)&&H(r,o,[f])})}else S(o)&&H(r,o,[])}function ci(r,e,t={},n,s,i,o){if(i){const a=Dr(e);if(a==null)return;const l=Jt(t);Hr(r,!0,a,t,l.hide,null,n,s,f=>{S(o)&&H(r,o,[f])})}else S(o)&&H(r,o,[])}function hi(r,e={}){Gt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function ne(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Kt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class di{node;state;constructor(e,t){this.node=e,this.state=t}}const Ht=g.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=g.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,s=g.inject(it,null),i=g.inject(ht,0),o=g.inject(lr,null),a=g.inject(dt,-1);let l=null;const f=r.modelSlot;if(f){g.provide(ht,i+1),g.provide(dt,f.index),g.provide(yt,f.index);const c=f.route;if(!c){console.warn("child view render error, route not exist");return}const h=Qe(t.proxy,!0);vn(h),ct(h,c)}else{if(s==null){console.error("router is not been injected");return}const c=r.name,h=g.inject(ar,null),d=g.inject(yt,0);if(l=s[Pr](c,i,o,a,h,d),l===null)return;if(g.provide(ar,l),l[G]===!0&&g.provide(lr,l),!n){g.provide(dt,-1),g.provide(ht,i+1),g.provide(yt,-1);const v=l.slots.value;if(v.length>0){const p=v[0].route;if(p){const m=Qe(t.proxy,!0);ct(m,p)}}else{const p=Qe(t.proxy,!0);l.compensation=()=>{const m=l.slots.value;if(m.length>0){const b=m[0].route;return b&&ct(p,b),!0}return!1}}}}const u={value:new Map};return g.onUnmounted(()=>{u.value&&u.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,y=[];for(let m=0;m<d.length;m++){const b=d[m],j=`${r.name}-${b.index}`,x=ne(r.transition,b.route,m)??!0,P={modelSlot:b};let R;e.slots.default?R=g.h(Ht,P,{default:e.slots.default}):R=g.h(Ht,P);const q={},K=ne(r.viewClass,b.route,m);typeof K=="string"&&K.length>0&&(q[K]=!0);const _=ne(r.viewActiveClass,b.route,m),L=ne(r.viewInactiveClass,b.route,m),W=u.value.get(j);if(typeof _=="string"&&_.length>0&&(q[_]=b.active),typeof L=="string"&&L.length>0&&(q[L]=!b.active),W&&b.active!==W.state){const ue=W.node;b.active?y.unshift(()=>{const lt=()=>{let Re=sr(ue);Re!=null&&or(Re,Ot.ACTIVATED)};fi(t,ue,r,b.route,m,x,lt)}):y.push(()=>{const lt=()=>{const Re=sr(ue);Re!=null&&or(Re,Ot.DEACTIVATED)};ci(t,ue,r,b.route,m,x,lt)})}const k={class:q,key:j},st=ne(r.viewTagProps,b.route,m);st!==null&&typeof st=="object"&&T(!0,k,st),b.route?.viewTagAttrs&&typeof b.route?.viewTagAttrs=="object"&&T(!0,k,b.route.viewTagAttrs);const Ur=ne(r.viewTag,b.route,m),ot=g.h(Ur,k,{default:()=>[R]});if(c.set(j,new di(ot,b.active)),u.value.delete(j),x){const ue=Nt(t,r,b.route,m);ot.transition=ue}h.push(ot)}u.value.forEach(m=>{m.node.transition=null}),u.value=c,hi(y,t);const v=ne(r.tag,null,-1),p={};return Object.assign(p,e.attrs),g.h(v,p,{default:()=>h})}else if(f!=null){const c=f.model,h={};c.props&&(typeof c.props=="object"?T(!1,h,c.props):c.props===!0&&typeof f.route?.params=="object"&&T(!1,h,f.route?.params));const d=g.h(c.component,h);return Kt(e.slots.default,{Component:d,route:f.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.model,y={};d.props&&(typeof d.props=="object"?T(!1,y,d.props):d.props===!0&&typeof h.route?.params=="object"&&T(!1,y,h.route?.params));const v=g.h(d.component,y);if(ne(r.transition,h.route,-1)??!0){const m=Nt(t,r,h.route,-1);v.transition=m}return Kt(e.slots.default,{Component:v,route:h.route})??v}else return Kt(e.slots.fallback,{})}}}});function yi(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function pi(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function mi(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function pe(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let vi=g.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=g.inject(it,null);return()=>{let n=pe(r.to,null),s=pe(r.tag,n);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[I](n),r.root&&(i.root=r.root),o=t.current);let a={},l=pe(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=mi(i,o)),pe(r.exact,i)===!0){let h=pe(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=pi(i,o))}let u={class:a};(s==="a"||s==="A")&&(u.href=i?.path??i?.name??"#"),T(!0,u,e.attrs);let c=pe(r.event,i);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}yi(d)&&t.to(i)};u[c]=h}return g.h(s,u,e.slots)}}}),gi={get each(){return tn},get type(){return Le},get isFunction(){return S},get isArray(){return wr},get isArrayLike(){return Vt},get makeArray(){return en},get merge(){return Rr},get isWindow(){return xr},get isPlainObject(){return Ze},get isEqual(){return et}};const Xt=Symbol("fk"),Yt=Symbol("fbk"),Zt=Symbol("fepk");function wi(r={}){const e=new Gn(r),t=new _t,n=new qt,s={...gi,get router(){return e},get bus(){return t},get Bus(){return _t},get eventproxy(){return n},get EventProxy(){return qt},get EventChain(){return Ie},get require(){return e.require},get request(){return kt},get extend(){return T},get clone(){return Oe},install(i){i.provide(it,e),i.provide(Xt,s),i.provide(Yt,t),i.provide(Zt,n),i.component(Qn,Ht),i.component(Xn,vi),Reflect.defineProperty(i.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(i.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$eventProxy",{get(){return n}}),i.config.globalProperties.$fox_on=function(o,a,l=!1){n.on(o,a,l)},i.config.globalProperties.$fox_off=function(o,a){n.off(o,a)},i.config.globalProperties.$fox_once=function(o,a){n.once(o,a)},i.config.globalProperties.$fox_all=function(...o){let a=n;Reflect.apply(a.all,a,o)},i.config.globalProperties.$fox_trigger=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.config.globalProperties.$fox_emit=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.mixin({computed:{$route(){return Fr(this)}}}),e.init()}};return s}function er(r){return r?r.$router:g.inject(it)}function bi(r){return r||(r=g.getCurrentInstance()?.proxy??void 0),r?Fr(r):null}function xi(r){return r?r.$fox:g.inject(Xt)}function Ri(r){return r?r.$bus:g.inject(Yt)}function Si(r){return r?r.$eventProxy:g.inject(Zt)}function Ci(r){const e=er(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.beforeEach(t),g.onUnmounted(()=>{e.removeBeforeEach(t)})}function Pi(r){const e=er(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.afterEach(t),g.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=_t;exports.EventChain=Ie;exports.EventProxy=qt;exports.Route=$;exports.cancelRequest=pn;exports.clone=Oe;exports.createFox=wi;exports.createMemoryHistory=$r;exports.createWebHashHistory=qr;exports.createWebHistory=Wn;exports.extend=T;exports.foxBusKey=Yt;exports.foxEventProxyKey=Zt;exports.foxKey=Xt;exports.isArray=wr;exports.isDate=Wr;exports.isESModule=Dt;exports.isEqual=et;exports.isFunction=S;exports.isMap=Vr;exports.isObject=br;exports.isPlainObject=Ze;exports.isPromise=Jr;exports.isSet=Br;exports.isString=kr;exports.isSymbol=zr;exports.onAfterRouteUpdate=Pi;exports.onBeforeRouteUpdate=Ci;exports.onFoxActivated=xn;exports.onFoxDeactivated=Rn;exports.request=kt;exports.sessionKey=ie;exports.toBoolean=Ut;exports.toNumber=Yr;exports.toTypeString=nt;exports.typeOf=Le;exports.useBus=Ri;exports.useEventProxy=Si;exports.useFox=xi;exports.useRoute=bi;exports.useRouter=er;
2
+ * fox v3.0.0 Mon Dec 26 2022 11:30:33 GMT+0800 (中国标准时间)
3
+ */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("vue"),wr=Array.isArray,Vr=r=>nt(r)==="[object Map]",Br=r=>nt(r)==="[object Set]",Wr=r=>r instanceof Date,S=r=>typeof r=="function",kr=r=>typeof r=="string",zr=r=>typeof r=="symbol",br=r=>r!==null&&typeof r=="object",Jr=r=>br(r)&&S(r.then)&&S(r.catch),Gr=Object.prototype.toString,nt=r=>Gr.call(r),Ze=r=>nt(r)==="[object Object]",Qr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Dt(r){return r.__esModule||Qr&&r[Symbol.toStringTag]==="Module"}const Xr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function T(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,s=!1;for(typeof e=="boolean"&&(s=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let i=r[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let f;Array.isArray(l)?f=a&&Array.isArray(a)?a:[]:f=a&&typeof a=="object"?a:{},e[o]=T(s,f,l)}else l!==void 0&&(e[o]=l)}}return e}function Oe(r,e,t=!1){if(!t)T(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let s in e){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ze(o))continue;i=Oe(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}const n=Object.getOwnPropertySymbols(e);for(let s of n){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ze(o))continue;i=Oe(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}}return r}class ee{static seed=new Date().getTime();static get(){let e=++ee.seed;return e>=Number.MAX_VALUE&&(ee.seed=0),e}}const at=Xr?Promise.resolve():null;function $e(r,...e){at!==null?e&&e.length>0?at.then(()=>{r(e)}):at.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Ut(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":Boolean(r)}function Yr(r){return typeof r=="number"?r:Number(r)}const Zr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function Le(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Zr[t]||"object"}function xr(r){return r&&typeof r=="object"&&"setInterval"in r}function Vt(r){let e=!!r&&"length"in r&&r.length,t=Le(r);return t==="function"||xr(r)?!1:t==="array"||e===0||typeof e=="number"&&e>0&&e-1 in r}function Rr(r,e){let t=+e.length,n=0,s=r.length;for(;n<t;n++)r[s++]=e[n];return r.length=s,r}function en(r,e=[]){let t=e;return r!=null&&(Vt(Object(r))?Rr(t,typeof r=="string"?[r]:r):t.push(r)),t}function tn(r,e,t){if(Vt(r))Reflect.apply([].forEach,r,[e]);else for(let n in r)if(t&&r.hasOwnProperty(n)){if(Reflect.apply(e,r,[r[n]])===!1)break}else if(Reflect.apply(e,r,[r[n]])===!1)break;return r}function et(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Le(r),n=Le(e);if(t!==n)return!1;if(t==="object"){let s=Object.keys(r),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=r[a],f=e[a];if(!et(l,f))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++){let i=r[s],o=e[s];if(!et(i,o))return!1}return!0}return!1}const tr=Symbol("idKey"),ae=Symbol("valueKey"),C=Symbol("childrenKey"),Q=Symbol("growKey");class Sr{[Q]=!0;[tr];[ae]=g.ref();[C]=new Map;constructor(e){this[tr]=e}}class rn{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[Q];let n=e[C].get(t);if(n)return Me(n);if(e[Q])return n=Wt(t),n[Q]=e[Q],e[C].set(t,n),Me(n)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[Q]=Ut(n),!0):n==null?(e[C].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[C].delete(t),!0)}}const Bt="__proxy__";function Wt(r){let e=new Sr(r);return Reflect.set(e,Bt,new Proxy(e,new rn)),e}function Me(r){return Reflect.get(r,Bt)}class Cr extends Sr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("\u53C2\u6570\u81F3\u5C11\u5305\u62EC\u4E00\u4E2A(key, value)"),!1;let n=this;for(let s=0;s<t-1;s++){let i=e[s],o;n[C].has(i)?o=n[C].get(i):(o=Wt(i),n[C].set(i,o)),n=o}return n[ae].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let s=0;s<t;s++){let i=e[s];if(n[C].has(i))n=n[C].get(i);else return}return n[ae].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[C].has(o))n=n[C].get(o);else return!1}let s=e[t-1];return n[C].has(s)?(n[C].delete(s),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[C].has(o))n=n[C].get(o);else return!1}let s=e[t-1];return n[C].has(s)}clear(){this[C].clear()}}const nn=["put","get","contains","remove","clear"];function rr(r){return nn.includes(r)}class sn{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[Q];if(t===C)return e[C];if(typeof t=="string"&&rr(t))return e[t];let n=String(t),s=e[C].get(n);if(s)return Me(s);if(e[Q])return s=Wt(n),s[Q]=e[Q],e[C].set(n,s),Me(s)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[Q]=Ut(n),!0):rr(t)?!1:n==null?(e[C].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[C].delete(t),!0)}}function on(){let r=new Cr,e=new sn,t=new Proxy(r,e);return Object.assign({put(...s){return Reflect.apply(r.put,r,s)},get(...s){return Reflect.apply(r.get,r,s)},remove(...s){return Reflect.apply(r.remove,r,s)},contains(...s){return Reflect.apply(r.contains,r,s)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,Bt,t),r}let _t=new Proxy(Cr,{construct(r,...e){let t=on();return Me(t)}});const Z="default",Pr=Symbol("sync"),I=Symbol("resolveRoute");function nr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function ln(r){let e=r.src;return new Promise((t,n)=>{const s=nr(a=>{Dt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=nr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(s,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(s,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(s,i)}})}class an{name;level;rootName;rootIndex=0;constructor(e,t,n,s){this.name=e,this.level=t,this.rootName=n,this.rootIndex=s}}class tt{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new tt(e.to,e.from),n=e.data??{};return T(!0,t.data,n),t}}class ${path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Z}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new $;return Oe(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new $;if(e==null)return t;let n=t;for(let i in e){let o=e[i];n[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)n[i]=e[i];return t}}class un{id;name;props;meta;src;component;constructor(e,t,n,s){this.id=ee.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return ln(this)}}class ir{models=[]}class ut{path;match;redirect;name;layers=[]}const D=Symbol("chainKey"),M=Symbol("cursorKey"),ft=Symbol("$persistentModeKey"),E=Symbol("statusKey"),X=Symbol("argsKey"),Ne=Symbol("exArgsKey"),fe=Symbol("successFnsKey"),Se=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),Y=Symbol("_go");class Ie{[D]=[];[M]=0;[ft]=!1;[E]="Free";[X]=[];[Ne]=[];[fe]=[];[Se]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[ft]=t}[Y](e,...t){let n=this[E];if(this[E]="Busy",this[M]+=e,this[M]<0&&(this[M]=0),this[X]=t,n==="Exception"||n==="Reject"){let a=[{session:this[ie]},...this[Ne]];for(;this[Se].length>0;)try{let l=this[Se].shift();typeof l=="function"&&$e(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[E]=n,this[D]=[],this[M]=0,this}else if(n==="Finished"||this[M]>=this[D].length){let a=[{session:this[ie]},...this[X]];for(;this[fe].length>0;){let l=this[fe].shift();typeof l=="function"&&$e(()=>{Reflect.apply(l,{},a)})}return this[E]="Free",this}if(this[M]>=this[D].length)return this[E]="Free",this;let s=this[D][this[M]];this[ft]||(this[D].splice(0,this[M]+1),this[M]=-1);let i=this[M]+1;try{let o=!1,a={go:(l,...f)=>{o||(o=!0,Reflect.apply(this[Y],this,[l,...f]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[Y],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[D].splice(i,0,l),i++)},session:this[ie]};$e(()=>{Reflect.apply(s,{},[a,...this[X]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[Y],this,[e,...t])}finish(...e){return this[E]="Finished",this[X]=e,Reflect.apply(this[Y],this,[0])}reject(...e){return this[E]="Reject",this[Ne]=e,Reflect.apply(this[Y],this,[0])}throw(...e){return this[E]="Exception",this[Ne]=e,Reflect.apply(this[Y],this,[0])}reset(...e){this[E]="Busy",this[X]=e,this[D]=[],this[M]=0;let n=[{session:this[ie]},...this[X]];for(;this[fe].length>0;){let s=this[fe].shift();$e(()=>{Reflect.apply(s,this,n)})}return this[E]="Free",this}post(e){return this[E]==="Reject"||this[E]==="Exception"?this:(Array.isArray(e)?this[D]=[...this[D],...e]:this[D].push(e),this[E]==="Busy"?this:(Reflect.apply(this[Y],this,[0,...this[X]]),this))}wait(e,t){return e&&typeof e=="function"&&this[fe].push(e),t&&typeof t=="function"&&this[Se].push(t),this[E]==="Busy"?this:(Reflect.apply(this[Y],this,[0,...this[X]]),this)}exception(e){return e&&typeof e=="function"&&this[Se].push(e),this[E]==="Busy"?this:Reflect.apply(this[Y],this,[0,...this[X]])}isFinish(){return this[E]=="Reject"||this[E]=="Free"&&this[M]>=this[D].length}}const ce=Symbol("registerKey");class fn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class qt{[ce]=new Map;constructor(){}on(e,t,n=!1){let s=this[ce].get(e);s||(s=new Array,this[ce].set(e,s));let i=n===!0?1:0,o=new fn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ce].delete(e),this;let n=this[ce].get(e);if(n){for(let s=0;s<n.length;s++)if(n[s].callback===t){n.splice(s,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(n,{},i)});return this}emit(e,...t){let n=this[ce].get(e);if(!n)return this;for(let s=0;s<n.length;){let i=n[s];if(i.policy==1?n.splice(s,1):s++,typeof i.callback=="function")try{$e(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const cn=new ee;function hn(r,e="text"){e=e.trim().toLowerCase();let t="";if(e.indexOf("application/x-www-form-urlencoded")===0)if(typeof r=="object")for(let n in r){let s=r[n];if(Array.isArray(s))for(let i=0;i<s.length;i++){let o=`${encodeURIComponent(n)}=${encodeURIComponent(s[i])}`;t.length>0&&(t+="&"),t+=o}else{let i=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`;t.length>0&&(t+="&"),t+=i}}else t=r;else e.indexOf("text")===0?typeof r=="object"?t=JSON.stringify(r):t=r:e.indexOf("application/json")===0&&typeof r=="object"?t=JSON.stringify(r):t=r;return t}function dn(r,e,t="text"){if(e==null)return r;t=t.trim().toLowerCase();let n="";if(t.indexOf("application/x-www-form-urlencoded")===0||t.indexOf("application/json")===0)if(typeof e=="object")for(let s in e){let i=e[s];if(Array.isArray(i))for(let o=0;o<i.length;o++){let a=`${encodeURIComponent(s)}=${encodeURIComponent(i[o])}`;n.length>0&&(n+="&"),n+=a}else{let o=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`;n.length>0&&(n+="&"),n+=o}}else n=e;else n=e;return n.length>0&&(r.indexOf("?")===-1?r=`${r}?${n}`:r=`${r}&${n}`),r}const yn={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},ve=new Map;async function kt(r){let{id:e,method:t="POST",url:n,headers:s={},data:i,processData:o=!0,timeout:a=-1}=r;if(e&&ve.has(e))throw new Error("resubmit");t=t.toUpperCase();const l={...yn};l.headers=l.headers??{},Object.assign(l.headers,s);const f=l.headers["Content-Type"];if(Object.assign(l,{method:t}),t==="GET"?n=dn(n,i,f):(o&&(i=hn(i,f)),l.body=i),e||a>0){e||(e=`fox_fetch_${cn.get()}`);const u=new AbortController;l.signal=u.signal;let c={timer:null,controller:u};if(a>0){const h=setTimeout(()=>{c.timer&&c.controller.abort()},a);c.timer=h}ve.set(e,c)}try{let u=await fetch(n,l),c={};u.headers.forEach((y,v)=>{c[v]=y});let h,d=c["content-type"]??"";return d.indexOf("application/json")!==-1?h=await u.json():d.indexOf("text")!=-1?h=await u.text():h=await u.blob(),{ok:u.ok,status:`${u.status}`,statusText:u.statusText,headers:c,data:h,response:u}}catch(u){throw u}finally{if(e){let u=ve.get(e);u&&(u.timer&&(clearTimeout(u.timer),u.timer=null),ve.delete(e))}}}function pn(r){let e=ve.get(r);return e?(e.timer&&(clearTimeout(e.timer),e.timer=null),e.controller.abort(),ve.delete(r),!0):!1}const Ce=Symbol("registerKey");class mn{[Ce]=new Map;constructor(){}set(e,t){this[Ce].set(e,t)}get(e){return this[Ce].get(e)}has(e){return this[Ce].has(e)}delete(e){return this[Ce].delete(e)}}const $t=Symbol("lc");function Qe(r,e=!1){let t=r,n=t[$t];if(!n)if(e)n=new mn,t[$t]=n;else return null;return n}function Ar(r,e){let t=r;for(;t!==null;){const n=t[$t];if(n&&n.has(e))return n.get(e);t=t.$parent}return null}function sr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return Qe(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function vn(r){let e=r.get(rt);e||(e=[],r.set(rt,e))}function or(r,e){let t=r.get(rt);if(t!=null)for(let n=t.length-1;n>=0;n--){let s=t[n];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var Ot=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Ot||{});class gn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function wn(r,e,t,n){let s=new gn(e,t,n);return r.push(s),!0}function bn(r,e,t,n){let s=-1;for(let i=0;i<r.length;i++){let o=r[i];if(o.type===e&&o.hook===t&&o.target===n){s=i;break}}return s!=-1?(r.splice(s,1),!0):!1}function Er(r){return(e,t)=>{let n;if(t)n=t;else{let i=g.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}n=i.proxy}let s=Ar(n,rt);if(s==null){console.warn("can not get hooks context");return}g.onUnmounted(()=>{bn(s,r,e,n)}),wn(s,r,e,n)}}let xn=Er("a"),Rn=Er("da");function Sn(){let r=new $;return r.path="",r.name="",r.params={},r.index=-1,g.shallowReactive(r)}const Lt=Symbol("routeKey");function ct(r,e){let t=r.get(Lt);if(t){let n={path:"",name:"",params:{},index:-1,session:{}};Object.assign(n,e),Object.assign(t,n)}else t=Sn(),Object.assign(t,e),r.set(Lt,t)}function Fr(r){let e=Ar(r,Lt);return e??null}const it=Symbol("rk"),ht=Symbol("vd"),lr=Symbol("rv"),dt=Symbol("rvi"),ar=Symbol("pv"),yt=Symbol("pvi");function Cn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var s="",i=t+1;i<r.length;){var o=r.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=r[i++];continue}break}if(!s)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:s}),t=i;continue}if(n==="("){var a=1,l="",i=t+1;if(r[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<r.length;){if(r[i]==="\\"){l+=r[i++]+r[i++];continue}if(r[i]===")"){if(a--,a===0){i++;break}}else if(r[i]==="("&&(a++,r[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=r[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function Tr(r,e){e===void 0&&(e={});for(var t=Cn(r),n=e.prefixes,s=n===void 0?"./":n,i="[^".concat(me(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,f="",u=function(R){if(l<t.length&&t[l].type===R)return t[l++].value},c=function(R){var q=u(R);if(q!==void 0)return q;var K=t[l],_=K.type,L=K.index;throw new TypeError("Unexpected ".concat(_," at ").concat(L,", expected ").concat(R))},h=function(){for(var R="",q;q=u("CHAR")||u("ESCAPED_CHAR");)R+=q;return R};l<t.length;){var d=u("CHAR"),y=u("NAME"),v=u("PATTERN");if(y||v){var p=d||"";s.indexOf(p)===-1&&(f+=p,p=""),f&&(o.push(f),f=""),o.push({name:y||a++,prefix:p,suffix:"",pattern:v||i,modifier:u("MODIFIER")||""});continue}var m=d||u("ESCAPED_CHAR");if(m){f+=m;continue}f&&(o.push(f),f="");var b=u("OPEN");if(b){var p=h(),j=u("NAME")||"",x=u("PATTERN")||"",P=h();c("CLOSE"),o.push({name:j||(x?a++:""),pattern:j&&!x?i:x,prefix:p,suffix:P,modifier:u("MODIFIER")||""});continue}c("END")}return o}function Pn(r,e){return An(Tr(r,e),e)}function An(r,e){e===void 0&&(e={});var t=zt(e),n=e.encode,s=n===void 0?function(l){return l}:n,i=e.validate,o=i===void 0?!0:i,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var f="",u=0;u<r.length;u++){var c=r[u];if(typeof c=="string"){f+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",y=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!y)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var v=0;v<h.length;v++){var p=s(h[v],c);if(o&&!a[u].test(p))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));f+=c.prefix+p+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var p=s(String(h),c);if(o&&!a[u].test(p))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));f+=c.prefix+p+c.suffix;continue}if(!d){var m=y?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(m))}}return f}}function En(r,e){var t=[],n=jr(r,t,e);return Fn(n,t,e)}function Fn(r,e,t){t===void 0&&(t={});var n=t.decode,s=n===void 0?function(i){return i}:n;return function(i){var o=r.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,f=Object.create(null),u=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?f[d.name]=o[h].split(d.prefix+d.suffix).map(function(y){return s(y,d)}):f[d.name]=s(o[h],d)},c=1;c<o.length;c++)u(c);return{path:a,index:l,params:f}}}function me(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function zt(r){return r&&r.sensitive?"":"i"}function Tn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=t.exec(r.source);s;)e.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(r.source);return r}function jn(r,e,t){var n=r.map(function(s){return jr(s,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),zt(t))}function Kn(r,e,t){return _n(Tr(r,t),e,t)}function _n(r,e,t){t===void 0&&(t={});for(var n=t.strict,s=n===void 0?!1:n,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,f=t.encode,u=f===void 0?function(L){return L}:f,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,y=d===void 0?"":d,v="[".concat(me(y),"]|$"),p="[".concat(me(h),"]"),m=o?"^":"",b=0,j=r;b<j.length;b++){var x=j[b];if(typeof x=="string")m+=me(u(x));else{var P=me(u(x.prefix)),R=me(u(x.suffix));if(x.pattern)if(e&&e.push(x),P||R)if(x.modifier==="+"||x.modifier==="*"){var q=x.modifier==="*"?"?":"";m+="(?:".concat(P,"((?:").concat(x.pattern,")(?:").concat(R).concat(P,"(?:").concat(x.pattern,"))*)").concat(R,")").concat(q)}else m+="(?:".concat(P,"(").concat(x.pattern,")").concat(R,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?m+="((?:".concat(x.pattern,")").concat(x.modifier,")"):m+="(".concat(x.pattern,")").concat(x.modifier);else m+="(?:".concat(P).concat(R,")").concat(x.modifier)}}if(l)s||(m+="".concat(p,"?")),m+=t.endsWith?"(?=".concat(v,")"):"$";else{var K=r[r.length-1],_=typeof K=="string"?p.indexOf(K[K.length-1])>-1:K===void 0;s||(m+="(?:".concat(p,"(?=").concat(v,"))?")),_||(m+="(?=".concat(p,"|").concat(v,")"))}return new RegExp(m,zt(t))}function jr(r,e,t){return r instanceof RegExp?Tn(r,e):Array.isArray(r)?jn(r,e,t):Kn(r,e,t)}var A=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(A||{}),Xe=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),le=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class te{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,s=!0){this.route=e,this.model=t,this.index=n,this.active=s}}class Pe{scope=null;set compensation(e){this.scope!==null&&this.scope.stop(),this.scope=g.effectScope(),this.scope.run(()=>{g.watch(this.slots,()=>{let t=!1;try{t=e()}catch(n){console.error(n)}t&&this.scope!==null&&(this.scope.stop(),this.scope=null)})})}_slots;get slots(){return this._slots==null&&(this._slots=g.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[le]=null;get name(){return this[Ye]}constructor(e,t,n){this[Ye]=e,this[G]=t,n&&(this[J]=n)}}class U{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let s=e[n];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class pt{views=[]}class qn{layers=[]}class $n{time;route}class On{forbidTime=300;submitRecorder=new $n;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const we=typeof window<"u",N=function(){return window},Ae=function(){return window.document};function Ln(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function Mn(){if(!we)return"/";let r=N().location,e=`${r.protocol}//${r.host}`;return e+=Ln(r.pathname),e}function Mt(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function It(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}let mt=Mn();class In{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let n=await kt({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(n.ok)return this.cache.set(e,n.data),n.data;throw Error(n.statusText)}remove(e){this.cache.delete(e)}}var z=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(z||{});class Nn{exports;status;id;src}class Hn{register=new Map;constructor(){}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}class Dn{head;isOldWebKit;moduleManager=new Hn;resource=new In;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=Ae();this.head=t.head||t.getElementsByTagName("head")[0]||t.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}ensure(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let f=e[l];for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}else{let f=e[l].split(",");for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}let o=new Un(t.length,(l,f)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},f)}catch(u){console.error(u.message,u)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(u){console.error(u.message,u)}}),a=new Ie;for(let l=0;l<t.length;l++){let f=new Vn(l,t[l],s,o);this.mount(a,f)}return this}remove(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){const n=Ae();if(this.isNaturePath(t.src,"js")){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src,"css")){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else if(this.isNaturePath(t.src,"html")){let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}let s=this.getFileNamePostfix(t.src);if(s==="js"||s.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(s==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else{let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}}mountHTML(e,t,n){e.post(s=>{let i=t.params.timeout??this.options.timeout??3e4,o=t.src;this.resource.get(o,i).then(a=>{n.innerHTML=a,t.progress.work(!0,t.index,a),s.resolve()},a=>{console.error(a),t.progress.work(!1,t.index,null),s.reject()})})}mountCSS(e,t,n){e.post(s=>{const i=Ae(),o=t.src,a=i.createElement("link"),l="onload"in a;if(this.isOldWebKit||!l){const u={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{n.removeChild(a)}catch(c){console.error(c.message,c)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{Kr(a,u)},1)}else a.onload=()=>{a.onload=a.onerror=null,t.progress.work(!0,t.index,t.src),s.resolve()},a.onerror=()=>{try{n.removeChild(a)}catch(u){console.error(u.message,u)}a.onload=a.onerror=null,t.progress.work(!1,t.index,null),s.reject()};let f=i.getElementById(o);f&&f.parentNode&&f.parentNode.removeChild(f),a.rel="stylesheet",a.type="text/css",a.id=o,a.href=o,n.appendChild(a)})}mountJS(e,t,n){e.post(s=>{let i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==z.Defined||o.status==z.Loaded)){if(o.exports){t.progress.work(!0,t.index,o.exports),s.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),s.resolve();return}}o=new Nn,o.id=i,o.src=i,o.status=z.Loading,this.moduleManager.put(i,o);const l=Ae().createElement("script");if("onload"in l)l.onload=()=>{l.onload=l.onerror=null,o.status==z.Loading&&(o.status=z.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{let c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==z.Loading&&(o.status=z.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;let u=N();u.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Ae(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=n.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=n.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}else{this.resource.remove(e);let i=t.htmlPoint;i||(i=n.body),i.innerHTML="";return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){let s=e[n].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){let n=this,s=function(...i){e.status=z.Defining;let o,a,l,f=i.length;f===1?(l=i[0],o=void 0):f===2?(l=i[1],Array.isArray(i[0])?(a=n.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=n.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...u)=>{typeof l=="function"?e.exports=Reflect.apply(l,e,u):e.exports=l,e.status=z.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=z.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&t!=="html"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let s=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e,t){if(this.options.nature==null)return!1;if(t==="all"||t==="js"){let n=this.options.nature.js;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="css"){let n=this.options.nature.css;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="html"){let n=this.options.nature.html;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return mt+e.slice(1);if(e.indexOf("./")==0)return mt+e.slice(2);if(t){let s=this.options.alias[e];if(!s){let i=e.indexOf("/");if(i==-1)s=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?s=a+e.slice(i):s=e}}return this.parserPath(s,!1)}return mt+e}}function Kr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.time>e.timeout?e.error():Kr(r,e)},20)}class Un{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}}isOK(){return this.status}}class Vn{index;src;params;progress;constructor(e,t,n,s){this.index=e,this.src=t,this.params=n,this.progress=s}}const ge=Symbol("_notifyChange");class Bn{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const He=Symbol("ignoreHistoryChangeOnceKey"),ur=Symbol("_navigateFirstRoute"),De=Symbol("_getRouteMark"),fr=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),Ee=Symbol("_setRouteMarkRecorder"),cr="Symbol(_fox_restore_point)";function gt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class _r{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[He]=!1;constructor(e="hash",t="",n="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??N().sessionStorage}init(e=!0){const t=N();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[He]){this[He]=!1;return}if(gt(this.historyMonitor)){const n=t.history.state;this[ge](n);try{let s=[];if(typeof n=="string"?s=JSON.parse(n):s=n,Array.isArray(s)&&s.length>0){const i=this[De]()??"/";this[Ee](i,s)}}catch{}}}),Mt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ur](),Promise.resolve()}destroy(){if(this.historyChange){const e=N();It(e,"popstate",this.historyChange)}}[ur](){let e=this[De]()??"/";const t=this.storage.getItem(cr);if(t)try{const o=JSON.parse(t);if(o.mark===e){this[ge](o.routes);return}}catch{}const n=e.indexOf("!");let s;n!=-1?s=e.substring(n+1):s=e;const i=new $;i.path=s,i.query=this[fr](),this[ge]([i])}[Ee](e,t){try{const n={mark:e,routes:t},s=JSON.stringify(n);this.storage.setItem(cr,s)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[De]()??"/";this[Ee](t,e)}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[De](){const e=N();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[fr](){return N().location.search}listen(e){this.changeHandler=e}go(e,t=!0){const n=N();this[He]=!t,n.history.go(e)}push(e){let t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||N().history.pushState(e.routes,"",t),this[Ee](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||N().history.replaceState(e.routes,"",t),this[Ee](e.currentRoute.fullPath,e.routes)}[vt](e){const t=N();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l in e.query){let f=encodeURIComponent(e.query[l]),u=`${encodeURIComponent(l)}=${f}`;a.length>0&&(a+="&"),a+=u}else a=e.query;this.query?(n=`${this.query}&${a}`,n.charAt(0)!=="?"&&(n=`?${n}`)):n=`?${a}`}const s=t.location;let i=e.fullPath;i.startsWith(Z)&&(i=i.substring(Z.length+1));let o;return n?this.mode=="path"?o=`${this.base}/${i}${n}`:o=`${s.pathname}${n}#${i}`:this.mode=="path"?o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Wn(r=!0,e=null,t="",n=!0,s=!1,i){return e!==null&&(e=N().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new _r("path",e??"",t,r,n,s,i)}function qr(r=!0,e="",t=!0,n=!1,s){return new _r("hash","",e,r,t,n,s)}class kn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}listen(e){this.changeHandler=e}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const s=this.queue[n];this[ge](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function $r(r="",e=50){return new kn(r,e)}const Ue=Symbol("_constructRouteModel"),Ve=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),hr=Symbol("_getFirstView"),se=Symbol("_removeView"),dr=Symbol("_buildPage"),yr=Symbol("_resolveComponent"),pr=Symbol("_update"),re=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),Be=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),w=Symbol("currentRoutes"),he=Symbol("current"),mr=Symbol("_addRouteRecorder"),de=Symbol("_removeRouteRecorder"),xt=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),ke=Symbol("errorCallback"),V=Symbol("registerKey"),ze=Symbol("notFoundKey"),Rt=Symbol("notFoundPathKey"),B=Symbol("forestKey"),F=Symbol("historyKey"),Fe=Symbol("beforeFiltersKey"),Te=Symbol("afterFiltersKey"),je=Symbol("destroyFiltersKey"),ye=Symbol("mainDispatcherKey"),St=Symbol("initKey"),Je=Symbol("requireKey"),oe=Symbol("readyKey"),Ct=Symbol("readyHandlersKey"),Ge=Symbol("_markReady"),vr=Symbol("_createNextFn"),Pt=Symbol("_start"),At=Symbol("_before"),Et=Symbol("_after"),gr=Symbol("_destroy"),Ft=Symbol("_load"),Ke=Symbol("_unload"),Tt=Symbol("_loadDependency"),jt=Symbol("resolvedModulesKey"),_e=Symbol("resolveDependencyKey"),qe=Symbol("routerGuardKey");function zn(r){return r.layers.length==0||r.layers[0].views.length==0}function Jn(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let s=T(!0,{},n.meta);e.push(s)}else n.meta&&e.push(n.meta)})}),e}class Gn{[V]=new Array;[ze];[Rt]="*";[oe]=!1;[Ct]=[];[B]=new qn;[F];[w]=new Array;[ke]=null;[We]=null;[Fe]=new Array;[Te]=new Array;[je]=new Array;[ye]=new Ie;[jt]=new Map;[_e]=null;[qe]=new On;[St]=!1;[he]=g.ref(null);[Je]=null;get require(){return we?(this[Je]||(this[Je]=new Dn),this[Je]):null}get current(){return this[he].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[F]=e.history:this[F]=we?qr():$r(),this[F]?.listen(async n=>{let s=!0;try{if(typeof n=="string"){let i=this[I](n);i&&await this[bt]([i])}else await this[bt](n)}catch(i){console.error(i.message,i),s=!1}this[oe]===!1&&this[Ge](s)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[ke]=="function")try{this[ke](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[F]?.init(!this[oe]),this[St]=!0)}isReady(){return this[oe]?Promise.resolve():new Promise((e,t)=>{this[Ct].push([e,t])})}[Ge](e){this[oe]=!0,this[Ct].forEach(([t,n])=>{try{e?t():n()}catch(s){console.error(s.message,s)}})}[bt](e){try{if(!e){let o=[...this[w]].reverse();return this[Ke](o),we&&N().location.reload(),Promise.resolve()}let t=null,n=[],s=[],i=0;for(;i<e.length&&i<this[w].length&&$.isSame(e[i],this[w][i]);i++)e[i].opsType===A.Open&&e[i].active===!0&&e[i].active!==this[w][i].active&&(t=e[i]);if(i<e.length&&(n=e.slice(i)),i<this[w].length&&(s=this[w].slice(i).reverse()),s.length==0&&n.length==0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Ke](s)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[O](t)}return Promise.resolve()}[Be](e){if(e)this[he].value=e;else{let t=this[w].length;t>0?this[he].value=this[w][t-1]:this[he].value=null}if(typeof this[We]=="function")try{this[We](this[he].value)}catch{}}[mr](e,t=-1){t<0||t>=this[w].length?this[w].push(e):this[w].splice(t,0,e)}[xt](){let e=[];for(let t of this[w]){let n=$.clone(t,!0);e.push(n)}return e}[de](e){if(!this[w])return;let t=-1;for(let n=0;n<this[w].length;n++)if($.isSame(this[w][n],e)){t=n;break}if(t!=-1){let n=this[w][t];this[w].splice(t,1),this[gr](n,n.session)}}set historyMonitor(e){this[F]&&(this[F].historyMonitor=e)}get historyMonitor(){return this[F]?this[F].historyMonitor:!1}set traceless(e){this[F]&&(this[F].traceless=e)}get traceless(){return this[F]?this[F].traceless:!1}setRestorePoint(){const e=this[xt]();this[F]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[ke]=e}beforeEach(e){this[Fe].push(e)}removeBeforeEach(e){const t=this[Fe].indexOf(e);return t!==-1?(this[Fe].splice(t,1),!0):!1}afterEach(e){this[Te].push(e)}removeAfterEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}destroyEach(e){this[je].push(e)}removeDestroyEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}setResolveDependency(e){this[_e]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Rt]){this.setNotFoundRoute(e);return}const n=this[Ue](e);if(t==-1)this[V]=[...this[V],...n];else for(let s=n.length-1;s>=0;s--)this[V].splice(t,0,n[s])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1;for(let n=0;n<this[V].length;n++){const s=this[V][n];if(t?.path&&s.path===t.path)return this[V].splice(n,1),!0;if(t?.name&&s.name===t.name)return this[V].splice(n,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1):this[V].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Rt]=e}setNotFoundRoute(e){const t=this[Ue](e);this[ze]=t[0]}getRoutes(){return[...this[V]]}[Ue](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){let a=new ut;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in n){let l=n[a];a.length===0&&(a=Z);let f=new un(a,l,e.props,e.meta);s.push(f)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ue](a);for(let f of l){let u=new ut;u.name=f.name,f.path&&f.path.length>0?t!=="/"?u.path=`${t}${f.path}`:u.path=f.path:(i=!0,u.path=t);let c=new ir;c.models=[...s],u.layers=[c,...f.layers],o.push(u)}}if(!i){let a=new ir;a.models=s;let l=new ut;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ve](e){let t=e.route;try{for(let n of this[V])if(t.path&&n.path){let s=n.match;s||(s=n.match=En(n.path));let i=s(t.path);if(!i)continue;if(n.redirect){let o=new $;T(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ve](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},T(!0,t.params,i.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let f of l){let u=f.split("=");if(u.length!==2)continue;let c=decodeURIComponent(u[0].trim()),h=decodeURIComponent(u[1].trim());a[c]=h}T(!0,t.params,a)}else typeof o=="object"&&T(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let s=Pn(n.path);return t.path=s(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new $,typeof e[0]=="object")t=$.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&T(!1,t,e[n]);else typeof e=="object"?t=$.from(e):typeof e=="string"&&(t=new $,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Z,t.opsType=t.opsType??this.options.defaultOperationType??A.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||A.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=A.Put,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=A.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=A.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ye].post(n=>{try{if(this[w].length===0){n.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[w][0].root??Z,e.all)for(let l=this[w].length-1;l>0;l--){let f=this[w][l];f.opsType===A.Append&&f.root===i&&(o.splice(0,0,f),s=l-1)}else if(e.until)for(let l=this[w].length-1;l>0;l--){let f=this[w][l];if(f.opsType===A.Append&&f.root===i){if(e.until.charAt(0)==="/"&&e.until===f.path){s=l;break}else if(e.until===f.name){s=l;break}o.splice(0,0,f)}}}else{i=Z;let l=this[hr](this[B]);l&&(i=l.name);for(let f=this[w].length-1;f>0;f--){let u=this[w][f];if(u.opsType===A.Append&&u.root===i){o.push(u),s=f-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[w].forEach(l=>{l.opsType!==A.Put&&a++}),this[Ke](o)){let l=0;this[w].forEach(u=>{u.opsType!==A.Put&&l++});const f=l-a;this[F]?.go(f,!1),n.resolve(),t(!0)}}catch(s){this[O](s),n.resolve(),t(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=A.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ye].post(t=>{try{let n=this[I](e);if(!n){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[w].length;i++){let o=this[w][i];if(o.root===n.root){if(!n.path&&!n.name){s.push(o);continue}if(n.path&&n.path===o.path){s.push(o);break}else if(n.name&&n.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Ke](s)&&this[Be](),t.resolve()}catch(n){this[O](n),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[O]("resolve route fail",t),this;console.debug("route to",t.path,t.root);let n=this[qe].acquire(t);return n==null?(this[O]("route forbid",t),this):(this[ye].post(s=>{try{let i=this[Pt](t);this[At](i),!i.session?.routeModel&&this[_e]&&this[Tt](i),this[Ft](i),this[Et](i),i.wait((o,a)=>{let l=o.session.to;try{let f=$.clone(l,!0);const u=new Bn(f,this[xt]());l.opsType===A.Replace?this[F]?.replace(u):this[F]?.push(u)}catch(f){console.error(f.message,f)}if(this[qe].release(n),this[Be](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(f){console.error(f.message,f)}this[oe]===!1&&this[Ge](!0),s.resolve()},(o,a)=>{this[qe].release(n),a!==null&&this[O](a,t),this[oe]===!1&&this[Ge](!1),s.resolve()})}catch(i){this[qe].release(n),this[O](i,t),s.resolve()}}),this)}back(e=1){this[F]?.go(-e)}[vr](e){return(t,n)=>{if(typeof t=="boolean")t?e.resolve():e.reject(n??null);else if(t){let s=this[I](t);if(s){let i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Pt](e){let t=this[w].length>0?this[w][0]:void 0,n=new tt(e,t),s={route:e,find:null};return this[Ve](s),s.find&&(n.routeModel=s.find,e.matched=Jn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new Ie(n)}[At](e){for(let t of this[Fe])e.post(n=>{let s=this[vr](n);Reflect.apply(t,{},[n.session.to,n.session.from,s,n.session])})}[Et](e){e.post(t=>{for(let n of this[Te])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[gr](e,t){for(let n of this[je])try{Reflect.apply(n,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Tt](e){let t=e.session,n=Reflect.apply(this[_e],this,[t?.to]);if(n==null)return;Array.isArray(n)||(n=[n]);let s=[];for(let i of n)this[jt].has(i)||s.push(i);s.length!==0&&e.post(i=>{this.require.ensure(s,(...o)=>{if(!o){i.reject();return}for(let a of o){if(!a)continue;let l;Dt(a)?l=a.default:l=a,Array.isArray(l)&&this.addRoutes(l)}for(let a of s)this[jt].set(a,!0);i.resolve()})})}[Ft](e){e.post(t=>{let n=t.session.to,s=t.session.routeModel;if(s==null){let o={route:n,find:null};if(this[Ve](o))s=o.find,t.session.routeModel=s;else if(this[ze])s=this[ze];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let i=tt.from(t.session);this[dr](n,s,i).then(o=>{this[B],t.resolve()},o=>{t.reject(o)})})}[Ke](e){if(e.length==0)return!0;let t=this[B],n=[];for(let s of e){let i=this[wt](t,s);i!=null&&n.push({...i,route:s})}if(n.length==0){let s="can not find view index";return this[O](s),!1}for(let s of n.reverse())this[se](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[wt](e,t){const n=t.root??Z;let s;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Ye]===n)return s={x:a,y:i},s}}return null}[hr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[se](e,t,n=null,s=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,f=[...i.slots.value];for(let c=f.length-1;c>=0;c--){let h=f[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&i[G]&&(this[de](h.route),h.active===!0&&h.route.opsType==A.Append&&(l=!0)),a.push(new U(i,h.index,t.y)),f.splice(c,1))}if(f.length==0)s?i.slots.value=f:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=f.length-1,h=f[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=f}e.layers[t.y].views.length==0&&(o=!0);let u=t.y+1;for(;u<e.layers.length;u++){let c=e.layers[u].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let y=c[d];if(y[le]&&(o||U.include(a,y[le]))){let v=y.slots.value;for(let p=v.length-1;p>=0;p--){let m=v[p];m.route&&y[G]&&this[de](m.route),h.push(new U(y,m.index,u)),v.splice(p,1)}e.layers[u].views.splice(d,1)}}a=h,e.layers[u].views.length==0&&(o=!0)}}restore(e){if(!e||this[V].length==0){let t=this[B];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[w]=[],this[Be](),Promise.resolve()}else return new Promise((n,s)=>{for(let i=0;i<e.length;i++){let o=e[i];this[ye].post(a=>{let l=this[Pt](o);this[At](l),!l.session?.routeModel&&this[_e]&&this[Tt](l),this[Ft](l),this[Et](l),l.wait((f,u)=>{a.resolve()},(f,u)=>{u!==null&&this[O](u),a.resolve()})})}this[ye].post(i=>{i.resolve(),n()})})}[dr](e,t,n){let s=e.updateType??Xe.Part;return this[yr](t).then(()=>{this[pr](t,e,n,s)})}[yr](e){let t=[];for(let n=0;n<e.layers.length;n++){let s=e.layers[n];for(let i=0;i<s.models.length;i++){let o=s.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[pr](e,t,n,s){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const i=e.layers[0].models[0];let o=this[B],a=zn(o),l=t.root??Z,f;!a&&s==Xe.Part&&(f=this[wt](o,t));let u,c=0;if(f==null||f==null)if(a||s===Xe.All){if(o.layers.length==0&&(o.layers[0]=new pt),o.layers[0].views.length==0){let h=t.root??Z;u=new Pe(h,!0,null),o.layers[0].views=[u]}else u=o.layers[0].views[0];f={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let y;if(h.rootName){let v=o.layers[d-1];for(let p of v.views){if(p[G]&&p.name===h.rootName){y=new U(p,h.rootIndex??0,d-1);break}if(p[J]&&p[J].view.name===h.rootName&&p[J].index===h.rootIndex){y=p[J];break}}}if(!y)return Promise.reject("can not insert view(not find root node ref)");u=new Pe(l,!0,y),o.layers[d].views.push(u),f={x:o.layers[d].views.length-1,y:d}}else u=o.layers[f.y].views[f.x];if(c=f.y,u[G]=!0,t.opsType===A.Append){t.index=ee.get();let h=u.slots.value;if(h.length>0){let m=h[h.length-1];m.active=!1,m.route&&(m.route.active=m.active)}let d=new te(t,i,t.index,!0);u.slots.value=[...h,d];let y=c+1,v=1,p=new U(u,t.index,c);this[re](o,y,e,v,p)}else if(t.opsType===A.Open){let h=u.slots.value,d=!1;for(let y of h){if(y.route!==null&&$.isSameForRouteModel(y.route,t)){if(y.active==!0)return t.index=y.index,t.active=y.active,y.route=t,Promise.resolve();y.active=!0,d=!0,t.index=y.index,t.active=y.active,y.route=t,this[de](y.route)}else y.active=!1;y.route&&(y.route.active=y.active)}if(!d){t.index=ee.get(),t.active=!0;let y=new te(t,i,t.index,!0);h.push(y);let v=c+1,p=1,m=new U(u,t.index,c);this[re](o,v,e,p,m)}u.slots.value=[...h]}else{let h=u.slots.value;if(h.length==0){t.index=ee.get(),u.slots.value=[new te(t,i,t.index)];let d=c+1,y=1,v=new U(u,t.index,c);this[re](o,d,e,y,v)}else{let d=h[0];if(d.model!==i){this[se](o,f,null,!0),t.index=ee.get(),u.slots.value=[new te(t,i,t.index)];let y=c+1,v=1,p=new U(u,t.index,c);this[re](o,y,e,v,p)}else{d.route!==null&&this[de](d.route);let y=[];for(let j=1;j<h.length;j++)y.push(h[j].index);y.length>0&&this[se](o,f,y,!0),t.index=d.index,d.route=t;let v=[new U(u,t.index,c)],p=c+1,m=1,b=new U(u,t.index,c);for(;v.length>0&&p<o.layers.length&&m<e.layers.length;p++,m++){let j=[];for(let P=0;P<o.layers[p].views.length;P++){let R=o.layers[p].views[P];R[le]&&U.include(v,R[le])&&j.unshift(P)}let x=[];for(let P of j){let R=o.layers[p].views[P],q=e.layers[m].models,K;for(let _=0;_<q.length;_++)if(R.name===q[_].name){K=q[_];break}if(!K)this[se](o,{x:P,y:p},null,!1);else{let _=R.slots.value;if(_.length==0){let L=0;R.slots.value=[new te(null,K,L)];let W=p+1,k=m+1;this[re](o,W,e,k,b)}else{let L=_[0];if(L.model!==K){this[se](o,{x:P,y:p},null,!0),R.slots.value=[new te(null,K,0)];let W=p+1,k=m+1;this[re](o,W,e,k,b)}else{R[G]&&L.route!==null&&this[de](L.route);let W=[];for(let k=1;k<_.length;k++)W.push(_[k].index);W.length>0&&this[se](o,{x:P,y:p},W,!0),x.push(new U(R,L.index,p))}}R[G]=!1}}v=x}this[re](o,p,e,m,b)}}}if(u&&u[J]){let h=u[J];h&&(t.slot=new an(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[mr](t)}[re](e,t,n,s,i){let o=s,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let f of n.layers[o].models){let u=new Pe(f.name,!1,i),c=new te(null,f);u.slots.value=[c],l.push(u)}}for(;o<n.layers.length;o++){let l=new pt;l.views=[];for(let f of n.layers[o].models){let u=new Pe(f.name,!1,i),c=new te(null,f);u.slots.value=[c],l.views.push(u)}e.layers.push(l)}}[Pr](e,t,n,s,i,o){if(t<0||t>this[B].layers.length)return null;if(t<this[B].layers.length){let u=this[B].layers[t],c=null;for(let h of u.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&s!==-1&&(d=h[J]?.index===s)):d=h.name===e,!!d){i!==null&&(h[le]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[G]?a={view:i,index:o,level:t-1}:a=i[J],l={view:i,index:o,level:t-1});let f=new Pe(e,!0,a);if(f[le]=l,t==this[B].layers.length){let u=new pt;u.views=[f],this[B].layers.push(u)}else this[B].layers[t].views.push(f);return f}}const Qn="fox-router-view",Xn="fox-router-link";function Or(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Lr(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Yn(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Zn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ei(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function ti(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function ri(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function ni(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function ii(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function si(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function oi(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function li(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function ai(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Jt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function be(r,e){r.classList.contains(e)||r.classList.add(e)}function xe(r,e){r.classList.remove(e)}const ui=we&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Gt(r){ui(r)}function H(r,e,t){!S(e)||(r==null&&(r={}),Reflect.apply(e,r,t))}function Mr(r,e,t,n=-1,s,i,o,a){if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},s);return}const l=["animationend","transitionend"],f=u=>{l.forEach(c=>{It(e,c,f)}),Reflect.apply(i,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(u=>{Mt(e,u,f)})}if(S(o)){const l="animationcancel",f=u=>{Reflect.apply(o,r,[e,t,n]),It(e,l,f)};Mt(e,l,f)}}function Qt(r){return!we||r===null?!1:r.opsType===A.Append||r.opsType===A.Open}function Ir(r,e,t,n={},s,i=-1){if(e||Qt(s)){const o=Or(n,e);o&&be(t,o);const a=Lr(n,e);a&&be(t,a);const l=ri(n,e);H(r,l,[t,e,s,i])}}function Nr(r,e,t,n={},s,i,o,a){if(!Qt(i)&&!e){S(a)&&a(r,a,[t]);return}const l=Or(n,e),f=Lr(n,e),u=Yn(n,e),c=ni(n,e),h=ii(n,e),d=si(n,e);Gt(()=>{Mr(r,t,i,o,s,()=>{f&&xe(t,f),u&&xe(t,u),S(h)&&H(r,h,[t,e,i,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&H(r,d,[t,e,i,o])}),l&&xe(t,l),u&&be(t,u),S(c)&&H(r,c,[t,e,i,o])})}function Hr(r,e,t,n={},s,i,o,a,l){if(!Qt(o)&&!e){!e&&S(i)&&i();return}const f=Zn(n,e),u=ei(n,e),c=ti(n,e),h=oi(n,e),d=li(n,e),y=ai(n,e);f&&be(t,f),u&&be(t,u),S(h)&&H(r,h,[t,e,o,a]),Gt(()=>{Mr(r,t,o,a,s,()=>{u&&xe(t,u),c&&xe(t,c),S(d)&&H(r,d,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(i)&&i()},()=>{S(y)&&H(r,y,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(i)&&i()}),f&&xe(t,f),c&&be(t,c)})}function Nt(r,e={},t,n=-1){const s=e.mode??"default",i=Jt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Ir(r,!1,a,e,t,n)},enter:a=>{Nr(r,!1,a,e,i.enter,t,n)},leave:(a,l)=>{Hr(r,!1,a,e,i.leave,l,t,n)},clone:a=>Nt(r,e,t,n)}}function Dr(r){return r.el}function fi(r,e,t={},n,s,i,o){if(i){const a=Dr(e);if(a==null)return;const l=Jt(t);Ir(r,!0,a,t,n,s),Nr(r,!0,a,t,l.show,n,s,f=>{S(o)&&H(r,o,[f])})}else S(o)&&H(r,o,[])}function ci(r,e,t={},n,s,i,o){if(i){const a=Dr(e);if(a==null)return;const l=Jt(t);Hr(r,!0,a,t,l.hide,null,n,s,f=>{S(o)&&H(r,o,[f])})}else S(o)&&H(r,o,[])}function hi(r,e={}){Gt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function ne(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Kt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class di{node;state;constructor(e,t){this.node=e,this.state=t}}const Ht=g.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=g.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,s=g.inject(it,null),i=g.inject(ht,0),o=g.inject(lr,null),a=g.inject(dt,-1);let l=null;const f=r.modelSlot;if(f){g.provide(ht,i+1),g.provide(dt,f.index),g.provide(yt,f.index);const c=f.route;if(!c){console.warn("child view render error, route not exist");return}const h=Qe(t.proxy,!0);vn(h),ct(h,c)}else{if(s==null){console.error("router is not been injected");return}const c=r.name,h=g.inject(ar,null),d=g.inject(yt,0);if(l=s[Pr](c,i,o,a,h,d),l===null)return;if(g.provide(ar,l),l[G]===!0&&g.provide(lr,l),!n){g.provide(dt,-1),g.provide(ht,i+1),g.provide(yt,-1);const v=l.slots.value;if(v.length>0){const p=v[0].route;if(p){const m=Qe(t.proxy,!0);ct(m,p)}}else{const p=Qe(t.proxy,!0);l.compensation=()=>{const m=l.slots.value;if(m.length>0){const b=m[0].route;return b&&ct(p,b),!0}return!1}}}}const u={value:new Map};return g.onUnmounted(()=>{u.value&&u.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,y=[];for(let m=0;m<d.length;m++){const b=d[m],j=`${r.name}-${b.index}`,x=ne(r.transition,b.route,m)??!0,P={modelSlot:b};let R;e.slots.default?R=g.h(Ht,P,{default:e.slots.default}):R=g.h(Ht,P);const q={},K=ne(r.viewClass,b.route,m);typeof K=="string"&&K.length>0&&(q[K]=!0);const _=ne(r.viewActiveClass,b.route,m),L=ne(r.viewInactiveClass,b.route,m),W=u.value.get(j);if(typeof _=="string"&&_.length>0&&(q[_]=b.active),typeof L=="string"&&L.length>0&&(q[L]=!b.active),W&&b.active!==W.state){const ue=W.node;b.active?y.unshift(()=>{const lt=()=>{let Re=sr(ue);Re!=null&&or(Re,Ot.ACTIVATED)};fi(t,ue,r,b.route,m,x,lt)}):y.push(()=>{const lt=()=>{const Re=sr(ue);Re!=null&&or(Re,Ot.DEACTIVATED)};ci(t,ue,r,b.route,m,x,lt)})}const k={class:q,key:j},st=ne(r.viewTagProps,b.route,m);st!==null&&typeof st=="object"&&T(!0,k,st),b.route?.viewTagAttrs&&typeof b.route?.viewTagAttrs=="object"&&T(!0,k,b.route.viewTagAttrs);const Ur=ne(r.viewTag,b.route,m),ot=g.h(Ur,k,{default:()=>[R]});if(c.set(j,new di(ot,b.active)),u.value.delete(j),x){const ue=Nt(t,r,b.route,m);ot.transition=ue}h.push(ot)}u.value.forEach(m=>{m.node.transition=null}),u.value=c,hi(y,t);const v=ne(r.tag,null,-1),p={};return Object.assign(p,e.attrs),g.h(v,p,{default:()=>h})}else if(f!=null){const c=f.model,h={};c.props&&(typeof c.props=="object"?T(!1,h,c.props):c.props===!0&&typeof f.route?.params=="object"&&T(!1,h,f.route?.params));const d=g.h(c.component,h);return Kt(e.slots.default,{Component:d,route:f.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.model,y={};d.props&&(typeof d.props=="object"?T(!1,y,d.props):d.props===!0&&typeof h.route?.params=="object"&&T(!1,y,h.route?.params));const v=g.h(d.component,y);if(ne(r.transition,h.route,-1)??!0){const m=Nt(t,r,h.route,-1);v.transition=m}return Kt(e.slots.default,{Component:v,route:h.route})??v}else return Kt(e.slots.fallback,{})}}}});function yi(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function pi(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function mi(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function pe(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let vi=g.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=g.inject(it,null);return()=>{let n=pe(r.to,null),s=pe(r.tag,n);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[I](n),r.root&&(i.root=r.root),o=t.current);let a={},l=pe(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=mi(i,o)),pe(r.exact,i)===!0){let h=pe(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=pi(i,o))}let u={class:a};(s==="a"||s==="A")&&(u.href=i?.path??i?.name??"#"),T(!0,u,e.attrs);let c=pe(r.event,i);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}yi(d)&&t.to(i)};u[c]=h}return g.h(s,u,e.slots)}}}),gi={get each(){return tn},get type(){return Le},get isFunction(){return S},get isArray(){return wr},get isArrayLike(){return Vt},get makeArray(){return en},get merge(){return Rr},get isWindow(){return xr},get isPlainObject(){return Ze},get isEqual(){return et}};const Xt=Symbol("fk"),Yt=Symbol("fbk"),Zt=Symbol("fepk");function wi(r={}){const e=new Gn(r),t=new _t,n=new qt,s={...gi,get router(){return e},get bus(){return t},get Bus(){return _t},get eventproxy(){return n},get EventProxy(){return qt},get EventChain(){return Ie},get require(){return e.require},get request(){return kt},get extend(){return T},get clone(){return Oe},install(i){i.provide(it,e),i.provide(Xt,s),i.provide(Yt,t),i.provide(Zt,n),i.component(Qn,Ht),i.component(Xn,vi),Reflect.defineProperty(i.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(i.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$eventProxy",{get(){return n}}),i.config.globalProperties.$fox_on=function(o,a,l=!1){n.on(o,a,l)},i.config.globalProperties.$fox_off=function(o,a){n.off(o,a)},i.config.globalProperties.$fox_once=function(o,a){n.once(o,a)},i.config.globalProperties.$fox_all=function(...o){let a=n;Reflect.apply(a.all,a,o)},i.config.globalProperties.$fox_trigger=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.config.globalProperties.$fox_emit=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.mixin({computed:{$route(){return Fr(this)}}}),e.init()}};return s}function er(r){return r?r.$router:g.inject(it)}function bi(r){return r||(r=g.getCurrentInstance()?.proxy??void 0),r?Fr(r):null}function xi(r){return r?r.$fox:g.inject(Xt)}function Ri(r){return r?r.$bus:g.inject(Yt)}function Si(r){return r?r.$eventProxy:g.inject(Zt)}function Ci(r){const e=er(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.beforeEach(t),g.onUnmounted(()=>{e.removeBeforeEach(t)})}function Pi(r){const e=er(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.afterEach(t),g.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=_t;exports.EventChain=Ie;exports.EventProxy=qt;exports.Route=$;exports.cancelRequest=pn;exports.clone=Oe;exports.createFox=wi;exports.createMemoryHistory=$r;exports.createWebHashHistory=qr;exports.createWebHistory=Wn;exports.extend=T;exports.foxBusKey=Yt;exports.foxEventProxyKey=Zt;exports.foxKey=Xt;exports.isArray=wr;exports.isDate=Wr;exports.isESModule=Dt;exports.isEqual=et;exports.isFunction=S;exports.isMap=Vr;exports.isObject=br;exports.isPlainObject=Ze;exports.isPromise=Jr;exports.isSet=Br;exports.isString=kr;exports.isSymbol=zr;exports.onAfterRouteUpdate=Pi;exports.onBeforeRouteUpdate=Ci;exports.onFoxActivated=xn;exports.onFoxDeactivated=Rn;exports.request=kt;exports.sessionKey=ie;exports.toBoolean=Ut;exports.toNumber=Yr;exports.toTypeString=nt;exports.typeOf=Le;exports.useBus=Ri;exports.useEventProxy=Si;exports.useFox=xi;exports.useRoute=bi;exports.useRouter=er;
@@ -881,8 +881,7 @@ declare class Require {
881
881
  */
882
882
  private isOldWebKit;
883
883
  /**
884
- * moudel manager
885
- * @type {ModuleManager}
884
+ * module manager
886
885
  */
887
886
  private moduleManager;
888
887
  /**
@@ -1554,7 +1553,7 @@ export declare class Router {
1554
1553
  * 移除view
1555
1554
  * @param page
1556
1555
  * @param pos
1557
- * @param indexs
1556
+ * @param indexList
1558
1557
  * @param retainRoot
1559
1558
  */
1560
1559
  private [_removeView];
package/libs/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ref as mr, getCurrentInstance as Ht, onUnmounted as nt, shallowReactive as kr, effectScope as Wr, watch as zr, shallowRef as Jr, defineComponent as vr, inject as G, provide as te, h as ae } from "vue";
2
2
  /*!
3
- * fox v3.0.0 Mon Nov 28 2022 08:32:30 GMT+0800 (中国标准时间)
3
+ * fox v3.0.0 Mon Dec 26 2022 11:30:33 GMT+0800 (中国标准时间)
4
4
  */
5
5
  const Gr = Array.isArray, wi = (r) => Ut(r) === "[object Map]", bi = (r) => Ut(r) === "[object Set]", xi = (r) => r instanceof Date, S = (r) => typeof r == "function", Ri = (r) => typeof r == "string", Si = (r) => typeof r == "symbol", Qr = (r) => r !== null && typeof r == "object", Ci = (r) => Qr(r) && S(r.then) && S(r.catch), Xr = Object.prototype.toString, Ut = (r) => Xr.call(r), _t = (r) => Ut(r) === "[object Object]", Yr = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
6
6
  function gr(r) {
@@ -1976,7 +1976,7 @@ class Jn {
1976
1976
  return e;
1977
1977
  }
1978
1978
  [pe](e) {
1979
- if (this[g] == null)
1979
+ if (!this[g])
1980
1980
  return;
1981
1981
  let t = -1;
1982
1982
  for (let n = 0; n < this[g].length; n++)
@@ -2459,11 +2459,12 @@ class Jn {
2459
2459
  return !0;
2460
2460
  }
2461
2461
  [wt](e, t) {
2462
- let n = t.root ?? Z, s;
2462
+ const n = t.root ?? Z;
2463
+ let s;
2463
2464
  for (let i = 0; i < e.layers.length; i++) {
2464
- let o = e.layers[i];
2465
+ const o = e.layers[i];
2465
2466
  for (let a = o.views.length - 1; a >= 0; a--) {
2466
- let l = o.views[a];
2467
+ const l = o.views[a];
2467
2468
  if (l[J] && l[Xe] === n)
2468
2469
  return s = { x: a, y: i }, s;
2469
2470
  }
@@ -2476,19 +2477,19 @@ class Jn {
2476
2477
  [oe](e, t, n = null, s = !0) {
2477
2478
  if (t.y >= e.layers.length || t.x >= e.layers[t.y].views.length)
2478
2479
  return;
2479
- let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, f = i.slots.value;
2480
+ let i = e.layers[t.y].views[t.x], o = !1, a = [], l = !1, f = [...i.slots.value];
2480
2481
  for (let c = f.length - 1; c >= 0; c--) {
2481
2482
  let h = f[c];
2482
- (n == null || n.indexOf(h.index) != -1) && (h.route && i[J] && (this[pe](h.route), h.active === !0 && h.route.opsType == P.Append && (l = !0)), a.push(new H(i, h.index, t.y)), f.splice(c, 1));
2483
+ (!n || n.indexOf(h.index) != -1) && (h.route && i[J] && (this[pe](h.route), h.active === !0 && h.route.opsType == P.Append && (l = !0)), a.push(new H(i, h.index, t.y)), f.splice(c, 1));
2483
2484
  }
2484
2485
  if (f.length == 0)
2485
- s ? i.slots.value = [...f] : e.layers[t.y].views.splice(t.x, 1);
2486
+ s ? i.slots.value = f : e.layers[t.y].views.splice(t.x, 1);
2486
2487
  else {
2487
2488
  if (l) {
2488
2489
  let c = f.length - 1, h = f[c];
2489
2490
  h.active = !0, h.route && (h.route.active = h.active);
2490
2491
  }
2491
- i.slots.value = [...f];
2492
+ i.slots.value = f;
2492
2493
  }
2493
2494
  e.layers[t.y].views.length == 0 && (o = !0);
2494
2495
  let u = t.y + 1;
@@ -2556,7 +2557,7 @@ class Jn {
2556
2557
  }
2557
2558
  [hr](e, t, n, s) {
2558
2559
  if (e.layers[0].models.length !== 1)
2559
- return Promise.reject("illegal route structure(multil root node)");
2560
+ return Promise.reject("illegal route structure(multi root node)");
2560
2561
  const i = e.layers[0].models[0];
2561
2562
  let o = this[V], a = Wn(o), l = t.root ?? Z, f;
2562
2563
  !a && s == Qe.Part && (f = this[wt](o, t));
package/libs/index.umd.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function(g,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],v):(g=typeof globalThis<"u"?globalThis:g||self,v(g.fox={},g.Vue))})(this,function(g,v){"use strict";/*!
2
- * fox v3.0.0 Mon Nov 28 2022 08:32:30 GMT+0800 (中国标准时间)
3
- */const rr=Array.isArray,Vr=r=>He(r)==="[object Map]",Br=r=>He(r)==="[object Set]",Wr=r=>r instanceof Date,C=r=>typeof r=="function",kr=r=>typeof r=="string",zr=r=>typeof r=="symbol",nr=r=>r!==null&&typeof r=="object",Jr=r=>nr(r)&&C(r.then)&&C(r.catch),Gr=Object.prototype.toString,He=r=>Gr.call(r),De=r=>He(r)==="[object Object]",Qr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function ot(r){return r.__esModule||Qr&&r[Symbol.toStringTag]==="Module"}const Xr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function F(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,s=!1;for(typeof e=="boolean"&&(s=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let i=r[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let f;Array.isArray(l)?f=a&&Array.isArray(a)?a:[]:f=a&&typeof a=="object"?a:{},e[o]=F(s,f,l)}else l!==void 0&&(e[o]=l)}}return e}function Se(r,e,t=!1){if(!t)F(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let s in e){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!De(o))continue;i=Se(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}const n=Object.getOwnPropertySymbols(e);for(let s of n){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!De(o))continue;i=Se(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}}return r}class te{static seed=new Date().getTime();static get(){let e=++te.seed;return e>=Number.MAX_VALUE&&(te.seed=0),e}}const lt=Xr?Promise.resolve():null;function Ce(r,...e){lt!==null?e&&e.length>0?lt.then(()=>{r(e)}):lt.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function at(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":Boolean(r)}function Yr(r){return typeof r=="number"?r:Number(r)}const Zr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function Pe(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Zr[t]||"object"}function ir(r){return r&&typeof r=="object"&&"setInterval"in r}function ut(r){let e=!!r&&"length"in r&&r.length,t=Pe(r);return t==="function"||ir(r)?!1:t==="array"||e===0||typeof e=="number"&&e>0&&e-1 in r}function sr(r,e){let t=+e.length,n=0,s=r.length;for(;n<t;n++)r[s++]=e[n];return r.length=s,r}function en(r,e=[]){let t=e;return r!=null&&(ut(Object(r))?sr(t,typeof r=="string"?[r]:r):t.push(r)),t}function tn(r,e,t){if(ut(r))Reflect.apply([].forEach,r,[e]);else for(let n in r)if(t&&r.hasOwnProperty(n)){if(Reflect.apply(e,r,[r[n]])===!1)break}else if(Reflect.apply(e,r,[r[n]])===!1)break;return r}function Ue(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Pe(r),n=Pe(e);if(t!==n)return!1;if(t==="object"){let s=Object.keys(r),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=r[a],f=e[a];if(!Ue(l,f))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++){let i=r[s],o=e[s];if(!Ue(i,o))return!1}return!0}return!1}const or=Symbol("idKey"),oe=Symbol("valueKey"),P=Symbol("childrenKey"),k=Symbol("growKey");class lr{[k]=!0;[or];[oe]=v.ref();[P]=new Map;constructor(e){this[or]=e}}class rn{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[k];let n=e[P].get(t);if(n)return Ae(n);if(e[k])return n=ct(t),n[k]=e[k],e[P].set(t,n),Ae(n)}set(e,t,n){return t=="value"?(e[oe].value=n,!0):t==="grow"?(e[k]=at(n),!0):n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}const ft="__proxy__";function ct(r){let e=new lr(r);return Reflect.set(e,ft,new Proxy(e,new rn)),e}function Ae(r){return Reflect.get(r,ft)}class ar extends lr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("\u53C2\u6570\u81F3\u5C11\u5305\u62EC\u4E00\u4E2A(key, value)"),!1;let n=this;for(let s=0;s<t-1;s++){let i=e[s],o;n[P].has(i)?o=n[P].get(i):(o=ct(i),n[P].set(i,o)),n=o}return n[oe].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let s=0;s<t;s++){let i=e[s];if(n[P].has(i))n=n[P].get(i);else return}return n[oe].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[P].has(o))n=n[P].get(o);else return!1}let s=e[t-1];return n[P].has(s)?(n[P].delete(s),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[P].has(o))n=n[P].get(o);else return!1}let s=e[t-1];return n[P].has(s)}clear(){this[P].clear()}}const nn=["put","get","contains","remove","clear"];function ur(r){return nn.includes(r)}class sn{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[k];if(t===P)return e[P];if(typeof t=="string"&&ur(t))return e[t];let n=String(t),s=e[P].get(n);if(s)return Ae(s);if(e[k])return s=ct(n),s[k]=e[k],e[P].set(n,s),Ae(s)}set(e,t,n){return t=="value"?(e[oe].value=n,!0):t==="grow"?(e[k]=at(n),!0):ur(t)?!1:n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}function on(){let r=new ar,e=new sn,t=new Proxy(r,e);return Object.assign({put(...s){return Reflect.apply(r.put,r,s)},get(...s){return Reflect.apply(r.get,r,s)},remove(...s){return Reflect.apply(r.remove,r,s)},contains(...s){return Reflect.apply(r.contains,r,s)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,ft,t),r}let ht=new Proxy(ar,{construct(r,...e){let t=on();return Ae(t)}});const Y="default",fr=Symbol("sync"),I=Symbol("resolveRoute");function cr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function ln(r){let e=r.src;return new Promise((t,n)=>{const s=cr(a=>{ot(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=cr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(s,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(s,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(s,i)}})}class an{name;level;rootName;rootIndex=0;constructor(e,t,n,s){this.name=e,this.level=t,this.rootName=n,this.rootIndex=s}}class Ve{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ve(e.to,e.from),n=e.data??{};return F(!0,t.data,n),t}}class ${path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new $;return Se(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new $;if(e==null)return t;let n=t;for(let i in e){let o=e[i];n[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)n[i]=e[i];return t}}class un{id;name;props;meta;src;component;constructor(e,t,n,s){this.id=te.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return ln(this)}}class hr{models=[]}class dt{path;match;redirect;name;layers=[]}const U=Symbol("chainKey"),N=Symbol("cursorKey"),yt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),Be=Symbol("exArgsKey"),fe=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),re=Symbol("sessionKey"),ee=Symbol("_go");class Fe{[U]=[];[N]=0;[yt]=!1;[T]="Free";[Z]=[];[Be]=[];[fe]=[];[Ee]=[];[re];get session(){return this[re]}constructor(e,t=!1){this[re]=e,this[yt]=t}[ee](e,...t){let n=this[T];if(this[T]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,n==="Exception"||n==="Reject"){let a=[{session:this[re]},...this[Be]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Ce(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=n,this[U]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[U].length){let a=[{session:this[re]},...this[Z]];for(;this[fe].length>0;){let l=this[fe].shift();typeof l=="function"&&Ce(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[N]>=this[U].length)return this[T]="Free",this;let s=this[U][this[N]];this[yt]||(this[U].splice(0,this[N]+1),this[N]=-1);let i=this[N]+1;try{let o=!1,a={go:(l,...f)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...f]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[ee],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[U].splice(i,0,l),i++)},session:this[re]};Ce(()=>{Reflect.apply(s,{},[a,...this[Z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[ee],this,[e,...t])}finish(...e){return this[T]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[T]="Reject",this[Be]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[Be]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[U]=[],this[N]=0;let n=[{session:this[re]},...this[Z]];for(;this[fe].length>0;){let s=this[fe].shift();Ce(()=>{Reflect.apply(s,this,n)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[U]=[...this[U],...e]:this[U].push(e),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[fe].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[T]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[N]>=this[U].length}}const ce=Symbol("registerKey");class fn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class mt{[ce]=new Map;constructor(){}on(e,t,n=!1){let s=this[ce].get(e);s||(s=new Array,this[ce].set(e,s));let i=n===!0?1:0,o=new fn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ce].delete(e),this;let n=this[ce].get(e);if(n){for(let s=0;s<n.length;s++)if(n[s].callback===t){n.splice(s,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(n,{},i)});return this}emit(e,...t){let n=this[ce].get(e);if(!n)return this;for(let s=0;s<n.length;){let i=n[s];if(i.policy==1?n.splice(s,1):s++,typeof i.callback=="function")try{Ce(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const cn=new te;function hn(r,e="text"){e=e.trim().toLowerCase();let t="";if(e.indexOf("application/x-www-form-urlencoded")===0)if(typeof r=="object")for(let n in r){let s=r[n];if(Array.isArray(s))for(let i=0;i<s.length;i++){let o=`${encodeURIComponent(n)}=${encodeURIComponent(s[i])}`;t.length>0&&(t+="&"),t+=o}else{let i=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`;t.length>0&&(t+="&"),t+=i}}else t=r;else e.indexOf("text")===0?typeof r=="object"?t=JSON.stringify(r):t=r:e.indexOf("application/json")===0&&typeof r=="object"?t=JSON.stringify(r):t=r;return t}function dn(r,e,t="text"){if(e==null)return r;t=t.trim().toLowerCase();let n="";if(t.indexOf("application/x-www-form-urlencoded")===0||t.indexOf("application/json")===0)if(typeof e=="object")for(let s in e){let i=e[s];if(Array.isArray(i))for(let o=0;o<i.length;o++){let a=`${encodeURIComponent(s)}=${encodeURIComponent(i[o])}`;n.length>0&&(n+="&"),n+=a}else{let o=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`;n.length>0&&(n+="&"),n+=o}}else n=e;else n=e;return n.length>0&&(r.indexOf("?")===-1?r=`${r}?${n}`:r=`${r}&${n}`),r}const yn={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},he=new Map;async function pt(r){let{id:e,method:t="POST",url:n,headers:s={},data:i,processData:o=!0,timeout:a=-1}=r;if(e&&he.has(e))throw new Error("resubmit");t=t.toUpperCase();const l={...yn};l.headers=l.headers??{},Object.assign(l.headers,s);const f=l.headers["Content-Type"];if(Object.assign(l,{method:t}),t==="GET"?n=dn(n,i,f):(o&&(i=hn(i,f)),l.body=i),e||a>0){e||(e=`fox_fetch_${cn.get()}`);const u=new AbortController;l.signal=u.signal;let c={timer:null,controller:u};if(a>0){const h=setTimeout(()=>{c.timer&&c.controller.abort()},a);c.timer=h}he.set(e,c)}try{let u=await fetch(n,l),c={};u.headers.forEach((y,w)=>{c[w]=y});let h,d=c["content-type"]??"";return d.indexOf("application/json")!==-1?h=await u.json():d.indexOf("text")!=-1?h=await u.text():h=await u.blob(),{ok:u.ok,status:`${u.status}`,statusText:u.statusText,headers:c,data:h,response:u}}catch(u){throw u}finally{if(e){let u=he.get(e);u&&(u.timer&&(clearTimeout(u.timer),u.timer=null),he.delete(e))}}}function mn(r){let e=he.get(r);return e?(e.timer&&(clearTimeout(e.timer),e.timer=null),e.controller.abort(),he.delete(r),!0):!1}const Te=Symbol("registerKey");class pn{[Te]=new Map;constructor(){}set(e,t){this[Te].set(e,t)}get(e){return this[Te].get(e)}has(e){return this[Te].has(e)}delete(e){return this[Te].delete(e)}}const gt=Symbol("lc");function We(r,e=!1){let t=r,n=t[gt];if(!n)if(e)n=new pn,t[gt]=n;else return null;return n}function dr(r,e){let t=r;for(;t!==null;){const n=t[gt];if(n&&n.has(e))return n.get(e);t=t.$parent}return null}function yr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return We(e.component.proxy,!1)}return null}const ke=Symbol("hooksKey");function gn(r){let e=r.get(ke);e||(e=[],r.set(ke,e))}function mr(r,e){let t=r.get(ke);if(t!=null)for(let n=t.length-1;n>=0;n--){let s=t[n];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var vt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(vt||{});class vn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function wn(r,e,t,n){let s=new vn(e,t,n);return r.push(s),!0}function bn(r,e,t,n){let s=-1;for(let i=0;i<r.length;i++){let o=r[i];if(o.type===e&&o.hook===t&&o.target===n){s=i;break}}return s!=-1?(r.splice(s,1),!0):!1}function pr(r){return(e,t)=>{let n;if(t)n=t;else{let i=v.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}n=i.proxy}let s=dr(n,ke);if(s==null){console.warn("can not get hooks context");return}v.onUnmounted(()=>{bn(s,r,e,n)}),wn(s,r,e,n)}}let Rn=pr("a"),xn=pr("da");function Sn(){let r=new $;return r.path="",r.name="",r.params={},r.index=-1,v.shallowReactive(r)}const wt=Symbol("routeKey");function bt(r,e){let t=r.get(wt);if(t){let n={path:"",name:"",params:{},index:-1,session:{}};Object.assign(n,e),Object.assign(t,n)}else t=Sn(),Object.assign(t,e),r.set(wt,t)}function gr(r){let e=dr(r,wt);return e??null}const ze=Symbol("rk"),Rt=Symbol("vd"),vr=Symbol("rv"),xt=Symbol("rvi"),wr=Symbol("pv"),St=Symbol("pvi");function Cn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var s="",i=t+1;i<r.length;){var o=r.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=r[i++];continue}break}if(!s)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:s}),t=i;continue}if(n==="("){var a=1,l="",i=t+1;if(r[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<r.length;){if(r[i]==="\\"){l+=r[i++]+r[i++];continue}if(r[i]===")"){if(a--,a===0){i++;break}}else if(r[i]==="("&&(a++,r[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=r[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function br(r,e){e===void 0&&(e={});for(var t=Cn(r),n=e.prefixes,s=n===void 0?"./":n,i="[^".concat(de(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,f="",u=function(S){if(l<t.length&&t[l].type===S)return t[l++].value},c=function(S){var O=u(S);if(O!==void 0)return O;var _=t[l],q=_.type,M=_.index;throw new TypeError("Unexpected ".concat(q," at ").concat(M,", expected ").concat(S))},h=function(){for(var S="",O;O=u("CHAR")||u("ESCAPED_CHAR");)S+=O;return S};l<t.length;){var d=u("CHAR"),y=u("NAME"),w=u("PATTERN");if(y||w){var m=d||"";s.indexOf(m)===-1&&(f+=m,m=""),f&&(o.push(f),f=""),o.push({name:y||a++,prefix:m,suffix:"",pattern:w||i,modifier:u("MODIFIER")||""});continue}var p=d||u("ESCAPED_CHAR");if(p){f+=p;continue}f&&(o.push(f),f="");var R=u("OPEN");if(R){var m=h(),K=u("NAME")||"",x=u("PATTERN")||"",A=h();c("CLOSE"),o.push({name:K||(x?a++:""),pattern:K&&!x?i:x,prefix:m,suffix:A,modifier:u("MODIFIER")||""});continue}c("END")}return o}function Pn(r,e){return An(br(r,e),e)}function An(r,e){e===void 0&&(e={});var t=Ct(e),n=e.encode,s=n===void 0?function(l){return l}:n,i=e.validate,o=i===void 0?!0:i,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var f="",u=0;u<r.length;u++){var c=r[u];if(typeof c=="string"){f+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",y=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!y)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var w=0;w<h.length;w++){var m=s(h[w],c);if(o&&!a[u].test(m))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));f+=c.prefix+m+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var m=s(String(h),c);if(o&&!a[u].test(m))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));f+=c.prefix+m+c.suffix;continue}if(!d){var p=y?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(p))}}return f}}function En(r,e){var t=[],n=Rr(r,t,e);return Fn(n,t,e)}function Fn(r,e,t){t===void 0&&(t={});var n=t.decode,s=n===void 0?function(i){return i}:n;return function(i){var o=r.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,f=Object.create(null),u=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?f[d.name]=o[h].split(d.prefix+d.suffix).map(function(y){return s(y,d)}):f[d.name]=s(o[h],d)},c=1;c<o.length;c++)u(c);return{path:a,index:l,params:f}}}function de(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ct(r){return r&&r.sensitive?"":"i"}function Tn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=t.exec(r.source);s;)e.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(r.source);return r}function jn(r,e,t){var n=r.map(function(s){return Rr(s,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Ct(t))}function Kn(r,e,t){return _n(br(r,t),e,t)}function _n(r,e,t){t===void 0&&(t={});for(var n=t.strict,s=n===void 0?!1:n,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,f=t.encode,u=f===void 0?function(M){return M}:f,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,y=d===void 0?"":d,w="[".concat(de(y),"]|$"),m="[".concat(de(h),"]"),p=o?"^":"",R=0,K=r;R<K.length;R++){var x=K[R];if(typeof x=="string")p+=de(u(x));else{var A=de(u(x.prefix)),S=de(u(x.suffix));if(x.pattern)if(e&&e.push(x),A||S)if(x.modifier==="+"||x.modifier==="*"){var O=x.modifier==="*"?"?":"";p+="(?:".concat(A,"((?:").concat(x.pattern,")(?:").concat(S).concat(A,"(?:").concat(x.pattern,"))*)").concat(S,")").concat(O)}else p+="(?:".concat(A,"(").concat(x.pattern,")").concat(S,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?p+="((?:".concat(x.pattern,")").concat(x.modifier,")"):p+="(".concat(x.pattern,")").concat(x.modifier);else p+="(?:".concat(A).concat(S,")").concat(x.modifier)}}if(l)s||(p+="".concat(m,"?")),p+=t.endsWith?"(?=".concat(w,")"):"$";else{var _=r[r.length-1],q=typeof _=="string"?m.indexOf(_[_.length-1])>-1:_===void 0;s||(p+="(?:".concat(m,"(?=").concat(w,"))?")),q||(p+="(?=".concat(m,"|").concat(w,")"))}return new RegExp(p,Ct(t))}function Rr(r,e,t){return r instanceof RegExp?Tn(r,e):Array.isArray(r)?jn(r,e,t):Kn(r,e,t)}var E=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(E||{}),Je=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Je||{});const z=Symbol("rootKey"),J=Symbol("rootNodeKey"),le=Symbol("parentNodeKey"),Ge=Symbol("nameKey");class ne{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,s=!0){this.route=e,this.model=t,this.index=n,this.active=s}}class je{scope=null;set compensation(e){this.scope!==null&&this.scope.stop(),this.scope=v.effectScope(),this.scope.run(()=>{v.watch(this.slots,()=>{let t=!1;try{t=e()}catch(n){console.error(n)}t&&this.scope!==null&&(this.scope.stop(),this.scope=null)})})}_slots;get slots(){return this._slots==null&&(this._slots=v.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ge];[z];[J]=null;[le]=null;get name(){return this[Ge]}constructor(e,t,n){this[Ge]=e,this[z]=t,n&&(this[J]=n)}}class V{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let s=e[n];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class Pt{views=[]}class qn{layers=[]}class $n{time;route}class On{forbidTime=300;submitRecorder=new $n;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const ye=typeof window<"u",H=function(){return window},Ke=function(){return window.document};function Ln(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function Mn(){if(!ye)return"/";let r=H().location,e=`${r.protocol}//${r.host}`;return e+=Ln(r.pathname),e}function At(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Et(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}let Ft=Mn();class In{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let n=await pt({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(n.ok)return this.cache.set(e,n.data),n.data;throw Error(n.statusText)}remove(e){this.cache.delete(e)}}var G=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(G||{});class Nn{exports;status;id;src}class Hn{register=new Map;constructor(){}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}class Dn{head;isOldWebKit;moduleManager=new Hn;resource=new In;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=Ke();this.head=t.head||t.getElementsByTagName("head")[0]||t.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}ensure(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let f=e[l];for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}else{let f=e[l].split(",");for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}let o=new Un(t.length,(l,f)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},f)}catch(u){console.error(u.message,u)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(u){console.error(u.message,u)}}),a=new Fe;for(let l=0;l<t.length;l++){let f=new Vn(l,t[l],s,o);this.mount(a,f)}return this}remove(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){const n=Ke();if(this.isNaturePath(t.src,"js")){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src,"css")){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else if(this.isNaturePath(t.src,"html")){let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}let s=this.getFileNamePostfix(t.src);if(s==="js"||s.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(s==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else{let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}}mountHTML(e,t,n){e.post(s=>{let i=t.params.timeout??this.options.timeout??3e4,o=t.src;this.resource.get(o,i).then(a=>{n.innerHTML=a,t.progress.work(!0,t.index,a),s.resolve()},a=>{console.error(a),t.progress.work(!1,t.index,null),s.reject()})})}mountCSS(e,t,n){e.post(s=>{const i=Ke(),o=t.src,a=i.createElement("link"),l="onload"in a;if(this.isOldWebKit||!l){const u={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{n.removeChild(a)}catch(c){console.error(c.message,c)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{xr(a,u)},1)}else a.onload=()=>{a.onload=a.onerror=null,t.progress.work(!0,t.index,t.src),s.resolve()},a.onerror=()=>{try{n.removeChild(a)}catch(u){console.error(u.message,u)}a.onload=a.onerror=null,t.progress.work(!1,t.index,null),s.reject()};let f=i.getElementById(o);f&&f.parentNode&&f.parentNode.removeChild(f),a.rel="stylesheet",a.type="text/css",a.id=o,a.href=o,n.appendChild(a)})}mountJS(e,t,n){e.post(s=>{let i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==G.Defined||o.status==G.Loaded)){if(o.exports){t.progress.work(!0,t.index,o.exports),s.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),s.resolve();return}}o=new Nn,o.id=i,o.src=i,o.status=G.Loading,this.moduleManager.put(i,o);const l=Ke().createElement("script");if("onload"in l)l.onload=()=>{l.onload=l.onerror=null,o.status==G.Loading&&(o.status=G.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{let c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==G.Loading&&(o.status=G.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;let u=H();u.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Ke(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=n.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=n.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}else{this.resource.remove(e);let i=t.htmlPoint;i||(i=n.body),i.innerHTML="";return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){let s=e[n].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){let n=this,s=function(...i){e.status=G.Defining;let o,a,l,f=i.length;f===1?(l=i[0],o=void 0):f===2?(l=i[1],Array.isArray(i[0])?(a=n.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=n.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...u)=>{typeof l=="function"?e.exports=Reflect.apply(l,e,u):e.exports=l,e.status=G.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=G.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&t!=="html"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let s=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e,t){if(this.options.nature==null)return!1;if(t==="all"||t==="js"){let n=this.options.nature.js;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="css"){let n=this.options.nature.css;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="html"){let n=this.options.nature.html;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return Ft+e.slice(1);if(e.indexOf("./")==0)return Ft+e.slice(2);if(t){let s=this.options.alias[e];if(!s){let i=e.indexOf("/");if(i==-1)s=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?s=a+e.slice(i):s=e}}return this.parserPath(s,!1)}return Ft+e}}function xr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.time>e.timeout?e.error():xr(r,e)},20)}class Un{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}}isOK(){return this.status}}class Vn{index;src;params;progress;constructor(e,t,n,s){this.index=e,this.src=t,this.params=n,this.progress=s}}const me=Symbol("_notifyChange");class Bn{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Qe=Symbol("ignoreHistoryChangeOnceKey"),Sr=Symbol("_navigateFirstRoute"),Xe=Symbol("_getRouteMark"),Cr=Symbol("_getUrlSearch"),Tt=Symbol("_generateLocation"),_e=Symbol("_setRouteMarkRecorder"),Pr="Symbol(_fox_restore_point)";function jt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[Qe]=!1;constructor(e="hash",t="",n="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??H().sessionStorage}init(e=!0){const t=H();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[Qe]){this[Qe]=!1;return}if(jt(this.historyMonitor)){const n=t.history.state;this[me](n);try{let s=[];if(typeof n=="string"?s=JSON.parse(n):s=n,Array.isArray(s)&&s.length>0){const i=this[Xe]()??"/";this[_e](i,s)}}catch{}}}),At(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Sr](),Promise.resolve()}destroy(){if(this.historyChange){const e=H();Et(e,"popstate",this.historyChange)}}[Sr](){let e=this[Xe]()??"/";const t=this.storage.getItem(Pr);if(t)try{const o=JSON.parse(t);if(o.mark===e){this[me](o.routes);return}}catch{}const n=e.indexOf("!");let s;n!=-1?s=e.substring(n+1):s=e;const i=new $;i.path=s,i.query=this[Cr](),this[me]([i])}[_e](e,t){try{const n={mark:e,routes:t},s=JSON.stringify(n);this.storage.setItem(Pr,s)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Xe]()??"/";this[_e](t,e)}[me](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Xe](){const e=H();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[Cr](){return H().location.search}listen(e){this.changeHandler=e}go(e,t=!0){const n=H();this[Qe]=!t,n.history.go(e)}push(e){let t=this[Tt](e.currentRoute);jt(this.traceless,e.currentRoute)||H().history.pushState(e.routes,"",t),this[_e](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[Tt](e.currentRoute);jt(this.traceless,e.currentRoute)||H().history.replaceState(e.routes,"",t),this[_e](e.currentRoute.fullPath,e.routes)}[Tt](e){const t=H();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l in e.query){let f=encodeURIComponent(e.query[l]),u=`${encodeURIComponent(l)}=${f}`;a.length>0&&(a+="&"),a+=u}else a=e.query;this.query?(n=`${this.query}&${a}`,n.charAt(0)!=="?"&&(n=`?${n}`)):n=`?${a}`}const s=t.location;let i=e.fullPath;i.startsWith(Y)&&(i=i.substring(Y.length+1));let o;return n?this.mode=="path"?o=`${this.base}/${i}${n}`:o=`${s.pathname}${n}#${i}`:this.mode=="path"?o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Wn(r=!0,e=null,t="",n=!0,s=!1,i){return e!==null&&(e=H().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,r,n,s,i)}function Er(r=!0,e="",t=!0,n=!1,s){return new Ar("hash","",e,r,t,n,s)}class kn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}listen(e){this.changeHandler=e}[me](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const s=this.queue[n];this[me](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Fr(r="",e=50){return new kn(r,e)}function Ei(r){}const Ye=Symbol("_constructRouteModel"),Ze=Symbol("_findRouteModel"),Kt=Symbol("_findRootView"),Tr=Symbol("_getFirstView"),ae=Symbol("_removeView"),jr=Symbol("_buildPage"),Kr=Symbol("_resolveComponent"),_r=Symbol("_update"),ie=Symbol("_merge"),_t=Symbol("_handleHistoryChange"),et=Symbol("_handleRouteUpdated"),tt=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),pe=Symbol("current"),qr=Symbol("_addRouteRecorder"),ge=Symbol("_removeRouteRecorder"),qt=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),rt=Symbol("errorCallback"),B=Symbol("registerKey"),nt=Symbol("notFoundKey"),$t=Symbol("notFoundPathKey"),W=Symbol("forestKey"),j=Symbol("historyKey"),qe=Symbol("beforeFiltersKey"),$e=Symbol("afterFiltersKey"),Oe=Symbol("destroyFiltersKey"),ve=Symbol("mainDispatcherKey"),Ot=Symbol("initKey"),it=Symbol("requireKey"),ue=Symbol("readyKey"),Lt=Symbol("readyHandlersKey"),st=Symbol("_markReady"),$r=Symbol("_createNextFn"),Mt=Symbol("_start"),It=Symbol("_before"),Nt=Symbol("_after"),Or=Symbol("_destroy"),Ht=Symbol("_load"),Le=Symbol("_unload"),Dt=Symbol("_loadDependency"),Ut=Symbol("resolvedModulesKey"),Me=Symbol("resolveDependencyKey"),Ie=Symbol("routerGuardKey");function zn(r){return r.layers.length==0||r.layers[0].views.length==0}function Jn(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let s=F(!0,{},n.meta);e.push(s)}else n.meta&&e.push(n.meta)})}),e}class Gn{[B]=new Array;[nt];[$t]="*";[ue]=!1;[Lt]=[];[W]=new qn;[j];[b]=new Array;[rt]=null;[tt]=null;[qe]=new Array;[$e]=new Array;[Oe]=new Array;[ve]=new Fe;[Ut]=new Map;[Me]=null;[Ie]=new On;[Ot]=!1;[pe]=v.ref(null);[it]=null;get require(){return ye?(this[it]||(this[it]=new Dn),this[it]):null}get current(){return this[pe].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[j]=e.history:this[j]=ye?Er():Fr(),this[j]?.listen(async n=>{let s=!0;try{if(typeof n=="string"){let i=this[I](n);i&&await this[_t]([i])}else await this[_t](n)}catch(i){console.error(i.message,i),s=!1}this[ue]===!1&&this[st](s)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[rt]=="function")try{this[rt](e,t)}catch{}console.error(e)}init(){this[Ot]!==!0&&(this[j]?.init(!this[ue]),this[Ot]=!0)}isReady(){return this[ue]?Promise.resolve():new Promise((e,t)=>{this[Lt].push([e,t])})}[st](e){this[ue]=!0,this[Lt].forEach(([t,n])=>{try{e?t():n()}catch(s){console.error(s.message,s)}})}[_t](e){try{if(!e){let o=[...this[b]].reverse();return this[Le](o),ye&&H().location.reload(),Promise.resolve()}let t=null,n=[],s=[],i=0;for(;i<e.length&&i<this[b].length&&$.isSame(e[i],this[b][i]);i++)e[i].opsType===E.Open&&e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(n=e.slice(i)),i<this[b].length&&(s=this[b].slice(i).reverse()),s.length==0&&n.length==0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Le](s)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[L](t)}return Promise.resolve()}[et](e){if(e)this[pe].value=e;else{let t=this[b].length;t>0?this[pe].value=this[b][t-1]:this[pe].value=null}if(typeof this[tt]=="function")try{this[tt](this[pe].value)}catch{}}[qr](e,t=-1){t<0||t>=this[b].length?this[b].push(e):this[b].splice(t,0,e)}[qt](){let e=[];for(let t of this[b]){let n=$.clone(t,!0);e.push(n)}return e}[ge](e){if(this[b]==null)return;let t=-1;for(let n=0;n<this[b].length;n++)if($.isSame(this[b][n],e)){t=n;break}if(t!=-1){let n=this[b][t];this[b].splice(t,1),this[Or](n,n.session)}}set historyMonitor(e){this[j]&&(this[j].historyMonitor=e)}get historyMonitor(){return this[j]?this[j].historyMonitor:!1}set traceless(e){this[j]&&(this[j].traceless=e)}get traceless(){return this[j]?this[j].traceless:!1}setRestorePoint(){const e=this[qt]();this[j]?.setRestorePoint(e)}onRouteUpdated(e){this[tt]=e}onError(e){this[rt]=e}beforeEach(e){this[qe].push(e)}removeBeforeEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}afterEach(e){this[$e].push(e)}removeAfterEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}destroyEach(e){this[Oe].push(e)}removeDestroyEach(e){const t=this[Oe].indexOf(e);return t!==-1?(this[Oe].splice(t,1),!0):!1}setResolveDependency(e){this[Me]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[$t]){this.setNotFoundRoute(e);return}const n=this[Ye](e);if(t==-1)this[B]=[...this[B],...n];else for(let s=n.length-1;s>=0;s--)this[B].splice(t,0,n[s])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1;for(let n=0;n<this[B].length;n++){const s=this[B][n];if(t?.path&&s.path===t.path)return this[B].splice(n,1),!0;if(t?.name&&s.name===t.name)return this[B].splice(n,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1):this[B].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[$t]=e}setNotFoundRoute(e){const t=this[Ye](e);this[nt]=t[0]}getRoutes(){return[...this[B]]}[Ye](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){let a=new dt;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in n){let l=n[a];a.length===0&&(a=Y);let f=new un(a,l,e.props,e.meta);s.push(f)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ye](a);for(let f of l){let u=new dt;u.name=f.name,f.path&&f.path.length>0?t!=="/"?u.path=`${t}${f.path}`:u.path=f.path:(i=!0,u.path=t);let c=new hr;c.models=[...s],u.layers=[c,...f.layers],o.push(u)}}if(!i){let a=new hr;a.models=s;let l=new dt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ze](e){let t=e.route;try{for(let n of this[B])if(t.path&&n.path){let s=n.match;s||(s=n.match=En(n.path));let i=s(t.path);if(!i)continue;if(n.redirect){let o=new $;F(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ze](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},F(!0,t.params,i.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let f of l){let u=f.split("=");if(u.length!==2)continue;let c=decodeURIComponent(u[0].trim()),h=decodeURIComponent(u[1].trim());a[c]=h}F(!0,t.params,a)}else typeof o=="object"&&F(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let s=Pn(n.path);return t.path=s(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new $,typeof e[0]=="object")t=$.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&F(!1,t,e[n]);else typeof e=="object"?t=$.from(e):typeof e=="string"&&(t=new $,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Y,t.opsType=t.opsType??this.options.defaultOperationType??E.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||E.Push,this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=E.Put,this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=E.Replace,this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=E.Append,this.to(t)):(this[L]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[b][0].root??Y,e.all)for(let l=this[b].length-1;l>0;l--){let f=this[b][l];f.opsType===E.Append&&f.root===i&&(o.splice(0,0,f),s=l-1)}else if(e.until)for(let l=this[b].length-1;l>0;l--){let f=this[b][l];if(f.opsType===E.Append&&f.root===i){if(e.until.charAt(0)==="/"&&e.until===f.path){s=l;break}else if(e.until===f.name){s=l;break}o.splice(0,0,f)}}}else{i=Y;let l=this[Tr](this[W]);l&&(i=l.name);for(let f=this[b].length-1;f>0;f--){let u=this[b][f];if(u.opsType===E.Append&&u.root===i){o.push(u),s=f-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[b].forEach(l=>{l.opsType!==E.Put&&a++}),this[Le](o)){let l=0;this[b].forEach(u=>{u.opsType!==E.Put&&l++});const f=l-a;this[j]?.go(f,!1),n.resolve(),t(!0)}}catch(s){this[L](s),n.resolve(),t(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=E.Open,this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let n=this[I](e);if(!n){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===n.root){if(!n.path&&!n.name){s.push(o);continue}if(n.path&&n.path===o.path){s.push(o);break}else if(n.name&&n.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Le](s)&&this[et](),t.resolve()}catch(n){this[L](n),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[L]("resolve route fail",t),this;console.debug("route to",t.path,t.root);let n=this[Ie].acquire(t);return n==null?(this[L]("route forbid",t),this):(this[ve].post(s=>{try{let i=this[Mt](t);this[It](i),!i.session?.routeModel&&this[Me]&&this[Dt](i),this[Ht](i),this[Nt](i),i.wait((o,a)=>{let l=o.session.to;try{let f=$.clone(l,!0);const u=new Bn(f,this[qt]());l.opsType===E.Replace?this[j]?.replace(u):this[j]?.push(u)}catch(f){console.error(f.message,f)}if(this[Ie].release(n),this[et](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(f){console.error(f.message,f)}this[ue]===!1&&this[st](!0),s.resolve()},(o,a)=>{this[Ie].release(n),a!==null&&this[L](a,t),this[ue]===!1&&this[st](!1),s.resolve()})}catch(i){this[Ie].release(n),this[L](i,t),s.resolve()}}),this)}back(e=1){this[j]?.go(-e)}[$r](e){return(t,n)=>{if(typeof t=="boolean")t?e.resolve():e.reject(n??null);else if(t){let s=this[I](t);if(s){let i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Mt](e){let t=this[b].length>0?this[b][0]:void 0,n=new Ve(e,t),s={route:e,find:null};return this[Ze](s),s.find&&(n.routeModel=s.find,e.matched=Jn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new Fe(n)}[It](e){for(let t of this[qe])e.post(n=>{let s=this[$r](n);Reflect.apply(t,{},[n.session.to,n.session.from,s,n.session])})}[Nt](e){e.post(t=>{for(let n of this[$e])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[Or](e,t){for(let n of this[Oe])try{Reflect.apply(n,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Dt](e){let t=e.session,n=Reflect.apply(this[Me],this,[t?.to]);if(n==null)return;Array.isArray(n)||(n=[n]);let s=[];for(let i of n)this[Ut].has(i)||s.push(i);s.length!==0&&e.post(i=>{this.require.ensure(s,(...o)=>{if(!o){i.reject();return}for(let a of o){if(!a)continue;let l;ot(a)?l=a.default:l=a,Array.isArray(l)&&this.addRoutes(l)}for(let a of s)this[Ut].set(a,!0);i.resolve()})})}[Ht](e){e.post(t=>{let n=t.session.to,s=t.session.routeModel;if(s==null){let o={route:n,find:null};if(this[Ze](o))s=o.find,t.session.routeModel=s;else if(this[nt])s=this[nt];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let i=Ve.from(t.session);this[jr](n,s,i).then(o=>{this[W],t.resolve()},o=>{t.reject(o)})})}[Le](e){if(e.length==0)return!0;let t=this[W],n=[];for(let s of e){let i=this[Kt](t,s);i!=null&&n.push({...i,route:s})}if(n.length==0){let s="can not find view index";return this[L](s),!1}for(let s of n.reverse())this[ae](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[Kt](e,t){let n=t.root??Y,s;for(let i=0;i<e.layers.length;i++){let o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){let l=o.views[a];if(l[z]&&l[Ge]===n)return s={x:a,y:i},s}}return null}[Tr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ae](e,t,n=null,s=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,f=i.slots.value;for(let c=f.length-1;c>=0;c--){let h=f[c];(n==null||n.indexOf(h.index)!=-1)&&(h.route&&i[z]&&(this[ge](h.route),h.active===!0&&h.route.opsType==E.Append&&(l=!0)),a.push(new V(i,h.index,t.y)),f.splice(c,1))}if(f.length==0)s?i.slots.value=[...f]:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=f.length-1,h=f[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=[...f]}e.layers[t.y].views.length==0&&(o=!0);let u=t.y+1;for(;u<e.layers.length;u++){let c=e.layers[u].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let y=c[d];if(y[le]&&(o||V.include(a,y[le]))){let w=y.slots.value;for(let m=w.length-1;m>=0;m--){let p=w[m];p.route&&y[z]&&this[ge](p.route),h.push(new V(y,p.index,u)),w.splice(m,1)}e.layers[u].views.splice(d,1)}}a=h,e.layers[u].views.length==0&&(o=!0)}}restore(e){if(!e||this[B].length==0){let t=this[W];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[b]=[],this[et](),Promise.resolve()}else return new Promise((n,s)=>{for(let i=0;i<e.length;i++){let o=e[i];this[ve].post(a=>{let l=this[Mt](o);this[It](l),!l.session?.routeModel&&this[Me]&&this[Dt](l),this[Ht](l),this[Nt](l),l.wait((f,u)=>{a.resolve()},(f,u)=>{u!==null&&this[L](u),a.resolve()})})}this[ve].post(i=>{i.resolve(),n()})})}[jr](e,t,n){let s=e.updateType??Je.Part;return this[Kr](t).then(()=>{this[_r](t,e,n,s)})}[Kr](e){let t=[];for(let n=0;n<e.layers.length;n++){let s=e.layers[n];for(let i=0;i<s.models.length;i++){let o=s.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[_r](e,t,n,s){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multil root node)");const i=e.layers[0].models[0];let o=this[W],a=zn(o),l=t.root??Y,f;!a&&s==Je.Part&&(f=this[Kt](o,t));let u,c=0;if(f==null||f==null)if(a||s===Je.All){if(o.layers.length==0&&(o.layers[0]=new Pt),o.layers[0].views.length==0){let h=t.root??Y;u=new je(h,!0,null),o.layers[0].views=[u]}else u=o.layers[0].views[0];f={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let y;if(h.rootName){let w=o.layers[d-1];for(let m of w.views){if(m[z]&&m.name===h.rootName){y=new V(m,h.rootIndex??0,d-1);break}if(m[J]&&m[J].view.name===h.rootName&&m[J].index===h.rootIndex){y=m[J];break}}}if(!y)return Promise.reject("can not insert view(not find root node ref)");u=new je(l,!0,y),o.layers[d].views.push(u),f={x:o.layers[d].views.length-1,y:d}}else u=o.layers[f.y].views[f.x];if(c=f.y,u[z]=!0,t.opsType===E.Append){t.index=te.get();let h=u.slots.value;if(h.length>0){let p=h[h.length-1];p.active=!1,p.route&&(p.route.active=p.active)}let d=new ne(t,i,t.index,!0);u.slots.value=[...h,d];let y=c+1,w=1,m=new V(u,t.index,c);this[ie](o,y,e,w,m)}else if(t.opsType===E.Open){let h=u.slots.value,d=!1;for(let y of h){if(y.route!==null&&$.isSameForRouteModel(y.route,t)){if(y.active==!0)return t.index=y.index,t.active=y.active,y.route=t,Promise.resolve();y.active=!0,d=!0,t.index=y.index,t.active=y.active,y.route=t,this[ge](y.route)}else y.active=!1;y.route&&(y.route.active=y.active)}if(!d){t.index=te.get(),t.active=!0;let y=new ne(t,i,t.index,!0);h.push(y);let w=c+1,m=1,p=new V(u,t.index,c);this[ie](o,w,e,m,p)}u.slots.value=[...h]}else{let h=u.slots.value;if(h.length==0){t.index=te.get(),u.slots.value=[new ne(t,i,t.index)];let d=c+1,y=1,w=new V(u,t.index,c);this[ie](o,d,e,y,w)}else{let d=h[0];if(d.model!==i){this[ae](o,f,null,!0),t.index=te.get(),u.slots.value=[new ne(t,i,t.index)];let y=c+1,w=1,m=new V(u,t.index,c);this[ie](o,y,e,w,m)}else{d.route!==null&&this[ge](d.route);let y=[];for(let K=1;K<h.length;K++)y.push(h[K].index);y.length>0&&this[ae](o,f,y,!0),t.index=d.index,d.route=t;let w=[new V(u,t.index,c)],m=c+1,p=1,R=new V(u,t.index,c);for(;w.length>0&&m<o.layers.length&&p<e.layers.length;m++,p++){let K=[];for(let A=0;A<o.layers[m].views.length;A++){let S=o.layers[m].views[A];S[le]&&V.include(w,S[le])&&K.unshift(A)}let x=[];for(let A of K){let S=o.layers[m].views[A],O=e.layers[p].models,_;for(let q=0;q<O.length;q++)if(S.name===O[q].name){_=O[q];break}if(!_)this[ae](o,{x:A,y:m},null,!1);else{let q=S.slots.value;if(q.length==0){let M=0;S.slots.value=[new ne(null,_,M)];let Q=m+1,X=p+1;this[ie](o,Q,e,X,R)}else{let M=q[0];if(M.model!==_){this[ae](o,{x:A,y:m},null,!0),S.slots.value=[new ne(null,_,0)];let Q=m+1,X=p+1;this[ie](o,Q,e,X,R)}else{S[z]&&M.route!==null&&this[ge](M.route);let Q=[];for(let X=1;X<q.length;X++)Q.push(q[X].index);Q.length>0&&this[ae](o,{x:A,y:m},Q,!0),x.push(new V(S,M.index,m))}}S[z]=!1}}w=x}this[ie](o,m,e,p,R)}}}if(u&&u[J]){let h=u[J];h&&(t.slot=new an(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[qr](t)}[ie](e,t,n,s,i){let o=s,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let f of n.layers[o].models){let u=new je(f.name,!1,i),c=new ne(null,f);u.slots.value=[c],l.push(u)}}for(;o<n.layers.length;o++){let l=new Pt;l.views=[];for(let f of n.layers[o].models){let u=new je(f.name,!1,i),c=new ne(null,f);u.slots.value=[c],l.views.push(u)}e.layers.push(l)}}[fr](e,t,n,s,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let u=this[W].layers[t],c=null;for(let h of u.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&s!==-1&&(d=h[J]?.index===s)):d=h.name===e,!!d){i!==null&&(h[le]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[z]?a={view:i,index:o,level:t-1}:a=i[J],l={view:i,index:o,level:t-1});let f=new je(e,!0,a);if(f[le]=l,t==this[W].layers.length){let u=new Pt;u.views=[f],this[W].layers.push(u)}else this[W].layers[t].views.push(f);return f}}const Qn="fox-router-view",Xn="fox-router-link";function Lr(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Mr(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Yn(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Zn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ei(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function ti(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function ri(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function ni(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function ii(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function si(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function oi(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function li(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function ai(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Vt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function we(r,e){r.classList.contains(e)||r.classList.add(e)}function be(r,e){r.classList.remove(e)}const ui=ye&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Bt(r){ui(r)}function D(r,e,t){!C(e)||(r==null&&(r={}),Reflect.apply(e,r,t))}function Ir(r,e,t,n=-1,s,i,o,a){if(C(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,n]),C(a)&&Reflect.apply(a,r,[])},s);return}const l=["animationend","transitionend"],f=u=>{l.forEach(c=>{Et(e,c,f)}),Reflect.apply(i,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(u=>{At(e,u,f)})}if(C(o)){const l="animationcancel",f=u=>{Reflect.apply(o,r,[e,t,n]),Et(e,l,f)};At(e,l,f)}}function Wt(r){return!ye||r===null?!1:r.opsType===E.Append||r.opsType===E.Open}function Nr(r,e,t,n={},s,i=-1){if(e||Wt(s)){const o=Lr(n,e);o&&we(t,o);const a=Mr(n,e);a&&we(t,a);const l=ri(n,e);D(r,l,[t,e,s,i])}}function Hr(r,e,t,n={},s,i,o,a){if(!Wt(i)&&!e){C(a)&&a(r,a,[t]);return}const l=Lr(n,e),f=Mr(n,e),u=Yn(n,e),c=ni(n,e),h=ii(n,e),d=si(n,e);Bt(()=>{Ir(r,t,i,o,s,()=>{f&&be(t,f),u&&be(t,u),C(h)&&D(r,h,[t,e,i,o]),C(a)&&a(r,a,[t])},()=>{C(d)&&D(r,d,[t,e,i,o])}),l&&be(t,l),u&&we(t,u),C(c)&&D(r,c,[t,e,i,o])})}function Dr(r,e,t,n={},s,i,o,a,l){if(!Wt(o)&&!e){!e&&C(i)&&i();return}const f=Zn(n,e),u=ei(n,e),c=ti(n,e),h=oi(n,e),d=li(n,e),y=ai(n,e);f&&we(t,f),u&&we(t,u),C(h)&&D(r,h,[t,e,o,a]),Bt(()=>{Ir(r,t,o,a,s,()=>{u&&be(t,u),c&&be(t,c),C(d)&&D(r,d,[t,e,o,a]),C(l)&&D(r,l,[t]),!e&&C(i)&&i()},()=>{C(y)&&D(r,y,[t,e,o,a]),C(l)&&D(r,l,[t]),!e&&C(i)&&i()}),f&&be(t,f),c&&we(t,c)})}function kt(r,e={},t,n=-1){const s=e.mode??"default",i=Vt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Nr(r,!1,a,e,t,n)},enter:a=>{Hr(r,!1,a,e,i.enter,t,n)},leave:(a,l)=>{Dr(r,!1,a,e,i.leave,l,t,n)},clone:a=>kt(r,e,t,n)}}function Ur(r){return r.el}function fi(r,e,t={},n,s,i,o){if(i){const a=Ur(e);if(a==null)return;const l=Vt(t);Nr(r,!0,a,t,n,s),Hr(r,!0,a,t,l.show,n,s,f=>{C(o)&&D(r,o,[f])})}else C(o)&&D(r,o,[])}function ci(r,e,t={},n,s,i,o){if(i){const a=Ur(e);if(a==null)return;const l=Vt(t);Dr(r,!0,a,t,l.hide,null,n,s,f=>{C(o)&&D(r,o,[f])})}else C(o)&&D(r,o,[])}function hi(r,e={}){Bt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function se(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function zt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class di{node;state;constructor(e,t){this.node=e,this.state=t}}const Jt=v.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=v.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,s=v.inject(ze,null),i=v.inject(Rt,0),o=v.inject(vr,null),a=v.inject(xt,-1);let l=null;const f=r.modelSlot;if(f){v.provide(Rt,i+1),v.provide(xt,f.index),v.provide(St,f.index);const c=f.route;if(!c){console.warn("child view render error, route not exist");return}const h=We(t.proxy,!0);gn(h),bt(h,c)}else{if(s==null){console.error("router is not been injected");return}const c=r.name,h=v.inject(wr,null),d=v.inject(St,0);if(l=s[fr](c,i,o,a,h,d),l===null)return;if(v.provide(wr,l),l[z]===!0&&v.provide(vr,l),!n){v.provide(xt,-1),v.provide(Rt,i+1),v.provide(St,-1);const w=l.slots.value;if(w.length>0){const m=w[0].route;if(m){const p=We(t.proxy,!0);bt(p,m)}}else{const m=We(t.proxy,!0);l.compensation=()=>{const p=l.slots.value;if(p.length>0){const R=p[0].route;return R&&bt(m,R),!0}return!1}}}}const u={value:new Map};return v.onUnmounted(()=>{u.value&&u.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,y=[];for(let p=0;p<d.length;p++){const R=d[p],K=`${r.name}-${R.index}`,x=se(r.transition,R.route,p)??!0,A={modelSlot:R};let S;e.slots.default?S=v.h(Jt,A,{default:e.slots.default}):S=v.h(Jt,A);const O={},_=se(r.viewClass,R.route,p);typeof _=="string"&&_.length>0&&(O[_]=!0);const q=se(r.viewActiveClass,R.route,p),M=se(r.viewInactiveClass,R.route,p),Q=u.value.get(K);if(typeof q=="string"&&q.length>0&&(O[q]=R.active),typeof M=="string"&&M.length>0&&(O[M]=!R.active),Q&&R.active!==Q.state){const xe=Q.node;R.active?y.unshift(()=>{const tr=()=>{let Ne=yr(xe);Ne!=null&&mr(Ne,vt.ACTIVATED)};fi(t,xe,r,R.route,p,x,tr)}):y.push(()=>{const tr=()=>{const Ne=yr(xe);Ne!=null&&mr(Ne,vt.DEACTIVATED)};ci(t,xe,r,R.route,p,x,tr)})}const X={class:O,key:K},Zt=se(r.viewTagProps,R.route,p);Zt!==null&&typeof Zt=="object"&&F(!0,X,Zt),R.route?.viewTagAttrs&&typeof R.route?.viewTagAttrs=="object"&&F(!0,X,R.route.viewTagAttrs);const Ai=se(r.viewTag,R.route,p),er=v.h(Ai,X,{default:()=>[S]});if(c.set(K,new di(er,R.active)),u.value.delete(K),x){const xe=kt(t,r,R.route,p);er.transition=xe}h.push(er)}u.value.forEach(p=>{p.node.transition=null}),u.value=c,hi(y,t);const w=se(r.tag,null,-1),m={};return Object.assign(m,e.attrs),v.h(w,m,{default:()=>h})}else if(f!=null){const c=f.model,h={};c.props&&(typeof c.props=="object"?F(!1,h,c.props):c.props===!0&&typeof f.route?.params=="object"&&F(!1,h,f.route?.params));const d=v.h(c.component,h);return zt(e.slots.default,{Component:d,route:f.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.model,y={};d.props&&(typeof d.props=="object"?F(!1,y,d.props):d.props===!0&&typeof h.route?.params=="object"&&F(!1,y,h.route?.params));const w=v.h(d.component,y);if(se(r.transition,h.route,-1)??!0){const p=kt(t,r,h.route,-1);w.transition=p}return zt(e.slots.default,{Component:w,route:h.route})??w}else return zt(e.slots.fallback,{})}}}});function yi(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function mi(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function pi(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function Re(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let gi=v.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=v.inject(ze,null);return()=>{let n=Re(r.to,null),s=Re(r.tag,n);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[I](n),r.root&&(i.root=r.root),o=t.current);let a={},l=Re(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=pi(i,o)),Re(r.exact,i)===!0){let h=Re(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=mi(i,o))}let u={class:a};(s==="a"||s==="A")&&(u.href=i?.path??i?.name??"#"),F(!0,u,e.attrs);let c=Re(r.event,i);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}yi(d)&&t.to(i)};u[c]=h}return v.h(s,u,e.slots)}}}),vi={get each(){return tn},get type(){return Pe},get isFunction(){return C},get isArray(){return rr},get isArrayLike(){return ut},get makeArray(){return en},get merge(){return sr},get isWindow(){return ir},get isPlainObject(){return De},get isEqual(){return Ue}};const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function wi(r={}){const e=new Gn(r),t=new ht,n=new mt,s={...vi,get router(){return e},get bus(){return t},get Bus(){return ht},get eventproxy(){return n},get EventProxy(){return mt},get EventChain(){return Fe},get require(){return e.require},get request(){return pt},get extend(){return F},get clone(){return Se},install(i){i.provide(ze,e),i.provide(Gt,s),i.provide(Qt,t),i.provide(Xt,n),i.component(Qn,Jt),i.component(Xn,gi),Reflect.defineProperty(i.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(i.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$eventProxy",{get(){return n}}),i.config.globalProperties.$fox_on=function(o,a,l=!1){n.on(o,a,l)},i.config.globalProperties.$fox_off=function(o,a){n.off(o,a)},i.config.globalProperties.$fox_once=function(o,a){n.once(o,a)},i.config.globalProperties.$fox_all=function(...o){let a=n;Reflect.apply(a.all,a,o)},i.config.globalProperties.$fox_trigger=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.config.globalProperties.$fox_emit=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.mixin({computed:{$route(){return gr(this)}}}),e.init()}};return s}function Yt(r){return r?r.$router:v.inject(ze)}function bi(r){return r||(r=v.getCurrentInstance()?.proxy??void 0),r?gr(r):null}function Ri(r){return r?r.$fox:v.inject(Gt)}function xi(r){return r?r.$bus:v.inject(Qt)}function Si(r){return r?r.$eventProxy:v.inject(Xt)}function Ci(r){const e=Yt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.beforeEach(t),v.onUnmounted(()=>{e.removeBeforeEach(t)})}function Pi(r){const e=Yt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.afterEach(t),v.onUnmounted(()=>{e.removeAfterEach(t)})}const Fi="";g.Bus=ht,g.EventChain=Fe,g.EventProxy=mt,g.Route=$,g.cancelRequest=mn,g.clone=Se,g.createFox=wi,g.createMemoryHistory=Fr,g.createWebHashHistory=Er,g.createWebHistory=Wn,g.extend=F,g.foxBusKey=Qt,g.foxEventProxyKey=Xt,g.foxKey=Gt,g.isArray=rr,g.isDate=Wr,g.isESModule=ot,g.isEqual=Ue,g.isFunction=C,g.isMap=Vr,g.isObject=nr,g.isPlainObject=De,g.isPromise=Jr,g.isSet=Br,g.isString=kr,g.isSymbol=zr,g.onAfterRouteUpdate=Pi,g.onBeforeRouteUpdate=Ci,g.onFoxActivated=Rn,g.onFoxDeactivated=xn,g.request=pt,g.sessionKey=re,g.toBoolean=at,g.toNumber=Yr,g.toTypeString=He,g.typeOf=Pe,g.useBus=xi,g.useEventProxy=Si,g.useFox=Ri,g.useRoute=bi,g.useRouter=Yt,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
2
+ * fox v3.0.0 Mon Dec 26 2022 11:30:33 GMT+0800 (中国标准时间)
3
+ */const rr=Array.isArray,Vr=r=>He(r)==="[object Map]",Br=r=>He(r)==="[object Set]",Wr=r=>r instanceof Date,C=r=>typeof r=="function",kr=r=>typeof r=="string",zr=r=>typeof r=="symbol",nr=r=>r!==null&&typeof r=="object",Jr=r=>nr(r)&&C(r.then)&&C(r.catch),Gr=Object.prototype.toString,He=r=>Gr.call(r),De=r=>He(r)==="[object Object]",Qr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function ot(r){return r.__esModule||Qr&&r[Symbol.toStringTag]==="Module"}const Xr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function F(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,s=!1;for(typeof e=="boolean"&&(s=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let i=r[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let f;Array.isArray(l)?f=a&&Array.isArray(a)?a:[]:f=a&&typeof a=="object"?a:{},e[o]=F(s,f,l)}else l!==void 0&&(e[o]=l)}}return e}function Se(r,e,t=!1){if(!t)F(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let s in e){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!De(o))continue;i=Se(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}const n=Object.getOwnPropertySymbols(e);for(let s of n){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!De(o))continue;i=Se(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}}return r}class te{static seed=new Date().getTime();static get(){let e=++te.seed;return e>=Number.MAX_VALUE&&(te.seed=0),e}}const lt=Xr?Promise.resolve():null;function Ce(r,...e){lt!==null?e&&e.length>0?lt.then(()=>{r(e)}):lt.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function at(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":Boolean(r)}function Yr(r){return typeof r=="number"?r:Number(r)}const Zr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function Pe(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Zr[t]||"object"}function ir(r){return r&&typeof r=="object"&&"setInterval"in r}function ut(r){let e=!!r&&"length"in r&&r.length,t=Pe(r);return t==="function"||ir(r)?!1:t==="array"||e===0||typeof e=="number"&&e>0&&e-1 in r}function sr(r,e){let t=+e.length,n=0,s=r.length;for(;n<t;n++)r[s++]=e[n];return r.length=s,r}function en(r,e=[]){let t=e;return r!=null&&(ut(Object(r))?sr(t,typeof r=="string"?[r]:r):t.push(r)),t}function tn(r,e,t){if(ut(r))Reflect.apply([].forEach,r,[e]);else for(let n in r)if(t&&r.hasOwnProperty(n)){if(Reflect.apply(e,r,[r[n]])===!1)break}else if(Reflect.apply(e,r,[r[n]])===!1)break;return r}function Ue(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Pe(r),n=Pe(e);if(t!==n)return!1;if(t==="object"){let s=Object.keys(r),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=r[a],f=e[a];if(!Ue(l,f))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++){let i=r[s],o=e[s];if(!Ue(i,o))return!1}return!0}return!1}const or=Symbol("idKey"),oe=Symbol("valueKey"),P=Symbol("childrenKey"),k=Symbol("growKey");class lr{[k]=!0;[or];[oe]=v.ref();[P]=new Map;constructor(e){this[or]=e}}class rn{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[k];let n=e[P].get(t);if(n)return Ae(n);if(e[k])return n=ct(t),n[k]=e[k],e[P].set(t,n),Ae(n)}set(e,t,n){return t=="value"?(e[oe].value=n,!0):t==="grow"?(e[k]=at(n),!0):n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}const ft="__proxy__";function ct(r){let e=new lr(r);return Reflect.set(e,ft,new Proxy(e,new rn)),e}function Ae(r){return Reflect.get(r,ft)}class ar extends lr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("\u53C2\u6570\u81F3\u5C11\u5305\u62EC\u4E00\u4E2A(key, value)"),!1;let n=this;for(let s=0;s<t-1;s++){let i=e[s],o;n[P].has(i)?o=n[P].get(i):(o=ct(i),n[P].set(i,o)),n=o}return n[oe].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let s=0;s<t;s++){let i=e[s];if(n[P].has(i))n=n[P].get(i);else return}return n[oe].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[P].has(o))n=n[P].get(o);else return!1}let s=e[t-1];return n[P].has(s)?(n[P].delete(s),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[P].has(o))n=n[P].get(o);else return!1}let s=e[t-1];return n[P].has(s)}clear(){this[P].clear()}}const nn=["put","get","contains","remove","clear"];function ur(r){return nn.includes(r)}class sn{get(e,t){if(t=="value")return e[oe].value;if(t==="grow")return e[k];if(t===P)return e[P];if(typeof t=="string"&&ur(t))return e[t];let n=String(t),s=e[P].get(n);if(s)return Ae(s);if(e[k])return s=ct(n),s[k]=e[k],e[P].set(n,s),Ae(s)}set(e,t,n){return t=="value"?(e[oe].value=n,!0):t==="grow"?(e[k]=at(n),!0):ur(t)?!1:n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}function on(){let r=new ar,e=new sn,t=new Proxy(r,e);return Object.assign({put(...s){return Reflect.apply(r.put,r,s)},get(...s){return Reflect.apply(r.get,r,s)},remove(...s){return Reflect.apply(r.remove,r,s)},contains(...s){return Reflect.apply(r.contains,r,s)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,ft,t),r}let ht=new Proxy(ar,{construct(r,...e){let t=on();return Ae(t)}});const Y="default",fr=Symbol("sync"),I=Symbol("resolveRoute");function cr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function ln(r){let e=r.src;return new Promise((t,n)=>{const s=cr(a=>{ot(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=cr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(s,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(s,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(s,i)}})}class an{name;level;rootName;rootIndex=0;constructor(e,t,n,s){this.name=e,this.level=t,this.rootName=n,this.rootIndex=s}}class Ve{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ve(e.to,e.from),n=e.data??{};return F(!0,t.data,n),t}}class ${path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new $;return Se(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new $;if(e==null)return t;let n=t;for(let i in e){let o=e[i];n[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)n[i]=e[i];return t}}class un{id;name;props;meta;src;component;constructor(e,t,n,s){this.id=te.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return ln(this)}}class hr{models=[]}class dt{path;match;redirect;name;layers=[]}const U=Symbol("chainKey"),N=Symbol("cursorKey"),yt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),Be=Symbol("exArgsKey"),fe=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),re=Symbol("sessionKey"),ee=Symbol("_go");class Fe{[U]=[];[N]=0;[yt]=!1;[T]="Free";[Z]=[];[Be]=[];[fe]=[];[Ee]=[];[re];get session(){return this[re]}constructor(e,t=!1){this[re]=e,this[yt]=t}[ee](e,...t){let n=this[T];if(this[T]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,n==="Exception"||n==="Reject"){let a=[{session:this[re]},...this[Be]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Ce(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=n,this[U]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[U].length){let a=[{session:this[re]},...this[Z]];for(;this[fe].length>0;){let l=this[fe].shift();typeof l=="function"&&Ce(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[N]>=this[U].length)return this[T]="Free",this;let s=this[U][this[N]];this[yt]||(this[U].splice(0,this[N]+1),this[N]=-1);let i=this[N]+1;try{let o=!1,a={go:(l,...f)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...f]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[ee],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[U].splice(i,0,l),i++)},session:this[re]};Ce(()=>{Reflect.apply(s,{},[a,...this[Z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[ee],this,[e,...t])}finish(...e){return this[T]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[T]="Reject",this[Be]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[Be]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[U]=[],this[N]=0;let n=[{session:this[re]},...this[Z]];for(;this[fe].length>0;){let s=this[fe].shift();Ce(()=>{Reflect.apply(s,this,n)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[U]=[...this[U],...e]:this[U].push(e),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[fe].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[T]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[N]>=this[U].length}}const ce=Symbol("registerKey");class fn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class mt{[ce]=new Map;constructor(){}on(e,t,n=!1){let s=this[ce].get(e);s||(s=new Array,this[ce].set(e,s));let i=n===!0?1:0,o=new fn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ce].delete(e),this;let n=this[ce].get(e);if(n){for(let s=0;s<n.length;s++)if(n[s].callback===t){n.splice(s,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(n,{},i)});return this}emit(e,...t){let n=this[ce].get(e);if(!n)return this;for(let s=0;s<n.length;){let i=n[s];if(i.policy==1?n.splice(s,1):s++,typeof i.callback=="function")try{Ce(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const cn=new te;function hn(r,e="text"){e=e.trim().toLowerCase();let t="";if(e.indexOf("application/x-www-form-urlencoded")===0)if(typeof r=="object")for(let n in r){let s=r[n];if(Array.isArray(s))for(let i=0;i<s.length;i++){let o=`${encodeURIComponent(n)}=${encodeURIComponent(s[i])}`;t.length>0&&(t+="&"),t+=o}else{let i=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`;t.length>0&&(t+="&"),t+=i}}else t=r;else e.indexOf("text")===0?typeof r=="object"?t=JSON.stringify(r):t=r:e.indexOf("application/json")===0&&typeof r=="object"?t=JSON.stringify(r):t=r;return t}function dn(r,e,t="text"){if(e==null)return r;t=t.trim().toLowerCase();let n="";if(t.indexOf("application/x-www-form-urlencoded")===0||t.indexOf("application/json")===0)if(typeof e=="object")for(let s in e){let i=e[s];if(Array.isArray(i))for(let o=0;o<i.length;o++){let a=`${encodeURIComponent(s)}=${encodeURIComponent(i[o])}`;n.length>0&&(n+="&"),n+=a}else{let o=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`;n.length>0&&(n+="&"),n+=o}}else n=e;else n=e;return n.length>0&&(r.indexOf("?")===-1?r=`${r}?${n}`:r=`${r}&${n}`),r}const yn={method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",keepalive:!0},he=new Map;async function pt(r){let{id:e,method:t="POST",url:n,headers:s={},data:i,processData:o=!0,timeout:a=-1}=r;if(e&&he.has(e))throw new Error("resubmit");t=t.toUpperCase();const l={...yn};l.headers=l.headers??{},Object.assign(l.headers,s);const f=l.headers["Content-Type"];if(Object.assign(l,{method:t}),t==="GET"?n=dn(n,i,f):(o&&(i=hn(i,f)),l.body=i),e||a>0){e||(e=`fox_fetch_${cn.get()}`);const u=new AbortController;l.signal=u.signal;let c={timer:null,controller:u};if(a>0){const h=setTimeout(()=>{c.timer&&c.controller.abort()},a);c.timer=h}he.set(e,c)}try{let u=await fetch(n,l),c={};u.headers.forEach((y,w)=>{c[w]=y});let h,d=c["content-type"]??"";return d.indexOf("application/json")!==-1?h=await u.json():d.indexOf("text")!=-1?h=await u.text():h=await u.blob(),{ok:u.ok,status:`${u.status}`,statusText:u.statusText,headers:c,data:h,response:u}}catch(u){throw u}finally{if(e){let u=he.get(e);u&&(u.timer&&(clearTimeout(u.timer),u.timer=null),he.delete(e))}}}function mn(r){let e=he.get(r);return e?(e.timer&&(clearTimeout(e.timer),e.timer=null),e.controller.abort(),he.delete(r),!0):!1}const Te=Symbol("registerKey");class pn{[Te]=new Map;constructor(){}set(e,t){this[Te].set(e,t)}get(e){return this[Te].get(e)}has(e){return this[Te].has(e)}delete(e){return this[Te].delete(e)}}const gt=Symbol("lc");function We(r,e=!1){let t=r,n=t[gt];if(!n)if(e)n=new pn,t[gt]=n;else return null;return n}function dr(r,e){let t=r;for(;t!==null;){const n=t[gt];if(n&&n.has(e))return n.get(e);t=t.$parent}return null}function yr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return We(e.component.proxy,!1)}return null}const ke=Symbol("hooksKey");function gn(r){let e=r.get(ke);e||(e=[],r.set(ke,e))}function mr(r,e){let t=r.get(ke);if(t!=null)for(let n=t.length-1;n>=0;n--){let s=t[n];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var vt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(vt||{});class vn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function wn(r,e,t,n){let s=new vn(e,t,n);return r.push(s),!0}function bn(r,e,t,n){let s=-1;for(let i=0;i<r.length;i++){let o=r[i];if(o.type===e&&o.hook===t&&o.target===n){s=i;break}}return s!=-1?(r.splice(s,1),!0):!1}function pr(r){return(e,t)=>{let n;if(t)n=t;else{let i=v.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}n=i.proxy}let s=dr(n,ke);if(s==null){console.warn("can not get hooks context");return}v.onUnmounted(()=>{bn(s,r,e,n)}),wn(s,r,e,n)}}let Rn=pr("a"),xn=pr("da");function Sn(){let r=new $;return r.path="",r.name="",r.params={},r.index=-1,v.shallowReactive(r)}const wt=Symbol("routeKey");function bt(r,e){let t=r.get(wt);if(t){let n={path:"",name:"",params:{},index:-1,session:{}};Object.assign(n,e),Object.assign(t,n)}else t=Sn(),Object.assign(t,e),r.set(wt,t)}function gr(r){let e=dr(r,wt);return e??null}const ze=Symbol("rk"),Rt=Symbol("vd"),vr=Symbol("rv"),xt=Symbol("rvi"),wr=Symbol("pv"),St=Symbol("pvi");function Cn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var s="",i=t+1;i<r.length;){var o=r.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=r[i++];continue}break}if(!s)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:s}),t=i;continue}if(n==="("){var a=1,l="",i=t+1;if(r[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<r.length;){if(r[i]==="\\"){l+=r[i++]+r[i++];continue}if(r[i]===")"){if(a--,a===0){i++;break}}else if(r[i]==="("&&(a++,r[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=r[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function br(r,e){e===void 0&&(e={});for(var t=Cn(r),n=e.prefixes,s=n===void 0?"./":n,i="[^".concat(de(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,f="",u=function(S){if(l<t.length&&t[l].type===S)return t[l++].value},c=function(S){var O=u(S);if(O!==void 0)return O;var _=t[l],q=_.type,M=_.index;throw new TypeError("Unexpected ".concat(q," at ").concat(M,", expected ").concat(S))},h=function(){for(var S="",O;O=u("CHAR")||u("ESCAPED_CHAR");)S+=O;return S};l<t.length;){var d=u("CHAR"),y=u("NAME"),w=u("PATTERN");if(y||w){var m=d||"";s.indexOf(m)===-1&&(f+=m,m=""),f&&(o.push(f),f=""),o.push({name:y||a++,prefix:m,suffix:"",pattern:w||i,modifier:u("MODIFIER")||""});continue}var p=d||u("ESCAPED_CHAR");if(p){f+=p;continue}f&&(o.push(f),f="");var R=u("OPEN");if(R){var m=h(),K=u("NAME")||"",x=u("PATTERN")||"",A=h();c("CLOSE"),o.push({name:K||(x?a++:""),pattern:K&&!x?i:x,prefix:m,suffix:A,modifier:u("MODIFIER")||""});continue}c("END")}return o}function Pn(r,e){return An(br(r,e),e)}function An(r,e){e===void 0&&(e={});var t=Ct(e),n=e.encode,s=n===void 0?function(l){return l}:n,i=e.validate,o=i===void 0?!0:i,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var f="",u=0;u<r.length;u++){var c=r[u];if(typeof c=="string"){f+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",y=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!y)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var w=0;w<h.length;w++){var m=s(h[w],c);if(o&&!a[u].test(m))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));f+=c.prefix+m+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var m=s(String(h),c);if(o&&!a[u].test(m))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));f+=c.prefix+m+c.suffix;continue}if(!d){var p=y?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(p))}}return f}}function En(r,e){var t=[],n=Rr(r,t,e);return Fn(n,t,e)}function Fn(r,e,t){t===void 0&&(t={});var n=t.decode,s=n===void 0?function(i){return i}:n;return function(i){var o=r.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,f=Object.create(null),u=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?f[d.name]=o[h].split(d.prefix+d.suffix).map(function(y){return s(y,d)}):f[d.name]=s(o[h],d)},c=1;c<o.length;c++)u(c);return{path:a,index:l,params:f}}}function de(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ct(r){return r&&r.sensitive?"":"i"}function Tn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=t.exec(r.source);s;)e.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(r.source);return r}function jn(r,e,t){var n=r.map(function(s){return Rr(s,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Ct(t))}function Kn(r,e,t){return _n(br(r,t),e,t)}function _n(r,e,t){t===void 0&&(t={});for(var n=t.strict,s=n===void 0?!1:n,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,f=t.encode,u=f===void 0?function(M){return M}:f,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,y=d===void 0?"":d,w="[".concat(de(y),"]|$"),m="[".concat(de(h),"]"),p=o?"^":"",R=0,K=r;R<K.length;R++){var x=K[R];if(typeof x=="string")p+=de(u(x));else{var A=de(u(x.prefix)),S=de(u(x.suffix));if(x.pattern)if(e&&e.push(x),A||S)if(x.modifier==="+"||x.modifier==="*"){var O=x.modifier==="*"?"?":"";p+="(?:".concat(A,"((?:").concat(x.pattern,")(?:").concat(S).concat(A,"(?:").concat(x.pattern,"))*)").concat(S,")").concat(O)}else p+="(?:".concat(A,"(").concat(x.pattern,")").concat(S,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?p+="((?:".concat(x.pattern,")").concat(x.modifier,")"):p+="(".concat(x.pattern,")").concat(x.modifier);else p+="(?:".concat(A).concat(S,")").concat(x.modifier)}}if(l)s||(p+="".concat(m,"?")),p+=t.endsWith?"(?=".concat(w,")"):"$";else{var _=r[r.length-1],q=typeof _=="string"?m.indexOf(_[_.length-1])>-1:_===void 0;s||(p+="(?:".concat(m,"(?=").concat(w,"))?")),q||(p+="(?=".concat(m,"|").concat(w,")"))}return new RegExp(p,Ct(t))}function Rr(r,e,t){return r instanceof RegExp?Tn(r,e):Array.isArray(r)?jn(r,e,t):Kn(r,e,t)}var E=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(E||{}),Je=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Je||{});const z=Symbol("rootKey"),J=Symbol("rootNodeKey"),le=Symbol("parentNodeKey"),Ge=Symbol("nameKey");class ne{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,s=!0){this.route=e,this.model=t,this.index=n,this.active=s}}class je{scope=null;set compensation(e){this.scope!==null&&this.scope.stop(),this.scope=v.effectScope(),this.scope.run(()=>{v.watch(this.slots,()=>{let t=!1;try{t=e()}catch(n){console.error(n)}t&&this.scope!==null&&(this.scope.stop(),this.scope=null)})})}_slots;get slots(){return this._slots==null&&(this._slots=v.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ge];[z];[J]=null;[le]=null;get name(){return this[Ge]}constructor(e,t,n){this[Ge]=e,this[z]=t,n&&(this[J]=n)}}class V{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let s=e[n];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class Pt{views=[]}class qn{layers=[]}class $n{time;route}class On{forbidTime=300;submitRecorder=new $n;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const ye=typeof window<"u",H=function(){return window},Ke=function(){return window.document};function Ln(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function Mn(){if(!ye)return"/";let r=H().location,e=`${r.protocol}//${r.host}`;return e+=Ln(r.pathname),e}function At(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Et(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}let Ft=Mn();class In{cache=new Map;constructor(){}async get(e,t=-1){if(this.cache.has(e))return this.cache.get(e);let n=await pt({url:e,method:"GET",timeout:t,heaaders:{"content-type":"text/plain"}});if(n.ok)return this.cache.set(e,n.data),n.data;throw Error(n.statusText)}remove(e){this.cache.delete(e)}}var G=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(G||{});class Nn{exports;status;id;src}class Hn{register=new Map;constructor(){}get(e){return this.register.get(e)}put(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t}contains(e){return this.register.has(e)}clear(){this.register.clear()}}class Dn{head;isOldWebKit;moduleManager=new Hn;resource=new In;options;_query;set query(e){this._query=e}get query(){return this._query}constructor(e={}){const t=Ke();this.head=t.head||t.getElementsByTagName("head")[0]||t.documentElement,this.isOldWebKit=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/(\d+).*/,"$1")<536,this.options=e,this.options.paths||(this.options.paths={}),this.options.alias||(this.options.alias={})}ensure(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let f=e[l];for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}else{let f=e[l].split(",");for(let u=0;u<f.length;u++)f[u]!==void 0&&t.push(this.resolvePath(f[u]))}let o=new Un(t.length,(l,f)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},f)}catch(u){console.error(u.message,u)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(u){console.error(u.message,u)}}),a=new Fe;for(let l=0;l<t.length;l++){let f=new Vn(l,t[l],s,o);this.mount(a,f)}return this}remove(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]!==void 0&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){const n=Ke();if(this.isNaturePath(t.src,"js")){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src,"css")){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else if(this.isNaturePath(t.src,"html")){let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}let s=this.getFileNamePostfix(t.src);if(s==="js"||s.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(s==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}else{let i=t.params.htmlPoint;i||(i=n.body),this.mountHTML(e,t,i);return}}mountHTML(e,t,n){e.post(s=>{let i=t.params.timeout??this.options.timeout??3e4,o=t.src;this.resource.get(o,i).then(a=>{n.innerHTML=a,t.progress.work(!0,t.index,a),s.resolve()},a=>{console.error(a),t.progress.work(!1,t.index,null),s.reject()})})}mountCSS(e,t,n){e.post(s=>{const i=Ke(),o=t.src,a=i.createElement("link"),l="onload"in a;if(this.isOldWebKit||!l){const u={timeout:this.options.time||3e3,time:0,isOldWebKit:this.isOldWebKit,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{n.removeChild(a)}catch(c){console.error(c.message,c)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{xr(a,u)},1)}else a.onload=()=>{a.onload=a.onerror=null,t.progress.work(!0,t.index,t.src),s.resolve()},a.onerror=()=>{try{n.removeChild(a)}catch(u){console.error(u.message,u)}a.onload=a.onerror=null,t.progress.work(!1,t.index,null),s.reject()};let f=i.getElementById(o);f&&f.parentNode&&f.parentNode.removeChild(f),a.rel="stylesheet",a.type="text/css",a.id=o,a.href=o,n.appendChild(a)})}mountJS(e,t,n){e.post(s=>{let i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==G.Defined||o.status==G.Loaded)){if(o.exports){t.progress.work(!0,t.index,o.exports),s.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),s.resolve();return}}o=new Nn,o.id=i,o.src=i,o.status=G.Loading,this.moduleManager.put(i,o);const l=Ke().createElement("script");if("onload"in l)l.onload=()=>{l.onload=l.onerror=null,o.status==G.Loading&&(o.status=G.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{let c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==G.Loading&&(o.status=G.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;let u=H();u.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Ke(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=n.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=n.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}else{this.resource.remove(e);let i=t.htmlPoint;i||(i=n.body),i.innerHTML="";return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){let s=e[n].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){let n=this,s=function(...i){e.status=G.Defining;let o,a,l,f=i.length;f===1?(l=i[0],o=void 0):f===2?(l=i[1],Array.isArray(i[0])?(a=n.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=n.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...u)=>{typeof l=="function"?e.exports=Reflect.apply(l,e,u):e.exports=l,e.status=G.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=G.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(this.isNaturePath(e,"all"))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&t!=="html"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let s=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e,t){if(this.options.nature==null)return!1;if(t==="all"||t==="js"){let n=this.options.nature.js;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="css"){let n=this.options.nature.css;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}if(t==="all"||t==="html"){let n=this.options.nature.html;if(n!==void 0)for(let s=0;s<n.length;s++){let i=n[s];if(e.indexOf(i)===0)return!0}}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return Ft+e.slice(1);if(e.indexOf("./")==0)return Ft+e.slice(2);if(t){let s=this.options.alias[e];if(!s){let i=e.indexOf("/");if(i==-1)s=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?s=a+e.slice(i):s=e}}return this.parserPath(s,!1)}return Ft+e}}function xr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.time>e.timeout?e.error():xr(r,e)},20)}class Un{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}}isOK(){return this.status}}class Vn{index;src;params;progress;constructor(e,t,n,s){this.index=e,this.src=t,this.params=n,this.progress=s}}const me=Symbol("_notifyChange");class Bn{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Qe=Symbol("ignoreHistoryChangeOnceKey"),Sr=Symbol("_navigateFirstRoute"),Xe=Symbol("_getRouteMark"),Cr=Symbol("_getUrlSearch"),Tt=Symbol("_generateLocation"),_e=Symbol("_setRouteMarkRecorder"),Pr="Symbol(_fox_restore_point)";function jt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[Qe]=!1;constructor(e="hash",t="",n="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??H().sessionStorage}init(e=!0){const t=H();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[Qe]){this[Qe]=!1;return}if(jt(this.historyMonitor)){const n=t.history.state;this[me](n);try{let s=[];if(typeof n=="string"?s=JSON.parse(n):s=n,Array.isArray(s)&&s.length>0){const i=this[Xe]()??"/";this[_e](i,s)}}catch{}}}),At(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Sr](),Promise.resolve()}destroy(){if(this.historyChange){const e=H();Et(e,"popstate",this.historyChange)}}[Sr](){let e=this[Xe]()??"/";const t=this.storage.getItem(Pr);if(t)try{const o=JSON.parse(t);if(o.mark===e){this[me](o.routes);return}}catch{}const n=e.indexOf("!");let s;n!=-1?s=e.substring(n+1):s=e;const i=new $;i.path=s,i.query=this[Cr](),this[me]([i])}[_e](e,t){try{const n={mark:e,routes:t},s=JSON.stringify(n);this.storage.setItem(Pr,s)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Xe]()??"/";this[_e](t,e)}[me](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Xe](){const e=H();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[Cr](){return H().location.search}listen(e){this.changeHandler=e}go(e,t=!0){const n=H();this[Qe]=!t,n.history.go(e)}push(e){let t=this[Tt](e.currentRoute);jt(this.traceless,e.currentRoute)||H().history.pushState(e.routes,"",t),this[_e](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[Tt](e.currentRoute);jt(this.traceless,e.currentRoute)||H().history.replaceState(e.routes,"",t),this[_e](e.currentRoute.fullPath,e.routes)}[Tt](e){const t=H();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l in e.query){let f=encodeURIComponent(e.query[l]),u=`${encodeURIComponent(l)}=${f}`;a.length>0&&(a+="&"),a+=u}else a=e.query;this.query?(n=`${this.query}&${a}`,n.charAt(0)!=="?"&&(n=`?${n}`)):n=`?${a}`}const s=t.location;let i=e.fullPath;i.startsWith(Y)&&(i=i.substring(Y.length+1));let o;return n?this.mode=="path"?o=`${this.base}/${i}${n}`:o=`${s.pathname}${n}#${i}`:this.mode=="path"?o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Wn(r=!0,e=null,t="",n=!0,s=!1,i){return e!==null&&(e=H().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,r,n,s,i)}function Er(r=!0,e="",t=!0,n=!1,s){return new Ar("hash","",e,r,t,n,s)}class kn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}listen(e){this.changeHandler=e}[me](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const s=this.queue[n];this[me](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Fr(r="",e=50){return new kn(r,e)}function Ei(r){}const Ye=Symbol("_constructRouteModel"),Ze=Symbol("_findRouteModel"),Kt=Symbol("_findRootView"),Tr=Symbol("_getFirstView"),ae=Symbol("_removeView"),jr=Symbol("_buildPage"),Kr=Symbol("_resolveComponent"),_r=Symbol("_update"),ie=Symbol("_merge"),_t=Symbol("_handleHistoryChange"),et=Symbol("_handleRouteUpdated"),tt=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),pe=Symbol("current"),qr=Symbol("_addRouteRecorder"),ge=Symbol("_removeRouteRecorder"),qt=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),rt=Symbol("errorCallback"),B=Symbol("registerKey"),nt=Symbol("notFoundKey"),$t=Symbol("notFoundPathKey"),W=Symbol("forestKey"),j=Symbol("historyKey"),qe=Symbol("beforeFiltersKey"),$e=Symbol("afterFiltersKey"),Oe=Symbol("destroyFiltersKey"),ve=Symbol("mainDispatcherKey"),Ot=Symbol("initKey"),it=Symbol("requireKey"),ue=Symbol("readyKey"),Lt=Symbol("readyHandlersKey"),st=Symbol("_markReady"),$r=Symbol("_createNextFn"),Mt=Symbol("_start"),It=Symbol("_before"),Nt=Symbol("_after"),Or=Symbol("_destroy"),Ht=Symbol("_load"),Le=Symbol("_unload"),Dt=Symbol("_loadDependency"),Ut=Symbol("resolvedModulesKey"),Me=Symbol("resolveDependencyKey"),Ie=Symbol("routerGuardKey");function zn(r){return r.layers.length==0||r.layers[0].views.length==0}function Jn(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let s=F(!0,{},n.meta);e.push(s)}else n.meta&&e.push(n.meta)})}),e}class Gn{[B]=new Array;[nt];[$t]="*";[ue]=!1;[Lt]=[];[W]=new qn;[j];[b]=new Array;[rt]=null;[tt]=null;[qe]=new Array;[$e]=new Array;[Oe]=new Array;[ve]=new Fe;[Ut]=new Map;[Me]=null;[Ie]=new On;[Ot]=!1;[pe]=v.ref(null);[it]=null;get require(){return ye?(this[it]||(this[it]=new Dn),this[it]):null}get current(){return this[pe].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[j]=e.history:this[j]=ye?Er():Fr(),this[j]?.listen(async n=>{let s=!0;try{if(typeof n=="string"){let i=this[I](n);i&&await this[_t]([i])}else await this[_t](n)}catch(i){console.error(i.message,i),s=!1}this[ue]===!1&&this[st](s)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[rt]=="function")try{this[rt](e,t)}catch{}console.error(e)}init(){this[Ot]!==!0&&(this[j]?.init(!this[ue]),this[Ot]=!0)}isReady(){return this[ue]?Promise.resolve():new Promise((e,t)=>{this[Lt].push([e,t])})}[st](e){this[ue]=!0,this[Lt].forEach(([t,n])=>{try{e?t():n()}catch(s){console.error(s.message,s)}})}[_t](e){try{if(!e){let o=[...this[b]].reverse();return this[Le](o),ye&&H().location.reload(),Promise.resolve()}let t=null,n=[],s=[],i=0;for(;i<e.length&&i<this[b].length&&$.isSame(e[i],this[b][i]);i++)e[i].opsType===E.Open&&e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(n=e.slice(i)),i<this[b].length&&(s=this[b].slice(i).reverse()),s.length==0&&n.length==0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Le](s)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[L](t)}return Promise.resolve()}[et](e){if(e)this[pe].value=e;else{let t=this[b].length;t>0?this[pe].value=this[b][t-1]:this[pe].value=null}if(typeof this[tt]=="function")try{this[tt](this[pe].value)}catch{}}[qr](e,t=-1){t<0||t>=this[b].length?this[b].push(e):this[b].splice(t,0,e)}[qt](){let e=[];for(let t of this[b]){let n=$.clone(t,!0);e.push(n)}return e}[ge](e){if(!this[b])return;let t=-1;for(let n=0;n<this[b].length;n++)if($.isSame(this[b][n],e)){t=n;break}if(t!=-1){let n=this[b][t];this[b].splice(t,1),this[Or](n,n.session)}}set historyMonitor(e){this[j]&&(this[j].historyMonitor=e)}get historyMonitor(){return this[j]?this[j].historyMonitor:!1}set traceless(e){this[j]&&(this[j].traceless=e)}get traceless(){return this[j]?this[j].traceless:!1}setRestorePoint(){const e=this[qt]();this[j]?.setRestorePoint(e)}onRouteUpdated(e){this[tt]=e}onError(e){this[rt]=e}beforeEach(e){this[qe].push(e)}removeBeforeEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}afterEach(e){this[$e].push(e)}removeAfterEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}destroyEach(e){this[Oe].push(e)}removeDestroyEach(e){const t=this[Oe].indexOf(e);return t!==-1?(this[Oe].splice(t,1),!0):!1}setResolveDependency(e){this[Me]=e}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[$t]){this.setNotFoundRoute(e);return}const n=this[Ye](e);if(t==-1)this[B]=[...this[B],...n];else for(let s=n.length-1;s>=0;s--)this[B].splice(t,0,n[s])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1;for(let n=0;n<this[B].length;n++){const s=this[B][n];if(t?.path&&s.path===t.path)return this[B].splice(n,1),!0;if(t?.name&&s.name===t.name)return this[B].splice(n,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route\u683C\u5F0F\u9519\u8BEF",e),!1):this[B].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[$t]=e}setNotFoundRoute(e){const t=this[Ye](e);this[nt]=t[0]}getRoutes(){return[...this[B]]}[Ye](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){let a=new dt;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in n){let l=n[a];a.length===0&&(a=Y);let f=new un(a,l,e.props,e.meta);s.push(f)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ye](a);for(let f of l){let u=new dt;u.name=f.name,f.path&&f.path.length>0?t!=="/"?u.path=`${t}${f.path}`:u.path=f.path:(i=!0,u.path=t);let c=new hr;c.models=[...s],u.layers=[c,...f.layers],o.push(u)}}if(!i){let a=new hr;a.models=s;let l=new dt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ze](e){let t=e.route;try{for(let n of this[B])if(t.path&&n.path){let s=n.match;s||(s=n.match=En(n.path));let i=s(t.path);if(!i)continue;if(n.redirect){let o=new $;F(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ze](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},F(!0,t.params,i.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let f of l){let u=f.split("=");if(u.length!==2)continue;let c=decodeURIComponent(u[0].trim()),h=decodeURIComponent(u[1].trim());a[c]=h}F(!0,t.params,a)}else typeof o=="object"&&F(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let s=Pn(n.path);return t.path=s(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new $,typeof e[0]=="object")t=$.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&F(!1,t,e[n]);else typeof e=="object"?t=$.from(e):typeof e=="string"&&(t=new $,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Y,t.opsType=t.opsType??this.options.defaultOperationType??E.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||E.Push,this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=E.Put,this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=E.Replace,this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=E.Append,this.to(t)):(this[L]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[b][0].root??Y,e.all)for(let l=this[b].length-1;l>0;l--){let f=this[b][l];f.opsType===E.Append&&f.root===i&&(o.splice(0,0,f),s=l-1)}else if(e.until)for(let l=this[b].length-1;l>0;l--){let f=this[b][l];if(f.opsType===E.Append&&f.root===i){if(e.until.charAt(0)==="/"&&e.until===f.path){s=l;break}else if(e.until===f.name){s=l;break}o.splice(0,0,f)}}}else{i=Y;let l=this[Tr](this[W]);l&&(i=l.name);for(let f=this[b].length-1;f>0;f--){let u=this[b][f];if(u.opsType===E.Append&&u.root===i){o.push(u),s=f-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[b].forEach(l=>{l.opsType!==E.Put&&a++}),this[Le](o)){let l=0;this[b].forEach(u=>{u.opsType!==E.Put&&l++});const f=l-a;this[j]?.go(f,!1),n.resolve(),t(!0)}}catch(s){this[L](s),n.resolve(),t(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=E.Open,this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let n=this[I](e);if(!n){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===n.root){if(!n.path&&!n.name){s.push(o);continue}if(n.path&&n.path===o.path){s.push(o);break}else if(n.name&&n.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Le](s)&&this[et](),t.resolve()}catch(n){this[L](n),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[L]("resolve route fail",t),this;console.debug("route to",t.path,t.root);let n=this[Ie].acquire(t);return n==null?(this[L]("route forbid",t),this):(this[ve].post(s=>{try{let i=this[Mt](t);this[It](i),!i.session?.routeModel&&this[Me]&&this[Dt](i),this[Ht](i),this[Nt](i),i.wait((o,a)=>{let l=o.session.to;try{let f=$.clone(l,!0);const u=new Bn(f,this[qt]());l.opsType===E.Replace?this[j]?.replace(u):this[j]?.push(u)}catch(f){console.error(f.message,f)}if(this[Ie].release(n),this[et](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(f){console.error(f.message,f)}this[ue]===!1&&this[st](!0),s.resolve()},(o,a)=>{this[Ie].release(n),a!==null&&this[L](a,t),this[ue]===!1&&this[st](!1),s.resolve()})}catch(i){this[Ie].release(n),this[L](i,t),s.resolve()}}),this)}back(e=1){this[j]?.go(-e)}[$r](e){return(t,n)=>{if(typeof t=="boolean")t?e.resolve():e.reject(n??null);else if(t){let s=this[I](t);if(s){let i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.routeModel=null,e.resolve()}else e.reject("route resolve fail")}else e.resolve()}}[Mt](e){let t=this[b].length>0?this[b][0]:void 0,n=new Ve(e,t),s={route:e,find:null};return this[Ze](s),s.find&&(n.routeModel=s.find,e.matched=Jn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new Fe(n)}[It](e){for(let t of this[qe])e.post(n=>{let s=this[$r](n);Reflect.apply(t,{},[n.session.to,n.session.from,s,n.session])})}[Nt](e){e.post(t=>{for(let n of this[$e])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[Or](e,t){for(let n of this[Oe])try{Reflect.apply(n,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Dt](e){let t=e.session,n=Reflect.apply(this[Me],this,[t?.to]);if(n==null)return;Array.isArray(n)||(n=[n]);let s=[];for(let i of n)this[Ut].has(i)||s.push(i);s.length!==0&&e.post(i=>{this.require.ensure(s,(...o)=>{if(!o){i.reject();return}for(let a of o){if(!a)continue;let l;ot(a)?l=a.default:l=a,Array.isArray(l)&&this.addRoutes(l)}for(let a of s)this[Ut].set(a,!0);i.resolve()})})}[Ht](e){e.post(t=>{let n=t.session.to,s=t.session.routeModel;if(s==null){let o={route:n,find:null};if(this[Ze](o))s=o.find,t.session.routeModel=s;else if(this[nt])s=this[nt];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let i=Ve.from(t.session);this[jr](n,s,i).then(o=>{this[W],t.resolve()},o=>{t.reject(o)})})}[Le](e){if(e.length==0)return!0;let t=this[W],n=[];for(let s of e){let i=this[Kt](t,s);i!=null&&n.push({...i,route:s})}if(n.length==0){let s="can not find view index";return this[L](s),!1}for(let s of n.reverse())this[ae](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[Kt](e,t){const n=t.root??Y;let s;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[z]&&l[Ge]===n)return s={x:a,y:i},s}}return null}[Tr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ae](e,t,n=null,s=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,f=[...i.slots.value];for(let c=f.length-1;c>=0;c--){let h=f[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&i[z]&&(this[ge](h.route),h.active===!0&&h.route.opsType==E.Append&&(l=!0)),a.push(new V(i,h.index,t.y)),f.splice(c,1))}if(f.length==0)s?i.slots.value=f:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=f.length-1,h=f[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=f}e.layers[t.y].views.length==0&&(o=!0);let u=t.y+1;for(;u<e.layers.length;u++){let c=e.layers[u].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let y=c[d];if(y[le]&&(o||V.include(a,y[le]))){let w=y.slots.value;for(let m=w.length-1;m>=0;m--){let p=w[m];p.route&&y[z]&&this[ge](p.route),h.push(new V(y,p.index,u)),w.splice(m,1)}e.layers[u].views.splice(d,1)}}a=h,e.layers[u].views.length==0&&(o=!0)}}restore(e){if(!e||this[B].length==0){let t=this[W];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[b]=[],this[et](),Promise.resolve()}else return new Promise((n,s)=>{for(let i=0;i<e.length;i++){let o=e[i];this[ve].post(a=>{let l=this[Mt](o);this[It](l),!l.session?.routeModel&&this[Me]&&this[Dt](l),this[Ht](l),this[Nt](l),l.wait((f,u)=>{a.resolve()},(f,u)=>{u!==null&&this[L](u),a.resolve()})})}this[ve].post(i=>{i.resolve(),n()})})}[jr](e,t,n){let s=e.updateType??Je.Part;return this[Kr](t).then(()=>{this[_r](t,e,n,s)})}[Kr](e){let t=[];for(let n=0;n<e.layers.length;n++){let s=e.layers[n];for(let i=0;i<s.models.length;i++){let o=s.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[_r](e,t,n,s){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const i=e.layers[0].models[0];let o=this[W],a=zn(o),l=t.root??Y,f;!a&&s==Je.Part&&(f=this[Kt](o,t));let u,c=0;if(f==null||f==null)if(a||s===Je.All){if(o.layers.length==0&&(o.layers[0]=new Pt),o.layers[0].views.length==0){let h=t.root??Y;u=new je(h,!0,null),o.layers[0].views=[u]}else u=o.layers[0].views[0];f={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let y;if(h.rootName){let w=o.layers[d-1];for(let m of w.views){if(m[z]&&m.name===h.rootName){y=new V(m,h.rootIndex??0,d-1);break}if(m[J]&&m[J].view.name===h.rootName&&m[J].index===h.rootIndex){y=m[J];break}}}if(!y)return Promise.reject("can not insert view(not find root node ref)");u=new je(l,!0,y),o.layers[d].views.push(u),f={x:o.layers[d].views.length-1,y:d}}else u=o.layers[f.y].views[f.x];if(c=f.y,u[z]=!0,t.opsType===E.Append){t.index=te.get();let h=u.slots.value;if(h.length>0){let p=h[h.length-1];p.active=!1,p.route&&(p.route.active=p.active)}let d=new ne(t,i,t.index,!0);u.slots.value=[...h,d];let y=c+1,w=1,m=new V(u,t.index,c);this[ie](o,y,e,w,m)}else if(t.opsType===E.Open){let h=u.slots.value,d=!1;for(let y of h){if(y.route!==null&&$.isSameForRouteModel(y.route,t)){if(y.active==!0)return t.index=y.index,t.active=y.active,y.route=t,Promise.resolve();y.active=!0,d=!0,t.index=y.index,t.active=y.active,y.route=t,this[ge](y.route)}else y.active=!1;y.route&&(y.route.active=y.active)}if(!d){t.index=te.get(),t.active=!0;let y=new ne(t,i,t.index,!0);h.push(y);let w=c+1,m=1,p=new V(u,t.index,c);this[ie](o,w,e,m,p)}u.slots.value=[...h]}else{let h=u.slots.value;if(h.length==0){t.index=te.get(),u.slots.value=[new ne(t,i,t.index)];let d=c+1,y=1,w=new V(u,t.index,c);this[ie](o,d,e,y,w)}else{let d=h[0];if(d.model!==i){this[ae](o,f,null,!0),t.index=te.get(),u.slots.value=[new ne(t,i,t.index)];let y=c+1,w=1,m=new V(u,t.index,c);this[ie](o,y,e,w,m)}else{d.route!==null&&this[ge](d.route);let y=[];for(let K=1;K<h.length;K++)y.push(h[K].index);y.length>0&&this[ae](o,f,y,!0),t.index=d.index,d.route=t;let w=[new V(u,t.index,c)],m=c+1,p=1,R=new V(u,t.index,c);for(;w.length>0&&m<o.layers.length&&p<e.layers.length;m++,p++){let K=[];for(let A=0;A<o.layers[m].views.length;A++){let S=o.layers[m].views[A];S[le]&&V.include(w,S[le])&&K.unshift(A)}let x=[];for(let A of K){let S=o.layers[m].views[A],O=e.layers[p].models,_;for(let q=0;q<O.length;q++)if(S.name===O[q].name){_=O[q];break}if(!_)this[ae](o,{x:A,y:m},null,!1);else{let q=S.slots.value;if(q.length==0){let M=0;S.slots.value=[new ne(null,_,M)];let Q=m+1,X=p+1;this[ie](o,Q,e,X,R)}else{let M=q[0];if(M.model!==_){this[ae](o,{x:A,y:m},null,!0),S.slots.value=[new ne(null,_,0)];let Q=m+1,X=p+1;this[ie](o,Q,e,X,R)}else{S[z]&&M.route!==null&&this[ge](M.route);let Q=[];for(let X=1;X<q.length;X++)Q.push(q[X].index);Q.length>0&&this[ae](o,{x:A,y:m},Q,!0),x.push(new V(S,M.index,m))}}S[z]=!1}}w=x}this[ie](o,m,e,p,R)}}}if(u&&u[J]){let h=u[J];h&&(t.slot=new an(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[qr](t)}[ie](e,t,n,s,i){let o=s,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let f of n.layers[o].models){let u=new je(f.name,!1,i),c=new ne(null,f);u.slots.value=[c],l.push(u)}}for(;o<n.layers.length;o++){let l=new Pt;l.views=[];for(let f of n.layers[o].models){let u=new je(f.name,!1,i),c=new ne(null,f);u.slots.value=[c],l.views.push(u)}e.layers.push(l)}}[fr](e,t,n,s,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let u=this[W].layers[t],c=null;for(let h of u.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&s!==-1&&(d=h[J]?.index===s)):d=h.name===e,!!d){i!==null&&(h[le]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[z]?a={view:i,index:o,level:t-1}:a=i[J],l={view:i,index:o,level:t-1});let f=new je(e,!0,a);if(f[le]=l,t==this[W].layers.length){let u=new Pt;u.views=[f],this[W].layers.push(u)}else this[W].layers[t].views.push(f);return f}}const Qn="fox-router-view",Xn="fox-router-link";function Lr(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Mr(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Yn(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Zn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ei(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function ti(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function ri(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function ni(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function ii(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function si(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function oi(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function li(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function ai(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Vt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function we(r,e){r.classList.contains(e)||r.classList.add(e)}function be(r,e){r.classList.remove(e)}const ui=ye&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Bt(r){ui(r)}function D(r,e,t){!C(e)||(r==null&&(r={}),Reflect.apply(e,r,t))}function Ir(r,e,t,n=-1,s,i,o,a){if(C(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,n]),C(a)&&Reflect.apply(a,r,[])},s);return}const l=["animationend","transitionend"],f=u=>{l.forEach(c=>{Et(e,c,f)}),Reflect.apply(i,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(u=>{At(e,u,f)})}if(C(o)){const l="animationcancel",f=u=>{Reflect.apply(o,r,[e,t,n]),Et(e,l,f)};At(e,l,f)}}function Wt(r){return!ye||r===null?!1:r.opsType===E.Append||r.opsType===E.Open}function Nr(r,e,t,n={},s,i=-1){if(e||Wt(s)){const o=Lr(n,e);o&&we(t,o);const a=Mr(n,e);a&&we(t,a);const l=ri(n,e);D(r,l,[t,e,s,i])}}function Hr(r,e,t,n={},s,i,o,a){if(!Wt(i)&&!e){C(a)&&a(r,a,[t]);return}const l=Lr(n,e),f=Mr(n,e),u=Yn(n,e),c=ni(n,e),h=ii(n,e),d=si(n,e);Bt(()=>{Ir(r,t,i,o,s,()=>{f&&be(t,f),u&&be(t,u),C(h)&&D(r,h,[t,e,i,o]),C(a)&&a(r,a,[t])},()=>{C(d)&&D(r,d,[t,e,i,o])}),l&&be(t,l),u&&we(t,u),C(c)&&D(r,c,[t,e,i,o])})}function Dr(r,e,t,n={},s,i,o,a,l){if(!Wt(o)&&!e){!e&&C(i)&&i();return}const f=Zn(n,e),u=ei(n,e),c=ti(n,e),h=oi(n,e),d=li(n,e),y=ai(n,e);f&&we(t,f),u&&we(t,u),C(h)&&D(r,h,[t,e,o,a]),Bt(()=>{Ir(r,t,o,a,s,()=>{u&&be(t,u),c&&be(t,c),C(d)&&D(r,d,[t,e,o,a]),C(l)&&D(r,l,[t]),!e&&C(i)&&i()},()=>{C(y)&&D(r,y,[t,e,o,a]),C(l)&&D(r,l,[t]),!e&&C(i)&&i()}),f&&be(t,f),c&&we(t,c)})}function kt(r,e={},t,n=-1){const s=e.mode??"default",i=Vt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Nr(r,!1,a,e,t,n)},enter:a=>{Hr(r,!1,a,e,i.enter,t,n)},leave:(a,l)=>{Dr(r,!1,a,e,i.leave,l,t,n)},clone:a=>kt(r,e,t,n)}}function Ur(r){return r.el}function fi(r,e,t={},n,s,i,o){if(i){const a=Ur(e);if(a==null)return;const l=Vt(t);Nr(r,!0,a,t,n,s),Hr(r,!0,a,t,l.show,n,s,f=>{C(o)&&D(r,o,[f])})}else C(o)&&D(r,o,[])}function ci(r,e,t={},n,s,i,o){if(i){const a=Ur(e);if(a==null)return;const l=Vt(t);Dr(r,!0,a,t,l.hide,null,n,s,f=>{C(o)&&D(r,o,[f])})}else C(o)&&D(r,o,[])}function hi(r,e={}){Bt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function se(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function zt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class di{node;state;constructor(e,t){this.node=e,this.state=t}}const Jt=v.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=v.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,s=v.inject(ze,null),i=v.inject(Rt,0),o=v.inject(vr,null),a=v.inject(xt,-1);let l=null;const f=r.modelSlot;if(f){v.provide(Rt,i+1),v.provide(xt,f.index),v.provide(St,f.index);const c=f.route;if(!c){console.warn("child view render error, route not exist");return}const h=We(t.proxy,!0);gn(h),bt(h,c)}else{if(s==null){console.error("router is not been injected");return}const c=r.name,h=v.inject(wr,null),d=v.inject(St,0);if(l=s[fr](c,i,o,a,h,d),l===null)return;if(v.provide(wr,l),l[z]===!0&&v.provide(vr,l),!n){v.provide(xt,-1),v.provide(Rt,i+1),v.provide(St,-1);const w=l.slots.value;if(w.length>0){const m=w[0].route;if(m){const p=We(t.proxy,!0);bt(p,m)}}else{const m=We(t.proxy,!0);l.compensation=()=>{const p=l.slots.value;if(p.length>0){const R=p[0].route;return R&&bt(m,R),!0}return!1}}}}const u={value:new Map};return v.onUnmounted(()=>{u.value&&u.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,y=[];for(let p=0;p<d.length;p++){const R=d[p],K=`${r.name}-${R.index}`,x=se(r.transition,R.route,p)??!0,A={modelSlot:R};let S;e.slots.default?S=v.h(Jt,A,{default:e.slots.default}):S=v.h(Jt,A);const O={},_=se(r.viewClass,R.route,p);typeof _=="string"&&_.length>0&&(O[_]=!0);const q=se(r.viewActiveClass,R.route,p),M=se(r.viewInactiveClass,R.route,p),Q=u.value.get(K);if(typeof q=="string"&&q.length>0&&(O[q]=R.active),typeof M=="string"&&M.length>0&&(O[M]=!R.active),Q&&R.active!==Q.state){const xe=Q.node;R.active?y.unshift(()=>{const tr=()=>{let Ne=yr(xe);Ne!=null&&mr(Ne,vt.ACTIVATED)};fi(t,xe,r,R.route,p,x,tr)}):y.push(()=>{const tr=()=>{const Ne=yr(xe);Ne!=null&&mr(Ne,vt.DEACTIVATED)};ci(t,xe,r,R.route,p,x,tr)})}const X={class:O,key:K},Zt=se(r.viewTagProps,R.route,p);Zt!==null&&typeof Zt=="object"&&F(!0,X,Zt),R.route?.viewTagAttrs&&typeof R.route?.viewTagAttrs=="object"&&F(!0,X,R.route.viewTagAttrs);const Ai=se(r.viewTag,R.route,p),er=v.h(Ai,X,{default:()=>[S]});if(c.set(K,new di(er,R.active)),u.value.delete(K),x){const xe=kt(t,r,R.route,p);er.transition=xe}h.push(er)}u.value.forEach(p=>{p.node.transition=null}),u.value=c,hi(y,t);const w=se(r.tag,null,-1),m={};return Object.assign(m,e.attrs),v.h(w,m,{default:()=>h})}else if(f!=null){const c=f.model,h={};c.props&&(typeof c.props=="object"?F(!1,h,c.props):c.props===!0&&typeof f.route?.params=="object"&&F(!1,h,f.route?.params));const d=v.h(c.component,h);return zt(e.slots.default,{Component:d,route:f.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.model,y={};d.props&&(typeof d.props=="object"?F(!1,y,d.props):d.props===!0&&typeof h.route?.params=="object"&&F(!1,y,h.route?.params));const w=v.h(d.component,y);if(se(r.transition,h.route,-1)??!0){const p=kt(t,r,h.route,-1);w.transition=p}return zt(e.slots.default,{Component:w,route:h.route})??w}else return zt(e.slots.fallback,{})}}}});function yi(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function mi(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function pi(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function Re(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let gi=v.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=v.inject(ze,null);return()=>{let n=Re(r.to,null),s=Re(r.tag,n);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[I](n),r.root&&(i.root=r.root),o=t.current);let a={},l=Re(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=pi(i,o)),Re(r.exact,i)===!0){let h=Re(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=mi(i,o))}let u={class:a};(s==="a"||s==="A")&&(u.href=i?.path??i?.name??"#"),F(!0,u,e.attrs);let c=Re(r.event,i);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}yi(d)&&t.to(i)};u[c]=h}return v.h(s,u,e.slots)}}}),vi={get each(){return tn},get type(){return Pe},get isFunction(){return C},get isArray(){return rr},get isArrayLike(){return ut},get makeArray(){return en},get merge(){return sr},get isWindow(){return ir},get isPlainObject(){return De},get isEqual(){return Ue}};const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function wi(r={}){const e=new Gn(r),t=new ht,n=new mt,s={...vi,get router(){return e},get bus(){return t},get Bus(){return ht},get eventproxy(){return n},get EventProxy(){return mt},get EventChain(){return Fe},get require(){return e.require},get request(){return pt},get extend(){return F},get clone(){return Se},install(i){i.provide(ze,e),i.provide(Gt,s),i.provide(Qt,t),i.provide(Xt,n),i.component(Qn,Jt),i.component(Xn,gi),Reflect.defineProperty(i.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(i.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(i.config.globalProperties,"$eventProxy",{get(){return n}}),i.config.globalProperties.$fox_on=function(o,a,l=!1){n.on(o,a,l)},i.config.globalProperties.$fox_off=function(o,a){n.off(o,a)},i.config.globalProperties.$fox_once=function(o,a){n.once(o,a)},i.config.globalProperties.$fox_all=function(...o){let a=n;Reflect.apply(a.all,a,o)},i.config.globalProperties.$fox_trigger=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.config.globalProperties.$fox_emit=function(o,...a){let l=n;Reflect.apply(l.trigger,l,[o,...a])},i.mixin({computed:{$route(){return gr(this)}}}),e.init()}};return s}function Yt(r){return r?r.$router:v.inject(ze)}function bi(r){return r||(r=v.getCurrentInstance()?.proxy??void 0),r?gr(r):null}function Ri(r){return r?r.$fox:v.inject(Gt)}function xi(r){return r?r.$bus:v.inject(Qt)}function Si(r){return r?r.$eventProxy:v.inject(Xt)}function Ci(r){const e=Yt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.beforeEach(t),v.onUnmounted(()=>{e.removeBeforeEach(t)})}function Pi(r){const e=Yt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.afterEach(t),v.onUnmounted(()=>{e.removeAfterEach(t)})}const Fi="";g.Bus=ht,g.EventChain=Fe,g.EventProxy=mt,g.Route=$,g.cancelRequest=mn,g.clone=Se,g.createFox=wi,g.createMemoryHistory=Fr,g.createWebHashHistory=Er,g.createWebHistory=Wn,g.extend=F,g.foxBusKey=Qt,g.foxEventProxyKey=Xt,g.foxKey=Gt,g.isArray=rr,g.isDate=Wr,g.isESModule=ot,g.isEqual=Ue,g.isFunction=C,g.isMap=Vr,g.isObject=nr,g.isPlainObject=De,g.isPromise=Jr,g.isSet=Br,g.isString=kr,g.isSymbol=zr,g.onAfterRouteUpdate=Pi,g.onBeforeRouteUpdate=Ci,g.onFoxActivated=Rn,g.onFoxDeactivated=xn,g.request=pt,g.sessionKey=re,g.toBoolean=at,g.toNumber=Yr,g.toTypeString=He,g.typeOf=Pe,g.useBus=xi,g.useEventProxy=Si,g.useFox=Ri,g.useRoute=bi,g.useRouter=Yt,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fox-js/fox",
3
- "version": "3.0.1-10",
3
+ "version": "3.0.1-11",
4
4
  "description": "Fox Router and commons Utils",
5
5
  "author": "jiangcheng",
6
6
  "keywords": [