@hortiview/modulebase 0.0.11518 → 0.0.11535
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/components/ModuleBase.js +39 -38
- package/dist/hooks/useCustom.d.ts +3 -3
- package/dist/hooks/useCustom.js +13 -12
- package/dist/hooks/useNavigate.js +4 -25
- package/dist/hooks/useStores.d.ts +1 -1
- package/dist/main.js +4 -4
- package/dist/stores/EnvironmentStore.d.ts +1 -1
- package/dist/stores/EnvironmentStore.js +8 -3
- package/dist/types/Environment.d.ts +1 -1
- package/dist/types/ModuleApi.d.ts +10 -0
- package/dist/{chunk-IR6S3I6Y-BvQXS3A3.js → useNavigate-BW3A9mQm.js} +698 -667
- package/package.json +1 -1
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
import * as m from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { useEffect as Zr, useCallback as en } from "react";
|
|
3
|
+
import { useBasePropsStore as bt } from "./stores/BasePropsStore.js";
|
|
4
|
+
var je = {}, Xt;
|
|
5
|
+
function tn() {
|
|
6
|
+
if (Xt) return je;
|
|
7
|
+
Xt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.parse = l, je.serialize = c;
|
|
6
8
|
const e = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, t = /^[\u0021-\u003A\u003C-\u007E]*$/, r = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, a = /^[\u0020-\u003A\u003D-\u007E]*$/, n = Object.prototype.toString, i = /* @__PURE__ */ (() => {
|
|
7
9
|
const g = function() {
|
|
8
10
|
};
|
|
9
11
|
return g.prototype = /* @__PURE__ */ Object.create(null), g;
|
|
10
12
|
})();
|
|
11
13
|
function l(g, p) {
|
|
12
|
-
const v = new i(),
|
|
13
|
-
if (
|
|
14
|
+
const v = new i(), C = g.length;
|
|
15
|
+
if (C < 2)
|
|
14
16
|
return v;
|
|
15
17
|
const x = p?.decode || y;
|
|
16
18
|
let E = 0;
|
|
17
19
|
do {
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
+
const L = g.indexOf("=", E);
|
|
21
|
+
if (L === -1)
|
|
20
22
|
break;
|
|
21
|
-
const T = g.indexOf(";", E),
|
|
22
|
-
if (
|
|
23
|
-
E = g.lastIndexOf(";",
|
|
23
|
+
const T = g.indexOf(";", E), O = T === -1 ? C : T;
|
|
24
|
+
if (L > O) {
|
|
25
|
+
E = g.lastIndexOf(";", L - 1) + 1;
|
|
24
26
|
continue;
|
|
25
27
|
}
|
|
26
|
-
const
|
|
28
|
+
const U = s(g, E, L), f = u(g, L, U), A = g.slice(U, f);
|
|
27
29
|
if (v[A] === void 0) {
|
|
28
|
-
let I = s(g,
|
|
30
|
+
let I = s(g, L + 1, O), $ = u(g, O, I);
|
|
29
31
|
const W = x(g.slice(I, $));
|
|
30
32
|
v[A] = W;
|
|
31
33
|
}
|
|
32
|
-
E =
|
|
33
|
-
} while (E <
|
|
34
|
+
E = O + 1;
|
|
35
|
+
} while (E < C);
|
|
34
36
|
return v;
|
|
35
37
|
}
|
|
36
38
|
function s(g, p, v) {
|
|
37
39
|
do {
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
+
const C = g.charCodeAt(p);
|
|
41
|
+
if (C !== 32 && C !== 9)
|
|
40
42
|
return p;
|
|
41
43
|
} while (++p < v);
|
|
42
44
|
return v;
|
|
43
45
|
}
|
|
44
46
|
function u(g, p, v) {
|
|
45
47
|
for (; p > v; ) {
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
+
const C = g.charCodeAt(--p);
|
|
49
|
+
if (C !== 32 && C !== 9)
|
|
48
50
|
return p + 1;
|
|
49
51
|
}
|
|
50
52
|
return v;
|
|
51
53
|
}
|
|
52
54
|
function c(g, p, v) {
|
|
53
|
-
const
|
|
55
|
+
const C = v?.encode || encodeURIComponent;
|
|
54
56
|
if (!e.test(g))
|
|
55
57
|
throw new TypeError(`argument name is invalid: ${g}`);
|
|
56
|
-
const x =
|
|
58
|
+
const x = C(p);
|
|
57
59
|
if (!t.test(x))
|
|
58
60
|
throw new TypeError(`argument val is invalid: ${p}`);
|
|
59
61
|
let E = g + "=" + x;
|
|
@@ -122,9 +124,9 @@ function Qr() {
|
|
|
122
124
|
function b(g) {
|
|
123
125
|
return n.call(g) === "[object Date]";
|
|
124
126
|
}
|
|
125
|
-
return
|
|
127
|
+
return je;
|
|
126
128
|
}
|
|
127
|
-
|
|
129
|
+
tn();
|
|
128
130
|
/**
|
|
129
131
|
* react-router v7.1.5
|
|
130
132
|
*
|
|
@@ -135,8 +137,8 @@ Qr();
|
|
|
135
137
|
*
|
|
136
138
|
* @license MIT
|
|
137
139
|
*/
|
|
138
|
-
var
|
|
139
|
-
function
|
|
140
|
+
var Qt = "popstate";
|
|
141
|
+
function rn(e = {}) {
|
|
140
142
|
function t(a, n) {
|
|
141
143
|
let { pathname: i, search: l, hash: s } = a.location;
|
|
142
144
|
return Ve(
|
|
@@ -150,14 +152,14 @@ function qr(e = {}) {
|
|
|
150
152
|
function r(a, n) {
|
|
151
153
|
return typeof n == "string" ? n : pe(n);
|
|
152
154
|
}
|
|
153
|
-
return
|
|
155
|
+
return an(
|
|
154
156
|
t,
|
|
155
157
|
r,
|
|
156
158
|
null,
|
|
157
159
|
e
|
|
158
160
|
);
|
|
159
161
|
}
|
|
160
|
-
function
|
|
162
|
+
function N(e, t) {
|
|
161
163
|
if (e === !1 || e === null || typeof e > "u")
|
|
162
164
|
throw new Error(t);
|
|
163
165
|
}
|
|
@@ -170,10 +172,10 @@ function G(e, t) {
|
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
|
-
function
|
|
175
|
+
function nn() {
|
|
174
176
|
return Math.random().toString(36).substring(2, 10);
|
|
175
177
|
}
|
|
176
|
-
function
|
|
178
|
+
function qt(e, t) {
|
|
177
179
|
return {
|
|
178
180
|
usr: e.state,
|
|
179
181
|
key: e.key,
|
|
@@ -191,7 +193,7 @@ function Ve(e, t, r = null, a) {
|
|
|
191
193
|
// full Locations now and avoid the need to run through this flow at all
|
|
192
194
|
// But that's a pretty big refactor to the current test suite so going to
|
|
193
195
|
// keep as is for the time being and just let any incoming keys take precedence
|
|
194
|
-
key: t && t.key || a ||
|
|
196
|
+
key: t && t.key || a || nn()
|
|
195
197
|
};
|
|
196
198
|
}
|
|
197
199
|
function pe({
|
|
@@ -211,7 +213,7 @@ function ye(e) {
|
|
|
211
213
|
}
|
|
212
214
|
return t;
|
|
213
215
|
}
|
|
214
|
-
function
|
|
216
|
+
function an(e, t, r, a = {}) {
|
|
215
217
|
let { window: n = document.defaultView, v5Compat: i = !1 } = a, l = n.history, s = "POP", u = null, c = y();
|
|
216
218
|
c == null && (c = 0, l.replaceState({ ...l.state, idx: c }, ""));
|
|
217
219
|
function y() {
|
|
@@ -220,37 +222,37 @@ function en(e, t, r, a = {}) {
|
|
|
220
222
|
function b() {
|
|
221
223
|
s = "POP";
|
|
222
224
|
let x = y(), E = x == null ? null : x - c;
|
|
223
|
-
c = x, u && u({ action: s, location:
|
|
225
|
+
c = x, u && u({ action: s, location: C.location, delta: E });
|
|
224
226
|
}
|
|
225
227
|
function g(x, E) {
|
|
226
228
|
s = "PUSH";
|
|
227
|
-
let
|
|
229
|
+
let L = Ve(C.location, x, E);
|
|
228
230
|
c = y() + 1;
|
|
229
|
-
let T =
|
|
231
|
+
let T = qt(L, c), O = C.createHref(L);
|
|
230
232
|
try {
|
|
231
|
-
l.pushState(T, "",
|
|
232
|
-
} catch (
|
|
233
|
-
if (
|
|
234
|
-
throw
|
|
235
|
-
n.location.assign(
|
|
233
|
+
l.pushState(T, "", O);
|
|
234
|
+
} catch (U) {
|
|
235
|
+
if (U instanceof DOMException && U.name === "DataCloneError")
|
|
236
|
+
throw U;
|
|
237
|
+
n.location.assign(O);
|
|
236
238
|
}
|
|
237
|
-
i && u && u({ action: s, location:
|
|
239
|
+
i && u && u({ action: s, location: C.location, delta: 1 });
|
|
238
240
|
}
|
|
239
241
|
function p(x, E) {
|
|
240
242
|
s = "REPLACE";
|
|
241
|
-
let
|
|
243
|
+
let L = Ve(C.location, x, E);
|
|
242
244
|
c = y();
|
|
243
|
-
let T =
|
|
244
|
-
l.replaceState(T, "",
|
|
245
|
+
let T = qt(L, c), O = C.createHref(L);
|
|
246
|
+
l.replaceState(T, "", O), i && u && u({ action: s, location: C.location, delta: 0 });
|
|
245
247
|
}
|
|
246
248
|
function v(x) {
|
|
247
|
-
let E = n.location.origin !== "null" ? n.location.origin : n.location.href,
|
|
248
|
-
return
|
|
249
|
+
let E = n.location.origin !== "null" ? n.location.origin : n.location.href, L = typeof x == "string" ? x : pe(x);
|
|
250
|
+
return L = L.replace(/ $/, "%20"), N(
|
|
249
251
|
E,
|
|
250
|
-
`No window.location.(origin|href) available to create URL for href: ${
|
|
251
|
-
), new URL(
|
|
252
|
+
`No window.location.(origin|href) available to create URL for href: ${L}`
|
|
253
|
+
), new URL(L, E);
|
|
252
254
|
}
|
|
253
|
-
let
|
|
255
|
+
let C = {
|
|
254
256
|
get action() {
|
|
255
257
|
return s;
|
|
256
258
|
},
|
|
@@ -260,8 +262,8 @@ function en(e, t, r, a = {}) {
|
|
|
260
262
|
listen(x) {
|
|
261
263
|
if (u)
|
|
262
264
|
throw new Error("A history only accepts one active listener");
|
|
263
|
-
return n.addEventListener(
|
|
264
|
-
n.removeEventListener(
|
|
265
|
+
return n.addEventListener(Qt, b), u = x, () => {
|
|
266
|
+
n.removeEventListener(Qt, b), u = null;
|
|
265
267
|
};
|
|
266
268
|
},
|
|
267
269
|
createHref(x) {
|
|
@@ -282,9 +284,9 @@ function en(e, t, r, a = {}) {
|
|
|
282
284
|
return l.go(x);
|
|
283
285
|
}
|
|
284
286
|
};
|
|
285
|
-
return
|
|
287
|
+
return C;
|
|
286
288
|
}
|
|
287
|
-
var
|
|
289
|
+
var on = /* @__PURE__ */ new Set([
|
|
288
290
|
"lazy",
|
|
289
291
|
"caseSensitive",
|
|
290
292
|
"path",
|
|
@@ -292,19 +294,19 @@ var tn = /* @__PURE__ */ new Set([
|
|
|
292
294
|
"index",
|
|
293
295
|
"children"
|
|
294
296
|
]);
|
|
295
|
-
function
|
|
297
|
+
function ln(e) {
|
|
296
298
|
return e.index === !0;
|
|
297
299
|
}
|
|
298
300
|
function ct(e, t, r = [], a = {}) {
|
|
299
301
|
return e.map((n, i) => {
|
|
300
302
|
let l = [...r, String(i)], s = typeof n.id == "string" ? n.id : l.join("-");
|
|
301
|
-
if (
|
|
303
|
+
if (N(
|
|
302
304
|
n.index !== !0 || !n.children,
|
|
303
305
|
"Cannot specify children on an index route"
|
|
304
|
-
),
|
|
306
|
+
), N(
|
|
305
307
|
!a[s],
|
|
306
308
|
`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`
|
|
307
|
-
),
|
|
309
|
+
), ln(n)) {
|
|
308
310
|
let u = {
|
|
309
311
|
...n,
|
|
310
312
|
...t(n),
|
|
@@ -334,12 +336,12 @@ function st(e, t, r, a) {
|
|
|
334
336
|
let n = typeof t == "string" ? ye(t) : t, i = re(n.pathname || "/", r);
|
|
335
337
|
if (i == null)
|
|
336
338
|
return null;
|
|
337
|
-
let l =
|
|
338
|
-
|
|
339
|
+
let l = gr(e);
|
|
340
|
+
un(l);
|
|
339
341
|
let s = null;
|
|
340
342
|
for (let u = 0; s == null && u < l.length; ++u) {
|
|
341
|
-
let c =
|
|
342
|
-
s =
|
|
343
|
+
let c = bn(i);
|
|
344
|
+
s = vn(
|
|
343
345
|
l[u],
|
|
344
346
|
c,
|
|
345
347
|
a
|
|
@@ -347,7 +349,7 @@ function st(e, t, r, a) {
|
|
|
347
349
|
}
|
|
348
350
|
return s;
|
|
349
351
|
}
|
|
350
|
-
function
|
|
352
|
+
function sn(e, t) {
|
|
351
353
|
let { route: r, pathname: a, params: n } = e;
|
|
352
354
|
return {
|
|
353
355
|
id: r.id,
|
|
@@ -357,7 +359,7 @@ function nn(e, t) {
|
|
|
357
359
|
handle: r.handle
|
|
358
360
|
};
|
|
359
361
|
}
|
|
360
|
-
function
|
|
362
|
+
function gr(e, t = [], r = [], a = "") {
|
|
361
363
|
let n = (i, l, s) => {
|
|
362
364
|
let u = {
|
|
363
365
|
relativePath: s === void 0 ? i.path || "" : s,
|
|
@@ -365,19 +367,19 @@ function yr(e, t = [], r = [], a = "") {
|
|
|
365
367
|
childrenIndex: l,
|
|
366
368
|
route: i
|
|
367
369
|
};
|
|
368
|
-
u.relativePath.startsWith("/") && (
|
|
370
|
+
u.relativePath.startsWith("/") && (N(
|
|
369
371
|
u.relativePath.startsWith(a),
|
|
370
372
|
`Absolute route path "${u.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
371
373
|
), u.relativePath = u.relativePath.slice(a.length));
|
|
372
374
|
let c = ie([a, u.relativePath]), y = r.concat(u);
|
|
373
|
-
i.children && i.children.length > 0 && (
|
|
375
|
+
i.children && i.children.length > 0 && (N(
|
|
374
376
|
// Our types know better, but runtime JS may not!
|
|
375
377
|
// @ts-expect-error
|
|
376
378
|
i.index !== !0,
|
|
377
379
|
`Index routes must not have child routes. Please remove all child routes from route path "${c}".`
|
|
378
|
-
),
|
|
380
|
+
), gr(i.children, t, y, c)), !(i.path == null && !i.index) && t.push({
|
|
379
381
|
path: c,
|
|
380
|
-
score:
|
|
382
|
+
score: yn(c, i.index),
|
|
381
383
|
routesMeta: y
|
|
382
384
|
});
|
|
383
385
|
};
|
|
@@ -385,17 +387,17 @@ function yr(e, t = [], r = [], a = "") {
|
|
|
385
387
|
if (i.path === "" || !i.path?.includes("?"))
|
|
386
388
|
n(i, l);
|
|
387
389
|
else
|
|
388
|
-
for (let s of
|
|
390
|
+
for (let s of vr(i.path))
|
|
389
391
|
n(i, l, s);
|
|
390
392
|
}), t;
|
|
391
393
|
}
|
|
392
|
-
function
|
|
394
|
+
function vr(e) {
|
|
393
395
|
let t = e.split("/");
|
|
394
396
|
if (t.length === 0) return [];
|
|
395
397
|
let [r, ...a] = t, n = r.endsWith("?"), i = r.replace(/\?$/, "");
|
|
396
398
|
if (a.length === 0)
|
|
397
399
|
return n ? [i, ""] : [i];
|
|
398
|
-
let l =
|
|
400
|
+
let l = vr(a.join("/")), s = [];
|
|
399
401
|
return s.push(
|
|
400
402
|
...l.map(
|
|
401
403
|
(u) => u === "" ? i : [i, u].join("/")
|
|
@@ -404,23 +406,23 @@ function gr(e) {
|
|
|
404
406
|
(u) => e.startsWith("/") && u === "" ? "/" : u
|
|
405
407
|
);
|
|
406
408
|
}
|
|
407
|
-
function
|
|
409
|
+
function un(e) {
|
|
408
410
|
e.sort(
|
|
409
|
-
(t, r) => t.score !== r.score ? r.score - t.score :
|
|
411
|
+
(t, r) => t.score !== r.score ? r.score - t.score : gn(
|
|
410
412
|
t.routesMeta.map((a) => a.childrenIndex),
|
|
411
413
|
r.routesMeta.map((a) => a.childrenIndex)
|
|
412
414
|
)
|
|
413
415
|
);
|
|
414
416
|
}
|
|
415
|
-
var
|
|
416
|
-
function
|
|
417
|
+
var dn = /^:[\w-]+$/, cn = 3, fn = 2, hn = 1, mn = 10, pn = -2, Zt = (e) => e === "*";
|
|
418
|
+
function yn(e, t) {
|
|
417
419
|
let r = e.split("/"), a = r.length;
|
|
418
|
-
return r.some(
|
|
419
|
-
(n, i) => n + (
|
|
420
|
+
return r.some(Zt) && (a += pn), t && (a += fn), r.filter((n) => !Zt(n)).reduce(
|
|
421
|
+
(n, i) => n + (dn.test(i) ? cn : i === "" ? hn : mn),
|
|
420
422
|
a
|
|
421
423
|
);
|
|
422
424
|
}
|
|
423
|
-
function
|
|
425
|
+
function gn(e, t) {
|
|
424
426
|
return e.length === t.length && e.slice(0, -1).every((a, n) => a === t[n]) ? (
|
|
425
427
|
// If two routes are siblings, we should try to match the earlier sibling
|
|
426
428
|
// first. This allows people to have fine-grained control over the matching
|
|
@@ -433,7 +435,7 @@ function hn(e, t) {
|
|
|
433
435
|
0
|
|
434
436
|
);
|
|
435
437
|
}
|
|
436
|
-
function
|
|
438
|
+
function vn(e, t, r = !1) {
|
|
437
439
|
let { routesMeta: a } = e, n = {}, i = "/", l = [];
|
|
438
440
|
for (let s = 0; s < a.length; ++s) {
|
|
439
441
|
let u = a[s], c = s === a.length - 1, y = i === "/" ? t : t.slice(i.length) || "/", b = ft(
|
|
@@ -453,7 +455,7 @@ function mn(e, t, r = !1) {
|
|
|
453
455
|
// TODO: Can this as be avoided?
|
|
454
456
|
params: n,
|
|
455
457
|
pathname: ie([i, b.pathname]),
|
|
456
|
-
pathnameBase:
|
|
458
|
+
pathnameBase: xn(
|
|
457
459
|
ie([i, b.pathnameBase])
|
|
458
460
|
),
|
|
459
461
|
route: g
|
|
@@ -463,7 +465,7 @@ function mn(e, t, r = !1) {
|
|
|
463
465
|
}
|
|
464
466
|
function ft(e, t) {
|
|
465
467
|
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
466
|
-
let [r, a] =
|
|
468
|
+
let [r, a] = wn(
|
|
467
469
|
e.path,
|
|
468
470
|
e.caseSensitive,
|
|
469
471
|
e.end
|
|
@@ -487,7 +489,7 @@ function ft(e, t) {
|
|
|
487
489
|
pattern: e
|
|
488
490
|
};
|
|
489
491
|
}
|
|
490
|
-
function
|
|
492
|
+
function wn(e, t = !1, r = !0) {
|
|
491
493
|
G(
|
|
492
494
|
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
493
495
|
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
@@ -498,7 +500,7 @@ function pn(e, t = !1, r = !0) {
|
|
|
498
500
|
);
|
|
499
501
|
return e.endsWith("*") ? (a.push({ paramName: "*" }), n += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? n += "\\/*$" : e !== "" && e !== "/" && (n += "(?:(?=\\/|$))"), [new RegExp(n, t ? void 0 : "i"), a];
|
|
500
502
|
}
|
|
501
|
-
function
|
|
503
|
+
function bn(e) {
|
|
502
504
|
try {
|
|
503
505
|
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
504
506
|
} catch (t) {
|
|
@@ -515,51 +517,51 @@ function re(e, t) {
|
|
|
515
517
|
let r = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(r);
|
|
516
518
|
return a && a !== "/" ? null : e.slice(r) || "/";
|
|
517
519
|
}
|
|
518
|
-
function
|
|
520
|
+
function En(e, t = "/") {
|
|
519
521
|
let {
|
|
520
522
|
pathname: r,
|
|
521
523
|
search: a = "",
|
|
522
524
|
hash: n = ""
|
|
523
525
|
} = typeof e == "string" ? ye(e) : e;
|
|
524
526
|
return {
|
|
525
|
-
pathname: r ? r.startsWith("/") ? r :
|
|
526
|
-
search:
|
|
527
|
-
hash:
|
|
527
|
+
pathname: r ? r.startsWith("/") ? r : Rn(r, t) : t,
|
|
528
|
+
search: Sn(a),
|
|
529
|
+
hash: Cn(n)
|
|
528
530
|
};
|
|
529
531
|
}
|
|
530
|
-
function
|
|
532
|
+
function Rn(e, t) {
|
|
531
533
|
let r = t.replace(/\/+$/, "").split("/");
|
|
532
534
|
return e.split("/").forEach((n) => {
|
|
533
535
|
n === ".." ? r.length > 1 && r.pop() : n !== "." && r.push(n);
|
|
534
536
|
}), r.length > 1 ? r.join("/") : "/";
|
|
535
537
|
}
|
|
536
|
-
function
|
|
538
|
+
function Et(e, t, r, a) {
|
|
537
539
|
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
|
|
538
540
|
a
|
|
539
541
|
)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
540
542
|
}
|
|
541
|
-
function
|
|
543
|
+
function wr(e) {
|
|
542
544
|
return e.filter(
|
|
543
545
|
(t, r) => r === 0 || t.route.path && t.route.path.length > 0
|
|
544
546
|
);
|
|
545
547
|
}
|
|
546
|
-
function
|
|
547
|
-
let t =
|
|
548
|
+
function Dt(e) {
|
|
549
|
+
let t = wr(e);
|
|
548
550
|
return t.map(
|
|
549
551
|
(r, a) => a === t.length - 1 ? r.pathname : r.pathnameBase
|
|
550
552
|
);
|
|
551
553
|
}
|
|
552
|
-
function
|
|
554
|
+
function Mt(e, t, r, a = !1) {
|
|
553
555
|
let n;
|
|
554
|
-
typeof e == "string" ? n = ye(e) : (n = { ...e },
|
|
556
|
+
typeof e == "string" ? n = ye(e) : (n = { ...e }, N(
|
|
555
557
|
!n.pathname || !n.pathname.includes("?"),
|
|
556
|
-
|
|
557
|
-
),
|
|
558
|
+
Et("?", "pathname", "search", n)
|
|
559
|
+
), N(
|
|
558
560
|
!n.pathname || !n.pathname.includes("#"),
|
|
559
|
-
|
|
560
|
-
),
|
|
561
|
+
Et("#", "pathname", "hash", n)
|
|
562
|
+
), N(
|
|
561
563
|
!n.search || !n.search.includes("#"),
|
|
562
|
-
|
|
564
|
+
Et("#", "search", "hash", n)
|
|
563
565
|
));
|
|
564
566
|
let i = e === "" || n.pathname === "", l = i ? "/" : n.pathname, s;
|
|
565
567
|
if (l == null)
|
|
@@ -574,10 +576,10 @@ function Dt(e, t, r, a = !1) {
|
|
|
574
576
|
}
|
|
575
577
|
s = b >= 0 ? t[b] : "/";
|
|
576
578
|
}
|
|
577
|
-
let u =
|
|
579
|
+
let u = En(n, s), c = l && l !== "/" && l.endsWith("/"), y = (i || l === ".") && r.endsWith("/");
|
|
578
580
|
return !u.pathname.endsWith("/") && (c || y) && (u.pathname += "/"), u;
|
|
579
581
|
}
|
|
580
|
-
var ie = (e) => e.join("/").replace(/\/\/+/g, "/"),
|
|
582
|
+
var ie = (e) => e.join("/").replace(/\/\/+/g, "/"), xn = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Sn = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Cn = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, ht = class {
|
|
581
583
|
constructor(e, t, r, a = !1) {
|
|
582
584
|
this.status = e, this.statusText = t || "", this.internal = a, r instanceof Error ? (this.data = r.toString(), this.error = r) : this.data = r;
|
|
583
585
|
}
|
|
@@ -585,17 +587,17 @@ var ie = (e) => e.join("/").replace(/\/\/+/g, "/"), wn = (e) => e.replace(/\/+$/
|
|
|
585
587
|
function Ke(e) {
|
|
586
588
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
587
589
|
}
|
|
588
|
-
var
|
|
590
|
+
var br = [
|
|
589
591
|
"POST",
|
|
590
592
|
"PUT",
|
|
591
593
|
"PATCH",
|
|
592
594
|
"DELETE"
|
|
593
|
-
],
|
|
594
|
-
|
|
595
|
-
),
|
|
595
|
+
], Ln = new Set(
|
|
596
|
+
br
|
|
597
|
+
), Pn = [
|
|
596
598
|
"GET",
|
|
597
|
-
...
|
|
598
|
-
],
|
|
599
|
+
...br
|
|
600
|
+
], Dn = new Set(Pn), Mn = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]), Tn = /* @__PURE__ */ new Set([307, 308]), Rt = {
|
|
599
601
|
state: "idle",
|
|
600
602
|
location: void 0,
|
|
601
603
|
formMethod: void 0,
|
|
@@ -604,7 +606,7 @@ var wr = [
|
|
|
604
606
|
formData: void 0,
|
|
605
607
|
json: void 0,
|
|
606
608
|
text: void 0
|
|
607
|
-
},
|
|
609
|
+
}, Fn = {
|
|
608
610
|
state: "idle",
|
|
609
611
|
data: void 0,
|
|
610
612
|
formMethod: void 0,
|
|
@@ -618,27 +620,27 @@ var wr = [
|
|
|
618
620
|
proceed: void 0,
|
|
619
621
|
reset: void 0,
|
|
620
622
|
location: void 0
|
|
621
|
-
},
|
|
623
|
+
}, Tt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, kn = (e) => ({
|
|
622
624
|
hasErrorBoundary: !!e.hasErrorBoundary
|
|
623
|
-
}),
|
|
624
|
-
function
|
|
625
|
+
}), Er = "remix-router-transitions", Rr = Symbol("ResetLoaderData");
|
|
626
|
+
function $n(e) {
|
|
625
627
|
const t = e.window ? e.window : typeof window < "u" ? window : void 0, r = typeof t < "u" && typeof t.document < "u" && typeof t.document.createElement < "u";
|
|
626
|
-
|
|
628
|
+
N(
|
|
627
629
|
e.routes.length > 0,
|
|
628
630
|
"You must provide a non-empty routes array to createRouter"
|
|
629
631
|
);
|
|
630
|
-
let a = e.mapRouteProperties ||
|
|
632
|
+
let a = e.mapRouteProperties || kn, n = {}, i = ct(
|
|
631
633
|
e.routes,
|
|
632
634
|
a,
|
|
633
635
|
void 0,
|
|
634
636
|
n
|
|
635
|
-
), l, s = e.basename || "/", u = e.dataStrategy ||
|
|
637
|
+
), l, s = e.basename || "/", u = e.dataStrategy || In, c = e.patchRoutesOnNavigation, y = {
|
|
636
638
|
...e.future
|
|
637
|
-
}, b = null, g = /* @__PURE__ */ new Set(), p = null, v = null,
|
|
639
|
+
}, b = null, g = /* @__PURE__ */ new Set(), p = null, v = null, C = null, x = e.hydrationData != null, E = me(i, e.history.location, s), L = !1, T = null;
|
|
638
640
|
if (E == null && !c) {
|
|
639
641
|
let o = ee(404, {
|
|
640
642
|
pathname: e.history.location.pathname
|
|
641
|
-
}), { matches: d, route: h } =
|
|
643
|
+
}), { matches: d, route: h } = dr(i);
|
|
642
644
|
E = d, T = { [h.id]: o };
|
|
643
645
|
}
|
|
644
646
|
E && !e.hydrationData && tt(
|
|
@@ -646,39 +648,39 @@ function Mn(e) {
|
|
|
646
648
|
i,
|
|
647
649
|
e.history.location.pathname
|
|
648
650
|
).active && (E = null);
|
|
649
|
-
let
|
|
651
|
+
let O;
|
|
650
652
|
if (E)
|
|
651
653
|
if (E.some((o) => o.route.lazy))
|
|
652
|
-
|
|
654
|
+
O = !1;
|
|
653
655
|
else if (!E.some((o) => o.route.loader))
|
|
654
|
-
|
|
656
|
+
O = !0;
|
|
655
657
|
else {
|
|
656
658
|
let o = e.hydrationData ? e.hydrationData.loaderData : null, d = e.hydrationData ? e.hydrationData.errors : null;
|
|
657
659
|
if (d) {
|
|
658
660
|
let h = E.findIndex(
|
|
659
661
|
(w) => d[w.route.id] !== void 0
|
|
660
662
|
);
|
|
661
|
-
|
|
663
|
+
O = E.slice(0, h + 1).every((w) => !Lt(w.route, o, d));
|
|
662
664
|
} else
|
|
663
|
-
|
|
665
|
+
O = E.every(
|
|
664
666
|
(h) => !Lt(h.route, o, d)
|
|
665
667
|
);
|
|
666
668
|
}
|
|
667
669
|
else {
|
|
668
|
-
|
|
670
|
+
O = !1, E = [];
|
|
669
671
|
let o = tt(
|
|
670
672
|
null,
|
|
671
673
|
i,
|
|
672
674
|
e.history.location.pathname
|
|
673
675
|
);
|
|
674
|
-
o.active && o.matches && (
|
|
676
|
+
o.active && o.matches && (L = !0, E = o.matches);
|
|
675
677
|
}
|
|
676
|
-
let
|
|
678
|
+
let U, f = {
|
|
677
679
|
historyAction: e.history.action,
|
|
678
680
|
location: e.history.location,
|
|
679
681
|
matches: E,
|
|
680
|
-
initialized:
|
|
681
|
-
navigation:
|
|
682
|
+
initialized: O,
|
|
683
|
+
navigation: Rt,
|
|
682
684
|
// Don't restore on initial updateState() if we were SSR'd
|
|
683
685
|
restoreScrollPosition: e.hydrationData != null ? !1 : null,
|
|
684
686
|
preventScrollReset: !1,
|
|
@@ -688,7 +690,7 @@ function Mn(e) {
|
|
|
688
690
|
errors: e.hydrationData && e.hydrationData.errors || T,
|
|
689
691
|
fetchers: /* @__PURE__ */ new Map(),
|
|
690
692
|
blockers: /* @__PURE__ */ new Map()
|
|
691
|
-
}, A = "POP", I = !1, $, W = !1, Q = /* @__PURE__ */ new Map(), ke = null, Xe = !1, ge = !1, Qe = /* @__PURE__ */ new Set(), Y = /* @__PURE__ */ new Map(), qe = 0, $e = -1,
|
|
693
|
+
}, A = "POP", I = !1, $, W = !1, Q = /* @__PURE__ */ new Map(), ke = null, Xe = !1, ge = !1, Qe = /* @__PURE__ */ new Set(), Y = /* @__PURE__ */ new Map(), qe = 0, $e = -1, Le = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), Pe = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Set(), ve = /* @__PURE__ */ new Map(), Ze, Oe = null;
|
|
692
694
|
function Ur() {
|
|
693
695
|
if (b = e.history.listen(
|
|
694
696
|
({ action: o, location: d, delta: h }) => {
|
|
@@ -700,7 +702,7 @@ function Mn(e) {
|
|
|
700
702
|
ve.size === 0 || h != null,
|
|
701
703
|
"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL."
|
|
702
704
|
);
|
|
703
|
-
let w =
|
|
705
|
+
let w = Kt({
|
|
704
706
|
currentLocation: f.location,
|
|
705
707
|
nextLocation: d,
|
|
706
708
|
historyAction: o
|
|
@@ -730,18 +732,18 @@ function Mn(e) {
|
|
|
730
732
|
return we(o, d);
|
|
731
733
|
}
|
|
732
734
|
), r) {
|
|
733
|
-
|
|
734
|
-
let o = () =>
|
|
735
|
+
Gn(t, Q);
|
|
736
|
+
let o = () => Xn(t, Q);
|
|
735
737
|
t.addEventListener("pagehide", o), ke = () => t.removeEventListener("pagehide", o);
|
|
736
738
|
}
|
|
737
739
|
return f.initialized || we("POP", f.location, {
|
|
738
740
|
initialHydration: !0
|
|
739
|
-
}),
|
|
741
|
+
}), U;
|
|
740
742
|
}
|
|
741
|
-
function
|
|
742
|
-
b && b(), ke && ke(), g.clear(), $ && $.abort(), f.fetchers.forEach((o, d) => gt(d)), f.blockers.forEach((o, d) =>
|
|
743
|
+
function Ar() {
|
|
744
|
+
b && b(), ke && ke(), g.clear(), $ && $.abort(), f.fetchers.forEach((o, d) => gt(d)), f.blockers.forEach((o, d) => Vt(d));
|
|
743
745
|
}
|
|
744
|
-
function
|
|
746
|
+
function Ir(o) {
|
|
745
747
|
return g.add(o), () => g.delete(o);
|
|
746
748
|
}
|
|
747
749
|
function q(o, d = {}) {
|
|
@@ -765,7 +767,7 @@ function Mn(e) {
|
|
|
765
767
|
function De(o, d, { flushSync: h } = {}) {
|
|
766
768
|
let w = f.actionData != null && f.navigation.formMethod != null && te(f.navigation.formMethod) && f.navigation.state === "loading" && o.state?._isRedirect !== !0, S;
|
|
767
769
|
d.actionData ? Object.keys(d.actionData).length > 0 ? S = d.actionData : S = null : w ? S = f.actionData : S = null;
|
|
768
|
-
let M = d.loaderData ?
|
|
770
|
+
let M = d.loaderData ? sr(
|
|
769
771
|
f.loaderData,
|
|
770
772
|
d.loaderData,
|
|
771
773
|
d.matches || [],
|
|
@@ -800,9 +802,9 @@ function Mn(e) {
|
|
|
800
802
|
historyAction: A,
|
|
801
803
|
location: o,
|
|
802
804
|
initialized: !0,
|
|
803
|
-
navigation:
|
|
805
|
+
navigation: Rt,
|
|
804
806
|
revalidation: "idle",
|
|
805
|
-
restoreScrollPosition:
|
|
807
|
+
restoreScrollPosition: Jt(
|
|
806
808
|
o,
|
|
807
809
|
d.matches || f.matches
|
|
808
810
|
),
|
|
@@ -813,21 +815,21 @@ function Mn(e) {
|
|
|
813
815
|
viewTransitionOpts: D,
|
|
814
816
|
flushSync: h === !0
|
|
815
817
|
}
|
|
816
|
-
), A = "POP", I = !1, W = !1, Xe = !1, ge = !1,
|
|
818
|
+
), A = "POP", I = !1, W = !1, Xe = !1, ge = !1, Oe?.resolve(), Oe = null;
|
|
817
819
|
}
|
|
818
|
-
async function
|
|
820
|
+
async function It(o, d) {
|
|
819
821
|
if (typeof o == "number") {
|
|
820
822
|
e.history.go(o);
|
|
821
823
|
return;
|
|
822
824
|
}
|
|
823
|
-
let h =
|
|
825
|
+
let h = Ct(
|
|
824
826
|
f.location,
|
|
825
827
|
f.matches,
|
|
826
828
|
s,
|
|
827
829
|
o,
|
|
828
830
|
d?.fromRouteId,
|
|
829
831
|
d?.relative
|
|
830
|
-
), { path: w, submission: S, error: M } =
|
|
832
|
+
), { path: w, submission: S, error: M } = er(
|
|
831
833
|
!1,
|
|
832
834
|
h,
|
|
833
835
|
d
|
|
@@ -838,7 +840,7 @@ function Mn(e) {
|
|
|
838
840
|
};
|
|
839
841
|
let D = d && d.replace != null ? d.replace : void 0, R = "PUSH";
|
|
840
842
|
D === !0 ? R = "REPLACE" : D === !1 || S != null && te(S.formMethod) && S.formAction === f.location.pathname + f.location.search && (R = "REPLACE");
|
|
841
|
-
let k = d && "preventScrollReset" in d ? d.preventScrollReset === !0 : void 0,
|
|
843
|
+
let k = d && "preventScrollReset" in d ? d.preventScrollReset === !0 : void 0, H = (d && d.flushSync) === !0, B = Kt({
|
|
842
844
|
currentLocation: F,
|
|
843
845
|
nextLocation: P,
|
|
844
846
|
historyAction: R
|
|
@@ -853,7 +855,7 @@ function Mn(e) {
|
|
|
853
855
|
proceed: void 0,
|
|
854
856
|
reset: void 0,
|
|
855
857
|
location: P
|
|
856
|
-
}),
|
|
858
|
+
}), It(o, d);
|
|
857
859
|
},
|
|
858
860
|
reset() {
|
|
859
861
|
let J = new Map(f.blockers);
|
|
@@ -870,12 +872,12 @@ function Mn(e) {
|
|
|
870
872
|
preventScrollReset: k,
|
|
871
873
|
replace: d && d.replace,
|
|
872
874
|
enableViewTransition: d && d.viewTransition,
|
|
873
|
-
flushSync:
|
|
875
|
+
flushSync: H
|
|
874
876
|
});
|
|
875
877
|
}
|
|
876
|
-
function
|
|
877
|
-
|
|
878
|
-
let o =
|
|
878
|
+
function Hr() {
|
|
879
|
+
Oe || (Oe = Qn()), yt(), q({ revalidation: "loading" });
|
|
880
|
+
let o = Oe.promise;
|
|
879
881
|
return f.navigation.state === "submitting" ? o : f.navigation.state === "idle" ? (we(f.historyAction, f.location, {
|
|
880
882
|
startUninterruptedRevalidation: !0
|
|
881
883
|
}), o) : (we(
|
|
@@ -889,12 +891,12 @@ function Mn(e) {
|
|
|
889
891
|
), o);
|
|
890
892
|
}
|
|
891
893
|
async function we(o, d, h) {
|
|
892
|
-
$ && $.abort(), $ = null, A = o, Xe = (h && h.startUninterruptedRevalidation) === !0,
|
|
893
|
-
let w = l || i, S = h && h.overrideNavigation, M = h?.initialHydration && f.matches && f.matches.length > 0 && !
|
|
894
|
+
$ && $.abort(), $ = null, A = o, Xe = (h && h.startUninterruptedRevalidation) === !0, Gr(f.location, f.matches), I = (h && h.preventScrollReset) === !0, W = (h && h.enableViewTransition) === !0;
|
|
895
|
+
let w = l || i, S = h && h.overrideNavigation, M = h?.initialHydration && f.matches && f.matches.length > 0 && !L ? (
|
|
894
896
|
// `matchRoutes()` has already been called if we're in here via `router.initialize()`
|
|
895
897
|
f.matches
|
|
896
898
|
) : me(w, d, s), F = (h && h.flushSync) === !0;
|
|
897
|
-
if (M && f.initialized && !ge &&
|
|
899
|
+
if (M && f.initialized && !ge && Wn(f.location, d) && !(h && h.submission && te(h.submission.formMethod))) {
|
|
898
900
|
De(d, { matches: M }, { flushSync: F });
|
|
899
901
|
return;
|
|
900
902
|
}
|
|
@@ -929,7 +931,7 @@ function Mn(e) {
|
|
|
929
931
|
{ type: "error", error: h.pendingError }
|
|
930
932
|
];
|
|
931
933
|
else if (h && h.submission && te(h.submission.formMethod)) {
|
|
932
|
-
let _ = await
|
|
934
|
+
let _ = await jr(
|
|
933
935
|
D,
|
|
934
936
|
d,
|
|
935
937
|
h.submission,
|
|
@@ -952,7 +954,7 @@ function Mn(e) {
|
|
|
952
954
|
return;
|
|
953
955
|
}
|
|
954
956
|
}
|
|
955
|
-
M = _.matches || M, R = _.pendingActionResult, S =
|
|
957
|
+
M = _.matches || M, R = _.pendingActionResult, S = xt(d, h.submission), F = !1, P.active = !1, D = Fe(
|
|
956
958
|
e.history,
|
|
957
959
|
D.url,
|
|
958
960
|
D.signal
|
|
@@ -960,10 +962,10 @@ function Mn(e) {
|
|
|
960
962
|
}
|
|
961
963
|
let {
|
|
962
964
|
shortCircuited: k,
|
|
963
|
-
matches:
|
|
965
|
+
matches: H,
|
|
964
966
|
loaderData: B,
|
|
965
967
|
errors: J
|
|
966
|
-
} = await
|
|
968
|
+
} = await zr(
|
|
967
969
|
D,
|
|
968
970
|
d,
|
|
969
971
|
M,
|
|
@@ -977,15 +979,15 @@ function Mn(e) {
|
|
|
977
979
|
R
|
|
978
980
|
);
|
|
979
981
|
k || ($ = null, De(d, {
|
|
980
|
-
matches:
|
|
981
|
-
...
|
|
982
|
+
matches: H || M,
|
|
983
|
+
...ur(R),
|
|
982
984
|
loaderData: B,
|
|
983
985
|
errors: J
|
|
984
986
|
}));
|
|
985
987
|
}
|
|
986
|
-
async function
|
|
988
|
+
async function jr(o, d, h, w, S, M = {}) {
|
|
987
989
|
yt();
|
|
988
|
-
let F =
|
|
990
|
+
let F = Yn(d, h);
|
|
989
991
|
if (q({ navigation: F }, { flushSync: M.flushSync === !0 }), S) {
|
|
990
992
|
let R = await rt(
|
|
991
993
|
w,
|
|
@@ -1009,7 +1011,7 @@ function Mn(e) {
|
|
|
1009
1011
|
} else if (R.matches)
|
|
1010
1012
|
w = R.matches;
|
|
1011
1013
|
else {
|
|
1012
|
-
let { notFoundMatches: k, error:
|
|
1014
|
+
let { notFoundMatches: k, error: H, route: B } = vt(
|
|
1013
1015
|
d.pathname
|
|
1014
1016
|
);
|
|
1015
1017
|
return {
|
|
@@ -1018,7 +1020,7 @@ function Mn(e) {
|
|
|
1018
1020
|
B.id,
|
|
1019
1021
|
{
|
|
1020
1022
|
type: "error",
|
|
1021
|
-
error:
|
|
1023
|
+
error: H
|
|
1022
1024
|
}
|
|
1023
1025
|
]
|
|
1024
1026
|
};
|
|
@@ -1034,7 +1036,7 @@ function Mn(e) {
|
|
|
1034
1036
|
routeId: D.route.id
|
|
1035
1037
|
})
|
|
1036
1038
|
};
|
|
1037
|
-
else if (P = (await
|
|
1039
|
+
else if (P = (await Ue(
|
|
1038
1040
|
"action",
|
|
1039
1041
|
f,
|
|
1040
1042
|
o,
|
|
@@ -1045,7 +1047,7 @@ function Mn(e) {
|
|
|
1045
1047
|
return { shortCircuited: !0 };
|
|
1046
1048
|
if (xe(P)) {
|
|
1047
1049
|
let R;
|
|
1048
|
-
return M && M.replace != null ? R = M.replace : R =
|
|
1050
|
+
return M && M.replace != null ? R = M.replace : R = ir(
|
|
1049
1051
|
P.response.headers.get("Location"),
|
|
1050
1052
|
new URL(o.url),
|
|
1051
1053
|
s
|
|
@@ -1066,14 +1068,14 @@ function Mn(e) {
|
|
|
1066
1068
|
pendingActionResult: [D.route.id, P]
|
|
1067
1069
|
};
|
|
1068
1070
|
}
|
|
1069
|
-
async function
|
|
1070
|
-
let
|
|
1071
|
+
async function zr(o, d, h, w, S, M, F, P, D, R, k) {
|
|
1072
|
+
let H = S || xt(d, M), B = M || F || fr(H), J = !Xe && !D;
|
|
1071
1073
|
if (w) {
|
|
1072
1074
|
if (J) {
|
|
1073
|
-
let X =
|
|
1075
|
+
let X = Ht(k);
|
|
1074
1076
|
q(
|
|
1075
1077
|
{
|
|
1076
|
-
navigation:
|
|
1078
|
+
navigation: H,
|
|
1077
1079
|
...X !== void 0 ? { actionData: X } : {}
|
|
1078
1080
|
},
|
|
1079
1081
|
{
|
|
@@ -1081,38 +1083,38 @@ function Mn(e) {
|
|
|
1081
1083
|
}
|
|
1082
1084
|
);
|
|
1083
1085
|
}
|
|
1084
|
-
let
|
|
1086
|
+
let j = await rt(
|
|
1085
1087
|
h,
|
|
1086
1088
|
d.pathname,
|
|
1087
1089
|
o.signal
|
|
1088
1090
|
);
|
|
1089
|
-
if (
|
|
1091
|
+
if (j.type === "aborted")
|
|
1090
1092
|
return { shortCircuited: !0 };
|
|
1091
|
-
if (
|
|
1092
|
-
let X = Re(
|
|
1093
|
+
if (j.type === "error") {
|
|
1094
|
+
let X = Re(j.partialMatches).route.id;
|
|
1093
1095
|
return {
|
|
1094
|
-
matches:
|
|
1096
|
+
matches: j.partialMatches,
|
|
1095
1097
|
loaderData: {},
|
|
1096
1098
|
errors: {
|
|
1097
|
-
[X]:
|
|
1099
|
+
[X]: j.error
|
|
1098
1100
|
}
|
|
1099
1101
|
};
|
|
1100
|
-
} else if (
|
|
1101
|
-
h =
|
|
1102
|
+
} else if (j.matches)
|
|
1103
|
+
h = j.matches;
|
|
1102
1104
|
else {
|
|
1103
|
-
let { error: X, notFoundMatches: it, route:
|
|
1105
|
+
let { error: X, notFoundMatches: it, route: He } = vt(
|
|
1104
1106
|
d.pathname
|
|
1105
1107
|
);
|
|
1106
1108
|
return {
|
|
1107
1109
|
matches: it,
|
|
1108
1110
|
loaderData: {},
|
|
1109
1111
|
errors: {
|
|
1110
|
-
[
|
|
1112
|
+
[He.id]: X
|
|
1111
1113
|
}
|
|
1112
1114
|
};
|
|
1113
1115
|
}
|
|
1114
1116
|
}
|
|
1115
|
-
let _ = l || i, [z, K] =
|
|
1117
|
+
let _ = l || i, [z, K] = rr(
|
|
1116
1118
|
e.history,
|
|
1117
1119
|
f,
|
|
1118
1120
|
h,
|
|
@@ -1123,13 +1125,13 @@ function Mn(e) {
|
|
|
1123
1125
|
Qe,
|
|
1124
1126
|
ne,
|
|
1125
1127
|
Pe,
|
|
1126
|
-
|
|
1128
|
+
se,
|
|
1127
1129
|
_,
|
|
1128
1130
|
s,
|
|
1129
1131
|
k
|
|
1130
1132
|
);
|
|
1131
1133
|
if ($e = ++qe, z.length === 0 && K.length === 0) {
|
|
1132
|
-
let
|
|
1134
|
+
let j = Bt();
|
|
1133
1135
|
return De(
|
|
1134
1136
|
d,
|
|
1135
1137
|
{
|
|
@@ -1137,30 +1139,30 @@ function Mn(e) {
|
|
|
1137
1139
|
loaderData: {},
|
|
1138
1140
|
// Commit pending error if we're short circuiting
|
|
1139
1141
|
errors: k && Z(k[1]) ? { [k[0]]: k[1].error } : null,
|
|
1140
|
-
...
|
|
1141
|
-
...
|
|
1142
|
+
...ur(k),
|
|
1143
|
+
...j ? { fetchers: new Map(f.fetchers) } : {}
|
|
1142
1144
|
},
|
|
1143
1145
|
{ flushSync: R }
|
|
1144
1146
|
), { shortCircuited: !0 };
|
|
1145
1147
|
}
|
|
1146
1148
|
if (J) {
|
|
1147
|
-
let
|
|
1149
|
+
let j = {};
|
|
1148
1150
|
if (!w) {
|
|
1149
|
-
|
|
1150
|
-
let X =
|
|
1151
|
-
X !== void 0 && (
|
|
1151
|
+
j.navigation = H;
|
|
1152
|
+
let X = Ht(k);
|
|
1153
|
+
X !== void 0 && (j.actionData = X);
|
|
1152
1154
|
}
|
|
1153
|
-
K.length > 0 && (
|
|
1155
|
+
K.length > 0 && (j.fetchers = _r(K)), q(j, { flushSync: R });
|
|
1154
1156
|
}
|
|
1155
|
-
K.forEach((
|
|
1156
|
-
fe(
|
|
1157
|
+
K.forEach((j) => {
|
|
1158
|
+
fe(j.key), j.controller && Y.set(j.key, j.controller);
|
|
1157
1159
|
});
|
|
1158
|
-
let Me = () => K.forEach((
|
|
1160
|
+
let Me = () => K.forEach((j) => fe(j.key));
|
|
1159
1161
|
$ && $.signal.addEventListener(
|
|
1160
1162
|
"abort",
|
|
1161
1163
|
Me
|
|
1162
1164
|
);
|
|
1163
|
-
let { loaderResults: Ae, fetcherResults:
|
|
1165
|
+
let { loaderResults: Ae, fetcherResults: de } = await jt(
|
|
1164
1166
|
f,
|
|
1165
1167
|
h,
|
|
1166
1168
|
z,
|
|
@@ -1172,26 +1174,26 @@ function Mn(e) {
|
|
|
1172
1174
|
$ && $.signal.removeEventListener(
|
|
1173
1175
|
"abort",
|
|
1174
1176
|
Me
|
|
1175
|
-
), K.forEach((
|
|
1177
|
+
), K.forEach((j) => Y.delete(j.key));
|
|
1176
1178
|
let ae = ot(Ae);
|
|
1177
1179
|
if (ae)
|
|
1178
1180
|
return await be(o, ae.result, !0, {
|
|
1179
1181
|
replace: P
|
|
1180
1182
|
}), { shortCircuited: !0 };
|
|
1181
|
-
if (ae = ot(
|
|
1182
|
-
return
|
|
1183
|
+
if (ae = ot(de), ae)
|
|
1184
|
+
return se.add(ae.key), await be(o, ae.result, !0, {
|
|
1183
1185
|
replace: P
|
|
1184
1186
|
}), { shortCircuited: !0 };
|
|
1185
|
-
let { loaderData: wt, errors: Ie } =
|
|
1187
|
+
let { loaderData: wt, errors: Ie } = lr(
|
|
1186
1188
|
f,
|
|
1187
1189
|
h,
|
|
1188
1190
|
Ae,
|
|
1189
1191
|
k,
|
|
1190
1192
|
K,
|
|
1191
|
-
|
|
1193
|
+
de
|
|
1192
1194
|
);
|
|
1193
1195
|
D && f.errors && (Ie = { ...f.errors, ...Ie });
|
|
1194
|
-
let Ee =
|
|
1196
|
+
let Ee = Bt(), nt = Wt($e), at = Ee || nt || K.length > 0;
|
|
1195
1197
|
return {
|
|
1196
1198
|
matches: h,
|
|
1197
1199
|
loaderData: wt,
|
|
@@ -1199,7 +1201,7 @@ function Mn(e) {
|
|
|
1199
1201
|
...at ? { fetchers: new Map(f.fetchers) } : {}
|
|
1200
1202
|
};
|
|
1201
1203
|
}
|
|
1202
|
-
function
|
|
1204
|
+
function Ht(o) {
|
|
1203
1205
|
if (o && !Z(o[1]))
|
|
1204
1206
|
return {
|
|
1205
1207
|
[o[0]]: o[1].data
|
|
@@ -1207,7 +1209,7 @@ function Mn(e) {
|
|
|
1207
1209
|
if (f.actionData)
|
|
1208
1210
|
return Object.keys(f.actionData).length === 0 ? null : f.actionData;
|
|
1209
1211
|
}
|
|
1210
|
-
function
|
|
1212
|
+
function _r(o) {
|
|
1211
1213
|
return o.forEach((d) => {
|
|
1212
1214
|
let h = f.fetchers.get(d.key), w = _e(
|
|
1213
1215
|
void 0,
|
|
@@ -1216,9 +1218,9 @@ function Mn(e) {
|
|
|
1216
1218
|
f.fetchers.set(d.key, w);
|
|
1217
1219
|
}), new Map(f.fetchers);
|
|
1218
1220
|
}
|
|
1219
|
-
async function
|
|
1221
|
+
async function Br(o, d, h, w) {
|
|
1220
1222
|
fe(o);
|
|
1221
|
-
let S = (w && w.flushSync) === !0, M = l || i, F =
|
|
1223
|
+
let S = (w && w.flushSync) === !0, M = l || i, F = Ct(
|
|
1222
1224
|
f.location,
|
|
1223
1225
|
f.matches,
|
|
1224
1226
|
s,
|
|
@@ -1227,7 +1229,7 @@ function Mn(e) {
|
|
|
1227
1229
|
w?.relative
|
|
1228
1230
|
), P = me(M, F, s), D = tt(P, M, F);
|
|
1229
1231
|
if (D.active && D.matches && (P = D.matches), !P) {
|
|
1230
|
-
|
|
1232
|
+
ue(
|
|
1231
1233
|
o,
|
|
1232
1234
|
d,
|
|
1233
1235
|
ee(404, { pathname: F }),
|
|
@@ -1235,18 +1237,18 @@ function Mn(e) {
|
|
|
1235
1237
|
);
|
|
1236
1238
|
return;
|
|
1237
1239
|
}
|
|
1238
|
-
let { path: R, submission: k, error:
|
|
1240
|
+
let { path: R, submission: k, error: H } = er(
|
|
1239
1241
|
!0,
|
|
1240
1242
|
F,
|
|
1241
1243
|
w
|
|
1242
1244
|
);
|
|
1243
|
-
if (
|
|
1244
|
-
|
|
1245
|
+
if (H) {
|
|
1246
|
+
ue(o, d, H, { flushSync: S });
|
|
1245
1247
|
return;
|
|
1246
1248
|
}
|
|
1247
1249
|
let B = We(P, R), J = (w && w.preventScrollReset) === !0;
|
|
1248
1250
|
if (k && te(k.formMethod)) {
|
|
1249
|
-
await
|
|
1251
|
+
await Wr(
|
|
1250
1252
|
o,
|
|
1251
1253
|
d,
|
|
1252
1254
|
R,
|
|
@@ -1259,7 +1261,7 @@ function Mn(e) {
|
|
|
1259
1261
|
);
|
|
1260
1262
|
return;
|
|
1261
1263
|
}
|
|
1262
|
-
Pe.set(o, { routeId: d, path: R }), await
|
|
1264
|
+
Pe.set(o, { routeId: d, path: R }), await Vr(
|
|
1263
1265
|
o,
|
|
1264
1266
|
d,
|
|
1265
1267
|
R,
|
|
@@ -1271,7 +1273,7 @@ function Mn(e) {
|
|
|
1271
1273
|
k
|
|
1272
1274
|
);
|
|
1273
1275
|
}
|
|
1274
|
-
async function
|
|
1276
|
+
async function Wr(o, d, h, w, S, M, F, P, D) {
|
|
1275
1277
|
yt(), Pe.delete(o);
|
|
1276
1278
|
function R(V) {
|
|
1277
1279
|
if (!V.route.action && !V.route.lazy) {
|
|
@@ -1280,20 +1282,20 @@ function Mn(e) {
|
|
|
1280
1282
|
pathname: h,
|
|
1281
1283
|
routeId: d
|
|
1282
1284
|
});
|
|
1283
|
-
return
|
|
1285
|
+
return ue(o, d, Te, { flushSync: F }), !0;
|
|
1284
1286
|
}
|
|
1285
1287
|
return !1;
|
|
1286
1288
|
}
|
|
1287
1289
|
if (!M && R(w))
|
|
1288
1290
|
return;
|
|
1289
1291
|
let k = f.fetchers.get(o);
|
|
1290
|
-
ce(o,
|
|
1292
|
+
ce(o, Jn(D, k), {
|
|
1291
1293
|
flushSync: F
|
|
1292
1294
|
});
|
|
1293
|
-
let
|
|
1295
|
+
let H = new AbortController(), B = Fe(
|
|
1294
1296
|
e.history,
|
|
1295
1297
|
h,
|
|
1296
|
-
|
|
1298
|
+
H.signal,
|
|
1297
1299
|
D
|
|
1298
1300
|
);
|
|
1299
1301
|
if (M) {
|
|
@@ -1305,13 +1307,13 @@ function Mn(e) {
|
|
|
1305
1307
|
if (V.type === "aborted")
|
|
1306
1308
|
return;
|
|
1307
1309
|
if (V.type === "error") {
|
|
1308
|
-
|
|
1310
|
+
ue(o, d, V.error, { flushSync: F });
|
|
1309
1311
|
return;
|
|
1310
1312
|
} else if (V.matches) {
|
|
1311
1313
|
if (S = V.matches, w = We(S, h), R(w))
|
|
1312
1314
|
return;
|
|
1313
1315
|
} else {
|
|
1314
|
-
|
|
1316
|
+
ue(
|
|
1315
1317
|
o,
|
|
1316
1318
|
d,
|
|
1317
1319
|
ee(404, { pathname: h }),
|
|
@@ -1320,8 +1322,8 @@ function Mn(e) {
|
|
|
1320
1322
|
return;
|
|
1321
1323
|
}
|
|
1322
1324
|
}
|
|
1323
|
-
Y.set(o,
|
|
1324
|
-
let J = qe, z = (await
|
|
1325
|
+
Y.set(o, H);
|
|
1326
|
+
let J = qe, z = (await Ue(
|
|
1325
1327
|
"action",
|
|
1326
1328
|
f,
|
|
1327
1329
|
B,
|
|
@@ -1330,7 +1332,7 @@ function Mn(e) {
|
|
|
1330
1332
|
o
|
|
1331
1333
|
))[w.route.id];
|
|
1332
1334
|
if (B.signal.aborted) {
|
|
1333
|
-
Y.get(o) ===
|
|
1335
|
+
Y.get(o) === H && Y.delete(o);
|
|
1334
1336
|
return;
|
|
1335
1337
|
}
|
|
1336
1338
|
if (ne.has(o)) {
|
|
@@ -1344,29 +1346,29 @@ function Mn(e) {
|
|
|
1344
1346
|
ce(o, he(void 0));
|
|
1345
1347
|
return;
|
|
1346
1348
|
} else
|
|
1347
|
-
return
|
|
1349
|
+
return se.add(o), ce(o, _e(D)), be(B, z, !1, {
|
|
1348
1350
|
fetcherSubmission: D,
|
|
1349
1351
|
preventScrollReset: P
|
|
1350
1352
|
});
|
|
1351
1353
|
if (Z(z)) {
|
|
1352
|
-
|
|
1354
|
+
ue(o, d, z.error);
|
|
1353
1355
|
return;
|
|
1354
1356
|
}
|
|
1355
1357
|
}
|
|
1356
1358
|
let K = f.navigation.location || f.location, Me = Fe(
|
|
1357
1359
|
e.history,
|
|
1358
1360
|
K,
|
|
1359
|
-
|
|
1360
|
-
), Ae = l || i,
|
|
1361
|
-
|
|
1361
|
+
H.signal
|
|
1362
|
+
), Ae = l || i, de = f.navigation.state !== "idle" ? me(Ae, f.navigation.location, s) : f.matches;
|
|
1363
|
+
N(de, "Didn't find any matches after fetcher action");
|
|
1362
1364
|
let ae = ++qe;
|
|
1363
|
-
|
|
1365
|
+
Le.set(o, ae);
|
|
1364
1366
|
let wt = _e(D, z.data);
|
|
1365
1367
|
f.fetchers.set(o, wt);
|
|
1366
|
-
let [Ie, Ee] =
|
|
1368
|
+
let [Ie, Ee] = rr(
|
|
1367
1369
|
e.history,
|
|
1368
1370
|
f,
|
|
1369
|
-
|
|
1371
|
+
de,
|
|
1370
1372
|
D,
|
|
1371
1373
|
K,
|
|
1372
1374
|
!1,
|
|
@@ -1374,36 +1376,36 @@ function Mn(e) {
|
|
|
1374
1376
|
Qe,
|
|
1375
1377
|
ne,
|
|
1376
1378
|
Pe,
|
|
1377
|
-
|
|
1379
|
+
se,
|
|
1378
1380
|
Ae,
|
|
1379
1381
|
s,
|
|
1380
1382
|
[w.route.id, z]
|
|
1381
1383
|
);
|
|
1382
1384
|
Ee.filter((V) => V.key !== o).forEach((V) => {
|
|
1383
|
-
let Te = V.key,
|
|
1385
|
+
let Te = V.key, Gt = f.fetchers.get(Te), qr = _e(
|
|
1384
1386
|
void 0,
|
|
1385
|
-
|
|
1387
|
+
Gt ? Gt.data : void 0
|
|
1386
1388
|
);
|
|
1387
|
-
f.fetchers.set(Te,
|
|
1389
|
+
f.fetchers.set(Te, qr), fe(Te), V.controller && Y.set(Te, V.controller);
|
|
1388
1390
|
}), q({ fetchers: new Map(f.fetchers) });
|
|
1389
1391
|
let nt = () => Ee.forEach((V) => fe(V.key));
|
|
1390
|
-
|
|
1392
|
+
H.signal.addEventListener(
|
|
1391
1393
|
"abort",
|
|
1392
1394
|
nt
|
|
1393
1395
|
);
|
|
1394
|
-
let { loaderResults: at, fetcherResults:
|
|
1396
|
+
let { loaderResults: at, fetcherResults: j } = await jt(
|
|
1395
1397
|
f,
|
|
1396
|
-
|
|
1398
|
+
de,
|
|
1397
1399
|
Ie,
|
|
1398
1400
|
Ee,
|
|
1399
1401
|
Me
|
|
1400
1402
|
);
|
|
1401
|
-
if (
|
|
1403
|
+
if (H.signal.aborted)
|
|
1402
1404
|
return;
|
|
1403
|
-
|
|
1405
|
+
H.signal.removeEventListener(
|
|
1404
1406
|
"abort",
|
|
1405
1407
|
nt
|
|
1406
|
-
),
|
|
1408
|
+
), Le.delete(o), Y.delete(o), Ee.forEach((V) => Y.delete(V.key));
|
|
1407
1409
|
let X = ot(at);
|
|
1408
1410
|
if (X)
|
|
1409
1411
|
return be(
|
|
@@ -1412,42 +1414,42 @@ function Mn(e) {
|
|
|
1412
1414
|
!1,
|
|
1413
1415
|
{ preventScrollReset: P }
|
|
1414
1416
|
);
|
|
1415
|
-
if (X = ot(
|
|
1416
|
-
return
|
|
1417
|
+
if (X = ot(j), X)
|
|
1418
|
+
return se.add(X.key), be(
|
|
1417
1419
|
Me,
|
|
1418
1420
|
X.result,
|
|
1419
1421
|
!1,
|
|
1420
1422
|
{ preventScrollReset: P }
|
|
1421
1423
|
);
|
|
1422
|
-
let { loaderData: it, errors:
|
|
1424
|
+
let { loaderData: it, errors: He } = lr(
|
|
1423
1425
|
f,
|
|
1424
|
-
|
|
1426
|
+
de,
|
|
1425
1427
|
at,
|
|
1426
1428
|
void 0,
|
|
1427
1429
|
Ee,
|
|
1428
|
-
|
|
1430
|
+
j
|
|
1429
1431
|
);
|
|
1430
1432
|
if (f.fetchers.has(o)) {
|
|
1431
1433
|
let V = he(z.data);
|
|
1432
1434
|
f.fetchers.set(o, V);
|
|
1433
1435
|
}
|
|
1434
|
-
|
|
1435
|
-
matches:
|
|
1436
|
+
Wt(ae), f.navigation.state === "loading" && ae > $e ? (N(A, "Expected pending action"), $ && $.abort(), De(f.navigation.location, {
|
|
1437
|
+
matches: de,
|
|
1436
1438
|
loaderData: it,
|
|
1437
|
-
errors:
|
|
1439
|
+
errors: He,
|
|
1438
1440
|
fetchers: new Map(f.fetchers)
|
|
1439
1441
|
})) : (q({
|
|
1440
|
-
errors:
|
|
1441
|
-
loaderData:
|
|
1442
|
+
errors: He,
|
|
1443
|
+
loaderData: sr(
|
|
1442
1444
|
f.loaderData,
|
|
1443
1445
|
it,
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
+
de,
|
|
1447
|
+
He
|
|
1446
1448
|
),
|
|
1447
1449
|
fetchers: new Map(f.fetchers)
|
|
1448
1450
|
}), ge = !1);
|
|
1449
1451
|
}
|
|
1450
|
-
async function
|
|
1452
|
+
async function Vr(o, d, h, w, S, M, F, P, D) {
|
|
1451
1453
|
let R = f.fetchers.get(o);
|
|
1452
1454
|
ce(
|
|
1453
1455
|
o,
|
|
@@ -1457,7 +1459,7 @@ function Mn(e) {
|
|
|
1457
1459
|
),
|
|
1458
1460
|
{ flushSync: F }
|
|
1459
1461
|
);
|
|
1460
|
-
let k = new AbortController(),
|
|
1462
|
+
let k = new AbortController(), H = Fe(
|
|
1461
1463
|
e.history,
|
|
1462
1464
|
h,
|
|
1463
1465
|
k.signal
|
|
@@ -1466,17 +1468,17 @@ function Mn(e) {
|
|
|
1466
1468
|
let z = await rt(
|
|
1467
1469
|
S,
|
|
1468
1470
|
h,
|
|
1469
|
-
|
|
1471
|
+
H.signal
|
|
1470
1472
|
);
|
|
1471
1473
|
if (z.type === "aborted")
|
|
1472
1474
|
return;
|
|
1473
1475
|
if (z.type === "error") {
|
|
1474
|
-
|
|
1476
|
+
ue(o, d, z.error, { flushSync: F });
|
|
1475
1477
|
return;
|
|
1476
1478
|
} else if (z.matches)
|
|
1477
1479
|
S = z.matches, w = We(S, h);
|
|
1478
1480
|
else {
|
|
1479
|
-
|
|
1481
|
+
ue(
|
|
1480
1482
|
o,
|
|
1481
1483
|
d,
|
|
1482
1484
|
ee(404, { pathname: h }),
|
|
@@ -1486,15 +1488,15 @@ function Mn(e) {
|
|
|
1486
1488
|
}
|
|
1487
1489
|
}
|
|
1488
1490
|
Y.set(o, k);
|
|
1489
|
-
let B = qe, _ = (await
|
|
1491
|
+
let B = qe, _ = (await Ue(
|
|
1490
1492
|
"loader",
|
|
1491
1493
|
f,
|
|
1492
|
-
|
|
1494
|
+
H,
|
|
1493
1495
|
[w],
|
|
1494
1496
|
S,
|
|
1495
1497
|
o
|
|
1496
1498
|
))[w.route.id];
|
|
1497
|
-
if (Y.get(o) === k && Y.delete(o), !
|
|
1499
|
+
if (Y.get(o) === k && Y.delete(o), !H.signal.aborted) {
|
|
1498
1500
|
if (ne.has(o)) {
|
|
1499
1501
|
ce(o, he(void 0));
|
|
1500
1502
|
return;
|
|
@@ -1504,13 +1506,13 @@ function Mn(e) {
|
|
|
1504
1506
|
ce(o, he(void 0));
|
|
1505
1507
|
return;
|
|
1506
1508
|
} else {
|
|
1507
|
-
|
|
1509
|
+
se.add(o), await be(H, _, !1, {
|
|
1508
1510
|
preventScrollReset: P
|
|
1509
1511
|
});
|
|
1510
1512
|
return;
|
|
1511
1513
|
}
|
|
1512
1514
|
if (Z(_)) {
|
|
1513
|
-
|
|
1515
|
+
ue(o, d, _.error);
|
|
1514
1516
|
return;
|
|
1515
1517
|
}
|
|
1516
1518
|
ce(o, he(_.data));
|
|
@@ -1524,7 +1526,7 @@ function Mn(e) {
|
|
|
1524
1526
|
} = {}) {
|
|
1525
1527
|
d.response.headers.has("X-Remix-Revalidate") && (ge = !0);
|
|
1526
1528
|
let P = d.response.headers.get("Location");
|
|
1527
|
-
|
|
1529
|
+
N(P, "Expected a Location header on the redirect Response"), P = ir(
|
|
1528
1530
|
P,
|
|
1529
1531
|
new URL(o.url),
|
|
1530
1532
|
s
|
|
@@ -1536,7 +1538,7 @@ function Mn(e) {
|
|
|
1536
1538
|
let _ = !1;
|
|
1537
1539
|
if (d.response.headers.has("X-Remix-Reload-Document"))
|
|
1538
1540
|
_ = !0;
|
|
1539
|
-
else if (
|
|
1541
|
+
else if (Tt.test(P)) {
|
|
1540
1542
|
const z = e.history.createURL(P);
|
|
1541
1543
|
_ = // Hard reload if it's an absolute URL to a new origin
|
|
1542
1544
|
z.origin !== t.location.origin || // Hard reload if it's an absolute URL that does not match our basename
|
|
@@ -1548,10 +1550,10 @@ function Mn(e) {
|
|
|
1548
1550
|
}
|
|
1549
1551
|
}
|
|
1550
1552
|
$ = null;
|
|
1551
|
-
let R = F === !0 || d.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH", { formMethod: k, formAction:
|
|
1552
|
-
!w && !S && k &&
|
|
1553
|
+
let R = F === !0 || d.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH", { formMethod: k, formAction: H, formEncType: B } = f.navigation;
|
|
1554
|
+
!w && !S && k && H && B && (w = fr(f.navigation));
|
|
1553
1555
|
let J = w || S;
|
|
1554
|
-
if (
|
|
1556
|
+
if (Tn.has(d.response.status) && J && te(J.formMethod))
|
|
1555
1557
|
await we(R, D, {
|
|
1556
1558
|
submission: {
|
|
1557
1559
|
...J,
|
|
@@ -1562,7 +1564,7 @@ function Mn(e) {
|
|
|
1562
1564
|
enableViewTransition: h ? W : void 0
|
|
1563
1565
|
});
|
|
1564
1566
|
else {
|
|
1565
|
-
let _ =
|
|
1567
|
+
let _ = xt(
|
|
1566
1568
|
D,
|
|
1567
1569
|
w
|
|
1568
1570
|
);
|
|
@@ -1576,10 +1578,10 @@ function Mn(e) {
|
|
|
1576
1578
|
});
|
|
1577
1579
|
}
|
|
1578
1580
|
}
|
|
1579
|
-
async function
|
|
1581
|
+
async function Ue(o, d, h, w, S, M) {
|
|
1580
1582
|
let F, P = {};
|
|
1581
1583
|
try {
|
|
1582
|
-
F = await
|
|
1584
|
+
F = await Hn(
|
|
1583
1585
|
u,
|
|
1584
1586
|
o,
|
|
1585
1587
|
d,
|
|
@@ -1599,11 +1601,11 @@ function Mn(e) {
|
|
|
1599
1601
|
}), P;
|
|
1600
1602
|
}
|
|
1601
1603
|
for (let [D, R] of Object.entries(F))
|
|
1602
|
-
if (
|
|
1604
|
+
if (Vn(R)) {
|
|
1603
1605
|
let k = R.result;
|
|
1604
1606
|
P[D] = {
|
|
1605
1607
|
type: "redirect",
|
|
1606
|
-
response:
|
|
1608
|
+
response: _n(
|
|
1607
1609
|
k,
|
|
1608
1610
|
h,
|
|
1609
1611
|
D,
|
|
@@ -1612,13 +1614,13 @@ function Mn(e) {
|
|
|
1612
1614
|
)
|
|
1613
1615
|
};
|
|
1614
1616
|
} else
|
|
1615
|
-
P[D] = await
|
|
1617
|
+
P[D] = await zn(
|
|
1616
1618
|
R
|
|
1617
1619
|
);
|
|
1618
1620
|
return P;
|
|
1619
1621
|
}
|
|
1620
1622
|
async function jt(o, d, h, w, S) {
|
|
1621
|
-
let M =
|
|
1623
|
+
let M = Ue(
|
|
1622
1624
|
"loader",
|
|
1623
1625
|
o,
|
|
1624
1626
|
S,
|
|
@@ -1628,7 +1630,7 @@ function Mn(e) {
|
|
|
1628
1630
|
), F = Promise.all(
|
|
1629
1631
|
w.map(async (R) => {
|
|
1630
1632
|
if (R.matches && R.match && R.controller) {
|
|
1631
|
-
let
|
|
1633
|
+
let H = (await Ue(
|
|
1632
1634
|
"loader",
|
|
1633
1635
|
o,
|
|
1634
1636
|
Fe(e.history, R.path, R.controller.signal),
|
|
@@ -1636,7 +1638,7 @@ function Mn(e) {
|
|
|
1636
1638
|
R.matches,
|
|
1637
1639
|
R.key
|
|
1638
1640
|
))[R.match.route.id];
|
|
1639
|
-
return { [R.key]:
|
|
1641
|
+
return { [R.key]: H };
|
|
1640
1642
|
} else
|
|
1641
1643
|
return Promise.resolve({
|
|
1642
1644
|
[R.key]: {
|
|
@@ -1667,7 +1669,7 @@ function Mn(e) {
|
|
|
1667
1669
|
{ flushSync: (h && h.flushSync) === !0 }
|
|
1668
1670
|
);
|
|
1669
1671
|
}
|
|
1670
|
-
function
|
|
1672
|
+
function ue(o, d, h, w = {}) {
|
|
1671
1673
|
let S = Re(f.matches, d);
|
|
1672
1674
|
gt(o), q(
|
|
1673
1675
|
{
|
|
@@ -1679,61 +1681,61 @@ function Mn(e) {
|
|
|
1679
1681
|
{ flushSync: (w && w.flushSync) === !0 }
|
|
1680
1682
|
);
|
|
1681
1683
|
}
|
|
1682
|
-
function
|
|
1683
|
-
return
|
|
1684
|
+
function zt(o) {
|
|
1685
|
+
return Ne.set(o, (Ne.get(o) || 0) + 1), ne.has(o) && ne.delete(o), f.fetchers.get(o) || Fn;
|
|
1684
1686
|
}
|
|
1685
1687
|
function gt(o) {
|
|
1686
1688
|
let d = f.fetchers.get(o);
|
|
1687
|
-
Y.has(o) && !(d && d.state === "loading" &&
|
|
1689
|
+
Y.has(o) && !(d && d.state === "loading" && Le.has(o)) && fe(o), Pe.delete(o), Le.delete(o), se.delete(o), ne.delete(o), Qe.delete(o), f.fetchers.delete(o);
|
|
1688
1690
|
}
|
|
1689
|
-
function
|
|
1690
|
-
let d = (
|
|
1691
|
-
d <= 0 ? (
|
|
1691
|
+
function Kr(o) {
|
|
1692
|
+
let d = (Ne.get(o) || 0) - 1;
|
|
1693
|
+
d <= 0 ? (Ne.delete(o), ne.add(o)) : Ne.set(o, d), q({ fetchers: new Map(f.fetchers) });
|
|
1692
1694
|
}
|
|
1693
1695
|
function fe(o) {
|
|
1694
1696
|
let d = Y.get(o);
|
|
1695
1697
|
d && (d.abort(), Y.delete(o));
|
|
1696
1698
|
}
|
|
1697
|
-
function
|
|
1699
|
+
function _t(o) {
|
|
1698
1700
|
for (let d of o) {
|
|
1699
|
-
let h =
|
|
1701
|
+
let h = zt(d), w = he(h.data);
|
|
1700
1702
|
f.fetchers.set(d, w);
|
|
1701
1703
|
}
|
|
1702
1704
|
}
|
|
1703
|
-
function
|
|
1705
|
+
function Bt() {
|
|
1704
1706
|
let o = [], d = !1;
|
|
1705
|
-
for (let h of
|
|
1707
|
+
for (let h of se) {
|
|
1706
1708
|
let w = f.fetchers.get(h);
|
|
1707
|
-
|
|
1709
|
+
N(w, `Expected fetcher: ${h}`), w.state === "loading" && (se.delete(h), o.push(h), d = !0);
|
|
1708
1710
|
}
|
|
1709
|
-
return
|
|
1711
|
+
return _t(o), d;
|
|
1710
1712
|
}
|
|
1711
|
-
function
|
|
1713
|
+
function Wt(o) {
|
|
1712
1714
|
let d = [];
|
|
1713
|
-
for (let [h, w] of
|
|
1715
|
+
for (let [h, w] of Le)
|
|
1714
1716
|
if (w < o) {
|
|
1715
1717
|
let S = f.fetchers.get(h);
|
|
1716
|
-
|
|
1718
|
+
N(S, `Expected fetcher: ${h}`), S.state === "loading" && (fe(h), Le.delete(h), d.push(h));
|
|
1717
1719
|
}
|
|
1718
|
-
return
|
|
1720
|
+
return _t(d), d.length > 0;
|
|
1719
1721
|
}
|
|
1720
|
-
function
|
|
1722
|
+
function Yr(o, d) {
|
|
1721
1723
|
let h = f.blockers.get(o) || ze;
|
|
1722
1724
|
return ve.get(o) !== d && ve.set(o, d), h;
|
|
1723
1725
|
}
|
|
1724
|
-
function
|
|
1726
|
+
function Vt(o) {
|
|
1725
1727
|
f.blockers.delete(o), ve.delete(o);
|
|
1726
1728
|
}
|
|
1727
1729
|
function et(o, d) {
|
|
1728
1730
|
let h = f.blockers.get(o) || ze;
|
|
1729
|
-
|
|
1731
|
+
N(
|
|
1730
1732
|
h.state === "unblocked" && d.state === "blocked" || h.state === "blocked" && d.state === "blocked" || h.state === "blocked" && d.state === "proceeding" || h.state === "blocked" && d.state === "unblocked" || h.state === "proceeding" && d.state === "unblocked",
|
|
1731
1733
|
`Invalid blocker state transition: ${h.state} -> ${d.state}`
|
|
1732
1734
|
);
|
|
1733
1735
|
let w = new Map(f.blockers);
|
|
1734
1736
|
w.set(o, d), q({ blockers: w });
|
|
1735
1737
|
}
|
|
1736
|
-
function
|
|
1738
|
+
function Kt({
|
|
1737
1739
|
currentLocation: o,
|
|
1738
1740
|
nextLocation: d,
|
|
1739
1741
|
historyAction: h
|
|
@@ -1746,34 +1748,34 @@ function Mn(e) {
|
|
|
1746
1748
|
return S;
|
|
1747
1749
|
}
|
|
1748
1750
|
function vt(o) {
|
|
1749
|
-
let d = ee(404, { pathname: o }), h = l || i, { matches: w, route: S } =
|
|
1751
|
+
let d = ee(404, { pathname: o }), h = l || i, { matches: w, route: S } = dr(h);
|
|
1750
1752
|
return { notFoundMatches: w, route: S, error: d };
|
|
1751
1753
|
}
|
|
1752
|
-
function
|
|
1753
|
-
if (p = o,
|
|
1754
|
+
function Jr(o, d, h) {
|
|
1755
|
+
if (p = o, C = d, v = h || null, !x && f.navigation === Rt) {
|
|
1754
1756
|
x = !0;
|
|
1755
|
-
let w =
|
|
1757
|
+
let w = Jt(f.location, f.matches);
|
|
1756
1758
|
w != null && q({ restoreScrollPosition: w });
|
|
1757
1759
|
}
|
|
1758
1760
|
return () => {
|
|
1759
|
-
p = null,
|
|
1761
|
+
p = null, C = null, v = null;
|
|
1760
1762
|
};
|
|
1761
1763
|
}
|
|
1762
|
-
function
|
|
1764
|
+
function Yt(o, d) {
|
|
1763
1765
|
return v && v(
|
|
1764
1766
|
o,
|
|
1765
|
-
d.map((w) =>
|
|
1767
|
+
d.map((w) => sn(w, f.loaderData))
|
|
1766
1768
|
) || o.key;
|
|
1767
1769
|
}
|
|
1768
|
-
function
|
|
1769
|
-
if (p &&
|
|
1770
|
-
let h =
|
|
1771
|
-
p[h] =
|
|
1770
|
+
function Gr(o, d) {
|
|
1771
|
+
if (p && C) {
|
|
1772
|
+
let h = Yt(o, d);
|
|
1773
|
+
p[h] = C();
|
|
1772
1774
|
}
|
|
1773
1775
|
}
|
|
1774
|
-
function
|
|
1776
|
+
function Jt(o, d) {
|
|
1775
1777
|
if (p) {
|
|
1776
|
-
let h =
|
|
1778
|
+
let h = Yt(o, d), w = p[h];
|
|
1777
1779
|
if (typeof w == "number")
|
|
1778
1780
|
return w;
|
|
1779
1781
|
}
|
|
@@ -1809,7 +1811,7 @@ function Mn(e) {
|
|
|
1809
1811
|
path: d,
|
|
1810
1812
|
matches: w,
|
|
1811
1813
|
patch: (R, k) => {
|
|
1812
|
-
h.aborted ||
|
|
1814
|
+
h.aborted || ar(
|
|
1813
1815
|
R,
|
|
1814
1816
|
k,
|
|
1815
1817
|
M,
|
|
@@ -1841,7 +1843,7 @@ function Mn(e) {
|
|
|
1841
1843
|
w = D;
|
|
1842
1844
|
}
|
|
1843
1845
|
}
|
|
1844
|
-
function
|
|
1846
|
+
function Xr(o) {
|
|
1845
1847
|
n = {}, l = ct(
|
|
1846
1848
|
o,
|
|
1847
1849
|
a,
|
|
@@ -1849,9 +1851,9 @@ function Mn(e) {
|
|
|
1849
1851
|
n
|
|
1850
1852
|
);
|
|
1851
1853
|
}
|
|
1852
|
-
function
|
|
1854
|
+
function Qr(o, d) {
|
|
1853
1855
|
let h = l == null;
|
|
1854
|
-
|
|
1856
|
+
ar(
|
|
1855
1857
|
o,
|
|
1856
1858
|
d,
|
|
1857
1859
|
l || i,
|
|
@@ -1859,7 +1861,7 @@ function Mn(e) {
|
|
|
1859
1861
|
a
|
|
1860
1862
|
), h && (i = [...i], q({}));
|
|
1861
1863
|
}
|
|
1862
|
-
return
|
|
1864
|
+
return U = {
|
|
1863
1865
|
get basename() {
|
|
1864
1866
|
return s;
|
|
1865
1867
|
},
|
|
@@ -1876,31 +1878,31 @@ function Mn(e) {
|
|
|
1876
1878
|
return t;
|
|
1877
1879
|
},
|
|
1878
1880
|
initialize: Ur,
|
|
1879
|
-
subscribe:
|
|
1880
|
-
enableScrollRestoration:
|
|
1881
|
-
navigate:
|
|
1882
|
-
fetch:
|
|
1883
|
-
revalidate:
|
|
1881
|
+
subscribe: Ir,
|
|
1882
|
+
enableScrollRestoration: Jr,
|
|
1883
|
+
navigate: It,
|
|
1884
|
+
fetch: Br,
|
|
1885
|
+
revalidate: Hr,
|
|
1884
1886
|
// Passthrough to history-aware createHref used by useHref so we get proper
|
|
1885
1887
|
// hash-aware URLs in DOM paths
|
|
1886
1888
|
createHref: (o) => e.history.createHref(o),
|
|
1887
1889
|
encodeLocation: (o) => e.history.encodeLocation(o),
|
|
1888
|
-
getFetcher:
|
|
1889
|
-
deleteFetcher:
|
|
1890
|
-
dispose:
|
|
1891
|
-
getBlocker:
|
|
1892
|
-
deleteBlocker:
|
|
1893
|
-
patchRoutes:
|
|
1890
|
+
getFetcher: zt,
|
|
1891
|
+
deleteFetcher: Kr,
|
|
1892
|
+
dispose: Ar,
|
|
1893
|
+
getBlocker: Yr,
|
|
1894
|
+
deleteBlocker: Vt,
|
|
1895
|
+
patchRoutes: Qr,
|
|
1894
1896
|
_internalFetchControllers: Y,
|
|
1895
1897
|
// TODO: Remove setRoutes, it's temporary to avoid dealing with
|
|
1896
1898
|
// updating the tree while validating the update algorithm.
|
|
1897
|
-
_internalSetRoutes:
|
|
1898
|
-
},
|
|
1899
|
+
_internalSetRoutes: Xr
|
|
1900
|
+
}, U;
|
|
1899
1901
|
}
|
|
1900
|
-
function
|
|
1902
|
+
function Nn(e) {
|
|
1901
1903
|
return e != null && ("formData" in e && e.formData != null || "body" in e && e.body !== void 0);
|
|
1902
1904
|
}
|
|
1903
|
-
function
|
|
1905
|
+
function Ct(e, t, r, a, n, i) {
|
|
1904
1906
|
let l, s;
|
|
1905
1907
|
if (n) {
|
|
1906
1908
|
l = [];
|
|
@@ -1911,14 +1913,14 @@ function St(e, t, r, a, n, i) {
|
|
|
1911
1913
|
}
|
|
1912
1914
|
} else
|
|
1913
1915
|
l = t, s = t[t.length - 1];
|
|
1914
|
-
let u =
|
|
1916
|
+
let u = Mt(
|
|
1915
1917
|
a || ".",
|
|
1916
|
-
|
|
1918
|
+
Dt(l),
|
|
1917
1919
|
re(e.pathname, r) || e.pathname,
|
|
1918
1920
|
i === "path"
|
|
1919
1921
|
);
|
|
1920
1922
|
if (a == null && (u.search = e.search, u.hash = e.hash), (a == null || a === "" || a === ".") && s) {
|
|
1921
|
-
let c =
|
|
1923
|
+
let c = Ft(u.search);
|
|
1922
1924
|
if (s.route.index && !c)
|
|
1923
1925
|
u.search = u.search ? u.search.replace(/^\?/, "?index&") : "?index";
|
|
1924
1926
|
else if (!s.route.index && c) {
|
|
@@ -1930,10 +1932,10 @@ function St(e, t, r, a, n, i) {
|
|
|
1930
1932
|
}
|
|
1931
1933
|
return r !== "/" && (u.pathname = u.pathname === "/" ? r : ie([r, u.pathname])), pe(u);
|
|
1932
1934
|
}
|
|
1933
|
-
function
|
|
1934
|
-
if (!r || !
|
|
1935
|
+
function er(e, t, r) {
|
|
1936
|
+
if (!r || !Nn(r))
|
|
1935
1937
|
return { path: t };
|
|
1936
|
-
if (r.formMethod && !
|
|
1938
|
+
if (r.formMethod && !Kn(r.formMethod))
|
|
1937
1939
|
return {
|
|
1938
1940
|
path: t,
|
|
1939
1941
|
error: ee(405, { method: r.formMethod })
|
|
@@ -1941,7 +1943,7 @@ function Zt(e, t, r) {
|
|
|
1941
1943
|
let a = () => ({
|
|
1942
1944
|
path: t,
|
|
1943
1945
|
error: ee(400, { type: "invalid-body" })
|
|
1944
|
-
}), i = (r.formMethod || "get").toUpperCase(), l =
|
|
1946
|
+
}), i = (r.formMethod || "get").toUpperCase(), l = Sr(t);
|
|
1945
1947
|
if (r.body !== void 0) {
|
|
1946
1948
|
if (r.formEncType === "text/plain") {
|
|
1947
1949
|
if (!te(i))
|
|
@@ -1986,22 +1988,22 @@ function Zt(e, t, r) {
|
|
|
1986
1988
|
}
|
|
1987
1989
|
}
|
|
1988
1990
|
}
|
|
1989
|
-
|
|
1991
|
+
N(
|
|
1990
1992
|
typeof FormData == "function",
|
|
1991
1993
|
"FormData is not available in this environment"
|
|
1992
1994
|
);
|
|
1993
1995
|
let s, u;
|
|
1994
1996
|
if (r.formData)
|
|
1995
|
-
s =
|
|
1997
|
+
s = Pt(r.formData), u = r.formData;
|
|
1996
1998
|
else if (r.body instanceof FormData)
|
|
1997
|
-
s =
|
|
1999
|
+
s = Pt(r.body), u = r.body;
|
|
1998
2000
|
else if (r.body instanceof URLSearchParams)
|
|
1999
|
-
s = r.body, u =
|
|
2001
|
+
s = r.body, u = or(s);
|
|
2000
2002
|
else if (r.body == null)
|
|
2001
2003
|
s = new URLSearchParams(), u = new FormData();
|
|
2002
2004
|
else
|
|
2003
2005
|
try {
|
|
2004
|
-
s = new URLSearchParams(r.body), u =
|
|
2006
|
+
s = new URLSearchParams(r.body), u = or(s);
|
|
2005
2007
|
} catch {
|
|
2006
2008
|
return a();
|
|
2007
2009
|
}
|
|
@@ -2016,23 +2018,23 @@ function Zt(e, t, r) {
|
|
|
2016
2018
|
if (te(c.formMethod))
|
|
2017
2019
|
return { path: t, submission: c };
|
|
2018
2020
|
let y = ye(t);
|
|
2019
|
-
return e && y.search &&
|
|
2021
|
+
return e && y.search && Ft(y.search) && s.append("index", ""), y.search = `?${s}`, { path: pe(y), submission: c };
|
|
2020
2022
|
}
|
|
2021
|
-
function
|
|
2023
|
+
function tr(e, t, r = !1) {
|
|
2022
2024
|
let a = e.findIndex((n) => n.route.id === t);
|
|
2023
2025
|
return a >= 0 ? e.slice(0, r ? a + 1 : a) : e;
|
|
2024
2026
|
}
|
|
2025
|
-
function
|
|
2026
|
-
let v = p ? Z(p[1]) ? p[1].error : p[1].data : void 0,
|
|
2027
|
-
i && t.errors ? E =
|
|
2027
|
+
function rr(e, t, r, a, n, i, l, s, u, c, y, b, g, p) {
|
|
2028
|
+
let v = p ? Z(p[1]) ? p[1].error : p[1].data : void 0, C = e.createURL(t.location), x = e.createURL(n), E = r;
|
|
2029
|
+
i && t.errors ? E = tr(
|
|
2028
2030
|
r,
|
|
2029
2031
|
Object.keys(t.errors)[0],
|
|
2030
2032
|
!0
|
|
2031
|
-
) : p && Z(p[1]) && (E =
|
|
2033
|
+
) : p && Z(p[1]) && (E = tr(
|
|
2032
2034
|
r,
|
|
2033
2035
|
p[0]
|
|
2034
2036
|
));
|
|
2035
|
-
let
|
|
2037
|
+
let L = p ? p[1].statusCode : void 0, T = L && L >= 400, O = E.filter((f, A) => {
|
|
2036
2038
|
let { route: I } = f;
|
|
2037
2039
|
if (I.lazy)
|
|
2038
2040
|
return !0;
|
|
@@ -2040,30 +2042,30 @@ function tr(e, t, r, a, n, i, l, s, u, c, y, b, g, p) {
|
|
|
2040
2042
|
return !1;
|
|
2041
2043
|
if (i)
|
|
2042
2044
|
return Lt(I, t.loaderData, t.errors);
|
|
2043
|
-
if (
|
|
2045
|
+
if (On(t.loaderData, t.matches[A], f))
|
|
2044
2046
|
return !0;
|
|
2045
2047
|
let $ = t.matches[A], W = f;
|
|
2046
|
-
return
|
|
2047
|
-
currentUrl:
|
|
2048
|
+
return nr(f, {
|
|
2049
|
+
currentUrl: C,
|
|
2048
2050
|
currentParams: $.params,
|
|
2049
2051
|
nextUrl: x,
|
|
2050
2052
|
nextParams: W.params,
|
|
2051
2053
|
...a,
|
|
2052
2054
|
actionResult: v,
|
|
2053
|
-
actionStatus:
|
|
2055
|
+
actionStatus: L,
|
|
2054
2056
|
defaultShouldRevalidate: T ? !1 : (
|
|
2055
2057
|
// Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
|
|
2056
|
-
l ||
|
|
2057
|
-
|
|
2058
|
+
l || C.pathname + C.search === x.pathname + x.search || // Search params affect all loaders
|
|
2059
|
+
C.search !== x.search || Un($, W)
|
|
2058
2060
|
)
|
|
2059
2061
|
});
|
|
2060
|
-
}),
|
|
2062
|
+
}), U = [];
|
|
2061
2063
|
return c.forEach((f, A) => {
|
|
2062
2064
|
if (i || !r.some((ke) => ke.route.id === f.routeId) || u.has(A))
|
|
2063
2065
|
return;
|
|
2064
2066
|
let I = me(b, f.path, g);
|
|
2065
2067
|
if (!I) {
|
|
2066
|
-
|
|
2068
|
+
U.push({
|
|
2067
2069
|
key: A,
|
|
2068
2070
|
routeId: f.routeId,
|
|
2069
2071
|
path: f.path,
|
|
@@ -2074,16 +2076,16 @@ function tr(e, t, r, a, n, i, l, s, u, c, y, b, g, p) {
|
|
|
2074
2076
|
return;
|
|
2075
2077
|
}
|
|
2076
2078
|
let $ = t.fetchers.get(A), W = We(I, f.path), Q = !1;
|
|
2077
|
-
y.has(A) ? Q = !1 : s.has(A) ? (s.delete(A), Q = !0) : $ && $.state !== "idle" && $.data === void 0 ? Q = l : Q =
|
|
2078
|
-
currentUrl:
|
|
2079
|
+
y.has(A) ? Q = !1 : s.has(A) ? (s.delete(A), Q = !0) : $ && $.state !== "idle" && $.data === void 0 ? Q = l : Q = nr(W, {
|
|
2080
|
+
currentUrl: C,
|
|
2079
2081
|
currentParams: t.matches[t.matches.length - 1].params,
|
|
2080
2082
|
nextUrl: x,
|
|
2081
2083
|
nextParams: r[r.length - 1].params,
|
|
2082
2084
|
...a,
|
|
2083
2085
|
actionResult: v,
|
|
2084
|
-
actionStatus:
|
|
2086
|
+
actionStatus: L,
|
|
2085
2087
|
defaultShouldRevalidate: T ? !1 : l
|
|
2086
|
-
}), Q &&
|
|
2088
|
+
}), Q && U.push({
|
|
2087
2089
|
key: A,
|
|
2088
2090
|
routeId: f.routeId,
|
|
2089
2091
|
path: f.path,
|
|
@@ -2091,7 +2093,7 @@ function tr(e, t, r, a, n, i, l, s, u, c, y, b, g, p) {
|
|
|
2091
2093
|
match: W,
|
|
2092
2094
|
controller: new AbortController()
|
|
2093
2095
|
});
|
|
2094
|
-
}), [
|
|
2096
|
+
}), [O, U];
|
|
2095
2097
|
}
|
|
2096
2098
|
function Lt(e, t, r) {
|
|
2097
2099
|
if (e.lazy)
|
|
@@ -2101,7 +2103,7 @@ function Lt(e, t, r) {
|
|
|
2101
2103
|
let a = t != null && t[e.id] !== void 0, n = r != null && r[e.id] !== void 0;
|
|
2102
2104
|
return !a && n ? !1 : typeof e.loader == "function" && e.loader.hydrate === !0 ? !0 : !a && !n;
|
|
2103
2105
|
}
|
|
2104
|
-
function
|
|
2106
|
+
function On(e, t, r) {
|
|
2105
2107
|
let a = (
|
|
2106
2108
|
// [a] -> [a, b]
|
|
2107
2109
|
!t || // [a, b] -> [a, c]
|
|
@@ -2109,7 +2111,7 @@ function Fn(e, t, r) {
|
|
|
2109
2111
|
), n = !e.hasOwnProperty(r.route.id);
|
|
2110
2112
|
return a || n;
|
|
2111
2113
|
}
|
|
2112
|
-
function
|
|
2114
|
+
function Un(e, t) {
|
|
2113
2115
|
let r = e.route.path;
|
|
2114
2116
|
return (
|
|
2115
2117
|
// param change for this match, /users/123 -> /users/456
|
|
@@ -2118,7 +2120,7 @@ function kn(e, t) {
|
|
|
2118
2120
|
r != null && r.endsWith("*") && e.params["*"] !== t.params["*"]
|
|
2119
2121
|
);
|
|
2120
2122
|
}
|
|
2121
|
-
function
|
|
2123
|
+
function nr(e, t) {
|
|
2122
2124
|
if (e.route.shouldRevalidate) {
|
|
2123
2125
|
let r = e.route.shouldRevalidate(t);
|
|
2124
2126
|
if (typeof r == "boolean")
|
|
@@ -2126,11 +2128,11 @@ function rr(e, t) {
|
|
|
2126
2128
|
}
|
|
2127
2129
|
return t.defaultShouldRevalidate;
|
|
2128
2130
|
}
|
|
2129
|
-
function
|
|
2131
|
+
function ar(e, t, r, a, n) {
|
|
2130
2132
|
let i;
|
|
2131
2133
|
if (e) {
|
|
2132
2134
|
let u = a[e];
|
|
2133
|
-
|
|
2135
|
+
N(
|
|
2134
2136
|
u,
|
|
2135
2137
|
`No route found to patch children into: routeId = ${e}`
|
|
2136
2138
|
), u.children || (u.children = []), i = u.children;
|
|
@@ -2138,7 +2140,7 @@ function nr(e, t, r, a, n) {
|
|
|
2138
2140
|
i = r;
|
|
2139
2141
|
let l = t.filter(
|
|
2140
2142
|
(u) => !i.some(
|
|
2141
|
-
(c) =>
|
|
2143
|
+
(c) => xr(u, c)
|
|
2142
2144
|
)
|
|
2143
2145
|
), s = ct(
|
|
2144
2146
|
l,
|
|
@@ -2148,19 +2150,19 @@ function nr(e, t, r, a, n) {
|
|
|
2148
2150
|
);
|
|
2149
2151
|
i.push(...s);
|
|
2150
2152
|
}
|
|
2151
|
-
function
|
|
2153
|
+
function xr(e, t) {
|
|
2152
2154
|
return "id" in e && "id" in t && e.id === t.id ? !0 : e.index === t.index && e.path === t.path && e.caseSensitive === t.caseSensitive ? (!e.children || e.children.length === 0) && (!t.children || t.children.length === 0) ? !0 : e.children.every(
|
|
2153
|
-
(r, a) => t.children?.some((n) =>
|
|
2155
|
+
(r, a) => t.children?.some((n) => xr(r, n))
|
|
2154
2156
|
) : !1;
|
|
2155
2157
|
}
|
|
2156
|
-
async function
|
|
2158
|
+
async function An(e, t, r) {
|
|
2157
2159
|
if (!e.lazy)
|
|
2158
2160
|
return;
|
|
2159
2161
|
let a = await e.lazy();
|
|
2160
2162
|
if (!e.lazy)
|
|
2161
2163
|
return;
|
|
2162
2164
|
let n = r[e.id];
|
|
2163
|
-
|
|
2165
|
+
N(n, "No route found in manifest");
|
|
2164
2166
|
let i = {};
|
|
2165
2167
|
for (let l in a) {
|
|
2166
2168
|
let u = n[l] !== void 0 && // This property isn't static since it should always be updated based
|
|
@@ -2169,7 +2171,7 @@ async function $n(e, t, r) {
|
|
|
2169
2171
|
G(
|
|
2170
2172
|
!u,
|
|
2171
2173
|
`Route "${n.id}" has a static property "${l}" defined but its lazy function is also returning a value for this property. The lazy route property "${l}" will be ignored.`
|
|
2172
|
-
), !u && !
|
|
2174
|
+
), !u && !on.has(l) && (i[l] = a[l]);
|
|
2173
2175
|
}
|
|
2174
2176
|
Object.assign(n, i), Object.assign(n, {
|
|
2175
2177
|
// To keep things framework agnostic, we use the provided `mapRouteProperties`
|
|
@@ -2179,7 +2181,7 @@ async function $n(e, t, r) {
|
|
|
2179
2181
|
lazy: void 0
|
|
2180
2182
|
});
|
|
2181
2183
|
}
|
|
2182
|
-
async function
|
|
2184
|
+
async function In({
|
|
2183
2185
|
matches: e
|
|
2184
2186
|
}) {
|
|
2185
2187
|
let t = e.filter((a) => a.shouldLoad);
|
|
@@ -2188,20 +2190,20 @@ async function Un({
|
|
|
2188
2190
|
{}
|
|
2189
2191
|
);
|
|
2190
2192
|
}
|
|
2191
|
-
async function
|
|
2193
|
+
async function Hn(e, t, r, a, n, i, l, s, u, c) {
|
|
2192
2194
|
let y = i.map(
|
|
2193
|
-
(p) => p.route.lazy ?
|
|
2195
|
+
(p) => p.route.lazy ? An(p.route, u, s) : void 0
|
|
2194
2196
|
), b = i.map((p, v) => {
|
|
2195
|
-
let
|
|
2197
|
+
let C = y[v], x = n.some((L) => L.route.id === p.route.id);
|
|
2196
2198
|
return {
|
|
2197
2199
|
...p,
|
|
2198
2200
|
shouldLoad: x,
|
|
2199
|
-
resolve: async (
|
|
2201
|
+
resolve: async (L) => (L && a.method === "GET" && (p.route.lazy || p.route.loader) && (x = !0), x ? jn(
|
|
2200
2202
|
t,
|
|
2201
2203
|
a,
|
|
2202
2204
|
p,
|
|
2203
|
-
L,
|
|
2204
2205
|
C,
|
|
2206
|
+
L,
|
|
2205
2207
|
c
|
|
2206
2208
|
) : Promise.resolve({ type: "data", result: void 0 }))
|
|
2207
2209
|
};
|
|
@@ -2218,9 +2220,9 @@ async function Nn(e, t, r, a, n, i, l, s, u, c) {
|
|
|
2218
2220
|
}
|
|
2219
2221
|
return g;
|
|
2220
2222
|
}
|
|
2221
|
-
async function
|
|
2223
|
+
async function jn(e, t, r, a, n, i) {
|
|
2222
2224
|
let l, s, u = (c) => {
|
|
2223
|
-
let y, b = new Promise((v,
|
|
2225
|
+
let y, b = new Promise((v, C) => y = C);
|
|
2224
2226
|
s = () => y(), t.signal.addEventListener("abort", s);
|
|
2225
2227
|
let g = (v) => typeof c != "function" ? Promise.reject(
|
|
2226
2228
|
new Error(
|
|
@@ -2235,7 +2237,7 @@ async function On(e, t, r, a, n, i) {
|
|
|
2235
2237
|
...v !== void 0 ? [v] : []
|
|
2236
2238
|
), p = (async () => {
|
|
2237
2239
|
try {
|
|
2238
|
-
return { type: "data", result: await (n ? n((
|
|
2240
|
+
return { type: "data", result: await (n ? n((C) => g(C)) : g()) };
|
|
2239
2241
|
} catch (v) {
|
|
2240
2242
|
return { type: "error", result: v };
|
|
2241
2243
|
}
|
|
@@ -2284,9 +2286,9 @@ async function On(e, t, r, a, n, i) {
|
|
|
2284
2286
|
}
|
|
2285
2287
|
return l;
|
|
2286
2288
|
}
|
|
2287
|
-
async function
|
|
2289
|
+
async function zn(e) {
|
|
2288
2290
|
let { result: t, type: r } = e;
|
|
2289
|
-
if (
|
|
2291
|
+
if (Cr(t)) {
|
|
2290
2292
|
let a;
|
|
2291
2293
|
try {
|
|
2292
2294
|
let n = t.headers.get("Content-Type");
|
|
@@ -2306,7 +2308,7 @@ async function An(e) {
|
|
|
2306
2308
|
headers: t.headers
|
|
2307
2309
|
};
|
|
2308
2310
|
}
|
|
2309
|
-
return r === "error" ?
|
|
2311
|
+
return r === "error" ? cr(t) ? t.data instanceof Error ? {
|
|
2310
2312
|
type: "error",
|
|
2311
2313
|
error: t.data,
|
|
2312
2314
|
statusCode: t.init?.status,
|
|
@@ -2324,24 +2326,24 @@ async function An(e) {
|
|
|
2324
2326
|
type: "error",
|
|
2325
2327
|
error: t,
|
|
2326
2328
|
statusCode: Ke(t) ? t.status : void 0
|
|
2327
|
-
} :
|
|
2329
|
+
} : cr(t) ? {
|
|
2328
2330
|
type: "data",
|
|
2329
2331
|
data: t.data,
|
|
2330
2332
|
statusCode: t.init?.status,
|
|
2331
2333
|
headers: t.init?.headers ? new Headers(t.init.headers) : void 0
|
|
2332
2334
|
} : { type: "data", data: t };
|
|
2333
2335
|
}
|
|
2334
|
-
function
|
|
2336
|
+
function _n(e, t, r, a, n) {
|
|
2335
2337
|
let i = e.headers.get("Location");
|
|
2336
|
-
if (
|
|
2338
|
+
if (N(
|
|
2337
2339
|
i,
|
|
2338
2340
|
"Redirects returned/thrown from loaders/actions must have a Location header"
|
|
2339
|
-
), !
|
|
2341
|
+
), !Tt.test(i)) {
|
|
2340
2342
|
let l = a.slice(
|
|
2341
2343
|
0,
|
|
2342
2344
|
a.findIndex((s) => s.route.id === r) + 1
|
|
2343
2345
|
);
|
|
2344
|
-
i =
|
|
2346
|
+
i = Ct(
|
|
2345
2347
|
new URL(t.url),
|
|
2346
2348
|
l,
|
|
2347
2349
|
n,
|
|
@@ -2350,8 +2352,8 @@ function In(e, t, r, a, n) {
|
|
|
2350
2352
|
}
|
|
2351
2353
|
return e;
|
|
2352
2354
|
}
|
|
2353
|
-
function
|
|
2354
|
-
if (
|
|
2355
|
+
function ir(e, t, r) {
|
|
2356
|
+
if (Tt.test(e)) {
|
|
2355
2357
|
let a = e, n = a.startsWith("//") ? new URL(t.protocol + a) : new URL(a), i = re(n.pathname, r) != null;
|
|
2356
2358
|
if (n.origin === t.origin && i)
|
|
2357
2359
|
return n.pathname + n.search + n.hash;
|
|
@@ -2359,32 +2361,32 @@ function ar(e, t, r) {
|
|
|
2359
2361
|
return e;
|
|
2360
2362
|
}
|
|
2361
2363
|
function Fe(e, t, r, a) {
|
|
2362
|
-
let n = e.createURL(
|
|
2364
|
+
let n = e.createURL(Sr(t)).toString(), i = { signal: r };
|
|
2363
2365
|
if (a && te(a.formMethod)) {
|
|
2364
2366
|
let { formMethod: l, formEncType: s } = a;
|
|
2365
|
-
i.method = l.toUpperCase(), s === "application/json" ? (i.headers = new Headers({ "Content-Type": s }), i.body = JSON.stringify(a.json)) : s === "text/plain" ? i.body = a.text : s === "application/x-www-form-urlencoded" && a.formData ? i.body =
|
|
2367
|
+
i.method = l.toUpperCase(), s === "application/json" ? (i.headers = new Headers({ "Content-Type": s }), i.body = JSON.stringify(a.json)) : s === "text/plain" ? i.body = a.text : s === "application/x-www-form-urlencoded" && a.formData ? i.body = Pt(a.formData) : i.body = a.formData;
|
|
2366
2368
|
}
|
|
2367
2369
|
return new Request(n, i);
|
|
2368
2370
|
}
|
|
2369
|
-
function
|
|
2371
|
+
function Pt(e) {
|
|
2370
2372
|
let t = new URLSearchParams();
|
|
2371
2373
|
for (let [r, a] of e.entries())
|
|
2372
2374
|
t.append(r, typeof a == "string" ? a : a.name);
|
|
2373
2375
|
return t;
|
|
2374
2376
|
}
|
|
2375
|
-
function
|
|
2377
|
+
function or(e) {
|
|
2376
2378
|
let t = new FormData();
|
|
2377
2379
|
for (let [r, a] of e.entries())
|
|
2378
2380
|
t.append(r, a);
|
|
2379
2381
|
return t;
|
|
2380
2382
|
}
|
|
2381
|
-
function
|
|
2383
|
+
function Bn(e, t, r, a = !1, n = !1) {
|
|
2382
2384
|
let i = {}, l = null, s, u = !1, c = {}, y = r && Z(r[1]) ? r[1].error : void 0;
|
|
2383
2385
|
return e.forEach((b) => {
|
|
2384
2386
|
if (!(b.route.id in t))
|
|
2385
2387
|
return;
|
|
2386
2388
|
let g = b.route.id, p = t[g];
|
|
2387
|
-
if (
|
|
2389
|
+
if (N(
|
|
2388
2390
|
!xe(p),
|
|
2389
2391
|
"Cannot handle redirect results in processLoaderData"
|
|
2390
2392
|
), Z(p)) {
|
|
@@ -2392,10 +2394,10 @@ function jn(e, t, r, a = !1, n = !1) {
|
|
|
2392
2394
|
if (y !== void 0 && (v = y, y = void 0), l = l || {}, n)
|
|
2393
2395
|
l[g] = v;
|
|
2394
2396
|
else {
|
|
2395
|
-
let
|
|
2396
|
-
l[
|
|
2397
|
+
let C = Re(e, g);
|
|
2398
|
+
l[C.route.id] == null && (l[C.route.id] = v);
|
|
2397
2399
|
}
|
|
2398
|
-
a || (i[g] =
|
|
2400
|
+
a || (i[g] = Rr), u || (u = !0, s = Ke(p.error) ? p.error.status : 500), p.headers && (c[g] = p.headers);
|
|
2399
2401
|
} else
|
|
2400
2402
|
i[g] = p.data, p.statusCode && p.statusCode !== 200 && !u && (s = p.statusCode), p.headers && (c[g] = p.headers);
|
|
2401
2403
|
}), y !== void 0 && r && (l = { [r[0]]: y }, i[r[0]] = void 0), {
|
|
@@ -2405,15 +2407,15 @@ function jn(e, t, r, a = !1, n = !1) {
|
|
|
2405
2407
|
loaderHeaders: c
|
|
2406
2408
|
};
|
|
2407
2409
|
}
|
|
2408
|
-
function
|
|
2409
|
-
let { loaderData: l, errors: s } =
|
|
2410
|
+
function lr(e, t, r, a, n, i) {
|
|
2411
|
+
let { loaderData: l, errors: s } = Bn(
|
|
2410
2412
|
t,
|
|
2411
2413
|
r,
|
|
2412
2414
|
a
|
|
2413
2415
|
);
|
|
2414
2416
|
return n.forEach((u) => {
|
|
2415
2417
|
let { key: c, match: y, controller: b } = u, g = i[c];
|
|
2416
|
-
if (
|
|
2418
|
+
if (N(g, "Did not find corresponding fetcher result"), !(b && b.signal.aborted))
|
|
2417
2419
|
if (Z(g)) {
|
|
2418
2420
|
let p = Re(e.matches, y?.route.id);
|
|
2419
2421
|
s && s[p.route.id] || (s = {
|
|
@@ -2421,15 +2423,15 @@ function or(e, t, r, a, n, i) {
|
|
|
2421
2423
|
[p.route.id]: g.error
|
|
2422
2424
|
}), e.fetchers.delete(c);
|
|
2423
2425
|
} else if (xe(g))
|
|
2424
|
-
|
|
2426
|
+
N(!1, "Unhandled fetcher revalidation redirect");
|
|
2425
2427
|
else {
|
|
2426
2428
|
let p = he(g.data);
|
|
2427
2429
|
e.fetchers.set(c, p);
|
|
2428
2430
|
}
|
|
2429
2431
|
}), { loaderData: l, errors: s };
|
|
2430
2432
|
}
|
|
2431
|
-
function
|
|
2432
|
-
let n = Object.entries(t).filter(([, i]) => i !==
|
|
2433
|
+
function sr(e, t, r, a) {
|
|
2434
|
+
let n = Object.entries(t).filter(([, i]) => i !== Rr).reduce((i, [l, s]) => (i[l] = s, i), {});
|
|
2433
2435
|
for (let i of r) {
|
|
2434
2436
|
let l = i.route.id;
|
|
2435
2437
|
if (!t.hasOwnProperty(l) && e.hasOwnProperty(l) && i.route.loader && (n[l] = e[l]), a && a.hasOwnProperty(l))
|
|
@@ -2437,7 +2439,7 @@ function lr(e, t, r, a) {
|
|
|
2437
2439
|
}
|
|
2438
2440
|
return n;
|
|
2439
2441
|
}
|
|
2440
|
-
function
|
|
2442
|
+
function ur(e) {
|
|
2441
2443
|
return e ? Z(e[1]) ? {
|
|
2442
2444
|
// Clear out prior actionData on errors
|
|
2443
2445
|
actionData: {}
|
|
@@ -2450,7 +2452,7 @@ function sr(e) {
|
|
|
2450
2452
|
function Re(e, t) {
|
|
2451
2453
|
return (t ? e.slice(0, e.findIndex((a) => a.route.id === t) + 1) : [...e]).reverse().find((a) => a.route.hasErrorBoundary === !0) || e[0];
|
|
2452
2454
|
}
|
|
2453
|
-
function
|
|
2455
|
+
function dr(e) {
|
|
2454
2456
|
let t = e.length === 1 ? e[0] : e.find((r) => r.index || !r.path || r.path === "/") || {
|
|
2455
2457
|
id: "__shim-error-route__"
|
|
2456
2458
|
};
|
|
@@ -2489,15 +2491,15 @@ function ot(e) {
|
|
|
2489
2491
|
return { key: a, result: n };
|
|
2490
2492
|
}
|
|
2491
2493
|
}
|
|
2492
|
-
function
|
|
2494
|
+
function Sr(e) {
|
|
2493
2495
|
let t = typeof e == "string" ? ye(e) : e;
|
|
2494
2496
|
return pe({ ...t, hash: "" });
|
|
2495
2497
|
}
|
|
2496
|
-
function
|
|
2498
|
+
function Wn(e, t) {
|
|
2497
2499
|
return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash ? !0 : t.hash !== "";
|
|
2498
2500
|
}
|
|
2499
|
-
function
|
|
2500
|
-
return
|
|
2501
|
+
function Vn(e) {
|
|
2502
|
+
return Cr(e.result) && Mn.has(e.result.status);
|
|
2501
2503
|
}
|
|
2502
2504
|
function Z(e) {
|
|
2503
2505
|
return e.type === "error";
|
|
@@ -2505,29 +2507,29 @@ function Z(e) {
|
|
|
2505
2507
|
function xe(e) {
|
|
2506
2508
|
return (e && e.type) === "redirect";
|
|
2507
2509
|
}
|
|
2508
|
-
function
|
|
2510
|
+
function cr(e) {
|
|
2509
2511
|
return typeof e == "object" && e != null && "type" in e && "data" in e && "init" in e && e.type === "DataWithResponseInit";
|
|
2510
2512
|
}
|
|
2511
|
-
function
|
|
2513
|
+
function Cr(e) {
|
|
2512
2514
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.headers == "object" && typeof e.body < "u";
|
|
2513
2515
|
}
|
|
2514
|
-
function
|
|
2515
|
-
return
|
|
2516
|
+
function Kn(e) {
|
|
2517
|
+
return Dn.has(e.toUpperCase());
|
|
2516
2518
|
}
|
|
2517
2519
|
function te(e) {
|
|
2518
|
-
return
|
|
2520
|
+
return Ln.has(e.toUpperCase());
|
|
2519
2521
|
}
|
|
2520
|
-
function
|
|
2522
|
+
function Ft(e) {
|
|
2521
2523
|
return new URLSearchParams(e).getAll("index").some((t) => t === "");
|
|
2522
2524
|
}
|
|
2523
2525
|
function We(e, t) {
|
|
2524
2526
|
let r = typeof t == "string" ? ye(t).search : t.search;
|
|
2525
|
-
if (e[e.length - 1].route.index &&
|
|
2527
|
+
if (e[e.length - 1].route.index && Ft(r || ""))
|
|
2526
2528
|
return e[e.length - 1];
|
|
2527
|
-
let a =
|
|
2529
|
+
let a = wr(e);
|
|
2528
2530
|
return a[a.length - 1];
|
|
2529
2531
|
}
|
|
2530
|
-
function
|
|
2532
|
+
function fr(e) {
|
|
2531
2533
|
let { formMethod: t, formAction: r, formEncType: a, text: n, formData: i, json: l } = e;
|
|
2532
2534
|
if (!(!t || !r || !a)) {
|
|
2533
2535
|
if (n != null)
|
|
@@ -2559,7 +2561,7 @@ function cr(e) {
|
|
|
2559
2561
|
};
|
|
2560
2562
|
}
|
|
2561
2563
|
}
|
|
2562
|
-
function
|
|
2564
|
+
function xt(e, t) {
|
|
2563
2565
|
return t ? {
|
|
2564
2566
|
state: "loading",
|
|
2565
2567
|
location: e,
|
|
@@ -2580,7 +2582,7 @@ function Rt(e, t) {
|
|
|
2580
2582
|
text: void 0
|
|
2581
2583
|
};
|
|
2582
2584
|
}
|
|
2583
|
-
function
|
|
2585
|
+
function Yn(e, t) {
|
|
2584
2586
|
return {
|
|
2585
2587
|
state: "submitting",
|
|
2586
2588
|
location: e,
|
|
@@ -2613,7 +2615,7 @@ function _e(e, t) {
|
|
|
2613
2615
|
data: t
|
|
2614
2616
|
};
|
|
2615
2617
|
}
|
|
2616
|
-
function
|
|
2618
|
+
function Jn(e, t) {
|
|
2617
2619
|
return {
|
|
2618
2620
|
state: "submitting",
|
|
2619
2621
|
formMethod: e.formMethod,
|
|
@@ -2637,10 +2639,10 @@ function he(e) {
|
|
|
2637
2639
|
data: e
|
|
2638
2640
|
};
|
|
2639
2641
|
}
|
|
2640
|
-
function
|
|
2642
|
+
function Gn(e, t) {
|
|
2641
2643
|
try {
|
|
2642
2644
|
let r = e.sessionStorage.getItem(
|
|
2643
|
-
|
|
2645
|
+
Er
|
|
2644
2646
|
);
|
|
2645
2647
|
if (r) {
|
|
2646
2648
|
let a = JSON.parse(r);
|
|
@@ -2650,14 +2652,14 @@ function Vn(e, t) {
|
|
|
2650
2652
|
} catch {
|
|
2651
2653
|
}
|
|
2652
2654
|
}
|
|
2653
|
-
function
|
|
2655
|
+
function Xn(e, t) {
|
|
2654
2656
|
if (t.size > 0) {
|
|
2655
2657
|
let r = {};
|
|
2656
2658
|
for (let [a, n] of t)
|
|
2657
2659
|
r[a] = [...n];
|
|
2658
2660
|
try {
|
|
2659
2661
|
e.sessionStorage.setItem(
|
|
2660
|
-
|
|
2662
|
+
Er,
|
|
2661
2663
|
JSON.stringify(r)
|
|
2662
2664
|
);
|
|
2663
2665
|
} catch (a) {
|
|
@@ -2668,7 +2670,7 @@ function Kn(e, t) {
|
|
|
2668
2670
|
}
|
|
2669
2671
|
}
|
|
2670
2672
|
}
|
|
2671
|
-
function
|
|
2673
|
+
function Qn() {
|
|
2672
2674
|
let e, t, r = new Promise((a, n) => {
|
|
2673
2675
|
e = async (i) => {
|
|
2674
2676
|
a(i);
|
|
@@ -2696,16 +2698,16 @@ var Se = m.createContext(null);
|
|
|
2696
2698
|
Se.displayName = "DataRouter";
|
|
2697
2699
|
var Ye = m.createContext(null);
|
|
2698
2700
|
Ye.displayName = "DataRouterState";
|
|
2699
|
-
var
|
|
2701
|
+
var kt = m.createContext({
|
|
2700
2702
|
isTransitioning: !1
|
|
2701
2703
|
});
|
|
2702
|
-
|
|
2704
|
+
kt.displayName = "ViewTransition";
|
|
2703
2705
|
var Lr = m.createContext(
|
|
2704
2706
|
/* @__PURE__ */ new Map()
|
|
2705
2707
|
);
|
|
2706
2708
|
Lr.displayName = "Fetchers";
|
|
2707
|
-
var
|
|
2708
|
-
|
|
2709
|
+
var qn = m.createContext(null);
|
|
2710
|
+
qn.displayName = "Await";
|
|
2709
2711
|
var oe = m.createContext(
|
|
2710
2712
|
null
|
|
2711
2713
|
);
|
|
@@ -2714,16 +2716,16 @@ var mt = m.createContext(
|
|
|
2714
2716
|
null
|
|
2715
2717
|
);
|
|
2716
2718
|
mt.displayName = "Location";
|
|
2717
|
-
var
|
|
2719
|
+
var le = m.createContext({
|
|
2718
2720
|
outlet: null,
|
|
2719
2721
|
matches: [],
|
|
2720
2722
|
isDataRoute: !1
|
|
2721
2723
|
});
|
|
2722
|
-
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2725
|
-
function
|
|
2726
|
-
|
|
2724
|
+
le.displayName = "Route";
|
|
2725
|
+
var $t = m.createContext(null);
|
|
2726
|
+
$t.displayName = "RouteError";
|
|
2727
|
+
function Zn(e, { relative: t } = {}) {
|
|
2728
|
+
N(
|
|
2727
2729
|
Je(),
|
|
2728
2730
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
2729
2731
|
// router loaded. We can help them understand how to avoid that.
|
|
@@ -2735,40 +2737,40 @@ function Gn(e, { relative: t } = {}) {
|
|
|
2735
2737
|
function Je() {
|
|
2736
2738
|
return m.useContext(mt) != null;
|
|
2737
2739
|
}
|
|
2738
|
-
function
|
|
2739
|
-
return
|
|
2740
|
+
function Ce() {
|
|
2741
|
+
return N(
|
|
2740
2742
|
Je(),
|
|
2741
2743
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
2742
2744
|
// router loaded. We can help them understand how to avoid that.
|
|
2743
2745
|
"useLocation() may be used only in the context of a <Router> component."
|
|
2744
2746
|
), m.useContext(mt).location;
|
|
2745
2747
|
}
|
|
2746
|
-
var
|
|
2747
|
-
function
|
|
2748
|
+
var Pr = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
2749
|
+
function Dr(e) {
|
|
2748
2750
|
m.useContext(oe).static || m.useLayoutEffect(e);
|
|
2749
2751
|
}
|
|
2750
|
-
function
|
|
2751
|
-
let { isDataRoute: e } = m.useContext(
|
|
2752
|
-
return e ?
|
|
2752
|
+
function Mr() {
|
|
2753
|
+
let { isDataRoute: e } = m.useContext(le);
|
|
2754
|
+
return e ? ma() : ea();
|
|
2753
2755
|
}
|
|
2754
|
-
function
|
|
2755
|
-
|
|
2756
|
+
function ea() {
|
|
2757
|
+
N(
|
|
2756
2758
|
Je(),
|
|
2757
2759
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
2758
2760
|
// router loaded. We can help them understand how to avoid that.
|
|
2759
2761
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
2760
2762
|
);
|
|
2761
|
-
let e = m.useContext(Se), { basename: t, navigator: r } = m.useContext(oe), { matches: a } = m.useContext(
|
|
2762
|
-
return
|
|
2763
|
+
let e = m.useContext(Se), { basename: t, navigator: r } = m.useContext(oe), { matches: a } = m.useContext(le), { pathname: n } = Ce(), i = JSON.stringify(Dt(a)), l = m.useRef(!1);
|
|
2764
|
+
return Dr(() => {
|
|
2763
2765
|
l.current = !0;
|
|
2764
2766
|
}), m.useCallback(
|
|
2765
2767
|
(u, c = {}) => {
|
|
2766
|
-
if (G(l.current,
|
|
2768
|
+
if (G(l.current, Pr), !l.current) return;
|
|
2767
2769
|
if (typeof u == "number") {
|
|
2768
2770
|
r.go(u);
|
|
2769
2771
|
return;
|
|
2770
2772
|
}
|
|
2771
|
-
let y =
|
|
2773
|
+
let y = Mt(
|
|
2772
2774
|
u,
|
|
2773
2775
|
JSON.parse(i),
|
|
2774
2776
|
n,
|
|
@@ -2789,11 +2791,15 @@ function Qn() {
|
|
|
2789
2791
|
]
|
|
2790
2792
|
);
|
|
2791
2793
|
}
|
|
2792
|
-
m.createContext(null);
|
|
2794
|
+
var ta = m.createContext(null);
|
|
2795
|
+
function ra(e) {
|
|
2796
|
+
let t = m.useContext(le).outlet;
|
|
2797
|
+
return t && /* @__PURE__ */ m.createElement(ta.Provider, { value: e }, t);
|
|
2798
|
+
}
|
|
2793
2799
|
function Ge(e, { relative: t } = {}) {
|
|
2794
|
-
let { matches: r } = m.useContext(
|
|
2800
|
+
let { matches: r } = m.useContext(le), { pathname: a } = Ce(), n = JSON.stringify(Dt(r));
|
|
2795
2801
|
return m.useMemo(
|
|
2796
|
-
() =>
|
|
2802
|
+
() => Mt(
|
|
2797
2803
|
e,
|
|
2798
2804
|
JSON.parse(n),
|
|
2799
2805
|
a,
|
|
@@ -2802,51 +2808,51 @@ function Ge(e, { relative: t } = {}) {
|
|
|
2802
2808
|
[e, n, a, t]
|
|
2803
2809
|
);
|
|
2804
2810
|
}
|
|
2805
|
-
function
|
|
2806
|
-
|
|
2811
|
+
function na(e, t, r, a) {
|
|
2812
|
+
N(
|
|
2807
2813
|
Je(),
|
|
2808
2814
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
2809
2815
|
// router loaded. We can help them understand how to avoid that.
|
|
2810
2816
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
2811
2817
|
);
|
|
2812
|
-
let { navigator: n, static: i } = m.useContext(oe), { matches: l } = m.useContext(
|
|
2818
|
+
let { navigator: n, static: i } = m.useContext(oe), { matches: l } = m.useContext(le), s = l[l.length - 1], u = s ? s.params : {}, c = s ? s.pathname : "/", y = s ? s.pathnameBase : "/", b = s && s.route;
|
|
2813
2819
|
{
|
|
2814
|
-
let
|
|
2815
|
-
|
|
2820
|
+
let L = b && b.path || "";
|
|
2821
|
+
Tr(
|
|
2816
2822
|
c,
|
|
2817
|
-
!b ||
|
|
2818
|
-
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${
|
|
2823
|
+
!b || L.endsWith("*") || L.endsWith("*?"),
|
|
2824
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${L}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2819
2825
|
|
|
2820
|
-
Please change the parent <Route path="${
|
|
2826
|
+
Please change the parent <Route path="${L}"> to <Route path="${L === "/" ? "*" : `${L}/*`}">.`
|
|
2821
2827
|
);
|
|
2822
2828
|
}
|
|
2823
|
-
let g =
|
|
2829
|
+
let g = Ce(), p;
|
|
2824
2830
|
p = g;
|
|
2825
|
-
let v = p.pathname || "/",
|
|
2831
|
+
let v = p.pathname || "/", C = v;
|
|
2826
2832
|
if (y !== "/") {
|
|
2827
|
-
let
|
|
2828
|
-
|
|
2833
|
+
let L = y.replace(/^\//, "").split("/");
|
|
2834
|
+
C = "/" + v.replace(/^\//, "").split("/").slice(L.length).join("/");
|
|
2829
2835
|
}
|
|
2830
|
-
let x = !i && r && r.matches && r.matches.length > 0 ? r.matches : me(e, { pathname:
|
|
2836
|
+
let x = !i && r && r.matches && r.matches.length > 0 ? r.matches : me(e, { pathname: C });
|
|
2831
2837
|
return G(
|
|
2832
2838
|
b || x != null,
|
|
2833
2839
|
`No routes matched location "${p.pathname}${p.search}${p.hash}" `
|
|
2834
2840
|
), G(
|
|
2835
2841
|
x == null || x[x.length - 1].route.element !== void 0 || x[x.length - 1].route.Component !== void 0 || x[x.length - 1].route.lazy !== void 0,
|
|
2836
2842
|
`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
2837
|
-
),
|
|
2843
|
+
), sa(
|
|
2838
2844
|
x && x.map(
|
|
2839
|
-
(
|
|
2840
|
-
params: Object.assign({}, u,
|
|
2845
|
+
(L) => Object.assign({}, L, {
|
|
2846
|
+
params: Object.assign({}, u, L.params),
|
|
2841
2847
|
pathname: ie([
|
|
2842
2848
|
y,
|
|
2843
2849
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
2844
|
-
n.encodeLocation ? n.encodeLocation(
|
|
2850
|
+
n.encodeLocation ? n.encodeLocation(L.pathname).pathname : L.pathname
|
|
2845
2851
|
]),
|
|
2846
|
-
pathnameBase:
|
|
2852
|
+
pathnameBase: L.pathnameBase === "/" ? y : ie([
|
|
2847
2853
|
y,
|
|
2848
2854
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
2849
|
-
n.encodeLocation ? n.encodeLocation(
|
|
2855
|
+
n.encodeLocation ? n.encodeLocation(L.pathnameBase).pathname : L.pathnameBase
|
|
2850
2856
|
])
|
|
2851
2857
|
})
|
|
2852
2858
|
),
|
|
@@ -2855,14 +2861,14 @@ Please change the parent <Route path="${C}"> to <Route path="${C === "/" ? "*" :
|
|
|
2855
2861
|
a
|
|
2856
2862
|
);
|
|
2857
2863
|
}
|
|
2858
|
-
function
|
|
2859
|
-
let e =
|
|
2864
|
+
function aa() {
|
|
2865
|
+
let e = ha(), t = Ke(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", n = { padding: "0.5rem", backgroundColor: a }, i = { padding: "2px 4px", backgroundColor: a }, l = null;
|
|
2860
2866
|
return console.error(
|
|
2861
2867
|
"Error handled by React Router default ErrorBoundary:",
|
|
2862
2868
|
e
|
|
2863
2869
|
), l = /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ m.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ m.createElement("code", { style: i }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ m.createElement("code", { style: i }, "errorElement"), " prop on your route.")), /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ m.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ m.createElement("pre", { style: n }, r) : null, l);
|
|
2864
2870
|
}
|
|
2865
|
-
var
|
|
2871
|
+
var ia = /* @__PURE__ */ m.createElement(aa, null), oa = class extends m.Component {
|
|
2866
2872
|
constructor(e) {
|
|
2867
2873
|
super(e), this.state = {
|
|
2868
2874
|
location: e.location,
|
|
@@ -2892,8 +2898,8 @@ var ea = /* @__PURE__ */ m.createElement(Zn, null), ta = class extends m.Compone
|
|
|
2892
2898
|
);
|
|
2893
2899
|
}
|
|
2894
2900
|
render() {
|
|
2895
|
-
return this.state.error !== void 0 ? /* @__PURE__ */ m.createElement(
|
|
2896
|
-
|
|
2901
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ m.createElement(le.Provider, { value: this.props.routeContext }, /* @__PURE__ */ m.createElement(
|
|
2902
|
+
$t.Provider,
|
|
2897
2903
|
{
|
|
2898
2904
|
value: this.state.error,
|
|
2899
2905
|
children: this.props.component
|
|
@@ -2901,11 +2907,11 @@ var ea = /* @__PURE__ */ m.createElement(Zn, null), ta = class extends m.Compone
|
|
|
2901
2907
|
)) : this.props.children;
|
|
2902
2908
|
}
|
|
2903
2909
|
};
|
|
2904
|
-
function
|
|
2910
|
+
function la({ routeContext: e, match: t, children: r }) {
|
|
2905
2911
|
let a = m.useContext(Se);
|
|
2906
|
-
return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ m.createElement(
|
|
2912
|
+
return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ m.createElement(le.Provider, { value: e }, r);
|
|
2907
2913
|
}
|
|
2908
|
-
function
|
|
2914
|
+
function sa(e, t = [], r = null, a = null) {
|
|
2909
2915
|
if (e == null) {
|
|
2910
2916
|
if (!r)
|
|
2911
2917
|
return null;
|
|
@@ -2921,7 +2927,7 @@ function na(e, t = [], r = null, a = null) {
|
|
|
2921
2927
|
let u = n.findIndex(
|
|
2922
2928
|
(c) => c.route.id && i?.[c.route.id] !== void 0
|
|
2923
2929
|
);
|
|
2924
|
-
|
|
2930
|
+
N(
|
|
2925
2931
|
u >= 0,
|
|
2926
2932
|
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
2927
2933
|
i
|
|
@@ -2945,20 +2951,20 @@ function na(e, t = [], r = null, a = null) {
|
|
|
2945
2951
|
}
|
|
2946
2952
|
return n.reduceRight((u, c, y) => {
|
|
2947
2953
|
let b, g = !1, p = null, v = null;
|
|
2948
|
-
r && (b = i && c.route.id ? i[c.route.id] : void 0, p = c.route.errorElement ||
|
|
2954
|
+
r && (b = i && c.route.id ? i[c.route.id] : void 0, p = c.route.errorElement || ia, l && (s < 0 && y === 0 ? (Tr(
|
|
2949
2955
|
"route-fallback",
|
|
2950
2956
|
!1,
|
|
2951
2957
|
"No `HydrateFallback` element provided to render during initial hydration"
|
|
2952
2958
|
), g = !0, v = null) : s === y && (g = !0, v = c.route.hydrateFallbackElement || null)));
|
|
2953
|
-
let
|
|
2959
|
+
let C = t.concat(n.slice(0, y + 1)), x = () => {
|
|
2954
2960
|
let E;
|
|
2955
2961
|
return b ? E = p : g ? E = v : c.route.Component ? E = /* @__PURE__ */ m.createElement(c.route.Component, null) : c.route.element ? E = c.route.element : E = u, /* @__PURE__ */ m.createElement(
|
|
2956
|
-
|
|
2962
|
+
la,
|
|
2957
2963
|
{
|
|
2958
2964
|
match: c,
|
|
2959
2965
|
routeContext: {
|
|
2960
2966
|
outlet: u,
|
|
2961
|
-
matches:
|
|
2967
|
+
matches: C,
|
|
2962
2968
|
isDataRoute: r != null
|
|
2963
2969
|
},
|
|
2964
2970
|
children: E
|
|
@@ -2966,82 +2972,82 @@ function na(e, t = [], r = null, a = null) {
|
|
|
2966
2972
|
);
|
|
2967
2973
|
};
|
|
2968
2974
|
return r && (c.route.ErrorBoundary || c.route.errorElement || y === 0) ? /* @__PURE__ */ m.createElement(
|
|
2969
|
-
|
|
2975
|
+
oa,
|
|
2970
2976
|
{
|
|
2971
2977
|
location: r.location,
|
|
2972
2978
|
revalidation: r.revalidation,
|
|
2973
2979
|
component: p,
|
|
2974
2980
|
error: b,
|
|
2975
2981
|
children: x(),
|
|
2976
|
-
routeContext: { outlet: null, matches:
|
|
2982
|
+
routeContext: { outlet: null, matches: C, isDataRoute: !0 }
|
|
2977
2983
|
}
|
|
2978
2984
|
) : x();
|
|
2979
2985
|
}, null);
|
|
2980
2986
|
}
|
|
2981
|
-
function
|
|
2987
|
+
function Nt(e) {
|
|
2982
2988
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
2983
2989
|
}
|
|
2984
|
-
function
|
|
2990
|
+
function ua(e) {
|
|
2985
2991
|
let t = m.useContext(Se);
|
|
2986
|
-
return
|
|
2992
|
+
return N(t, Nt(e)), t;
|
|
2987
2993
|
}
|
|
2988
|
-
function
|
|
2994
|
+
function da(e) {
|
|
2989
2995
|
let t = m.useContext(Ye);
|
|
2990
|
-
return
|
|
2996
|
+
return N(t, Nt(e)), t;
|
|
2991
2997
|
}
|
|
2992
|
-
function
|
|
2993
|
-
let t = m.useContext(
|
|
2994
|
-
return
|
|
2998
|
+
function ca(e) {
|
|
2999
|
+
let t = m.useContext(le);
|
|
3000
|
+
return N(t, Nt(e)), t;
|
|
2995
3001
|
}
|
|
2996
|
-
function
|
|
2997
|
-
let t =
|
|
2998
|
-
return
|
|
3002
|
+
function Ot(e) {
|
|
3003
|
+
let t = ca(e), r = t.matches[t.matches.length - 1];
|
|
3004
|
+
return N(
|
|
2999
3005
|
r.route.id,
|
|
3000
3006
|
`${e} can only be used on routes that contain a unique "id"`
|
|
3001
3007
|
), r.route.id;
|
|
3002
3008
|
}
|
|
3003
|
-
function
|
|
3004
|
-
return
|
|
3009
|
+
function fa() {
|
|
3010
|
+
return Ot(
|
|
3005
3011
|
"useRouteId"
|
|
3006
3012
|
/* UseRouteId */
|
|
3007
3013
|
);
|
|
3008
3014
|
}
|
|
3009
|
-
function
|
|
3010
|
-
let e = m.useContext(
|
|
3015
|
+
function ha() {
|
|
3016
|
+
let e = m.useContext($t), t = da(
|
|
3011
3017
|
"useRouteError"
|
|
3012
3018
|
/* UseRouteError */
|
|
3013
|
-
), r =
|
|
3019
|
+
), r = Ot(
|
|
3014
3020
|
"useRouteError"
|
|
3015
3021
|
/* UseRouteError */
|
|
3016
3022
|
);
|
|
3017
3023
|
return e !== void 0 ? e : t.errors?.[r];
|
|
3018
3024
|
}
|
|
3019
|
-
function
|
|
3020
|
-
let { router: e } =
|
|
3025
|
+
function ma() {
|
|
3026
|
+
let { router: e } = ua(
|
|
3021
3027
|
"useNavigate"
|
|
3022
3028
|
/* UseNavigateStable */
|
|
3023
|
-
), t =
|
|
3029
|
+
), t = Ot(
|
|
3024
3030
|
"useNavigate"
|
|
3025
3031
|
/* UseNavigateStable */
|
|
3026
3032
|
), r = m.useRef(!1);
|
|
3027
|
-
return
|
|
3033
|
+
return Dr(() => {
|
|
3028
3034
|
r.current = !0;
|
|
3029
3035
|
}), m.useCallback(
|
|
3030
3036
|
async (n, i = {}) => {
|
|
3031
|
-
G(r.current,
|
|
3037
|
+
G(r.current, Pr), r.current && (typeof n == "number" ? e.navigate(n) : await e.navigate(n, { fromRouteId: t, ...i }));
|
|
3032
3038
|
},
|
|
3033
3039
|
[e, t]
|
|
3034
3040
|
);
|
|
3035
3041
|
}
|
|
3036
|
-
var fr = {};
|
|
3037
|
-
function Dr(e, t, r) {
|
|
3038
|
-
!t && !fr[e] && (fr[e] = !0, G(!1, r));
|
|
3039
|
-
}
|
|
3040
3042
|
var hr = {};
|
|
3041
|
-
function
|
|
3042
|
-
!
|
|
3043
|
+
function Tr(e, t, r) {
|
|
3044
|
+
!t && !hr[e] && (hr[e] = !0, G(!1, r));
|
|
3043
3045
|
}
|
|
3044
|
-
|
|
3046
|
+
var mr = {};
|
|
3047
|
+
function pr(e, t) {
|
|
3048
|
+
!e && !mr[t] && (mr[t] = !0, console.warn(t));
|
|
3049
|
+
}
|
|
3050
|
+
function pa(e) {
|
|
3045
3051
|
let t = {
|
|
3046
3052
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
3047
3053
|
// there if you change this -- please and thank you!
|
|
@@ -3067,7 +3073,7 @@ function da(e) {
|
|
|
3067
3073
|
ErrorBoundary: void 0
|
|
3068
3074
|
})), t;
|
|
3069
3075
|
}
|
|
3070
|
-
var
|
|
3076
|
+
var ya = class {
|
|
3071
3077
|
constructor() {
|
|
3072
3078
|
this.status = "pending", this.promise = new Promise((e, t) => {
|
|
3073
3079
|
this.resolve = (r) => {
|
|
@@ -3078,29 +3084,29 @@ var ca = class {
|
|
|
3078
3084
|
});
|
|
3079
3085
|
}
|
|
3080
3086
|
};
|
|
3081
|
-
function
|
|
3087
|
+
function ri({
|
|
3082
3088
|
router: e,
|
|
3083
3089
|
flushSync: t
|
|
3084
3090
|
}) {
|
|
3085
3091
|
let [r, a] = m.useState(e.state), [n, i] = m.useState(), [l, s] = m.useState({
|
|
3086
3092
|
isTransitioning: !1
|
|
3087
|
-
}), [u, c] = m.useState(), [y, b] = m.useState(), [g, p] = m.useState(), v = m.useRef(/* @__PURE__ */ new Map()),
|
|
3088
|
-
(T, { deletedFetchers:
|
|
3093
|
+
}), [u, c] = m.useState(), [y, b] = m.useState(), [g, p] = m.useState(), v = m.useRef(/* @__PURE__ */ new Map()), C = m.useCallback(
|
|
3094
|
+
(T, { deletedFetchers: O, flushSync: U, viewTransitionOpts: f }) => {
|
|
3089
3095
|
T.fetchers.forEach((I, $) => {
|
|
3090
3096
|
I.data !== void 0 && v.current.set($, I.data);
|
|
3091
|
-
}),
|
|
3092
|
-
|
|
3097
|
+
}), O.forEach((I) => v.current.delete(I)), pr(
|
|
3098
|
+
U === !1 || t != null,
|
|
3093
3099
|
'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
|
|
3094
3100
|
);
|
|
3095
3101
|
let A = e.window != null && e.window.document != null && typeof e.window.document.startViewTransition == "function";
|
|
3096
|
-
if (
|
|
3102
|
+
if (pr(
|
|
3097
3103
|
f == null || A,
|
|
3098
3104
|
"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
|
|
3099
3105
|
), !f || !A) {
|
|
3100
|
-
t &&
|
|
3106
|
+
t && U ? t(() => a(T)) : m.startTransition(() => a(T));
|
|
3101
3107
|
return;
|
|
3102
3108
|
}
|
|
3103
|
-
if (t &&
|
|
3109
|
+
if (t && U) {
|
|
3104
3110
|
t(() => {
|
|
3105
3111
|
y && (u && u.resolve(), y.skipTransition()), s({
|
|
3106
3112
|
isTransitioning: !0,
|
|
@@ -3132,16 +3138,16 @@ function Ga({
|
|
|
3132
3138
|
},
|
|
3133
3139
|
[e.window, t, y, u]
|
|
3134
3140
|
);
|
|
3135
|
-
m.useLayoutEffect(() => e.subscribe(
|
|
3136
|
-
l.isTransitioning && !l.flushSync && c(new
|
|
3141
|
+
m.useLayoutEffect(() => e.subscribe(C), [e, C]), m.useEffect(() => {
|
|
3142
|
+
l.isTransitioning && !l.flushSync && c(new ya());
|
|
3137
3143
|
}, [l]), m.useEffect(() => {
|
|
3138
3144
|
if (u && n && e.window) {
|
|
3139
|
-
let T = n,
|
|
3140
|
-
m.startTransition(() => a(T)), await
|
|
3145
|
+
let T = n, O = u.promise, U = e.window.document.startViewTransition(async () => {
|
|
3146
|
+
m.startTransition(() => a(T)), await O;
|
|
3141
3147
|
});
|
|
3142
|
-
|
|
3148
|
+
U.finished.finally(() => {
|
|
3143
3149
|
c(void 0), b(void 0), i(void 0), s({ isTransitioning: !1 });
|
|
3144
|
-
}), b(
|
|
3150
|
+
}), b(U);
|
|
3145
3151
|
}
|
|
3146
3152
|
}, [n, u, e.window]), m.useEffect(() => {
|
|
3147
3153
|
u && n && r.location.key === n.location.key && u.resolve();
|
|
@@ -3157,16 +3163,16 @@ function Ga({
|
|
|
3157
3163
|
createHref: e.createHref,
|
|
3158
3164
|
encodeLocation: e.encodeLocation,
|
|
3159
3165
|
go: (T) => e.navigate(T),
|
|
3160
|
-
push: (T,
|
|
3161
|
-
state:
|
|
3162
|
-
preventScrollReset:
|
|
3166
|
+
push: (T, O, U) => e.navigate(T, {
|
|
3167
|
+
state: O,
|
|
3168
|
+
preventScrollReset: U?.preventScrollReset
|
|
3163
3169
|
}),
|
|
3164
|
-
replace: (T,
|
|
3170
|
+
replace: (T, O, U) => e.navigate(T, {
|
|
3165
3171
|
replace: !0,
|
|
3166
|
-
state:
|
|
3167
|
-
preventScrollReset:
|
|
3172
|
+
state: O,
|
|
3173
|
+
preventScrollReset: U?.preventScrollReset
|
|
3168
3174
|
})
|
|
3169
|
-
}), [e]), E = e.basename || "/",
|
|
3175
|
+
}), [e]), E = e.basename || "/", L = m.useMemo(
|
|
3170
3176
|
() => ({
|
|
3171
3177
|
router: e,
|
|
3172
3178
|
navigator: x,
|
|
@@ -3175,8 +3181,8 @@ function Ga({
|
|
|
3175
3181
|
}),
|
|
3176
3182
|
[e, x, E]
|
|
3177
3183
|
);
|
|
3178
|
-
return /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement(Se.Provider, { value:
|
|
3179
|
-
|
|
3184
|
+
return /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement(Se.Provider, { value: L }, /* @__PURE__ */ m.createElement(Ye.Provider, { value: r }, /* @__PURE__ */ m.createElement(Lr.Provider, { value: v.current }, /* @__PURE__ */ m.createElement(kt.Provider, { value: l }, /* @__PURE__ */ m.createElement(
|
|
3185
|
+
wa,
|
|
3180
3186
|
{
|
|
3181
3187
|
basename: E,
|
|
3182
3188
|
location: r.location,
|
|
@@ -3184,7 +3190,7 @@ function Ga({
|
|
|
3184
3190
|
navigator: x
|
|
3185
3191
|
},
|
|
3186
3192
|
/* @__PURE__ */ m.createElement(
|
|
3187
|
-
|
|
3193
|
+
ga,
|
|
3188
3194
|
{
|
|
3189
3195
|
routes: e.routes,
|
|
3190
3196
|
future: e.future,
|
|
@@ -3193,15 +3199,18 @@ function Ga({
|
|
|
3193
3199
|
)
|
|
3194
3200
|
))))), null);
|
|
3195
3201
|
}
|
|
3196
|
-
var
|
|
3197
|
-
function
|
|
3202
|
+
var ga = m.memo(va);
|
|
3203
|
+
function va({
|
|
3198
3204
|
routes: e,
|
|
3199
3205
|
future: t,
|
|
3200
3206
|
state: r
|
|
3201
3207
|
}) {
|
|
3202
|
-
return
|
|
3208
|
+
return na(e, void 0, r, t);
|
|
3203
3209
|
}
|
|
3204
|
-
function
|
|
3210
|
+
function ni(e) {
|
|
3211
|
+
return ra(e.context);
|
|
3212
|
+
}
|
|
3213
|
+
function wa({
|
|
3205
3214
|
basename: e = "/",
|
|
3206
3215
|
children: t = null,
|
|
3207
3216
|
location: r,
|
|
@@ -3209,7 +3218,7 @@ function ma({
|
|
|
3209
3218
|
navigator: n,
|
|
3210
3219
|
static: i = !1
|
|
3211
3220
|
}) {
|
|
3212
|
-
|
|
3221
|
+
N(
|
|
3213
3222
|
!Je(),
|
|
3214
3223
|
"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
|
|
3215
3224
|
);
|
|
@@ -3251,25 +3260,25 @@ var ut = "get", dt = "application/x-www-form-urlencoded";
|
|
|
3251
3260
|
function pt(e) {
|
|
3252
3261
|
return e != null && typeof e.tagName == "string";
|
|
3253
3262
|
}
|
|
3254
|
-
function
|
|
3263
|
+
function ba(e) {
|
|
3255
3264
|
return pt(e) && e.tagName.toLowerCase() === "button";
|
|
3256
3265
|
}
|
|
3257
|
-
function
|
|
3266
|
+
function Ea(e) {
|
|
3258
3267
|
return pt(e) && e.tagName.toLowerCase() === "form";
|
|
3259
3268
|
}
|
|
3260
|
-
function
|
|
3269
|
+
function Ra(e) {
|
|
3261
3270
|
return pt(e) && e.tagName.toLowerCase() === "input";
|
|
3262
3271
|
}
|
|
3263
|
-
function
|
|
3272
|
+
function xa(e) {
|
|
3264
3273
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
3265
3274
|
}
|
|
3266
|
-
function
|
|
3275
|
+
function Sa(e, t) {
|
|
3267
3276
|
return e.button === 0 && // Ignore everything but left clicks
|
|
3268
3277
|
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
3269
|
-
!
|
|
3278
|
+
!xa(e);
|
|
3270
3279
|
}
|
|
3271
3280
|
var lt = null;
|
|
3272
|
-
function
|
|
3281
|
+
function Ca() {
|
|
3273
3282
|
if (lt === null)
|
|
3274
3283
|
try {
|
|
3275
3284
|
new FormData(
|
|
@@ -3282,30 +3291,30 @@ function ba() {
|
|
|
3282
3291
|
}
|
|
3283
3292
|
return lt;
|
|
3284
3293
|
}
|
|
3285
|
-
var
|
|
3294
|
+
var La = /* @__PURE__ */ new Set([
|
|
3286
3295
|
"application/x-www-form-urlencoded",
|
|
3287
3296
|
"multipart/form-data",
|
|
3288
3297
|
"text/plain"
|
|
3289
3298
|
]);
|
|
3290
|
-
function
|
|
3291
|
-
return e != null && !
|
|
3299
|
+
function St(e) {
|
|
3300
|
+
return e != null && !La.has(e) ? (G(
|
|
3292
3301
|
!1,
|
|
3293
3302
|
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dt}"`
|
|
3294
3303
|
), null) : e;
|
|
3295
3304
|
}
|
|
3296
|
-
function
|
|
3305
|
+
function Pa(e, t) {
|
|
3297
3306
|
let r, a, n, i, l;
|
|
3298
|
-
if (
|
|
3307
|
+
if (Ea(e)) {
|
|
3299
3308
|
let s = e.getAttribute("action");
|
|
3300
|
-
a = s ? re(s, t) : null, r = e.getAttribute("method") || ut, n =
|
|
3301
|
-
} else if (
|
|
3309
|
+
a = s ? re(s, t) : null, r = e.getAttribute("method") || ut, n = St(e.getAttribute("enctype")) || dt, i = new FormData(e);
|
|
3310
|
+
} else if (ba(e) || Ra(e) && (e.type === "submit" || e.type === "image")) {
|
|
3302
3311
|
let s = e.form;
|
|
3303
3312
|
if (s == null)
|
|
3304
3313
|
throw new Error(
|
|
3305
3314
|
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
3306
3315
|
);
|
|
3307
3316
|
let u = e.getAttribute("formaction") || s.getAttribute("action");
|
|
3308
|
-
if (a = u ? re(u, t) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || ut, n =
|
|
3317
|
+
if (a = u ? re(u, t) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || ut, n = St(e.getAttribute("formenctype")) || St(s.getAttribute("enctype")) || dt, i = new FormData(s, e), !Ca()) {
|
|
3309
3318
|
let { name: c, type: y, value: b } = e;
|
|
3310
3319
|
if (y === "image") {
|
|
3311
3320
|
let g = c ? `${c}.` : "";
|
|
@@ -3321,11 +3330,11 @@ function Ra(e, t) {
|
|
|
3321
3330
|
}
|
|
3322
3331
|
return i && n === "text/plain" && (l = i, i = void 0), { action: a, method: r.toLowerCase(), encType: n, formData: i, body: l };
|
|
3323
3332
|
}
|
|
3324
|
-
function
|
|
3333
|
+
function Ut(e, t) {
|
|
3325
3334
|
if (e === !1 || e === null || typeof e > "u")
|
|
3326
3335
|
throw new Error(t);
|
|
3327
3336
|
}
|
|
3328
|
-
async function
|
|
3337
|
+
async function Da(e, t) {
|
|
3329
3338
|
if (e.id in t)
|
|
3330
3339
|
return t[e.id];
|
|
3331
3340
|
try {
|
|
@@ -3342,27 +3351,27 @@ async function xa(e, t) {
|
|
|
3342
3351
|
});
|
|
3343
3352
|
}
|
|
3344
3353
|
}
|
|
3345
|
-
function
|
|
3354
|
+
function Ma(e) {
|
|
3346
3355
|
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
3347
3356
|
}
|
|
3348
|
-
async function
|
|
3357
|
+
async function Ta(e, t, r) {
|
|
3349
3358
|
let a = await Promise.all(
|
|
3350
3359
|
e.map(async (n) => {
|
|
3351
3360
|
let i = t.routes[n.route.id];
|
|
3352
3361
|
if (i) {
|
|
3353
|
-
let l = await
|
|
3362
|
+
let l = await Da(i, r);
|
|
3354
3363
|
return l.links ? l.links() : [];
|
|
3355
3364
|
}
|
|
3356
3365
|
return [];
|
|
3357
3366
|
})
|
|
3358
3367
|
);
|
|
3359
|
-
return
|
|
3360
|
-
a.flat(1).filter(
|
|
3368
|
+
return Na(
|
|
3369
|
+
a.flat(1).filter(Ma).filter((n) => n.rel === "stylesheet" || n.rel === "preload").map(
|
|
3361
3370
|
(n) => n.rel === "stylesheet" ? { ...n, rel: "prefetch", as: "style" } : { ...n, rel: "prefetch" }
|
|
3362
3371
|
)
|
|
3363
3372
|
);
|
|
3364
3373
|
}
|
|
3365
|
-
function
|
|
3374
|
+
function yr(e, t, r, a, n, i) {
|
|
3366
3375
|
let l = (u, c) => r[c] ? u.route.id !== r[c].route.id : !0, s = (u, c) => (
|
|
3367
3376
|
// param change, /users/123 -> /users/456
|
|
3368
3377
|
r[c].pathname !== u.pathname || // splat param changed, which is not present in match.path
|
|
@@ -3394,8 +3403,8 @@ function pr(e, t, r, a, n, i) {
|
|
|
3394
3403
|
return !0;
|
|
3395
3404
|
}) : [];
|
|
3396
3405
|
}
|
|
3397
|
-
function
|
|
3398
|
-
return
|
|
3406
|
+
function Fa(e, t) {
|
|
3407
|
+
return ka(
|
|
3399
3408
|
e.map((r) => {
|
|
3400
3409
|
let a = t.routes[r.route.id];
|
|
3401
3410
|
if (!a) return [];
|
|
@@ -3404,23 +3413,23 @@ function Ca(e, t) {
|
|
|
3404
3413
|
}).flat(1)
|
|
3405
3414
|
);
|
|
3406
3415
|
}
|
|
3407
|
-
function
|
|
3416
|
+
function ka(e) {
|
|
3408
3417
|
return [...new Set(e)];
|
|
3409
3418
|
}
|
|
3410
|
-
function
|
|
3419
|
+
function $a(e) {
|
|
3411
3420
|
let t = {}, r = Object.keys(e).sort();
|
|
3412
3421
|
for (let a of r)
|
|
3413
3422
|
t[a] = e[a];
|
|
3414
3423
|
return t;
|
|
3415
3424
|
}
|
|
3416
|
-
function
|
|
3425
|
+
function Na(e, t) {
|
|
3417
3426
|
let r = /* @__PURE__ */ new Set();
|
|
3418
3427
|
return new Set(t), e.reduce((a, n) => {
|
|
3419
|
-
let i = JSON.stringify(
|
|
3428
|
+
let i = JSON.stringify($a(n));
|
|
3420
3429
|
return r.has(i) || (r.add(i), a.push({ key: i, link: n })), a;
|
|
3421
3430
|
}, []);
|
|
3422
3431
|
}
|
|
3423
|
-
function
|
|
3432
|
+
function Oa(e) {
|
|
3424
3433
|
let t = typeof e == "string" ? new URL(
|
|
3425
3434
|
e,
|
|
3426
3435
|
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
@@ -3429,49 +3438,49 @@ function Ta(e) {
|
|
|
3429
3438
|
) : e;
|
|
3430
3439
|
return t.pathname === "/" ? t.pathname = "_root.data" : t.pathname = `${t.pathname.replace(/\/$/, "")}.data`, t;
|
|
3431
3440
|
}
|
|
3432
|
-
function
|
|
3441
|
+
function Ua() {
|
|
3433
3442
|
let e = m.useContext(Se);
|
|
3434
|
-
return
|
|
3443
|
+
return Ut(
|
|
3435
3444
|
e,
|
|
3436
3445
|
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
3437
3446
|
), e;
|
|
3438
3447
|
}
|
|
3439
|
-
function
|
|
3448
|
+
function Aa() {
|
|
3440
3449
|
let e = m.useContext(Ye);
|
|
3441
|
-
return
|
|
3450
|
+
return Ut(
|
|
3442
3451
|
e,
|
|
3443
3452
|
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
3444
3453
|
), e;
|
|
3445
3454
|
}
|
|
3446
|
-
var
|
|
3447
|
-
|
|
3448
|
-
function
|
|
3449
|
-
let e = m.useContext(
|
|
3450
|
-
return
|
|
3455
|
+
var At = m.createContext(void 0);
|
|
3456
|
+
At.displayName = "FrameworkContext";
|
|
3457
|
+
function Fr() {
|
|
3458
|
+
let e = m.useContext(At);
|
|
3459
|
+
return Ut(
|
|
3451
3460
|
e,
|
|
3452
3461
|
"You must render this element inside a <HydratedRouter> element"
|
|
3453
3462
|
), e;
|
|
3454
3463
|
}
|
|
3455
|
-
function
|
|
3456
|
-
let r = m.useContext(
|
|
3464
|
+
function Ia(e, t) {
|
|
3465
|
+
let r = m.useContext(At), [a, n] = m.useState(!1), [i, l] = m.useState(!1), { onFocus: s, onBlur: u, onMouseEnter: c, onMouseLeave: y, onTouchStart: b } = t, g = m.useRef(null);
|
|
3457
3466
|
m.useEffect(() => {
|
|
3458
3467
|
if (e === "render" && l(!0), e === "viewport") {
|
|
3459
|
-
let
|
|
3460
|
-
E.forEach((
|
|
3461
|
-
l(
|
|
3468
|
+
let C = (E) => {
|
|
3469
|
+
E.forEach((L) => {
|
|
3470
|
+
l(L.isIntersecting);
|
|
3462
3471
|
});
|
|
3463
|
-
}, x = new IntersectionObserver(
|
|
3472
|
+
}, x = new IntersectionObserver(C, { threshold: 0.5 });
|
|
3464
3473
|
return g.current && x.observe(g.current), () => {
|
|
3465
3474
|
x.disconnect();
|
|
3466
3475
|
};
|
|
3467
3476
|
}
|
|
3468
3477
|
}, [e]), m.useEffect(() => {
|
|
3469
3478
|
if (a) {
|
|
3470
|
-
let
|
|
3479
|
+
let C = setTimeout(() => {
|
|
3471
3480
|
l(!0);
|
|
3472
3481
|
}, 100);
|
|
3473
3482
|
return () => {
|
|
3474
|
-
clearTimeout(
|
|
3483
|
+
clearTimeout(C);
|
|
3475
3484
|
};
|
|
3476
3485
|
}
|
|
3477
3486
|
}, [a]);
|
|
@@ -3497,21 +3506,21 @@ function Be(e, t) {
|
|
|
3497
3506
|
e && e(r), r.defaultPrevented || t(r);
|
|
3498
3507
|
};
|
|
3499
3508
|
}
|
|
3500
|
-
function
|
|
3509
|
+
function Ha({
|
|
3501
3510
|
page: e,
|
|
3502
3511
|
...t
|
|
3503
3512
|
}) {
|
|
3504
|
-
let { router: r } =
|
|
3513
|
+
let { router: r } = Ua(), a = m.useMemo(
|
|
3505
3514
|
() => me(r.routes, e, r.basename),
|
|
3506
3515
|
[r.routes, e, r.basename]
|
|
3507
3516
|
);
|
|
3508
|
-
return a ? /* @__PURE__ */ m.createElement(
|
|
3517
|
+
return a ? /* @__PURE__ */ m.createElement(za, { page: e, matches: a, ...t }) : null;
|
|
3509
3518
|
}
|
|
3510
|
-
function
|
|
3511
|
-
let { manifest: t, routeModules: r } =
|
|
3519
|
+
function ja(e) {
|
|
3520
|
+
let { manifest: t, routeModules: r } = Fr(), [a, n] = m.useState([]);
|
|
3512
3521
|
return m.useEffect(() => {
|
|
3513
3522
|
let i = !1;
|
|
3514
|
-
return
|
|
3523
|
+
return Ta(e, t, r).then(
|
|
3515
3524
|
(l) => {
|
|
3516
3525
|
i || n(l);
|
|
3517
3526
|
}
|
|
@@ -3520,13 +3529,13 @@ function Na(e) {
|
|
|
3520
3529
|
};
|
|
3521
3530
|
}, [e, t, r]), a;
|
|
3522
3531
|
}
|
|
3523
|
-
function
|
|
3532
|
+
function za({
|
|
3524
3533
|
page: e,
|
|
3525
3534
|
matches: t,
|
|
3526
3535
|
...r
|
|
3527
3536
|
}) {
|
|
3528
|
-
let a =
|
|
3529
|
-
() =>
|
|
3537
|
+
let a = Ce(), { manifest: n, routeModules: i } = Fr(), { loaderData: l, matches: s } = Aa(), u = m.useMemo(
|
|
3538
|
+
() => yr(
|
|
3530
3539
|
e,
|
|
3531
3540
|
t,
|
|
3532
3541
|
s,
|
|
@@ -3536,7 +3545,7 @@ function Oa({
|
|
|
3536
3545
|
),
|
|
3537
3546
|
[e, t, s, n, a]
|
|
3538
3547
|
), c = m.useMemo(
|
|
3539
|
-
() =>
|
|
3548
|
+
() => yr(
|
|
3540
3549
|
e,
|
|
3541
3550
|
t,
|
|
3542
3551
|
s,
|
|
@@ -3551,14 +3560,14 @@ function Oa({
|
|
|
3551
3560
|
let p = /* @__PURE__ */ new Set(), v = !1;
|
|
3552
3561
|
if (t.forEach((x) => {
|
|
3553
3562
|
let E = n.routes[x.route.id];
|
|
3554
|
-
!E || !E.hasLoader || (!u.some((
|
|
3563
|
+
!E || !E.hasLoader || (!u.some((L) => L.route.id === x.route.id) && x.route.id in l && i[x.route.id]?.shouldRevalidate || E.hasClientLoader ? v = !0 : p.add(x.route.id));
|
|
3555
3564
|
}), p.size === 0)
|
|
3556
3565
|
return [];
|
|
3557
|
-
let
|
|
3558
|
-
return v && p.size > 0 &&
|
|
3566
|
+
let C = Oa(e);
|
|
3567
|
+
return v && p.size > 0 && C.searchParams.set(
|
|
3559
3568
|
"_routes",
|
|
3560
3569
|
t.filter((x) => p.has(x.route.id)).map((x) => x.route.id).join(",")
|
|
3561
|
-
), [
|
|
3570
|
+
), [C.pathname + C.search];
|
|
3562
3571
|
}, [
|
|
3563
3572
|
l,
|
|
3564
3573
|
a,
|
|
@@ -3568,48 +3577,48 @@ function Oa({
|
|
|
3568
3577
|
e,
|
|
3569
3578
|
i
|
|
3570
3579
|
]), b = m.useMemo(
|
|
3571
|
-
() =>
|
|
3580
|
+
() => Fa(c, n),
|
|
3572
3581
|
[c, n]
|
|
3573
|
-
), g =
|
|
3582
|
+
), g = ja(c);
|
|
3574
3583
|
return /* @__PURE__ */ m.createElement(m.Fragment, null, y.map((p) => /* @__PURE__ */ m.createElement("link", { key: p, rel: "prefetch", as: "fetch", href: p, ...r })), b.map((p) => /* @__PURE__ */ m.createElement("link", { key: p, rel: "modulepreload", href: p, ...r })), g.map(({ key: p, link: v }) => (
|
|
3575
3584
|
// these don't spread `linkProps` because they are full link descriptors
|
|
3576
3585
|
// already with their own props
|
|
3577
3586
|
/* @__PURE__ */ m.createElement("link", { key: p, ...v })
|
|
3578
3587
|
)));
|
|
3579
3588
|
}
|
|
3580
|
-
function
|
|
3589
|
+
function _a(...e) {
|
|
3581
3590
|
return (t) => {
|
|
3582
3591
|
e.forEach((r) => {
|
|
3583
3592
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
3584
3593
|
});
|
|
3585
3594
|
};
|
|
3586
3595
|
}
|
|
3587
|
-
var
|
|
3596
|
+
var kr = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
3588
3597
|
try {
|
|
3589
|
-
|
|
3598
|
+
kr && (window.__reactRouterVersion = "7.1.5");
|
|
3590
3599
|
} catch {
|
|
3591
3600
|
}
|
|
3592
|
-
function
|
|
3593
|
-
return
|
|
3601
|
+
function ai(e, t) {
|
|
3602
|
+
return $n({
|
|
3594
3603
|
basename: t?.basename,
|
|
3595
3604
|
future: t?.future,
|
|
3596
|
-
history:
|
|
3597
|
-
hydrationData:
|
|
3605
|
+
history: rn({ window: t?.window }),
|
|
3606
|
+
hydrationData: Ba(),
|
|
3598
3607
|
routes: e,
|
|
3599
|
-
mapRouteProperties:
|
|
3608
|
+
mapRouteProperties: pa,
|
|
3600
3609
|
dataStrategy: t?.dataStrategy,
|
|
3601
3610
|
patchRoutesOnNavigation: t?.patchRoutesOnNavigation,
|
|
3602
3611
|
window: t?.window
|
|
3603
3612
|
}).initialize();
|
|
3604
3613
|
}
|
|
3605
|
-
function
|
|
3614
|
+
function Ba() {
|
|
3606
3615
|
let e = window?.__staticRouterHydrationData;
|
|
3607
3616
|
return e && e.errors && (e = {
|
|
3608
3617
|
...e,
|
|
3609
|
-
errors:
|
|
3618
|
+
errors: Wa(e.errors)
|
|
3610
3619
|
}), e;
|
|
3611
3620
|
}
|
|
3612
|
-
function
|
|
3621
|
+
function Wa(e) {
|
|
3613
3622
|
if (!e) return null;
|
|
3614
3623
|
let t = Object.entries(e), r = {};
|
|
3615
3624
|
for (let [a, n] of t)
|
|
@@ -3638,7 +3647,7 @@ function ja(e) {
|
|
|
3638
3647
|
r[a] = n;
|
|
3639
3648
|
return r;
|
|
3640
3649
|
}
|
|
3641
|
-
var
|
|
3650
|
+
var $r = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Nr = m.forwardRef(
|
|
3642
3651
|
function({
|
|
3643
3652
|
onClick: t,
|
|
3644
3653
|
discover: r = "render",
|
|
@@ -3653,8 +3662,8 @@ var Fr = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, kr = m.forwardRef(
|
|
|
3653
3662
|
viewTransition: b,
|
|
3654
3663
|
...g
|
|
3655
3664
|
}, p) {
|
|
3656
|
-
let { basename: v } = m.useContext(oe),
|
|
3657
|
-
if (typeof c == "string" &&
|
|
3665
|
+
let { basename: v } = m.useContext(oe), C = typeof c == "string" && $r.test(c), x, E = !1;
|
|
3666
|
+
if (typeof c == "string" && C && (x = c, kr))
|
|
3658
3667
|
try {
|
|
3659
3668
|
let $ = new URL(window.location.href), W = c.startsWith("//") ? new URL($.protocol + c) : new URL(c), Q = re(W.pathname, v);
|
|
3660
3669
|
W.origin === $.origin && Q != null ? c = Q + W.search + W.hash : E = !0;
|
|
@@ -3664,10 +3673,10 @@ var Fr = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, kr = m.forwardRef(
|
|
|
3664
3673
|
`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
3665
3674
|
);
|
|
3666
3675
|
}
|
|
3667
|
-
let
|
|
3676
|
+
let L = Zn(c, { relative: n }), [T, O, U] = Ia(
|
|
3668
3677
|
a,
|
|
3669
3678
|
g
|
|
3670
|
-
), f =
|
|
3679
|
+
), f = Ja(c, {
|
|
3671
3680
|
replace: l,
|
|
3672
3681
|
state: s,
|
|
3673
3682
|
target: u,
|
|
@@ -3684,20 +3693,20 @@ var Fr = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, kr = m.forwardRef(
|
|
|
3684
3693
|
"a",
|
|
3685
3694
|
{
|
|
3686
3695
|
...g,
|
|
3687
|
-
...
|
|
3688
|
-
href: x ||
|
|
3696
|
+
...U,
|
|
3697
|
+
href: x || L,
|
|
3689
3698
|
onClick: E || i ? t : A,
|
|
3690
|
-
ref:
|
|
3699
|
+
ref: _a(p, O),
|
|
3691
3700
|
target: u,
|
|
3692
|
-
"data-discover": !
|
|
3701
|
+
"data-discover": !C && r === "render" ? "true" : void 0
|
|
3693
3702
|
}
|
|
3694
3703
|
)
|
|
3695
3704
|
);
|
|
3696
|
-
return T && !
|
|
3705
|
+
return T && !C ? /* @__PURE__ */ m.createElement(m.Fragment, null, I, /* @__PURE__ */ m.createElement(Ha, { page: L })) : I;
|
|
3697
3706
|
}
|
|
3698
3707
|
);
|
|
3699
|
-
|
|
3700
|
-
var
|
|
3708
|
+
Nr.displayName = "Link";
|
|
3709
|
+
var Va = m.forwardRef(
|
|
3701
3710
|
function({
|
|
3702
3711
|
"aria-current": t = "page",
|
|
3703
3712
|
caseSensitive: r = !1,
|
|
@@ -3709,25 +3718,25 @@ var Ha = m.forwardRef(
|
|
|
3709
3718
|
children: u,
|
|
3710
3719
|
...c
|
|
3711
3720
|
}, y) {
|
|
3712
|
-
let b = Ge(l, { relative: c.relative }), g =
|
|
3721
|
+
let b = Ge(l, { relative: c.relative }), g = Ce(), p = m.useContext(Ye), { navigator: v, basename: C } = m.useContext(oe), x = p != null && // Conditional usage is OK here because the usage of a data router is static
|
|
3713
3722
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
3714
|
-
|
|
3715
|
-
r || (
|
|
3716
|
-
const
|
|
3717
|
-
let
|
|
3718
|
-
isActive:
|
|
3723
|
+
Za(b) && s === !0, E = v.encodeLocation ? v.encodeLocation(b).pathname : b.pathname, L = g.pathname, T = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
|
|
3724
|
+
r || (L = L.toLowerCase(), T = T ? T.toLowerCase() : null, E = E.toLowerCase()), T && C && (T = re(T, C) || T);
|
|
3725
|
+
const O = E !== "/" && E.endsWith("/") ? E.length - 1 : E.length;
|
|
3726
|
+
let U = L === E || !n && L.startsWith(E) && L.charAt(O) === "/", f = T != null && (T === E || !n && T.startsWith(E) && T.charAt(E.length) === "/"), A = {
|
|
3727
|
+
isActive: U,
|
|
3719
3728
|
isPending: f,
|
|
3720
3729
|
isTransitioning: x
|
|
3721
|
-
}, I =
|
|
3730
|
+
}, I = U ? t : void 0, $;
|
|
3722
3731
|
typeof a == "function" ? $ = a(A) : $ = [
|
|
3723
3732
|
a,
|
|
3724
|
-
|
|
3733
|
+
U ? "active" : null,
|
|
3725
3734
|
f ? "pending" : null,
|
|
3726
3735
|
x ? "transitioning" : null
|
|
3727
3736
|
].filter(Boolean).join(" ");
|
|
3728
3737
|
let W = typeof i == "function" ? i(A) : i;
|
|
3729
3738
|
return /* @__PURE__ */ m.createElement(
|
|
3730
|
-
|
|
3739
|
+
Nr,
|
|
3731
3740
|
{
|
|
3732
3741
|
...c,
|
|
3733
3742
|
"aria-current": I,
|
|
@@ -3741,8 +3750,8 @@ var Ha = m.forwardRef(
|
|
|
3741
3750
|
);
|
|
3742
3751
|
}
|
|
3743
3752
|
);
|
|
3744
|
-
|
|
3745
|
-
var
|
|
3753
|
+
Va.displayName = "NavLink";
|
|
3754
|
+
var Ka = m.forwardRef(
|
|
3746
3755
|
({
|
|
3747
3756
|
discover: e = "render",
|
|
3748
3757
|
fetcherKey: t,
|
|
@@ -3758,13 +3767,13 @@ var za = m.forwardRef(
|
|
|
3758
3767
|
viewTransition: b,
|
|
3759
3768
|
...g
|
|
3760
3769
|
}, p) => {
|
|
3761
|
-
let v =
|
|
3770
|
+
let v = Qa(), C = qa(s, { relative: c }), x = l.toLowerCase() === "get" ? "get" : "post", E = typeof s == "string" && $r.test(s), L = (T) => {
|
|
3762
3771
|
if (u && u(T), T.defaultPrevented) return;
|
|
3763
3772
|
T.preventDefault();
|
|
3764
|
-
let
|
|
3765
|
-
v(
|
|
3773
|
+
let O = T.nativeEvent.submitter, U = O?.getAttribute("formmethod") || l;
|
|
3774
|
+
v(O || T.currentTarget, {
|
|
3766
3775
|
fetcherKey: t,
|
|
3767
|
-
method:
|
|
3776
|
+
method: U,
|
|
3768
3777
|
navigate: r,
|
|
3769
3778
|
replace: n,
|
|
3770
3779
|
state: i,
|
|
@@ -3778,23 +3787,23 @@ var za = m.forwardRef(
|
|
|
3778
3787
|
{
|
|
3779
3788
|
ref: p,
|
|
3780
3789
|
method: x,
|
|
3781
|
-
action:
|
|
3782
|
-
onSubmit: a ? u :
|
|
3790
|
+
action: C,
|
|
3791
|
+
onSubmit: a ? u : L,
|
|
3783
3792
|
...g,
|
|
3784
3793
|
"data-discover": !E && e === "render" ? "true" : void 0
|
|
3785
3794
|
}
|
|
3786
3795
|
);
|
|
3787
3796
|
}
|
|
3788
3797
|
);
|
|
3789
|
-
|
|
3790
|
-
function
|
|
3798
|
+
Ka.displayName = "Form";
|
|
3799
|
+
function Ya(e) {
|
|
3791
3800
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
3792
3801
|
}
|
|
3793
|
-
function
|
|
3802
|
+
function Or(e) {
|
|
3794
3803
|
let t = m.useContext(Se);
|
|
3795
|
-
return
|
|
3804
|
+
return N(t, Ya(e)), t;
|
|
3796
3805
|
}
|
|
3797
|
-
function
|
|
3806
|
+
function Ja(e, {
|
|
3798
3807
|
target: t,
|
|
3799
3808
|
replace: r,
|
|
3800
3809
|
state: a,
|
|
@@ -3802,10 +3811,10 @@ function Ba(e, {
|
|
|
3802
3811
|
relative: i,
|
|
3803
3812
|
viewTransition: l
|
|
3804
3813
|
} = {}) {
|
|
3805
|
-
let s =
|
|
3814
|
+
let s = Mr(), u = Ce(), c = Ge(e, { relative: i });
|
|
3806
3815
|
return m.useCallback(
|
|
3807
3816
|
(y) => {
|
|
3808
|
-
if (
|
|
3817
|
+
if (Sa(y, t)) {
|
|
3809
3818
|
y.preventDefault();
|
|
3810
3819
|
let b = r !== void 0 ? r : pe(u) === pe(c);
|
|
3811
3820
|
s(e, {
|
|
@@ -3831,20 +3840,20 @@ function Ba(e, {
|
|
|
3831
3840
|
]
|
|
3832
3841
|
);
|
|
3833
3842
|
}
|
|
3834
|
-
var
|
|
3835
|
-
function
|
|
3836
|
-
let { router: e } =
|
|
3843
|
+
var Ga = 0, Xa = () => `__${String(++Ga)}__`;
|
|
3844
|
+
function Qa() {
|
|
3845
|
+
let { router: e } = Or(
|
|
3837
3846
|
"useSubmit"
|
|
3838
3847
|
/* UseSubmit */
|
|
3839
|
-
), { basename: t } = m.useContext(oe), r =
|
|
3848
|
+
), { basename: t } = m.useContext(oe), r = fa();
|
|
3840
3849
|
return m.useCallback(
|
|
3841
3850
|
async (a, n = {}) => {
|
|
3842
|
-
let { action: i, method: l, encType: s, formData: u, body: c } =
|
|
3851
|
+
let { action: i, method: l, encType: s, formData: u, body: c } = Pa(
|
|
3843
3852
|
a,
|
|
3844
3853
|
t
|
|
3845
3854
|
);
|
|
3846
3855
|
if (n.navigate === !1) {
|
|
3847
|
-
let y = n.fetcherKey ||
|
|
3856
|
+
let y = n.fetcherKey || Xa();
|
|
3848
3857
|
await e.fetch(y, r, n.action || i, {
|
|
3849
3858
|
preventScrollReset: n.preventScrollReset,
|
|
3850
3859
|
formData: u,
|
|
@@ -3870,10 +3879,10 @@ function Ka() {
|
|
|
3870
3879
|
[e, t, r]
|
|
3871
3880
|
);
|
|
3872
3881
|
}
|
|
3873
|
-
function
|
|
3874
|
-
let { basename: r } = m.useContext(oe), a = m.useContext(
|
|
3875
|
-
|
|
3876
|
-
let [n] = a.matches.slice(-1), i = { ...Ge(e || ".", { relative: t }) }, l =
|
|
3882
|
+
function qa(e, { relative: t } = {}) {
|
|
3883
|
+
let { basename: r } = m.useContext(oe), a = m.useContext(le);
|
|
3884
|
+
N(a, "useFormAction must be used inside a RouteContext");
|
|
3885
|
+
let [n] = a.matches.slice(-1), i = { ...Ge(e || ".", { relative: t }) }, l = Ce();
|
|
3877
3886
|
if (e == null) {
|
|
3878
3887
|
i.search = l.search;
|
|
3879
3888
|
let s = new URLSearchParams(i.search), u = s.getAll("index");
|
|
@@ -3885,13 +3894,13 @@ function Ya(e, { relative: t } = {}) {
|
|
|
3885
3894
|
}
|
|
3886
3895
|
return (!e || e === ".") && n.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (i.pathname = i.pathname === "/" ? r : ie([r, i.pathname])), pe(i);
|
|
3887
3896
|
}
|
|
3888
|
-
function
|
|
3889
|
-
let r = m.useContext(
|
|
3890
|
-
|
|
3897
|
+
function Za(e, t = {}) {
|
|
3898
|
+
let r = m.useContext(kt);
|
|
3899
|
+
N(
|
|
3891
3900
|
r != null,
|
|
3892
3901
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
3893
3902
|
);
|
|
3894
|
-
let { basename: a } =
|
|
3903
|
+
let { basename: a } = Or(
|
|
3895
3904
|
"useViewTransitionState"
|
|
3896
3905
|
/* useViewTransitionState */
|
|
3897
3906
|
), n = Ge(e, { relative: t.relative });
|
|
@@ -3901,8 +3910,30 @@ function Ja(e, t = {}) {
|
|
|
3901
3910
|
return ft(n.pathname, l) != null || ft(n.pathname, i) != null;
|
|
3902
3911
|
}
|
|
3903
3912
|
new TextEncoder();
|
|
3913
|
+
const ii = () => {
|
|
3914
|
+
const e = bt(
|
|
3915
|
+
(i) => i.currentNavigationPath
|
|
3916
|
+
), t = bt(
|
|
3917
|
+
(i) => i.navigateTo
|
|
3918
|
+
), r = bt(
|
|
3919
|
+
(i) => i.navigateInHortiview
|
|
3920
|
+
), a = Mr();
|
|
3921
|
+
return Zr(() => {
|
|
3922
|
+
e && a(e, { replace: !0 });
|
|
3923
|
+
}, [e, a]), en(
|
|
3924
|
+
(i) => {
|
|
3925
|
+
if (r) {
|
|
3926
|
+
r(i);
|
|
3927
|
+
return;
|
|
3928
|
+
}
|
|
3929
|
+
t && t(i);
|
|
3930
|
+
},
|
|
3931
|
+
[r, t]
|
|
3932
|
+
);
|
|
3933
|
+
};
|
|
3904
3934
|
export {
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3935
|
+
ni as O,
|
|
3936
|
+
ri as R,
|
|
3937
|
+
ai as c,
|
|
3938
|
+
ii as u
|
|
3908
3939
|
};
|