@kitbag/router 0.14.2 → 0.15.1
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 +123 -37
- package/dist/kitbag-router.js +1134 -1091
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +9 -9
package/dist/kitbag-router.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
5
|
-
function
|
|
1
|
+
var ir = Object.defineProperty;
|
|
2
|
+
var fr = (e, t, r) => t in e ? ir(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var M = (e, t, r) => fr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { inject as ce, toRefs as lr, computed as N, reactive as Ce, defineComponent as ue, h as te, ref as De, markRaw as Pe, watch as le, onUnmounted as Ne, defineAsyncComponent as hr, toValue as j, openBlock as yt, createElementBlock as dr, normalizeClass as pr, renderSlot as gt, normalizeProps as wt, guardReactiveProps as mr, unref as fe, getCurrentInstance as Rr, resolveComponent as vr, provide as yr, mergeProps as gr, createBlock as wr, resolveDynamicComponent as Er, createCommentVNode as Pr } from "vue";
|
|
5
|
+
function T(e) {
|
|
6
6
|
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
7
7
|
}
|
|
8
8
|
function Et(e) {
|
|
9
|
-
return
|
|
9
|
+
return T(e) ? e : `/${e}`;
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class br extends Error {
|
|
12
12
|
/**
|
|
13
13
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
14
14
|
* @param paramName - The name of the parameter that was duplicated.
|
|
@@ -17,17 +17,17 @@ class kr extends Error {
|
|
|
17
17
|
super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
class
|
|
20
|
+
class Sr extends Error {
|
|
21
21
|
constructor(t) {
|
|
22
22
|
super(`Child property on meta for ${t} conflicts with the parent meta.`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
class
|
|
25
|
+
class Re extends Error {
|
|
26
26
|
constructor() {
|
|
27
27
|
super("Router not installed");
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class Ar extends Error {
|
|
31
31
|
/**
|
|
32
32
|
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
33
33
|
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
@@ -38,123 +38,120 @@ class xr extends Error {
|
|
|
38
38
|
super(`useRoute called with incorrect route. Given ${t}, expected ${r}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
const e =
|
|
41
|
+
const Pt = Symbol();
|
|
42
|
+
function Fe() {
|
|
43
|
+
const e = ce(Pt);
|
|
44
44
|
if (!e)
|
|
45
|
-
throw new
|
|
45
|
+
throw new Re();
|
|
46
46
|
return e;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ve(e) {
|
|
49
49
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return e.every((t) => Array.isArray(t));
|
|
53
|
-
}
|
|
54
|
-
function F(e) {
|
|
51
|
+
function J(e) {
|
|
55
52
|
return typeof e == "string" && e.length > 0;
|
|
56
53
|
}
|
|
57
|
-
function
|
|
54
|
+
function be(e) {
|
|
58
55
|
return {
|
|
59
|
-
value:
|
|
56
|
+
value: J(e) ? e.replace(/^#*/, "") : void 0
|
|
60
57
|
};
|
|
61
58
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
59
|
+
function kr(e, t) {
|
|
60
|
+
return be(`${e.value ?? ""}${t.value ?? ""}`);
|
|
64
61
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
62
|
+
function xr(e, t) {
|
|
63
|
+
return Lr(e, t), { ...e, ...t };
|
|
67
64
|
}
|
|
68
|
-
function
|
|
65
|
+
function Lr(e, t) {
|
|
69
66
|
const r = Object.keys(e).find((n) => n in t && typeof t[n] != typeof e[n]);
|
|
70
67
|
if (r)
|
|
71
|
-
throw new
|
|
68
|
+
throw new Sr(r);
|
|
72
69
|
}
|
|
73
|
-
function
|
|
70
|
+
function re(e) {
|
|
74
71
|
return Array.isArray(e) ? e : [e];
|
|
75
72
|
}
|
|
76
|
-
function
|
|
73
|
+
function bt(e, t) {
|
|
77
74
|
return e.filter((r) => t === r).length;
|
|
78
75
|
}
|
|
79
|
-
function
|
|
80
|
-
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(
|
|
76
|
+
function ie(...e) {
|
|
77
|
+
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(Ur));
|
|
81
78
|
for (const r of t)
|
|
82
|
-
if (
|
|
83
|
-
throw new
|
|
79
|
+
if (bt(t, r) > 1)
|
|
80
|
+
throw new br(r);
|
|
84
81
|
}
|
|
85
|
-
function
|
|
82
|
+
function Ur(e) {
|
|
86
83
|
return e.startsWith("?") ? e.slice(1) : e;
|
|
87
84
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
85
|
+
function Br(e, t) {
|
|
86
|
+
return ie(e.params, t.params), {
|
|
90
87
|
value: `${e.value}${t.value}`,
|
|
91
88
|
params: { ...e.params, ...t.params }
|
|
92
89
|
};
|
|
93
90
|
}
|
|
94
|
-
function
|
|
95
|
-
return
|
|
96
|
-
value: [e.value, t.value].filter(
|
|
91
|
+
function Cr(e, t) {
|
|
92
|
+
return ie(e.params, t.params), {
|
|
93
|
+
value: [e.value, t.value].filter(J).join("&"),
|
|
97
94
|
params: { ...e.params, ...t.params }
|
|
98
95
|
};
|
|
99
96
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
97
|
+
function Nr(e, t) {
|
|
98
|
+
return ie(e, t), { ...e, ...t };
|
|
102
99
|
}
|
|
103
|
-
function
|
|
100
|
+
function Vr(e) {
|
|
104
101
|
return "host" in e && !!e.host;
|
|
105
102
|
}
|
|
106
|
-
function
|
|
103
|
+
function St(e) {
|
|
107
104
|
return "parent" in e && !!e.parent;
|
|
108
105
|
}
|
|
109
106
|
function Me(e) {
|
|
110
107
|
return "component" in e && !!e.component;
|
|
111
108
|
}
|
|
112
|
-
function
|
|
109
|
+
function Te(e) {
|
|
113
110
|
return "components" in e && !!e.components;
|
|
114
111
|
}
|
|
115
|
-
function
|
|
112
|
+
function jr(e) {
|
|
116
113
|
return "state" in e && !!e.state;
|
|
117
114
|
}
|
|
118
115
|
function At(e, t) {
|
|
119
116
|
return {
|
|
120
117
|
...t,
|
|
121
|
-
path:
|
|
122
|
-
query:
|
|
123
|
-
meta:
|
|
124
|
-
state:
|
|
125
|
-
hash:
|
|
118
|
+
path: Br(e.path, t.path),
|
|
119
|
+
query: Cr(e.query, t.query),
|
|
120
|
+
meta: xr(e.meta, t.meta),
|
|
121
|
+
state: Nr(e.state, t.state),
|
|
122
|
+
hash: kr(e.hash, t.hash),
|
|
126
123
|
matches: [...e.matches, t.matched],
|
|
127
124
|
host: e.host,
|
|
128
125
|
depth: e.depth + 1
|
|
129
126
|
};
|
|
130
127
|
}
|
|
131
|
-
function
|
|
128
|
+
function We() {
|
|
132
129
|
return typeof window < "u" && typeof window.document < "u";
|
|
133
130
|
}
|
|
134
|
-
class
|
|
131
|
+
class he extends Error {
|
|
135
132
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
133
|
+
const G = "[", K = "]";
|
|
134
|
+
function Hr(e) {
|
|
138
135
|
return e !== String && e !== Boolean && e !== Number && e !== Date;
|
|
139
136
|
}
|
|
140
|
-
function
|
|
141
|
-
return typeof e == "function" &&
|
|
137
|
+
function $r(e) {
|
|
138
|
+
return typeof e == "function" && Hr(e);
|
|
142
139
|
}
|
|
143
|
-
function
|
|
140
|
+
function Ve(e) {
|
|
144
141
|
return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
|
|
145
142
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
143
|
+
function _r(e) {
|
|
144
|
+
return Ve(e) && e.defaultValue !== void 0;
|
|
148
145
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
146
|
+
function lo(e, t) {
|
|
147
|
+
return Ir(e, t);
|
|
151
148
|
}
|
|
152
|
-
function
|
|
149
|
+
function qr(e, t) {
|
|
153
150
|
return e[t] ?? String;
|
|
154
151
|
}
|
|
155
|
-
const
|
|
152
|
+
const _ = {
|
|
156
153
|
invalid: (e) => {
|
|
157
|
-
throw new
|
|
154
|
+
throw new he(e);
|
|
158
155
|
}
|
|
159
156
|
}, Or = {
|
|
160
157
|
get: (e) => e,
|
|
@@ -163,7 +160,7 @@ const q = {
|
|
|
163
160
|
throw t();
|
|
164
161
|
return e;
|
|
165
162
|
}
|
|
166
|
-
},
|
|
163
|
+
}, kt = {
|
|
167
164
|
get: (e, { invalid: t }) => {
|
|
168
165
|
if (e === "true")
|
|
169
166
|
return !0;
|
|
@@ -176,7 +173,7 @@ const q = {
|
|
|
176
173
|
throw t();
|
|
177
174
|
return e.toString();
|
|
178
175
|
}
|
|
179
|
-
},
|
|
176
|
+
}, xt = {
|
|
180
177
|
get: (e, { invalid: t }) => {
|
|
181
178
|
const r = Number(e);
|
|
182
179
|
if (isNaN(r))
|
|
@@ -200,7 +197,7 @@ const q = {
|
|
|
200
197
|
throw t();
|
|
201
198
|
return e.toISOString();
|
|
202
199
|
}
|
|
203
|
-
},
|
|
200
|
+
}, Ut = {
|
|
204
201
|
get: (e, { invalid: t }) => {
|
|
205
202
|
try {
|
|
206
203
|
return JSON.parse(e);
|
|
@@ -216,79 +213,78 @@ const q = {
|
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
215
|
};
|
|
219
|
-
function
|
|
220
|
-
if (e === void 0 || !
|
|
221
|
-
if (
|
|
216
|
+
function de(e, t, r = !1) {
|
|
217
|
+
if (e === void 0 || !J(e)) {
|
|
218
|
+
if (_r(t))
|
|
222
219
|
return t.defaultValue;
|
|
223
220
|
if (r)
|
|
224
221
|
return;
|
|
225
|
-
throw new
|
|
222
|
+
throw new he();
|
|
226
223
|
}
|
|
227
224
|
if (t === String)
|
|
228
|
-
return Or.get(e,
|
|
225
|
+
return Or.get(e, _);
|
|
229
226
|
if (t === Boolean)
|
|
230
|
-
return
|
|
227
|
+
return kt.get(e, _);
|
|
231
228
|
if (t === Number)
|
|
232
|
-
return
|
|
229
|
+
return xt.get(e, _);
|
|
233
230
|
if (t === Date)
|
|
234
|
-
return Lt.get(e,
|
|
231
|
+
return Lt.get(e, _);
|
|
235
232
|
if (t === JSON)
|
|
236
|
-
return
|
|
237
|
-
if (
|
|
238
|
-
return t(e,
|
|
239
|
-
if (
|
|
240
|
-
return t.get(e,
|
|
233
|
+
return Ut.get(e, _);
|
|
234
|
+
if ($r(t))
|
|
235
|
+
return t(e, _);
|
|
236
|
+
if (Ve(t))
|
|
237
|
+
return t.get(e, _);
|
|
241
238
|
if (t instanceof RegExp) {
|
|
242
239
|
if (t.test(e))
|
|
243
240
|
return e;
|
|
244
|
-
throw new
|
|
241
|
+
throw new he();
|
|
245
242
|
}
|
|
246
243
|
return e;
|
|
247
244
|
}
|
|
248
|
-
function
|
|
245
|
+
function pe(e, t, r = !1) {
|
|
249
246
|
if (e === void 0) {
|
|
250
247
|
if (r)
|
|
251
248
|
return "";
|
|
252
|
-
throw new
|
|
249
|
+
throw new he();
|
|
253
250
|
}
|
|
254
251
|
if (t === Boolean)
|
|
255
|
-
return
|
|
252
|
+
return kt.set(e, _);
|
|
256
253
|
if (t === Number)
|
|
257
|
-
return
|
|
254
|
+
return xt.set(e, _);
|
|
258
255
|
if (t === Date)
|
|
259
|
-
return Lt.set(e,
|
|
256
|
+
return Lt.set(e, _);
|
|
260
257
|
if (t === JSON)
|
|
261
|
-
return
|
|
262
|
-
if (
|
|
263
|
-
return t.set(e,
|
|
258
|
+
return Ut.set(e, _);
|
|
259
|
+
if (Ve(t))
|
|
260
|
+
return t.set(e, _);
|
|
264
261
|
try {
|
|
265
262
|
return e.toString();
|
|
266
263
|
} catch {
|
|
267
|
-
throw new
|
|
264
|
+
throw new he();
|
|
268
265
|
}
|
|
269
266
|
}
|
|
270
|
-
function
|
|
271
|
-
return
|
|
272
|
-
get: (r) =>
|
|
273
|
-
set: (r) =>
|
|
267
|
+
function Ir(e, t) {
|
|
268
|
+
return Ve(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
|
|
269
|
+
get: (r) => de(r, e),
|
|
270
|
+
set: (r) => pe(r, e),
|
|
274
271
|
defaultValue: t
|
|
275
272
|
};
|
|
276
273
|
}
|
|
277
|
-
function
|
|
278
|
-
return
|
|
274
|
+
function z() {
|
|
275
|
+
return z = Object.assign ? Object.assign.bind() : function(e) {
|
|
279
276
|
for (var t = 1; t < arguments.length; t++) {
|
|
280
277
|
var r = arguments[t];
|
|
281
|
-
for (var n in r)
|
|
282
|
-
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
278
|
+
for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
283
279
|
}
|
|
284
280
|
return e;
|
|
285
|
-
},
|
|
281
|
+
}, z.apply(null, arguments);
|
|
286
282
|
}
|
|
287
283
|
var V;
|
|
288
284
|
(function(e) {
|
|
289
285
|
e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
|
|
290
286
|
})(V || (V = {}));
|
|
291
|
-
var
|
|
287
|
+
var oe = process.env.NODE_ENV !== "production" ? function(e) {
|
|
292
288
|
return Object.freeze(e);
|
|
293
289
|
} : function(e) {
|
|
294
290
|
return e;
|
|
@@ -302,36 +298,36 @@ function Y(e, t) {
|
|
|
302
298
|
}
|
|
303
299
|
}
|
|
304
300
|
}
|
|
305
|
-
var
|
|
306
|
-
function
|
|
301
|
+
var Se = "beforeunload", Dr = "hashchange", Bt = "popstate";
|
|
302
|
+
function at(e) {
|
|
307
303
|
e === void 0 && (e = {});
|
|
308
304
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
309
305
|
function a() {
|
|
310
|
-
var
|
|
311
|
-
return [
|
|
306
|
+
var d = n.location, l = d.pathname, g = d.search, x = d.hash, L = o.state || {};
|
|
307
|
+
return [L.idx, oe({
|
|
312
308
|
pathname: l,
|
|
313
|
-
search:
|
|
314
|
-
hash:
|
|
315
|
-
state:
|
|
316
|
-
key:
|
|
309
|
+
search: g,
|
|
310
|
+
hash: x,
|
|
311
|
+
state: L.usr || null,
|
|
312
|
+
key: L.key || "default"
|
|
317
313
|
})];
|
|
318
314
|
}
|
|
319
315
|
var s = null;
|
|
320
|
-
function
|
|
316
|
+
function f() {
|
|
321
317
|
if (s)
|
|
322
|
-
|
|
318
|
+
P.call(s), s = null;
|
|
323
319
|
else {
|
|
324
|
-
var
|
|
325
|
-
if (
|
|
326
|
-
if (
|
|
327
|
-
var
|
|
328
|
-
|
|
329
|
-
action:
|
|
330
|
-
location:
|
|
320
|
+
var d = V.Pop, l = a(), g = l[0], x = l[1];
|
|
321
|
+
if (P.length)
|
|
322
|
+
if (g != null) {
|
|
323
|
+
var L = h - g;
|
|
324
|
+
L && (s = {
|
|
325
|
+
action: d,
|
|
326
|
+
location: x,
|
|
331
327
|
retry: function() {
|
|
332
|
-
|
|
328
|
+
S(L * -1);
|
|
333
329
|
}
|
|
334
|
-
},
|
|
330
|
+
}, S(L));
|
|
335
331
|
} else
|
|
336
332
|
process.env.NODE_ENV !== "production" && Y(
|
|
337
333
|
!1,
|
|
@@ -341,135 +337,135 @@ function st(e) {
|
|
|
341
337
|
"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."
|
|
342
338
|
);
|
|
343
339
|
else
|
|
344
|
-
|
|
340
|
+
A(d);
|
|
345
341
|
}
|
|
346
342
|
}
|
|
347
|
-
n.addEventListener(Bt,
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
idx:
|
|
343
|
+
n.addEventListener(Bt, f);
|
|
344
|
+
var c = V.Pop, u = a(), h = u[0], v = u[1], E = ae(), P = ae();
|
|
345
|
+
h == null && (h = 0, o.replaceState(z({}, o.state, {
|
|
346
|
+
idx: h
|
|
351
347
|
}), ""));
|
|
352
|
-
function
|
|
353
|
-
return typeof
|
|
348
|
+
function m(d) {
|
|
349
|
+
return typeof d == "string" ? d : X(d);
|
|
354
350
|
}
|
|
355
|
-
function
|
|
356
|
-
return l === void 0 && (l = null),
|
|
357
|
-
pathname:
|
|
351
|
+
function y(d, l) {
|
|
352
|
+
return l === void 0 && (l = null), oe(z({
|
|
353
|
+
pathname: v.pathname,
|
|
358
354
|
hash: "",
|
|
359
355
|
search: ""
|
|
360
|
-
}, typeof
|
|
356
|
+
}, typeof d == "string" ? me(d) : d, {
|
|
361
357
|
state: l,
|
|
362
|
-
key:
|
|
358
|
+
key: ke()
|
|
363
359
|
}));
|
|
364
360
|
}
|
|
365
|
-
function
|
|
361
|
+
function i(d, l) {
|
|
366
362
|
return [{
|
|
367
|
-
usr:
|
|
368
|
-
key:
|
|
363
|
+
usr: d.state,
|
|
364
|
+
key: d.key,
|
|
369
365
|
idx: l
|
|
370
|
-
},
|
|
366
|
+
}, m(d)];
|
|
371
367
|
}
|
|
372
|
-
function
|
|
373
|
-
return !
|
|
374
|
-
action:
|
|
368
|
+
function p(d, l, g) {
|
|
369
|
+
return !P.length || (P.call({
|
|
370
|
+
action: d,
|
|
375
371
|
location: l,
|
|
376
|
-
retry:
|
|
372
|
+
retry: g
|
|
377
373
|
}), !1);
|
|
378
374
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
375
|
+
function A(d) {
|
|
376
|
+
c = d;
|
|
381
377
|
var l = a();
|
|
382
|
-
|
|
383
|
-
action:
|
|
384
|
-
location:
|
|
378
|
+
h = l[0], v = l[1], E.call({
|
|
379
|
+
action: c,
|
|
380
|
+
location: v
|
|
385
381
|
});
|
|
386
382
|
}
|
|
387
|
-
function
|
|
388
|
-
var
|
|
389
|
-
function
|
|
390
|
-
|
|
383
|
+
function R(d, l) {
|
|
384
|
+
var g = V.Push, x = y(d, l);
|
|
385
|
+
function L() {
|
|
386
|
+
R(d, l);
|
|
391
387
|
}
|
|
392
|
-
if (
|
|
393
|
-
var
|
|
388
|
+
if (p(g, x, L)) {
|
|
389
|
+
var B = i(x, h + 1), C = B[0], H = B[1];
|
|
394
390
|
try {
|
|
395
|
-
o.pushState(
|
|
391
|
+
o.pushState(C, "", H);
|
|
396
392
|
} catch {
|
|
397
393
|
n.location.assign(H);
|
|
398
394
|
}
|
|
399
|
-
|
|
395
|
+
A(g);
|
|
400
396
|
}
|
|
401
397
|
}
|
|
402
|
-
function w(
|
|
403
|
-
var
|
|
404
|
-
function
|
|
405
|
-
w(
|
|
398
|
+
function w(d, l) {
|
|
399
|
+
var g = V.Replace, x = y(d, l);
|
|
400
|
+
function L() {
|
|
401
|
+
w(d, l);
|
|
406
402
|
}
|
|
407
|
-
if (
|
|
408
|
-
var
|
|
409
|
-
o.replaceState(
|
|
403
|
+
if (p(g, x, L)) {
|
|
404
|
+
var B = i(x, h), C = B[0], H = B[1];
|
|
405
|
+
o.replaceState(C, "", H), A(g);
|
|
410
406
|
}
|
|
411
407
|
}
|
|
412
|
-
function
|
|
413
|
-
o.go(
|
|
408
|
+
function S(d) {
|
|
409
|
+
o.go(d);
|
|
414
410
|
}
|
|
415
|
-
var
|
|
411
|
+
var k = {
|
|
416
412
|
get action() {
|
|
417
|
-
return
|
|
413
|
+
return c;
|
|
418
414
|
},
|
|
419
415
|
get location() {
|
|
420
|
-
return
|
|
416
|
+
return v;
|
|
421
417
|
},
|
|
422
|
-
createHref:
|
|
423
|
-
push:
|
|
418
|
+
createHref: m,
|
|
419
|
+
push: R,
|
|
424
420
|
replace: w,
|
|
425
|
-
go:
|
|
421
|
+
go: S,
|
|
426
422
|
back: function() {
|
|
427
|
-
|
|
423
|
+
S(-1);
|
|
428
424
|
},
|
|
429
425
|
forward: function() {
|
|
430
|
-
|
|
426
|
+
S(1);
|
|
431
427
|
},
|
|
432
428
|
listen: function(l) {
|
|
433
|
-
return
|
|
429
|
+
return E.push(l);
|
|
434
430
|
},
|
|
435
431
|
block: function(l) {
|
|
436
|
-
var
|
|
437
|
-
return
|
|
438
|
-
|
|
432
|
+
var g = P.push(l);
|
|
433
|
+
return P.length === 1 && n.addEventListener(Se, Ae), function() {
|
|
434
|
+
g(), P.length || n.removeEventListener(Se, Ae);
|
|
439
435
|
};
|
|
440
436
|
}
|
|
441
437
|
};
|
|
442
|
-
return
|
|
438
|
+
return k;
|
|
443
439
|
}
|
|
444
440
|
function Fr(e) {
|
|
445
441
|
e === void 0 && (e = {});
|
|
446
442
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
447
443
|
function a() {
|
|
448
|
-
var l =
|
|
449
|
-
return [
|
|
450
|
-
pathname:
|
|
451
|
-
search:
|
|
444
|
+
var l = me(n.location.hash.substr(1)), g = l.pathname, x = g === void 0 ? "/" : g, L = l.search, B = L === void 0 ? "" : L, C = l.hash, H = C === void 0 ? "" : C, O = o.state || {};
|
|
445
|
+
return [O.idx, oe({
|
|
446
|
+
pathname: x,
|
|
447
|
+
search: B,
|
|
452
448
|
hash: H,
|
|
453
|
-
state:
|
|
454
|
-
key:
|
|
449
|
+
state: O.usr || null,
|
|
450
|
+
key: O.key || "default"
|
|
455
451
|
})];
|
|
456
452
|
}
|
|
457
453
|
var s = null;
|
|
458
|
-
function
|
|
454
|
+
function f() {
|
|
459
455
|
if (s)
|
|
460
|
-
|
|
456
|
+
P.call(s), s = null;
|
|
461
457
|
else {
|
|
462
|
-
var l = V.Pop,
|
|
463
|
-
if (
|
|
464
|
-
if (
|
|
465
|
-
var
|
|
466
|
-
|
|
458
|
+
var l = V.Pop, g = a(), x = g[0], L = g[1];
|
|
459
|
+
if (P.length)
|
|
460
|
+
if (x != null) {
|
|
461
|
+
var B = h - x;
|
|
462
|
+
B && (s = {
|
|
467
463
|
action: l,
|
|
468
|
-
location:
|
|
464
|
+
location: L,
|
|
469
465
|
retry: function() {
|
|
470
|
-
|
|
466
|
+
k(B * -1);
|
|
471
467
|
}
|
|
472
|
-
},
|
|
468
|
+
}, k(B));
|
|
473
469
|
} else
|
|
474
470
|
process.env.NODE_ENV !== "production" && Y(
|
|
475
471
|
!1,
|
|
@@ -479,212 +475,212 @@ function Fr(e) {
|
|
|
479
475
|
"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."
|
|
480
476
|
);
|
|
481
477
|
else
|
|
482
|
-
|
|
478
|
+
R(l);
|
|
483
479
|
}
|
|
484
480
|
}
|
|
485
|
-
n.addEventListener(Bt,
|
|
486
|
-
var l = a(),
|
|
487
|
-
X(
|
|
481
|
+
n.addEventListener(Bt, f), n.addEventListener(Dr, function() {
|
|
482
|
+
var l = a(), g = l[1];
|
|
483
|
+
X(g) !== X(v) && f();
|
|
488
484
|
});
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
idx:
|
|
485
|
+
var c = V.Pop, u = a(), h = u[0], v = u[1], E = ae(), P = ae();
|
|
486
|
+
h == null && (h = 0, o.replaceState(z({}, o.state, {
|
|
487
|
+
idx: h
|
|
492
488
|
}), ""));
|
|
493
|
-
function
|
|
494
|
-
var l = document.querySelector("base"),
|
|
489
|
+
function m() {
|
|
490
|
+
var l = document.querySelector("base"), g = "";
|
|
495
491
|
if (l && l.getAttribute("href")) {
|
|
496
|
-
var
|
|
497
|
-
|
|
492
|
+
var x = n.location.href, L = x.indexOf("#");
|
|
493
|
+
g = L === -1 ? x : x.slice(0, L);
|
|
498
494
|
}
|
|
499
|
-
return
|
|
495
|
+
return g;
|
|
500
496
|
}
|
|
501
|
-
function
|
|
502
|
-
return
|
|
497
|
+
function y(l) {
|
|
498
|
+
return m() + "#" + (typeof l == "string" ? l : X(l));
|
|
503
499
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
506
|
-
pathname:
|
|
500
|
+
function i(l, g) {
|
|
501
|
+
return g === void 0 && (g = null), oe(z({
|
|
502
|
+
pathname: v.pathname,
|
|
507
503
|
hash: "",
|
|
508
504
|
search: ""
|
|
509
|
-
}, typeof l == "string" ?
|
|
510
|
-
state:
|
|
511
|
-
key:
|
|
505
|
+
}, typeof l == "string" ? me(l) : l, {
|
|
506
|
+
state: g,
|
|
507
|
+
key: ke()
|
|
512
508
|
}));
|
|
513
509
|
}
|
|
514
|
-
function
|
|
510
|
+
function p(l, g) {
|
|
515
511
|
return [{
|
|
516
512
|
usr: l.state,
|
|
517
513
|
key: l.key,
|
|
518
|
-
idx:
|
|
519
|
-
},
|
|
514
|
+
idx: g
|
|
515
|
+
}, y(l)];
|
|
520
516
|
}
|
|
521
|
-
function
|
|
522
|
-
return !
|
|
517
|
+
function A(l, g, x) {
|
|
518
|
+
return !P.length || (P.call({
|
|
523
519
|
action: l,
|
|
524
|
-
location:
|
|
525
|
-
retry:
|
|
520
|
+
location: g,
|
|
521
|
+
retry: x
|
|
526
522
|
}), !1);
|
|
527
523
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
action:
|
|
533
|
-
location:
|
|
524
|
+
function R(l) {
|
|
525
|
+
c = l;
|
|
526
|
+
var g = a();
|
|
527
|
+
h = g[0], v = g[1], E.call({
|
|
528
|
+
action: c,
|
|
529
|
+
location: v
|
|
534
530
|
});
|
|
535
531
|
}
|
|
536
|
-
function w(l,
|
|
537
|
-
var
|
|
538
|
-
function
|
|
539
|
-
w(l,
|
|
532
|
+
function w(l, g) {
|
|
533
|
+
var x = V.Push, L = i(l, g);
|
|
534
|
+
function B() {
|
|
535
|
+
w(l, g);
|
|
540
536
|
}
|
|
541
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
542
|
-
var
|
|
537
|
+
if (process.env.NODE_ENV !== "production" && Y(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), A(x, L, B)) {
|
|
538
|
+
var C = p(L, h + 1), H = C[0], O = C[1];
|
|
543
539
|
try {
|
|
544
|
-
o.pushState(H, "",
|
|
540
|
+
o.pushState(H, "", O);
|
|
545
541
|
} catch {
|
|
546
|
-
n.location.assign(
|
|
542
|
+
n.location.assign(O);
|
|
547
543
|
}
|
|
548
|
-
|
|
544
|
+
R(x);
|
|
549
545
|
}
|
|
550
546
|
}
|
|
551
|
-
function
|
|
552
|
-
var
|
|
553
|
-
function
|
|
554
|
-
|
|
547
|
+
function S(l, g) {
|
|
548
|
+
var x = V.Replace, L = i(l, g);
|
|
549
|
+
function B() {
|
|
550
|
+
S(l, g);
|
|
555
551
|
}
|
|
556
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
557
|
-
var
|
|
558
|
-
o.replaceState(H, "",
|
|
552
|
+
if (process.env.NODE_ENV !== "production" && Y(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), A(x, L, B)) {
|
|
553
|
+
var C = p(L, h), H = C[0], O = C[1];
|
|
554
|
+
o.replaceState(H, "", O), R(x);
|
|
559
555
|
}
|
|
560
556
|
}
|
|
561
|
-
function
|
|
557
|
+
function k(l) {
|
|
562
558
|
o.go(l);
|
|
563
559
|
}
|
|
564
|
-
var
|
|
560
|
+
var d = {
|
|
565
561
|
get action() {
|
|
566
|
-
return
|
|
562
|
+
return c;
|
|
567
563
|
},
|
|
568
564
|
get location() {
|
|
569
|
-
return
|
|
565
|
+
return v;
|
|
570
566
|
},
|
|
571
|
-
createHref:
|
|
567
|
+
createHref: y,
|
|
572
568
|
push: w,
|
|
573
|
-
replace:
|
|
574
|
-
go:
|
|
569
|
+
replace: S,
|
|
570
|
+
go: k,
|
|
575
571
|
back: function() {
|
|
576
|
-
|
|
572
|
+
k(-1);
|
|
577
573
|
},
|
|
578
574
|
forward: function() {
|
|
579
|
-
|
|
575
|
+
k(1);
|
|
580
576
|
},
|
|
581
|
-
listen: function(
|
|
582
|
-
return
|
|
577
|
+
listen: function(g) {
|
|
578
|
+
return E.push(g);
|
|
583
579
|
},
|
|
584
|
-
block: function(
|
|
585
|
-
var
|
|
586
|
-
return
|
|
587
|
-
|
|
580
|
+
block: function(g) {
|
|
581
|
+
var x = P.push(g);
|
|
582
|
+
return P.length === 1 && n.addEventListener(Se, Ae), function() {
|
|
583
|
+
x(), P.length || n.removeEventListener(Se, Ae);
|
|
588
584
|
};
|
|
589
585
|
}
|
|
590
586
|
};
|
|
591
|
-
return
|
|
587
|
+
return d;
|
|
592
588
|
}
|
|
593
|
-
function
|
|
589
|
+
function st(e) {
|
|
594
590
|
e === void 0 && (e = {});
|
|
595
|
-
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(
|
|
596
|
-
var w =
|
|
591
|
+
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(R) {
|
|
592
|
+
var w = oe(z({
|
|
597
593
|
pathname: "/",
|
|
598
594
|
search: "",
|
|
599
595
|
hash: "",
|
|
600
596
|
state: null,
|
|
601
|
-
key:
|
|
602
|
-
}, typeof
|
|
603
|
-
return process.env.NODE_ENV !== "production" && Y(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(
|
|
604
|
-
}), s =
|
|
605
|
-
function
|
|
606
|
-
return typeof
|
|
607
|
-
}
|
|
608
|
-
function
|
|
609
|
-
return w === void 0 && (w = null),
|
|
610
|
-
pathname:
|
|
597
|
+
key: ke()
|
|
598
|
+
}, typeof R == "string" ? me(R) : R));
|
|
599
|
+
return process.env.NODE_ENV !== "production" && Y(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(R) + ")"), w;
|
|
600
|
+
}), s = ct(o ?? a.length - 1, 0, a.length - 1), f = V.Pop, c = a[s], u = ae(), h = ae();
|
|
601
|
+
function v(R) {
|
|
602
|
+
return typeof R == "string" ? R : X(R);
|
|
603
|
+
}
|
|
604
|
+
function E(R, w) {
|
|
605
|
+
return w === void 0 && (w = null), oe(z({
|
|
606
|
+
pathname: c.pathname,
|
|
611
607
|
search: "",
|
|
612
608
|
hash: ""
|
|
613
|
-
}, typeof
|
|
609
|
+
}, typeof R == "string" ? me(R) : R, {
|
|
614
610
|
state: w,
|
|
615
|
-
key:
|
|
611
|
+
key: ke()
|
|
616
612
|
}));
|
|
617
613
|
}
|
|
618
|
-
function
|
|
619
|
-
return !
|
|
620
|
-
action:
|
|
614
|
+
function P(R, w, S) {
|
|
615
|
+
return !h.length || (h.call({
|
|
616
|
+
action: R,
|
|
621
617
|
location: w,
|
|
622
|
-
retry:
|
|
618
|
+
retry: S
|
|
623
619
|
}), !1);
|
|
624
620
|
}
|
|
625
|
-
function
|
|
626
|
-
|
|
627
|
-
action:
|
|
628
|
-
location:
|
|
621
|
+
function m(R, w) {
|
|
622
|
+
f = R, c = w, u.call({
|
|
623
|
+
action: f,
|
|
624
|
+
location: c
|
|
629
625
|
});
|
|
630
626
|
}
|
|
631
|
-
function
|
|
632
|
-
var
|
|
633
|
-
function
|
|
634
|
-
|
|
627
|
+
function y(R, w) {
|
|
628
|
+
var S = V.Push, k = E(R, w);
|
|
629
|
+
function d() {
|
|
630
|
+
y(R, w);
|
|
635
631
|
}
|
|
636
|
-
process.env.NODE_ENV !== "production" && Y(
|
|
632
|
+
process.env.NODE_ENV !== "production" && Y(c.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(R) + ")"), P(S, k, d) && (s += 1, a.splice(s, a.length, k), m(S, k));
|
|
637
633
|
}
|
|
638
|
-
function R
|
|
639
|
-
var
|
|
640
|
-
function
|
|
641
|
-
R
|
|
634
|
+
function i(R, w) {
|
|
635
|
+
var S = V.Replace, k = E(R, w);
|
|
636
|
+
function d() {
|
|
637
|
+
i(R, w);
|
|
642
638
|
}
|
|
643
|
-
process.env.NODE_ENV !== "production" && Y(
|
|
639
|
+
process.env.NODE_ENV !== "production" && Y(c.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(R) + ")"), P(S, k, d) && (a[s] = k, m(S, k));
|
|
644
640
|
}
|
|
645
|
-
function
|
|
646
|
-
var w =
|
|
647
|
-
function
|
|
648
|
-
|
|
641
|
+
function p(R) {
|
|
642
|
+
var w = ct(s + R, 0, a.length - 1), S = V.Pop, k = a[w];
|
|
643
|
+
function d() {
|
|
644
|
+
p(R);
|
|
649
645
|
}
|
|
650
|
-
|
|
646
|
+
P(S, k, d) && (s = w, m(S, k));
|
|
651
647
|
}
|
|
652
|
-
var
|
|
648
|
+
var A = {
|
|
653
649
|
get index() {
|
|
654
650
|
return s;
|
|
655
651
|
},
|
|
656
652
|
get action() {
|
|
657
|
-
return
|
|
653
|
+
return f;
|
|
658
654
|
},
|
|
659
655
|
get location() {
|
|
660
|
-
return
|
|
656
|
+
return c;
|
|
661
657
|
},
|
|
662
|
-
createHref:
|
|
663
|
-
push:
|
|
664
|
-
replace:
|
|
665
|
-
go:
|
|
658
|
+
createHref: v,
|
|
659
|
+
push: y,
|
|
660
|
+
replace: i,
|
|
661
|
+
go: p,
|
|
666
662
|
back: function() {
|
|
667
|
-
|
|
663
|
+
p(-1);
|
|
668
664
|
},
|
|
669
665
|
forward: function() {
|
|
670
|
-
|
|
666
|
+
p(1);
|
|
671
667
|
},
|
|
672
668
|
listen: function(w) {
|
|
673
669
|
return u.push(w);
|
|
674
670
|
},
|
|
675
671
|
block: function(w) {
|
|
676
|
-
return
|
|
672
|
+
return h.push(w);
|
|
677
673
|
}
|
|
678
674
|
};
|
|
679
|
-
return
|
|
675
|
+
return A;
|
|
680
676
|
}
|
|
681
|
-
function
|
|
677
|
+
function ct(e, t, r) {
|
|
682
678
|
return Math.min(Math.max(e, t), r);
|
|
683
679
|
}
|
|
684
|
-
function
|
|
680
|
+
function Ae(e) {
|
|
685
681
|
e.preventDefault(), e.returnValue = "";
|
|
686
682
|
}
|
|
687
|
-
function
|
|
683
|
+
function ae() {
|
|
688
684
|
var e = [];
|
|
689
685
|
return {
|
|
690
686
|
get length() {
|
|
@@ -704,14 +700,14 @@ function ne() {
|
|
|
704
700
|
}
|
|
705
701
|
};
|
|
706
702
|
}
|
|
707
|
-
function
|
|
703
|
+
function ke() {
|
|
708
704
|
return Math.random().toString(36).substr(2, 8);
|
|
709
705
|
}
|
|
710
706
|
function X(e) {
|
|
711
707
|
var t = e.pathname, r = t === void 0 ? "/" : t, n = e.search, o = n === void 0 ? "" : n, a = e.hash, s = a === void 0 ? "" : a;
|
|
712
708
|
return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
|
|
713
709
|
}
|
|
714
|
-
function
|
|
710
|
+
function me(e) {
|
|
715
711
|
var t = {};
|
|
716
712
|
if (e) {
|
|
717
713
|
var r = e.indexOf("#");
|
|
@@ -721,57 +717,57 @@ function he(e) {
|
|
|
721
717
|
}
|
|
722
718
|
return t;
|
|
723
719
|
}
|
|
724
|
-
const
|
|
725
|
-
function
|
|
726
|
-
const e =
|
|
720
|
+
const Ct = Symbol();
|
|
721
|
+
function Mr() {
|
|
722
|
+
const e = ce(Ct);
|
|
727
723
|
if (!e)
|
|
728
|
-
throw new
|
|
724
|
+
throw new Re();
|
|
729
725
|
return e;
|
|
730
726
|
}
|
|
731
|
-
const
|
|
732
|
-
function
|
|
733
|
-
return typeof e == "object" && e !== null &&
|
|
727
|
+
const Nt = Symbol("isRouterRouteSymbol");
|
|
728
|
+
function Tr(e) {
|
|
729
|
+
return typeof e == "object" && e !== null && Nt in e;
|
|
734
730
|
}
|
|
735
|
-
function
|
|
736
|
-
function r(
|
|
737
|
-
if (typeof
|
|
731
|
+
function Wr(e, t) {
|
|
732
|
+
function r(i, p, A) {
|
|
733
|
+
if (typeof i == "object") {
|
|
738
734
|
const w = {
|
|
739
735
|
...e.params,
|
|
740
|
-
...
|
|
736
|
+
...i
|
|
741
737
|
};
|
|
742
|
-
return t(e.name, w,
|
|
738
|
+
return t(e.name, w, p);
|
|
743
739
|
}
|
|
744
|
-
const
|
|
740
|
+
const R = {
|
|
745
741
|
...e.params,
|
|
746
|
-
[
|
|
742
|
+
[i]: p
|
|
747
743
|
};
|
|
748
|
-
return t(e.name,
|
|
749
|
-
}
|
|
750
|
-
const n = (...
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
}, o = (...
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
}, a = (...
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
}, { id: s, matched:
|
|
744
|
+
return t(e.name, R, A);
|
|
745
|
+
}
|
|
746
|
+
const n = (...i) => {
|
|
747
|
+
const p = new URLSearchParams(e.query);
|
|
748
|
+
p.set(...i), r({}, { query: p });
|
|
749
|
+
}, o = (...i) => {
|
|
750
|
+
const p = new URLSearchParams(e.query);
|
|
751
|
+
p.append(...i), r({}, { query: p });
|
|
752
|
+
}, a = (...i) => {
|
|
753
|
+
const p = new URLSearchParams(e.query);
|
|
754
|
+
p.delete(...i), r({}, { query: p });
|
|
755
|
+
}, { id: s, matched: f, matches: c, name: u, hash: h, href: v } = lr(e), E = N({
|
|
760
756
|
get() {
|
|
761
757
|
return new Proxy(e.params, {
|
|
762
|
-
set(
|
|
763
|
-
return r(
|
|
758
|
+
set(i, p, A) {
|
|
759
|
+
return r(p, A), !0;
|
|
764
760
|
}
|
|
765
761
|
});
|
|
766
762
|
},
|
|
767
|
-
set(
|
|
768
|
-
r(
|
|
763
|
+
set(i) {
|
|
764
|
+
r(i);
|
|
769
765
|
}
|
|
770
|
-
}),
|
|
766
|
+
}), P = N({
|
|
771
767
|
get() {
|
|
772
768
|
return new Proxy(e.query, {
|
|
773
|
-
get(
|
|
774
|
-
switch (
|
|
769
|
+
get(i, p, A) {
|
|
770
|
+
switch (p) {
|
|
775
771
|
case "append":
|
|
776
772
|
return o;
|
|
777
773
|
case "set":
|
|
@@ -779,58 +775,58 @@ function zr(e, t) {
|
|
|
779
775
|
case "delete":
|
|
780
776
|
return a;
|
|
781
777
|
default:
|
|
782
|
-
return Reflect.get(
|
|
778
|
+
return Reflect.get(i, p, A);
|
|
783
779
|
}
|
|
784
780
|
}
|
|
785
781
|
});
|
|
786
782
|
},
|
|
787
|
-
set(
|
|
788
|
-
r({}, { query:
|
|
783
|
+
set(i) {
|
|
784
|
+
r({}, { query: i });
|
|
789
785
|
}
|
|
790
|
-
}),
|
|
786
|
+
}), m = N({
|
|
791
787
|
get() {
|
|
792
788
|
return new Proxy(e.state, {
|
|
793
|
-
set(
|
|
794
|
-
return r({}, { state: { ...e.state, [
|
|
789
|
+
set(i, p, A) {
|
|
790
|
+
return r({}, { state: { ...e.state, [p]: A } }), !0;
|
|
795
791
|
}
|
|
796
792
|
});
|
|
797
793
|
},
|
|
798
|
-
set(
|
|
799
|
-
r({}, { state:
|
|
794
|
+
set(i) {
|
|
795
|
+
r({}, { state: i });
|
|
800
796
|
}
|
|
801
797
|
});
|
|
802
|
-
return
|
|
798
|
+
return Ce({
|
|
803
799
|
id: s,
|
|
804
|
-
matched:
|
|
805
|
-
matches:
|
|
806
|
-
state:
|
|
807
|
-
query:
|
|
808
|
-
hash:
|
|
809
|
-
params:
|
|
800
|
+
matched: f,
|
|
801
|
+
matches: c,
|
|
802
|
+
state: m,
|
|
803
|
+
query: P,
|
|
804
|
+
hash: h,
|
|
805
|
+
params: E,
|
|
810
806
|
name: u,
|
|
811
|
-
href:
|
|
807
|
+
href: v,
|
|
812
808
|
update: r,
|
|
813
|
-
[
|
|
809
|
+
[Nt]: !0
|
|
814
810
|
});
|
|
815
811
|
}
|
|
816
|
-
const
|
|
817
|
-
function
|
|
818
|
-
const r =
|
|
812
|
+
const Vt = Symbol();
|
|
813
|
+
function Jr(e, t) {
|
|
814
|
+
const r = Ce({ ...e }), n = (s) => {
|
|
819
815
|
Object.assign(r, {
|
|
820
|
-
[
|
|
816
|
+
[Vt]: !1,
|
|
821
817
|
...s
|
|
822
818
|
});
|
|
823
|
-
}, o = r, a =
|
|
819
|
+
}, o = r, a = Wr(o, t);
|
|
824
820
|
return {
|
|
825
821
|
currentRoute: o,
|
|
826
822
|
routerRoute: a,
|
|
827
823
|
updateRoute: n
|
|
828
824
|
};
|
|
829
825
|
}
|
|
830
|
-
function
|
|
831
|
-
return !e.startsWith("http") ?
|
|
826
|
+
function q(e) {
|
|
827
|
+
return !e.startsWith("http") ? Qr(e) : Gr(e);
|
|
832
828
|
}
|
|
833
|
-
function
|
|
829
|
+
function Gr(e) {
|
|
834
830
|
const { protocol: t, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(e, e);
|
|
835
831
|
return {
|
|
836
832
|
protocol: t,
|
|
@@ -841,7 +837,7 @@ function Kr(e) {
|
|
|
841
837
|
hash: s
|
|
842
838
|
};
|
|
843
839
|
}
|
|
844
|
-
function
|
|
840
|
+
function Qr(e) {
|
|
845
841
|
const { pathname: t, search: r, searchParams: n, hash: o } = new URL(e, "https://localhost");
|
|
846
842
|
return {
|
|
847
843
|
pathname: t,
|
|
@@ -850,22 +846,22 @@ function Yr(e) {
|
|
|
850
846
|
hash: o
|
|
851
847
|
};
|
|
852
848
|
}
|
|
853
|
-
function
|
|
849
|
+
function zr(e) {
|
|
854
850
|
return (t) => {
|
|
855
|
-
const { host: r } =
|
|
851
|
+
const { host: r } = q(t);
|
|
856
852
|
return !(r === void 0 || r === e);
|
|
857
853
|
};
|
|
858
854
|
}
|
|
859
|
-
function
|
|
860
|
-
const r =
|
|
855
|
+
function Kr({ mode: e, listener: t }) {
|
|
856
|
+
const r = Yr(e), n = (c, u) => {
|
|
861
857
|
if (u != null && u.replace) {
|
|
862
|
-
r.replace(
|
|
858
|
+
r.replace(c, u.state);
|
|
863
859
|
return;
|
|
864
860
|
}
|
|
865
|
-
r.push(
|
|
861
|
+
r.push(c, u == null ? void 0 : u.state);
|
|
866
862
|
}, o = () => {
|
|
867
|
-
const
|
|
868
|
-
r.replace(
|
|
863
|
+
const c = X(r.location);
|
|
864
|
+
r.replace(c);
|
|
869
865
|
};
|
|
870
866
|
let a;
|
|
871
867
|
return {
|
|
@@ -880,14 +876,14 @@ function Zr({ mode: e, listener: t }) {
|
|
|
880
876
|
}
|
|
881
877
|
};
|
|
882
878
|
}
|
|
883
|
-
function
|
|
879
|
+
function Yr(e = "auto") {
|
|
884
880
|
switch (e) {
|
|
885
881
|
case "auto":
|
|
886
|
-
return
|
|
882
|
+
return We() ? at() : st();
|
|
887
883
|
case "browser":
|
|
888
|
-
return
|
|
884
|
+
return at();
|
|
889
885
|
case "memory":
|
|
890
|
-
return
|
|
886
|
+
return st();
|
|
891
887
|
case "hash":
|
|
892
888
|
return Fr();
|
|
893
889
|
default:
|
|
@@ -895,202 +891,211 @@ function en(e = "auto") {
|
|
|
895
891
|
throw new Error(`Switch is not exhaustive for mode: ${t}`);
|
|
896
892
|
}
|
|
897
893
|
}
|
|
898
|
-
class Ee {
|
|
899
|
-
constructor() {
|
|
900
|
-
T(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
901
|
-
T(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
902
|
-
T(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
903
|
-
T(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
904
|
-
T(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
905
|
-
T(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
894
|
class jt extends Error {
|
|
909
895
|
constructor() {
|
|
910
896
|
super("Uncaught CallbackContextAbortError");
|
|
911
|
-
|
|
897
|
+
M(this, "response");
|
|
912
898
|
this.response = { status: "ABORT" };
|
|
913
899
|
}
|
|
914
900
|
}
|
|
915
|
-
class
|
|
901
|
+
class ne extends Error {
|
|
916
902
|
constructor(r) {
|
|
917
903
|
super("Uncaught CallbackContextPushError");
|
|
918
|
-
|
|
904
|
+
M(this, "response");
|
|
919
905
|
this.response = { status: "PUSH", to: r };
|
|
920
906
|
}
|
|
921
907
|
}
|
|
922
|
-
class
|
|
908
|
+
class xe extends Error {
|
|
923
909
|
constructor(r) {
|
|
924
910
|
super("Uncaught CallbackContextRejectionError");
|
|
925
|
-
|
|
911
|
+
M(this, "response");
|
|
926
912
|
this.response = { status: "REJECT", type: r };
|
|
927
913
|
}
|
|
928
914
|
}
|
|
929
|
-
function
|
|
930
|
-
const r = new Ee();
|
|
931
|
-
return e.matches.forEach((n, o) => {
|
|
932
|
-
n.onBeforeRouteEnter && Oe(e, t, o) && ee(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Ie(e, t, o) && ee(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
933
|
-
}), t.matches.forEach((n, o) => {
|
|
934
|
-
n.onBeforeRouteLeave && Te(e, t, o) && ee(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
935
|
-
}), r;
|
|
936
|
-
}
|
|
937
|
-
function rn(e, t) {
|
|
938
|
-
const r = new Ee();
|
|
939
|
-
return e.matches.forEach((n, o) => {
|
|
940
|
-
n.onAfterRouteEnter && Oe(e, t, o) && ee(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Ie(e, t, o) && ee(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
941
|
-
}), t.matches.forEach((n, o) => {
|
|
942
|
-
n.onAfterRouteLeave && Te(e, t, o) && ee(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
943
|
-
}), r;
|
|
944
|
-
}
|
|
945
|
-
function $t() {
|
|
915
|
+
function Ht() {
|
|
946
916
|
return { reject: (o) => {
|
|
947
|
-
throw new
|
|
917
|
+
throw new xe(o);
|
|
948
918
|
}, push: (...o) => {
|
|
949
|
-
throw new
|
|
919
|
+
throw new ne(o);
|
|
950
920
|
}, replace: (o, a, s) => {
|
|
951
|
-
if (
|
|
921
|
+
if (T(o)) {
|
|
952
922
|
const u = a ?? {};
|
|
953
|
-
throw new
|
|
923
|
+
throw new ne([o, { ...u, replace: !0 }]);
|
|
954
924
|
}
|
|
955
|
-
const
|
|
956
|
-
throw new
|
|
925
|
+
const f = a, c = s ?? {};
|
|
926
|
+
throw new ne([o, f, { ...c, replace: !0 }]);
|
|
957
927
|
}, abort: () => {
|
|
958
928
|
throw new jt();
|
|
959
929
|
} };
|
|
960
930
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
...f.onBeforeRouteUpdate,
|
|
970
|
-
...u.onBeforeRouteLeave,
|
|
971
|
-
...d.onBeforeRouteLeave,
|
|
972
|
-
...f.onBeforeRouteLeave
|
|
973
|
-
];
|
|
974
|
-
try {
|
|
975
|
-
const p = P.map((h) => h(s, {
|
|
976
|
-
from: c,
|
|
977
|
-
reject: e,
|
|
978
|
-
push: t,
|
|
979
|
-
replace: r,
|
|
980
|
-
abort: n
|
|
981
|
-
}));
|
|
982
|
-
await Promise.all(p);
|
|
983
|
-
} catch (p) {
|
|
984
|
-
if (p instanceof te || p instanceof be || p instanceof jt)
|
|
985
|
-
return p.response;
|
|
986
|
-
throw p;
|
|
987
|
-
}
|
|
988
|
-
return {
|
|
989
|
-
status: "SUCCESS"
|
|
990
|
-
};
|
|
991
|
-
}
|
|
992
|
-
async function a({ to: s, from: c, hooks: i }) {
|
|
993
|
-
const { global: u, component: f } = i, d = rn(s, c), P = [
|
|
994
|
-
...f.onAfterRouteLeave,
|
|
995
|
-
...d.onAfterRouteLeave,
|
|
996
|
-
...u.onAfterRouteLeave,
|
|
997
|
-
...f.onAfterRouteUpdate,
|
|
998
|
-
...d.onAfterRouteUpdate,
|
|
999
|
-
...u.onAfterRouteUpdate,
|
|
1000
|
-
...f.onAfterRouteEnter,
|
|
1001
|
-
...d.onAfterRouteEnter,
|
|
1002
|
-
...u.onAfterRouteEnter
|
|
1003
|
-
];
|
|
1004
|
-
try {
|
|
1005
|
-
const p = P.map((h) => h(s, {
|
|
1006
|
-
from: c,
|
|
1007
|
-
reject: e,
|
|
1008
|
-
push: t,
|
|
1009
|
-
replace: r
|
|
1010
|
-
}));
|
|
1011
|
-
await Promise.all(p);
|
|
1012
|
-
} catch (p) {
|
|
1013
|
-
if (p instanceof te || p instanceof be)
|
|
1014
|
-
return p.response;
|
|
1015
|
-
throw p;
|
|
1016
|
-
}
|
|
1017
|
-
return {
|
|
1018
|
-
status: "SUCCESS"
|
|
1019
|
-
};
|
|
931
|
+
class Z {
|
|
932
|
+
constructor() {
|
|
933
|
+
M(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
934
|
+
M(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
935
|
+
M(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
936
|
+
M(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
937
|
+
M(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
938
|
+
M(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
1020
939
|
}
|
|
1021
|
-
return {
|
|
1022
|
-
runBeforeRouteHooks: o,
|
|
1023
|
-
runAfterRouteHooks: a
|
|
1024
|
-
};
|
|
1025
940
|
}
|
|
1026
|
-
const
|
|
1027
|
-
var a;
|
|
941
|
+
const ye = (e, t, r) => {
|
|
942
|
+
var a, s;
|
|
1028
943
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1029
|
-
return n.length < r || n
|
|
1030
|
-
},
|
|
1031
|
-
var a;
|
|
944
|
+
return n.length < r || ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
945
|
+
}, ge = (e, t, r) => {
|
|
946
|
+
var a, s;
|
|
1032
947
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1033
|
-
return n.length < r || n
|
|
1034
|
-
},
|
|
1035
|
-
var n;
|
|
1036
|
-
return e.matches
|
|
948
|
+
return n.length < r || ((a = n.at(r)) == null ? void 0 : a.id) !== ((s = o.at(r)) == null ? void 0 : s.id);
|
|
949
|
+
}, we = (e, t, r) => {
|
|
950
|
+
var n, o;
|
|
951
|
+
return ((n = e.matches.at(r)) == null ? void 0 : n.id) === ((o = t == null ? void 0 : t.matches.at(r)) == null ? void 0 : o.id);
|
|
1037
952
|
};
|
|
1038
|
-
function
|
|
953
|
+
function ut(e) {
|
|
1039
954
|
switch (e) {
|
|
1040
955
|
case "onBeforeRouteEnter":
|
|
1041
956
|
case "onAfterRouteEnter":
|
|
1042
|
-
return
|
|
957
|
+
return ye;
|
|
1043
958
|
case "onBeforeRouteUpdate":
|
|
1044
959
|
case "onAfterRouteUpdate":
|
|
1045
|
-
return
|
|
960
|
+
return we;
|
|
1046
961
|
case "onBeforeRouteLeave":
|
|
1047
962
|
case "onAfterRouteLeave":
|
|
1048
|
-
return
|
|
963
|
+
return ge;
|
|
1049
964
|
default:
|
|
1050
965
|
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
1051
966
|
}
|
|
1052
967
|
}
|
|
1053
|
-
function
|
|
968
|
+
function Xr(e, t) {
|
|
969
|
+
const r = new Z();
|
|
970
|
+
return e.matches.forEach((n, o) => {
|
|
971
|
+
n.onBeforeRouteEnter && ye(e, t, o) && re(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && we(e, t, o) && re(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
972
|
+
}), t == null || t.matches.forEach((n, o) => {
|
|
973
|
+
n.onBeforeRouteLeave && ge(e, t, o) && re(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
974
|
+
}), r;
|
|
975
|
+
}
|
|
976
|
+
function Zr(e, t) {
|
|
977
|
+
const r = new Z();
|
|
978
|
+
return e.matches.forEach((n, o) => {
|
|
979
|
+
n.onAfterRouteEnter && ye(e, t, o) && re(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && we(e, t, o) && re(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
980
|
+
}), t == null || t.matches.forEach((n, o) => {
|
|
981
|
+
n.onAfterRouteLeave && ge(e, t, o) && re(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
982
|
+
}), r;
|
|
983
|
+
}
|
|
984
|
+
function en(e, t, r) {
|
|
985
|
+
const n = new Z();
|
|
986
|
+
return e.matches.forEach((o, a) => {
|
|
987
|
+
ye(e, t, a) && r.onBeforeRouteEnter.forEach((s) => n.onBeforeRouteEnter.add(s)), we(e, t, a) && r.onBeforeRouteUpdate.forEach((s) => n.onBeforeRouteUpdate.add(s));
|
|
988
|
+
}), t == null || t.matches.forEach((o, a) => {
|
|
989
|
+
ge(e, t, a) && r.onBeforeRouteLeave.forEach((s) => n.onBeforeRouteLeave.add(s));
|
|
990
|
+
}), n;
|
|
991
|
+
}
|
|
992
|
+
function tn(e, t, r) {
|
|
993
|
+
const n = new Z();
|
|
994
|
+
return e.matches.forEach((o, a) => {
|
|
995
|
+
ye(e, t, a) && r.onAfterRouteEnter.forEach((s) => n.onAfterRouteEnter.add(s)), we(e, t, a) && r.onAfterRouteUpdate.forEach((s) => n.onAfterRouteUpdate.add(s));
|
|
996
|
+
}), t == null || t.matches.forEach((o, a) => {
|
|
997
|
+
ge(e, t, a) && r.onAfterRouteLeave.forEach((s) => n.onAfterRouteLeave.add(s));
|
|
998
|
+
}), n;
|
|
999
|
+
}
|
|
1000
|
+
const $t = Symbol();
|
|
1001
|
+
function rn() {
|
|
1054
1002
|
const e = {
|
|
1055
|
-
global: new
|
|
1056
|
-
component: new
|
|
1057
|
-
};
|
|
1058
|
-
function
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
|
|
1003
|
+
global: new Z(),
|
|
1004
|
+
component: new Z()
|
|
1005
|
+
}, { reject: t, push: r, replace: n, abort: o } = Ht(), a = (i) => (e.global.onBeforeRouteEnter.add(i), () => e.global.onBeforeRouteEnter.delete(i)), s = (i) => (e.global.onBeforeRouteUpdate.add(i), () => e.global.onBeforeRouteUpdate.delete(i)), f = (i) => (e.global.onBeforeRouteLeave.add(i), () => e.global.onBeforeRouteLeave.delete(i)), c = (i) => (e.global.onAfterRouteEnter.add(i), () => e.global.onAfterRouteEnter.delete(i)), u = (i) => (e.global.onAfterRouteUpdate.add(i), () => e.global.onAfterRouteUpdate.delete(i)), h = (i) => (e.global.onAfterRouteLeave.add(i), () => e.global.onAfterRouteLeave.delete(i));
|
|
1006
|
+
async function v({ to: i, from: p }) {
|
|
1007
|
+
const { global: A, component: R } = e, w = Xr(i, p), S = en(i, p, A), k = [
|
|
1008
|
+
...S.onBeforeRouteEnter,
|
|
1009
|
+
...w.onBeforeRouteEnter,
|
|
1010
|
+
...S.onBeforeRouteUpdate,
|
|
1011
|
+
...w.onBeforeRouteUpdate,
|
|
1012
|
+
...R.onBeforeRouteUpdate,
|
|
1013
|
+
...S.onBeforeRouteLeave,
|
|
1014
|
+
...w.onBeforeRouteLeave,
|
|
1015
|
+
...R.onBeforeRouteLeave
|
|
1016
|
+
];
|
|
1017
|
+
try {
|
|
1018
|
+
const d = k.map((l) => l(i, {
|
|
1019
|
+
from: p,
|
|
1020
|
+
reject: t,
|
|
1021
|
+
push: r,
|
|
1022
|
+
replace: n,
|
|
1023
|
+
abort: o
|
|
1024
|
+
}));
|
|
1025
|
+
await Promise.all(d);
|
|
1026
|
+
} catch (d) {
|
|
1027
|
+
if (d instanceof ne || d instanceof xe || d instanceof jt)
|
|
1028
|
+
return d.response;
|
|
1029
|
+
throw d;
|
|
1030
|
+
}
|
|
1031
|
+
return {
|
|
1032
|
+
status: "SUCCESS"
|
|
1062
1033
|
};
|
|
1063
|
-
return i.add(u), () => i.delete(u);
|
|
1064
1034
|
}
|
|
1065
|
-
function
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1068
|
-
|
|
1035
|
+
async function E({ to: i, from: p }) {
|
|
1036
|
+
const { global: A, component: R } = e, w = Zr(i, p), S = tn(i, p, A), k = [
|
|
1037
|
+
...R.onAfterRouteLeave,
|
|
1038
|
+
...w.onAfterRouteLeave,
|
|
1039
|
+
...S.onAfterRouteLeave,
|
|
1040
|
+
...R.onAfterRouteUpdate,
|
|
1041
|
+
...w.onAfterRouteUpdate,
|
|
1042
|
+
...S.onAfterRouteUpdate,
|
|
1043
|
+
...R.onAfterRouteEnter,
|
|
1044
|
+
...w.onAfterRouteEnter,
|
|
1045
|
+
...S.onAfterRouteEnter
|
|
1046
|
+
];
|
|
1047
|
+
try {
|
|
1048
|
+
const d = k.map((l) => l(i, {
|
|
1049
|
+
from: p,
|
|
1050
|
+
reject: t,
|
|
1051
|
+
push: r,
|
|
1052
|
+
replace: n
|
|
1053
|
+
}));
|
|
1054
|
+
await Promise.all(d);
|
|
1055
|
+
} catch (d) {
|
|
1056
|
+
if (d instanceof ne || d instanceof xe)
|
|
1057
|
+
return d.response;
|
|
1058
|
+
throw d;
|
|
1059
|
+
}
|
|
1060
|
+
return {
|
|
1061
|
+
status: "SUCCESS"
|
|
1069
1062
|
};
|
|
1070
|
-
return i.add(u), () => i.delete(u);
|
|
1071
1063
|
}
|
|
1072
|
-
return { ...e, addBeforeRouteHook: t, addAfterRouteHook: r };
|
|
1073
|
-
}
|
|
1074
|
-
const qt = Symbol();
|
|
1075
|
-
function an() {
|
|
1076
|
-
const e = on();
|
|
1077
1064
|
return {
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1065
|
+
runBeforeRouteHooks: v,
|
|
1066
|
+
runAfterRouteHooks: E,
|
|
1067
|
+
addComponentBeforeRouteHook: ({ lifecycle: i, depth: p, hook: A }) => {
|
|
1068
|
+
const R = ut(i), w = e.component[i], S = (k, d) => {
|
|
1069
|
+
if (R(k, d.from, p))
|
|
1070
|
+
return A(k, d);
|
|
1071
|
+
};
|
|
1072
|
+
return w.add(S), () => w.delete(S);
|
|
1073
|
+
},
|
|
1074
|
+
addComponentAfterRouteHook: ({ lifecycle: i, depth: p, hook: A }) => {
|
|
1075
|
+
const R = ut(i), w = e.component[i], S = (k, d) => {
|
|
1076
|
+
if (R(k, d.from, p))
|
|
1077
|
+
return A(k, d);
|
|
1078
|
+
};
|
|
1079
|
+
return w.add(S), () => w.delete(S);
|
|
1080
|
+
},
|
|
1081
|
+
addGlobalRouteHooks: (i) => {
|
|
1082
|
+
i.onBeforeRouteEnter.forEach((p) => a(p)), i.onBeforeRouteUpdate.forEach((p) => s(p)), i.onBeforeRouteLeave.forEach((p) => f(p)), i.onAfterRouteEnter.forEach((p) => c(p)), i.onAfterRouteUpdate.forEach((p) => u(p)), i.onAfterRouteLeave.forEach((p) => h(p));
|
|
1083
|
+
},
|
|
1084
|
+
onBeforeRouteEnter: a,
|
|
1085
|
+
onBeforeRouteUpdate: s,
|
|
1086
|
+
onBeforeRouteLeave: f,
|
|
1087
|
+
onAfterRouteEnter: c,
|
|
1088
|
+
onAfterRouteUpdate: u,
|
|
1089
|
+
onAfterRouteLeave: h
|
|
1085
1090
|
};
|
|
1086
1091
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1092
|
+
function nn(e) {
|
|
1093
|
+
return ue(() => () => te("h1", e), {
|
|
1089
1094
|
name: e,
|
|
1090
1095
|
props: []
|
|
1091
1096
|
});
|
|
1092
1097
|
}
|
|
1093
|
-
function
|
|
1098
|
+
function Je(e) {
|
|
1094
1099
|
const t = new URLSearchParams(e);
|
|
1095
1100
|
return {
|
|
1096
1101
|
get: (...r) => t.get(...r),
|
|
@@ -1119,37 +1124,34 @@ function Fe(e) {
|
|
|
1119
1124
|
[Symbol.iterator]: () => t[Symbol.iterator]()
|
|
1120
1125
|
};
|
|
1121
1126
|
}
|
|
1122
|
-
function
|
|
1127
|
+
function Ge() {
|
|
1123
1128
|
let e = 0;
|
|
1124
1129
|
return () => (++e).toString();
|
|
1125
1130
|
}
|
|
1126
|
-
const
|
|
1127
|
-
function
|
|
1128
|
-
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
}, r = (a) => {
|
|
1136
|
-
const s = ye(t(a)), c = {
|
|
1137
|
-
id: Je(),
|
|
1131
|
+
const on = Ge()();
|
|
1132
|
+
function an(e) {
|
|
1133
|
+
return e === on;
|
|
1134
|
+
}
|
|
1135
|
+
const Qe = Ge();
|
|
1136
|
+
function sn(e) {
|
|
1137
|
+
const t = (a) => Pe(e[a] ?? nn(a)), r = (a) => {
|
|
1138
|
+
const s = Pe(t(a)), f = {
|
|
1139
|
+
id: Qe(),
|
|
1138
1140
|
component: s,
|
|
1139
1141
|
meta: {},
|
|
1140
1142
|
state: {}
|
|
1141
1143
|
};
|
|
1142
1144
|
return {
|
|
1143
|
-
id:
|
|
1144
|
-
matched:
|
|
1145
|
-
matches: [
|
|
1145
|
+
id: f.id,
|
|
1146
|
+
matched: f,
|
|
1147
|
+
matches: [f],
|
|
1146
1148
|
name: a,
|
|
1147
|
-
query:
|
|
1149
|
+
query: Je(""),
|
|
1148
1150
|
params: {},
|
|
1149
1151
|
state: {},
|
|
1150
1152
|
href: "/",
|
|
1151
1153
|
hash: "",
|
|
1152
|
-
[
|
|
1154
|
+
[Vt]: !0
|
|
1153
1155
|
};
|
|
1154
1156
|
}, n = (a) => {
|
|
1155
1157
|
if (!a) {
|
|
@@ -1158,164 +1160,71 @@ function cn({
|
|
|
1158
1160
|
}
|
|
1159
1161
|
const s = t(a);
|
|
1160
1162
|
o.value = { type: a, component: s };
|
|
1161
|
-
}, o =
|
|
1163
|
+
}, o = De(null);
|
|
1162
1164
|
return {
|
|
1163
1165
|
setRejection: n,
|
|
1164
1166
|
rejection: o,
|
|
1165
1167
|
getRejectionRoute: r
|
|
1166
1168
|
};
|
|
1167
1169
|
}
|
|
1168
|
-
class
|
|
1170
|
+
class cn extends Error {
|
|
1169
1171
|
constructor() {
|
|
1170
1172
|
super("initialUrl must be set if window.location is unavailable");
|
|
1171
1173
|
}
|
|
1172
1174
|
}
|
|
1173
|
-
function
|
|
1175
|
+
function un(e) {
|
|
1174
1176
|
if (e)
|
|
1175
1177
|
return e;
|
|
1176
|
-
if (
|
|
1178
|
+
if (We())
|
|
1177
1179
|
return window.location.toString();
|
|
1178
|
-
throw new
|
|
1179
|
-
}
|
|
1180
|
-
function Qe(e) {
|
|
1181
|
-
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1182
|
-
}
|
|
1183
|
-
function ln(e, t) {
|
|
1184
|
-
const r = Array.from(e.matchAll(t));
|
|
1185
|
-
if (r.length === 0)
|
|
1186
|
-
return [e];
|
|
1187
|
-
let n = 0;
|
|
1188
|
-
const o = r.reduce((s, c) => {
|
|
1189
|
-
const i = Qe(e.slice(n, c.index));
|
|
1190
|
-
i.length && s.push(i);
|
|
1191
|
-
const [u] = c;
|
|
1192
|
-
return s.push(u), n = c.index + u.length, s;
|
|
1193
|
-
}, []), a = e.slice(n);
|
|
1194
|
-
return a && o.push(a), o;
|
|
1195
|
-
}
|
|
1196
|
-
function hn(e) {
|
|
1197
|
-
const t = Mt(e.path.value);
|
|
1198
|
-
return new RegExp(`^${t}$`, "i");
|
|
1199
|
-
}
|
|
1200
|
-
function pn(e) {
|
|
1201
|
-
const t = new URLSearchParams(e.query.value);
|
|
1202
|
-
return Array.from(t.entries()).filter(([, r]) => !He(r)).map(([r, n]) => {
|
|
1203
|
-
const o = Mt(n);
|
|
1204
|
-
return new RegExp(`${Qe(r)}=${o}(&|$)`, "i");
|
|
1205
|
-
});
|
|
1206
|
-
}
|
|
1207
|
-
function Mt(e) {
|
|
1208
|
-
return ln(e, new RegExp(dn, "g")).map((t) => t.startsWith(J) ? Wt(t) : Qe(t)).join("");
|
|
1209
|
-
}
|
|
1210
|
-
function Wt(e) {
|
|
1211
|
-
return [
|
|
1212
|
-
mn,
|
|
1213
|
-
yn
|
|
1214
|
-
].reduce((t, r) => r(t), e);
|
|
1215
|
-
}
|
|
1216
|
-
const dn = `\\${J}\\??([\\w-_]+)\\${K}`, ze = `\\${J}\\?([\\w-_]+)\\${K}`, Dt = `\\${J}([\\w-_]+)\\${K}`;
|
|
1217
|
-
function mn(e) {
|
|
1218
|
-
return e.replace(new RegExp(ze, "g"), ".*");
|
|
1219
|
-
}
|
|
1220
|
-
function He(e) {
|
|
1221
|
-
return new RegExp(ze, "g").test(e);
|
|
1222
|
-
}
|
|
1223
|
-
function yn(e) {
|
|
1224
|
-
return e.replace(new RegExp(Dt, "g"), ".+");
|
|
1180
|
+
throw new cn();
|
|
1225
1181
|
}
|
|
1226
|
-
function
|
|
1227
|
-
const [t] = Se(e, new RegExp(ze, "g")), [r] = Se(e, new RegExp(Dt, "g"));
|
|
1228
|
-
return t ?? r;
|
|
1229
|
-
}
|
|
1230
|
-
function Se(e, t) {
|
|
1231
|
-
return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) => F(o) ? o : ""));
|
|
1232
|
-
}
|
|
1233
|
-
function Ge(e, t) {
|
|
1234
|
-
const r = new RegExp(`\\${J}(\\??[\\w-_]+)\\${K}`, "g");
|
|
1235
|
-
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
1236
|
-
const c = Le(a);
|
|
1237
|
-
if (!c)
|
|
1238
|
-
return o;
|
|
1239
|
-
const i = Dr(t, c);
|
|
1240
|
-
return ce([c], o), o[s] = i, o;
|
|
1241
|
-
}, {});
|
|
1242
|
-
}
|
|
1243
|
-
function je(e, t) {
|
|
1244
|
-
return {
|
|
1245
|
-
value: e,
|
|
1246
|
-
params: Ge(e, t)
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
function gn(e, t) {
|
|
1250
|
-
return F(t) ? e.map((r) => {
|
|
1251
|
-
const n = `${t}${r.path.value}`;
|
|
1252
|
-
return {
|
|
1253
|
-
...r,
|
|
1254
|
-
path: je(n, r.path.params)
|
|
1255
|
-
};
|
|
1256
|
-
}) : e;
|
|
1257
|
-
}
|
|
1258
|
-
function Ot(e) {
|
|
1182
|
+
function _t(e) {
|
|
1259
1183
|
return !!e && typeof e == "object";
|
|
1260
1184
|
}
|
|
1261
|
-
const
|
|
1262
|
-
function
|
|
1263
|
-
if (
|
|
1185
|
+
const Le = !0;
|
|
1186
|
+
function fn(e, t, r) {
|
|
1187
|
+
if (_t(e) && t in e) {
|
|
1264
1188
|
const n = e[t];
|
|
1265
|
-
return typeof n == "string" ?
|
|
1189
|
+
return typeof n == "string" ? de(n, r, Le) : n;
|
|
1266
1190
|
}
|
|
1267
|
-
return
|
|
1191
|
+
return de(void 0, r, Le);
|
|
1268
1192
|
}
|
|
1269
|
-
function
|
|
1193
|
+
function qt(e, t) {
|
|
1270
1194
|
const r = {};
|
|
1271
1195
|
for (const [n, o] of Object.entries(e)) {
|
|
1272
|
-
const a =
|
|
1196
|
+
const a = fn(t, n, o);
|
|
1273
1197
|
r[n] = a;
|
|
1274
1198
|
}
|
|
1275
1199
|
return r;
|
|
1276
1200
|
}
|
|
1277
|
-
function
|
|
1278
|
-
if (
|
|
1201
|
+
function ln(e, t, r) {
|
|
1202
|
+
if (_t(e) && t in e) {
|
|
1279
1203
|
const n = e[t];
|
|
1280
|
-
return
|
|
1204
|
+
return pe(n, r, Le);
|
|
1281
1205
|
}
|
|
1282
|
-
return
|
|
1206
|
+
return pe(void 0, r, Le);
|
|
1283
1207
|
}
|
|
1284
|
-
const
|
|
1208
|
+
const it = (e, t) => {
|
|
1285
1209
|
const r = {};
|
|
1286
1210
|
for (const [n, o] of Object.entries(e)) {
|
|
1287
|
-
const a =
|
|
1211
|
+
const a = ln(t, n, o);
|
|
1288
1212
|
r[n] = a;
|
|
1289
1213
|
}
|
|
1290
1214
|
return r;
|
|
1291
1215
|
};
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
constructor(t) {
|
|
1298
|
-
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
function Pn(e) {
|
|
1302
|
-
const t = e.map(({ name: r }) => r);
|
|
1303
|
-
for (const r of t)
|
|
1304
|
-
if (St(t, r) > 1)
|
|
1305
|
-
throw new wn(r);
|
|
1306
|
-
}
|
|
1307
|
-
function En() {
|
|
1308
|
-
const e = xe(/* @__PURE__ */ new Map()), t = De() ? s() : null, r = (c) => {
|
|
1309
|
-
e.set(c, !1), t == null || t.observe(c);
|
|
1310
|
-
}, n = (c) => {
|
|
1311
|
-
e.delete(c), t == null || t.unobserve(c);
|
|
1216
|
+
function hn() {
|
|
1217
|
+
const e = Ce(/* @__PURE__ */ new Map()), t = We() ? s() : null, r = (f) => {
|
|
1218
|
+
e.set(f, !1), t == null || t.observe(f);
|
|
1219
|
+
}, n = (f) => {
|
|
1220
|
+
e.delete(f), t == null || t.unobserve(f);
|
|
1312
1221
|
}, o = () => {
|
|
1313
1222
|
t == null || t.disconnect();
|
|
1314
|
-
}, a = (
|
|
1223
|
+
}, a = (f) => e.get(f) ?? !1;
|
|
1315
1224
|
function s() {
|
|
1316
|
-
return new IntersectionObserver((
|
|
1317
|
-
|
|
1318
|
-
e.set(
|
|
1225
|
+
return new IntersectionObserver((f) => {
|
|
1226
|
+
f.forEach((c) => {
|
|
1227
|
+
e.set(c.target, c.isIntersecting);
|
|
1319
1228
|
});
|
|
1320
1229
|
});
|
|
1321
1230
|
}
|
|
@@ -1326,59 +1235,114 @@ function En() {
|
|
|
1326
1235
|
isElementVisible: a
|
|
1327
1236
|
};
|
|
1328
1237
|
}
|
|
1329
|
-
const
|
|
1330
|
-
function
|
|
1331
|
-
const t =
|
|
1238
|
+
const Ot = Symbol("visibilityObserver");
|
|
1239
|
+
function dn(e) {
|
|
1240
|
+
const t = ce(Ot);
|
|
1332
1241
|
if (!t)
|
|
1333
|
-
throw new
|
|
1334
|
-
return
|
|
1242
|
+
throw new Re();
|
|
1243
|
+
return le(e, (n, o) => {
|
|
1335
1244
|
n && t.observe(n), o && t.unobserve(o);
|
|
1336
|
-
}, { immediate: !0 }), {
|
|
1245
|
+
}, { immediate: !0 }), Ne(() => {
|
|
1246
|
+
e.value && t.unobserve(e.value);
|
|
1247
|
+
}), {
|
|
1337
1248
|
isElementVisible: N(() => e.value ? t.isElementVisible(e.value) : !1)
|
|
1338
1249
|
};
|
|
1339
1250
|
}
|
|
1340
|
-
class
|
|
1251
|
+
class pn extends Error {
|
|
1341
1252
|
constructor(t) {
|
|
1342
1253
|
super(`Route not found: "${t}"`);
|
|
1343
1254
|
}
|
|
1344
1255
|
}
|
|
1345
|
-
function
|
|
1346
|
-
|
|
1256
|
+
function ze(e) {
|
|
1257
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1258
|
+
}
|
|
1259
|
+
function mn(e, t) {
|
|
1260
|
+
const r = Array.from(e.matchAll(t));
|
|
1261
|
+
if (r.length === 0)
|
|
1262
|
+
return [e];
|
|
1263
|
+
let n = 0;
|
|
1264
|
+
const o = r.reduce((s, f) => {
|
|
1265
|
+
const c = ze(e.slice(n, f.index));
|
|
1266
|
+
c.length && s.push(c);
|
|
1267
|
+
const [u] = f;
|
|
1268
|
+
return s.push(u), n = f.index + u.length, s;
|
|
1269
|
+
}, []), a = e.slice(n);
|
|
1270
|
+
return a && o.push(a), o;
|
|
1271
|
+
}
|
|
1272
|
+
function Rn(e) {
|
|
1273
|
+
const t = It(e.path.value);
|
|
1274
|
+
return new RegExp(`^${t}$`, "i");
|
|
1275
|
+
}
|
|
1276
|
+
function vn(e) {
|
|
1277
|
+
const t = new URLSearchParams(e.query.value);
|
|
1278
|
+
return Array.from(t.entries()).filter(([, r]) => !Mt(r)).map(([r, n]) => {
|
|
1279
|
+
const o = It(n);
|
|
1280
|
+
return new RegExp(`${ze(r)}=${o}(&|$)`, "i");
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
function It(e) {
|
|
1284
|
+
return mn(e, new RegExp(yn, "g")).map((t) => t.startsWith(G) ? Dt(t) : ze(t)).join("");
|
|
1285
|
+
}
|
|
1286
|
+
function Dt(e) {
|
|
1287
|
+
return [
|
|
1288
|
+
gn,
|
|
1289
|
+
wn
|
|
1290
|
+
].reduce((t, r) => r(t), e);
|
|
1291
|
+
}
|
|
1292
|
+
const yn = `\\${G}\\??([\\w-_]+)\\${K}`, Ke = `\\${G}\\?([\\w-_]+)\\${K}`, Ft = `\\${G}([\\w-_]+)\\${K}`;
|
|
1293
|
+
function gn(e) {
|
|
1294
|
+
return e.replace(new RegExp(Ke, "g"), ".*");
|
|
1295
|
+
}
|
|
1296
|
+
function Mt(e) {
|
|
1297
|
+
return new RegExp(Ke, "g").test(e);
|
|
1298
|
+
}
|
|
1299
|
+
function wn(e) {
|
|
1300
|
+
return e.replace(new RegExp(Ft, "g"), ".+");
|
|
1301
|
+
}
|
|
1302
|
+
function je(e) {
|
|
1303
|
+
const [t] = Ue(e, new RegExp(Ke, "g")), [r] = Ue(e, new RegExp(Ft, "g"));
|
|
1304
|
+
return t ?? r;
|
|
1305
|
+
}
|
|
1306
|
+
function Ue(e, t) {
|
|
1307
|
+
return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) => J(o) ? o : ""));
|
|
1308
|
+
}
|
|
1309
|
+
function Tt(e, t, r) {
|
|
1310
|
+
const n = Jt(t, r), [o] = Ue(e, n);
|
|
1347
1311
|
return o;
|
|
1348
1312
|
}
|
|
1349
|
-
function
|
|
1313
|
+
function Wt(e, t) {
|
|
1350
1314
|
if (!t)
|
|
1351
1315
|
return e;
|
|
1352
|
-
const { name: r, param: n, value: o } = t, a =
|
|
1353
|
-
return
|
|
1316
|
+
const { name: r, param: n, value: o } = t, a = Jt(e, r);
|
|
1317
|
+
return Ue(e, a).reduce((f, c) => c === void 0 ? f : f.replace(c, () => pe(o, n, r.startsWith("?"))), e);
|
|
1354
1318
|
}
|
|
1355
|
-
function
|
|
1319
|
+
function Jt(e, t) {
|
|
1356
1320
|
const r = [
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1321
|
+
En,
|
|
1322
|
+
Pn,
|
|
1323
|
+
Dt
|
|
1360
1324
|
].reduce((n, o) => o(n, t), e);
|
|
1361
1325
|
return new RegExp(r, "g");
|
|
1362
1326
|
}
|
|
1363
|
-
function
|
|
1327
|
+
function En(e, t) {
|
|
1364
1328
|
if (!t.startsWith("?"))
|
|
1365
1329
|
return e;
|
|
1366
|
-
const r = new RegExp(`\\${
|
|
1330
|
+
const r = new RegExp(`\\${G}\\${t}\\${K}`, "g");
|
|
1367
1331
|
return e.replace(r, "(.*)");
|
|
1368
1332
|
}
|
|
1369
|
-
function
|
|
1333
|
+
function Pn(e, t) {
|
|
1370
1334
|
if (t.startsWith("?"))
|
|
1371
1335
|
return e;
|
|
1372
|
-
const r = new RegExp(`\\${
|
|
1336
|
+
const r = new RegExp(`\\${G}${t}\\${K}`, "g");
|
|
1373
1337
|
return e.replace(r, "(.+)");
|
|
1374
1338
|
}
|
|
1375
|
-
function
|
|
1339
|
+
function Gt({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
1376
1340
|
const s = new URL("https://localhost");
|
|
1377
1341
|
e && (s.protocol = e), t && (s.host = t), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
|
|
1378
|
-
const
|
|
1379
|
-
return Et(
|
|
1342
|
+
const f = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
1343
|
+
return Et(f);
|
|
1380
1344
|
}
|
|
1381
|
-
function
|
|
1345
|
+
function Ye(...e) {
|
|
1382
1346
|
const t = new URLSearchParams();
|
|
1383
1347
|
for (const r of e) {
|
|
1384
1348
|
const n = new URLSearchParams(r);
|
|
@@ -1387,564 +1351,642 @@ function Ke(...e) {
|
|
|
1387
1351
|
}
|
|
1388
1352
|
return t;
|
|
1389
1353
|
}
|
|
1390
|
-
function
|
|
1391
|
-
const { params: r = {}, query: n } = t, o =
|
|
1392
|
-
return
|
|
1354
|
+
function bn(e, t = {}) {
|
|
1355
|
+
const { params: r = {}, query: n } = t, o = kn(e.query, r), a = Ye(o, n), s = An(e.path, r), f = be(e.hash.value ?? t.hash).value, c = Sn(e.host, r), { protocol: u, host: h } = q(c);
|
|
1356
|
+
return Gt({ protocol: u, host: h, pathname: s, searchParams: a, hash: f });
|
|
1393
1357
|
}
|
|
1394
|
-
function
|
|
1358
|
+
function Sn(e, t) {
|
|
1395
1359
|
const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
1396
1360
|
return Object.entries(e.params).reduce((n, [o, a]) => {
|
|
1397
|
-
const s =
|
|
1398
|
-
return s ?
|
|
1361
|
+
const s = je(`${G}${o}${K}`);
|
|
1362
|
+
return s ? Wt(n, { name: o, param: a, value: t[s] }) : n;
|
|
1399
1363
|
}, r);
|
|
1400
1364
|
}
|
|
1401
|
-
function
|
|
1365
|
+
function An(e, t) {
|
|
1402
1366
|
return Object.entries(e.params).reduce((r, [n, o]) => {
|
|
1403
|
-
const a =
|
|
1404
|
-
return a ?
|
|
1367
|
+
const a = je(`${G}${n}${K}`);
|
|
1368
|
+
return a ? Wt(r, { name: n, param: o, value: t[a] }) : r;
|
|
1405
1369
|
}, e.value);
|
|
1406
1370
|
}
|
|
1407
|
-
function
|
|
1371
|
+
function kn(e, t) {
|
|
1408
1372
|
const r = new URLSearchParams(e.value);
|
|
1409
1373
|
if (!e.value)
|
|
1410
1374
|
return r;
|
|
1411
1375
|
for (const [n, o] of Array.from(r.entries())) {
|
|
1412
|
-
const a =
|
|
1376
|
+
const a = je(o);
|
|
1413
1377
|
if (!a)
|
|
1414
1378
|
continue;
|
|
1415
|
-
const c =
|
|
1416
|
-
|
|
1379
|
+
const f = Mt(o), c = f ? `?${a}` : a, u = pe(t[a], e.params[c], f), h = t[a] === void 0 && u === "";
|
|
1380
|
+
f && h ? r.delete(n, o) : r.set(n, u);
|
|
1417
1381
|
}
|
|
1418
1382
|
return r;
|
|
1419
1383
|
}
|
|
1420
|
-
const
|
|
1384
|
+
const xn = (e, t) => {
|
|
1421
1385
|
try {
|
|
1422
|
-
|
|
1386
|
+
Xe(e, t);
|
|
1423
1387
|
} catch {
|
|
1424
1388
|
return !1;
|
|
1425
1389
|
}
|
|
1426
1390
|
return !0;
|
|
1427
|
-
},
|
|
1428
|
-
const { pathname: r, search: n } =
|
|
1391
|
+
}, Xe = (e, t) => {
|
|
1392
|
+
const { pathname: r, search: n } = q(t);
|
|
1429
1393
|
return {
|
|
1430
|
-
...
|
|
1431
|
-
...
|
|
1394
|
+
...Ln(e.path, r),
|
|
1395
|
+
...Un(e.query, n)
|
|
1432
1396
|
};
|
|
1433
1397
|
};
|
|
1434
|
-
function
|
|
1398
|
+
function Ln(e, t) {
|
|
1435
1399
|
const r = {}, n = decodeURIComponent(t);
|
|
1436
1400
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1437
|
-
const s = o.startsWith("?"),
|
|
1438
|
-
r[
|
|
1401
|
+
const s = o.startsWith("?"), f = s ? o.slice(1) : o, c = Tt(n, e.value, o), u = de(c, a, s);
|
|
1402
|
+
r[f] = u;
|
|
1439
1403
|
}
|
|
1440
1404
|
return r;
|
|
1441
1405
|
}
|
|
1442
|
-
function
|
|
1406
|
+
function Un(e, t) {
|
|
1443
1407
|
const r = {}, n = new URLSearchParams(t);
|
|
1444
1408
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1445
|
-
const s = o.startsWith("?"),
|
|
1446
|
-
r[
|
|
1409
|
+
const s = o.startsWith("?"), f = s ? o.slice(1) : o, c = n.get(f) ?? void 0, u = de(c, a, s);
|
|
1410
|
+
r[f] = u;
|
|
1447
1411
|
}
|
|
1448
1412
|
return r;
|
|
1449
1413
|
}
|
|
1450
|
-
function
|
|
1451
|
-
const n =
|
|
1414
|
+
function Bn(e, t = {}, r = {}) {
|
|
1415
|
+
const n = bn(e, {
|
|
1452
1416
|
params: t,
|
|
1453
1417
|
query: r.query,
|
|
1454
1418
|
hash: r.hash
|
|
1455
|
-
}), { search: o, hash: a } =
|
|
1419
|
+
}), { search: o, hash: a } = q(n);
|
|
1456
1420
|
return {
|
|
1457
1421
|
id: e.id,
|
|
1458
1422
|
matched: e.matched,
|
|
1459
1423
|
matches: e.matches,
|
|
1460
1424
|
name: e.name,
|
|
1461
|
-
query:
|
|
1462
|
-
params:
|
|
1463
|
-
state:
|
|
1425
|
+
query: Je(o),
|
|
1426
|
+
params: Xe(e, n),
|
|
1427
|
+
state: qt(e.state, r.state),
|
|
1464
1428
|
hash: a,
|
|
1465
1429
|
href: n
|
|
1466
1430
|
};
|
|
1467
1431
|
}
|
|
1468
|
-
const
|
|
1469
|
-
const { pathname: r } =
|
|
1470
|
-
return
|
|
1471
|
-
},
|
|
1472
|
-
const { search: r } =
|
|
1473
|
-
return
|
|
1474
|
-
},
|
|
1475
|
-
const { hash: r } =
|
|
1432
|
+
const Cn = (e) => "name" in e.matched && !!e.matched.name, Nn = (e, t) => {
|
|
1433
|
+
const { pathname: r } = q(t);
|
|
1434
|
+
return Rn(e).test(r);
|
|
1435
|
+
}, Vn = (e, t) => {
|
|
1436
|
+
const { search: r } = q(t);
|
|
1437
|
+
return vn(e).every((o) => o.test(r));
|
|
1438
|
+
}, Oe = (e, t) => {
|
|
1439
|
+
const { hash: r } = q(t), { value: n } = e.hash;
|
|
1476
1440
|
return n === void 0 || `#${n.toLowerCase()}` === r.toLowerCase();
|
|
1477
1441
|
};
|
|
1478
|
-
function
|
|
1479
|
-
const { searchParams: t, pathname: r } =
|
|
1442
|
+
function jn(e) {
|
|
1443
|
+
const { searchParams: t, pathname: r } = q(e), n = -1, o = 1;
|
|
1480
1444
|
return (a, s) => {
|
|
1481
|
-
const
|
|
1482
|
-
return a.depth > s.depth ? n : a.depth < s.depth ? o :
|
|
1445
|
+
const f = lt(a, t), c = ft(a, r), u = lt(s, t), h = ft(s, r);
|
|
1446
|
+
return a.depth > s.depth ? n : a.depth < s.depth ? o : f + c > u + h ? n : f + c < u + h ? o : Oe(a, e) ? n : Oe(s, e) ? o : 0;
|
|
1483
1447
|
};
|
|
1484
1448
|
}
|
|
1485
|
-
function
|
|
1486
|
-
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) =>
|
|
1449
|
+
function ft(e, t) {
|
|
1450
|
+
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) => Tt(t, e.path.value, o) === void 0);
|
|
1487
1451
|
return r.length - n.length;
|
|
1488
1452
|
}
|
|
1489
|
-
function
|
|
1453
|
+
function lt(e, t) {
|
|
1490
1454
|
const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
1491
1455
|
return o.length - a.length;
|
|
1492
1456
|
}
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1457
|
+
const Hn = [
|
|
1458
|
+
Cn,
|
|
1459
|
+
Nn,
|
|
1460
|
+
Vn,
|
|
1461
|
+
Oe,
|
|
1462
|
+
xn
|
|
1499
1463
|
];
|
|
1500
|
-
function
|
|
1501
|
-
const r =
|
|
1502
|
-
return e.filter((n) =>
|
|
1464
|
+
function $n(e, t) {
|
|
1465
|
+
const r = jn(t);
|
|
1466
|
+
return e.filter((n) => Hn.every((o) => o(n, t))).sort(r);
|
|
1503
1467
|
}
|
|
1504
|
-
function
|
|
1505
|
-
const n =
|
|
1468
|
+
function _n(e, t, r) {
|
|
1469
|
+
const n = $n(e, t);
|
|
1506
1470
|
if (!n.length)
|
|
1507
1471
|
return;
|
|
1508
|
-
const [o] = n, { searchParams: a, hash: s } =
|
|
1472
|
+
const [o] = n, { searchParams: a, hash: s } = q(t);
|
|
1509
1473
|
return {
|
|
1510
1474
|
id: o.id,
|
|
1511
1475
|
matched: o.matched,
|
|
1512
1476
|
matches: o.matches,
|
|
1513
1477
|
name: o.name,
|
|
1514
|
-
query:
|
|
1515
|
-
params:
|
|
1516
|
-
state:
|
|
1478
|
+
query: Je(a),
|
|
1479
|
+
params: Xe(o, t),
|
|
1480
|
+
state: qt(o.state, r),
|
|
1517
1481
|
hash: s,
|
|
1518
1482
|
href: Et(t)
|
|
1519
1483
|
};
|
|
1520
1484
|
}
|
|
1521
|
-
function
|
|
1522
|
-
const r = typeof e == "string" ?
|
|
1523
|
-
return
|
|
1524
|
-
protocol:
|
|
1525
|
-
host:
|
|
1526
|
-
pathname:
|
|
1527
|
-
searchParams:
|
|
1528
|
-
hash:
|
|
1485
|
+
function ht(e, t) {
|
|
1486
|
+
const r = typeof e == "string" ? q(e) : e, n = typeof t == "string" ? q(t) : t, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
|
|
1487
|
+
return Gt({
|
|
1488
|
+
protocol: J(n.protocol) ? n.protocol : r.protocol,
|
|
1489
|
+
host: J(n.host) ? n.host : r.host,
|
|
1490
|
+
pathname: J(n.pathname) ? n.pathname : r.pathname,
|
|
1491
|
+
searchParams: Ye(a, o),
|
|
1492
|
+
hash: J(n.hash) ? n.hash : r.hash
|
|
1529
1493
|
});
|
|
1530
1494
|
}
|
|
1531
|
-
function
|
|
1532
|
-
const r =
|
|
1533
|
-
|
|
1534
|
-
|
|
1495
|
+
function Ze(e, t) {
|
|
1496
|
+
const r = new RegExp(`\\${G}(\\??[\\w-_]+)\\${K}`, "g");
|
|
1497
|
+
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
1498
|
+
const f = je(a);
|
|
1499
|
+
if (!f)
|
|
1500
|
+
return o;
|
|
1501
|
+
const c = qr(t, f);
|
|
1502
|
+
return ie([f], o), o[s] = c, o;
|
|
1503
|
+
}, {});
|
|
1504
|
+
}
|
|
1505
|
+
function Ie(e, t) {
|
|
1506
|
+
return {
|
|
1507
|
+
value: e,
|
|
1508
|
+
params: Ze(e, t)
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
function qn(e, t) {
|
|
1512
|
+
return J(t) ? e.map((r) => {
|
|
1513
|
+
const n = `${t}${r.path.value}`;
|
|
1514
|
+
return {
|
|
1515
|
+
...r,
|
|
1516
|
+
path: Ie(n, r.path.params)
|
|
1517
|
+
};
|
|
1518
|
+
}) : e;
|
|
1519
|
+
}
|
|
1520
|
+
class On extends Error {
|
|
1521
|
+
/**
|
|
1522
|
+
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1523
|
+
* @param name - The name of the name that was duplicated.
|
|
1524
|
+
*/
|
|
1525
|
+
constructor(t) {
|
|
1526
|
+
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
function In(e) {
|
|
1530
|
+
const t = e.map(({ name: r }) => r);
|
|
1531
|
+
for (const r of t)
|
|
1532
|
+
if (bt(t, r) > 1)
|
|
1533
|
+
throw new On(r);
|
|
1534
|
+
}
|
|
1535
|
+
function Dn(e, t = [], r) {
|
|
1536
|
+
const n = [
|
|
1537
|
+
...e,
|
|
1538
|
+
...t.map((o) => o.routes)
|
|
1539
|
+
].flat();
|
|
1540
|
+
return In(n), qn(n, r);
|
|
1541
|
+
}
|
|
1542
|
+
function Fn(e = {}, t = []) {
|
|
1543
|
+
const r = new Z();
|
|
1544
|
+
return ee("onBeforeRouteEnter", e, t).forEach((n) => r.onBeforeRouteEnter.add(n)), ee("onBeforeRouteUpdate", e, t).forEach((n) => r.onBeforeRouteUpdate.add(n)), ee("onBeforeRouteLeave", e, t).forEach((n) => r.onBeforeRouteLeave.add(n)), ee("onAfterRouteEnter", e, t).forEach((n) => r.onAfterRouteEnter.add(n)), ee("onAfterRouteUpdate", e, t).forEach((n) => r.onAfterRouteUpdate.add(n)), ee("onAfterRouteLeave", e, t).forEach((n) => r.onAfterRouteLeave.add(n)), r;
|
|
1545
|
+
}
|
|
1546
|
+
function ee(e, t, r) {
|
|
1547
|
+
return [
|
|
1548
|
+
t[e],
|
|
1549
|
+
...r.map((o) => o[e])
|
|
1550
|
+
].flat().filter((o) => o !== void 0);
|
|
1551
|
+
}
|
|
1552
|
+
function ho(e, t, r = []) {
|
|
1553
|
+
const n = Dn(e, r, t == null ? void 0 : t.base), o = rn();
|
|
1554
|
+
o.addGlobalRouteHooks(Fn(t, r));
|
|
1555
|
+
const a = Ge(), s = Kn(), f = hn(), c = Kr({
|
|
1535
1556
|
mode: t == null ? void 0 : t.historyMode,
|
|
1536
1557
|
listener: ({ location: b }) => {
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1558
|
+
const U = X(b);
|
|
1559
|
+
h(U, { state: b.state, replace: !0 });
|
|
1539
1560
|
}
|
|
1540
|
-
})
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
} = an();
|
|
1549
|
-
function E(b, L = {}) {
|
|
1550
|
-
return Dn(n, b, L.state);
|
|
1551
|
-
}
|
|
1552
|
-
async function k(b, L = {}) {
|
|
1553
|
-
const Q = o();
|
|
1554
|
-
if (c.stopListening(), rt(b)) {
|
|
1555
|
-
c.update(b, L);
|
|
1561
|
+
});
|
|
1562
|
+
function u(b, U = {}) {
|
|
1563
|
+
return _n(n, b, U.state);
|
|
1564
|
+
}
|
|
1565
|
+
async function h(b, U = {}) {
|
|
1566
|
+
const W = a();
|
|
1567
|
+
if (c.stopListening(), g(b)) {
|
|
1568
|
+
c.update(b, U);
|
|
1556
1569
|
return;
|
|
1557
1570
|
}
|
|
1558
|
-
const
|
|
1559
|
-
switch (
|
|
1571
|
+
const I = u(b, U) ?? p("NotFound"), $ = O(W), Q = await o.runBeforeRouteHooks({ to: I, from: $ });
|
|
1572
|
+
switch (Q.status) {
|
|
1560
1573
|
// On abort do nothing
|
|
1561
1574
|
case "ABORT":
|
|
1562
1575
|
return;
|
|
1563
1576
|
// On push update the history, and push new route, and return
|
|
1564
1577
|
case "PUSH":
|
|
1565
|
-
c.update(b,
|
|
1578
|
+
c.update(b, U), await E(...Q.to);
|
|
1566
1579
|
return;
|
|
1567
1580
|
// On reject update the history, the route, and set the rejection type
|
|
1568
1581
|
case "REJECT":
|
|
1569
|
-
c.update(b,
|
|
1582
|
+
c.update(b, U), y(Q.type);
|
|
1570
1583
|
break;
|
|
1571
1584
|
// On success update history, set the route, and clear the rejection
|
|
1572
1585
|
case "SUCCESS":
|
|
1573
|
-
c.update(b,
|
|
1586
|
+
c.update(b, U), y(null);
|
|
1574
1587
|
break;
|
|
1575
1588
|
default:
|
|
1576
|
-
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(
|
|
1589
|
+
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(Q)}`);
|
|
1577
1590
|
}
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
if (
|
|
1591
|
+
const He = W;
|
|
1592
|
+
s.setProps(I).then((D) => {
|
|
1593
|
+
if (He === W)
|
|
1581
1594
|
switch (D.status) {
|
|
1582
1595
|
case "SUCCESS":
|
|
1583
1596
|
break;
|
|
1584
1597
|
case "PUSH":
|
|
1585
|
-
|
|
1598
|
+
E(...D.to);
|
|
1586
1599
|
break;
|
|
1587
1600
|
case "REJECT":
|
|
1588
|
-
|
|
1601
|
+
y(D.type);
|
|
1589
1602
|
break;
|
|
1590
1603
|
default:
|
|
1591
|
-
const
|
|
1592
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
1604
|
+
const $e = D;
|
|
1605
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify($e)}`);
|
|
1593
1606
|
}
|
|
1594
|
-
}),
|
|
1595
|
-
const
|
|
1596
|
-
switch (
|
|
1607
|
+
}), S(I);
|
|
1608
|
+
const F = await o.runAfterRouteHooks({ to: I, from: $ });
|
|
1609
|
+
switch (F.status) {
|
|
1597
1610
|
case "PUSH":
|
|
1598
|
-
await
|
|
1611
|
+
await E(...F.to);
|
|
1599
1612
|
break;
|
|
1600
1613
|
case "REJECT":
|
|
1601
|
-
|
|
1614
|
+
y(F.type);
|
|
1602
1615
|
break;
|
|
1603
1616
|
case "SUCCESS":
|
|
1604
1617
|
break;
|
|
1605
1618
|
default:
|
|
1606
|
-
const D =
|
|
1619
|
+
const D = F;
|
|
1607
1620
|
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(D)}`);
|
|
1608
1621
|
}
|
|
1609
1622
|
c.startListening();
|
|
1610
1623
|
}
|
|
1611
|
-
const
|
|
1612
|
-
const
|
|
1613
|
-
if (!
|
|
1614
|
-
throw new
|
|
1615
|
-
return
|
|
1616
|
-
},
|
|
1617
|
-
if (
|
|
1618
|
-
const
|
|
1619
|
-
searchParams:
|
|
1620
|
-
hash:
|
|
1624
|
+
const v = (b, U = {}, W = {}) => {
|
|
1625
|
+
const I = n.find(($) => $.name === b);
|
|
1626
|
+
if (!I)
|
|
1627
|
+
throw new pn(String(b));
|
|
1628
|
+
return Bn(I, U, W);
|
|
1629
|
+
}, E = (b, U, W) => {
|
|
1630
|
+
if (T(b)) {
|
|
1631
|
+
const F = { ...U }, D = ht(b, {
|
|
1632
|
+
searchParams: F.query,
|
|
1633
|
+
hash: F.hash
|
|
1621
1634
|
});
|
|
1622
|
-
return
|
|
1635
|
+
return h(D, F);
|
|
1623
1636
|
}
|
|
1624
1637
|
if (typeof b == "string") {
|
|
1625
|
-
const { replace:
|
|
1626
|
-
return
|
|
1638
|
+
const { replace: F, ...D } = { ...W }, $e = { ...U }, _e = v(b, $e, D), ur = it({ ..._e.matched.state }, { ..._e.state, ...D.state });
|
|
1639
|
+
return h(_e.href, { replace: F, state: ur });
|
|
1627
1640
|
}
|
|
1628
|
-
const { replace:
|
|
1629
|
-
searchParams:
|
|
1630
|
-
hash:
|
|
1641
|
+
const { replace: I, ...$ } = { ...U }, Q = it({ ...b.matched.state }, { ...b.state, ...$.state }), He = ht(b.href, {
|
|
1642
|
+
searchParams: $.query,
|
|
1643
|
+
hash: $.hash
|
|
1631
1644
|
});
|
|
1632
|
-
return
|
|
1633
|
-
},
|
|
1634
|
-
if (
|
|
1635
|
-
const
|
|
1636
|
-
return
|
|
1645
|
+
return h(He, { replace: I, state: Q });
|
|
1646
|
+
}, P = (b, U, W) => {
|
|
1647
|
+
if (T(b)) {
|
|
1648
|
+
const $ = { ...U, replace: !0 };
|
|
1649
|
+
return E(b, $);
|
|
1637
1650
|
}
|
|
1638
1651
|
if (typeof b == "string") {
|
|
1639
|
-
const
|
|
1640
|
-
return
|
|
1652
|
+
const $ = { ...W, replace: !0 }, Q = { ...U };
|
|
1653
|
+
return E(b, Q, $);
|
|
1641
1654
|
}
|
|
1642
|
-
const
|
|
1643
|
-
return
|
|
1644
|
-
},
|
|
1645
|
-
|
|
1646
|
-
}, { setRejection:
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1655
|
+
const I = { ...U, replace: !0 };
|
|
1656
|
+
return E(b, I);
|
|
1657
|
+
}, m = (b) => {
|
|
1658
|
+
y(b);
|
|
1659
|
+
}, { setRejection: y, rejection: i, getRejectionRoute: p } = sn({
|
|
1660
|
+
...r.reduce((b, U) => ({ ...b, ...U.rejections }), {}),
|
|
1661
|
+
...t == null ? void 0 : t.rejections
|
|
1662
|
+
}), A = p("NotFound"), { currentRoute: R, routerRoute: w, updateRoute: S } = Jr(A, E), k = un(t == null ? void 0 : t.initialUrl), d = c.location.state, { host: l } = q(k), g = zr(l);
|
|
1663
|
+
let x = !1;
|
|
1664
|
+
const { promise: L, resolve: B } = Promise.withResolvers();
|
|
1665
|
+
async function C() {
|
|
1666
|
+
if (x)
|
|
1667
|
+
return L;
|
|
1668
|
+
x = !0, await h(k, { replace: !0, state: d }), c.startListening(), B();
|
|
1669
|
+
}
|
|
1670
|
+
function H() {
|
|
1671
|
+
c.stopListening();
|
|
1672
|
+
}
|
|
1673
|
+
function O(b) {
|
|
1674
|
+
return an(b) ? null : { ...R };
|
|
1675
|
+
}
|
|
1676
|
+
function nt(b) {
|
|
1677
|
+
b.component("RouterView", co), b.component("RouterLink", ro), b.provide(Ct, i), b.provide($t, o), b.provide(rr, s), b.provide(Ot, f), b.provide(Pt, ot), C();
|
|
1678
|
+
}
|
|
1679
|
+
const ot = {
|
|
1680
|
+
route: w,
|
|
1681
|
+
resolve: v,
|
|
1682
|
+
find: u,
|
|
1683
|
+
push: E,
|
|
1684
|
+
replace: P,
|
|
1685
|
+
reject: m,
|
|
1663
1686
|
refresh: c.refresh,
|
|
1664
1687
|
forward: c.forward,
|
|
1665
1688
|
back: c.back,
|
|
1666
1689
|
go: c.go,
|
|
1667
|
-
install:
|
|
1668
|
-
isExternal:
|
|
1669
|
-
onBeforeRouteEnter:
|
|
1670
|
-
|
|
1671
|
-
onBeforeRouteLeave:
|
|
1672
|
-
onAfterRouteEnter:
|
|
1673
|
-
|
|
1674
|
-
onAfterRouteLeave:
|
|
1690
|
+
install: nt,
|
|
1691
|
+
isExternal: g,
|
|
1692
|
+
onBeforeRouteEnter: o.onBeforeRouteEnter,
|
|
1693
|
+
onBeforeRouteUpdate: o.onBeforeRouteUpdate,
|
|
1694
|
+
onBeforeRouteLeave: o.onBeforeRouteLeave,
|
|
1695
|
+
onAfterRouteEnter: o.onAfterRouteEnter,
|
|
1696
|
+
onAfterRouteUpdate: o.onAfterRouteUpdate,
|
|
1697
|
+
onAfterRouteLeave: o.onAfterRouteLeave,
|
|
1675
1698
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
1676
|
-
start:
|
|
1699
|
+
start: C,
|
|
1700
|
+
stop: H
|
|
1677
1701
|
};
|
|
1678
|
-
return
|
|
1702
|
+
return ot;
|
|
1679
1703
|
}
|
|
1680
1704
|
function dt(e, t) {
|
|
1681
1705
|
return {
|
|
1682
1706
|
value: e,
|
|
1683
|
-
params:
|
|
1707
|
+
params: Ze(e, t)
|
|
1684
1708
|
};
|
|
1685
1709
|
}
|
|
1686
|
-
function
|
|
1710
|
+
function po(e) {
|
|
1711
|
+
return {
|
|
1712
|
+
routes: e.routes ?? [],
|
|
1713
|
+
rejections: e.rejections ?? {},
|
|
1714
|
+
...e
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
function Qt(e, t) {
|
|
1687
1718
|
return {
|
|
1688
1719
|
value: e,
|
|
1689
|
-
params:
|
|
1720
|
+
params: Ze(e, t)
|
|
1690
1721
|
};
|
|
1691
1722
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return
|
|
1723
|
+
function Mn(e) {
|
|
1724
|
+
return ve(e) && typeof e.hash == "string";
|
|
1694
1725
|
}
|
|
1695
|
-
function
|
|
1696
|
-
return e === void 0 ?
|
|
1726
|
+
function zt(e) {
|
|
1727
|
+
return e === void 0 ? be() : Mn(e) ? e : be(e);
|
|
1697
1728
|
}
|
|
1698
|
-
function
|
|
1729
|
+
function Kt(e) {
|
|
1699
1730
|
return e === void 0 ? "" : e;
|
|
1700
1731
|
}
|
|
1701
1732
|
function Tn(e) {
|
|
1702
|
-
return
|
|
1733
|
+
return ve(e) && typeof e.value == "string";
|
|
1703
1734
|
}
|
|
1704
|
-
function
|
|
1705
|
-
return e === void 0 ?
|
|
1735
|
+
function Yt(e) {
|
|
1736
|
+
return e === void 0 ? Ie("", {}) : Tn(e) ? e : Ie(e, {});
|
|
1706
1737
|
}
|
|
1707
|
-
function
|
|
1708
|
-
return
|
|
1738
|
+
function Wn(e) {
|
|
1739
|
+
return ve(e) && typeof e.value == "string";
|
|
1709
1740
|
}
|
|
1710
|
-
function
|
|
1711
|
-
return e === void 0 ? dt("", {}) :
|
|
1741
|
+
function Xt(e) {
|
|
1742
|
+
return e === void 0 ? dt("", {}) : Wn(e) ? e : dt(e, {});
|
|
1712
1743
|
}
|
|
1713
|
-
function
|
|
1714
|
-
const t =
|
|
1744
|
+
function se(e) {
|
|
1745
|
+
const t = Qe(), r = Kt(e.name), n = Yt(e.path), o = Xt(e.query), a = zt(e.hash), s = e.meta ?? {}, f = jr(e) ? e.state : {}, c = Pe({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
1715
1746
|
id: t,
|
|
1716
|
-
matched:
|
|
1717
|
-
matches: [
|
|
1747
|
+
matched: c,
|
|
1748
|
+
matches: [c],
|
|
1718
1749
|
name: r,
|
|
1719
1750
|
path: n,
|
|
1720
1751
|
query: o,
|
|
1721
1752
|
hash: a,
|
|
1722
1753
|
meta: s,
|
|
1723
|
-
state:
|
|
1754
|
+
state: f,
|
|
1724
1755
|
depth: 1,
|
|
1725
|
-
host:
|
|
1756
|
+
host: Qt("", {}),
|
|
1726
1757
|
prefetch: e.prefetch
|
|
1727
|
-
},
|
|
1728
|
-
return
|
|
1758
|
+
}, h = St(e) ? At(e.parent, u) : u;
|
|
1759
|
+
return ie(h.path.params, h.query.params), h;
|
|
1729
1760
|
}
|
|
1730
|
-
const
|
|
1761
|
+
const Be = { template: "<div>This is component</div>" }, et = se({
|
|
1731
1762
|
name: "parentA",
|
|
1732
1763
|
path: "/parentA/[paramA]"
|
|
1733
|
-
}),
|
|
1734
|
-
parent:
|
|
1764
|
+
}), Zt = se({
|
|
1765
|
+
parent: et,
|
|
1735
1766
|
name: "parentA.childA",
|
|
1736
|
-
path: "/[?paramB]"
|
|
1737
|
-
}),
|
|
1738
|
-
parent:
|
|
1767
|
+
path: "/childA/[?paramB]"
|
|
1768
|
+
}), Jn = se({
|
|
1769
|
+
parent: et,
|
|
1739
1770
|
name: "parentA.childB",
|
|
1740
|
-
path: "/[paramD]",
|
|
1741
|
-
component:
|
|
1742
|
-
}),
|
|
1743
|
-
parent:
|
|
1771
|
+
path: "/childB/[paramD]",
|
|
1772
|
+
component: Be
|
|
1773
|
+
}), Gn = se({
|
|
1774
|
+
parent: Zt,
|
|
1744
1775
|
name: "parentA.childA.grandChildA",
|
|
1745
1776
|
path: "/[paramC]",
|
|
1746
|
-
component:
|
|
1777
|
+
component: Be
|
|
1747
1778
|
});
|
|
1748
|
-
|
|
1779
|
+
se({
|
|
1749
1780
|
name: "parentB",
|
|
1750
1781
|
path: "/parentB",
|
|
1751
|
-
component:
|
|
1752
|
-
}),
|
|
1782
|
+
component: Be
|
|
1783
|
+
}), se({
|
|
1753
1784
|
name: "parentC",
|
|
1754
1785
|
path: "/",
|
|
1755
|
-
component:
|
|
1786
|
+
component: Be
|
|
1756
1787
|
});
|
|
1757
1788
|
const Qn = "lazy", zn = {
|
|
1758
1789
|
components: !0,
|
|
1759
1790
|
props: !1
|
|
1760
1791
|
};
|
|
1761
|
-
function
|
|
1762
|
-
return ["eager", "lazy"].includes(e);
|
|
1792
|
+
function Ee(e) {
|
|
1793
|
+
return ["eager", "lazy", "intent"].includes(e);
|
|
1763
1794
|
}
|
|
1764
|
-
function
|
|
1765
|
-
const o =
|
|
1795
|
+
function er({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
|
|
1796
|
+
const o = qe(r, n), a = qe(t, n), s = qe(e, n), f = [
|
|
1766
1797
|
o,
|
|
1767
1798
|
a,
|
|
1768
1799
|
s,
|
|
1769
1800
|
zn[n],
|
|
1770
1801
|
Qn
|
|
1771
|
-
].reduce((
|
|
1772
|
-
return
|
|
1802
|
+
].reduce((c, u) => Ee(c) ? c : c === !0 && Ee(u) ? u : c === !0 && !Ee(u) ? c : c === void 0 ? u : c, void 0);
|
|
1803
|
+
return Ee(f) ? f : !1;
|
|
1773
1804
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return
|
|
1805
|
+
function qe(e, t) {
|
|
1806
|
+
return ve(e) ? e[t] : e;
|
|
1776
1807
|
}
|
|
1777
|
-
function
|
|
1808
|
+
function tr(e) {
|
|
1778
1809
|
return typeof e == "object" && e !== null && "then" in e;
|
|
1779
1810
|
}
|
|
1780
|
-
function
|
|
1811
|
+
function pt(e) {
|
|
1781
1812
|
try {
|
|
1782
1813
|
const t = e();
|
|
1783
|
-
return
|
|
1814
|
+
return tr(t) ? t.catch((r) => r) : t;
|
|
1784
1815
|
} catch (t) {
|
|
1785
1816
|
return t;
|
|
1786
1817
|
}
|
|
1787
1818
|
}
|
|
1788
|
-
const
|
|
1789
|
-
function
|
|
1790
|
-
const e =
|
|
1791
|
-
if (!
|
|
1792
|
-
return
|
|
1793
|
-
const
|
|
1819
|
+
const rr = Symbol();
|
|
1820
|
+
function Kn() {
|
|
1821
|
+
const e = Ce(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = Ht(), o = (v, E, P) => E.matches.filter((m) => er({ ...P, routePrefetch: m.prefetch }, "props") === v).flatMap((m) => u(m)).reduce((m, { id: y, name: i, props: p }) => {
|
|
1822
|
+
if (!p)
|
|
1823
|
+
return m;
|
|
1824
|
+
const A = c(y, i, E), R = pt(() => p(E, {
|
|
1794
1825
|
push: t,
|
|
1795
1826
|
replace: r,
|
|
1796
1827
|
reject: n
|
|
1797
1828
|
}));
|
|
1798
|
-
return
|
|
1799
|
-
}, {}), a = (
|
|
1800
|
-
Object.entries(
|
|
1801
|
-
e.set(
|
|
1829
|
+
return m[A] = R, m;
|
|
1830
|
+
}, {}), a = (v) => {
|
|
1831
|
+
Object.entries(v).forEach(([E, P]) => {
|
|
1832
|
+
e.set(E, P);
|
|
1802
1833
|
});
|
|
1803
|
-
}, s = async (
|
|
1804
|
-
const
|
|
1805
|
-
for (const { id:
|
|
1806
|
-
if (!
|
|
1834
|
+
}, s = async (v) => {
|
|
1835
|
+
const E = v.matches.flatMap(u), P = [], m = [];
|
|
1836
|
+
for (const { id: y, name: i, props: p } of E) {
|
|
1837
|
+
if (!p)
|
|
1807
1838
|
continue;
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1810
|
-
const
|
|
1839
|
+
const A = c(y, i, v);
|
|
1840
|
+
if (P.push(A), !e.has(A)) {
|
|
1841
|
+
const R = pt(() => p(v, {
|
|
1811
1842
|
push: t,
|
|
1812
1843
|
replace: r,
|
|
1813
1844
|
reject: n
|
|
1814
1845
|
}));
|
|
1815
|
-
e.set(
|
|
1846
|
+
e.set(A, R);
|
|
1816
1847
|
}
|
|
1817
|
-
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
throw
|
|
1848
|
+
m.push((async () => {
|
|
1849
|
+
const R = await e.get(A);
|
|
1850
|
+
if (R instanceof Error)
|
|
1851
|
+
throw R;
|
|
1821
1852
|
})());
|
|
1822
1853
|
}
|
|
1823
|
-
|
|
1854
|
+
h(P);
|
|
1824
1855
|
try {
|
|
1825
|
-
return await Promise.all(
|
|
1826
|
-
} catch (
|
|
1827
|
-
if (
|
|
1828
|
-
return
|
|
1829
|
-
throw
|
|
1856
|
+
return await Promise.all(m), { status: "SUCCESS" };
|
|
1857
|
+
} catch (y) {
|
|
1858
|
+
if (y instanceof ne || y instanceof xe)
|
|
1859
|
+
return y.response;
|
|
1860
|
+
throw y;
|
|
1830
1861
|
}
|
|
1831
|
-
},
|
|
1832
|
-
const
|
|
1833
|
-
return e.get(
|
|
1862
|
+
}, f = (v, E, P) => {
|
|
1863
|
+
const m = c(v, E, P);
|
|
1864
|
+
return e.get(m);
|
|
1834
1865
|
};
|
|
1835
|
-
function
|
|
1836
|
-
return [
|
|
1866
|
+
function c(v, E, P) {
|
|
1867
|
+
return [v, E, P.id, JSON.stringify(P.params)].join("-");
|
|
1837
1868
|
}
|
|
1838
|
-
function u(
|
|
1839
|
-
return
|
|
1869
|
+
function u(v) {
|
|
1870
|
+
return Te(v) ? Object.entries(v.props ?? {}).map(([E, P]) => ({ id: v.id, name: E, props: P })) : Me(v) ? [
|
|
1840
1871
|
{
|
|
1841
|
-
id:
|
|
1872
|
+
id: v.id,
|
|
1842
1873
|
name: "default",
|
|
1843
|
-
props:
|
|
1874
|
+
props: v.props
|
|
1844
1875
|
}
|
|
1845
1876
|
] : [];
|
|
1846
1877
|
}
|
|
1847
|
-
function
|
|
1848
|
-
for (const
|
|
1849
|
-
|
|
1878
|
+
function h(v) {
|
|
1879
|
+
for (const E in e.keys())
|
|
1880
|
+
v.includes(E) || e.delete(E);
|
|
1850
1881
|
}
|
|
1851
1882
|
return {
|
|
1852
1883
|
getPrefetchProps: o,
|
|
1853
1884
|
setPrefetchProps: a,
|
|
1854
|
-
getProps:
|
|
1885
|
+
getProps: f,
|
|
1855
1886
|
setProps: s
|
|
1856
1887
|
};
|
|
1857
1888
|
}
|
|
1858
|
-
function
|
|
1859
|
-
const e =
|
|
1889
|
+
function nr() {
|
|
1890
|
+
const e = ce(rr);
|
|
1860
1891
|
if (!e)
|
|
1861
|
-
throw new
|
|
1892
|
+
throw new Re();
|
|
1862
1893
|
return e;
|
|
1863
1894
|
}
|
|
1864
|
-
const
|
|
1895
|
+
const Yn = hr(() => new Promise((e) => {
|
|
1865
1896
|
e({ default: { template: "foo" } });
|
|
1866
1897
|
}));
|
|
1867
|
-
function
|
|
1868
|
-
return e.name ===
|
|
1898
|
+
function mt(e) {
|
|
1899
|
+
return e.name === Yn.name && "__asyncLoader" in e;
|
|
1900
|
+
}
|
|
1901
|
+
function Rt(e, t, r) {
|
|
1902
|
+
le(e, (n, o) => {
|
|
1903
|
+
n && n.addEventListener(t, r), o && o.removeEventListener(t, r);
|
|
1904
|
+
}, { immediate: !0 }), Ne(() => {
|
|
1905
|
+
e.value && e.value.removeEventListener(t, r);
|
|
1906
|
+
});
|
|
1869
1907
|
}
|
|
1870
|
-
function
|
|
1871
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
1872
|
-
const
|
|
1873
|
-
o(
|
|
1908
|
+
function Xn(e) {
|
|
1909
|
+
const t = /* @__PURE__ */ new Map(), r = De(), { getPrefetchProps: n, setPrefetchProps: o } = nr(), { isElementVisible: a } = dn(r), s = () => {
|
|
1910
|
+
const u = Array.from(t.values()).reduce((h, v) => (Object.assign(h, v), h), {});
|
|
1911
|
+
o(u);
|
|
1874
1912
|
};
|
|
1875
|
-
|
|
1876
|
-
t.clear(),
|
|
1877
|
-
}, { immediate: !0 }),
|
|
1878
|
-
const { route:
|
|
1879
|
-
!
|
|
1880
|
-
}, { immediate: !0 });
|
|
1881
|
-
function
|
|
1882
|
-
|
|
1913
|
+
le(() => j(e), ({ route: u, ...h }) => {
|
|
1914
|
+
t.clear(), u && c("eager", u, h);
|
|
1915
|
+
}, { immediate: !0 }), le(a, (u) => {
|
|
1916
|
+
const { route: h, ...v } = j(e);
|
|
1917
|
+
!h || !u || c("lazy", h, v);
|
|
1918
|
+
}, { immediate: !0 }), Rt(r, "focusin", f), Rt(r, "mouseover", f);
|
|
1919
|
+
function f() {
|
|
1920
|
+
const { route: u, ...h } = j(e);
|
|
1921
|
+
u && c("intent", u, h);
|
|
1922
|
+
}
|
|
1923
|
+
function c(u, h, v) {
|
|
1924
|
+
Zn(u, h, v), t.has(u) || t.set(u, n(u, h, v));
|
|
1883
1925
|
}
|
|
1884
1926
|
return {
|
|
1885
1927
|
element: r,
|
|
1886
1928
|
commit: s
|
|
1887
1929
|
};
|
|
1888
1930
|
}
|
|
1889
|
-
function
|
|
1931
|
+
function Zn(e, t, r) {
|
|
1890
1932
|
t.matches.forEach((n) => {
|
|
1891
|
-
|
|
1933
|
+
er({
|
|
1892
1934
|
...r,
|
|
1893
1935
|
routePrefetch: n.prefetch
|
|
1894
|
-
}, "components") === e && (Me(n) &&
|
|
1895
|
-
|
|
1936
|
+
}, "components") === e && (Me(n) && mt(n.component) && n.component.__asyncLoader(), Te(n) && Object.values(n.components).forEach((a) => {
|
|
1937
|
+
mt(a) && a.__asyncLoader();
|
|
1896
1938
|
}));
|
|
1897
1939
|
});
|
|
1898
1940
|
}
|
|
1899
|
-
function
|
|
1900
|
-
return
|
|
1941
|
+
function or(e, t, { exact: r } = {}) {
|
|
1942
|
+
return Tr(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
|
|
1901
1943
|
}
|
|
1902
|
-
function
|
|
1903
|
-
const n =
|
|
1904
|
-
const
|
|
1905
|
-
return typeof
|
|
1944
|
+
function eo(e, t = {}, r = {}) {
|
|
1945
|
+
const n = Fe(), o = N(() => {
|
|
1946
|
+
const m = j(e);
|
|
1947
|
+
return typeof m != "string" ? m : T(m) ? n.find(m, j(r)) : n.resolve(m, j(t), j(r));
|
|
1906
1948
|
}), a = N(() => {
|
|
1907
1949
|
if (o.value)
|
|
1908
1950
|
return o.value.href;
|
|
1909
|
-
const
|
|
1910
|
-
if (
|
|
1911
|
-
return
|
|
1951
|
+
const m = j(e);
|
|
1952
|
+
if (T(m))
|
|
1953
|
+
return m;
|
|
1912
1954
|
console.error(new Error("Failed to resolve route in RouterLink."));
|
|
1913
|
-
}), s = N(() =>
|
|
1914
|
-
var
|
|
1915
|
-
return
|
|
1916
|
-
})),
|
|
1917
|
-
var
|
|
1918
|
-
return n.route.id === ((
|
|
1919
|
-
}),
|
|
1920
|
-
const
|
|
1921
|
-
return typeof
|
|
1922
|
-
}), { element:
|
|
1955
|
+
}), s = N(() => or(n.route) && n.route.matches.some((m) => {
|
|
1956
|
+
var y;
|
|
1957
|
+
return m.id === ((y = o.value) == null ? void 0 : y.id);
|
|
1958
|
+
})), f = N(() => {
|
|
1959
|
+
var m;
|
|
1960
|
+
return n.route.id === ((m = o.value) == null ? void 0 : m.id);
|
|
1961
|
+
}), c = N(() => !!a.value && n.isExternal(a.value)), u = N(() => {
|
|
1962
|
+
const m = j(e);
|
|
1963
|
+
return typeof m != "string" || T(m) ? j(t) : j(r);
|
|
1964
|
+
}), { element: h, commit: v } = Xn(() => ({
|
|
1923
1965
|
route: o.value,
|
|
1924
1966
|
routerPrefetch: n.prefetch,
|
|
1925
1967
|
linkPrefetch: u.value.prefetch
|
|
1926
|
-
})),
|
|
1927
|
-
|
|
1928
|
-
const
|
|
1929
|
-
replace: (
|
|
1930
|
-
query:
|
|
1931
|
-
hash: (
|
|
1932
|
-
state: { ...u.value.state, ...
|
|
1933
|
-
},
|
|
1934
|
-
return
|
|
1968
|
+
})), E = (m) => {
|
|
1969
|
+
v();
|
|
1970
|
+
const y = {
|
|
1971
|
+
replace: (m == null ? void 0 : m.replace) ?? u.value.replace,
|
|
1972
|
+
query: Ye(u.value.query, m == null ? void 0 : m.query),
|
|
1973
|
+
hash: (m == null ? void 0 : m.hash) ?? u.value.hash,
|
|
1974
|
+
state: { ...u.value.state, ...m == null ? void 0 : m.state }
|
|
1975
|
+
}, i = j(e);
|
|
1976
|
+
return T(i) || typeof i == "object" ? n.push(i, y) : n.push(i, j(t), y);
|
|
1935
1977
|
};
|
|
1936
1978
|
return {
|
|
1937
|
-
element:
|
|
1979
|
+
element: h,
|
|
1938
1980
|
route: o,
|
|
1939
1981
|
href: a,
|
|
1940
1982
|
isMatch: s,
|
|
1941
|
-
isExactMatch:
|
|
1942
|
-
isExternal:
|
|
1943
|
-
push:
|
|
1944
|
-
replace: (
|
|
1983
|
+
isExactMatch: f,
|
|
1984
|
+
isExternal: c,
|
|
1985
|
+
push: E,
|
|
1986
|
+
replace: (m) => E({ ...m, replace: !0 })
|
|
1945
1987
|
};
|
|
1946
1988
|
}
|
|
1947
|
-
const
|
|
1989
|
+
const to = ["href"], ro = /* @__PURE__ */ ue({
|
|
1948
1990
|
__name: "routerLink",
|
|
1949
1991
|
props: {
|
|
1950
1992
|
to: {},
|
|
@@ -1955,177 +1997,178 @@ const eo = ["href"], to = /* @__PURE__ */ se({
|
|
|
1955
1997
|
state: {}
|
|
1956
1998
|
},
|
|
1957
1999
|
setup(e) {
|
|
1958
|
-
const t = e, r =
|
|
1959
|
-
const { to:
|
|
1960
|
-
return
|
|
1961
|
-
}), { element: s, isMatch:
|
|
1962
|
-
"router-link--match":
|
|
1963
|
-
"router-link--exact-match":
|
|
2000
|
+
const t = e, r = Fe(), n = N(() => E(t.to)), o = N(() => P(t.to)), a = N(() => {
|
|
2001
|
+
const { to: y, ...i } = t;
|
|
2002
|
+
return i;
|
|
2003
|
+
}), { element: s, isMatch: f, isExactMatch: c, isExternal: u, push: h } = eo(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), v = N(() => ({
|
|
2004
|
+
"router-link--match": f.value,
|
|
2005
|
+
"router-link--exact-match": c.value
|
|
1964
2006
|
}));
|
|
1965
|
-
function
|
|
1966
|
-
if (typeof
|
|
1967
|
-
const
|
|
1968
|
-
return
|
|
2007
|
+
function E(y) {
|
|
2008
|
+
if (typeof y == "function") {
|
|
2009
|
+
const i = y(r.resolve);
|
|
2010
|
+
return E(i);
|
|
1969
2011
|
}
|
|
1970
|
-
return
|
|
2012
|
+
return T(y) ? r.find(y) : y;
|
|
1971
2013
|
}
|
|
1972
|
-
function
|
|
1973
|
-
if (typeof
|
|
1974
|
-
const
|
|
1975
|
-
return
|
|
2014
|
+
function P(y) {
|
|
2015
|
+
if (typeof y == "function") {
|
|
2016
|
+
const i = y(r.resolve);
|
|
2017
|
+
return P(i);
|
|
1976
2018
|
}
|
|
1977
|
-
return
|
|
2019
|
+
return T(y) ? y : y == null ? void 0 : y.href;
|
|
1978
2020
|
}
|
|
1979
|
-
function
|
|
1980
|
-
|
|
2021
|
+
function m(y) {
|
|
2022
|
+
y.preventDefault(), h();
|
|
1981
2023
|
}
|
|
1982
|
-
return (
|
|
2024
|
+
return (y, i) => (yt(), dr("a", {
|
|
1983
2025
|
ref_key: "element",
|
|
1984
2026
|
ref: s,
|
|
1985
2027
|
href: o.value,
|
|
1986
|
-
class:
|
|
1987
|
-
onClick:
|
|
2028
|
+
class: pr(["router-link", v.value]),
|
|
2029
|
+
onClick: m
|
|
1988
2030
|
}, [
|
|
1989
|
-
|
|
1990
|
-
], 10,
|
|
2031
|
+
gt(y.$slots, "default", wt(mr({ route: n.value, isMatch: fe(f), isExactMatch: fe(c), isExternal: fe(u) })))
|
|
2032
|
+
], 10, to));
|
|
1991
2033
|
}
|
|
1992
2034
|
});
|
|
1993
|
-
function
|
|
1994
|
-
const r =
|
|
2035
|
+
function no(e, t) {
|
|
2036
|
+
const r = Fe();
|
|
1995
2037
|
function n() {
|
|
1996
2038
|
if (!e)
|
|
1997
2039
|
return;
|
|
1998
|
-
if (!
|
|
1999
|
-
throw new
|
|
2040
|
+
if (!or(r.route, e, t))
|
|
2041
|
+
throw new Ar(e, r.route.name);
|
|
2000
2042
|
}
|
|
2001
|
-
return
|
|
2043
|
+
return le(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
2002
2044
|
}
|
|
2003
|
-
const
|
|
2004
|
-
function
|
|
2005
|
-
return
|
|
2045
|
+
const ar = Symbol();
|
|
2046
|
+
function tt() {
|
|
2047
|
+
return ce(ar, 0);
|
|
2006
2048
|
}
|
|
2007
|
-
function
|
|
2008
|
-
return
|
|
2049
|
+
function oo(e, t) {
|
|
2050
|
+
return ue({
|
|
2009
2051
|
name: "PropsWrapper",
|
|
2010
2052
|
expose: [],
|
|
2011
2053
|
setup() {
|
|
2012
|
-
const r = t(), n =
|
|
2013
|
-
return () => r instanceof Error ? "" :
|
|
2054
|
+
const r = t(), n = Rr();
|
|
2055
|
+
return () => r instanceof Error ? "" : tr(r) ? n != null && n.suspense ? te(so(e, r)) : te(ao(e, r)) : te(e, r);
|
|
2014
2056
|
}
|
|
2015
2057
|
});
|
|
2016
2058
|
}
|
|
2017
|
-
function
|
|
2018
|
-
return
|
|
2059
|
+
function ao(e, t) {
|
|
2060
|
+
return ue({
|
|
2019
2061
|
name: "AsyncPropsWrapper",
|
|
2020
2062
|
expose: [],
|
|
2021
2063
|
setup() {
|
|
2022
|
-
const r =
|
|
2023
|
-
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ?
|
|
2064
|
+
const r = De();
|
|
2065
|
+
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ? te(e, r.value) : "";
|
|
2024
2066
|
}
|
|
2025
2067
|
});
|
|
2026
2068
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return
|
|
2069
|
+
function so(e, t) {
|
|
2070
|
+
return ue({
|
|
2029
2071
|
name: "SuspenseAsyncPropsWrapper",
|
|
2030
2072
|
expose: [],
|
|
2031
2073
|
async setup() {
|
|
2032
2074
|
const r = await t;
|
|
2033
|
-
return () =>
|
|
2075
|
+
return () => te(e, r);
|
|
2034
2076
|
}
|
|
2035
2077
|
});
|
|
2036
2078
|
}
|
|
2037
|
-
const
|
|
2079
|
+
const co = /* @__PURE__ */ ue({
|
|
2038
2080
|
__name: "routerView",
|
|
2039
2081
|
props: {
|
|
2040
2082
|
name: { default: "default" }
|
|
2041
2083
|
},
|
|
2042
2084
|
setup(e) {
|
|
2043
|
-
const t =
|
|
2044
|
-
|
|
2085
|
+
const t = no(), r = Mr(), n = tt(), { getProps: o } = nr(), a = vr("RouterView", !0);
|
|
2086
|
+
yr(ar, n + 1);
|
|
2045
2087
|
const s = N(() => {
|
|
2046
2088
|
if (r.value)
|
|
2047
2089
|
return r.value.component;
|
|
2048
2090
|
const u = t.matches.at(n);
|
|
2049
2091
|
if (!u)
|
|
2050
2092
|
return null;
|
|
2051
|
-
const
|
|
2052
|
-
return
|
|
2093
|
+
const h = f(u), v = o(u.id, e.name, t);
|
|
2094
|
+
return h ? v ? oo(h, () => v) : h : null;
|
|
2053
2095
|
});
|
|
2054
|
-
function
|
|
2055
|
-
return
|
|
2096
|
+
function f(u) {
|
|
2097
|
+
return c(u)[e.name];
|
|
2056
2098
|
}
|
|
2057
|
-
function
|
|
2058
|
-
return
|
|
2099
|
+
function c(u) {
|
|
2100
|
+
return Te(u) ? u.components : Me(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
|
|
2059
2101
|
}
|
|
2060
|
-
return (u,
|
|
2061
|
-
(
|
|
2062
|
-
]) :
|
|
2102
|
+
return (u, h) => s.value ? gt(u.$slots, "default", wt(gr({ key: 0 }, { route: fe(t), component: s.value, rejection: fe(r) })), () => [
|
|
2103
|
+
(yt(), wr(Er(s.value)))
|
|
2104
|
+
]) : Pr("", !0);
|
|
2063
2105
|
}
|
|
2064
2106
|
});
|
|
2065
|
-
function
|
|
2066
|
-
const e =
|
|
2107
|
+
function sr() {
|
|
2108
|
+
const e = ce($t);
|
|
2067
2109
|
if (!e)
|
|
2068
|
-
throw new
|
|
2110
|
+
throw new Re();
|
|
2069
2111
|
return e;
|
|
2070
2112
|
}
|
|
2071
|
-
function
|
|
2113
|
+
function cr(e) {
|
|
2072
2114
|
return (t) => {
|
|
2073
|
-
const r =
|
|
2074
|
-
return
|
|
2115
|
+
const r = tt(), o = sr().addComponentBeforeRouteHook({ lifecycle: e, hook: t, depth: r });
|
|
2116
|
+
return Ne(o), o;
|
|
2075
2117
|
};
|
|
2076
2118
|
}
|
|
2077
|
-
function
|
|
2119
|
+
function rt(e) {
|
|
2078
2120
|
return (t) => {
|
|
2079
|
-
const r =
|
|
2080
|
-
return
|
|
2121
|
+
const r = tt(), o = sr().addComponentAfterRouteHook({ lifecycle: e, hook: t, depth: r });
|
|
2122
|
+
return Ne(o), o;
|
|
2081
2123
|
};
|
|
2082
2124
|
}
|
|
2083
|
-
const
|
|
2084
|
-
function
|
|
2085
|
-
return
|
|
2125
|
+
const mo = cr("onBeforeRouteUpdate"), Ro = cr("onBeforeRouteLeave"), vo = rt("onAfterRouteEnter"), yo = rt("onAfterRouteUpdate"), go = rt("onAfterRouteLeave");
|
|
2126
|
+
function uo(e) {
|
|
2127
|
+
return ve(e) && typeof e.value == "string";
|
|
2086
2128
|
}
|
|
2087
|
-
function
|
|
2088
|
-
return
|
|
2129
|
+
function vt(e) {
|
|
2130
|
+
return uo(e) ? e : Qt(e, {});
|
|
2089
2131
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const t =
|
|
2132
|
+
function wo(e) {
|
|
2133
|
+
const t = Qe(), r = Kt(e.name), n = Yt(e.path), o = Xt(e.query), a = zt(e.hash), s = e.meta ?? {}, f = Vr(e) ? vt(e.host) : vt(""), c = Pe({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
2092
2134
|
id: t,
|
|
2093
|
-
matched:
|
|
2094
|
-
matches: [
|
|
2135
|
+
matched: c,
|
|
2136
|
+
matches: [c],
|
|
2095
2137
|
name: r,
|
|
2096
|
-
host:
|
|
2138
|
+
host: f,
|
|
2097
2139
|
path: n,
|
|
2098
2140
|
query: o,
|
|
2099
2141
|
hash: a,
|
|
2100
2142
|
meta: s,
|
|
2101
2143
|
depth: 1,
|
|
2102
2144
|
state: {}
|
|
2103
|
-
},
|
|
2104
|
-
return
|
|
2145
|
+
}, h = St(e) ? At(e.parent, u) : u;
|
|
2146
|
+
return ie(h.path.params, h.query.params, h.host.params), h;
|
|
2105
2147
|
}
|
|
2106
2148
|
export {
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2149
|
+
br as DuplicateParamsError,
|
|
2150
|
+
Sr as MetaPropertyConflict,
|
|
2151
|
+
ro as RouterLink,
|
|
2152
|
+
Re as RouterNotInstalledError,
|
|
2153
|
+
co as RouterView,
|
|
2154
|
+
Ar as UseRouteInvalidError,
|
|
2113
2155
|
Et as asUrl,
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2156
|
+
wo as createExternalRoute,
|
|
2157
|
+
Ir as createParam,
|
|
2158
|
+
se as createRoute,
|
|
2159
|
+
ho as createRouter,
|
|
2160
|
+
po as createRouterPlugin,
|
|
2161
|
+
or as isRoute,
|
|
2162
|
+
T as isUrl,
|
|
2163
|
+
vo as onAfterRouteEnter,
|
|
2121
2164
|
yo as onAfterRouteLeave,
|
|
2122
2165
|
go as onAfterRouteUpdate,
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2166
|
+
mo as onBeforeRouteLeave,
|
|
2167
|
+
Ro as onBeforeRouteUpdate,
|
|
2168
|
+
Ie as path,
|
|
2126
2169
|
dt as query,
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2170
|
+
eo as useLink,
|
|
2171
|
+
no as useRoute,
|
|
2172
|
+
Fe as useRouter,
|
|
2173
|
+
lo as withDefault
|
|
2131
2174
|
};
|