@argon-router/core 0.6.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +77 -0
- package/dist/index.js +708 -654
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEffect as
|
|
2
|
-
function
|
|
1
|
+
import { createEffect as S, createStore as k, createEvent as g, sample as h, split as V, attach as K, scopeBind as N } from "effector";
|
|
2
|
+
function C(e, t) {
|
|
3
3
|
var r = Object.keys(e);
|
|
4
4
|
if (Object.getOwnPropertySymbols) {
|
|
5
5
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -9,25 +9,25 @@ function q(e, t) {
|
|
|
9
9
|
}
|
|
10
10
|
return r;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function P(e) {
|
|
13
13
|
for (var t = 1; t < arguments.length; t++) {
|
|
14
14
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
15
|
-
t % 2 ?
|
|
16
|
-
|
|
17
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
15
|
+
t % 2 ? C(Object(r), !0).forEach(function(n) {
|
|
16
|
+
ne(e, n, r[n]);
|
|
17
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : C(Object(r)).forEach(function(n) {
|
|
18
18
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return (t =
|
|
23
|
+
function ne(e, t, r) {
|
|
24
|
+
return (t = ae(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
var t =
|
|
26
|
+
function ae(e) {
|
|
27
|
+
var t = oe(e, "string");
|
|
28
28
|
return typeof t == "symbol" ? t : t + "";
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function oe(e, t) {
|
|
31
31
|
if (typeof e != "object" || !e) return e;
|
|
32
32
|
var r = e[Symbol.toPrimitive];
|
|
33
33
|
if (r !== void 0) {
|
|
@@ -37,62 +37,62 @@ function ce(e, t) {
|
|
|
37
37
|
}
|
|
38
38
|
return (t === "string" ? String : Number)(e);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ze(e) {
|
|
41
41
|
let t;
|
|
42
|
-
const r =
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
42
|
+
const r = S(() => {
|
|
43
|
+
var m;
|
|
44
|
+
return (m = t) === null || m === void 0 ? void 0 : m();
|
|
45
45
|
}, {
|
|
46
46
|
name: "waitForAsyncBundleFx",
|
|
47
47
|
sid: "-au0m0h"
|
|
48
|
-
}), n =
|
|
49
|
-
for (const
|
|
50
|
-
var
|
|
51
|
-
await
|
|
48
|
+
}), n = S(async () => {
|
|
49
|
+
for (const j of (m = e.beforeOpen) !== null && m !== void 0 ? m : []) {
|
|
50
|
+
var m;
|
|
51
|
+
await j();
|
|
52
52
|
}
|
|
53
53
|
}, {
|
|
54
54
|
name: "beforeOpenFx",
|
|
55
55
|
sid: "-iy13uf"
|
|
56
|
-
}), a =
|
|
56
|
+
}), a = S(async (m) => {
|
|
57
57
|
await r(), await n();
|
|
58
|
-
const
|
|
59
|
-
return
|
|
58
|
+
const j = e.parent;
|
|
59
|
+
return j && await j.internal.openFx(P(P({}, m ?? {
|
|
60
60
|
params: {}
|
|
61
61
|
}), {}, {
|
|
62
62
|
navigate: !1
|
|
63
|
-
})),
|
|
63
|
+
})), m;
|
|
64
64
|
}, {
|
|
65
65
|
name: "openFx",
|
|
66
66
|
sid: "cbmc2y"
|
|
67
|
-
}), o =
|
|
67
|
+
}), o = k({}, {
|
|
68
68
|
name: "$params",
|
|
69
69
|
sid: "-cxehz9"
|
|
70
|
-
}), i =
|
|
70
|
+
}), i = k(!1, {
|
|
71
71
|
name: "$isOpened",
|
|
72
72
|
sid: "-561dht"
|
|
73
|
-
}), s = a.pending, c =
|
|
73
|
+
}), s = a.pending, c = g({
|
|
74
74
|
name: "open",
|
|
75
75
|
sid: "hyxmmx"
|
|
76
|
-
}),
|
|
76
|
+
}), d = g({
|
|
77
77
|
name: "close",
|
|
78
78
|
sid: "-wvbr5n"
|
|
79
|
-
}),
|
|
79
|
+
}), b = g({
|
|
80
80
|
name: "opened",
|
|
81
81
|
sid: "-qni80y"
|
|
82
|
-
}),
|
|
82
|
+
}), u = g({
|
|
83
83
|
name: "openedOnServer",
|
|
84
84
|
sid: "eh9oki"
|
|
85
|
-
}),
|
|
85
|
+
}), y = g({
|
|
86
86
|
name: "openedOnClient",
|
|
87
87
|
sid: "eet6mh"
|
|
88
|
-
}),
|
|
88
|
+
}), l = g({
|
|
89
89
|
name: "navigated",
|
|
90
90
|
sid: "-rnvpuc"
|
|
91
|
-
}),
|
|
91
|
+
}), f = g({
|
|
92
92
|
name: "closed",
|
|
93
93
|
sid: "w9iziz"
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
h({
|
|
96
96
|
and: [{
|
|
97
97
|
clock: c,
|
|
98
98
|
target: a
|
|
@@ -101,67 +101,67 @@ function _e(e) {
|
|
|
101
101
|
sid: "u86cfp"
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
const
|
|
105
|
-
return
|
|
104
|
+
const p = {};
|
|
105
|
+
return h({
|
|
106
106
|
and: [{
|
|
107
|
-
clock:
|
|
108
|
-
fn: (
|
|
107
|
+
clock: l,
|
|
108
|
+
fn: (m) => m && "params" in m ? P({}, m.params) : p,
|
|
109
109
|
target: o
|
|
110
110
|
}],
|
|
111
111
|
or: {
|
|
112
112
|
sid: "ymu9q6"
|
|
113
113
|
}
|
|
114
|
-
}),
|
|
114
|
+
}), V({
|
|
115
115
|
and: [{
|
|
116
|
-
source:
|
|
116
|
+
source: l,
|
|
117
117
|
match: () => typeof window > "u" ? "server" : "client",
|
|
118
118
|
cases: {
|
|
119
|
-
server:
|
|
120
|
-
client:
|
|
119
|
+
server: u,
|
|
120
|
+
client: y
|
|
121
121
|
}
|
|
122
122
|
}],
|
|
123
123
|
or: {
|
|
124
124
|
sid: "z4zhb3"
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
126
|
+
}), h({
|
|
127
127
|
and: [{
|
|
128
|
-
clock: [
|
|
129
|
-
target:
|
|
128
|
+
clock: [y, u],
|
|
129
|
+
target: b
|
|
130
130
|
}],
|
|
131
131
|
or: {
|
|
132
132
|
sid: "-zf2y9u"
|
|
133
133
|
}
|
|
134
|
-
}),
|
|
134
|
+
}), h({
|
|
135
135
|
and: [{
|
|
136
|
-
clock:
|
|
137
|
-
target:
|
|
136
|
+
clock: d,
|
|
137
|
+
target: f
|
|
138
138
|
}],
|
|
139
139
|
or: {
|
|
140
140
|
sid: "-z0saug"
|
|
141
141
|
}
|
|
142
|
-
}),
|
|
142
|
+
}), h({
|
|
143
143
|
and: [{
|
|
144
|
-
clock: [
|
|
144
|
+
clock: [b.map(() => !0), f.map(() => !1)],
|
|
145
145
|
target: i
|
|
146
146
|
}],
|
|
147
147
|
or: {
|
|
148
148
|
sid: "-yy1bvn"
|
|
149
149
|
}
|
|
150
|
-
}),
|
|
150
|
+
}), P(P({
|
|
151
151
|
$params: o,
|
|
152
152
|
$isOpened: i,
|
|
153
153
|
$isPending: s,
|
|
154
154
|
open: c,
|
|
155
|
-
closed:
|
|
156
|
-
opened:
|
|
157
|
-
openedOnClient:
|
|
158
|
-
openedOnServer:
|
|
155
|
+
closed: f,
|
|
156
|
+
opened: b,
|
|
157
|
+
openedOnClient: y,
|
|
158
|
+
openedOnServer: u
|
|
159
159
|
}, e), {}, {
|
|
160
160
|
internal: {
|
|
161
|
-
navigated:
|
|
162
|
-
close:
|
|
161
|
+
navigated: l,
|
|
162
|
+
close: d,
|
|
163
163
|
openFx: a,
|
|
164
|
-
setAsyncImport: (
|
|
164
|
+
setAsyncImport: (m) => t = m
|
|
165
165
|
},
|
|
166
166
|
"@@unitShape": () => ({
|
|
167
167
|
params: o,
|
|
@@ -171,20 +171,20 @@ function _e(e) {
|
|
|
171
171
|
})
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
any:
|
|
176
|
-
number:
|
|
177
|
-
string:
|
|
178
|
-
array:
|
|
179
|
-
boolean:
|
|
174
|
+
const ie = Symbol("any"), se = Symbol("number"), ce = Symbol("string"), ue = Symbol("array"), fe = Symbol("boolean"), w = {
|
|
175
|
+
any: ie,
|
|
176
|
+
number: se,
|
|
177
|
+
string: ce,
|
|
178
|
+
array: ue,
|
|
179
|
+
boolean: fe
|
|
180
180
|
};
|
|
181
|
-
function
|
|
181
|
+
function D(e, t) {
|
|
182
182
|
for (const r of e)
|
|
183
183
|
if (t.includes(r))
|
|
184
184
|
return !0;
|
|
185
185
|
return !1;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function z(e, t) {
|
|
188
188
|
for (const r in t) {
|
|
189
189
|
const n = t[r];
|
|
190
190
|
if (Array.isArray(n) && (!e[r] || JSON.stringify(n) !== e[r]))
|
|
@@ -212,27 +212,27 @@ function T(e, t) {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
switch (n) {
|
|
215
|
-
case
|
|
215
|
+
case w.any: {
|
|
216
216
|
if (!e[r])
|
|
217
217
|
return !1;
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
|
-
case
|
|
220
|
+
case w.string: {
|
|
221
221
|
if (!e[r] || Array.isArray(e[r]))
|
|
222
222
|
return !1;
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
|
-
case
|
|
225
|
+
case w.array: {
|
|
226
226
|
if (!e[r] || !Array.isArray(e[r]))
|
|
227
227
|
return !1;
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
230
|
-
case
|
|
230
|
+
case w.number: {
|
|
231
231
|
if (!e[r] || Array.isArray(e[r]) || isNaN(parseInt(e[r])) && isNaN(parseFloat(e[r])))
|
|
232
232
|
return !1;
|
|
233
233
|
break;
|
|
234
234
|
}
|
|
235
|
-
case
|
|
235
|
+
case w.boolean: {
|
|
236
236
|
if (!e[r] || Array.isArray(e[r]) || !["0", "1", "false", "true"].includes(e[r]))
|
|
237
237
|
return !1;
|
|
238
238
|
break;
|
|
@@ -241,7 +241,7 @@ function T(e, t) {
|
|
|
241
241
|
}
|
|
242
242
|
return !0;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function le(e, t) {
|
|
245
245
|
const r = {};
|
|
246
246
|
for (const n in t) {
|
|
247
247
|
const a = t[n], o = e[n];
|
|
@@ -267,18 +267,18 @@ function me(e, t) {
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
switch (a) {
|
|
270
|
-
case
|
|
271
|
-
case
|
|
272
|
-
case
|
|
270
|
+
case w.any:
|
|
271
|
+
case w.string:
|
|
272
|
+
case w.array: {
|
|
273
273
|
r[n] = e[n];
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
|
-
case
|
|
276
|
+
case w.number: {
|
|
277
277
|
const i = e[n];
|
|
278
278
|
r[n] = isNaN(parseInt(i)) ? parseFloat(i) : parseInt(i);
|
|
279
279
|
break;
|
|
280
280
|
}
|
|
281
|
-
case
|
|
281
|
+
case w.boolean: {
|
|
282
282
|
const i = e[n];
|
|
283
283
|
r[n] = i === "1" || i === "true";
|
|
284
284
|
break;
|
|
@@ -287,7 +287,21 @@ function me(e, t) {
|
|
|
287
287
|
}
|
|
288
288
|
return r;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function de(e) {
|
|
291
|
+
let {
|
|
292
|
+
$query: t,
|
|
293
|
+
navigate: r
|
|
294
|
+
} = e;
|
|
295
|
+
return L({
|
|
296
|
+
$activeRoutes: k([], {
|
|
297
|
+
name: "$activeRoutes",
|
|
298
|
+
sid: "7ol7tr"
|
|
299
|
+
}),
|
|
300
|
+
$query: t,
|
|
301
|
+
navigate: r
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
function L(e) {
|
|
291
305
|
let {
|
|
292
306
|
$activeRoutes: t,
|
|
293
307
|
$query: r,
|
|
@@ -297,86 +311,86 @@ function ye(e) {
|
|
|
297
311
|
const {
|
|
298
312
|
parameters: o,
|
|
299
313
|
forRoutes: i
|
|
300
|
-
} = a, s =
|
|
314
|
+
} = a, s = k(!1, {
|
|
301
315
|
name: "$entered",
|
|
302
|
-
sid: "
|
|
303
|
-
}), c =
|
|
316
|
+
sid: "-okbvx4"
|
|
317
|
+
}), c = g({
|
|
304
318
|
name: "entered",
|
|
305
|
-
sid: "-
|
|
306
|
-
}),
|
|
319
|
+
sid: "-1bbi51"
|
|
320
|
+
}), d = g({
|
|
307
321
|
name: "exited",
|
|
308
|
-
sid: "
|
|
309
|
-
}),
|
|
322
|
+
sid: "-lw34uy"
|
|
323
|
+
}), b = g({
|
|
310
324
|
name: "exit",
|
|
311
|
-
sid: "
|
|
312
|
-
}),
|
|
325
|
+
sid: "5l9ghz"
|
|
326
|
+
}), u = g({
|
|
313
327
|
name: "changeEntered",
|
|
314
|
-
sid: "
|
|
328
|
+
sid: "en4cc0"
|
|
315
329
|
});
|
|
316
|
-
return
|
|
330
|
+
return h({
|
|
317
331
|
and: [{
|
|
318
|
-
clock:
|
|
332
|
+
clock: u,
|
|
319
333
|
target: s
|
|
320
334
|
}],
|
|
321
335
|
or: {
|
|
322
|
-
sid: "-
|
|
336
|
+
sid: "-gssa85"
|
|
323
337
|
}
|
|
324
|
-
}),
|
|
338
|
+
}), h({
|
|
325
339
|
and: [{
|
|
326
340
|
source: {
|
|
327
341
|
activeRoutes: t,
|
|
328
342
|
query: r
|
|
329
343
|
},
|
|
330
|
-
filter: (
|
|
344
|
+
filter: (y) => {
|
|
331
345
|
let {
|
|
332
|
-
activeRoutes:
|
|
333
|
-
query:
|
|
334
|
-
} =
|
|
335
|
-
return (!i ||
|
|
346
|
+
activeRoutes: l,
|
|
347
|
+
query: f
|
|
348
|
+
} = y;
|
|
349
|
+
return (!i || D(i, l)) && z(f, o);
|
|
336
350
|
},
|
|
337
|
-
fn: (
|
|
351
|
+
fn: (y) => {
|
|
338
352
|
let {
|
|
339
|
-
query:
|
|
340
|
-
} =
|
|
341
|
-
return
|
|
353
|
+
query: l
|
|
354
|
+
} = y;
|
|
355
|
+
return le(l, o);
|
|
342
356
|
},
|
|
343
|
-
target: [c,
|
|
357
|
+
target: [c, u.prepend(() => !0)]
|
|
344
358
|
}],
|
|
345
359
|
or: {
|
|
346
|
-
sid: "-
|
|
360
|
+
sid: "-gehmsr"
|
|
347
361
|
}
|
|
348
|
-
}),
|
|
362
|
+
}), h({
|
|
349
363
|
and: [{
|
|
350
364
|
source: {
|
|
351
365
|
activeRoutes: t,
|
|
352
366
|
query: r,
|
|
353
367
|
entered: s
|
|
354
368
|
},
|
|
355
|
-
filter: (
|
|
369
|
+
filter: (y) => {
|
|
356
370
|
let {
|
|
357
|
-
activeRoutes:
|
|
358
|
-
query:
|
|
359
|
-
entered:
|
|
360
|
-
} =
|
|
361
|
-
return
|
|
371
|
+
activeRoutes: l,
|
|
372
|
+
query: f,
|
|
373
|
+
entered: p
|
|
374
|
+
} = y;
|
|
375
|
+
return p && !((!i || D(i, l)) && z(f, o));
|
|
362
376
|
},
|
|
363
|
-
target: [
|
|
364
|
-
}),
|
|
377
|
+
target: [d.prepend(() => {
|
|
378
|
+
}), u.prepend(() => !1)]
|
|
365
379
|
}],
|
|
366
380
|
or: {
|
|
367
|
-
sid: "-
|
|
381
|
+
sid: "-fxzszx"
|
|
368
382
|
}
|
|
369
|
-
}),
|
|
383
|
+
}), h({
|
|
370
384
|
and: [{
|
|
371
|
-
clock:
|
|
385
|
+
clock: b,
|
|
372
386
|
source: r,
|
|
373
|
-
fn: (
|
|
374
|
-
if (
|
|
375
|
-
const
|
|
376
|
-
for (const
|
|
377
|
-
|
|
387
|
+
fn: (y, l) => {
|
|
388
|
+
if (l && l.ignoreParams) {
|
|
389
|
+
const f = {};
|
|
390
|
+
for (const p of l.ignoreParams)
|
|
391
|
+
y[p] && (f[p] = y[p]);
|
|
378
392
|
return {
|
|
379
|
-
query:
|
|
393
|
+
query: f
|
|
380
394
|
};
|
|
381
395
|
}
|
|
382
396
|
return {
|
|
@@ -386,17 +400,251 @@ function ye(e) {
|
|
|
386
400
|
target: n
|
|
387
401
|
}],
|
|
388
402
|
or: {
|
|
389
|
-
sid: "-
|
|
403
|
+
sid: "-fer08a"
|
|
390
404
|
}
|
|
391
405
|
}), {
|
|
392
406
|
entered: c,
|
|
393
|
-
exited:
|
|
394
|
-
exit:
|
|
407
|
+
exited: d,
|
|
408
|
+
exit: b
|
|
395
409
|
};
|
|
396
410
|
};
|
|
397
411
|
}
|
|
398
|
-
|
|
399
|
-
|
|
412
|
+
function pe(e) {
|
|
413
|
+
return (t) => {
|
|
414
|
+
const r = t.split("/").map((s) => s.trim()).filter((s) => s !== "");
|
|
415
|
+
let n = null;
|
|
416
|
+
function a(s, c) {
|
|
417
|
+
n || (n = {}), n[s] = c;
|
|
418
|
+
}
|
|
419
|
+
if (e.length === 0) return r.length === 0 ? {
|
|
420
|
+
path: t,
|
|
421
|
+
params: null
|
|
422
|
+
} : null;
|
|
423
|
+
for (let s = 0; s < e.length; s++) {
|
|
424
|
+
const c = e[s];
|
|
425
|
+
switch (c.type) {
|
|
426
|
+
case "const": {
|
|
427
|
+
if (c.name !== r.shift()) return null;
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
case "parameter": {
|
|
431
|
+
const {
|
|
432
|
+
arrayProps: d,
|
|
433
|
+
genericProps: b,
|
|
434
|
+
required: u
|
|
435
|
+
} = c.payload;
|
|
436
|
+
if (d) {
|
|
437
|
+
var o;
|
|
438
|
+
const l = [];
|
|
439
|
+
let f;
|
|
440
|
+
for (; ; ) {
|
|
441
|
+
var i;
|
|
442
|
+
if (f = r.shift(), !f) break;
|
|
443
|
+
switch (b == null ? void 0 : b.type) {
|
|
444
|
+
case "number": {
|
|
445
|
+
if (isNaN(+f)) return null;
|
|
446
|
+
l.push(+f);
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
case "union": {
|
|
450
|
+
if (!b.items.includes(f)) return null;
|
|
451
|
+
l.push(f);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
default: {
|
|
455
|
+
l.push(f);
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (l.length >= ((i = d.max) !== null && i !== void 0 ? i : 1 / 0)) break;
|
|
460
|
+
}
|
|
461
|
+
if (l.length < ((o = d.min) !== null && o !== void 0 ? o : 0) || r.length > 0 && !e[s + 1]) return null;
|
|
462
|
+
a(c.name, l);
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
const y = r.shift();
|
|
466
|
+
if (u && !y) return null;
|
|
467
|
+
if (!y) {
|
|
468
|
+
a(c.name, void 0);
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
switch (b == null ? void 0 : b.type) {
|
|
472
|
+
case "number": {
|
|
473
|
+
if (isNaN(+y)) return null;
|
|
474
|
+
a(c.name, +y);
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
case "union": {
|
|
478
|
+
if (!b.items.includes(y)) return null;
|
|
479
|
+
a(c.name, y);
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
default: {
|
|
483
|
+
a(c.name, y);
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return r.length > 0 ? null : {
|
|
491
|
+
path: t,
|
|
492
|
+
params: n
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
function me(e) {
|
|
497
|
+
if (!e) return null;
|
|
498
|
+
const t = e[1];
|
|
499
|
+
let r, n, a;
|
|
500
|
+
for (const o of e.slice(2)) if (o) {
|
|
501
|
+
if (o.includes("<")) {
|
|
502
|
+
r = o.replace("<", "").replace(">", "");
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (o.includes("{") && (n = o.replace("{", "").replace("}", "").split(",").map((i) => parseInt(i))), ["*", "?", "+"].includes(o)) {
|
|
506
|
+
a = o;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return {
|
|
511
|
+
name: t,
|
|
512
|
+
genericProps: r,
|
|
513
|
+
arrayProps: n,
|
|
514
|
+
modificator: a
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function ye(e) {
|
|
518
|
+
return (t) => {
|
|
519
|
+
const r = [];
|
|
520
|
+
if (e.length === 0) return "/";
|
|
521
|
+
for (const n of e) switch (n.type) {
|
|
522
|
+
case "const": {
|
|
523
|
+
r.push(n.name);
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
case "parameter": {
|
|
527
|
+
if (!t[n.name]) continue;
|
|
528
|
+
if (Array.isArray(t[n.name])) for (const a of t[n.name]) r.push(a.toString());
|
|
529
|
+
else r.push(t[n.name].toString());
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return "/".concat(r.join("/"));
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
function q(e, t) {
|
|
537
|
+
var r = Object.keys(e);
|
|
538
|
+
if (Object.getOwnPropertySymbols) {
|
|
539
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
540
|
+
t && (n = n.filter(function(a) {
|
|
541
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
542
|
+
})), r.push.apply(r, n);
|
|
543
|
+
}
|
|
544
|
+
return r;
|
|
545
|
+
}
|
|
546
|
+
function U(e) {
|
|
547
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
548
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
549
|
+
t % 2 ? q(Object(r), !0).forEach(function(n) {
|
|
550
|
+
be(e, n, r[n]);
|
|
551
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : q(Object(r)).forEach(function(n) {
|
|
552
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
return e;
|
|
556
|
+
}
|
|
557
|
+
function be(e, t, r) {
|
|
558
|
+
return (t = ge(t)) in e ? Object.defineProperty(e, t, {
|
|
559
|
+
value: r,
|
|
560
|
+
enumerable: !0,
|
|
561
|
+
configurable: !0,
|
|
562
|
+
writable: !0
|
|
563
|
+
}) : e[t] = r, e;
|
|
564
|
+
}
|
|
565
|
+
function ge(e) {
|
|
566
|
+
var t = he(e, "string");
|
|
567
|
+
return typeof t == "symbol" ? t : t + "";
|
|
568
|
+
}
|
|
569
|
+
function he(e, t) {
|
|
570
|
+
if (typeof e != "object" || !e) return e;
|
|
571
|
+
var r = e[Symbol.toPrimitive];
|
|
572
|
+
if (r !== void 0) {
|
|
573
|
+
var n = r.call(e, t);
|
|
574
|
+
if (typeof n != "object") return n;
|
|
575
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
576
|
+
}
|
|
577
|
+
return (t === "string" ? String : Number)(e);
|
|
578
|
+
}
|
|
579
|
+
function Oe(e) {
|
|
580
|
+
const t = [], r = /:(\w+)(<[\w|]+>)?({\d+\,\d+})?([+*?])?/, n = e.split("/").filter(Boolean);
|
|
581
|
+
for (let a = 0; a < n.length; a++) {
|
|
582
|
+
const o = n[a];
|
|
583
|
+
if (!o) continue;
|
|
584
|
+
const i = me(o.match(r));
|
|
585
|
+
if (!i) {
|
|
586
|
+
t.push({
|
|
587
|
+
type: "const",
|
|
588
|
+
name: o,
|
|
589
|
+
payload: void 0
|
|
590
|
+
});
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
const {
|
|
594
|
+
arrayProps: s,
|
|
595
|
+
genericProps: c,
|
|
596
|
+
modificator: d,
|
|
597
|
+
name: b
|
|
598
|
+
} = i;
|
|
599
|
+
if (!b) throw new Error('Invalid path: "'.concat(e, '". Name for argument must be provided'));
|
|
600
|
+
const u = {
|
|
601
|
+
type: "parameter",
|
|
602
|
+
name: b,
|
|
603
|
+
payload: {
|
|
604
|
+
required: !0
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
switch (c && c === "number" && (u.payload.genericProps = {
|
|
608
|
+
type: "number"
|
|
609
|
+
}), c && c.includes("|") && (u.payload.genericProps = {
|
|
610
|
+
type: "union",
|
|
611
|
+
items: c.split("|")
|
|
612
|
+
}), d) {
|
|
613
|
+
case "*": {
|
|
614
|
+
u.payload.arrayProps = {};
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
case "+": {
|
|
618
|
+
u.payload.arrayProps = {
|
|
619
|
+
min: 1
|
|
620
|
+
};
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
case "?": {
|
|
624
|
+
u.payload.required = !1;
|
|
625
|
+
break;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
s && (u.payload.arrayProps = U(U({}, u.payload.arrayProps), {}, {
|
|
629
|
+
min: s[0],
|
|
630
|
+
max: s[1]
|
|
631
|
+
})), t.push(u);
|
|
632
|
+
}
|
|
633
|
+
return {
|
|
634
|
+
/**
|
|
635
|
+
* @param input Input path
|
|
636
|
+
* @returns `{ path: string; params: Params }` | `null`
|
|
637
|
+
*/
|
|
638
|
+
parse: pe(t),
|
|
639
|
+
/**
|
|
640
|
+
* @param params Route parameters
|
|
641
|
+
* @returns string
|
|
642
|
+
*/
|
|
643
|
+
build: ye(t)
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
const M = "%[a-f0-9]{2}", B = new RegExp("(" + M + ")|([^%]+?)", "gi"), _ = new RegExp("(" + M + ")+", "gi");
|
|
647
|
+
function A(e, t) {
|
|
400
648
|
try {
|
|
401
649
|
return [decodeURIComponent(e.join(""))];
|
|
402
650
|
} catch {
|
|
@@ -405,32 +653,32 @@ function D(e, t) {
|
|
|
405
653
|
return e;
|
|
406
654
|
t = t || 1;
|
|
407
655
|
const r = e.slice(0, t), n = e.slice(t);
|
|
408
|
-
return Array.prototype.concat.call([],
|
|
656
|
+
return Array.prototype.concat.call([], A(r), A(n));
|
|
409
657
|
}
|
|
410
|
-
function
|
|
658
|
+
function we(e) {
|
|
411
659
|
try {
|
|
412
660
|
return decodeURIComponent(e);
|
|
413
661
|
} catch {
|
|
414
|
-
let t = e.match(
|
|
662
|
+
let t = e.match(B) || [];
|
|
415
663
|
for (let r = 1; r < t.length; r++)
|
|
416
|
-
e =
|
|
664
|
+
e = A(t, r).join(""), t = e.match(B) || [];
|
|
417
665
|
return e;
|
|
418
666
|
}
|
|
419
667
|
}
|
|
420
|
-
function
|
|
668
|
+
function Fe(e) {
|
|
421
669
|
const t = {
|
|
422
670
|
"%FE%FF": "��",
|
|
423
671
|
"%FF%FE": "��"
|
|
424
672
|
};
|
|
425
|
-
let r =
|
|
673
|
+
let r = _.exec(e);
|
|
426
674
|
for (; r; ) {
|
|
427
675
|
try {
|
|
428
676
|
t[r[0]] = decodeURIComponent(r[0]);
|
|
429
677
|
} catch {
|
|
430
|
-
const a =
|
|
678
|
+
const a = we(r[0]);
|
|
431
679
|
a !== r[0] && (t[r[0]] = a);
|
|
432
680
|
}
|
|
433
|
-
r =
|
|
681
|
+
r = _.exec(e);
|
|
434
682
|
}
|
|
435
683
|
t["%C2"] = "�";
|
|
436
684
|
const n = Object.keys(t);
|
|
@@ -438,16 +686,16 @@ function ge(e) {
|
|
|
438
686
|
e = e.replace(new RegExp(a, "g"), t[a]);
|
|
439
687
|
return e;
|
|
440
688
|
}
|
|
441
|
-
function
|
|
689
|
+
function je(e) {
|
|
442
690
|
if (typeof e != "string")
|
|
443
691
|
throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof e + "`");
|
|
444
692
|
try {
|
|
445
693
|
return decodeURIComponent(e);
|
|
446
694
|
} catch {
|
|
447
|
-
return
|
|
695
|
+
return Fe(e);
|
|
448
696
|
}
|
|
449
697
|
}
|
|
450
|
-
function
|
|
698
|
+
function ke(e, t) {
|
|
451
699
|
const r = {};
|
|
452
700
|
if (Array.isArray(t))
|
|
453
701
|
for (const n of t) {
|
|
@@ -464,7 +712,7 @@ function Oe(e, t) {
|
|
|
464
712
|
}
|
|
465
713
|
return r;
|
|
466
714
|
}
|
|
467
|
-
function
|
|
715
|
+
function Q(e, t) {
|
|
468
716
|
if (!(typeof e == "string" && typeof t == "string"))
|
|
469
717
|
throw new TypeError("Expected the arguments to be of type `string`");
|
|
470
718
|
if (e === "" || t === "")
|
|
@@ -472,8 +720,8 @@ function W(e, t) {
|
|
|
472
720
|
const r = e.indexOf(t);
|
|
473
721
|
return r === -1 ? [] : [e.slice(0, r), e.slice(r + t.length)];
|
|
474
722
|
}
|
|
475
|
-
const
|
|
476
|
-
function
|
|
723
|
+
const Se = (e) => e == null, Pe = (e) => encodeURIComponent(e).replaceAll(/[!'()*]/g, (t) => `%${t.charCodeAt(0).toString(16).toUpperCase()}`), E = Symbol("encodeFragmentIdentifier");
|
|
724
|
+
function ve(e) {
|
|
477
725
|
switch (e.arrayFormat) {
|
|
478
726
|
case "index":
|
|
479
727
|
return (t) => (r, n) => {
|
|
@@ -494,7 +742,7 @@ function Fe(e) {
|
|
|
494
742
|
return (t) => (r, n) => n === void 0 || e.skipNull && n === null || e.skipEmptyString && n === "" ? r : n === null ? [...r, O(t, e)] : [...r, [O(t, e), "=", O(n, e)].join("")];
|
|
495
743
|
}
|
|
496
744
|
}
|
|
497
|
-
function
|
|
745
|
+
function xe(e) {
|
|
498
746
|
let t;
|
|
499
747
|
switch (e.arrayFormat) {
|
|
500
748
|
case "index":
|
|
@@ -532,19 +780,19 @@ function Se(e) {
|
|
|
532
780
|
case "comma":
|
|
533
781
|
case "separator":
|
|
534
782
|
return (r, n, a) => {
|
|
535
|
-
const o = typeof n == "string" && n.includes(e.arrayFormatSeparator), i = typeof n == "string" && !o &&
|
|
536
|
-
n = i ?
|
|
537
|
-
const s = o || i ? n.split(e.arrayFormatSeparator).map((c) =>
|
|
783
|
+
const o = typeof n == "string" && n.includes(e.arrayFormatSeparator), i = typeof n == "string" && !o && F(n, e).includes(e.arrayFormatSeparator);
|
|
784
|
+
n = i ? F(n, e) : n;
|
|
785
|
+
const s = o || i ? n.split(e.arrayFormatSeparator).map((c) => F(c, e)) : n === null ? n : F(n, e);
|
|
538
786
|
a[r] = s;
|
|
539
787
|
};
|
|
540
788
|
case "bracket-separator":
|
|
541
789
|
return (r, n, a) => {
|
|
542
790
|
const o = /(\[])$/.test(r);
|
|
543
791
|
if (r = r.replace(/\[]$/, ""), !o) {
|
|
544
|
-
a[r] = n &&
|
|
792
|
+
a[r] = n && F(n, e);
|
|
545
793
|
return;
|
|
546
794
|
}
|
|
547
|
-
const i = n === null ? [] :
|
|
795
|
+
const i = n === null ? [] : F(n, e).split(e.arrayFormatSeparator);
|
|
548
796
|
if (a[r] === void 0) {
|
|
549
797
|
a[r] = i;
|
|
550
798
|
return;
|
|
@@ -561,37 +809,37 @@ function Se(e) {
|
|
|
561
809
|
};
|
|
562
810
|
}
|
|
563
811
|
}
|
|
564
|
-
function
|
|
812
|
+
function J(e) {
|
|
565
813
|
if (typeof e != "string" || e.length !== 1)
|
|
566
814
|
throw new TypeError("arrayFormatSeparator must be single character string");
|
|
567
815
|
}
|
|
568
816
|
function O(e, t) {
|
|
569
|
-
return t.encode ? t.strict ?
|
|
817
|
+
return t.encode ? t.strict ? Pe(e) : encodeURIComponent(e) : e;
|
|
570
818
|
}
|
|
571
|
-
function
|
|
572
|
-
return t.decode ?
|
|
819
|
+
function F(e, t) {
|
|
820
|
+
return t.decode ? je(e) : e;
|
|
573
821
|
}
|
|
574
|
-
function
|
|
575
|
-
return Array.isArray(e) ? e.sort() : typeof e == "object" ?
|
|
822
|
+
function G(e) {
|
|
823
|
+
return Array.isArray(e) ? e.sort() : typeof e == "object" ? G(Object.keys(e)).sort((t, r) => Number(t) - Number(r)).map((t) => e[t]) : e;
|
|
576
824
|
}
|
|
577
|
-
function
|
|
825
|
+
function W(e) {
|
|
578
826
|
const t = e.indexOf("#");
|
|
579
827
|
return t !== -1 && (e = e.slice(0, t)), e;
|
|
580
828
|
}
|
|
581
|
-
function
|
|
829
|
+
function $e(e) {
|
|
582
830
|
let t = "";
|
|
583
831
|
const r = e.indexOf("#");
|
|
584
832
|
return r !== -1 && (t = e.slice(r)), t;
|
|
585
833
|
}
|
|
586
|
-
function
|
|
834
|
+
function T(e, t, r) {
|
|
587
835
|
return r === "string" && typeof e == "string" ? e : typeof r == "function" && typeof e == "string" ? r(e) : t.parseBooleans && e !== null && (e.toLowerCase() === "true" || e.toLowerCase() === "false") ? e.toLowerCase() === "true" : r === "number" && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" || t.parseNumbers && !Number.isNaN(Number(e)) && typeof e == "string" && e.trim() !== "" ? Number(e) : e;
|
|
588
836
|
}
|
|
589
|
-
function
|
|
590
|
-
e =
|
|
837
|
+
function R(e) {
|
|
838
|
+
e = W(e);
|
|
591
839
|
const t = e.indexOf("?");
|
|
592
840
|
return t === -1 ? "" : e.slice(t + 1);
|
|
593
841
|
}
|
|
594
|
-
function
|
|
842
|
+
function I(e, t) {
|
|
595
843
|
t = {
|
|
596
844
|
decode: !0,
|
|
597
845
|
sort: !0,
|
|
@@ -601,30 +849,30 @@ function U(e, t) {
|
|
|
601
849
|
parseBooleans: !1,
|
|
602
850
|
types: /* @__PURE__ */ Object.create(null),
|
|
603
851
|
...t
|
|
604
|
-
},
|
|
605
|
-
const r =
|
|
852
|
+
}, J(t.arrayFormatSeparator);
|
|
853
|
+
const r = xe(t), n = /* @__PURE__ */ Object.create(null);
|
|
606
854
|
if (typeof e != "string" || (e = e.trim().replace(/^[?#&]/, ""), !e))
|
|
607
855
|
return n;
|
|
608
856
|
for (const a of e.split("&")) {
|
|
609
857
|
if (a === "")
|
|
610
858
|
continue;
|
|
611
859
|
const o = t.decode ? a.replaceAll("+", " ") : a;
|
|
612
|
-
let [i, s] =
|
|
613
|
-
i === void 0 && (i = o), s = s === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? s :
|
|
860
|
+
let [i, s] = Q(o, "=");
|
|
861
|
+
i === void 0 && (i = o), s = s === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(t.arrayFormat) ? s : F(s, t), r(F(i, t), s, n);
|
|
614
862
|
}
|
|
615
863
|
for (const [a, o] of Object.entries(n))
|
|
616
864
|
if (typeof o == "object" && o !== null && t.types[a] !== "string")
|
|
617
865
|
for (const [i, s] of Object.entries(o)) {
|
|
618
866
|
const c = t.types[a] ? t.types[a].replace("[]", "") : void 0;
|
|
619
|
-
o[i] =
|
|
867
|
+
o[i] = T(s, t, c);
|
|
620
868
|
}
|
|
621
|
-
else typeof o == "object" && o !== null && t.types[a] === "string" ? n[a] = Object.values(o).join(t.arrayFormatSeparator) : n[a] =
|
|
869
|
+
else typeof o == "object" && o !== null && t.types[a] === "string" ? n[a] = Object.values(o).join(t.arrayFormatSeparator) : n[a] = T(o, t, t.types[a]);
|
|
622
870
|
return t.sort === !1 ? n : (t.sort === !0 ? Object.keys(n).sort() : Object.keys(n).sort(t.sort)).reduce((a, o) => {
|
|
623
871
|
const i = n[o];
|
|
624
|
-
return a[o] = i && typeof i == "object" && !Array.isArray(i) ?
|
|
872
|
+
return a[o] = i && typeof i == "object" && !Array.isArray(i) ? G(i) : i, a;
|
|
625
873
|
}, /* @__PURE__ */ Object.create(null));
|
|
626
874
|
}
|
|
627
|
-
function
|
|
875
|
+
function X(e, t) {
|
|
628
876
|
if (!e)
|
|
629
877
|
return "";
|
|
630
878
|
t = {
|
|
@@ -633,8 +881,8 @@ function ee(e, t) {
|
|
|
633
881
|
arrayFormat: "none",
|
|
634
882
|
arrayFormatSeparator: ",",
|
|
635
883
|
...t
|
|
636
|
-
},
|
|
637
|
-
const r = (i) => t.skipNull &&
|
|
884
|
+
}, J(t.arrayFormatSeparator);
|
|
885
|
+
const r = (i) => t.skipNull && Se(e[i]) || t.skipEmptyString && e[i] === "", n = ve(t), a = {};
|
|
638
886
|
for (const [i, s] of Object.entries(e))
|
|
639
887
|
r(i) || (a[i] = s);
|
|
640
888
|
const o = Object.keys(a);
|
|
@@ -643,199 +891,75 @@ function ee(e, t) {
|
|
|
643
891
|
return s === void 0 ? "" : s === null ? O(i, t) : Array.isArray(s) ? s.length === 0 && t.arrayFormat === "bracket-separator" ? O(i, t) + "[]" : s.reduce(n(i), []).join("&") : O(i, t) + "=" + O(s, t);
|
|
644
892
|
}).filter((i) => i.length > 0).join("&");
|
|
645
893
|
}
|
|
646
|
-
function
|
|
894
|
+
function Y(e, t) {
|
|
647
895
|
var a;
|
|
648
896
|
t = {
|
|
649
897
|
decode: !0,
|
|
650
898
|
...t
|
|
651
899
|
};
|
|
652
|
-
let [r, n] =
|
|
900
|
+
let [r, n] = Q(e, "#");
|
|
653
901
|
return r === void 0 && (r = e), {
|
|
654
902
|
url: ((a = r == null ? void 0 : r.split("?")) == null ? void 0 : a[0]) ?? "",
|
|
655
|
-
query:
|
|
903
|
+
query: I(R(e), t),
|
|
656
904
|
...t && t.parseFragmentIdentifier && n ? {
|
|
657
|
-
fragmentIdentifier:
|
|
905
|
+
fragmentIdentifier: F(n, t)
|
|
658
906
|
} : {}
|
|
659
907
|
};
|
|
660
908
|
}
|
|
661
|
-
function
|
|
909
|
+
function Z(e, t) {
|
|
662
910
|
t = {
|
|
663
911
|
encode: !0,
|
|
664
912
|
strict: !0,
|
|
665
|
-
[
|
|
913
|
+
[E]: !0,
|
|
666
914
|
...t
|
|
667
915
|
};
|
|
668
|
-
const r =
|
|
669
|
-
...
|
|
916
|
+
const r = W(e.url).split("?")[0] || "", n = R(e.url), a = {
|
|
917
|
+
...I(n, {
|
|
670
918
|
sort: !1
|
|
671
919
|
}),
|
|
672
920
|
...e.query
|
|
673
921
|
};
|
|
674
|
-
let o =
|
|
922
|
+
let o = X(a, t);
|
|
675
923
|
o && (o = `?${o}`);
|
|
676
|
-
let i =
|
|
924
|
+
let i = $e(e.url);
|
|
677
925
|
if (typeof e.fragmentIdentifier == "string") {
|
|
678
926
|
const s = new URL(r);
|
|
679
|
-
s.hash = e.fragmentIdentifier, i = t[
|
|
927
|
+
s.hash = e.fragmentIdentifier, i = t[E] ? s.hash : `#${e.fragmentIdentifier}`;
|
|
680
928
|
}
|
|
681
929
|
return `${r}${o}${i}`;
|
|
682
930
|
}
|
|
683
|
-
function
|
|
931
|
+
function ee(e, t, r) {
|
|
684
932
|
r = {
|
|
685
933
|
parseFragmentIdentifier: !0,
|
|
686
|
-
[
|
|
934
|
+
[E]: !1,
|
|
687
935
|
...r
|
|
688
936
|
};
|
|
689
937
|
const {
|
|
690
938
|
url: n,
|
|
691
939
|
query: a,
|
|
692
940
|
fragmentIdentifier: o
|
|
693
|
-
} =
|
|
694
|
-
return
|
|
941
|
+
} = Y(e, r);
|
|
942
|
+
return Z({
|
|
695
943
|
url: n,
|
|
696
|
-
query:
|
|
944
|
+
query: ke(a, t),
|
|
697
945
|
fragmentIdentifier: o
|
|
698
946
|
}, r);
|
|
699
947
|
}
|
|
700
|
-
function
|
|
948
|
+
function Ne(e, t, r) {
|
|
701
949
|
const n = Array.isArray(t) ? (a) => !t.includes(a) : (a, o) => !t(a, o);
|
|
702
|
-
return
|
|
950
|
+
return ee(e, n, r);
|
|
703
951
|
}
|
|
704
|
-
const
|
|
952
|
+
const x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
705
953
|
__proto__: null,
|
|
706
|
-
exclude:
|
|
707
|
-
extract:
|
|
708
|
-
parse:
|
|
709
|
-
parseUrl:
|
|
710
|
-
pick:
|
|
711
|
-
stringify:
|
|
712
|
-
stringifyUrl:
|
|
954
|
+
exclude: Ne,
|
|
955
|
+
extract: R,
|
|
956
|
+
parse: I,
|
|
957
|
+
parseUrl: Y,
|
|
958
|
+
pick: ee,
|
|
959
|
+
stringify: X,
|
|
960
|
+
stringifyUrl: Z
|
|
713
961
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
714
|
-
function
|
|
715
|
-
return (t) => {
|
|
716
|
-
const r = t.split("/").map((s) => s.trim()).filter((s) => s !== "");
|
|
717
|
-
let n = null;
|
|
718
|
-
function a(s, c) {
|
|
719
|
-
n || (n = {}), n[s] = c;
|
|
720
|
-
}
|
|
721
|
-
if (e.length === 0) return r.length === 0 ? {
|
|
722
|
-
path: t,
|
|
723
|
-
params: null
|
|
724
|
-
} : null;
|
|
725
|
-
for (let s = 0; s < e.length; s++) {
|
|
726
|
-
const c = e[s];
|
|
727
|
-
switch (c.type) {
|
|
728
|
-
case "const": {
|
|
729
|
-
if (c.name !== r.shift()) return null;
|
|
730
|
-
continue;
|
|
731
|
-
}
|
|
732
|
-
case "parameter": {
|
|
733
|
-
const {
|
|
734
|
-
arrayProps: j,
|
|
735
|
-
genericProps: w,
|
|
736
|
-
required: p
|
|
737
|
-
} = c.payload;
|
|
738
|
-
if (j) {
|
|
739
|
-
var o;
|
|
740
|
-
const d = [];
|
|
741
|
-
let g;
|
|
742
|
-
for (; ; ) {
|
|
743
|
-
var i;
|
|
744
|
-
if (g = r.shift(), !g) break;
|
|
745
|
-
switch (w == null ? void 0 : w.type) {
|
|
746
|
-
case "number": {
|
|
747
|
-
if (isNaN(+g)) return null;
|
|
748
|
-
d.push(+g);
|
|
749
|
-
break;
|
|
750
|
-
}
|
|
751
|
-
case "union": {
|
|
752
|
-
if (!w.items.includes(g)) return null;
|
|
753
|
-
d.push(g);
|
|
754
|
-
break;
|
|
755
|
-
}
|
|
756
|
-
default: {
|
|
757
|
-
d.push(g);
|
|
758
|
-
break;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
if (d.length >= ((i = j.max) !== null && i !== void 0 ? i : 1 / 0)) break;
|
|
762
|
-
}
|
|
763
|
-
if (d.length < ((o = j.min) !== null && o !== void 0 ? o : 0) || r.length > 0 && !e[s + 1]) return null;
|
|
764
|
-
a(c.name, d);
|
|
765
|
-
break;
|
|
766
|
-
}
|
|
767
|
-
const l = r.shift();
|
|
768
|
-
if (p && !l) return null;
|
|
769
|
-
if (!l) {
|
|
770
|
-
a(c.name, void 0);
|
|
771
|
-
continue;
|
|
772
|
-
}
|
|
773
|
-
switch (w == null ? void 0 : w.type) {
|
|
774
|
-
case "number": {
|
|
775
|
-
if (isNaN(+l)) return null;
|
|
776
|
-
a(c.name, +l);
|
|
777
|
-
break;
|
|
778
|
-
}
|
|
779
|
-
case "union": {
|
|
780
|
-
if (!w.items.includes(l)) return null;
|
|
781
|
-
a(c.name, l);
|
|
782
|
-
break;
|
|
783
|
-
}
|
|
784
|
-
default: {
|
|
785
|
-
a(c.name, l);
|
|
786
|
-
break;
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
return r.length > 0 ? null : {
|
|
793
|
-
path: t,
|
|
794
|
-
params: n
|
|
795
|
-
};
|
|
796
|
-
};
|
|
797
|
-
}
|
|
798
|
-
function ve(e) {
|
|
799
|
-
if (!e) return null;
|
|
800
|
-
const t = e[1];
|
|
801
|
-
let r, n, a;
|
|
802
|
-
for (const o of e.slice(2)) if (o) {
|
|
803
|
-
if (o.includes("<")) {
|
|
804
|
-
r = o.replace("<", "").replace(">", "");
|
|
805
|
-
continue;
|
|
806
|
-
}
|
|
807
|
-
if (o.includes("{") && (n = o.replace("{", "").replace("}", "").split(",").map((i) => parseInt(i))), ["*", "?", "+"].includes(o)) {
|
|
808
|
-
a = o;
|
|
809
|
-
continue;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
return {
|
|
813
|
-
name: t,
|
|
814
|
-
genericProps: r,
|
|
815
|
-
arrayProps: n,
|
|
816
|
-
modificator: a
|
|
817
|
-
};
|
|
818
|
-
}
|
|
819
|
-
function Ne(e) {
|
|
820
|
-
return (t) => {
|
|
821
|
-
const r = [];
|
|
822
|
-
if (e.length === 0) return "/";
|
|
823
|
-
for (const n of e) switch (n.type) {
|
|
824
|
-
case "const": {
|
|
825
|
-
r.push(n.name);
|
|
826
|
-
break;
|
|
827
|
-
}
|
|
828
|
-
case "parameter": {
|
|
829
|
-
if (!t[n.name]) continue;
|
|
830
|
-
if (Array.isArray(t[n.name])) for (const a of t[n.name]) r.push(a.toString());
|
|
831
|
-
else r.push(t[n.name].toString());
|
|
832
|
-
break;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
return "/".concat(r.join("/"));
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
function L(e, t) {
|
|
962
|
+
function H(e, t) {
|
|
839
963
|
var r = Object.keys(e);
|
|
840
964
|
if (Object.getOwnPropertySymbols) {
|
|
841
965
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -845,135 +969,25 @@ function L(e, t) {
|
|
|
845
969
|
}
|
|
846
970
|
return r;
|
|
847
971
|
}
|
|
848
|
-
function
|
|
849
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
850
|
-
var r = arguments[t] != null ? arguments[t] : {};
|
|
851
|
-
t % 2 ? L(Object(r), !0).forEach(function(n) {
|
|
852
|
-
$e(e, n, r[n]);
|
|
853
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : L(Object(r)).forEach(function(n) {
|
|
854
|
-
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
return e;
|
|
858
|
-
}
|
|
859
|
-
function $e(e, t, r) {
|
|
860
|
-
return (t = Ae(t)) in e ? Object.defineProperty(e, t, {
|
|
861
|
-
value: r,
|
|
862
|
-
enumerable: !0,
|
|
863
|
-
configurable: !0,
|
|
864
|
-
writable: !0
|
|
865
|
-
}) : e[t] = r, e;
|
|
866
|
-
}
|
|
867
|
-
function Ae(e) {
|
|
868
|
-
var t = Ee(e, "string");
|
|
869
|
-
return typeof t == "symbol" ? t : t + "";
|
|
870
|
-
}
|
|
871
|
-
function Ee(e, t) {
|
|
872
|
-
if (typeof e != "object" || !e) return e;
|
|
873
|
-
var r = e[Symbol.toPrimitive];
|
|
874
|
-
if (r !== void 0) {
|
|
875
|
-
var n = r.call(e, t);
|
|
876
|
-
if (typeof n != "object") return n;
|
|
877
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
878
|
-
}
|
|
879
|
-
return (t === "string" ? String : Number)(e);
|
|
880
|
-
}
|
|
881
|
-
function Re(e) {
|
|
882
|
-
const t = [], r = /:(\w+)(<[\w|]+>)?({\d+\,\d+})?([+*?])?/, n = e.split("/").filter(Boolean);
|
|
883
|
-
for (let a = 0; a < n.length; a++) {
|
|
884
|
-
const o = n[a];
|
|
885
|
-
if (!o) continue;
|
|
886
|
-
const i = ve(o.match(r));
|
|
887
|
-
if (!i) {
|
|
888
|
-
t.push({
|
|
889
|
-
type: "const",
|
|
890
|
-
name: o,
|
|
891
|
-
payload: void 0
|
|
892
|
-
});
|
|
893
|
-
continue;
|
|
894
|
-
}
|
|
895
|
-
const {
|
|
896
|
-
arrayProps: s,
|
|
897
|
-
genericProps: c,
|
|
898
|
-
modificator: j,
|
|
899
|
-
name: w
|
|
900
|
-
} = i;
|
|
901
|
-
if (!w) throw new Error('Invalid path: "'.concat(e, '". Name for argument must be provided'));
|
|
902
|
-
const p = {
|
|
903
|
-
type: "parameter",
|
|
904
|
-
name: w,
|
|
905
|
-
payload: {
|
|
906
|
-
required: !0
|
|
907
|
-
}
|
|
908
|
-
};
|
|
909
|
-
switch (c && c === "number" && (p.payload.genericProps = {
|
|
910
|
-
type: "number"
|
|
911
|
-
}), c && c.includes("|") && (p.payload.genericProps = {
|
|
912
|
-
type: "union",
|
|
913
|
-
items: c.split("|")
|
|
914
|
-
}), j) {
|
|
915
|
-
case "*": {
|
|
916
|
-
p.payload.arrayProps = {};
|
|
917
|
-
break;
|
|
918
|
-
}
|
|
919
|
-
case "+": {
|
|
920
|
-
p.payload.arrayProps = {
|
|
921
|
-
min: 1
|
|
922
|
-
};
|
|
923
|
-
break;
|
|
924
|
-
}
|
|
925
|
-
case "?": {
|
|
926
|
-
p.payload.required = !1;
|
|
927
|
-
break;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
s && (p.payload.arrayProps = M(M({}, p.payload.arrayProps), {}, {
|
|
931
|
-
min: s[0],
|
|
932
|
-
max: s[1]
|
|
933
|
-
})), t.push(p);
|
|
934
|
-
}
|
|
935
|
-
return {
|
|
936
|
-
/**
|
|
937
|
-
* @param input Input path
|
|
938
|
-
* @returns `{ path: string; params: Params }` | `null`
|
|
939
|
-
*/
|
|
940
|
-
parse: xe(t),
|
|
941
|
-
/**
|
|
942
|
-
* @param params Route parameters
|
|
943
|
-
* @returns string
|
|
944
|
-
*/
|
|
945
|
-
build: Ne(t)
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
function J(e, t) {
|
|
949
|
-
var r = Object.keys(e);
|
|
950
|
-
if (Object.getOwnPropertySymbols) {
|
|
951
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
952
|
-
t && (n = n.filter(function(a) {
|
|
953
|
-
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
954
|
-
})), r.push.apply(r, n);
|
|
955
|
-
}
|
|
956
|
-
return r;
|
|
957
|
-
}
|
|
958
|
-
function I(e) {
|
|
972
|
+
function $(e) {
|
|
959
973
|
for (var t = 1; t < arguments.length; t++) {
|
|
960
974
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
961
|
-
t % 2 ?
|
|
962
|
-
|
|
963
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
975
|
+
t % 2 ? H(Object(r), !0).forEach(function(n) {
|
|
976
|
+
Ae(e, n, r[n]);
|
|
977
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : H(Object(r)).forEach(function(n) {
|
|
964
978
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
965
979
|
});
|
|
966
980
|
}
|
|
967
981
|
return e;
|
|
968
982
|
}
|
|
969
|
-
function
|
|
970
|
-
return (t =
|
|
983
|
+
function Ae(e, t, r) {
|
|
984
|
+
return (t = Ee(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
971
985
|
}
|
|
972
|
-
function
|
|
973
|
-
var t =
|
|
986
|
+
function Ee(e) {
|
|
987
|
+
var t = Re(e, "string");
|
|
974
988
|
return typeof t == "symbol" ? t : t + "";
|
|
975
989
|
}
|
|
976
|
-
function
|
|
990
|
+
function Re(e, t) {
|
|
977
991
|
if (typeof e != "object" || !e) return e;
|
|
978
992
|
var r = e[Symbol.toPrimitive];
|
|
979
993
|
if (r !== void 0) {
|
|
@@ -983,266 +997,292 @@ function Ce(e, t) {
|
|
|
983
997
|
}
|
|
984
998
|
return (t === "string" ? String : Number)(e);
|
|
985
999
|
}
|
|
986
|
-
function
|
|
987
|
-
const {
|
|
988
|
-
base: t = "/",
|
|
989
|
-
routes: r
|
|
990
|
-
} = e, n = v(null, {
|
|
1000
|
+
function Ie() {
|
|
1001
|
+
const e = k(null, {
|
|
991
1002
|
and: {
|
|
992
1003
|
serialize: "ignore"
|
|
993
1004
|
},
|
|
994
1005
|
name: "$history",
|
|
995
|
-
sid: "
|
|
996
|
-
}),
|
|
1006
|
+
sid: "o3gup1"
|
|
1007
|
+
}), t = k({
|
|
997
1008
|
query: {},
|
|
998
1009
|
path: null
|
|
999
1010
|
}, {
|
|
1000
1011
|
name: "$locationState",
|
|
1001
|
-
sid: "-
|
|
1002
|
-
}),
|
|
1012
|
+
sid: "-kglf8k"
|
|
1013
|
+
}), r = t.map((u) => u.query), n = t.map((u) => u.path), a = g({
|
|
1003
1014
|
name: "setHistory",
|
|
1004
|
-
sid: "
|
|
1005
|
-
}),
|
|
1015
|
+
sid: "kp1u42"
|
|
1016
|
+
}), o = g({
|
|
1006
1017
|
name: "navigate",
|
|
1007
|
-
sid: "
|
|
1008
|
-
}),
|
|
1018
|
+
sid: "3qh547"
|
|
1019
|
+
}), i = g({
|
|
1009
1020
|
name: "back",
|
|
1010
|
-
sid: "-
|
|
1011
|
-
}),
|
|
1021
|
+
sid: "-3oja8m"
|
|
1022
|
+
}), s = g({
|
|
1012
1023
|
name: "forward",
|
|
1013
|
-
sid: "-
|
|
1014
|
-
}),
|
|
1024
|
+
sid: "-rc4ibg"
|
|
1025
|
+
}), c = g({
|
|
1015
1026
|
name: "locationUpdated",
|
|
1016
|
-
sid: "
|
|
1017
|
-
}),
|
|
1018
|
-
let b = u;
|
|
1019
|
-
const f = [];
|
|
1020
|
-
for (f.unshift(b.path); b.parent; )
|
|
1021
|
-
b = b.parent, b.path !== "/" && f.unshift(b.path);
|
|
1022
|
-
const F = t === "/" ? f.join("") : [t, ...f].join(""), {
|
|
1023
|
-
build: N,
|
|
1024
|
-
parse: x
|
|
1025
|
-
} = Re(F);
|
|
1026
|
-
return {
|
|
1027
|
-
route: u,
|
|
1028
|
-
path: F,
|
|
1029
|
-
build: N,
|
|
1030
|
-
parse: x
|
|
1031
|
-
};
|
|
1032
|
-
}), d = i.map((u) => {
|
|
1033
|
-
const b = [];
|
|
1034
|
-
if (!u)
|
|
1035
|
-
return b;
|
|
1036
|
-
for (const {
|
|
1037
|
-
route: f,
|
|
1038
|
-
parse: F
|
|
1039
|
-
} of l)
|
|
1040
|
-
F(u) && b.push(f);
|
|
1041
|
-
return b;
|
|
1042
|
-
}), g = _({
|
|
1027
|
+
sid: "5yi2di"
|
|
1028
|
+
}), d = K({
|
|
1043
1029
|
and: {
|
|
1044
|
-
source:
|
|
1045
|
-
effect: (u,
|
|
1030
|
+
source: e,
|
|
1031
|
+
effect: (u, y) => {
|
|
1046
1032
|
let {
|
|
1047
|
-
path:
|
|
1048
|
-
query:
|
|
1049
|
-
replace:
|
|
1050
|
-
} =
|
|
1033
|
+
path: l,
|
|
1034
|
+
query: f,
|
|
1035
|
+
replace: p
|
|
1036
|
+
} = y;
|
|
1051
1037
|
if (!u)
|
|
1052
1038
|
throw new Error("history not found");
|
|
1053
|
-
const
|
|
1054
|
-
pathname:
|
|
1055
|
-
search: "?".concat(
|
|
1039
|
+
const m = {
|
|
1040
|
+
pathname: l,
|
|
1041
|
+
search: "?".concat(x.stringify(f))
|
|
1056
1042
|
};
|
|
1057
|
-
|
|
1043
|
+
p ? u.replace(m) : u.push(m);
|
|
1058
1044
|
}
|
|
1059
1045
|
},
|
|
1060
1046
|
or: {
|
|
1061
1047
|
name: "navigateFx",
|
|
1062
|
-
sid: "
|
|
1048
|
+
sid: "klmj1f"
|
|
1063
1049
|
}
|
|
1064
|
-
}),
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1050
|
+
}), b = S((u) => {
|
|
1051
|
+
const y = N(c);
|
|
1052
|
+
if (y({
|
|
1067
1053
|
pathname: u.location.pathname,
|
|
1068
|
-
query:
|
|
1054
|
+
query: $({}, x.parse(u.location.search))
|
|
1069
1055
|
}), !u)
|
|
1070
1056
|
throw new Error();
|
|
1071
|
-
u.listen((
|
|
1057
|
+
u.listen((l) => {
|
|
1072
1058
|
let {
|
|
1073
|
-
location:
|
|
1074
|
-
} =
|
|
1075
|
-
|
|
1076
|
-
pathname:
|
|
1077
|
-
query:
|
|
1059
|
+
location: f
|
|
1060
|
+
} = l;
|
|
1061
|
+
y({
|
|
1062
|
+
pathname: f.pathname,
|
|
1063
|
+
query: $({}, x.parse(f.search))
|
|
1078
1064
|
});
|
|
1079
1065
|
});
|
|
1080
1066
|
}, {
|
|
1081
1067
|
name: "subscribeHistoryFx",
|
|
1082
|
-
sid: "
|
|
1083
|
-
}), h = _({
|
|
1084
|
-
and: {
|
|
1085
|
-
source: {
|
|
1086
|
-
query: o,
|
|
1087
|
-
path: i
|
|
1088
|
-
},
|
|
1089
|
-
effect: async (u) => {
|
|
1090
|
-
let {
|
|
1091
|
-
query: b,
|
|
1092
|
-
path: f
|
|
1093
|
-
} = u;
|
|
1094
|
-
for (const {
|
|
1095
|
-
route: F,
|
|
1096
|
-
parse: N
|
|
1097
|
-
} of l) {
|
|
1098
|
-
const x = N(f), [ae, oe] = [E(F.internal.close), E(F.internal.navigated)];
|
|
1099
|
-
x ? oe({
|
|
1100
|
-
query: b,
|
|
1101
|
-
params: x.params
|
|
1102
|
-
}) : ae();
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
},
|
|
1106
|
-
or: {
|
|
1107
|
-
name: "openRoutesByPathFx",
|
|
1108
|
-
sid: "dzro9q"
|
|
1109
|
-
}
|
|
1068
|
+
sid: "xpn9z4"
|
|
1110
1069
|
});
|
|
1111
|
-
|
|
1112
|
-
route: u,
|
|
1113
|
-
build: b
|
|
1114
|
-
} of l)
|
|
1115
|
-
y({
|
|
1116
|
-
and: [{
|
|
1117
|
-
clock: u.internal.openFx.doneData,
|
|
1118
|
-
filter: (f) => (f == null ? void 0 : f.navigate) !== !1,
|
|
1119
|
-
fn: (f) => {
|
|
1120
|
-
var F;
|
|
1121
|
-
return {
|
|
1122
|
-
path: b(f && "params" in f ? f.params : void 0),
|
|
1123
|
-
query: (F = f == null ? void 0 : f.query) !== null && F !== void 0 ? F : {},
|
|
1124
|
-
replace: f == null ? void 0 : f.replace
|
|
1125
|
-
};
|
|
1126
|
-
},
|
|
1127
|
-
target: c
|
|
1128
|
-
}],
|
|
1129
|
-
or: {
|
|
1130
|
-
sid: "htdbac"
|
|
1131
|
-
}
|
|
1132
|
-
});
|
|
1133
|
-
return y({
|
|
1070
|
+
return h({
|
|
1134
1071
|
and: [{
|
|
1135
|
-
clock:
|
|
1136
|
-
target:
|
|
1072
|
+
clock: a,
|
|
1073
|
+
target: e
|
|
1137
1074
|
}],
|
|
1138
1075
|
or: {
|
|
1139
|
-
sid: "
|
|
1076
|
+
sid: "-h2wuu"
|
|
1140
1077
|
}
|
|
1141
|
-
}),
|
|
1078
|
+
}), h({
|
|
1142
1079
|
and: [{
|
|
1143
|
-
clock:
|
|
1080
|
+
clock: e,
|
|
1144
1081
|
filter: Boolean,
|
|
1145
|
-
target:
|
|
1082
|
+
target: b
|
|
1146
1083
|
}],
|
|
1147
1084
|
or: {
|
|
1148
|
-
sid: "
|
|
1085
|
+
sid: "-ebxw1"
|
|
1149
1086
|
}
|
|
1150
|
-
}),
|
|
1087
|
+
}), h({
|
|
1151
1088
|
and: [{
|
|
1152
|
-
clock:
|
|
1089
|
+
clock: c,
|
|
1153
1090
|
fn: (u) => ({
|
|
1154
1091
|
path: u.pathname,
|
|
1155
1092
|
query: u.query
|
|
1156
1093
|
}),
|
|
1157
|
-
target:
|
|
1094
|
+
target: t
|
|
1158
1095
|
}],
|
|
1159
1096
|
or: {
|
|
1160
|
-
sid: "
|
|
1097
|
+
sid: "ii4q"
|
|
1161
1098
|
}
|
|
1162
|
-
}),
|
|
1099
|
+
}), h({
|
|
1163
1100
|
and: [{
|
|
1164
|
-
clock:
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
}),
|
|
1169
|
-
target:
|
|
1101
|
+
clock: o,
|
|
1102
|
+
source: n,
|
|
1103
|
+
fn: (u, y) => $({
|
|
1104
|
+
path: u
|
|
1105
|
+
}, y),
|
|
1106
|
+
target: d
|
|
1170
1107
|
}],
|
|
1171
1108
|
or: {
|
|
1172
|
-
sid: "
|
|
1109
|
+
sid: "h0bxk"
|
|
1173
1110
|
}
|
|
1174
|
-
}),
|
|
1111
|
+
}), {
|
|
1112
|
+
$history: e,
|
|
1113
|
+
$locationState: t,
|
|
1114
|
+
$query: r,
|
|
1115
|
+
$path: n,
|
|
1116
|
+
setHistory: a,
|
|
1117
|
+
navigate: o,
|
|
1118
|
+
back: i,
|
|
1119
|
+
forward: s,
|
|
1120
|
+
locationUpdated: c,
|
|
1121
|
+
trackQuery: de({
|
|
1122
|
+
$query: r,
|
|
1123
|
+
navigate: o
|
|
1124
|
+
})
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
function qe(e) {
|
|
1128
|
+
const {
|
|
1129
|
+
base: t = "/",
|
|
1130
|
+
routes: r
|
|
1131
|
+
} = e, {
|
|
1132
|
+
$path: n,
|
|
1133
|
+
$query: a,
|
|
1134
|
+
back: o,
|
|
1135
|
+
forward: i,
|
|
1136
|
+
navigate: s,
|
|
1137
|
+
setHistory: c,
|
|
1138
|
+
locationUpdated: d
|
|
1139
|
+
} = Ie(), b = r.map((l) => {
|
|
1140
|
+
let f = l;
|
|
1141
|
+
const p = [];
|
|
1142
|
+
for (p.unshift(f.path); f.parent; )
|
|
1143
|
+
f = f.parent, f.path !== "/" && p.unshift(f.path);
|
|
1144
|
+
const m = t === "/" ? p.join("") : [t, ...p].join(""), {
|
|
1145
|
+
build: j,
|
|
1146
|
+
parse: v
|
|
1147
|
+
} = Oe(m);
|
|
1148
|
+
return {
|
|
1149
|
+
route: l,
|
|
1150
|
+
path: m,
|
|
1151
|
+
build: j,
|
|
1152
|
+
parse: v
|
|
1153
|
+
};
|
|
1154
|
+
}), u = n.map((l) => {
|
|
1155
|
+
const f = [];
|
|
1156
|
+
if (!l)
|
|
1157
|
+
return f;
|
|
1158
|
+
for (const {
|
|
1159
|
+
route: p,
|
|
1160
|
+
parse: m
|
|
1161
|
+
} of b)
|
|
1162
|
+
m(l) && f.push(p);
|
|
1163
|
+
return f;
|
|
1164
|
+
}), y = K({
|
|
1165
|
+
and: {
|
|
1166
|
+
source: {
|
|
1167
|
+
query: a,
|
|
1168
|
+
path: n
|
|
1169
|
+
},
|
|
1170
|
+
effect: async (l) => {
|
|
1171
|
+
let {
|
|
1172
|
+
query: f,
|
|
1173
|
+
path: p
|
|
1174
|
+
} = l;
|
|
1175
|
+
for (const {
|
|
1176
|
+
route: m,
|
|
1177
|
+
parse: j
|
|
1178
|
+
} of b) {
|
|
1179
|
+
const v = j(p), [re, te] = [N(m.internal.close), N(m.internal.navigated)];
|
|
1180
|
+
v ? te({
|
|
1181
|
+
query: f,
|
|
1182
|
+
params: v.params
|
|
1183
|
+
}) : re();
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
},
|
|
1187
|
+
or: {
|
|
1188
|
+
name: "openRoutesByPathFx",
|
|
1189
|
+
sid: "-3zl7vq"
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
for (const {
|
|
1193
|
+
route: l,
|
|
1194
|
+
build: f
|
|
1195
|
+
} of b)
|
|
1196
|
+
h({
|
|
1197
|
+
and: [{
|
|
1198
|
+
clock: l.internal.openFx.doneData,
|
|
1199
|
+
filter: (p) => (p == null ? void 0 : p.navigate) !== !1,
|
|
1200
|
+
fn: (p) => {
|
|
1201
|
+
var m;
|
|
1202
|
+
return {
|
|
1203
|
+
path: f(p && "params" in p ? p.params : void 0),
|
|
1204
|
+
query: (m = p == null ? void 0 : p.query) !== null && m !== void 0 ? m : {},
|
|
1205
|
+
replace: p == null ? void 0 : p.replace
|
|
1206
|
+
};
|
|
1207
|
+
},
|
|
1208
|
+
target: s
|
|
1209
|
+
}],
|
|
1210
|
+
or: {
|
|
1211
|
+
sid: "exzzqg"
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
return h({
|
|
1175
1215
|
and: [{
|
|
1176
|
-
clock:
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}
|
|
1181
|
-
target:
|
|
1216
|
+
clock: d,
|
|
1217
|
+
fn: (l) => ({
|
|
1218
|
+
path: l.pathname,
|
|
1219
|
+
query: l.query
|
|
1220
|
+
}),
|
|
1221
|
+
target: y
|
|
1182
1222
|
}],
|
|
1183
1223
|
or: {
|
|
1184
|
-
sid: "
|
|
1224
|
+
sid: "ficdn3"
|
|
1185
1225
|
}
|
|
1186
1226
|
}), {
|
|
1187
|
-
$query:
|
|
1188
|
-
$path:
|
|
1189
|
-
$activeRoutes:
|
|
1190
|
-
back:
|
|
1191
|
-
forward:
|
|
1192
|
-
navigate:
|
|
1227
|
+
$query: a,
|
|
1228
|
+
$path: n,
|
|
1229
|
+
$activeRoutes: u,
|
|
1230
|
+
back: o,
|
|
1231
|
+
forward: i,
|
|
1232
|
+
navigate: s,
|
|
1193
1233
|
routes: r,
|
|
1194
|
-
setHistory:
|
|
1195
|
-
mappedRoutes:
|
|
1196
|
-
trackQuery:
|
|
1197
|
-
$activeRoutes:
|
|
1198
|
-
$query:
|
|
1199
|
-
navigate:
|
|
1234
|
+
setHistory: c,
|
|
1235
|
+
mappedRoutes: b,
|
|
1236
|
+
trackQuery: L({
|
|
1237
|
+
$activeRoutes: u,
|
|
1238
|
+
$query: a,
|
|
1239
|
+
navigate: s
|
|
1200
1240
|
}),
|
|
1201
1241
|
"@@unitShape": () => ({
|
|
1202
|
-
query:
|
|
1203
|
-
path:
|
|
1204
|
-
activeRoutes:
|
|
1205
|
-
onBack:
|
|
1206
|
-
onForward:
|
|
1207
|
-
onNavigate:
|
|
1242
|
+
query: a,
|
|
1243
|
+
path: n,
|
|
1244
|
+
activeRoutes: u,
|
|
1245
|
+
onBack: o,
|
|
1246
|
+
onForward: i,
|
|
1247
|
+
onNavigate: s
|
|
1208
1248
|
})
|
|
1209
1249
|
};
|
|
1210
1250
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const t =
|
|
1251
|
+
function Ce(e) {
|
|
1252
|
+
const t = k(null, {
|
|
1213
1253
|
name: "$params",
|
|
1214
|
-
sid: "-
|
|
1215
|
-
}), r =
|
|
1254
|
+
sid: "-i70thm"
|
|
1255
|
+
}), r = k(!1, {
|
|
1216
1256
|
name: "$isOpened",
|
|
1217
|
-
sid: "
|
|
1218
|
-
}), n = e, a =
|
|
1257
|
+
sid: "-xjh75b"
|
|
1258
|
+
}), n = e, a = g({
|
|
1219
1259
|
name: "open",
|
|
1220
|
-
sid: "
|
|
1221
|
-
}), o =
|
|
1260
|
+
sid: "7j5xyt"
|
|
1261
|
+
}), o = g({
|
|
1222
1262
|
name: "opened",
|
|
1223
|
-
sid: "
|
|
1224
|
-
}), i =
|
|
1263
|
+
sid: "vvlmuq"
|
|
1264
|
+
}), i = g({
|
|
1225
1265
|
name: "openedOnServer",
|
|
1226
|
-
sid: "
|
|
1227
|
-
}), s =
|
|
1266
|
+
sid: "aqzl82"
|
|
1267
|
+
}), s = g({
|
|
1228
1268
|
name: "openedOnClient",
|
|
1229
|
-
sid: "-
|
|
1230
|
-
}), c =
|
|
1269
|
+
sid: "-n5wotz"
|
|
1270
|
+
}), c = g({
|
|
1231
1271
|
name: "close",
|
|
1232
|
-
sid: "
|
|
1233
|
-
}),
|
|
1272
|
+
sid: "2mdmp7"
|
|
1273
|
+
}), d = g({
|
|
1234
1274
|
name: "closed",
|
|
1235
|
-
sid: "
|
|
1275
|
+
sid: "tyhbsl"
|
|
1236
1276
|
});
|
|
1237
|
-
return
|
|
1277
|
+
return h({
|
|
1238
1278
|
and: [{
|
|
1239
1279
|
clock: a,
|
|
1240
1280
|
target: o
|
|
1241
1281
|
}],
|
|
1242
1282
|
or: {
|
|
1243
|
-
sid: "-
|
|
1283
|
+
sid: "-unpbr1"
|
|
1244
1284
|
}
|
|
1245
|
-
}),
|
|
1285
|
+
}), V({
|
|
1246
1286
|
and: [{
|
|
1247
1287
|
source: o,
|
|
1248
1288
|
match: () => typeof window > "u" ? "server" : "client",
|
|
@@ -1252,23 +1292,23 @@ function ze(e) {
|
|
|
1252
1292
|
}
|
|
1253
1293
|
}],
|
|
1254
1294
|
or: {
|
|
1255
|
-
sid: "-
|
|
1295
|
+
sid: "-ukycs8"
|
|
1256
1296
|
}
|
|
1257
|
-
}),
|
|
1297
|
+
}), h({
|
|
1258
1298
|
and: [{
|
|
1259
1299
|
clock: c,
|
|
1260
|
-
target:
|
|
1300
|
+
target: d
|
|
1261
1301
|
}],
|
|
1262
1302
|
or: {
|
|
1263
|
-
sid: "-
|
|
1303
|
+
sid: "-u4gize"
|
|
1264
1304
|
}
|
|
1265
|
-
}),
|
|
1305
|
+
}), h({
|
|
1266
1306
|
and: [{
|
|
1267
|
-
clock: [o.map(() => !0),
|
|
1307
|
+
clock: [o.map(() => !0), d.map(() => !1)],
|
|
1268
1308
|
target: r
|
|
1269
1309
|
}],
|
|
1270
1310
|
or: {
|
|
1271
|
-
sid: "-
|
|
1311
|
+
sid: "-tq5vk0"
|
|
1272
1312
|
}
|
|
1273
1313
|
}), {
|
|
1274
1314
|
$params: t,
|
|
@@ -1279,7 +1319,7 @@ function ze(e) {
|
|
|
1279
1319
|
openedOnClient: s,
|
|
1280
1320
|
openedOnServer: i,
|
|
1281
1321
|
close: c,
|
|
1282
|
-
closed:
|
|
1322
|
+
closed: d,
|
|
1283
1323
|
// @ts-expect-error emulated path for virtual route
|
|
1284
1324
|
path: null,
|
|
1285
1325
|
"@@unitShape": () => ({
|
|
@@ -1290,68 +1330,82 @@ function ze(e) {
|
|
|
1290
1330
|
})
|
|
1291
1331
|
};
|
|
1292
1332
|
}
|
|
1293
|
-
function
|
|
1333
|
+
function Ue(e) {
|
|
1294
1334
|
const {
|
|
1295
1335
|
route: t,
|
|
1296
1336
|
beforeOpen: r,
|
|
1297
1337
|
openOn: n,
|
|
1298
1338
|
cancelOn: a
|
|
1299
|
-
} = e
|
|
1300
|
-
|
|
1301
|
-
|
|
1339
|
+
} = e;
|
|
1340
|
+
let o;
|
|
1341
|
+
const i = S(() => {
|
|
1342
|
+
var d;
|
|
1343
|
+
return (d = o) === null || d === void 0 ? void 0 : d();
|
|
1344
|
+
}, {
|
|
1345
|
+
name: "waitForAsyncBundleFx",
|
|
1346
|
+
sid: "-y53ute"
|
|
1347
|
+
}), s = S(async (d) => {
|
|
1348
|
+
await i();
|
|
1349
|
+
for (const b of [].concat(r))
|
|
1350
|
+
await b(d);
|
|
1302
1351
|
}, {
|
|
1303
1352
|
name: "openFx",
|
|
1304
|
-
sid: "
|
|
1305
|
-
}),
|
|
1306
|
-
return
|
|
1353
|
+
sid: "-nropd8"
|
|
1354
|
+
}), c = Ce(s.pending);
|
|
1355
|
+
return h({
|
|
1307
1356
|
and: [{
|
|
1308
1357
|
clock: t.open,
|
|
1309
|
-
target:
|
|
1358
|
+
target: s
|
|
1310
1359
|
}],
|
|
1311
1360
|
or: {
|
|
1312
|
-
sid: "
|
|
1361
|
+
sid: "k4g7d"
|
|
1313
1362
|
}
|
|
1314
|
-
}),
|
|
1363
|
+
}), h({
|
|
1315
1364
|
and: [{
|
|
1316
1365
|
clock: t.opened,
|
|
1317
|
-
fn: (
|
|
1318
|
-
target:
|
|
1366
|
+
fn: (d) => d && "params" in d ? d.params : null,
|
|
1367
|
+
target: c.$params
|
|
1319
1368
|
}],
|
|
1320
1369
|
or: {
|
|
1321
|
-
sid: "
|
|
1370
|
+
sid: "mvf66"
|
|
1322
1371
|
}
|
|
1323
|
-
}), n &&
|
|
1372
|
+
}), n && h({
|
|
1324
1373
|
and: [{
|
|
1325
1374
|
clock: n,
|
|
1326
1375
|
source: {
|
|
1327
|
-
params:
|
|
1376
|
+
params: c.$params
|
|
1328
1377
|
},
|
|
1329
|
-
fn: (
|
|
1378
|
+
fn: (d) => {
|
|
1330
1379
|
let {
|
|
1331
|
-
params:
|
|
1332
|
-
} =
|
|
1380
|
+
params: b
|
|
1381
|
+
} = d;
|
|
1333
1382
|
return {
|
|
1334
|
-
params:
|
|
1383
|
+
params: b
|
|
1335
1384
|
};
|
|
1336
1385
|
},
|
|
1337
|
-
target:
|
|
1386
|
+
target: c.open
|
|
1338
1387
|
}],
|
|
1339
1388
|
or: {
|
|
1340
|
-
sid: "
|
|
1389
|
+
sid: "13d90q"
|
|
1341
1390
|
}
|
|
1342
|
-
}), a &&
|
|
1391
|
+
}), a && h({
|
|
1343
1392
|
and: [{
|
|
1344
1393
|
clock: [t.closed].concat(a),
|
|
1345
|
-
target:
|
|
1394
|
+
target: c.close
|
|
1346
1395
|
}],
|
|
1347
1396
|
or: {
|
|
1348
|
-
sid: "
|
|
1397
|
+
sid: "1jv2tk"
|
|
1349
1398
|
}
|
|
1350
|
-
}),
|
|
1399
|
+
}), Object.assign(c, {
|
|
1400
|
+
internal: {
|
|
1401
|
+
setAsyncImport: (d) => o = d
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1351
1404
|
}
|
|
1352
1405
|
export {
|
|
1353
|
-
|
|
1354
|
-
|
|
1406
|
+
Ue as chainRoute,
|
|
1407
|
+
ze as createRoute,
|
|
1355
1408
|
qe as createRouter,
|
|
1356
|
-
|
|
1409
|
+
Ie as createRouterControls,
|
|
1410
|
+
w as parameters
|
|
1357
1411
|
};
|