@kitbag/router 0.15.0 → 0.15.2
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 +107 -26
- package/dist/kitbag-router.js +1156 -1126
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +6 -6
package/dist/kitbag-router.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as
|
|
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 Ne, defineComponent as ue, h as te, ref as De, markRaw as be, watch as le, onUnmounted as Ve, defineAsyncComponent as hr, toValue as H, openBlock as gt, createElementBlock as dr, normalizeClass as pr, renderSlot as wt, normalizeProps as Et, 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
5
|
function T(e) {
|
|
6
6
|
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Pt(e) {
|
|
9
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 Lr 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,132 +38,129 @@ class Cr 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 bt = Symbol();
|
|
42
|
+
function Fe() {
|
|
43
|
+
const e = ce(bt);
|
|
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 Se(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 Se(`${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 St(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 (St(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
103
|
function At(e) {
|
|
107
104
|
return "parent" in e && !!e.parent;
|
|
108
105
|
}
|
|
109
|
-
function
|
|
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 Hr(e) {
|
|
116
113
|
return "state" in e && !!e.state;
|
|
117
114
|
}
|
|
118
|
-
function
|
|
115
|
+
function kt(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 jr(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" && jr(e);
|
|
142
139
|
}
|
|
143
|
-
function
|
|
140
|
+
function He(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 He(e) && e.defaultValue !== void 0;
|
|
148
145
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
146
|
+
function lo(e, t) {
|
|
147
|
+
return Or(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
|
+
}, Ir = {
|
|
160
157
|
get: (e) => e,
|
|
161
158
|
set: (e, { invalid: t }) => {
|
|
162
159
|
if (typeof e != "string")
|
|
163
160
|
throw t();
|
|
164
161
|
return e;
|
|
165
162
|
}
|
|
166
|
-
},
|
|
163
|
+
}, xt = {
|
|
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
|
+
}, Lt = {
|
|
180
177
|
get: (e, { invalid: t }) => {
|
|
181
178
|
const r = Number(e);
|
|
182
179
|
if (isNaN(r))
|
|
@@ -188,7 +185,7 @@ const q = {
|
|
|
188
185
|
throw t();
|
|
189
186
|
return e.toString();
|
|
190
187
|
}
|
|
191
|
-
},
|
|
188
|
+
}, Ut = {
|
|
192
189
|
get: (e, { invalid: t }) => {
|
|
193
190
|
const r = new Date(e);
|
|
194
191
|
if (isNaN(r.getTime()))
|
|
@@ -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
|
|
225
|
+
return Ir.get(e, _);
|
|
229
226
|
if (t === Boolean)
|
|
230
|
-
return
|
|
227
|
+
return xt.get(e, _);
|
|
231
228
|
if (t === Number)
|
|
232
|
-
return
|
|
229
|
+
return Lt.get(e, _);
|
|
233
230
|
if (t === Date)
|
|
234
|
-
return
|
|
231
|
+
return Ut.get(e, _);
|
|
235
232
|
if (t === JSON)
|
|
236
|
-
return Bt.get(e,
|
|
237
|
-
if (
|
|
238
|
-
return t(e,
|
|
239
|
-
if (
|
|
240
|
-
return t.get(e,
|
|
233
|
+
return Bt.get(e, _);
|
|
234
|
+
if ($r(t))
|
|
235
|
+
return t(e, _);
|
|
236
|
+
if (He(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 xt.set(e, _);
|
|
256
253
|
if (t === Number)
|
|
257
|
-
return
|
|
254
|
+
return Lt.set(e, _);
|
|
258
255
|
if (t === Date)
|
|
259
|
-
return
|
|
256
|
+
return Ut.set(e, _);
|
|
260
257
|
if (t === JSON)
|
|
261
|
-
return Bt.set(e,
|
|
262
|
-
if (
|
|
263
|
-
return t.set(e,
|
|
258
|
+
return Bt.set(e, _);
|
|
259
|
+
if (He(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 Or(e, t) {
|
|
268
|
+
return He(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 Ae = "beforeunload", Dr = "hashchange", Ct = "popstate";
|
|
302
|
+
function st(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 [
|
|
312
|
-
pathname:
|
|
313
|
-
search:
|
|
314
|
-
hash:
|
|
315
|
-
state:
|
|
316
|
-
key:
|
|
306
|
+
var d = n.location, h = d.pathname, g = d.search, x = d.hash, L = o.state || {};
|
|
307
|
+
return [L.idx, oe({
|
|
308
|
+
pathname: h,
|
|
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, h = a(), g = h[0], x = h[1];
|
|
321
|
+
if (P.length)
|
|
322
|
+
if (g != null) {
|
|
323
|
+
var L = l - 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 ct(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(
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
idx:
|
|
343
|
+
n.addEventListener(Ct, f);
|
|
344
|
+
var u = V.Pop, c = a(), l = c[0], v = c[1], E = ae(), P = ae();
|
|
345
|
+
l == null && (l = 0, o.replaceState(z({}, o.state, {
|
|
346
|
+
idx: l
|
|
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
|
|
357
|
-
pathname:
|
|
351
|
+
function y(d, h) {
|
|
352
|
+
return h === void 0 && (h = null), oe(z({
|
|
353
|
+
pathname: v.pathname,
|
|
358
354
|
hash: "",
|
|
359
355
|
search: ""
|
|
360
|
-
}, typeof
|
|
361
|
-
state:
|
|
362
|
-
key:
|
|
356
|
+
}, typeof d == "string" ? me(d) : d, {
|
|
357
|
+
state: h,
|
|
358
|
+
key: xe()
|
|
363
359
|
}));
|
|
364
360
|
}
|
|
365
|
-
function
|
|
361
|
+
function i(d, h) {
|
|
366
362
|
return [{
|
|
367
|
-
usr:
|
|
368
|
-
key:
|
|
369
|
-
idx:
|
|
370
|
-
},
|
|
371
|
-
}
|
|
372
|
-
function
|
|
373
|
-
return !
|
|
374
|
-
action:
|
|
375
|
-
location:
|
|
376
|
-
retry:
|
|
363
|
+
usr: d.state,
|
|
364
|
+
key: d.key,
|
|
365
|
+
idx: h
|
|
366
|
+
}, m(d)];
|
|
367
|
+
}
|
|
368
|
+
function p(d, h, g) {
|
|
369
|
+
return !P.length || (P.call({
|
|
370
|
+
action: d,
|
|
371
|
+
location: h,
|
|
372
|
+
retry: g
|
|
377
373
|
}), !1);
|
|
378
374
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
381
|
-
var
|
|
382
|
-
|
|
383
|
-
action:
|
|
384
|
-
location:
|
|
375
|
+
function A(d) {
|
|
376
|
+
u = d;
|
|
377
|
+
var h = a();
|
|
378
|
+
l = h[0], v = h[1], E.call({
|
|
379
|
+
action: u,
|
|
380
|
+
location: v
|
|
385
381
|
});
|
|
386
382
|
}
|
|
387
|
-
function
|
|
388
|
-
var
|
|
389
|
-
function
|
|
390
|
-
|
|
383
|
+
function R(d, h) {
|
|
384
|
+
var g = V.Push, x = y(d, h);
|
|
385
|
+
function L() {
|
|
386
|
+
R(d, h);
|
|
391
387
|
}
|
|
392
|
-
if (
|
|
393
|
-
var
|
|
388
|
+
if (p(g, x, L)) {
|
|
389
|
+
var B = i(x, l + 1), C = B[0], j = B[1];
|
|
394
390
|
try {
|
|
395
|
-
o.pushState(
|
|
391
|
+
o.pushState(C, "", j);
|
|
396
392
|
} catch {
|
|
397
|
-
n.location.assign(
|
|
393
|
+
n.location.assign(j);
|
|
398
394
|
}
|
|
399
|
-
|
|
395
|
+
A(g);
|
|
400
396
|
}
|
|
401
397
|
}
|
|
402
|
-
function w(
|
|
403
|
-
var
|
|
404
|
-
function
|
|
405
|
-
w(
|
|
398
|
+
function w(d, h) {
|
|
399
|
+
var g = V.Replace, x = y(d, h);
|
|
400
|
+
function L() {
|
|
401
|
+
w(d, h);
|
|
406
402
|
}
|
|
407
|
-
if (
|
|
408
|
-
var
|
|
409
|
-
o.replaceState(
|
|
403
|
+
if (p(g, x, L)) {
|
|
404
|
+
var B = i(x, l), C = B[0], j = B[1];
|
|
405
|
+
o.replaceState(C, "", j), 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 u;
|
|
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
|
-
listen: function(
|
|
433
|
-
return
|
|
428
|
+
listen: function(h) {
|
|
429
|
+
return E.push(h);
|
|
434
430
|
},
|
|
435
|
-
block: function(
|
|
436
|
-
var
|
|
437
|
-
return
|
|
438
|
-
|
|
431
|
+
block: function(h) {
|
|
432
|
+
var g = P.push(h);
|
|
433
|
+
return P.length === 1 && n.addEventListener(Ae, ke), function() {
|
|
434
|
+
g(), P.length || n.removeEventListener(Ae, ke);
|
|
439
435
|
};
|
|
440
436
|
}
|
|
441
437
|
};
|
|
442
|
-
return
|
|
438
|
+
return k;
|
|
443
439
|
}
|
|
444
|
-
function
|
|
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
|
|
449
|
-
return [
|
|
450
|
-
pathname:
|
|
451
|
-
search:
|
|
452
|
-
hash:
|
|
453
|
-
state:
|
|
454
|
-
key:
|
|
444
|
+
var h = me(n.location.hash.substr(1)), g = h.pathname, x = g === void 0 ? "/" : g, L = h.search, B = L === void 0 ? "" : L, C = h.hash, j = C === void 0 ? "" : C, I = o.state || {};
|
|
445
|
+
return [I.idx, oe({
|
|
446
|
+
pathname: x,
|
|
447
|
+
search: B,
|
|
448
|
+
hash: j,
|
|
449
|
+
state: I.usr || null,
|
|
450
|
+
key: I.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
|
|
463
|
-
if (
|
|
464
|
-
if (
|
|
465
|
-
var
|
|
466
|
-
|
|
467
|
-
action:
|
|
468
|
-
location:
|
|
458
|
+
var h = V.Pop, g = a(), x = g[0], L = g[1];
|
|
459
|
+
if (P.length)
|
|
460
|
+
if (x != null) {
|
|
461
|
+
var B = l - x;
|
|
462
|
+
B && (s = {
|
|
463
|
+
action: h,
|
|
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 zr(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(h);
|
|
483
479
|
}
|
|
484
480
|
}
|
|
485
|
-
n.addEventListener(
|
|
486
|
-
var
|
|
487
|
-
X(
|
|
481
|
+
n.addEventListener(Ct, f), n.addEventListener(Dr, function() {
|
|
482
|
+
var h = a(), g = h[1];
|
|
483
|
+
X(g) !== X(v) && f();
|
|
488
484
|
});
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
idx:
|
|
485
|
+
var u = V.Pop, c = a(), l = c[0], v = c[1], E = ae(), P = ae();
|
|
486
|
+
l == null && (l = 0, o.replaceState(z({}, o.state, {
|
|
487
|
+
idx: l
|
|
492
488
|
}), ""));
|
|
493
|
-
function
|
|
494
|
-
var
|
|
495
|
-
if (
|
|
496
|
-
var
|
|
497
|
-
|
|
489
|
+
function m() {
|
|
490
|
+
var h = document.querySelector("base"), g = "";
|
|
491
|
+
if (h && h.getAttribute("href")) {
|
|
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(h) {
|
|
498
|
+
return m() + "#" + (typeof h == "string" ? h : X(h));
|
|
503
499
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
506
|
-
pathname:
|
|
500
|
+
function i(h, g) {
|
|
501
|
+
return g === void 0 && (g = null), oe(z({
|
|
502
|
+
pathname: v.pathname,
|
|
507
503
|
hash: "",
|
|
508
504
|
search: ""
|
|
509
|
-
}, typeof
|
|
510
|
-
state:
|
|
511
|
-
key:
|
|
505
|
+
}, typeof h == "string" ? me(h) : h, {
|
|
506
|
+
state: g,
|
|
507
|
+
key: xe()
|
|
512
508
|
}));
|
|
513
509
|
}
|
|
514
|
-
function
|
|
510
|
+
function p(h, g) {
|
|
515
511
|
return [{
|
|
516
|
-
usr:
|
|
517
|
-
key:
|
|
518
|
-
idx:
|
|
519
|
-
},
|
|
520
|
-
}
|
|
521
|
-
function
|
|
522
|
-
return !
|
|
523
|
-
action:
|
|
524
|
-
location:
|
|
525
|
-
retry:
|
|
512
|
+
usr: h.state,
|
|
513
|
+
key: h.key,
|
|
514
|
+
idx: g
|
|
515
|
+
}, y(h)];
|
|
516
|
+
}
|
|
517
|
+
function A(h, g, x) {
|
|
518
|
+
return !P.length || (P.call({
|
|
519
|
+
action: h,
|
|
520
|
+
location: g,
|
|
521
|
+
retry: x
|
|
526
522
|
}), !1);
|
|
527
523
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
action:
|
|
533
|
-
location:
|
|
524
|
+
function R(h) {
|
|
525
|
+
u = h;
|
|
526
|
+
var g = a();
|
|
527
|
+
l = g[0], v = g[1], E.call({
|
|
528
|
+
action: u,
|
|
529
|
+
location: v
|
|
534
530
|
});
|
|
535
531
|
}
|
|
536
|
-
function w(
|
|
537
|
-
var
|
|
538
|
-
function
|
|
539
|
-
w(
|
|
532
|
+
function w(h, g) {
|
|
533
|
+
var x = V.Push, L = i(h, g);
|
|
534
|
+
function B() {
|
|
535
|
+
w(h, 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(h) + ")"), A(x, L, B)) {
|
|
538
|
+
var C = p(L, l + 1), j = C[0], I = C[1];
|
|
543
539
|
try {
|
|
544
|
-
o.pushState(
|
|
540
|
+
o.pushState(j, "", I);
|
|
545
541
|
} catch {
|
|
546
|
-
n.location.assign(
|
|
542
|
+
n.location.assign(I);
|
|
547
543
|
}
|
|
548
|
-
|
|
544
|
+
R(x);
|
|
549
545
|
}
|
|
550
546
|
}
|
|
551
|
-
function
|
|
552
|
-
var
|
|
553
|
-
function
|
|
554
|
-
|
|
547
|
+
function S(h, g) {
|
|
548
|
+
var x = V.Replace, L = i(h, g);
|
|
549
|
+
function B() {
|
|
550
|
+
S(h, g);
|
|
555
551
|
}
|
|
556
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
557
|
-
var
|
|
558
|
-
o.replaceState(
|
|
552
|
+
if (process.env.NODE_ENV !== "production" && Y(L.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(h) + ")"), A(x, L, B)) {
|
|
553
|
+
var C = p(L, l), j = C[0], I = C[1];
|
|
554
|
+
o.replaceState(j, "", I), R(x);
|
|
559
555
|
}
|
|
560
556
|
}
|
|
561
|
-
function
|
|
562
|
-
o.go(
|
|
557
|
+
function k(h) {
|
|
558
|
+
o.go(h);
|
|
563
559
|
}
|
|
564
|
-
var
|
|
560
|
+
var d = {
|
|
565
561
|
get action() {
|
|
566
|
-
return
|
|
562
|
+
return u;
|
|
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(Ae, ke), function() {
|
|
583
|
+
x(), P.length || n.removeEventListener(Ae, ke);
|
|
588
584
|
};
|
|
589
585
|
}
|
|
590
586
|
};
|
|
591
|
-
return
|
|
587
|
+
return d;
|
|
592
588
|
}
|
|
593
|
-
function
|
|
589
|
+
function ct(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: xe()
|
|
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 = ut(o ?? a.length - 1, 0, a.length - 1), f = V.Pop, u = a[s], c = ae(), l = 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: u.pathname,
|
|
611
607
|
search: "",
|
|
612
608
|
hash: ""
|
|
613
|
-
}, typeof
|
|
609
|
+
}, typeof R == "string" ? me(R) : R, {
|
|
614
610
|
state: w,
|
|
615
|
-
key:
|
|
611
|
+
key: xe()
|
|
616
612
|
}));
|
|
617
613
|
}
|
|
618
|
-
function
|
|
619
|
-
return !
|
|
620
|
-
action:
|
|
614
|
+
function P(R, w, S) {
|
|
615
|
+
return !l.length || (l.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, u = w, c.call({
|
|
623
|
+
action: f,
|
|
624
|
+
location: u
|
|
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(u.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(u.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 = ut(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 u;
|
|
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
|
-
return
|
|
669
|
+
return c.push(w);
|
|
674
670
|
},
|
|
675
671
|
block: function(w) {
|
|
676
|
-
return
|
|
672
|
+
return l.push(w);
|
|
677
673
|
}
|
|
678
674
|
};
|
|
679
|
-
return
|
|
675
|
+
return A;
|
|
680
676
|
}
|
|
681
|
-
function
|
|
677
|
+
function ut(e, t, r) {
|
|
682
678
|
return Math.min(Math.max(e, t), r);
|
|
683
679
|
}
|
|
684
|
-
function
|
|
680
|
+
function ke(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 xe() {
|
|
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 pe(e) {
|
|
|
721
717
|
}
|
|
722
718
|
return t;
|
|
723
719
|
}
|
|
724
|
-
const
|
|
725
|
-
function
|
|
726
|
-
const e =
|
|
720
|
+
const Nt = Symbol();
|
|
721
|
+
function Mr() {
|
|
722
|
+
const e = ce(Nt);
|
|
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 Vt = Symbol("isRouterRouteSymbol");
|
|
728
|
+
function Tr(e) {
|
|
729
|
+
return typeof e == "object" && e !== null && Vt 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: u, name: c, hash: l, 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 Yr(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 Ne({
|
|
803
799
|
id: s,
|
|
804
|
-
matched:
|
|
805
|
-
matches:
|
|
806
|
-
state:
|
|
807
|
-
query:
|
|
808
|
-
hash:
|
|
809
|
-
params:
|
|
810
|
-
name:
|
|
811
|
-
href:
|
|
800
|
+
matched: f,
|
|
801
|
+
matches: u,
|
|
802
|
+
state: m,
|
|
803
|
+
query: P,
|
|
804
|
+
hash: l,
|
|
805
|
+
params: E,
|
|
806
|
+
name: c,
|
|
807
|
+
href: v,
|
|
812
808
|
update: r,
|
|
813
|
-
[
|
|
809
|
+
[Vt]: !0
|
|
814
810
|
});
|
|
815
811
|
}
|
|
816
|
-
const
|
|
817
|
-
function
|
|
818
|
-
const r =
|
|
812
|
+
const Ht = Symbol();
|
|
813
|
+
function Jr(e, t) {
|
|
814
|
+
const r = Ne({ ...e }), n = (s) => {
|
|
819
815
|
Object.assign(r, {
|
|
820
|
-
[
|
|
816
|
+
[Ht]: !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 Zr(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 en(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 =
|
|
861
|
-
if (
|
|
862
|
-
r.replace(
|
|
855
|
+
function Kr({ mode: e, listener: t }) {
|
|
856
|
+
const r = Yr(e), n = (u, c) => {
|
|
857
|
+
if (c != null && c.replace) {
|
|
858
|
+
r.replace(u, c.state);
|
|
863
859
|
return;
|
|
864
860
|
}
|
|
865
|
-
r.push(
|
|
861
|
+
r.push(u, c == null ? void 0 : c.state);
|
|
866
862
|
}, o = () => {
|
|
867
|
-
const
|
|
868
|
-
r.replace(
|
|
863
|
+
const u = X(r.location);
|
|
864
|
+
r.replace(u);
|
|
869
865
|
};
|
|
870
866
|
let a;
|
|
871
867
|
return {
|
|
@@ -880,108 +876,155 @@ function rn({ 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() ? st() : ct();
|
|
887
883
|
case "browser":
|
|
888
|
-
return
|
|
884
|
+
return st();
|
|
889
885
|
case "memory":
|
|
890
|
-
return
|
|
886
|
+
return ct();
|
|
891
887
|
case "hash":
|
|
892
|
-
return
|
|
888
|
+
return Fr();
|
|
893
889
|
default:
|
|
894
890
|
const t = e;
|
|
895
891
|
throw new Error(`Switch is not exhaustive for mode: ${t}`);
|
|
896
892
|
}
|
|
897
893
|
}
|
|
898
|
-
class
|
|
899
|
-
constructor() {
|
|
900
|
-
O(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
901
|
-
O(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
902
|
-
O(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
903
|
-
O(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
904
|
-
O(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
905
|
-
O(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
class $t extends Error {
|
|
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 Le 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 && Fe(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 an(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 && Fe(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 qt() {
|
|
915
|
+
function $t() {
|
|
946
916
|
return { reject: (o) => {
|
|
947
|
-
throw new
|
|
917
|
+
throw new Le(o);
|
|
948
918
|
}, push: (...o) => {
|
|
949
|
-
throw new
|
|
919
|
+
throw new ne(o);
|
|
950
920
|
}, replace: (o, a, s) => {
|
|
951
921
|
if (T(o)) {
|
|
952
|
-
const
|
|
953
|
-
throw new
|
|
922
|
+
const c = a ?? {};
|
|
923
|
+
throw new ne([o, { ...c, replace: !0 }]);
|
|
954
924
|
}
|
|
955
|
-
const
|
|
956
|
-
throw new
|
|
925
|
+
const f = a, u = s ?? {};
|
|
926
|
+
throw new ne([o, f, { ...u, replace: !0 }]);
|
|
957
927
|
}, abort: () => {
|
|
958
|
-
throw new
|
|
928
|
+
throw new jt();
|
|
959
929
|
} };
|
|
960
930
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
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());
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
const ye = (e, t, r) => {
|
|
942
|
+
var a, s;
|
|
943
|
+
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
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;
|
|
947
|
+
const n = e.matches, o = (t == null ? void 0 : t.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);
|
|
952
|
+
};
|
|
953
|
+
function it(e) {
|
|
954
|
+
switch (e) {
|
|
955
|
+
case "onBeforeRouteEnter":
|
|
956
|
+
case "onAfterRouteEnter":
|
|
957
|
+
return ye;
|
|
958
|
+
case "onBeforeRouteUpdate":
|
|
959
|
+
case "onAfterRouteUpdate":
|
|
960
|
+
return we;
|
|
961
|
+
case "onBeforeRouteLeave":
|
|
962
|
+
case "onAfterRouteLeave":
|
|
963
|
+
return ge;
|
|
964
|
+
default:
|
|
965
|
+
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
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() {
|
|
1002
|
+
const e = {
|
|
1003
|
+
global: new Z(),
|
|
1004
|
+
component: new Z()
|
|
1005
|
+
}, { reject: t, push: r, replace: n, abort: o } = $t(), 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)), u = (i) => (e.global.onAfterRouteEnter.add(i), () => e.global.onAfterRouteEnter.delete(i)), c = (i) => (e.global.onAfterRouteUpdate.add(i), () => e.global.onAfterRouteUpdate.delete(i)), l = (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
|
|
973
1016
|
];
|
|
974
1017
|
try {
|
|
975
|
-
const d =
|
|
976
|
-
from:
|
|
977
|
-
reject:
|
|
978
|
-
push:
|
|
979
|
-
replace:
|
|
980
|
-
abort:
|
|
1018
|
+
const d = k.map((h) => h(i, {
|
|
1019
|
+
from: p,
|
|
1020
|
+
reject: t,
|
|
1021
|
+
push: r,
|
|
1022
|
+
replace: n,
|
|
1023
|
+
abort: o
|
|
981
1024
|
}));
|
|
982
1025
|
await Promise.all(d);
|
|
983
1026
|
} catch (d) {
|
|
984
|
-
if (d instanceof
|
|
1027
|
+
if (d instanceof ne || d instanceof Le || d instanceof jt)
|
|
985
1028
|
return d.response;
|
|
986
1029
|
throw d;
|
|
987
1030
|
}
|
|
@@ -989,28 +1032,28 @@ function sn() {
|
|
|
989
1032
|
status: "SUCCESS"
|
|
990
1033
|
};
|
|
991
1034
|
}
|
|
992
|
-
async function
|
|
993
|
-
const { global:
|
|
994
|
-
...
|
|
995
|
-
...
|
|
996
|
-
...
|
|
997
|
-
...
|
|
998
|
-
...
|
|
999
|
-
...
|
|
1000
|
-
...
|
|
1001
|
-
...
|
|
1002
|
-
...
|
|
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
|
|
1003
1046
|
];
|
|
1004
1047
|
try {
|
|
1005
|
-
const d =
|
|
1006
|
-
from:
|
|
1007
|
-
reject:
|
|
1008
|
-
push:
|
|
1009
|
-
replace:
|
|
1048
|
+
const d = k.map((h) => h(i, {
|
|
1049
|
+
from: p,
|
|
1050
|
+
reject: t,
|
|
1051
|
+
push: r,
|
|
1052
|
+
replace: n
|
|
1010
1053
|
}));
|
|
1011
1054
|
await Promise.all(d);
|
|
1012
1055
|
} catch (d) {
|
|
1013
|
-
if (d instanceof
|
|
1056
|
+
if (d instanceof ne || d instanceof Le)
|
|
1014
1057
|
return d.response;
|
|
1015
1058
|
throw d;
|
|
1016
1059
|
}
|
|
@@ -1019,73 +1062,35 @@ function sn() {
|
|
|
1019
1062
|
};
|
|
1020
1063
|
}
|
|
1021
1064
|
return {
|
|
1022
|
-
runBeforeRouteHooks:
|
|
1023
|
-
runAfterRouteHooks:
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
case "onAfterRouteLeave":
|
|
1048
|
-
return Te;
|
|
1049
|
-
default:
|
|
1050
|
-
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
function cn() {
|
|
1054
|
-
const e = {
|
|
1055
|
-
global: new Ee(),
|
|
1056
|
-
component: new Ee()
|
|
1057
|
-
};
|
|
1058
|
-
function t({ lifecycle: n, timing: o, depth: a, hook: s }) {
|
|
1059
|
-
const c = ft(n), i = e[o][n], u = (f, h) => {
|
|
1060
|
-
if (c(f, h.from, a))
|
|
1061
|
-
return s(f, h);
|
|
1062
|
-
};
|
|
1063
|
-
return i.add(u), () => i.delete(u);
|
|
1064
|
-
}
|
|
1065
|
-
function r({ lifecycle: n, timing: o, depth: a, hook: s }) {
|
|
1066
|
-
const c = ft(n), i = e[o][n], u = (f, h) => {
|
|
1067
|
-
if (c(f, h.from, a))
|
|
1068
|
-
return s(f, h);
|
|
1069
|
-
};
|
|
1070
|
-
return i.add(u), () => i.delete(u);
|
|
1071
|
-
}
|
|
1072
|
-
return { ...e, addBeforeRouteHook: t, addAfterRouteHook: r };
|
|
1073
|
-
}
|
|
1074
|
-
const _t = Symbol();
|
|
1075
|
-
function un() {
|
|
1076
|
-
const e = cn();
|
|
1077
|
-
return {
|
|
1078
|
-
onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
1079
|
-
onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
1080
|
-
onBeforeRouteLeave: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: c, timing: "global", depth: 0 }),
|
|
1081
|
-
onAfterRouteEnter: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
1082
|
-
onAfterRouteUpdate: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
1083
|
-
onAfterRouteLeave: (c) => e.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: c, timing: "global", depth: 0 }),
|
|
1084
|
-
hooks: e
|
|
1065
|
+
runBeforeRouteHooks: v,
|
|
1066
|
+
runAfterRouteHooks: E,
|
|
1067
|
+
addComponentBeforeRouteHook: ({ lifecycle: i, depth: p, hook: A }) => {
|
|
1068
|
+
const R = it(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 = it(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) => u(p)), i.onAfterRouteUpdate.forEach((p) => c(p)), i.onAfterRouteLeave.forEach((p) => l(p));
|
|
1083
|
+
},
|
|
1084
|
+
onBeforeRouteEnter: a,
|
|
1085
|
+
onBeforeRouteUpdate: s,
|
|
1086
|
+
onBeforeRouteLeave: f,
|
|
1087
|
+
onAfterRouteEnter: u,
|
|
1088
|
+
onAfterRouteUpdate: c,
|
|
1089
|
+
onAfterRouteLeave: l
|
|
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
|
});
|
|
@@ -1119,37 +1124,34 @@ function Je(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
|
-
return ge(s[a] ?? fn(a));
|
|
1135
|
-
}, r = (a) => {
|
|
1136
|
-
const s = ge(t(a)), c = {
|
|
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) => be(e[a] ?? nn(a)), r = (a) => {
|
|
1138
|
+
const s = be(t(a)), f = {
|
|
1137
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
1149
|
query: Je(""),
|
|
1148
1150
|
params: {},
|
|
1149
1151
|
state: {},
|
|
1150
1152
|
href: "/",
|
|
1151
1153
|
hash: "",
|
|
1152
|
-
[
|
|
1154
|
+
[Ht]: !0
|
|
1153
1155
|
};
|
|
1154
1156
|
}, n = (a) => {
|
|
1155
1157
|
if (!a) {
|
|
@@ -1158,164 +1160,71 @@ function ln({
|
|
|
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 ze(e) {
|
|
1181
|
-
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1182
|
-
}
|
|
1183
|
-
function dn(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 = ze(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 mn(e) {
|
|
1197
|
-
const t = Wt(e.path.value);
|
|
1198
|
-
return new RegExp(`^${t}$`, "i");
|
|
1199
|
-
}
|
|
1200
|
-
function yn(e) {
|
|
1201
|
-
const t = new URLSearchParams(e.query.value);
|
|
1202
|
-
return Array.from(t.entries()).filter(([, r]) => !je(r)).map(([r, n]) => {
|
|
1203
|
-
const o = Wt(n);
|
|
1204
|
-
return new RegExp(`${ze(r)}=${o}(&|$)`, "i");
|
|
1205
|
-
});
|
|
1206
|
-
}
|
|
1207
|
-
function Wt(e) {
|
|
1208
|
-
return dn(e, new RegExp(gn, "g")).map((t) => t.startsWith(J) ? Dt(t) : ze(t)).join("");
|
|
1209
|
-
}
|
|
1210
|
-
function Dt(e) {
|
|
1211
|
-
return [
|
|
1212
|
-
vn,
|
|
1213
|
-
Rn
|
|
1214
|
-
].reduce((t, r) => r(t), e);
|
|
1215
|
-
}
|
|
1216
|
-
const gn = `\\${J}\\??([\\w-_]+)\\${K}`, Ge = `\\${J}\\?([\\w-_]+)\\${K}`, It = `\\${J}([\\w-_]+)\\${K}`;
|
|
1217
|
-
function vn(e) {
|
|
1218
|
-
return e.replace(new RegExp(Ge, "g"), ".*");
|
|
1219
|
-
}
|
|
1220
|
-
function je(e) {
|
|
1221
|
-
return new RegExp(Ge, "g").test(e);
|
|
1222
|
-
}
|
|
1223
|
-
function Rn(e) {
|
|
1224
|
-
return e.replace(new RegExp(It, "g"), ".+");
|
|
1225
|
-
}
|
|
1226
|
-
function Ce(e) {
|
|
1227
|
-
const [t] = Se(e, new RegExp(Ge, "g")), [r] = Se(e, new RegExp(It, "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 Ke(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 = Ce(a);
|
|
1237
|
-
if (!c)
|
|
1238
|
-
return o;
|
|
1239
|
-
const i = Tr(t, c);
|
|
1240
|
-
return ce([c], o), o[s] = i, o;
|
|
1241
|
-
}, {});
|
|
1242
|
-
}
|
|
1243
|
-
function $e(e, t) {
|
|
1244
|
-
return {
|
|
1245
|
-
value: e,
|
|
1246
|
-
params: Ke(e, t)
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
function wn(e, t) {
|
|
1250
|
-
return F(t) ? e.map((r) => {
|
|
1251
|
-
const n = `${t}${r.path.value}`;
|
|
1252
|
-
return {
|
|
1253
|
-
...r,
|
|
1254
|
-
path: $e(n, r.path.params)
|
|
1255
|
-
};
|
|
1256
|
-
}) : e;
|
|
1180
|
+
throw new cn();
|
|
1257
1181
|
}
|
|
1258
|
-
function
|
|
1182
|
+
function qt(e) {
|
|
1259
1183
|
return !!e && typeof e == "object";
|
|
1260
1184
|
}
|
|
1261
|
-
const
|
|
1262
|
-
function
|
|
1263
|
-
if (
|
|
1185
|
+
const Ue = !0;
|
|
1186
|
+
function fn(e, t, r) {
|
|
1187
|
+
if (qt(e) && t in e) {
|
|
1264
1188
|
const n = e[t];
|
|
1265
|
-
return typeof n == "string" ?
|
|
1189
|
+
return typeof n == "string" ? de(n, r, Ue) : n;
|
|
1266
1190
|
}
|
|
1267
|
-
return
|
|
1191
|
+
return de(void 0, r, Ue);
|
|
1268
1192
|
}
|
|
1269
|
-
function
|
|
1193
|
+
function It(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 (qt(e) && t in e) {
|
|
1279
1203
|
const n = e[t];
|
|
1280
|
-
return
|
|
1204
|
+
return pe(n, r, Ue);
|
|
1281
1205
|
}
|
|
1282
|
-
return
|
|
1206
|
+
return pe(void 0, r, Ue);
|
|
1283
1207
|
}
|
|
1284
|
-
const
|
|
1208
|
+
const ft = (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 Sn(e) {
|
|
1302
|
-
const t = e.map(({ name: r }) => r);
|
|
1303
|
-
for (const r of t)
|
|
1304
|
-
if (kt(t, r) > 1)
|
|
1305
|
-
throw new bn(r);
|
|
1306
|
-
}
|
|
1307
|
-
function kn() {
|
|
1308
|
-
const e = xe(/* @__PURE__ */ new Map()), t = Ie() ? 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 = Ne(/* @__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((u) => {
|
|
1227
|
+
e.set(u.target, u.isIntersecting);
|
|
1319
1228
|
});
|
|
1320
1229
|
});
|
|
1321
1230
|
}
|
|
@@ -1326,61 +1235,114 @@ function kn() {
|
|
|
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 }), Ve(() => {
|
|
1337
1246
|
e.value && t.unobserve(e.value);
|
|
1338
1247
|
}), {
|
|
1339
1248
|
isElementVisible: N(() => e.value ? t.isElementVisible(e.value) : !1)
|
|
1340
1249
|
};
|
|
1341
1250
|
}
|
|
1342
|
-
class
|
|
1251
|
+
class pn extends Error {
|
|
1343
1252
|
constructor(t) {
|
|
1344
1253
|
super(`Route not found: "${t}"`);
|
|
1345
1254
|
}
|
|
1346
1255
|
}
|
|
1347
|
-
function
|
|
1348
|
-
|
|
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 u = ze(e.slice(n, f.index));
|
|
1266
|
+
u.length && s.push(u);
|
|
1267
|
+
const [c] = f;
|
|
1268
|
+
return s.push(c), n = f.index + c.length, s;
|
|
1269
|
+
}, []), a = e.slice(n);
|
|
1270
|
+
return a && o.push(a), o;
|
|
1271
|
+
}
|
|
1272
|
+
function Rn(e) {
|
|
1273
|
+
const t = Dt(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]) => !Ye(r)).map(([r, n]) => {
|
|
1279
|
+
const o = Dt(n);
|
|
1280
|
+
return new RegExp(`${ze(r)}=${o}(&|$)`, "i");
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
function Dt(e) {
|
|
1284
|
+
return mn(e, new RegExp(yn, "g")).map((t) => t.startsWith(G) ? Ft(t) : ze(t)).join("");
|
|
1285
|
+
}
|
|
1286
|
+
function Ft(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}`, Mt = `\\${G}([\\w-_]+)\\${K}`;
|
|
1293
|
+
function gn(e) {
|
|
1294
|
+
return e.replace(new RegExp(Ke, "g"), ".*");
|
|
1295
|
+
}
|
|
1296
|
+
function Ye(e) {
|
|
1297
|
+
return new RegExp(Ke, "g").test(e);
|
|
1298
|
+
}
|
|
1299
|
+
function wn(e) {
|
|
1300
|
+
return e.replace(new RegExp(Mt, "g"), ".+");
|
|
1301
|
+
}
|
|
1302
|
+
function Ee(e) {
|
|
1303
|
+
const [t] = Be(e, new RegExp(Ke, "g")), [r] = Be(e, new RegExp(Mt, "g"));
|
|
1304
|
+
return t ?? r;
|
|
1305
|
+
}
|
|
1306
|
+
function Be(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] = Be(e, n);
|
|
1349
1311
|
return o;
|
|
1350
1312
|
}
|
|
1351
|
-
function
|
|
1313
|
+
function Wt(e, t) {
|
|
1352
1314
|
if (!t)
|
|
1353
1315
|
return e;
|
|
1354
|
-
const { name: r, param: n, value: o } = t, a =
|
|
1355
|
-
return
|
|
1316
|
+
const { name: r, param: n, value: o } = t, a = Jt(e, r);
|
|
1317
|
+
return Be(e, a).reduce((f, u) => u === void 0 ? f : f.replace(u, () => pe(o, n, r.startsWith("?"))), e);
|
|
1356
1318
|
}
|
|
1357
|
-
function
|
|
1319
|
+
function Jt(e, t) {
|
|
1358
1320
|
const r = [
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1321
|
+
En,
|
|
1322
|
+
Pn,
|
|
1323
|
+
Ft
|
|
1362
1324
|
].reduce((n, o) => o(n, t), e);
|
|
1363
1325
|
return new RegExp(r, "g");
|
|
1364
1326
|
}
|
|
1365
|
-
function
|
|
1327
|
+
function En(e, t) {
|
|
1366
1328
|
if (!t.startsWith("?"))
|
|
1367
1329
|
return e;
|
|
1368
|
-
const r = new RegExp(`\\${
|
|
1330
|
+
const r = new RegExp(`\\${G}\\${t}\\${K}`, "g");
|
|
1369
1331
|
return e.replace(r, "(.*)");
|
|
1370
1332
|
}
|
|
1371
|
-
function
|
|
1333
|
+
function Pn(e, t) {
|
|
1372
1334
|
if (t.startsWith("?"))
|
|
1373
1335
|
return e;
|
|
1374
|
-
const r = new RegExp(`\\${
|
|
1336
|
+
const r = new RegExp(`\\${G}${t}\\${K}`, "g");
|
|
1375
1337
|
return e.replace(r, "(.+)");
|
|
1376
1338
|
}
|
|
1377
1339
|
function Gt({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
1378
1340
|
const s = new URL("https://localhost");
|
|
1379
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);
|
|
1380
|
-
const
|
|
1381
|
-
return
|
|
1342
|
+
const f = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
1343
|
+
return Pt(f);
|
|
1382
1344
|
}
|
|
1383
|
-
function
|
|
1345
|
+
function Xe(...e) {
|
|
1384
1346
|
const t = new URLSearchParams();
|
|
1385
1347
|
for (const r of e) {
|
|
1386
1348
|
const n = new URLSearchParams(r);
|
|
@@ -1389,578 +1351,645 @@ function Ye(...e) {
|
|
|
1389
1351
|
}
|
|
1390
1352
|
return t;
|
|
1391
1353
|
}
|
|
1392
|
-
function
|
|
1393
|
-
const { params: r = {}, query: n } = t, o =
|
|
1394
|
-
return Gt({ protocol:
|
|
1354
|
+
function bn(e, t = {}) {
|
|
1355
|
+
const { params: r = {}, query: n } = t, o = kn(e.query, r), a = Xe(o, n), s = An(e.path, r), f = Se(e.hash.value ?? t.hash).value, u = Sn(e.host, r), { protocol: c, host: l } = q(u);
|
|
1356
|
+
return Gt({ protocol: c, host: l, pathname: s, searchParams: a, hash: f });
|
|
1395
1357
|
}
|
|
1396
|
-
function
|
|
1358
|
+
function Sn(e, t) {
|
|
1397
1359
|
const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
1398
1360
|
return Object.entries(e.params).reduce((n, [o, a]) => {
|
|
1399
|
-
const s =
|
|
1400
|
-
return s ?
|
|
1361
|
+
const s = Ee(`${G}${o}${K}`);
|
|
1362
|
+
return s ? Wt(n, { name: o, param: a, value: t[s] }) : n;
|
|
1401
1363
|
}, r);
|
|
1402
1364
|
}
|
|
1403
|
-
function
|
|
1365
|
+
function An(e, t) {
|
|
1404
1366
|
return Object.entries(e.params).reduce((r, [n, o]) => {
|
|
1405
|
-
const a =
|
|
1406
|
-
return a ?
|
|
1367
|
+
const a = Ee(`${G}${n}${K}`);
|
|
1368
|
+
return a ? Wt(r, { name: n, param: o, value: t[a] }) : r;
|
|
1407
1369
|
}, e.value);
|
|
1408
1370
|
}
|
|
1409
|
-
function
|
|
1371
|
+
function kn(e, t) {
|
|
1410
1372
|
const r = new URLSearchParams(e.value);
|
|
1411
1373
|
if (!e.value)
|
|
1412
1374
|
return r;
|
|
1413
1375
|
for (const [n, o] of Array.from(r.entries())) {
|
|
1414
|
-
const a =
|
|
1376
|
+
const a = Ee(o);
|
|
1415
1377
|
if (!a)
|
|
1416
1378
|
continue;
|
|
1417
|
-
const c =
|
|
1418
|
-
|
|
1379
|
+
const f = Ye(o), u = f ? `?${a}` : a, c = pe(t[a], e.params[u], f), l = t[a] === void 0 && c === "";
|
|
1380
|
+
f && l ? r.delete(n, o) : r.set(n, c);
|
|
1419
1381
|
}
|
|
1420
1382
|
return r;
|
|
1421
1383
|
}
|
|
1422
|
-
const
|
|
1384
|
+
const xn = (e, t) => {
|
|
1423
1385
|
try {
|
|
1424
|
-
|
|
1386
|
+
Ze(e, t);
|
|
1425
1387
|
} catch {
|
|
1426
1388
|
return !1;
|
|
1427
1389
|
}
|
|
1428
1390
|
return !0;
|
|
1429
|
-
},
|
|
1430
|
-
const { pathname: r, search: n } =
|
|
1391
|
+
}, Ze = (e, t) => {
|
|
1392
|
+
const { pathname: r, search: n } = q(t);
|
|
1431
1393
|
return {
|
|
1432
|
-
...
|
|
1433
|
-
|
|
1394
|
+
...Ln(e.path, r),
|
|
1395
|
+
...Un(e.query, n)
|
|
1434
1396
|
};
|
|
1435
1397
|
};
|
|
1436
|
-
function
|
|
1398
|
+
function Ln(e, t) {
|
|
1437
1399
|
const r = {}, n = decodeURIComponent(t);
|
|
1438
1400
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1439
|
-
const s = o.startsWith("?"),
|
|
1440
|
-
r[
|
|
1401
|
+
const s = o.startsWith("?"), f = s ? o.slice(1) : o, u = Tt(n, e.value, o), c = de(u, a, s);
|
|
1402
|
+
r[f] = c;
|
|
1441
1403
|
}
|
|
1442
1404
|
return r;
|
|
1443
1405
|
}
|
|
1444
|
-
function
|
|
1445
|
-
const r = {}, n = new URLSearchParams(t);
|
|
1446
|
-
for (const [
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1406
|
+
function Un(e, t) {
|
|
1407
|
+
const r = {}, n = new URLSearchParams(e.value), o = new URLSearchParams(t);
|
|
1408
|
+
for (const [a, s] of Array.from(n.entries())) {
|
|
1409
|
+
const f = Ee(s);
|
|
1410
|
+
if (!f)
|
|
1411
|
+
continue;
|
|
1412
|
+
const c = Ye(s), l = c ? `?${f}` : f, v = o.get(a) ?? void 0, E = de(v, e.params[l], c);
|
|
1413
|
+
r[f] = E;
|
|
1449
1414
|
}
|
|
1450
1415
|
return r;
|
|
1451
1416
|
}
|
|
1452
|
-
function
|
|
1453
|
-
const n =
|
|
1417
|
+
function Bn(e, t = {}, r = {}) {
|
|
1418
|
+
const n = bn(e, {
|
|
1454
1419
|
params: t,
|
|
1455
1420
|
query: r.query,
|
|
1456
1421
|
hash: r.hash
|
|
1457
|
-
}), { search: o, hash: a } =
|
|
1422
|
+
}), { search: o, hash: a } = q(n);
|
|
1458
1423
|
return {
|
|
1459
1424
|
id: e.id,
|
|
1460
1425
|
matched: e.matched,
|
|
1461
1426
|
matches: e.matches,
|
|
1462
1427
|
name: e.name,
|
|
1463
1428
|
query: Je(o),
|
|
1464
|
-
params:
|
|
1465
|
-
state:
|
|
1429
|
+
params: Ze(e, n),
|
|
1430
|
+
state: It(e.state, r.state),
|
|
1466
1431
|
hash: a,
|
|
1467
1432
|
href: n
|
|
1468
1433
|
};
|
|
1469
1434
|
}
|
|
1470
|
-
const
|
|
1471
|
-
const { pathname: r } =
|
|
1472
|
-
return
|
|
1473
|
-
},
|
|
1474
|
-
const { search: r } =
|
|
1475
|
-
return
|
|
1476
|
-
},
|
|
1477
|
-
const { hash: r } =
|
|
1435
|
+
const Cn = (e) => "name" in e.matched && !!e.matched.name, Nn = (e, t) => {
|
|
1436
|
+
const { pathname: r } = q(t);
|
|
1437
|
+
return Rn(e).test(r);
|
|
1438
|
+
}, Vn = (e, t) => {
|
|
1439
|
+
const { search: r } = q(t);
|
|
1440
|
+
return vn(e).every((o) => o.test(r));
|
|
1441
|
+
}, Ie = (e, t) => {
|
|
1442
|
+
const { hash: r } = q(t), { value: n } = e.hash;
|
|
1478
1443
|
return n === void 0 || `#${n.toLowerCase()}` === r.toLowerCase();
|
|
1479
1444
|
};
|
|
1480
|
-
function
|
|
1481
|
-
const { searchParams: t, pathname: r } =
|
|
1445
|
+
function Hn(e) {
|
|
1446
|
+
const { searchParams: t, pathname: r } = q(e), n = -1, o = 1;
|
|
1482
1447
|
return (a, s) => {
|
|
1483
|
-
const
|
|
1484
|
-
return a.depth > s.depth ? n : a.depth < s.depth ? o :
|
|
1448
|
+
const f = ht(a, t), u = lt(a, r), c = ht(s, t), l = lt(s, r);
|
|
1449
|
+
return a.depth > s.depth ? n : a.depth < s.depth ? o : f + u > c + l ? n : f + u < c + l ? o : Ie(a, e) ? n : Ie(s, e) ? o : 0;
|
|
1485
1450
|
};
|
|
1486
1451
|
}
|
|
1487
|
-
function
|
|
1488
|
-
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) =>
|
|
1452
|
+
function lt(e, t) {
|
|
1453
|
+
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);
|
|
1489
1454
|
return r.length - n.length;
|
|
1490
1455
|
}
|
|
1491
|
-
function
|
|
1456
|
+
function ht(e, t) {
|
|
1492
1457
|
const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
1493
1458
|
return o.length - a.length;
|
|
1494
1459
|
}
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1460
|
+
const jn = [
|
|
1461
|
+
Cn,
|
|
1462
|
+
Nn,
|
|
1463
|
+
Vn,
|
|
1464
|
+
Ie,
|
|
1465
|
+
xn
|
|
1501
1466
|
];
|
|
1502
|
-
function
|
|
1503
|
-
const r =
|
|
1504
|
-
return e.filter((n) =>
|
|
1467
|
+
function $n(e, t) {
|
|
1468
|
+
const r = Hn(t);
|
|
1469
|
+
return e.filter((n) => jn.every((o) => o(n, t))).sort(r);
|
|
1505
1470
|
}
|
|
1506
|
-
function
|
|
1507
|
-
const n =
|
|
1471
|
+
function _n(e, t, r) {
|
|
1472
|
+
const n = $n(e, t);
|
|
1508
1473
|
if (!n.length)
|
|
1509
1474
|
return;
|
|
1510
|
-
const [o] = n, { searchParams: a, hash: s } =
|
|
1475
|
+
const [o] = n, { searchParams: a, hash: s } = q(t);
|
|
1511
1476
|
return {
|
|
1512
1477
|
id: o.id,
|
|
1513
1478
|
matched: o.matched,
|
|
1514
1479
|
matches: o.matches,
|
|
1515
1480
|
name: o.name,
|
|
1516
1481
|
query: Je(a),
|
|
1517
|
-
params:
|
|
1518
|
-
state:
|
|
1482
|
+
params: Ze(o, t),
|
|
1483
|
+
state: It(o.state, r),
|
|
1519
1484
|
hash: s,
|
|
1520
|
-
href:
|
|
1485
|
+
href: Pt(t)
|
|
1521
1486
|
};
|
|
1522
1487
|
}
|
|
1523
1488
|
function dt(e, t) {
|
|
1524
|
-
const r = typeof e == "string" ?
|
|
1489
|
+
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);
|
|
1525
1490
|
return Gt({
|
|
1526
|
-
protocol:
|
|
1527
|
-
host:
|
|
1528
|
-
pathname:
|
|
1529
|
-
searchParams:
|
|
1530
|
-
hash:
|
|
1491
|
+
protocol: J(n.protocol) ? n.protocol : r.protocol,
|
|
1492
|
+
host: J(n.host) ? n.host : r.host,
|
|
1493
|
+
pathname: J(n.pathname) ? n.pathname : r.pathname,
|
|
1494
|
+
searchParams: Xe(a, o),
|
|
1495
|
+
hash: J(n.hash) ? n.hash : r.hash
|
|
1531
1496
|
});
|
|
1532
1497
|
}
|
|
1533
|
-
function
|
|
1534
|
-
const r =
|
|
1535
|
-
|
|
1536
|
-
|
|
1498
|
+
function et(e, t) {
|
|
1499
|
+
const r = new RegExp(`\\${G}(\\??[\\w-_]+)\\${K}`, "g");
|
|
1500
|
+
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
1501
|
+
const f = Ee(a);
|
|
1502
|
+
if (!f)
|
|
1503
|
+
return o;
|
|
1504
|
+
const u = qr(t, f);
|
|
1505
|
+
return ie([f], o), o[s] = u, o;
|
|
1506
|
+
}, {});
|
|
1507
|
+
}
|
|
1508
|
+
function Oe(e, t) {
|
|
1509
|
+
return {
|
|
1510
|
+
value: e,
|
|
1511
|
+
params: et(e, t)
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
function qn(e, t) {
|
|
1515
|
+
return J(t) ? e.map((r) => {
|
|
1516
|
+
const n = `${t}${r.path.value}`;
|
|
1517
|
+
return {
|
|
1518
|
+
...r,
|
|
1519
|
+
path: Oe(n, r.path.params)
|
|
1520
|
+
};
|
|
1521
|
+
}) : e;
|
|
1522
|
+
}
|
|
1523
|
+
class In extends Error {
|
|
1524
|
+
/**
|
|
1525
|
+
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1526
|
+
* @param name - The name of the name that was duplicated.
|
|
1527
|
+
*/
|
|
1528
|
+
constructor(t) {
|
|
1529
|
+
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
function On(e) {
|
|
1533
|
+
const t = e.map(({ name: r }) => r);
|
|
1534
|
+
for (const r of t)
|
|
1535
|
+
if (St(t, r) > 1)
|
|
1536
|
+
throw new In(r);
|
|
1537
|
+
}
|
|
1538
|
+
function Dn(e, t = [], r) {
|
|
1539
|
+
const n = [
|
|
1540
|
+
...e,
|
|
1541
|
+
...t.map((o) => o.routes)
|
|
1542
|
+
].flat();
|
|
1543
|
+
return On(n), qn(n, r);
|
|
1544
|
+
}
|
|
1545
|
+
function Fn(e = {}, t = []) {
|
|
1546
|
+
const r = new Z();
|
|
1547
|
+
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;
|
|
1548
|
+
}
|
|
1549
|
+
function ee(e, t, r) {
|
|
1550
|
+
return [
|
|
1551
|
+
t[e],
|
|
1552
|
+
...r.map((o) => o[e])
|
|
1553
|
+
].flat().filter((o) => o !== void 0);
|
|
1554
|
+
}
|
|
1555
|
+
function ho(e, t, r = []) {
|
|
1556
|
+
const n = Dn(e, r, t == null ? void 0 : t.base), o = rn();
|
|
1557
|
+
o.addGlobalRouteHooks(Fn(t, r));
|
|
1558
|
+
const a = Ge(), s = Kn(), f = hn(), u = Kr({
|
|
1537
1559
|
mode: t == null ? void 0 : t.historyMode,
|
|
1538
1560
|
listener: ({ location: b }) => {
|
|
1539
1561
|
const U = X(b);
|
|
1540
|
-
|
|
1562
|
+
l(U, { state: b.state, replace: !0 });
|
|
1541
1563
|
}
|
|
1542
|
-
})
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
} = un();
|
|
1551
|
-
function E(b, U = {}) {
|
|
1552
|
-
return Tn(n, b, U.state);
|
|
1553
|
-
}
|
|
1554
|
-
async function k(b, U = {}) {
|
|
1555
|
-
const Q = o();
|
|
1556
|
-
if (c.stopListening(), nt(b)) {
|
|
1557
|
-
c.update(b, U);
|
|
1564
|
+
});
|
|
1565
|
+
function c(b, U = {}) {
|
|
1566
|
+
return _n(n, b, U.state);
|
|
1567
|
+
}
|
|
1568
|
+
async function l(b, U = {}) {
|
|
1569
|
+
const W = a();
|
|
1570
|
+
if (u.stopListening(), g(b)) {
|
|
1571
|
+
u.update(b, U);
|
|
1558
1572
|
return;
|
|
1559
1573
|
}
|
|
1560
|
-
const
|
|
1561
|
-
switch (
|
|
1574
|
+
const O = c(b, U) ?? p("NotFound"), $ = I(W), Q = await o.runBeforeRouteHooks({ to: O, from: $ });
|
|
1575
|
+
switch (Q.status) {
|
|
1562
1576
|
// On abort do nothing
|
|
1563
1577
|
case "ABORT":
|
|
1564
1578
|
return;
|
|
1565
1579
|
// On push update the history, and push new route, and return
|
|
1566
1580
|
case "PUSH":
|
|
1567
|
-
|
|
1581
|
+
u.update(b, U), await E(...Q.to);
|
|
1568
1582
|
return;
|
|
1569
1583
|
// On reject update the history, the route, and set the rejection type
|
|
1570
1584
|
case "REJECT":
|
|
1571
|
-
|
|
1585
|
+
u.update(b, U), y(Q.type);
|
|
1572
1586
|
break;
|
|
1573
1587
|
// On success update history, set the route, and clear the rejection
|
|
1574
1588
|
case "SUCCESS":
|
|
1575
|
-
|
|
1589
|
+
u.update(b, U), y(null);
|
|
1576
1590
|
break;
|
|
1577
1591
|
default:
|
|
1578
|
-
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(
|
|
1592
|
+
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(Q)}`);
|
|
1579
1593
|
}
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
if (
|
|
1594
|
+
const je = W;
|
|
1595
|
+
s.setProps(O).then((D) => {
|
|
1596
|
+
if (je === W)
|
|
1583
1597
|
switch (D.status) {
|
|
1584
1598
|
case "SUCCESS":
|
|
1585
1599
|
break;
|
|
1586
1600
|
case "PUSH":
|
|
1587
|
-
|
|
1601
|
+
E(...D.to);
|
|
1588
1602
|
break;
|
|
1589
1603
|
case "REJECT":
|
|
1590
|
-
|
|
1604
|
+
y(D.type);
|
|
1591
1605
|
break;
|
|
1592
1606
|
default:
|
|
1593
|
-
const
|
|
1594
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
1607
|
+
const $e = D;
|
|
1608
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify($e)}`);
|
|
1595
1609
|
}
|
|
1596
|
-
}),
|
|
1597
|
-
const
|
|
1598
|
-
switch (
|
|
1610
|
+
}), S(O);
|
|
1611
|
+
const F = await o.runAfterRouteHooks({ to: O, from: $ });
|
|
1612
|
+
switch (F.status) {
|
|
1599
1613
|
case "PUSH":
|
|
1600
|
-
await
|
|
1614
|
+
await E(...F.to);
|
|
1601
1615
|
break;
|
|
1602
1616
|
case "REJECT":
|
|
1603
|
-
|
|
1617
|
+
y(F.type);
|
|
1604
1618
|
break;
|
|
1605
1619
|
case "SUCCESS":
|
|
1606
1620
|
break;
|
|
1607
1621
|
default:
|
|
1608
|
-
const D =
|
|
1622
|
+
const D = F;
|
|
1609
1623
|
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(D)}`);
|
|
1610
1624
|
}
|
|
1611
|
-
|
|
1612
|
-
}
|
|
1613
|
-
const
|
|
1614
|
-
const
|
|
1615
|
-
if (!
|
|
1616
|
-
throw new
|
|
1617
|
-
return
|
|
1618
|
-
},
|
|
1625
|
+
u.startListening();
|
|
1626
|
+
}
|
|
1627
|
+
const v = (b, U = {}, W = {}) => {
|
|
1628
|
+
const O = n.find(($) => $.name === b);
|
|
1629
|
+
if (!O)
|
|
1630
|
+
throw new pn(String(b));
|
|
1631
|
+
return Bn(O, U, W);
|
|
1632
|
+
}, E = (b, U, W) => {
|
|
1619
1633
|
if (T(b)) {
|
|
1620
|
-
const
|
|
1621
|
-
searchParams:
|
|
1622
|
-
hash:
|
|
1634
|
+
const F = { ...U }, D = dt(b, {
|
|
1635
|
+
searchParams: F.query,
|
|
1636
|
+
hash: F.hash
|
|
1623
1637
|
});
|
|
1624
|
-
return
|
|
1638
|
+
return l(D, F);
|
|
1625
1639
|
}
|
|
1626
1640
|
if (typeof b == "string") {
|
|
1627
|
-
const { replace:
|
|
1628
|
-
return
|
|
1641
|
+
const { replace: F, ...D } = { ...W }, $e = { ...U }, _e = v(b, $e, D), ur = ft({ ..._e.matched.state }, { ..._e.state, ...D.state });
|
|
1642
|
+
return l(_e.href, { replace: F, state: ur });
|
|
1629
1643
|
}
|
|
1630
|
-
const { replace:
|
|
1644
|
+
const { replace: O, ...$ } = { ...U }, Q = ft({ ...b.matched.state }, { ...b.state, ...$.state }), je = dt(b.href, {
|
|
1631
1645
|
searchParams: $.query,
|
|
1632
1646
|
hash: $.hash
|
|
1633
1647
|
});
|
|
1634
|
-
return
|
|
1635
|
-
},
|
|
1648
|
+
return l(je, { replace: O, state: Q });
|
|
1649
|
+
}, P = (b, U, W) => {
|
|
1636
1650
|
if (T(b)) {
|
|
1637
1651
|
const $ = { ...U, replace: !0 };
|
|
1638
|
-
return
|
|
1652
|
+
return E(b, $);
|
|
1639
1653
|
}
|
|
1640
1654
|
if (typeof b == "string") {
|
|
1641
|
-
const $ = { ...
|
|
1642
|
-
return
|
|
1655
|
+
const $ = { ...W, replace: !0 }, Q = { ...U };
|
|
1656
|
+
return E(b, Q, $);
|
|
1643
1657
|
}
|
|
1644
|
-
const
|
|
1645
|
-
return
|
|
1646
|
-
},
|
|
1647
|
-
|
|
1648
|
-
}, { setRejection:
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1658
|
+
const O = { ...U, replace: !0 };
|
|
1659
|
+
return E(b, O);
|
|
1660
|
+
}, m = (b) => {
|
|
1661
|
+
y(b);
|
|
1662
|
+
}, { setRejection: y, rejection: i, getRejectionRoute: p } = sn({
|
|
1663
|
+
...r.reduce((b, U) => ({ ...b, ...U.rejections }), {}),
|
|
1664
|
+
...t == null ? void 0 : t.rejections
|
|
1665
|
+
}), A = p("NotFound"), { currentRoute: R, routerRoute: w, updateRoute: S } = Jr(A, E), k = un(t == null ? void 0 : t.initialUrl), d = u.location.state, { host: h } = q(k), g = zr(h);
|
|
1666
|
+
let x = !1;
|
|
1667
|
+
const { promise: L, resolve: B } = Promise.withResolvers();
|
|
1668
|
+
async function C() {
|
|
1669
|
+
if (x)
|
|
1670
|
+
return L;
|
|
1671
|
+
x = !0, await l(k, { replace: !0, state: d }), u.startListening(), B();
|
|
1672
|
+
}
|
|
1673
|
+
function j() {
|
|
1674
|
+
u.stopListening();
|
|
1675
|
+
}
|
|
1676
|
+
function I(b) {
|
|
1677
|
+
return an(b) ? null : { ...R };
|
|
1678
|
+
}
|
|
1679
|
+
function ot(b) {
|
|
1680
|
+
b.component("RouterView", co), b.component("RouterLink", ro), b.provide(Nt, i), b.provide(_t, o), b.provide(rr, s), b.provide(Ot, f), b.provide(bt, at), C();
|
|
1681
|
+
}
|
|
1682
|
+
const at = {
|
|
1683
|
+
route: w,
|
|
1684
|
+
resolve: v,
|
|
1685
|
+
find: c,
|
|
1686
|
+
push: E,
|
|
1687
|
+
replace: P,
|
|
1688
|
+
reject: m,
|
|
1689
|
+
refresh: u.refresh,
|
|
1690
|
+
forward: u.forward,
|
|
1691
|
+
back: u.back,
|
|
1692
|
+
go: u.go,
|
|
1693
|
+
install: ot,
|
|
1694
|
+
isExternal: g,
|
|
1695
|
+
onBeforeRouteEnter: o.onBeforeRouteEnter,
|
|
1696
|
+
onBeforeRouteUpdate: o.onBeforeRouteUpdate,
|
|
1697
|
+
onBeforeRouteLeave: o.onBeforeRouteLeave,
|
|
1698
|
+
onAfterRouteEnter: o.onAfterRouteEnter,
|
|
1699
|
+
onAfterRouteUpdate: o.onAfterRouteUpdate,
|
|
1700
|
+
onAfterRouteLeave: o.onAfterRouteLeave,
|
|
1680
1701
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
1681
|
-
start:
|
|
1702
|
+
start: C,
|
|
1703
|
+
stop: j
|
|
1682
1704
|
};
|
|
1683
|
-
return
|
|
1705
|
+
return at;
|
|
1684
1706
|
}
|
|
1685
|
-
function
|
|
1707
|
+
function pt(e, t) {
|
|
1686
1708
|
return {
|
|
1687
1709
|
value: e,
|
|
1688
|
-
params:
|
|
1710
|
+
params: et(e, t)
|
|
1689
1711
|
};
|
|
1690
1712
|
}
|
|
1691
|
-
function
|
|
1713
|
+
function po(e) {
|
|
1714
|
+
return {
|
|
1715
|
+
routes: e.routes ?? [],
|
|
1716
|
+
rejections: e.rejections ?? {},
|
|
1717
|
+
...e
|
|
1718
|
+
};
|
|
1719
|
+
}
|
|
1720
|
+
function Qt(e, t) {
|
|
1692
1721
|
return {
|
|
1693
1722
|
value: e,
|
|
1694
|
-
params:
|
|
1723
|
+
params: et(e, t)
|
|
1695
1724
|
};
|
|
1696
1725
|
}
|
|
1697
|
-
function
|
|
1698
|
-
return
|
|
1726
|
+
function Mn(e) {
|
|
1727
|
+
return ve(e) && typeof e.hash == "string";
|
|
1699
1728
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return e === void 0 ?
|
|
1729
|
+
function zt(e) {
|
|
1730
|
+
return e === void 0 ? Se() : Mn(e) ? e : Se(e);
|
|
1702
1731
|
}
|
|
1703
|
-
function
|
|
1732
|
+
function Kt(e) {
|
|
1704
1733
|
return e === void 0 ? "" : e;
|
|
1705
1734
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1735
|
+
function Tn(e) {
|
|
1736
|
+
return ve(e) && typeof e.value == "string";
|
|
1708
1737
|
}
|
|
1709
|
-
function
|
|
1710
|
-
return e === void 0 ?
|
|
1738
|
+
function Yt(e) {
|
|
1739
|
+
return e === void 0 ? Oe("", {}) : Tn(e) ? e : Oe(e, {});
|
|
1711
1740
|
}
|
|
1712
|
-
function
|
|
1713
|
-
return
|
|
1741
|
+
function Wn(e) {
|
|
1742
|
+
return ve(e) && typeof e.value == "string";
|
|
1714
1743
|
}
|
|
1715
|
-
function
|
|
1716
|
-
return e === void 0 ?
|
|
1744
|
+
function Xt(e) {
|
|
1745
|
+
return e === void 0 ? pt("", {}) : Wn(e) ? e : pt(e, {});
|
|
1717
1746
|
}
|
|
1718
|
-
function
|
|
1719
|
-
const t = Qe(), r =
|
|
1747
|
+
function se(e) {
|
|
1748
|
+
const t = Qe(), r = Kt(e.name), n = Yt(e.path), o = Xt(e.query), a = zt(e.hash), s = e.meta ?? {}, f = Hr(e) ? e.state : {}, u = be({ id: t, meta: {}, state: {}, ...e }), c = {
|
|
1720
1749
|
id: t,
|
|
1721
|
-
matched:
|
|
1722
|
-
matches: [
|
|
1750
|
+
matched: u,
|
|
1751
|
+
matches: [u],
|
|
1723
1752
|
name: r,
|
|
1724
1753
|
path: n,
|
|
1725
1754
|
query: o,
|
|
1726
1755
|
hash: a,
|
|
1727
1756
|
meta: s,
|
|
1728
|
-
state:
|
|
1757
|
+
state: f,
|
|
1729
1758
|
depth: 1,
|
|
1730
|
-
host:
|
|
1759
|
+
host: Qt("", {}),
|
|
1731
1760
|
prefetch: e.prefetch
|
|
1732
|
-
},
|
|
1733
|
-
return
|
|
1761
|
+
}, l = At(e) ? kt(e.parent, c) : c;
|
|
1762
|
+
return ie(l.path.params, l.query.params), l;
|
|
1734
1763
|
}
|
|
1735
|
-
const
|
|
1764
|
+
const Ce = { template: "<div>This is component</div>" }, tt = se({
|
|
1736
1765
|
name: "parentA",
|
|
1737
1766
|
path: "/parentA/[paramA]"
|
|
1738
|
-
}),
|
|
1739
|
-
parent:
|
|
1767
|
+
}), Zt = se({
|
|
1768
|
+
parent: tt,
|
|
1740
1769
|
name: "parentA.childA",
|
|
1741
|
-
path: "/[?paramB]"
|
|
1742
|
-
}),
|
|
1743
|
-
parent:
|
|
1770
|
+
path: "/childA/[?paramB]"
|
|
1771
|
+
}), Jn = se({
|
|
1772
|
+
parent: tt,
|
|
1744
1773
|
name: "parentA.childB",
|
|
1745
|
-
path: "/[paramD]",
|
|
1746
|
-
component:
|
|
1747
|
-
}), Gn =
|
|
1748
|
-
parent:
|
|
1774
|
+
path: "/childB/[paramD]",
|
|
1775
|
+
component: Ce
|
|
1776
|
+
}), Gn = se({
|
|
1777
|
+
parent: Zt,
|
|
1749
1778
|
name: "parentA.childA.grandChildA",
|
|
1750
1779
|
path: "/[paramC]",
|
|
1751
|
-
component:
|
|
1780
|
+
component: Ce
|
|
1752
1781
|
});
|
|
1753
|
-
|
|
1782
|
+
se({
|
|
1754
1783
|
name: "parentB",
|
|
1755
1784
|
path: "/parentB",
|
|
1756
|
-
component:
|
|
1757
|
-
}),
|
|
1785
|
+
component: Ce
|
|
1786
|
+
}), se({
|
|
1758
1787
|
name: "parentC",
|
|
1759
1788
|
path: "/",
|
|
1760
|
-
component:
|
|
1789
|
+
component: Ce
|
|
1761
1790
|
});
|
|
1762
|
-
const
|
|
1791
|
+
const Qn = "lazy", zn = {
|
|
1763
1792
|
components: !0,
|
|
1764
1793
|
props: !1
|
|
1765
1794
|
};
|
|
1766
|
-
function
|
|
1795
|
+
function Pe(e) {
|
|
1767
1796
|
return ["eager", "lazy", "intent"].includes(e);
|
|
1768
1797
|
}
|
|
1769
|
-
function
|
|
1770
|
-
const o =
|
|
1798
|
+
function er({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
|
|
1799
|
+
const o = qe(r, n), a = qe(t, n), s = qe(e, n), f = [
|
|
1771
1800
|
o,
|
|
1772
1801
|
a,
|
|
1773
1802
|
s,
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
].reduce((
|
|
1777
|
-
return
|
|
1803
|
+
zn[n],
|
|
1804
|
+
Qn
|
|
1805
|
+
].reduce((u, c) => Pe(u) ? u : u === !0 && Pe(c) ? c : u === !0 && !Pe(c) ? u : u === void 0 ? c : u, void 0);
|
|
1806
|
+
return Pe(f) ? f : !1;
|
|
1778
1807
|
}
|
|
1779
|
-
function
|
|
1780
|
-
return
|
|
1808
|
+
function qe(e, t) {
|
|
1809
|
+
return ve(e) ? e[t] : e;
|
|
1781
1810
|
}
|
|
1782
|
-
function
|
|
1811
|
+
function tr(e) {
|
|
1783
1812
|
return typeof e == "object" && e !== null && "then" in e;
|
|
1784
1813
|
}
|
|
1785
|
-
function
|
|
1814
|
+
function mt(e) {
|
|
1786
1815
|
try {
|
|
1787
1816
|
const t = e();
|
|
1788
|
-
return
|
|
1817
|
+
return tr(t) ? t.catch((r) => r) : t;
|
|
1789
1818
|
} catch (t) {
|
|
1790
1819
|
return t;
|
|
1791
1820
|
}
|
|
1792
1821
|
}
|
|
1793
|
-
const
|
|
1794
|
-
function
|
|
1795
|
-
const e =
|
|
1796
|
-
if (!
|
|
1797
|
-
return
|
|
1798
|
-
const
|
|
1822
|
+
const rr = Symbol();
|
|
1823
|
+
function Kn() {
|
|
1824
|
+
const e = Ne(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = $t(), o = (v, E, P) => E.matches.filter((m) => er({ ...P, routePrefetch: m.prefetch }, "props") === v).flatMap((m) => c(m)).reduce((m, { id: y, name: i, props: p }) => {
|
|
1825
|
+
if (!p)
|
|
1826
|
+
return m;
|
|
1827
|
+
const A = u(y, i, E), R = mt(() => p(E, {
|
|
1799
1828
|
push: t,
|
|
1800
1829
|
replace: r,
|
|
1801
1830
|
reject: n
|
|
1802
1831
|
}));
|
|
1803
|
-
return
|
|
1804
|
-
}, {}), a = (
|
|
1805
|
-
Object.entries(
|
|
1806
|
-
e.set(
|
|
1832
|
+
return m[A] = R, m;
|
|
1833
|
+
}, {}), a = (v) => {
|
|
1834
|
+
Object.entries(v).forEach(([E, P]) => {
|
|
1835
|
+
e.set(E, P);
|
|
1807
1836
|
});
|
|
1808
|
-
}, s = async (
|
|
1809
|
-
const
|
|
1810
|
-
for (const { id:
|
|
1811
|
-
if (!
|
|
1837
|
+
}, s = async (v) => {
|
|
1838
|
+
const E = v.matches.flatMap(c), P = [], m = [];
|
|
1839
|
+
for (const { id: y, name: i, props: p } of E) {
|
|
1840
|
+
if (!p)
|
|
1812
1841
|
continue;
|
|
1813
|
-
const
|
|
1814
|
-
if (
|
|
1815
|
-
const
|
|
1842
|
+
const A = u(y, i, v);
|
|
1843
|
+
if (P.push(A), !e.has(A)) {
|
|
1844
|
+
const R = mt(() => p(v, {
|
|
1816
1845
|
push: t,
|
|
1817
1846
|
replace: r,
|
|
1818
1847
|
reject: n
|
|
1819
1848
|
}));
|
|
1820
|
-
e.set(
|
|
1849
|
+
e.set(A, R);
|
|
1821
1850
|
}
|
|
1822
|
-
|
|
1823
|
-
const
|
|
1824
|
-
if (
|
|
1825
|
-
throw
|
|
1851
|
+
m.push((async () => {
|
|
1852
|
+
const R = await e.get(A);
|
|
1853
|
+
if (R instanceof Error)
|
|
1854
|
+
throw R;
|
|
1826
1855
|
})());
|
|
1827
1856
|
}
|
|
1828
|
-
|
|
1857
|
+
l(P);
|
|
1829
1858
|
try {
|
|
1830
|
-
return await Promise.all(
|
|
1831
|
-
} catch (
|
|
1832
|
-
if (
|
|
1833
|
-
return
|
|
1834
|
-
throw
|
|
1859
|
+
return await Promise.all(m), { status: "SUCCESS" };
|
|
1860
|
+
} catch (y) {
|
|
1861
|
+
if (y instanceof ne || y instanceof Le)
|
|
1862
|
+
return y.response;
|
|
1863
|
+
throw y;
|
|
1835
1864
|
}
|
|
1836
|
-
},
|
|
1837
|
-
const
|
|
1838
|
-
return e.get(
|
|
1865
|
+
}, f = (v, E, P) => {
|
|
1866
|
+
const m = u(v, E, P);
|
|
1867
|
+
return e.get(m);
|
|
1839
1868
|
};
|
|
1840
|
-
function
|
|
1841
|
-
return [
|
|
1869
|
+
function u(v, E, P) {
|
|
1870
|
+
return [v, E, P.id, JSON.stringify(P.params)].join("-");
|
|
1842
1871
|
}
|
|
1843
|
-
function
|
|
1844
|
-
return
|
|
1872
|
+
function c(v) {
|
|
1873
|
+
return Te(v) ? Object.entries(v.props ?? {}).map(([E, P]) => ({ id: v.id, name: E, props: P })) : Me(v) ? [
|
|
1845
1874
|
{
|
|
1846
|
-
id:
|
|
1875
|
+
id: v.id,
|
|
1847
1876
|
name: "default",
|
|
1848
|
-
props:
|
|
1877
|
+
props: v.props
|
|
1849
1878
|
}
|
|
1850
1879
|
] : [];
|
|
1851
1880
|
}
|
|
1852
|
-
function
|
|
1853
|
-
for (const
|
|
1854
|
-
|
|
1881
|
+
function l(v) {
|
|
1882
|
+
for (const E in e.keys())
|
|
1883
|
+
v.includes(E) || e.delete(E);
|
|
1855
1884
|
}
|
|
1856
1885
|
return {
|
|
1857
1886
|
getPrefetchProps: o,
|
|
1858
1887
|
setPrefetchProps: a,
|
|
1859
|
-
getProps:
|
|
1888
|
+
getProps: f,
|
|
1860
1889
|
setProps: s
|
|
1861
1890
|
};
|
|
1862
1891
|
}
|
|
1863
|
-
function
|
|
1864
|
-
const e =
|
|
1892
|
+
function nr() {
|
|
1893
|
+
const e = ce(rr);
|
|
1865
1894
|
if (!e)
|
|
1866
|
-
throw new
|
|
1895
|
+
throw new Re();
|
|
1867
1896
|
return e;
|
|
1868
1897
|
}
|
|
1869
|
-
const
|
|
1898
|
+
const Yn = hr(() => new Promise((e) => {
|
|
1870
1899
|
e({ default: { template: "foo" } });
|
|
1871
1900
|
}));
|
|
1872
|
-
function
|
|
1873
|
-
return e.name ===
|
|
1901
|
+
function Rt(e) {
|
|
1902
|
+
return e.name === Yn.name && "__asyncLoader" in e;
|
|
1874
1903
|
}
|
|
1875
1904
|
function vt(e, t, r) {
|
|
1876
|
-
|
|
1905
|
+
le(e, (n, o) => {
|
|
1877
1906
|
n && n.addEventListener(t, r), o && o.removeEventListener(t, r);
|
|
1878
|
-
}, { immediate: !0 }),
|
|
1907
|
+
}, { immediate: !0 }), Ve(() => {
|
|
1879
1908
|
e.value && e.value.removeEventListener(t, r);
|
|
1880
1909
|
});
|
|
1881
1910
|
}
|
|
1882
|
-
function
|
|
1883
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
1884
|
-
const
|
|
1885
|
-
o(
|
|
1911
|
+
function Xn(e) {
|
|
1912
|
+
const t = /* @__PURE__ */ new Map(), r = De(), { getPrefetchProps: n, setPrefetchProps: o } = nr(), { isElementVisible: a } = dn(r), s = () => {
|
|
1913
|
+
const c = Array.from(t.values()).reduce((l, v) => (Object.assign(l, v), l), {});
|
|
1914
|
+
o(c);
|
|
1886
1915
|
};
|
|
1887
|
-
|
|
1888
|
-
t.clear(),
|
|
1889
|
-
}, { immediate: !0 }),
|
|
1890
|
-
const { route:
|
|
1891
|
-
!
|
|
1892
|
-
}, { immediate: !0 }), vt(r, "focusin",
|
|
1893
|
-
function
|
|
1894
|
-
const { route:
|
|
1895
|
-
|
|
1896
|
-
}
|
|
1897
|
-
function
|
|
1898
|
-
|
|
1916
|
+
le(() => H(e), ({ route: c, ...l }) => {
|
|
1917
|
+
t.clear(), c && u("eager", c, l);
|
|
1918
|
+
}, { immediate: !0 }), le(a, (c) => {
|
|
1919
|
+
const { route: l, ...v } = H(e);
|
|
1920
|
+
!l || !c || u("lazy", l, v);
|
|
1921
|
+
}, { immediate: !0 }), vt(r, "focusin", f), vt(r, "mouseover", f);
|
|
1922
|
+
function f() {
|
|
1923
|
+
const { route: c, ...l } = H(e);
|
|
1924
|
+
c && u("intent", c, l);
|
|
1925
|
+
}
|
|
1926
|
+
function u(c, l, v) {
|
|
1927
|
+
Zn(c, l, v), t.has(c) || t.set(c, n(c, l, v));
|
|
1899
1928
|
}
|
|
1900
1929
|
return {
|
|
1901
1930
|
element: r,
|
|
1902
1931
|
commit: s
|
|
1903
1932
|
};
|
|
1904
1933
|
}
|
|
1905
|
-
function
|
|
1934
|
+
function Zn(e, t, r) {
|
|
1906
1935
|
t.matches.forEach((n) => {
|
|
1907
|
-
|
|
1936
|
+
er({
|
|
1908
1937
|
...r,
|
|
1909
1938
|
routePrefetch: n.prefetch
|
|
1910
|
-
}, "components") === e && (
|
|
1911
|
-
|
|
1939
|
+
}, "components") === e && (Me(n) && Rt(n.component) && n.component.__asyncLoader(), Te(n) && Object.values(n.components).forEach((a) => {
|
|
1940
|
+
Rt(a) && a.__asyncLoader();
|
|
1912
1941
|
}));
|
|
1913
1942
|
});
|
|
1914
1943
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return
|
|
1944
|
+
function or(e, t, { exact: r } = {}) {
|
|
1945
|
+
return Tr(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
|
|
1917
1946
|
}
|
|
1918
|
-
function
|
|
1919
|
-
const n =
|
|
1920
|
-
const
|
|
1921
|
-
return typeof
|
|
1947
|
+
function eo(e, t = {}, r = {}) {
|
|
1948
|
+
const n = Fe(), o = N(() => {
|
|
1949
|
+
const m = H(e);
|
|
1950
|
+
return typeof m != "string" ? m : T(m) ? n.find(m, H(r)) : n.resolve(m, H(t), H(r));
|
|
1922
1951
|
}), a = N(() => {
|
|
1923
1952
|
if (o.value)
|
|
1924
1953
|
return o.value.href;
|
|
1925
|
-
const
|
|
1926
|
-
if (T(
|
|
1927
|
-
return
|
|
1954
|
+
const m = H(e);
|
|
1955
|
+
if (T(m))
|
|
1956
|
+
return m;
|
|
1928
1957
|
console.error(new Error("Failed to resolve route in RouterLink."));
|
|
1929
|
-
}), s = N(() =>
|
|
1930
|
-
var
|
|
1931
|
-
return
|
|
1932
|
-
})),
|
|
1933
|
-
var
|
|
1934
|
-
return n.route.id === ((
|
|
1935
|
-
}),
|
|
1936
|
-
const
|
|
1937
|
-
return typeof
|
|
1938
|
-
}), { element:
|
|
1958
|
+
}), s = N(() => or(n.route) && n.route.matches.some((m) => {
|
|
1959
|
+
var y;
|
|
1960
|
+
return m.id === ((y = o.value) == null ? void 0 : y.id);
|
|
1961
|
+
})), f = N(() => {
|
|
1962
|
+
var m;
|
|
1963
|
+
return n.route.id === ((m = o.value) == null ? void 0 : m.id);
|
|
1964
|
+
}), u = N(() => !!a.value && n.isExternal(a.value)), c = N(() => {
|
|
1965
|
+
const m = H(e);
|
|
1966
|
+
return typeof m != "string" || T(m) ? H(t) : H(r);
|
|
1967
|
+
}), { element: l, commit: v } = Xn(() => ({
|
|
1939
1968
|
route: o.value,
|
|
1940
1969
|
routerPrefetch: n.prefetch,
|
|
1941
|
-
linkPrefetch:
|
|
1942
|
-
})),
|
|
1943
|
-
|
|
1944
|
-
const
|
|
1945
|
-
replace: (
|
|
1946
|
-
query:
|
|
1947
|
-
hash: (
|
|
1948
|
-
state: { ...
|
|
1949
|
-
},
|
|
1950
|
-
return T(
|
|
1970
|
+
linkPrefetch: c.value.prefetch
|
|
1971
|
+
})), E = (m) => {
|
|
1972
|
+
v();
|
|
1973
|
+
const y = {
|
|
1974
|
+
replace: (m == null ? void 0 : m.replace) ?? c.value.replace,
|
|
1975
|
+
query: Xe(c.value.query, m == null ? void 0 : m.query),
|
|
1976
|
+
hash: (m == null ? void 0 : m.hash) ?? c.value.hash,
|
|
1977
|
+
state: { ...c.value.state, ...m == null ? void 0 : m.state }
|
|
1978
|
+
}, i = H(e);
|
|
1979
|
+
return T(i) || typeof i == "object" ? n.push(i, y) : n.push(i, H(t), y);
|
|
1951
1980
|
};
|
|
1952
1981
|
return {
|
|
1953
|
-
element:
|
|
1982
|
+
element: l,
|
|
1954
1983
|
route: o,
|
|
1955
1984
|
href: a,
|
|
1956
1985
|
isMatch: s,
|
|
1957
|
-
isExactMatch:
|
|
1958
|
-
isExternal:
|
|
1959
|
-
push:
|
|
1960
|
-
replace: (
|
|
1986
|
+
isExactMatch: f,
|
|
1987
|
+
isExternal: u,
|
|
1988
|
+
push: E,
|
|
1989
|
+
replace: (m) => E({ ...m, replace: !0 })
|
|
1961
1990
|
};
|
|
1962
1991
|
}
|
|
1963
|
-
const
|
|
1992
|
+
const to = ["href"], ro = /* @__PURE__ */ ue({
|
|
1964
1993
|
__name: "routerLink",
|
|
1965
1994
|
props: {
|
|
1966
1995
|
to: {},
|
|
@@ -1971,177 +2000,178 @@ const no = ["href"], oo = /* @__PURE__ */ se({
|
|
|
1971
2000
|
state: {}
|
|
1972
2001
|
},
|
|
1973
2002
|
setup(e) {
|
|
1974
|
-
const t = e, r =
|
|
1975
|
-
const { to:
|
|
1976
|
-
return
|
|
1977
|
-
}), { element: s, isMatch:
|
|
1978
|
-
"router-link--match":
|
|
1979
|
-
"router-link--exact-match":
|
|
2003
|
+
const t = e, r = Fe(), n = N(() => E(t.to)), o = N(() => P(t.to)), a = N(() => {
|
|
2004
|
+
const { to: y, ...i } = t;
|
|
2005
|
+
return i;
|
|
2006
|
+
}), { element: s, isMatch: f, isExactMatch: u, isExternal: c, push: l } = eo(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), v = N(() => ({
|
|
2007
|
+
"router-link--match": f.value,
|
|
2008
|
+
"router-link--exact-match": u.value
|
|
1980
2009
|
}));
|
|
1981
|
-
function
|
|
1982
|
-
if (typeof
|
|
1983
|
-
const
|
|
1984
|
-
return
|
|
2010
|
+
function E(y) {
|
|
2011
|
+
if (typeof y == "function") {
|
|
2012
|
+
const i = y(r.resolve);
|
|
2013
|
+
return E(i);
|
|
1985
2014
|
}
|
|
1986
|
-
return T(
|
|
2015
|
+
return T(y) ? r.find(y) : y;
|
|
1987
2016
|
}
|
|
1988
|
-
function
|
|
1989
|
-
if (typeof
|
|
1990
|
-
const
|
|
1991
|
-
return
|
|
2017
|
+
function P(y) {
|
|
2018
|
+
if (typeof y == "function") {
|
|
2019
|
+
const i = y(r.resolve);
|
|
2020
|
+
return P(i);
|
|
1992
2021
|
}
|
|
1993
|
-
return T(
|
|
2022
|
+
return T(y) ? y : y == null ? void 0 : y.href;
|
|
1994
2023
|
}
|
|
1995
|
-
function
|
|
1996
|
-
|
|
2024
|
+
function m(y) {
|
|
2025
|
+
y.preventDefault(), l();
|
|
1997
2026
|
}
|
|
1998
|
-
return (
|
|
2027
|
+
return (y, i) => (gt(), dr("a", {
|
|
1999
2028
|
ref_key: "element",
|
|
2000
2029
|
ref: s,
|
|
2001
2030
|
href: o.value,
|
|
2002
|
-
class:
|
|
2003
|
-
onClick:
|
|
2031
|
+
class: pr(["router-link", v.value]),
|
|
2032
|
+
onClick: m
|
|
2004
2033
|
}, [
|
|
2005
|
-
|
|
2006
|
-
], 10,
|
|
2034
|
+
wt(y.$slots, "default", Et(mr({ route: n.value, isMatch: fe(f), isExactMatch: fe(u), isExternal: fe(c) })))
|
|
2035
|
+
], 10, to));
|
|
2007
2036
|
}
|
|
2008
2037
|
});
|
|
2009
|
-
function
|
|
2010
|
-
const r =
|
|
2038
|
+
function no(e, t) {
|
|
2039
|
+
const r = Fe();
|
|
2011
2040
|
function n() {
|
|
2012
2041
|
if (!e)
|
|
2013
2042
|
return;
|
|
2014
|
-
if (!
|
|
2015
|
-
throw new
|
|
2043
|
+
if (!or(r.route, e, t))
|
|
2044
|
+
throw new Ar(e, r.route.name);
|
|
2016
2045
|
}
|
|
2017
|
-
return
|
|
2046
|
+
return le(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
2018
2047
|
}
|
|
2019
|
-
const
|
|
2020
|
-
function
|
|
2021
|
-
return
|
|
2048
|
+
const ar = Symbol();
|
|
2049
|
+
function rt() {
|
|
2050
|
+
return ce(ar, 0);
|
|
2022
2051
|
}
|
|
2023
|
-
function
|
|
2024
|
-
return
|
|
2052
|
+
function oo(e, t) {
|
|
2053
|
+
return ue({
|
|
2025
2054
|
name: "PropsWrapper",
|
|
2026
2055
|
expose: [],
|
|
2027
2056
|
setup() {
|
|
2028
|
-
const r = t(), n =
|
|
2029
|
-
return () => r instanceof Error ? "" :
|
|
2057
|
+
const r = t(), n = Rr();
|
|
2058
|
+
return () => r instanceof Error ? "" : tr(r) ? n != null && n.suspense ? te(so(e, r)) : te(ao(e, r)) : te(e, r);
|
|
2030
2059
|
}
|
|
2031
2060
|
});
|
|
2032
2061
|
}
|
|
2033
|
-
function
|
|
2034
|
-
return
|
|
2062
|
+
function ao(e, t) {
|
|
2063
|
+
return ue({
|
|
2035
2064
|
name: "AsyncPropsWrapper",
|
|
2036
2065
|
expose: [],
|
|
2037
2066
|
setup() {
|
|
2038
|
-
const r =
|
|
2039
|
-
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ?
|
|
2067
|
+
const r = De();
|
|
2068
|
+
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ? te(e, r.value) : "";
|
|
2040
2069
|
}
|
|
2041
2070
|
});
|
|
2042
2071
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return
|
|
2072
|
+
function so(e, t) {
|
|
2073
|
+
return ue({
|
|
2045
2074
|
name: "SuspenseAsyncPropsWrapper",
|
|
2046
2075
|
expose: [],
|
|
2047
2076
|
async setup() {
|
|
2048
2077
|
const r = await t;
|
|
2049
|
-
return () =>
|
|
2078
|
+
return () => te(e, r);
|
|
2050
2079
|
}
|
|
2051
2080
|
});
|
|
2052
2081
|
}
|
|
2053
|
-
const
|
|
2082
|
+
const co = /* @__PURE__ */ ue({
|
|
2054
2083
|
__name: "routerView",
|
|
2055
2084
|
props: {
|
|
2056
2085
|
name: { default: "default" }
|
|
2057
2086
|
},
|
|
2058
2087
|
setup(e) {
|
|
2059
|
-
const t =
|
|
2060
|
-
|
|
2088
|
+
const t = no(), r = Mr(), n = rt(), { getProps: o } = nr(), a = vr("RouterView", !0);
|
|
2089
|
+
yr(ar, n + 1);
|
|
2061
2090
|
const s = N(() => {
|
|
2062
2091
|
if (r.value)
|
|
2063
2092
|
return r.value.component;
|
|
2064
|
-
const
|
|
2065
|
-
if (!
|
|
2093
|
+
const c = t.matches.at(n);
|
|
2094
|
+
if (!c)
|
|
2066
2095
|
return null;
|
|
2067
|
-
const
|
|
2068
|
-
return
|
|
2096
|
+
const l = f(c), v = o(c.id, e.name, t);
|
|
2097
|
+
return l ? v ? oo(l, () => v) : l : null;
|
|
2069
2098
|
});
|
|
2070
|
-
function c
|
|
2071
|
-
return
|
|
2099
|
+
function f(c) {
|
|
2100
|
+
return u(c)[e.name];
|
|
2072
2101
|
}
|
|
2073
|
-
function
|
|
2074
|
-
return
|
|
2102
|
+
function u(c) {
|
|
2103
|
+
return Te(c) ? c.components : Me(c) ? { default: c.component } : typeof a == "string" ? {} : { default: a };
|
|
2075
2104
|
}
|
|
2076
|
-
return (
|
|
2077
|
-
(
|
|
2078
|
-
]) :
|
|
2105
|
+
return (c, l) => s.value ? wt(c.$slots, "default", Et(gr({ key: 0 }, { route: fe(t), component: s.value, rejection: fe(r) })), () => [
|
|
2106
|
+
(gt(), wr(Er(s.value)))
|
|
2107
|
+
]) : Pr("", !0);
|
|
2079
2108
|
}
|
|
2080
2109
|
});
|
|
2081
|
-
function
|
|
2082
|
-
const e =
|
|
2110
|
+
function sr() {
|
|
2111
|
+
const e = ce(_t);
|
|
2083
2112
|
if (!e)
|
|
2084
|
-
throw new
|
|
2113
|
+
throw new Re();
|
|
2085
2114
|
return e;
|
|
2086
2115
|
}
|
|
2087
|
-
function
|
|
2116
|
+
function cr(e) {
|
|
2088
2117
|
return (t) => {
|
|
2089
|
-
const r =
|
|
2090
|
-
return
|
|
2118
|
+
const r = rt(), o = sr().addComponentBeforeRouteHook({ lifecycle: e, hook: t, depth: r });
|
|
2119
|
+
return Ve(o), o;
|
|
2091
2120
|
};
|
|
2092
2121
|
}
|
|
2093
|
-
function
|
|
2122
|
+
function nt(e) {
|
|
2094
2123
|
return (t) => {
|
|
2095
|
-
const r =
|
|
2096
|
-
return
|
|
2124
|
+
const r = rt(), o = sr().addComponentAfterRouteHook({ lifecycle: e, hook: t, depth: r });
|
|
2125
|
+
return Ve(o), o;
|
|
2097
2126
|
};
|
|
2098
2127
|
}
|
|
2099
|
-
const
|
|
2100
|
-
function
|
|
2101
|
-
return
|
|
2128
|
+
const mo = cr("onBeforeRouteUpdate"), Ro = cr("onBeforeRouteLeave"), vo = nt("onAfterRouteEnter"), yo = nt("onAfterRouteUpdate"), go = nt("onAfterRouteLeave");
|
|
2129
|
+
function uo(e) {
|
|
2130
|
+
return ve(e) && typeof e.value == "string";
|
|
2102
2131
|
}
|
|
2103
|
-
function
|
|
2104
|
-
return
|
|
2132
|
+
function yt(e) {
|
|
2133
|
+
return uo(e) ? e : Qt(e, {});
|
|
2105
2134
|
}
|
|
2106
|
-
function
|
|
2107
|
-
const t = Qe(), r =
|
|
2135
|
+
function wo(e) {
|
|
2136
|
+
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) ? yt(e.host) : yt(""), u = be({ id: t, meta: {}, state: {}, ...e }), c = {
|
|
2108
2137
|
id: t,
|
|
2109
|
-
matched:
|
|
2110
|
-
matches: [
|
|
2138
|
+
matched: u,
|
|
2139
|
+
matches: [u],
|
|
2111
2140
|
name: r,
|
|
2112
|
-
host:
|
|
2141
|
+
host: f,
|
|
2113
2142
|
path: n,
|
|
2114
2143
|
query: o,
|
|
2115
2144
|
hash: a,
|
|
2116
2145
|
meta: s,
|
|
2117
2146
|
depth: 1,
|
|
2118
2147
|
state: {}
|
|
2119
|
-
},
|
|
2120
|
-
return
|
|
2148
|
+
}, l = At(e) ? kt(e.parent, c) : c;
|
|
2149
|
+
return ie(l.path.params, l.query.params, l.host.params), l;
|
|
2121
2150
|
}
|
|
2122
2151
|
export {
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2152
|
+
br as DuplicateParamsError,
|
|
2153
|
+
Sr as MetaPropertyConflict,
|
|
2154
|
+
ro as RouterLink,
|
|
2155
|
+
Re as RouterNotInstalledError,
|
|
2156
|
+
co as RouterView,
|
|
2157
|
+
Ar as UseRouteInvalidError,
|
|
2158
|
+
Pt as asUrl,
|
|
2159
|
+
wo as createExternalRoute,
|
|
2160
|
+
Or as createParam,
|
|
2161
|
+
se as createRoute,
|
|
2162
|
+
ho as createRouter,
|
|
2163
|
+
po as createRouterPlugin,
|
|
2164
|
+
or as isRoute,
|
|
2135
2165
|
T as isUrl,
|
|
2136
2166
|
vo as onAfterRouteEnter,
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2167
|
+
yo as onAfterRouteLeave,
|
|
2168
|
+
go as onAfterRouteUpdate,
|
|
2169
|
+
mo as onBeforeRouteLeave,
|
|
2170
|
+
Ro as onBeforeRouteUpdate,
|
|
2171
|
+
Oe as path,
|
|
2172
|
+
pt as query,
|
|
2173
|
+
eo as useLink,
|
|
2174
|
+
no as useRoute,
|
|
2175
|
+
Fe as useRouter,
|
|
2176
|
+
lo as withDefault
|
|
2147
2177
|
};
|