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