@kitbag/router 0.5.3 → 0.5.4
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/dist/kitbag-router.d.ts +5 -5
- package/dist/kitbag-router.js +230 -230
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/kitbag-router.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var V = (t, e, n) => (
|
|
4
|
-
import { inject as lt, computed as H, toValue as mt, toRefs as
|
|
5
|
-
class
|
|
1
|
+
var Ae = Object.defineProperty;
|
|
2
|
+
var Le = (t, e, n) => e in t ? Ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var V = (t, e, n) => (Le(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { inject as lt, computed as H, toValue as mt, toRefs as Be, reactive as It, watch as Ue, onUnmounted as Ft, defineComponent as et, openBlock as Jt, createElementBlock as $e, normalizeClass as Ne, renderSlot as Qt, normalizeProps as Kt, guardReactiveProps as Gt, unref as rt, provide as He, defineAsyncComponent as je, createBlock as Ve, resolveDynamicComponent as Ce, h as ot, ref as qe, markRaw as at } from "vue";
|
|
5
|
+
class _e extends Error {
|
|
6
6
|
/**
|
|
7
7
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
8
8
|
* @param paramName - The name of the parameter that was duplicated.
|
|
@@ -16,7 +16,7 @@ class vt extends Error {
|
|
|
16
16
|
super("Router not installed");
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
class
|
|
19
|
+
class Oe extends Error {
|
|
20
20
|
/**
|
|
21
21
|
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
22
22
|
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
@@ -27,9 +27,9 @@ class _e extends Error {
|
|
|
27
27
|
super(`useRoute called with incorrect route. Given ${e}, expected ${n}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const zt = Symbol();
|
|
31
31
|
function wt() {
|
|
32
|
-
const t = lt(
|
|
32
|
+
const t = lt(zt);
|
|
33
33
|
if (!t)
|
|
34
34
|
throw new vt();
|
|
35
35
|
return t;
|
|
@@ -39,7 +39,7 @@ class z extends Error {
|
|
|
39
39
|
function F(t) {
|
|
40
40
|
return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function We(t, e = {}, n = {}) {
|
|
43
43
|
const o = wt(), r = H(() => mt(t)), a = H(() => mt(e)), s = H(() => mt(n)), c = H(() => {
|
|
44
44
|
if (F(r.value))
|
|
45
45
|
return r.value;
|
|
@@ -58,9 +58,9 @@ function Oe(t, e = {}, n = {}) {
|
|
|
58
58
|
replace: (m) => o.replace(c.value, {}, { ...s.value, ...m })
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
function
|
|
63
|
-
const t = lt(
|
|
61
|
+
const Yt = Symbol();
|
|
62
|
+
function Me() {
|
|
63
|
+
const t = lt(Yt);
|
|
64
64
|
if (!t)
|
|
65
65
|
throw new vt();
|
|
66
66
|
return t;
|
|
@@ -68,11 +68,11 @@ function We() {
|
|
|
68
68
|
function Et(t, e) {
|
|
69
69
|
return [t, e].filter((n) => !!n).join(".");
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
73
|
-
return typeof t == "object" && t !== null &&
|
|
71
|
+
const Xt = Symbol("isRouterRouteSymbol");
|
|
72
|
+
function De(t) {
|
|
73
|
+
return typeof t == "object" && t !== null && Xt in t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Te(t, e) {
|
|
76
76
|
function n(f, h, m) {
|
|
77
77
|
if (typeof f == "object") {
|
|
78
78
|
const y = {
|
|
@@ -87,14 +87,14 @@ function De(t, e) {
|
|
|
87
87
|
};
|
|
88
88
|
return e(t.key, b, m);
|
|
89
89
|
}
|
|
90
|
-
const { matched: o, matches: r, key: a, query: s, params: c } =
|
|
90
|
+
const { matched: o, matches: r, key: a, query: s, params: c } = Be(t), i = It({
|
|
91
91
|
matched: o,
|
|
92
92
|
matches: r,
|
|
93
93
|
query: s,
|
|
94
94
|
params: c,
|
|
95
95
|
key: a,
|
|
96
96
|
update: n,
|
|
97
|
-
[
|
|
97
|
+
[Xt]: !0
|
|
98
98
|
});
|
|
99
99
|
return new Proxy(i, {
|
|
100
100
|
get: (f, h, m) => h === "params" ? new Proxy(t.params, {
|
|
@@ -104,19 +104,19 @@ function De(t, e) {
|
|
|
104
104
|
}) : Reflect.get(f, h, m)
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
if (!
|
|
107
|
+
function Ie(t, e, { exact: n } = {}) {
|
|
108
|
+
if (!De(t))
|
|
109
109
|
return !1;
|
|
110
110
|
if (e === void 0)
|
|
111
111
|
return !0;
|
|
112
|
-
const o =
|
|
112
|
+
const o = Fe(t);
|
|
113
113
|
if (n) {
|
|
114
114
|
const r = o.at(-1);
|
|
115
115
|
return e === r;
|
|
116
116
|
}
|
|
117
117
|
return o.includes(e);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Fe(t) {
|
|
120
120
|
return t.matches.map((n) => n.name).reduce((n, o) => {
|
|
121
121
|
const r = n.pop(), a = o ? [Et(r, o)] : [];
|
|
122
122
|
return r ? [
|
|
@@ -126,19 +126,19 @@ function Ie(t) {
|
|
|
126
126
|
] : a;
|
|
127
127
|
}, []);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Je(t, e) {
|
|
130
130
|
const n = wt();
|
|
131
131
|
function o() {
|
|
132
132
|
if (!t)
|
|
133
133
|
return;
|
|
134
|
-
if (!
|
|
135
|
-
throw new
|
|
134
|
+
if (!Ie(n.route, t, e))
|
|
135
|
+
throw new Oe(t, n.route.key);
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return Ue(n.route, o, { immediate: !0, deep: !0 }), n.route;
|
|
138
138
|
}
|
|
139
|
-
const
|
|
139
|
+
const Zt = Symbol();
|
|
140
140
|
function bt() {
|
|
141
|
-
return lt(
|
|
141
|
+
return lt(Zt, 0);
|
|
142
142
|
}
|
|
143
143
|
class st {
|
|
144
144
|
constructor() {
|
|
@@ -169,7 +169,7 @@ class yt extends Error {
|
|
|
169
169
|
function G(t) {
|
|
170
170
|
return Array.isArray(t) ? t : [t];
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Qe(t, e) {
|
|
173
173
|
const n = new st();
|
|
174
174
|
return t.matches.forEach((o, r) => {
|
|
175
175
|
o.onBeforeRouteEnter && Pt(t, e, r) && G(o.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), o.onBeforeRouteUpdate && kt(t, e, r) && G(o.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
|
|
@@ -177,7 +177,7 @@ function Je(t, e) {
|
|
|
177
177
|
o.onBeforeRouteLeave && St(t, e, r) && G(o.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
|
|
178
178
|
}), n;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function Ke(t, e) {
|
|
181
181
|
const n = new st();
|
|
182
182
|
return t.matches.forEach((o, r) => {
|
|
183
183
|
o.onAfterRouteEnter && Pt(t, e, r) && G(o.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), o.onAfterRouteUpdate && kt(t, e, r) && G(o.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
|
|
@@ -185,7 +185,7 @@ function Qe(t, e) {
|
|
|
185
185
|
o.onAfterRouteLeave && St(t, e, r) && G(o.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
|
|
186
186
|
}), n;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Ge() {
|
|
189
189
|
const t = (s) => {
|
|
190
190
|
throw new yt(s);
|
|
191
191
|
}, e = (...s) => {
|
|
@@ -201,7 +201,7 @@ function Ke() {
|
|
|
201
201
|
throw new jt();
|
|
202
202
|
};
|
|
203
203
|
async function r({ to: s, from: c, hooks: i }) {
|
|
204
|
-
const { global: f, component: h } = i, m =
|
|
204
|
+
const { global: f, component: h } = i, m = Qe(s, c), b = [
|
|
205
205
|
...f.onBeforeRouteEnter,
|
|
206
206
|
...m.onBeforeRouteEnter,
|
|
207
207
|
...f.onBeforeRouteUpdate,
|
|
@@ -242,7 +242,7 @@ function Ke() {
|
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
async function a({ to: s, from: c, hooks: i }) {
|
|
245
|
-
const { global: f, component: h } = i, m =
|
|
245
|
+
const { global: f, component: h } = i, m = Ke(s, c), b = [
|
|
246
246
|
...h.onAfterRouteLeave,
|
|
247
247
|
...m.onAfterRouteLeave,
|
|
248
248
|
...f.onAfterRouteLeave,
|
|
@@ -305,7 +305,7 @@ function Vt(t) {
|
|
|
305
305
|
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
class
|
|
308
|
+
class ze {
|
|
309
309
|
constructor() {
|
|
310
310
|
V(this, "global", new st());
|
|
311
311
|
V(this, "component", new st());
|
|
@@ -325,9 +325,9 @@ class Ge {
|
|
|
325
325
|
return s.add(c), () => s.delete(c);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
function
|
|
330
|
-
const t = new
|
|
328
|
+
const te = Symbol();
|
|
329
|
+
function Ye() {
|
|
330
|
+
const t = new ze();
|
|
331
331
|
return {
|
|
332
332
|
onBeforeRouteEnter: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
333
333
|
onBeforeRouteUpdate: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
@@ -338,25 +338,25 @@ function ze() {
|
|
|
338
338
|
hooks: t
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const t = lt(
|
|
341
|
+
function ee() {
|
|
342
|
+
const t = lt(te);
|
|
343
343
|
if (!t)
|
|
344
344
|
throw new vt();
|
|
345
345
|
return t;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ne(t) {
|
|
348
348
|
return (e) => {
|
|
349
|
-
const n = bt(), r =
|
|
350
|
-
return
|
|
349
|
+
const n = bt(), r = ee().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
350
|
+
return Ft(r), r;
|
|
351
351
|
};
|
|
352
352
|
}
|
|
353
353
|
function xt(t) {
|
|
354
354
|
return (e) => {
|
|
355
|
-
const n = bt(), r =
|
|
356
|
-
return
|
|
355
|
+
const n = bt(), r = ee().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
356
|
+
return Ft(r), r;
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
const or =
|
|
359
|
+
const or = ne("onBeforeRouteUpdate"), ar = ne("onBeforeRouteLeave"), sr = xt("onAfterRouteEnter"), cr = xt("onAfterRouteUpdate"), ir = xt("onAfterRouteLeave"), Xe = ["href"], Ze = /* @__PURE__ */ et({
|
|
360
360
|
__name: "routerLink",
|
|
361
361
|
props: {
|
|
362
362
|
to: { type: [String, Function] },
|
|
@@ -367,42 +367,42 @@ const or = ee("onBeforeRouteUpdate"), ar = ee("onBeforeRouteLeave"), sr = xt("on
|
|
|
367
367
|
const e = t, n = wt(), o = H(() => F(e.to) ? e.to : e.to(n.resolve)), r = H(() => {
|
|
368
368
|
const { to: m, ...b } = e;
|
|
369
369
|
return b;
|
|
370
|
-
}), { href: a, isMatch: s, isExactMatch: c } =
|
|
370
|
+
}), { href: a, isMatch: s, isExactMatch: c } = We(o), i = H(() => ({
|
|
371
371
|
"router-link--match": s.value,
|
|
372
372
|
"router-link--exact-match": c.value
|
|
373
373
|
})), f = H(() => n.isExternal(o.value));
|
|
374
374
|
function h(m) {
|
|
375
375
|
m.preventDefault(), n.push(a.value, r.value);
|
|
376
376
|
}
|
|
377
|
-
return (m, b) => (
|
|
377
|
+
return (m, b) => (Jt(), $e("a", {
|
|
378
378
|
href: o.value,
|
|
379
|
-
class:
|
|
379
|
+
class: Ne(["router-link", i.value]),
|
|
380
380
|
onClick: h
|
|
381
381
|
}, [
|
|
382
|
-
|
|
383
|
-
], 10,
|
|
382
|
+
Qt(m.$slots, "default", Kt(Gt({ resolved: o.value, isMatch: rt(s), isExactMatch: rt(c), isExternal: f.value })))
|
|
383
|
+
], 10, Xe));
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
|
-
function
|
|
386
|
+
function re(t) {
|
|
387
387
|
return "children" in t;
|
|
388
388
|
}
|
|
389
|
-
function Ze(t) {
|
|
390
|
-
return ne(t) && !("component" in t) && !("components" in t);
|
|
391
|
-
}
|
|
392
389
|
function tn(t) {
|
|
393
|
-
return
|
|
390
|
+
return re(t) && !("component" in t) && !("components" in t);
|
|
394
391
|
}
|
|
395
392
|
function en(t) {
|
|
393
|
+
return typeof t == "object" && t !== null && "component" in t;
|
|
394
|
+
}
|
|
395
|
+
function nn(t) {
|
|
396
396
|
return typeof t == "object" && t !== null && "components" in t;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const oe = /* @__PURE__ */ et({
|
|
399
399
|
__name: "routerView",
|
|
400
400
|
props: {
|
|
401
401
|
name: {}
|
|
402
402
|
},
|
|
403
403
|
setup(t) {
|
|
404
|
-
const { name: e = "default" } = t, n =
|
|
405
|
-
|
|
404
|
+
const { name: e = "default" } = t, n = Je(), o = Me(), r = bt();
|
|
405
|
+
He(Zt, r + 1);
|
|
406
406
|
const a = H(() => {
|
|
407
407
|
if (o.value)
|
|
408
408
|
return o.value.component;
|
|
@@ -410,13 +410,13 @@ const re = /* @__PURE__ */ et({
|
|
|
410
410
|
if (!c)
|
|
411
411
|
return null;
|
|
412
412
|
const f = s(c)[e];
|
|
413
|
-
return f ? typeof f == "function" ?
|
|
413
|
+
return f ? typeof f == "function" ? je(f) : f : null;
|
|
414
414
|
});
|
|
415
415
|
function s(c) {
|
|
416
|
-
return
|
|
416
|
+
return nn(c) ? c.components : en(c) ? { default: c.component } : {};
|
|
417
417
|
}
|
|
418
|
-
return (c, i) =>
|
|
419
|
-
(
|
|
418
|
+
return (c, i) => Qt(c.$slots, "default", Kt(Gt({ route: rt(n), component: a.value, rejection: rt(o) })), () => [
|
|
419
|
+
(Jt(), Ve(Ce(a.value)))
|
|
420
420
|
]);
|
|
421
421
|
}
|
|
422
422
|
});
|
|
@@ -426,11 +426,11 @@ function ur(t, e) {
|
|
|
426
426
|
expose: [],
|
|
427
427
|
setup() {
|
|
428
428
|
const n = e();
|
|
429
|
-
return "then" in n ? () => ot(
|
|
429
|
+
return "then" in n ? () => ot(rn(t, n)) : () => ot(t, n);
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function rn(t, e) {
|
|
434
434
|
return et({
|
|
435
435
|
name: "AsyncPropsWrapper",
|
|
436
436
|
expose: [],
|
|
@@ -441,39 +441,39 @@ function nn(t, e) {
|
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
443
|
const O = "[", D = "]";
|
|
444
|
-
function
|
|
444
|
+
function on(t) {
|
|
445
445
|
return t !== String && t !== Boolean && t !== Number && t !== Date;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return typeof t == "function" &&
|
|
447
|
+
function an(t) {
|
|
448
|
+
return typeof t == "function" && on(t);
|
|
449
449
|
}
|
|
450
450
|
function ht(t) {
|
|
451
451
|
return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function sn(t) {
|
|
454
454
|
return ht(t) && t.defaultValue !== void 0;
|
|
455
455
|
}
|
|
456
456
|
function fr(t, e) {
|
|
457
|
-
return
|
|
457
|
+
return fn(t, e);
|
|
458
458
|
}
|
|
459
459
|
function At(t) {
|
|
460
460
|
return typeof t == "string" && t.length > 0;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function cn(t, e) {
|
|
463
463
|
return t[e] ?? String;
|
|
464
464
|
}
|
|
465
465
|
const j = {
|
|
466
466
|
invalid: (t) => {
|
|
467
467
|
throw new z(t);
|
|
468
468
|
}
|
|
469
|
-
},
|
|
469
|
+
}, un = {
|
|
470
470
|
get: (t) => t,
|
|
471
471
|
set: (t, { invalid: e }) => {
|
|
472
472
|
if (typeof t != "string")
|
|
473
473
|
throw e();
|
|
474
474
|
return t;
|
|
475
475
|
}
|
|
476
|
-
},
|
|
476
|
+
}, ae = {
|
|
477
477
|
get: (t, { invalid: e }) => {
|
|
478
478
|
if (t === "true")
|
|
479
479
|
return !0;
|
|
@@ -486,7 +486,7 @@ const j = {
|
|
|
486
486
|
throw e();
|
|
487
487
|
return t.toString();
|
|
488
488
|
}
|
|
489
|
-
},
|
|
489
|
+
}, se = {
|
|
490
490
|
get: (t, { invalid: e }) => {
|
|
491
491
|
const n = Number(t);
|
|
492
492
|
if (isNaN(n))
|
|
@@ -498,7 +498,7 @@ const j = {
|
|
|
498
498
|
throw e();
|
|
499
499
|
return t.toString();
|
|
500
500
|
}
|
|
501
|
-
},
|
|
501
|
+
}, ce = {
|
|
502
502
|
get: (t, { invalid: e }) => {
|
|
503
503
|
const n = new Date(t);
|
|
504
504
|
if (isNaN(n.getTime()))
|
|
@@ -510,7 +510,7 @@ const j = {
|
|
|
510
510
|
throw e();
|
|
511
511
|
return t.toISOString();
|
|
512
512
|
}
|
|
513
|
-
},
|
|
513
|
+
}, ie = {
|
|
514
514
|
get: (t, { invalid: e }) => {
|
|
515
515
|
try {
|
|
516
516
|
return JSON.parse(t);
|
|
@@ -528,23 +528,23 @@ const j = {
|
|
|
528
528
|
};
|
|
529
529
|
function Lt(t, e, n = !1) {
|
|
530
530
|
if (t === void 0 || !At(t)) {
|
|
531
|
-
if (
|
|
531
|
+
if (sn(e))
|
|
532
532
|
return e.defaultValue;
|
|
533
533
|
if (n)
|
|
534
534
|
return;
|
|
535
535
|
throw new z();
|
|
536
536
|
}
|
|
537
537
|
if (e === String)
|
|
538
|
-
return
|
|
538
|
+
return un.get(t, j);
|
|
539
539
|
if (e === Boolean)
|
|
540
|
-
return oe.get(t, j);
|
|
541
|
-
if (e === Number)
|
|
542
540
|
return ae.get(t, j);
|
|
543
|
-
if (e ===
|
|
541
|
+
if (e === Number)
|
|
544
542
|
return se.get(t, j);
|
|
545
|
-
if (e ===
|
|
543
|
+
if (e === Date)
|
|
546
544
|
return ce.get(t, j);
|
|
547
|
-
if (
|
|
545
|
+
if (e === JSON)
|
|
546
|
+
return ie.get(t, j);
|
|
547
|
+
if (an(e))
|
|
548
548
|
return e(t, j);
|
|
549
549
|
if (ht(e))
|
|
550
550
|
return e.get(t, j);
|
|
@@ -562,13 +562,13 @@ function Bt(t, e, n = !1) {
|
|
|
562
562
|
throw new z();
|
|
563
563
|
}
|
|
564
564
|
if (e === Boolean)
|
|
565
|
-
return oe.set(t, j);
|
|
566
|
-
if (e === Number)
|
|
567
565
|
return ae.set(t, j);
|
|
568
|
-
if (e ===
|
|
566
|
+
if (e === Number)
|
|
569
567
|
return se.set(t, j);
|
|
570
|
-
if (e ===
|
|
568
|
+
if (e === Date)
|
|
571
569
|
return ce.set(t, j);
|
|
570
|
+
if (e === JSON)
|
|
571
|
+
return ie.set(t, j);
|
|
572
572
|
if (ht(e))
|
|
573
573
|
return e.set(t, j);
|
|
574
574
|
try {
|
|
@@ -577,7 +577,7 @@ function Bt(t, e, n = !1) {
|
|
|
577
577
|
throw new z();
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function fn(t, e) {
|
|
581
581
|
return ht(t) ? { ...t, defaultValue: e ?? t.defaultValue } : {
|
|
582
582
|
get: (n) => Lt(n, t),
|
|
583
583
|
set: (n) => Bt(n, t),
|
|
@@ -612,7 +612,7 @@ function J(t, e) {
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
var ct = "beforeunload",
|
|
615
|
+
var ct = "beforeunload", ln = "hashchange", ue = "popstate";
|
|
616
616
|
function Ct(t) {
|
|
617
617
|
t === void 0 && (t = {});
|
|
618
618
|
var e = t, n = e.window, o = n === void 0 ? document.defaultView : n, r = o.history;
|
|
@@ -654,7 +654,7 @@ function Ct(t) {
|
|
|
654
654
|
q(p);
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
o.addEventListener(
|
|
657
|
+
o.addEventListener(ue, c);
|
|
658
658
|
var i = L.Pop, f = a(), h = f[0], m = f[1], b = X(), y = X();
|
|
659
659
|
h == null && (h = 0, r.replaceState(M({}, r.state, {
|
|
660
660
|
idx: h
|
|
@@ -751,7 +751,7 @@ function Ct(t) {
|
|
|
751
751
|
};
|
|
752
752
|
return P;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function hn(t) {
|
|
755
755
|
t === void 0 && (t = {});
|
|
756
756
|
var e = t, n = e.window, o = n === void 0 ? document.defaultView : n, r = o.history;
|
|
757
757
|
function a() {
|
|
@@ -792,7 +792,7 @@ function ln(t) {
|
|
|
792
792
|
d(u);
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
|
-
o.addEventListener(
|
|
795
|
+
o.addEventListener(ue, c), o.addEventListener(ln, function() {
|
|
796
796
|
var u = a(), l = u[1];
|
|
797
797
|
Q(l) !== Q(m) && c();
|
|
798
798
|
});
|
|
@@ -1031,10 +1031,10 @@ function tt(t) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return e;
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const n =
|
|
1034
|
+
function pn(t, e) {
|
|
1035
|
+
const n = It({ ...t }), o = (s) => {
|
|
1036
1036
|
Object.assign(n, { ...s });
|
|
1037
|
-
}, r = n, a =
|
|
1037
|
+
}, r = n, a = Te(r, e);
|
|
1038
1038
|
return {
|
|
1039
1039
|
currentRoute: r,
|
|
1040
1040
|
routerRoute: a,
|
|
@@ -1042,9 +1042,9 @@ function hn(t, e) {
|
|
|
1042
1042
|
};
|
|
1043
1043
|
}
|
|
1044
1044
|
function K(t) {
|
|
1045
|
-
return !t.startsWith("http") ?
|
|
1045
|
+
return !t.startsWith("http") ? mn(t) : dn(t);
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function dn(t) {
|
|
1048
1048
|
const { protocol: e, host: n, pathname: o, search: r, searchParams: a, hash: s } = new URL(t, t);
|
|
1049
1049
|
return {
|
|
1050
1050
|
protocol: e,
|
|
@@ -1055,7 +1055,7 @@ function pn(t) {
|
|
|
1055
1055
|
hash: s
|
|
1056
1056
|
};
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function mn(t) {
|
|
1059
1059
|
const { pathname: e, search: n, searchParams: o, hash: r } = new URL(t, "https://localhost");
|
|
1060
1060
|
return {
|
|
1061
1061
|
pathname: e,
|
|
@@ -1064,17 +1064,17 @@ function dn(t) {
|
|
|
1064
1064
|
hash: r
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function yn(t) {
|
|
1068
1068
|
return (e) => {
|
|
1069
1069
|
const { host: n } = K(e);
|
|
1070
1070
|
return !(n === void 0 || n === t);
|
|
1071
1071
|
};
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function fe() {
|
|
1074
1074
|
return typeof window < "u" && typeof window.document < "u";
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1077
|
-
const n =
|
|
1076
|
+
function gn({ mode: t, listener: e }) {
|
|
1077
|
+
const n = Rn(t), o = (i, f) => {
|
|
1078
1078
|
if (f != null && f.replace)
|
|
1079
1079
|
return n.replace(i);
|
|
1080
1080
|
n.push(i);
|
|
@@ -1095,28 +1095,28 @@ function yn({ mode: t, listener: e }) {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function Rn(t = "auto") {
|
|
1099
1099
|
switch (t) {
|
|
1100
1100
|
case "auto":
|
|
1101
|
-
return
|
|
1101
|
+
return fe() ? Ct() : qt();
|
|
1102
1102
|
case "browser":
|
|
1103
1103
|
return Ct();
|
|
1104
1104
|
case "memory":
|
|
1105
1105
|
return qt();
|
|
1106
1106
|
case "hash":
|
|
1107
|
-
return
|
|
1107
|
+
return hn();
|
|
1108
1108
|
default:
|
|
1109
1109
|
const e = t;
|
|
1110
1110
|
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function vn(t) {
|
|
1114
1114
|
return et(() => () => ot("h1", t), {
|
|
1115
1115
|
name: t,
|
|
1116
1116
|
props: []
|
|
1117
1117
|
});
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function le(t) {
|
|
1120
1120
|
const e = new URLSearchParams(t);
|
|
1121
1121
|
return {
|
|
1122
1122
|
get: (n) => e.get(n),
|
|
@@ -1124,14 +1124,14 @@ function fe(t) {
|
|
|
1124
1124
|
};
|
|
1125
1125
|
}
|
|
1126
1126
|
const Ot = Symbol();
|
|
1127
|
-
function
|
|
1127
|
+
function wn({
|
|
1128
1128
|
rejections: t
|
|
1129
1129
|
}) {
|
|
1130
1130
|
const e = (s) => {
|
|
1131
1131
|
const c = {
|
|
1132
1132
|
...t
|
|
1133
1133
|
};
|
|
1134
|
-
return at(c[s] ??
|
|
1134
|
+
return at(c[s] ?? vn(s));
|
|
1135
1135
|
}, n = (s) => {
|
|
1136
1136
|
const c = at(e(s)), i = {
|
|
1137
1137
|
name: s,
|
|
@@ -1143,7 +1143,7 @@ function vn({
|
|
|
1143
1143
|
matched: i,
|
|
1144
1144
|
matches: [i],
|
|
1145
1145
|
key: s,
|
|
1146
|
-
query:
|
|
1146
|
+
query: le(""),
|
|
1147
1147
|
params: {},
|
|
1148
1148
|
[Ot]: !0
|
|
1149
1149
|
};
|
|
@@ -1154,7 +1154,7 @@ function vn({
|
|
|
1154
1154
|
}
|
|
1155
1155
|
const c = e(s);
|
|
1156
1156
|
a.value = { type: s, component: c };
|
|
1157
|
-
}, a =
|
|
1157
|
+
}, a = qe(null);
|
|
1158
1158
|
return {
|
|
1159
1159
|
setRejection: r,
|
|
1160
1160
|
rejection: a,
|
|
@@ -1162,12 +1162,12 @@ function vn({
|
|
|
1162
1162
|
isRejectionRoute: o
|
|
1163
1163
|
};
|
|
1164
1164
|
}
|
|
1165
|
-
class
|
|
1165
|
+
class En extends Error {
|
|
1166
1166
|
constructor(e) {
|
|
1167
1167
|
super(`Route disabled: "${e}"`);
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
class
|
|
1170
|
+
class bn extends Error {
|
|
1171
1171
|
constructor(e) {
|
|
1172
1172
|
super(`Route not found: "${e}"`);
|
|
1173
1173
|
}
|
|
@@ -1175,7 +1175,7 @@ class En extends Error {
|
|
|
1175
1175
|
function Ut(t) {
|
|
1176
1176
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function Pn(t, e) {
|
|
1179
1179
|
const n = Array.from(t.matchAll(e));
|
|
1180
1180
|
if (n.length === 0)
|
|
1181
1181
|
return [t];
|
|
@@ -1188,74 +1188,74 @@ function bn(t, e) {
|
|
|
1188
1188
|
}, []), a = t.slice(o);
|
|
1189
1189
|
return a && r.push(a), r;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
const e =
|
|
1191
|
+
function Sn(t) {
|
|
1192
|
+
const e = he(t.path.toString());
|
|
1193
1193
|
return new RegExp(`^${e}$`, "i");
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function kn(t) {
|
|
1196
1196
|
const e = new URLSearchParams(t.query.toString());
|
|
1197
1197
|
return Array.from(e.entries()).filter(([, n]) => !Rt(n)).map(([n, o]) => {
|
|
1198
|
-
const r =
|
|
1198
|
+
const r = he(o);
|
|
1199
1199
|
return new RegExp(`${Ut(n)}=${r}(&|$)`, "i");
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
function le(t) {
|
|
1203
|
-
return bn(t, new RegExp(kn, "g")).map((e) => e.startsWith(O) ? he(e) : Ut(e)).join("");
|
|
1204
|
-
}
|
|
1205
1202
|
function he(t) {
|
|
1203
|
+
return Pn(t, new RegExp(xn, "g")).map((e) => e.startsWith(O) ? pe(e) : Ut(e)).join("");
|
|
1204
|
+
}
|
|
1205
|
+
function pe(t) {
|
|
1206
1206
|
return [
|
|
1207
|
-
|
|
1208
|
-
|
|
1207
|
+
An,
|
|
1208
|
+
Ln
|
|
1209
1209
|
].reduce((e, n) => n(e), t);
|
|
1210
1210
|
}
|
|
1211
|
-
const
|
|
1212
|
-
function
|
|
1211
|
+
const xn = `\\${O}\\??([\\w-_]+)\\${D}`, $t = `\\${O}\\?([\\w-_]+)\\${D}`, de = `\\${O}([\\w-_]+)\\${D}`;
|
|
1212
|
+
function An(t) {
|
|
1213
1213
|
return t.replace(new RegExp($t, "g"), ".*");
|
|
1214
1214
|
}
|
|
1215
1215
|
function Rt(t) {
|
|
1216
1216
|
return new RegExp($t, "g").test(t);
|
|
1217
1217
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return t.replace(new RegExp(
|
|
1218
|
+
function Ln(t) {
|
|
1219
|
+
return t.replace(new RegExp(de, "g"), ".+");
|
|
1220
1220
|
}
|
|
1221
1221
|
function pt(t) {
|
|
1222
|
-
const [e] = ft(t, new RegExp($t, "g")), [n] = ft(t, new RegExp(
|
|
1222
|
+
const [e] = ft(t, new RegExp($t, "g")), [n] = ft(t, new RegExp(de, "g"));
|
|
1223
1223
|
return e ?? n;
|
|
1224
1224
|
}
|
|
1225
1225
|
function ft(t, e) {
|
|
1226
1226
|
return Array.from(t.matchAll(e)).flatMap(([, ...o]) => o.map((r) => At(r) ? r : ""));
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
const o =
|
|
1228
|
+
function me(t, e, n) {
|
|
1229
|
+
const o = ge(e, n), [r] = ft(t, o);
|
|
1230
1230
|
return r;
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function ye(t, e) {
|
|
1233
1233
|
if (!e)
|
|
1234
1234
|
return t;
|
|
1235
|
-
const { name: n, param: o, value: r } = e, a =
|
|
1235
|
+
const { name: n, param: o, value: r } = e, a = ge(t, n);
|
|
1236
1236
|
return ft(t, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () => Bt(r, o, n.startsWith("?"))), t);
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function ge(t, e) {
|
|
1239
1239
|
const n = [
|
|
1240
|
-
Ln,
|
|
1241
1240
|
Bn,
|
|
1242
|
-
|
|
1241
|
+
Un,
|
|
1242
|
+
pe
|
|
1243
1243
|
].reduce((o, r) => r(o, e), t);
|
|
1244
1244
|
return new RegExp(n, "g");
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Bn(t, e) {
|
|
1247
1247
|
if (!e.startsWith("?"))
|
|
1248
1248
|
return t;
|
|
1249
1249
|
const n = new RegExp(`\\${O}\\${e}\\${D}`, "g");
|
|
1250
1250
|
return t.replace(n, "(.*)");
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function Un(t, e) {
|
|
1253
1253
|
if (e.startsWith("?"))
|
|
1254
1254
|
return t;
|
|
1255
1255
|
const n = new RegExp(`\\${O}${e}\\${D}`, "g");
|
|
1256
1256
|
return t.replace(n, "(.+)");
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function Re(t, ...e) {
|
|
1259
1259
|
return e.reduce((n, o) => {
|
|
1260
1260
|
if (!o)
|
|
1261
1261
|
return n;
|
|
@@ -1263,25 +1263,25 @@ function ge(t, ...e) {
|
|
|
1263
1263
|
return Object.keys(r).length === 0 ? n : n.includes("?") ? `${n}&${r}` : `${n}?${r}`;
|
|
1264
1264
|
}, t);
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1267
|
-
const { params: n = {}, query: o } = e, r =
|
|
1268
|
-
return
|
|
1266
|
+
function $n(t, e = {}) {
|
|
1267
|
+
const { params: n = {}, query: o } = e, r = Nn(t.host, n), a = Hn(t.path, n), s = jn(t.query, n);
|
|
1268
|
+
return Re(`${r}${a}`, s, o);
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1270
|
+
function Nn(t, e) {
|
|
1271
1271
|
const n = t.toString();
|
|
1272
1272
|
return Object.entries(t.params).reduce((o, [r, a]) => {
|
|
1273
1273
|
const s = pt(`${O}${r}${D}`);
|
|
1274
|
-
return s ?
|
|
1274
|
+
return s ? ye(o, { name: r, param: a, value: e[s] }) : o;
|
|
1275
1275
|
}, n);
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function Hn(t, e) {
|
|
1278
1278
|
const n = t.toString();
|
|
1279
1279
|
return Object.entries(t.params).reduce((o, [r, a]) => {
|
|
1280
1280
|
const s = pt(`${O}${r}${D}`);
|
|
1281
|
-
return s ?
|
|
1281
|
+
return s ? ye(o, { name: r, param: a, value: e[s] }) : o;
|
|
1282
1282
|
}, n);
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function jn(t, e) {
|
|
1285
1285
|
const n = t.toString();
|
|
1286
1286
|
if (!n)
|
|
1287
1287
|
return {};
|
|
@@ -1294,56 +1294,56 @@ function Hn(t, e) {
|
|
|
1294
1294
|
return Rt(s) && h ? r : { ...r, [a]: f };
|
|
1295
1295
|
}, {});
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Vn(t) {
|
|
1298
1298
|
return (e, n, o) => {
|
|
1299
1299
|
if (F(e))
|
|
1300
|
-
return
|
|
1300
|
+
return Re(e, (n ?? {}).query);
|
|
1301
1301
|
const r = n ?? {}, a = o ?? {}, s = t.find((i) => i.key === e);
|
|
1302
1302
|
if (!s)
|
|
1303
|
-
throw new
|
|
1303
|
+
throw new bn(String(e));
|
|
1304
1304
|
if (s.matched.disabled)
|
|
1305
|
-
throw new
|
|
1306
|
-
return
|
|
1305
|
+
throw new En(String(e));
|
|
1306
|
+
return $n(s, {
|
|
1307
1307
|
params: r,
|
|
1308
1308
|
query: a.query
|
|
1309
1309
|
});
|
|
1310
1310
|
};
|
|
1311
1311
|
}
|
|
1312
|
-
class
|
|
1312
|
+
class Cn extends Error {
|
|
1313
1313
|
constructor() {
|
|
1314
1314
|
super("initialUrl must be set if window.location is unavailable");
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
|
-
function
|
|
1317
|
+
function qn(t) {
|
|
1318
1318
|
if (t)
|
|
1319
1319
|
return t;
|
|
1320
|
-
if (
|
|
1320
|
+
if (fe())
|
|
1321
1321
|
return window.location.toString();
|
|
1322
|
-
throw new
|
|
1322
|
+
throw new Cn();
|
|
1323
1323
|
}
|
|
1324
|
-
const
|
|
1324
|
+
const _n = (t, e) => {
|
|
1325
1325
|
try {
|
|
1326
|
-
|
|
1326
|
+
ve(t, e);
|
|
1327
1327
|
} catch {
|
|
1328
1328
|
return !1;
|
|
1329
1329
|
}
|
|
1330
1330
|
return !0;
|
|
1331
|
-
},
|
|
1331
|
+
}, ve = (t, e) => {
|
|
1332
1332
|
const { pathname: n, search: o } = K(e);
|
|
1333
1333
|
return {
|
|
1334
|
-
...
|
|
1335
|
-
...
|
|
1334
|
+
...On(t.path, n),
|
|
1335
|
+
...Wn(t.query, o)
|
|
1336
1336
|
};
|
|
1337
1337
|
};
|
|
1338
|
-
function
|
|
1338
|
+
function On(t, e) {
|
|
1339
1339
|
const n = {}, o = decodeURIComponent(e);
|
|
1340
1340
|
for (const [r, a] of Object.entries(t.params)) {
|
|
1341
|
-
const s = r.startsWith("?"), c = s ? r.slice(1) : r, i =
|
|
1341
|
+
const s = r.startsWith("?"), c = s ? r.slice(1) : r, i = me(o, t.toString(), r), f = Lt(i, a, s);
|
|
1342
1342
|
n[c] = f;
|
|
1343
1343
|
}
|
|
1344
1344
|
return n;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function Wn(t, e) {
|
|
1347
1347
|
const n = {}, o = new URLSearchParams(e);
|
|
1348
1348
|
for (const [r, a] of Object.entries(t.params)) {
|
|
1349
1349
|
const s = r.startsWith("?"), c = s ? r.slice(1) : r, i = o.get(c) ?? void 0, f = Lt(i, a, s);
|
|
@@ -1351,14 +1351,14 @@ function On(t, e) {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
return n;
|
|
1353
1353
|
}
|
|
1354
|
-
const
|
|
1354
|
+
const Mn = (t) => "name" in t.matched && !!t.matched.name, Dn = (t, e) => {
|
|
1355
1355
|
const { pathname: n } = K(e);
|
|
1356
|
-
return
|
|
1357
|
-
},
|
|
1356
|
+
return Sn(t).test(n);
|
|
1357
|
+
}, Tn = (t, e) => {
|
|
1358
1358
|
const { search: n } = K(e);
|
|
1359
|
-
return
|
|
1359
|
+
return kn(t).every((r) => r.test(n));
|
|
1360
1360
|
};
|
|
1361
|
-
function
|
|
1361
|
+
function In(t) {
|
|
1362
1362
|
const { searchParams: e, pathname: n } = K(t), o = -1, r = 1;
|
|
1363
1363
|
return (a, s) => {
|
|
1364
1364
|
const c = Mt(a, e), i = Wt(a, n), f = Mt(s, e), h = Wt(s, n);
|
|
@@ -1366,24 +1366,24 @@ function Tn(t) {
|
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
1368
|
function Wt(t, e) {
|
|
1369
|
-
const n = Object.keys(t.path.params).filter((r) => r.startsWith("?")).map((r) => r), o = n.filter((r) =>
|
|
1369
|
+
const n = Object.keys(t.path.params).filter((r) => r.startsWith("?")).map((r) => r), o = n.filter((r) => me(e, t.path.toString(), r) === void 0);
|
|
1370
1370
|
return n.length - o.length;
|
|
1371
1371
|
}
|
|
1372
1372
|
function Mt(t, e) {
|
|
1373
1373
|
const n = new URLSearchParams(t.query.toString()), o = Array.from(n.keys()), r = o.filter((a) => !e.has(a));
|
|
1374
1374
|
return o.length - r.length;
|
|
1375
1375
|
}
|
|
1376
|
-
const
|
|
1377
|
-
Wn,
|
|
1376
|
+
const Fn = [
|
|
1378
1377
|
Mn,
|
|
1379
1378
|
Dn,
|
|
1380
|
-
|
|
1379
|
+
Tn,
|
|
1380
|
+
_n
|
|
1381
1381
|
];
|
|
1382
1382
|
function gt(t, e) {
|
|
1383
|
-
const n =
|
|
1383
|
+
const n = In(e), o = t.filter((i) => Fn.every((f) => f(i, e))).sort(n);
|
|
1384
1384
|
if (o.length === 0)
|
|
1385
1385
|
return;
|
|
1386
|
-
const [r] = o, { search: a } = K(e), s =
|
|
1386
|
+
const [r] = o, { search: a } = K(e), s = le(a), c = ve(r, e);
|
|
1387
1387
|
return {
|
|
1388
1388
|
matched: r.matched,
|
|
1389
1389
|
matches: r.matches,
|
|
@@ -1395,17 +1395,17 @@ function gt(t, e) {
|
|
|
1395
1395
|
function Nt(t) {
|
|
1396
1396
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1397
1397
|
}
|
|
1398
|
-
function
|
|
1398
|
+
function Jn(t) {
|
|
1399
1399
|
return t.every((e) => Array.isArray(e));
|
|
1400
1400
|
}
|
|
1401
1401
|
function lr(t, e = {}) {
|
|
1402
|
-
const n =
|
|
1402
|
+
const n = Jn(t) ? t.flat() : t, o = Vn(n), r = gn({
|
|
1403
1403
|
mode: e.historyMode,
|
|
1404
1404
|
listener: () => {
|
|
1405
1405
|
const v = Q(location);
|
|
1406
1406
|
k(v);
|
|
1407
1407
|
}
|
|
1408
|
-
}), { runBeforeRouteHooks: a, runAfterRouteHooks: s } =
|
|
1408
|
+
}), { runBeforeRouteHooks: a, runAfterRouteHooks: s } = Ge(), {
|
|
1409
1409
|
hooks: c,
|
|
1410
1410
|
onBeforeRouteEnter: i,
|
|
1411
1411
|
onAfterRouteUpdate: f,
|
|
@@ -1413,7 +1413,7 @@ function lr(t, e = {}) {
|
|
|
1413
1413
|
onAfterRouteEnter: m,
|
|
1414
1414
|
onBeforeRouteUpdate: b,
|
|
1415
1415
|
onAfterRouteLeave: y
|
|
1416
|
-
} =
|
|
1416
|
+
} = Ye();
|
|
1417
1417
|
async function k(v, { replace: N } = {}) {
|
|
1418
1418
|
if (r.stopListening(), S(v))
|
|
1419
1419
|
return r.update(v, { replace: N });
|
|
@@ -1451,8 +1451,8 @@ function lr(t, e = {}) {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
const x = (v, N, _) => {
|
|
1453
1453
|
if (F(v)) {
|
|
1454
|
-
const nt = { ...N },
|
|
1455
|
-
return k(
|
|
1454
|
+
const nt = { ...N }, xe = o(v, nt);
|
|
1455
|
+
return k(xe, { replace: nt.replace });
|
|
1456
1456
|
}
|
|
1457
1457
|
const T = { ..._ }, W = o(v, N ?? {}, T);
|
|
1458
1458
|
return k(W, { replace: T.replace });
|
|
@@ -1470,11 +1470,11 @@ function lr(t, e = {}) {
|
|
|
1470
1470
|
}
|
|
1471
1471
|
if (!S(v))
|
|
1472
1472
|
return gt(n, v);
|
|
1473
|
-
}, { setRejection: d, rejection: g, getRejectionRoute: E } =
|
|
1473
|
+
}, { setRejection: d, rejection: g, getRejectionRoute: E } = wn(e), P = E("NotFound"), { currentRoute: p, routerRoute: u, updateRoute: l } = pn(P, x);
|
|
1474
1474
|
r.startListening();
|
|
1475
|
-
const R =
|
|
1475
|
+
const R = qn(e.initialUrl), { host: w } = K(R), S = yn(w), A = k(R, { replace: !0 });
|
|
1476
1476
|
function U(v) {
|
|
1477
|
-
v.component("RouterView",
|
|
1477
|
+
v.component("RouterView", oe), v.component("RouterLink", Ze), v.provide(Yt, g), v.provide(te, c), v.provide(zt, $);
|
|
1478
1478
|
}
|
|
1479
1479
|
const $ = {
|
|
1480
1480
|
route: u,
|
|
@@ -1500,18 +1500,18 @@ function lr(t, e = {}) {
|
|
|
1500
1500
|
return $;
|
|
1501
1501
|
}
|
|
1502
1502
|
function dt(...t) {
|
|
1503
|
-
const e = t.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(
|
|
1503
|
+
const e = t.flatMap((n) => Array.isArray(n) ? n : Object.keys(n).map(Kn));
|
|
1504
1504
|
for (const n of e)
|
|
1505
|
-
if (
|
|
1506
|
-
throw new
|
|
1505
|
+
if (Qn(e, n) > 1)
|
|
1506
|
+
throw new _e(n);
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function Qn(t, e) {
|
|
1509
1509
|
return t.filter((n) => e === n).length;
|
|
1510
1510
|
}
|
|
1511
|
-
function
|
|
1511
|
+
function Kn(t) {
|
|
1512
1512
|
return t.startsWith("?") ? t.slice(1) : t;
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function we(t, e) {
|
|
1515
1515
|
dt(t.params, e.params);
|
|
1516
1516
|
const n = `${t.path}${e.path}`;
|
|
1517
1517
|
return {
|
|
@@ -1520,7 +1520,7 @@ function ve(t, e) {
|
|
|
1520
1520
|
toString: () => n
|
|
1521
1521
|
};
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function Ee(t, e) {
|
|
1524
1524
|
dt(t.params, e.params);
|
|
1525
1525
|
const n = [t.query, e.query].filter(At).join("&");
|
|
1526
1526
|
return {
|
|
@@ -1535,18 +1535,18 @@ function Ht(t, e) {
|
|
|
1535
1535
|
const c = pt(a);
|
|
1536
1536
|
if (!c)
|
|
1537
1537
|
return r;
|
|
1538
|
-
const i =
|
|
1538
|
+
const i = cn(e, c);
|
|
1539
1539
|
return dt([c], r), r[s] = i, r;
|
|
1540
1540
|
}, {});
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1542
|
+
function be(t, e) {
|
|
1543
1543
|
return {
|
|
1544
1544
|
host: t,
|
|
1545
1545
|
params: Ht(t, e),
|
|
1546
1546
|
toString: () => t
|
|
1547
1547
|
};
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1549
|
+
function Dt(t, e) {
|
|
1550
1550
|
return {
|
|
1551
1551
|
path: t,
|
|
1552
1552
|
params: Ht(t, e),
|
|
@@ -1556,10 +1556,10 @@ function Kn(t, e) {
|
|
|
1556
1556
|
function Gn(t) {
|
|
1557
1557
|
return Nt(t) && typeof t.path == "string";
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return Gn(t) ? t :
|
|
1559
|
+
function Pe(t) {
|
|
1560
|
+
return t === void 0 ? Dt("", {}) : Gn(t) ? t : Dt(t, {});
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function Tt(t, e) {
|
|
1563
1563
|
return {
|
|
1564
1564
|
query: t,
|
|
1565
1565
|
params: Ht(t, e),
|
|
@@ -1569,25 +1569,25 @@ function Dt(t, e) {
|
|
|
1569
1569
|
function zn(t) {
|
|
1570
1570
|
return Nt(t) && typeof t.query == "string";
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1573
|
-
return t === void 0 ?
|
|
1572
|
+
function Se(t) {
|
|
1573
|
+
return t === void 0 ? Tt("", {}) : zn(t) ? t : Tt(t, {});
|
|
1574
1574
|
}
|
|
1575
1575
|
function hr(t) {
|
|
1576
1576
|
const e = t.reduce((n, o) => {
|
|
1577
1577
|
const r = Yn(o);
|
|
1578
|
-
return
|
|
1578
|
+
return re(o) && n.push(...o.children.map((a) => ({
|
|
1579
1579
|
...a,
|
|
1580
1580
|
key: Et(r.key, a.key),
|
|
1581
|
-
path:
|
|
1582
|
-
query:
|
|
1581
|
+
path: we(r.path, a.path),
|
|
1582
|
+
query: Ee(r.query, a.query),
|
|
1583
1583
|
matches: [r.matched, ...a.matches],
|
|
1584
1584
|
depth: a.depth + 1
|
|
1585
1585
|
}))), n.push(r), n;
|
|
1586
1586
|
}, []);
|
|
1587
|
-
return
|
|
1587
|
+
return ke(e), e;
|
|
1588
1588
|
}
|
|
1589
1589
|
function Yn(t) {
|
|
1590
|
-
const e = Xn(t), n =
|
|
1590
|
+
const e = Xn(t), n = Pe(t.path), o = Se(t.query), r = at({ meta: {}, ...e });
|
|
1591
1591
|
return {
|
|
1592
1592
|
matched: r,
|
|
1593
1593
|
matches: [r],
|
|
@@ -1596,22 +1596,22 @@ function Yn(t) {
|
|
|
1596
1596
|
query: o,
|
|
1597
1597
|
depth: 1,
|
|
1598
1598
|
disabled: t.disabled ?? !1,
|
|
1599
|
-
host:
|
|
1599
|
+
host: be("", {})
|
|
1600
1600
|
};
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function ke(t) {
|
|
1603
1603
|
t.forEach(({ path: e, query: n, host: o }) => {
|
|
1604
1604
|
dt(e.params, n.params, o.params);
|
|
1605
1605
|
});
|
|
1606
1606
|
}
|
|
1607
1607
|
function Xn(t) {
|
|
1608
|
-
return
|
|
1608
|
+
return tn(t) ? { ...t, component: oe } : t;
|
|
1609
1609
|
}
|
|
1610
1610
|
function Zn(t) {
|
|
1611
1611
|
return Nt(t) && typeof t.host == "string";
|
|
1612
1612
|
}
|
|
1613
1613
|
function tr(t) {
|
|
1614
|
-
return Zn(t) ? t :
|
|
1614
|
+
return Zn(t) ? t : be(t, {});
|
|
1615
1615
|
}
|
|
1616
1616
|
function pr(t) {
|
|
1617
1617
|
const e = t.reduce((n, o) => {
|
|
@@ -1619,17 +1619,17 @@ function pr(t) {
|
|
|
1619
1619
|
return o.children && n.push(...o.children.map((a) => ({
|
|
1620
1620
|
...a,
|
|
1621
1621
|
key: Et(r.key, a.key),
|
|
1622
|
-
path:
|
|
1623
|
-
query:
|
|
1622
|
+
path: we(r.path, a.path),
|
|
1623
|
+
query: Ee(r.query, a.query),
|
|
1624
1624
|
matches: [r.matched, ...a.matches],
|
|
1625
1625
|
depth: a.depth + 1,
|
|
1626
1626
|
host: r.host
|
|
1627
1627
|
}))), n.push(r), n;
|
|
1628
1628
|
}, []);
|
|
1629
|
-
return
|
|
1629
|
+
return ke(e), e;
|
|
1630
1630
|
}
|
|
1631
1631
|
function er(t) {
|
|
1632
|
-
const e =
|
|
1632
|
+
const e = Pe(t.path), n = Se(t.query), o = tr(t.host ?? "");
|
|
1633
1633
|
return {
|
|
1634
1634
|
matched: at({ meta: {}, ...t, name: t.name ?? "", children: [] }),
|
|
1635
1635
|
matches: [],
|
|
@@ -1642,24 +1642,24 @@ function er(t) {
|
|
|
1642
1642
|
};
|
|
1643
1643
|
}
|
|
1644
1644
|
export {
|
|
1645
|
-
|
|
1646
|
-
|
|
1645
|
+
_e as DuplicateParamsError,
|
|
1646
|
+
Ze as RouterLink,
|
|
1647
1647
|
vt as RouterNotInstalledError,
|
|
1648
|
-
|
|
1649
|
-
|
|
1648
|
+
oe as RouterView,
|
|
1649
|
+
Oe as UseRouteInvalidError,
|
|
1650
1650
|
ur as component,
|
|
1651
1651
|
pr as createExternalRoutes,
|
|
1652
|
-
|
|
1652
|
+
fn as createParam,
|
|
1653
1653
|
lr as createRouter,
|
|
1654
1654
|
hr as createRoutes,
|
|
1655
1655
|
ht as isParamGetSet,
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1656
|
+
an as isParamGetter,
|
|
1657
|
+
sn as isParamWithDefault,
|
|
1658
|
+
re as isParentRoute,
|
|
1659
|
+
tn as isParentRouteWithoutComponent,
|
|
1660
|
+
Ie as isRoute,
|
|
1661
|
+
en as isRouteWithComponent,
|
|
1662
|
+
nn as isRouteWithComponents,
|
|
1663
1663
|
sr as onAfterRouteEnter,
|
|
1664
1664
|
cr as onAfterRouteLeave,
|
|
1665
1665
|
ir as onAfterRouteUpdate,
|
|
@@ -1667,14 +1667,14 @@ export {
|
|
|
1667
1667
|
ar as onBeforeRouteUpdate,
|
|
1668
1668
|
D as paramEnd,
|
|
1669
1669
|
O as paramStart,
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1670
|
+
Dt as path,
|
|
1671
|
+
Tt as query,
|
|
1672
|
+
zt as routerInjectionKey,
|
|
1673
|
+
Yt as routerRejectionKey,
|
|
1674
|
+
ke as throwIfDuplicateParamsAreFound,
|
|
1675
|
+
We as useLink,
|
|
1676
|
+
Me as useRejection,
|
|
1677
|
+
Je as useRoute,
|
|
1678
1678
|
wt as useRouter,
|
|
1679
1679
|
fr as withDefault
|
|
1680
1680
|
};
|