@fox-js/fox 3.0.1-16 → 3.0.1-18
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 +16 -21
- package/libs/index.esm.js +925 -932
- package/libs/index.umd.js +3 -3
- package/package.json +1 -1
package/libs/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";/*!
|
|
2
|
-
* fox v3.0.0
|
|
3
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("vue"),Ir=Array.isArray,Nr=r=>et(r)==="[object Map]",Hr=r=>et(r)==="[object Set]",Dr=r=>r instanceof Date,P=r=>typeof r=="function",Vr=r=>typeof r=="string",Br=r=>typeof r=="symbol",vr=r=>r!==null&&typeof r=="object",Ur=r=>vr(r)&&P(r.then)&&P(r.catch),kr=Object.prototype.toString,et=r=>kr.call(r),At=r=>et(r)==="[object Object]",Wr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function It(r){return r.__esModule||Wr&&r[Symbol.toStringTag]==="Module"}const zr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function j(...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]=j(s,u,l)}else l!==void 0&&(e[o]=l)}}return e}function Ke(r,e,t=!1){if(!t)j(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let s in e){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!At(o))continue;i=Ke(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}const n=Object.getOwnPropertySymbols(e);for(let s of n){let i=r[s],o=e[s];if(i!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!At(o))continue;i=Ke(i,o,t),r[s]=i}else{if(typeof o=="function")continue;r[s]=o}}}return r}class se{static seed=new Date().getTime();static get(){let e=++se.seed;return e>=Number.MAX_VALUE&&(se.seed=0),e}}const it=zr?Promise.resolve():null;function _e(r,...e){it!==null?e&&e.length>0?it.then(()=>{r(e)}):it.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Nt(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":Boolean(r)}function Jr(r){return typeof r=="number"?r:Number(r)}const Gr={"[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 Et(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Gr[t]||"object"}function Ft(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Et(r),n=Et(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(!Ft(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(!Ft(i,o))return!1}return!0}return!1}const Qt=Symbol("idKey"),ae=Symbol("valueKey"),S=Symbol("childrenKey"),Q=Symbol("growKey");class gr{[Q]=!0;[Qt];[ae]=v.ref();[S]=new Map;constructor(e){this[Qt]=e}}class Qr{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[Q];let n=e[S].get(t);if(n)return $e(n);if(e[Q])return n=Dt(t),n[Q]=e[Q],e[S].set(t,n),$e(n)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[Q]=Nt(n),!0):n==null?(e[S].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[S].delete(t),!0)}}const Ht="__proxy__";function Dt(r){let e=new gr(r);return Reflect.set(e,Ht,new Proxy(e,new Qr)),e}function $e(r){return Reflect.get(r,Ht)}class wr extends gr{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[S].has(i)?o=n[S].get(i):(o=Dt(i),n[S].set(i,o)),n=o}return n[ae].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let s=0;s<t;s++){let i=e[s];if(n[S].has(i))n=n[S].get(i);else return}return n[ae].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let i=0;i<t-1;i++){let o=e[i];if(n[S].has(o))n=n[S].get(o);else return!1}let s=e[t-1];return n[S].has(s)?(n[S].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[S].has(o))n=n[S].get(o);else return!1}let s=e[t-1];return n[S].has(s)}clear(){this[S].clear()}}const Xr=["put","get","contains","remove","clear"];function Xt(r){return Xr.includes(r)}class Yr{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[Q];if(t===S)return e[S];if(typeof t=="string"&&Xt(t))return e[t];let n=String(t),s=e[S].get(n);if(s)return $e(s);if(e[Q])return s=Dt(n),s[Q]=e[Q],e[S].set(n,s),$e(s)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[Q]=Nt(n),!0):Xt(t)?!1:n==null?(e[S].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[S].delete(t),!0)}}function Zr(){let r=new wr,e=new Yr,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,Ht,t),r}let jt=new Proxy(wr,{construct(r,...e){let t=Zr();return $e(t)}});const Z="default",br=Symbol("sync"),H=Symbol("resolveRoute");function Yt(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function en(r){let e=r.src;return new Promise((t,n)=>{const s=Yt(a=>{It(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),i=Yt(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 tn{name;level;rootName;rootIndex=0;constructor(e,t,n,s){this.name=e,this.level=t,this.rootName=n,this.rootIndex=s}}class Ye{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ye(e.to,e.from),n=e.data??{};return j(!0,t.data,n),t}}class ${path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Z}!${e}`}name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new $;return Ke(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 rn{id;name;props;meta;src;component;constructor(e,t,n,s){this.id=se.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 en(this)}}class Zt{models=[]}class ot{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),N=Symbol("cursorKey"),lt=Symbol("$persistentModeKey"),F=Symbol("statusKey"),X=Symbol("argsKey"),Le=Symbol("exArgsKey"),fe=Symbol("successFnsKey"),xe=Symbol("errorFnsKey"),ne=Symbol("sessionKey"),Y=Symbol("_go");class qe{[V]=[];[N]=0;[lt]=!1;[F]="Free";[X]=[];[Le]=[];[fe]=[];[xe]=[];[ne];get session(){return this[ne]}constructor(e,t=!1){this[ne]=e,this[lt]=t}[Y](e,...t){let n=this[F];if(this[F]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[X]=t,n==="Exception"||n==="Reject"){let a=[{session:this[ne]},...this[Le]];for(;this[xe].length>0;)try{let l=this[xe].shift();typeof l=="function"&&_e(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[F]=n,this[V]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[V].length){let a=[{session:this[ne]},...this[X]];for(;this[fe].length>0;){let l=this[fe].shift();typeof l=="function"&&_e(()=>{Reflect.apply(l,{},a)})}return this[F]="Free",this}if(this[N]>=this[V].length)return this[F]="Free",this;let s=this[V][this[N]];this[lt]||(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[Y],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[Y],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[V].splice(i,0,l),i++)},session:this[ne]};_e(()=>{Reflect.apply(s,{},[a,...this[X]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[Y],this,[e,...t])}finish(...e){return this[F]="Finished",this[X]=e,Reflect.apply(this[Y],this,[0])}reject(...e){return this[F]="Reject",this[Le]=e,Reflect.apply(this[Y],this,[0])}throw(...e){return this[F]="Exception",this[Le]=e,Reflect.apply(this[Y],this,[0])}reset(...e){this[F]="Busy",this[X]=e,this[V]=[],this[N]=0;let n=[{session:this[ne]},...this[X]];for(;this[fe].length>0;){let s=this[fe].shift();_e(()=>{Reflect.apply(s,this,n)})}return this[F]="Free",this}post(e){return this[F]==="Reject"||this[F]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[F]==="Busy"?this:(Reflect.apply(this[Y],this,[0,...this[X]]),this))}wait(e,t){return e&&typeof e=="function"&&this[fe].push(e),t&&typeof t=="function"&&this[xe].push(t),this[F]==="Busy"?this:(Reflect.apply(this[Y],this,[0,...this[X]]),this)}exception(e){return e&&typeof e=="function"&&this[xe].push(e),this[F]==="Busy"?this:Reflect.apply(this[Y],this,[0,...this[X]])}isFinish(){return this[F]=="Reject"||this[F]=="Free"&&this[N]>=this[V].length}}const ce=Symbol("registerKey");class nn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Tt{[ce]=new Map;constructor(){}on(e,t,n=!1){let s=this[ce].get(e);s||(s=new Array,this[ce].set(e,s));let i=n===!0?1:0,o=new nn(t,i);return s.push(o),this}off(e,t){if(!t)return this[ce].delete(e),this;let n=this[ce].get(e);if(n){for(let s=0;s<n.length;s++)if(n[s].callback===t){n.splice(s,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let s=t-1,i=new Array(s),o=[].splice.call(e,0,s);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,s-=1,s==0&&Reflect.apply(n,{},i)});return this}emit(e,...t){let n=this[ce].get(e);if(!n)return this;for(let s=0;s<n.length;){let i=n[s];if(i.policy==1?n.splice(s,1):s++,typeof i.callback=="function")try{_e(()=>{Reflect.apply(i.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Re=Symbol("registerKey");class sn{[Re]=new Map;constructor(){}set(e,t){this[Re].set(e,t)}get(e){return this[Re].get(e)}has(e){return this[Re].has(e)}delete(e){return this[Re].delete(e)}}const _t=Symbol("lc");function Je(r,e=!1){let t=r,n=t[_t];if(!n)if(e)n=new sn,t[_t]=n;else return null;return n}function xr(r,e){let t=r;for(;t!==null;){const n=t[_t];if(n&&n.has(e))return n.get(e);t=t.$parent}return null}function er(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 Je(e.component.proxy,!1)}return null}const Ze=Symbol("hooksKey");function on(r){let e=r.get(Ze);e||(e=[],r.set(Ze,e))}function tr(r,e){let t=r.get(Ze);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 Kt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Kt||{});class ln{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function an(r,e,t,n){let s=new ln(e,t,n);return r.push(s),!0}function un(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 Rr(r){return(e,t)=>{let n;if(t)n=t;else{let i=v.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}n=i.proxy}let s=xr(n,Ze);if(s==null){console.warn("can not get hooks context");return}v.onUnmounted(()=>{un(s,r,e,n)}),an(s,r,e,n)}}let fn=Rr("a"),cn=Rr("da");function hn(){let r=new $;return r.path="",r.name="",r.params={},r.index=-1,v.shallowReactive(r)}const $t=Symbol("routeKey");function at(r,e){let t=r.get($t);if(t){let n={path:"",name:"",params:{},index:-1,session:{}};Object.assign(n,e),Object.assign(t,n)}else t=hn(),Object.assign(t,e),r.set($t,t)}function Sr(r){let e=xr(r,$t);return e??null}const tt=Symbol("rk"),ut=Symbol("vd"),rr=Symbol("rv"),ft=Symbol("rvi"),nr=Symbol("pv"),ct=Symbol("pvi");function dn(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 Pr(r,e){e===void 0&&(e={});for(var t=dn(r),n=e.prefixes,s=n===void 0?"./":n,i="[^".concat(me(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(R){if(l<t.length&&t[l].type===R)return t[l++].value},c=function(R){var q=f(R);if(q!==void 0)return q;var _=t[l],K=_.type,L=_.index;throw new TypeError("Unexpected ".concat(K," at ").concat(L,", expected ").concat(R))},h=function(){for(var R="",q;q=f("CHAR")||f("ESCAPED_CHAR");)R+=q;return R};l<t.length;){var d=f("CHAR"),y=f("NAME"),g=f("PATTERN");if(y||g){var p=d||"";s.indexOf(p)===-1&&(u+=p,p=""),u&&(o.push(u),u=""),o.push({name:y||a++,prefix:p,suffix:"",pattern:g||i,modifier:f("MODIFIER")||""});continue}var m=d||f("ESCAPED_CHAR");if(m){u+=m;continue}u&&(o.push(u),u="");var b=f("OPEN");if(b){var p=h(),T=f("NAME")||"",x=f("PATTERN")||"",C=h();c("CLOSE"),o.push({name:T||(x?a++:""),pattern:T&&!x?i:x,prefix:p,suffix:C,modifier:f("MODIFIER")||""});continue}c("END")}return o}function yn(r,e){return pn(Pr(r,e),e)}function pn(r,e){e===void 0&&(e={});var t=Vt(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 g=0;g<h.length;g++){var p=s(h[g],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 m=y?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(m))}}return u}}function mn(r,e){var t=[],n=Cr(r,t,e);return vn(n,t,e)}function vn(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 me(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Vt(r){return r&&r.sensitive?"":"i"}function gn(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 wn(r,e,t){var n=r.map(function(s){return Cr(s,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Vt(t))}function bn(r,e,t){return xn(Pr(r,t),e,t)}function xn(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(L){return L}:u,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,y=d===void 0?"":d,g="[".concat(me(y),"]|$"),p="[".concat(me(h),"]"),m=o?"^":"",b=0,T=r;b<T.length;b++){var x=T[b];if(typeof x=="string")m+=me(f(x));else{var C=me(f(x.prefix)),R=me(f(x.suffix));if(x.pattern)if(e&&e.push(x),C||R)if(x.modifier==="+"||x.modifier==="*"){var q=x.modifier==="*"?"?":"";m+="(?:".concat(C,"((?:").concat(x.pattern,")(?:").concat(R).concat(C,"(?:").concat(x.pattern,"))*)").concat(R,")").concat(q)}else m+="(?:".concat(C,"(").concat(x.pattern,")").concat(R,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?m+="((?:".concat(x.pattern,")").concat(x.modifier,")"):m+="(".concat(x.pattern,")").concat(x.modifier);else m+="(?:".concat(C).concat(R,")").concat(x.modifier)}}if(l)s||(m+="".concat(p,"?")),m+=t.endsWith?"(?=".concat(g,")"):"$";else{var _=r[r.length-1],K=typeof _=="string"?p.indexOf(_[_.length-1])>-1:_===void 0;s||(m+="(?:".concat(p,"(?=").concat(g,"))?")),K||(m+="(?=".concat(p,"|").concat(g,")"))}return new RegExp(m,Vt(t))}function Cr(r,e,t){return r instanceof RegExp?gn(r,e):Array.isArray(r)?wn(r,e,t):bn(r,e,t)}var E=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(E||{}),Ge=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Ge||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),le=Symbol("parentNodeKey"),Qe=Symbol("nameKey");class ee{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 Se{scope=null;set compensation(e){this.scope!==null&&this.scope.stop(),this.scope=v.effectScope(),this.scope.run(()=>{v.watch(this.slots,()=>{let t=!1;try{t=e()}catch(n){console.error(n)}t&&this.scope!==null&&(this.scope.stop(),this.scope=null)})})}_slots;get slots(){return this._slots==null&&(this._slots=v.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Qe];[G];[J]=null;[le]=null;get name(){return this[Qe]}constructor(e,t,n){this[Qe]=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 ht{views=[]}class Rn{layers=[]}class Sn{time;route}class Pn{forbidTime=300;submitRecorder=new Sn;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 ve=Symbol("_notifyChange");class sr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Oe=typeof window<"u",I=function(){return window},Me=function(){return window.document};function Cn(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 dt(){if(!Oe)return"/";let r=I().location,e=`${r.protocol}//${r.host}`;return e+=Cn(r.pathname),e}function qt(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Ot(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const Ie=Symbol("ignoreHistoryChangeOnceKey"),ir=Symbol("_navigateFirstRoute"),Ne=Symbol("_getRouteMark"),or=Symbol("_getUrlSearch"),yt=Symbol("_generateLocation"),Pe=Symbol("_setRouteMarkRecorder"),lr="Symbol(_fox_restore_point)";function pt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[Ie]=!1;constructor(e="hash",t="",n="",s=!0,i=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=s,this.historyMonitor=i,this.traceless=o,this.storage=a??I().sessionStorage}init(e=!0){const t=I();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[Ie]){this[Ie]=!1;return}if(pt(this.historyMonitor)){const n=t.history.state;this[ve](n);try{let s=[];if(typeof n=="string"?s=JSON.parse(n):s=n,Array.isArray(s)&&s.length>0){const i=this[Ne]()??"/";this[Pe](i,s)}}catch{}}}),qt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ir](),Promise.resolve()}destroy(){if(this.historyChange){const e=I();Ot(e,"popstate",this.historyChange)}}[ir](){const e=this[Ne]()??"/",t=this.storage.getItem(lr);if(t)try{const o=JSON.parse(t);if(o.mark===e){this[ve](o.routes);return}}catch{}const n=e.indexOf("!");let s;n!=-1?s=e.substring(n+1):s=e;const i=new $;i.path=s,i.query=this[or](),this[ve]([i])}[Pe](e,t){try{const n={mark:e,routes:t},s=JSON.stringify(n);this.storage.setItem(lr,s)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Ne]()??"/";this[Pe](t,e)}[ve](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ne](){const e=I();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}[or](){return I().location.search}listen(e){this.changeHandler=e}go(e,t=!0){const n=I();this[Ie]=!t,n.history.go(e)}push(e){let t=this[yt](e.currentRoute);pt(this.traceless,e.currentRoute)||I().history.pushState(e.routes,"",t),this[Pe](e.currentRoute.fullPath,e.routes)}replace(e){let t=this[yt](e.currentRoute);pt(this.traceless,e.currentRoute)||I().history.replaceState(e.routes,"",t),this[Pe](e.currentRoute.fullPath,e.routes)}[yt](e){const t=I();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l in e.query){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(l)}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(n=`${this.query}&${a}`,n.charAt(0)!=="?"&&(n=`?${n}`)):n=`?${a}`}const s=t.location;let i=e.fullPath;i.startsWith(Z)&&(i=i.substring(Z.length+1));let o;return n?this.mode=="path"?o=`${this.base}/${i}${n}`:o=`${s.pathname}${n}#${i}`:this.mode=="path"?o=`${this.base}/${i}`:o=`${s.pathname}#${i}`,`${s.origin}${o}`}}function An(r=!0,e=null,t="",n=!0,s=!1,i){return e!==null&&(e=I().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,r,n,s,i)}function Er(r=!0,e="",t=!0,n=!1,s){return new Ar("hash","",e,r,t,n,s)}class En{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}listen(e){this.changeHandler=e}[ve](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[ve](s.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Fr(r="",e=50){return new En(r,e)}const He=Symbol("_constructRouteModel"),De=Symbol("_findRouteModel"),mt=Symbol("_findRootView"),ar=Symbol("_getFirstView"),ie=Symbol("_removeView"),ur=Symbol("_buildPage"),fr=Symbol("_resolveComponent"),cr=Symbol("_update"),te=Symbol("_merge"),vt=Symbol("_handleHistoryChange"),Ve=Symbol("_handleRouteUpdated"),Be=Symbol("routeUpdatedCallback"),w=Symbol("currentRoutes"),he=Symbol("current"),hr=Symbol("_addRouteRecorder"),de=Symbol("_removeRouteRecorder"),Ue=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),ke=Symbol("errorCallback"),U=Symbol("registerKey"),We=Symbol("notFoundKey"),gt=Symbol("notFoundPathKey"),k=Symbol("forestKey"),A=Symbol("historyKey"),Ce=Symbol("beforeFiltersKey"),Ae=Symbol("afterFiltersKey"),Ee=Symbol("destroyFiltersKey"),Fe=Symbol("beforeRestoreFiltersKey"),ye=Symbol("mainDispatcherKey"),wt=Symbol("initKey"),oe=Symbol("readyKey"),bt=Symbol("readyHandlersKey"),ze=Symbol("_markReady"),dr=Symbol("_createNextFn"),xt=Symbol("_start"),Rt=Symbol("_before"),St=Symbol("_after"),yr=Symbol("_destroy"),pr=Symbol("_beforeRestore"),Pt=Symbol("_load"),je=Symbol("_unload"),Te=Symbol("routerGuardKey");function Fn(r){return r.layers.length==0||r.layers[0].views.length==0}function jn(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let s=j(!0,{},n.meta);e.push(s)}else n.meta&&e.push(n.meta)})}),e}class Tn{[U]=new Array;[We];[gt]="*";[oe]=!1;[bt]=[];[k]=new Rn;[A];[w]=new Array;[ke]=null;[Be]=null;[Ce]=new Array;[Ae]=new Array;[Ee]=new Array;[Fe]=new Array;[ye]=new qe;[Te]=new Pn;[wt]=!1;[he]=v.ref(null);get current(){return this[he].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[A]=e.history:this[A]=Oe?Er():Fr(),this[A]?.listen(async n=>{let s=!0;try{if(typeof n=="string"){const i=this[H](n);i&&await this[vt]([i])}else await this[vt](n)}catch(i){console.error(i.message,i),s=!1}this[oe]===!1&&this[ze](s)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[ke]=="function")try{this[ke](e,t)}catch{}console.error(e)}init(){this[wt]!==!0&&(this[A]?.init(!this[oe]),this[wt]=!0)}isReady(){return this[oe]?Promise.resolve():new Promise((e,t)=>{this[bt].push([e,t])})}[ze](e){this[oe]=!0,this[bt].forEach(([t,n])=>{try{e?t():n()}catch(s){console.error(s.message,s)}})}[vt](e){try{if(!e){let o=[...this[w]].reverse();return this[je](o),Oe&&I().location.reload(),Promise.resolve()}let t=null,n=[],s=[],i=0;for(;i<e.length&&i<this[w].length&&$.isSame(e[i],this[w][i]);i++)e[i].opsType===E.Open&&e[i].active===!0&&e[i].active!==this[w][i].active&&(t=e[i]);if(i<e.length&&(n=e.slice(i)),i<this[w].length&&(s=this[w].slice(i).reverse()),s.length==0&&n.length==0){if(t!==null)return this.restore([t])}else if(s.length>0){if(this[je](s)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[O](t)}return Promise.resolve()}[Ve](e){if(e)this[he].value=e;else{let t=this[w].length;t>0?this[he].value=this[w][t-1]:this[he].value=null}if(typeof this[Be]=="function")try{this[Be](this[he].value)}catch{}}[hr](e,t=-1){t<0||t>=this[w].length?this[w].push(e):this[w].splice(t,0,e)}[Ue](){let e=[];for(let t of this[w]){let n=$.clone(t,!0);e.push(n)}return e}[de](e){if(!this[w])return;let t=-1;for(let n=0;n<this[w].length;n++)if($.isSame(this[w][n],e)){t=n;break}if(t!=-1){let n=this[w][t];this[w].splice(t,1),this[yr](n,n.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}setRestorePoint(){const e=this[Ue]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[Be]=e}onError(e){this[ke]=e}beforeEach(e){this[Ce].push(e)}removeBeforeEach(e){const t=this[Ce].indexOf(e);return t!==-1?(this[Ce].splice(t,1),!0):!1}afterEach(e){this[Ae].push(e)}removeAfterEach(e){const t=this[Ae].indexOf(e);return t!==-1?(this[Ae].splice(t,1),!0):!1}destroyEach(e){this[Ee].push(e)}removeDestroyEach(e){const t=this[Ee].indexOf(e);return t!==-1?(this[Ee].splice(t,1),!0):!1}beforeRestoreEach(e){this[Fe].push(e)}removeBeforeRestoreEach(e){const t=this[Fe].indexOf(e);return t!==-1?(this[Fe].splice(t,1),!0):!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[gt]){this.setNotFoundRoute(e);return}const n=this[He](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[gt]=e}setNotFoundRoute(e){const t=this[He](e);this[We]=t[0]}getRoutes(){return[...this[U]]}[He](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){let a=new ot;return a.path=t,a.redirect=e.redirect,[a]}let s=[];for(let a in n){let l=n[a];a.length===0&&(a=Z);let u=new rn(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[He](a);for(let u of l){let f=new ot;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 Zt;c.models=[...s],f.layers=[c,...u.layers],o.push(f)}}if(!i){let a=new Zt;a.models=s;let l=new ot;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[De](e){const t=e.route;try{for(let n of this[U])if(t.path&&n.path){let s=n.match;s||(s=n.match=mn(n.path));let i=s(t.path);if(!i)continue;if(n.redirect){let o=new $;j(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[De](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},j(!0,t.params,i.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let u of l){let f=u.split("=");if(f.length!==2)continue;let c=decodeURIComponent(f[0].trim()),h=decodeURIComponent(f[1].trim());a[c]=h}j(!0,t.params,a)}else typeof o=="object"&&j(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let s=yn(n.path);return t.path=s(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[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&&j(!1,t,e[n]);else typeof e=="object"?t=$.from(e):typeof e=="string"&&(t=new $,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Z,t.opsType=t.opsType??this.options.defaultOperationType??E.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||E.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=E.Put,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=E.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=E.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ye].post(n=>{try{if(this[w].length===0){n.resolve(),t(!1);return}let s=-1,i,o=[];if(e){if(e.root?i=e.root:i=this[w][0].root??Z,e.all)for(let l=this[w].length-1;l>0;l--){let u=this[w][l];u.opsType===E.Append&&u.root===i&&(o.splice(0,0,u),s=l-1)}else if(e.until)for(let l=this[w].length-1;l>0;l--){let u=this[w][l];if(u.opsType===E.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=Z;let l=this[ar](this[k]);l&&(i=l.name);for(let u=this[w].length-1;u>0;u--){let f=this[w][u];if(f.opsType===E.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[w].forEach(l=>{l.opsType!==E.Put&&a++}),this[je](o)){let l=0;this[w].forEach(f=>{f.opsType!==E.Put&&l++});const u=l-a;this[A]?.go(u,!1),n.resolve(),t(!0)}}catch(s){this[O](s),n.resolve(),t(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=E.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ye].post(t=>{try{let n=this[H](e);if(!n){t.reject("resolve route fail");return}let s=[];for(let i=0;i<this[w].length;i++){let o=this[w][i];if(o.root===n.root){if(!n.path&&!n.name){s.push(o);continue}if(n.path&&n.path===o.path){s.push(o);break}else if(n.name&&n.name===o.name){s.push(o);break}}}if(s.length===0){t.resolve();return}this[je](s)&&this[Ve](),t.resolve()}catch(n){this[O](n),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[O]("resolve route fail",t),this;console.debug("route to",t.path,t.root);let n=this[Te].acquire(t);return n==null?(this[O]("route forbid",t),this):(this[ye].post(s=>{try{let i=this[xt](t);this[Rt](i),this[Pt](i),this[St](i),i.wait((o,a)=>{const l=o.session.to;try{let u=$.clone(l,!0);const f=new sr(u,this[Ue]());l.opsType===E.Replace?this[A]?.replace(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Te].release(n),this[Ve](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[oe]===!1&&this[ze](!0),s.resolve()},(o,a)=>{this[Te].release(n),a!==null&&this[O](a,t),this[oe]===!1&&this[ze](!1),s.resolve()})}catch(i){this[Te].release(n),this[O](i,t),s.resolve()}}),this)}back(e=1){this[A]?.go(-e)}[dr](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()}}[pr](e){for(let t of this[Fe])try{const n=Reflect.apply(t,{},[e]);if(n===!1)return n}catch(n){console.error(n.message,n)}return!0}[xt](e){let t=this[w].length>0?this[w][0]:void 0,n=new Ye(e,t),s={route:e,find:null};return this[De](s),s.find&&(n.routeModel=s.find,e.matched=jn(s.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=s.find.layers[0].models[0].meta)),new qe(n)}[Rt](e){for(let t of this[Ce])e.post(n=>{let s=this[dr](n);Reflect.apply(t,{},[n.session.to,n.session.from,s,n.session])})}[St](e){e.post(t=>{for(let n of this[Ae])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(s){console.error(s.message,s)}t.resolve()})}[yr](e,t){for(let n of this[Ee])try{Reflect.apply(n,{},[e,t])}catch(s){console.error(s.message,s)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Pt](e){e.post(t=>{let n=t.session.to,s=t.session.routeModel;if(s==null){let o={route:n,find:null};if(this[De](o))s=o.find,t.session.routeModel=s;else if(this[We])s=this[We];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let i=Ye.from(t.session);this[ur](n,s,i).then(o=>{this[k],t.resolve()},o=>{t.reject(o)})})}[je](e){if(e.length==0)return!0;let t=this[k],n=[];for(let s of e){let i=this[mt](t,s);i!=null&&n.push({...i,route:s})}if(n.length==0){let s="can not find view index";return this[O](s),!1}for(let s of n.reverse())this[ie](t,{x:s.x,y:s.y},[s.route.index??0],!0);return!0}[mt](e,t){const n=t.root??Z;let s;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Qe]===n)return s={x:a,y:i},s}}return null}[ar](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ie](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[de](h.route),h.active===!0&&h.route.opsType==E.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[le]&&(o||B.include(a,y[le]))){let g=y.slots.value;for(let p=g.length-1;p>=0;p--){let m=g[p];m.route&&y[G]&&this[de](m.route),h.push(new B(y,m.index,f)),g.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[w]=[],this[Ve](),Promise.resolve()}else return new Promise((n,s)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){let l=e[a];this[pr](l)&&this[ye].post(u=>{let f=this[xt](l);this[Rt](f),this[Pt](f),this[St](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[O](h),u.resolve()})})}this[ye].post(a=>{if(i&&o===!0){const l=$.clone(i,!0),u=new sr(l,this[Ue]());this[A]?.replace(u)}a.resolve(),n()})})}[ur](e,t,n){let s=e.updateType??Ge.Part;return this[fr](t).then(()=>{this[cr](t,e,n,s)})}[fr](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()}[cr](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=Fn(o),l=t.root??Z,u;!a&&s==Ge.Part&&(u=this[mt](o,t));let f,c=0;if(u==null||u==null)if(a||s===Ge.All){if(o.layers.length==0&&(o.layers[0]=new ht),o.layers[0].views.length==0){let h=t.root??Z;f=new Se(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 g=o.layers[d-1];for(let p of g.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 Se(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===E.Append){t.index=se.get();let h=f.slots.value;if(h.length>0){let m=h[h.length-1];m.active=!1,m.route&&(m.route.active=m.active)}let d=new ee(t,i,t.index,!0);f.slots.value=[...h,d];let y=c+1,g=1,p=new B(f,t.index,c);this[te](o,y,e,g,p)}else if(t.opsType===E.Open){let h=f.slots.value,d=!1;for(let y of h){if(y.route!==null&&$.isSameForRouteModel(y.route,t)){if(y.active==!0)return t.index=y.index,t.active=y.active,y.route=t,Promise.resolve();y.active=!0,d=!0,t.index=y.index,t.active=y.active,y.route=t,this[de](y.route)}else y.active=!1;y.route&&(y.route.active=y.active)}if(!d){t.index=se.get(),t.active=!0;let y=new ee(t,i,t.index,!0);h.push(y);let g=c+1,p=1,m=new B(f,t.index,c);this[te](o,g,e,p,m)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=se.get(),f.slots.value=[new ee(t,i,t.index)];let d=c+1,y=1,g=new B(f,t.index,c);this[te](o,d,e,y,g)}else{let d=h[0];if(d.model!==i){this[ie](o,u,null,!0),t.index=se.get(),f.slots.value=[new ee(t,i,t.index)];let y=c+1,g=1,p=new B(f,t.index,c);this[te](o,y,e,g,p)}else{d.route!==null&&this[de](d.route);let y=[];for(let T=1;T<h.length;T++)y.push(h[T].index);y.length>0&&this[ie](o,u,y,!0),t.index=d.index,d.route=t;let g=[new B(f,t.index,c)],p=c+1,m=1,b=new B(f,t.index,c);for(;g.length>0&&p<o.layers.length&&m<e.layers.length;p++,m++){let T=[];for(let C=0;C<o.layers[p].views.length;C++){let R=o.layers[p].views[C];R[le]&&B.include(g,R[le])&&T.unshift(C)}let x=[];for(let C of T){let R=o.layers[p].views[C],q=e.layers[m].models,_;for(let K=0;K<q.length;K++)if(R.name===q[K].name){_=q[K];break}if(!_)this[ie](o,{x:C,y:p},null,!1);else{let K=R.slots.value;if(K.length==0){let L=0;R.slots.value=[new ee(null,_,L)];let W=p+1,z=m+1;this[te](o,W,e,z,b)}else{let L=K[0];if(L.model!==_){this[ie](o,{x:C,y:p},null,!0),R.slots.value=[new ee(null,_,0)];let W=p+1,z=m+1;this[te](o,W,e,z,b)}else{R[G]&&L.route!==null&&this[de](L.route);let W=[];for(let z=1;z<K.length;z++)W.push(K[z].index);W.length>0&&this[ie](o,{x:C,y:p},W,!0),x.push(new B(R,L.index,p))}}R[G]=!1}}g=x}this[te](o,p,e,m,b)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new tn(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[hr](t)}[te](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 Se(u.name,!1,i),c=new ee(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new ht;l.views=[];for(let u of n.layers[o].models){let f=new Se(u.name,!1,i),c=new ee(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[br](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[le]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[G]?a={view:i,index:o,level:t-1}:a=i[J],l={view:i,index:o,level:t-1});let u=new Se(e,!0,a);if(u[le]=l,t==this[k].layers.length){let f=new ht;f.views=[u],this[k].layers.push(f)}else this[k].layers[t].views.push(u);return u}}const _n="fox-router-view",Kn="fox-router-link";function jr(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 Tr(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 $n(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 qn(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 On(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 Ln(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 Mn(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function In(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Nn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function Hn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Dn(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function Vn(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function Bn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Bt(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 ge(r,e){r.classList.contains(e)||r.classList.add(e)}function we(r,e){r.classList.remove(e)}const Un=Oe&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Ut(r){Un(r)}function D(r,e,t){P(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function _r(r,e,t,n=-1,s,i,o,a){if(P(i)){if(s!==void 0&&s>=0){setTimeout(()=>{Reflect.apply(i,r,[e,t,n]),P(a)&&Reflect.apply(a,r,[])},s);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Ot(e,c,u)}),Reflect.apply(i,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{qt(e,f,u)})}if(P(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Ot(e,l,u)};qt(e,l,u)}}function kt(r){return!Oe||r===null?!1:r.opsType===E.Append||r.opsType===E.Open}function Kr(r,e,t,n={},s,i=-1){if(e||kt(s)){const o=jr(n,e);o&&ge(t,o);const a=Tr(n,e);a&&ge(t,a);const l=Mn(n,e);D(r,l,[t,e,s,i])}}function $r(r,e,t,n={},s,i,o,a){if(!kt(i)&&!e){P(a)&&a(r,a,[t]);return}const l=jr(n,e),u=Tr(n,e),f=$n(n,e),c=In(n,e),h=Nn(n,e),d=Hn(n,e);Ut(()=>{_r(r,t,i,o,s,()=>{u&&we(t,u),f&&we(t,f),P(h)&&D(r,h,[t,e,i,o]),P(a)&&a(r,a,[t])},()=>{P(d)&&D(r,d,[t,e,i,o])}),l&&we(t,l),f&&ge(t,f),P(c)&&D(r,c,[t,e,i,o])})}function qr(r,e,t,n={},s,i,o,a,l){if(!kt(o)&&!e){!e&&P(i)&&i();return}const u=qn(n,e),f=On(n,e),c=Ln(n,e),h=Dn(n,e),d=Vn(n,e),y=Bn(n,e);u&&ge(t,u),f&&ge(t,f),P(h)&&D(r,h,[t,e,o,a]),Ut(()=>{_r(r,t,o,a,s,()=>{f&&we(t,f),c&&we(t,c),P(d)&&D(r,d,[t,e,o,a]),P(l)&&D(r,l,[t]),!e&&P(i)&&i()},()=>{P(y)&&D(r,y,[t,e,o,a]),P(l)&&D(r,l,[t]),!e&&P(i)&&i()}),u&&we(t,u),c&&ge(t,c)})}function Lt(r,e={},t,n=-1){const s=e.mode??"default",i=Bt(e);return{mode:s,persisted:!1,beforeEnter:a=>{Kr(r,!1,a,e,t,n)},enter:a=>{$r(r,!1,a,e,i.enter,t,n)},leave:(a,l)=>{qr(r,!1,a,e,i.leave,l,t,n)},clone:a=>Lt(r,e,t,n)}}function Or(r){return r.el}function kn(r,e,t={},n,s,i,o){if(i){const a=Or(e);if(a==null)return;const l=Bt(t);Kr(r,!0,a,t,n,s),$r(r,!0,a,t,l.show,n,s,u=>{P(o)&&D(r,o,[u])})}else P(o)&&D(r,o,[])}function Wn(r,e,t={},n,s,i,o){if(i){const a=Or(e);if(a==null)return;const l=Bt(t);qr(r,!0,a,t,l.hide,null,n,s,u=>{P(o)&&D(r,o,[u])})}else P(o)&&D(r,o,[])}function zn(r,e={}){Ut(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function re(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Ct(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class Jn{node;state;constructor(e,t){this.node=e,this.state=t}}const Mt=v.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=v.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,s=v.inject(tt,null),i=v.inject(ut,0),o=v.inject(rr,null),a=v.inject(ft,-1);let l=null;const u=r.modelSlot;if(u){v.provide(ut,i+1),v.provide(ft,u.index),v.provide(ct,u.index);const c=u.route;if(!c){console.warn("child view render error, route not exist");return}const h=Je(t.proxy,!0);on(h),at(h,c)}else{if(s==null){console.error("router is not been injected");return}const c=r.name,h=v.inject(nr,null),d=v.inject(ct,0);if(l=s[br](c,i,o,a,h,d),l===null)return;if(v.provide(nr,l),l[G]===!0&&v.provide(rr,l),!n){v.provide(ft,-1),v.provide(ut,i+1),v.provide(ct,-1);const g=l.slots.value;if(g.length>0){const p=g[0].route;if(p){const m=Je(t.proxy,!0);at(m,p)}}else{const p=Je(t.proxy,!0);l.compensation=()=>{const m=l.slots.value;if(m.length>0){const b=m[0].route;return b&&at(p,b),!0}return!1}}}}const f={value:new Map};return v.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,y=[];for(let m=0;m<d.length;m++){const b=d[m],T=`${r.name}-${b.index}`,x=re(r.transition,b.route,m)??!0,C={modelSlot:b};let R;e.slots.default?R=v.h(Mt,C,{default:e.slots.default}):R=v.h(Mt,C);const q={},_=re(r.viewClass,b.route,m);typeof _=="string"&&_.length>0&&(q[_]=!0);const K=re(r.viewActiveClass,b.route,m),L=re(r.viewInactiveClass,b.route,m),W=f.value.get(T);if(typeof K=="string"&&K.length>0&&(q[K]=b.active),typeof L=="string"&&L.length>0&&(q[L]=!b.active),W&&b.active!==W.state){const ue=W.node;b.active?y.unshift(()=>{const st=()=>{let be=er(ue);be!=null&&tr(be,Kt.ACTIVATED)};kn(t,ue,r,b.route,m,x,st)}):y.push(()=>{const st=()=>{const be=er(ue);be!=null&&tr(be,Kt.DEACTIVATED)};Wn(t,ue,r,b.route,m,x,st)})}const z={class:q,key:T},rt=re(r.viewTagProps,b.route,m);rt!==null&&typeof rt=="object"&&j(!0,z,rt),b.route?.viewTagAttrs&&typeof b.route?.viewTagAttrs=="object"&&j(!0,z,b.route.viewTagAttrs);const Mr=re(r.viewTag,b.route,m),nt=v.h(Mr,z,{default:()=>[R]});if(c.set(T,new Jn(nt,b.active)),f.value.delete(T),x){const ue=Lt(t,r,b.route,m);nt.transition=ue}h.push(nt)}f.value.forEach(m=>{m.node.transition=null}),f.value=c,zn(y,t);const g=re(r.tag,null,-1),p={};return Object.assign(p,e.attrs),v.h(g,p,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?j(!1,h,c.props):c.props===!0&&typeof u.route?.params=="object"&&j(!1,h,u.route?.params));const d=v.h(c.component,h);return Ct(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.model,y={};d.props&&(typeof d.props=="object"?j(!1,y,d.props):d.props===!0&&typeof h.route?.params=="object"&&j(!1,y,h.route?.params));const g=v.h(d.component,y);if(re(r.transition,h.route,-1)??!0){const m=Lt(t,r,h.route,-1);g.transition=m}return Ct(e.slots.default,{Component:g,route:h.route})??g}else return Ct(e.slots.fallback,{})}}}});function Gn(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 Qn(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function Xn(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function pe(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let Yn=v.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=v.inject(tt,null);return()=>{let n=pe(r.to,null),s=pe(r.tag,n);if(s==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[H](n),r.root&&(i.root=r.root),o=t.current);let a={},l=pe(r.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=Xn(i,o)),pe(r.exact,i)===!0){let h=pe(r.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=Qn(i,o))}let f={class:a};(s==="a"||s==="A")&&(f.href=i?.path??i?.name??"#"),j(!0,f,e.attrs);let c=pe(r.event,i);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}Gn(d)&&t.to(i)};f[c]=h}return v.h(s,f,e.slots)}}});var M=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(M||{}),Xe=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(Xe||{});class Zn{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 mr{moduleManager=new Zn;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 Me().head}constructor(){}setModule(e,t){const n={id:e,src:"",status:M.Defined};typeof t=="function"?(n.exports=t,n.type=Xe.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 es(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 qe;for(let l=0;l<t.length;l++){const u=new ts(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==M.Defined||o.status==M.Loaded)&&o.exports){o.type===Xe.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=Me(),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(()=>{Lr(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==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===Xe.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),s.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),s.resolve();return}}o={id:i,src:i,status:M.Loading},this.moduleManager.set(i,o);const l=Me().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve()},l.onerror=()=>{try{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==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,i)),s.resolve())}}l.defer=!0,l.src=i;const f=I();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Me(),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=M.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=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=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.Defined,t.progress.work(!0,t.index,e.exports))};return s.amd=!0,s}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let 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`${dt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${dt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${I().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`${dt()}${e}`}}function Lr(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():Lr(r,e)},20)}class es{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 ts{index;src;params;progress;constructor(e,t,n,s){this.index=e,this.src=t,this.params=n,this.progress=s}}const Wt=Symbol("fk"),zt=Symbol("fbk"),Jt=Symbol("fepk");function rs(r={}){const e=new Tn(r),t=new jt,n=new Tt,s=new mr,i={get router(){return e},get bus(){return t},get Bus(){return jt},get EventProxy(){return Tt},get eventproxy(){return n},get EventChain(){return qe},get Require(){return mr},get require(){return s},get extend(){return j},get clone(){return Ke},get isESModule(){return It},install(o){o.provide(tt,e),o.provide(Wt,i),o.provide(zt,t),o.provide(Jt,n),o.component(_n,Mt),o.component(Kn,Yn),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 Sr(this)}}}),e.init()}};return i}function Gt(r){return r?r.$router:v.inject(tt)}function ns(r){return r||(r=v.getCurrentInstance()?.proxy??void 0),r?Sr(r):null}function ss(r){return r?r.$fox:v.inject(Wt)}function is(r){return r?r.$bus:v.inject(zt)}function os(r){return r?r.$eventProxy:v.inject(Jt)}function ls(r){const e=Gt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.beforeEach(t),v.onUnmounted(()=>{e.removeBeforeEach(t)})}function as(r){const e=Gt(),t=(n,s,i)=>{try{Reflect.apply(r,{},[n,s])}catch(o){console.error(o)}i()};e.afterEach(t),v.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=jt;exports.EventChain=qe;exports.EventProxy=Tt;exports.Route=$;exports.clone=Ke;exports.createFox=rs;exports.createMemoryHistory=Fr;exports.createWebHashHistory=Er;exports.createWebHistory=An;exports.extend=j;exports.foxBusKey=zt;exports.foxEventProxyKey=Jt;exports.foxKey=Wt;exports.isArray=Ir;exports.isDate=Dr;exports.isESModule=It;exports.isEqual=Ft;exports.isFunction=P;exports.isMap=Nr;exports.isObject=vr;exports.isPlainObject=At;exports.isPromise=Ur;exports.isSet=Hr;exports.isString=Vr;exports.isSymbol=Br;exports.onAfterRouteUpdate=as;exports.onBeforeRouteUpdate=ls;exports.onFoxActivated=fn;exports.onFoxInactivated=cn;exports.sessionKey=ne;exports.toBoolean=Nt;exports.toNumber=Jr;exports.toTypeString=et;exports.typeOf=Et;exports.useBus=is;exports.useEventProxy=os;exports.useFox=ss;exports.useRoute=ns;exports.useRouter=Gt;
|
|
2
|
+
* fox v3.0.0 Sun Mar 12 2023 19:51:27 GMT+0800 (China Standard Time)
|
|
3
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Nr=Array.isArray,Ir=r=>tt(r)==="[object Map]",Hr=r=>tt(r)==="[object Set]",Dr=r=>r instanceof Date,S=r=>typeof r=="function",Br=r=>typeof r=="string",Vr=r=>typeof r=="symbol",wr=r=>r!==null&&typeof r=="object",Ur=r=>wr(r)&&S(r.then)&&S(r.catch),kr=Object.prototype.toString,tt=r=>kr.call(r),Ct=r=>tt(r)==="[object Object]",Wr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Nt(r){return r.__esModule||Wr&&r[Symbol.toStringTag]==="Module"}const zr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function j(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,i=!1;for(typeof e=="boolean"&&(i=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let s=r[t];for(let o in s){let a=e[o],l=s[o];if(a!==l)if(i===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=j(i,u,l)}else l!==void 0&&(e[o]=l)}}return e}function qe(r,e,t=!1){if(!t)j(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let i in e){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ct(o))continue;s=qe(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}const n=Object.getOwnPropertySymbols(e);for(let i of n){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ct(o))continue;s=qe(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}}return r}class oe{static seed=new Date().getTime();static get(){let e=++oe.seed;return e>=Number.MAX_VALUE&&(oe.seed=0),e}}const st=zr?Promise.resolve():null;function $e(r,...e){st!==null?e&&e.length>0?st.then(()=>{r(e)}):st.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function It(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":Boolean(r)}function Jr(r){return typeof r=="number"?r:Number(r)}const Gr={"[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 Et(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Gr[t]||"object"}function At(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=Et(r),n=Et(e);if(t!==n)return!1;if(t==="object"){let i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++){let a=i[o],l=r[a],u=e[a];if(!At(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++){let s=r[i],o=e[i];if(!At(s,o))return!1}return!0}return!1}const Xt=Symbol("idKey"),fe=Symbol("valueKey"),R=Symbol("childrenKey"),Q=Symbol("growKey");class br{[Q]=!0;[Xt];[fe]=w.ref();[R]=new Map;constructor(e){this[Xt]=e}}class Qr{get(e,t){if(t=="value")return e[fe].value;if(t==="grow")return e[Q];let n=e[R].get(t);if(n)return Oe(n);if(e[Q])return n=Dt(t),n[Q]=e[Q],e[R].set(t,n),Oe(n)}set(e,t,n){return t=="value"?(e[fe].value=n,!0):t==="grow"?(e[Q]=It(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 Ht="__proxy__";function Dt(r){let e=new br(r);return Reflect.set(e,Ht,new Proxy(e,new Qr)),e}function Oe(r){return Reflect.get(r,Ht)}class xr extends br{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let n=this;for(let i=0;i<t-1;i++){let s=e[i],o;n[R].has(s)?o=n[R].get(s):(o=Dt(s),n[R].set(s,o)),n=o}return n[fe].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let i=0;i<t;i++){let s=e[i];if(n[R].has(s))n=n[R].get(s);else return}return n[fe].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[R].has(o))n=n[R].get(o);else return!1}let i=e[t-1];return n[R].has(i)?(n[R].delete(i),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[R].has(o))n=n[R].get(o);else return!1}let i=e[t-1];return n[R].has(i)}clear(){this[R].clear()}}const Xr=["put","get","contains","remove","clear"];function Yt(r){return Xr.includes(r)}class Yr{get(e,t){if(t=="value")return e[fe].value;if(t==="grow")return e[Q];if(t===R)return e[R];if(typeof t=="string"&&Yt(t))return e[t];let n=String(t),i=e[R].get(n);if(i)return Oe(i);if(e[Q])return i=Dt(n),i[Q]=e[Q],e[R].set(n,i),Oe(i)}set(e,t,n){return t=="value"?(e[fe].value=n,!0):t==="grow"?(e[Q]=It(n),!0):Yt(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 Zr(){let r=new xr,e=new Yr,t=new Proxy(r,e);return Object.assign({put(...i){return Reflect.apply(r.put,r,i)},get(...i){return Reflect.apply(r.get,r,i)},remove(...i){return Reflect.apply(r.remove,r,i)},contains(...i){return Reflect.apply(r.contains,r,i)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,Ht,t),r}let Ft=new Proxy(xr,{construct(r,...e){let t=Zr();return Oe(t)}});const ee="default",Rr=Symbol("sync"),H=Symbol("resolveRoute");function Zt(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function en(r){let e=r.src;return new Promise((t,n)=>{const i=Zt(a=>{Nt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),s=Zt(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(i,s)}catch(a){s(a)}if(o)if(typeof o.then=="function")o.then(i,s);else{const a=o.component;a&&typeof a.then=="function"&&a.then(i,s)}})}class tn{name;level;rootName;rootIndex=0;constructor(e,t,n,i){this.name=e,this.level=t,this.rootName=n,this.rootIndex=i}}class Ze{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new Ze(e.to,e.from),n=e.data??{};return j(!0,t.data,n),t}}class ${path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??ee}!${e}`}alias;name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new $;return qe(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 s in e){let o=e[s];n[s]=o}const i=Object.getOwnPropertySymbols(e);if(Array.isArray(i)&&i.length>0)for(let s of i)n[s]=e[s];return t}}class rn{id;name;props;meta;src;component;constructor(e,t,n,i){this.id=oe.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=i}get isResolved(){return this.component!==void 0}resolve(){return en(this)}}class er{models=[]}class ot{path;match;redirect;name;layers=[]}const B=Symbol("chainKey"),I=Symbol("cursorKey"),lt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Y=Symbol("argsKey"),Ne=Symbol("exArgsKey"),he=Symbol("successFnsKey"),Re=Symbol("errorFnsKey"),se=Symbol("sessionKey"),Z=Symbol("_go");class Le{[B]=[];[I]=0;[lt]=!1;[T]="Free";[Y]=[];[Ne]=[];[he]=[];[Re]=[];[se];get session(){return this[se]}constructor(e,t=!1){this[se]=e,this[lt]=t}[Z](e,...t){let n=this[T];if(this[T]="Busy",this[I]+=e,this[I]<0&&(this[I]=0),this[Y]=t,n==="Exception"||n==="Reject"){let a=[{session:this[se]},...this[Ne]];for(;this[Re].length>0;)try{let l=this[Re].shift();typeof l=="function"&&$e(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=n,this[B]=[],this[I]=0,this}else if(n==="Finished"||this[I]>=this[B].length){let a=[{session:this[se]},...this[Y]];for(;this[he].length>0;){let l=this[he].shift();typeof l=="function"&&$e(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[I]>=this[B].length)return this[T]="Free",this;let i=this[B][this[I]];this[lt]||(this[B].splice(0,this[I]+1),this[I]=-1);let s=this[I]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[Z],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[Z],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[B].splice(s,0,l),s++)},session:this[se]};$e(()=>{Reflect.apply(i,{},[a,...this[Y]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[Z],this,[e,...t])}finish(...e){return this[T]="Finished",this[Y]=e,Reflect.apply(this[Z],this,[0])}reject(...e){return this[T]="Reject",this[Ne]=e,Reflect.apply(this[Z],this,[0])}throw(...e){return this[T]="Exception",this[Ne]=e,Reflect.apply(this[Z],this,[0])}reset(...e){this[T]="Busy",this[Y]=e,this[B]=[],this[I]=0;let n=[{session:this[se]},...this[Y]];for(;this[he].length>0;){let i=this[he].shift();$e(()=>{Reflect.apply(i,this,n)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[T]==="Busy"?this:(Reflect.apply(this[Z],this,[0,...this[Y]]),this))}wait(e,t){return e&&typeof e=="function"&&this[he].push(e),t&&typeof t=="function"&&this[Re].push(t),this[T]==="Busy"?this:(Reflect.apply(this[Z],this,[0,...this[Y]]),this)}exception(e){return e&&typeof e=="function"&&this[Re].push(e),this[T]==="Busy"?this:Reflect.apply(this[Z],this,[0,...this[Y]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[I]>=this[B].length}}const de=Symbol("registerKey");class nn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Tt{[de]=new Map;constructor(){}on(e,t,n=!1){let i=this[de].get(e);i||(i=new Array,this[de].set(e,i));let s=n===!0?1:0,o=new nn(t,s);return i.push(o),this}off(e,t){if(!t)return this[de].delete(e),this;let n=this[de].get(e);if(n){for(let i=0;i<n.length;i++)if(n[i].callback===t){n.splice(i,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 i=t-1,s=new Array(i),o=[].splice.call(e,0,i);for(let a=0;a<o.length;a++)this.once(o[a],l=>{s[a]=l,i-=1,i==0&&Reflect.apply(n,{},s)});return this}emit(e,...t){let n=this[de].get(e);if(!n)return this;for(let i=0;i<n.length;){let s=n[i];if(s.policy==1?n.splice(i,1):i++,typeof s.callback=="function")try{$e(()=>{Reflect.apply(s.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Se=Symbol("registerKey");class sn{[Se]=new Map;constructor(){}set(e,t){this[Se].set(e,t)}get(e){return this[Se].get(e)}has(e){return this[Se].has(e)}delete(e){return this[Se].delete(e)}}const jt=Symbol("lc");function _t(r,e=!1){let t=r,n=t[jt];if(!n)if(e)n=new sn,t[jt]=n;else return null;return n}function Sr(r,e){let t=r;for(;t!==null;){const n=t[jt];if(n&&n.has(e))return n.get(e);t=t.$parent}return null}function tr(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 _t(e.component.proxy,!1)}return null}const et=Symbol("hooksKey");function on(r){let e=r.get(et);e||(e=[],r.set(et,e))}function rr(r,e){let t=r.get(et);if(t!=null)for(let n=t.length-1;n>=0;n--){let i=t[n];if(i.type===e)try{Reflect.apply(i.hook,i.target,[])}catch(s){console.error(s.message,s)}}}var Kt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Kt||{});class ln{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function an(r,e,t,n){let i=new ln(e,t,n);return r.push(i),!0}function un(r,e,t,n){let i=-1;for(let s=0;s<r.length;s++){let o=r[s];if(o.type===e&&o.hook===t&&o.target===n){i=s;break}}return i!=-1?(r.splice(i,1),!0):!1}function Pr(r){return(e,t)=>{let n;if(t)n=t;else{let s=w.getCurrentInstance();if(s==null||s.proxy==null){console.error("can not get current instance or proxy");return}n=s.proxy}let i=Sr(n,et);if(i==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{un(i,r,e,n)}),an(i,r,e,n)}}let fn=Pr("a"),cn=Pr("da");const $t=Symbol("routeKey");function nr(r,e){r.set($t,e)}function Bt(r){let e=Sr(r,$t);return typeof e=="function"?e():e??null}const rt=Symbol("rk"),at=Symbol("vd"),ir=Symbol("rv"),ut=Symbol("rvi"),sr=Symbol("pv"),ft=Symbol("pvi");function hn(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 i="",s=t+1;s<r.length;){var o=r.charCodeAt(s);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){i+=r[s++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:i}),t=s;continue}if(n==="("){var a=1,l="",s=t+1;if(r[s]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<r.length;){if(r[s]==="\\"){l+=r[s++]+r[s++];continue}if(r[s]===")"){if(a--,a===0){s++;break}}else if(r[s]==="("&&(a++,r[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(s));l+=r[s++]}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=s;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function Cr(r,e){e===void 0&&(e={});for(var t=hn(r),n=e.prefixes,i=n===void 0?"./":n,s="[^".concat(ve(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"),m=f("NAME"),p=f("PATTERN");if(m||p){var y=d||"";i.indexOf(y)===-1&&(u+=y,y=""),u&&(o.push(u),u=""),o.push({name:m||a++,prefix:y,suffix:"",pattern:p||s,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 y=h(),_=f("NAME")||"",x=f("PATTERN")||"",K=h();c("CLOSE"),o.push({name:_||(x?a++:""),pattern:_&&!x?s:x,prefix:y,suffix:K,modifier:f("MODIFIER")||""});continue}c("END")}return o}function dn(r,e){return yn(Cr(r,e),e)}function yn(r,e){e===void 0&&(e={});var t=Vt(e),n=e.encode,i=n===void 0?function(l){return l}:n,s=e.validate,o=s===void 0?!0:s,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==="*",m=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!m)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var y=i(h[p],c);if(o&&!a[f].test(y))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var y=i(String(h),c);if(o&&!a[f].test(y))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix;continue}if(!d){var v=m?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function pn(r,e){var t=[],n=Er(r,t,e);return mn(n,t,e)}function mn(r,e,t){t===void 0&&(t={});var n=t.decode,i=n===void 0?function(s){return s}:n;return function(s){var o=r.exec(s);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(m){return i(m,d)}):u[d.name]=i(o[h],d)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function ve(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Vt(r){return r&&r.sensitive?"":"i"}function vn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=t.exec(r.source);i;)e.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=t.exec(r.source);return r}function gn(r,e,t){var n=r.map(function(i){return Er(i,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Vt(t))}function wn(r,e,t){return bn(Cr(r,t),e,t)}function bn(r,e,t){t===void 0&&(t={});for(var n=t.strict,i=n===void 0?!1:n,s=t.start,o=s===void 0?!0:s,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,m=d===void 0?"":d,p="[".concat(ve(m),"]|$"),y="[".concat(ve(h),"]"),v=o?"^":"",g=0,_=r;g<_.length;g++){var x=_[g];if(typeof x=="string")v+=ve(f(x));else{var K=ve(f(x.prefix)),A=ve(f(x.suffix));if(x.pattern)if(e&&e.push(x),K||A)if(x.modifier==="+"||x.modifier==="*"){var P=x.modifier==="*"?"?":"";v+="(?:".concat(K,"((?:").concat(x.pattern,")(?:").concat(A).concat(K,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(P)}else v+="(?:".concat(K,"(").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(K).concat(A,")").concat(x.modifier)}}if(l)i||(v+="".concat(y,"?")),v+=t.endsWith?"(?=".concat(p,")"):"$";else{var C=r[r.length-1],W=typeof C=="string"?y.indexOf(C[C.length-1])>-1:C===void 0;i||(v+="(?:".concat(y,"(?=").concat(p,"))?")),W||(v+="(?=".concat(y,"|").concat(p,")"))}return new RegExp(v,Vt(t))}function Er(r,e,t){return r instanceof RegExp?vn(r,e):Array.isArray(r)?gn(r,e,t):wn(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||{}),Qe=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Qe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),ue=Symbol("parentNodeKey"),Xe=Symbol("nameKey");class re{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,i=!0){this.route=e,this.model=t,this.index=n,this.active=i}}class Pe{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Xe];[G];[J]=null;[ue]=null;get name(){return this[Xe]}constructor(e,t,n){this[Xe]=e,this[G]=t,n&&(this[J]=n)}}class V{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.view===t.view&&(t.index==-1||i.index===t.index)&&i.level===t.level)return!0}return!1}}class ct{views=[]}class xn{layers=[]}class Rn{time;route}class Sn{forbidTime=300;submitRecorder=new Rn;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 ge=Symbol("_notifyChange");class or{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Me=typeof window<"u",L=function(){return window},Ie=function(){return window.document};function Pn(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 ht(){if(!Me)return"/";let r=L().location,e=`${r.protocol}//${r.host}`;return e+=Pn(r.pathname),e}function qt(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Ot(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const He=Symbol("ignoreHistoryChangeOnceKey"),lr=Symbol("_navigateFirstRoute"),De=Symbol("_getRouteMark"),ar=Symbol("_getUrlSearch"),dt=Symbol("_generateLocation"),Ce=Symbol("_setRouteMarkRecorder"),Ee=Symbol("beforeRestoreFiltersKey"),ur=Symbol("_beforeRestore"),fr="Symbol(_fox_restore_point)";function yt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Ar{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[He]=!1;[Ee]=new Array;constructor(e="hash",t="",n="",i=!0,s=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=i,this.historyMonitor=s,this.traceless=o,this.storage=a??L().sessionStorage}init(e=!0){const t=L();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[He]){this[He]=!1;return}if(yt(this.historyMonitor)){const n=t.history.state;this[ge](n);try{let i=[];if(typeof n=="string"?i=JSON.parse(n):i=n,Array.isArray(i)&&i.length>0){const s=this[De]()??"/";this[Ce](s,i)}}catch{}}}),qt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[lr](),Promise.resolve()}destroy(){if(this.historyChange){const e=L();Ot(e,"popstate",this.historyChange)}}[ur](e,t){for(let n of this[Ee])try{const i=Reflect.apply(n,{},[e,t]);if(i===!1)return i}catch(i){console.error(i.message,i)}return!0}beforeRestoreEach(e){this[Ee].push(e)}removeBeforeRestoreEach(e){const t=this[Ee].indexOf(e);return t!==-1?(this[Ee].splice(t,1),!0):!1}[lr](){const e=this[De]()??"/",t=this.storage.getItem(fr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0&&o.routes.filter(l=>this[ur](l,e)).length>0){this[ge](o.routes);return}}catch{}const n=e.indexOf("!");let i;n!=-1?i=e.substring(n+1):i=e;const s=new $;s.path=i,s.query=this[ar](),this[ge]([s])}[Ce](e,t){try{const n={mark:e,routes:t},i=JSON.stringify(n);this.storage.setItem(fr,i)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[De]()??"/";this[Ce](t,e)}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[De](){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}[ar](){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[He]=!t,n.history.go(e)}push(e){const t=this[dt](e.currentRoute);yt(this.traceless,e.currentRoute)||L().history.pushState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ce](n,e.routes)}replace(e){const t=this[dt](e.currentRoute);yt(this.traceless,e.currentRoute)||L().history.replaceState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ce](n,e.routes)}[dt](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 i=t.location;let s=e.alias??e.fullPath;s.startsWith(ee)&&(s=s.substring(ee.length+1));let o;return n?this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}${n}`:o=`${this.base}/${s}${n}`:o=`${i.pathname}${n}#${s}`:this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}`:o=`${this.base}/${s}`:o=`${i.pathname}#${s}`,`${i.origin}${o}`}}function Cn(r=!0,e=null,t="",n=!0,i=!1,s){return e!==null&&(e=L().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Ar("path",e??"",t,r,n,i,s)}function Fr(r=!0,e="",t=!0,n=!1,i){return new Ar("hash","",e,r,t,n,i)}class En{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}[ge](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const i=this.queue[n];this[ge](i.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 Tr(r="",e=50){return new En(r,e)}const Be=Symbol("_constructRouteModel"),Ve=Symbol("_findRouteModel"),pt=Symbol("_findRootView"),cr=Symbol("_getFirstView"),le=Symbol("_removeView"),hr=Symbol("_buildPage"),dr=Symbol("_resolveComponent"),yr=Symbol("_update"),ne=Symbol("_merge"),mt=Symbol("_handleHistoryChange"),Ue=Symbol("_handleRouteUpdated"),ke=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),ye=Symbol("current"),pr=Symbol("_addRouteRecorder"),Ae=Symbol("_removeRouteRecorder"),We=Symbol("_cloneRouteRecorder"),q=Symbol("_handleError"),ze=Symbol("errorCallback"),U=Symbol("registerKey"),Je=Symbol("notFoundKey"),vt=Symbol("notFoundPathKey"),k=Symbol("forestKey"),E=Symbol("historyKey"),Fe=Symbol("beforeFiltersKey"),Te=Symbol("afterFiltersKey"),je=Symbol("destroyFiltersKey"),pe=Symbol("mainDispatcherKey"),gt=Symbol("initKey"),ae=Symbol("readyKey"),wt=Symbol("readyHandlersKey"),Ge=Symbol("_markReady"),mr=Symbol("_createNextFn"),bt=Symbol("_start"),xt=Symbol("_before"),Rt=Symbol("_after"),vr=Symbol("_destroy"),St=Symbol("_load"),_e=Symbol("_unload"),Ke=Symbol("routerGuardKey");function An(r){return r.layers.length==0||r.layers[0].views.length==0}function Fn(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 i=j(!0,{},n.meta);e.push(i)}else n.meta&&e.push(n.meta)})}),e}class Tn{[U]=new Array;[Je];[vt]="*";[ae]=!1;[wt]=[];[k]=new xn;[E];[b]=new Array;[ze]=null;[ke]=null;[Fe]=new Array;[Te]=new Array;[je]=new Array;[pe]=new Le;[Ke]=new Sn;[gt]=!1;[ye]=w.ref(null);get current(){return this[ye].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[E]=e.history:this[E]=Me?Fr():Tr(),this[E]?.listen(async n=>{let i=!0;try{if(typeof n=="string"){const s=this[H](n);s&&await this[mt]([s])}else await this[mt](n)}catch(s){console.error(s.message,s),i=!1}this[ae]===!1&&this[Ge](i)})}[q](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[ze]=="function")try{this[ze](e,t)}catch{}console.error(e)}init(){this[gt]!==!0&&(this[E]?.init(!this[ae]),this[gt]=!0)}isReady(){return this[ae]?Promise.resolve():new Promise((e,t)=>{this[wt].push([e,t])})}[Ge](e){this[ae]=!0,this[wt].forEach(([t,n])=>{try{e?t():n()}catch(i){console.error(i.message,i)}})}[mt](e){try{if(!e){let o=[...this[b]].reverse();return this[_e](o),Me&&L().location.reload(),Promise.resolve()}let t=null,n=[],i=[],s=0;for(;s<e.length&&s<this[b].length&&$.isSame(e[s],this[b][s]);s++)e[s].active===!0&&e[s].active!==this[b][s].active&&(t=e[s]);if(s<e.length&&(n=e.slice(s)),s<this[b].length&&(i=this[b].slice(s).reverse()),i.length===0&&n.length===0){if(t!==null)return this.restore([t])}else if(i.length>0){if(this[_e](i)){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()}[Ue](e){if(e)this[ye].value=e;else{let t=this[b].length;t>0?this[ye].value=this[b][t-1]:this[ye].value=null}if(typeof this[ke]=="function")try{this[ke](this[ye].value)}catch{}}[pr](e){if(e.opsType===F.Open){let t=!1;const n=this[b].length-1;for(let i=n;i>=0;i--){const s=this[b][i];if(e.root==s.root){if(e.path===s.path){this[b].splice(i,1,e),t=!0;continue}e.active&&(s.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[We](){let e=[];for(let t of this[b]){let n=$.clone(t,!0);e.push(n)}return e}[Ae](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[vr](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}setRestorePoint(){const e=this[We]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[ke]=e}onError(e){this[ze]=e}beforeEach(e){this[Fe].push(e)}removeBeforeEach(e){const t=this[Fe].indexOf(e);return t!==-1?(this[Fe].splice(t,1),!0):!1}afterEach(e){this[Te].push(e)}removeAfterEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}destroyEach(e){this[je].push(e)}removeDestroyEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}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[vt]){this.setNotFoundRoute(e);return}const n=this[Be](e);if(t==-1)this[U]=[...this[U],...n];else for(let i=n.length-1;i>=0;i--)this[U].splice(t,0,n[i])}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 i=this[U][n];if(t?.path&&i.path===t.path)return this[U].splice(n,1),!0;if(t?.name&&i.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(i=>{if(t?.path&&i.path===t.path||t?.name&&i.name===t.name)return!0})!==-1}setNotFoundPath(e){this[vt]=e}setNotFoundRoute(e){const t=this[Be](e);this[Je]=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 ot;return a.path=t,a.redirect=e.redirect,[a]}let i=[];for(let a in n){let l=n[a];a.length===0&&(a=ee);let u=new rn(a,l,e.props,e.meta);i.push(u)}let s=!1,o=[];if(e.children)for(let a of e.children){let l=this[Be](a);for(let u of l){let f=new ot;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(s=!0,f.path=t);let c=new er;c.models=[...i],f.layers=[c,...u.layers],o.push(f)}}if(!s){const a=new er;a.models=i;const l=new ot;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ve](e){const t=e.route;try{for(let n of this[U])if(t.path&&n.path){let i=n.match;i||(i=n.match=pn(n.path));let s=i(t.path);if(!s)continue;if(n.redirect){let o=new $;j(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ve](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},j(!0,t.params,s.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let u of l){let f=u.split("=");if(f.length!==2)continue;let c=decodeURIComponent(f[0].trim()),h=decodeURIComponent(f[1].trim());a[c]=h}j(!0,t.params,a)}else typeof o=="object"&&j(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let i=dn(n.path);return t.path=i(t.params),e.find=n,!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&&j(!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??ee,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[pe].post(n=>{try{if(this[b].length===0){n.resolve(),t(!1);return}let i=-1,s,o=[];if(e){if(e.root?s=e.root:s=this[b][0].root??ee,e.all)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];u.opsType===F.Append&&u.root===s&&(o.splice(0,0,u),i=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===s){if(e.until.charAt(0)==="/"&&e.until===u.path){i=l;break}else if(e.until===u.name){i=l;break}o.splice(0,0,u)}}}else{s=ee;let l=this[cr](this[k]);l&&(s=l.name);for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===F.Append&&f.root===s){o.push(f),i=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(i){this[q](i),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[pe].post(t=>{try{let n=this[H](e);if(!n){t.reject("resolve route fail");return}let i=[];for(let s=0;s<this[b].length;s++){let o=this[b][s];if(o.root===n.root){if(!n.path&&!n.name){i.push(o);continue}if(n.path&&n.path===o.path){i.push(o);break}else if(n.name&&n.name===o.name){i.push(o);break}}}if(i.length===0){t.resolve();return}this[_e](i)&&this[Ue](),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[Ke].acquire(t);return n==null?(this[q]("route forbid",t),this):(this[pe].post(i=>{try{let s=this[bt](t);this[xt](s),this[St](s),this[Rt](s),s.wait((o,a)=>{const l=o.session.to;try{let u=$.clone(l,!0);const f=new or(u,this[We]());l.opsType===F.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[Ke].release(n),this[Ue](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ae]===!1&&this[Ge](!0),i.resolve()},(o,a)=>{this[Ke].release(n),a!==null&&this[q](a,t),this[ae]===!1&&this[Ge](!1),i.resolve()})}catch(s){this[Ke].release(n),this[q](s,t),i.resolve()}}),this)}back(e=1){this[E]?.go(-e)}[mr](e){return(t,n)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(n??null);else if(t){const i=this[H](t);if(i){const s=e.session.to;i.success=s.success,i.error=s.error,e.session.to=i,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()}}[bt](e){let t=this[b].length>0?this[b][0]:void 0,n=new Ze(e,t),i={route:e,find:null};return this[Ve](i),i.find&&(n.routeModel=i.find,e.matched=Fn(i.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=i.find.layers[0].models[0].meta)),new Le(n)}[xt](e){for(let t of this[Fe])e.post(n=>{let i=this[mr](n);Reflect.apply(t,{},[n.session.to,n.session.from,i,n.session])})}[Rt](e){e.post(t=>{for(let n of this[Te])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(i){console.error(i.message,i)}t.resolve()})}[vr](e,t){for(let n of this[je])try{Reflect.apply(n,{},[e,t])}catch(i){console.error(i.message,i)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[St](e){e.post(t=>{let n=t.session.to,i=t.session.routeModel;if(i==null){let o={route:n,find:null};if(this[Ve](o))i=o.find,t.session.routeModel=i;else if(this[Je])i=this[Je];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let s=Ze.from(t.session);this[hr](n,i,s).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 i of e){let s=this[pt](t,i);s!=null&&n.push({...s,route:i})}if(n.length==0){let i="can not find view index";return this[q](i),!1}for(let i of n.reverse())this[le](t,{x:i.x,y:i.y},[i.route.index??0],!0);return!0}[pt](e,t){const n=t.root??ee;let i;for(let s=0;s<e.layers.length;s++){const o=e.layers[s];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Xe]===n)return i={x:a,y:s},i}}return null}[cr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[le](e,t,n=null,i=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...s.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&s[G]&&(this[Ae](h.route),h.active===!0&&h.route.opsType==F.Append&&(l=!0)),a.push(new V(s,h.index,t.y)),u.splice(c,1))}if(u.length==0)i?s.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)}s.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 m=c[d];if(m[ue]&&(o||V.include(a,m[ue]))){let p=m.slots.value;for(let y=p.length-1;y>=0;y--){let v=p[y];v.route&&m[G]&&this[Ae](v.route),h.push(new V(m,v.index,f)),p.splice(y,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[Ue](),Promise.resolve()}else return new Promise((n,i)=>{let s=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[pe].post(u=>{const f=this[bt](l);this[xt](f),this[St](f),this[Rt](f),f.wait((c,h)=>{s=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{s=null,h!==null&&this[q](h),u.resolve()})})}this[pe].post(a=>{if(s&&o===!0){const l=$.clone(s,!0),u=new or(l,this[We]());this[E]?.replace(u)}a.resolve(),n()})})}[hr](e,t,n){let i=e.updateType??Qe.Part;return this[dr](t).then(()=>{this[yr](t,e,n,i)})}[dr](e){let t=[];for(let n=0;n<e.layers.length;n++){let i=e.layers[n];for(let s=0;s<i.models.length;s++){let o=i.models[s];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[yr](e,t,n,i){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const s=e.layers[0].models[0];let o=this[k],a=An(o),l=t.root??ee,u;!a&&i==Qe.Part&&(u=this[pt](o,t));let f,c=0;if(u==null||u==null)if(a||i===Qe.All){if(o.layers.length==0&&(o.layers[0]=new ct),o.layers[0].views.length==0){let h=t.root??ee;f=new Pe(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 m;if(h.rootName){let p=o.layers[d-1];for(let y of p.views){if(y[G]&&y.name===h.rootName){m=new V(y,h.rootIndex??0,d-1);break}if(y[J]&&y[J].view.name===h.rootName&&y[J].index===h.rootIndex){m=y[J];break}}}if(!m)return Promise.reject("can not insert view(not find root node ref)");f=new Pe(l,!0,m),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=oe.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 re(t,s,t.index,!0);f.slots.value=[...h,d];let m=c+1,p=1,y=new V(f,t.index,c);this[ne](o,m,e,p,y)}else if(t.opsType===F.Open){let h=f.slots.value;const d=t.active??!0;let m=!1;for(let p of h){if(p.route!==null&&$.isSameForRouteModel(p.route,t)){if(p.active===d)return t.index=p.index,t.active=d,p.route=t,Promise.resolve();p.active=d,m=!0,t.index=p.index,t.active=d,p.route=t}else d&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!m){t.index=oe.get(),t.active=d;let p=new re(t,s,t.index,d);h.push(p);let y=c+1,v=1,g=new V(f,t.index,c);this[ne](o,y,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=oe.get(),t.active=!0,f.slots.value=[new re(t,s,t.index)];let d=c+1,m=1,p=new V(f,t.index,c);this[ne](o,d,e,m,p)}else{let d=h[0];if(d.model!==s){this[le](o,u,null,!0),t.index=oe.get(),t.active=!0,f.slots.value=[new re(t,s,t.index)];let m=c+1,p=1,y=new V(f,t.index,c);this[ne](o,m,e,p,y)}else{d.route!==null&&this[Ae](d.route);let m=!1;const p=t.active??!0;d.active!==p&&(d.active=p,m=!0),t.active=p,t.index=d.index,d.route=t;let y=[];for(let K=1;K<h.length;K++)y.push(h[K].index);y.length>0?this[le](o,u,y,!0):m&&(f.slots.value=[...h]);let v=[new V(f,t.index,c)],g=c+1,_=1,x=new V(f,t.index,c);for(;v.length>0&&g<o.layers.length&&_<e.layers.length;g++,_++){let K=[];for(let P=0;P<o.layers[g].views.length;P++){let C=o.layers[g].views[P];C[ue]&&V.include(v,C[ue])&&K.unshift(P)}let A=[];for(let P of K){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[le](o,{x:P,y:g},null,!1);else{let N=C.slots.value;if(N.length==0){let X=0;C.slots.value=[new re(null,M,X)];let z=g+1,te=_+1;this[ne](o,z,e,te,x)}else{let X=N[0];if(X.model!==M){this[le](o,{x:P,y:g},null,!0),C.slots.value=[new re(null,M,0)];let z=g+1,te=_+1;this[ne](o,z,e,te,x)}else{C[G]&&X.route!==null&&this[Ae](X.route);let z=[];for(let te=1;te<N.length;te++)z.push(N[te].index);z.length>0&&this[le](o,{x:P,y:g},z,!0),A.push(new V(C,X.index,g))}}C[G]=!1}}v=A}this[ne](o,g,e,_,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new tn(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[pr](t)}[ne](e,t,n,i,s){let o=i,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 Pe(u.name,!1,s),c=new re(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new ct;l.views=[];for(let u of n.layers[o].models){let f=new Pe(u.name,!1,s),c=new re(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[Rr](e,t,n,i,s,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&&i!==-1&&(d=h[J]?.index===i)):d=h.name===e,!!d){s!==null&&(h[ue]={view:s,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;s!==null&&(s[G]?a={view:s,index:o,level:t-1}:a=s[J],l={view:s,index:o,level:t-1});let u=new Pe(e,!0,a);if(u[ue]=l,t==this[k].layers.length){let f=new ct;f.views=[u],this[k].layers.push(f)}else this[k].layers[t].views.push(u);return u}}const jn="fox-router-view",_n="fox-router-link";function jr(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 _r(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 Kn(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 $n(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 qn(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 On(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 Ln(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function Mn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Nn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function In(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Hn(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function Dn(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function Bn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Ut(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function we(r,e){r.classList.contains(e)||r.classList.add(e)}function be(r,e){r.classList.remove(e)}const Vn=Me&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function kt(r){Vn(r)}function D(r,e,t){S(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function Kr(r,e,t,n=-1,i,s,o,a){if(S(s)){if(i!==void 0&&i>=0){setTimeout(()=>{Reflect.apply(s,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},i);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Ot(e,c,u)}),Reflect.apply(s,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{qt(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Ot(e,l,u)};qt(e,l,u)}}function Wt(r){return!Me||r===null?!1:r.opsType===F.Append||r.opsType===F.Open}function $r(r,e,t,n={},i,s=-1){if(e||Wt(i)){const o=jr(n,e);o&&we(t,o);const a=_r(n,e);a&&we(t,a);const l=Ln(n,e);D(r,l,[t,e,i,s])}}function qr(r,e,t,n={},i,s,o,a){if(!Wt(s)&&!e){S(a)&&a(r,a,[t]);return}const l=jr(n,e),u=_r(n,e),f=Kn(n,e),c=Mn(n,e),h=Nn(n,e),d=In(n,e);kt(()=>{Kr(r,t,s,o,i,()=>{u&&be(t,u),f&&be(t,f),S(h)&&D(r,h,[t,e,s,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&D(r,d,[t,e,s,o])}),l&&be(t,l),f&&we(t,f),S(c)&&D(r,c,[t,e,s,o])})}function Or(r,e,t,n={},i,s,o,a,l){if(!Wt(o)&&!e){!e&&S(s)&&s();return}const u=$n(n,e),f=qn(n,e),c=On(n,e),h=Hn(n,e),d=Dn(n,e),m=Bn(n,e);u&&we(t,u),f&&we(t,f),S(h)&&D(r,h,[t,e,o,a]),kt(()=>{Kr(r,t,o,a,i,()=>{f&&be(t,f),c&&be(t,c),S(d)&&D(r,d,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(s)&&s()},()=>{S(m)&&D(r,m,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(s)&&s()}),u&&be(t,u),c&&we(t,c)})}function Lt(r,e={},t,n=-1){const i=e.mode??"default",s=Ut(e);return{mode:i,persisted:!1,beforeEnter:a=>{$r(r,!1,a,e,t,n)},enter:a=>{qr(r,!1,a,e,s.enter,t,n)},leave:(a,l)=>{Or(r,!1,a,e,s.leave,l,t,n)},clone:a=>Lt(r,e,t,n)}}function Lr(r){return r.el}function Un(r,e,t={},n,i,s,o){if(s){const a=Lr(e);if(a==null)return;const l=Ut(t);$r(r,!0,a,t,n,i),qr(r,!0,a,t,l.show,n,i,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function kn(r,e,t={},n,i,s,o){if(s){const a=Lr(e);if(a==null)return;const l=Ut(t);Or(r,!0,a,t,l.hide,null,n,i,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function Wn(r,e={}){kt(()=>{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 Pt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class zn{node;state;constructor(e,t){this.node=e,this.state=t}}const Mt=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,i=w.inject(rt,null),s=w.inject(at,0),o=w.inject(ir,null),a=w.inject(ut,-1);let l=null;const u=r.modelSlot;if(u){if(w.provide(at,s+1),w.provide(ut,u.index),w.provide(ft,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=_t(t.proxy,!0);on(h),nr(h,()=>u.route??null)}else{if(i==null){console.error("router is not been injected");return}const c=r.name,h=w.inject(sr,null),d=w.inject(ft,0);if(l=i[Rr](c,s,o,a,h,d),l===null)return;w.provide(sr,l);const m=l[G]===!0;if(m&&w.provide(ir,l),!n&&(w.provide(ut,-1),w.provide(at,s+1),w.provide(ft,-1),m)){const p=_t(t.proxy,!0);nr(p,()=>{const y=l.slots.value;return y.length>0?y[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,m=[];for(let v=0;v<d.length;v++){const g=d[v],_=`${r.name}_${g.index}`,x=ie(r.transition,g.route,v)??!0,K={modelSlot:g};let A;e.slots.default?A=w.h(Mt,K,{default:e.slots.default}):A=w.h(Mt,K);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),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 ce=N.node;g.active?m.unshift(()=>{const it=()=>{let xe=tr(ce);xe!=null&&rr(xe,Kt.ACTIVATED)};Un(t,ce,r,g.route,v,x,it)}):m.push(()=>{const it=()=>{const xe=tr(ce);xe!=null&&rr(xe,Kt.DEACTIVATED)};kn(t,ce,r,g.route,v,x,it)})}const X={class:P,key:_},z=ie(r.viewTagProps,g.route,v);z!==null&&typeof z=="object"&&j(!0,X,z),g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"&&j(!0,X,g.route.viewTagAttrs);const te=ie(r.viewTag,g.route,v),nt=w.h(te,X,{default:()=>[A]});if(c.set(_,new zn(nt,g.active)),f.value.delete(_),x){const ce=Lt(t,r,g.route,v);nt.transition=ce}h.push(nt)}f.value.forEach(v=>{v.node.transition=null}),f.value=c,Wn(m,t);const p=ie(r.tag,null,-1),y={};return Object.assign(y,e.attrs),w.h(p,y,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?j(!1,h,c.props):c.props===!0&&typeof u.route?.params=="object"&&j(!1,h,u.route?.params));const d=w.h(c.component,h);return Pt(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&&Bt(t.proxy))??null,m=h.model,p={};m.props&&(typeof m.props=="object"?j(!1,p,m.props):m.props===!0&&typeof d?.params=="object"&&j(!1,p,d?.params));const y=w.h(m.component,p);if(ie(r.transition,d,-1)??!0){const g=Lt(t,r,d,-1);y.transition=g}return Pt(e.slots.default,{Component:y,route:d})??y}else return Pt(e.slots.fallback,{})}}}});function Jn(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 Gn(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function Qn(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function me(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let Xn=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(rt,null);return()=>{let n=me(r.to,null),i=me(r.tag,n);if(i==null){console.warn("can not resolve link tag");return}let s=null,o=null;t!==null&&(s=t[H](n),r.root&&(s.root=r.root),o=t.current);let a={},l=me(r.activeClass,s);if(typeof l=="string"&&l.length>0&&(a[l]=Qn(s,o)),me(r.exact,s)===!0){let h=me(r.exactActiveClass,s);typeof h=="string"&&h.length>0&&(a[h]=Gn(s,o))}let f={class:a};(i==="a"||i==="A")&&(f.href=s?.path??s?.name??"#"),j(!0,f,e.attrs);let c=me(r.event,s);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(s==null){console.warn("route is not been resolved");return}Jn(d)&&t.to(s)};f[c]=h}return w.h(i,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||{}),Ye=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(Ye||{});class Yn{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 gr{moduleManager=new Yn;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 n={id:e,src:"",status:O.Defined};typeof t=="function"?(n.exports=t,n.type=Ye.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 i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=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 Zn(t.length,(l,u)=>{if(o.isOK())try{typeof s=="function"&&Reflect.apply(s,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof s=="function"&&Reflect.apply(s,{},[])}catch(f){console.error(f.message,f)}}),a=new Le;for(let l=0;l<t.length;l++){const u=new ei(l,t[l],i,o);this.mount(a,u)}return this}remove(...e){let t=[],n=e.length-1,i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=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,i)}),typeof s=="function"&&Reflect.apply(s,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(i=>{t.progress.work(!0,t.index,"exports"),i.resolve()});return}else if(t.src==="module"){e.post(i=>{t.progress.work(!0,t.index,"module"),i.resolve()});return}if(this.isNaturePath(t.src)){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src)){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}let n=this.getFileNamePostfix(t.src);if(n==="js"||n.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(n==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}}mountCSS(e,t,n){e.post(i=>{const s=t.src,o=this.moduleManager.get(s);if(o&&(o.status==O.Defined||o.status==O.Loaded)&&o.exports){o.type===Ye.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.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),i.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),i.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),i.resolve()},error:()=>{try{n.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),i.resolve()}};setTimeout(()=>{Mr(l,c)},1)}let f=a.getElementById(s);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=s,l.href=s,n.appendChild(l)})}mountJS(e,t,n){e.post(i=>{const s=t.src;let o=this.moduleManager.get(s);if(o&&(o.status==O.Defined||o.status==O.Loaded)){if(o.exports){o.type===Ye.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}if(document.querySelector(`script[src='${s}`)){t.progress.work(!0,t.index,o.exports),i.resolve();return}}o={id:s,src:s,status:O.Loading},this.moduleManager.set(s,o);const l=Ie().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,s)),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(s),t.progress.work(!1,t.index,null),i.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,s)),i.resolve())}}l.defer=!0,l.src=s;const f=L();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Ie(),i=this.getFileNamePostfix(e);if(i==="js"||i.length===0){const s=n.querySelector(`script[src="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s),this.moduleManager.remove(e);return}else if(i==="css"){const s=n.querySelector(`style[href="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s);return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===void 0||e[n]===null)continue;const i=e[n].trim();i.length!==0&&t.push(i)}return t}createDefine(e,t){const n=this,i=function(...s){e.status=O.Defining;let o,a,l,u=s.length;u===1?(l=s[0],o=void 0):u===2?(l=s[1],Array.isArray(s[0])?(a=n.trimEmptyElement(s[0]),o=void 0):a=void 0):(o=s[0],a=n.trimEmptyElement(s[1]),l=s[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 i.amd=!0,i}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 i=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}&`}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 i=t[n];if(e.indexOf(i)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${ht()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${ht()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${L().location.protocol}${e}`;if(t){let i=this.options.alias[e];if(!i){let s=e.indexOf("/");if(s==-1)i=e;else{let o=e.slice(0,s),a=this.options.paths[o];a?i=a+e.slice(s):i=e}}return this.parserPath(i,!1)}return`${ht()}${e}`}}function Mr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(i){i.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.timeout>e.timeout?e.error():Mr(r,e)},20)}class Zn{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(i){console.error(i.message,i)}}isOK(){return this.status}}class ei{index;src;params;progress;constructor(e,t,n,i){this.index=e,this.src=t,this.params=n,this.progress=i}}const zt=Symbol("fk"),Jt=Symbol("fbk"),Gt=Symbol("fepk");function ti(r={}){const e=new Tn(r),t=new Ft,n=new Tt,i=new gr,s={get router(){return e},get bus(){return t},get Bus(){return Ft},get EventProxy(){return Tt},get eventproxy(){return n},get EventChain(){return Le},get Require(){return gr},get require(){return i},get extend(){return j},get clone(){return qe},get isESModule(){return Nt},install(o){o.provide(rt,e),o.provide(zt,s),o.provide(Jt,t),o.provide(Gt,n),o.component(jn,Mt),o.component(_n,Xn),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return s}}),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 Bt(this)}}}),e.init()}};return s}function Qt(r){return r?r.$router:w.inject(rt)}function ri(r){return r||(r=w.getCurrentInstance()?.proxy??void 0),r?Bt(r):null}function ni(r){return r?r.$fox:w.inject(zt)}function ii(r){return r?r.$bus:w.inject(Jt)}function si(r){return r?r.$eventProxy:w.inject(Gt)}function oi(r){const e=Qt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function li(r){const e=Qt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=Ft;exports.EventChain=Le;exports.EventProxy=Tt;exports.Route=$;exports.clone=qe;exports.createFox=ti;exports.createMemoryHistory=Tr;exports.createWebHashHistory=Fr;exports.createWebHistory=Cn;exports.extend=j;exports.foxBusKey=Jt;exports.foxEventProxyKey=Gt;exports.foxKey=zt;exports.isArray=Nr;exports.isDate=Dr;exports.isESModule=Nt;exports.isEqual=At;exports.isFunction=S;exports.isMap=Ir;exports.isObject=wr;exports.isPlainObject=Ct;exports.isPromise=Ur;exports.isSet=Hr;exports.isString=Br;exports.isSymbol=Vr;exports.onAfterRouteUpdate=li;exports.onBeforeRouteUpdate=oi;exports.onFoxActivated=fn;exports.onFoxInactivated=cn;exports.sessionKey=se;exports.toBoolean=It;exports.toNumber=Jr;exports.toTypeString=tt;exports.typeOf=Et;exports.useBus=ii;exports.useEventProxy=si;exports.useFox=ni;exports.useRoute=ri;exports.useRouter=Qt;
|
package/libs/index.esm.d.ts
CHANGED
|
@@ -27,13 +27,9 @@ declare const beforeFiltersKey: unique symbol;
|
|
|
27
27
|
* before route restore filter(用于刷新还原)
|
|
28
28
|
*/
|
|
29
29
|
declare interface BeforeResotreFilter {
|
|
30
|
-
(route: Route): boolean;
|
|
30
|
+
(route: Route, mark: string): boolean;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
declare const _beforeRestore: unique symbol;
|
|
34
|
-
|
|
35
|
-
declare const beforeRestoreFiltersKey: unique symbol;
|
|
36
|
-
|
|
37
33
|
/**
|
|
38
34
|
* before route update filter
|
|
39
35
|
*/
|
|
@@ -943,6 +939,10 @@ export declare class Route {
|
|
|
943
939
|
* 返回full path
|
|
944
940
|
*/
|
|
945
941
|
get fullPath(): string;
|
|
942
|
+
/**
|
|
943
|
+
* 别名路径(设置了该属性后,url的route mark优先使用别名显示)
|
|
944
|
+
*/
|
|
945
|
+
alias?: string;
|
|
946
946
|
/**
|
|
947
947
|
* 名称
|
|
948
948
|
*/
|
|
@@ -1164,10 +1164,6 @@ export declare class Router {
|
|
|
1164
1164
|
* destroy过滤器队列
|
|
1165
1165
|
*/
|
|
1166
1166
|
private [destroyFiltersKey];
|
|
1167
|
-
/**
|
|
1168
|
-
* before restore 过滤器队列(用于刷新还原)
|
|
1169
|
-
*/
|
|
1170
|
-
private [beforeRestoreFiltersKey];
|
|
1171
1167
|
/**
|
|
1172
1168
|
* 主任务分发器
|
|
1173
1169
|
*/
|
|
@@ -1419,11 +1415,6 @@ export declare class Router {
|
|
|
1419
1415
|
* 创建next函数
|
|
1420
1416
|
*/
|
|
1421
1417
|
private [_createNextFn];
|
|
1422
|
-
/**
|
|
1423
|
-
* 执行before restore事件
|
|
1424
|
-
* @param route
|
|
1425
|
-
*/
|
|
1426
|
-
private [_beforeRestore];
|
|
1427
1418
|
/**
|
|
1428
1419
|
* 开始链路
|
|
1429
1420
|
* @param route
|
|
@@ -1553,6 +1544,17 @@ declare interface RouterHistory {
|
|
|
1553
1544
|
* 销毁
|
|
1554
1545
|
*/
|
|
1555
1546
|
destroy(): void;
|
|
1547
|
+
/**
|
|
1548
|
+
* 添加before restore filter
|
|
1549
|
+
* @param filter
|
|
1550
|
+
*/
|
|
1551
|
+
beforeRestoreEach(filter: BeforeResotreFilter): void;
|
|
1552
|
+
/**
|
|
1553
|
+
* 移除before restore filter
|
|
1554
|
+
* @param filter
|
|
1555
|
+
* @returns
|
|
1556
|
+
*/
|
|
1557
|
+
removeBeforeRestoreEach(filter: BeforeResotreFilter): boolean;
|
|
1556
1558
|
/**
|
|
1557
1559
|
* 监听历史记录改变
|
|
1558
1560
|
* @param handler
|
|
@@ -1845,13 +1847,6 @@ declare const valueKey: unique symbol;
|
|
|
1845
1847
|
* 视图
|
|
1846
1848
|
*/
|
|
1847
1849
|
declare class View {
|
|
1848
|
-
private scope;
|
|
1849
|
-
/**
|
|
1850
|
-
* 设置补偿函数
|
|
1851
|
-
*/
|
|
1852
|
-
set compensation(func: {
|
|
1853
|
-
(): boolean;
|
|
1854
|
-
});
|
|
1855
1850
|
/**
|
|
1856
1851
|
* model slots列表
|
|
1857
1852
|
*/
|