@fox-js/fox 3.0.1-27 → 3.0.1-28
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.d.ts +19 -152
- package/libs/index.esm.js +1076 -975
- package/libs/index.umd.js +2 -2
- package/package.json +10 -14
package/libs/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";/*!
|
|
2
|
-
* fox v3.0.0 Wed
|
|
3
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Br=Array.isArray,Ur=r=>nt(r)==="[object Map]",kr=r=>nt(r)==="[object Set]",Wr=r=>r instanceof Date,S=r=>typeof r=="function",zr=r=>typeof r=="string",Jr=r=>typeof r=="symbol",xr=r=>r!==null&&typeof r=="object",Gr=r=>xr(r)&&S(r.then)&&S(r.catch),Qr=Object.prototype.toString,nt=r=>Qr.call(r),Rr=r=>nt(r)==="[object Object]",Xr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Ht(r){return r.__esModule||Xr&&r[Symbol.toStringTag]==="Module"}const Yr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function $(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,s=!1;for(typeof e=="boolean"&&(s=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let i=r[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(s===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=$(s,u,l)}else l!==void 0&&(e[o]=l)}}return e}function st(r,e,t=!1){if(!t)$(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let n of Reflect.ownKeys(e)){let s=r[n],i=e[n];if(s!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Rr(i))continue;s=st(s,i,t),r[n]=s}else{if(typeof i=="function")continue;r[n]=i}}}return r}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const at=Yr?Promise.resolve():null;function Oe(r,...e){at!==null?e&&e.length>0?at.then(()=>{r(e)}):at.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Dt(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":!!r}function Zr(r){return typeof r=="number"?r:Number(r)}const en={"[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(r){let t=Object.prototype.toString.call(r);return r==null?String(r):en[t]||"object"}function jt(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=$t(r),n=$t(e);if(t!==n)return!1;if(t==="object"){let s=Object.keys(r),i=Object.keys(e);if(s.length!==i.length)return!1;for(let o=0;o<s.length;o++){let a=s[o],l=r[a],u=e[a];if(!jt(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let s=0;s<r.length;s++){let i=r[s],o=e[s];if(!jt(i,o))return!1}return!0}return!1}const Sr=r=>{const e={};for(let t of Reflect.ownKeys(r)){let n=r[t];n&&!Array.isArray(n)&&typeof n=="object"&&(n=Sr(n)),typeof t=="symbol"?e[String(t)]=n:e[t]=n}return e},tn=/^Symbol\((.*)\)$/,Pr=r=>{const e={};for(let t of Reflect.ownKeys(r)){let n=r[t];n&&!Array.isArray(n)&&typeof n=="object"&&(n=Pr(n));const s=tn.exec(t);if(s&&s[1]){const i=Symbol.for(s[1]);e[i]=n}else e[t]=n}return e},er=Symbol("idKey"),he=Symbol("valueKey"),R=Symbol("childrenKey"),Q=Symbol("growKey");class Cr{[Q]=!0;[er];[he]=w.ref();[R]=new Map;constructor(e){this[er]=e}}class rn{get(e,t){if(t=="value")return e[he].value;if(t==="grow")return e[Q];let n=e[R].get(t);if(n)return Le(n);if(e[Q])return n=Bt(t),n[Q]=e[Q],e[R].set(t,n),Le(n)}set(e,t,n){return t=="value"?(e[he].value=n,!0):t==="grow"?(e[Q]=Dt(n),!0):n==null?(e[R].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[R].delete(t),!0)}}const Vt="__proxy__";function Bt(r){let e=new Cr(r);return Reflect.set(e,Vt,new Proxy(e,new rn)),e}function Le(r){return Reflect.get(r,Vt)}class Er extends Cr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let n=this;for(let s=0;s<t-1;s++){let i=e[s],o;n[R].has(i)?o=n[R].get(i):(o=Bt(i),n[R].set(i,o)),n=o}return n[he].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let s=0;s<t;s++){let i=e[s];if(n[R].has(i))n=n[R].get(i);else return}return n[he].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[R].has(o))n=n[R].get(o);else return!1}let s=e[t-1];return n[R].has(s)?(n[R].delete(s),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[R].has(o))n=n[R].get(o);else return!1}let s=e[t-1];return n[R].has(s)}clear(){this[R].clear()}}const nn=["put","get","contains","remove","clear"];function tr(r){return nn.includes(r)}class sn{get(e,t){if(t=="value")return e[he].value;if(t==="grow")return e[Q];if(t===R)return e[R];if(typeof t=="string"&&tr(t))return e[t];let n=String(t),s=e[R].get(n);if(s)return Le(s);if(e[Q])return s=Bt(n),s[Q]=e[Q],e[R].set(n,s),Le(s)}set(e,t,n){return t=="value"?(e[he].value=n,!0):t==="grow"?(e[Q]=Dt(n),!0):tr(t)?!1:n==null?(e[R].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[R].delete(t),!0)}}function on(){let r=new Er,e=new sn,t=new Proxy(r,e);return Object.assign({put(...s){return Reflect.apply(r.put,r,s)},get(...s){return Reflect.apply(r.get,r,s)},remove(...s){return Reflect.apply(r.remove,r,s)},contains(...s){return Reflect.apply(r.contains,r,s)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,Vt,t),r}const Tt=new Proxy(Er,{construct(r,...e){const t=on();return Le(t)}}),te="default",Ar=Symbol("sync"),H=Symbol("resolveRoute");function rr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function ln(r){let e=r.src;return new Promise((t,n)=>{const s=rr(a=>{Ht(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=rr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(s,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(s,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(s,i)}})}class an{name;level;rootName;rootIndex=0;constructor(e,t,n,s){this.name=e,this.level=t,this.rootName=n,this.rootIndex=s}}class et{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new et(e.to,e.from),n=e.data??{};return $(!0,t.data,n),t}}class _{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new _;return st(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new _;if(e==null)return t;let n=t;for(let i in e){let o=e[i];n[i]=o}const s=Object.getOwnPropertySymbols(e);if(Array.isArray(s)&&s.length>0)for(let i of s)n[i]=e[i];return t}}class un{id;name;props;meta;src;component;constructor(e,t,n,s){this.id=le.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=s}get isResolved(){return this.component!==void 0}resolve(){return ln(this)}}class nr{models=[]}class ut{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),N=Symbol("cursorKey"),ft=Symbol("$persistentModeKey"),K=Symbol("statusKey"),Z=Symbol("argsKey"),Ne=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Pe=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class Me{[V]=[];[N]=0;[ft]=!1;[K]="Free";[Z]=[];[Ne]=[];[de]=[];[Pe]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[ft]=t}[ee](e,...t){let n=this[K];if(this[K]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,n==="Exception"||n==="Reject"){let a=[{session:this[oe]},...this[Ne]];for(;this[Pe].length>0;)try{let l=this[Pe].shift();typeof l=="function"&&Oe(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[K]=n,this[V]=[],this[N]=0,this}else if(n==="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"&&Oe(()=>{Reflect.apply(l,{},a)})}return this[K]="Free",this}if(this[N]>=this[V].length)return this[K]="Free",this;let s=this[V][this[N]];this[ft]||(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]};Oe(()=>{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[K]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[K]="Reject",this[Ne]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[K]="Exception",this[Ne]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[K]="Busy",this[Z]=e,this[V]=[],this[N]=0;let n=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let s=this[de].shift();Oe(()=>{Reflect.apply(s,this,n)})}return this[K]="Free",this}post(e){return this[K]==="Reject"||this[K]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[K]==="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[Pe].push(t),this[K]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Pe].push(e),this[K]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[K]=="Reject"||this[K]=="Free"&&this[N]>=this[V].length}}const ye=Symbol("registerKey");class fn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class _t{[ye]=new Map;constructor(){}on(e,t,n=!1){let s=this[ye].get(e);s||(s=new Array,this[ye].set(e,s));let i=n===!0?1:0,o=new fn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ye].delete(e),this;let n=this[ye].get(e);if(n){for(let s=0;s<n.length;s++)if(n[s].callback===t){n.splice(s,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(n,{},i)});return this}emit(e,...t){let n=this[ye].get(e);if(!n)return this;for(let s=0;s<n.length;){let i=n[s];if(i.policy==1?n.splice(s,1):s++,typeof i.callback=="function")try{Oe(()=>{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 Ce=Symbol("registerKey");class cn{[Ce]=new Map;constructor(){}set(e,t){this[Ce].set(e,t)}get(e){return this[Ce].get(e)}has(e){return this[Ce].has(e)}delete(e){return this[Ce].delete(e)}}const ce=Symbol("lc");function tt(r,e=!1){let t=r;if(Reflect.has(t,ce))return t[ce];if(e){const n=new cn;return t[ce]=n,n}return null}function Fr(r,e=!1){let t=null,n=r;for(;n&&!(Reflect.has(n,ce)&&(t=n[ce],t));)n=n.$parent;if(!t&&e){const s=r;s&&s.$parent&&(t=tt(s.$parent,e))}return t}function Ut(r,e){let t=r;for(;t;){if(Reflect.has(t,ce)){const n=t[ce];if(n.has(e))return n.get(e)}t=t.$parent}return null}function hn(r,e,t){Fr(r,!0)?.set(e,t)}function dn(r,e){Fr(r,!0)?.delete(e)}function sr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return tt(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function yn(r){let e=r.get(rt);e||(e=[],r.set(rt,e))}function ir(r,e){let t=r.get(rt);if(t!=null)for(let n=t.length-1;n>=0;n--){let s=t[n];if(s.type===e)try{Reflect.apply(s.hook,s.target,[])}catch(i){console.error(i.message,i)}}}var qt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(qt||{});class pn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function mn(r,e,t,n){let s=new pn(e,t,n);return r.push(s),!0}function vn(r,e,t,n){let s=-1;for(let i=0;i<r.length;i++){let o=r[i];if(o.type===e&&o.hook===t&&o.target===n){s=i;break}}return s!=-1?(r.splice(s,1),!0):!1}function Kr(r){return(e,t)=>{let n;if(t)n=t;else{const i=w.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}n=i.proxy}const s=Ut(n,rt);if(s==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{vn(s,r,e,n)}),mn(s,r,e,n)}}const gn=Kr("a"),wn=Kr("da"),Ot=Symbol("routeKey");function or(r,e){r.set(Ot,e)}function kt(r){let e=Ut(r,Ot);return typeof e=="function"?e():e??null}const it=Symbol("rk"),ct=Symbol("vd"),lr=Symbol("rv"),ht=Symbol("rvi"),ar=Symbol("pv"),dt=Symbol("pvi");function bn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var s="",i=t+1;i<r.length;){var o=r.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){s+=r[i++];continue}break}if(!s)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:s}),t=i;continue}if(n==="("){var a=1,l="",i=t+1;if(r[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<r.length;){if(r[i]==="\\"){l+=r[i++]+r[i++];continue}if(r[i]===")"){if(a--,a===0){i++;break}}else if(r[i]==="("&&(a++,r[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=r[i++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=i;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function $r(r,e){e===void 0&&(e={});for(var t=bn(r),n=e.prefixes,s=n===void 0?"./":n,i="[^".concat(we(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(A){if(l<t.length&&t[l].type===A)return t[l++].value},c=function(A){var P=f(A);if(P!==void 0)return P;var C=t[l],W=C.type,M=C.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(A))},h=function(){for(var A="",P;P=f("CHAR")||f("ESCAPED_CHAR");)A+=P;return A};l<t.length;){var d=f("CHAR"),y=f("NAME"),m=f("PATTERN");if(y||m){var p=d||"";s.indexOf(p)===-1&&(u+=p,p=""),u&&(o.push(u),u=""),o.push({name:y||a++,prefix:p,suffix:"",pattern:m||i,modifier:f("MODIFIER")||""});continue}var v=d||f("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var p=h(),j=f("NAME")||"",x=f("PATTERN")||"",T=h();c("CLOSE"),o.push({name:j||(x?a++:""),pattern:j&&!x?i:x,prefix:p,suffix:T,modifier:f("MODIFIER")||""});continue}c("END")}return o}function xn(r,e){return Rn($r(r,e),e)}function Rn(r,e){e===void 0&&(e={});var t=Wt(e),n=e.encode,s=n===void 0?function(l){return l}:n,i=e.validate,o=i===void 0?!0:i,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<r.length;f++){var c=r[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",y=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!y)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var p=s(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=s(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(!d){var v=y?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function Sn(r,e){var t=[],n=jr(r,t,e);return Pn(n,t,e)}function Pn(r,e,t){t===void 0&&(t={});var n=t.decode,s=n===void 0?function(i){return i}:n;return function(i){var o=r.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?u[d.name]=o[h].split(d.prefix+d.suffix).map(function(y){return s(y,d)}):u[d.name]=s(o[h],d)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function we(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Wt(r){return r&&r.sensitive?"":"i"}function Cn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,s=t.exec(r.source);s;)e.push({name:s[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),s=t.exec(r.source);return r}function En(r,e,t){var n=r.map(function(s){return jr(s,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Wt(t))}function An(r,e,t){return Fn($r(r,t),e,t)}function Fn(r,e,t){t===void 0&&(t={});for(var n=t.strict,s=n===void 0?!1:n,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,y=d===void 0?"":d,m="[".concat(we(y),"]|$"),p="[".concat(we(h),"]"),v=o?"^":"",g=0,j=r;g<j.length;g++){var x=j[g];if(typeof x=="string")v+=we(f(x));else{var T=we(f(x.prefix)),A=we(f(x.suffix));if(x.pattern)if(e&&e.push(x),T||A)if(x.modifier==="+"||x.modifier==="*"){var P=x.modifier==="*"?"?":"";v+="(?:".concat(T,"((?:").concat(x.pattern,")(?:").concat(A).concat(T,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(P)}else v+="(?:".concat(T,"(").concat(x.pattern,")").concat(A,")").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(T).concat(A,")").concat(x.modifier)}}if(l)s||(v+="".concat(p,"?")),v+=t.endsWith?"(?=".concat(m,")"):"$";else{var C=r[r.length-1],W=typeof C=="string"?p.indexOf(C[C.length-1])>-1:C===void 0;s||(v+="(?:".concat(p,"(?=").concat(m,"))?")),W||(v+="(?=".concat(p,"|").concat(m,")"))}return new RegExp(v,Wt(t))}function jr(r,e,t){return r instanceof RegExp?Cn(r,e):Array.isArray(r)?En(r,e,t):An(r,e,t)}var F=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(F||{}),Xe=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),fe=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class ne{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,s=!0){this.route=e,this.model=t,this.index=n,this.active=s}}class Ee{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[fe]=null;get name(){return this[Ye]}constructor(e,t,n){this[Ye]=e,this[G]=t,n&&(this[J]=n)}}class B{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let s=e[n];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class yt{views=[]}class Kn{layers=[]}class $n{time;route}class jn{forbidTime=300;submitRecorder=new $n;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const be=Symbol("_notifyChange");class ur{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Ie=typeof window<"u",L=function(){return window},He=function(){return window.document};function Tn(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function pt(){if(!Ie)return"/";let r=L().location,e=`${r.protocol}//${r.host}`;return e+=Tn(r.pathname),e}function Lt(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Mt(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const De=Symbol("ignoreHistoryChangeOnceKey"),fr=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),mt=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),Ae=Symbol("_setRouteMarkRecorder"),Fe=Symbol("beforeRestoreFiltersKey"),cr=Symbol("_beforeRestore"),hr="Symbol(_fox_restore_point)";function gt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Tr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[De]=!1;[Fe]=new Array;constructor(e="hash",t="",n="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??L().sessionStorage}init(e=!0){const t=L();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[De]){this[De]=!1;return}if(gt(this.historyMonitor)){const n=t.history.state;this[be](n);try{let s=[];if(typeof n=="string"?s=JSON.parse(n):s=n,Array.isArray(s)&&s.length>0){const i=this[Ve]()??"/";this[Ae](i,s)}}catch{}}}),Lt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[fr](),Promise.resolve()}destroy(){if(this.historyChange){const e=L();Mt(e,"popstate",this.historyChange)}}[cr](e,t,n,s){for(let i of this[Fe])try{const o=Reflect.apply(i,{},[e,t,n,s]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Fe].push(e)}removeBeforeRestoreEach(e){const t=this[Fe].indexOf(e);return t!==-1?(this[Fe].splice(t,1),!0):!1}[fr](){const e=this[Ve]()??"/",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?Pr(l.params):{},this[cr](l,u,e,o.routes)));if(a.length>0){const l=this[mt](),u=a.length-1;a[u].query=l||a[u].query,this[be](a);return}}}catch{}const n=e.indexOf("!");let s;n!=-1?s=e.substring(n+1):s=e;const i=new _;i.path=s,i.query=this[mt](),this[be]([i])}[Ae](e,t){try{t.forEach(i=>{i.params=i.params?Sr(i.params):{}});const s=JSON.stringify({mark:e,routes:t});this.storage.setItem(hr,s)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Ve]()??"/";this[Ae](t,e)}[be](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=L();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[mt](){let t=L().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!0){const n=L();this[De]=!t,n.history.go(e)}push(e){const t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||L().history.pushState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ae](n,e.routes)}replace(e){const t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||L().history.replaceState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ae](n,e.routes)}[vt](e){const t=L();let n="";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?(n=a.length>0?`${this.query}&${a}`:this.query,n.length>0&&n.charAt(0)!=="?"&&(n=`?${n}`)):a.length>0&&(n=`?${a}`)}const s=t.location;let i=e.alias??e.fullPath;i.startsWith(te)&&(i=i.substring(te.length+1));let o;return n?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${n}`:o=`${this.base}/${i}${n}`:o=`${s.pathname}${n}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function _n(r=!0,e=null,t="",n=!0,s=!1,i){return e!==null&&(e=L().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Tr("path",e??"",t,r,n,s,i)}function _r(r=!0,e="",t=!0,n=!1,s){return new Tr("hash","",e,r,t,n,s)}class qn{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}[be](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const s=this.queue[n];this[be](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function qr(r="",e=50){return new qn(r,e)}const Be=Symbol("_constructRouteModel"),Ue=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),dr=Symbol("_getFirstView"),ae=Symbol("_removeView"),yr=Symbol("_buildPage"),pr=Symbol("_resolveComponent"),mr=Symbol("_update"),se=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),ke=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),pe=Symbol("current"),vr=Symbol("_addRouteRecorder"),Ke=Symbol("_removeRouteRecorder"),ze=Symbol("_cloneRouteRecorder"),q=Symbol("_handleError"),Je=Symbol("errorCallback"),U=Symbol("registerKey"),Ge=Symbol("notFoundKey"),xt=Symbol("notFoundPathKey"),k=Symbol("forestKey"),E=Symbol("historyKey"),$e=Symbol("beforeFiltersKey"),je=Symbol("afterFiltersKey"),Te=Symbol("destroyFiltersKey"),Rt=Symbol("propsFilterKey"),me=Symbol("mainDispatcherKey"),St=Symbol("initKey"),ue=Symbol("readyKey"),Pt=Symbol("readyHandlersKey"),Qe=Symbol("_markReady"),gr=Symbol("_createNextFn"),Ct=Symbol("_start"),Et=Symbol("_before"),At=Symbol("_after"),wr=Symbol("_destroy"),Ft=Symbol("_load"),_e=Symbol("_unload"),qe=Symbol("routerGuardKey");function On(r){return r.layers.length==0||r.layers[0].views.length==0}function Ln(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let s=$(!0,{},n.meta);e.push(s)}else n.meta&&e.push(n.meta)})}),e}class Mn{[U]=new Array;[Ge];[xt]="*";[ue]=!1;[Pt]=[];[k]=new Kn;[E];[b]=new Array;[Je]=null;[We]=null;[$e]=new Array;[je]=new Array;[Te]=new Array;[Rt]=null;[me]=new Me;[qe]=new jn;[St]=!1;[pe]=w.ref(null);get current(){return this[pe].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[E]=e.history:this[E]=Ie?_r():qr(),this[E]?.listen(async n=>{let s=!0;try{if(typeof n=="string"){const i=this[H](n);i&&await this[bt]([i])}else await this[bt](n)}catch(i){console.error(i.message,i),s=!1}this[ue]===!1&&this[Qe](s)})}[q](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Je]=="function")try{this[Je](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[E]?.init(!this[ue]),this[St]=!0)}isReady(){return this[ue]?Promise.resolve():new Promise((e,t)=>{this[Pt].push([e,t])})}[Qe](e){this[ue]=!0,this[Pt].forEach(([t,n])=>{try{e?t():n()}catch(s){console.error(s.message,s)}})}[bt](e){try{if(!e){let o=[...this[b]].reverse();return this[_e](o),Ie&&L().location.reload(),Promise.resolve()}let t=null,n=[],s=[],i=0;for(;i<e.length&&i<this[b].length&&_.isSame(e[i],this[b][i]);i++)e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(n=e.slice(i)),i<this[b].length&&(s=this[b].slice(i).reverse()),s.length===0&&n.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[_e](s)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[q](t)}return Promise.resolve()}[ke](e){if(e)this[pe].value=e;else{let t=this[b].length;t>0?this[pe].value=this[b][t-1]:this[pe].value=null}if(typeof this[We]=="function")try{this[We](this[pe].value)}catch{}}[vr](e){if(e.opsType===F.Open){let t=!1;const n=this[b].length-1;for(let s=n;s>=0;s--){const i=this[b][s];if(e.root==i.root){if(e.path===i.path){this[b].splice(s,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[ze](){let e=[];for(let t of this[b]){let n=_.clone(t,!0);e.push(n)}return e}[Ke](e){if(!this[b])return;let t=-1;for(let n=0;n<this[b].length;n++)if(_.isSame(this[b][n],e)){t=n;break}if(t!=-1){let n=this[b][t];this[b].splice(t,1),this[wr](n,n.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[Rt]=e}get propsFilter(){return this[Rt]}setRestorePoint(){const e=this[ze]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[Je]=e}beforeEach(e){this[$e].push(e)}removeBeforeEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}afterEach(e){this[je].push(e)}removeAfterEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}destroyEach(e){this[Te].push(e)}removeDestroyEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].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[xt]){this.setNotFoundRoute(e);return}const n=this[Be](e);if(t==-1)this[U]=[...this[U],...n];else for(let s=n.length-1;s>=0;s--)this[U].splice(t,0,n[s])}removeRoute(e){const t=this[H](e);if(t===null)return console.warn("route格式错误",e),!1;for(let n=0;n<this[U].length;n++){const s=this[U][n];if(t?.path&&s.path===t.path)return this[U].splice(n,1),!0;if(t?.name&&s.name===t.name)return this[U].splice(n,1),!0}return!1}hasRoute(e){const t=this[H](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[xt]=e}setNotFoundRoute(e){const t=this[Be](e);this[Ge]=t[0]}getRoutes(){return[...this[U]]}[Be](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){const a=new ut;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in n){let l=n[a];a.length===0&&(a=te);let u=new un(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[Be](a);for(let u of l){let f=new ut;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 nr;c.models=[...s],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new nr;a.models=s;const l=new ut;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 n of this[U]){const s=t.template??t.path,i=t.template??t.name;if(s&&n.path){let o=n.match;o||(o=n.match=Sn(n.path));const a=o(s);if(!a)continue;if(n.redirect){const l=new _;$(!0,l,t),l.path=n.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??{},$(!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 d=decodeURIComponent(h[0].trim()),y=decodeURIComponent(h[1].trim());u[d]=y}$(!0,t.params,u)}else typeof l=="object"&&$(!0,t.params,l)}return e.find=n,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===n.name){t.params=t.params??{};const o=xn(n.path);return t.path=o(t.params),e.find=n,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[H](e){let t=null;if(Array.isArray(e))if(t=new _,typeof e[0]=="object")t=_.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&$(!1,t,e[n]);else typeof e=="object"?t=_.from(e):typeof e=="string"&&(t=new _,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??te,t.opsType=t.opsType??this.options.defaultOperationType??F.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||F.Push,this.to(t)):(this[q]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=F.Put,this.to(t)):(this[q]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=F.Replace,this.to(t)):(this[q]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=F.Append,this.to(t)):(this[q]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[me].post(n=>{try{if(this[b].length===0){n.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[b][0].root??te,e.all)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];u.opsType===F.Append&&u.root===i&&(o.splice(0,0,u),s=l-1)}else if(e.until)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];if(u.opsType===F.Append&&u.root===i){if(e.until.charAt(0)==="/"&&e.until===u.path){s=l;break}else if(e.until===u.name){s=l;break}o.splice(0,0,u)}}}else{i=te;let l=this[dr](this[k]);l&&(i=l.name);for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===F.Append&&f.root===i){o.push(f),s=u-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[b].forEach(l=>{l.opsType!==F.Put&&a++}),this[_e](o)){let l=0;this[b].forEach(f=>{f.opsType!==F.Put&&l++});const u=l-a;this[E]?.go(u,!1),n.resolve(),t(!0)}}catch(s){this[q](s),n.resolve(),t(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=F.Open,this.to(t)):(this[q]("resolve route fail",t),this)}close(e){return this[me].post(t=>{try{let n=this[H](e);if(!n){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===n.root){if(!n.path&&!n.name){s.push(o);continue}if(n.path&&n.path===o.path){s.push(o);break}else if(n.name&&n.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[_e](s)&&this[ke](),t.resolve()}catch(n){this[q](n),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[q]("resolve route fail",t),this;let n=this[qe].acquire(t);return n==null?(this[q]("route forbid",t),this):(this[me].post(s=>{try{let i=this[Ct](t);this[Et](i),this[Ft](i),this[At](i),i.wait((o,a)=>{const l=o.session.to;try{let u=_.clone(l,!0);const f=new ur(u,this[ze]());l.opsType===F.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[qe].release(n),this[ke](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ue]===!1&&this[Qe](!0),s.resolve()},(o,a)=>{this[qe].release(n),a!==null&&this[q](a,t),this[ue]===!1&&this[Qe](!1),s.resolve()})}catch(i){this[qe].release(n),this[q](i,t),s.resolve()}}),this)}back(e=1){this[E]?.go(-e)}[gr](e){return(t,n)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(n??null);else if(t){const s=this[H](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()}}[Ct](e){let t=this[b].length>0?this[b][0]:void 0,n=new et(e,t),s={route:e,find:null};return this[Ue](s),s.find&&(n.routeModel=s.find,e.matched=Ln(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new Me(n)}[Et](e){for(let t of this[$e])e.post(n=>{const s=this[gr](n);Reflect.apply(t,{},[n.session.to,n.session.from,s,n.session])})}[At](e){e.post(t=>{for(let n of this[je])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[wr](e,t){for(let n of this[Te])try{Reflect.apply(n,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ft](e){e.post(t=>{let n=t.session.to,s=t.session.routeModel;if(s==null){let o={route:n,find:null};if(this[Ue](o))s=o.find,t.session.routeModel=s;else if(this[Ge])s=this[Ge];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let i=et.from(t.session);this[yr](n,s,i).then(o=>{this[k],t.resolve()},o=>{t.reject(o)})})}[_e](e){if(e.length==0)return!0;let t=this[k],n=[];for(let s of e){let i=this[wt](t,s);i!=null&&n.push({...i,route:s})}if(n.length==0){let s="can not find view index";return this[q](s),!1}for(let s of n.reverse())this[ae](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[wt](e,t){const n=t.root??te;let s;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Ye]===n)return s={x:a,y:i},s}}return null}[dr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ae](e,t,n=null,s=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&i[G]&&(this[Ke](h.route),h.active===!0&&h.route.opsType==F.Append&&(l=!0)),a.push(new B(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 d=c.length-1;(o||a.length>0)&&d>=0;d--){let y=c[d];if(y[fe]&&(o||B.include(a,y[fe]))){let m=y.slots.value;for(let p=m.length-1;p>=0;p--){let v=m[p];v.route&&y[G]&&this[Ke](v.route),h.push(new B(y,v.index,f)),m.splice(p,1)}e.layers[f].views.splice(d,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[U].length==0){let t=this[k];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[b]=[],this[ke](),Promise.resolve()}else return new Promise((n,s)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[me].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[q](h),u.resolve()})})}this[me].post(a=>{if(i&&o===!0){const l=_.clone(i,!0),u=new ur(l,this[ze]());this[E]?.replace(u)}a.resolve(),n()})})}[yr](e,t,n){let s=e.updateType??Xe.Part;return this[pr](t).then(()=>{this[mr](t,e,n,s)})}[pr](e){let t=[];for(let n=0;n<e.layers.length;n++){let s=e.layers[n];for(let i=0;i<s.models.length;i++){let o=s.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[mr](e,t,n,s){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const i=e.layers[0].models[0];let o=this[k],a=On(o),l=t.root??te,u;!a&&s==Xe.Part&&(u=this[wt](o,t));let f,c=0;if(u==null||u==null)if(a||s===Xe.All){if(o.layers.length==0&&(o.layers[0]=new yt),o.layers[0].views.length==0){let h=t.root??te;f=new Ee(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 Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let y;if(h.rootName){let m=o.layers[d-1];for(let p of m.views){if(p[G]&&p.name===h.rootName){y=new B(p,h.rootIndex??0,d-1);break}if(p[J]&&p[J].view.name===h.rootName&&p[J].index===h.rootIndex){y=p[J];break}}}if(!y)return Promise.reject("can not insert view(not find root node ref)");f=new Ee(l,!0,y),o.layers[d].views.push(f),u={x:o.layers[d].views.length-1,y:d}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[G]=!0,t.opsType===F.Append){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 d=new ne(t,i,t.index,!0);f.slots.value=[...h,d];let y=c+1,m=1,p=new B(f,t.index,c);this[se](o,y,e,m,p)}else if(t.opsType===F.Open){let h=f.slots.value;const d=t.active??!0;let y=!1;for(let m of h){if(m.route!==null&&_.isSameForRouteModel(m.route,t)){if(m.active===d)return t.index=m.index,t.active=d,m.route=t,Promise.resolve();m.active=d,y=!0,t.index=m.index,t.active=d,m.route=t}else d&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!y){t.index=le.get(),t.active=d;let m=new ne(t,i,t.index,d);h.push(m);let p=c+1,v=1,g=new B(f,t.index,c);this[se](o,p,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=le.get(),t.active=!0,f.slots.value=[new ne(t,i,t.index)];let d=c+1,y=1,m=new B(f,t.index,c);this[se](o,d,e,y,m)}else{let d=h[0];if(d.model!==i){this[ae](o,u,null,!0),t.index=le.get(),t.active=!0,f.slots.value=[new ne(t,i,t.index)];let y=c+1,m=1,p=new B(f,t.index,c);this[se](o,y,e,m,p)}else{d.route!==null&&this[Ke](d.route);let y=!1;const m=t.active??!0;d.active!==m&&(d.active=m,y=!0),t.active=m,t.index=d.index,d.route=t;let p=[];for(let T=1;T<h.length;T++)p.push(h[T].index);p.length>0?this[ae](o,u,p,!0):y&&(f.slots.value=[...h]);let v=[new B(f,t.index,c)],g=c+1,j=1,x=new B(f,t.index,c);for(;v.length>0&&g<o.layers.length&&j<e.layers.length;g++,j++){let T=[];for(let P=0;P<o.layers[g].views.length;P++){let C=o.layers[g].views[P];C[fe]&&B.include(v,C[fe])&&T.unshift(P)}let A=[];for(let P of T){let C=o.layers[g].views[P],W=e.layers[j].models,M;for(let I=0;I<W.length;I++)if(C.name===W[I].name){M=W[I];break}if(!M)this[ae](o,{x:P,y:g},null,!1);else{let I=C.slots.value;if(I.length==0){let X=0;C.slots.value=[new ne(null,M,X)];let z=g+1,re=j+1;this[se](o,z,e,re,x)}else{let X=I[0];if(X.model!==M){this[ae](o,{x:P,y:g},null,!0),C.slots.value=[new ne(null,M,0)];let z=g+1,re=j+1;this[se](o,z,e,re,x)}else{C[G]&&X.route!==null&&this[Ke](X.route);let z=[];for(let re=1;re<I.length;re++)z.push(I[re].index);z.length>0&&this[ae](o,{x:P,y:g},z,!0),A.push(new B(C,X.index,g))}}C[G]=!1}}v=A}this[se](o,g,e,j,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new an(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[vr](t)}[se](e,t,n,s,i){let o=s,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let u of n.layers[o].models){let f=new Ee(u.name,!1,i),c=new ne(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new yt;l.views=[];for(let u of n.layers[o].models){let f=new Ee(u.name,!1,i),c=new ne(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[Ar](e,t,n,s,i,o){if(t<0||t>this[k].layers.length)return null;if(t<this[k].layers.length){let f=this[k].layers[t],c=null;for(let h of f.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&s!==-1&&(d=h[J]?.index===s)):d=h.name===e,!!d){i!==null&&(h[fe]={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 Ee(e,!0,a);if(u[fe]=l,t==this[k].layers.length){let f=new yt;f.views=[u],this[k].layers.push(f)}else this[k].layers[t].views.push(u);return u}}const In="fox-router-view",Nn="fox-router-link";function Or(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Lr(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Hn(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Dn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Vn(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Bn(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Un(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function kn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Wn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function zn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Jn(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function Gn(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function Qn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function zt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function xe(r,e){r.classList.contains(e)||r.classList.add(e)}function Re(r,e){r.classList.remove(e)}const Xn=Ie&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Jt(r){Xn(r)}function D(r,e,t){S(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function Mr(r,e,t,n=-1,s,i,o,a){if(S(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},s);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Mt(e,c,u)}),Reflect.apply(i,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{Lt(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Mt(e,l,u)};Lt(e,l,u)}}function Gt(r){return!Ie||r===null?!1:r.opsType===F.Append||r.opsType===F.Open}function Ir(r,e,t,n={},s,i=-1){if(e||Gt(s)){const o=Or(n,e);o&&xe(t,o);const a=Lr(n,e);a&&xe(t,a);const l=Un(n,e);D(r,l,[t,e,s,i])}}function Nr(r,e,t,n={},s,i,o,a){if(!Gt(i)&&!e){S(a)&&a(r,a,[t]);return}const l=Or(n,e),u=Lr(n,e),f=Hn(n,e),c=kn(n,e),h=Wn(n,e),d=zn(n,e);Jt(()=>{Mr(r,t,i,o,s,()=>{u&&Re(t,u),f&&Re(t,f),S(h)&&D(r,h,[t,e,i,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&D(r,d,[t,e,i,o])}),l&&Re(t,l),f&&xe(t,f),S(c)&&D(r,c,[t,e,i,o])})}function Hr(r,e,t,n={},s,i,o,a,l){if(!Gt(o)&&!e){!e&&S(i)&&i();return}const u=Dn(n,e),f=Vn(n,e),c=Bn(n,e),h=Jn(n,e),d=Gn(n,e),y=Qn(n,e);u&&xe(t,u),f&&xe(t,f),S(h)&&D(r,h,[t,e,o,a]),Jt(()=>{Mr(r,t,o,a,s,()=>{f&&Re(t,f),c&&Re(t,c),S(d)&&D(r,d,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(i)&&i()},()=>{S(y)&&D(r,y,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(i)&&i()}),u&&Re(t,u),c&&xe(t,c)})}function It(r,e={},t,n=-1){const s=e.mode??"default",i=zt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Ir(r,!1,a,e,t,n)},enter:a=>{Nr(r,!1,a,e,i.enter,t,n)},leave:(a,l)=>{Hr(r,!1,a,e,i.leave,l,t,n)},clone:a=>It(r,e,t,n)}}function Dr(r){return r.el}function Yn(r,e,t={},n,s,i,o){if(i){const a=Dr(e);if(a==null)return;const l=zt(t);Ir(r,!0,a,t,n,s),Nr(r,!0,a,t,l.show,n,s,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function Zn(r,e,t={},n,s,i,o){if(i){const a=Dr(e);if(a==null)return;const l=zt(t);Hr(r,!0,a,t,l.hide,null,n,s,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function es(r,e={}){Jt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function ie(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Kt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}function ve(r,e){return typeof e=="function"?e(r):r}class ts{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(r,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,s=w.inject(it,null),i=w.inject(ct,0),o=w.inject(lr,null),a=w.inject(ht,-1);let l=null;const u=r.modelSlot;if(u){if(w.provide(ct,i+1),w.provide(ht,u.index),w.provide(dt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=tt(t.proxy,!0);yn(h),or(h,()=>u.route??null)}else{if(s==null){console.error("router is not been injected");return}const c=r.name,h=w.inject(ar,null),d=w.inject(dt,0);if(l=s[Ar](c,i,o,a,h,d),l===null)return;w.provide(ar,l);const y=l[G]===!0;if(y&&w.provide(lr,l),!n&&(w.provide(ht,-1),w.provide(ct,i+1),w.provide(dt,-1),y)){const m=tt(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(n){const c=new Map,h=[],d=l?.slots.value,y=[];for(let v=0;v<d.length;v++){const g=d[v],j=`${r.name}_${g.index}`,x=ie(r.transition,g.route,v)??!0,T={modelSlot:g};let A;e.slots.default?A=w.h(Nt,T,{default:e.slots.default}):A=w.h(Nt,T);const P={},C=ie(r.viewClass,g.route,v);typeof C=="string"&&C.length>0&&(P[C]=!0);const W=ie(r.viewActiveClass,g.route,v),M=ie(r.viewInactiveClass,g.route,v),I=f.value.get(j);if(typeof W=="string"&&W.length>0&&(P[W]=g.active),typeof M=="string"&&M.length>0&&(P[M]=!g.active),I&&g.active!==I.state){const Y=I.node;g.active?y.unshift(()=>{const lt=()=>{let Se=sr(Y);Se!=null&&ir(Se,qt.ACTIVATED)};Yn(t,Y,r,g.route,v,x,lt)}):y.push(()=>{const lt=()=>{const Se=sr(Y);Se!=null&&ir(Se,qt.DEACTIVATED)};Zn(t,Y,r,g.route,v,x,lt)})}const X={class:P,key:j},z=ie(r.viewTagProps,g.route,v);if(z!==null&&typeof z=="object"){const Y=ve(z,s?.propsFilter);$(!0,X,Y)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const Y=ve(g.route.viewTagAttrs,s?.propsFilter);$(!0,X,Y)}const re=ie(r.viewTag,g.route,v),ot=w.h(re,X,{default:()=>[A]});if(c.set(j,new ts(ot,g.active)),f.value.delete(j),x){const Y=It(t,r,g.route,v);ot.transition=Y}h.push(ot)}f.value.forEach(v=>{v.node.transition=null}),f.value=c,es(y,t);const m=ie(r.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 y=ve(c.props,s?.propsFilter);$(!1,h,y)}else if(c.props===!0&&typeof u.route?.params=="object"){const y=ve(u.route.params,s?.propsFilter);$(!1,h,y)}}const d=w.h(c.component,h);return Kt(e.slots.default,{Component:d,route:u.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.route??(t.proxy&&kt(t.proxy))??null,y=h.model,m={};if(y.props){if(typeof y.props=="object"){const g=ve(y.props,s?.propsFilter);$(!1,m,g)}else if(y.props===!0&&typeof d?.params=="object"){const g=ve(d.params,s?.propsFilter);$(!1,m,g)}}const p=w.h(y.component,m);if(ie(r.transition,d,-1)??!0){const g=It(t,r,d,-1);p.transition=g}return Kt(e.slots.default,{Component:p,route:d})??p}else return Kt(e.slots.fallback,{})}}}});function rs(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function ns(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function ss(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function ge(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let is=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(r,e){const t=w.inject(it,null);return()=>{let n=ge(r.to,null),s=ge(r.tag,n);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[H](n),r.root&&(i.root=r.root),o=t.current);let a={},l=ge(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=ss(i,o)),ge(r.exact,i)===!0){let h=ge(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=ns(i,o))}let f={class:a};(s==="a"||s==="A")&&(f.href=i?.path??i?.name??"#"),$(!0,f,e.attrs);let c=ge(r.event,i);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}rs(d)&&t.to(i)};f[c]=h}return w.h(s,f,e.slots)}}});var O=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(O||{}),Ze=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(Ze||{});class os{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 br{moduleManager=new os;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 He().head}constructor(){}setModule(e,t){const n={id:e,src:"",status:O.Defined};typeof t=="function"?(n.exports=t,n.type=Ze.factory):n.exports=t,this.moduleManager.set(e,n)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let n=e.length-1;const s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let 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 ls(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 Me;for(let l=0;l<t.length;l++){const u=new as(l,t[l],s,o);this.mount(a,u)}return this}remove(...e){let t=[],n=e.length-1,s={};typeof e[n]=="object"&&(Object.assign(s,e[n]),n--);let i=null;typeof e[n]=="function"&&(i=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&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 n=this.getFileNamePostfix(t.src);if(n==="js"||n.length===0){let s=t.params.jsPoint;s||(s=this.head),this.mountJS(e,t,s);return}else if(n==="css"){let s=t.params.cssPoint;s||(s=this.head),this.mountCSS(e,t,s);return}}mountCSS(e,t,n){e.post(s=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==O.Defined||o.status==O.Loaded)&&o.exports){o.type===Ze.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=He(),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{n.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{n.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),s.resolve()}};setTimeout(()=>{Vr(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,n.appendChild(l)})}mountJS(e,t,n){e.post(s=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==O.Defined||o.status==O.Loaded)){if(o.exports){o.type===Ze.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:O.Loading},this.moduleManager.set(i,o);const l=He().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status==O.Loading&&(o.status=O.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=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==O.Loading&&(o.status=O.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;const f=L();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=He(),s=this.getFileNamePostfix(e);if(s==="js"||s.length===0){const i=n.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(s==="css"){const i=n.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===void 0||e[n]===null)continue;const s=e[n].trim();s.length!==0&&t.push(s)}return t}createDefine(e,t){const n=this,s=function(...i){e.status=O.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=n.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=n.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...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=O.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=O.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 n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let s=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(s)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e){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 n=0;n<t.length;n++){const s=t[n];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`${pt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${pt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${L().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`${pt()}${e}`}}function Vr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(s){s.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.timeout>e.timeout?e.error():Vr(r,e)},20)}class ls{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(s){console.error(s.message,s)}}isOK(){return this.status}}class as{index;src;params;progress;constructor(e,t,n,s){this.index=e,this.src=t,this.params=n,this.progress=s}}const Qt=Symbol("fk"),Xt=Symbol("fbk"),Yt=Symbol("fepk");function us(r={}){const e=new Mn(r),t=new Tt,n=new _t,s=new br,i={get router(){return e},get bus(){return t},get Bus(){return Tt},get EventProxy(){return _t},get eventproxy(){return n},get EventChain(){return Me},get Require(){return br},get require(){return s},get extend(){return $},get clone(){return st},get isESModule(){return Ht},install(o){o.provide(it,e),o.provide(Qt,i),o.provide(Xt,t),o.provide(Yt,n),o.component(In,Nt),o.component(Nn,is),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 n}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){n.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){n.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){n.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=n;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return kt(this)}}}),e.init()}};return i}function Zt(r){return r?r.$router:w.inject(it)}function fs(r){return r||(r=w.getCurrentInstance()?.proxy??void 0),r?kt(r):null}function cs(r){return r?r.$fox:w.inject(Qt)}function hs(r){return r?r.$bus:w.inject(Xt)}function ds(r){return r?r.$eventProxy:w.inject(Yt)}function ys(r){const e=Zt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function ps(r){const e=Zt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=Tt;exports.EventChain=Me;exports.EventProxy=_t;exports.Route=_;exports.clone=st;exports.createFox=us;exports.createMemoryHistory=qr;exports.createWebHashHistory=_r;exports.createWebHistory=_n;exports.deleteContextValue=dn;exports.extend=$;exports.foxBusKey=Xt;exports.foxEventProxyKey=Yt;exports.foxKey=Qt;exports.injectContextValue=Ut;exports.isArray=Br;exports.isDate=Wr;exports.isESModule=Ht;exports.isEqual=jt;exports.isFunction=S;exports.isMap=Ur;exports.isObject=xr;exports.isPlainObject=Rr;exports.isPromise=Gr;exports.isSet=kr;exports.isString=zr;exports.isSymbol=Jr;exports.onAfterRouteUpdate=ps;exports.onBeforeRouteUpdate=ys;exports.onFoxActivated=gn;exports.onFoxInactivated=wn;exports.provideContextValue=hn;exports.sessionKey=oe;exports.toBoolean=Dt;exports.toNumber=Zr;exports.toTypeString=nt;exports.typeOf=$t;exports.useBus=hs;exports.useEventProxy=ds;exports.useFox=cs;exports.useRoute=fs;exports.useRouter=Zt;
|
|
2
|
+
* fox v3.0.0 Wed Aug 30 2023 08:45:58 GMT+0800 (中国标准时间)
|
|
3
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Se=typeof window<"u",O=function(){return window},Ie=function(){return window.document};function Ur(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(!Se)return"/";let n=O().location,e=`${n.protocol}//${n.host}`;return e+=Ur(n.pathname),e}function Kt(n,e,t){n.addEventListener?n.addEventListener(e,t,!1):n.attachEvent?n.attachEvent(`on${e}`,t):n[`on${e}`]=t}function $t(n,e,t){n.removeEventListener?n.removeEventListener(e,t):n.detachEvent?n.detachEvent(`on${e}`,t):n[`on${e}`]=null}const kr=Array.isArray,Wr=n=>nt(n)==="[object Map]",zr=n=>nt(n)==="[object Set]",Jr=n=>n instanceof Date,S=n=>typeof n=="function",Gr=n=>typeof n=="string",Qr=n=>typeof n=="symbol",xr=n=>n!==null&&typeof n=="object",Xr=n=>xr(n)&&S(n.then)&&S(n.catch),Rr=n=>n==null,Yr=Object.prototype.toString,nt=n=>Yr.call(n),Sr=n=>nt(n)==="[object Object]",Zr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Ht(n){return n.__esModule||Zr&&n[Symbol.toStringTag]==="Module"}const en=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 st(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)&&!Sr(i))continue;s=st(s,i,t),n[r]=s}else{if(typeof i=="function")continue;n[r]=i}}}return n}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const ut=en?Promise.resolve():null;function Le(n,...e){ut!==null?e&&e.length>0?ut.then(()=>{n(e)}):ut.then(n):e&&e.length>0?setTimeout(()=>{n(e)}):setTimeout(n)}function Dt(n){return n==null?!1:typeof n=="boolean"?n:typeof n=="string"?n.toLocaleLowerCase()==="true":!!n}function tn(n){return typeof n=="number"?n:Number(n)}const rn={"[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 jt(n){let t=Object.prototype.toString.call(n);return n==null?String(n):rn[t]||"object"}function Tt(n,e){if(n==e)return!0;if(n===void 0||e===void 0)return!1;let t=jt(n),r=jt(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(!Tt(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(!Tt(i,o))return!1}return!0}return!1}const Pr=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Pr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},nn=/^Symbol\((.*)\)$/,Cr=n=>{const e={};for(let t of Reflect.ownKeys(n)){let r=n[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Cr(r));const s=nn.exec(t);if(s&&s[1]){const i=Symbol.for(s[1]);e[i]=r}else e[t]=r}return e},er=Symbol("idKey"),he=Symbol("valueKey"),R=Symbol("childrenKey"),Q=Symbol("growKey");class Er{[Q]=!0;[er];[he]=w.ref();[R]=new Map;constructor(e){this[er]=e}}class sn{get(e,t){if(t=="value")return e[he].value;if(t==="grow")return e[Q];let r=e[R].get(t);if(r)return Me(r);if(e[Q])return r=Bt(t),r[Q]=e[Q],e[R].set(t,r),Me(r)}set(e,t,r){return t=="value"?(e[he].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):r==null?(e[R].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[R].delete(t),!0)}}const Vt="__proxy__";function Bt(n){const e=new Er(n);return Reflect.set(e,Vt,new Proxy(e,new sn)),e}function Me(n){return Reflect.get(n,Vt)}class on{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(Se){const t=O();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 Er{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new on(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[R].has(i)?o=r[R].get(i):(o=Bt(i),r[R].set(i,o)),r=o}return r[he].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[R].has(i))r=r[R].get(i);else return}return r[he].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[R].has(o))r=r[R].get(o);else return!1}const s=e[t-1];return r[R].has(s)?(r[R].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[R].has(o))r=r[R].get(o);else return!1}const s=e[t-1];return r[R].has(s)}clear(){this[R].clear(),this._persistHandler.clear()}}const ln=["put","get","contains","remove","clear","_persistHandler"];function tr(n){return ln.includes(n)}class an{get(e,t){if(t=="value")return e[he].value;if(t==="grow")return e[Q];if(t===R)return e[R];if(typeof t=="string"&&tr(t))return e[t];let r=String(t),s=e[R].get(r);if(s)return Me(s);if(e[Q])return s=Bt(r),s[Q]=e[Q],e[R].set(r,s),Me(s)}set(e,t,r){return t=="value"?(e[he].value=r,!0):t==="grow"?(e[Q]=Dt(r),!0):tr(t)?!1:r==null?(e[R].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[R].delete(t),!0)}}function un(n){const e=new Ar(n),t=new an,r=new Proxy(e,t);return Reflect.set(e,Vt,r),e}const qt=new Proxy(Ar,{construct(n,e){const t=un(e[0]??{});return Me(t)}}),te="default",Fr=Symbol("sync"),H=Symbol("resolveRoute");function rr(n){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(n,{},t)}}function fn(n){let e=n.src;return new Promise((t,r)=>{const s=rr(a=>{Ht(a)&&(a=a.default),n.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(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 cn{name;level;rootName;rootIndex=0;constructor(e,t,r,s){this.name=e,this.level=t,this.rootName=r,this.rootIndex=s}}class et{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new et(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class T{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;template;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new T;return st(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 T;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 hn{id;name;props;meta;src;component;constructor(e,t,r,s){this.id=le.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 fn(this)}}class nr{models=[]}class ft{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),I=Symbol("cursorKey"),ct=Symbol("$persistentModeKey"),_=Symbol("statusKey"),Z=Symbol("argsKey"),He=Symbol("exArgsKey"),ye=Symbol("successFnsKey"),Ce=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class Ne{[V]=[];[I]=0;[ct]=!1;[_]="Free";[Z]=[];[He]=[];[ye]=[];[Ce]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[ct]=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[He]];for(;this[Ce].length>0;)try{let l=this[Ce].shift();typeof l=="function"&&Le(()=>{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[ye].length>0;){let l=this[ye].shift();typeof l=="function"&&Le(()=>{Reflect.apply(l,{},a)})}return this[_]="Free",this}if(this[I]>=this[V].length)return this[_]="Free",this;let s=this[V][this[I]];this[ct]||(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]};Le(()=>{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[_]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[_]="Reject",this[He]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[_]="Exception",this[He]=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[ye].length>0;){let s=this[ye].shift();Le(()=>{Reflect.apply(s,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[ye].push(e),t&&typeof t=="function"&&this[Ce].push(t),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ce].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 de=Symbol("registerKey");class yn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Ot{[de]=new Map;constructor(){}on(e,t,r=!1){let s=this[de].get(e);s||(s=new Array,this[de].set(e,s));let i=r===!0?1:0,o=new yn(t,i);return s.push(o),this}off(e,t){if(!t)return this[de].delete(e),this;let r=this[de].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[de].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{Le(()=>{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 Ee=Symbol("registerKey");class dn{[Ee]=new Map;constructor(){}set(e,t){this[Ee].set(e,t)}get(e){return this[Ee].get(e)}has(e){return this[Ee].has(e)}delete(e){return this[Ee].delete(e)}}const ce=Symbol("lc");function tt(n,e=!1){let t=n;if(Reflect.has(t,ce))return t[ce];if(e){const r=new dn;return t[ce]=r,r}return null}function _r(n,e=!1){let t=null,r=n;for(;r&&!(Reflect.has(r,ce)&&(t=r[ce],t));)r=r.$parent;if(!t&&e){const s=n;s&&s.$parent&&(t=tt(s.$parent,e))}return t}function Ut(n,e){let t=n;for(;t;){if(Reflect.has(t,ce)){const r=t[ce];if(r.has(e))return r.get(e)}t=t.$parent}return null}function pn(n,e,t){_r(n,!0)?.set(e,t)}function mn(n,e){_r(n,!0)?.delete(e)}function sr(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 tt(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function vn(n){let e=n.get(rt);e||(e=[],n.set(rt,e))}function ir(n,e){let t=n.get(rt);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 Lt=(n=>(n.DEACTIVATED="da",n.ACTIVATED="a",n))(Lt||{});class gn{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function wn(n,e,t,r){let s=new gn(e,t,r);return n.push(s),!0}function bn(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 Kr(n){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 s=Ut(r,rt);if(s==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{bn(s,n,e,r)}),wn(s,n,e,r)}}const xn=Kr("a"),Rn=Kr("da"),Mt=Symbol("routeKey");function or(n,e){n.set(Mt,e)}function kt(n){let e=Ut(n,Mt);return typeof e=="function"?e():e??null}const it=Symbol("rk"),ht=Symbol("vd"),lr=Symbol("rv"),yt=Symbol("rvi"),ar=Symbol("pv"),dt=Symbol("pvi");function Sn(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 $r(n,e){e===void 0&&(e={});for(var t=Sn(n),r=e.prefixes,s=r===void 0?"./":r,i="[^".concat(we(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(A){if(l<t.length&&t[l].type===A)return t[l++].value},c=function(A){var P=f(A);if(P!==void 0)return P;var C=t[l],W=C.type,M=C.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(A))},h=function(){for(var A="",P;P=f("CHAR")||f("ESCAPED_CHAR");)A+=P;return A};l<t.length;){var y=f("CHAR"),d=f("NAME"),m=f("PATTERN");if(d||m){var p=y||"";s.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(),$=f("NAME")||"",x=f("PATTERN")||"",j=h();c("CLOSE"),o.push({name:$||(x?a++:""),pattern:$&&!x?i:x,prefix:p,suffix:j,modifier:f("MODIFIER")||""});continue}c("END")}return o}function Pn(n,e){return Cn($r(n,e),e)}function Cn(n,e){e===void 0&&(e={});var t=Wt(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 m=0;m<h.length;m++){var p=s(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=s(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 En(n,e){var t=[],r=jr(n,t,e);return An(r,t,e)}function An(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 we(n){return n.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Wt(n){return n&&n.sensitive?"":"i"}function Fn(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 _n(n,e,t){var r=n.map(function(s){return jr(s,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Wt(t))}function Kn(n,e,t){return $n($r(n,t),e,t)}function $n(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(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,d=y===void 0?"":y,m="[".concat(we(d),"]|$"),p="[".concat(we(h),"]"),v=o?"^":"",g=0,$=n;g<$.length;g++){var x=$[g];if(typeof x=="string")v+=we(f(x));else{var j=we(f(x.prefix)),A=we(f(x.suffix));if(x.pattern)if(e&&e.push(x),j||A)if(x.modifier==="+"||x.modifier==="*"){var P=x.modifier==="*"?"?":"";v+="(?:".concat(j,"((?:").concat(x.pattern,")(?:").concat(A).concat(j,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(P)}else v+="(?:".concat(j,"(").concat(x.pattern,")").concat(A,")").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(j).concat(A,")").concat(x.modifier)}}if(l)s||(v+="".concat(p,"?")),v+=t.endsWith?"(?=".concat(m,")"):"$";else{var C=n[n.length-1],W=typeof C=="string"?p.indexOf(C[C.length-1])>-1:C===void 0;s||(v+="(?:".concat(p,"(?=").concat(m,"))?")),W||(v+="(?=".concat(p,"|").concat(m,")"))}return new RegExp(v,Wt(t))}function jr(n,e,t){return n instanceof RegExp?Fn(n,e):Array.isArray(n)?_n(n,e,t):Kn(n,e,t)}var F=(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))(F||{}),Xe=(n=>(n[n.Part=0]="Part",n[n.All=1]="All",n))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),fe=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class ne{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 Ae{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[fe]=null;get name(){return this[Ye]}constructor(e,t,r){this[Ye]=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 s=e[r];if(s.view===t.view&&(t.index==-1||s.index===t.index)&&s.level===t.level)return!0}return!1}}class pt{views=[]}class jn{layers=[]}class Tn{time;route}class qn{forbidTime=300;submitRecorder=new Tn;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 be=Symbol("_notifyChange");class ur{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const De=Symbol("ignoreHistoryChangeOnceKey"),fr=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),mt=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),Fe=Symbol("_setRouteMarkRecorder"),_e=Symbol("beforeRestoreFiltersKey"),cr=Symbol("_beforeRestore"),hr="Symbol(_fox_restore_point)";function gt(n,...e){return typeof n=="function"?Reflect.apply(n,null,[...e]):n}class Tr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[De]=!1;[_e]=new Array;constructor(e="hash",t="",r="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=r,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??O().sessionStorage}init(e=!0){const t=O();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[De]){this[De]=!1;return}if(gt(this.historyMonitor)){const r=t.history.state;this[be](r);try{let s=[];if(typeof r=="string"?s=JSON.parse(r):s=r,Array.isArray(s)&&s.length>0){const i=this[Ve]()??"/";this[Fe](i,s)}}catch{}}}),Kt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[fr](),Promise.resolve()}destroy(){if(this.historyChange){const e=O();$t(e,"popstate",this.historyChange)}}[cr](e,t,r,s){for(let i of this[_e])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[_e].push(e)}removeBeforeRestoreEach(e){const t=this[_e].indexOf(e);return t!==-1?(this[_e].splice(t,1),!0):!1}[fr](){const e=this[Ve]()??"/",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?Cr(l.params):{},this[cr](l,u,e,o.routes)));if(a.length>0){const l=this[mt](),u=a.length-1;a[u].query=l||a[u].query,this[be](a);return}}}catch{}const r=e.indexOf("!");let s;r!=-1?s=e.substring(r+1):s=e;const i=new T;i.path=s,i.query=this[mt](),this[be]([i])}[Fe](e,t){try{t.forEach(i=>{i.params=i.params?Pr(i.params):{}});const s=JSON.stringify({mark:e,routes:t});this.storage.setItem(hr,s)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ve]()??"/";this[Fe](t,e)}[be](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=O();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}[mt](){let t=O().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!0){const r=O();this[De]=!t,r.history.go(e)}push(e){const t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||O().history.pushState(e.routes,"",t);const r=e.currentRoute.fullPath;this[Fe](r,e.routes)}replace(e){const t=this[vt](e.currentRoute);gt(this.traceless,e.currentRoute)||O().history.replaceState(e.routes,"",t);const r=e.currentRoute.fullPath;this[Fe](r,e.routes)}[vt](e){const t=O();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(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=`${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 On(n=!0,e=null,t="",r=!0,s=!1,i){return e!==null&&(e=O().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Tr("path",e??"",t,n,r,s,i)}function qr(n=!0,e="",t=!0,r=!1,s){return new Tr("hash","",e,n,t,r,s)}class Ln{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}[be](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let 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,t)){const s=this.queue[r];this[be](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Or(n="",e=50){return new Ln(n,e)}const Be=Symbol("_constructRouteModel"),Ue=Symbol("_findRouteModel"),wt=Symbol("_findRootView"),yr=Symbol("_getFirstView"),ae=Symbol("_removeView"),dr=Symbol("_buildPage"),pr=Symbol("_resolveComponent"),mr=Symbol("_update"),se=Symbol("_merge"),bt=Symbol("_handleHistoryChange"),ke=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),pe=Symbol("current"),vr=Symbol("_addRouteRecorder"),Ke=Symbol("_removeRouteRecorder"),ze=Symbol("_cloneRouteRecorder"),q=Symbol("_handleError"),Je=Symbol("errorCallback"),U=Symbol("registerKey"),Ge=Symbol("notFoundKey"),xt=Symbol("notFoundPathKey"),k=Symbol("forestKey"),E=Symbol("historyKey"),$e=Symbol("beforeFiltersKey"),je=Symbol("afterFiltersKey"),Te=Symbol("destroyFiltersKey"),Rt=Symbol("propsFilterKey"),me=Symbol("mainDispatcherKey"),St=Symbol("initKey"),ue=Symbol("readyKey"),Pt=Symbol("readyHandlersKey"),Qe=Symbol("_markReady"),gr=Symbol("_createNextFn"),Ct=Symbol("_start"),Et=Symbol("_before"),At=Symbol("_after"),wr=Symbol("_destroy"),Ft=Symbol("_load"),qe=Symbol("_unload"),Oe=Symbol("routerGuardKey");function Mn(n){return n.layers.length==0||n.layers[0].views.length==0}function Nn(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 In{[U]=new Array;[Ge];[xt]="*";[ue]=!1;[Pt]=[];[k]=new jn;[E];[b]=new Array;[Je]=null;[We]=null;[$e]=new Array;[je]=new Array;[Te]=new Array;[Rt]=null;[me]=new Ne;[Oe]=new qn;[St]=!1;[pe]=w.ref(null);get current(){return this[pe].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[E]=e.history:this[E]=Se?qr():Or(),this[E]?.listen(async r=>{let s=!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),s=!1}this[ue]===!1&&this[Qe](s)})}[q](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Je]=="function")try{this[Je](e,t)}catch{}console.error(e)}init(){this[St]!==!0&&(this[E]?.init(!this[ue]),this[St]=!0)}isReady(){return this[ue]?Promise.resolve():new Promise((e,t)=>{this[Pt].push([e,t])})}[Qe](e){this[ue]=!0,this[Pt].forEach(([t,r])=>{try{e?t():r()}catch(s){console.error(s.message,s)}})}[bt](e){try{if(!e){let o=[...this[b]].reverse();return this[qe](o),Se&&O().location.reload(),Promise.resolve()}let t=null,r=[],s=[],i=0;for(;i<e.length&&i<this[b].length&&T.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&&(s=this[b].slice(i).reverse()),s.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[qe](s)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[q](t)}return Promise.resolve()}[ke](e){if(e)this[pe].value=e;else{let t=this[b].length;t>0?this[pe].value=this[b][t-1]:this[pe].value=null}if(typeof this[We]=="function")try{this[We](this[pe].value)}catch{}}[vr](e){if(e.opsType===F.Open){let t=!1;const r=this[b].length-1;for(let s=r;s>=0;s--){const i=this[b][s];if(e.root==i.root){if(e.path===i.path){this[b].splice(s,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[ze](){let e=[];for(let t of this[b]){let r=T.clone(t,!0);e.push(r)}return e}[Ke](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(T.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1),this[wr](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[Rt]=e}get propsFilter(){return this[Rt]}setRestorePoint(){const e=this[ze]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[Je]=e}beforeEach(e){this[$e].push(e)}removeBeforeEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}afterEach(e){this[je].push(e)}removeAfterEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}destroyEach(e){this[Te].push(e)}removeDestroyEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].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[xt]){this.setNotFoundRoute(e);return}const r=this[Be](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[H](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[H](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[xt]=e}setNotFoundRoute(e){const t=this[Be](e);this[Ge]=t[0]}getRoutes(){return[...this[U]]}[Be](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 ft;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in r){let l=r[a];a.length===0&&(a=te);let u=new hn(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[Be](a);for(let u of l){let f=new ft;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 nr;c.models=[...s],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new nr;a.models=s;const l=new ft;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[U]){const s=t.template??t.path,i=t.template??t.name;if(s&&r.path){let o=r.match;o||(o=r.match=En(r.path));const a=o(s);if(!a)continue;if(r.redirect){const l=new T;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=Pn(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 T,typeof e[0]=="object")t=T.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=T.from(e):typeof e=="string"&&(t=new T,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??F.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||F.Push,this.to(t)):(this[q]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=F.Put,this.to(t)):(this[q]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=F.Replace,this.to(t)):(this[q]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=F.Append,this.to(t)):(this[q]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[me].post(r=>{try{if(this[b].length===0){r.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[b][0].root??te,e.all)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];u.opsType===F.Append&&u.root===i&&(o.splice(0,0,u),s=l-1)}else if(e.until)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];if(u.opsType===F.Append&&u.root===i){if(e.until.charAt(0)==="/"&&e.until===u.path){s=l;break}else if(e.until===u.name){s=l;break}o.splice(0,0,u)}}}else{i=te;let l=this[yr](this[k]);l&&(i=l.name);for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===F.Append&&f.root===i){o.push(f),s=u-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),r.resolve(l),t(!1);return}let a=0;if(this[b].forEach(l=>{l.opsType!==F.Put&&a++}),this[qe](o)){let l=0;this[b].forEach(f=>{f.opsType!==F.Put&&l++});const u=l-a;this[E]?.go(u,!1),r.resolve(),t(!0)}}catch(s){this[q](s),r.resolve(),t(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=F.Open,this.to(t)):(this[q]("resolve route fail",t),this)}close(e){return this[me].post(t=>{try{let r=this[H](e);if(!r){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===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[qe](s)&&this[ke](),t.resolve()}catch(r){this[q](r),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[q]("resolve route fail",t),this;let r=this[Oe].acquire(t);return r==null?(this[q]("route forbid",t),this):(this[me].post(s=>{try{let i=this[Ct](t);this[Et](i),this[Ft](i),this[At](i),i.wait((o,a)=>{const l=o.session.to;try{let u=T.clone(l,!0);const f=new ur(u,this[ze]());l.opsType===F.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[Oe].release(r),this[ke](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ue]===!1&&this[Qe](!0),s.resolve()},(o,a)=>{this[Oe].release(r),a!==null&&this[q](a,t),this[ue]===!1&&this[Qe](!1),s.resolve()})}catch(i){this[Oe].release(r),this[q](i,t),s.resolve()}}),this)}back(e=1){this[E]?.go(-e)}[gr](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[H](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()}}[Ct](e){let t=this[b].length>0?this[b][0]:void 0,r=new et(e,t),s={route:e,find:null};return this[Ue](s),s.find&&(r.routeModel=s.find,e.matched=Nn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new Ne(r)}[Et](e){for(let t of this[$e])e.post(r=>{const s=this[gr](r);Reflect.apply(t,{},[r.session.to,r.session.from,s,r.session])})}[At](e){e.post(t=>{for(let r of this[je])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[wr](e,t){for(let r of this[Te])try{Reflect.apply(r,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ft](e){e.post(t=>{let r=t.session.to,s=t.session.routeModel;if(s==null){let o={route:r,find:null};if(this[Ue](o))s=o.find,t.session.routeModel=s;else if(this[Ge])s=this[Ge];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=et.from(t.session);this[dr](r,s,i).then(o=>{this[k],t.resolve()},o=>{t.reject(o)})})}[qe](e){if(e.length==0)return!0;let t=this[k],r=[];for(let s of e){let i=this[wt](t,s);i!=null&&r.push({...i,route:s})}if(r.length==0){let s="can not find view index";return this[q](s),!1}for(let s of r.reverse())this[ae](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[wt](e,t){const r=t.root??te;let s;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Ye]===r)return s={x:a,y:i},s}}return null}[yr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ae](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[G]&&(this[Ke](h.route),h.active===!0&&h.route.opsType==F.Append&&(l=!0)),a.push(new B(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[fe]&&(o||B.include(a,d[fe]))){let m=d.slots.value;for(let p=m.length-1;p>=0;p--){let v=m[p];v.route&&d[G]&&this[Ke](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[U].length==0){let t=this[k];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[ke](),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[me].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[q](h),u.resolve()})})}this[me].post(a=>{if(i&&o===!0){const l=T.clone(i,!0),u=new ur(l,this[ze]());this[E]?.replace(u)}a.resolve(),r()})})}[dr](e,t,r){let s=e.updateType??Xe.Part;return this[pr](t).then(()=>{this[mr](t,e,r,s)})}[pr](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()}[mr](e,t,r,s){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const i=e.layers[0].models[0];let o=this[k],a=Mn(o),l=t.root??te,u;!a&&s==Xe.Part&&(u=this[wt](o,t));let f,c=0;if(u==null||u==null)if(a||s===Xe.All){if(o.layers.length==0&&(o.layers[0]=new pt),o.layers[0].views.length==0){let h=t.root??te;f=new Ae(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 Promise.reject("can not rebuild view(because not route slot)");let y=h.level;if(y>o.layers.length)return Promise.reject("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 Promise.reject("can not insert view(not find root node ref)");f=new Ae(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===F.Append){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 ne(t,i,t.index,!0);f.slots.value=[...h,y];let d=c+1,m=1,p=new B(f,t.index,c);this[se](o,d,e,m,p)}else if(t.opsType===F.Open){let h=f.slots.value;const y=t.active??!0;let d=!1;for(let m of h){if(m.route!==null&&T.isSameForRouteModel(m.route,t)){if(m.active===y)return t.index=m.index,t.active=y,m.route=t,Promise.resolve();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=le.get(),t.active=y;let m=new ne(t,i,t.index,y);h.push(m);let p=c+1,v=1,g=new B(f,t.index,c);this[se](o,p,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=le.get(),t.active=!0,f.slots.value=[new ne(t,i,t.index)];let y=c+1,d=1,m=new B(f,t.index,c);this[se](o,y,e,d,m)}else{let y=h[0];if(y.model!==i){this[ae](o,u,null,!0),t.index=le.get(),t.active=!0,f.slots.value=[new ne(t,i,t.index)];let d=c+1,m=1,p=new B(f,t.index,c);this[se](o,d,e,m,p)}else{y.route!==null&&this[Ke](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 j=1;j<h.length;j++)p.push(h[j].index);p.length>0?this[ae](o,u,p,!0):d&&(f.slots.value=[...h]);let v=[new B(f,t.index,c)],g=c+1,$=1,x=new B(f,t.index,c);for(;v.length>0&&g<o.layers.length&&$<e.layers.length;g++,$++){let j=[];for(let P=0;P<o.layers[g].views.length;P++){let C=o.layers[g].views[P];C[fe]&&B.include(v,C[fe])&&j.unshift(P)}let A=[];for(let P of j){let C=o.layers[g].views[P],W=e.layers[$].models,M;for(let N=0;N<W.length;N++)if(C.name===W[N].name){M=W[N];break}if(!M)this[ae](o,{x:P,y:g},null,!1);else{let N=C.slots.value;if(N.length==0){let X=0;C.slots.value=[new ne(null,M,X)];let z=g+1,re=$+1;this[se](o,z,e,re,x)}else{let X=N[0];if(X.model!==M){this[ae](o,{x:P,y:g},null,!0),C.slots.value=[new ne(null,M,0)];let z=g+1,re=$+1;this[se](o,z,e,re,x)}else{C[G]&&X.route!==null&&this[Ke](X.route);let z=[];for(let re=1;re<N.length;re++)z.push(N[re].index);z.length>0&&this[ae](o,{x:P,y:g},z,!0),A.push(new B(C,X.index,g))}}C[G]=!1}}v=A}this[se](o,g,e,$,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new cn(l,c,h?.view.name,h?.index??0))}r.to=void 0,r.routeModel=void 0,t.session=r,this[vr](t)}[se](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 Ae(u.name,!1,i),c=new ne(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new pt;l.views=[];for(let u of r.layers[o].models){let f=new Ae(u.name,!1,i),c=new ne(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[k].layers.length)return null;if(t<this[k].layers.length){let f=this[k].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&&s!==-1&&(y=h[J]?.index===s)):y=h.name===e,!!y){i!==null&&(h[fe]={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 Ae(e,!0,a);if(u[fe]=l,t==this[k].layers.length){let f=new pt;f.views=[u],this[k].layers.push(f)}else this[k].layers[t].views.push(u);return u}}const Hn="fox-router-view",Dn="fox-router-link";function Lr(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 Mr(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 Vn(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 Bn(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 Un(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 kn(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 Wn(n,e=!1){let t=null;return e?t=n.beforeShow??n.beforeEnter:t=n.beforeEnter,t}function zn(n,e=!1){let t=null;return e?t=n.show??n.enter:t=n.enter,t}function Jn(n,e=!1){let t=null;return e?t=n.afterShow??n.afterEnter:t=n.afterEnter,t}function Gn(n,e=!1){let t=null;return e?t=n.showCancelled??n.enterCancelled:t=n.enterCancelled,t}function Qn(n,e=!1){let t=null;return e?t=n.hide??n.leave:t=n.leave,t}function Xn(n,e=!1){let t=null;return e?t=n.afterHide??n.afterLeave:t=n.afterLeave,t}function Yn(n,e=!1){let t=null;return e?t=n.hideCancelled??n.leaveCancelled:t=n.leaveCancelled,t}function zt(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 Re(n,e){n.classList.remove(e)}const Zn=Se&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Jt(n){Zn(n)}function D(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=>{$t(e,c,u)}),Reflect.apply(i,n,[e,t,r]),a&&Reflect.apply(a,n,[])};l.forEach(f=>{Kt(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,n,[e,t,r]),$t(e,l,u)};Kt(e,l,u)}}function Gt(n){return!Se||n===null?!1:n.opsType===F.Append||n.opsType===F.Open}function Ir(n,e,t,r={},s,i=-1){if(e||Gt(s)){const o=Lr(r,e);o&&xe(t,o);const a=Mr(r,e);a&&xe(t,a);const l=Wn(r,e);D(n,l,[t,e,s,i])}}function Hr(n,e,t,r={},s,i,o,a){if(!Gt(i)&&!e){S(a)&&a(n,a,[t]);return}const l=Lr(r,e),u=Mr(r,e),f=Vn(r,e),c=zn(r,e),h=Jn(r,e),y=Gn(r,e);Jt(()=>{Nr(n,t,i,o,s,()=>{u&&Re(t,u),f&&Re(t,f),S(h)&&D(n,h,[t,e,i,o]),S(a)&&a(n,a,[t])},()=>{S(y)&&D(n,y,[t,e,i,o])}),l&&Re(t,l),f&&xe(t,f),S(c)&&D(n,c,[t,e,i,o])})}function Dr(n,e,t,r={},s,i,o,a,l){if(!Gt(o)&&!e){!e&&S(i)&&i();return}const u=Bn(r,e),f=Un(r,e),c=kn(r,e),h=Qn(r,e),y=Xn(r,e),d=Yn(r,e);u&&xe(t,u),f&&xe(t,f),S(h)&&D(n,h,[t,e,o,a]),Jt(()=>{Nr(n,t,o,a,s,()=>{f&&Re(t,f),c&&Re(t,c),S(y)&&D(n,y,[t,e,o,a]),S(l)&&D(n,l,[t]),!e&&S(i)&&i()},()=>{S(d)&&D(n,d,[t,e,o,a]),S(l)&&D(n,l,[t]),!e&&S(i)&&i()}),u&&Re(t,u),c&&xe(t,c)})}function Nt(n,e={},t,r=-1){const s=e.mode??"default",i=zt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Ir(n,!1,a,e,t,r)},enter:a=>{Hr(n,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Dr(n,!1,a,e,i.leave,l,t,r)},clone:a=>Nt(n,e,t,r)}}function Vr(n){return n.el}function es(n,e,t={},r,s,i,o){if(i){const a=Vr(e);if(a==null)return;const l=zt(t);Ir(n,!0,a,t,r,s),Hr(n,!0,a,t,l.show,r,s,u=>{S(o)&&D(n,o,[u])})}else S(o)&&D(n,o,[])}function ts(n,e,t={},r,s,i,o){if(i){const a=Vr(e);if(a==null)return;const l=zt(t);Dr(n,!0,a,t,l.hide,null,r,s,u=>{S(o)&&D(n,o,[u])})}else S(o)&&D(n,o,[])}function rs(n,e={}){Jt(()=>{for(let t=0;t<n.length;t++)Reflect.apply(n[t],e,[])})}function ie(n,e,t){return typeof n=="function"?Reflect.apply(n,{},[e,t]):n}function _t(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}function ve(n,e){return typeof e=="function"?e(n):n}class ns{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(n,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=n.multi===!0,s=w.inject(it,null),i=w.inject(ht,0),o=w.inject(lr,null),a=w.inject(yt,-1);let l=null;const u=n.modelSlot;if(u){if(w.provide(ht,i+1),w.provide(yt,u.index),w.provide(dt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=tt(t.proxy,!0);vn(h),or(h,()=>u.route??null)}else{if(s==null){console.error("router is not been injected");return}const c=n.name,h=w.inject(ar,null),y=w.inject(dt,0);if(l=s[Fr](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(yt,-1),w.provide(ht,i+1),w.provide(dt,-1),d)){const m=tt(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],$=`${n.name}_${g.index}`,x=ie(n.transition,g.route,v)??!0,j={modelSlot:g};let A;e.slots.default?A=w.h(It,j,{default:e.slots.default}):A=w.h(It,j);const P={},C=ie(n.viewClass,g.route,v);typeof C=="string"&&C.length>0&&(P[C]=!0);const W=ie(n.viewActiveClass,g.route,v),M=ie(n.viewInactiveClass,g.route,v),N=f.value.get($);if(typeof W=="string"&&W.length>0&&(P[W]=g.active),typeof M=="string"&&M.length>0&&(P[M]=!g.active),N&&g.active!==N.state){const Y=N.node;g.active?d.unshift(()=>{const lt=()=>{let Pe=sr(Y);Pe!=null&&ir(Pe,Lt.ACTIVATED)};es(t,Y,n,g.route,v,x,lt)}):d.push(()=>{const lt=()=>{const Pe=sr(Y);Pe!=null&&ir(Pe,Lt.DEACTIVATED)};ts(t,Y,n,g.route,v,x,lt)})}const X={class:P,key:$},z=ie(n.viewTagProps,g.route,v);if(z!==null&&typeof z=="object"){const Y=ve(z,s?.propsFilter);K(!0,X,Y)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const Y=ve(g.route.viewTagAttrs,s?.propsFilter);K(!0,X,Y)}const re=ie(n.viewTag,g.route,v),ot=w.h(re,X,{default:()=>[A]});if(c.set($,new ns(ot,g.active)),f.value.delete($),x){const Y=Nt(t,n,g.route,v);ot.transition=Y}h.push(ot)}f.value.forEach(v=>{v.node.transition=null}),f.value=c,rs(d,t);const m=ie(n.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=ve(c.props,s?.propsFilter);K(!1,h,d)}else if(c.props===!0&&typeof u.route?.params=="object"){const d=ve(u.route.params,s?.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&&kt(t.proxy))??null,d=h.model,m={};if(d.props){if(typeof d.props=="object"){const g=ve(d.props,s?.propsFilter);K(!1,m,g)}else if(d.props===!0&&typeof y?.params=="object"){const g=ve(y.params,s?.propsFilter);K(!1,m,g)}}const p=w.h(d.component,m);if(ie(n.transition,y,-1)??!0){const g=Nt(t,n,y,-1);p.transition=g}return _t(e.slots.default,{Component:p,route:y})??p}else return _t(e.slots.fallback,{})}}}});function ss(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 is(n,e){return n==null||e==null?!1:!!(n===e||n.path&&n.path===e.path||n.name&&n.name===e.name)}function os(n,e){return n==null||e==null?!1:!!(n.path&&e.path&&e.path.startsWith(n.path)||n.name&&n.name==e.name)}function ge(n,e){return typeof n=="function"?Reflect.apply(n,{},[e]):n}let ls=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(n,e){const t=w.inject(it,null);return()=>{let r=ge(n.to,null),s=ge(n.tag,r);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[H](r),n.root&&(i.root=n.root),o=t.current);let a={},l=ge(n.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=os(i,o)),ge(n.exact,i)===!0){let h=ge(n.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=is(i,o))}let f={class:a};(s==="a"||s==="A")&&(f.href=i?.path??i?.name??"#"),K(!0,f,e.attrs);let c=ge(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}ss(y)&&t.to(i)};f[c]=h}return w.h(s,f,e.slots)}}});var L=(n=>(n[n.Loading=0]="Loading",n[n.Loaded=1]="Loaded",n[n.Defining=2]="Defining",n[n.Defined=3]="Defined",n))(L||{}),Ze=(n=>(n[n.normal=0]="normal",n[n.factory=1]="factory",n))(Ze||{});class as{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 br{moduleManager=new as;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 Ie().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:L.Defined};typeof t=="function"?(r.exports=t,r.type=Ze.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 us(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 Ne;for(let l=0;l<t.length;l++){const u=new fs(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==L.Defined||o.status==L.Loaded)&&o.exports){o.type===Ze.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=Ie(),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(()=>{Br(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==L.Defined||o.status==L.Loaded)){if(o.exports){o.type===Ze.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:L.Loading},this.moduleManager.set(i,o);const l=Ie().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)),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==L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;const f=O();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=Ie(),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=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 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`${O().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 Br(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():Br(n,e)},20)}class us{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 fs{index;src;params;progress;constructor(e,t,r,s){this.index=e,this.src=t,this.params=r,this.progress=s}}const Qt=Symbol("fk"),Xt=Symbol("fbk"),Yt=Symbol("fepk");function cs(n={}){const e=new In(n),t=new qt,r=new Ot,s=new br,i={get router(){return e},get bus(){return t},get Bus(){return qt},get EventProxy(){return Ot},get eventproxy(){return r},get EventChain(){return Ne},get Require(){return br},get require(){return s},get extend(){return K},get clone(){return st},get isESModule(){return Ht},install(o){o.provide(it,e),o.provide(Qt,i),o.provide(Xt,t),o.provide(Yt,r),o.component(Hn,It),o.component(Dn,ls),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 kt(this)}}}),e.init()}};return i}function Zt(n){return n?n.$router:w.inject(it)}function hs(n){return n||(n=w.getCurrentInstance()?.proxy??void 0),n?kt(n):null}function ys(n){return n?n.$fox:w.inject(Qt)}function ds(n){return n?n.$bus:w.inject(Xt)}function ps(n){return n?n.$eventProxy:w.inject(Yt)}function ms(n){const e=Zt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function vs(n){const e=Zt(),t=(r,s,i)=>{try{Reflect.apply(n,{},[r,s])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=qt;exports.EventChain=Ne;exports.EventProxy=Ot;exports.Route=T;exports.clone=st;exports.createFox=cs;exports.createMemoryHistory=Or;exports.createWebHashHistory=qr;exports.createWebHistory=On;exports.deleteContextValue=mn;exports.extend=K;exports.foxBusKey=Xt;exports.foxEventProxyKey=Yt;exports.foxKey=Qt;exports.injectContextValue=Ut;exports.isArray=kr;exports.isDate=Jr;exports.isESModule=Ht;exports.isEqual=Tt;exports.isFunction=S;exports.isMap=Wr;exports.isNil=Rr;exports.isObject=xr;exports.isPlainObject=Sr;exports.isPromise=Xr;exports.isSet=zr;exports.isString=Gr;exports.isSymbol=Qr;exports.onAfterRouteUpdate=vs;exports.onBeforeRouteUpdate=ms;exports.onFoxActivated=xn;exports.onFoxInactivated=Rn;exports.provideContextValue=pn;exports.sessionKey=oe;exports.toBoolean=Dt;exports.toNumber=tn;exports.toTypeString=nt;exports.typeOf=jt;exports.useBus=ds;exports.useEventProxy=ps;exports.useFox=ys;exports.useRoute=hs;exports.useRouter=Zt;
|
package/libs/index.esm.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ComponentInternalInstance } from 'vue';
|
|
|
3
3
|
import { ComponentPublicInstance } from 'vue';
|
|
4
4
|
import { InjectionKey } from 'vue';
|
|
5
5
|
import { Ref } from 'vue';
|
|
6
|
+
import { Require } from './require';
|
|
6
7
|
|
|
7
8
|
declare const _addRouteRecorder: unique symbol;
|
|
8
9
|
|
|
@@ -448,17 +449,20 @@ export declare interface Fox {
|
|
|
448
449
|
/**
|
|
449
450
|
* 全局Bus
|
|
450
451
|
*/
|
|
451
|
-
export declare const foxBusKey:
|
|
452
|
+
export declare const foxBusKey: FoxInjectionKey<Tree>;
|
|
452
453
|
|
|
453
454
|
/**
|
|
454
455
|
* 全局Event Proxy
|
|
455
456
|
*/
|
|
456
|
-
export declare const foxEventProxyKey:
|
|
457
|
+
export declare const foxEventProxyKey: FoxInjectionKey<EventProxy>;
|
|
458
|
+
|
|
459
|
+
declare interface FoxInjectionKey<T> extends InjectionKey<T> {
|
|
460
|
+
}
|
|
457
461
|
|
|
458
462
|
/**
|
|
459
463
|
* 全局Fox
|
|
460
464
|
*/
|
|
461
|
-
export declare const foxKey:
|
|
465
|
+
export declare const foxKey: FoxInjectionKey<Fox>;
|
|
462
466
|
|
|
463
467
|
/**
|
|
464
468
|
* 参数
|
|
@@ -466,7 +470,10 @@ export declare const foxKey: InjectionKey<Fox>;
|
|
|
466
470
|
export declare interface FoxOptions extends RouterOptions {
|
|
467
471
|
}
|
|
468
472
|
|
|
469
|
-
|
|
473
|
+
/**
|
|
474
|
+
* 通用函数接口
|
|
475
|
+
*/
|
|
476
|
+
export declare interface GenericFunction {
|
|
470
477
|
(...args: any[]): any;
|
|
471
478
|
}
|
|
472
479
|
|
|
@@ -550,6 +557,13 @@ export declare const isFunction: (val: unknown) => val is Function;
|
|
|
550
557
|
*/
|
|
551
558
|
export declare const isMap: (val: unknown) => val is Map<any, any>;
|
|
552
559
|
|
|
560
|
+
/**
|
|
561
|
+
* 是否为空对象
|
|
562
|
+
* @param val
|
|
563
|
+
* @returns
|
|
564
|
+
*/
|
|
565
|
+
export declare const isNil: (val: unknown) => val is null;
|
|
566
|
+
|
|
553
567
|
/**
|
|
554
568
|
* 是否为object
|
|
555
569
|
*/
|
|
@@ -812,154 +826,6 @@ declare const _removeRouteRecorder: unique symbol;
|
|
|
812
826
|
|
|
813
827
|
declare const _removeView: unique symbol;
|
|
814
828
|
|
|
815
|
-
/**
|
|
816
|
-
* AMD加载器
|
|
817
|
-
*/
|
|
818
|
-
declare class Require {
|
|
819
|
-
/**
|
|
820
|
-
* module manager
|
|
821
|
-
*/
|
|
822
|
-
private moduleManager;
|
|
823
|
-
/**
|
|
824
|
-
* 参数配置
|
|
825
|
-
*/
|
|
826
|
-
private options;
|
|
827
|
-
/**
|
|
828
|
-
* 设置路径映射
|
|
829
|
-
*/
|
|
830
|
-
set paths(paths: Record<string, string>);
|
|
831
|
-
/**
|
|
832
|
-
* 获取路径映射
|
|
833
|
-
*/
|
|
834
|
-
get paths(): Record<string, string>;
|
|
835
|
-
/**
|
|
836
|
-
* 设置路径别名
|
|
837
|
-
*/
|
|
838
|
-
set alias(alias: Record<string, string>);
|
|
839
|
-
/**
|
|
840
|
-
* 获取路径别名
|
|
841
|
-
*/
|
|
842
|
-
get alias(): Record<string, string>;
|
|
843
|
-
/**
|
|
844
|
-
* 设置不需要解析路径或判断函数
|
|
845
|
-
*/
|
|
846
|
-
set naturePaths(nature: string[] | {
|
|
847
|
-
(path: string): boolean;
|
|
848
|
-
});
|
|
849
|
-
/**
|
|
850
|
-
* 获取不需要解析路径或判断函数
|
|
851
|
-
*/
|
|
852
|
-
get naturePaths(): string[] | {
|
|
853
|
-
(path: string): boolean;
|
|
854
|
-
};
|
|
855
|
-
/**
|
|
856
|
-
* 设置超时时间
|
|
857
|
-
*/
|
|
858
|
-
set timeout(t: number);
|
|
859
|
-
/**
|
|
860
|
-
* 获取超时时间
|
|
861
|
-
*/
|
|
862
|
-
get timeout(): number;
|
|
863
|
-
/**
|
|
864
|
-
* 设置query
|
|
865
|
-
*/
|
|
866
|
-
private _query?;
|
|
867
|
-
set query(val: Record<string, string | number> | undefined);
|
|
868
|
-
get query(): Record<string, string | number> | undefined;
|
|
869
|
-
/**
|
|
870
|
-
* 获取document head
|
|
871
|
-
*/
|
|
872
|
-
get head(): any;
|
|
873
|
-
/**
|
|
874
|
-
* 构造函数
|
|
875
|
-
*/
|
|
876
|
-
constructor();
|
|
877
|
-
/**
|
|
878
|
-
* 安装module
|
|
879
|
-
*/
|
|
880
|
-
setModule(id: string, exports: Record<string, any> | {
|
|
881
|
-
(): Record<string, any>;
|
|
882
|
-
}): void;
|
|
883
|
-
/**
|
|
884
|
-
* 移除module
|
|
885
|
-
*/
|
|
886
|
-
removeModule(id: string): void;
|
|
887
|
-
/**
|
|
888
|
-
* 加载
|
|
889
|
-
* @params args
|
|
890
|
-
*/
|
|
891
|
-
ensure(...args: any[]): Require;
|
|
892
|
-
/**
|
|
893
|
-
* 卸载
|
|
894
|
-
*/
|
|
895
|
-
remove(...args: any): Require;
|
|
896
|
-
/**
|
|
897
|
-
* 加载
|
|
898
|
-
*
|
|
899
|
-
* @param chain
|
|
900
|
-
* @param taskNode
|
|
901
|
-
*/
|
|
902
|
-
private mount;
|
|
903
|
-
/**
|
|
904
|
-
* 加载css
|
|
905
|
-
* @param chain
|
|
906
|
-
* @param task
|
|
907
|
-
* @param point
|
|
908
|
-
*/
|
|
909
|
-
private mountCSS;
|
|
910
|
-
/**
|
|
911
|
-
* 加载js
|
|
912
|
-
*
|
|
913
|
-
* @param chain
|
|
914
|
-
* @param task
|
|
915
|
-
* @param point
|
|
916
|
-
*/
|
|
917
|
-
private mountJS;
|
|
918
|
-
/**
|
|
919
|
-
* 卸载资源
|
|
920
|
-
*/
|
|
921
|
-
private unmount;
|
|
922
|
-
/**
|
|
923
|
-
* 去掉空元素
|
|
924
|
-
*/
|
|
925
|
-
private trimEmptyElement;
|
|
926
|
-
/**
|
|
927
|
-
* 创建define函数
|
|
928
|
-
* @param module
|
|
929
|
-
* @param task
|
|
930
|
-
* @returns
|
|
931
|
-
*/
|
|
932
|
-
private createDefine;
|
|
933
|
-
/**
|
|
934
|
-
* 解析路径
|
|
935
|
-
* @param uri
|
|
936
|
-
* @returns
|
|
937
|
-
*/
|
|
938
|
-
private resolvePath;
|
|
939
|
-
/**
|
|
940
|
-
* 创建search字符串
|
|
941
|
-
*/
|
|
942
|
-
private createSearch;
|
|
943
|
-
/**
|
|
944
|
-
* 获取文件名后缀
|
|
945
|
-
* @param name
|
|
946
|
-
* @returns {string}
|
|
947
|
-
*/
|
|
948
|
-
private getFileNamePostfix;
|
|
949
|
-
/**
|
|
950
|
-
* 是否为不处理的路径
|
|
951
|
-
* @param uri
|
|
952
|
-
* @return
|
|
953
|
-
*/
|
|
954
|
-
private isNaturePath;
|
|
955
|
-
/**
|
|
956
|
-
* 解析路径
|
|
957
|
-
* @param uri
|
|
958
|
-
* @param replace
|
|
959
|
-
*/
|
|
960
|
-
private parserPath;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
829
|
declare const _resolveComponent: unique symbol;
|
|
964
830
|
|
|
965
831
|
declare const resolveRoute: unique symbol;
|
|
@@ -1766,6 +1632,7 @@ declare interface Storage_2 {
|
|
|
1766
1632
|
*/
|
|
1767
1633
|
removeItem(key: string): void;
|
|
1768
1634
|
}
|
|
1635
|
+
export { Storage_2 as Storage }
|
|
1769
1636
|
|
|
1770
1637
|
declare const successFnsKey: unique symbol;
|
|
1771
1638
|
|