@fox-js/fox 3.0.1-32 → 3.0.1-33
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 +2 -2
- package/libs/index.esm.js +114 -133
- package/libs/index.umd.js +3 -3
- package/package.json +1 -1
package/libs/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";/*!
|
|
2
|
-
* fox v3.0.0
|
|
3
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Pe=typeof window<"u",q=function(){return window},De=function(){return window.document};function Ur(s){let e=s,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 ut(){if(!Pe)return"/";let s=q().location,e=`${s.protocol}//${s.host}`;return e+=Ur(s.pathname),e}function Kt(s,e,t){s.addEventListener?s.addEventListener(e,t,!1):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function Tt(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const Wr=Array.isArray,zr=s=>nt(s)==="[object Map]",Jr=s=>nt(s)==="[object Set]",Gr=s=>s instanceof Date,R=s=>typeof s=="function",Qr=s=>typeof s=="string",Xr=s=>typeof s=="symbol",Rr=s=>s!==null&&typeof s=="object",Yr=s=>Rr(s)&&R(s.then)&&R(s.catch),Sr=s=>s==null,Zr=Object.prototype.toString,nt=s=>Zr.call(s),Pr=s=>nt(s)==="[object Object]",es=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Ht(s){return s.__esModule||es&&s[Symbol.toStringTag]==="Module"}const ts=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...s){let e=s[0]!==void 0&&s[0]!==null?s[0]:{},t=1,r=s.length,n=!1;for(typeof e=="boolean"&&(n=e,e=s[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(s[t]!==null&&s[t]!==void 0){let i=s[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(n===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function it(s,e,t=!1){if(!t)K(!0,s,e);else{if(typeof e!="object")return{};typeof s!="object"&&(s={});for(let r of Reflect.ownKeys(e)){let n=s[r],i=e[r];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Pr(i))continue;n=it(n,i,t),s[r]=n}else{if(typeof i=="function")continue;s[r]=i}}}return s}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const ft=ts?Promise.resolve():null;function Ne(s,...e){ft!==null?e&&e.length>0?ft.then(()=>{s(e)}):ft.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function Dt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function rs(s){return typeof s=="number"?s:Number(s)}const ss={"[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 $t(s){let t=Object.prototype.toString.call(s);return s==null?String(s):ss[t]||"object"}function jt(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=$t(s),r=$t(e);if(t!==r)return!1;if(t==="object"){let n=Object.keys(s),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=s[a],u=e[a];if(!jt(l,u))return!1}return!0}else if(t==="array"){if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++){let i=s[n],o=e[n];if(!jt(i,o))return!1}return!0}return!1}const Cr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Cr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},ns=/^Symbol\((.*)\)$/,Er=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Er(r));const n=ns.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e},er=Symbol("idKey"),ye=Symbol("valueKey"),S=Symbol("childrenKey"),Q=Symbol("growKey");class Ar{[Q]=!0;[er];[ye]=w.ref();[S]=new Map;constructor(e){this[er]=e}}class is{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[Q];let r=e[S].get(t);if(r)return Ie(r);if(e[Q])return r=Bt(t),r[Q]=e[Q],e[S].set(t,r),Ie(r)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):r==null?(e[S].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[S].delete(t),!0)}}const Vt="__proxy__";function Bt(s){const e=new Ar(s);return Reflect.set(e,Vt,new Proxy(e,new is)),e}function Ie(s){return Reflect.get(s,Vt)}class os{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&Sr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(Pe){const t=q();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);n&&(this.state=JSON.parse(n),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n=e[t-1];this.state[r]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(n[o]=this.state[o]))}),this.state=n,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class Fr extends Ar{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new os(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let i=e[n],o;r[S].has(i)?o=r[S].get(i):(o=Bt(i),r[S].set(i,o)),r=o}return r[ye].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let n=0;n<t;n++){let i=e[n];if(r[S].has(i))r=r[S].get(i);else return}return r[ye].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)?(r[S].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)}clear(){this[S].clear(),this._persistHandler.clear()}}const ls=["put","get","contains","remove","clear","_persistHandler"];function tr(s){return ls.includes(s)}class as{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[Q];if(t===S)return e[S];if(typeof t=="string"&&tr(t))return e[t];let r=String(t),n=e[S].get(r);if(n)return Ie(n);if(e[Q])return n=Bt(r),n[Q]=e[Q],e[S].set(r,n),Ie(n)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):tr(t)?!1:r==null?(e[S].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[S].delete(t),!0)}}function us(s){const e=new Fr(s),t=new as,r=new Proxy(e,t);return Reflect.set(e,Vt,r),e}const qt=new Proxy(Fr,{construct(s,e){const t=us(e[0]??{});return Ie(t)}}),te="default",_r=Symbol("sync"),H=Symbol("resolveRoute");function rr(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function fs(s){let e=s.src;return new Promise((t,r)=>{const n=rr(a=>{Ht(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=rr(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(n,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(n,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(n,i)}})}class cs{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}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),r=e.data??{};return K(!0,t.data,r),t}}class P{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new P;return it(r,e,t),r}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 P;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)r[i]=e[i];return t}}class hs{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=le.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return fs(this)}}class sr{models=[]}class ct{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),I=Symbol("cursorKey"),ht=Symbol("$persistentModeKey"),_=Symbol("statusKey"),Z=Symbol("argsKey"),Ve=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class He{[V]=[];[I]=0;[ht]=!1;[_]="Free";[Z]=[];[Ve]=[];[de]=[];[Ee]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[ht]=t}[ee](e,...t){let r=this[_];if(this[_]="Busy",this[I]+=e,this[I]<0&&(this[I]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[oe]},...this[Ve]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Ne(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[_]=r,this[V]=[],this[I]=0,this}else if(r==="Finished"||this[I]>=this[V].length){let a=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&Ne(()=>{Reflect.apply(l,{},a)})}return this[_]="Free",this}if(this[I]>=this[V].length)return this[_]="Free",this;let n=this[V][this[I]];this[ht]||(this[V].splice(0,this[I]+1),this[I]=-1);let i=this[I]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},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[V].splice(i,0,l),i++)},session:this[oe]};Ne(()=>{Reflect.apply(n,{},[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[_]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[_]="Reject",this[Ve]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[_]="Exception",this[Ve]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[_]="Busy",this[Z]=e,this[V]=[],this[I]=0;let r=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let n=this[de].shift();Ne(()=>{Reflect.apply(n,this,r)})}return this[_]="Free",this}post(e){return this[_]==="Reject"||this[_]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[_]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[_]=="Reject"||this[_]=="Free"&&this[I]>=this[V].length}}const pe=Symbol("registerKey");class ys{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Ot{[pe]=new Map;constructor(){}on(e,t,r=!1){let n=this[pe].get(e);n||(n=new Array,this[pe].set(e,n));let i=r===!0?1:0,o=new ys(t,i);return n.push(o),this}off(e,t){if(!t)return this[pe].delete(e),this;let r=this[pe].get(e);if(r){for(let n=0;n<r.length;n++)if(r[n].callback===t){r.splice(n,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}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 r=e[t-1];if(typeof r!="function")return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),o=[].splice.call(e,0,n);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,n-=1,n==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[pe].get(e);if(!r)return this;for(let n=0;n<r.length;){let i=r[n];if(i.policy==1?r.splice(n,1):n++,typeof i.callback=="function")try{Ne(()=>{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 Ae=Symbol("registerKey");class ds{[Ae]=new Map;constructor(){}set(e,t){this[Ae].set(e,t)}get(e){return this[Ae].get(e)}has(e){return this[Ae].has(e)}delete(e){return this[Ae].delete(e)}}const he=Symbol("lc");function rt(s,e=!1){let t=s;if(Reflect.has(t,he))return t[he];if(e){const r=new ds;return t[he]=r,r}return null}function Kr(s,e=!1){let t=null,r=s;for(;r&&!(Reflect.has(r,he)&&(t=r[he],t));)r=r.$parent;if(!t&&e){const n=s;n&&n.$parent&&(t=rt(n.$parent,e))}return t}function kt(s,e){let t=s;for(;t;){if(Reflect.has(t,he)){const r=t[he];if(r.has(e))return r.get(e)}t=t.$parent}return null}function ps(s,e,t){Kr(s,!0)?.set(e,t)}function ms(s,e){Kr(s,!0)?.delete(e)}function nr(s){if(Array.isArray(s.children)&&s.children.length>0){let e=s.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return rt(e.component.proxy,!1)}return null}const st=Symbol("hooksKey");function vs(s){let e=s.get(st);e||(e=[],s.set(st,e))}function ir(s,e){let t=s.get(st);if(t!=null)for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Lt=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Lt||{});class gs{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function ws(s,e,t,r){let n=new gs(e,t,r);return s.push(n),!0}function bs(s,e,t,r){let n=-1;for(let i=0;i<s.length;i++){let o=s[i];if(o.type===e&&o.hook===t&&o.target===r){n=i;break}}return n!=-1?(s.splice(n,1),!0):!1}function Tr(s){return(e,t)=>{let r;if(t)r=t;else{const i=w.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const n=kt(r,st);if(n==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{bs(n,s,e,r)}),ws(n,s,e,r)}}const xs=Tr("a"),Rs=Tr("da"),Mt=Symbol("routeKey");function or(s,e){s.set(Mt,e)}function Ut(s){let e=kt(s,Mt);return typeof e=="function"?e():e??null}const ot=Symbol("rk"),yt=Symbol("vd"),lr=Symbol("rv"),dt=Symbol("rvi"),ar=Symbol("pv"),pt=Symbol("pvi");function Ss(s){for(var e=[],t=0;t<s.length;){var r=s[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:s[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:s[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:s[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:s[t++]});continue}if(r===":"){for(var n="",i=t+1;i<s.length;){var o=s.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){n+=s[i++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:n}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(s[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<s.length;){if(s[i]==="\\"){l+=s[i++]+s[i++];continue}if(s[i]===")"){if(a--,a===0){i++;break}}else if(s[i]==="("&&(a++,s[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=s[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:s[t++]})}return e.push({type:"END",index:t,value:""}),e}function $r(s,e){e===void 0&&(e={});for(var t=Ss(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(be(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(F){if(l<t.length&&t[l].type===F)return t[l++].value},c=function(F){var C=f(F);if(C!==void 0)return C;var E=t[l],W=E.type,M=E.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(F))},h=function(){for(var F="",C;C=f("CHAR")||f("ESCAPED_CHAR");)F+=C;return F};l<t.length;){var y=f("CHAR"),p=f("NAME"),m=f("PATTERN");if(p||m){var d=y||"";n.indexOf(d)===-1&&(u+=d,d=""),u&&(o.push(u),u=""),o.push({name:p||a++,prefix:d,suffix:"",pattern:m||i,modifier:f("MODIFIER")||""});continue}var v=y||f("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var d=h(),T=f("NAME")||"",x=f("PATTERN")||"",$=h();c("CLOSE"),o.push({name:T||(x?a++:""),pattern:T&&!x?i:x,prefix:d,suffix:$,modifier:f("MODIFIER")||""});continue}c("END")}return o}function Ps(s,e){return Cs($r(s,e),e)}function Cs(s,e){e===void 0&&(e={});var t=Wt(e),r=e.encode,n=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=s.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<s.length;f++){var c=s[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",p=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!p)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var d=n(h[m],c);if(o&&!a[f].test(d))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(d,'"'));u+=c.prefix+d+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var d=n(String(h),c);if(o&&!a[f].test(d))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(d,'"'));u+=c.prefix+d+c.suffix;continue}if(!y){var v=p?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function Es(s,e){var t=[],r=jr(s,t,e);return As(r,t,e)}function As(s,e,t){t===void 0&&(t={});var r=t.decode,n=r===void 0?function(i){return i}:r;return function(i){var o=s.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(p){return n(p,y)}):u[y.name]=n(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function be(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Wt(s){return s&&s.sensitive?"":"i"}function Fs(s,e){if(!e)return s;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,n=t.exec(s.source);n;)e.push({name:n[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),n=t.exec(s.source);return s}function _s(s,e,t){var r=s.map(function(n){return jr(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Wt(t))}function Ks(s,e,t){return Ts($r(s,t),e,t)}function Ts(s,e,t){t===void 0&&(t={});for(var r=t.strict,n=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,p=y===void 0?"":y,m="[".concat(be(p),"]|$"),d="[".concat(be(h),"]"),v=o?"^":"",g=0,T=s;g<T.length;g++){var x=T[g];if(typeof x=="string")v+=be(f(x));else{var $=be(f(x.prefix)),F=be(f(x.suffix));if(x.pattern)if(e&&e.push(x),$||F)if(x.modifier==="+"||x.modifier==="*"){var C=x.modifier==="*"?"?":"";v+="(?:".concat($,"((?:").concat(x.pattern,")(?:").concat(F).concat($,"(?:").concat(x.pattern,"))*)").concat(F,")").concat(C)}else v+="(?:".concat($,"(").concat(x.pattern,")").concat(F,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?v+="((?:".concat(x.pattern,")").concat(x.modifier,")"):v+="(".concat(x.pattern,")").concat(x.modifier);else v+="(?:".concat($).concat(F,")").concat(x.modifier)}}if(l)n||(v+="".concat(d,"?")),v+=t.endsWith?"(?=".concat(m,")"):"$";else{var E=s[s.length-1],W=typeof E=="string"?d.indexOf(E[E.length-1])>-1:E===void 0;n||(v+="(?:".concat(d,"(?=").concat(m,"))?")),W||(v+="(?=".concat(d,"|").concat(m,")"))}return new RegExp(v,Wt(t))}function jr(s,e,t){return s instanceof RegExp?Fs(s,e):Array.isArray(s)?_s(s,e,t):Ks(s,e,t)}var j=(s=>(s[s.Push=0]="Push",s[s.Replace=1]="Replace",s[s.Put=2]="Put",s[s.Append=3]="Append",s[s.Open=4]="Open",s))(j||{}),Ye=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(Ye||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Ze=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Fe{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ze];[G];[J]=null;[ce]=null;get name(){return this[Ze]}constructor(e,t,r){this[Ze]=e,this[G]=t,r&&(this[J]=r)}}class B{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class mt{views=[]}class $s{layers=[]}class js{time;route}class qs{forbidTime=300;submitRecorder=new js;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 xe=Symbol("_notifyChange");class ur{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ae=Symbol("historyChangeConsumerKey"),fr=Symbol("_navigateFirstRoute"),Be=Symbol("_getRouteMark"),vt=Symbol("_getUrlSearch"),gt=Symbol("_generateLocation"),_e=Symbol("_setRouteMarkRecorder"),Ke=Symbol("beforeRestoreFiltersKey"),cr=Symbol("_beforeRestore"),hr="Symbol(_fox_restore_point)";function Te(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function yr(s){if(!Array.isArray(s))return!1;if(s.length===0)return!0;const e=s[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class qr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[ae]=!1;[Ke]=new Array;backTimeout=320;constructor(e="hash",t="",r="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??q().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=q();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[ae]=="function"){const r=this[ae]();if(this[ae]=!1,r)return}else if(this[ae]===!0){this[ae]=!1;return}if(Te(this.historyMonitor)){const r=t.history.state;this[xe](r);try{let n=[];if(typeof r=="string"?n=JSON.parse(r):n=r,Array.isArray(n)&&n.length>0){const i=this[Be]()??"/";this[_e](i,n)}}catch{}}}),Kt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[fr](),Promise.resolve()}destroy(){if(this.historyChange){const e=q();Tt(e,"popstate",this.historyChange)}}[cr](e,t,r,n){for(let i of this[Ke])try{const o=Reflect.apply(i,{},[e,t,r,n]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Ke].push(e)}removeBeforeRestoreEach(e){const t=this[Ke].indexOf(e);return t!==-1?(this[Ke].splice(t,1),!0):!1}[fr](){const e=this[Be]()??"/",t=this.storage.getItem(hr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?Er(l.params):{},this[cr](l,u,e,o.routes)));if(a.length>0){const l=this[vt](),u=a.length-1;a[u].query=l||a[u].query,this[xe](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new P;i.path=n,i.query=this[vt](),this[xe]([i])}[_e](e,t){try{t.forEach(i=>{i.params=i.params?Cr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(hr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Be]()??"/";this[_e](t,e)}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Be](){const e=q();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,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[vt](){let t=q().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=q();this[ae]=t,r.history.go(e)}goBack(e,t){const r=q(),n=r.history.state;if(yr(n)&&n.length>0){let i=0;if(e===null)i=n.length;else for(let c=n.length-1;c>=0;c--){const h=P.from(n[c]);if(!(h.traceless===!0||Te(this.traceless,h))){if(P.isSame(h,e))break;i++}}if(i===0){t();return}let o=n.length-i;if(e!==null&&o===0){t();return}const a=this.backTimeout;let l=null;const u=()=>{r.history.go(-1),l=setTimeout(u,a)};l=setTimeout(u,a);const f=()=>{clearTimeout(l);const h=q().history.state;if(yr(h)&&h.length>0){let y=h.length;const p=h[y-1],m=P.from(p);if(e==null||P.isSame(m,e))return t(),!0;if(y>o){let d=0;for(let v=y-1;v>=0;v--){const g=P.from(h[v]);if(!(g.traceless===!0||Te(this.traceless,g))){if(P.isSame(g,e))break;d++}}if(d===0){t();return}if(o=y-d,o>0)return l=setTimeout(u,a),this.go(-d,f),!0}}return t(),!0};this.go(-i,f)}else t()}push(e){const t=this[gt](e.currentRoute);e.currentRoute.traceless!==!0&&!Te(this.traceless,e.currentRoute)&&q().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[_e](r,e.routes)}replace(e){const t=this[gt](e.currentRoute);e.currentRoute.traceless!==!0&&!Te(this.traceless,e.currentRoute)&&q().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[_e](r,e.routes)}[gt](e){const t=q();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(te)&&(i=i.substring(te.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${n.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function Os(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=q().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new qr("path",e??"",t,s,r,n,i)}function Or(s=!0,e="",t=!0,r=!1,n){return new qr("hash","",e,s,t,r,n)}class Ls{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=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[r];this[xe](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let n=this.cursor;n>=0;n--){const i=this.queue[n];if(P.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}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 Lr(s="",e=50){return new Ls(s,e)}const ke=Symbol("_constructRouteModel"),Ue=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),dr=Symbol("_getFirstView"),ue=Symbol("_removeView"),pr=Symbol("_buildPage"),mr=Symbol("_resolveComponent"),vr=Symbol("_update"),ne=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),We=Symbol("_handleRouteUpdated"),ze=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),me=Symbol("current"),gr=Symbol("_addRouteRecorder"),$e=Symbol("_removeRouteRecorder"),Je=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),Ge=Symbol("errorCallback"),k=Symbol("registerKey"),Qe=Symbol("notFoundKey"),xt=Symbol("notFoundPathKey"),U=Symbol("forestKey"),A=Symbol("historyKey"),je=Symbol("beforeFiltersKey"),qe=Symbol("afterFiltersKey"),Oe=Symbol("destroyFiltersKey"),Rt=Symbol("propsFilterKey"),ve=Symbol("mainDispatcherKey"),St=Symbol("initKey"),fe=Symbol("readyKey"),Pt=Symbol("readyHandlersKey"),Xe=Symbol("_markReady"),wr=Symbol("_createNextFn"),Ct=Symbol("_start"),Et=Symbol("_before"),At=Symbol("_after"),br=Symbol("_destroy"),Ft=Symbol("_load"),Le=Symbol("_unload"),Me=Symbol("routerGuardKey");function Ms(s){return s.layers.length==0||s.layers[0].views.length==0}function Ns(s){let e=[];return s.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let n=K(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class Is{[k]=new Array;[Qe];[xt]="*";[fe]=!1;[Pt]=[];[U]=new $s;[A];[b]=new Array;[Ge]=null;[ze]=null;[je]=new Array;[qe]=new Array;[Oe]=new Array;[Rt]=null;[ve]=new He;[Me]=new qs;[St]=!1;[me]=w.ref(null);get current(){return this[me].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[A]=e.history:this[A]=Pe?Or():Lr(),this[A]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[H](r);i&&await this[bt]([i])}else await this[bt](r)}catch(i){console.error(i.message,i),n=!1}this[fe]===!1&&this[Xe](n)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Ge]=="function")try{this[Ge](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[A]?.init(!this[fe]),this[St]=!0)}isReady(){return this[fe]?Promise.resolve():new Promise((e,t)=>{this[Pt].push([e,t])})}[Xe](e){this[fe]=!0,this[Pt].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[bt](e){try{if(!e){let o=[...this[b]].reverse();return this[Le](o),Pe&&q().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[b].length&&P.isSame(e[i],this[b][i]);i++)e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[b].length&&(n=this[b].slice(i).reverse()),n.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Le](n)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[O](t)}return Promise.resolve()}[We](e){if(e)this[me].value=e;else{let t=this[b].length;t>0?this[me].value=this[b][t-1]:this[me].value=null}if(typeof this[ze]=="function")try{this[ze](this[me].value)}catch{}}[gr](e){if(e.opsType===j.Open){let t=!1;const r=this[b].length-1;for(let n=r;n>=0;n--){const i=this[b][n];if(e.root==i.root){if(e.path===i.path){this[b].splice(n,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[Je](){let e=[];for(let t of this[b]){let r=P.clone(t,!0);e.push(r)}return e}[$e](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(P.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1),this[br](r,r.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}set propsFilter(e){this[Rt]=e}get propsFilter(){return this[Rt]}setRestorePoint(){const e=this[Je]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[ze]=e}onError(e){this[Ge]=e}beforeEach(e){this[je].push(e)}removeBeforeEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}afterEach(e){this[qe].push(e)}removeAfterEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].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}beforeRestoreEach(e){this[A]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[A]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[xt]){this.setNotFoundRoute(e);return}const r=this[ke](e);if(t==-1)this[k]=[...this[k],...r];else for(let n=r.length-1;n>=0;n--)this[k].splice(t,0,r[n])}removeRoute(e){const t=this[H](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[k].length;r++){const n=this[k][r];if(t?.path&&n.path===t.path)return this[k].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[k].splice(r,1),!0}return!1}hasRoute(e){const t=this[H](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[xt]=e}setNotFoundRoute(e){const t=this[ke](e);this[Qe]=t[0]}getRoutes(){return[...this[k]]}[ke](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new ct;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in r){let l=r[a];a.length===0&&(a=te);let u=new hs(a,l,e.props,e.meta);n.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[ke](a);for(let u of l){let f=new ct;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new sr;c.models=[...n],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new sr;a.models=n;const l=new ct;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ue](e){const t=e.route;try{for(let r of this[k]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=Es(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new P;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[Ue](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),p=decodeURIComponent(h[1].trim());u[y]=p}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=Ps(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[H](e){let t=null;if(Array.isArray(e))if(t=new P,typeof e[0]=="object")t=P.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=P.from(e):typeof e=="string"&&(t=new P,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??te,t.opsType=t.opsType??this.options.defaultOperationType??j.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||j.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=j.Put,t.traceless=!0,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=j.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=j.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[b][0].root??te,e.all)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=te;let u=this[dr](this[U]);u&&(o=u.name);for(let f=this[b].length-1;f>0;f--){let c=this[b][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),n.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[b][i]),this[Le](a)){if(t===!1)return n.resolve(),r(!0),!0;const u=this[b].length,f=()=>(n.resolve(),r(!0),!0);if(l&&u>0&&P.isSame(l,this[b][u-1])){this[A]?.goBack(l,f);return}if(l===null&&u===0){this[A]?.goBack(null,f);return}f()}}catch(i){this[O](i),n.resolve(),r(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=j.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let r=this[H](e);if(!r){t.reject("resolve route fail");return}let n=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===r.root){if(!r.path&&!r.name){n.push(o);continue}if(r.path&&r.path===o.path){n.push(o);break}else if(r.name&&r.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Le](n)&&this[We](),t.resolve()}catch(r){this[O](r),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[O]("resolve route fail",t),this;let r=this[Me].acquire(t);return r==null?(this[O]("route forbid",t),this):(this[ve].post(n=>{try{let i=this[Ct](t);this[Et](i),this[Ft](i),this[At](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=P.clone(l,!0);const f=new ur(u,this[Je]());l.opsType===j.Replace?this[A]?.replace(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Me].release(r),this[We](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[fe]===!1&&this[Xe](!0),n.resolve()},(o,a)=>{this[Me].release(r),a!==null&&this[O](a,t),this[fe]===!1&&this[Xe](!1),n.resolve()})}catch(i){this[Me].release(r),this[O](i,t),n.resolve()}}),this)}back(e=1){this[A]?.go(-e,!1)}[wr](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const n=this[H](t);if(n){const i=e.session.to;n.success=i.success,n.error=i.error,e.session.to=n,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[Ct](e){let t=this[b].length>0?this[b][0]:void 0,r=new tt(e,t),n={route:e,find:null};return this[Ue](n),n.find&&(r.routeModel=n.find,e.matched=Ns(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new He(r)}[Et](e){for(let t of this[je])e.post(r=>{const n=this[wr](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[At](e){e.post(t=>{for(let r of this[qe])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[br](e,t){for(let r of this[Oe])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ft](e){e.post(t=>{let r=t.session.to,n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[Ue](o))n=o.find,t.session.routeModel=n;else if(this[Qe])n=this[Qe];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=tt.from(t.session);this[pr](r,n,i).then(o=>{this[U],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Le](e){if(e.length==0)return!0;let t=this[U],r=[];for(let n of e){let i=this[wt](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0){let n="can not find view index";return this[O](n),!1}for(let n of r.reverse())this[ue](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[wt](e,t){const r=t.root??te;let n;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[Ze]===r)return n={x:a,y:i},n}}return null}[dr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ue](e,t,r=null,n=!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,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[G]&&(this[$e](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new B(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let y=c.length-1;(o||a.length>0)&&y>=0;y--){let p=c[y];if(p[ce]&&(o||B.include(a,p[ce]))){let m=p.slots.value;for(let d=m.length-1;d>=0;d--){let v=m[d];v.route&&p[G]&&this[$e](v.route),h.push(new B(p,v.index,f)),m.splice(d,1)}e.layers[f].views.splice(y,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[k].length==0){let t=this[U];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[We](),Promise.resolve()}else return new Promise((r,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ve].post(u=>{const f=this[Ct](l);this[Et](f),this[Ft](f),this[At](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[O](h),u.resolve()})})}this[ve].post(a=>{if(i&&o===!0){const l=P.clone(i,!0),u=new ur(l,this[Je]());this[A]?.replace(u)}a.resolve(),r()})})}[pr](e,t,r){const n=e.updateType??Ye.Part;return this[mr](t).then(()=>{const o=this[vr](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[mr](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let i=0;i<n.models.length;i++){let o=n.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[vr](e,t,r,n){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[U],a=Ms(o),l=t.root??te,u;!a&&n==Ye.Part&&(u=this[wt](o,t));let f,c=0;if(u==null||u==null)if(a||n===Ye.All){if(o.layers.length==0&&(o.layers[0]=new mt),o.layers[0].views.length==0){let h=t.root??te;f=new Fe(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let p;if(h.rootName){let m=o.layers[y-1];for(let d of m.views){if(d[G]&&d.name===h.rootName){p=new B(d,h.rootIndex??0,y-1);break}if(d[J]&&d[J].view.name===h.rootName&&d[J].index===h.rootIndex){p=d[J];break}}}if(!p)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Fe(l,!0,p),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[G]=!0,t.opsType===j.Append){t.index=t.index??le.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let v=h[h.length-1];v.active=!1,v.route&&(v.route.active=v.active)}let y=new se(t,i,t.index,!0);f.slots.value=[...h,y];let p=c+1,m=1,d=new B(f,t.index,c);this[ne](o,p,e,m,d)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let p=!1;for(let m of h){if(m.route!==null&&P.isSameForRouteModel(m.route,t)){if(m.active===y)return t.index=m.index,t.active=y,m.route=t,{status:"no-change",message:""};m.active=y,p=!0,t.index=m.index,t.active=y,m.route=t}else y&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!p){t.index=t.index??le.get(),t.active=y;let m=new se(t,i,t.index,y);h.push(m);let d=c+1,v=1,g=new B(f,t.index,c);this[ne](o,d,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=t.index??le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let y=c+1,p=1,m=new B(f,t.index,c);this[ne](o,y,e,p,m)}else{let y=h[0];if(y.model!==i){this[ue](o,u,null,!0),t.index=t.index??le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let p=c+1,m=1,d=new B(f,t.index,c);this[ne](o,p,e,m,d)}else{y.route!==null&&this[$e](y.route);let p=!1;const m=t.active??!0;y.active!==m&&(y.active=m,p=!0),t.active=m,t.index=y.index,y.route=t;let d=[];for(let $=1;$<h.length;$++)d.push(h[$].index);d.length>0?this[ue](o,u,d,!0):p&&(f.slots.value=[...h]);let v=[new B(f,t.index,c)],g=c+1,T=1,x=new B(f,t.index,c);for(;v.length>0&&g<o.layers.length&&T<e.layers.length;g++,T++){let $=[];for(let C=0;C<o.layers[g].views.length;C++){let E=o.layers[g].views[C];E[ce]&&B.include(v,E[ce])&&$.unshift(C)}let F=[];for(let C of $){let E=o.layers[g].views[C],W=e.layers[T].models,M;for(let N=0;N<W.length;N++)if(E.name===W[N].name){M=W[N];break}if(!M)this[ue](o,{x:C,y:g},null,!1);else{let N=E.slots.value;if(N.length==0){let X=0;E.slots.value=[new se(null,M,X)];let z=g+1,re=T+1;this[ne](o,z,e,re,x)}else{let X=N[0];if(X.model!==M){this[ue](o,{x:C,y:g},null,!0),E.slots.value=[new se(null,M,0)];let z=g+1,re=T+1;this[ne](o,z,e,re,x)}else{E[G]&&X.route!==null&&this[$e](X.route);let z=[];for(let re=1;re<N.length;re++)z.push(N[re].index);z.length>0&&this[ue](o,{x:C,y:g},z,!0),F.push(new B(E,X.index,g))}}E[G]=!1}}v=F}this[ne](o,g,e,T,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new cs(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[gr](t),{status:"success",message:""}}[ne](e,t,r,n,i){let o=n,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Fe(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new mt;l.views=[];for(let u of r.layers[o].models){let f=new Fe(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[_r](e,t,r,n,i,o){if(t<0||t>this[U].layers.length)return null;if(t<this[U].layers.length){let f=this[U].layers[t],c=null;for(let h of f.views){let y=!1;if(r!==null?(y=h.name===e&&h[J]?.view===r,y&&n!==-1&&(y=h[J]?.index===n)):y=h.name===e,!!y){i!==null&&(h[ce]={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 u=new Fe(e,!0,a);if(u[ce]=l,t==this[U].layers.length){let f=new mt;f.views=[u],this[U].layers.push(f)}else this[U].layers[t].views.push(u);return u}}const Hs="fox-router-view",Ds="fox-router-link";function Mr(s,e=!1){let t=null;return e?t=s.showFromClass??s.enterFromClass:t=s.enterFromClass,t||(t=s.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Nr(s,e=!1){let t=null;return e?t=s.showActiveClass??s.enterActiveClass:t=s.enterActiveClass,t||(t=s.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Vs(s,e=!1){let t=null;return e?t=s.showToClass??s.enterToClass:t=s.enterToClass,t||(t=s.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Bs(s,e=!1){let t=null;return e?t=s.hideFromClass??s.leaveFromClass:t=s.leaveFromClass,t||(t=s.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ks(s,e=!1){let t=null;return e?t=s.hideActiveClass??s.leaveActiveClass:t=s.leaveActiveClass,t||(t=s.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Us(s,e=!1){let t=null;return e?t=s.hideToClass??s.leaveToClass:t=s.leaveToClass,t||(t=s.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Ws(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function zs(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function Js(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function Gs(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function Qs(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function Xs(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function Ys(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function zt(s){let e,t=s.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 Re(s,e){s.classList.contains(e)||s.classList.add(e)}function Se(s,e){s.classList.remove(e)}const Zs=Pe&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Jt(s){Zs(s)}function D(s,e,t){R(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function Ir(s,e,t,r=-1,n,i,o,a){if(R(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),R(a)&&Reflect.apply(a,s,[])},n);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Tt(e,c,u)}),Reflect.apply(i,s,[e,t,r]),a&&Reflect.apply(a,s,[])};l.forEach(f=>{Kt(e,f,u)})}if(R(o)){const l="animationcancel",u=f=>{Reflect.apply(o,s,[e,t,r]),Tt(e,l,u)};Kt(e,l,u)}}function Gt(s){return!Pe||s===null?!1:s.opsType===j.Append||s.opsType===j.Open}function Hr(s,e,t,r={},n,i=-1){if(e||Gt(n)){const o=Mr(r,e);o&&Re(t,o);const a=Nr(r,e);a&&Re(t,a);const l=Ws(r,e);D(s,l,[t,e,n,i])}}function Dr(s,e,t,r={},n,i,o,a){if(!Gt(i)&&!e){R(a)&&a(s,a,[t]);return}const l=Mr(r,e),u=Nr(r,e),f=Vs(r,e),c=zs(r,e),h=Js(r,e),y=Gs(r,e);if(!l&&!u&&!f&&!c){R(a)&&a(s,a,[t]);return}Jt(()=>{Ir(s,t,i,o,n,()=>{u&&Se(t,u),f&&Se(t,f),R(h)&&D(s,h,[t,e,i,o]),R(a)&&a(s,a,[t])},()=>{R(y)&&D(s,y,[t,e,i,o])}),l&&Se(t,l),f&&Re(t,f),R(c)&&D(s,c,[t,e,i,o])})}function Vr(s,e,t,r={},n,i,o,a,l){if(!Gt(o)&&!e){!e&&R(i)&&i();return}const u=Bs(r,e),f=ks(r,e),c=Us(r,e),h=Qs(r,e),y=Xs(r,e),p=Ys(r,e);if(!u&&!f&&!c&&!h){!e&&R(i)&&i();return}u&&Re(t,u),f&&Re(t,f),R(h)&&D(s,h,[t,e,o,a]),Jt(()=>{Ir(s,t,o,a,n,()=>{f&&Se(t,f),c&&Se(t,c),R(y)&&D(s,y,[t,e,o,a]),R(l)&&D(s,l,[t]),!e&&R(i)&&i()},()=>{R(p)&&D(s,p,[t,e,o,a]),R(l)&&D(s,l,[t]),!e&&R(i)&&i()}),u&&Se(t,u),c&&Re(t,c)})}function Nt(s,e={},t,r=-1){const n=e.mode??"default",i=zt(e);return{mode:n,persisted:!1,beforeEnter:a=>{Hr(s,!1,a,e,t,r)},enter:a=>{Dr(s,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Vr(s,!1,a,e,i.leave,l,t,r)},clone:a=>Nt(s,e,t,r)}}function Br(s){return s.el}function en(s,e,t={},r,n,i,o){if(i){const a=Br(e);if(a==null)return;const l=zt(t);Hr(s,!0,a,t,r,n),Dr(s,!0,a,t,l.show,r,n,u=>{R(o)&&D(s,o,[u])})}else R(o)&&D(s,o,[])}function tn(s,e,t={},r,n,i,o){if(i){const a=Br(e);if(a==null)return;const l=zt(t);Vr(s,!0,a,t,l.hide,null,r,n,u=>{R(o)&&D(s,o,[u])})}else R(o)&&D(s,o,[])}function rn(s,e={}){Jt(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function ie(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function _t(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function ge(s,e){return typeof e=="function"?e(s):s}class sn{node;state;constructor(e,t){this.node=e,this.state=t}}const It=w.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(s,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=s.multi===!0,n=w.inject(ot,null),i=w.inject(yt,0),o=w.inject(lr,null),a=w.inject(dt,-1);let l=null;const u=s.modelSlot;if(u){if(w.provide(yt,i+1),w.provide(dt,u.index),w.provide(pt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=rt(t.proxy,!0);vs(h),or(h,()=>u.route??null)}else{if(n==null){console.error("router is not been injected");return}const c=s.name,h=w.inject(ar,null),y=w.inject(pt,0);if(l=n[_r](c,i,o,a,h,y),l===null)return;w.provide(ar,l);const p=l[G]===!0;if(p&&w.provide(lr,l),!r&&(w.provide(dt,-1),w.provide(yt,i+1),w.provide(pt,-1),p)){const m=rt(t.proxy,!0);or(m,()=>{const d=l.slots.value;return d.length>0?d[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,p=[];for(let v=0;v<y.length;v++){const g=y[v],T=`${s.name}_${g.index}`,x=ie(s.transition,g.route,v)??!0,$={modelSlot:g};let F;e.slots.default?F=w.h(It,$,{default:e.slots.default}):F=w.h(It,$);const C={},E=ie(s.viewClass,g.route,v);typeof E=="string"&&E.length>0&&(C[E]=!0);const W=ie(s.viewActiveClass,g.route,v),M=ie(s.viewInactiveClass,g.route,v),N=f.value.get(T);if(typeof W=="string"&&W.length>0&&(C[W]=g.active),typeof M=="string"&&M.length>0&&(C[M]=!g.active),N&&g.active!==N.state){const Y=N.node;g.active?p.unshift(()=>{const at=()=>{let Ce=nr(Y);Ce!=null&&ir(Ce,Lt.ACTIVATED)};en(t,Y,s,g.route,v,x,at)}):p.push(()=>{const at=()=>{const Ce=nr(Y);Ce!=null&&ir(Ce,Lt.DEACTIVATED)};tn(t,Y,s,g.route,v,x,at)})}const X={class:C,key:T},z=ie(s.viewTagProps,g.route,v);if(z!==null&&typeof z=="object"){const Y=ge(z,n?.propsFilter);K(!0,X,Y)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const Y=ge(g.route.viewTagAttrs,n?.propsFilter);K(!0,X,Y)}const re=ie(s.viewTag,g.route,v),lt=w.h(re,X,{default:()=>[F]});if(c.set(T,new sn(lt,g.active)),f.value.delete(T),x){const Y=Nt(t,s,g.route,v);lt.transition=Y}h.push(lt)}f.value.forEach(v=>{v.node.transition=null}),f.value=c,rn(p,t);const m=ie(s.tag,null,-1),d={};return Object.assign(d,e.attrs),w.h(m,d,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const p=ge(c.props,n?.propsFilter);K(!1,h,p)}else if(c.props===!0&&typeof u.route?.params=="object"){const p=ge(u.route.params,n?.propsFilter);K(!1,h,p)}}const y=w.h(c.component,h);return _t(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Ut(t.proxy))??null,p=h.model,m={};if(p.props){if(typeof p.props=="object"){const g=ge(p.props,n?.propsFilter);K(!1,m,g)}else if(p.props===!0&&typeof y?.params=="object"){const g=ge(y.params,n?.propsFilter);K(!1,m,g)}}const d=w.h(p.component,m);if(ie(s.transition,y,-1)??!0){const g=Nt(t,s,y,-1);d.transition=g}return _t(e.slots.default,{Component:d,route:y})??d}else return _t(e.slots.fallback,{})}}}});function nn(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!=null&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){const e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function on(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function ln(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function we(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let an=w.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(s,e){const t=w.inject(ot,null);return()=>{let r=we(s.to,null),n=we(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[H](r),s.root&&(i.root=s.root),o=t.current);let a={},l=we(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=ln(i,o)),we(s.exact,i)===!0){let h=we(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=on(i,o))}let f={class:a};(n==="a"||n==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=we(s.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}nn(y)&&t.to(i)};f[c]=h}return w.h(n,f,e.slots)}}});var L=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(L||{}),et=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(et||{});class un{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class xr{moduleManager=new un;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return De().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:L.Defined};typeof t=="function"?(r.exports=t,r.type=et.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new fn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new He;for(let l=0;l<t.length;l++){const u=new cn(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,n)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(n=>{t.progress.work(!0,t.index,"exports"),n.resolve()});return}else if(t.src==="module"){e.post(n=>{t.progress.work(!0,t.index,"module"),n.resolve()});return}if(this.isNaturePath(t.src)){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(this.isNaturePath(t.src)){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(r==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,r){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.Loaded)&&o.exports){o.type===et.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}const a=De(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{kr(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.Loaded)){if(o.exports){o.type===et.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),n.resolve();return}}o={id:i,src:i,status:L.Loading},this.moduleManager.set(i,o);const l=De().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const f=q();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=De(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const n=e[r].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const r=this,n=function(...i){e.status=L.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=L.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=L.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let r=0;r<t.length;r++){const n=t[r];if(e.indexOf(n)===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`${ut()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${ut()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${q().location.protocol}${e}`;if(t){let n=this.options.alias[e];if(!n){let i=e.indexOf("/");if(i==-1)n=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?n=a+e.slice(i):n=e}}return this.parserPath(n,!1)}return`${ut()}${e}`}}function kr(s,e){let t=s.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():kr(s,e)},20)}class fn{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,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(n){console.error(n.message,n)}}isOK(){return this.status}}class cn{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Qt=Symbol("fk"),Xt=Symbol("fbk"),Yt=Symbol("fepk");function hn(s={}){const e=new Is(s),t=new qt,r=new Ot,n=new xr,i={get router(){return e},get bus(){return t},get Bus(){return qt},get EventProxy(){return Ot},get eventproxy(){return r},get EventChain(){return He},get Require(){return xr},get require(){return n},get extend(){return K},get clone(){return it},get isESModule(){return Ht},install(o){o.provide(ot,e),o.provide(Qt,i),o.provide(Xt,t),o.provide(Yt,r),o.component(Hs,It),o.component(Ds,an),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ut(this)}}}),e.init()}};return i}function Zt(s){return s?s.$router:w.inject(ot)}function yn(s){return s||(s=w.getCurrentInstance()?.proxy??void 0),s?Ut(s):null}function dn(s){return s?s.$fox:w.inject(Qt)}function pn(s){return s?s.$bus:w.inject(Xt)}function mn(s){return s?s.$eventProxy:w.inject(Yt)}function vn(s){const e=Zt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function gn(s){const e=Zt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=qt;exports.EventChain=He;exports.EventProxy=Ot;exports.Route=P;exports.clone=it;exports.createFox=hn;exports.createMemoryHistory=Lr;exports.createWebHashHistory=Or;exports.createWebHistory=Os;exports.deleteContextValue=ms;exports.extend=K;exports.foxBusKey=Xt;exports.foxEventProxyKey=Yt;exports.foxKey=Qt;exports.injectContextValue=kt;exports.isArray=Wr;exports.isDate=Gr;exports.isESModule=Ht;exports.isEqual=jt;exports.isFunction=R;exports.isMap=zr;exports.isNil=Sr;exports.isObject=Rr;exports.isPlainObject=Pr;exports.isPromise=Yr;exports.isSet=Jr;exports.isString=Qr;exports.isSymbol=Xr;exports.onAfterRouteUpdate=gn;exports.onBeforeRouteUpdate=vn;exports.onFoxActivated=xs;exports.onFoxInactivated=Rs;exports.provideContextValue=ps;exports.sessionKey=oe;exports.toBoolean=Dt;exports.toNumber=rs;exports.toTypeString=nt;exports.typeOf=$t;exports.useBus=pn;exports.useEventProxy=mn;exports.useFox=dn;exports.useRoute=yn;exports.useRouter=Zt;
|
|
2
|
+
* fox v3.0.0 Wed Nov 29 2023 16:14:35 GMT+0800 (中国标准时间)
|
|
3
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Pe=typeof window<"u",q=function(){return window},De=function(){return window.document};function Ur(s){let e=s,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 ut(){if(!Pe)return"/";let s=q().location,e=`${s.protocol}//${s.host}`;return e+=Ur(s.pathname),e}function Kt(s,e,t){s.addEventListener?s.addEventListener(e,t,!1):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function Tt(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const Wr=Array.isArray,zr=s=>nt(s)==="[object Map]",Jr=s=>nt(s)==="[object Set]",Gr=s=>s instanceof Date,R=s=>typeof s=="function",Qr=s=>typeof s=="string",Xr=s=>typeof s=="symbol",Rr=s=>s!==null&&typeof s=="object",Yr=s=>Rr(s)&&R(s.then)&&R(s.catch),Sr=s=>s==null,Zr=Object.prototype.toString,nt=s=>Zr.call(s),Pr=s=>nt(s)==="[object Object]",es=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Ht(s){return s.__esModule||es&&s[Symbol.toStringTag]==="Module"}const ts=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...s){let e=s[0]!==void 0&&s[0]!==null?s[0]:{},t=1,r=s.length,n=!1;for(typeof e=="boolean"&&(n=e,e=s[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(s[t]!==null&&s[t]!==void 0){let i=s[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(n===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function it(s,e,t=!1){if(!t)K(!0,s,e);else{if(typeof e!="object")return{};typeof s!="object"&&(s={});for(let r of Reflect.ownKeys(e)){let n=s[r],i=e[r];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Pr(i))continue;n=it(n,i,t),s[r]=n}else{if(typeof i=="function")continue;s[r]=i}}}return s}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const ft=ts?Promise.resolve():null;function Ie(s,...e){ft!==null?e&&e.length>0?ft.then(()=>{s(e)}):ft.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function Dt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function rs(s){return typeof s=="number"?s:Number(s)}const ss={"[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 $t(s){let t=Object.prototype.toString.call(s);return s==null?String(s):ss[t]||"object"}function jt(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=$t(s),r=$t(e);if(t!==r)return!1;if(t==="object"){let n=Object.keys(s),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=s[a],u=e[a];if(!jt(l,u))return!1}return!0}else if(t==="array"){if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++){let i=s[n],o=e[n];if(!jt(i,o))return!1}return!0}return!1}const Cr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Cr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},ns=/^Symbol\((.*)\)$/,Er=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Er(r));const n=ns.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e},er=Symbol("idKey"),ye=Symbol("valueKey"),S=Symbol("childrenKey"),Q=Symbol("growKey");class Ar{[Q]=!0;[er];[ye]=w.ref();[S]=new Map;constructor(e){this[er]=e}}class is{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[Q];let r=e[S].get(t);if(r)return Ne(r);if(e[Q])return r=Bt(t),r[Q]=e[Q],e[S].set(t,r),Ne(r)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):r==null?(e[S].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[S].delete(t),!0)}}const Vt="__proxy__";function Bt(s){const e=new Ar(s);return Reflect.set(e,Vt,new Proxy(e,new is)),e}function Ne(s){return Reflect.get(s,Vt)}class os{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&Sr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(Pe){const t=q();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);n&&(this.state=JSON.parse(n),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n=e[t-1];this.state[r]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(n[o]=this.state[o]))}),this.state=n,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class Fr extends Ar{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new os(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let i=e[n],o;r[S].has(i)?o=r[S].get(i):(o=Bt(i),r[S].set(i,o)),r=o}return r[ye].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let n=0;n<t;n++){let i=e[n];if(r[S].has(i))r=r[S].get(i);else return}return r[ye].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)?(r[S].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)}clear(){this[S].clear(),this._persistHandler.clear()}}const ls=["put","get","contains","remove","clear","_persistHandler"];function tr(s){return ls.includes(s)}class as{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[Q];if(t===S)return e[S];if(typeof t=="string"&&tr(t))return e[t];let r=String(t),n=e[S].get(r);if(n)return Ne(n);if(e[Q])return n=Bt(r),n[Q]=e[Q],e[S].set(r,n),Ne(n)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):tr(t)?!1:r==null?(e[S].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[S].delete(t),!0)}}function us(s){const e=new Fr(s),t=new as,r=new Proxy(e,t);return Reflect.set(e,Vt,r),e}const qt=new Proxy(Fr,{construct(s,e){const t=us(e[0]??{});return Ne(t)}}),te="default",_r=Symbol("sync"),H=Symbol("resolveRoute");function rr(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function fs(s){let e=s.src;return new Promise((t,r)=>{const n=rr(a=>{Ht(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=rr(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(n,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(n,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(n,i)}})}class cs{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}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),r=e.data??{};return K(!0,t.data,r),t}}class P{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new P;return it(r,e,t),r}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 P;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)r[i]=e[i];return t}}class hs{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=le.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return fs(this)}}class sr{models=[]}class ct{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),N=Symbol("cursorKey"),ht=Symbol("$persistentModeKey"),_=Symbol("statusKey"),Z=Symbol("argsKey"),Ve=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class He{[V]=[];[N]=0;[ht]=!1;[_]="Free";[Z]=[];[Ve]=[];[de]=[];[Ee]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[ht]=t}[ee](e,...t){let r=this[_];if(this[_]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[oe]},...this[Ve]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Ie(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[_]=r,this[V]=[],this[N]=0,this}else if(r==="Finished"||this[N]>=this[V].length){let a=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&Ie(()=>{Reflect.apply(l,{},a)})}return this[_]="Free",this}if(this[N]>=this[V].length)return this[_]="Free",this;let n=this[V][this[N]];this[ht]||(this[V].splice(0,this[N]+1),this[N]=-1);let i=this[N]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},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[V].splice(i,0,l),i++)},session:this[oe]};Ie(()=>{Reflect.apply(n,{},[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[_]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[_]="Reject",this[Ve]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[_]="Exception",this[Ve]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[_]="Busy",this[Z]=e,this[V]=[],this[N]=0;let r=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let n=this[de].shift();Ie(()=>{Reflect.apply(n,this,r)})}return this[_]="Free",this}post(e){return this[_]==="Reject"||this[_]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[_]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[_]=="Reject"||this[_]=="Free"&&this[N]>=this[V].length}}const pe=Symbol("registerKey");class ys{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Ot{[pe]=new Map;constructor(){}on(e,t,r=!1){let n=this[pe].get(e);n||(n=new Array,this[pe].set(e,n));let i=r===!0?1:0,o=new ys(t,i);return n.push(o),this}off(e,t){if(!t)return this[pe].delete(e),this;let r=this[pe].get(e);if(r){for(let n=0;n<r.length;n++)if(r[n].callback===t){r.splice(n,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}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 r=e[t-1];if(typeof r!="function")return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),o=[].splice.call(e,0,n);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,n-=1,n==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[pe].get(e);if(!r)return this;for(let n=0;n<r.length;){let i=r[n];if(i.policy==1?r.splice(n,1):n++,typeof i.callback=="function")try{Ie(()=>{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 Ae=Symbol("registerKey");class ds{[Ae]=new Map;constructor(){}set(e,t){this[Ae].set(e,t)}get(e){return this[Ae].get(e)}has(e){return this[Ae].has(e)}delete(e){return this[Ae].delete(e)}}const he=Symbol("lc");function rt(s,e=!1){let t=s;if(Reflect.has(t,he))return t[he];if(e){const r=new ds;return t[he]=r,r}return null}function Kr(s,e=!1){let t=null,r=s;for(;r&&!(Reflect.has(r,he)&&(t=r[he],t));)r=r.$parent;if(!t&&e){const n=s;n&&n.$parent&&(t=rt(n.$parent,e))}return t}function kt(s,e){let t=s;for(;t;){if(Reflect.has(t,he)){const r=t[he];if(r.has(e))return r.get(e)}t=t.$parent}return null}function ps(s,e,t){Kr(s,!0)?.set(e,t)}function ms(s,e){Kr(s,!0)?.delete(e)}function nr(s){if(Array.isArray(s.children)&&s.children.length>0){let e=s.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return rt(e.component.proxy,!1)}return null}const st=Symbol("hooksKey");function vs(s){let e=s.get(st);e||(e=[],s.set(st,e))}function ir(s,e){let t=s.get(st);if(t!=null)for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Lt=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Lt||{});class gs{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function ws(s,e,t,r){let n=new gs(e,t,r);return s.push(n),!0}function bs(s,e,t,r){let n=-1;for(let i=0;i<s.length;i++){let o=s[i];if(o.type===e&&o.hook===t&&o.target===r){n=i;break}}return n!=-1?(s.splice(n,1),!0):!1}function Tr(s){return(e,t)=>{let r;if(t)r=t;else{const i=w.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const n=kt(r,st);if(n==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{bs(n,s,e,r)}),ws(n,s,e,r)}}const xs=Tr("a"),Rs=Tr("da"),Mt=Symbol("routeKey");function or(s,e){s.set(Mt,e)}function Ut(s){let e=kt(s,Mt);return typeof e=="function"?e():e??null}const ot=Symbol("rk"),yt=Symbol("vd"),lr=Symbol("rv"),dt=Symbol("rvi"),ar=Symbol("pv"),pt=Symbol("pvi");function Ss(s){for(var e=[],t=0;t<s.length;){var r=s[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:s[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:s[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:s[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:s[t++]});continue}if(r===":"){for(var n="",i=t+1;i<s.length;){var o=s.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){n+=s[i++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:n}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(s[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<s.length;){if(s[i]==="\\"){l+=s[i++]+s[i++];continue}if(s[i]===")"){if(a--,a===0){i++;break}}else if(s[i]==="("&&(a++,s[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=s[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:s[t++]})}return e.push({type:"END",index:t,value:""}),e}function $r(s,e){e===void 0&&(e={});for(var t=Ss(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(be(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(F){if(l<t.length&&t[l].type===F)return t[l++].value},c=function(F){var C=f(F);if(C!==void 0)return C;var E=t[l],W=E.type,M=E.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(F))},h=function(){for(var F="",C;C=f("CHAR")||f("ESCAPED_CHAR");)F+=C;return F};l<t.length;){var y=f("CHAR"),d=f("NAME"),m=f("PATTERN");if(d||m){var p=y||"";n.indexOf(p)===-1&&(u+=p,p=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:p,suffix:"",pattern:m||i,modifier:f("MODIFIER")||""});continue}var v=y||f("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var p=h(),T=f("NAME")||"",x=f("PATTERN")||"",$=h();c("CLOSE"),o.push({name:T||(x?a++:""),pattern:T&&!x?i:x,prefix:p,suffix:$,modifier:f("MODIFIER")||""});continue}c("END")}return o}function Ps(s,e){return Cs($r(s,e),e)}function Cs(s,e){e===void 0&&(e={});var t=Wt(e),r=e.encode,n=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=s.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<s.length;f++){var c=s[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",d=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var p=n(h[m],c);if(o&&!a[f].test(p))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));u+=c.prefix+p+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var p=n(String(h),c);if(o&&!a[f].test(p))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));u+=c.prefix+p+c.suffix;continue}if(!y){var v=d?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function Es(s,e){var t=[],r=jr(s,t,e);return As(r,t,e)}function As(s,e,t){t===void 0&&(t={});var r=t.decode,n=r===void 0?function(i){return i}:r;return function(i){var o=s.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(d){return n(d,y)}):u[y.name]=n(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function be(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Wt(s){return s&&s.sensitive?"":"i"}function Fs(s,e){if(!e)return s;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,n=t.exec(s.source);n;)e.push({name:n[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),n=t.exec(s.source);return s}function _s(s,e,t){var r=s.map(function(n){return jr(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Wt(t))}function Ks(s,e,t){return Ts($r(s,t),e,t)}function Ts(s,e,t){t===void 0&&(t={});for(var r=t.strict,n=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,d=y===void 0?"":y,m="[".concat(be(d),"]|$"),p="[".concat(be(h),"]"),v=o?"^":"",g=0,T=s;g<T.length;g++){var x=T[g];if(typeof x=="string")v+=be(f(x));else{var $=be(f(x.prefix)),F=be(f(x.suffix));if(x.pattern)if(e&&e.push(x),$||F)if(x.modifier==="+"||x.modifier==="*"){var C=x.modifier==="*"?"?":"";v+="(?:".concat($,"((?:").concat(x.pattern,")(?:").concat(F).concat($,"(?:").concat(x.pattern,"))*)").concat(F,")").concat(C)}else v+="(?:".concat($,"(").concat(x.pattern,")").concat(F,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?v+="((?:".concat(x.pattern,")").concat(x.modifier,")"):v+="(".concat(x.pattern,")").concat(x.modifier);else v+="(?:".concat($).concat(F,")").concat(x.modifier)}}if(l)n||(v+="".concat(p,"?")),v+=t.endsWith?"(?=".concat(m,")"):"$";else{var E=s[s.length-1],W=typeof E=="string"?p.indexOf(E[E.length-1])>-1:E===void 0;n||(v+="(?:".concat(p,"(?=").concat(m,"))?")),W||(v+="(?=".concat(p,"|").concat(m,")"))}return new RegExp(v,Wt(t))}function jr(s,e,t){return s instanceof RegExp?Fs(s,e):Array.isArray(s)?_s(s,e,t):Ks(s,e,t)}var j=(s=>(s[s.Push=0]="Push",s[s.Replace=1]="Replace",s[s.Put=2]="Put",s[s.Append=3]="Append",s[s.Open=4]="Open",s))(j||{}),Ye=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(Ye||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Ze=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Fe{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ze];[G];[J]=null;[ce]=null;get name(){return this[Ze]}constructor(e,t,r){this[Ze]=e,this[G]=t,r&&(this[J]=r)}}class B{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class mt{views=[]}class $s{layers=[]}class js{time;route}class qs{forbidTime=300;submitRecorder=new js;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 xe=Symbol("_notifyChange");class ur{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ae=Symbol("historyChangeConsumerKey"),fr=Symbol("_navigateFirstRoute"),Be=Symbol("_getRouteMark"),vt=Symbol("_getUrlSearch"),gt=Symbol("_generateLocation"),_e=Symbol("_setRouteMarkRecorder"),Ke=Symbol("beforeRestoreFiltersKey"),cr=Symbol("_beforeRestore"),hr="Symbol(_fox_restore_point)";function Te(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function yr(s){if(!Array.isArray(s))return!1;if(s.length===0)return!0;const e=s[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class qr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[ae]=!1;[Ke]=new Array;backTimeout=320;constructor(e="hash",t="",r="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??q().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=q();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[ae]=="function"){const r=this[ae]();if(this[ae]=!1,r)return}else if(this[ae]===!0){this[ae]=!1;return}if(Te(this.historyMonitor)){const r=t.history.state;this[xe](r);try{let n=[];if(typeof r=="string"?n=JSON.parse(r):n=r,Array.isArray(n)&&n.length>0){const i=this[Be]()??"/";this[_e](i,n)}}catch{}}}),Kt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[fr](),Promise.resolve()}destroy(){if(this.historyChange){const e=q();Tt(e,"popstate",this.historyChange)}}[cr](e,t,r,n){for(let i of this[Ke])try{const o=Reflect.apply(i,{},[e,t,r,n]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Ke].push(e)}removeBeforeRestoreEach(e){const t=this[Ke].indexOf(e);return t!==-1?(this[Ke].splice(t,1),!0):!1}[fr](){const e=this[Be]()??"/",t=this.storage.getItem(hr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?Er(l.params):{},this[cr](l,u,e,o.routes)));if(a.length>0){const l=this[vt](),u=a.length-1;a[u].query=l||a[u].query,this[xe](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new P;i.path=n,i.query=this[vt](),this[xe]([i])}[_e](e,t){try{t.forEach(i=>{i.params=i.params?Cr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(hr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Be]()??"/";this[_e](t,e)}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Be](){const e=q();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,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[vt](){let t=q().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=q();this[ae]=t,r.history.go(e)}goBack(e,t){const r=q(),n=r.history.state;if(yr(n)&&n.length>0){let i=!1;for(let f=n.length-1;f>=0;f--){const c=P.from(n[f]);if(!(c.traceless===!0||Te(this.traceless,c))&&P.isSame(c,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,o)};a=setTimeout(l,o);const u=()=>{clearTimeout(a);const c=q().history.state;if(yr(c)&&c.length>0){let h=c.length;const y=c[h-1],d=P.from(y);if(P.isSame(d,e))return t(),!0;if(h>0){let m=!1;for(let p=h-1;p>=0;p--){const v=P.from(c[p]);if(!(v.traceless===!0||Te(this.traceless,v))&&P.isSame(v,e)){m=!0;break}}return m?(a=setTimeout(l,o),this.go(-1,u),!0):(t(),!0)}}return t(),!0};this.go(-1,u)}else t()}push(e){const t=this[gt](e.currentRoute);e.currentRoute.traceless!==!0&&!Te(this.traceless,e.currentRoute)&&q().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[_e](r,e.routes)}replace(e){const t=this[gt](e.currentRoute);e.currentRoute.traceless!==!0&&!Te(this.traceless,e.currentRoute)&&q().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[_e](r,e.routes)}[gt](e){const t=q();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(te)&&(i=i.substring(te.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${n.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function Os(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=q().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new qr("path",e??"",t,s,r,n,i)}function Or(s=!0,e="",t=!0,r=!1,n){return new qr("hash","",e,s,t,r,n)}class Ls{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=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[r];this[xe](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let n=this.cursor;n>=0;n--){const i=this.queue[n];if(P.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}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 Lr(s="",e=50){return new Ls(s,e)}const ke=Symbol("_constructRouteModel"),Ue=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),dr=Symbol("_getFirstView"),ue=Symbol("_removeView"),pr=Symbol("_buildPage"),mr=Symbol("_resolveComponent"),vr=Symbol("_update"),ne=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),We=Symbol("_handleRouteUpdated"),ze=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),me=Symbol("current"),gr=Symbol("_addRouteRecorder"),$e=Symbol("_removeRouteRecorder"),Je=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),Ge=Symbol("errorCallback"),k=Symbol("registerKey"),Qe=Symbol("notFoundKey"),xt=Symbol("notFoundPathKey"),U=Symbol("forestKey"),A=Symbol("historyKey"),je=Symbol("beforeFiltersKey"),qe=Symbol("afterFiltersKey"),Oe=Symbol("destroyFiltersKey"),Rt=Symbol("propsFilterKey"),ve=Symbol("mainDispatcherKey"),St=Symbol("initKey"),fe=Symbol("readyKey"),Pt=Symbol("readyHandlersKey"),Xe=Symbol("_markReady"),wr=Symbol("_createNextFn"),Ct=Symbol("_start"),Et=Symbol("_before"),At=Symbol("_after"),br=Symbol("_destroy"),Ft=Symbol("_load"),Le=Symbol("_unload"),Me=Symbol("routerGuardKey");function Ms(s){return s.layers.length==0||s.layers[0].views.length==0}function Is(s){let e=[];return s.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let n=K(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class Ns{[k]=new Array;[Qe];[xt]="*";[fe]=!1;[Pt]=[];[U]=new $s;[A];[b]=new Array;[Ge]=null;[ze]=null;[je]=new Array;[qe]=new Array;[Oe]=new Array;[Rt]=null;[ve]=new He;[Me]=new qs;[St]=!1;[me]=w.ref(null);get current(){return this[me].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[A]=e.history:this[A]=Pe?Or():Lr(),this[A]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[H](r);i&&await this[bt]([i])}else await this[bt](r)}catch(i){console.error(i.message,i),n=!1}this[fe]===!1&&this[Xe](n)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Ge]=="function")try{this[Ge](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[A]?.init(!this[fe]),this[St]=!0)}isReady(){return this[fe]?Promise.resolve():new Promise((e,t)=>{this[Pt].push([e,t])})}[Xe](e){this[fe]=!0,this[Pt].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[bt](e){try{if(!e){let o=[...this[b]].reverse();return this[Le](o),Pe&&q().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[b].length&&P.isSame(e[i],this[b][i]);i++)e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[b].length&&(n=this[b].slice(i).reverse()),n.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Le](n)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[O](t)}return Promise.resolve()}[We](e){if(e)this[me].value=e;else{let t=this[b].length;t>0?this[me].value=this[b][t-1]:this[me].value=null}if(typeof this[ze]=="function")try{this[ze](this[me].value)}catch{}}[gr](e){if(e.opsType===j.Open){let t=!1;const r=this[b].length-1;for(let n=r;n>=0;n--){const i=this[b][n];if(e.root==i.root){if(e.path===i.path){this[b].splice(n,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[Je](){let e=[];for(let t of this[b]){let r=P.clone(t,!0);e.push(r)}return e}[$e](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(P.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1),this[br](r,r.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}set propsFilter(e){this[Rt]=e}get propsFilter(){return this[Rt]}setRestorePoint(){const e=this[Je]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[ze]=e}onError(e){this[Ge]=e}beforeEach(e){this[je].push(e)}removeBeforeEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}afterEach(e){this[qe].push(e)}removeAfterEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].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}beforeRestoreEach(e){this[A]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[A]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[xt]){this.setNotFoundRoute(e);return}const r=this[ke](e);if(t==-1)this[k]=[...this[k],...r];else for(let n=r.length-1;n>=0;n--)this[k].splice(t,0,r[n])}removeRoute(e){const t=this[H](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[k].length;r++){const n=this[k][r];if(t?.path&&n.path===t.path)return this[k].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[k].splice(r,1),!0}return!1}hasRoute(e){const t=this[H](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[xt]=e}setNotFoundRoute(e){const t=this[ke](e);this[Qe]=t[0]}getRoutes(){return[...this[k]]}[ke](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new ct;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in r){let l=r[a];a.length===0&&(a=te);let u=new hs(a,l,e.props,e.meta);n.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[ke](a);for(let u of l){let f=new ct;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new sr;c.models=[...n],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new sr;a.models=n;const l=new ct;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ue](e){const t=e.route;try{for(let r of this[k]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=Es(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new P;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[Ue](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=Ps(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[H](e){let t=null;if(Array.isArray(e))if(t=new P,typeof e[0]=="object")t=P.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=P.from(e):typeof e=="string"&&(t=new P,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??te,t.opsType=t.opsType??this.options.defaultOperationType??j.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||j.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=j.Put,t.traceless=!0,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=j.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=j.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[b][0].root??te,e.all)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=te;let u=this[dr](this[U]);u&&(o=u.name);for(let f=this[b].length-1;f>0;f--){let c=this[b][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),n.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[b][i]),this[Le](a)){if(t===!1)return n.resolve(),r(!0),!0;const u=()=>(n.resolve(),r(!0),!0);if(l&&P.isSame(l,this[b][len-1])){this[A]?.goBack(l,u);return}u()}}catch(i){this[O](i),n.resolve(),r(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=j.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let r=this[H](e);if(!r){t.reject("resolve route fail");return}let n=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===r.root){if(!r.path&&!r.name){n.push(o);continue}if(r.path&&r.path===o.path){n.push(o);break}else if(r.name&&r.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Le](n)&&this[We](),t.resolve()}catch(r){this[O](r),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[O]("resolve route fail",t),this;let r=this[Me].acquire(t);return r==null?(this[O]("route forbid",t),this):(this[ve].post(n=>{try{let i=this[Ct](t);this[Et](i),this[Ft](i),this[At](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=P.clone(l,!0);const f=new ur(u,this[Je]());l.opsType===j.Replace?this[A]?.replace(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Me].release(r),this[We](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[fe]===!1&&this[Xe](!0),n.resolve()},(o,a)=>{this[Me].release(r),a!==null&&this[O](a,t),this[fe]===!1&&this[Xe](!1),n.resolve()})}catch(i){this[Me].release(r),this[O](i,t),n.resolve()}}),this)}back(e=1){this[A]?.go(-e,!1)}[wr](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const n=this[H](t);if(n){const i=e.session.to;n.success=i.success,n.error=i.error,e.session.to=n,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[Ct](e){let t=this[b].length>0?this[b][0]:void 0,r=new tt(e,t),n={route:e,find:null};return this[Ue](n),n.find&&(r.routeModel=n.find,e.matched=Is(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new He(r)}[Et](e){for(let t of this[je])e.post(r=>{const n=this[wr](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[At](e){e.post(t=>{for(let r of this[qe])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[br](e,t){for(let r of this[Oe])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ft](e){e.post(t=>{let r=t.session.to,n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[Ue](o))n=o.find,t.session.routeModel=n;else if(this[Qe])n=this[Qe];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=tt.from(t.session);this[pr](r,n,i).then(o=>{this[U],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Le](e){if(e.length==0)return!0;let t=this[U],r=[];for(let n of e){let i=this[wt](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0){let n="can not find view index";return this[O](n),!1}for(let n of r.reverse())this[ue](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[wt](e,t){const r=t.root??te;let n;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[Ze]===r)return n={x:a,y:i},n}}return null}[dr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ue](e,t,r=null,n=!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,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[G]&&(this[$e](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new B(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let y=c.length-1;(o||a.length>0)&&y>=0;y--){let d=c[y];if(d[ce]&&(o||B.include(a,d[ce]))){let m=d.slots.value;for(let p=m.length-1;p>=0;p--){let v=m[p];v.route&&d[G]&&this[$e](v.route),h.push(new B(d,v.index,f)),m.splice(p,1)}e.layers[f].views.splice(y,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[k].length==0){let t=this[U];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[We](),Promise.resolve()}else return new Promise((r,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ve].post(u=>{const f=this[Ct](l);this[Et](f),this[Ft](f),this[At](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[O](h),u.resolve()})})}this[ve].post(a=>{if(i&&o===!0){const l=P.clone(i,!0),u=new ur(l,this[Je]());this[A]?.replace(u)}a.resolve(),r()})})}[pr](e,t,r){const n=e.updateType??Ye.Part;return this[mr](t).then(()=>{const o=this[vr](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[mr](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let i=0;i<n.models.length;i++){let o=n.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[vr](e,t,r,n){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[U],a=Ms(o),l=t.root??te,u;!a&&n==Ye.Part&&(u=this[wt](o,t));let f,c=0;if(u==null||u==null)if(a||n===Ye.All){if(o.layers.length==0&&(o.layers[0]=new mt),o.layers[0].views.length==0){let h=t.root??te;f=new Fe(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let d;if(h.rootName){let m=o.layers[y-1];for(let p of m.views){if(p[G]&&p.name===h.rootName){d=new B(p,h.rootIndex??0,y-1);break}if(p[J]&&p[J].view.name===h.rootName&&p[J].index===h.rootIndex){d=p[J];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Fe(l,!0,d),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[G]=!0,t.opsType===j.Append){t.index=t.index??le.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let v=h[h.length-1];v.active=!1,v.route&&(v.route.active=v.active)}let y=new se(t,i,t.index,!0);f.slots.value=[...h,y];let d=c+1,m=1,p=new B(f,t.index,c);this[ne](o,d,e,m,p)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let d=!1;for(let m of h){if(m.route!==null&&P.isSameForRouteModel(m.route,t)){if(m.active===y)return t.index=m.index,t.active=y,m.route=t,{status:"no-change",message:""};m.active=y,d=!0,t.index=m.index,t.active=y,m.route=t}else y&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!d){t.index=t.index??le.get(),t.active=y;let m=new se(t,i,t.index,y);h.push(m);let p=c+1,v=1,g=new B(f,t.index,c);this[ne](o,p,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=t.index??le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let y=c+1,d=1,m=new B(f,t.index,c);this[ne](o,y,e,d,m)}else{let y=h[0];if(y.model!==i){this[ue](o,u,null,!0),t.index=t.index??le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let d=c+1,m=1,p=new B(f,t.index,c);this[ne](o,d,e,m,p)}else{y.route!==null&&this[$e](y.route);let d=!1;const m=t.active??!0;y.active!==m&&(y.active=m,d=!0),t.active=m,t.index=y.index,y.route=t;let p=[];for(let $=1;$<h.length;$++)p.push(h[$].index);p.length>0?this[ue](o,u,p,!0):d&&(f.slots.value=[...h]);let v=[new B(f,t.index,c)],g=c+1,T=1,x=new B(f,t.index,c);for(;v.length>0&&g<o.layers.length&&T<e.layers.length;g++,T++){let $=[];for(let C=0;C<o.layers[g].views.length;C++){let E=o.layers[g].views[C];E[ce]&&B.include(v,E[ce])&&$.unshift(C)}let F=[];for(let C of $){let E=o.layers[g].views[C],W=e.layers[T].models,M;for(let I=0;I<W.length;I++)if(E.name===W[I].name){M=W[I];break}if(!M)this[ue](o,{x:C,y:g},null,!1);else{let I=E.slots.value;if(I.length==0){let X=0;E.slots.value=[new se(null,M,X)];let z=g+1,re=T+1;this[ne](o,z,e,re,x)}else{let X=I[0];if(X.model!==M){this[ue](o,{x:C,y:g},null,!0),E.slots.value=[new se(null,M,0)];let z=g+1,re=T+1;this[ne](o,z,e,re,x)}else{E[G]&&X.route!==null&&this[$e](X.route);let z=[];for(let re=1;re<I.length;re++)z.push(I[re].index);z.length>0&&this[ue](o,{x:C,y:g},z,!0),F.push(new B(E,X.index,g))}}E[G]=!1}}v=F}this[ne](o,g,e,T,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new cs(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[gr](t),{status:"success",message:""}}[ne](e,t,r,n,i){let o=n,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Fe(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new mt;l.views=[];for(let u of r.layers[o].models){let f=new Fe(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[_r](e,t,r,n,i,o){if(t<0||t>this[U].layers.length)return null;if(t<this[U].layers.length){let f=this[U].layers[t],c=null;for(let h of f.views){let y=!1;if(r!==null?(y=h.name===e&&h[J]?.view===r,y&&n!==-1&&(y=h[J]?.index===n)):y=h.name===e,!!y){i!==null&&(h[ce]={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 u=new Fe(e,!0,a);if(u[ce]=l,t==this[U].layers.length){let f=new mt;f.views=[u],this[U].layers.push(f)}else this[U].layers[t].views.push(u);return u}}const Hs="fox-router-view",Ds="fox-router-link";function Mr(s,e=!1){let t=null;return e?t=s.showFromClass??s.enterFromClass:t=s.enterFromClass,t||(t=s.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Ir(s,e=!1){let t=null;return e?t=s.showActiveClass??s.enterActiveClass:t=s.enterActiveClass,t||(t=s.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Vs(s,e=!1){let t=null;return e?t=s.showToClass??s.enterToClass:t=s.enterToClass,t||(t=s.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Bs(s,e=!1){let t=null;return e?t=s.hideFromClass??s.leaveFromClass:t=s.leaveFromClass,t||(t=s.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function ks(s,e=!1){let t=null;return e?t=s.hideActiveClass??s.leaveActiveClass:t=s.leaveActiveClass,t||(t=s.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Us(s,e=!1){let t=null;return e?t=s.hideToClass??s.leaveToClass:t=s.leaveToClass,t||(t=s.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Ws(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function zs(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function Js(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function Gs(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function Qs(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function Xs(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function Ys(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function zt(s){let e,t=s.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 Re(s,e){s.classList.contains(e)||s.classList.add(e)}function Se(s,e){s.classList.remove(e)}const Zs=Pe&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Jt(s){Zs(s)}function D(s,e,t){R(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function Nr(s,e,t,r=-1,n,i,o,a){if(R(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),R(a)&&Reflect.apply(a,s,[])},n);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Tt(e,c,u)}),Reflect.apply(i,s,[e,t,r]),a&&Reflect.apply(a,s,[])};l.forEach(f=>{Kt(e,f,u)})}if(R(o)){const l="animationcancel",u=f=>{Reflect.apply(o,s,[e,t,r]),Tt(e,l,u)};Kt(e,l,u)}}function Gt(s){return!Pe||s===null?!1:s.opsType===j.Append||s.opsType===j.Open}function Hr(s,e,t,r={},n,i=-1){if(e||Gt(n)){const o=Mr(r,e);o&&Re(t,o);const a=Ir(r,e);a&&Re(t,a);const l=Ws(r,e);D(s,l,[t,e,n,i])}}function Dr(s,e,t,r={},n,i,o,a){if(!Gt(i)&&!e){R(a)&&a(s,a,[t]);return}const l=Mr(r,e),u=Ir(r,e),f=Vs(r,e),c=zs(r,e),h=Js(r,e),y=Gs(r,e);if(!l&&!u&&!f&&!c){R(a)&&a(s,a,[t]);return}Jt(()=>{Nr(s,t,i,o,n,()=>{u&&Se(t,u),f&&Se(t,f),R(h)&&D(s,h,[t,e,i,o]),R(a)&&a(s,a,[t])},()=>{R(y)&&D(s,y,[t,e,i,o])}),l&&Se(t,l),f&&Re(t,f),R(c)&&D(s,c,[t,e,i,o])})}function Vr(s,e,t,r={},n,i,o,a,l){if(!Gt(o)&&!e){!e&&R(i)&&i();return}const u=Bs(r,e),f=ks(r,e),c=Us(r,e),h=Qs(r,e),y=Xs(r,e),d=Ys(r,e);if(!u&&!f&&!c&&!h){!e&&R(i)&&i();return}u&&Re(t,u),f&&Re(t,f),R(h)&&D(s,h,[t,e,o,a]),Jt(()=>{Nr(s,t,o,a,n,()=>{f&&Se(t,f),c&&Se(t,c),R(y)&&D(s,y,[t,e,o,a]),R(l)&&D(s,l,[t]),!e&&R(i)&&i()},()=>{R(d)&&D(s,d,[t,e,o,a]),R(l)&&D(s,l,[t]),!e&&R(i)&&i()}),u&&Se(t,u),c&&Re(t,c)})}function It(s,e={},t,r=-1){const n=e.mode??"default",i=zt(e);return{mode:n,persisted:!1,beforeEnter:a=>{Hr(s,!1,a,e,t,r)},enter:a=>{Dr(s,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Vr(s,!1,a,e,i.leave,l,t,r)},clone:a=>It(s,e,t,r)}}function Br(s){return s.el}function en(s,e,t={},r,n,i,o){if(i){const a=Br(e);if(a==null)return;const l=zt(t);Hr(s,!0,a,t,r,n),Dr(s,!0,a,t,l.show,r,n,u=>{R(o)&&D(s,o,[u])})}else R(o)&&D(s,o,[])}function tn(s,e,t={},r,n,i,o){if(i){const a=Br(e);if(a==null)return;const l=zt(t);Vr(s,!0,a,t,l.hide,null,r,n,u=>{R(o)&&D(s,o,[u])})}else R(o)&&D(s,o,[])}function rn(s,e={}){Jt(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function ie(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function _t(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function ge(s,e){return typeof e=="function"?e(s):s}class sn{node;state;constructor(e,t){this.node=e,this.state=t}}const Nt=w.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(s,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=s.multi===!0,n=w.inject(ot,null),i=w.inject(yt,0),o=w.inject(lr,null),a=w.inject(dt,-1);let l=null;const u=s.modelSlot;if(u){if(w.provide(yt,i+1),w.provide(dt,u.index),w.provide(pt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=rt(t.proxy,!0);vs(h),or(h,()=>u.route??null)}else{if(n==null){console.error("router is not been injected");return}const c=s.name,h=w.inject(ar,null),y=w.inject(pt,0);if(l=n[_r](c,i,o,a,h,y),l===null)return;w.provide(ar,l);const d=l[G]===!0;if(d&&w.provide(lr,l),!r&&(w.provide(dt,-1),w.provide(yt,i+1),w.provide(pt,-1),d)){const m=rt(t.proxy,!0);or(m,()=>{const p=l.slots.value;return p.length>0?p[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,d=[];for(let v=0;v<y.length;v++){const g=y[v],T=`${s.name}_${g.index}`,x=ie(s.transition,g.route,v)??!0,$={modelSlot:g};let F;e.slots.default?F=w.h(Nt,$,{default:e.slots.default}):F=w.h(Nt,$);const C={},E=ie(s.viewClass,g.route,v);typeof E=="string"&&E.length>0&&(C[E]=!0);const W=ie(s.viewActiveClass,g.route,v),M=ie(s.viewInactiveClass,g.route,v),I=f.value.get(T);if(typeof W=="string"&&W.length>0&&(C[W]=g.active),typeof M=="string"&&M.length>0&&(C[M]=!g.active),I&&g.active!==I.state){const Y=I.node;g.active?d.unshift(()=>{const at=()=>{let Ce=nr(Y);Ce!=null&&ir(Ce,Lt.ACTIVATED)};en(t,Y,s,g.route,v,x,at)}):d.push(()=>{const at=()=>{const Ce=nr(Y);Ce!=null&&ir(Ce,Lt.DEACTIVATED)};tn(t,Y,s,g.route,v,x,at)})}const X={class:C,key:T},z=ie(s.viewTagProps,g.route,v);if(z!==null&&typeof z=="object"){const Y=ge(z,n?.propsFilter);K(!0,X,Y)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const Y=ge(g.route.viewTagAttrs,n?.propsFilter);K(!0,X,Y)}const re=ie(s.viewTag,g.route,v),lt=w.h(re,X,{default:()=>[F]});if(c.set(T,new sn(lt,g.active)),f.value.delete(T),x){const Y=It(t,s,g.route,v);lt.transition=Y}h.push(lt)}f.value.forEach(v=>{v.node.transition=null}),f.value=c,rn(d,t);const m=ie(s.tag,null,-1),p={};return Object.assign(p,e.attrs),w.h(m,p,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const d=ge(c.props,n?.propsFilter);K(!1,h,d)}else if(c.props===!0&&typeof u.route?.params=="object"){const d=ge(u.route.params,n?.propsFilter);K(!1,h,d)}}const y=w.h(c.component,h);return _t(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Ut(t.proxy))??null,d=h.model,m={};if(d.props){if(typeof d.props=="object"){const g=ge(d.props,n?.propsFilter);K(!1,m,g)}else if(d.props===!0&&typeof y?.params=="object"){const g=ge(y.params,n?.propsFilter);K(!1,m,g)}}const p=w.h(d.component,m);if(ie(s.transition,y,-1)??!0){const g=It(t,s,y,-1);p.transition=g}return _t(e.slots.default,{Component:p,route:y})??p}else return _t(e.slots.fallback,{})}}}});function nn(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!=null&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){const e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function on(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function ln(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function we(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let an=w.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(s,e){const t=w.inject(ot,null);return()=>{let r=we(s.to,null),n=we(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[H](r),s.root&&(i.root=s.root),o=t.current);let a={},l=we(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=ln(i,o)),we(s.exact,i)===!0){let h=we(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=on(i,o))}let f={class:a};(n==="a"||n==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=we(s.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}nn(y)&&t.to(i)};f[c]=h}return w.h(n,f,e.slots)}}});var L=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(L||{}),et=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(et||{});class un{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class xr{moduleManager=new un;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return De().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:L.Defined};typeof t=="function"?(r.exports=t,r.type=et.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new fn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new He;for(let l=0;l<t.length;l++){const u=new cn(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,n)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(n=>{t.progress.work(!0,t.index,"exports"),n.resolve()});return}else if(t.src==="module"){e.post(n=>{t.progress.work(!0,t.index,"module"),n.resolve()});return}if(this.isNaturePath(t.src)){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(this.isNaturePath(t.src)){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(r==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,r){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.Loaded)&&o.exports){o.type===et.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}const a=De(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{kr(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.Loaded)){if(o.exports){o.type===et.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),n.resolve();return}}o={id:i,src:i,status:L.Loading},this.moduleManager.set(i,o);const l=De().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const f=q();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=De(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const n=e[r].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const r=this,n=function(...i){e.status=L.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=L.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=L.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let r=0;r<t.length;r++){const n=t[r];if(e.indexOf(n)===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`${ut()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${ut()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${q().location.protocol}${e}`;if(t){let n=this.options.alias[e];if(!n){let i=e.indexOf("/");if(i==-1)n=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?n=a+e.slice(i):n=e}}return this.parserPath(n,!1)}return`${ut()}${e}`}}function kr(s,e){let t=s.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():kr(s,e)},20)}class fn{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,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(n){console.error(n.message,n)}}isOK(){return this.status}}class cn{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Qt=Symbol("fk"),Xt=Symbol("fbk"),Yt=Symbol("fepk");function hn(s={}){const e=new Ns(s),t=new qt,r=new Ot,n=new xr,i={get router(){return e},get bus(){return t},get Bus(){return qt},get EventProxy(){return Ot},get eventproxy(){return r},get EventChain(){return He},get Require(){return xr},get require(){return n},get extend(){return K},get clone(){return it},get isESModule(){return Ht},install(o){o.provide(ot,e),o.provide(Qt,i),o.provide(Xt,t),o.provide(Yt,r),o.component(Hs,Nt),o.component(Ds,an),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ut(this)}}}),e.init()}};return i}function Zt(s){return s?s.$router:w.inject(ot)}function yn(s){return s||(s=w.getCurrentInstance()?.proxy??void 0),s?Ut(s):null}function dn(s){return s?s.$fox:w.inject(Qt)}function pn(s){return s?s.$bus:w.inject(Xt)}function mn(s){return s?s.$eventProxy:w.inject(Yt)}function vn(s){const e=Zt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function gn(s){const e=Zt(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=qt;exports.EventChain=He;exports.EventProxy=Ot;exports.Route=P;exports.clone=it;exports.createFox=hn;exports.createMemoryHistory=Lr;exports.createWebHashHistory=Or;exports.createWebHistory=Os;exports.deleteContextValue=ms;exports.extend=K;exports.foxBusKey=Xt;exports.foxEventProxyKey=Yt;exports.foxKey=Qt;exports.injectContextValue=kt;exports.isArray=Wr;exports.isDate=Gr;exports.isESModule=Ht;exports.isEqual=jt;exports.isFunction=R;exports.isMap=zr;exports.isNil=Sr;exports.isObject=Rr;exports.isPlainObject=Pr;exports.isPromise=Yr;exports.isSet=Jr;exports.isString=Qr;exports.isSymbol=Xr;exports.onAfterRouteUpdate=gn;exports.onBeforeRouteUpdate=vn;exports.onFoxActivated=xs;exports.onFoxInactivated=Rs;exports.provideContextValue=ps;exports.sessionKey=oe;exports.toBoolean=Dt;exports.toNumber=rs;exports.toTypeString=nt;exports.typeOf=$t;exports.useBus=pn;exports.useEventProxy=mn;exports.useFox=dn;exports.useRoute=yn;exports.useRouter=Zt;
|
package/libs/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as wr, getCurrentInstance as Mt, onUnmounted as ot, shallowRef as Wr, defineComponent as br, inject as G, provide as se, h as he } from "vue";
|
|
2
2
|
/*!
|
|
3
|
-
* fox v3.0.0
|
|
3
|
+
* fox v3.0.0 Wed Nov 29 2023 16:14:35 GMT+0800 (中国标准时间)
|
|
4
4
|
*/
|
|
5
5
|
const Ae = typeof window < "u", T = function() {
|
|
6
6
|
return window;
|
|
@@ -1432,12 +1432,12 @@ function $r(s, e) {
|
|
|
1432
1432
|
E += P;
|
|
1433
1433
|
return E;
|
|
1434
1434
|
}; l < t.length; ) {
|
|
1435
|
-
var y = f("CHAR"),
|
|
1436
|
-
if (
|
|
1437
|
-
var
|
|
1438
|
-
n.indexOf(
|
|
1439
|
-
name:
|
|
1440
|
-
prefix:
|
|
1435
|
+
var y = f("CHAR"), d = f("NAME"), m = f("PATTERN");
|
|
1436
|
+
if (d || m) {
|
|
1437
|
+
var p = y || "";
|
|
1438
|
+
n.indexOf(p) === -1 && (u += p, p = ""), u && (o.push(u), u = ""), o.push({
|
|
1439
|
+
name: d || a++,
|
|
1440
|
+
prefix: p,
|
|
1441
1441
|
suffix: "",
|
|
1442
1442
|
pattern: m || i,
|
|
1443
1443
|
modifier: f("MODIFIER") || ""
|
|
@@ -1452,11 +1452,11 @@ function $r(s, e) {
|
|
|
1452
1452
|
u && (o.push(u), u = "");
|
|
1453
1453
|
var g = f("OPEN");
|
|
1454
1454
|
if (g) {
|
|
1455
|
-
var
|
|
1455
|
+
var p = h(), _ = f("NAME") || "", b = f("PATTERN") || "", K = h();
|
|
1456
1456
|
c("CLOSE"), o.push({
|
|
1457
1457
|
name: _ || (b ? a++ : ""),
|
|
1458
1458
|
pattern: _ && !b ? i : b,
|
|
1459
|
-
prefix:
|
|
1459
|
+
prefix: p,
|
|
1460
1460
|
suffix: K,
|
|
1461
1461
|
modifier: f("MODIFIER") || ""
|
|
1462
1462
|
});
|
|
@@ -1484,9 +1484,9 @@ function gs(s, e) {
|
|
|
1484
1484
|
u += c;
|
|
1485
1485
|
continue;
|
|
1486
1486
|
}
|
|
1487
|
-
var h = l ? l[c.name] : void 0, y = c.modifier === "?" || c.modifier === "*",
|
|
1487
|
+
var h = l ? l[c.name] : void 0, y = c.modifier === "?" || c.modifier === "*", d = c.modifier === "*" || c.modifier === "+";
|
|
1488
1488
|
if (Array.isArray(h)) {
|
|
1489
|
-
if (!
|
|
1489
|
+
if (!d)
|
|
1490
1490
|
throw new TypeError('Expected "'.concat(c.name, '" to not repeat, but got an array'));
|
|
1491
1491
|
if (h.length === 0) {
|
|
1492
1492
|
if (y)
|
|
@@ -1494,22 +1494,22 @@ function gs(s, e) {
|
|
|
1494
1494
|
throw new TypeError('Expected "'.concat(c.name, '" to not be empty'));
|
|
1495
1495
|
}
|
|
1496
1496
|
for (var m = 0; m < h.length; m++) {
|
|
1497
|
-
var
|
|
1498
|
-
if (o && !a[f].test(
|
|
1499
|
-
throw new TypeError('Expected all "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(
|
|
1500
|
-
u += c.prefix +
|
|
1497
|
+
var p = n(h[m], c);
|
|
1498
|
+
if (o && !a[f].test(p))
|
|
1499
|
+
throw new TypeError('Expected all "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(p, '"'));
|
|
1500
|
+
u += c.prefix + p + c.suffix;
|
|
1501
1501
|
}
|
|
1502
1502
|
continue;
|
|
1503
1503
|
}
|
|
1504
1504
|
if (typeof h == "string" || typeof h == "number") {
|
|
1505
|
-
var
|
|
1506
|
-
if (o && !a[f].test(
|
|
1507
|
-
throw new TypeError('Expected "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(
|
|
1508
|
-
u += c.prefix +
|
|
1505
|
+
var p = n(String(h), c);
|
|
1506
|
+
if (o && !a[f].test(p))
|
|
1507
|
+
throw new TypeError('Expected "'.concat(c.name, '" to match "').concat(c.pattern, '", but got "').concat(p, '"'));
|
|
1508
|
+
u += c.prefix + p + c.suffix;
|
|
1509
1509
|
continue;
|
|
1510
1510
|
}
|
|
1511
1511
|
if (!y) {
|
|
1512
|
-
var v =
|
|
1512
|
+
var v = d ? "an array" : "a string";
|
|
1513
1513
|
throw new TypeError('Expected "'.concat(c.name, '" to be ').concat(v));
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
@@ -1533,8 +1533,8 @@ function bs(s, e, t) {
|
|
|
1533
1533
|
if (o[h] === void 0)
|
|
1534
1534
|
return "continue";
|
|
1535
1535
|
var y = e[h - 1];
|
|
1536
|
-
y.modifier === "*" || y.modifier === "+" ? u[y.name] = o[h].split(y.prefix + y.suffix).map(function(
|
|
1537
|
-
return n(
|
|
1536
|
+
y.modifier === "*" || y.modifier === "+" ? u[y.name] = o[h].split(y.prefix + y.suffix).map(function(d) {
|
|
1537
|
+
return n(d, y);
|
|
1538
1538
|
}) : u[y.name] = n(o[h], y);
|
|
1539
1539
|
}, c = 1; c < o.length; c++)
|
|
1540
1540
|
f(c);
|
|
@@ -1574,7 +1574,7 @@ function Ps(s, e, t) {
|
|
|
1574
1574
|
t === void 0 && (t = {});
|
|
1575
1575
|
for (var r = t.strict, n = r === void 0 ? !1 : r, i = t.start, o = i === void 0 ? !0 : i, a = t.end, l = a === void 0 ? !0 : a, u = t.encode, f = u === void 0 ? function(L) {
|
|
1576
1576
|
return L;
|
|
1577
|
-
} : u, c = t.delimiter, h = c === void 0 ? "/#?" : c, y = t.endsWith,
|
|
1577
|
+
} : u, c = t.delimiter, h = c === void 0 ? "/#?" : c, y = t.endsWith, d = y === void 0 ? "" : y, m = "[".concat(Re(d), "]|$"), p = "[".concat(Re(h), "]"), v = o ? "^" : "", g = 0, _ = s; g < _.length; g++) {
|
|
1578
1578
|
var b = _[g];
|
|
1579
1579
|
if (typeof b == "string")
|
|
1580
1580
|
v += Re(f(b));
|
|
@@ -1594,10 +1594,10 @@ function Ps(s, e, t) {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
1596
|
if (l)
|
|
1597
|
-
n || (v += "".concat(
|
|
1597
|
+
n || (v += "".concat(p, "?")), v += t.endsWith ? "(?=".concat(m, ")") : "$";
|
|
1598
1598
|
else {
|
|
1599
|
-
var C = s[s.length - 1], U = typeof C == "string" ?
|
|
1600
|
-
n || (v += "(?:".concat(
|
|
1599
|
+
var C = s[s.length - 1], U = typeof C == "string" ? p.indexOf(C[C.length - 1]) > -1 : C === void 0;
|
|
1600
|
+
n || (v += "(?:".concat(p, "(?=").concat(m, "))?")), U || (v += "(?=".concat(p, "|").concat(m, ")"));
|
|
1601
1601
|
}
|
|
1602
1602
|
return new RegExp(v, Bt(t));
|
|
1603
1603
|
}
|
|
@@ -2050,62 +2050,47 @@ class qr {
|
|
|
2050
2050
|
goBack(e, t) {
|
|
2051
2051
|
const r = T(), n = r.history.state;
|
|
2052
2052
|
if (fr(n) && n.length > 0) {
|
|
2053
|
-
let i =
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
if (!(h.traceless === !0 || qe(this.traceless, h))) {
|
|
2060
|
-
if (S.isSame(h, e))
|
|
2061
|
-
break;
|
|
2062
|
-
i++;
|
|
2063
|
-
}
|
|
2053
|
+
let i = !1;
|
|
2054
|
+
for (let f = n.length - 1; f >= 0; f--) {
|
|
2055
|
+
const c = S.from(n[f]);
|
|
2056
|
+
if (!(c.traceless === !0 || qe(this.traceless, c)) && S.isSame(c, e)) {
|
|
2057
|
+
i = !0;
|
|
2058
|
+
break;
|
|
2064
2059
|
}
|
|
2065
|
-
if (i === 0) {
|
|
2066
|
-
t();
|
|
2067
|
-
return;
|
|
2068
2060
|
}
|
|
2069
|
-
|
|
2070
|
-
if (e !== null && o === 0) {
|
|
2061
|
+
if (!i) {
|
|
2071
2062
|
t();
|
|
2072
2063
|
return;
|
|
2073
2064
|
}
|
|
2074
|
-
const
|
|
2075
|
-
let
|
|
2076
|
-
const
|
|
2077
|
-
r.history.go(-1),
|
|
2065
|
+
const o = this.backTimeout;
|
|
2066
|
+
let a = null;
|
|
2067
|
+
const l = () => {
|
|
2068
|
+
r.history.go(-1), a = setTimeout(l, o);
|
|
2078
2069
|
};
|
|
2079
|
-
|
|
2080
|
-
const
|
|
2081
|
-
clearTimeout(
|
|
2082
|
-
const
|
|
2083
|
-
if (fr(
|
|
2084
|
-
let
|
|
2085
|
-
const
|
|
2086
|
-
if (
|
|
2070
|
+
a = setTimeout(l, o);
|
|
2071
|
+
const u = () => {
|
|
2072
|
+
clearTimeout(a);
|
|
2073
|
+
const c = T().history.state;
|
|
2074
|
+
if (fr(c) && c.length > 0) {
|
|
2075
|
+
let h = c.length;
|
|
2076
|
+
const y = c[h - 1], d = S.from(y);
|
|
2077
|
+
if (S.isSame(d, e))
|
|
2087
2078
|
return t(), !0;
|
|
2088
|
-
if (
|
|
2089
|
-
let
|
|
2090
|
-
for (let
|
|
2091
|
-
const
|
|
2092
|
-
if (!(
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
d++;
|
|
2079
|
+
if (h > 0) {
|
|
2080
|
+
let m = !1;
|
|
2081
|
+
for (let p = h - 1; p >= 0; p--) {
|
|
2082
|
+
const v = S.from(c[p]);
|
|
2083
|
+
if (!(v.traceless === !0 || qe(this.traceless, v)) && S.isSame(v, e)) {
|
|
2084
|
+
m = !0;
|
|
2085
|
+
break;
|
|
2096
2086
|
}
|
|
2097
2087
|
}
|
|
2098
|
-
|
|
2099
|
-
t();
|
|
2100
|
-
return;
|
|
2101
|
-
}
|
|
2102
|
-
if (o = y - d, o > 0)
|
|
2103
|
-
return l = setTimeout(u, a), this.go(-d, f), !0;
|
|
2088
|
+
return m ? (a = setTimeout(l, o), this.go(-1, u), !0) : (t(), !0);
|
|
2104
2089
|
}
|
|
2105
2090
|
}
|
|
2106
2091
|
return t(), !0;
|
|
2107
2092
|
};
|
|
2108
|
-
this.go(-
|
|
2093
|
+
this.go(-1, u);
|
|
2109
2094
|
} else
|
|
2110
2095
|
t();
|
|
2111
2096
|
}
|
|
@@ -2836,8 +2821,8 @@ class qs {
|
|
|
2836
2821
|
const h = c.split("=");
|
|
2837
2822
|
if (h.length !== 2)
|
|
2838
2823
|
continue;
|
|
2839
|
-
const y = decodeURIComponent(h[0].trim()),
|
|
2840
|
-
u[y] =
|
|
2824
|
+
const y = decodeURIComponent(h[0].trim()), d = decodeURIComponent(h[1].trim());
|
|
2825
|
+
u[y] = d;
|
|
2841
2826
|
}
|
|
2842
2827
|
q(!0, t.params, u);
|
|
2843
2828
|
} else
|
|
@@ -2966,16 +2951,12 @@ class qs {
|
|
|
2966
2951
|
if (i !== -1 && (l = this[w][i]), this[Ne](a)) {
|
|
2967
2952
|
if (t === !1)
|
|
2968
2953
|
return n.resolve(), r(!0), !0;
|
|
2969
|
-
const u =
|
|
2970
|
-
if (l &&
|
|
2971
|
-
this[A]?.goBack(l,
|
|
2972
|
-
return;
|
|
2973
|
-
}
|
|
2974
|
-
if (l === null && u === 0) {
|
|
2975
|
-
this[A]?.goBack(null, f);
|
|
2954
|
+
const u = () => (n.resolve(), r(!0), !0);
|
|
2955
|
+
if (l && S.isSame(l, this[w][len - 1])) {
|
|
2956
|
+
this[A]?.goBack(l, u);
|
|
2976
2957
|
return;
|
|
2977
2958
|
}
|
|
2978
|
-
|
|
2959
|
+
u();
|
|
2979
2960
|
}
|
|
2980
2961
|
} catch (i) {
|
|
2981
2962
|
this[j](i), n.resolve(), r(!1);
|
|
@@ -3264,12 +3245,12 @@ class qs {
|
|
|
3264
3245
|
for (; f < e.layers.length; f++) {
|
|
3265
3246
|
let c = e.layers[f].views, h = [];
|
|
3266
3247
|
for (let y = c.length - 1; (o || a.length > 0) && y >= 0; y--) {
|
|
3267
|
-
let
|
|
3268
|
-
if (
|
|
3269
|
-
let m =
|
|
3270
|
-
for (let
|
|
3271
|
-
let v = m[
|
|
3272
|
-
v.route &&
|
|
3248
|
+
let d = c[y];
|
|
3249
|
+
if (d[ye] && (o || V.include(a, d[ye]))) {
|
|
3250
|
+
let m = d.slots.value;
|
|
3251
|
+
for (let p = m.length - 1; p >= 0; p--) {
|
|
3252
|
+
let v = m[p];
|
|
3253
|
+
v.route && d[J] && this[je](v.route), h.push(new V(d, v.index, f)), m.splice(p, 1);
|
|
3273
3254
|
}
|
|
3274
3255
|
e.layers[f].views.splice(y, 1);
|
|
3275
3256
|
}
|
|
@@ -3385,26 +3366,26 @@ class qs {
|
|
|
3385
3366
|
status: "error",
|
|
3386
3367
|
message: "can not insert view(override level)"
|
|
3387
3368
|
};
|
|
3388
|
-
let
|
|
3369
|
+
let d;
|
|
3389
3370
|
if (h.rootName) {
|
|
3390
3371
|
let m = o.layers[y - 1];
|
|
3391
|
-
for (let
|
|
3392
|
-
if (
|
|
3393
|
-
|
|
3372
|
+
for (let p of m.views) {
|
|
3373
|
+
if (p[J] && p.name === h.rootName) {
|
|
3374
|
+
d = new V(p, h.rootIndex ?? 0, y - 1);
|
|
3394
3375
|
break;
|
|
3395
3376
|
}
|
|
3396
|
-
if (
|
|
3397
|
-
|
|
3377
|
+
if (p[z] && p[z].view.name === h.rootName && p[z].index === h.rootIndex) {
|
|
3378
|
+
d = p[z];
|
|
3398
3379
|
break;
|
|
3399
3380
|
}
|
|
3400
3381
|
}
|
|
3401
3382
|
}
|
|
3402
|
-
if (!
|
|
3383
|
+
if (!d)
|
|
3403
3384
|
return {
|
|
3404
3385
|
status: "error",
|
|
3405
3386
|
message: "can not insert view(not find root node ref)"
|
|
3406
3387
|
};
|
|
3407
|
-
f = new Ke(l, !0,
|
|
3388
|
+
f = new Ke(l, !0, d), o.layers[y].views.push(f), u = { x: o.layers[y].views.length - 1, y };
|
|
3408
3389
|
}
|
|
3409
3390
|
else
|
|
3410
3391
|
f = o.layers[u.y].views[u.x];
|
|
@@ -3417,12 +3398,12 @@ class qs {
|
|
|
3417
3398
|
}
|
|
3418
3399
|
let y = new ne(t, i, t.index, !0);
|
|
3419
3400
|
f.slots.value = [...h, y];
|
|
3420
|
-
let
|
|
3421
|
-
this[ie](o,
|
|
3401
|
+
let d = c + 1, m = 1, p = new V(f, t.index, c);
|
|
3402
|
+
this[ie](o, d, e, m, p);
|
|
3422
3403
|
} else if (t.opsType === $.Open) {
|
|
3423
3404
|
let h = f.slots.value;
|
|
3424
3405
|
const y = t.active ?? !0;
|
|
3425
|
-
let
|
|
3406
|
+
let d = !1;
|
|
3426
3407
|
for (let m of h) {
|
|
3427
3408
|
if (m.route !== null && S.isSameForRouteModel(m.route, t)) {
|
|
3428
3409
|
if (m.active === y)
|
|
@@ -3430,40 +3411,40 @@ class qs {
|
|
|
3430
3411
|
status: "no-change",
|
|
3431
3412
|
message: ""
|
|
3432
3413
|
};
|
|
3433
|
-
m.active = y,
|
|
3414
|
+
m.active = y, d = !0, t.index = m.index, t.active = y, m.route = t;
|
|
3434
3415
|
} else
|
|
3435
3416
|
y && (m.active = !1);
|
|
3436
3417
|
m.route && (m.route.active = m.active);
|
|
3437
3418
|
}
|
|
3438
|
-
if (!
|
|
3419
|
+
if (!d) {
|
|
3439
3420
|
t.index = t.index ?? le.get(), t.active = y;
|
|
3440
3421
|
let m = new ne(t, i, t.index, y);
|
|
3441
3422
|
h.push(m);
|
|
3442
|
-
let
|
|
3443
|
-
this[ie](o,
|
|
3423
|
+
let p = c + 1, v = 1, g = new V(f, t.index, c);
|
|
3424
|
+
this[ie](o, p, e, v, g);
|
|
3444
3425
|
}
|
|
3445
3426
|
f.slots.value = [...h];
|
|
3446
3427
|
} else {
|
|
3447
3428
|
let h = f.slots.value;
|
|
3448
3429
|
if (h.length == 0) {
|
|
3449
3430
|
t.index = t.index ?? le.get(), t.active = !0, f.slots.value = [new ne(t, i, t.index)];
|
|
3450
|
-
let y = c + 1,
|
|
3451
|
-
this[ie](o, y, e,
|
|
3431
|
+
let y = c + 1, d = 1, m = new V(f, t.index, c);
|
|
3432
|
+
this[ie](o, y, e, d, m);
|
|
3452
3433
|
} else {
|
|
3453
3434
|
let y = h[0];
|
|
3454
3435
|
if (y.model !== i) {
|
|
3455
3436
|
this[fe](o, u, null, !0), t.index = t.index ?? le.get(), t.active = !0, f.slots.value = [new ne(t, i, t.index)];
|
|
3456
|
-
let
|
|
3457
|
-
this[ie](o,
|
|
3437
|
+
let d = c + 1, m = 1, p = new V(f, t.index, c);
|
|
3438
|
+
this[ie](o, d, e, m, p);
|
|
3458
3439
|
} else {
|
|
3459
3440
|
y.route !== null && this[je](y.route);
|
|
3460
|
-
let
|
|
3441
|
+
let d = !1;
|
|
3461
3442
|
const m = t.active ?? !0;
|
|
3462
|
-
y.active !== m && (y.active = m,
|
|
3463
|
-
let
|
|
3443
|
+
y.active !== m && (y.active = m, d = !0), t.active = m, t.index = y.index, y.route = t;
|
|
3444
|
+
let p = [];
|
|
3464
3445
|
for (let K = 1; K < h.length; K++)
|
|
3465
|
-
|
|
3466
|
-
|
|
3446
|
+
p.push(h[K].index);
|
|
3447
|
+
p.length > 0 ? this[fe](o, u, p, !0) : d && (f.slots.value = [...h]);
|
|
3467
3448
|
let v = [new V(f, t.index, c)], g = c + 1, _ = 1, b = new V(f, t.index, c);
|
|
3468
3449
|
for (; v.length > 0 && g < o.layers.length && _ < e.layers.length; g++, _++) {
|
|
3469
3450
|
let K = [];
|
|
@@ -3735,7 +3716,7 @@ function Ir(s, e, t, r = {}, n, i, o, a, l) {
|
|
|
3735
3716
|
!e && x(i) && i();
|
|
3736
3717
|
return;
|
|
3737
3718
|
}
|
|
3738
|
-
const u = Ms(r, e), f = Ns(r, e), c = Is(r, e), h = ks(r, e), y = Us(r, e),
|
|
3719
|
+
const u = Ms(r, e), f = Ns(r, e), c = Is(r, e), h = ks(r, e), y = Us(r, e), d = Ws(r, e);
|
|
3739
3720
|
if (!u && !f && !c && !h) {
|
|
3740
3721
|
!e && x(i) && i();
|
|
3741
3722
|
return;
|
|
@@ -3744,7 +3725,7 @@ function Ir(s, e, t, r = {}, n, i, o, a, l) {
|
|
|
3744
3725
|
Lr(s, t, o, a, n, () => {
|
|
3745
3726
|
f && Ce(t, f), c && Ce(t, c), x(y) && H(s, y, [t, e, o, a]), x(l) && H(s, l, [t]), !e && x(i) && i();
|
|
3746
3727
|
}, () => {
|
|
3747
|
-
x(
|
|
3728
|
+
x(d) && H(s, d, [t, e, o, a]), x(l) && H(s, l, [t]), !e && x(i) && i();
|
|
3748
3729
|
}), u && Ce(t, u), c && Pe(t, c);
|
|
3749
3730
|
});
|
|
3750
3731
|
}
|
|
@@ -4069,12 +4050,12 @@ const Lt = br({
|
|
|
4069
4050
|
if (l = n[Er](c, i, o, a, h, y), l === null)
|
|
4070
4051
|
return;
|
|
4071
4052
|
se(ir, l);
|
|
4072
|
-
const
|
|
4073
|
-
if (
|
|
4053
|
+
const d = l[J] === !0;
|
|
4054
|
+
if (d && se(nr, l), !r && (se(pt, -1), se(dt, i + 1), se(mt, -1), d)) {
|
|
4074
4055
|
const m = nt(t.proxy, !0);
|
|
4075
4056
|
sr(m, () => {
|
|
4076
|
-
const
|
|
4077
|
-
return
|
|
4057
|
+
const p = l.slots.value;
|
|
4058
|
+
return p.length > 0 ? p[0].route : null;
|
|
4078
4059
|
});
|
|
4079
4060
|
}
|
|
4080
4061
|
}
|
|
@@ -4083,7 +4064,7 @@ const Lt = br({
|
|
|
4083
4064
|
f.value && f.value.clear();
|
|
4084
4065
|
}), () => {
|
|
4085
4066
|
if (r) {
|
|
4086
|
-
const c = /* @__PURE__ */ new Map(), h = [], y = l?.slots.value,
|
|
4067
|
+
const c = /* @__PURE__ */ new Map(), h = [], y = l?.slots.value, d = [];
|
|
4087
4068
|
for (let v = 0; v < y.length; v++) {
|
|
4088
4069
|
const g = y[v], _ = `${s.name}_${g.index}`, b = oe(s.transition, g.route, v) ?? !0, K = { modelSlot: g };
|
|
4089
4070
|
let E;
|
|
@@ -4093,13 +4074,13 @@ const Lt = br({
|
|
|
4093
4074
|
const U = oe(s.viewActiveClass, g.route, v), L = oe(s.viewInactiveClass, g.route, v), M = f.value.get(_);
|
|
4094
4075
|
if (typeof U == "string" && U.length > 0 && (P[U] = g.active), typeof L == "string" && L.length > 0 && (P[L] = !g.active), M && g.active !== M.state) {
|
|
4095
4076
|
const Y = M.node;
|
|
4096
|
-
g.active ?
|
|
4077
|
+
g.active ? d.unshift(() => {
|
|
4097
4078
|
const ut = () => {
|
|
4098
4079
|
let Ee = tr(Y);
|
|
4099
4080
|
Ee != null && rr(Ee, qt.ACTIVATED);
|
|
4100
4081
|
};
|
|
4101
4082
|
Js(t, Y, s, g.route, v, b, ut);
|
|
4102
|
-
}) :
|
|
4083
|
+
}) : d.push(() => {
|
|
4103
4084
|
const ut = () => {
|
|
4104
4085
|
const Ee = tr(Y);
|
|
4105
4086
|
Ee != null && rr(Ee, qt.DEACTIVATED);
|
|
@@ -4128,18 +4109,18 @@ const Lt = br({
|
|
|
4128
4109
|
}
|
|
4129
4110
|
f.value.forEach((v) => {
|
|
4130
4111
|
v.node.transition = null;
|
|
4131
|
-
}), f.value = c, Qs(
|
|
4132
|
-
const m = oe(s.tag, null, -1),
|
|
4133
|
-
return Object.assign(
|
|
4112
|
+
}), f.value = c, Qs(d, t);
|
|
4113
|
+
const m = oe(s.tag, null, -1), p = {};
|
|
4114
|
+
return Object.assign(p, e.attrs), he(m, p, { default: () => h });
|
|
4134
4115
|
} else if (u != null) {
|
|
4135
4116
|
const c = u.model, h = {};
|
|
4136
4117
|
if (c.props) {
|
|
4137
4118
|
if (typeof c.props == "object") {
|
|
4138
|
-
const
|
|
4139
|
-
q(!1, h,
|
|
4119
|
+
const d = be(c.props, n?.propsFilter);
|
|
4120
|
+
q(!1, h, d);
|
|
4140
4121
|
} else if (c.props === !0 && typeof u.route?.params == "object") {
|
|
4141
|
-
const
|
|
4142
|
-
q(!1, h,
|
|
4122
|
+
const d = be(u.route.params, n?.propsFilter);
|
|
4123
|
+
q(!1, h, d);
|
|
4143
4124
|
}
|
|
4144
4125
|
}
|
|
4145
4126
|
const y = he(c.component, h);
|
|
@@ -4147,22 +4128,22 @@ const Lt = br({
|
|
|
4147
4128
|
} else {
|
|
4148
4129
|
const c = l.slots.value;
|
|
4149
4130
|
if (c.length > 0) {
|
|
4150
|
-
const h = c[0], y = h.route ?? (t.proxy && Vt(t.proxy)) ?? null,
|
|
4151
|
-
if (
|
|
4152
|
-
if (typeof
|
|
4153
|
-
const g = be(
|
|
4131
|
+
const h = c[0], y = h.route ?? (t.proxy && Vt(t.proxy)) ?? null, d = h.model, m = {};
|
|
4132
|
+
if (d.props) {
|
|
4133
|
+
if (typeof d.props == "object") {
|
|
4134
|
+
const g = be(d.props, n?.propsFilter);
|
|
4154
4135
|
q(!1, m, g);
|
|
4155
|
-
} else if (
|
|
4136
|
+
} else if (d.props === !0 && typeof y?.params == "object") {
|
|
4156
4137
|
const g = be(y.params, n?.propsFilter);
|
|
4157
4138
|
q(!1, m, g);
|
|
4158
4139
|
}
|
|
4159
4140
|
}
|
|
4160
|
-
const
|
|
4141
|
+
const p = he(d.component, m);
|
|
4161
4142
|
if (oe(s.transition, y, -1) ?? !0) {
|
|
4162
4143
|
const g = Ot(t, s, y, -1);
|
|
4163
|
-
|
|
4144
|
+
p.transition = g;
|
|
4164
4145
|
}
|
|
4165
|
-
return Kt(e.slots.default, { Component:
|
|
4146
|
+
return Kt(e.slots.default, { Component: p, route: y }) ?? p;
|
|
4166
4147
|
} else
|
|
4167
4148
|
return Kt(e.slots.fallback, {});
|
|
4168
4149
|
}
|
package/libs/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* fox v3.0.0
|
|
3
|
-
*/const me=typeof window<"u",$=function(){return window},Ve=function(){return window.document};function Wr(n){let e=n,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 at(){if(!me)return"/";let n=$().location,e=`${n.protocol}//${n.host}`;return e+=Wr(n.pathname),e}function ut(n,e,t){n.addEventListener?n.addEventListener(e,t,!1):n.attachEvent?n.attachEvent(`on${e}`,t):n[`on${e}`]=t}function ft(n,e,t){n.removeEventListener?n.removeEventListener(e,t):n.detachEvent?n.detachEvent(`on${e}`,t):n[`on${e}`]=null}const zr=Array.isArray,Jr=n=>Be(n)==="[object Map]",Gr=n=>Be(n)==="[object Set]",Qr=n=>n instanceof Date,S=n=>typeof n=="function",Xr=n=>typeof n=="string",Yr=n=>typeof n=="symbol",tr=n=>n!==null&&typeof n=="object",Zr=n=>tr(n)&&S(n.then)&&S(n.catch),rr=n=>n==null,en=Object.prototype.toString,Be=n=>en.call(n),nr=n=>Be(n)==="[object Object]",tn=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function ct(n){return n.__esModule||tn&&n[Symbol.toStringTag]==="Module"}const rn=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...n){let e=n[0]!==void 0&&n[0]!==null?n[0]:{},t=1,r=n.length,s=!1;for(typeof e=="boolean"&&(s=e,e=n[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(n[t]!==null&&n[t]!==void 0){let i=n[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(s,u,l)}else l!==void 0&&(e[o]=l)}}return e}function ke(n,e,t=!1){if(!t)K(!0,n,e);else{if(typeof e!="object")return{};typeof n!="object"&&(n={});for(let r of Reflect.ownKeys(e)){let s=n[r],i=e[r];if(s!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!nr(i))continue;s=ke(s,i,t),n[r]=s}else{if(typeof i=="function")continue;n[r]=i}}}return n}class se{static seed=new Date().getTime();static get(){let e=++se.seed;return e>=Number.MAX_VALUE&&(se.seed=0),e}}const ht=rn?Promise.resolve():null;function Ee(n,...e){ht!==null?e&&e.length>0?ht.then(()=>{n(e)}):ht.then(n):e&&e.length>0?setTimeout(()=>{n(e)}):setTimeout(n)}function yt(n){return n==null?!1:typeof n=="boolean"?n:typeof n=="string"?n.toLocaleLowerCase()==="true":!!n}function nn(n){return typeof n=="number"?n:Number(n)}const sn={"[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 dt(n){let t=Object.prototype.toString.call(n);return n==null?String(n):sn[t]||"object"}function mt(n,e){if(n==e)return!0;if(n===void 0||e===void 0)return!1;let t=dt(n),r=dt(e);if(t!==r)return!1;if(t==="object"){let s=Object.keys(n),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=n[a],u=e[a];if(!mt(l,u))return!1}return!0}else if(t==="array"){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){let i=n[s],o=e[s];if(!mt(i,o))return!1}return!0}return!1}const sr=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=sr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},on=/^Symbol\((.*)\)$/,ir=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=ir(r));const s=on.exec(t);if(s&&s[1]){const i=Symbol.for(s[1]);e[i]=r}else e[t]=r}return e},or=Symbol("idKey"),ue=Symbol("valueKey"),P=Symbol("childrenKey"),z=Symbol("growKey");class lr{[z]=!0;[or];[ue]=b.ref();[P]=new Map;constructor(e){this[or]=e}}class ln{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];let r=e[P].get(t);if(r)return Ae(r);if(e[z])return r=gt(t),r[z]=e[z],e[P].set(t,r),Ae(r)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=yt(r),!0):r==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 pt="__proxy__";function gt(n){const e=new lr(n);return Reflect.set(e,pt,new Proxy(e,new ln)),e}function Ae(n){return Reflect.get(n,pt)}class an{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&rr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){const t=$();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,s=t.getItem(r);s&&(this.state=JSON.parse(s),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),s=e[t-1];this.state[r]=s,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),s={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(s[o]=this.state[o]))}),this.state=s,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class ar extends lr{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new an(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let s=0;s<t-1;s++){let i=e[s],o;r[P].has(i)?o=r[P].get(i):(o=gt(i),r[P].set(i,o)),r=o}return r[ue].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let s=0;s<t;s++){let i=e[s];if(r[P].has(i))r=r[P].get(i);else return}return r[ue].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[P].has(o))r=r[P].get(o);else return!1}const s=e[t-1];return r[P].has(s)?(r[P].delete(s),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[P].has(o))r=r[P].get(o);else return!1}const s=e[t-1];return r[P].has(s)}clear(){this[P].clear(),this._persistHandler.clear()}}const un=["put","get","contains","remove","clear","_persistHandler"];function ur(n){return un.includes(n)}class fn{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];if(t===P)return e[P];if(typeof t=="string"&&ur(t))return e[t];let r=String(t),s=e[P].get(r);if(s)return Ae(s);if(e[z])return s=gt(r),s[z]=e[z],e[P].set(r,s),Ae(s)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=yt(r),!0):ur(t)?!1:r==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 cn(n){const e=new ar(n),t=new fn,r=new Proxy(e,t);return Reflect.set(e,pt,r),e}const vt=new Proxy(ar,{construct(n,e){const t=cn(e[0]??{});return Ae(t)}}),Y="default",fr=Symbol("sync"),N=Symbol("resolveRoute");function cr(n){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(n,{},t)}}function hn(n){let e=n.src;return new Promise((t,r)=>{const s=cr(a=>{ct(a)&&(a=a.default),n.component=a,console.debug("success load async module"),t()}),i=cr(a=>{console.debug("reject load async module"),r(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 yn{name;level;rootName;rootIndex=0;constructor(e,t,r,s){this.name=e,this.level=t,this.rootName=r,this.rootIndex=s}}class Ue{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ue(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class C{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new C;return ke(r,e,t),r}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 C;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)r[i]=e[i];return t}}class dn{id;name;props;meta;src;component;constructor(e,t,r,s){this.id=se.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return hn(this)}}class hr{models=[]}class wt{path;match;redirect;name;layers=[]}const B=Symbol("chainKey"),I=Symbol("cursorKey"),bt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),We=Symbol("exArgsKey"),pe=Symbol("successFnsKey"),Fe=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),ee=Symbol("_go");class _e{[B]=[];[I]=0;[bt]=!1;[T]="Free";[Z]=[];[We]=[];[pe]=[];[Fe]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[bt]=t}[ee](e,...t){let r=this[T];if(this[T]="Busy",this[I]+=e,this[I]<0&&(this[I]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[ie]},...this[We]];for(;this[Fe].length>0;)try{let l=this[Fe].shift();typeof l=="function"&&Ee(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=r,this[B]=[],this[I]=0,this}else if(r==="Finished"||this[I]>=this[B].length){let a=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let l=this[pe].shift();typeof l=="function"&&Ee(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[I]>=this[B].length)return this[T]="Free",this;let s=this[B][this[I]];this[bt]||(this[B].splice(0,this[I]+1),this[I]=-1);let i=this[I]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},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[B].splice(i,0,l),i++)},session:this[ie]};Ee(()=>{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[We]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[We]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[B]=[],this[I]=0;let r=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let s=this[pe].shift();Ee(()=>{Reflect.apply(s,this,r)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[pe].push(e),t&&typeof t=="function"&&this[Fe].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Fe].push(e),this[T]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[I]>=this[B].length}}const ge=Symbol("registerKey");class mn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Rt{[ge]=new Map;constructor(){}on(e,t,r=!1){let s=this[ge].get(e);s||(s=new Array,this[ge].set(e,s));let i=r===!0?1:0,o=new mn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ge].delete(e),this;let r=this[ge].get(e);if(r){for(let s=0;s<r.length;s++)if(r[s].callback===t){r.splice(s,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}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 r=e[t-1];if(typeof r!="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(r,{},i)});return this}emit(e,...t){let r=this[ge].get(e);if(!r)return this;for(let s=0;s<r.length;){let i=r[s];if(i.policy==1?r.splice(s,1):s++,typeof i.callback=="function")try{Ee(()=>{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 Ke=Symbol("registerKey");class pn{[Ke]=new Map;constructor(){}set(e,t){this[Ke].set(e,t)}get(e){return this[Ke].get(e)}has(e){return this[Ke].has(e)}delete(e){return this[Ke].delete(e)}}const fe=Symbol("lc");function ze(n,e=!1){let t=n;if(Reflect.has(t,fe))return t[fe];if(e){const r=new pn;return t[fe]=r,r}return null}function yr(n,e=!1){let t=null,r=n;for(;r&&!(Reflect.has(r,fe)&&(t=r[fe],t));)r=r.$parent;if(!t&&e){const s=n;s&&s.$parent&&(t=ze(s.$parent,e))}return t}function xt(n,e){let t=n;for(;t;){if(Reflect.has(t,fe)){const r=t[fe];if(r.has(e))return r.get(e)}t=t.$parent}return null}function gn(n,e,t){yr(n,!0)?.set(e,t)}function vn(n,e){yr(n,!0)?.delete(e)}function dr(n){if(Array.isArray(n.children)&&n.children.length>0){let e=n.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return ze(e.component.proxy,!1)}return null}const Je=Symbol("hooksKey");function wn(n){let e=n.get(Je);e||(e=[],n.set(Je,e))}function mr(n,e){let t=n.get(Je);if(t!=null)for(let r=t.length-1;r>=0;r--){let s=t[r];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var St=(n=>(n.DEACTIVATED="da",n.ACTIVATED="a",n))(St||{});class bn{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Rn(n,e,t,r){let s=new bn(e,t,r);return n.push(s),!0}function xn(n,e,t,r){let s=-1;for(let i=0;i<n.length;i++){let o=n[i];if(o.type===e&&o.hook===t&&o.target===r){s=i;break}}return s!=-1?(n.splice(s,1),!0):!1}function pr(n){return(e,t)=>{let r;if(t)r=t;else{const i=b.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const s=xt(r,Je);if(s==null){console.warn("can not get hooks context");return}b.onUnmounted(()=>{xn(s,n,e,r)}),Rn(s,n,e,r)}}const Sn=pr("a"),Pn=pr("da"),Pt=Symbol("routeKey");function gr(n,e){n.set(Pt,e)}function Ct(n){let e=xt(n,Pt);return typeof e=="function"?e():e??null}const Ge=Symbol("rk"),Et=Symbol("vd"),vr=Symbol("rv"),At=Symbol("rvi"),wr=Symbol("pv"),Ft=Symbol("pvi");function Cn(n){for(var e=[],t=0;t<n.length;){var r=n[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:n[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:n[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:n[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:n[t++]});continue}if(r===":"){for(var s="",i=t+1;i<n.length;){var o=n.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=n[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(r==="("){var a=1,l="",i=t+1;if(n[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<n.length;){if(n[i]==="\\"){l+=n[i++]+n[i++];continue}if(n[i]===")"){if(a--,a===0){i++;break}}else if(n[i]==="("&&(a++,n[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=n[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:n[t++]})}return e.push({type:"END",index:t,value:""}),e}function br(n,e){e===void 0&&(e={});for(var t=Cn(n),r=e.prefixes,s=r===void 0?"./":r,i="[^".concat(ve(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(_){if(l<t.length&&t[l].type===_)return t[l++].value},c=function(_){var A=f(_);if(A!==void 0)return A;var F=t[l],Q=F.type,D=F.index;throw new TypeError("Unexpected ".concat(Q," at ").concat(D,", expected ").concat(_))},h=function(){for(var _="",A;A=f("CHAR")||f("ESCAPED_CHAR");)_+=A;return _};l<t.length;){var y=f("CHAR"),m=f("NAME"),p=f("PATTERN");if(m||p){var d=y||"";s.indexOf(d)===-1&&(u+=d,d=""),u&&(o.push(u),u=""),o.push({name:m||a++,prefix:d,suffix:"",pattern:p||i,modifier:f("MODIFIER")||""});continue}var g=y||f("ESCAPED_CHAR");if(g){u+=g;continue}u&&(o.push(u),u="");var v=f("OPEN");if(v){var d=h(),q=f("NAME")||"",x=f("PATTERN")||"",O=h();c("CLOSE"),o.push({name:q||(x?a++:""),pattern:q&&!x?i:x,prefix:d,suffix:O,modifier:f("MODIFIER")||""});continue}c("END")}return o}function En(n,e){return An(br(n,e),e)}function An(n,e){e===void 0&&(e={});var t=_t(e),r=e.encode,s=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=n.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<n.length;f++){var c=n[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",m=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!m)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var d=s(h[p],c);if(o&&!a[f].test(d))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(d,'"'));u+=c.prefix+d+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var d=s(String(h),c);if(o&&!a[f].test(d))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(d,'"'));u+=c.prefix+d+c.suffix;continue}if(!y){var g=m?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(g))}}return u}}function Fn(n,e){var t=[],r=Rr(n,t,e);return _n(r,t,e)}function _n(n,e,t){t===void 0&&(t={});var r=t.decode,s=r===void 0?function(i){return i}:r;return function(i){var o=n.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(m){return s(m,y)}):u[y.name]=s(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function ve(n){return n.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _t(n){return n&&n.sensitive?"":"i"}function Kn(n,e){if(!e)return n;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,s=t.exec(n.source);s;)e.push({name:s[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(n.source);return n}function Tn(n,e,t){var r=n.map(function(s){return Rr(s,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),_t(t))}function $n(n,e,t){return jn(br(n,t),e,t)}function jn(n,e,t){t===void 0&&(t={});for(var r=t.strict,s=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(D){return D}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,m=y===void 0?"":y,p="[".concat(ve(m),"]|$"),d="[".concat(ve(h),"]"),g=o?"^":"",v=0,q=n;v<q.length;v++){var x=q[v];if(typeof x=="string")g+=ve(f(x));else{var O=ve(f(x.prefix)),_=ve(f(x.suffix));if(x.pattern)if(e&&e.push(x),O||_)if(x.modifier==="+"||x.modifier==="*"){var A=x.modifier==="*"?"?":"";g+="(?:".concat(O,"((?:").concat(x.pattern,")(?:").concat(_).concat(O,"(?:").concat(x.pattern,"))*)").concat(_,")").concat(A)}else g+="(?:".concat(O,"(").concat(x.pattern,")").concat(_,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?g+="((?:".concat(x.pattern,")").concat(x.modifier,")"):g+="(".concat(x.pattern,")").concat(x.modifier);else g+="(?:".concat(O).concat(_,")").concat(x.modifier)}}if(l)s||(g+="".concat(d,"?")),g+=t.endsWith?"(?=".concat(p,")"):"$";else{var F=n[n.length-1],Q=typeof F=="string"?d.indexOf(F[F.length-1])>-1:F===void 0;s||(g+="(?:".concat(d,"(?=").concat(p,"))?")),Q||(g+="(?=".concat(d,"|").concat(p,")"))}return new RegExp(g,_t(t))}function Rr(n,e,t){return n instanceof RegExp?Kn(n,e):Array.isArray(n)?Tn(n,e,t):$n(n,e,t)}var j=(n=>(n[n.Push=0]="Push",n[n.Replace=1]="Replace",n[n.Put=2]="Put",n[n.Append=3]="Append",n[n.Open=4]="Open",n))(j||{}),Qe=(n=>(n[n.Part=0]="Part",n[n.All=1]="All",n))(Qe||{});const J=Symbol("rootKey"),G=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Xe=Symbol("nameKey");class oe{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,s=!0){this.route=e,this.model=t,this.index=r,this.active=s}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=b.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Xe];[J];[G]=null;[ce]=null;get name(){return this[Xe]}constructor(e,t,r){this[Xe]=e,this[J]=t,r&&(this[G]=r)}}class k{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let s=e[r];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class Kt{views=[]}class qn{layers=[]}class On{time;route}class Ln{forbidTime=300;submitRecorder=new On;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=Symbol("_notifyChange");class xr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const he=Symbol("historyChangeConsumerKey"),Sr=Symbol("_navigateFirstRoute"),Ye=Symbol("_getRouteMark"),Tt=Symbol("_getUrlSearch"),$t=Symbol("_generateLocation"),$e=Symbol("_setRouteMarkRecorder"),je=Symbol("beforeRestoreFiltersKey"),Pr=Symbol("_beforeRestore"),Cr="Symbol(_fox_restore_point)";function qe(n,...e){return typeof n=="function"?Reflect.apply(n,null,[...e]):n}function Er(n){if(!Array.isArray(n))return!1;if(n.length===0)return!0;const e=n[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[he]=!1;[je]=new Array;backTimeout=320;constructor(e="hash",t="",r="",s=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??$().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=$();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[he]=="function"){const r=this[he]();if(this[he]=!1,r)return}else if(this[he]===!0){this[he]=!1;return}if(qe(this.historyMonitor)){const r=t.history.state;this[we](r);try{let s=[];if(typeof r=="string"?s=JSON.parse(r):s=r,Array.isArray(s)&&s.length>0){const i=this[Ye]()??"/";this[$e](i,s)}}catch{}}}),ut(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Sr](),Promise.resolve()}destroy(){if(this.historyChange){const e=$();ft(e,"popstate",this.historyChange)}}[Pr](e,t,r,s){for(let i of this[je])try{const o=Reflect.apply(i,{},[e,t,r,s]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[je].push(e)}removeBeforeRestoreEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}[Sr](){const e=this[Ye]()??"/",t=this.storage.getItem(Cr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?ir(l.params):{},this[Pr](l,u,e,o.routes)));if(a.length>0){const l=this[Tt](),u=a.length-1;a[u].query=l||a[u].query,this[we](a);return}}}catch{}const r=e.indexOf("!");let s;r!=-1?s=e.substring(r+1):s=e;const i=new C;i.path=s,i.query=this[Tt](),this[we]([i])}[$e](e,t){try{t.forEach(i=>{i.params=i.params?sr(i.params):{}});const s=JSON.stringify({mark:e,routes:t});this.storage.setItem(Cr,s)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ye]()??"/";this[$e](t,e)}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ye](){const e=$();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,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[Tt](){let t=$().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=$();this[he]=t,r.history.go(e)}goBack(e,t){const r=$(),s=r.history.state;if(Er(s)&&s.length>0){let i=0;if(e===null)i=s.length;else for(let c=s.length-1;c>=0;c--){const h=C.from(s[c]);if(!(h.traceless===!0||qe(this.traceless,h))){if(C.isSame(h,e))break;i++}}if(i===0){t();return}let o=s.length-i;if(e!==null&&o===0){t();return}const a=this.backTimeout;let l=null;const u=()=>{r.history.go(-1),l=setTimeout(u,a)};l=setTimeout(u,a);const f=()=>{clearTimeout(l);const h=$().history.state;if(Er(h)&&h.length>0){let y=h.length;const m=h[y-1],p=C.from(m);if(e==null||C.isSame(p,e))return t(),!0;if(y>o){let d=0;for(let g=y-1;g>=0;g--){const v=C.from(h[g]);if(!(v.traceless===!0||qe(this.traceless,v))){if(C.isSame(v,e))break;d++}}if(d===0){t();return}if(o=y-d,o>0)return l=setTimeout(u,a),this.go(-d,f),!0}}return t(),!0};this.go(-i,f)}else t()}push(e){const t=this[$t](e.currentRoute);e.currentRoute.traceless!==!0&&!qe(this.traceless,e.currentRoute)&&$().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[$e](r,e.routes)}replace(e){const t=this[$t](e.currentRoute);e.currentRoute.traceless!==!0&&!qe(this.traceless,e.currentRoute)&&$().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[$e](r,e.routes)}[$t](e){const t=$();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const s=t.location;let i=e.alias??e.fullPath;i.startsWith(Y)&&(i=i.substring(Y.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${s.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Mn(n=!0,e=null,t="",r=!0,s=!1,i){return e!==null&&(e=$().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,n,r,s,i)}function Fr(n=!0,e="",t=!0,r=!1,s){return new Ar("hash","",e,n,t,r,s)}class Nn{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=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let s=!1;if(typeof t=="function"?s=t():s=t,!s){const i=this.queue[r];this[we](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let s=this.cursor;s>=0;s--){const i=this.queue[s];if(C.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}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(n="",e=50){return new Nn(n,e)}function bs(n){}const Ze=Symbol("_constructRouteModel"),et=Symbol("_findRouteModel"),jt=Symbol("_findRootView"),Kr=Symbol("_getFirstView"),ye=Symbol("_removeView"),Tr=Symbol("_buildPage"),$r=Symbol("_resolveComponent"),jr=Symbol("_update"),le=Symbol("_merge"),qt=Symbol("_handleHistoryChange"),tt=Symbol("_handleRouteUpdated"),rt=Symbol("routeUpdatedCallback"),R=Symbol("currentRoutes"),be=Symbol("current"),qr=Symbol("_addRouteRecorder"),Oe=Symbol("_removeRouteRecorder"),nt=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),st=Symbol("errorCallback"),U=Symbol("registerKey"),it=Symbol("notFoundKey"),Ot=Symbol("notFoundPathKey"),W=Symbol("forestKey"),E=Symbol("historyKey"),Le=Symbol("beforeFiltersKey"),Me=Symbol("afterFiltersKey"),Ne=Symbol("destroyFiltersKey"),Lt=Symbol("propsFilterKey"),Re=Symbol("mainDispatcherKey"),Mt=Symbol("initKey"),de=Symbol("readyKey"),Nt=Symbol("readyHandlersKey"),ot=Symbol("_markReady"),Or=Symbol("_createNextFn"),It=Symbol("_start"),Ht=Symbol("_before"),Dt=Symbol("_after"),Lr=Symbol("_destroy"),Vt=Symbol("_load"),Ie=Symbol("_unload"),He=Symbol("routerGuardKey");function In(n){return n.layers.length==0||n.layers[0].views.length==0}function Hn(n){let e=[];return n.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let s=K(!0,{},r.meta);e.push(s)}else r.meta&&e.push(r.meta)})}),e}class Dn{[U]=new Array;[it];[Ot]="*";[de]=!1;[Nt]=[];[W]=new qn;[E];[R]=new Array;[st]=null;[rt]=null;[Le]=new Array;[Me]=new Array;[Ne]=new Array;[Lt]=null;[Re]=new _e;[He]=new Ln;[Mt]=!1;[be]=b.ref(null);get current(){return this[be].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[E]=e.history:this[E]=me?Fr():_r(),this[E]?.listen(async r=>{let s=!0;try{if(typeof r=="string"){const i=this[N](r);i&&await this[qt]([i])}else await this[qt](r)}catch(i){console.error(i.message,i),s=!1}this[de]===!1&&this[ot](s)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[st]=="function")try{this[st](e,t)}catch{}console.error(e)}init(){this[Mt]!==!0&&(this[E]?.init(!this[de]),this[Mt]=!0)}isReady(){return this[de]?Promise.resolve():new Promise((e,t)=>{this[Nt].push([e,t])})}[ot](e){this[de]=!0,this[Nt].forEach(([t,r])=>{try{e?t():r()}catch(s){console.error(s.message,s)}})}[qt](e){try{if(!e){let o=[...this[R]].reverse();return this[Ie](o),me&&$().location.reload(),Promise.resolve()}let t=null,r=[],s=[],i=0;for(;i<e.length&&i<this[R].length&&C.isSame(e[i],this[R][i]);i++)e[i].active===!0&&e[i].active!==this[R][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[R].length&&(s=this[R].slice(i).reverse()),s.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Ie](s)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[L](t)}return Promise.resolve()}[tt](e){if(e)this[be].value=e;else{let t=this[R].length;t>0?this[be].value=this[R][t-1]:this[be].value=null}if(typeof this[rt]=="function")try{this[rt](this[be].value)}catch{}}[qr](e){if(e.opsType===j.Open){let t=!1;const r=this[R].length-1;for(let s=r;s>=0;s--){const i=this[R][s];if(e.root==i.root){if(e.path===i.path){this[R].splice(s,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[R].push(e)}else this[R].push(e)}[nt](){let e=[];for(let t of this[R]){let r=C.clone(t,!0);e.push(r)}return e}[Oe](e){if(!this[R])return;let t=-1;for(let r=0;r<this[R].length;r++)if(C.isSame(this[R][r],e)){t=r;break}if(t!=-1){let r=this[R][t];this[R].splice(t,1),this[Lr](r,r.session)}}set historyMonitor(e){this[E]&&(this[E].historyMonitor=e)}get historyMonitor(){return this[E]?this[E].historyMonitor:!1}set traceless(e){this[E]&&(this[E].traceless=e)}get traceless(){return this[E]?this[E].traceless:!1}set propsFilter(e){this[Lt]=e}get propsFilter(){return this[Lt]}setRestorePoint(){const e=this[nt]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[rt]=e}onError(e){this[st]=e}beforeEach(e){this[Le].push(e)}removeBeforeEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}afterEach(e){this[Me].push(e)}removeAfterEach(e){const t=this[Me].indexOf(e);return t!==-1?(this[Me].splice(t,1),!0):!1}destroyEach(e){this[Ne].push(e)}removeDestroyEach(e){const t=this[Ne].indexOf(e);return t!==-1?(this[Ne].splice(t,1),!0):!1}beforeRestoreEach(e){this[E]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[E]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ot]){this.setNotFoundRoute(e);return}const r=this[Ze](e);if(t==-1)this[U]=[...this[U],...r];else for(let s=r.length-1;s>=0;s--)this[U].splice(t,0,r[s])}removeRoute(e){const t=this[N](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[U].length;r++){const s=this[U][r];if(t?.path&&s.path===t.path)return this[U].splice(r,1),!0;if(t?.name&&s.name===t.name)return this[U].splice(r,1),!0}return!1}hasRoute(e){const t=this[N](e);return t===null?(console.warn("route格式错误",e),!1):this[U].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ot]=e}setNotFoundRoute(e){const t=this[Ze](e);this[it]=t[0]}getRoutes(){return[...this[U]]}[Ze](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new wt;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in r){let l=r[a];a.length===0&&(a=Y);let u=new dn(a,l,e.props,e.meta);s.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ze](a);for(let u of l){let f=new wt;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new hr;c.models=[...s],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new hr;a.models=s;const l=new wt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[et](e){const t=e.route;try{for(let r of this[U]){const s=t.template??t.path,i=t.template??t.name;if(s&&r.path){let o=r.match;o||(o=r.match=Fn(r.path));const a=o(s);if(!a)continue;if(r.redirect){const l=new C;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[et](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),m=decodeURIComponent(h[1].trim());u[y]=m}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=En(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[N](e){let t=null;if(Array.isArray(e))if(t=new C,typeof e[0]=="object")t=C.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=C.from(e):typeof e=="string"&&(t=new C,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??Y,t.opsType=t.opsType??this.options.defaultOperationType??j.Push}return t}push(...e){let t=this[N](e);return t?(t.opsType=t.opsType||j.Push,this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){let t=this[N](e);return t?(t.opsType=j.Put,t.traceless=!0,this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){let t=this[N](e);return t?(t.opsType=j.Replace,this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){let t=this[N](e);return t?(t.opsType=j.Append,this.to(t)):(this[L]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[Re].post(s=>{try{if(this[R].length===0){s.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[R][0].root??Y,e.all)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=Y;let u=this[Kr](this[W]);u&&(o=u.name);for(let f=this[R].length-1;f>0;f--){let c=this[R][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),s.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[R][i]),this[Ie](a)){if(t===!1)return s.resolve(),r(!0),!0;const u=this[R].length,f=()=>(s.resolve(),r(!0),!0);if(l&&u>0&&C.isSame(l,this[R][u-1])){this[E]?.goBack(l,f);return}if(l===null&&u===0){this[E]?.goBack(null,f);return}f()}}catch(i){this[L](i),s.resolve(),r(!1)}})})}open(...e){let t=this[N](e);return t?(t.opsType=j.Open,this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[Re].post(t=>{try{let r=this[N](e);if(!r){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[R].length;i++){let o=this[R][i];if(o.root===r.root){if(!r.path&&!r.name){s.push(o);continue}if(r.path&&r.path===o.path){s.push(o);break}else if(r.name&&r.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Ie](s)&&this[tt](),t.resolve()}catch(r){this[L](r),t.resolve()}}),this}to(...e){let t=this[N](e);if(!t)return this[L]("resolve route fail",t),this;let r=this[He].acquire(t);return r==null?(this[L]("route forbid",t),this):(this[Re].post(s=>{try{let i=this[It](t);this[Ht](i),this[Vt](i),this[Dt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=C.clone(l,!0);const f=new xr(u,this[nt]());l.opsType===j.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[He].release(r),this[tt](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[de]===!1&&this[ot](!0),s.resolve()},(o,a)=>{this[He].release(r),a!==null&&this[L](a,t),this[de]===!1&&this[ot](!1),s.resolve()})}catch(i){this[He].release(r),this[L](i,t),s.resolve()}}),this)}back(e=1){this[E]?.go(-e,!1)}[Or](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const s=this[N](t);if(s){const i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[It](e){let t=this[R].length>0?this[R][0]:void 0,r=new Ue(e,t),s={route:e,find:null};return this[et](s),s.find&&(r.routeModel=s.find,e.matched=Hn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new _e(r)}[Ht](e){for(let t of this[Le])e.post(r=>{const s=this[Or](r);Reflect.apply(t,{},[r.session.to,r.session.from,s,r.session])})}[Dt](e){e.post(t=>{for(let r of this[Me])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[Lr](e,t){for(let r of this[Ne])try{Reflect.apply(r,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Vt](e){e.post(t=>{let r=t.session.to,s=t.session.routeModel;if(s==null){let o={route:r,find:null};if(this[et](o))s=o.find,t.session.routeModel=s;else if(this[it])s=this[it];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=Ue.from(t.session);this[Tr](r,s,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Ie](e){if(e.length==0)return!0;let t=this[W],r=[];for(let s of e){let i=this[jt](t,s);i!=null&&r.push({...i,route:s})}if(r.length==0){let s="can not find view index";return this[L](s),!1}for(let s of r.reverse())this[ye](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[jt](e,t){const r=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[J]&&l[Xe]===r)return s={x:a,y:i},s}}return null}[Kr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ye](e,t,r=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,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[J]&&(this[Oe](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new k(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)s?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let y=c.length-1;(o||a.length>0)&&y>=0;y--){let m=c[y];if(m[ce]&&(o||k.include(a,m[ce]))){let p=m.slots.value;for(let d=p.length-1;d>=0;d--){let g=p[d];g.route&&m[J]&&this[Oe](g.route),h.push(new k(m,g.index,f)),p.splice(d,1)}e.layers[f].views.splice(y,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[U].length==0){let t=this[W];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[R]=[],this[tt](),Promise.resolve()}else return new Promise((r,s)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[Re].post(u=>{const f=this[It](l);this[Ht](f),this[Vt](f),this[Dt](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[L](h),u.resolve()})})}this[Re].post(a=>{if(i&&o===!0){const l=C.clone(i,!0),u=new xr(l,this[nt]());this[E]?.replace(u)}a.resolve(),r()})})}[Tr](e,t,r){const s=e.updateType??Qe.Part;return this[$r](t).then(()=>{const o=this[jr](t,e,r,s);if(o.status==="error")throw Error(o.message);return o})}[$r](e){let t=[];for(let r=0;r<e.layers.length;r++){let s=e.layers[r];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()}[jr](e,t,r,s){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[W],a=In(o),l=t.root??Y,u;!a&&s==Qe.Part&&(u=this[jt](o,t));let f,c=0;if(u==null||u==null)if(a||s===Qe.All){if(o.layers.length==0&&(o.layers[0]=new Kt),o.layers[0].views.length==0){let h=t.root??Y;f=new Te(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let m;if(h.rootName){let p=o.layers[y-1];for(let d of p.views){if(d[J]&&d.name===h.rootName){m=new k(d,h.rootIndex??0,y-1);break}if(d[G]&&d[G].view.name===h.rootName&&d[G].index===h.rootIndex){m=d[G];break}}}if(!m)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Te(l,!0,m),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[J]=!0,t.opsType===j.Append){t.index=t.index??se.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let g=h[h.length-1];g.active=!1,g.route&&(g.route.active=g.active)}let y=new oe(t,i,t.index,!0);f.slots.value=[...h,y];let m=c+1,p=1,d=new k(f,t.index,c);this[le](o,m,e,p,d)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let m=!1;for(let p of h){if(p.route!==null&&C.isSameForRouteModel(p.route,t)){if(p.active===y)return t.index=p.index,t.active=y,p.route=t,{status:"no-change",message:""};p.active=y,m=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!m){t.index=t.index??se.get(),t.active=y;let p=new oe(t,i,t.index,y);h.push(p);let d=c+1,g=1,v=new k(f,t.index,c);this[le](o,d,e,g,v)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=t.index??se.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let y=c+1,m=1,p=new k(f,t.index,c);this[le](o,y,e,m,p)}else{let y=h[0];if(y.model!==i){this[ye](o,u,null,!0),t.index=t.index??se.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let m=c+1,p=1,d=new k(f,t.index,c);this[le](o,m,e,p,d)}else{y.route!==null&&this[Oe](y.route);let m=!1;const p=t.active??!0;y.active!==p&&(y.active=p,m=!0),t.active=p,t.index=y.index,y.route=t;let d=[];for(let O=1;O<h.length;O++)d.push(h[O].index);d.length>0?this[ye](o,u,d,!0):m&&(f.slots.value=[...h]);let g=[new k(f,t.index,c)],v=c+1,q=1,x=new k(f,t.index,c);for(;g.length>0&&v<o.layers.length&&q<e.layers.length;v++,q++){let O=[];for(let A=0;A<o.layers[v].views.length;A++){let F=o.layers[v].views[A];F[ce]&&k.include(g,F[ce])&&O.unshift(A)}let _=[];for(let A of O){let F=o.layers[v].views[A],Q=e.layers[q].models,D;for(let V=0;V<Q.length;V++)if(F.name===Q[V].name){D=Q[V];break}if(!D)this[ye](o,{x:A,y:v},null,!1);else{let V=F.slots.value;if(V.length==0){let te=0;F.slots.value=[new oe(null,D,te)];let X=v+1,ne=q+1;this[le](o,X,e,ne,x)}else{let te=V[0];if(te.model!==D){this[ye](o,{x:A,y:v},null,!0),F.slots.value=[new oe(null,D,0)];let X=v+1,ne=q+1;this[le](o,X,e,ne,x)}else{F[J]&&te.route!==null&&this[Oe](te.route);let X=[];for(let ne=1;ne<V.length;ne++)X.push(V[ne].index);X.length>0&&this[ye](o,{x:A,y:v},X,!0),_.push(new k(F,te.index,v))}}F[J]=!1}}g=_}this[le](o,v,e,q,x)}}}if(f&&f[G]){let h=f[G];h&&(t.slot=new yn(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[qr](t),{status:"success",message:""}}[le](e,t,r,s,i){let o=s,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),c=new oe(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new Kt;l.views=[];for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),c=new oe(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[fr](e,t,r,s,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let f=this[W].layers[t],c=null;for(let h of f.views){let y=!1;if(r!==null?(y=h.name===e&&h[G]?.view===r,y&&s!==-1&&(y=h[G]?.index===s)):y=h.name===e,!!y){i!==null&&(h[ce]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[J]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new Te(e,!0,a);if(u[ce]=l,t==this[W].layers.length){let f=new Kt;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const Vn="fox-router-view",Bn="fox-router-link";function Mr(n,e=!1){let t=null;return e?t=n.showFromClass??n.enterFromClass:t=n.enterFromClass,t||(t=n.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Nr(n,e=!1){let t=null;return e?t=n.showActiveClass??n.enterActiveClass:t=n.enterActiveClass,t||(t=n.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function kn(n,e=!1){let t=null;return e?t=n.showToClass??n.enterToClass:t=n.enterToClass,t||(t=n.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Un(n,e=!1){let t=null;return e?t=n.hideFromClass??n.leaveFromClass:t=n.leaveFromClass,t||(t=n.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Wn(n,e=!1){let t=null;return e?t=n.hideActiveClass??n.leaveActiveClass:t=n.leaveActiveClass,t||(t=n.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function zn(n,e=!1){let t=null;return e?t=n.hideToClass??n.leaveToClass:t=n.leaveToClass,t||(t=n.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Jn(n,e=!1){let t=null;return e?t=n.beforeShow??n.beforeEnter:t=n.beforeEnter,t}function Gn(n,e=!1){let t=null;return e?t=n.show??n.enter:t=n.enter,t}function Qn(n,e=!1){let t=null;return e?t=n.afterShow??n.afterEnter:t=n.afterEnter,t}function Xn(n,e=!1){let t=null;return e?t=n.showCancelled??n.enterCancelled:t=n.enterCancelled,t}function Yn(n,e=!1){let t=null;return e?t=n.hide??n.leave:t=n.leave,t}function Zn(n,e=!1){let t=null;return e?t=n.afterHide??n.afterLeave:t=n.afterLeave,t}function es(n,e=!1){let t=null;return e?t=n.hideCancelled??n.leaveCancelled:t=n.leaveCancelled,t}function Bt(n){let e,t=n.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 xe(n,e){n.classList.contains(e)||n.classList.add(e)}function Se(n,e){n.classList.remove(e)}const ts=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function kt(n){ts(n)}function H(n,e,t){S(e)&&(n==null&&(n={}),Reflect.apply(e,n,t))}function Ir(n,e,t,r=-1,s,i,o,a){if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,n,[e,t,r]),S(a)&&Reflect.apply(a,n,[])},s);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{ft(e,c,u)}),Reflect.apply(i,n,[e,t,r]),a&&Reflect.apply(a,n,[])};l.forEach(f=>{ut(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,n,[e,t,r]),ft(e,l,u)};ut(e,l,u)}}function Ut(n){return!me||n===null?!1:n.opsType===j.Append||n.opsType===j.Open}function Hr(n,e,t,r={},s,i=-1){if(e||Ut(s)){const o=Mr(r,e);o&&xe(t,o);const a=Nr(r,e);a&&xe(t,a);const l=Jn(r,e);H(n,l,[t,e,s,i])}}function Dr(n,e,t,r={},s,i,o,a){if(!Ut(i)&&!e){S(a)&&a(n,a,[t]);return}const l=Mr(r,e),u=Nr(r,e),f=kn(r,e),c=Gn(r,e),h=Qn(r,e),y=Xn(r,e);if(!l&&!u&&!f&&!c){S(a)&&a(n,a,[t]);return}kt(()=>{Ir(n,t,i,o,s,()=>{u&&Se(t,u),f&&Se(t,f),S(h)&&H(n,h,[t,e,i,o]),S(a)&&a(n,a,[t])},()=>{S(y)&&H(n,y,[t,e,i,o])}),l&&Se(t,l),f&&xe(t,f),S(c)&&H(n,c,[t,e,i,o])})}function Vr(n,e,t,r={},s,i,o,a,l){if(!Ut(o)&&!e){!e&&S(i)&&i();return}const u=Un(r,e),f=Wn(r,e),c=zn(r,e),h=Yn(r,e),y=Zn(r,e),m=es(r,e);if(!u&&!f&&!c&&!h){!e&&S(i)&&i();return}u&&xe(t,u),f&&xe(t,f),S(h)&&H(n,h,[t,e,o,a]),kt(()=>{Ir(n,t,o,a,s,()=>{f&&Se(t,f),c&&Se(t,c),S(y)&&H(n,y,[t,e,o,a]),S(l)&&H(n,l,[t]),!e&&S(i)&&i()},()=>{S(m)&&H(n,m,[t,e,o,a]),S(l)&&H(n,l,[t]),!e&&S(i)&&i()}),u&&Se(t,u),c&&xe(t,c)})}function Wt(n,e={},t,r=-1){const s=e.mode??"default",i=Bt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Hr(n,!1,a,e,t,r)},enter:a=>{Dr(n,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Vr(n,!1,a,e,i.leave,l,t,r)},clone:a=>Wt(n,e,t,r)}}function Br(n){return n.el}function rs(n,e,t={},r,s,i,o){if(i){const a=Br(e);if(a==null)return;const l=Bt(t);Hr(n,!0,a,t,r,s),Dr(n,!0,a,t,l.show,r,s,u=>{S(o)&&H(n,o,[u])})}else S(o)&&H(n,o,[])}function ns(n,e,t={},r,s,i,o){if(i){const a=Br(e);if(a==null)return;const l=Bt(t);Vr(n,!0,a,t,l.hide,null,r,s,u=>{S(o)&&H(n,o,[u])})}else S(o)&&H(n,o,[])}function ss(n,e={}){kt(()=>{for(let t=0;t<n.length;t++)Reflect.apply(n[t],e,[])})}function ae(n,e,t){return typeof n=="function"?Reflect.apply(n,{},[e,t]):n}function zt(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}function Pe(n,e){return typeof e=="function"?e(n):n}class is{node;state;constructor(e,t){this.node=e,this.state=t}}const Jt=b.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(n,e){const t=b.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=n.multi===!0,s=b.inject(Ge,null),i=b.inject(Et,0),o=b.inject(vr,null),a=b.inject(At,-1);let l=null;const u=n.modelSlot;if(u){if(b.provide(Et,i+1),b.provide(At,u.index),b.provide(Ft,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=ze(t.proxy,!0);wn(h),gr(h,()=>u.route??null)}else{if(s==null){console.error("router is not been injected");return}const c=n.name,h=b.inject(wr,null),y=b.inject(Ft,0);if(l=s[fr](c,i,o,a,h,y),l===null)return;b.provide(wr,l);const m=l[J]===!0;if(m&&b.provide(vr,l),!r&&(b.provide(At,-1),b.provide(Et,i+1),b.provide(Ft,-1),m)){const p=ze(t.proxy,!0);gr(p,()=>{const d=l.slots.value;return d.length>0?d[0].route:null})}}const f={value:new Map};return b.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,m=[];for(let g=0;g<y.length;g++){const v=y[g],q=`${n.name}_${v.index}`,x=ae(n.transition,v.route,g)??!0,O={modelSlot:v};let _;e.slots.default?_=b.h(Jt,O,{default:e.slots.default}):_=b.h(Jt,O);const A={},F=ae(n.viewClass,v.route,g);typeof F=="string"&&F.length>0&&(A[F]=!0);const Q=ae(n.viewActiveClass,v.route,g),D=ae(n.viewInactiveClass,v.route,g),V=f.value.get(q);if(typeof Q=="string"&&Q.length>0&&(A[Q]=v.active),typeof D=="string"&&D.length>0&&(A[D]=!v.active),V&&v.active!==V.state){const re=V.node;v.active?m.unshift(()=>{const er=()=>{let De=dr(re);De!=null&&mr(De,St.ACTIVATED)};rs(t,re,n,v.route,g,x,er)}):m.push(()=>{const er=()=>{const De=dr(re);De!=null&&mr(De,St.DEACTIVATED)};ns(t,re,n,v.route,g,x,er)})}const te={class:A,key:q},X=ae(n.viewTagProps,v.route,g);if(X!==null&&typeof X=="object"){const re=Pe(X,s?.propsFilter);K(!0,te,re)}if(v.route?.viewTagAttrs&&typeof v.route?.viewTagAttrs=="object"){const re=Pe(v.route.viewTagAttrs,s?.propsFilter);K(!0,te,re)}const ne=ae(n.viewTag,v.route,g),Zt=b.h(ne,te,{default:()=>[_]});if(c.set(q,new is(Zt,v.active)),f.value.delete(q),x){const re=Wt(t,n,v.route,g);Zt.transition=re}h.push(Zt)}f.value.forEach(g=>{g.node.transition=null}),f.value=c,ss(m,t);const p=ae(n.tag,null,-1),d={};return Object.assign(d,e.attrs),b.h(p,d,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const m=Pe(c.props,s?.propsFilter);K(!1,h,m)}else if(c.props===!0&&typeof u.route?.params=="object"){const m=Pe(u.route.params,s?.propsFilter);K(!1,h,m)}}const y=b.h(c.component,h);return zt(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Ct(t.proxy))??null,m=h.model,p={};if(m.props){if(typeof m.props=="object"){const v=Pe(m.props,s?.propsFilter);K(!1,p,v)}else if(m.props===!0&&typeof y?.params=="object"){const v=Pe(y.params,s?.propsFilter);K(!1,p,v)}}const d=b.h(m.component,p);if(ae(n.transition,y,-1)??!0){const v=Wt(t,n,y,-1);d.transition=v}return zt(e.slots.default,{Component:d,route:y})??d}else return zt(e.slots.fallback,{})}}}});function os(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!=null&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function ls(n,e){return n==null||e==null?!1:!!(n===e||n.path&&n.path===e.path||n.name&&n.name===e.name)}function as(n,e){return n==null||e==null?!1:!!(n.path&&e.path&&e.path.startsWith(n.path)||n.name&&n.name==e.name)}function Ce(n,e){return typeof n=="function"?Reflect.apply(n,{},[e]):n}let us=b.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(n,e){const t=b.inject(Ge,null);return()=>{let r=Ce(n.to,null),s=Ce(n.tag,r);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[N](r),n.root&&(i.root=n.root),o=t.current);let a={},l=Ce(n.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=as(i,o)),Ce(n.exact,i)===!0){let h=Ce(n.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=ls(i,o))}let f={class:a};(s==="a"||s==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=Ce(n.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}os(y)&&t.to(i)};f[c]=h}return b.h(s,f,e.slots)}}});var M=(n=>(n[n.Loading=0]="Loading",n[n.Loaded=1]="Loaded",n[n.Defining=2]="Defining",n[n.Defined=3]="Defined",n))(M||{}),lt=(n=>(n[n.normal=0]="normal",n[n.factory=1]="factory",n))(lt||{});class fs{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class kr{moduleManager=new fs;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return Ve().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:M.Defined};typeof t=="function"?(r.exports=t,r.type=lt.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const s={};typeof e[r]=="object"&&(Object.assign(s,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new cs(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new _e;for(let l=0;l<t.length;l++){const u=new hs(l,t[l],s,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,s={};typeof e[r]=="object"&&(Object.assign(s,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(s=>{t.progress.work(!0,t.index,"exports"),s.resolve()});return}else if(t.src==="module"){e.post(s=>{t.progress.work(!0,t.index,"module"),s.resolve()});return}if(this.isNaturePath(t.src)){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(this.isNaturePath(t.src)){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(r==="css"){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}}mountCSS(e,t,r){e.post(s=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==M.Defined||o.status==M.Loaded)&&o.exports){o.type===lt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),s.resolve();return}const a=Ve(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{Ur(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(s=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===lt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,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={id:i,src:i,status:M.Loading},this.moduleManager.set(i,o);const l=Ve().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),s.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;const f=$();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=Ve(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const s=e[r].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){const r=this,s=function(...i){e.status=M.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let s=`${e[r]}`;t+=`${encodeURIComponent(r)}=${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 r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let r=0;r<t.length;r++){const s=t[r];if(e.indexOf(s)===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`${at()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${at()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${$().location.protocol}${e}`;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`${at()}${e}`}}function Ur(n,e){let t=n.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():Ur(n,e)},20)}class cs{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,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),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 hs{index;src;params;progress;constructor(e,t,r,s){this.index=e,this.src=t,this.params=r,this.progress=s}}const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function ys(n={}){const e=new Dn(n),t=new vt,r=new Rt,s=new kr,i={get router(){return e},get bus(){return t},get Bus(){return vt},get EventProxy(){return Rt},get eventproxy(){return r},get EventChain(){return _e},get Require(){return kr},get require(){return s},get extend(){return K},get clone(){return ke},get isESModule(){return ct},install(o){o.provide(Ge,e),o.provide(Gt,i),o.provide(Qt,t),o.provide(Xt,r),o.component(Vn,Jt),o.component(Bn,us),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ct(this)}}}),e.init()}};return i}function Yt(n){return n?n.$router:b.inject(Ge)}function ds(n){return n||(n=b.getCurrentInstance()?.proxy??void 0),n?Ct(n):null}function ms(n){return n?n.$fox:b.inject(Gt)}function ps(n){return n?n.$bus:b.inject(Qt)}function gs(n){return n?n.$eventProxy:b.inject(Xt)}function vs(n){const e=Yt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.beforeEach(t),b.onUnmounted(()=>{e.removeBeforeEach(t)})}function ws(n){const e=Yt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.afterEach(t),b.onUnmounted(()=>{e.removeAfterEach(t)})}const Rs="";w.Bus=vt,w.EventChain=_e,w.EventProxy=Rt,w.Route=C,w.clone=ke,w.createFox=ys,w.createMemoryHistory=_r,w.createWebHashHistory=Fr,w.createWebHistory=Mn,w.deleteContextValue=vn,w.extend=K,w.foxBusKey=Qt,w.foxEventProxyKey=Xt,w.foxKey=Gt,w.injectContextValue=xt,w.isArray=zr,w.isDate=Qr,w.isESModule=ct,w.isEqual=mt,w.isFunction=S,w.isMap=Jr,w.isNil=rr,w.isObject=tr,w.isPlainObject=nr,w.isPromise=Zr,w.isSet=Gr,w.isString=Xr,w.isSymbol=Yr,w.onAfterRouteUpdate=ws,w.onBeforeRouteUpdate=vs,w.onFoxActivated=Sn,w.onFoxInactivated=Pn,w.provideContextValue=gn,w.sessionKey=ie,w.toBoolean=yt,w.toNumber=nn,w.toTypeString=Be,w.typeOf=dt,w.useBus=ps,w.useEventProxy=gs,w.useFox=ms,w.useRoute=ds,w.useRouter=Yt,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(v,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],b):(v=typeof globalThis<"u"?globalThis:v||self,b(v.Fox={},v.Vue))})(this,function(v,b){"use strict";/*!
|
|
2
|
+
* fox v3.0.0 Wed Nov 29 2023 16:14:35 GMT+0800 (中国标准时间)
|
|
3
|
+
*/const me=typeof window<"u",$=function(){return window},Ve=function(){return window.document};function Wr(n){let e=n,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 at(){if(!me)return"/";let n=$().location,e=`${n.protocol}//${n.host}`;return e+=Wr(n.pathname),e}function ut(n,e,t){n.addEventListener?n.addEventListener(e,t,!1):n.attachEvent?n.attachEvent(`on${e}`,t):n[`on${e}`]=t}function ft(n,e,t){n.removeEventListener?n.removeEventListener(e,t):n.detachEvent?n.detachEvent(`on${e}`,t):n[`on${e}`]=null}const zr=Array.isArray,Jr=n=>Be(n)==="[object Map]",Gr=n=>Be(n)==="[object Set]",Qr=n=>n instanceof Date,S=n=>typeof n=="function",Xr=n=>typeof n=="string",Yr=n=>typeof n=="symbol",tr=n=>n!==null&&typeof n=="object",Zr=n=>tr(n)&&S(n.then)&&S(n.catch),rr=n=>n==null,en=Object.prototype.toString,Be=n=>en.call(n),nr=n=>Be(n)==="[object Object]",tn=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function ct(n){return n.__esModule||tn&&n[Symbol.toStringTag]==="Module"}const rn=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...n){let e=n[0]!==void 0&&n[0]!==null?n[0]:{},t=1,r=n.length,s=!1;for(typeof e=="boolean"&&(s=e,e=n[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(n[t]!==null&&n[t]!==void 0){let i=n[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(s,u,l)}else l!==void 0&&(e[o]=l)}}return e}function ke(n,e,t=!1){if(!t)K(!0,n,e);else{if(typeof e!="object")return{};typeof n!="object"&&(n={});for(let r of Reflect.ownKeys(e)){let s=n[r],i=e[r];if(s!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!nr(i))continue;s=ke(s,i,t),n[r]=s}else{if(typeof i=="function")continue;n[r]=i}}}return n}class se{static seed=new Date().getTime();static get(){let e=++se.seed;return e>=Number.MAX_VALUE&&(se.seed=0),e}}const ht=rn?Promise.resolve():null;function Ee(n,...e){ht!==null?e&&e.length>0?ht.then(()=>{n(e)}):ht.then(n):e&&e.length>0?setTimeout(()=>{n(e)}):setTimeout(n)}function yt(n){return n==null?!1:typeof n=="boolean"?n:typeof n=="string"?n.toLocaleLowerCase()==="true":!!n}function nn(n){return typeof n=="number"?n:Number(n)}const sn={"[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 dt(n){let t=Object.prototype.toString.call(n);return n==null?String(n):sn[t]||"object"}function mt(n,e){if(n==e)return!0;if(n===void 0||e===void 0)return!1;let t=dt(n),r=dt(e);if(t!==r)return!1;if(t==="object"){let s=Object.keys(n),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=n[a],u=e[a];if(!mt(l,u))return!1}return!0}else if(t==="array"){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){let i=n[s],o=e[s];if(!mt(i,o))return!1}return!0}return!1}const sr=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=sr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},on=/^Symbol\((.*)\)$/,ir=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=ir(r));const s=on.exec(t);if(s&&s[1]){const i=Symbol.for(s[1]);e[i]=r}else e[t]=r}return e},or=Symbol("idKey"),ue=Symbol("valueKey"),P=Symbol("childrenKey"),z=Symbol("growKey");class lr{[z]=!0;[or];[ue]=b.ref();[P]=new Map;constructor(e){this[or]=e}}class ln{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];let r=e[P].get(t);if(r)return Ae(r);if(e[z])return r=gt(t),r[z]=e[z],e[P].set(t,r),Ae(r)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=yt(r),!0):r==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 pt="__proxy__";function gt(n){const e=new lr(n);return Reflect.set(e,pt,new Proxy(e,new ln)),e}function Ae(n){return Reflect.get(n,pt)}class an{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&rr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(me){const t=$();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,s=t.getItem(r);s&&(this.state=JSON.parse(s),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),s=e[t-1];this.state[r]=s,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),s={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(s[o]=this.state[o]))}),this.state=s,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class ar extends lr{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new an(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let s=0;s<t-1;s++){let i=e[s],o;r[P].has(i)?o=r[P].get(i):(o=gt(i),r[P].set(i,o)),r=o}return r[ue].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let s=0;s<t;s++){let i=e[s];if(r[P].has(i))r=r[P].get(i);else return}return r[ue].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[P].has(o))r=r[P].get(o);else return!1}const s=e[t-1];return r[P].has(s)?(r[P].delete(s),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[P].has(o))r=r[P].get(o);else return!1}const s=e[t-1];return r[P].has(s)}clear(){this[P].clear(),this._persistHandler.clear()}}const un=["put","get","contains","remove","clear","_persistHandler"];function ur(n){return un.includes(n)}class fn{get(e,t){if(t=="value")return e[ue].value;if(t==="grow")return e[z];if(t===P)return e[P];if(typeof t=="string"&&ur(t))return e[t];let r=String(t),s=e[P].get(r);if(s)return Ae(s);if(e[z])return s=gt(r),s[z]=e[z],e[P].set(r,s),Ae(s)}set(e,t,r){return t=="value"?(e[ue].value=r,!0):t==="grow"?(e[z]=yt(r),!0):ur(t)?!1:r==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 cn(n){const e=new ar(n),t=new fn,r=new Proxy(e,t);return Reflect.set(e,pt,r),e}const vt=new Proxy(ar,{construct(n,e){const t=cn(e[0]??{});return Ae(t)}}),Y="default",fr=Symbol("sync"),I=Symbol("resolveRoute");function cr(n){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(n,{},t)}}function hn(n){let e=n.src;return new Promise((t,r)=>{const s=cr(a=>{ct(a)&&(a=a.default),n.component=a,console.debug("success load async module"),t()}),i=cr(a=>{console.debug("reject load async module"),r(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 yn{name;level;rootName;rootIndex=0;constructor(e,t,r,s){this.name=e,this.level=t,this.rootName=r,this.rootIndex=s}}class Ue{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ue(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class C{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new C;return ke(r,e,t),r}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 C;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)r[i]=e[i];return t}}class dn{id;name;props;meta;src;component;constructor(e,t,r,s){this.id=se.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return hn(this)}}class hr{models=[]}class wt{path;match;redirect;name;layers=[]}const B=Symbol("chainKey"),N=Symbol("cursorKey"),bt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),We=Symbol("exArgsKey"),pe=Symbol("successFnsKey"),Fe=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),ee=Symbol("_go");class _e{[B]=[];[N]=0;[bt]=!1;[T]="Free";[Z]=[];[We]=[];[pe]=[];[Fe]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[bt]=t}[ee](e,...t){let r=this[T];if(this[T]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[ie]},...this[We]];for(;this[Fe].length>0;)try{let l=this[Fe].shift();typeof l=="function"&&Ee(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=r,this[B]=[],this[N]=0,this}else if(r==="Finished"||this[N]>=this[B].length){let a=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let l=this[pe].shift();typeof l=="function"&&Ee(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[N]>=this[B].length)return this[T]="Free",this;let s=this[B][this[N]];this[bt]||(this[B].splice(0,this[N]+1),this[N]=-1);let i=this[N]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},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[B].splice(i,0,l),i++)},session:this[ie]};Ee(()=>{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[We]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[We]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[B]=[],this[N]=0;let r=[{session:this[ie]},...this[Z]];for(;this[pe].length>0;){let s=this[pe].shift();Ee(()=>{Reflect.apply(s,this,r)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[pe].push(e),t&&typeof t=="function"&&this[Fe].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Fe].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[B].length}}const ge=Symbol("registerKey");class mn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Rt{[ge]=new Map;constructor(){}on(e,t,r=!1){let s=this[ge].get(e);s||(s=new Array,this[ge].set(e,s));let i=r===!0?1:0,o=new mn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ge].delete(e),this;let r=this[ge].get(e);if(r){for(let s=0;s<r.length;s++)if(r[s].callback===t){r.splice(s,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}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 r=e[t-1];if(typeof r!="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(r,{},i)});return this}emit(e,...t){let r=this[ge].get(e);if(!r)return this;for(let s=0;s<r.length;){let i=r[s];if(i.policy==1?r.splice(s,1):s++,typeof i.callback=="function")try{Ee(()=>{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 Ke=Symbol("registerKey");class pn{[Ke]=new Map;constructor(){}set(e,t){this[Ke].set(e,t)}get(e){return this[Ke].get(e)}has(e){return this[Ke].has(e)}delete(e){return this[Ke].delete(e)}}const fe=Symbol("lc");function ze(n,e=!1){let t=n;if(Reflect.has(t,fe))return t[fe];if(e){const r=new pn;return t[fe]=r,r}return null}function yr(n,e=!1){let t=null,r=n;for(;r&&!(Reflect.has(r,fe)&&(t=r[fe],t));)r=r.$parent;if(!t&&e){const s=n;s&&s.$parent&&(t=ze(s.$parent,e))}return t}function xt(n,e){let t=n;for(;t;){if(Reflect.has(t,fe)){const r=t[fe];if(r.has(e))return r.get(e)}t=t.$parent}return null}function gn(n,e,t){yr(n,!0)?.set(e,t)}function vn(n,e){yr(n,!0)?.delete(e)}function dr(n){if(Array.isArray(n.children)&&n.children.length>0){let e=n.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return ze(e.component.proxy,!1)}return null}const Je=Symbol("hooksKey");function wn(n){let e=n.get(Je);e||(e=[],n.set(Je,e))}function mr(n,e){let t=n.get(Je);if(t!=null)for(let r=t.length-1;r>=0;r--){let s=t[r];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var St=(n=>(n.DEACTIVATED="da",n.ACTIVATED="a",n))(St||{});class bn{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Rn(n,e,t,r){let s=new bn(e,t,r);return n.push(s),!0}function xn(n,e,t,r){let s=-1;for(let i=0;i<n.length;i++){let o=n[i];if(o.type===e&&o.hook===t&&o.target===r){s=i;break}}return s!=-1?(n.splice(s,1),!0):!1}function pr(n){return(e,t)=>{let r;if(t)r=t;else{const i=b.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const s=xt(r,Je);if(s==null){console.warn("can not get hooks context");return}b.onUnmounted(()=>{xn(s,n,e,r)}),Rn(s,n,e,r)}}const Sn=pr("a"),Pn=pr("da"),Pt=Symbol("routeKey");function gr(n,e){n.set(Pt,e)}function Ct(n){let e=xt(n,Pt);return typeof e=="function"?e():e??null}const Ge=Symbol("rk"),Et=Symbol("vd"),vr=Symbol("rv"),At=Symbol("rvi"),wr=Symbol("pv"),Ft=Symbol("pvi");function Cn(n){for(var e=[],t=0;t<n.length;){var r=n[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:n[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:n[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:n[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:n[t++]});continue}if(r===":"){for(var s="",i=t+1;i<n.length;){var o=n.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=n[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(r==="("){var a=1,l="",i=t+1;if(n[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<n.length;){if(n[i]==="\\"){l+=n[i++]+n[i++];continue}if(n[i]===")"){if(a--,a===0){i++;break}}else if(n[i]==="("&&(a++,n[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=n[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:n[t++]})}return e.push({type:"END",index:t,value:""}),e}function br(n,e){e===void 0&&(e={});for(var t=Cn(n),r=e.prefixes,s=r===void 0?"./":r,i="[^".concat(ve(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(_){if(l<t.length&&t[l].type===_)return t[l++].value},c=function(_){var E=f(_);if(E!==void 0)return E;var A=t[l],Q=A.type,D=A.index;throw new TypeError("Unexpected ".concat(Q," at ").concat(D,", expected ").concat(_))},h=function(){for(var _="",E;E=f("CHAR")||f("ESCAPED_CHAR");)_+=E;return _};l<t.length;){var y=f("CHAR"),d=f("NAME"),p=f("PATTERN");if(d||p){var m=y||"";s.indexOf(m)===-1&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:m,suffix:"",pattern:p||i,modifier:f("MODIFIER")||""});continue}var g=y||f("ESCAPED_CHAR");if(g){u+=g;continue}u&&(o.push(u),u="");var w=f("OPEN");if(w){var m=h(),q=f("NAME")||"",x=f("PATTERN")||"",O=h();c("CLOSE"),o.push({name:q||(x?a++:""),pattern:q&&!x?i:x,prefix:m,suffix:O,modifier:f("MODIFIER")||""});continue}c("END")}return o}function En(n,e){return An(br(n,e),e)}function An(n,e){e===void 0&&(e={});var t=_t(e),r=e.encode,s=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=n.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<n.length;f++){var c=n[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",d=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var m=s(h[p],c);if(o&&!a[f].test(m))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));u+=c.prefix+m+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var m=s(String(h),c);if(o&&!a[f].test(m))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(m,'"'));u+=c.prefix+m+c.suffix;continue}if(!y){var g=d?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(g))}}return u}}function Fn(n,e){var t=[],r=Rr(n,t,e);return _n(r,t,e)}function _n(n,e,t){t===void 0&&(t={});var r=t.decode,s=r===void 0?function(i){return i}:r;return function(i){var o=n.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(d){return s(d,y)}):u[y.name]=s(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function ve(n){return n.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function _t(n){return n&&n.sensitive?"":"i"}function Kn(n,e){if(!e)return n;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,s=t.exec(n.source);s;)e.push({name:s[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(n.source);return n}function Tn(n,e,t){var r=n.map(function(s){return Rr(s,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),_t(t))}function $n(n,e,t){return jn(br(n,t),e,t)}function jn(n,e,t){t===void 0&&(t={});for(var r=t.strict,s=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(D){return D}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,d=y===void 0?"":y,p="[".concat(ve(d),"]|$"),m="[".concat(ve(h),"]"),g=o?"^":"",w=0,q=n;w<q.length;w++){var x=q[w];if(typeof x=="string")g+=ve(f(x));else{var O=ve(f(x.prefix)),_=ve(f(x.suffix));if(x.pattern)if(e&&e.push(x),O||_)if(x.modifier==="+"||x.modifier==="*"){var E=x.modifier==="*"?"?":"";g+="(?:".concat(O,"((?:").concat(x.pattern,")(?:").concat(_).concat(O,"(?:").concat(x.pattern,"))*)").concat(_,")").concat(E)}else g+="(?:".concat(O,"(").concat(x.pattern,")").concat(_,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?g+="((?:".concat(x.pattern,")").concat(x.modifier,")"):g+="(".concat(x.pattern,")").concat(x.modifier);else g+="(?:".concat(O).concat(_,")").concat(x.modifier)}}if(l)s||(g+="".concat(m,"?")),g+=t.endsWith?"(?=".concat(p,")"):"$";else{var A=n[n.length-1],Q=typeof A=="string"?m.indexOf(A[A.length-1])>-1:A===void 0;s||(g+="(?:".concat(m,"(?=").concat(p,"))?")),Q||(g+="(?=".concat(m,"|").concat(p,")"))}return new RegExp(g,_t(t))}function Rr(n,e,t){return n instanceof RegExp?Kn(n,e):Array.isArray(n)?Tn(n,e,t):$n(n,e,t)}var j=(n=>(n[n.Push=0]="Push",n[n.Replace=1]="Replace",n[n.Put=2]="Put",n[n.Append=3]="Append",n[n.Open=4]="Open",n))(j||{}),Qe=(n=>(n[n.Part=0]="Part",n[n.All=1]="All",n))(Qe||{});const J=Symbol("rootKey"),G=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),Xe=Symbol("nameKey");class oe{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,s=!0){this.route=e,this.model=t,this.index=r,this.active=s}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=b.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Xe];[J];[G]=null;[ce]=null;get name(){return this[Xe]}constructor(e,t,r){this[Xe]=e,this[J]=t,r&&(this[G]=r)}}class k{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let s=e[r];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class Kt{views=[]}class qn{layers=[]}class On{time;route}class Ln{forbidTime=300;submitRecorder=new On;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=Symbol("_notifyChange");class xr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const he=Symbol("historyChangeConsumerKey"),Sr=Symbol("_navigateFirstRoute"),Ye=Symbol("_getRouteMark"),Tt=Symbol("_getUrlSearch"),$t=Symbol("_generateLocation"),$e=Symbol("_setRouteMarkRecorder"),je=Symbol("beforeRestoreFiltersKey"),Pr=Symbol("_beforeRestore"),Cr="Symbol(_fox_restore_point)";function qe(n,...e){return typeof n=="function"?Reflect.apply(n,null,[...e]):n}function Er(n){if(!Array.isArray(n))return!1;if(n.length===0)return!0;const e=n[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[he]=!1;[je]=new Array;backTimeout=320;constructor(e="hash",t="",r="",s=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??$().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=$();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[he]=="function"){const r=this[he]();if(this[he]=!1,r)return}else if(this[he]===!0){this[he]=!1;return}if(qe(this.historyMonitor)){const r=t.history.state;this[we](r);try{let s=[];if(typeof r=="string"?s=JSON.parse(r):s=r,Array.isArray(s)&&s.length>0){const i=this[Ye]()??"/";this[$e](i,s)}}catch{}}}),ut(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[Sr](),Promise.resolve()}destroy(){if(this.historyChange){const e=$();ft(e,"popstate",this.historyChange)}}[Pr](e,t,r,s){for(let i of this[je])try{const o=Reflect.apply(i,{},[e,t,r,s]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[je].push(e)}removeBeforeRestoreEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}[Sr](){const e=this[Ye]()??"/",t=this.storage.getItem(Cr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>(l.params=l.params?ir(l.params):{},this[Pr](l,u,e,o.routes)));if(a.length>0){const l=this[Tt](),u=a.length-1;a[u].query=l||a[u].query,this[we](a);return}}}catch{}const r=e.indexOf("!");let s;r!=-1?s=e.substring(r+1):s=e;const i=new C;i.path=s,i.query=this[Tt](),this[we]([i])}[$e](e,t){try{t.forEach(i=>{i.params=i.params?sr(i.params):{}});const s=JSON.stringify({mark:e,routes:t});this.storage.setItem(Cr,s)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ye]()??"/";this[$e](t,e)}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ye](){const e=$();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,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[Tt](){let t=$().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=$();this[he]=t,r.history.go(e)}goBack(e,t){const r=$(),s=r.history.state;if(Er(s)&&s.length>0){let i=!1;for(let f=s.length-1;f>=0;f--){const c=C.from(s[f]);if(!(c.traceless===!0||qe(this.traceless,c))&&C.isSame(c,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,o)};a=setTimeout(l,o);const u=()=>{clearTimeout(a);const c=$().history.state;if(Er(c)&&c.length>0){let h=c.length;const y=c[h-1],d=C.from(y);if(C.isSame(d,e))return t(),!0;if(h>0){let p=!1;for(let m=h-1;m>=0;m--){const g=C.from(c[m]);if(!(g.traceless===!0||qe(this.traceless,g))&&C.isSame(g,e)){p=!0;break}}return p?(a=setTimeout(l,o),this.go(-1,u),!0):(t(),!0)}}return t(),!0};this.go(-1,u)}else t()}push(e){const t=this[$t](e.currentRoute);e.currentRoute.traceless!==!0&&!qe(this.traceless,e.currentRoute)&&$().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[$e](r,e.routes)}replace(e){const t=this[$t](e.currentRoute);e.currentRoute.traceless!==!0&&!qe(this.traceless,e.currentRoute)&&$().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[$e](r,e.routes)}[$t](e){const t=$();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const s=t.location;let i=e.alias??e.fullPath;i.startsWith(Y)&&(i=i.substring(Y.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${s.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function Mn(n=!0,e=null,t="",r=!0,s=!1,i){return e!==null&&(e=$().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,n,r,s,i)}function Fr(n=!0,e="",t=!0,r=!1,s){return new Ar("hash","",e,n,t,r,s)}class In{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=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let s=!1;if(typeof t=="function"?s=t():s=t,!s){const i=this.queue[r];this[we](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let s=this.cursor;s>=0;s--){const i=this.queue[s];if(C.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}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(n="",e=50){return new In(n,e)}function bs(n){}const Ze=Symbol("_constructRouteModel"),et=Symbol("_findRouteModel"),jt=Symbol("_findRootView"),Kr=Symbol("_getFirstView"),ye=Symbol("_removeView"),Tr=Symbol("_buildPage"),$r=Symbol("_resolveComponent"),jr=Symbol("_update"),le=Symbol("_merge"),qt=Symbol("_handleHistoryChange"),tt=Symbol("_handleRouteUpdated"),rt=Symbol("routeUpdatedCallback"),R=Symbol("currentRoutes"),be=Symbol("current"),qr=Symbol("_addRouteRecorder"),Oe=Symbol("_removeRouteRecorder"),nt=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),st=Symbol("errorCallback"),U=Symbol("registerKey"),it=Symbol("notFoundKey"),Ot=Symbol("notFoundPathKey"),W=Symbol("forestKey"),F=Symbol("historyKey"),Le=Symbol("beforeFiltersKey"),Me=Symbol("afterFiltersKey"),Ie=Symbol("destroyFiltersKey"),Lt=Symbol("propsFilterKey"),Re=Symbol("mainDispatcherKey"),Mt=Symbol("initKey"),de=Symbol("readyKey"),It=Symbol("readyHandlersKey"),ot=Symbol("_markReady"),Or=Symbol("_createNextFn"),Nt=Symbol("_start"),Ht=Symbol("_before"),Dt=Symbol("_after"),Lr=Symbol("_destroy"),Vt=Symbol("_load"),Ne=Symbol("_unload"),He=Symbol("routerGuardKey");function Nn(n){return n.layers.length==0||n.layers[0].views.length==0}function Hn(n){let e=[];return n.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let s=K(!0,{},r.meta);e.push(s)}else r.meta&&e.push(r.meta)})}),e}class Dn{[U]=new Array;[it];[Ot]="*";[de]=!1;[It]=[];[W]=new qn;[F];[R]=new Array;[st]=null;[rt]=null;[Le]=new Array;[Me]=new Array;[Ie]=new Array;[Lt]=null;[Re]=new _e;[He]=new Ln;[Mt]=!1;[be]=b.ref(null);get current(){return this[be].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]=me?Fr():_r(),this[F]?.listen(async r=>{let s=!0;try{if(typeof r=="string"){const i=this[I](r);i&&await this[qt]([i])}else await this[qt](r)}catch(i){console.error(i.message,i),s=!1}this[de]===!1&&this[ot](s)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[st]=="function")try{this[st](e,t)}catch{}console.error(e)}init(){this[Mt]!==!0&&(this[F]?.init(!this[de]),this[Mt]=!0)}isReady(){return this[de]?Promise.resolve():new Promise((e,t)=>{this[It].push([e,t])})}[ot](e){this[de]=!0,this[It].forEach(([t,r])=>{try{e?t():r()}catch(s){console.error(s.message,s)}})}[qt](e){try{if(!e){let o=[...this[R]].reverse();return this[Ne](o),me&&$().location.reload(),Promise.resolve()}let t=null,r=[],s=[],i=0;for(;i<e.length&&i<this[R].length&&C.isSame(e[i],this[R][i]);i++)e[i].active===!0&&e[i].active!==this[R][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[R].length&&(s=this[R].slice(i).reverse()),s.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[Ne](s)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[L](t)}return Promise.resolve()}[tt](e){if(e)this[be].value=e;else{let t=this[R].length;t>0?this[be].value=this[R][t-1]:this[be].value=null}if(typeof this[rt]=="function")try{this[rt](this[be].value)}catch{}}[qr](e){if(e.opsType===j.Open){let t=!1;const r=this[R].length-1;for(let s=r;s>=0;s--){const i=this[R][s];if(e.root==i.root){if(e.path===i.path){this[R].splice(s,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[R].push(e)}else this[R].push(e)}[nt](){let e=[];for(let t of this[R]){let r=C.clone(t,!0);e.push(r)}return e}[Oe](e){if(!this[R])return;let t=-1;for(let r=0;r<this[R].length;r++)if(C.isSame(this[R][r],e)){t=r;break}if(t!=-1){let r=this[R][t];this[R].splice(t,1),this[Lr](r,r.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}set propsFilter(e){this[Lt]=e}get propsFilter(){return this[Lt]}setRestorePoint(){const e=this[nt]();this[F]?.setRestorePoint(e)}onRouteUpdated(e){this[rt]=e}onError(e){this[st]=e}beforeEach(e){this[Le].push(e)}removeBeforeEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}afterEach(e){this[Me].push(e)}removeAfterEach(e){const t=this[Me].indexOf(e);return t!==-1?(this[Me].splice(t,1),!0):!1}destroyEach(e){this[Ie].push(e)}removeDestroyEach(e){const t=this[Ie].indexOf(e);return t!==-1?(this[Ie].splice(t,1),!0):!1}beforeRestoreEach(e){this[F]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[F]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ot]){this.setNotFoundRoute(e);return}const r=this[Ze](e);if(t==-1)this[U]=[...this[U],...r];else for(let s=r.length-1;s>=0;s--)this[U].splice(t,0,r[s])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[U].length;r++){const s=this[U][r];if(t?.path&&s.path===t.path)return this[U].splice(r,1),!0;if(t?.name&&s.name===t.name)return this[U].splice(r,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route格式错误",e),!1):this[U].findIndex(s=>{if(t?.path&&s.path===t.path||t?.name&&s.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ot]=e}setNotFoundRoute(e){const t=this[Ze](e);this[it]=t[0]}getRoutes(){return[...this[U]]}[Ze](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new wt;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in r){let l=r[a];a.length===0&&(a=Y);let u=new dn(a,l,e.props,e.meta);s.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[Ze](a);for(let u of l){let f=new wt;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new hr;c.models=[...s],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new hr;a.models=s;const l=new wt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[et](e){const t=e.route;try{for(let r of this[U]){const s=t.template??t.path,i=t.template??t.name;if(s&&r.path){let o=r.match;o||(o=r.match=Fn(r.path));const a=o(s);if(!a)continue;if(r.redirect){const l=new C;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[et](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=En(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new C,typeof e[0]=="object")t=C.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=C.from(e):typeof e=="string"&&(t=new C,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??Y,t.opsType=t.opsType??this.options.defaultOperationType??j.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||j.Push,this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=j.Put,t.traceless=!0,this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=j.Replace,this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=j.Append,this.to(t)):(this[L]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[Re].post(s=>{try{if(this[R].length===0){s.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[R][0].root??Y,e.all)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[R].length-1;u>0;u--){let f=this[R][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=Y;let u=this[Kr](this[W]);u&&(o=u.name);for(let f=this[R].length-1;f>0;f--){let c=this[R][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),s.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[R][i]),this[Ne](a)){if(t===!1)return s.resolve(),r(!0),!0;const u=()=>(s.resolve(),r(!0),!0);if(l&&C.isSame(l,this[R][len-1])){this[F]?.goBack(l,u);return}u()}}catch(i){this[L](i),s.resolve(),r(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=j.Open,this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[Re].post(t=>{try{let r=this[I](e);if(!r){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[R].length;i++){let o=this[R][i];if(o.root===r.root){if(!r.path&&!r.name){s.push(o);continue}if(r.path&&r.path===o.path){s.push(o);break}else if(r.name&&r.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[Ne](s)&&this[tt](),t.resolve()}catch(r){this[L](r),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[L]("resolve route fail",t),this;let r=this[He].acquire(t);return r==null?(this[L]("route forbid",t),this):(this[Re].post(s=>{try{let i=this[Nt](t);this[Ht](i),this[Vt](i),this[Dt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=C.clone(l,!0);const f=new xr(u,this[nt]());l.opsType===j.Replace?this[F]?.replace(f):this[F]?.push(f)}catch(u){console.error(u.message,u)}if(this[He].release(r),this[tt](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[de]===!1&&this[ot](!0),s.resolve()},(o,a)=>{this[He].release(r),a!==null&&this[L](a,t),this[de]===!1&&this[ot](!1),s.resolve()})}catch(i){this[He].release(r),this[L](i,t),s.resolve()}}),this)}back(e=1){this[F]?.go(-e,!1)}[Or](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const s=this[I](t);if(s){const i=e.session.to;s.success=i.success,s.error=i.error,e.session.to=s,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[Nt](e){let t=this[R].length>0?this[R][0]:void 0,r=new Ue(e,t),s={route:e,find:null};return this[et](s),s.find&&(r.routeModel=s.find,e.matched=Hn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new _e(r)}[Ht](e){for(let t of this[Le])e.post(r=>{const s=this[Or](r);Reflect.apply(t,{},[r.session.to,r.session.from,s,r.session])})}[Dt](e){e.post(t=>{for(let r of this[Me])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[Lr](e,t){for(let r of this[Ie])try{Reflect.apply(r,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Vt](e){e.post(t=>{let r=t.session.to,s=t.session.routeModel;if(s==null){let o={route:r,find:null};if(this[et](o))s=o.find,t.session.routeModel=s;else if(this[it])s=this[it];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=Ue.from(t.session);this[Tr](r,s,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Ne](e){if(e.length==0)return!0;let t=this[W],r=[];for(let s of e){let i=this[jt](t,s);i!=null&&r.push({...i,route:s})}if(r.length==0){let s="can not find view index";return this[L](s),!1}for(let s of r.reverse())this[ye](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[jt](e,t){const r=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[J]&&l[Xe]===r)return s={x:a,y:i},s}}return null}[Kr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ye](e,t,r=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,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[J]&&(this[Oe](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new k(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)s?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let y=c.length-1;(o||a.length>0)&&y>=0;y--){let d=c[y];if(d[ce]&&(o||k.include(a,d[ce]))){let p=d.slots.value;for(let m=p.length-1;m>=0;m--){let g=p[m];g.route&&d[J]&&this[Oe](g.route),h.push(new k(d,g.index,f)),p.splice(m,1)}e.layers[f].views.splice(y,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[U].length==0){let t=this[W];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[R]=[],this[tt](),Promise.resolve()}else return new Promise((r,s)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[Re].post(u=>{const f=this[Nt](l);this[Ht](f),this[Vt](f),this[Dt](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[L](h),u.resolve()})})}this[Re].post(a=>{if(i&&o===!0){const l=C.clone(i,!0),u=new xr(l,this[nt]());this[F]?.replace(u)}a.resolve(),r()})})}[Tr](e,t,r){const s=e.updateType??Qe.Part;return this[$r](t).then(()=>{const o=this[jr](t,e,r,s);if(o.status==="error")throw Error(o.message);return o})}[$r](e){let t=[];for(let r=0;r<e.layers.length;r++){let s=e.layers[r];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()}[jr](e,t,r,s){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[W],a=Nn(o),l=t.root??Y,u;!a&&s==Qe.Part&&(u=this[jt](o,t));let f,c=0;if(u==null||u==null)if(a||s===Qe.All){if(o.layers.length==0&&(o.layers[0]=new Kt),o.layers[0].views.length==0){let h=t.root??Y;f=new Te(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let d;if(h.rootName){let p=o.layers[y-1];for(let m of p.views){if(m[J]&&m.name===h.rootName){d=new k(m,h.rootIndex??0,y-1);break}if(m[G]&&m[G].view.name===h.rootName&&m[G].index===h.rootIndex){d=m[G];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Te(l,!0,d),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[J]=!0,t.opsType===j.Append){t.index=t.index??se.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let g=h[h.length-1];g.active=!1,g.route&&(g.route.active=g.active)}let y=new oe(t,i,t.index,!0);f.slots.value=[...h,y];let d=c+1,p=1,m=new k(f,t.index,c);this[le](o,d,e,p,m)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let d=!1;for(let p of h){if(p.route!==null&&C.isSameForRouteModel(p.route,t)){if(p.active===y)return t.index=p.index,t.active=y,p.route=t,{status:"no-change",message:""};p.active=y,d=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!d){t.index=t.index??se.get(),t.active=y;let p=new oe(t,i,t.index,y);h.push(p);let m=c+1,g=1,w=new k(f,t.index,c);this[le](o,m,e,g,w)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=t.index??se.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let y=c+1,d=1,p=new k(f,t.index,c);this[le](o,y,e,d,p)}else{let y=h[0];if(y.model!==i){this[ye](o,u,null,!0),t.index=t.index??se.get(),t.active=!0,f.slots.value=[new oe(t,i,t.index)];let d=c+1,p=1,m=new k(f,t.index,c);this[le](o,d,e,p,m)}else{y.route!==null&&this[Oe](y.route);let d=!1;const p=t.active??!0;y.active!==p&&(y.active=p,d=!0),t.active=p,t.index=y.index,y.route=t;let m=[];for(let O=1;O<h.length;O++)m.push(h[O].index);m.length>0?this[ye](o,u,m,!0):d&&(f.slots.value=[...h]);let g=[new k(f,t.index,c)],w=c+1,q=1,x=new k(f,t.index,c);for(;g.length>0&&w<o.layers.length&&q<e.layers.length;w++,q++){let O=[];for(let E=0;E<o.layers[w].views.length;E++){let A=o.layers[w].views[E];A[ce]&&k.include(g,A[ce])&&O.unshift(E)}let _=[];for(let E of O){let A=o.layers[w].views[E],Q=e.layers[q].models,D;for(let V=0;V<Q.length;V++)if(A.name===Q[V].name){D=Q[V];break}if(!D)this[ye](o,{x:E,y:w},null,!1);else{let V=A.slots.value;if(V.length==0){let te=0;A.slots.value=[new oe(null,D,te)];let X=w+1,ne=q+1;this[le](o,X,e,ne,x)}else{let te=V[0];if(te.model!==D){this[ye](o,{x:E,y:w},null,!0),A.slots.value=[new oe(null,D,0)];let X=w+1,ne=q+1;this[le](o,X,e,ne,x)}else{A[J]&&te.route!==null&&this[Oe](te.route);let X=[];for(let ne=1;ne<V.length;ne++)X.push(V[ne].index);X.length>0&&this[ye](o,{x:E,y:w},X,!0),_.push(new k(A,te.index,w))}}A[J]=!1}}g=_}this[le](o,w,e,q,x)}}}if(f&&f[G]){let h=f[G];h&&(t.slot=new yn(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[qr](t),{status:"success",message:""}}[le](e,t,r,s,i){let o=s,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),c=new oe(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new Kt;l.views=[];for(let u of r.layers[o].models){let f=new Te(u.name,!1,i),c=new oe(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[fr](e,t,r,s,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let f=this[W].layers[t],c=null;for(let h of f.views){let y=!1;if(r!==null?(y=h.name===e&&h[G]?.view===r,y&&s!==-1&&(y=h[G]?.index===s)):y=h.name===e,!!y){i!==null&&(h[ce]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[J]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new Te(e,!0,a);if(u[ce]=l,t==this[W].layers.length){let f=new Kt;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const Vn="fox-router-view",Bn="fox-router-link";function Mr(n,e=!1){let t=null;return e?t=n.showFromClass??n.enterFromClass:t=n.enterFromClass,t||(t=n.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Ir(n,e=!1){let t=null;return e?t=n.showActiveClass??n.enterActiveClass:t=n.enterActiveClass,t||(t=n.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function kn(n,e=!1){let t=null;return e?t=n.showToClass??n.enterToClass:t=n.enterToClass,t||(t=n.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Un(n,e=!1){let t=null;return e?t=n.hideFromClass??n.leaveFromClass:t=n.leaveFromClass,t||(t=n.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Wn(n,e=!1){let t=null;return e?t=n.hideActiveClass??n.leaveActiveClass:t=n.leaveActiveClass,t||(t=n.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function zn(n,e=!1){let t=null;return e?t=n.hideToClass??n.leaveToClass:t=n.leaveToClass,t||(t=n.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Jn(n,e=!1){let t=null;return e?t=n.beforeShow??n.beforeEnter:t=n.beforeEnter,t}function Gn(n,e=!1){let t=null;return e?t=n.show??n.enter:t=n.enter,t}function Qn(n,e=!1){let t=null;return e?t=n.afterShow??n.afterEnter:t=n.afterEnter,t}function Xn(n,e=!1){let t=null;return e?t=n.showCancelled??n.enterCancelled:t=n.enterCancelled,t}function Yn(n,e=!1){let t=null;return e?t=n.hide??n.leave:t=n.leave,t}function Zn(n,e=!1){let t=null;return e?t=n.afterHide??n.afterLeave:t=n.afterLeave,t}function es(n,e=!1){let t=null;return e?t=n.hideCancelled??n.leaveCancelled:t=n.leaveCancelled,t}function Bt(n){let e,t=n.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 xe(n,e){n.classList.contains(e)||n.classList.add(e)}function Se(n,e){n.classList.remove(e)}const ts=me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function kt(n){ts(n)}function H(n,e,t){S(e)&&(n==null&&(n={}),Reflect.apply(e,n,t))}function Nr(n,e,t,r=-1,s,i,o,a){if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,n,[e,t,r]),S(a)&&Reflect.apply(a,n,[])},s);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{ft(e,c,u)}),Reflect.apply(i,n,[e,t,r]),a&&Reflect.apply(a,n,[])};l.forEach(f=>{ut(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,n,[e,t,r]),ft(e,l,u)};ut(e,l,u)}}function Ut(n){return!me||n===null?!1:n.opsType===j.Append||n.opsType===j.Open}function Hr(n,e,t,r={},s,i=-1){if(e||Ut(s)){const o=Mr(r,e);o&&xe(t,o);const a=Ir(r,e);a&&xe(t,a);const l=Jn(r,e);H(n,l,[t,e,s,i])}}function Dr(n,e,t,r={},s,i,o,a){if(!Ut(i)&&!e){S(a)&&a(n,a,[t]);return}const l=Mr(r,e),u=Ir(r,e),f=kn(r,e),c=Gn(r,e),h=Qn(r,e),y=Xn(r,e);if(!l&&!u&&!f&&!c){S(a)&&a(n,a,[t]);return}kt(()=>{Nr(n,t,i,o,s,()=>{u&&Se(t,u),f&&Se(t,f),S(h)&&H(n,h,[t,e,i,o]),S(a)&&a(n,a,[t])},()=>{S(y)&&H(n,y,[t,e,i,o])}),l&&Se(t,l),f&&xe(t,f),S(c)&&H(n,c,[t,e,i,o])})}function Vr(n,e,t,r={},s,i,o,a,l){if(!Ut(o)&&!e){!e&&S(i)&&i();return}const u=Un(r,e),f=Wn(r,e),c=zn(r,e),h=Yn(r,e),y=Zn(r,e),d=es(r,e);if(!u&&!f&&!c&&!h){!e&&S(i)&&i();return}u&&xe(t,u),f&&xe(t,f),S(h)&&H(n,h,[t,e,o,a]),kt(()=>{Nr(n,t,o,a,s,()=>{f&&Se(t,f),c&&Se(t,c),S(y)&&H(n,y,[t,e,o,a]),S(l)&&H(n,l,[t]),!e&&S(i)&&i()},()=>{S(d)&&H(n,d,[t,e,o,a]),S(l)&&H(n,l,[t]),!e&&S(i)&&i()}),u&&Se(t,u),c&&xe(t,c)})}function Wt(n,e={},t,r=-1){const s=e.mode??"default",i=Bt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Hr(n,!1,a,e,t,r)},enter:a=>{Dr(n,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Vr(n,!1,a,e,i.leave,l,t,r)},clone:a=>Wt(n,e,t,r)}}function Br(n){return n.el}function rs(n,e,t={},r,s,i,o){if(i){const a=Br(e);if(a==null)return;const l=Bt(t);Hr(n,!0,a,t,r,s),Dr(n,!0,a,t,l.show,r,s,u=>{S(o)&&H(n,o,[u])})}else S(o)&&H(n,o,[])}function ns(n,e,t={},r,s,i,o){if(i){const a=Br(e);if(a==null)return;const l=Bt(t);Vr(n,!0,a,t,l.hide,null,r,s,u=>{S(o)&&H(n,o,[u])})}else S(o)&&H(n,o,[])}function ss(n,e={}){kt(()=>{for(let t=0;t<n.length;t++)Reflect.apply(n[t],e,[])})}function ae(n,e,t){return typeof n=="function"?Reflect.apply(n,{},[e,t]):n}function zt(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}function Pe(n,e){return typeof e=="function"?e(n):n}class is{node;state;constructor(e,t){this.node=e,this.state=t}}const Jt=b.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(n,e){const t=b.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=n.multi===!0,s=b.inject(Ge,null),i=b.inject(Et,0),o=b.inject(vr,null),a=b.inject(At,-1);let l=null;const u=n.modelSlot;if(u){if(b.provide(Et,i+1),b.provide(At,u.index),b.provide(Ft,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=ze(t.proxy,!0);wn(h),gr(h,()=>u.route??null)}else{if(s==null){console.error("router is not been injected");return}const c=n.name,h=b.inject(wr,null),y=b.inject(Ft,0);if(l=s[fr](c,i,o,a,h,y),l===null)return;b.provide(wr,l);const d=l[J]===!0;if(d&&b.provide(vr,l),!r&&(b.provide(At,-1),b.provide(Et,i+1),b.provide(Ft,-1),d)){const p=ze(t.proxy,!0);gr(p,()=>{const m=l.slots.value;return m.length>0?m[0].route:null})}}const f={value:new Map};return b.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,d=[];for(let g=0;g<y.length;g++){const w=y[g],q=`${n.name}_${w.index}`,x=ae(n.transition,w.route,g)??!0,O={modelSlot:w};let _;e.slots.default?_=b.h(Jt,O,{default:e.slots.default}):_=b.h(Jt,O);const E={},A=ae(n.viewClass,w.route,g);typeof A=="string"&&A.length>0&&(E[A]=!0);const Q=ae(n.viewActiveClass,w.route,g),D=ae(n.viewInactiveClass,w.route,g),V=f.value.get(q);if(typeof Q=="string"&&Q.length>0&&(E[Q]=w.active),typeof D=="string"&&D.length>0&&(E[D]=!w.active),V&&w.active!==V.state){const re=V.node;w.active?d.unshift(()=>{const er=()=>{let De=dr(re);De!=null&&mr(De,St.ACTIVATED)};rs(t,re,n,w.route,g,x,er)}):d.push(()=>{const er=()=>{const De=dr(re);De!=null&&mr(De,St.DEACTIVATED)};ns(t,re,n,w.route,g,x,er)})}const te={class:E,key:q},X=ae(n.viewTagProps,w.route,g);if(X!==null&&typeof X=="object"){const re=Pe(X,s?.propsFilter);K(!0,te,re)}if(w.route?.viewTagAttrs&&typeof w.route?.viewTagAttrs=="object"){const re=Pe(w.route.viewTagAttrs,s?.propsFilter);K(!0,te,re)}const ne=ae(n.viewTag,w.route,g),Zt=b.h(ne,te,{default:()=>[_]});if(c.set(q,new is(Zt,w.active)),f.value.delete(q),x){const re=Wt(t,n,w.route,g);Zt.transition=re}h.push(Zt)}f.value.forEach(g=>{g.node.transition=null}),f.value=c,ss(d,t);const p=ae(n.tag,null,-1),m={};return Object.assign(m,e.attrs),b.h(p,m,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const d=Pe(c.props,s?.propsFilter);K(!1,h,d)}else if(c.props===!0&&typeof u.route?.params=="object"){const d=Pe(u.route.params,s?.propsFilter);K(!1,h,d)}}const y=b.h(c.component,h);return zt(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Ct(t.proxy))??null,d=h.model,p={};if(d.props){if(typeof d.props=="object"){const w=Pe(d.props,s?.propsFilter);K(!1,p,w)}else if(d.props===!0&&typeof y?.params=="object"){const w=Pe(y.params,s?.propsFilter);K(!1,p,w)}}const m=b.h(d.component,p);if(ae(n.transition,y,-1)??!0){const w=Wt(t,n,y,-1);m.transition=w}return zt(e.slots.default,{Component:m,route:y})??m}else return zt(e.slots.fallback,{})}}}});function os(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!=null&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function ls(n,e){return n==null||e==null?!1:!!(n===e||n.path&&n.path===e.path||n.name&&n.name===e.name)}function as(n,e){return n==null||e==null?!1:!!(n.path&&e.path&&e.path.startsWith(n.path)||n.name&&n.name==e.name)}function Ce(n,e){return typeof n=="function"?Reflect.apply(n,{},[e]):n}let us=b.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(n,e){const t=b.inject(Ge,null);return()=>{let r=Ce(n.to,null),s=Ce(n.tag,r);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[I](r),n.root&&(i.root=n.root),o=t.current);let a={},l=Ce(n.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=as(i,o)),Ce(n.exact,i)===!0){let h=Ce(n.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=ls(i,o))}let f={class:a};(s==="a"||s==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=Ce(n.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}os(y)&&t.to(i)};f[c]=h}return b.h(s,f,e.slots)}}});var M=(n=>(n[n.Loading=0]="Loading",n[n.Loaded=1]="Loaded",n[n.Defining=2]="Defining",n[n.Defined=3]="Defined",n))(M||{}),lt=(n=>(n[n.normal=0]="normal",n[n.factory=1]="factory",n))(lt||{});class fs{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class kr{moduleManager=new fs;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return Ve().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:M.Defined};typeof t=="function"?(r.exports=t,r.type=lt.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const s={};typeof e[r]=="object"&&(Object.assign(s,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new cs(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new _e;for(let l=0;l<t.length;l++){const u=new hs(l,t[l],s,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,s={};typeof e[r]=="object"&&(Object.assign(s,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,s)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(s=>{t.progress.work(!0,t.index,"exports"),s.resolve()});return}else if(t.src==="module"){e.post(s=>{t.progress.work(!0,t.index,"module"),s.resolve()});return}if(this.isNaturePath(t.src)){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(this.isNaturePath(t.src)){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(r==="css"){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}}mountCSS(e,t,r){e.post(s=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==M.Defined||o.status==M.Loaded)&&o.exports){o.type===lt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),s.resolve();return}const a=Ve(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),s.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),s.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{Ur(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(s=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===lt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,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={id:i,src:i,status:M.Loading},this.moduleManager.set(i,o);const l=Ve().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),s.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;const f=$();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=Ve(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const s=e[r].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){const r=this,s=function(...i){e.status=M.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let s=`${e[r]}`;t+=`${encodeURIComponent(r)}=${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 r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let r=0;r<t.length;r++){const s=t[r];if(e.indexOf(s)===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`${at()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${at()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${$().location.protocol}${e}`;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`${at()}${e}`}}function Ur(n,e){let t=n.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():Ur(n,e)},20)}class cs{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,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),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 hs{index;src;params;progress;constructor(e,t,r,s){this.index=e,this.src=t,this.params=r,this.progress=s}}const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function ys(n={}){const e=new Dn(n),t=new vt,r=new Rt,s=new kr,i={get router(){return e},get bus(){return t},get Bus(){return vt},get EventProxy(){return Rt},get eventproxy(){return r},get EventChain(){return _e},get Require(){return kr},get require(){return s},get extend(){return K},get clone(){return ke},get isESModule(){return ct},install(o){o.provide(Ge,e),o.provide(Gt,i),o.provide(Qt,t),o.provide(Xt,r),o.component(Vn,Jt),o.component(Bn,us),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ct(this)}}}),e.init()}};return i}function Yt(n){return n?n.$router:b.inject(Ge)}function ds(n){return n||(n=b.getCurrentInstance()?.proxy??void 0),n?Ct(n):null}function ms(n){return n?n.$fox:b.inject(Gt)}function ps(n){return n?n.$bus:b.inject(Qt)}function gs(n){return n?n.$eventProxy:b.inject(Xt)}function vs(n){const e=Yt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.beforeEach(t),b.onUnmounted(()=>{e.removeBeforeEach(t)})}function ws(n){const e=Yt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.afterEach(t),b.onUnmounted(()=>{e.removeAfterEach(t)})}v.Bus=vt,v.EventChain=_e,v.EventProxy=Rt,v.Route=C,v.clone=ke,v.createFox=ys,v.createMemoryHistory=_r,v.createWebHashHistory=Fr,v.createWebHistory=Mn,v.deleteContextValue=vn,v.extend=K,v.foxBusKey=Qt,v.foxEventProxyKey=Xt,v.foxKey=Gt,v.injectContextValue=xt,v.isArray=zr,v.isDate=Qr,v.isESModule=ct,v.isEqual=mt,v.isFunction=S,v.isMap=Jr,v.isNil=rr,v.isObject=tr,v.isPlainObject=nr,v.isPromise=Zr,v.isSet=Gr,v.isString=Xr,v.isSymbol=Yr,v.onAfterRouteUpdate=ws,v.onBeforeRouteUpdate=vs,v.onFoxActivated=Sn,v.onFoxInactivated=Pn,v.provideContextValue=gn,v.sessionKey=ie,v.toBoolean=yt,v.toNumber=nn,v.toTypeString=Be,v.typeOf=dt,v.useBus=ps,v.useEventProxy=gs,v.useFox=ms,v.useRoute=ds,v.useRouter=Yt,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|