@kitbag/router 0.2.0 → 0.4.0
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/README.md +18 -5
- package/dist/kitbag-router.d.ts +173 -38
- package/dist/kitbag-router.js +929 -838
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/kitbag-router.js
CHANGED
|
@@ -1,75 +1,138 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var $ = (
|
|
4
|
-
import { inject as
|
|
5
|
-
class
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var we = (t, e, n) => e in t ? ve(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var $ = (t, e, n) => (we(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { inject as st, computed as H, toValue as lt, readonly as ct, watch as Ee, onUnmounted as Ot, defineComponent as it, openBlock as _t, createElementBlock as be, normalizeClass as Pe, renderSlot as qt, normalizeProps as Dt, guardReactiveProps as Mt, unref as Z, provide as Se, defineAsyncComponent as ke, createBlock as xe, resolveDynamicComponent as Ae, h as Tt, reactive as Le, ref as Ue, markRaw as pt } from "vue";
|
|
5
|
+
class ut 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.
|
|
9
9
|
*/
|
|
10
|
-
constructor(
|
|
11
|
-
super(`Invalid Param "${
|
|
10
|
+
constructor(e) {
|
|
11
|
+
super(`Invalid Param "${e}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class mt extends Error {
|
|
15
15
|
constructor() {
|
|
16
16
|
super("Router not installed");
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
class
|
|
19
|
+
class Be 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.
|
|
23
23
|
* @param routeName - The route name that was incorrectly used.
|
|
24
24
|
* @param actualRouteName - The expected route name that should have been used.
|
|
25
25
|
*/
|
|
26
|
-
constructor(
|
|
27
|
-
super(`useRoute called with incorrect route. Given ${
|
|
26
|
+
constructor(e, n) {
|
|
27
|
+
super(`useRoute called with incorrect route. Given ${e}, expected ${n}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
34
|
-
throw new
|
|
35
|
-
return
|
|
30
|
+
const Wt = Symbol();
|
|
31
|
+
function Rt() {
|
|
32
|
+
const t = st(Wt);
|
|
33
|
+
if (!t)
|
|
34
|
+
throw new mt();
|
|
35
|
+
return t;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
function me() {
|
|
39
|
-
const e = ae(De);
|
|
40
|
-
if (!e)
|
|
41
|
-
throw new de();
|
|
42
|
-
return e;
|
|
37
|
+
class F extends Error {
|
|
43
38
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
39
|
+
function I(t) {
|
|
40
|
+
return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
|
|
46
41
|
}
|
|
47
|
-
function
|
|
48
|
-
const t =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
throw
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
function He(t, e = {}, n = {}) {
|
|
43
|
+
const r = Rt(), o = H(() => lt(t)), a = H(() => lt(e)), s = H(() => lt(n)), c = H(() => {
|
|
44
|
+
if (I(o.value))
|
|
45
|
+
return o.value;
|
|
46
|
+
try {
|
|
47
|
+
return r.resolve(o.value, a.value, s.value);
|
|
48
|
+
} catch (d) {
|
|
49
|
+
throw d instanceof F && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, d), d;
|
|
50
|
+
}
|
|
51
|
+
}), u = H(() => r.find(c.value, s.value)), f = H(() => !!u.value && r.route.matches.includes(ct(u.value.matched))), R = H(() => !!u.value && r.route.matched === u.value.matched);
|
|
52
|
+
return {
|
|
53
|
+
route: u,
|
|
54
|
+
href: c,
|
|
55
|
+
isMatch: f,
|
|
56
|
+
isExactMatch: R,
|
|
57
|
+
push: (d) => r.push(c.value, {}, { ...s.value, ...d }),
|
|
58
|
+
replace: (d) => r.replace(c.value, {}, { ...s.value, ...d })
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const Ft = Symbol();
|
|
62
|
+
function Ne() {
|
|
63
|
+
const t = st(Ft);
|
|
64
|
+
if (!t)
|
|
65
|
+
throw new mt();
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
function It(t, e) {
|
|
69
|
+
return [t, e].filter((n) => !!n).join(".");
|
|
70
|
+
}
|
|
71
|
+
const tt = Symbol("isRouterRouteSymbol");
|
|
72
|
+
function $e(t) {
|
|
73
|
+
return typeof t == "object" && t !== null && tt in t && t[tt] === !0;
|
|
74
|
+
}
|
|
75
|
+
function je(t, e) {
|
|
76
|
+
function n(r, o, a) {
|
|
77
|
+
if (typeof r == "object") {
|
|
78
|
+
const c = {
|
|
79
|
+
...t.params,
|
|
80
|
+
...r
|
|
81
|
+
};
|
|
82
|
+
return e(t.key, c, o);
|
|
83
|
+
}
|
|
84
|
+
const s = {
|
|
85
|
+
...t.params,
|
|
86
|
+
[r]: o
|
|
87
|
+
};
|
|
88
|
+
return e(t.key, s, a);
|
|
89
|
+
}
|
|
90
|
+
return new Proxy(t, {
|
|
91
|
+
has: (r, o) => ["update", "params", tt].includes(o) ? !0 : Reflect.has(r, o),
|
|
92
|
+
get: (r, o, a) => o === tt ? !0 : o === "update" ? n : o === "params" ? new Proxy(t.params, {
|
|
93
|
+
set(s, c, u) {
|
|
94
|
+
return n(c, u), !0;
|
|
95
|
+
}
|
|
96
|
+
}) : Reflect.get(r, o, a)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function Ve(t, e, { exact: n } = {}) {
|
|
100
|
+
if (!$e(t))
|
|
101
|
+
return !1;
|
|
102
|
+
if (e === void 0)
|
|
103
|
+
return !0;
|
|
104
|
+
const r = Ce(t);
|
|
105
|
+
if (n) {
|
|
106
|
+
const o = r.at(-1);
|
|
107
|
+
return e === o;
|
|
108
|
+
}
|
|
109
|
+
return r.includes(e);
|
|
110
|
+
}
|
|
111
|
+
function Ce(t) {
|
|
112
|
+
return t.matches.map((n) => n.name).reduce((n, r) => {
|
|
113
|
+
const o = n.pop(), a = r ? [It(o, r)] : [];
|
|
114
|
+
return o ? [
|
|
115
|
+
...n,
|
|
116
|
+
o,
|
|
117
|
+
...a
|
|
118
|
+
] : a;
|
|
66
119
|
}, []);
|
|
67
120
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
121
|
+
function Oe(t, { exact: e } = {}) {
|
|
122
|
+
const n = Rt();
|
|
123
|
+
function r() {
|
|
124
|
+
if (!t)
|
|
125
|
+
return;
|
|
126
|
+
if (!Ve(n.route, t, { exact: e }))
|
|
127
|
+
throw new Be(t, n.route.key);
|
|
128
|
+
}
|
|
129
|
+
return Ee(n.route, r, { immediate: !0, deep: !0 }), n.route;
|
|
71
130
|
}
|
|
72
|
-
|
|
131
|
+
const Jt = Symbol();
|
|
132
|
+
function gt() {
|
|
133
|
+
return st(Jt, 0);
|
|
134
|
+
}
|
|
135
|
+
class et {
|
|
73
136
|
constructor() {
|
|
74
137
|
$(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
75
138
|
$(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
@@ -79,132 +142,129 @@ class X {
|
|
|
79
142
|
$(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
80
143
|
}
|
|
81
144
|
}
|
|
82
|
-
class
|
|
145
|
+
class Ut extends Error {
|
|
83
146
|
}
|
|
84
|
-
class
|
|
147
|
+
class G extends Error {
|
|
85
148
|
constructor(n) {
|
|
86
149
|
super("Error occurred during a router push operation.");
|
|
87
150
|
$(this, "to");
|
|
88
151
|
this.to = n;
|
|
89
152
|
}
|
|
90
153
|
}
|
|
91
|
-
class
|
|
154
|
+
class ht extends Error {
|
|
92
155
|
constructor(n) {
|
|
93
156
|
super(`Routing action rejected: ${n}`);
|
|
94
157
|
$(this, "type");
|
|
95
158
|
this.type = n;
|
|
96
159
|
}
|
|
97
160
|
}
|
|
98
|
-
function
|
|
99
|
-
return Array.isArray(
|
|
161
|
+
function W(t) {
|
|
162
|
+
return Array.isArray(t) ? t : [t];
|
|
100
163
|
}
|
|
101
|
-
function
|
|
102
|
-
const n = new
|
|
103
|
-
return
|
|
104
|
-
r.onBeforeRouteEnter &&
|
|
105
|
-
}),
|
|
106
|
-
r.onBeforeRouteLeave &&
|
|
164
|
+
function _e(t, e) {
|
|
165
|
+
const n = new et();
|
|
166
|
+
return t.matches.forEach((r, o) => {
|
|
167
|
+
r.onBeforeRouteEnter && yt(t, e, o) && W(r.onBeforeRouteEnter).forEach((a) => n.onBeforeRouteEnter.add(a)), r.onBeforeRouteUpdate && wt(t, e, o) && W(r.onBeforeRouteUpdate).forEach((a) => n.onBeforeRouteUpdate.add(a));
|
|
168
|
+
}), e.matches.forEach((r, o) => {
|
|
169
|
+
r.onBeforeRouteLeave && vt(t, e, o) && W(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
|
|
107
170
|
}), n;
|
|
108
171
|
}
|
|
109
|
-
function
|
|
110
|
-
const n = new
|
|
111
|
-
return
|
|
112
|
-
r.onAfterRouteEnter &&
|
|
113
|
-
}),
|
|
114
|
-
r.onAfterRouteLeave &&
|
|
172
|
+
function qe(t, e) {
|
|
173
|
+
const n = new et();
|
|
174
|
+
return t.matches.forEach((r, o) => {
|
|
175
|
+
r.onAfterRouteEnter && yt(t, e, o) && W(r.onAfterRouteEnter).forEach((a) => n.onAfterRouteEnter.add(a)), r.onAfterRouteUpdate && wt(t, e, o) && W(r.onAfterRouteUpdate).forEach((a) => n.onAfterRouteUpdate.add(a));
|
|
176
|
+
}), e.matches.forEach((r, o) => {
|
|
177
|
+
r.onAfterRouteLeave && vt(t, e, o) && W(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
|
|
115
178
|
}), n;
|
|
116
179
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
throw new fe(s);
|
|
123
|
-
}, t = (...s) => {
|
|
124
|
-
throw new F(s);
|
|
180
|
+
function De() {
|
|
181
|
+
const t = (s) => {
|
|
182
|
+
throw new ht(s);
|
|
183
|
+
}, e = (...s) => {
|
|
184
|
+
throw new G(s);
|
|
125
185
|
}, n = (s, c, u) => {
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
throw new
|
|
186
|
+
if (I(s)) {
|
|
187
|
+
const d = c ?? {};
|
|
188
|
+
throw new G([s, { ...d, replace: !0 }]);
|
|
129
189
|
}
|
|
130
|
-
const
|
|
131
|
-
throw new
|
|
190
|
+
const f = c, R = u ?? {};
|
|
191
|
+
throw new G([s, f, { ...R, replace: !0 }]);
|
|
132
192
|
}, r = () => {
|
|
133
|
-
throw new
|
|
193
|
+
throw new Ut();
|
|
134
194
|
};
|
|
135
195
|
async function o({ to: s, from: c, hooks: u }) {
|
|
136
|
-
const { global:
|
|
196
|
+
const { global: f, component: R } = u, d = _e(s, c), A = [
|
|
197
|
+
...f.onBeforeRouteEnter,
|
|
137
198
|
...d.onBeforeRouteEnter,
|
|
138
|
-
...
|
|
199
|
+
...f.onBeforeRouteUpdate,
|
|
139
200
|
...d.onBeforeRouteUpdate,
|
|
140
|
-
...
|
|
141
|
-
...
|
|
201
|
+
...R.onBeforeRouteUpdate,
|
|
202
|
+
...f.onBeforeRouteLeave,
|
|
142
203
|
...d.onBeforeRouteLeave,
|
|
143
|
-
...
|
|
144
|
-
...m.onBeforeRouteLeave
|
|
204
|
+
...R.onBeforeRouteLeave
|
|
145
205
|
];
|
|
146
206
|
try {
|
|
147
|
-
const
|
|
207
|
+
const p = A.map((S) => S(s, {
|
|
148
208
|
from: c,
|
|
149
|
-
reject:
|
|
150
|
-
push:
|
|
209
|
+
reject: t,
|
|
210
|
+
push: e,
|
|
151
211
|
replace: n,
|
|
152
212
|
abort: r
|
|
153
213
|
}));
|
|
154
|
-
await Promise.all(
|
|
155
|
-
} catch (
|
|
156
|
-
if (
|
|
214
|
+
await Promise.all(p);
|
|
215
|
+
} catch (p) {
|
|
216
|
+
if (p instanceof G)
|
|
157
217
|
return {
|
|
158
218
|
status: "PUSH",
|
|
159
|
-
to:
|
|
219
|
+
to: p.to
|
|
160
220
|
};
|
|
161
|
-
if (
|
|
221
|
+
if (p instanceof ht)
|
|
162
222
|
return {
|
|
163
223
|
status: "REJECT",
|
|
164
|
-
type:
|
|
224
|
+
type: p.type
|
|
165
225
|
};
|
|
166
|
-
if (
|
|
226
|
+
if (p instanceof Ut)
|
|
167
227
|
return {
|
|
168
228
|
status: "ABORT"
|
|
169
229
|
};
|
|
170
|
-
throw
|
|
230
|
+
throw p;
|
|
171
231
|
}
|
|
172
232
|
return {
|
|
173
233
|
status: "SUCCESS"
|
|
174
234
|
};
|
|
175
235
|
}
|
|
176
236
|
async function a({ to: s, from: c, hooks: u }) {
|
|
177
|
-
const { global:
|
|
178
|
-
...
|
|
179
|
-
...y.onAfterRouteLeave,
|
|
237
|
+
const { global: f, component: R } = u, d = qe(s, c), A = [
|
|
238
|
+
...R.onAfterRouteLeave,
|
|
180
239
|
...d.onAfterRouteLeave,
|
|
181
|
-
...
|
|
182
|
-
...
|
|
240
|
+
...f.onAfterRouteLeave,
|
|
241
|
+
...R.onAfterRouteUpdate,
|
|
183
242
|
...d.onAfterRouteUpdate,
|
|
184
|
-
...
|
|
185
|
-
...
|
|
186
|
-
...d.onAfterRouteEnter
|
|
243
|
+
...f.onAfterRouteUpdate,
|
|
244
|
+
...R.onAfterRouteEnter,
|
|
245
|
+
...d.onAfterRouteEnter,
|
|
246
|
+
...f.onAfterRouteEnter
|
|
187
247
|
];
|
|
188
248
|
try {
|
|
189
|
-
const
|
|
249
|
+
const p = A.map((S) => S(s, {
|
|
190
250
|
from: c,
|
|
191
|
-
reject:
|
|
192
|
-
push:
|
|
251
|
+
reject: t,
|
|
252
|
+
push: e,
|
|
193
253
|
replace: n
|
|
194
254
|
}));
|
|
195
|
-
await Promise.all(
|
|
196
|
-
} catch (
|
|
197
|
-
if (
|
|
255
|
+
await Promise.all(p);
|
|
256
|
+
} catch (p) {
|
|
257
|
+
if (p instanceof G)
|
|
198
258
|
return {
|
|
199
259
|
status: "PUSH",
|
|
200
|
-
to:
|
|
260
|
+
to: p.to
|
|
201
261
|
};
|
|
202
|
-
if (
|
|
262
|
+
if (p instanceof ht)
|
|
203
263
|
return {
|
|
204
264
|
status: "REJECT",
|
|
205
|
-
type:
|
|
265
|
+
type: p.type
|
|
206
266
|
};
|
|
207
|
-
throw
|
|
267
|
+
throw p;
|
|
208
268
|
}
|
|
209
269
|
return {
|
|
210
270
|
status: "SUCCESS"
|
|
@@ -215,198 +275,214 @@ function Ht() {
|
|
|
215
275
|
runAfterRouteHooks: a
|
|
216
276
|
};
|
|
217
277
|
}
|
|
218
|
-
const
|
|
219
|
-
const r =
|
|
278
|
+
const yt = (t, e, n) => {
|
|
279
|
+
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
220
280
|
return r.length < n || r[n] !== o[n];
|
|
221
|
-
},
|
|
222
|
-
const r =
|
|
281
|
+
}, vt = (t, e, n) => {
|
|
282
|
+
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
223
283
|
return r.length < n || r[n] !== o[n];
|
|
224
|
-
},
|
|
225
|
-
function
|
|
226
|
-
switch (
|
|
284
|
+
}, wt = (t, e, n) => t.matches[n] === (e == null ? void 0 : e.matches[n]);
|
|
285
|
+
function Bt(t) {
|
|
286
|
+
switch (t) {
|
|
227
287
|
case "onBeforeRouteEnter":
|
|
228
288
|
case "onAfterRouteEnter":
|
|
229
|
-
return
|
|
289
|
+
return yt;
|
|
230
290
|
case "onBeforeRouteUpdate":
|
|
231
291
|
case "onAfterRouteUpdate":
|
|
232
|
-
return
|
|
292
|
+
return wt;
|
|
233
293
|
case "onBeforeRouteLeave":
|
|
234
294
|
case "onAfterRouteLeave":
|
|
235
|
-
return
|
|
295
|
+
return vt;
|
|
236
296
|
default:
|
|
237
|
-
throw new Error(`Switch is not exhaustive for lifecycle: ${
|
|
297
|
+
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
238
298
|
}
|
|
239
299
|
}
|
|
240
|
-
class
|
|
300
|
+
class Me {
|
|
241
301
|
constructor() {
|
|
242
|
-
$(this, "global", new
|
|
243
|
-
$(this, "component", new
|
|
302
|
+
$(this, "global", new et());
|
|
303
|
+
$(this, "component", new et());
|
|
244
304
|
}
|
|
245
|
-
addBeforeRouteHook({ lifecycle:
|
|
246
|
-
const a =
|
|
247
|
-
if (a(u,
|
|
248
|
-
return o(u,
|
|
305
|
+
addBeforeRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
|
|
306
|
+
const a = Bt(e), s = this[n][e], c = (u, f) => {
|
|
307
|
+
if (a(u, f.from, r))
|
|
308
|
+
return o(u, f);
|
|
249
309
|
};
|
|
250
310
|
return s.add(c), () => s.delete(c);
|
|
251
311
|
}
|
|
252
|
-
addAfterRouteHook({ lifecycle:
|
|
253
|
-
const a =
|
|
254
|
-
if (a(u,
|
|
255
|
-
return o(u,
|
|
312
|
+
addAfterRouteHook({ lifecycle: e, timing: n, depth: r, hook: o }) {
|
|
313
|
+
const a = Bt(e), s = this[n][e], c = (u, f) => {
|
|
314
|
+
if (a(u, f.from, r))
|
|
315
|
+
return o(u, f);
|
|
256
316
|
};
|
|
257
317
|
return s.add(c), () => s.delete(c);
|
|
258
318
|
}
|
|
259
319
|
}
|
|
260
|
-
const
|
|
261
|
-
function
|
|
262
|
-
const
|
|
320
|
+
const Kt = Symbol();
|
|
321
|
+
function Te() {
|
|
322
|
+
const t = new Me();
|
|
263
323
|
return {
|
|
264
|
-
onBeforeRouteEnter: (c) =>
|
|
265
|
-
onBeforeRouteUpdate: (c) =>
|
|
266
|
-
onBeforeRouteLeave: (c) =>
|
|
267
|
-
onAfterRouteEnter: (c) =>
|
|
268
|
-
onAfterRouteUpdate: (c) =>
|
|
269
|
-
onAfterRouteLeave: (c) =>
|
|
270
|
-
hooks:
|
|
324
|
+
onBeforeRouteEnter: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
325
|
+
onBeforeRouteUpdate: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
326
|
+
onBeforeRouteLeave: (c) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: c, timing: "global", depth: 0 }),
|
|
327
|
+
onAfterRouteEnter: (c) => t.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
328
|
+
onAfterRouteUpdate: (c) => t.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
329
|
+
onAfterRouteLeave: (c) => t.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: c, timing: "global", depth: 0 }),
|
|
330
|
+
hooks: t
|
|
271
331
|
};
|
|
272
332
|
}
|
|
273
|
-
function
|
|
274
|
-
const
|
|
275
|
-
if (!
|
|
276
|
-
throw new
|
|
277
|
-
return
|
|
333
|
+
function Qt() {
|
|
334
|
+
const t = st(Kt);
|
|
335
|
+
if (!t)
|
|
336
|
+
throw new mt();
|
|
337
|
+
return t;
|
|
278
338
|
}
|
|
279
|
-
function
|
|
280
|
-
return (
|
|
281
|
-
const n =
|
|
282
|
-
return
|
|
339
|
+
function Gt(t) {
|
|
340
|
+
return (e) => {
|
|
341
|
+
const n = gt(), o = Qt().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
342
|
+
return Ot(o), o;
|
|
283
343
|
};
|
|
284
344
|
}
|
|
285
|
-
function
|
|
286
|
-
return (
|
|
287
|
-
const n =
|
|
288
|
-
return
|
|
345
|
+
function Et(t) {
|
|
346
|
+
return (e) => {
|
|
347
|
+
const n = gt(), o = Qt().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
348
|
+
return Ot(o), o;
|
|
289
349
|
};
|
|
290
350
|
}
|
|
291
|
-
const
|
|
351
|
+
const In = Gt("onBeforeRouteUpdate"), Jn = Gt("onBeforeRouteLeave"), Kn = Et("onAfterRouteEnter"), Qn = Et("onAfterRouteUpdate"), Gn = Et("onAfterRouteLeave"), We = ["href"], Fe = /* @__PURE__ */ it({
|
|
292
352
|
__name: "routerLink",
|
|
293
353
|
props: {
|
|
294
354
|
to: { type: [String, Function] },
|
|
295
355
|
query: {},
|
|
296
356
|
replace: { type: Boolean }
|
|
297
357
|
},
|
|
298
|
-
setup(
|
|
299
|
-
const
|
|
300
|
-
const { to:
|
|
358
|
+
setup(t) {
|
|
359
|
+
const e = t, n = Rt(), r = H(() => I(e.to) ? e.to : e.to(n.resolve)), o = H(() => {
|
|
360
|
+
const { to: d, ...A } = e;
|
|
301
361
|
return A;
|
|
302
|
-
}), a =
|
|
303
|
-
var y;
|
|
304
|
-
return (y = n.find(r.value, o.value)) == null ? void 0 : y.matched;
|
|
305
|
-
}), s = V(() => !!a.value && n.route.matches.includes(ce(a.value))), c = V(() => !!a.value && n.route.matched === a.value), u = V(() => ({
|
|
362
|
+
}), { href: a, isMatch: s, isExactMatch: c } = He(r), u = H(() => ({
|
|
306
363
|
"router-link--match": s.value,
|
|
307
364
|
"router-link--exact-match": c.value
|
|
308
|
-
})),
|
|
309
|
-
const { host:
|
|
310
|
-
return
|
|
365
|
+
})), f = H(() => {
|
|
366
|
+
const { host: d } = new URL(r.value, window.location.origin);
|
|
367
|
+
return d !== window.location.host;
|
|
311
368
|
});
|
|
312
|
-
function
|
|
313
|
-
|
|
369
|
+
function R(d) {
|
|
370
|
+
d.preventDefault(), n.push(a.value, o.value);
|
|
314
371
|
}
|
|
315
|
-
return (
|
|
372
|
+
return (d, A) => (_t(), be("a", {
|
|
316
373
|
href: r.value,
|
|
317
|
-
class:
|
|
318
|
-
onClick:
|
|
374
|
+
class: Pe(["router-link", u.value]),
|
|
375
|
+
onClick: R
|
|
319
376
|
}, [
|
|
320
|
-
|
|
321
|
-
], 10,
|
|
377
|
+
qt(d.$slots, "default", Dt(Mt({ resolved: r.value, isMatch: Z(s), isExactMatch: Z(c), isExternal: f.value })))
|
|
378
|
+
], 10, We));
|
|
322
379
|
}
|
|
323
|
-
})
|
|
380
|
+
});
|
|
381
|
+
function zt(t) {
|
|
382
|
+
return "children" in t;
|
|
383
|
+
}
|
|
384
|
+
function Ie(t) {
|
|
385
|
+
return zt(t) && !("component" in t) && !("components" in t);
|
|
386
|
+
}
|
|
387
|
+
function Je(t) {
|
|
388
|
+
return typeof t == "object" && t !== null && "component" in t;
|
|
389
|
+
}
|
|
390
|
+
function Ke(t) {
|
|
391
|
+
return typeof t == "object" && t !== null && "components" in t;
|
|
392
|
+
}
|
|
393
|
+
const Yt = /* @__PURE__ */ it({
|
|
324
394
|
__name: "routerView",
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
395
|
+
props: {
|
|
396
|
+
name: {}
|
|
397
|
+
},
|
|
398
|
+
setup(t) {
|
|
399
|
+
const { name: e = "default" } = t, n = Oe(), r = Ne(), o = gt();
|
|
400
|
+
Se(Jt, o + 1);
|
|
401
|
+
const a = H(() => {
|
|
402
|
+
if (r.value)
|
|
403
|
+
return r.value.component;
|
|
404
|
+
const c = n.matches.at(o);
|
|
405
|
+
if (!c)
|
|
406
|
+
return null;
|
|
407
|
+
const f = s(c)[e];
|
|
408
|
+
return f ? typeof f == "function" ? ke(f) : f : null;
|
|
332
409
|
});
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
(le(), xe(Ae(o.value)))
|
|
410
|
+
function s(c) {
|
|
411
|
+
return Ke(c) ? c.components : Je(c) ? { default: c.component } : {};
|
|
412
|
+
}
|
|
413
|
+
return (c, u) => qt(c.$slots, "default", Dt(Mt({ route: Z(n), component: a.value, rejection: Z(r) })), () => [
|
|
414
|
+
(_t(), xe(Ae(a.value)))
|
|
339
415
|
]);
|
|
340
416
|
}
|
|
341
417
|
});
|
|
342
|
-
function
|
|
343
|
-
return
|
|
418
|
+
function zn(t, e) {
|
|
419
|
+
return it({
|
|
344
420
|
name: "PropsWrapper",
|
|
345
421
|
expose: [],
|
|
346
422
|
async setup() {
|
|
347
|
-
const n = await
|
|
348
|
-
return () =>
|
|
423
|
+
const n = await e();
|
|
424
|
+
return () => Tt(t, n);
|
|
349
425
|
}
|
|
350
426
|
});
|
|
351
427
|
}
|
|
352
|
-
function
|
|
353
|
-
return
|
|
354
|
-
for (var
|
|
355
|
-
var n = arguments[
|
|
428
|
+
function _() {
|
|
429
|
+
return _ = Object.assign ? Object.assign.bind() : function(t) {
|
|
430
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
431
|
+
var n = arguments[e];
|
|
356
432
|
for (var r in n)
|
|
357
|
-
Object.prototype.hasOwnProperty.call(n, r) && (
|
|
433
|
+
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
358
434
|
}
|
|
359
|
-
return
|
|
360
|
-
},
|
|
435
|
+
return t;
|
|
436
|
+
}, _.apply(this, arguments);
|
|
361
437
|
}
|
|
362
438
|
var L;
|
|
363
|
-
(function(
|
|
364
|
-
|
|
439
|
+
(function(t) {
|
|
440
|
+
t.Pop = "POP", t.Push = "PUSH", t.Replace = "REPLACE";
|
|
365
441
|
})(L || (L = {}));
|
|
366
|
-
var
|
|
367
|
-
return Object.freeze(
|
|
368
|
-
} : function(
|
|
369
|
-
return
|
|
442
|
+
var J = process.env.NODE_ENV !== "production" ? function(t) {
|
|
443
|
+
return Object.freeze(t);
|
|
444
|
+
} : function(t) {
|
|
445
|
+
return t;
|
|
370
446
|
};
|
|
371
|
-
function D(
|
|
372
|
-
if (!
|
|
373
|
-
typeof console < "u" && console.warn(
|
|
447
|
+
function D(t, e) {
|
|
448
|
+
if (!t) {
|
|
449
|
+
typeof console < "u" && console.warn(e);
|
|
374
450
|
try {
|
|
375
|
-
throw new Error(
|
|
451
|
+
throw new Error(e);
|
|
376
452
|
} catch {
|
|
377
453
|
}
|
|
378
454
|
}
|
|
379
455
|
}
|
|
380
|
-
var
|
|
381
|
-
function
|
|
382
|
-
|
|
383
|
-
var
|
|
456
|
+
var nt = "beforeunload", Qe = "hashchange", Xt = "popstate";
|
|
457
|
+
function Ht(t) {
|
|
458
|
+
t === void 0 && (t = {});
|
|
459
|
+
var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
384
460
|
function a() {
|
|
385
|
-
var
|
|
386
|
-
return [
|
|
461
|
+
var h = r.location, i = h.pathname, l = h.search, v = h.hash, w = o.state || {};
|
|
462
|
+
return [w.idx, J({
|
|
387
463
|
pathname: i,
|
|
388
|
-
search:
|
|
389
|
-
hash:
|
|
390
|
-
state:
|
|
391
|
-
key:
|
|
464
|
+
search: l,
|
|
465
|
+
hash: v,
|
|
466
|
+
state: w.usr || null,
|
|
467
|
+
key: w.key || "default"
|
|
392
468
|
})];
|
|
393
469
|
}
|
|
394
470
|
var s = null;
|
|
395
471
|
function c() {
|
|
396
472
|
if (s)
|
|
397
|
-
|
|
473
|
+
p.call(s), s = null;
|
|
398
474
|
else {
|
|
399
|
-
var
|
|
400
|
-
if (
|
|
401
|
-
if (
|
|
402
|
-
var
|
|
403
|
-
|
|
404
|
-
action:
|
|
405
|
-
location:
|
|
475
|
+
var h = L.Pop, i = a(), l = i[0], v = i[1];
|
|
476
|
+
if (p.length)
|
|
477
|
+
if (l != null) {
|
|
478
|
+
var w = R - l;
|
|
479
|
+
w && (s = {
|
|
480
|
+
action: h,
|
|
481
|
+
location: v,
|
|
406
482
|
retry: function() {
|
|
407
|
-
E(
|
|
483
|
+
E(w * -1);
|
|
408
484
|
}
|
|
409
|
-
}, E(
|
|
485
|
+
}, E(w));
|
|
410
486
|
} else
|
|
411
487
|
process.env.NODE_ENV !== "production" && D(
|
|
412
488
|
!1,
|
|
@@ -416,87 +492,87 @@ function Ue(e) {
|
|
|
416
492
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
417
493
|
);
|
|
418
494
|
else
|
|
419
|
-
|
|
495
|
+
U(h);
|
|
420
496
|
}
|
|
421
497
|
}
|
|
422
|
-
r.addEventListener(
|
|
423
|
-
var u = L.Pop,
|
|
424
|
-
|
|
425
|
-
idx:
|
|
498
|
+
r.addEventListener(Xt, c);
|
|
499
|
+
var u = L.Pop, f = a(), R = f[0], d = f[1], A = K(), p = K();
|
|
500
|
+
R == null && (R = 0, o.replaceState(_({}, o.state, {
|
|
501
|
+
idx: R
|
|
426
502
|
}), ""));
|
|
427
|
-
function
|
|
428
|
-
return typeof
|
|
503
|
+
function S(h) {
|
|
504
|
+
return typeof h == "string" ? h : M(h);
|
|
429
505
|
}
|
|
430
|
-
function
|
|
431
|
-
return i === void 0 && (i = null),
|
|
432
|
-
pathname:
|
|
506
|
+
function j(h, i) {
|
|
507
|
+
return i === void 0 && (i = null), J(_({
|
|
508
|
+
pathname: d.pathname,
|
|
433
509
|
hash: "",
|
|
434
510
|
search: ""
|
|
435
|
-
}, typeof
|
|
511
|
+
}, typeof h == "string" ? z(h) : h, {
|
|
436
512
|
state: i,
|
|
437
|
-
key:
|
|
513
|
+
key: ot()
|
|
438
514
|
}));
|
|
439
515
|
}
|
|
440
|
-
function
|
|
516
|
+
function V(h, i) {
|
|
441
517
|
return [{
|
|
442
|
-
usr:
|
|
443
|
-
key:
|
|
518
|
+
usr: h.state,
|
|
519
|
+
key: h.key,
|
|
444
520
|
idx: i
|
|
445
|
-
},
|
|
521
|
+
}, S(h)];
|
|
446
522
|
}
|
|
447
|
-
function
|
|
448
|
-
return !
|
|
449
|
-
action:
|
|
523
|
+
function B(h, i, l) {
|
|
524
|
+
return !p.length || (p.call({
|
|
525
|
+
action: h,
|
|
450
526
|
location: i,
|
|
451
|
-
retry:
|
|
527
|
+
retry: l
|
|
452
528
|
}), !1);
|
|
453
529
|
}
|
|
454
|
-
function
|
|
455
|
-
u =
|
|
530
|
+
function U(h) {
|
|
531
|
+
u = h;
|
|
456
532
|
var i = a();
|
|
457
|
-
|
|
533
|
+
R = i[0], d = i[1], A.call({
|
|
458
534
|
action: u,
|
|
459
|
-
location:
|
|
535
|
+
location: d
|
|
460
536
|
});
|
|
461
537
|
}
|
|
462
|
-
function
|
|
463
|
-
var
|
|
464
|
-
function
|
|
465
|
-
|
|
538
|
+
function m(h, i) {
|
|
539
|
+
var l = L.Push, v = j(h, i);
|
|
540
|
+
function w() {
|
|
541
|
+
m(h, i);
|
|
466
542
|
}
|
|
467
|
-
if (
|
|
468
|
-
var
|
|
543
|
+
if (B(l, v, w)) {
|
|
544
|
+
var k = V(v, R + 1), g = k[0], P = k[1];
|
|
469
545
|
try {
|
|
470
546
|
o.pushState(g, "", P);
|
|
471
547
|
} catch {
|
|
472
548
|
r.location.assign(P);
|
|
473
549
|
}
|
|
474
|
-
|
|
550
|
+
U(l);
|
|
475
551
|
}
|
|
476
552
|
}
|
|
477
|
-
function
|
|
478
|
-
var
|
|
479
|
-
function
|
|
480
|
-
|
|
553
|
+
function y(h, i) {
|
|
554
|
+
var l = L.Replace, v = j(h, i);
|
|
555
|
+
function w() {
|
|
556
|
+
y(h, i);
|
|
481
557
|
}
|
|
482
|
-
if (
|
|
483
|
-
var
|
|
484
|
-
o.replaceState(g, "", P),
|
|
558
|
+
if (B(l, v, w)) {
|
|
559
|
+
var k = V(v, R), g = k[0], P = k[1];
|
|
560
|
+
o.replaceState(g, "", P), U(l);
|
|
485
561
|
}
|
|
486
562
|
}
|
|
487
|
-
function E(
|
|
488
|
-
o.go(
|
|
563
|
+
function E(h) {
|
|
564
|
+
o.go(h);
|
|
489
565
|
}
|
|
490
566
|
var b = {
|
|
491
567
|
get action() {
|
|
492
568
|
return u;
|
|
493
569
|
},
|
|
494
570
|
get location() {
|
|
495
|
-
return
|
|
571
|
+
return d;
|
|
496
572
|
},
|
|
497
|
-
createHref:
|
|
498
|
-
push:
|
|
499
|
-
replace:
|
|
573
|
+
createHref: S,
|
|
574
|
+
push: m,
|
|
575
|
+
replace: y,
|
|
500
576
|
go: E,
|
|
501
577
|
back: function() {
|
|
502
578
|
E(-1);
|
|
@@ -508,22 +584,22 @@ function Ue(e) {
|
|
|
508
584
|
return A.push(i);
|
|
509
585
|
},
|
|
510
586
|
block: function(i) {
|
|
511
|
-
var
|
|
512
|
-
return
|
|
513
|
-
|
|
587
|
+
var l = p.push(i);
|
|
588
|
+
return p.length === 1 && r.addEventListener(nt, rt), function() {
|
|
589
|
+
l(), p.length || r.removeEventListener(nt, rt);
|
|
514
590
|
};
|
|
515
591
|
}
|
|
516
592
|
};
|
|
517
593
|
return b;
|
|
518
594
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
var
|
|
595
|
+
function Ge(t) {
|
|
596
|
+
t === void 0 && (t = {});
|
|
597
|
+
var e = t, n = e.window, r = n === void 0 ? document.defaultView : n, o = r.history;
|
|
522
598
|
function a() {
|
|
523
|
-
var i =
|
|
524
|
-
return [x.idx,
|
|
525
|
-
pathname:
|
|
526
|
-
search:
|
|
599
|
+
var i = z(r.location.hash.substr(1)), l = i.pathname, v = l === void 0 ? "/" : l, w = i.search, k = w === void 0 ? "" : w, g = i.hash, P = g === void 0 ? "" : g, x = o.state || {};
|
|
600
|
+
return [x.idx, J({
|
|
601
|
+
pathname: v,
|
|
602
|
+
search: k,
|
|
527
603
|
hash: P,
|
|
528
604
|
state: x.usr || null,
|
|
529
605
|
key: x.key || "default"
|
|
@@ -532,19 +608,19 @@ function Vt(e) {
|
|
|
532
608
|
var s = null;
|
|
533
609
|
function c() {
|
|
534
610
|
if (s)
|
|
535
|
-
|
|
611
|
+
p.call(s), s = null;
|
|
536
612
|
else {
|
|
537
|
-
var i = L.Pop,
|
|
538
|
-
if (
|
|
539
|
-
if (
|
|
540
|
-
var
|
|
541
|
-
|
|
613
|
+
var i = L.Pop, l = a(), v = l[0], w = l[1];
|
|
614
|
+
if (p.length)
|
|
615
|
+
if (v != null) {
|
|
616
|
+
var k = R - v;
|
|
617
|
+
k && (s = {
|
|
542
618
|
action: i,
|
|
543
|
-
location:
|
|
619
|
+
location: w,
|
|
544
620
|
retry: function() {
|
|
545
|
-
b(
|
|
621
|
+
b(k * -1);
|
|
546
622
|
}
|
|
547
|
-
}, b(
|
|
623
|
+
}, b(k));
|
|
548
624
|
} else
|
|
549
625
|
process.env.NODE_ENV !== "production" && D(
|
|
550
626
|
!1,
|
|
@@ -554,97 +630,97 @@ function Vt(e) {
|
|
|
554
630
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
555
631
|
);
|
|
556
632
|
else
|
|
557
|
-
|
|
633
|
+
m(i);
|
|
558
634
|
}
|
|
559
635
|
}
|
|
560
|
-
r.addEventListener(
|
|
561
|
-
var i = a(),
|
|
562
|
-
|
|
636
|
+
r.addEventListener(Xt, c), r.addEventListener(Qe, function() {
|
|
637
|
+
var i = a(), l = i[1];
|
|
638
|
+
M(l) !== M(d) && c();
|
|
563
639
|
});
|
|
564
|
-
var u = L.Pop,
|
|
565
|
-
|
|
566
|
-
idx:
|
|
640
|
+
var u = L.Pop, f = a(), R = f[0], d = f[1], A = K(), p = K();
|
|
641
|
+
R == null && (R = 0, o.replaceState(_({}, o.state, {
|
|
642
|
+
idx: R
|
|
567
643
|
}), ""));
|
|
568
|
-
function
|
|
569
|
-
var i = document.querySelector("base"),
|
|
644
|
+
function S() {
|
|
645
|
+
var i = document.querySelector("base"), l = "";
|
|
570
646
|
if (i && i.getAttribute("href")) {
|
|
571
|
-
var
|
|
572
|
-
|
|
647
|
+
var v = r.location.href, w = v.indexOf("#");
|
|
648
|
+
l = w === -1 ? v : v.slice(0, w);
|
|
573
649
|
}
|
|
574
|
-
return
|
|
650
|
+
return l;
|
|
575
651
|
}
|
|
576
|
-
function
|
|
577
|
-
return
|
|
652
|
+
function j(i) {
|
|
653
|
+
return S() + "#" + (typeof i == "string" ? i : M(i));
|
|
578
654
|
}
|
|
579
|
-
function
|
|
580
|
-
return
|
|
581
|
-
pathname:
|
|
655
|
+
function V(i, l) {
|
|
656
|
+
return l === void 0 && (l = null), J(_({
|
|
657
|
+
pathname: d.pathname,
|
|
582
658
|
hash: "",
|
|
583
659
|
search: ""
|
|
584
|
-
}, typeof i == "string" ?
|
|
585
|
-
state:
|
|
586
|
-
key:
|
|
660
|
+
}, typeof i == "string" ? z(i) : i, {
|
|
661
|
+
state: l,
|
|
662
|
+
key: ot()
|
|
587
663
|
}));
|
|
588
664
|
}
|
|
589
|
-
function
|
|
665
|
+
function B(i, l) {
|
|
590
666
|
return [{
|
|
591
667
|
usr: i.state,
|
|
592
668
|
key: i.key,
|
|
593
|
-
idx:
|
|
594
|
-
},
|
|
669
|
+
idx: l
|
|
670
|
+
}, j(i)];
|
|
595
671
|
}
|
|
596
|
-
function
|
|
597
|
-
return !
|
|
672
|
+
function U(i, l, v) {
|
|
673
|
+
return !p.length || (p.call({
|
|
598
674
|
action: i,
|
|
599
|
-
location:
|
|
600
|
-
retry:
|
|
675
|
+
location: l,
|
|
676
|
+
retry: v
|
|
601
677
|
}), !1);
|
|
602
678
|
}
|
|
603
|
-
function
|
|
679
|
+
function m(i) {
|
|
604
680
|
u = i;
|
|
605
|
-
var
|
|
606
|
-
|
|
681
|
+
var l = a();
|
|
682
|
+
R = l[0], d = l[1], A.call({
|
|
607
683
|
action: u,
|
|
608
|
-
location:
|
|
684
|
+
location: d
|
|
609
685
|
});
|
|
610
686
|
}
|
|
611
|
-
function
|
|
612
|
-
var
|
|
613
|
-
function
|
|
614
|
-
|
|
687
|
+
function y(i, l) {
|
|
688
|
+
var v = L.Push, w = V(i, l);
|
|
689
|
+
function k() {
|
|
690
|
+
y(i, l);
|
|
615
691
|
}
|
|
616
|
-
if (process.env.NODE_ENV !== "production" && D(
|
|
617
|
-
var g =
|
|
692
|
+
if (process.env.NODE_ENV !== "production" && D(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(i) + ")"), U(v, w, k)) {
|
|
693
|
+
var g = B(w, R + 1), P = g[0], x = g[1];
|
|
618
694
|
try {
|
|
619
695
|
o.pushState(P, "", x);
|
|
620
696
|
} catch {
|
|
621
697
|
r.location.assign(x);
|
|
622
698
|
}
|
|
623
|
-
|
|
699
|
+
m(v);
|
|
624
700
|
}
|
|
625
701
|
}
|
|
626
|
-
function E(i,
|
|
627
|
-
var
|
|
628
|
-
function
|
|
629
|
-
E(i,
|
|
702
|
+
function E(i, l) {
|
|
703
|
+
var v = L.Replace, w = V(i, l);
|
|
704
|
+
function k() {
|
|
705
|
+
E(i, l);
|
|
630
706
|
}
|
|
631
|
-
if (process.env.NODE_ENV !== "production" && D(
|
|
632
|
-
var g =
|
|
633
|
-
o.replaceState(P, "", x),
|
|
707
|
+
if (process.env.NODE_ENV !== "production" && D(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(i) + ")"), U(v, w, k)) {
|
|
708
|
+
var g = B(w, R), P = g[0], x = g[1];
|
|
709
|
+
o.replaceState(P, "", x), m(v);
|
|
634
710
|
}
|
|
635
711
|
}
|
|
636
712
|
function b(i) {
|
|
637
713
|
o.go(i);
|
|
638
714
|
}
|
|
639
|
-
var
|
|
715
|
+
var h = {
|
|
640
716
|
get action() {
|
|
641
717
|
return u;
|
|
642
718
|
},
|
|
643
719
|
get location() {
|
|
644
|
-
return
|
|
720
|
+
return d;
|
|
645
721
|
},
|
|
646
|
-
createHref:
|
|
647
|
-
push:
|
|
722
|
+
createHref: j,
|
|
723
|
+
push: y,
|
|
648
724
|
replace: E,
|
|
649
725
|
go: b,
|
|
650
726
|
back: function() {
|
|
@@ -653,78 +729,78 @@ function Vt(e) {
|
|
|
653
729
|
forward: function() {
|
|
654
730
|
b(1);
|
|
655
731
|
},
|
|
656
|
-
listen: function(
|
|
657
|
-
return A.push(
|
|
732
|
+
listen: function(l) {
|
|
733
|
+
return A.push(l);
|
|
658
734
|
},
|
|
659
|
-
block: function(
|
|
660
|
-
var
|
|
661
|
-
return
|
|
662
|
-
|
|
735
|
+
block: function(l) {
|
|
736
|
+
var v = p.push(l);
|
|
737
|
+
return p.length === 1 && r.addEventListener(nt, rt), function() {
|
|
738
|
+
v(), p.length || r.removeEventListener(nt, rt);
|
|
663
739
|
};
|
|
664
740
|
}
|
|
665
741
|
};
|
|
666
|
-
return
|
|
742
|
+
return h;
|
|
667
743
|
}
|
|
668
|
-
function
|
|
669
|
-
|
|
670
|
-
var
|
|
671
|
-
var
|
|
744
|
+
function Nt(t) {
|
|
745
|
+
t === void 0 && (t = {});
|
|
746
|
+
var e = t, n = e.initialEntries, r = n === void 0 ? ["/"] : n, o = e.initialIndex, a = r.map(function(m) {
|
|
747
|
+
var y = J(_({
|
|
672
748
|
pathname: "/",
|
|
673
749
|
search: "",
|
|
674
750
|
hash: "",
|
|
675
751
|
state: null,
|
|
676
|
-
key:
|
|
677
|
-
}, typeof
|
|
678
|
-
return process.env.NODE_ENV !== "production" && D(
|
|
679
|
-
}), s = $
|
|
680
|
-
function
|
|
681
|
-
return typeof
|
|
682
|
-
}
|
|
683
|
-
function A(
|
|
684
|
-
return
|
|
752
|
+
key: ot()
|
|
753
|
+
}, typeof m == "string" ? z(m) : m));
|
|
754
|
+
return process.env.NODE_ENV !== "production" && D(y.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(m) + ")"), y;
|
|
755
|
+
}), s = $t(o ?? a.length - 1, 0, a.length - 1), c = L.Pop, u = a[s], f = K(), R = K();
|
|
756
|
+
function d(m) {
|
|
757
|
+
return typeof m == "string" ? m : M(m);
|
|
758
|
+
}
|
|
759
|
+
function A(m, y) {
|
|
760
|
+
return y === void 0 && (y = null), J(_({
|
|
685
761
|
pathname: u.pathname,
|
|
686
762
|
search: "",
|
|
687
763
|
hash: ""
|
|
688
|
-
}, typeof
|
|
689
|
-
state:
|
|
690
|
-
key:
|
|
764
|
+
}, typeof m == "string" ? z(m) : m, {
|
|
765
|
+
state: y,
|
|
766
|
+
key: ot()
|
|
691
767
|
}));
|
|
692
768
|
}
|
|
693
|
-
function
|
|
694
|
-
return !
|
|
695
|
-
action:
|
|
696
|
-
location:
|
|
769
|
+
function p(m, y, E) {
|
|
770
|
+
return !R.length || (R.call({
|
|
771
|
+
action: m,
|
|
772
|
+
location: y,
|
|
697
773
|
retry: E
|
|
698
774
|
}), !1);
|
|
699
775
|
}
|
|
700
|
-
function
|
|
701
|
-
c =
|
|
776
|
+
function S(m, y) {
|
|
777
|
+
c = m, u = y, f.call({
|
|
702
778
|
action: c,
|
|
703
779
|
location: u
|
|
704
780
|
});
|
|
705
781
|
}
|
|
706
|
-
function
|
|
707
|
-
var E = L.Push, b = A(
|
|
708
|
-
function
|
|
709
|
-
|
|
782
|
+
function j(m, y) {
|
|
783
|
+
var E = L.Push, b = A(m, y);
|
|
784
|
+
function h() {
|
|
785
|
+
j(m, y);
|
|
710
786
|
}
|
|
711
|
-
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(
|
|
787
|
+
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(m) + ")"), p(E, b, h) && (s += 1, a.splice(s, a.length, b), S(E, b));
|
|
712
788
|
}
|
|
713
|
-
function
|
|
714
|
-
var E = L.Replace, b = A(
|
|
715
|
-
function
|
|
716
|
-
|
|
789
|
+
function V(m, y) {
|
|
790
|
+
var E = L.Replace, b = A(m, y);
|
|
791
|
+
function h() {
|
|
792
|
+
V(m, y);
|
|
717
793
|
}
|
|
718
|
-
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(
|
|
794
|
+
process.env.NODE_ENV !== "production" && D(u.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(m) + ")"), p(E, b, h) && (a[s] = b, S(E, b));
|
|
719
795
|
}
|
|
720
|
-
function
|
|
721
|
-
var
|
|
722
|
-
function
|
|
723
|
-
|
|
796
|
+
function B(m) {
|
|
797
|
+
var y = $t(s + m, 0, a.length - 1), E = L.Pop, b = a[y];
|
|
798
|
+
function h() {
|
|
799
|
+
B(m);
|
|
724
800
|
}
|
|
725
|
-
|
|
801
|
+
p(E, b, h) && (s = y, S(E, b));
|
|
726
802
|
}
|
|
727
|
-
var
|
|
803
|
+
var U = {
|
|
728
804
|
get index() {
|
|
729
805
|
return s;
|
|
730
806
|
},
|
|
@@ -734,348 +810,350 @@ function He(e) {
|
|
|
734
810
|
get location() {
|
|
735
811
|
return u;
|
|
736
812
|
},
|
|
737
|
-
createHref:
|
|
738
|
-
push:
|
|
739
|
-
replace:
|
|
740
|
-
go:
|
|
813
|
+
createHref: d,
|
|
814
|
+
push: j,
|
|
815
|
+
replace: V,
|
|
816
|
+
go: B,
|
|
741
817
|
back: function() {
|
|
742
|
-
|
|
818
|
+
B(-1);
|
|
743
819
|
},
|
|
744
820
|
forward: function() {
|
|
745
|
-
|
|
821
|
+
B(1);
|
|
746
822
|
},
|
|
747
|
-
listen: function(
|
|
748
|
-
return
|
|
823
|
+
listen: function(y) {
|
|
824
|
+
return f.push(y);
|
|
749
825
|
},
|
|
750
|
-
block: function(
|
|
751
|
-
return
|
|
826
|
+
block: function(y) {
|
|
827
|
+
return R.push(y);
|
|
752
828
|
}
|
|
753
829
|
};
|
|
754
|
-
return
|
|
830
|
+
return U;
|
|
755
831
|
}
|
|
756
|
-
function $
|
|
757
|
-
return Math.min(Math.max(
|
|
832
|
+
function $t(t, e, n) {
|
|
833
|
+
return Math.min(Math.max(t, e), n);
|
|
758
834
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
835
|
+
function rt(t) {
|
|
836
|
+
t.preventDefault(), t.returnValue = "";
|
|
761
837
|
}
|
|
762
|
-
function
|
|
763
|
-
var
|
|
838
|
+
function K() {
|
|
839
|
+
var t = [];
|
|
764
840
|
return {
|
|
765
841
|
get length() {
|
|
766
|
-
return
|
|
842
|
+
return t.length;
|
|
767
843
|
},
|
|
768
844
|
push: function(n) {
|
|
769
|
-
return
|
|
770
|
-
|
|
845
|
+
return t.push(n), function() {
|
|
846
|
+
t = t.filter(function(r) {
|
|
771
847
|
return r !== n;
|
|
772
848
|
});
|
|
773
849
|
};
|
|
774
850
|
},
|
|
775
851
|
call: function(n) {
|
|
776
|
-
|
|
852
|
+
t.forEach(function(r) {
|
|
777
853
|
return r && r(n);
|
|
778
854
|
});
|
|
779
855
|
}
|
|
780
856
|
};
|
|
781
857
|
}
|
|
782
|
-
function
|
|
858
|
+
function ot() {
|
|
783
859
|
return Math.random().toString(36).substr(2, 8);
|
|
784
860
|
}
|
|
785
|
-
function
|
|
786
|
-
var
|
|
861
|
+
function M(t) {
|
|
862
|
+
var e = t.pathname, n = e === void 0 ? "/" : e, r = t.search, o = r === void 0 ? "" : r, a = t.hash, s = a === void 0 ? "" : a;
|
|
787
863
|
return o && o !== "?" && (n += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (n += s.charAt(0) === "#" ? s : "#" + s), n;
|
|
788
864
|
}
|
|
789
|
-
function
|
|
790
|
-
var
|
|
791
|
-
if (
|
|
792
|
-
var n =
|
|
793
|
-
n >= 0 && (
|
|
794
|
-
var r =
|
|
795
|
-
r >= 0 && (
|
|
865
|
+
function z(t) {
|
|
866
|
+
var e = {};
|
|
867
|
+
if (t) {
|
|
868
|
+
var n = t.indexOf("#");
|
|
869
|
+
n >= 0 && (e.hash = t.substr(n), t = t.substr(0, n));
|
|
870
|
+
var r = t.indexOf("?");
|
|
871
|
+
r >= 0 && (e.search = t.substr(r), t = t.substr(0, r)), t && (e.pathname = t);
|
|
796
872
|
}
|
|
797
|
-
return
|
|
798
|
-
}
|
|
799
|
-
function Ct(e, t) {
|
|
800
|
-
function n(r, o, a) {
|
|
801
|
-
if (typeof r == "object") {
|
|
802
|
-
const c = {
|
|
803
|
-
...e.params,
|
|
804
|
-
...r
|
|
805
|
-
};
|
|
806
|
-
return t(e.key, c, o);
|
|
807
|
-
}
|
|
808
|
-
const s = {
|
|
809
|
-
...e.params,
|
|
810
|
-
[r]: o
|
|
811
|
-
};
|
|
812
|
-
return t(e.key, s, a);
|
|
813
|
-
}
|
|
814
|
-
return new Proxy(e, {
|
|
815
|
-
get: (r, o, a) => o === "update" ? n : o === "params" ? new Proxy(e.params, {
|
|
816
|
-
set(s, c, u) {
|
|
817
|
-
return n(c, u), !0;
|
|
818
|
-
}
|
|
819
|
-
}) : Reflect.get(r, o, a)
|
|
820
|
-
});
|
|
873
|
+
return e;
|
|
821
874
|
}
|
|
822
|
-
function
|
|
823
|
-
const n =
|
|
875
|
+
function ze(t, e) {
|
|
876
|
+
const n = Le({ ...t }), r = (s) => {
|
|
824
877
|
Object.assign(n, { ...s });
|
|
825
|
-
}, o =
|
|
878
|
+
}, o = ct(n), a = je(o, e);
|
|
826
879
|
return {
|
|
827
880
|
currentRoute: o,
|
|
828
881
|
routerRoute: a,
|
|
829
882
|
updateRoute: r
|
|
830
883
|
};
|
|
831
884
|
}
|
|
832
|
-
class
|
|
885
|
+
class Ye extends Error {
|
|
886
|
+
constructor(e) {
|
|
887
|
+
super(`Route disabled: "${e}"`);
|
|
888
|
+
}
|
|
833
889
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
890
|
+
class Xe extends Error {
|
|
891
|
+
constructor(e) {
|
|
892
|
+
super(`Route not found: "${e}"`);
|
|
893
|
+
}
|
|
837
894
|
}
|
|
838
|
-
|
|
839
|
-
|
|
895
|
+
const Q = "[", Y = "]";
|
|
896
|
+
function Ze(t) {
|
|
897
|
+
return t !== String && t !== Boolean && t !== Number && t !== Date;
|
|
840
898
|
}
|
|
841
|
-
function
|
|
842
|
-
return typeof
|
|
899
|
+
function tn(t) {
|
|
900
|
+
return typeof t == "function" && Ze(t);
|
|
843
901
|
}
|
|
844
|
-
function
|
|
845
|
-
return typeof
|
|
902
|
+
function ft(t) {
|
|
903
|
+
return typeof t == "object" && "get" in t && typeof t.get == "function" && "set" in t && typeof t.set == "function";
|
|
846
904
|
}
|
|
847
|
-
function
|
|
848
|
-
return
|
|
905
|
+
function Zt(t) {
|
|
906
|
+
return ft(t) ? t : {
|
|
907
|
+
get: (e) => St(e, t),
|
|
908
|
+
set: (e) => kt(e, t)
|
|
909
|
+
};
|
|
849
910
|
}
|
|
850
|
-
const
|
|
851
|
-
function
|
|
852
|
-
return
|
|
911
|
+
const te = Symbol();
|
|
912
|
+
function bt(t) {
|
|
913
|
+
return te in t;
|
|
853
914
|
}
|
|
854
|
-
function
|
|
915
|
+
function en(t) {
|
|
855
916
|
return {
|
|
856
|
-
[
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
917
|
+
[te]: !0,
|
|
918
|
+
...Zt(t)
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
function nn(t) {
|
|
922
|
+
return ft(t) && t.defaultValue !== void 0;
|
|
923
|
+
}
|
|
924
|
+
function Yn(t, e) {
|
|
925
|
+
return {
|
|
926
|
+
defaultValue: e,
|
|
927
|
+
...Zt(t)
|
|
862
928
|
};
|
|
863
929
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
930
|
+
function Pt(t) {
|
|
931
|
+
return typeof t == "string" && t.length > 0;
|
|
932
|
+
}
|
|
933
|
+
function rn(t, e) {
|
|
934
|
+
return t[e] ?? String;
|
|
935
|
+
}
|
|
936
|
+
const N = {
|
|
937
|
+
invalid: (t) => {
|
|
938
|
+
throw new F(t);
|
|
867
939
|
}
|
|
868
|
-
},
|
|
869
|
-
get: (
|
|
870
|
-
set: (
|
|
871
|
-
if (typeof
|
|
872
|
-
throw
|
|
873
|
-
return
|
|
940
|
+
}, on = {
|
|
941
|
+
get: (t) => t,
|
|
942
|
+
set: (t, { invalid: e }) => {
|
|
943
|
+
if (typeof t != "string")
|
|
944
|
+
throw e();
|
|
945
|
+
return t;
|
|
874
946
|
}
|
|
875
|
-
},
|
|
876
|
-
get: (
|
|
877
|
-
if (
|
|
947
|
+
}, ee = {
|
|
948
|
+
get: (t, { invalid: e }) => {
|
|
949
|
+
if (t === "true")
|
|
878
950
|
return !0;
|
|
879
|
-
if (
|
|
951
|
+
if (t === "false")
|
|
880
952
|
return !1;
|
|
881
|
-
throw
|
|
953
|
+
throw e();
|
|
882
954
|
},
|
|
883
|
-
set: (
|
|
884
|
-
if (typeof
|
|
885
|
-
throw
|
|
886
|
-
return
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
get: (
|
|
890
|
-
const n = Number(
|
|
955
|
+
set: (t, { invalid: e }) => {
|
|
956
|
+
if (typeof t != "boolean")
|
|
957
|
+
throw e();
|
|
958
|
+
return t.toString();
|
|
959
|
+
}
|
|
960
|
+
}, ne = {
|
|
961
|
+
get: (t, { invalid: e }) => {
|
|
962
|
+
const n = Number(t);
|
|
891
963
|
if (isNaN(n))
|
|
892
|
-
throw
|
|
964
|
+
throw e();
|
|
893
965
|
return n;
|
|
894
966
|
},
|
|
895
|
-
set: (
|
|
896
|
-
if (typeof
|
|
897
|
-
throw
|
|
898
|
-
return
|
|
899
|
-
}
|
|
900
|
-
},
|
|
901
|
-
get: (
|
|
902
|
-
|
|
903
|
-
const n = new Date(e);
|
|
967
|
+
set: (t, { invalid: e }) => {
|
|
968
|
+
if (typeof t != "number")
|
|
969
|
+
throw e();
|
|
970
|
+
return t.toString();
|
|
971
|
+
}
|
|
972
|
+
}, re = {
|
|
973
|
+
get: (t, { invalid: e }) => {
|
|
974
|
+
const n = new Date(t);
|
|
904
975
|
if (isNaN(n.getTime()))
|
|
905
|
-
throw
|
|
976
|
+
throw e();
|
|
906
977
|
return n;
|
|
907
978
|
},
|
|
908
|
-
set: (
|
|
909
|
-
if (typeof
|
|
910
|
-
throw
|
|
911
|
-
return
|
|
979
|
+
set: (t, { invalid: e }) => {
|
|
980
|
+
if (typeof t != "object" || !(t instanceof Date))
|
|
981
|
+
throw e();
|
|
982
|
+
return t.toISOString();
|
|
912
983
|
}
|
|
913
|
-
},
|
|
914
|
-
get: (
|
|
984
|
+
}, oe = {
|
|
985
|
+
get: (t, { invalid: e }) => {
|
|
915
986
|
try {
|
|
916
|
-
return JSON.parse(
|
|
987
|
+
return JSON.parse(t);
|
|
917
988
|
} catch {
|
|
918
|
-
throw
|
|
989
|
+
throw e();
|
|
919
990
|
}
|
|
920
991
|
},
|
|
921
|
-
set: (
|
|
992
|
+
set: (t, { invalid: e }) => {
|
|
922
993
|
try {
|
|
923
|
-
return JSON.stringify(
|
|
994
|
+
return JSON.stringify(t);
|
|
924
995
|
} catch {
|
|
925
|
-
throw
|
|
996
|
+
throw e();
|
|
926
997
|
}
|
|
927
998
|
}
|
|
928
999
|
};
|
|
929
|
-
function
|
|
930
|
-
if (
|
|
931
|
-
if (
|
|
932
|
-
return
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
return Jt.get(e, U);
|
|
937
|
-
if (t === Boolean)
|
|
938
|
-
return Ye.get(e, U);
|
|
939
|
-
if (t === Number)
|
|
940
|
-
return Xe.get(e, U);
|
|
941
|
-
if (t === Date)
|
|
942
|
-
return Ze.get(e, U);
|
|
943
|
-
if (t === JSON)
|
|
944
|
-
return et.get(e, U);
|
|
945
|
-
if (Tt(t))
|
|
946
|
-
return t(e, U);
|
|
947
|
-
if (We(t))
|
|
948
|
-
return t.get(e, U);
|
|
949
|
-
if (t instanceof RegExp) {
|
|
950
|
-
if (t.test(e))
|
|
951
|
-
return e;
|
|
952
|
-
throw new ne();
|
|
1000
|
+
function St(t, e) {
|
|
1001
|
+
if (t === void 0 || !Pt(t)) {
|
|
1002
|
+
if (nn(e))
|
|
1003
|
+
return e.defaultValue;
|
|
1004
|
+
if (bt(e))
|
|
1005
|
+
return;
|
|
1006
|
+
throw new F();
|
|
953
1007
|
}
|
|
954
|
-
|
|
1008
|
+
if (e === String)
|
|
1009
|
+
return on.get(t, N);
|
|
1010
|
+
if (e === Boolean)
|
|
1011
|
+
return ee.get(t, N);
|
|
1012
|
+
if (e === Number)
|
|
1013
|
+
return ne.get(t, N);
|
|
1014
|
+
if (e === Date)
|
|
1015
|
+
return re.get(t, N);
|
|
1016
|
+
if (e === JSON)
|
|
1017
|
+
return oe.get(t, N);
|
|
1018
|
+
if (tn(e))
|
|
1019
|
+
return e(t, N);
|
|
1020
|
+
if (ft(e))
|
|
1021
|
+
return e.get(t, N);
|
|
1022
|
+
if (e instanceof RegExp) {
|
|
1023
|
+
if (e.test(t))
|
|
1024
|
+
return t;
|
|
1025
|
+
throw new F();
|
|
1026
|
+
}
|
|
1027
|
+
return t;
|
|
955
1028
|
}
|
|
956
|
-
function
|
|
957
|
-
if (t ===
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1029
|
+
function kt(t, e) {
|
|
1030
|
+
if (t === void 0) {
|
|
1031
|
+
if (bt(e))
|
|
1032
|
+
return "";
|
|
1033
|
+
throw new F();
|
|
1034
|
+
}
|
|
1035
|
+
if (e === Boolean)
|
|
1036
|
+
return ee.set(t, N);
|
|
1037
|
+
if (e === Number)
|
|
1038
|
+
return ne.set(t, N);
|
|
1039
|
+
if (e === Date)
|
|
1040
|
+
return re.set(t, N);
|
|
1041
|
+
if (e === JSON)
|
|
1042
|
+
return oe.set(t, N);
|
|
1043
|
+
if (ft(e))
|
|
1044
|
+
return e.set(t, N);
|
|
967
1045
|
try {
|
|
968
|
-
return
|
|
1046
|
+
return t.toString();
|
|
969
1047
|
} catch {
|
|
970
|
-
throw new
|
|
1048
|
+
throw new F();
|
|
971
1049
|
}
|
|
972
1050
|
}
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
-
return new RegExp(`^${
|
|
1051
|
+
function an(t) {
|
|
1052
|
+
const e = xt(t.path.toString());
|
|
1053
|
+
return new RegExp(`^${e}$`, "i");
|
|
976
1054
|
}
|
|
977
|
-
function
|
|
978
|
-
const
|
|
979
|
-
return Array.from(
|
|
1055
|
+
function sn(t) {
|
|
1056
|
+
const e = new URLSearchParams(t.query.toString());
|
|
1057
|
+
return Array.from(e.entries()).filter(([, n]) => !se(n)).map(([n, r]) => new RegExp(`${n}=${xt(r)}(&|$)`, "i"));
|
|
980
1058
|
}
|
|
981
|
-
function
|
|
1059
|
+
function xt(t) {
|
|
982
1060
|
return [
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
].reduce((
|
|
1061
|
+
cn,
|
|
1062
|
+
un
|
|
1063
|
+
].reduce((e, n) => n(e), t);
|
|
986
1064
|
}
|
|
987
|
-
const
|
|
988
|
-
function
|
|
989
|
-
return
|
|
1065
|
+
const At = `\\${Q}\\?([\\w-_]+)\\${Y}`, ae = `\\${Q}([\\w-_]+)\\${Y}`;
|
|
1066
|
+
function cn(t) {
|
|
1067
|
+
return t.replace(new RegExp(At, "g"), ".*");
|
|
990
1068
|
}
|
|
991
|
-
function
|
|
992
|
-
return new RegExp(
|
|
1069
|
+
function se(t) {
|
|
1070
|
+
return new RegExp(At, "g").test(t);
|
|
993
1071
|
}
|
|
994
|
-
function
|
|
995
|
-
return
|
|
1072
|
+
function un(t) {
|
|
1073
|
+
return t.replace(new RegExp(ae, "g"), ".+");
|
|
996
1074
|
}
|
|
997
|
-
function
|
|
998
|
-
const [
|
|
999
|
-
return
|
|
1075
|
+
function fn(t) {
|
|
1076
|
+
const [e] = at(t, new RegExp(At, "g")), [n] = at(t, new RegExp(ae, "g"));
|
|
1077
|
+
return e ?? n;
|
|
1000
1078
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return Array.from(
|
|
1079
|
+
function at(t, e) {
|
|
1080
|
+
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => Pt(o) ? o : ""));
|
|
1003
1081
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const r =
|
|
1082
|
+
function ce(t, e, n) {
|
|
1083
|
+
const r = ie(e, n), [o] = at(t, r);
|
|
1006
1084
|
return o;
|
|
1007
1085
|
}
|
|
1008
|
-
function
|
|
1009
|
-
if (!
|
|
1010
|
-
return
|
|
1011
|
-
const { name: n, param: r, value: o } =
|
|
1012
|
-
return
|
|
1086
|
+
function ln(t, e) {
|
|
1087
|
+
if (!e)
|
|
1088
|
+
return t;
|
|
1089
|
+
const { name: n, param: r, value: o } = e, a = ie(t, n);
|
|
1090
|
+
return at(t, a).reduce((c, u) => u === void 0 ? c : c.replace(u, () => kt(o, r)), t);
|
|
1013
1091
|
}
|
|
1014
|
-
function
|
|
1092
|
+
function ie(t, e) {
|
|
1015
1093
|
const n = [
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
].reduce((r, o) => o(r,
|
|
1094
|
+
hn,
|
|
1095
|
+
pn,
|
|
1096
|
+
xt
|
|
1097
|
+
].reduce((r, o) => o(r, e), t);
|
|
1020
1098
|
return new RegExp(n, "g");
|
|
1021
1099
|
}
|
|
1022
|
-
function
|
|
1023
|
-
const n = new RegExp(`(\\${
|
|
1024
|
-
return
|
|
1100
|
+
function hn(t, e) {
|
|
1101
|
+
const n = new RegExp(`(\\${Q}\\?${e})\\${Y}`, "g");
|
|
1102
|
+
return t.replace(n, "(.*)");
|
|
1025
1103
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const n = new RegExp(`(\\${
|
|
1028
|
-
return
|
|
1104
|
+
function pn(t, e) {
|
|
1105
|
+
const n = new RegExp(`(\\${Q}${e})\\${Y}`, "g");
|
|
1106
|
+
return t.replace(n, "(.+)");
|
|
1029
1107
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return
|
|
1108
|
+
function ue(t, ...e) {
|
|
1109
|
+
return e.reduce((n, r) => {
|
|
1032
1110
|
if (!r)
|
|
1033
1111
|
return n;
|
|
1034
1112
|
const o = new URLSearchParams(r).toString();
|
|
1035
1113
|
return Object.keys(o).length === 0 ? n : n.includes("?") ? `${n}&${o}` : `${n}?${o}`;
|
|
1036
|
-
},
|
|
1114
|
+
}, t);
|
|
1037
1115
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const { params: n = {}, query: r } =
|
|
1040
|
-
return
|
|
1116
|
+
function dn(t, e = {}) {
|
|
1117
|
+
const { params: n = {}, query: r } = e, o = { ...t.path.params, ...t.query.params }, a = t.path.toString(), s = t.query.toString(), c = mn(a, o, n), u = Rn(s, o, n);
|
|
1118
|
+
return ue(c, u, r);
|
|
1041
1119
|
}
|
|
1042
|
-
function
|
|
1043
|
-
return
|
|
1120
|
+
function mn(t, e, n) {
|
|
1121
|
+
return t.length ? Object.entries(e).reduce((r, [o, a]) => ln(r, { name: o, param: a, value: n[o] }), t) : t;
|
|
1044
1122
|
}
|
|
1045
|
-
function
|
|
1046
|
-
if (!
|
|
1123
|
+
function Rn(t, e, n) {
|
|
1124
|
+
if (!t.length)
|
|
1047
1125
|
return {};
|
|
1048
|
-
const r = new URLSearchParams(
|
|
1126
|
+
const r = new URLSearchParams(t);
|
|
1049
1127
|
return Array.from(r.entries()).reduce((o, [a, s]) => {
|
|
1050
|
-
const c =
|
|
1128
|
+
const c = fn(s);
|
|
1051
1129
|
if (!c)
|
|
1052
1130
|
return { ...o, [a]: s };
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1131
|
+
const f = kt(n[c], e[c]), R = n[c] === void 0 && f === "";
|
|
1132
|
+
return se(s) && R ? o : { ...o, [a]: f };
|
|
1055
1133
|
}, {});
|
|
1056
1134
|
}
|
|
1057
|
-
function
|
|
1058
|
-
return (
|
|
1059
|
-
if (
|
|
1060
|
-
return
|
|
1061
|
-
const o = n ?? {}, a = r ?? {}, s =
|
|
1135
|
+
function fe(t) {
|
|
1136
|
+
return (e, n, r) => {
|
|
1137
|
+
if (I(e))
|
|
1138
|
+
return ue(e, (n ?? {}).query);
|
|
1139
|
+
const o = n ?? {}, a = r ?? {}, s = t.find((u) => u.key === e);
|
|
1062
1140
|
if (!s)
|
|
1063
|
-
throw
|
|
1141
|
+
throw new Xe(String(e));
|
|
1064
1142
|
if (s.matched.disabled)
|
|
1065
|
-
throw
|
|
1066
|
-
return
|
|
1143
|
+
throw new Ye(String(e));
|
|
1144
|
+
return dn(s, {
|
|
1067
1145
|
params: o,
|
|
1068
1146
|
query: a.query
|
|
1069
1147
|
});
|
|
1070
1148
|
};
|
|
1071
1149
|
}
|
|
1072
|
-
function
|
|
1073
|
-
return !
|
|
1150
|
+
function T(t) {
|
|
1151
|
+
return !t.startsWith("http") ? yn(t) : gn(t);
|
|
1074
1152
|
}
|
|
1075
|
-
function
|
|
1076
|
-
const { protocol:
|
|
1153
|
+
function gn(t) {
|
|
1154
|
+
const { protocol: e, host: n, pathname: r, search: o, searchParams: a, hash: s } = new URL(t, t);
|
|
1077
1155
|
return {
|
|
1078
|
-
protocol:
|
|
1156
|
+
protocol: e,
|
|
1079
1157
|
host: n,
|
|
1080
1158
|
pathname: r,
|
|
1081
1159
|
search: o,
|
|
@@ -1083,104 +1161,113 @@ function nn(e) {
|
|
|
1083
1161
|
hash: s
|
|
1084
1162
|
};
|
|
1085
1163
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const { pathname:
|
|
1164
|
+
function yn(t) {
|
|
1165
|
+
const { pathname: e, search: n, searchParams: r, hash: o } = new URL(t, "https://localhost");
|
|
1088
1166
|
return {
|
|
1089
|
-
pathname:
|
|
1167
|
+
pathname: e,
|
|
1090
1168
|
search: n,
|
|
1091
1169
|
searchParams: r,
|
|
1092
1170
|
hash: o
|
|
1093
1171
|
};
|
|
1094
1172
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const
|
|
1173
|
+
function le(t) {
|
|
1174
|
+
const e = new URLSearchParams(t);
|
|
1097
1175
|
return {
|
|
1098
|
-
get: (n) =>
|
|
1099
|
-
getAll: (n) =>
|
|
1176
|
+
get: (n) => e.get(n),
|
|
1177
|
+
getAll: (n) => e.getAll(n)
|
|
1100
1178
|
};
|
|
1101
1179
|
}
|
|
1102
|
-
const
|
|
1180
|
+
const vn = (t, e) => {
|
|
1103
1181
|
try {
|
|
1104
|
-
|
|
1182
|
+
he(t, e);
|
|
1105
1183
|
} catch {
|
|
1106
1184
|
return !1;
|
|
1107
1185
|
}
|
|
1108
1186
|
return !0;
|
|
1109
|
-
},
|
|
1110
|
-
const { pathname: n, search: r } =
|
|
1187
|
+
}, he = (t, e) => {
|
|
1188
|
+
const { pathname: n, search: r } = T(e);
|
|
1111
1189
|
return {
|
|
1112
|
-
...
|
|
1113
|
-
...
|
|
1190
|
+
...wn(t.path, n),
|
|
1191
|
+
...En(t.query, r)
|
|
1114
1192
|
};
|
|
1115
1193
|
};
|
|
1116
|
-
function
|
|
1117
|
-
const n = {}, r = decodeURIComponent(
|
|
1118
|
-
for (const [o, a] of Object.entries(
|
|
1119
|
-
const s =
|
|
1194
|
+
function wn(t, e) {
|
|
1195
|
+
const n = {}, r = decodeURIComponent(e);
|
|
1196
|
+
for (const [o, a] of Object.entries(t.params)) {
|
|
1197
|
+
const s = ce(r, t.toString(), o), c = St(s, a);
|
|
1120
1198
|
n[o] = c;
|
|
1121
1199
|
}
|
|
1122
1200
|
return n;
|
|
1123
1201
|
}
|
|
1124
|
-
function
|
|
1125
|
-
const n = {}, r = new URLSearchParams(
|
|
1126
|
-
for (const [o, a] of Object.entries(
|
|
1127
|
-
const s = r.get(o) ?? void 0, c =
|
|
1202
|
+
function En(t, e) {
|
|
1203
|
+
const n = {}, r = new URLSearchParams(e);
|
|
1204
|
+
for (const [o, a] of Object.entries(t.params)) {
|
|
1205
|
+
const s = r.get(o) ?? void 0, c = St(s, a);
|
|
1128
1206
|
n[o] = c;
|
|
1129
1207
|
}
|
|
1130
1208
|
return n;
|
|
1131
1209
|
}
|
|
1132
|
-
const
|
|
1133
|
-
const {
|
|
1134
|
-
return
|
|
1135
|
-
},
|
|
1136
|
-
const {
|
|
1137
|
-
return
|
|
1210
|
+
const bn = (t) => "name" in t.matched && !!t.matched.name, Pn = (t, e) => {
|
|
1211
|
+
const { host: n } = T(e), { host: r } = T(t.path.toString());
|
|
1212
|
+
return n === r;
|
|
1213
|
+
}, Sn = (t, e) => {
|
|
1214
|
+
const { pathname: n } = T(e);
|
|
1215
|
+
return an(t).test(n);
|
|
1216
|
+
}, kn = (t, e) => {
|
|
1217
|
+
const { search: n } = T(e);
|
|
1218
|
+
return sn(t).every((o) => o.test(n));
|
|
1138
1219
|
};
|
|
1139
|
-
function
|
|
1140
|
-
const { searchParams:
|
|
1220
|
+
function xn(t) {
|
|
1221
|
+
const { searchParams: e, pathname: n } = T(t), r = -1, o = 1;
|
|
1141
1222
|
return (a, s) => {
|
|
1142
|
-
const c =
|
|
1143
|
-
return c + u >
|
|
1223
|
+
const c = Vt(a, e), u = jt(a, n), f = Vt(s, e), R = jt(s, n);
|
|
1224
|
+
return c + u > f + R ? r : c + u < f + R ? o : a.depth > s.depth ? r : a.depth < s.depth ? o : 0;
|
|
1144
1225
|
};
|
|
1145
1226
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const n = Object.entries(
|
|
1227
|
+
function jt(t, e) {
|
|
1228
|
+
const n = Object.entries(t.path.params).filter(([, o]) => bt(o)).map(([o]) => o), r = n.filter((o) => ce(e, t.path.toString(), o) === void 0);
|
|
1148
1229
|
return n.length - r.length;
|
|
1149
1230
|
}
|
|
1150
|
-
function
|
|
1151
|
-
const n = new URLSearchParams(
|
|
1231
|
+
function Vt(t, e) {
|
|
1232
|
+
const n = new URLSearchParams(t.query.toString()), r = Array.from(n.keys()), o = r.filter((a) => !e.has(a));
|
|
1152
1233
|
return r.length - o.length;
|
|
1153
1234
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1235
|
+
const An = [
|
|
1236
|
+
bn,
|
|
1237
|
+
Pn,
|
|
1238
|
+
Sn,
|
|
1239
|
+
kn,
|
|
1240
|
+
vn
|
|
1241
|
+
];
|
|
1242
|
+
function pe(t, e) {
|
|
1243
|
+
const n = xn(e), r = t.filter((u) => An.every((f) => f(u, e))).sort(n);
|
|
1244
|
+
if (r.length === 0)
|
|
1157
1245
|
return;
|
|
1158
|
-
const [
|
|
1159
|
-
return
|
|
1160
|
-
matched:
|
|
1161
|
-
matches:
|
|
1162
|
-
key:
|
|
1163
|
-
query:
|
|
1164
|
-
params:
|
|
1246
|
+
const [o] = r, { search: a } = T(e), s = le(a), c = he(o, e);
|
|
1247
|
+
return ct({
|
|
1248
|
+
matched: o.matched,
|
|
1249
|
+
matches: o.matches,
|
|
1250
|
+
key: o.key,
|
|
1251
|
+
query: s,
|
|
1252
|
+
params: c
|
|
1165
1253
|
});
|
|
1166
1254
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
return ut(e, o);
|
|
1255
|
+
function Ln(t) {
|
|
1256
|
+
return (e, n = {}) => {
|
|
1257
|
+
const o = fe(t)(e, n);
|
|
1258
|
+
return pe(t, o);
|
|
1172
1259
|
};
|
|
1173
1260
|
}
|
|
1174
|
-
function
|
|
1261
|
+
function de() {
|
|
1175
1262
|
return typeof window < "u" && typeof window.document < "u";
|
|
1176
1263
|
}
|
|
1177
|
-
function
|
|
1178
|
-
const n =
|
|
1179
|
-
if (
|
|
1264
|
+
function Un({ mode: t, listener: e }) {
|
|
1265
|
+
const n = Bn(t), r = (u, f) => {
|
|
1266
|
+
if (f != null && f.replace)
|
|
1180
1267
|
return n.replace(u);
|
|
1181
1268
|
n.push(u);
|
|
1182
1269
|
}, o = () => {
|
|
1183
|
-
const u =
|
|
1270
|
+
const u = M(n.location);
|
|
1184
1271
|
return n.replace(u);
|
|
1185
1272
|
};
|
|
1186
1273
|
let a;
|
|
@@ -1189,66 +1276,66 @@ function pn({ mode: e, listener: t }) {
|
|
|
1189
1276
|
update: r,
|
|
1190
1277
|
refresh: o,
|
|
1191
1278
|
startListening: () => {
|
|
1192
|
-
a == null || a(), a = n.listen(
|
|
1279
|
+
a == null || a(), a = n.listen(e);
|
|
1193
1280
|
},
|
|
1194
1281
|
stopListening: () => {
|
|
1195
1282
|
a == null || a();
|
|
1196
1283
|
}
|
|
1197
1284
|
};
|
|
1198
1285
|
}
|
|
1199
|
-
function
|
|
1200
|
-
switch (
|
|
1286
|
+
function Bn(t = "auto") {
|
|
1287
|
+
switch (t) {
|
|
1201
1288
|
case "auto":
|
|
1202
|
-
return
|
|
1289
|
+
return de() ? Ht() : Nt();
|
|
1203
1290
|
case "browser":
|
|
1204
|
-
return
|
|
1291
|
+
return Ht();
|
|
1205
1292
|
case "memory":
|
|
1206
|
-
return
|
|
1293
|
+
return Nt();
|
|
1207
1294
|
case "hash":
|
|
1208
|
-
return
|
|
1295
|
+
return Ge();
|
|
1209
1296
|
default:
|
|
1210
|
-
const
|
|
1211
|
-
throw new Error(`Switch is not exhaustive for mode: ${
|
|
1297
|
+
const e = t;
|
|
1298
|
+
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
1212
1299
|
}
|
|
1213
1300
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return
|
|
1216
|
-
name:
|
|
1301
|
+
function Hn(t) {
|
|
1302
|
+
return it(() => () => Tt("h1", t), {
|
|
1303
|
+
name: t,
|
|
1217
1304
|
props: []
|
|
1218
1305
|
});
|
|
1219
1306
|
}
|
|
1220
|
-
const
|
|
1221
|
-
function
|
|
1222
|
-
rejections:
|
|
1307
|
+
const Ct = Symbol();
|
|
1308
|
+
function Nn({
|
|
1309
|
+
rejections: t
|
|
1223
1310
|
}) {
|
|
1224
|
-
const
|
|
1311
|
+
const e = (s) => {
|
|
1225
1312
|
const c = {
|
|
1226
|
-
...
|
|
1313
|
+
...t
|
|
1227
1314
|
};
|
|
1228
|
-
return
|
|
1315
|
+
return pt(c[s] ?? Hn(s));
|
|
1229
1316
|
}, n = (s) => {
|
|
1230
|
-
const c =
|
|
1317
|
+
const c = pt(e(s)), u = {
|
|
1231
1318
|
name: s,
|
|
1232
1319
|
path: "",
|
|
1233
1320
|
component: c,
|
|
1234
1321
|
meta: {}
|
|
1235
1322
|
};
|
|
1236
|
-
return
|
|
1323
|
+
return ct({
|
|
1237
1324
|
matched: u,
|
|
1238
1325
|
matches: [u],
|
|
1239
1326
|
key: s,
|
|
1240
|
-
query:
|
|
1327
|
+
query: le(""),
|
|
1241
1328
|
params: {},
|
|
1242
|
-
[
|
|
1329
|
+
[Ct]: !0
|
|
1243
1330
|
});
|
|
1244
|
-
}, r = (s) => s[
|
|
1331
|
+
}, r = (s) => s[Ct] === !0, o = (s) => {
|
|
1245
1332
|
if (!s) {
|
|
1246
1333
|
a.value = null;
|
|
1247
1334
|
return;
|
|
1248
1335
|
}
|
|
1249
|
-
const c =
|
|
1336
|
+
const c = e(s);
|
|
1250
1337
|
a.value = { type: s, component: c };
|
|
1251
|
-
}, a =
|
|
1338
|
+
}, a = Ue(null);
|
|
1252
1339
|
return {
|
|
1253
1340
|
setRejection: o,
|
|
1254
1341
|
rejection: a,
|
|
@@ -1256,128 +1343,128 @@ function gn({
|
|
|
1256
1343
|
isRejectionRoute: r
|
|
1257
1344
|
};
|
|
1258
1345
|
}
|
|
1259
|
-
class
|
|
1346
|
+
class $n extends Error {
|
|
1260
1347
|
constructor() {
|
|
1261
1348
|
super("initialUrl must be set if window.location is unavailable");
|
|
1262
1349
|
}
|
|
1263
1350
|
}
|
|
1264
|
-
function
|
|
1265
|
-
if (
|
|
1266
|
-
return
|
|
1267
|
-
if (
|
|
1351
|
+
function jn(t) {
|
|
1352
|
+
if (t)
|
|
1353
|
+
return t;
|
|
1354
|
+
if (de())
|
|
1268
1355
|
return window.location.toString();
|
|
1269
|
-
throw new
|
|
1356
|
+
throw new $n();
|
|
1270
1357
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const n =
|
|
1273
|
-
mode:
|
|
1358
|
+
function Xn(t, e = {}) {
|
|
1359
|
+
const n = fe(t), r = Un({
|
|
1360
|
+
mode: e.historyMode,
|
|
1274
1361
|
listener: () => {
|
|
1275
|
-
const g =
|
|
1276
|
-
|
|
1362
|
+
const g = M(location);
|
|
1363
|
+
p(g);
|
|
1277
1364
|
}
|
|
1278
|
-
}), { runBeforeRouteHooks: o, runAfterRouteHooks: a } =
|
|
1365
|
+
}), { runBeforeRouteHooks: o, runAfterRouteHooks: a } = De(), {
|
|
1279
1366
|
hooks: s,
|
|
1280
1367
|
onBeforeRouteEnter: c,
|
|
1281
1368
|
onAfterRouteUpdate: u,
|
|
1282
|
-
onBeforeRouteLeave:
|
|
1283
|
-
onAfterRouteEnter:
|
|
1284
|
-
onBeforeRouteUpdate:
|
|
1369
|
+
onBeforeRouteLeave: f,
|
|
1370
|
+
onAfterRouteEnter: R,
|
|
1371
|
+
onBeforeRouteUpdate: d,
|
|
1285
1372
|
onAfterRouteLeave: A
|
|
1286
|
-
} =
|
|
1287
|
-
async function
|
|
1373
|
+
} = Te();
|
|
1374
|
+
async function p(g, { replace: P } = {}) {
|
|
1288
1375
|
r.stopListening();
|
|
1289
|
-
const x =
|
|
1376
|
+
const x = pe(t, g) ?? y("NotFound"), C = { ...b }, q = await o({ to: x, from: C, hooks: s });
|
|
1290
1377
|
switch (q.status) {
|
|
1291
1378
|
case "ABORT":
|
|
1292
1379
|
return;
|
|
1293
1380
|
case "PUSH":
|
|
1294
|
-
r.update(g, { replace: P }), await
|
|
1381
|
+
r.update(g, { replace: P }), await S(...q.to);
|
|
1295
1382
|
return;
|
|
1296
1383
|
case "REJECT":
|
|
1297
|
-
r.update(g, { replace: P }),
|
|
1384
|
+
r.update(g, { replace: P }), U(q.type), i(x);
|
|
1298
1385
|
break;
|
|
1299
1386
|
case "SUCCESS":
|
|
1300
|
-
r.update(g, { replace: P }),
|
|
1387
|
+
r.update(g, { replace: P }), U(null), i(x);
|
|
1301
1388
|
break;
|
|
1302
1389
|
default:
|
|
1303
1390
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(q)}`);
|
|
1304
1391
|
}
|
|
1305
|
-
const
|
|
1306
|
-
switch (
|
|
1392
|
+
const O = await a({ to: x, from: C, hooks: s });
|
|
1393
|
+
switch (O.status) {
|
|
1307
1394
|
case "PUSH":
|
|
1308
|
-
await
|
|
1395
|
+
await S(...O.to);
|
|
1309
1396
|
break;
|
|
1310
1397
|
case "REJECT":
|
|
1311
|
-
|
|
1398
|
+
U(O.type);
|
|
1312
1399
|
break;
|
|
1313
1400
|
case "SUCCESS":
|
|
1314
1401
|
break;
|
|
1315
1402
|
default:
|
|
1316
|
-
const
|
|
1317
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1403
|
+
const X = O;
|
|
1404
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(X)}`);
|
|
1318
1405
|
}
|
|
1319
1406
|
r.startListening();
|
|
1320
1407
|
}
|
|
1321
|
-
const
|
|
1322
|
-
if (
|
|
1323
|
-
const
|
|
1324
|
-
return
|
|
1408
|
+
const S = (g, P, x) => {
|
|
1409
|
+
if (I(g)) {
|
|
1410
|
+
const X = { ...P }, ye = n(g, X);
|
|
1411
|
+
return p(ye, { replace: X.replace });
|
|
1325
1412
|
}
|
|
1326
|
-
const
|
|
1327
|
-
return
|
|
1328
|
-
},
|
|
1329
|
-
if (
|
|
1330
|
-
const
|
|
1331
|
-
return
|
|
1413
|
+
const C = { ...x }, O = n(g, P ?? {}, C);
|
|
1414
|
+
return p(O, { replace: C.replace });
|
|
1415
|
+
}, j = (g, P, x) => {
|
|
1416
|
+
if (I(g)) {
|
|
1417
|
+
const O = { ...P, replace: !0 };
|
|
1418
|
+
return S(g, O);
|
|
1332
1419
|
}
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1335
|
-
},
|
|
1420
|
+
const C = P ?? {}, q = { ...x, replace: !0 };
|
|
1421
|
+
return S(g, C, q);
|
|
1422
|
+
}, V = (g) => U(g), B = Ln(t), { setRejection: U, rejection: m, getRejectionRoute: y } = Nn(e), E = y("NotFound"), { currentRoute: b, routerRoute: h, updateRoute: i } = ze(E, S);
|
|
1336
1423
|
r.startListening();
|
|
1337
|
-
const
|
|
1338
|
-
function
|
|
1339
|
-
g.component("RouterView",
|
|
1424
|
+
const l = jn(e.initialUrl), v = p(l, { replace: !0 });
|
|
1425
|
+
function w(g) {
|
|
1426
|
+
g.component("RouterView", Yt), g.component("RouterLink", Fe), g.provide(Wt, k), g.provide(Ft, m), g.provide(Kt, s);
|
|
1340
1427
|
}
|
|
1341
|
-
const
|
|
1342
|
-
route:
|
|
1428
|
+
const k = {
|
|
1429
|
+
route: h,
|
|
1343
1430
|
resolve: n,
|
|
1344
|
-
push:
|
|
1345
|
-
replace:
|
|
1346
|
-
reject:
|
|
1347
|
-
find:
|
|
1431
|
+
push: S,
|
|
1432
|
+
replace: j,
|
|
1433
|
+
reject: V,
|
|
1434
|
+
find: B,
|
|
1348
1435
|
refresh: r.refresh,
|
|
1349
1436
|
forward: r.forward,
|
|
1350
1437
|
back: r.back,
|
|
1351
1438
|
go: r.go,
|
|
1352
|
-
install:
|
|
1353
|
-
initialized:
|
|
1439
|
+
install: w,
|
|
1440
|
+
initialized: v,
|
|
1354
1441
|
onBeforeRouteEnter: c,
|
|
1355
1442
|
onAfterRouteUpdate: u,
|
|
1356
|
-
onBeforeRouteLeave:
|
|
1357
|
-
onAfterRouteEnter:
|
|
1358
|
-
onBeforeRouteUpdate:
|
|
1443
|
+
onBeforeRouteLeave: f,
|
|
1444
|
+
onAfterRouteEnter: R,
|
|
1445
|
+
onBeforeRouteUpdate: d,
|
|
1359
1446
|
onAfterRouteLeave: A
|
|
1360
1447
|
};
|
|
1361
|
-
return
|
|
1448
|
+
return k;
|
|
1362
1449
|
}
|
|
1363
|
-
function
|
|
1364
|
-
const n = new RegExp(`\\${
|
|
1365
|
-
return Array.from(
|
|
1366
|
-
const c = a.startsWith(`${
|
|
1450
|
+
function me(t, e) {
|
|
1451
|
+
const n = new RegExp(`\\${Q}\\??([\\w-_]+)\\${Y}`, "g");
|
|
1452
|
+
return Array.from(t.matchAll(n)).reduce((o, [a, s]) => {
|
|
1453
|
+
const c = a.startsWith(`${Q}?`), u = rn(e, s);
|
|
1367
1454
|
if (s in o)
|
|
1368
|
-
throw new
|
|
1369
|
-
return o[s] = c ?
|
|
1455
|
+
throw new ut(s);
|
|
1456
|
+
return o[s] = c ? en(u) : u, o;
|
|
1370
1457
|
}, {});
|
|
1371
1458
|
}
|
|
1372
|
-
function
|
|
1459
|
+
function Re(t, e) {
|
|
1373
1460
|
return {
|
|
1374
|
-
path:
|
|
1375
|
-
params:
|
|
1376
|
-
toString: () =>
|
|
1461
|
+
path: t,
|
|
1462
|
+
params: me(t, e),
|
|
1463
|
+
toString: () => t
|
|
1377
1464
|
};
|
|
1378
1465
|
}
|
|
1379
|
-
function
|
|
1380
|
-
const n = Object.keys(
|
|
1466
|
+
function Lt(t, e) {
|
|
1467
|
+
const n = Object.keys(t), r = Object.keys(e), o = n.find((a) => r.includes(a));
|
|
1381
1468
|
return o ? {
|
|
1382
1469
|
key: o,
|
|
1383
1470
|
hasDuplicates: !0
|
|
@@ -1386,101 +1473,105 @@ function Se(e, t) {
|
|
|
1386
1473
|
hasDuplicates: !1
|
|
1387
1474
|
};
|
|
1388
1475
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const { hasDuplicates: n, key: r } =
|
|
1476
|
+
function Vn(t, e) {
|
|
1477
|
+
const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
|
|
1391
1478
|
if (n)
|
|
1392
|
-
throw new
|
|
1393
|
-
return
|
|
1479
|
+
throw new ut(r);
|
|
1480
|
+
return Re(`${t.path}${e.path}`, { ...t.params, ...e.params });
|
|
1394
1481
|
}
|
|
1395
|
-
function
|
|
1482
|
+
function dt(t, e) {
|
|
1396
1483
|
return {
|
|
1397
|
-
query:
|
|
1398
|
-
params:
|
|
1399
|
-
toString: () =>
|
|
1484
|
+
query: t,
|
|
1485
|
+
params: me(t, e),
|
|
1486
|
+
toString: () => t
|
|
1400
1487
|
};
|
|
1401
1488
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const { hasDuplicates: n, key: r } =
|
|
1489
|
+
function Cn(t, e) {
|
|
1490
|
+
const { hasDuplicates: n, key: r } = Lt(t.params, e.params);
|
|
1404
1491
|
if (n)
|
|
1405
|
-
throw new
|
|
1406
|
-
const o = [
|
|
1407
|
-
return
|
|
1408
|
-
}
|
|
1409
|
-
function pt(e) {
|
|
1410
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1492
|
+
throw new ut(r);
|
|
1493
|
+
const o = [t.query, e.query].filter(Pt).join("&");
|
|
1494
|
+
return dt(o, { ...t.params, ...e.params });
|
|
1411
1495
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return
|
|
1496
|
+
function ge(t) {
|
|
1497
|
+
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1414
1498
|
}
|
|
1415
|
-
function
|
|
1416
|
-
return
|
|
1499
|
+
function On(t) {
|
|
1500
|
+
return ge(t) && typeof t.path == "string";
|
|
1417
1501
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return
|
|
1502
|
+
function _n(t) {
|
|
1503
|
+
return On(t) ? t : Re(t, {});
|
|
1420
1504
|
}
|
|
1421
|
-
function
|
|
1422
|
-
return
|
|
1505
|
+
function qn(t) {
|
|
1506
|
+
return ge(t) && typeof t.query == "string";
|
|
1423
1507
|
}
|
|
1424
|
-
function
|
|
1425
|
-
return "
|
|
1508
|
+
function Dn(t) {
|
|
1509
|
+
return t === void 0 ? dt("", {}) : qn(t) ? t : dt(t, {});
|
|
1426
1510
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const
|
|
1429
|
-
const o =
|
|
1430
|
-
|
|
1431
|
-
component: r.component ?? Fe
|
|
1432
|
-
});
|
|
1433
|
-
return Sn(r) && n.push(...r.children.map((a) => ({
|
|
1511
|
+
function Zn(t) {
|
|
1512
|
+
const e = t.reduce((n, r) => {
|
|
1513
|
+
const o = Mn(r);
|
|
1514
|
+
return zt(r) && n.push(...r.children.map((a) => ({
|
|
1434
1515
|
...a,
|
|
1435
|
-
key:
|
|
1436
|
-
path:
|
|
1437
|
-
query:
|
|
1516
|
+
key: It(o.key, a.key),
|
|
1517
|
+
path: Vn(o.path, a.path),
|
|
1518
|
+
query: Cn(o.query, a.query),
|
|
1438
1519
|
matches: [o.matched, ...a.matches],
|
|
1439
1520
|
depth: a.depth + 1
|
|
1440
1521
|
}))), n.push(o), n;
|
|
1441
1522
|
}, []);
|
|
1442
|
-
return
|
|
1443
|
-
const { hasDuplicates: o, key: a } =
|
|
1523
|
+
return e.forEach(({ path: n, query: r }) => {
|
|
1524
|
+
const { hasDuplicates: o, key: a } = Lt(n.params, r.params);
|
|
1444
1525
|
if (o)
|
|
1445
|
-
throw new
|
|
1446
|
-
}),
|
|
1526
|
+
throw new ut(a);
|
|
1527
|
+
}), e;
|
|
1447
1528
|
}
|
|
1448
|
-
function
|
|
1449
|
-
const t =
|
|
1529
|
+
function Mn(t) {
|
|
1530
|
+
const e = Tn(t), n = _n(t.path), r = Dn(t.query), o = pt({ meta: {}, ...e });
|
|
1450
1531
|
return {
|
|
1451
|
-
matched:
|
|
1452
|
-
matches: [
|
|
1453
|
-
key:
|
|
1454
|
-
path:
|
|
1455
|
-
query:
|
|
1532
|
+
matched: o,
|
|
1533
|
+
matches: [o],
|
|
1534
|
+
key: t.name,
|
|
1535
|
+
path: n,
|
|
1536
|
+
query: r,
|
|
1456
1537
|
depth: 1,
|
|
1457
|
-
disabled:
|
|
1538
|
+
disabled: t.disabled ?? !1
|
|
1458
1539
|
};
|
|
1459
1540
|
}
|
|
1541
|
+
function Tn(t) {
|
|
1542
|
+
return Ie(t) ? { ...t, component: Yt } : t;
|
|
1543
|
+
}
|
|
1460
1544
|
export {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1545
|
+
ut as DuplicateParamsError,
|
|
1546
|
+
Fe as RouterLink,
|
|
1547
|
+
mt as RouterNotInstalledError,
|
|
1548
|
+
Yt as RouterView,
|
|
1549
|
+
Be as UseRouteInvalidError,
|
|
1550
|
+
zn as component,
|
|
1551
|
+
Xn as createRouter,
|
|
1552
|
+
Zn as createRoutes,
|
|
1553
|
+
ft as isParamGetSet,
|
|
1554
|
+
tn as isParamGetter,
|
|
1555
|
+
nn as isParamWithDefault,
|
|
1556
|
+
zt as isParentRoute,
|
|
1557
|
+
Ie as isParentRouteWithoutComponent,
|
|
1558
|
+
Ve as isRoute,
|
|
1559
|
+
Je as isRouteWithComponent,
|
|
1560
|
+
Ke as isRouteWithComponents,
|
|
1561
|
+
Kn as onAfterRouteEnter,
|
|
1562
|
+
Qn as onAfterRouteLeave,
|
|
1563
|
+
Gn as onAfterRouteUpdate,
|
|
1564
|
+
In as onBeforeRouteLeave,
|
|
1565
|
+
Jn as onBeforeRouteUpdate,
|
|
1566
|
+
Y as paramEnd,
|
|
1567
|
+
Q as paramStart,
|
|
1568
|
+
Re as path,
|
|
1569
|
+
dt as query,
|
|
1570
|
+
Wt as routerInjectionKey,
|
|
1571
|
+
Ft as routerRejectionKey,
|
|
1572
|
+
He as useLink,
|
|
1573
|
+
Ne as useRejection,
|
|
1574
|
+
Oe as useRoute,
|
|
1575
|
+
Rt as useRouter,
|
|
1576
|
+
Yn as withDefault
|
|
1486
1577
|
};
|