@fox-js/fox 3.1.1-26 → 3.1.1-28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/index.cjs.js +1 -1
- package/libs/index.esm.d.ts +2 -2
- package/libs/index.esm.js +604 -600
- package/libs/index.umd.js +1 -1
- package/package.json +1 -1
package/libs/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as jr, effectScope as fs, getCurrentScope as Kr, h as he, hasInjectionContext as _e, inject as N, onActivated as cs, onDeactivated as hs, onScopeDispose as Fe, provide as te, reactive as ys, readonly as ds, ref as ms, shallowReactive as vs, shallowRef as Lr, toRaw as Ht, watch as ps } from "vue";
|
|
2
2
|
var Ee = typeof window < "u", C = function() {
|
|
3
3
|
return window;
|
|
4
4
|
}, Je = function() {
|
|
@@ -20,22 +20,22 @@ var ze = (e, t, r) => {
|
|
|
20
20
|
let i = !0, n = !0;
|
|
21
21
|
for (let o in t) o === "bubbles" ? i = !!t[o] : o === "cancelable" ? n = !!t[o] : s[o] = t[o];
|
|
22
22
|
s.initEvent(e, i, n), (r ?? document).dispatchEvent(s);
|
|
23
|
-
}, nr = Array.isArray,
|
|
23
|
+
}, nr = Array.isArray, Li = (e) => Zt(e) === "[object Map]", Mi = (e) => Zt(e) === "[object Set]", Ti = (e) => e instanceof Date, w = (e) => typeof e == "function", ki = (e) => typeof e == "string", Ii = (e) => typeof e == "symbol", gs = (e) => e !== null && typeof e == "object", Oi = (e) => gs(e) && w(e.then) && w(e.catch), We = (e) => e == null, bs = Object.prototype.toString, Zt = (e) => bs.call(e), ws = (e) => Zt(e) === "[object Object]", Rs = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
|
|
24
24
|
function Yt(e) {
|
|
25
25
|
return e.__esModule || Rs && e[Symbol.toStringTag] === "Module";
|
|
26
26
|
}
|
|
27
27
|
var xs = typeof Promise < "u" && Promise.toString().indexOf("[native code]") !== -1;
|
|
28
|
-
function
|
|
28
|
+
function j(...e) {
|
|
29
29
|
let t = e[0] !== void 0 && e[0] !== null ? e[0] : {}, r = 1, s = e.length, i = !1;
|
|
30
30
|
for (typeof t == "boolean" && (i = t, t = e[r] ?? {}, r++), typeof t != "object" && (t = {}); r < s; r++) if (e[r] !== null && e[r] !== void 0) {
|
|
31
31
|
let n = e[r];
|
|
32
32
|
for (let o in n) {
|
|
33
|
-
let
|
|
34
|
-
if (
|
|
35
|
-
if (i === !0 &&
|
|
36
|
-
let
|
|
37
|
-
Array.isArray(
|
|
38
|
-
} else
|
|
33
|
+
let l = t[o], a = n[o];
|
|
34
|
+
if (l !== a)
|
|
35
|
+
if (i === !0 && a && typeof a == "object") {
|
|
36
|
+
let u;
|
|
37
|
+
Array.isArray(a) ? u = l && Array.isArray(l) ? l : [] : u = l && typeof l == "object" ? l : {}, t[o] = j(i, u, a);
|
|
38
|
+
} else a !== void 0 && (t[o] = a);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return t;
|
|
@@ -47,7 +47,7 @@ function Mr(e, t, r = !1) {
|
|
|
47
47
|
let i = e[s], n = t[s];
|
|
48
48
|
if (i !== n)
|
|
49
49
|
if (typeof n == "object") {
|
|
50
|
-
if (!Array.isArray(n) && !
|
|
50
|
+
if (!Array.isArray(n) && !ws(n)) continue;
|
|
51
51
|
i = Mr(i, n, r), e[s] = i;
|
|
52
52
|
} else {
|
|
53
53
|
if (typeof n == "function") continue;
|
|
@@ -56,11 +56,11 @@ function Mr(e, t, r = !1) {
|
|
|
56
56
|
}
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
var De = class
|
|
59
|
+
var De = class Nt {
|
|
60
60
|
static seed = (/* @__PURE__ */ new Date()).getTime();
|
|
61
61
|
static get() {
|
|
62
|
-
let t = ++
|
|
63
|
-
return t >= Number.MAX_VALUE && (
|
|
62
|
+
let t = ++Nt.seed;
|
|
63
|
+
return t >= Number.MAX_VALUE && (Nt.seed = 0), t;
|
|
64
64
|
}
|
|
65
65
|
}, gt = xs ? Promise.resolve() : null;
|
|
66
66
|
function He(e, ...t) {
|
|
@@ -73,7 +73,7 @@ function He(e, ...t) {
|
|
|
73
73
|
function Tr(e) {
|
|
74
74
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e.toLocaleLowerCase() === "true" : !!e;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Bi(e) {
|
|
77
77
|
return typeof e == "number" ? e : Number(e);
|
|
78
78
|
}
|
|
79
79
|
var Ss = {
|
|
@@ -99,8 +99,8 @@ function lr(e, t) {
|
|
|
99
99
|
let s = Object.keys(e), i = Object.keys(t);
|
|
100
100
|
if (s.length !== i.length) return !1;
|
|
101
101
|
for (let n = 0; n < s.length; n++) {
|
|
102
|
-
let o = s[n],
|
|
103
|
-
if (!lr(
|
|
102
|
+
let o = s[n], l = e[o], a = t[o];
|
|
103
|
+
if (!lr(l, a)) return !1;
|
|
104
104
|
}
|
|
105
105
|
return !0;
|
|
106
106
|
} else if (r === "array") {
|
|
@@ -218,8 +218,8 @@ var _s = class {
|
|
|
218
218
|
const i = JSON.parse(s);
|
|
219
219
|
Object.assign(this.state, i), Reflect.ownKeys(this.state).forEach((n) => {
|
|
220
220
|
if (typeof n != "string") return;
|
|
221
|
-
const o = this.state[n],
|
|
222
|
-
|
|
221
|
+
const o = this.state[n], l = n.split(/\//g);
|
|
222
|
+
l.push(o), Reflect.apply(e.put, e, l);
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
}
|
|
@@ -388,52 +388,52 @@ var fr = new Proxy(Dr, { construct(e, t) {
|
|
|
388
388
|
function Nr(e, t, r) {
|
|
389
389
|
const s = new Hr(r);
|
|
390
390
|
s.restore(t);
|
|
391
|
-
const i = (
|
|
392
|
-
const
|
|
393
|
-
for (let f in
|
|
394
|
-
const c =
|
|
395
|
-
We(c) || (
|
|
391
|
+
const i = (l) => {
|
|
392
|
+
const a = Ht(l), u = {};
|
|
393
|
+
for (let f in a) {
|
|
394
|
+
const c = a[f];
|
|
395
|
+
We(c) || (u[f] = c);
|
|
396
396
|
}
|
|
397
|
-
rr(
|
|
397
|
+
rr(u) ? s.removeState() : s.saveState(u);
|
|
398
398
|
};
|
|
399
399
|
let n = null;
|
|
400
400
|
r && r.debounce === !1 ? n = i : n = Or(i, r && r.debounceDelay ? r.debounceDelay : 250);
|
|
401
401
|
const o = e ? vs(t) : ys(t);
|
|
402
402
|
return fs(!0).run(() => {
|
|
403
|
-
ps(o, (
|
|
404
|
-
const
|
|
405
|
-
n(
|
|
403
|
+
ps(o, (l) => {
|
|
404
|
+
const a = Ht(l);
|
|
405
|
+
n(a);
|
|
406
406
|
});
|
|
407
407
|
}), o;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function Di(e, t) {
|
|
410
410
|
return Nr(!1, e, t);
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Hi(e, t) {
|
|
413
413
|
return Nr(!0, e, t);
|
|
414
414
|
}
|
|
415
415
|
function qs(e, t) {
|
|
416
416
|
const r = new Hr(t);
|
|
417
417
|
r.restore(e);
|
|
418
418
|
const s = (n) => {
|
|
419
|
-
const o =
|
|
420
|
-
for (let
|
|
421
|
-
const
|
|
422
|
-
We(
|
|
419
|
+
const o = Ht(n), l = {};
|
|
420
|
+
for (let a in o) {
|
|
421
|
+
const u = o[a];
|
|
422
|
+
We(u) || (l[a] = u);
|
|
423
423
|
}
|
|
424
|
-
rr(
|
|
424
|
+
rr(l) ? r.removeState() : r.saveState(l);
|
|
425
425
|
};
|
|
426
426
|
let i = null;
|
|
427
427
|
return t && t.debounce === !1 ? i = s : i = Or(s, t && t.debounceDelay ? t.debounceDelay : 250), new Proxy(e, {
|
|
428
428
|
get(n, o) {
|
|
429
429
|
return n[o];
|
|
430
430
|
},
|
|
431
|
-
set(n, o,
|
|
432
|
-
return n[o] =
|
|
431
|
+
set(n, o, l) {
|
|
432
|
+
return n[o] = l, i(n), !0;
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function Ni(e, t) {
|
|
437
437
|
return qs(e, t);
|
|
438
438
|
}
|
|
439
439
|
var de = /* @__PURE__ */ (function(e) {
|
|
@@ -443,13 +443,13 @@ var de = /* @__PURE__ */ (function(e) {
|
|
|
443
443
|
})(P || {}), $s = {
|
|
444
444
|
type: de.Static,
|
|
445
445
|
value: ""
|
|
446
|
-
},
|
|
447
|
-
function
|
|
446
|
+
}, js = /[a-zA-Z0-9_]/;
|
|
447
|
+
function Ks(e) {
|
|
448
448
|
if (!e) return [[]];
|
|
449
449
|
if (e === "/") return [[$s]];
|
|
450
450
|
if (!e.startsWith("/")) throw new Error(`Invalid path "${e}"`);
|
|
451
451
|
function t(y) {
|
|
452
|
-
throw new Error(`ERR (${r})/"${
|
|
452
|
+
throw new Error(`ERR (${r})/"${u}": ${y}`);
|
|
453
453
|
}
|
|
454
454
|
let r = P.Static, s = r;
|
|
455
455
|
const i = [];
|
|
@@ -457,49 +457,49 @@ function js(e) {
|
|
|
457
457
|
function o() {
|
|
458
458
|
n && i.push(n), n = [];
|
|
459
459
|
}
|
|
460
|
-
let
|
|
460
|
+
let l = 0, a, u = "", f = "";
|
|
461
461
|
function c() {
|
|
462
|
-
|
|
462
|
+
u && (r === P.Static ? n.push({
|
|
463
463
|
type: de.Static,
|
|
464
|
-
value:
|
|
465
|
-
}) : r === P.Param || r === P.ParamRegExp || r === P.ParamRegExpEnd ? (n.length > 1 && (
|
|
464
|
+
value: u
|
|
465
|
+
}) : r === P.Param || r === P.ParamRegExp || r === P.ParamRegExpEnd ? (n.length > 1 && (a === "*" || a === "+") && t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`), n.push({
|
|
466
466
|
type: de.Param,
|
|
467
|
-
value:
|
|
467
|
+
value: u,
|
|
468
468
|
regexp: f,
|
|
469
|
-
repeatable:
|
|
470
|
-
optional:
|
|
471
|
-
})) : t("Invalid state to consume buffer"),
|
|
469
|
+
repeatable: a === "*" || a === "+",
|
|
470
|
+
optional: a === "*" || a === "?"
|
|
471
|
+
})) : t("Invalid state to consume buffer"), u = "");
|
|
472
472
|
}
|
|
473
473
|
function h() {
|
|
474
|
-
|
|
474
|
+
u += a;
|
|
475
475
|
}
|
|
476
|
-
for (;
|
|
477
|
-
if (
|
|
476
|
+
for (; l < e.length; ) {
|
|
477
|
+
if (a = e[l++], a === "\\" && r !== P.ParamRegExp) {
|
|
478
478
|
s = r, r = P.EscapeNext;
|
|
479
479
|
continue;
|
|
480
480
|
}
|
|
481
481
|
switch (r) {
|
|
482
482
|
case P.Static:
|
|
483
|
-
|
|
483
|
+
a === "/" ? (u && c(), o()) : a === ":" ? (c(), r = P.Param) : h();
|
|
484
484
|
break;
|
|
485
485
|
case P.EscapeNext:
|
|
486
486
|
h(), r = s;
|
|
487
487
|
break;
|
|
488
488
|
case P.Param:
|
|
489
|
-
|
|
489
|
+
a === "(" ? r = P.ParamRegExp : js.test(a) ? h() : (c(), r = P.Static, a !== "*" && a !== "?" && a !== "+" && l--);
|
|
490
490
|
break;
|
|
491
491
|
case P.ParamRegExp:
|
|
492
|
-
|
|
492
|
+
a === ")" ? f[f.length - 1] == "\\" ? f = f.slice(0, -1) + a : r = P.ParamRegExpEnd : f += a;
|
|
493
493
|
break;
|
|
494
494
|
case P.ParamRegExpEnd:
|
|
495
|
-
c(), r = P.Static,
|
|
495
|
+
c(), r = P.Static, a !== "*" && a !== "?" && a !== "+" && l--, f = "";
|
|
496
496
|
break;
|
|
497
497
|
default:
|
|
498
498
|
t("Unknown state");
|
|
499
499
|
break;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
return r === P.ParamRegExp && t(`Unfinished custom RegExp for param "${
|
|
502
|
+
return r === P.ParamRegExp && t(`Unfinished custom RegExp for param "${u}"`), c(), o(), i;
|
|
503
503
|
}
|
|
504
504
|
var cr = "[^/]+?", Ls = {
|
|
505
505
|
sensitive: !1,
|
|
@@ -510,23 +510,23 @@ var cr = "[^/]+?", Ls = {
|
|
|
510
510
|
return e[e._multiplier = 10] = "_multiplier", e[e.Root = 9 * e._multiplier] = "Root", e[e.Segment = 4 * e._multiplier] = "Segment", e[e.SubSegment = 3 * e._multiplier] = "SubSegment", e[e.Static = 4 * e._multiplier] = "Static", e[e.Dynamic = 2 * e._multiplier] = "Dynamic", e[e.BonusCustomRegExp = 1 * e._multiplier] = "BonusCustomRegExp", e[e.BonusWildcard = -4 * e._multiplier - e.BonusCustomRegExp] = "BonusWildcard", e[e.BonusRepeatable = -2 * e._multiplier] = "BonusRepeatable", e[e.BonusOptional = -0.8 * e._multiplier] = "BonusOptional", e[e.BonusStrict = 0.07 * e._multiplier] = "BonusStrict", e[e.BonusCaseSensitive = 0.025 * e._multiplier] = "BonusCaseSensitive", e;
|
|
511
511
|
})(J || {}), Ms = /[.+*?^${}()[\]/\\]/g;
|
|
512
512
|
function Ts(e, t) {
|
|
513
|
-
const r =
|
|
513
|
+
const r = j(!0, {}, Ls, t), s = [];
|
|
514
514
|
let i = r.start ? "^" : "";
|
|
515
515
|
const n = [];
|
|
516
|
-
for (const
|
|
517
|
-
const f =
|
|
518
|
-
r.strict && !
|
|
519
|
-
for (let c = 0; c <
|
|
520
|
-
const h =
|
|
516
|
+
for (const u of e) {
|
|
517
|
+
const f = u.length ? [] : [J.Root];
|
|
518
|
+
r.strict && !u.length && (i += "/");
|
|
519
|
+
for (let c = 0; c < u.length; c++) {
|
|
520
|
+
const h = u[c];
|
|
521
521
|
let y = J.Segment + (r.sensitive ? J.BonusCaseSensitive : 0);
|
|
522
522
|
if (h.type === de.Static)
|
|
523
523
|
c || (i += "/"), i += h.value.replace(Ms, "\\$&"), y += J.Static;
|
|
524
524
|
else if (h.type === de.Param) {
|
|
525
|
-
const { value: d, repeatable: m, optional:
|
|
525
|
+
const { value: d, repeatable: m, optional: b, regexp: g } = h;
|
|
526
526
|
n.push({
|
|
527
527
|
name: d,
|
|
528
528
|
repeatable: m,
|
|
529
|
-
optional:
|
|
529
|
+
optional: b
|
|
530
530
|
});
|
|
531
531
|
const v = g || cr;
|
|
532
532
|
if (v !== cr) {
|
|
@@ -537,21 +537,21 @@ function Ts(e, t) {
|
|
|
537
537
|
throw new Error(`Invalid custom RegExp for param "${d}" (${v}): ` + L.message);
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
let
|
|
541
|
-
c || (
|
|
540
|
+
let K = m ? `((?:${v})(?:/(?:${v}))*)` : `(${v})`;
|
|
541
|
+
c || (K = b && u.length < 2 ? `(?:/${K})` : "/" + K), b && (K += "?"), i += K, y += J.Dynamic, b && (y += J.BonusOptional), m && (y += J.BonusRepeatable), v === ".*" && (y += J.BonusWildcard);
|
|
542
542
|
}
|
|
543
543
|
f.push(y);
|
|
544
544
|
}
|
|
545
545
|
s.push(f);
|
|
546
546
|
}
|
|
547
547
|
if (r.strict && r.end) {
|
|
548
|
-
const
|
|
549
|
-
s[
|
|
548
|
+
const u = s.length - 1;
|
|
549
|
+
s[u][s[u].length - 1] += J.BonusStrict;
|
|
550
550
|
}
|
|
551
551
|
r.strict || (i += "/?"), r.end ? i += "$" : r.strict && !i.endsWith("/") && (i += "(?:/|$)");
|
|
552
552
|
const o = new RegExp(i, r.sensitive ? "" : "i");
|
|
553
|
-
function u
|
|
554
|
-
const f =
|
|
553
|
+
function l(u) {
|
|
554
|
+
const f = u.match(o), c = {};
|
|
555
555
|
if (!f) return null;
|
|
556
556
|
for (let h = 1; h < f.length; h++) {
|
|
557
557
|
const y = f[h] || "", d = n[h - 1];
|
|
@@ -559,16 +559,16 @@ function Ts(e, t) {
|
|
|
559
559
|
}
|
|
560
560
|
return c;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function a(u) {
|
|
563
563
|
let f = "", c = !1;
|
|
564
564
|
for (const h of e) {
|
|
565
565
|
(!c || !f.endsWith("/")) && (f += "/"), c = !1;
|
|
566
566
|
for (const y of h) if (y.type === de.Static) f += y.value;
|
|
567
567
|
else if (y.type === de.Param) {
|
|
568
|
-
const { value: d, repeatable: m, optional:
|
|
568
|
+
const { value: d, repeatable: m, optional: b } = y, g = d in u ? u[d] : "";
|
|
569
569
|
if (nr(g) && !m) throw new Error(`Provided param "${d}" is an array but it is not repeatable (* or + modifiers)`);
|
|
570
570
|
const v = nr(g) ? g.join("/") : g;
|
|
571
|
-
if (!v) if (
|
|
571
|
+
if (!v) if (b)
|
|
572
572
|
h.length < 2 && (f.endsWith("/") ? f = f.slice(0, -1) : c = !0);
|
|
573
573
|
else throw new Error(`Missing required param "${d}"`);
|
|
574
574
|
f += v;
|
|
@@ -580,12 +580,12 @@ function Ts(e, t) {
|
|
|
580
580
|
re: o,
|
|
581
581
|
score: s,
|
|
582
582
|
keys: n,
|
|
583
|
-
parse:
|
|
584
|
-
stringify:
|
|
583
|
+
parse: l,
|
|
584
|
+
stringify: a
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
function ks(e, t) {
|
|
588
|
-
const r = Ts(
|
|
588
|
+
const r = Ts(Ks(e), t);
|
|
589
589
|
return function(s) {
|
|
590
590
|
const i = r.parse(s);
|
|
591
591
|
return i ? {
|
|
@@ -605,21 +605,21 @@ function hr(e) {
|
|
|
605
605
|
function Is(e) {
|
|
606
606
|
let t = e.src;
|
|
607
607
|
return new Promise((r, s) => {
|
|
608
|
-
const i = hr((
|
|
609
|
-
Yt(
|
|
610
|
-
}), n = hr((
|
|
611
|
-
`${
|
|
608
|
+
const i = hr((l) => {
|
|
609
|
+
Yt(l) && (l = l.default), e.component = l, console.debug("success load async module"), r();
|
|
610
|
+
}), n = hr((l) => {
|
|
611
|
+
`${l}`, console.debug("reject load async module"), s(l);
|
|
612
612
|
});
|
|
613
613
|
let o;
|
|
614
614
|
try {
|
|
615
615
|
o = t(i, n);
|
|
616
|
-
} catch (
|
|
617
|
-
n(
|
|
616
|
+
} catch (l) {
|
|
617
|
+
n(l);
|
|
618
618
|
}
|
|
619
619
|
if (o) if (typeof o.then == "function") o.then(i, n);
|
|
620
620
|
else {
|
|
621
|
-
const
|
|
622
|
-
|
|
621
|
+
const l = o.component;
|
|
622
|
+
l && typeof l.then == "function" && l.then(i, n);
|
|
623
623
|
}
|
|
624
624
|
});
|
|
625
625
|
}
|
|
@@ -641,12 +641,12 @@ var Os = class {
|
|
|
641
641
|
}
|
|
642
642
|
static from(t) {
|
|
643
643
|
const r = new Wr(t.to, t.from), s = t.data ?? {};
|
|
644
|
-
return
|
|
644
|
+
return j(!0, r.data, s), r;
|
|
645
645
|
}
|
|
646
646
|
static clear(t) {
|
|
647
647
|
for (let r in t) t[r] = void 0;
|
|
648
648
|
}
|
|
649
|
-
},
|
|
649
|
+
}, x = class Ut {
|
|
650
650
|
path;
|
|
651
651
|
get fullPath() {
|
|
652
652
|
const t = this.path ?? `${this.name}`;
|
|
@@ -672,7 +672,7 @@ var Os = class {
|
|
|
672
672
|
active;
|
|
673
673
|
slot;
|
|
674
674
|
static clone(t, r) {
|
|
675
|
-
let s = new
|
|
675
|
+
let s = new Ut();
|
|
676
676
|
return Mr(s, t, r), s;
|
|
677
677
|
}
|
|
678
678
|
static isSame(t, r) {
|
|
@@ -682,7 +682,7 @@ var Os = class {
|
|
|
682
682
|
return !t || !r ? !1 : t === r || t.path && r.path && t.path === r.path ? !0 : !!(t.name && r.name && t.name === r.name);
|
|
683
683
|
}
|
|
684
684
|
static from(t) {
|
|
685
|
-
let r = new
|
|
685
|
+
let r = new Ut();
|
|
686
686
|
if (t == null) return r;
|
|
687
687
|
let s = r;
|
|
688
688
|
for (let n in t) s[n] = t[n];
|
|
@@ -707,7 +707,7 @@ var Os = class {
|
|
|
707
707
|
}
|
|
708
708
|
}, yr = class {
|
|
709
709
|
models = [];
|
|
710
|
-
},
|
|
710
|
+
}, bt = class {
|
|
711
711
|
path;
|
|
712
712
|
match;
|
|
713
713
|
redirect;
|
|
@@ -717,7 +717,7 @@ var Os = class {
|
|
|
717
717
|
layers = [];
|
|
718
718
|
}, F = /* @__PURE__ */ (function(e) {
|
|
719
719
|
return e[e.Push = 0] = "Push", e[e.Replace = 1] = "Replace", e[e.Put = 2] = "Put", e[e.Append = 3] = "Append", e[e.Open = 4] = "Open", e;
|
|
720
|
-
})({}),
|
|
720
|
+
})({}), wt = /* @__PURE__ */ (function(e) {
|
|
721
721
|
return e[e.Part = 0] = "Part", e[e.All = 1] = "All", e;
|
|
722
722
|
})({}), G = /* @__PURE__ */ Symbol("rootKey"), z = /* @__PURE__ */ Symbol("rootNodeKey"), ye = /* @__PURE__ */ Symbol("parentNodeKey"), at = /* @__PURE__ */ Symbol("nameKey"), re = class {
|
|
723
723
|
model;
|
|
@@ -831,17 +831,17 @@ var Os = class {
|
|
|
831
831
|
let i = this[k] + 1;
|
|
832
832
|
try {
|
|
833
833
|
let n = !1, o = {
|
|
834
|
-
go: (
|
|
835
|
-
n || (n = !0, Reflect.apply(this[Y], this, [
|
|
834
|
+
go: (l, ...a) => {
|
|
835
|
+
n || (n = !0, Reflect.apply(this[Y], this, [l, ...a]));
|
|
836
836
|
},
|
|
837
|
-
resolve: (...
|
|
838
|
-
n || (n = !0, Reflect.apply(this[Y], this, [1, ...
|
|
837
|
+
resolve: (...l) => {
|
|
838
|
+
n || (n = !0, Reflect.apply(this[Y], this, [1, ...l]));
|
|
839
839
|
},
|
|
840
|
-
reject: (...
|
|
841
|
-
n || (n = !0, Reflect.apply(this.reject, this, [...
|
|
840
|
+
reject: (...l) => {
|
|
841
|
+
n || (n = !0, Reflect.apply(this.reject, this, [...l]));
|
|
842
842
|
},
|
|
843
|
-
insert: (
|
|
844
|
-
n || (this[B].splice(i, 0,
|
|
843
|
+
insert: (l) => {
|
|
844
|
+
n || (this[B].splice(i, 0, l), i++);
|
|
845
845
|
},
|
|
846
846
|
session: this[le]
|
|
847
847
|
};
|
|
@@ -888,21 +888,21 @@ var Os = class {
|
|
|
888
888
|
isFinish() {
|
|
889
889
|
return this[_] == E.Reject || this[_] == E.Free && this[k] >= this[B].length;
|
|
890
890
|
}
|
|
891
|
-
}, xe = /* @__PURE__ */ Symbol("_notifyChange"),
|
|
891
|
+
}, xe = /* @__PURE__ */ Symbol("_notifyChange"), St = class {
|
|
892
892
|
currentRoute;
|
|
893
893
|
routes;
|
|
894
894
|
constructor(e, t) {
|
|
895
895
|
this.currentRoute = e, this.routes = t;
|
|
896
896
|
}
|
|
897
|
-
}, ae = /* @__PURE__ */ Symbol("historyChangeConsumerKey"),
|
|
898
|
-
function
|
|
897
|
+
}, ae = /* @__PURE__ */ Symbol("historyChangeConsumerKey"), dr = /* @__PURE__ */ Symbol("_navigateFirstRoute"), Qe = /* @__PURE__ */ Symbol("_getRouteMark"), Et = /* @__PURE__ */ Symbol("_getUrlSearch"), Pt = /* @__PURE__ */ Symbol("_generateLocation"), Ze = /* @__PURE__ */ Symbol("_setRouteMarkRecorder"), je = /* @__PURE__ */ Symbol("beforeRestoreFiltersKey"), mr = /* @__PURE__ */ Symbol("_beforeRestore"), vr = "Symbol(_fox_restore_point)";
|
|
898
|
+
function Ye(e, ...t) {
|
|
899
899
|
return typeof e == "function" ? Reflect.apply(e, null, [...t]) : e;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function pr(e) {
|
|
902
902
|
if (!Array.isArray(e)) return !1;
|
|
903
903
|
if (e.length === 0) return !0;
|
|
904
904
|
const t = e[0];
|
|
905
|
-
return !!(Reflect.has(t, "path") && Reflect.has(t, "root"));
|
|
905
|
+
return !!((Reflect.has(t, "path") || Reflect.has(t, "name")) && Reflect.has(t, "root"));
|
|
906
906
|
}
|
|
907
907
|
var Jr = class {
|
|
908
908
|
base;
|
|
@@ -915,10 +915,10 @@ var Jr = class {
|
|
|
915
915
|
changeHandler;
|
|
916
916
|
historyChange;
|
|
917
917
|
[ae] = !1;
|
|
918
|
-
[
|
|
918
|
+
[je] = new Array();
|
|
919
919
|
backTimeout = 320;
|
|
920
|
-
constructor(e = "hash", t = "", r = "", s = !0, i = !0, n = !1, o,
|
|
921
|
-
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ?? C().sessionStorage, this.backTimeout =
|
|
920
|
+
constructor(e = "hash", t = "", r = "", s = !0, i = !0, n = !1, o, l) {
|
|
921
|
+
this.mode = e, this.base = t, this.query = r, this.firstNavigate = s, this.historyMonitor = i, this.traceless = n, this.storage = o ?? C().sessionStorage, this.backTimeout = l ?? 320;
|
|
922
922
|
}
|
|
923
923
|
init(e = !0) {
|
|
924
924
|
const t = C();
|
|
@@ -930,7 +930,7 @@ var Jr = class {
|
|
|
930
930
|
this[ae] = !1;
|
|
931
931
|
return;
|
|
932
932
|
}
|
|
933
|
-
if (
|
|
933
|
+
if (Ye(this.historyMonitor)) {
|
|
934
934
|
const r = t.history.state;
|
|
935
935
|
this[xe](r);
|
|
936
936
|
try {
|
|
@@ -942,13 +942,13 @@ var Jr = class {
|
|
|
942
942
|
} catch {
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
}), ft(t, "popstate", this.historyChange), this.firstNavigate && e && this[
|
|
945
|
+
}), ft(t, "popstate", this.historyChange), this.firstNavigate && e && this[dr](), Promise.resolve();
|
|
946
946
|
}
|
|
947
947
|
destroy() {
|
|
948
948
|
this.historyChange && Qt(C(), "popstate", this.historyChange);
|
|
949
949
|
}
|
|
950
|
-
[
|
|
951
|
-
for (let i of this[
|
|
950
|
+
[mr](e, t, r, s) {
|
|
951
|
+
for (let i of this[je]) try {
|
|
952
952
|
const n = Reflect.apply(i, {}, [
|
|
953
953
|
e,
|
|
954
954
|
t,
|
|
@@ -962,21 +962,21 @@ var Jr = class {
|
|
|
962
962
|
return !0;
|
|
963
963
|
}
|
|
964
964
|
beforeRestoreEach(e) {
|
|
965
|
-
this[
|
|
965
|
+
this[je].push(e);
|
|
966
966
|
}
|
|
967
967
|
removeBeforeRestoreEach(e) {
|
|
968
|
-
const t = this[
|
|
969
|
-
return t !== -1 ? (this[
|
|
968
|
+
const t = this[je].indexOf(e);
|
|
969
|
+
return t !== -1 ? (this[je].splice(t, 1), !0) : !1;
|
|
970
970
|
}
|
|
971
|
-
[
|
|
972
|
-
const e = this[Qe]() ?? "/", t = this.storage.getItem(
|
|
971
|
+
[dr]() {
|
|
972
|
+
const e = this[Qe]() ?? "/", t = this.storage.getItem(vr);
|
|
973
973
|
if (t) try {
|
|
974
974
|
const n = JSON.parse(t);
|
|
975
975
|
if (n.mark === e && Array.isArray(n.routes) && n.routes.length > 0) {
|
|
976
|
-
const o = n.routes.filter((
|
|
976
|
+
const o = n.routes.filter((l, a) => (l.params = l.params ? Ir(l.params) : {}, this[mr](l, a, e, n.routes)));
|
|
977
977
|
if (o.length > 0) {
|
|
978
|
-
const
|
|
979
|
-
o[
|
|
978
|
+
const l = this[Et](), a = o.length - 1;
|
|
979
|
+
o[a].query = l || o[a].query, this[xe](o);
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
982
982
|
}
|
|
@@ -985,8 +985,8 @@ var Jr = class {
|
|
|
985
985
|
const r = e.indexOf("!");
|
|
986
986
|
let s;
|
|
987
987
|
r != -1 ? s = e.substring(r + 1) : s = e;
|
|
988
|
-
const i = new
|
|
989
|
-
i.path = s, i.query = this[
|
|
988
|
+
const i = new x();
|
|
989
|
+
i.path = s, i.query = this[Et](), this[xe]([i]);
|
|
990
990
|
}
|
|
991
991
|
[Ze](e, t) {
|
|
992
992
|
try {
|
|
@@ -997,7 +997,7 @@ var Jr = class {
|
|
|
997
997
|
mark: e,
|
|
998
998
|
routes: t
|
|
999
999
|
});
|
|
1000
|
-
this.storage.setItem(
|
|
1000
|
+
this.storage.setItem(vr, r);
|
|
1001
1001
|
} catch (r) {
|
|
1002
1002
|
console.error(r.message, r);
|
|
1003
1003
|
}
|
|
@@ -1020,7 +1020,7 @@ var Jr = class {
|
|
|
1020
1020
|
}
|
|
1021
1021
|
return null;
|
|
1022
1022
|
}
|
|
1023
|
-
[
|
|
1023
|
+
[Et]() {
|
|
1024
1024
|
let e = C().location.search;
|
|
1025
1025
|
return e.length > 0 && e.indexOf("?") === 0 && (e = e.substring(1)), e;
|
|
1026
1026
|
}
|
|
@@ -1033,11 +1033,11 @@ var Jr = class {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
goBack(e, t) {
|
|
1035
1035
|
const r = C(), s = r.history.state;
|
|
1036
|
-
if (
|
|
1036
|
+
if (pr(s) && s.length > 0) {
|
|
1037
1037
|
let i = !1;
|
|
1038
|
-
for (let
|
|
1039
|
-
const f =
|
|
1040
|
-
if (
|
|
1038
|
+
for (let u = s.length - 1; u >= 0; u--) {
|
|
1039
|
+
const f = x.from(s[u]);
|
|
1040
|
+
if (x.isSame(f, e)) {
|
|
1041
1041
|
i = !0;
|
|
1042
1042
|
break;
|
|
1043
1043
|
}
|
|
@@ -1048,33 +1048,33 @@ var Jr = class {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
const n = this.backTimeout;
|
|
1050
1050
|
let o = null;
|
|
1051
|
-
const
|
|
1052
|
-
r.history.go(-1), o = setTimeout(
|
|
1053
|
-
},
|
|
1051
|
+
const l = () => {
|
|
1052
|
+
r.history.go(-1), o = setTimeout(l, n);
|
|
1053
|
+
}, a = () => {
|
|
1054
1054
|
clearTimeout(o);
|
|
1055
|
-
const
|
|
1056
|
-
if (
|
|
1057
|
-
let f =
|
|
1058
|
-
const c =
|
|
1059
|
-
if (
|
|
1055
|
+
const u = C().history.state;
|
|
1056
|
+
if (pr(u) && u.length > 0) {
|
|
1057
|
+
let f = u.length;
|
|
1058
|
+
const c = u[f - 1], h = x.from(c);
|
|
1059
|
+
if (x.isSame(h, e))
|
|
1060
1060
|
return t(), !0;
|
|
1061
1061
|
if (f > 0) {
|
|
1062
1062
|
let y = !1;
|
|
1063
1063
|
for (let d = f - 1; d >= 0; d--) {
|
|
1064
|
-
const m =
|
|
1065
|
-
if (!(m.traceless === !0 ||
|
|
1064
|
+
const m = x.from(u[d]);
|
|
1065
|
+
if (!(m.traceless === !0 || Ye(this.traceless, m)) && x.isSame(m, e)) {
|
|
1066
1066
|
y = !0;
|
|
1067
1067
|
break;
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
1070
|
return y ? (setTimeout(() => {
|
|
1071
|
-
o = setTimeout(
|
|
1071
|
+
o = setTimeout(l, n), this.go(-1, a);
|
|
1072
1072
|
}, 0), !0) : (t(), !0);
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
1075
|
return t(), !0;
|
|
1076
1076
|
};
|
|
1077
|
-
o = setTimeout(
|
|
1077
|
+
o = setTimeout(l, n), this.go(-1, a);
|
|
1078
1078
|
} else t();
|
|
1079
1079
|
}
|
|
1080
1080
|
setRouteMark(e) {
|
|
@@ -1082,21 +1082,21 @@ var Jr = class {
|
|
|
1082
1082
|
this[Ze](t, e.routes);
|
|
1083
1083
|
}
|
|
1084
1084
|
push(e) {
|
|
1085
|
-
const t = this[
|
|
1086
|
-
e.currentRoute.historyUpdatePolicy !== "traceless" && !
|
|
1085
|
+
const t = this[Pt](e.currentRoute);
|
|
1086
|
+
e.currentRoute.historyUpdatePolicy !== "traceless" && !Ye(this.traceless, e.currentRoute) && C().history.pushState(e.routes, "", t), this.setRouteMark(e);
|
|
1087
1087
|
}
|
|
1088
1088
|
replace(e) {
|
|
1089
|
-
const t = this[
|
|
1090
|
-
(e.currentRoute.historyUpdatePolicy !== "traceless" || !
|
|
1089
|
+
const t = this[Pt](e.currentRoute);
|
|
1090
|
+
(e.currentRoute.historyUpdatePolicy !== "traceless" || !Ye(this.traceless, e.currentRoute)) && C().history.replaceState(e.routes, "", t), this.setRouteMark(e);
|
|
1091
1091
|
}
|
|
1092
|
-
[
|
|
1092
|
+
[Pt](e) {
|
|
1093
1093
|
const t = C();
|
|
1094
1094
|
let r = "";
|
|
1095
1095
|
if (e.query) {
|
|
1096
1096
|
let o = "";
|
|
1097
|
-
if (typeof e.query == "object") for (let
|
|
1098
|
-
let
|
|
1099
|
-
o.length > 0 && (o += "&"), o +=
|
|
1097
|
+
if (typeof e.query == "object") for (let l of Reflect.ownKeys(e.query)) {
|
|
1098
|
+
let a = encodeURIComponent(e.query[l]), u = `${encodeURIComponent(String(l))}=${a}`;
|
|
1099
|
+
o.length > 0 && (o += "&"), o += u;
|
|
1100
1100
|
}
|
|
1101
1101
|
else o = e.query;
|
|
1102
1102
|
this.query ? (r = o.length > 0 ? `${this.query}&${o}` : this.query, r.length > 0 && r.charAt(0) !== "?" && (r = `?${r}`)) : o.length > 0 && (r = `?${o}`);
|
|
@@ -1108,7 +1108,7 @@ var Jr = class {
|
|
|
1108
1108
|
return r ? this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}${r}` : n = `${this.base}/${i}${r}` : n = `${s.pathname}${r}#${i}` : this.mode == "path" ? i.indexOf("/") === 0 ? n = `${this.base}${i}` : n = `${this.base}/${i}` : n = `${s.pathname}#${i}`, `${s.origin}${n}`;
|
|
1109
1109
|
}
|
|
1110
1110
|
};
|
|
1111
|
-
function
|
|
1111
|
+
function Ui(e = !0, t = null, r = "", s = !0, i = !1, n) {
|
|
1112
1112
|
return t !== null && (t = C().location.pathname), t && t.endsWith("/") && (t = t.substring(0, t.length - 1)), new Jr("path", t ?? "", r, e, s, i, n);
|
|
1113
1113
|
}
|
|
1114
1114
|
function Us(e = !0, t = "", r = !0, s = !1, i) {
|
|
@@ -1160,7 +1160,7 @@ var Vs = class {
|
|
|
1160
1160
|
if (e === null) r = this.cursor + 1;
|
|
1161
1161
|
else for (let s = this.cursor; s >= 0; s--) {
|
|
1162
1162
|
const i = this.queue[s];
|
|
1163
|
-
if (
|
|
1163
|
+
if (x.isSame(i.currentRoute, e)) break;
|
|
1164
1164
|
r++;
|
|
1165
1165
|
}
|
|
1166
1166
|
if (r === 0) {
|
|
@@ -1184,44 +1184,44 @@ var Vs = class {
|
|
|
1184
1184
|
function Ws(e = "", t = 50) {
|
|
1185
1185
|
return new Vs(e, t);
|
|
1186
1186
|
}
|
|
1187
|
-
var
|
|
1187
|
+
var et = /* @__PURE__ */ Symbol("_constructRouteModel"), tt = /* @__PURE__ */ Symbol("_findRouteModel"), _t = /* @__PURE__ */ Symbol("_findRootView"), Js = /* @__PURE__ */ Symbol("_getFirstView"), ue = /* @__PURE__ */ Symbol("_removeView"), gr = /* @__PURE__ */ Symbol("_buildPage"), br = /* @__PURE__ */ Symbol("_resolveComponent"), wr = /* @__PURE__ */ Symbol("_update"), se = /* @__PURE__ */ Symbol("_merge"), Ft = /* @__PURE__ */ Symbol("_handleHistoryChange"), fe = /* @__PURE__ */ Symbol("_handleRouteUpdated"), rt = /* @__PURE__ */ Symbol("routeUpdatedCallback"), Ct = /* @__PURE__ */ Symbol("currentRoute"), p = /* @__PURE__ */ Symbol("currentRoutes"), st = /* @__PURE__ */ Symbol("routeSessionCacheKey"), Rr = /* @__PURE__ */ Symbol("_addRouteRecorder"), Ke = /* @__PURE__ */ Symbol("_removeRouteRecorder"), Le = /* @__PURE__ */ Symbol("_cloneRouteRecorder"), $ = /* @__PURE__ */ Symbol("_handleError"), it = /* @__PURE__ */ Symbol("errorCallback"), D = /* @__PURE__ */ Symbol("registerKey"), nt = /* @__PURE__ */ Symbol("notFoundKey"), At = /* @__PURE__ */ Symbol("notFoundPathKey"), W = /* @__PURE__ */ Symbol("forestKey"), S = /* @__PURE__ */ Symbol("historyKey"), Me = /* @__PURE__ */ Symbol("beforeFiltersKey"), Te = /* @__PURE__ */ Symbol("afterFiltersKey"), ke = /* @__PURE__ */ Symbol("destroyFiltersKey"), qt = /* @__PURE__ */ Symbol("propsFilterKey"), ge = /* @__PURE__ */ Symbol("mainDispatcherKey"), $t = /* @__PURE__ */ Symbol("initKey"), ce = /* @__PURE__ */ Symbol("readyKey"), jt = /* @__PURE__ */ Symbol("readyHandlersKey"), ot = /* @__PURE__ */ Symbol("_markReady"), xr = /* @__PURE__ */ Symbol("_createNextFn"), Kt = /* @__PURE__ */ Symbol("_start"), Lt = /* @__PURE__ */ Symbol("_before"), Mt = /* @__PURE__ */ Symbol("_after"), Sr = /* @__PURE__ */ Symbol("_destroy"), Tt = /* @__PURE__ */ Symbol("_load"), Ie = /* @__PURE__ */ Symbol("_unload"), Oe = /* @__PURE__ */ Symbol("routerGuardKey");
|
|
1188
1188
|
function zs(e) {
|
|
1189
1189
|
return e.layers.length == 0 || e.layers[0].views.length == 0;
|
|
1190
1190
|
}
|
|
1191
1191
|
var Gs = class {
|
|
1192
1192
|
[D] = new Array();
|
|
1193
1193
|
[nt];
|
|
1194
|
-
[
|
|
1194
|
+
[At] = "*";
|
|
1195
1195
|
[ce] = !1;
|
|
1196
|
-
[
|
|
1196
|
+
[jt] = [];
|
|
1197
1197
|
[W] = new Ds();
|
|
1198
|
-
[
|
|
1198
|
+
[S];
|
|
1199
1199
|
[p] = new Array();
|
|
1200
|
-
[
|
|
1201
|
-
[
|
|
1200
|
+
[Ct] = Lr(null);
|
|
1201
|
+
[st] = /* @__PURE__ */ new WeakMap();
|
|
1202
1202
|
[it] = null;
|
|
1203
|
-
[
|
|
1203
|
+
[rt] = null;
|
|
1204
1204
|
[Me] = new Array();
|
|
1205
1205
|
[Te] = new Array();
|
|
1206
1206
|
[ke] = new Array();
|
|
1207
|
-
[
|
|
1207
|
+
[qt] = null;
|
|
1208
1208
|
[ge] = new ct();
|
|
1209
1209
|
[Oe] = new Ns();
|
|
1210
|
-
[
|
|
1210
|
+
[$t] = !1;
|
|
1211
1211
|
get currentRoute() {
|
|
1212
|
-
return ds(this[
|
|
1212
|
+
return ds(this[Ct]);
|
|
1213
1213
|
}
|
|
1214
1214
|
options;
|
|
1215
1215
|
constructor(e) {
|
|
1216
1216
|
this.options = e ?? {}, this.options.notFoundPath && this.setNotFoundPath(this.options.notFoundPath);
|
|
1217
1217
|
let t = this.options.routes || [];
|
|
1218
|
-
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[
|
|
1218
|
+
this.addRoutes(t), this.options.notFound && this.setNotFoundRoute(this.options.notFound), e.history ? this[S] = e.history : this[S] = Ee ? Us() : Ws(), this[S]?.listen(async (r) => {
|
|
1219
1219
|
let s = !0;
|
|
1220
1220
|
try {
|
|
1221
1221
|
if (typeof r == "string") {
|
|
1222
1222
|
const i = this[I](r);
|
|
1223
|
-
i && await this[
|
|
1224
|
-
} else await this[
|
|
1223
|
+
i && await this[Ft]([i]);
|
|
1224
|
+
} else await this[Ft](r);
|
|
1225
1225
|
} catch (i) {
|
|
1226
1226
|
console.error(i.message, i), s = !1;
|
|
1227
1227
|
}
|
|
@@ -1240,15 +1240,15 @@ var Gs = class {
|
|
|
1240
1240
|
console.error(e);
|
|
1241
1241
|
}
|
|
1242
1242
|
init() {
|
|
1243
|
-
this[
|
|
1243
|
+
this[$t] !== !0 && (this[S]?.init(!this[ce]), this[$t] = !0);
|
|
1244
1244
|
}
|
|
1245
1245
|
isReady() {
|
|
1246
1246
|
return this[ce] ? Promise.resolve() : new Promise((e, t) => {
|
|
1247
|
-
this[
|
|
1247
|
+
this[jt].push([e, t]);
|
|
1248
1248
|
});
|
|
1249
1249
|
}
|
|
1250
1250
|
[ot](e) {
|
|
1251
|
-
this[ce] = !0, this[
|
|
1251
|
+
this[ce] = !0, this[jt].forEach(([t, r]) => {
|
|
1252
1252
|
try {
|
|
1253
1253
|
e ? t() : r();
|
|
1254
1254
|
} catch (s) {
|
|
@@ -1256,16 +1256,19 @@ var Gs = class {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
|
-
[
|
|
1259
|
+
[Ft](e) {
|
|
1260
1260
|
try {
|
|
1261
1261
|
if (!e) {
|
|
1262
1262
|
let n = [...this[p]].reverse();
|
|
1263
1263
|
return this[Ie](n), Ee && C().location.reload(), Promise.resolve();
|
|
1264
1264
|
}
|
|
1265
1265
|
let t = null, r = [], s = [], i = 0;
|
|
1266
|
-
for (; i < e.length && i < this[p].length &&
|
|
1266
|
+
for (; i < e.length && i < this[p].length && x.isSame(e[i], this[p][i]); i++)
|
|
1267
1267
|
e[i].active === !0 && e[i].active !== this[p][i].active && (t = e[i]);
|
|
1268
|
-
if (i < e.length
|
|
1268
|
+
if (i < e.length) r = e.slice(i);
|
|
1269
|
+
else if (i === e.length) for (; i < this[p].length && this[p][i].historyUpdatePolicy === "traceless"; i++)
|
|
1270
|
+
r.push(this[p][i]), t = e[i];
|
|
1271
|
+
if (i < this[p].length && (s = this[p].slice(i).reverse()), s.length === 0 && r.length === 0) {
|
|
1269
1272
|
if (t !== null) return this.restore([t]);
|
|
1270
1273
|
} else if (s.length > 0) {
|
|
1271
1274
|
if (this[Ie](s)) {
|
|
@@ -1279,12 +1282,12 @@ var Gs = class {
|
|
|
1279
1282
|
return Promise.resolve();
|
|
1280
1283
|
}
|
|
1281
1284
|
[fe](e = null) {
|
|
1282
|
-
if (this[
|
|
1283
|
-
this[
|
|
1285
|
+
if (this[Ct].value = e, typeof this[rt] == "function") try {
|
|
1286
|
+
this[rt](e);
|
|
1284
1287
|
} catch {
|
|
1285
1288
|
}
|
|
1286
1289
|
}
|
|
1287
|
-
[
|
|
1290
|
+
[Rr](e, t) {
|
|
1288
1291
|
if (e.opsType === F.Open) {
|
|
1289
1292
|
let r = !1;
|
|
1290
1293
|
const s = this[p].length - 1;
|
|
@@ -1300,60 +1303,60 @@ var Gs = class {
|
|
|
1300
1303
|
}
|
|
1301
1304
|
r || this[p].push(e);
|
|
1302
1305
|
} else this[p].push(e);
|
|
1303
|
-
this[
|
|
1306
|
+
this[st].set(e, t), this[fe](e);
|
|
1304
1307
|
}
|
|
1305
|
-
[
|
|
1308
|
+
[Le]() {
|
|
1306
1309
|
let e = [];
|
|
1307
1310
|
for (let t of this[p]) {
|
|
1308
|
-
let r =
|
|
1311
|
+
let r = x.clone(t, !0);
|
|
1309
1312
|
e.push(r);
|
|
1310
1313
|
}
|
|
1311
1314
|
return e;
|
|
1312
1315
|
}
|
|
1313
|
-
[
|
|
1316
|
+
[Ke](e) {
|
|
1314
1317
|
if (!this[p]) {
|
|
1315
1318
|
this[fe](null);
|
|
1316
1319
|
return;
|
|
1317
1320
|
}
|
|
1318
1321
|
let t = -1;
|
|
1319
|
-
for (let r = 0; r < this[p].length; r++) if (
|
|
1322
|
+
for (let r = 0; r < this[p].length; r++) if (x.isSame(this[p][r], e)) {
|
|
1320
1323
|
t = r;
|
|
1321
1324
|
break;
|
|
1322
1325
|
}
|
|
1323
1326
|
if (t != -1) {
|
|
1324
1327
|
const r = this[p][t];
|
|
1325
1328
|
this[p].splice(t, 1);
|
|
1326
|
-
const s = this[
|
|
1327
|
-
if (this[
|
|
1329
|
+
const s = this[st].get(r);
|
|
1330
|
+
if (this[st].delete(r), this[Sr](r, s), r.opsType === F.Append) {
|
|
1328
1331
|
const i = this[p].length - 1;
|
|
1329
1332
|
this[fe](this[p][i] ?? null);
|
|
1330
1333
|
} else this[fe](null);
|
|
1331
1334
|
} else this[fe](null);
|
|
1332
1335
|
}
|
|
1333
1336
|
set historyMonitor(e) {
|
|
1334
|
-
this[
|
|
1337
|
+
this[S] && (this[S].historyMonitor = e);
|
|
1335
1338
|
}
|
|
1336
1339
|
get historyMonitor() {
|
|
1337
|
-
return this[
|
|
1340
|
+
return this[S] ? this[S].historyMonitor : !1;
|
|
1338
1341
|
}
|
|
1339
1342
|
set traceless(e) {
|
|
1340
|
-
this[
|
|
1343
|
+
this[S] && (this[S].traceless = e);
|
|
1341
1344
|
}
|
|
1342
1345
|
get traceless() {
|
|
1343
|
-
return this[
|
|
1346
|
+
return this[S]?.traceless ?? !1;
|
|
1344
1347
|
}
|
|
1345
1348
|
set propsFilter(e) {
|
|
1346
|
-
this[
|
|
1349
|
+
this[qt] = e;
|
|
1347
1350
|
}
|
|
1348
1351
|
get propsFilter() {
|
|
1349
|
-
return this[
|
|
1352
|
+
return this[qt];
|
|
1350
1353
|
}
|
|
1351
1354
|
setRestorePoint() {
|
|
1352
|
-
const e = this[
|
|
1353
|
-
this[
|
|
1355
|
+
const e = this[Le]();
|
|
1356
|
+
this[S]?.setRestorePoint(e);
|
|
1354
1357
|
}
|
|
1355
1358
|
onRouteUpdated(e) {
|
|
1356
|
-
this[
|
|
1359
|
+
this[rt] = e;
|
|
1357
1360
|
}
|
|
1358
1361
|
onError(e) {
|
|
1359
1362
|
this[it] = e;
|
|
@@ -1380,27 +1383,27 @@ var Gs = class {
|
|
|
1380
1383
|
return t !== -1 ? (this[ke].splice(t, 1), !0) : !1;
|
|
1381
1384
|
}
|
|
1382
1385
|
beforeRestoreEach(e) {
|
|
1383
|
-
this[
|
|
1386
|
+
this[S]?.beforeRestoreEach(e);
|
|
1384
1387
|
}
|
|
1385
1388
|
removeBeforeRestoreEach(e) {
|
|
1386
|
-
return this[
|
|
1389
|
+
return this[S]?.removeBeforeRestoreEach(e) ?? !1;
|
|
1387
1390
|
}
|
|
1388
1391
|
addRoutes(e) {
|
|
1389
1392
|
for (let t of e) this.addRoute(t);
|
|
1390
1393
|
}
|
|
1391
1394
|
addRoute(e, t = -1) {
|
|
1392
|
-
if (e.path === this[
|
|
1395
|
+
if (e.path === this[At]) {
|
|
1393
1396
|
this.setNotFoundRoute(e);
|
|
1394
1397
|
return;
|
|
1395
1398
|
}
|
|
1396
|
-
const r = this[
|
|
1399
|
+
const r = this[et](e);
|
|
1397
1400
|
if (t == -1) this[D] = [...this[D], ...r];
|
|
1398
1401
|
else for (let s = r.length - 1; s >= 0; s--) this[D].splice(t, 0, r[s]);
|
|
1399
1402
|
}
|
|
1400
1403
|
removeRoute(e) {
|
|
1401
1404
|
const t = this[I](e);
|
|
1402
1405
|
if (t === null)
|
|
1403
|
-
return console.warn("[Fox]
|
|
1406
|
+
return console.warn("[Fox]Illegal routing format", e), !1;
|
|
1404
1407
|
for (let r = 0; r < this[D].length; r++) {
|
|
1405
1408
|
const s = this[D][r];
|
|
1406
1409
|
if (t?.path && s.path === t.path)
|
|
@@ -1412,56 +1415,56 @@ var Gs = class {
|
|
|
1412
1415
|
}
|
|
1413
1416
|
hasRoute(e) {
|
|
1414
1417
|
const t = this[I](e);
|
|
1415
|
-
return t === null ? (console.warn("[Fox]
|
|
1418
|
+
return t === null ? (console.warn("[Fox]Illegal routing format", e), !1) : this[D].findIndex((r) => {
|
|
1416
1419
|
if (t?.path && r.path === t.path || t?.name && r.name === t.name) return !0;
|
|
1417
1420
|
}) !== -1;
|
|
1418
1421
|
}
|
|
1419
1422
|
setNotFoundPath(e) {
|
|
1420
|
-
this[
|
|
1423
|
+
this[At] = e;
|
|
1421
1424
|
}
|
|
1422
1425
|
setNotFoundRoute(e) {
|
|
1423
|
-
const t = this[
|
|
1426
|
+
const t = this[et](e);
|
|
1424
1427
|
this[nt] = t[0];
|
|
1425
1428
|
}
|
|
1426
1429
|
getRoutes() {
|
|
1427
1430
|
return [...this[D]];
|
|
1428
1431
|
}
|
|
1429
|
-
[
|
|
1432
|
+
[et](e) {
|
|
1430
1433
|
let t = e.path ?? "";
|
|
1431
1434
|
t.length > 0 && t.charAt(0) !== "/" && (t = `/${t}`);
|
|
1432
1435
|
let r = e.components ?? (e.component && { "": e.component });
|
|
1433
1436
|
if (!r) {
|
|
1434
|
-
const
|
|
1435
|
-
return
|
|
1437
|
+
const l = new bt();
|
|
1438
|
+
return l.path = t, l.redirect = e.redirect, [l];
|
|
1436
1439
|
}
|
|
1437
|
-
const s = new
|
|
1440
|
+
const s = new x();
|
|
1438
1441
|
s.path = t, s.name = e.name, s.meta = e.meta;
|
|
1439
1442
|
let i = [];
|
|
1440
|
-
for (let
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1443
|
-
const
|
|
1444
|
-
i.push(
|
|
1443
|
+
for (let l in r) {
|
|
1444
|
+
const a = r[l];
|
|
1445
|
+
l.length === 0 && (l = Ur);
|
|
1446
|
+
const u = new Bs(l, a, e.props);
|
|
1447
|
+
i.push(u);
|
|
1445
1448
|
}
|
|
1446
1449
|
let n = !1, o = [];
|
|
1447
|
-
if (e.children) for (let
|
|
1448
|
-
const
|
|
1449
|
-
for (let
|
|
1450
|
-
let f = new
|
|
1451
|
-
f.name =
|
|
1450
|
+
if (e.children) for (let l of e.children) {
|
|
1451
|
+
const a = this[et](l);
|
|
1452
|
+
for (let u of a) {
|
|
1453
|
+
let f = new bt();
|
|
1454
|
+
f.name = u.name, u.path && u.path.length > 0 ? t !== "/" ? f.path = `${t}${u.path}` : f.path = u.path : (n = !0, f.path = t);
|
|
1452
1455
|
let c = new yr();
|
|
1453
|
-
c.models = [...i], f.layers = [c, ...
|
|
1456
|
+
c.models = [...i], f.layers = [c, ...u.layers], f.matchedRoutes = [s, ...u.matchedRoutes ?? []], o.push(f);
|
|
1454
1457
|
}
|
|
1455
1458
|
}
|
|
1456
1459
|
if (!n) {
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1460
|
+
const l = new yr();
|
|
1461
|
+
l.models = i;
|
|
1462
|
+
const a = new bt();
|
|
1463
|
+
a.name = e.name, a.path = t, a.matchedRoutes = [s], a.layers = [l], o.splice(0, 0, a);
|
|
1461
1464
|
}
|
|
1462
1465
|
return o;
|
|
1463
1466
|
}
|
|
1464
|
-
[
|
|
1467
|
+
[tt](e) {
|
|
1465
1468
|
const t = e.route;
|
|
1466
1469
|
try {
|
|
1467
1470
|
for (let r of this[D]) {
|
|
@@ -1472,26 +1475,26 @@ var Gs = class {
|
|
|
1472
1475
|
const o = n(s);
|
|
1473
1476
|
if (!o) continue;
|
|
1474
1477
|
if (r.redirect) {
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1477
|
-
const
|
|
1478
|
-
route:
|
|
1478
|
+
const l = new x();
|
|
1479
|
+
j(!0, l, t), l.path = r.redirect;
|
|
1480
|
+
const a = {
|
|
1481
|
+
route: l,
|
|
1479
1482
|
find: void 0
|
|
1480
1483
|
};
|
|
1481
|
-
return this[
|
|
1484
|
+
return this[tt](a) ? (e.route = a.route, e.find = a.find, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0) : !1;
|
|
1482
1485
|
}
|
|
1483
|
-
if (t.params = t.params ?? {},
|
|
1484
|
-
const
|
|
1485
|
-
if (typeof
|
|
1486
|
-
const
|
|
1487
|
-
for (let f of
|
|
1486
|
+
if (t.params = t.params ?? {}, j(!0, t.params, o.params), t.query) {
|
|
1487
|
+
const l = t.query;
|
|
1488
|
+
if (typeof l == "string") {
|
|
1489
|
+
const a = {}, u = l.split("&");
|
|
1490
|
+
for (let f of u) {
|
|
1488
1491
|
const c = f.split("=");
|
|
1489
1492
|
if (c.length !== 2) continue;
|
|
1490
1493
|
const h = decodeURIComponent(c[0].trim());
|
|
1491
|
-
|
|
1494
|
+
a[h] = decodeURIComponent(c[1].trim());
|
|
1492
1495
|
}
|
|
1493
|
-
|
|
1494
|
-
} else typeof
|
|
1496
|
+
j(!0, t.params, a);
|
|
1497
|
+
} else typeof l == "object" && j(!0, t.params, l);
|
|
1495
1498
|
}
|
|
1496
1499
|
return e.find = r, t.template && e.find && (e.find = { ...e.find }, e.find.path = t.path), !0;
|
|
1497
1500
|
} else if (i === r.name)
|
|
@@ -1505,9 +1508,9 @@ var Gs = class {
|
|
|
1505
1508
|
[I](e) {
|
|
1506
1509
|
let t = null;
|
|
1507
1510
|
if (Array.isArray(e))
|
|
1508
|
-
if (t = new
|
|
1509
|
-
else for (let r = 0; r < e.length; r++) r === 0 ? e[r].charAt(0) === "/" ? t.path = e[r] : t.name = e[r] : r === 1 ? t.params = e[r] : r === 2 ? t.root = e[r] : r === 3 &&
|
|
1510
|
-
else typeof e == "object" ? t =
|
|
1511
|
+
if (t = new x(), typeof e[0] == "object") t = x.from(e[0]);
|
|
1512
|
+
else for (let r = 0; r < e.length; r++) r === 0 ? e[r].charAt(0) === "/" ? t.path = e[r] : t.name = e[r] : r === 1 ? t.params = e[r] : r === 2 ? t.root = e[r] : r === 3 && j(!1, t, e[r]);
|
|
1513
|
+
else typeof e == "object" ? t = x.from(e) : typeof e == "string" && (t = new x(), e.charAt(0) == "/" ? t.path = e : t.name = e);
|
|
1511
1514
|
if (t) {
|
|
1512
1515
|
if (t.path) {
|
|
1513
1516
|
let r = t.path.indexOf("?");
|
|
@@ -1541,65 +1544,68 @@ var Gs = class {
|
|
|
1541
1544
|
s.resolve(), r(!1);
|
|
1542
1545
|
return;
|
|
1543
1546
|
}
|
|
1544
|
-
let i = -1, n = null, o = [];
|
|
1547
|
+
let i = -1, n = null, o = [], l = this[p].length - 1, a = l !== -1 ? this[p][l] : null;
|
|
1545
1548
|
if (e) {
|
|
1546
|
-
if (n = e.root ?? "default", e.all) for (let
|
|
1547
|
-
const
|
|
1548
|
-
if (
|
|
1549
|
-
const
|
|
1550
|
-
if (n && n !==
|
|
1551
|
-
o.splice(0, 0,
|
|
1549
|
+
if (n = e.root ?? "default", e.all) for (let f = l; f > 0; f--) {
|
|
1550
|
+
const c = this[p][f];
|
|
1551
|
+
if (c.opsType === F.Append) {
|
|
1552
|
+
const h = c.root ?? "default";
|
|
1553
|
+
if (n && n !== h) continue;
|
|
1554
|
+
o.splice(0, 0, c), i = f - 1;
|
|
1552
1555
|
}
|
|
1553
1556
|
}
|
|
1554
|
-
else if (e.until) for (let
|
|
1555
|
-
let
|
|
1556
|
-
if (
|
|
1557
|
-
if (e.until.charAt(0) === "/" && e.until ===
|
|
1558
|
-
i =
|
|
1557
|
+
else if (e.until) for (let f = l; f > 0; f--) {
|
|
1558
|
+
let c = this[p][f];
|
|
1559
|
+
if (c.opsType === F.Append && c.root === n) {
|
|
1560
|
+
if (e.until.charAt(0) === "/" && e.until === c.path) {
|
|
1561
|
+
i = f;
|
|
1559
1562
|
break;
|
|
1560
|
-
} else if (e.until ===
|
|
1561
|
-
i =
|
|
1563
|
+
} else if (e.until === c.name) {
|
|
1564
|
+
i = f;
|
|
1562
1565
|
break;
|
|
1563
1566
|
}
|
|
1564
|
-
o.splice(0, 0,
|
|
1567
|
+
o.splice(0, 0, c);
|
|
1565
1568
|
}
|
|
1566
1569
|
}
|
|
1567
|
-
else if (e.to) for (let
|
|
1568
|
-
const
|
|
1569
|
-
if (
|
|
1570
|
-
const
|
|
1571
|
-
if (n && n !==
|
|
1572
|
-
if (o.splice(0, 0,
|
|
1573
|
-
i =
|
|
1570
|
+
else if (e.to) for (let f = l; f > 0; f--) {
|
|
1571
|
+
const c = this[p][f];
|
|
1572
|
+
if (c.opsType === F.Append) {
|
|
1573
|
+
const h = c.root ?? "default";
|
|
1574
|
+
if (n && n !== h) continue;
|
|
1575
|
+
if (o.splice(0, 0, c), e.to.charAt(0) === "/" && e.to === c.path) {
|
|
1576
|
+
i = f - 1;
|
|
1574
1577
|
break;
|
|
1575
|
-
} else if (e.to ===
|
|
1576
|
-
i =
|
|
1578
|
+
} else if (e.to === c.name) {
|
|
1579
|
+
i = f - 1;
|
|
1577
1580
|
break;
|
|
1578
1581
|
}
|
|
1579
1582
|
}
|
|
1580
1583
|
}
|
|
1581
|
-
} else for (let
|
|
1582
|
-
let
|
|
1583
|
-
if (
|
|
1584
|
-
o.push(
|
|
1584
|
+
} else for (let f = l; f > 0; f--) {
|
|
1585
|
+
let c = this[p][f];
|
|
1586
|
+
if (c.opsType === F.Append) {
|
|
1587
|
+
o.push(c), i = f - 1;
|
|
1585
1588
|
break;
|
|
1586
1589
|
}
|
|
1587
1590
|
}
|
|
1588
1591
|
if (i === -1 || o.length === 0) {
|
|
1589
|
-
const
|
|
1590
|
-
console.warn(
|
|
1592
|
+
const f = "[Fox]can not find route";
|
|
1593
|
+
console.warn(f), s.resolve(f), r(!1);
|
|
1591
1594
|
return;
|
|
1592
1595
|
}
|
|
1593
|
-
|
|
1594
|
-
if (
|
|
1596
|
+
const u = i !== -1 ? this[p][i] : null;
|
|
1597
|
+
if (this[Ie](o)) {
|
|
1595
1598
|
if (t === !1)
|
|
1596
1599
|
return s.resolve(), r(!0), !0;
|
|
1597
|
-
const
|
|
1598
|
-
if (u &&
|
|
1599
|
-
|
|
1600
|
+
const f = () => (s.resolve(), r(!0), !0), c = this[p].length;
|
|
1601
|
+
if (u && x.isSame(u, this[p][c - 1])) {
|
|
1602
|
+
if (a?.historyUpdatePolicy === "traceless") {
|
|
1603
|
+
const h = new St(x.clone(u, !0), this[Le]());
|
|
1604
|
+
this[S]?.replace(h), f();
|
|
1605
|
+
} else this[S]?.goBack(u, f);
|
|
1600
1606
|
return;
|
|
1601
1607
|
}
|
|
1602
|
-
|
|
1608
|
+
f();
|
|
1603
1609
|
}
|
|
1604
1610
|
} catch (i) {
|
|
1605
1611
|
this[$](i), s.resolve(), r(!1);
|
|
@@ -1654,18 +1660,18 @@ var Gs = class {
|
|
|
1654
1660
|
return r == null ? (this[$]("route forbid", t), this) : (this[ge].post((s) => {
|
|
1655
1661
|
try {
|
|
1656
1662
|
let i = this[Kt](t);
|
|
1657
|
-
this[
|
|
1658
|
-
const
|
|
1663
|
+
this[Lt](i), this[Tt](i), this[Mt](i), i.wait((n, o) => {
|
|
1664
|
+
const l = n.session.to;
|
|
1659
1665
|
if (n.session.updateResult && n.session.updateResult.status === "success") try {
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1662
|
-
} catch (
|
|
1663
|
-
console.error(
|
|
1666
|
+
const a = new St(x.clone(l, !0), this[Le]());
|
|
1667
|
+
l.historyUpdatePolicy === "replace" ? this[S]?.replace(a) : l.historyUpdatePolicy === "traceless" ? this[S]?.setRouteMark(a) : this[S]?.push(a);
|
|
1668
|
+
} catch (a) {
|
|
1669
|
+
console.error(a.message, a);
|
|
1664
1670
|
}
|
|
1665
1671
|
if (Ge.clear(n.session), this[Oe].release(r), typeof t.success == "function") try {
|
|
1666
1672
|
Reflect.apply(t.success, {}, []);
|
|
1667
|
-
} catch (
|
|
1668
|
-
console.error(
|
|
1673
|
+
} catch (a) {
|
|
1674
|
+
console.error(a.message, a);
|
|
1669
1675
|
}
|
|
1670
1676
|
this[ce] === !1 && this[ot](!0), i = null, s.resolve();
|
|
1671
1677
|
}, (n, o) => {
|
|
@@ -1677,9 +1683,9 @@ var Gs = class {
|
|
|
1677
1683
|
}), this);
|
|
1678
1684
|
}
|
|
1679
1685
|
back(e = 1) {
|
|
1680
|
-
this[
|
|
1686
|
+
this[S]?.go(-e, !1);
|
|
1681
1687
|
}
|
|
1682
|
-
[
|
|
1688
|
+
[xr](e) {
|
|
1683
1689
|
return (t, r) => {
|
|
1684
1690
|
if (typeof t == "boolean")
|
|
1685
1691
|
e.session.redirect = !1, t ? e.resolve() : e.reject(r ?? null);
|
|
@@ -1699,7 +1705,7 @@ var Gs = class {
|
|
|
1699
1705
|
route: e,
|
|
1700
1706
|
find: null
|
|
1701
1707
|
};
|
|
1702
|
-
if (this[
|
|
1708
|
+
if (this[tt](r), r.find) {
|
|
1703
1709
|
t.routeModel = r.find, e.matched = r.find.matchedRoutes ?? [];
|
|
1704
1710
|
const s = {};
|
|
1705
1711
|
if (Array.isArray(r.find?.matchedRoutes)) for (let i = 0; i < r.find.matchedRoutes.length; i++) {
|
|
@@ -1710,9 +1716,9 @@ var Gs = class {
|
|
|
1710
1716
|
}
|
|
1711
1717
|
return new ct(t);
|
|
1712
1718
|
}
|
|
1713
|
-
[
|
|
1719
|
+
[Lt](e) {
|
|
1714
1720
|
for (let t of this[Me]) e.post((r) => {
|
|
1715
|
-
const s = this[
|
|
1721
|
+
const s = this[xr](r);
|
|
1716
1722
|
Reflect.apply(t, {}, [
|
|
1717
1723
|
r.session.to,
|
|
1718
1724
|
r.session.from,
|
|
@@ -1721,7 +1727,7 @@ var Gs = class {
|
|
|
1721
1727
|
]);
|
|
1722
1728
|
});
|
|
1723
1729
|
}
|
|
1724
|
-
[
|
|
1730
|
+
[Mt](e) {
|
|
1725
1731
|
e.post((t) => {
|
|
1726
1732
|
for (let r of this[Te]) try {
|
|
1727
1733
|
Reflect.apply(r, {}, [
|
|
@@ -1735,7 +1741,7 @@ var Gs = class {
|
|
|
1735
1741
|
t.resolve();
|
|
1736
1742
|
});
|
|
1737
1743
|
}
|
|
1738
|
-
[
|
|
1744
|
+
[Sr](e, t) {
|
|
1739
1745
|
for (let r of this[ke]) try {
|
|
1740
1746
|
Reflect.apply(r, {}, [e, t]);
|
|
1741
1747
|
} catch (s) {
|
|
@@ -1743,7 +1749,7 @@ var Gs = class {
|
|
|
1743
1749
|
}
|
|
1744
1750
|
typeof e.destroy == "function" && Reflect.apply(e.destroy, e, []);
|
|
1745
1751
|
}
|
|
1746
|
-
[
|
|
1752
|
+
[Tt](e) {
|
|
1747
1753
|
e.post((t) => {
|
|
1748
1754
|
const r = t.session.to;
|
|
1749
1755
|
let s = t.session.routeModel;
|
|
@@ -1752,7 +1758,7 @@ var Gs = class {
|
|
|
1752
1758
|
route: r,
|
|
1753
1759
|
find: null
|
|
1754
1760
|
};
|
|
1755
|
-
if (this[
|
|
1761
|
+
if (this[tt](n)) s = n.find, t.session.routeModel = s;
|
|
1756
1762
|
else if (this[nt]) s = this[nt];
|
|
1757
1763
|
else {
|
|
1758
1764
|
t.reject(`not find route model, path:${r.path ?? r.name}`);
|
|
@@ -1760,7 +1766,7 @@ var Gs = class {
|
|
|
1760
1766
|
}
|
|
1761
1767
|
}
|
|
1762
1768
|
const i = Ge.from(t.session);
|
|
1763
|
-
this[
|
|
1769
|
+
this[gr](r, s, i).then((n) => {
|
|
1764
1770
|
this[W], t.session.updateResult = n ?? {
|
|
1765
1771
|
status: "success",
|
|
1766
1772
|
message: ""
|
|
@@ -1774,7 +1780,7 @@ var Gs = class {
|
|
|
1774
1780
|
if (e.length == 0) return !0;
|
|
1775
1781
|
let t = this[W], r = [];
|
|
1776
1782
|
for (let s of e) {
|
|
1777
|
-
let i = this[
|
|
1783
|
+
let i = this[_t](t, s);
|
|
1778
1784
|
i != null && r.push({
|
|
1779
1785
|
...i,
|
|
1780
1786
|
route: s
|
|
@@ -1788,14 +1794,14 @@ var Gs = class {
|
|
|
1788
1794
|
}, [s.route.index ?? 0], !0);
|
|
1789
1795
|
return !0;
|
|
1790
1796
|
}
|
|
1791
|
-
[
|
|
1797
|
+
[_t](e, t) {
|
|
1792
1798
|
const r = t.root ?? "default";
|
|
1793
1799
|
let s;
|
|
1794
1800
|
for (let i = 0; i < e.layers.length; i++) {
|
|
1795
1801
|
const n = e.layers[i];
|
|
1796
1802
|
for (let o = n.views.length - 1; o >= 0; o--) {
|
|
1797
|
-
const
|
|
1798
|
-
if (
|
|
1803
|
+
const l = n.views[o];
|
|
1804
|
+
if (l[G] && l[at] === r)
|
|
1799
1805
|
return s = {
|
|
1800
1806
|
x: o,
|
|
1801
1807
|
y: i
|
|
@@ -1809,35 +1815,35 @@ var Gs = class {
|
|
|
1809
1815
|
}
|
|
1810
1816
|
[ue](e, t, r = null, s = !0) {
|
|
1811
1817
|
if (t.y >= e.layers.length || t.x >= e.layers[t.y].views.length) return;
|
|
1812
|
-
let i = e.layers[t.y].views[t.x], n = !1, o = [],
|
|
1813
|
-
for (let f =
|
|
1814
|
-
let c =
|
|
1815
|
-
(!r || r.indexOf(c.index) != -1) && (c.route && i[G] && (this[
|
|
1818
|
+
let i = e.layers[t.y].views[t.x], n = !1, o = [], l = !1, a = [...i.slots.value];
|
|
1819
|
+
for (let f = a.length - 1; f >= 0; f--) {
|
|
1820
|
+
let c = a[f];
|
|
1821
|
+
(!r || r.indexOf(c.index) != -1) && (c.route && i[G] && (this[Ke](c.route), c.active === !0 && c.route.opsType == F.Append && (l = !0)), o.push(new O(i, c.index, t.y)), a.splice(f, 1));
|
|
1816
1822
|
}
|
|
1817
|
-
if (
|
|
1823
|
+
if (a.length == 0) s ? i.slots.value = a : e.layers[t.y].views.splice(t.x, 1);
|
|
1818
1824
|
else {
|
|
1819
|
-
if (
|
|
1820
|
-
let f =
|
|
1825
|
+
if (l) {
|
|
1826
|
+
let f = a[a.length - 1];
|
|
1821
1827
|
f.active = !0, f.route && (f.route.active = f.active);
|
|
1822
1828
|
}
|
|
1823
|
-
i.slots.value =
|
|
1829
|
+
i.slots.value = a;
|
|
1824
1830
|
}
|
|
1825
1831
|
e.layers[t.y].views.length == 0 && (n = !0);
|
|
1826
|
-
let
|
|
1827
|
-
for (;
|
|
1828
|
-
let f = e.layers[
|
|
1832
|
+
let u = t.y + 1;
|
|
1833
|
+
for (; u < e.layers.length; u++) {
|
|
1834
|
+
let f = e.layers[u].views, c = [];
|
|
1829
1835
|
for (let h = f.length - 1; (n || o.length > 0) && h >= 0; h--) {
|
|
1830
1836
|
let y = f[h];
|
|
1831
1837
|
if (y[ye] && (n || O.include(o, y[ye]))) {
|
|
1832
1838
|
let d = y.slots.value;
|
|
1833
1839
|
for (let m = d.length - 1; m >= 0; m--) {
|
|
1834
|
-
let
|
|
1835
|
-
|
|
1840
|
+
let b = d[m];
|
|
1841
|
+
b.route && y[G] && this[Ke](b.route), c.push(new O(y, b.index, u)), d.splice(m, 1);
|
|
1836
1842
|
}
|
|
1837
|
-
e.layers[
|
|
1843
|
+
e.layers[u].views.splice(h, 1);
|
|
1838
1844
|
}
|
|
1839
1845
|
}
|
|
1840
|
-
o = c, e.layers[
|
|
1846
|
+
o = c, e.layers[u].views.length == 0 && (n = !0);
|
|
1841
1847
|
}
|
|
1842
1848
|
}
|
|
1843
1849
|
restore(e) {
|
|
@@ -1852,28 +1858,28 @@ var Gs = class {
|
|
|
1852
1858
|
let s = null, i = !1;
|
|
1853
1859
|
for (let n = 0; n < e.length; n++) {
|
|
1854
1860
|
const o = e[n];
|
|
1855
|
-
this[ge].post((
|
|
1856
|
-
const
|
|
1857
|
-
this[
|
|
1858
|
-
s =
|
|
1859
|
-
}, (
|
|
1860
|
-
s = null, f !== null && this[$](f),
|
|
1861
|
+
this[ge].post((l) => {
|
|
1862
|
+
const a = this[Kt](o);
|
|
1863
|
+
this[Lt](a), this[Tt](a), this[Mt](a), a.wait((u, f) => {
|
|
1864
|
+
s = u.session.to, i = u.session.redirect, l.resolve();
|
|
1865
|
+
}, (u, f) => {
|
|
1866
|
+
s = null, f !== null && this[$](f), l.resolve();
|
|
1861
1867
|
});
|
|
1862
1868
|
});
|
|
1863
1869
|
}
|
|
1864
1870
|
this[ge].post((n) => {
|
|
1865
1871
|
if (s && i === !0) {
|
|
1866
|
-
const o = new
|
|
1867
|
-
this[
|
|
1872
|
+
const o = new St(x.clone(s, !0), this[Le]());
|
|
1873
|
+
this[S]?.replace(o);
|
|
1868
1874
|
}
|
|
1869
1875
|
n.resolve(), t();
|
|
1870
1876
|
});
|
|
1871
1877
|
});
|
|
1872
1878
|
}
|
|
1873
|
-
async [
|
|
1874
|
-
const s = e.updateType ??
|
|
1879
|
+
async [gr](e, t, r) {
|
|
1880
|
+
const s = e.updateType ?? wt.Part;
|
|
1875
1881
|
await this[br](t);
|
|
1876
|
-
const i = this[
|
|
1882
|
+
const i = this[wr](t, e, r, s);
|
|
1877
1883
|
if (i.status === "error") throw Error(i.message);
|
|
1878
1884
|
return i;
|
|
1879
1885
|
}
|
|
@@ -1888,17 +1894,17 @@ var Gs = class {
|
|
|
1888
1894
|
}
|
|
1889
1895
|
return t.length > 0 ? Promise.all(t) : Promise.resolve();
|
|
1890
1896
|
}
|
|
1891
|
-
[
|
|
1897
|
+
[wr](e, t, r, s) {
|
|
1892
1898
|
if (e.layers[0].models.length !== 1) return {
|
|
1893
1899
|
status: "error",
|
|
1894
1900
|
message: "illegal route structure(multi root node)"
|
|
1895
1901
|
};
|
|
1896
1902
|
const i = e.layers[0].models[0];
|
|
1897
|
-
let n = this[W], o = zs(n),
|
|
1898
|
-
!o && s ==
|
|
1899
|
-
let
|
|
1900
|
-
if (
|
|
1901
|
-
n.layers.length == 0 && (n.layers[0] = new Rt()), n.layers[0].views.length == 0 ? (
|
|
1903
|
+
let n = this[W], o = zs(n), l = t.root ?? "default", a;
|
|
1904
|
+
!o && s == wt.Part && (a = this[_t](n, t));
|
|
1905
|
+
let u, f = 0;
|
|
1906
|
+
if (a == null || a == null) if (o || s === wt.All)
|
|
1907
|
+
n.layers.length == 0 && (n.layers[0] = new Rt()), n.layers[0].views.length == 0 ? (u = new qe(t.root ?? "default", !0, null), n.layers[0].views = [u]) : u = n.layers[0].views[0], a = {
|
|
1902
1908
|
x: 0,
|
|
1903
1909
|
y: 0
|
|
1904
1910
|
};
|
|
@@ -1931,29 +1937,29 @@ var Gs = class {
|
|
|
1931
1937
|
status: "error",
|
|
1932
1938
|
message: "can not insert view(not find root node ref)"
|
|
1933
1939
|
};
|
|
1934
|
-
|
|
1940
|
+
u = new qe(l, !0, y), n.layers[h].views.push(u), a = {
|
|
1935
1941
|
x: n.layers[h].views.length - 1,
|
|
1936
1942
|
y: h
|
|
1937
1943
|
};
|
|
1938
1944
|
}
|
|
1939
|
-
else
|
|
1940
|
-
if (f =
|
|
1945
|
+
else u = n.layers[a.y].views[a.x];
|
|
1946
|
+
if (f = a.y, u[G] = !0, t.opsType === F.Append) {
|
|
1941
1947
|
t.index = t.index ?? De.get(), t.active = !0;
|
|
1942
|
-
let c =
|
|
1948
|
+
let c = u.slots.value;
|
|
1943
1949
|
if (c.length > 0) {
|
|
1944
|
-
let
|
|
1945
|
-
|
|
1950
|
+
let b = c[c.length - 1];
|
|
1951
|
+
b.active = !1, b.route && (b.route.active = b.active);
|
|
1946
1952
|
}
|
|
1947
1953
|
let h = new re(t, i, t.index, !0);
|
|
1948
|
-
|
|
1949
|
-
let y = f + 1, d = 1, m = new O(
|
|
1954
|
+
u.slots.value = [...c, h];
|
|
1955
|
+
let y = f + 1, d = 1, m = new O(u, t.index, f);
|
|
1950
1956
|
this[se](n, y, e, d, m);
|
|
1951
1957
|
} else if (t.opsType === F.Open) {
|
|
1952
|
-
let c =
|
|
1958
|
+
let c = u.slots.value;
|
|
1953
1959
|
const h = t.active ?? !0;
|
|
1954
1960
|
let y = !1;
|
|
1955
1961
|
for (let d of c) {
|
|
1956
|
-
if (d.route !== null &&
|
|
1962
|
+
if (d.route !== null && x.isSamePathForRoute(d.route, t)) {
|
|
1957
1963
|
if (d.active === h)
|
|
1958
1964
|
return t.index = d.index, t.active = h, d.route = t, {
|
|
1959
1965
|
status: "noChange",
|
|
@@ -1967,36 +1973,36 @@ var Gs = class {
|
|
|
1967
1973
|
t.index = t.index ?? De.get(), t.active = h;
|
|
1968
1974
|
let d = new re(t, i, t.index, h);
|
|
1969
1975
|
c.push(d);
|
|
1970
|
-
let m = f + 1,
|
|
1971
|
-
this[se](n, m, e,
|
|
1976
|
+
let m = f + 1, b = 1, g = new O(u, t.index, f);
|
|
1977
|
+
this[se](n, m, e, b, g);
|
|
1972
1978
|
}
|
|
1973
|
-
|
|
1979
|
+
u.slots.value = [...c];
|
|
1974
1980
|
} else {
|
|
1975
|
-
let c =
|
|
1981
|
+
let c = u.slots.value;
|
|
1976
1982
|
if (c.length == 0) {
|
|
1977
|
-
t.index = t.index ?? De.get(), t.active = !0,
|
|
1978
|
-
let h = f + 1, y = 1, d = new O(
|
|
1983
|
+
t.index = t.index ?? De.get(), t.active = !0, u.slots.value = [new re(t, i, t.index)];
|
|
1984
|
+
let h = f + 1, y = 1, d = new O(u, t.index, f);
|
|
1979
1985
|
this[se](n, h, e, y, d);
|
|
1980
1986
|
} else {
|
|
1981
1987
|
let h = c[0];
|
|
1982
1988
|
if (h.model !== i) {
|
|
1983
|
-
this[ue](n,
|
|
1984
|
-
let y = f + 1, d = 1, m = new O(
|
|
1989
|
+
this[ue](n, a, null, !0), t.index = t.index ?? De.get(), t.active = !0, u.slots.value = [new re(t, i, t.index)];
|
|
1990
|
+
let y = f + 1, d = 1, m = new O(u, t.index, f);
|
|
1985
1991
|
this[se](n, y, e, d, m);
|
|
1986
1992
|
} else {
|
|
1987
|
-
h.route !== null && this[
|
|
1993
|
+
h.route !== null && this[Ke](h.route);
|
|
1988
1994
|
let y = !1;
|
|
1989
1995
|
const d = t.active ?? !0;
|
|
1990
1996
|
h.active !== d && (h.active = d, y = !0), t.active = d, t.index = h.index, h.route = t;
|
|
1991
1997
|
let m = [];
|
|
1992
1998
|
for (let L = 1; L < c.length; L++) m.push(c[L].index);
|
|
1993
|
-
m.length > 0 ? this[ue](n,
|
|
1994
|
-
let
|
|
1995
|
-
for (;
|
|
1999
|
+
m.length > 0 ? this[ue](n, a, m, !0) : y && (u.slots.value = [...c]);
|
|
2000
|
+
let b = [new O(u, t.index, f)], g = f + 1, v = 1, K = new O(u, t.index, f);
|
|
2001
|
+
for (; b.length > 0 && g < n.layers.length && v < e.layers.length; g++, v++) {
|
|
1996
2002
|
let L = [];
|
|
1997
2003
|
for (let M = 0; M < n.layers[g].views.length; M++) {
|
|
1998
2004
|
let q = n.layers[g].views[M];
|
|
1999
|
-
q[ye] && O.include(
|
|
2005
|
+
q[ye] && O.include(b, q[ye]) && L.unshift(M);
|
|
2000
2006
|
}
|
|
2001
2007
|
let Ce = [];
|
|
2002
2008
|
for (let M of L) {
|
|
@@ -2015,7 +2021,7 @@ var Gs = class {
|
|
|
2015
2021
|
let Q = 0;
|
|
2016
2022
|
q.slots.value = [new re(null, ee, Q)];
|
|
2017
2023
|
let U = g + 1, V = v + 1;
|
|
2018
|
-
this[se](n, U, e, V,
|
|
2024
|
+
this[se](n, U, e, V, K);
|
|
2019
2025
|
} else {
|
|
2020
2026
|
let Q = T[0];
|
|
2021
2027
|
if (Q.model !== ee) {
|
|
@@ -2024,9 +2030,9 @@ var Gs = class {
|
|
|
2024
2030
|
y: g
|
|
2025
2031
|
}, null, !0), q.slots.value = [new re(null, ee, 0)];
|
|
2026
2032
|
let U = g + 1, V = v + 1;
|
|
2027
|
-
this[se](n, U, e, V,
|
|
2033
|
+
this[se](n, U, e, V, K);
|
|
2028
2034
|
} else {
|
|
2029
|
-
q[G] && Q.route !== null && this[
|
|
2035
|
+
q[G] && Q.route !== null && this[Ke](Q.route);
|
|
2030
2036
|
let U = [];
|
|
2031
2037
|
for (let V = 1; V < T.length; V++) U.push(T[V].index);
|
|
2032
2038
|
U.length > 0 && this[ue](n, {
|
|
@@ -2038,17 +2044,17 @@ var Gs = class {
|
|
|
2038
2044
|
q[G] = !1;
|
|
2039
2045
|
}
|
|
2040
2046
|
}
|
|
2041
|
-
|
|
2047
|
+
b = Ce;
|
|
2042
2048
|
}
|
|
2043
|
-
this[se](n, g, e, v,
|
|
2049
|
+
this[se](n, g, e, v, K);
|
|
2044
2050
|
}
|
|
2045
2051
|
}
|
|
2046
2052
|
}
|
|
2047
|
-
if (
|
|
2048
|
-
let c =
|
|
2049
|
-
c && (t.slot = new Os(
|
|
2053
|
+
if (u && u[z]) {
|
|
2054
|
+
let c = u[z];
|
|
2055
|
+
c && (t.slot = new Os(l, f, c?.view.name, c?.index ?? 0));
|
|
2050
2056
|
}
|
|
2051
|
-
return r.to = void 0, r.routeModel = void 0, this[
|
|
2057
|
+
return r.to = void 0, r.routeModel = void 0, this[Rr](t, r), {
|
|
2052
2058
|
status: "success",
|
|
2053
2059
|
message: ""
|
|
2054
2060
|
};
|
|
@@ -2056,27 +2062,27 @@ var Gs = class {
|
|
|
2056
2062
|
[se](e, t, r, s, i) {
|
|
2057
2063
|
let n = s, o = t;
|
|
2058
2064
|
for (; o < e.layers.length && n < r.layers.length; o++, n++) {
|
|
2059
|
-
let
|
|
2060
|
-
for (let
|
|
2061
|
-
let
|
|
2062
|
-
|
|
2065
|
+
let l = e.layers[o].views;
|
|
2066
|
+
for (let a of r.layers[n].models) {
|
|
2067
|
+
let u = new qe(a.name, !1, i), f = new re(null, a);
|
|
2068
|
+
u.slots.value = [f], l.push(u);
|
|
2063
2069
|
}
|
|
2064
2070
|
}
|
|
2065
2071
|
for (; n < r.layers.length; n++) {
|
|
2066
|
-
let
|
|
2067
|
-
|
|
2068
|
-
for (let
|
|
2069
|
-
let
|
|
2070
|
-
|
|
2072
|
+
let l = new Rt();
|
|
2073
|
+
l.views = [];
|
|
2074
|
+
for (let a of r.layers[n].models) {
|
|
2075
|
+
let u = new qe(a.name, !1, i), f = new re(null, a);
|
|
2076
|
+
u.slots.value = [f], l.views.push(u);
|
|
2071
2077
|
}
|
|
2072
|
-
e.layers.push(
|
|
2078
|
+
e.layers.push(l);
|
|
2073
2079
|
}
|
|
2074
2080
|
}
|
|
2075
2081
|
[Vr](e, t, r, s, i, n) {
|
|
2076
2082
|
if (t < 0 || t > this[W].layers.length) return null;
|
|
2077
2083
|
if (t < this[W].layers.length) {
|
|
2078
|
-
let
|
|
2079
|
-
for (let c of
|
|
2084
|
+
let u = this[W].layers[t], f = null;
|
|
2085
|
+
for (let c of u.views) {
|
|
2080
2086
|
let h = !1;
|
|
2081
2087
|
if (r !== null ? (h = c.name === e && c[z]?.view === r, h && s !== -1 && (h = c[z]?.index === s)) : h = c.name === e, !!h) {
|
|
2082
2088
|
i !== null && (c[ye] = {
|
|
@@ -2089,24 +2095,24 @@ var Gs = class {
|
|
|
2089
2095
|
}
|
|
2090
2096
|
if (f !== null) return f;
|
|
2091
2097
|
}
|
|
2092
|
-
let o = null,
|
|
2098
|
+
let o = null, l = null;
|
|
2093
2099
|
i !== null && (i[G] ? o = {
|
|
2094
2100
|
view: i,
|
|
2095
2101
|
index: n,
|
|
2096
2102
|
level: t - 1
|
|
2097
|
-
} : o = i[z],
|
|
2103
|
+
} : o = i[z], l = {
|
|
2098
2104
|
view: i,
|
|
2099
2105
|
index: n,
|
|
2100
2106
|
level: t - 1
|
|
2101
2107
|
});
|
|
2102
|
-
let
|
|
2103
|
-
if (
|
|
2104
|
-
let
|
|
2105
|
-
|
|
2106
|
-
} else this[W].layers[t].views.push(
|
|
2107
|
-
return
|
|
2108
|
-
}
|
|
2109
|
-
}, Ve = /* @__PURE__ */ Symbol("rk"),
|
|
2108
|
+
let a = new qe(e, !0, o);
|
|
2109
|
+
if (a[ye] = l, t == this[W].layers.length) {
|
|
2110
|
+
let u = new Rt();
|
|
2111
|
+
u.views = [a], this[W].layers.push(u);
|
|
2112
|
+
} else this[W].layers[t].views.push(a);
|
|
2113
|
+
return a;
|
|
2114
|
+
}
|
|
2115
|
+
}, Ve = /* @__PURE__ */ Symbol("rk"), kt = /* @__PURE__ */ Symbol("vd"), Er = /* @__PURE__ */ Symbol("rv"), It = /* @__PURE__ */ Symbol("rvi"), Pr = /* @__PURE__ */ Symbol("pv"), Ot = /* @__PURE__ */ Symbol("pvi"), Be = /* @__PURE__ */ Symbol("registerKey"), zr = /* @__PURE__ */ Symbol("lc"), Xs = class {
|
|
2110
2116
|
[Be] = /* @__PURE__ */ new Map();
|
|
2111
2117
|
constructor() {
|
|
2112
2118
|
}
|
|
@@ -2141,23 +2147,25 @@ async function Qs(e, t) {
|
|
|
2141
2147
|
Ne.pop();
|
|
2142
2148
|
}
|
|
2143
2149
|
}
|
|
2144
|
-
function
|
|
2145
|
-
const t =
|
|
2150
|
+
function Vi(e) {
|
|
2151
|
+
const t = Kr();
|
|
2146
2152
|
if (!t) return !1;
|
|
2147
2153
|
const r = dt();
|
|
2148
2154
|
if (!r) return !1;
|
|
2149
|
-
if (ne.set(t, r), Array.isArray(e))
|
|
2155
|
+
if (ne.set(t, r), Array.isArray(e))
|
|
2156
|
+
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && ne.set(e[s], r);
|
|
2150
2157
|
return Fe(() => {
|
|
2151
|
-
if (ne.delete(t), Array.isArray(e))
|
|
2158
|
+
if (ne.delete(t), Array.isArray(e))
|
|
2159
|
+
for (let s = 0; s < e.length; s++) e[s] && typeof e[s] == "object" && ne.delete(e[s]);
|
|
2152
2160
|
}), !0;
|
|
2153
2161
|
}
|
|
2154
2162
|
function Gr(e, t) {
|
|
2155
2163
|
return dt(e)?.get(t) ?? null;
|
|
2156
2164
|
}
|
|
2157
|
-
function
|
|
2165
|
+
function Wi(e, t, r) {
|
|
2158
2166
|
dt(e)?.set(t, r);
|
|
2159
2167
|
}
|
|
2160
|
-
function
|
|
2168
|
+
function Ji(e, t, r) {
|
|
2161
2169
|
dt(e)?.delete(t);
|
|
2162
2170
|
}
|
|
2163
2171
|
var ht = /* @__PURE__ */ Symbol("hooksKey");
|
|
@@ -2165,7 +2173,7 @@ function Zs(e) {
|
|
|
2165
2173
|
let t = e.get(ht);
|
|
2166
2174
|
t || (t = [], e.set(ht, t));
|
|
2167
2175
|
}
|
|
2168
|
-
function
|
|
2176
|
+
function _r(e, t) {
|
|
2169
2177
|
const r = e.get(ht);
|
|
2170
2178
|
r != null && Qs(e, async () => {
|
|
2171
2179
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
@@ -2206,24 +2214,20 @@ function ti(e, t, r) {
|
|
|
2206
2214
|
function Xr(e) {
|
|
2207
2215
|
return (t) => {
|
|
2208
2216
|
const r = Gr(null, ht);
|
|
2209
|
-
|
|
2210
|
-
console.warn("[Fox]hooks context not found");
|
|
2211
|
-
return;
|
|
2212
|
-
}
|
|
2213
|
-
Fe(() => {
|
|
2217
|
+
r && (Fe(() => {
|
|
2214
2218
|
ti(r, e, t);
|
|
2215
|
-
}), ei(r, e, t);
|
|
2219
|
+
}), ei(r, e, t));
|
|
2216
2220
|
};
|
|
2217
2221
|
}
|
|
2218
|
-
var
|
|
2222
|
+
var zi = function(e) {
|
|
2219
2223
|
cs(e), Xr(yt.ACTIVATED)(e);
|
|
2220
|
-
},
|
|
2224
|
+
}, Gi = function(e) {
|
|
2221
2225
|
hs(e), Xr(yt.INACTIVATED)(e);
|
|
2222
2226
|
}, Qr = /* @__PURE__ */ Symbol("routeKey");
|
|
2223
|
-
function
|
|
2227
|
+
function Fr(e, t) {
|
|
2224
2228
|
e.set(Qr, t);
|
|
2225
2229
|
}
|
|
2226
|
-
function
|
|
2230
|
+
function Cr(e) {
|
|
2227
2231
|
const t = Gr(e ?? null, Qr);
|
|
2228
2232
|
return typeof t == "function" ? t() : t;
|
|
2229
2233
|
}
|
|
@@ -2309,15 +2313,15 @@ function mt(e) {
|
|
|
2309
2313
|
vi(e);
|
|
2310
2314
|
}
|
|
2311
2315
|
function A(e, t) {
|
|
2312
|
-
|
|
2316
|
+
w(e) && Reflect.apply(e, null, t);
|
|
2313
2317
|
}
|
|
2314
2318
|
function rs(e, t, r = -1, s, i, n) {
|
|
2315
2319
|
let o = [];
|
|
2316
|
-
const
|
|
2317
|
-
for (let
|
|
2320
|
+
const l = () => {
|
|
2321
|
+
for (let a of o) Qt(e, a.type, a.listener);
|
|
2318
2322
|
o = [];
|
|
2319
2323
|
};
|
|
2320
|
-
if (
|
|
2324
|
+
if (w(i)) {
|
|
2321
2325
|
if (s !== void 0 && s >= 0) {
|
|
2322
2326
|
setTimeout(() => {
|
|
2323
2327
|
Reflect.apply(i, null, [
|
|
@@ -2328,35 +2332,35 @@ function rs(e, t, r = -1, s, i, n) {
|
|
|
2328
2332
|
}, s);
|
|
2329
2333
|
return;
|
|
2330
2334
|
}
|
|
2331
|
-
const
|
|
2335
|
+
const a = [
|
|
2332
2336
|
"animationend",
|
|
2333
2337
|
"transitionend",
|
|
2334
2338
|
Vt
|
|
2335
|
-
],
|
|
2336
|
-
(f.target || f.srcElement) === f.currentTarget && (
|
|
2339
|
+
], u = (f) => {
|
|
2340
|
+
(f.target || f.srcElement) === f.currentTarget && (l(), Reflect.apply(i, null, [
|
|
2337
2341
|
e,
|
|
2338
2342
|
t,
|
|
2339
2343
|
r
|
|
2340
2344
|
]));
|
|
2341
2345
|
};
|
|
2342
|
-
|
|
2343
|
-
ft(e, f,
|
|
2346
|
+
a.forEach((f) => {
|
|
2347
|
+
ft(e, f, u), o.push({
|
|
2344
2348
|
type: f,
|
|
2345
|
-
listener:
|
|
2349
|
+
listener: u
|
|
2346
2350
|
});
|
|
2347
2351
|
});
|
|
2348
2352
|
}
|
|
2349
|
-
if (
|
|
2350
|
-
const
|
|
2351
|
-
(f.target || f.srcElement) === f.currentTarget && (
|
|
2353
|
+
if (w(n)) {
|
|
2354
|
+
const a = "animationcancel", u = (f) => {
|
|
2355
|
+
(f.target || f.srcElement) === f.currentTarget && (l(), Reflect.apply(n, null, [
|
|
2352
2356
|
e,
|
|
2353
2357
|
t,
|
|
2354
2358
|
r
|
|
2355
2359
|
]));
|
|
2356
2360
|
};
|
|
2357
|
-
ft(e,
|
|
2358
|
-
type:
|
|
2359
|
-
listener:
|
|
2361
|
+
ft(e, a, u), o.push({
|
|
2362
|
+
type: a,
|
|
2363
|
+
listener: u
|
|
2360
2364
|
});
|
|
2361
2365
|
}
|
|
2362
2366
|
}
|
|
@@ -2378,30 +2382,30 @@ function ss(e, t, r = {}, s, i = -1) {
|
|
|
2378
2382
|
}
|
|
2379
2383
|
function is(e, t, r = {}, s, i, n, o) {
|
|
2380
2384
|
if (!vt(i) && !e) {
|
|
2381
|
-
|
|
2385
|
+
w(o) && o(o, [t]);
|
|
2382
2386
|
return;
|
|
2383
2387
|
}
|
|
2384
|
-
const
|
|
2385
|
-
if (!
|
|
2386
|
-
|
|
2388
|
+
const l = Zr(r, e), a = Yr(r, e), u = oi(r, e), f = ui(r, e), c = fi(r, e), h = ci(r, e);
|
|
2389
|
+
if (!l && !a && !u && !f) {
|
|
2390
|
+
w(o) && o(o, [t]);
|
|
2387
2391
|
return;
|
|
2388
2392
|
}
|
|
2389
2393
|
mt(() => {
|
|
2390
2394
|
rs(t, i, n, s, () => {
|
|
2391
|
-
|
|
2395
|
+
a && Se(t, a), u && Se(t, u), w(c) && A(c, [
|
|
2392
2396
|
t,
|
|
2393
2397
|
e,
|
|
2394
2398
|
i,
|
|
2395
2399
|
n
|
|
2396
|
-
]),
|
|
2400
|
+
]), w(o) && o(o, [t]);
|
|
2397
2401
|
}, () => {
|
|
2398
|
-
|
|
2402
|
+
w(h) && A(h, [
|
|
2399
2403
|
t,
|
|
2400
2404
|
e,
|
|
2401
2405
|
i,
|
|
2402
2406
|
n
|
|
2403
2407
|
]);
|
|
2404
|
-
}),
|
|
2408
|
+
}), l && Se(t, l), u && Pe(t, u), w(f) && A(f, [
|
|
2405
2409
|
t,
|
|
2406
2410
|
e,
|
|
2407
2411
|
i,
|
|
@@ -2422,40 +2426,40 @@ function ns(e, t, r = {}, s, i = -1) {
|
|
|
2422
2426
|
]);
|
|
2423
2427
|
}
|
|
2424
2428
|
}
|
|
2425
|
-
function os(e, t, r = {}, s, i, n, o,
|
|
2429
|
+
function os(e, t, r = {}, s, i, n, o, l) {
|
|
2426
2430
|
if (!vt(n) && !e) {
|
|
2427
|
-
|
|
2431
|
+
w(l) && A(l, [t]), !e && w(i) && i();
|
|
2428
2432
|
return;
|
|
2429
2433
|
}
|
|
2430
|
-
const
|
|
2431
|
-
if (!
|
|
2432
|
-
|
|
2434
|
+
const a = es(r, e), u = ts(r, e), f = li(r, e), c = yi(r, e), h = di(r, e), y = mi(r, e);
|
|
2435
|
+
if (!a && !u && !f && !c) {
|
|
2436
|
+
w(l) && A(l, [t]), !e && w(i) && i();
|
|
2433
2437
|
return;
|
|
2434
2438
|
}
|
|
2435
2439
|
mt(() => {
|
|
2436
2440
|
rs(t, n, o, s, () => {
|
|
2437
2441
|
try {
|
|
2438
|
-
|
|
2442
|
+
u && Se(t, u), f && Se(t, f), w(h) && A(h, [
|
|
2439
2443
|
t,
|
|
2440
2444
|
e,
|
|
2441
2445
|
n,
|
|
2442
2446
|
o
|
|
2443
|
-
]),
|
|
2447
|
+
]), w(l) && A(l, [t]);
|
|
2444
2448
|
} finally {
|
|
2445
|
-
!e &&
|
|
2449
|
+
!e && w(i) && i();
|
|
2446
2450
|
}
|
|
2447
2451
|
}, () => {
|
|
2448
2452
|
try {
|
|
2449
|
-
|
|
2453
|
+
w(y) && A(y, [
|
|
2450
2454
|
t,
|
|
2451
2455
|
e,
|
|
2452
2456
|
n,
|
|
2453
2457
|
o
|
|
2454
|
-
]),
|
|
2458
|
+
]), w(l) && A(l, [t]);
|
|
2455
2459
|
} finally {
|
|
2456
|
-
!e &&
|
|
2460
|
+
!e && w(i) && i();
|
|
2457
2461
|
}
|
|
2458
|
-
}),
|
|
2462
|
+
}), a && Se(t, a), f && Pe(t, f), w(c) && A(c, [
|
|
2459
2463
|
t,
|
|
2460
2464
|
e,
|
|
2461
2465
|
n,
|
|
@@ -2474,8 +2478,8 @@ function Wt(e, t = {}, r, s = -1) {
|
|
|
2474
2478
|
enter: (o) => {
|
|
2475
2479
|
is(!1, o, t, n.enter, r, s);
|
|
2476
2480
|
},
|
|
2477
|
-
leave: (o,
|
|
2478
|
-
ns(!1, o, t, r, s), os(!1, o, t, n.leave,
|
|
2481
|
+
leave: (o, l) => {
|
|
2482
|
+
ns(!1, o, t, r, s), os(!1, o, t, n.leave, l, r, s, () => {
|
|
2479
2483
|
e.transition = null;
|
|
2480
2484
|
});
|
|
2481
2485
|
},
|
|
@@ -2489,23 +2493,23 @@ function pi(e, t = {}, r, s, i, n) {
|
|
|
2489
2493
|
if (i === !0) {
|
|
2490
2494
|
const o = ls(e);
|
|
2491
2495
|
if (o == null) return;
|
|
2492
|
-
const
|
|
2493
|
-
ss(!0, o, t, r, s), is(!0, o, t,
|
|
2494
|
-
|
|
2496
|
+
const l = sr(t);
|
|
2497
|
+
ss(!0, o, t, r, s), is(!0, o, t, l.show, r, s, (a) => {
|
|
2498
|
+
w(n) && A(n, [a]);
|
|
2495
2499
|
});
|
|
2496
|
-
} else
|
|
2500
|
+
} else w(n) && A(n, []);
|
|
2497
2501
|
}
|
|
2498
2502
|
function gi(e, t = {}, r, s, i, n) {
|
|
2499
2503
|
if (i === !0) {
|
|
2500
2504
|
const o = ls(e);
|
|
2501
2505
|
if (o == null) return;
|
|
2502
|
-
const
|
|
2503
|
-
ns(!0, o, t, r, s), os(!0, o, t,
|
|
2504
|
-
|
|
2506
|
+
const l = sr(t);
|
|
2507
|
+
ns(!0, o, t, r, s), os(!0, o, t, l.hide, null, r, s, (a) => {
|
|
2508
|
+
w(n) && A(n, [a]);
|
|
2505
2509
|
});
|
|
2506
|
-
} else
|
|
2510
|
+
} else w(n) && A(n, []);
|
|
2507
2511
|
}
|
|
2508
|
-
function
|
|
2512
|
+
function bi(e) {
|
|
2509
2513
|
mt(() => {
|
|
2510
2514
|
for (let t = 0; t < e.length; t++) Reflect.apply(e[t], null, []);
|
|
2511
2515
|
});
|
|
@@ -2522,8 +2526,8 @@ function as(e, t = {}, r, s = -1) {
|
|
|
2522
2526
|
},
|
|
2523
2527
|
leave: (i, n) => {
|
|
2524
2528
|
ze(ii, {}, i), mt(() => {
|
|
2525
|
-
const o = (
|
|
2526
|
-
(
|
|
2529
|
+
const o = (l) => {
|
|
2530
|
+
(l.target || l.srcElement) === l.currentTarget && (Qt(i, Vt, o), n && Reflect.apply(n, null, []), e.transition = null);
|
|
2527
2531
|
};
|
|
2528
2532
|
ft(i, Vt, o), ze(ni, {}, i);
|
|
2529
2533
|
});
|
|
@@ -2534,21 +2538,21 @@ function as(e, t = {}, r, s = -1) {
|
|
|
2534
2538
|
function ie(e, t, r) {
|
|
2535
2539
|
return typeof e == "function" ? Reflect.apply(e, {}, [t, r]) : e;
|
|
2536
2540
|
}
|
|
2537
|
-
function
|
|
2541
|
+
function Bt(e, t) {
|
|
2538
2542
|
if (!e) return null;
|
|
2539
2543
|
const r = e(t);
|
|
2540
2544
|
return r.length === 1 ? r[0] : r;
|
|
2541
2545
|
}
|
|
2542
|
-
function
|
|
2546
|
+
function be(e, t) {
|
|
2543
2547
|
return typeof t == "function" ? t(e) : e;
|
|
2544
2548
|
}
|
|
2545
|
-
var
|
|
2549
|
+
var wi = class {
|
|
2546
2550
|
node;
|
|
2547
2551
|
state;
|
|
2548
2552
|
constructor(e, t) {
|
|
2549
2553
|
this.node = e, this.state = t;
|
|
2550
2554
|
}
|
|
2551
|
-
}, Jt =
|
|
2555
|
+
}, Jt = jr({
|
|
2552
2556
|
name: "RouterView",
|
|
2553
2557
|
inheritAttrs: !1,
|
|
2554
2558
|
props: {
|
|
@@ -2738,94 +2742,94 @@ var bi = class {
|
|
|
2738
2742
|
}
|
|
2739
2743
|
},
|
|
2740
2744
|
setup(e, t) {
|
|
2741
|
-
const r =
|
|
2742
|
-
let
|
|
2743
|
-
if (
|
|
2744
|
-
if (te(
|
|
2745
|
+
const r = Kr(), s = e.multi === !0, i = N(Ve, null), n = N(kt, 0), o = N(Er, null), l = N(It, -1);
|
|
2746
|
+
let a = null, u = e.modelSlot ?? null;
|
|
2747
|
+
if (u) {
|
|
2748
|
+
if (te(kt, n + 1), te(It, u.index), te(Ot, u.index), !u.route) {
|
|
2745
2749
|
console.warn("[Fox]child view render error, route not exist");
|
|
2746
2750
|
return;
|
|
2747
2751
|
}
|
|
2748
|
-
const c = lt(
|
|
2749
|
-
c && (Zs(c),
|
|
2752
|
+
const c = lt(u, !0);
|
|
2753
|
+
c && (Zs(c), Fr(c, () => u?.route ?? null));
|
|
2750
2754
|
} else {
|
|
2751
2755
|
if (i == null) {
|
|
2752
2756
|
console.error("[Fox]router is not been injected");
|
|
2753
2757
|
return;
|
|
2754
2758
|
}
|
|
2755
|
-
const c = e.name, h = N(
|
|
2756
|
-
if (
|
|
2757
|
-
te(
|
|
2758
|
-
const d =
|
|
2759
|
-
if (d && te(
|
|
2759
|
+
const c = e.name, h = N(Pr, null), y = N(Ot, 0);
|
|
2760
|
+
if (a = i[Vr](c, n, o, l, h, y), a === null) return;
|
|
2761
|
+
te(Pr, a);
|
|
2762
|
+
const d = a[G] === !0;
|
|
2763
|
+
if (d && te(Er, a), !s && (te(It, -1), te(kt, n + 1), te(Ot, -1), d && r)) {
|
|
2760
2764
|
const m = lt(r, !0);
|
|
2761
|
-
m &&
|
|
2762
|
-
const
|
|
2763
|
-
return
|
|
2765
|
+
m && Fr(m, () => {
|
|
2766
|
+
const b = a?.slots.value ?? [];
|
|
2767
|
+
return b.length > 0 ? b[0].route : null;
|
|
2764
2768
|
});
|
|
2765
2769
|
}
|
|
2766
2770
|
}
|
|
2767
2771
|
const f = { value: /* @__PURE__ */ new Map() };
|
|
2768
2772
|
return Fe(() => {
|
|
2769
|
-
if (f.value && f.value.clear(),
|
|
2770
|
-
const c =
|
|
2771
|
-
c.route = null, c.model = null, c.instance = null,
|
|
2773
|
+
if (f.value && f.value.clear(), u) {
|
|
2774
|
+
const c = u;
|
|
2775
|
+
c.route = null, c.model = null, c.instance = null, u = null;
|
|
2772
2776
|
}
|
|
2773
2777
|
}), () => {
|
|
2774
2778
|
if (s) {
|
|
2775
|
-
const c = /* @__PURE__ */ new Map(), h = [], y =
|
|
2779
|
+
const c = /* @__PURE__ */ new Map(), h = [], y = a?.slots.value, d = [];
|
|
2776
2780
|
for (let g = 0; g < y.length; g++) {
|
|
2777
|
-
const v = y[g],
|
|
2781
|
+
const v = y[g], K = `${e.name}_${v.index}`, L = ie(e.transition, v.route, g) ?? !0, Ce = { modelSlot: v };
|
|
2778
2782
|
let M;
|
|
2779
2783
|
t.slots.default ? M = he(Jt, Ce, { default: t.slots.default }) : M = he(Jt, Ce);
|
|
2780
2784
|
const q = {}, oe = ie(e.viewClass, v.route, g);
|
|
2781
2785
|
typeof oe == "string" && oe.length > 0 && (q[oe] = !0);
|
|
2782
|
-
const ee = ie(e.viewActiveClass, v.route, g), T = ie(e.viewInactiveClass, v.route, g), Q = f.value.get(
|
|
2786
|
+
const ee = ie(e.viewActiveClass, v.route, g), T = ie(e.viewInactiveClass, v.route, g), Q = f.value.get(K);
|
|
2783
2787
|
if (typeof ee == "string" && ee.length > 0 && (q[ee] = v.active), typeof T == "string" && T.length > 0 && (q[T] = !v.active), Q && v.active !== Q.state) {
|
|
2784
2788
|
const ir = Q.node;
|
|
2785
2789
|
v.active ? d.unshift(() => {
|
|
2786
2790
|
const pt = () => {
|
|
2787
2791
|
const Ae = lt(v);
|
|
2788
|
-
Ae != null &&
|
|
2792
|
+
Ae != null && _r(Ae, yt.ACTIVATED);
|
|
2789
2793
|
};
|
|
2790
2794
|
pi(ir, e, v.route, g, L, pt);
|
|
2791
2795
|
}) : d.push(() => {
|
|
2792
2796
|
const pt = () => {
|
|
2793
2797
|
const Ae = lt(v);
|
|
2794
|
-
Ae != null &&
|
|
2798
|
+
Ae != null && _r(Ae, yt.INACTIVATED);
|
|
2795
2799
|
};
|
|
2796
2800
|
gi(ir, e, v.route, g, L, pt);
|
|
2797
2801
|
});
|
|
2798
2802
|
}
|
|
2799
2803
|
const U = {
|
|
2800
2804
|
class: q,
|
|
2801
|
-
key:
|
|
2805
|
+
key: K
|
|
2802
2806
|
}, V = ie(e.viewTagProps, v.route, g);
|
|
2803
|
-
V !== null && typeof V == "object" &&
|
|
2807
|
+
V !== null && typeof V == "object" && j(!0, U, be(V, i?.propsFilter)), v.route?.viewTagAttrs && typeof v.route?.viewTagAttrs == "object" && j(!0, U, be(v.route.viewTagAttrs, i?.propsFilter));
|
|
2804
2808
|
const ve = he(ie(e.viewTag, v.route, g), U, { default: () => [M] });
|
|
2805
|
-
c.set(
|
|
2809
|
+
c.set(K, new wi(ve, v.active)), f.value.delete(K), L === !0 ? ve.transition = Wt(ve, e, v.route, g) : L === "custom" && (ve.transition = as(ve, e, v.route, g)), h.push(ve);
|
|
2806
2810
|
}
|
|
2807
|
-
f.value = c,
|
|
2808
|
-
const m = ie(e.tag, null, -1),
|
|
2809
|
-
return Object.assign(
|
|
2810
|
-
} else if (
|
|
2811
|
-
const c =
|
|
2812
|
-
c.props && (typeof c.props == "object" ?
|
|
2811
|
+
f.value = c, bi(d);
|
|
2812
|
+
const m = ie(e.tag, null, -1), b = {};
|
|
2813
|
+
return Object.assign(b, t.attrs), he(m, b, { default: () => h });
|
|
2814
|
+
} else if (u != null) {
|
|
2815
|
+
const c = u.model, h = {};
|
|
2816
|
+
c.props && (typeof c.props == "object" ? j(!1, h, be(c.props, i?.propsFilter)) : c.props === !0 && typeof u.route?.params == "object" && j(!1, h, be(u.route.params, i?.propsFilter)));
|
|
2813
2817
|
const y = he(c.component, h);
|
|
2814
|
-
return
|
|
2818
|
+
return Bt(t.slots.default, {
|
|
2815
2819
|
Component: y,
|
|
2816
|
-
route:
|
|
2820
|
+
route: u.route
|
|
2817
2821
|
}) ?? y;
|
|
2818
2822
|
} else {
|
|
2819
|
-
const c =
|
|
2823
|
+
const c = a?.slots.value ?? [];
|
|
2820
2824
|
if (c.length > 0) {
|
|
2821
2825
|
const h = c[0], y = h.route, d = h.model, m = {};
|
|
2822
|
-
d.props && (typeof d.props == "object" ?
|
|
2823
|
-
const
|
|
2824
|
-
return (ie(e.transition, y, -1) ?? !0) && (
|
|
2825
|
-
Component:
|
|
2826
|
+
d.props && (typeof d.props == "object" ? j(!1, m, be(d.props, i?.propsFilter)) : d.props === !0 && typeof y?.params == "object" && j(!1, m, be(y.params, i?.propsFilter)));
|
|
2827
|
+
const b = he(d.component, m);
|
|
2828
|
+
return (ie(e.transition, y, -1) ?? !0) && (b.transition = Wt(b, e, y, -1)), Bt(t.slots.default, {
|
|
2829
|
+
Component: b,
|
|
2826
2830
|
route: y
|
|
2827
|
-
}) ??
|
|
2828
|
-
} else return
|
|
2831
|
+
}) ?? b;
|
|
2832
|
+
} else return Bt(t.slots.fallback, {});
|
|
2829
2833
|
}
|
|
2830
2834
|
};
|
|
2831
2835
|
}
|
|
@@ -2842,10 +2846,10 @@ function Ri(e) {
|
|
|
2842
2846
|
function xi(e, t) {
|
|
2843
2847
|
return e == null || t == null ? !1 : !!(e.path && t.path && t.path.startsWith(e.path) || e.name && e.name == t.name);
|
|
2844
2848
|
}
|
|
2845
|
-
function
|
|
2849
|
+
function we(e, t) {
|
|
2846
2850
|
return typeof e == "function" ? Reflect.apply(e, {}, [t]) : e;
|
|
2847
2851
|
}
|
|
2848
|
-
var Si =
|
|
2852
|
+
var Si = jr({
|
|
2849
2853
|
name: "RouterLink",
|
|
2850
2854
|
inheritAttrs: !1,
|
|
2851
2855
|
props: {
|
|
@@ -2894,21 +2898,21 @@ var Si = Kr({
|
|
|
2894
2898
|
setup(e, t) {
|
|
2895
2899
|
const r = N(Ve, null);
|
|
2896
2900
|
return () => {
|
|
2897
|
-
let s =
|
|
2901
|
+
let s = we(e.to, null), i = we(e.tag, s);
|
|
2898
2902
|
if (i == null) {
|
|
2899
2903
|
console.warn("[Fox]can not resolve link tag");
|
|
2900
2904
|
return;
|
|
2901
2905
|
}
|
|
2902
2906
|
let n = null, o = null;
|
|
2903
2907
|
r !== null && (n = r[I](s), e.root && (n.root = e.root), o = r.currentRoute.value);
|
|
2904
|
-
let
|
|
2905
|
-
if (typeof
|
|
2906
|
-
let c =
|
|
2907
|
-
typeof c == "string" && c.length > 0 && (
|
|
2908
|
-
}
|
|
2909
|
-
let
|
|
2910
|
-
(i === "a" || i === "A") && (
|
|
2911
|
-
const f =
|
|
2908
|
+
let l = {}, a = we(e.activeClass, n);
|
|
2909
|
+
if (typeof a == "string" && a.length > 0 && (l[a] = xi(n, o)), we(e.exact, n) === !0) {
|
|
2910
|
+
let c = we(e.exactActiveClass, n);
|
|
2911
|
+
typeof c == "string" && c.length > 0 && (l[c] = x.isSamePathForRoute(n, o));
|
|
2912
|
+
}
|
|
2913
|
+
let u = { class: l };
|
|
2914
|
+
(i === "a" || i === "A") && (u.href = n?.path ?? n?.name ?? "#"), j(!0, u, t.attrs);
|
|
2915
|
+
const f = we(e.event, n);
|
|
2912
2916
|
if (typeof f == "string") {
|
|
2913
2917
|
const c = (h) => {
|
|
2914
2918
|
if (r == null) {
|
|
@@ -2921,9 +2925,9 @@ var Si = Kr({
|
|
|
2921
2925
|
}
|
|
2922
2926
|
Ri(h) && r.to(n);
|
|
2923
2927
|
};
|
|
2924
|
-
|
|
2928
|
+
u[f] = c;
|
|
2925
2929
|
}
|
|
2926
|
-
return he(i,
|
|
2930
|
+
return he(i, u, t.slots);
|
|
2927
2931
|
};
|
|
2928
2932
|
}
|
|
2929
2933
|
}), ut = /* @__PURE__ */ (function(e) {
|
|
@@ -2972,8 +2976,8 @@ var Si = Kr({
|
|
|
2972
2976
|
if (typeof r != "function")
|
|
2973
2977
|
return console.error("[Fox]callback can not be empty"), this;
|
|
2974
2978
|
let s = t - 1, i = new Array(s), n = [].splice.call(e, 0, s);
|
|
2975
|
-
for (let o = 0; o < n.length; o++) this.once(n[o], (
|
|
2976
|
-
i[o] =
|
|
2979
|
+
for (let o = 0; o < n.length; o++) this.once(n[o], (l) => {
|
|
2980
|
+
i[o] = l, s -= 1, s == 0 && Reflect.apply(r, {}, i);
|
|
2977
2981
|
});
|
|
2978
2982
|
return this;
|
|
2979
2983
|
}
|
|
@@ -3041,7 +3045,7 @@ var qr = /* @__PURE__ */ (function(e) {
|
|
|
3041
3045
|
clear() {
|
|
3042
3046
|
this.register.clear(), this.regExpRegisters = [];
|
|
3043
3047
|
}
|
|
3044
|
-
},
|
|
3048
|
+
}, Dt = [
|
|
3045
3049
|
"require",
|
|
3046
3050
|
"exports",
|
|
3047
3051
|
"module"
|
|
@@ -3120,7 +3124,7 @@ var $r = class {
|
|
|
3120
3124
|
}
|
|
3121
3125
|
resloveResource(e) {
|
|
3122
3126
|
if (typeof e == "string") {
|
|
3123
|
-
if (
|
|
3127
|
+
if (Dt.includes(e)) return e;
|
|
3124
3128
|
if (e = this.alias?.[e] ?? e, typeof this.resourceParser == "function") {
|
|
3125
3129
|
const r = this.resloveResource(e);
|
|
3126
3130
|
if (!r) return r;
|
|
@@ -3152,31 +3156,31 @@ var $r = class {
|
|
|
3152
3156
|
const s = [];
|
|
3153
3157
|
let i = e.length - 1, n = null;
|
|
3154
3158
|
typeof e[i] == "function" && (n = e[i], i--);
|
|
3155
|
-
for (let
|
|
3156
|
-
const
|
|
3157
|
-
for (let f = 0; f <
|
|
3158
|
-
const c = this.resloveResource(
|
|
3159
|
+
for (let a = 0; a <= i; a++) if (Array.isArray(e[a])) {
|
|
3160
|
+
const u = e[a];
|
|
3161
|
+
for (let f = 0; f < u.length; f++) {
|
|
3162
|
+
const c = this.resloveResource(u[f]);
|
|
3159
3163
|
s.push(c);
|
|
3160
3164
|
}
|
|
3161
|
-
} else if (typeof e[
|
|
3162
|
-
const
|
|
3163
|
-
s.push(
|
|
3165
|
+
} else if (typeof e[a] == "string") {
|
|
3166
|
+
const u = this.resloveResource(e[a]);
|
|
3167
|
+
s.push(u);
|
|
3164
3168
|
}
|
|
3165
|
-
const o = new qi(s.length, (
|
|
3169
|
+
const o = new qi(s.length, (a, u) => {
|
|
3166
3170
|
if (o.isOK()) try {
|
|
3167
|
-
typeof n == "function" && Reflect.apply(n, {},
|
|
3171
|
+
typeof n == "function" && Reflect.apply(n, {}, u), t(u);
|
|
3168
3172
|
} catch (f) {
|
|
3169
3173
|
console.error(f), r(f);
|
|
3170
3174
|
}
|
|
3171
3175
|
else try {
|
|
3172
|
-
console.error(
|
|
3176
|
+
console.error(a), typeof n == "function" && Reflect.apply(n, {}, []), r(a);
|
|
3173
3177
|
} catch (f) {
|
|
3174
3178
|
console.error(f), r(f);
|
|
3175
3179
|
}
|
|
3176
|
-
}),
|
|
3177
|
-
for (let
|
|
3178
|
-
const
|
|
3179
|
-
this.mount(
|
|
3180
|
+
}), l = new ct();
|
|
3181
|
+
for (let a = 0; a < s.length; a++) {
|
|
3182
|
+
const u = new $i(a, s[a], o);
|
|
3183
|
+
this.mount(l, u);
|
|
3180
3184
|
}
|
|
3181
3185
|
return this;
|
|
3182
3186
|
});
|
|
@@ -3191,19 +3195,19 @@ var $r = class {
|
|
|
3191
3195
|
let i = e.length - 1, n = null;
|
|
3192
3196
|
typeof e[i] == "function" && (n = e[i], i--);
|
|
3193
3197
|
for (let o = 0; o <= i; o++) if (Array.isArray(e[o])) {
|
|
3194
|
-
const
|
|
3195
|
-
for (let
|
|
3196
|
-
const
|
|
3197
|
-
s.push(
|
|
3198
|
+
const l = e[o];
|
|
3199
|
+
for (let a = 0; a < l.length; a++) {
|
|
3200
|
+
const u = this.resloveResource(l[a]);
|
|
3201
|
+
s.push(u);
|
|
3198
3202
|
}
|
|
3199
3203
|
} else if (typeof e[o] == "string") {
|
|
3200
|
-
const
|
|
3201
|
-
s.push(
|
|
3204
|
+
const l = this.resloveResource(e[o]);
|
|
3205
|
+
s.push(l);
|
|
3202
3206
|
}
|
|
3203
3207
|
for (let o = 0; o < s.length; o++) try {
|
|
3204
3208
|
this.unmount(s[o]);
|
|
3205
|
-
} catch (
|
|
3206
|
-
console.error(
|
|
3209
|
+
} catch (l) {
|
|
3210
|
+
console.error(l);
|
|
3207
3211
|
}
|
|
3208
3212
|
typeof n == "function" && Reflect.apply(n, {}, [!0]), t(!0);
|
|
3209
3213
|
});
|
|
@@ -3216,7 +3220,7 @@ var $r = class {
|
|
|
3216
3220
|
return;
|
|
3217
3221
|
}
|
|
3218
3222
|
if (typeof t.resource == "string") {
|
|
3219
|
-
if (
|
|
3223
|
+
if (Dt.includes(t.resource)) {
|
|
3220
3224
|
e.post((i) => {
|
|
3221
3225
|
t.progress.work(!0, t.index, t.resource), i.resolve();
|
|
3222
3226
|
});
|
|
@@ -3248,19 +3252,19 @@ var $r = class {
|
|
|
3248
3252
|
t.progress.work(!0, t.index, n), s.resolve();
|
|
3249
3253
|
return;
|
|
3250
3254
|
}
|
|
3251
|
-
const o = Je(),
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
},
|
|
3255
|
+
const o = Je(), l = o.createElement("link"), a = "onload" in l;
|
|
3256
|
+
a && (l.onload = () => {
|
|
3257
|
+
l.onload = null, l.onerror = null, t.progress.work(!0, t.index, i.path), s.resolve();
|
|
3258
|
+
}, l.onerror = () => {
|
|
3255
3259
|
try {
|
|
3256
|
-
r.removeChild(
|
|
3260
|
+
r.removeChild(l);
|
|
3257
3261
|
} catch (c) {
|
|
3258
3262
|
console.error(c);
|
|
3259
3263
|
}
|
|
3260
|
-
|
|
3264
|
+
l.onload = null, l.onerror = null, t.progress.work(!1, t.index, null), s.reject();
|
|
3261
3265
|
});
|
|
3262
|
-
const
|
|
3263
|
-
f && f.parentNode && f.parentNode.removeChild(f),
|
|
3266
|
+
const u = this.constructResourceUri(i.path), f = o.getElementById(i.path);
|
|
3267
|
+
f && f.parentNode && f.parentNode.removeChild(f), l.rel = "stylesheet", l.type = "text/css", l.id = i.path, l.href = u, r.appendChild(l), a || (t.progress.work(!0, t.index, i.path), s.resolve());
|
|
3264
3268
|
});
|
|
3265
3269
|
}
|
|
3266
3270
|
mountJS(e, t, r) {
|
|
@@ -3276,32 +3280,32 @@ var $r = class {
|
|
|
3276
3280
|
status: H.Loading
|
|
3277
3281
|
};
|
|
3278
3282
|
this.moduleManager.set(i.path, o);
|
|
3279
|
-
const
|
|
3280
|
-
if ("onload" in
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
},
|
|
3283
|
+
const l = Je().createElement("script");
|
|
3284
|
+
if ("onload" in l)
|
|
3285
|
+
l.onload = () => {
|
|
3286
|
+
l.onload = null, l.onerror = null, o.status === H.Loading && (o.status = H.Loaded, t.progress.work(!0, t.index, i.path)), s.resolve();
|
|
3287
|
+
}, l.onerror = () => {
|
|
3284
3288
|
try {
|
|
3285
|
-
r.removeChild(
|
|
3289
|
+
r.removeChild(l);
|
|
3286
3290
|
} catch (h) {
|
|
3287
3291
|
console.error(h);
|
|
3288
3292
|
}
|
|
3289
|
-
|
|
3293
|
+
l.onload = null, l.onerror = null, this.moduleManager.remove(i.path), t.progress.work(!1, t.index, null), s.resolve();
|
|
3290
3294
|
};
|
|
3291
3295
|
else {
|
|
3292
|
-
const h =
|
|
3296
|
+
const h = l;
|
|
3293
3297
|
h.onreadystatechange = () => {
|
|
3294
3298
|
/loaded|complete/.test(h.readyState) && (h.onreadystatechange = null, o.status == H.Loading && (o.status = H.Loaded, t.progress.work(!0, t.index, i.path)), s.resolve());
|
|
3295
3299
|
};
|
|
3296
3300
|
}
|
|
3297
|
-
const
|
|
3298
|
-
|
|
3299
|
-
const
|
|
3300
|
-
|
|
3301
|
+
const a = this.constructResourceUri(i.path);
|
|
3302
|
+
l.defer = !0, l.src = a;
|
|
3303
|
+
const u = C(), f = this.createRequireLoad();
|
|
3304
|
+
u.__require = u.__require ?? u.require, u.require = f;
|
|
3301
3305
|
const c = this.createDefine(o, f, t);
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
}), r.appendChild(
|
|
3306
|
+
u.__define = u.__define ?? u.define, u.define = c, typeof t.progress.finalCallback != "function" && (t.progress.finalCallback = function() {
|
|
3307
|
+
u.require = u.__require, u.__require = void 0, u.define = u.__define, u.__define = void 0;
|
|
3308
|
+
}), r.appendChild(l);
|
|
3305
3309
|
});
|
|
3306
3310
|
}
|
|
3307
3311
|
mountCJS(e, t) {
|
|
@@ -3356,24 +3360,24 @@ var $r = class {
|
|
|
3356
3360
|
createDefine(e, t, r) {
|
|
3357
3361
|
const s = this, i = function(...n) {
|
|
3358
3362
|
e.status = H.Defining;
|
|
3359
|
-
let o,
|
|
3360
|
-
if (
|
|
3363
|
+
let o, l, a, u = n.length;
|
|
3364
|
+
if (u === 1 ? (a = n[0], o = void 0) : u === 2 ? (a = n[1], Array.isArray(n[0]) ? (l = s.trimEmptyElement(n[0]), o = void 0) : l = void 0) : (o = n[0], l = s.trimEmptyElement(n[1]), a = n[2]), o && (e.id = o, typeof s._alias == "object" && (s._alias[o] = e.src)), l && l.length > 0) s.ensure(l, (...f) => {
|
|
3361
3365
|
try {
|
|
3362
3366
|
const c = f.map((h) => h === "exports" ? ((!e.exports || typeof e.exports != "object") && (e.exports = {}), e.exports) : h === "module" ? e : h === "require" ? t : h);
|
|
3363
|
-
if (typeof
|
|
3364
|
-
const h = Reflect.apply(
|
|
3367
|
+
if (typeof a == "function") {
|
|
3368
|
+
const h = Reflect.apply(a, e, c);
|
|
3365
3369
|
h && typeof h == "object" && (e.exports = h);
|
|
3366
|
-
} else e.exports =
|
|
3370
|
+
} else e.exports = a;
|
|
3367
3371
|
e.status = H.Defined, r.progress.work(!0, r.index, e.exports);
|
|
3368
3372
|
} catch (c) {
|
|
3369
3373
|
console.error(c), r.progress.work(!1, r.index, []);
|
|
3370
3374
|
}
|
|
3371
3375
|
});
|
|
3372
3376
|
else {
|
|
3373
|
-
if (typeof
|
|
3374
|
-
const f = Reflect.apply(
|
|
3377
|
+
if (typeof a == "function") {
|
|
3378
|
+
const f = Reflect.apply(a, e, []);
|
|
3375
3379
|
f && typeof f == "object" && (e.exports = e.exports ?? {}, Object.assign(e.exports, f));
|
|
3376
|
-
} else e.exports =
|
|
3380
|
+
} else e.exports = a;
|
|
3377
3381
|
e.status = H.Defined, r.progress.work(!0, r.index, e.exports);
|
|
3378
3382
|
}
|
|
3379
3383
|
};
|
|
@@ -3384,7 +3388,7 @@ var $r = class {
|
|
|
3384
3388
|
}
|
|
3385
3389
|
constructResourceUri(e) {
|
|
3386
3390
|
try {
|
|
3387
|
-
if (
|
|
3391
|
+
if (Dt.includes(e) || !this.query) return e;
|
|
3388
3392
|
const t = this.createSearch(this.query);
|
|
3389
3393
|
return e.indexOf("?") == -1 ? e += `?${t}` : t.length > 0 && (e += `&${t}`), e;
|
|
3390
3394
|
} catch (t) {
|
|
@@ -3438,7 +3442,7 @@ var $r = class {
|
|
|
3438
3442
|
this.index = e, this.resource = t, this.progress = r;
|
|
3439
3443
|
}
|
|
3440
3444
|
}, zt = /* @__PURE__ */ Symbol("fk"), Gt = /* @__PURE__ */ Symbol("fbk"), Xt = /* @__PURE__ */ Symbol("fepk");
|
|
3441
|
-
function
|
|
3445
|
+
function Xi(e = {}) {
|
|
3442
3446
|
const t = new Gs(e), r = new fr(), s = new Ar(), i = new $r(), n = {
|
|
3443
3447
|
get router() {
|
|
3444
3448
|
return t;
|
|
@@ -3467,8 +3471,8 @@ function Gi(e = {}) {
|
|
|
3467
3471
|
get isESModule() {
|
|
3468
3472
|
return Yt;
|
|
3469
3473
|
},
|
|
3470
|
-
install(o,
|
|
3471
|
-
o.provide(Ve, t), o.provide(zt, n), o.provide(Gt, r), o.provide(Xt, s),
|
|
3474
|
+
install(o, l = {}) {
|
|
3475
|
+
o.provide(Ve, t), o.provide(zt, n), o.provide(Gt, r), o.provide(Xt, s), l.install !== !1 && (o.component(Pi, Jt), o.component(_i, Si)), l.optionsApi !== !1 && (Reflect.defineProperty(o.config.globalProperties, "$fox", { get() {
|
|
3472
3476
|
return n;
|
|
3473
3477
|
} }), Reflect.defineProperty(o.config.globalProperties, "$router", { get() {
|
|
3474
3478
|
return t;
|
|
@@ -3478,24 +3482,24 @@ function Gi(e = {}) {
|
|
|
3478
3482
|
return r;
|
|
3479
3483
|
} }), Reflect.defineProperty(o.config.globalProperties, "$eventProxy", { get() {
|
|
3480
3484
|
return s;
|
|
3481
|
-
} }), o.config.globalProperties.$fox_on = function(
|
|
3482
|
-
s.on(
|
|
3483
|
-
}, o.config.globalProperties.$fox_off = function(
|
|
3484
|
-
s.off(
|
|
3485
|
-
}, o.config.globalProperties.$fox_once = function(
|
|
3486
|
-
s.once(
|
|
3487
|
-
}, o.config.globalProperties.$fox_all = function(...
|
|
3488
|
-
let
|
|
3489
|
-
Reflect.apply(
|
|
3490
|
-
}, o.config.globalProperties.$fox_trigger = function(
|
|
3485
|
+
} }), o.config.globalProperties.$fox_on = function(a, u, f = !1) {
|
|
3486
|
+
s.on(a, u, f);
|
|
3487
|
+
}, o.config.globalProperties.$fox_off = function(a, u) {
|
|
3488
|
+
s.off(a, u);
|
|
3489
|
+
}, o.config.globalProperties.$fox_once = function(a, u) {
|
|
3490
|
+
s.once(a, u);
|
|
3491
|
+
}, o.config.globalProperties.$fox_all = function(...a) {
|
|
3492
|
+
let u = s;
|
|
3493
|
+
Reflect.apply(u.all, u, a);
|
|
3494
|
+
}, o.config.globalProperties.$fox_trigger = function(a, ...u) {
|
|
3491
3495
|
let f = s;
|
|
3492
|
-
Reflect.apply(f.trigger, f, [
|
|
3493
|
-
}, o.config.globalProperties.$fox_emit = function(
|
|
3496
|
+
Reflect.apply(f.trigger, f, [a, ...u]);
|
|
3497
|
+
}, o.config.globalProperties.$fox_emit = function(a, ...u) {
|
|
3494
3498
|
let f = s;
|
|
3495
|
-
Reflect.apply(f.trigger, f, [
|
|
3496
|
-
}, o.mixin({
|
|
3497
|
-
return
|
|
3498
|
-
} })), t.init();
|
|
3499
|
+
Reflect.apply(f.trigger, f, [a, ...u]);
|
|
3500
|
+
}, o.mixin({ computed: { $route() {
|
|
3501
|
+
return ji(this);
|
|
3502
|
+
} } })), t.init();
|
|
3499
3503
|
}
|
|
3500
3504
|
};
|
|
3501
3505
|
return n;
|
|
@@ -3503,11 +3507,11 @@ function Gi(e = {}) {
|
|
|
3503
3507
|
function us(e) {
|
|
3504
3508
|
return _e() ? N(Ve, null) : e ? e.$?.appContext?.provides?.[Ve] ?? null : null;
|
|
3505
3509
|
}
|
|
3506
|
-
function
|
|
3507
|
-
let t =
|
|
3510
|
+
function ji(e) {
|
|
3511
|
+
let t = Cr(e);
|
|
3508
3512
|
if (!t && e && !_e()) {
|
|
3509
3513
|
let r = e;
|
|
3510
|
-
for (r = r.$parent; r && (t =
|
|
3514
|
+
for (r = r.$parent; r && (t = Cr(r), !t); )
|
|
3511
3515
|
r = r.$parent;
|
|
3512
3516
|
}
|
|
3513
3517
|
return t;
|
|
@@ -3567,48 +3571,48 @@ export {
|
|
|
3567
3571
|
ni as FoxLeave,
|
|
3568
3572
|
Vt as FoxLeaveEnd,
|
|
3569
3573
|
F as OperationType,
|
|
3570
|
-
|
|
3574
|
+
x as Route,
|
|
3571
3575
|
Gs as Router,
|
|
3572
3576
|
Si as RouterLink,
|
|
3573
3577
|
Jt as RouterView,
|
|
3574
|
-
|
|
3575
|
-
|
|
3578
|
+
Vi as bindLifecycleContextToCurrentScope,
|
|
3579
|
+
Xi as createFox,
|
|
3576
3580
|
Ws as createMemoryHistory,
|
|
3577
3581
|
Us as createWebHashHistory,
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3582
|
+
Ui as createWebHistory,
|
|
3583
|
+
Ji as deleteContextValue,
|
|
3584
|
+
j as extend,
|
|
3581
3585
|
Gr as injectContextValue,
|
|
3582
3586
|
dt as injectLifecycleContext,
|
|
3583
3587
|
nr as isArray,
|
|
3584
|
-
|
|
3588
|
+
Ti as isDate,
|
|
3585
3589
|
Yt as isESModule,
|
|
3586
3590
|
lr as isEqual,
|
|
3587
|
-
|
|
3588
|
-
|
|
3591
|
+
w as isFunction,
|
|
3592
|
+
Li as isMap,
|
|
3589
3593
|
We as isNil,
|
|
3590
3594
|
gs as isObject,
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3595
|
+
ws as isPlainObject,
|
|
3596
|
+
Oi as isPromise,
|
|
3597
|
+
Mi as isSet,
|
|
3598
|
+
ki as isString,
|
|
3599
|
+
Ii as isSymbol,
|
|
3596
3600
|
tn as onAfterRouteUpdate,
|
|
3597
3601
|
en as onBeforeRouteUpdate,
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3602
|
+
zi as onFoxActivated,
|
|
3603
|
+
Gi as onFoxInactivated,
|
|
3604
|
+
Wi as provideContextValue,
|
|
3605
|
+
Ni as rawState,
|
|
3606
|
+
Di as reactiveState,
|
|
3607
|
+
Hi as shallowReactiveState,
|
|
3604
3608
|
Tr as toBoolean,
|
|
3605
|
-
|
|
3609
|
+
Bi as toNumber,
|
|
3606
3610
|
Zt as toTypeString,
|
|
3607
3611
|
or as typeOf,
|
|
3608
3612
|
Zi as useBus,
|
|
3609
3613
|
Yi as useEventProxy,
|
|
3610
3614
|
Qi as useFox,
|
|
3611
|
-
|
|
3615
|
+
ji as useRoute,
|
|
3612
3616
|
us as useRouter,
|
|
3613
3617
|
Qs as withLifecycleContext
|
|
3614
3618
|
};
|