@genai-fi/base 3.0.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button-CGKw9sMz.js +656 -0
- package/dist/CircularProgress-C6sMwjDC.js +1275 -0
- package/dist/{DefaultPropsProvider-C0Ib4Mye.js → DefaultPropsProvider-D2IJ8Qbs.js} +5 -1
- package/dist/{DialogQR-DVWhImXI.js → DialogQR-CyZcX7ul.js} +9 -5
- package/dist/{FlashWifi-CaAOKd3g.js → FlashWifi-CYp0UP0B.js} +1 -1
- package/dist/Portal-BqkDy0Wc.js +613 -0
- package/dist/SvgLayer-CA0elY7q.js +36 -0
- package/dist/assets/IconButtonDot.css +1 -0
- package/dist/assets/LangSelect.css +1 -0
- package/dist/assets/Loading.css +1 -0
- package/dist/assets/PercentageBar.css +1 -0
- package/dist/assets/PieScore.css +1 -0
- package/dist/assets/SvgLayer.css +1 -0
- package/dist/assets/Widget.css +1 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/style2.css +1 -0
- package/dist/colours.module.css +4 -0
- package/dist/components/AlertPara/AlertPara.js +1 -1
- package/dist/components/Application/Application.d.ts +10 -0
- package/dist/components/Application/Application.js +1610 -0
- package/dist/components/BusyButton/BusyButton.js +7 -6
- package/dist/components/Button/Button.js +12 -4
- package/dist/components/ConnectionStatus/ConnectionStatus.d.ts +1 -5
- package/dist/components/ConnectionStatus/ConnectionStatus.js +48 -47
- package/dist/components/ConnectionStatus/FlashWifi.js +1 -1
- package/dist/components/ContentLoader/ContentError.js +1 -1
- package/dist/components/ContentLoader/ContentLoader.js +5 -1
- package/dist/components/ContentLoader/ContentProgress.js +1 -1
- package/dist/components/IconButtonDot/IconButtonDot.d.ts +7 -0
- package/dist/components/IconButtonDot/IconButtonDot.js +22 -0
- package/dist/components/IconMenu/IconMenu.d.ts +12 -0
- package/dist/components/IconMenu/IconMenu.js +26 -0
- package/dist/components/IconMenu/IconMenuInline.d.ts +6 -0
- package/dist/components/IconMenu/IconMenuInline.js +12 -0
- package/dist/components/IconMenu/Item.d.ts +9 -0
- package/dist/components/IconMenu/Item.js +34 -0
- package/dist/components/IconMenu/Spacer.d.ts +1 -0
- package/dist/components/IconMenu/Spacer.js +11 -0
- package/dist/components/IconMenu/context.d.ts +1 -0
- package/dist/components/IconMenu/context.js +5 -0
- package/dist/components/IconMenu/index.d.ts +4 -0
- package/dist/components/IconMenu/index.js +10 -0
- package/dist/components/LangSelect/LangSelect.d.ts +12 -0
- package/dist/components/LangSelect/LangSelect.js +46 -0
- package/dist/components/Loading/Loading.d.ts +7 -0
- package/dist/components/Loading/Loading.js +15 -0
- package/dist/components/Motd/Motd.js +1 -1
- package/dist/components/PercentageBar/PercentageBar.d.ts +7 -0
- package/dist/components/PercentageBar/PercentageBar.js +37 -0
- package/dist/components/PieScore/PieScore.d.ts +6 -0
- package/dist/components/PieScore/PieScore.js +10676 -0
- package/dist/components/QRCode/DialogQR.js +8 -4
- package/dist/components/QRCode/QRCode.js +1 -1
- package/dist/components/Webcam/Webcam.js +3 -3
- package/dist/components/WorkflowLayout/Layout.d.ts +7 -0
- package/dist/components/WorkflowLayout/Layout.js +43 -0
- package/dist/components/WorkflowLayout/SvgLayer.d.ts +14 -0
- package/dist/components/WorkflowLayout/SvgLayer.js +5 -0
- package/dist/components/WorkflowLayout/Widget.d.ts +18 -0
- package/dist/components/WorkflowLayout/Widget.js +7413 -0
- package/dist/components/WorkflowLayout/index.d.ts +3 -0
- package/dist/components/WorkflowLayout/index.js +6 -0
- package/dist/components/WorkflowLayout/lines.d.ts +17 -0
- package/dist/components/WorkflowLayout/lines.js +37 -0
- package/dist/{createSvgIcon-BfF8yuCp.js → createSvgIcon-DmrVEdN7.js} +2 -2
- package/dist/{createTheme-BIcG8YPQ.js → createTheme-a85zdZWm.js} +4 -0
- package/dist/hooks/peer.d.ts +25 -2
- package/dist/hooks/peer.js +196 -54
- package/dist/main.d.ts +6 -0
- package/dist/main.js +53 -33
- package/dist/react-D_xU5dL6.js +112 -0
- package/dist/state/webrtcState.js +5 -4
- package/dist/style/theme.js +1 -1
- package/dist/style.module-BAnhZ_KJ.js +9 -0
- package/dist/style.module-BDpZJv9y.js +26 -0
- package/dist/util/Observer.d.ts +7 -0
- package/dist/util/Observer.js +9 -0
- package/dist/{webrtcState-D0nJpE9Z.js → vanilla-BJxibF1U.js} +83 -85
- package/package.json +8 -2
- package/dist/Button-DQwRVw4a.js +0 -1918
- package/dist/react-D-b-Xrzv.js +0 -98
- package/dist/style.module-DSFm2eLD.js +0 -9
|
@@ -0,0 +1,1610 @@
|
|
|
1
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import { ThemeProvider as Le } from "@emotion/react";
|
|
3
|
+
import { StyledEngineProvider as ke } from "@mui/material";
|
|
4
|
+
import { theme as $e } from "../../style/theme.js";
|
|
5
|
+
import * as o from "react";
|
|
6
|
+
import { Suspense as Te } from "react";
|
|
7
|
+
import * as Me from "react-dom";
|
|
8
|
+
import De from "../Loading/Loading.js";
|
|
9
|
+
import { P as Ae } from "../../react-D_xU5dL6.js";
|
|
10
|
+
var F = {}, ie;
|
|
11
|
+
function Ie() {
|
|
12
|
+
if (ie) return F;
|
|
13
|
+
ie = 1, Object.defineProperty(F, "__esModule", { value: !0 }), F.parse = s, F.serialize = u;
|
|
14
|
+
const e = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/, t = /^[\u0021-\u003A\u003C-\u007E]*$/, n = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i, i = /^[\u0020-\u003A\u003D-\u007E]*$/, r = Object.prototype.toString, a = /* @__PURE__ */ (() => {
|
|
15
|
+
const f = function() {
|
|
16
|
+
};
|
|
17
|
+
return f.prototype = /* @__PURE__ */ Object.create(null), f;
|
|
18
|
+
})();
|
|
19
|
+
function s(f, v) {
|
|
20
|
+
const d = new a(), g = f.length;
|
|
21
|
+
if (g < 2)
|
|
22
|
+
return d;
|
|
23
|
+
const x = (v == null ? void 0 : v.decode) || m;
|
|
24
|
+
let h = 0;
|
|
25
|
+
do {
|
|
26
|
+
const w = f.indexOf("=", h);
|
|
27
|
+
if (w === -1)
|
|
28
|
+
break;
|
|
29
|
+
const y = f.indexOf(";", h), C = y === -1 ? g : y;
|
|
30
|
+
if (w > C) {
|
|
31
|
+
h = f.lastIndexOf(";", w - 1) + 1;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const E = c(f, h, w), b = l(f, w, E), L = f.slice(E, b);
|
|
35
|
+
if (d[L] === void 0) {
|
|
36
|
+
let S = c(f, w + 1, C), P = l(f, C, S);
|
|
37
|
+
const A = x(f.slice(S, P));
|
|
38
|
+
d[L] = A;
|
|
39
|
+
}
|
|
40
|
+
h = C + 1;
|
|
41
|
+
} while (h < g);
|
|
42
|
+
return d;
|
|
43
|
+
}
|
|
44
|
+
function c(f, v, d) {
|
|
45
|
+
do {
|
|
46
|
+
const g = f.charCodeAt(v);
|
|
47
|
+
if (g !== 32 && g !== 9)
|
|
48
|
+
return v;
|
|
49
|
+
} while (++v < d);
|
|
50
|
+
return d;
|
|
51
|
+
}
|
|
52
|
+
function l(f, v, d) {
|
|
53
|
+
for (; v > d; ) {
|
|
54
|
+
const g = f.charCodeAt(--v);
|
|
55
|
+
if (g !== 32 && g !== 9)
|
|
56
|
+
return v + 1;
|
|
57
|
+
}
|
|
58
|
+
return d;
|
|
59
|
+
}
|
|
60
|
+
function u(f, v, d) {
|
|
61
|
+
const g = (d == null ? void 0 : d.encode) || encodeURIComponent;
|
|
62
|
+
if (!e.test(f))
|
|
63
|
+
throw new TypeError(`argument name is invalid: ${f}`);
|
|
64
|
+
const x = g(v);
|
|
65
|
+
if (!t.test(x))
|
|
66
|
+
throw new TypeError(`argument val is invalid: ${v}`);
|
|
67
|
+
let h = f + "=" + x;
|
|
68
|
+
if (!d)
|
|
69
|
+
return h;
|
|
70
|
+
if (d.maxAge !== void 0) {
|
|
71
|
+
if (!Number.isInteger(d.maxAge))
|
|
72
|
+
throw new TypeError(`option maxAge is invalid: ${d.maxAge}`);
|
|
73
|
+
h += "; Max-Age=" + d.maxAge;
|
|
74
|
+
}
|
|
75
|
+
if (d.domain) {
|
|
76
|
+
if (!n.test(d.domain))
|
|
77
|
+
throw new TypeError(`option domain is invalid: ${d.domain}`);
|
|
78
|
+
h += "; Domain=" + d.domain;
|
|
79
|
+
}
|
|
80
|
+
if (d.path) {
|
|
81
|
+
if (!i.test(d.path))
|
|
82
|
+
throw new TypeError(`option path is invalid: ${d.path}`);
|
|
83
|
+
h += "; Path=" + d.path;
|
|
84
|
+
}
|
|
85
|
+
if (d.expires) {
|
|
86
|
+
if (!p(d.expires) || !Number.isFinite(d.expires.valueOf()))
|
|
87
|
+
throw new TypeError(`option expires is invalid: ${d.expires}`);
|
|
88
|
+
h += "; Expires=" + d.expires.toUTCString();
|
|
89
|
+
}
|
|
90
|
+
if (d.httpOnly && (h += "; HttpOnly"), d.secure && (h += "; Secure"), d.partitioned && (h += "; Partitioned"), d.priority)
|
|
91
|
+
switch (typeof d.priority == "string" ? d.priority.toLowerCase() : void 0) {
|
|
92
|
+
case "low":
|
|
93
|
+
h += "; Priority=Low";
|
|
94
|
+
break;
|
|
95
|
+
case "medium":
|
|
96
|
+
h += "; Priority=Medium";
|
|
97
|
+
break;
|
|
98
|
+
case "high":
|
|
99
|
+
h += "; Priority=High";
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
throw new TypeError(`option priority is invalid: ${d.priority}`);
|
|
103
|
+
}
|
|
104
|
+
if (d.sameSite)
|
|
105
|
+
switch (typeof d.sameSite == "string" ? d.sameSite.toLowerCase() : d.sameSite) {
|
|
106
|
+
case !0:
|
|
107
|
+
case "strict":
|
|
108
|
+
h += "; SameSite=Strict";
|
|
109
|
+
break;
|
|
110
|
+
case "lax":
|
|
111
|
+
h += "; SameSite=Lax";
|
|
112
|
+
break;
|
|
113
|
+
case "none":
|
|
114
|
+
h += "; SameSite=None";
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
throw new TypeError(`option sameSite is invalid: ${d.sameSite}`);
|
|
118
|
+
}
|
|
119
|
+
return h;
|
|
120
|
+
}
|
|
121
|
+
function m(f) {
|
|
122
|
+
if (f.indexOf("%") === -1)
|
|
123
|
+
return f;
|
|
124
|
+
try {
|
|
125
|
+
return decodeURIComponent(f);
|
|
126
|
+
} catch {
|
|
127
|
+
return f;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function p(f) {
|
|
131
|
+
return r.call(f) === "[object Date]";
|
|
132
|
+
}
|
|
133
|
+
return F;
|
|
134
|
+
}
|
|
135
|
+
Ie();
|
|
136
|
+
/**
|
|
137
|
+
* react-router v7.6.2
|
|
138
|
+
*
|
|
139
|
+
* Copyright (c) Remix Software Inc.
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the MIT license found in the
|
|
142
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
143
|
+
*
|
|
144
|
+
* @license MIT
|
|
145
|
+
*/
|
|
146
|
+
function R(e, t) {
|
|
147
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
148
|
+
throw new Error(t);
|
|
149
|
+
}
|
|
150
|
+
function k(e, t) {
|
|
151
|
+
if (!e) {
|
|
152
|
+
typeof console < "u" && console.warn(t);
|
|
153
|
+
try {
|
|
154
|
+
throw new Error(t);
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function X({
|
|
160
|
+
pathname: e = "/",
|
|
161
|
+
search: t = "",
|
|
162
|
+
hash: n = ""
|
|
163
|
+
}) {
|
|
164
|
+
return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
|
|
165
|
+
}
|
|
166
|
+
function Y(e) {
|
|
167
|
+
let t = {};
|
|
168
|
+
if (e) {
|
|
169
|
+
let n = e.indexOf("#");
|
|
170
|
+
n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
|
|
171
|
+
let i = e.indexOf("?");
|
|
172
|
+
i >= 0 && (t.search = e.substring(i), e = e.substring(0, i)), e && (t.pathname = e);
|
|
173
|
+
}
|
|
174
|
+
return t;
|
|
175
|
+
}
|
|
176
|
+
function de(e, t, n = "/") {
|
|
177
|
+
return Ne(e, t, n, !1);
|
|
178
|
+
}
|
|
179
|
+
function Ne(e, t, n, i) {
|
|
180
|
+
let r = typeof t == "string" ? Y(t) : t, a = M(r.pathname || "/", n);
|
|
181
|
+
if (a == null)
|
|
182
|
+
return null;
|
|
183
|
+
let s = fe(e);
|
|
184
|
+
Oe(s);
|
|
185
|
+
let c = null;
|
|
186
|
+
for (let l = 0; c == null && l < s.length; ++l) {
|
|
187
|
+
let u = Je(a);
|
|
188
|
+
c = je(
|
|
189
|
+
s[l],
|
|
190
|
+
u,
|
|
191
|
+
i
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
return c;
|
|
195
|
+
}
|
|
196
|
+
function fe(e, t = [], n = [], i = "") {
|
|
197
|
+
let r = (a, s, c) => {
|
|
198
|
+
let l = {
|
|
199
|
+
relativePath: c === void 0 ? a.path || "" : c,
|
|
200
|
+
caseSensitive: a.caseSensitive === !0,
|
|
201
|
+
childrenIndex: s,
|
|
202
|
+
route: a
|
|
203
|
+
};
|
|
204
|
+
l.relativePath.startsWith("/") && (R(
|
|
205
|
+
l.relativePath.startsWith(i),
|
|
206
|
+
`Absolute route path "${l.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
207
|
+
), l.relativePath = l.relativePath.slice(i.length));
|
|
208
|
+
let u = T([i, l.relativePath]), m = n.concat(l);
|
|
209
|
+
a.children && a.children.length > 0 && (R(
|
|
210
|
+
// Our types know better, but runtime JS may not!
|
|
211
|
+
// @ts-expect-error
|
|
212
|
+
a.index !== !0,
|
|
213
|
+
`Index routes must not have child routes. Please remove all child routes from route path "${u}".`
|
|
214
|
+
), fe(a.children, t, m, u)), !(a.path == null && !a.index) && t.push({
|
|
215
|
+
path: u,
|
|
216
|
+
score: Ve(u, a.index),
|
|
217
|
+
routesMeta: m
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
return e.forEach((a, s) => {
|
|
221
|
+
var c;
|
|
222
|
+
if (a.path === "" || !((c = a.path) != null && c.includes("?")))
|
|
223
|
+
r(a, s);
|
|
224
|
+
else
|
|
225
|
+
for (let l of he(a.path))
|
|
226
|
+
r(a, s, l);
|
|
227
|
+
}), t;
|
|
228
|
+
}
|
|
229
|
+
function he(e) {
|
|
230
|
+
let t = e.split("/");
|
|
231
|
+
if (t.length === 0) return [];
|
|
232
|
+
let [n, ...i] = t, r = n.endsWith("?"), a = n.replace(/\?$/, "");
|
|
233
|
+
if (i.length === 0)
|
|
234
|
+
return r ? [a, ""] : [a];
|
|
235
|
+
let s = he(i.join("/")), c = [];
|
|
236
|
+
return c.push(
|
|
237
|
+
...s.map(
|
|
238
|
+
(l) => l === "" ? a : [a, l].join("/")
|
|
239
|
+
)
|
|
240
|
+
), r && c.push(...s), c.map(
|
|
241
|
+
(l) => e.startsWith("/") && l === "" ? "/" : l
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
function Oe(e) {
|
|
245
|
+
e.sort(
|
|
246
|
+
(t, n) => t.score !== n.score ? n.score - t.score : ze(
|
|
247
|
+
t.routesMeta.map((i) => i.childrenIndex),
|
|
248
|
+
n.routesMeta.map((i) => i.childrenIndex)
|
|
249
|
+
)
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
var Fe = /^:[\w-]+$/, Be = 3, We = 2, Ue = 1, _e = 10, He = -2, oe = (e) => e === "*";
|
|
253
|
+
function Ve(e, t) {
|
|
254
|
+
let n = e.split("/"), i = n.length;
|
|
255
|
+
return n.some(oe) && (i += He), t && (i += We), n.filter((r) => !oe(r)).reduce(
|
|
256
|
+
(r, a) => r + (Fe.test(a) ? Be : a === "" ? Ue : _e),
|
|
257
|
+
i
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
function ze(e, t) {
|
|
261
|
+
return e.length === t.length && e.slice(0, -1).every((i, r) => i === t[r]) ? (
|
|
262
|
+
// If two routes are siblings, we should try to match the earlier sibling
|
|
263
|
+
// first. This allows people to have fine-grained control over the matching
|
|
264
|
+
// behavior by simply putting routes with identical paths in the order they
|
|
265
|
+
// want them tried.
|
|
266
|
+
e[e.length - 1] - t[t.length - 1]
|
|
267
|
+
) : (
|
|
268
|
+
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
269
|
+
// so they sort equally.
|
|
270
|
+
0
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
function je(e, t, n = !1) {
|
|
274
|
+
let { routesMeta: i } = e, r = {}, a = "/", s = [];
|
|
275
|
+
for (let c = 0; c < i.length; ++c) {
|
|
276
|
+
let l = i[c], u = c === i.length - 1, m = a === "/" ? t : t.slice(a.length) || "/", p = j(
|
|
277
|
+
{ path: l.relativePath, caseSensitive: l.caseSensitive, end: u },
|
|
278
|
+
m
|
|
279
|
+
), f = l.route;
|
|
280
|
+
if (!p && u && n && !i[i.length - 1].route.index && (p = j(
|
|
281
|
+
{
|
|
282
|
+
path: l.relativePath,
|
|
283
|
+
caseSensitive: l.caseSensitive,
|
|
284
|
+
end: !1
|
|
285
|
+
},
|
|
286
|
+
m
|
|
287
|
+
)), !p)
|
|
288
|
+
return null;
|
|
289
|
+
Object.assign(r, p.params), s.push({
|
|
290
|
+
// TODO: Can this as be avoided?
|
|
291
|
+
params: r,
|
|
292
|
+
pathname: T([a, p.pathname]),
|
|
293
|
+
pathnameBase: Xe(
|
|
294
|
+
T([a, p.pathnameBase])
|
|
295
|
+
),
|
|
296
|
+
route: f
|
|
297
|
+
}), p.pathnameBase !== "/" && (a = T([a, p.pathnameBase]));
|
|
298
|
+
}
|
|
299
|
+
return s;
|
|
300
|
+
}
|
|
301
|
+
function j(e, t) {
|
|
302
|
+
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
303
|
+
let [n, i] = Ye(
|
|
304
|
+
e.path,
|
|
305
|
+
e.caseSensitive,
|
|
306
|
+
e.end
|
|
307
|
+
), r = t.match(n);
|
|
308
|
+
if (!r) return null;
|
|
309
|
+
let a = r[0], s = a.replace(/(.)\/+$/, "$1"), c = r.slice(1);
|
|
310
|
+
return {
|
|
311
|
+
params: i.reduce(
|
|
312
|
+
(u, { paramName: m, isOptional: p }, f) => {
|
|
313
|
+
if (m === "*") {
|
|
314
|
+
let d = c[f] || "";
|
|
315
|
+
s = a.slice(0, a.length - d.length).replace(/(.)\/+$/, "$1");
|
|
316
|
+
}
|
|
317
|
+
const v = c[f];
|
|
318
|
+
return p && !v ? u[m] = void 0 : u[m] = (v || "").replace(/%2F/g, "/"), u;
|
|
319
|
+
},
|
|
320
|
+
{}
|
|
321
|
+
),
|
|
322
|
+
pathname: a,
|
|
323
|
+
pathnameBase: s,
|
|
324
|
+
pattern: e
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function Ye(e, t = !1, n = !0) {
|
|
328
|
+
k(
|
|
329
|
+
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
330
|
+
`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(/\*$/, "/*")}".`
|
|
331
|
+
);
|
|
332
|
+
let i = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
333
|
+
/\/:([\w-]+)(\?)?/g,
|
|
334
|
+
(s, c, l) => (i.push({ paramName: c, isOptional: l != null }), l ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
335
|
+
);
|
|
336
|
+
return e.endsWith("*") ? (i.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, t ? void 0 : "i"), i];
|
|
337
|
+
}
|
|
338
|
+
function Je(e) {
|
|
339
|
+
try {
|
|
340
|
+
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
341
|
+
} catch (t) {
|
|
342
|
+
return k(
|
|
343
|
+
!1,
|
|
344
|
+
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
|
|
345
|
+
), e;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function M(e, t) {
|
|
349
|
+
if (t === "/") return e;
|
|
350
|
+
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
351
|
+
return null;
|
|
352
|
+
let n = t.endsWith("/") ? t.length - 1 : t.length, i = e.charAt(n);
|
|
353
|
+
return i && i !== "/" ? null : e.slice(n) || "/";
|
|
354
|
+
}
|
|
355
|
+
function Ke(e, t = "/") {
|
|
356
|
+
let {
|
|
357
|
+
pathname: n,
|
|
358
|
+
search: i = "",
|
|
359
|
+
hash: r = ""
|
|
360
|
+
} = typeof e == "string" ? Y(e) : e;
|
|
361
|
+
return {
|
|
362
|
+
pathname: n ? n.startsWith("/") ? n : qe(n, t) : t,
|
|
363
|
+
search: Qe(i),
|
|
364
|
+
hash: Ze(r)
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function qe(e, t) {
|
|
368
|
+
let n = t.replace(/\/+$/, "").split("/");
|
|
369
|
+
return e.split("/").forEach((r) => {
|
|
370
|
+
r === ".." ? n.length > 1 && n.pop() : r !== "." && n.push(r);
|
|
371
|
+
}), n.length > 1 ? n.join("/") : "/";
|
|
372
|
+
}
|
|
373
|
+
function q(e, t, n, i) {
|
|
374
|
+
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
|
|
375
|
+
i
|
|
376
|
+
)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
377
|
+
}
|
|
378
|
+
function Ge(e) {
|
|
379
|
+
return e.filter(
|
|
380
|
+
(t, n) => n === 0 || t.route.path && t.route.path.length > 0
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
function me(e) {
|
|
384
|
+
let t = Ge(e);
|
|
385
|
+
return t.map(
|
|
386
|
+
(n, i) => i === t.length - 1 ? n.pathname : n.pathnameBase
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
function pe(e, t, n, i = !1) {
|
|
390
|
+
let r;
|
|
391
|
+
typeof e == "string" ? r = Y(e) : (r = { ...e }, R(
|
|
392
|
+
!r.pathname || !r.pathname.includes("?"),
|
|
393
|
+
q("?", "pathname", "search", r)
|
|
394
|
+
), R(
|
|
395
|
+
!r.pathname || !r.pathname.includes("#"),
|
|
396
|
+
q("#", "pathname", "hash", r)
|
|
397
|
+
), R(
|
|
398
|
+
!r.search || !r.search.includes("#"),
|
|
399
|
+
q("#", "search", "hash", r)
|
|
400
|
+
));
|
|
401
|
+
let a = e === "" || r.pathname === "", s = a ? "/" : r.pathname, c;
|
|
402
|
+
if (s == null)
|
|
403
|
+
c = n;
|
|
404
|
+
else {
|
|
405
|
+
let p = t.length - 1;
|
|
406
|
+
if (!i && s.startsWith("..")) {
|
|
407
|
+
let f = s.split("/");
|
|
408
|
+
for (; f[0] === ".."; )
|
|
409
|
+
f.shift(), p -= 1;
|
|
410
|
+
r.pathname = f.join("/");
|
|
411
|
+
}
|
|
412
|
+
c = p >= 0 ? t[p] : "/";
|
|
413
|
+
}
|
|
414
|
+
let l = Ke(r, c), u = s && s !== "/" && s.endsWith("/"), m = (a || s === ".") && n.endsWith("/");
|
|
415
|
+
return !l.pathname.endsWith("/") && (u || m) && (l.pathname += "/"), l;
|
|
416
|
+
}
|
|
417
|
+
var T = (e) => e.join("/").replace(/\/\/+/g, "/"), Xe = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Qe = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Ze = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
418
|
+
function et(e) {
|
|
419
|
+
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
420
|
+
}
|
|
421
|
+
var ve = [
|
|
422
|
+
"POST",
|
|
423
|
+
"PUT",
|
|
424
|
+
"PATCH",
|
|
425
|
+
"DELETE"
|
|
426
|
+
];
|
|
427
|
+
new Set(
|
|
428
|
+
ve
|
|
429
|
+
);
|
|
430
|
+
var tt = [
|
|
431
|
+
"GET",
|
|
432
|
+
...ve
|
|
433
|
+
];
|
|
434
|
+
new Set(tt);
|
|
435
|
+
var I = o.createContext(null);
|
|
436
|
+
I.displayName = "DataRouter";
|
|
437
|
+
var W = o.createContext(null);
|
|
438
|
+
W.displayName = "DataRouterState";
|
|
439
|
+
var Q = o.createContext({
|
|
440
|
+
isTransitioning: !1
|
|
441
|
+
});
|
|
442
|
+
Q.displayName = "ViewTransition";
|
|
443
|
+
var ge = o.createContext(
|
|
444
|
+
/* @__PURE__ */ new Map()
|
|
445
|
+
);
|
|
446
|
+
ge.displayName = "Fetchers";
|
|
447
|
+
var nt = o.createContext(null);
|
|
448
|
+
nt.displayName = "Await";
|
|
449
|
+
var $ = o.createContext(
|
|
450
|
+
null
|
|
451
|
+
);
|
|
452
|
+
$.displayName = "Navigation";
|
|
453
|
+
var J = o.createContext(
|
|
454
|
+
null
|
|
455
|
+
);
|
|
456
|
+
J.displayName = "Location";
|
|
457
|
+
var D = o.createContext({
|
|
458
|
+
outlet: null,
|
|
459
|
+
matches: [],
|
|
460
|
+
isDataRoute: !1
|
|
461
|
+
});
|
|
462
|
+
D.displayName = "Route";
|
|
463
|
+
var Z = o.createContext(null);
|
|
464
|
+
Z.displayName = "RouteError";
|
|
465
|
+
function rt(e, { relative: t } = {}) {
|
|
466
|
+
R(
|
|
467
|
+
U(),
|
|
468
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
469
|
+
// router loaded. We can help them understand how to avoid that.
|
|
470
|
+
"useHref() may be used only in the context of a <Router> component."
|
|
471
|
+
);
|
|
472
|
+
let { basename: n, navigator: i } = o.useContext($), { hash: r, pathname: a, search: s } = _(e, { relative: t }), c = a;
|
|
473
|
+
return n !== "/" && (c = a === "/" ? n : T([n, a])), i.createHref({ pathname: c, search: s, hash: r });
|
|
474
|
+
}
|
|
475
|
+
function U() {
|
|
476
|
+
return o.useContext(J) != null;
|
|
477
|
+
}
|
|
478
|
+
function N() {
|
|
479
|
+
return R(
|
|
480
|
+
U(),
|
|
481
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
482
|
+
// router loaded. We can help them understand how to avoid that.
|
|
483
|
+
"useLocation() may be used only in the context of a <Router> component."
|
|
484
|
+
), o.useContext(J).location;
|
|
485
|
+
}
|
|
486
|
+
var ye = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
487
|
+
function we(e) {
|
|
488
|
+
o.useContext($).static || o.useLayoutEffect(e);
|
|
489
|
+
}
|
|
490
|
+
function at() {
|
|
491
|
+
let { isDataRoute: e } = o.useContext(D);
|
|
492
|
+
return e ? gt() : it();
|
|
493
|
+
}
|
|
494
|
+
function it() {
|
|
495
|
+
R(
|
|
496
|
+
U(),
|
|
497
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
498
|
+
// router loaded. We can help them understand how to avoid that.
|
|
499
|
+
"useNavigate() may be used only in the context of a <Router> component."
|
|
500
|
+
);
|
|
501
|
+
let e = o.useContext(I), { basename: t, navigator: n } = o.useContext($), { matches: i } = o.useContext(D), { pathname: r } = N(), a = JSON.stringify(me(i)), s = o.useRef(!1);
|
|
502
|
+
return we(() => {
|
|
503
|
+
s.current = !0;
|
|
504
|
+
}), o.useCallback(
|
|
505
|
+
(l, u = {}) => {
|
|
506
|
+
if (k(s.current, ye), !s.current) return;
|
|
507
|
+
if (typeof l == "number") {
|
|
508
|
+
n.go(l);
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
let m = pe(
|
|
512
|
+
l,
|
|
513
|
+
JSON.parse(a),
|
|
514
|
+
r,
|
|
515
|
+
u.relative === "path"
|
|
516
|
+
);
|
|
517
|
+
e == null && t !== "/" && (m.pathname = m.pathname === "/" ? t : T([t, m.pathname])), (u.replace ? n.replace : n.push)(
|
|
518
|
+
m,
|
|
519
|
+
u.state,
|
|
520
|
+
u
|
|
521
|
+
);
|
|
522
|
+
},
|
|
523
|
+
[
|
|
524
|
+
t,
|
|
525
|
+
n,
|
|
526
|
+
a,
|
|
527
|
+
r,
|
|
528
|
+
e
|
|
529
|
+
]
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
o.createContext(null);
|
|
533
|
+
function _(e, { relative: t } = {}) {
|
|
534
|
+
let { matches: n } = o.useContext(D), { pathname: i } = N(), r = JSON.stringify(me(n));
|
|
535
|
+
return o.useMemo(
|
|
536
|
+
() => pe(
|
|
537
|
+
e,
|
|
538
|
+
JSON.parse(r),
|
|
539
|
+
i,
|
|
540
|
+
t === "path"
|
|
541
|
+
),
|
|
542
|
+
[e, r, i, t]
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
function ot(e, t, n, i) {
|
|
546
|
+
R(
|
|
547
|
+
U(),
|
|
548
|
+
// TODO: This error is probably because they somehow have 2 versions of the
|
|
549
|
+
// router loaded. We can help them understand how to avoid that.
|
|
550
|
+
"useRoutes() may be used only in the context of a <Router> component."
|
|
551
|
+
);
|
|
552
|
+
let { navigator: r } = o.useContext($), { matches: a } = o.useContext(D), s = a[a.length - 1], c = s ? s.params : {}, l = s ? s.pathname : "/", u = s ? s.pathnameBase : "/", m = s && s.route;
|
|
553
|
+
{
|
|
554
|
+
let h = m && m.path || "";
|
|
555
|
+
xe(
|
|
556
|
+
l,
|
|
557
|
+
!m || h.endsWith("*") || h.endsWith("*?"),
|
|
558
|
+
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) 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.
|
|
559
|
+
|
|
560
|
+
Please change the parent <Route path="${h}"> to <Route path="${h === "/" ? "*" : `${h}/*`}">.`
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
let p = N(), f;
|
|
564
|
+
f = p;
|
|
565
|
+
let v = f.pathname || "/", d = v;
|
|
566
|
+
if (u !== "/") {
|
|
567
|
+
let h = u.replace(/^\//, "").split("/");
|
|
568
|
+
d = "/" + v.replace(/^\//, "").split("/").slice(h.length).join("/");
|
|
569
|
+
}
|
|
570
|
+
let g = de(e, { pathname: d });
|
|
571
|
+
return k(
|
|
572
|
+
m || g != null,
|
|
573
|
+
`No routes matched location "${f.pathname}${f.search}${f.hash}" `
|
|
574
|
+
), k(
|
|
575
|
+
g == null || g[g.length - 1].route.element !== void 0 || g[g.length - 1].route.Component !== void 0 || g[g.length - 1].route.lazy !== void 0,
|
|
576
|
+
`Matched leaf route at location "${f.pathname}${f.search}${f.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.`
|
|
577
|
+
), dt(
|
|
578
|
+
g && g.map(
|
|
579
|
+
(h) => Object.assign({}, h, {
|
|
580
|
+
params: Object.assign({}, c, h.params),
|
|
581
|
+
pathname: T([
|
|
582
|
+
u,
|
|
583
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
584
|
+
r.encodeLocation ? r.encodeLocation(h.pathname).pathname : h.pathname
|
|
585
|
+
]),
|
|
586
|
+
pathnameBase: h.pathnameBase === "/" ? u : T([
|
|
587
|
+
u,
|
|
588
|
+
// Re-encode pathnames that were decoded inside matchRoutes
|
|
589
|
+
r.encodeLocation ? r.encodeLocation(h.pathnameBase).pathname : h.pathnameBase
|
|
590
|
+
])
|
|
591
|
+
})
|
|
592
|
+
),
|
|
593
|
+
a,
|
|
594
|
+
n,
|
|
595
|
+
i
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
function lt() {
|
|
599
|
+
let e = vt(), t = et(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, i = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: i }, a = { padding: "2px 4px", backgroundColor: i }, s = null;
|
|
600
|
+
return console.error(
|
|
601
|
+
"Error handled by React Router default ErrorBoundary:",
|
|
602
|
+
e
|
|
603
|
+
), s = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ o.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ o.createElement("code", { style: a }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ o.createElement("code", { style: a }, "errorElement"), " prop on your route.")), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ o.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ o.createElement("pre", { style: r }, n) : null, s);
|
|
604
|
+
}
|
|
605
|
+
var ut = /* @__PURE__ */ o.createElement(lt, null), st = class extends o.Component {
|
|
606
|
+
constructor(e) {
|
|
607
|
+
super(e), this.state = {
|
|
608
|
+
location: e.location,
|
|
609
|
+
revalidation: e.revalidation,
|
|
610
|
+
error: e.error
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
static getDerivedStateFromError(e) {
|
|
614
|
+
return { error: e };
|
|
615
|
+
}
|
|
616
|
+
static getDerivedStateFromProps(e, t) {
|
|
617
|
+
return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
618
|
+
error: e.error,
|
|
619
|
+
location: e.location,
|
|
620
|
+
revalidation: e.revalidation
|
|
621
|
+
} : {
|
|
622
|
+
error: e.error !== void 0 ? e.error : t.error,
|
|
623
|
+
location: t.location,
|
|
624
|
+
revalidation: e.revalidation || t.revalidation
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
componentDidCatch(e, t) {
|
|
628
|
+
console.error(
|
|
629
|
+
"React Router caught the following error during render",
|
|
630
|
+
e,
|
|
631
|
+
t
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
render() {
|
|
635
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ o.createElement(D.Provider, { value: this.props.routeContext }, /* @__PURE__ */ o.createElement(
|
|
636
|
+
Z.Provider,
|
|
637
|
+
{
|
|
638
|
+
value: this.state.error,
|
|
639
|
+
children: this.props.component
|
|
640
|
+
}
|
|
641
|
+
)) : this.props.children;
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
function ct({ routeContext: e, match: t, children: n }) {
|
|
645
|
+
let i = o.useContext(I);
|
|
646
|
+
return i && i.static && i.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (i.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ o.createElement(D.Provider, { value: e }, n);
|
|
647
|
+
}
|
|
648
|
+
function dt(e, t = [], n = null, i = null) {
|
|
649
|
+
if (e == null) {
|
|
650
|
+
if (!n)
|
|
651
|
+
return null;
|
|
652
|
+
if (n.errors)
|
|
653
|
+
e = n.matches;
|
|
654
|
+
else if (t.length === 0 && !n.initialized && n.matches.length > 0)
|
|
655
|
+
e = n.matches;
|
|
656
|
+
else
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
let r = e, a = n == null ? void 0 : n.errors;
|
|
660
|
+
if (a != null) {
|
|
661
|
+
let l = r.findIndex(
|
|
662
|
+
(u) => u.route.id && (a == null ? void 0 : a[u.route.id]) !== void 0
|
|
663
|
+
);
|
|
664
|
+
R(
|
|
665
|
+
l >= 0,
|
|
666
|
+
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
667
|
+
a
|
|
668
|
+
).join(",")}`
|
|
669
|
+
), r = r.slice(
|
|
670
|
+
0,
|
|
671
|
+
Math.min(r.length, l + 1)
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
let s = !1, c = -1;
|
|
675
|
+
if (n)
|
|
676
|
+
for (let l = 0; l < r.length; l++) {
|
|
677
|
+
let u = r[l];
|
|
678
|
+
if ((u.route.HydrateFallback || u.route.hydrateFallbackElement) && (c = l), u.route.id) {
|
|
679
|
+
let { loaderData: m, errors: p } = n, f = u.route.loader && !m.hasOwnProperty(u.route.id) && (!p || p[u.route.id] === void 0);
|
|
680
|
+
if (u.route.lazy || f) {
|
|
681
|
+
s = !0, c >= 0 ? r = r.slice(0, c + 1) : r = [r[0]];
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return r.reduceRight((l, u, m) => {
|
|
687
|
+
let p, f = !1, v = null, d = null;
|
|
688
|
+
n && (p = a && u.route.id ? a[u.route.id] : void 0, v = u.route.errorElement || ut, s && (c < 0 && m === 0 ? (xe(
|
|
689
|
+
"route-fallback",
|
|
690
|
+
!1,
|
|
691
|
+
"No `HydrateFallback` element provided to render during initial hydration"
|
|
692
|
+
), f = !0, d = null) : c === m && (f = !0, d = u.route.hydrateFallbackElement || null)));
|
|
693
|
+
let g = t.concat(r.slice(0, m + 1)), x = () => {
|
|
694
|
+
let h;
|
|
695
|
+
return p ? h = v : f ? h = d : u.route.Component ? h = /* @__PURE__ */ o.createElement(u.route.Component, null) : u.route.element ? h = u.route.element : h = l, /* @__PURE__ */ o.createElement(
|
|
696
|
+
ct,
|
|
697
|
+
{
|
|
698
|
+
match: u,
|
|
699
|
+
routeContext: {
|
|
700
|
+
outlet: l,
|
|
701
|
+
matches: g,
|
|
702
|
+
isDataRoute: n != null
|
|
703
|
+
},
|
|
704
|
+
children: h
|
|
705
|
+
}
|
|
706
|
+
);
|
|
707
|
+
};
|
|
708
|
+
return n && (u.route.ErrorBoundary || u.route.errorElement || m === 0) ? /* @__PURE__ */ o.createElement(
|
|
709
|
+
st,
|
|
710
|
+
{
|
|
711
|
+
location: n.location,
|
|
712
|
+
revalidation: n.revalidation,
|
|
713
|
+
component: v,
|
|
714
|
+
error: p,
|
|
715
|
+
children: x(),
|
|
716
|
+
routeContext: { outlet: null, matches: g, isDataRoute: !0 }
|
|
717
|
+
}
|
|
718
|
+
) : x();
|
|
719
|
+
}, null);
|
|
720
|
+
}
|
|
721
|
+
function ee(e) {
|
|
722
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
723
|
+
}
|
|
724
|
+
function ft(e) {
|
|
725
|
+
let t = o.useContext(I);
|
|
726
|
+
return R(t, ee(e)), t;
|
|
727
|
+
}
|
|
728
|
+
function ht(e) {
|
|
729
|
+
let t = o.useContext(W);
|
|
730
|
+
return R(t, ee(e)), t;
|
|
731
|
+
}
|
|
732
|
+
function mt(e) {
|
|
733
|
+
let t = o.useContext(D);
|
|
734
|
+
return R(t, ee(e)), t;
|
|
735
|
+
}
|
|
736
|
+
function te(e) {
|
|
737
|
+
let t = mt(e), n = t.matches[t.matches.length - 1];
|
|
738
|
+
return R(
|
|
739
|
+
n.route.id,
|
|
740
|
+
`${e} can only be used on routes that contain a unique "id"`
|
|
741
|
+
), n.route.id;
|
|
742
|
+
}
|
|
743
|
+
function pt() {
|
|
744
|
+
return te(
|
|
745
|
+
"useRouteId"
|
|
746
|
+
/* UseRouteId */
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
function vt() {
|
|
750
|
+
var i;
|
|
751
|
+
let e = o.useContext(Z), t = ht(
|
|
752
|
+
"useRouteError"
|
|
753
|
+
/* UseRouteError */
|
|
754
|
+
), n = te(
|
|
755
|
+
"useRouteError"
|
|
756
|
+
/* UseRouteError */
|
|
757
|
+
);
|
|
758
|
+
return e !== void 0 ? e : (i = t.errors) == null ? void 0 : i[n];
|
|
759
|
+
}
|
|
760
|
+
function gt() {
|
|
761
|
+
let { router: e } = ft(
|
|
762
|
+
"useNavigate"
|
|
763
|
+
/* UseNavigateStable */
|
|
764
|
+
), t = te(
|
|
765
|
+
"useNavigate"
|
|
766
|
+
/* UseNavigateStable */
|
|
767
|
+
), n = o.useRef(!1);
|
|
768
|
+
return we(() => {
|
|
769
|
+
n.current = !0;
|
|
770
|
+
}), o.useCallback(
|
|
771
|
+
async (r, a = {}) => {
|
|
772
|
+
k(n.current, ye), n.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: t, ...a }));
|
|
773
|
+
},
|
|
774
|
+
[e, t]
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
var le = {};
|
|
778
|
+
function xe(e, t, n) {
|
|
779
|
+
!t && !le[e] && (le[e] = !0, k(!1, n));
|
|
780
|
+
}
|
|
781
|
+
var ue = {};
|
|
782
|
+
function se(e, t) {
|
|
783
|
+
!e && !ue[t] && (ue[t] = !0, console.warn(t));
|
|
784
|
+
}
|
|
785
|
+
var yt = class {
|
|
786
|
+
constructor() {
|
|
787
|
+
this.status = "pending", this.promise = new Promise((e, t) => {
|
|
788
|
+
this.resolve = (n) => {
|
|
789
|
+
this.status === "pending" && (this.status = "resolved", e(n));
|
|
790
|
+
}, this.reject = (n) => {
|
|
791
|
+
this.status === "pending" && (this.status = "rejected", t(n));
|
|
792
|
+
};
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
function wt({
|
|
797
|
+
router: e,
|
|
798
|
+
flushSync: t
|
|
799
|
+
}) {
|
|
800
|
+
let [n, i] = o.useState(e.state), [r, a] = o.useState(), [s, c] = o.useState({
|
|
801
|
+
isTransitioning: !1
|
|
802
|
+
}), [l, u] = o.useState(), [m, p] = o.useState(), [f, v] = o.useState(), d = o.useRef(/* @__PURE__ */ new Map()), g = o.useCallback(
|
|
803
|
+
(y, { deletedFetchers: C, flushSync: E, viewTransitionOpts: b }) => {
|
|
804
|
+
y.fetchers.forEach((S, P) => {
|
|
805
|
+
S.data !== void 0 && d.current.set(P, S.data);
|
|
806
|
+
}), C.forEach((S) => d.current.delete(S)), se(
|
|
807
|
+
E === !1 || t != null,
|
|
808
|
+
'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.'
|
|
809
|
+
);
|
|
810
|
+
let L = e.window != null && e.window.document != null && typeof e.window.document.startViewTransition == "function";
|
|
811
|
+
if (se(
|
|
812
|
+
b == null || L,
|
|
813
|
+
"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."
|
|
814
|
+
), !b || !L) {
|
|
815
|
+
t && E ? t(() => i(y)) : o.startTransition(() => i(y));
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
if (t && E) {
|
|
819
|
+
t(() => {
|
|
820
|
+
m && (l && l.resolve(), m.skipTransition()), c({
|
|
821
|
+
isTransitioning: !0,
|
|
822
|
+
flushSync: !0,
|
|
823
|
+
currentLocation: b.currentLocation,
|
|
824
|
+
nextLocation: b.nextLocation
|
|
825
|
+
});
|
|
826
|
+
});
|
|
827
|
+
let S = e.window.document.startViewTransition(() => {
|
|
828
|
+
t(() => i(y));
|
|
829
|
+
});
|
|
830
|
+
S.finished.finally(() => {
|
|
831
|
+
t(() => {
|
|
832
|
+
u(void 0), p(void 0), a(void 0), c({ isTransitioning: !1 });
|
|
833
|
+
});
|
|
834
|
+
}), t(() => p(S));
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
m ? (l && l.resolve(), m.skipTransition(), v({
|
|
838
|
+
state: y,
|
|
839
|
+
currentLocation: b.currentLocation,
|
|
840
|
+
nextLocation: b.nextLocation
|
|
841
|
+
})) : (a(y), c({
|
|
842
|
+
isTransitioning: !0,
|
|
843
|
+
flushSync: !1,
|
|
844
|
+
currentLocation: b.currentLocation,
|
|
845
|
+
nextLocation: b.nextLocation
|
|
846
|
+
}));
|
|
847
|
+
},
|
|
848
|
+
[e.window, t, m, l]
|
|
849
|
+
);
|
|
850
|
+
o.useLayoutEffect(() => e.subscribe(g), [e, g]), o.useEffect(() => {
|
|
851
|
+
s.isTransitioning && !s.flushSync && u(new yt());
|
|
852
|
+
}, [s]), o.useEffect(() => {
|
|
853
|
+
if (l && r && e.window) {
|
|
854
|
+
let y = r, C = l.promise, E = e.window.document.startViewTransition(async () => {
|
|
855
|
+
o.startTransition(() => i(y)), await C;
|
|
856
|
+
});
|
|
857
|
+
E.finished.finally(() => {
|
|
858
|
+
u(void 0), p(void 0), a(void 0), c({ isTransitioning: !1 });
|
|
859
|
+
}), p(E);
|
|
860
|
+
}
|
|
861
|
+
}, [r, l, e.window]), o.useEffect(() => {
|
|
862
|
+
l && r && n.location.key === r.location.key && l.resolve();
|
|
863
|
+
}, [l, m, n.location, r]), o.useEffect(() => {
|
|
864
|
+
!s.isTransitioning && f && (a(f.state), c({
|
|
865
|
+
isTransitioning: !0,
|
|
866
|
+
flushSync: !1,
|
|
867
|
+
currentLocation: f.currentLocation,
|
|
868
|
+
nextLocation: f.nextLocation
|
|
869
|
+
}), v(void 0));
|
|
870
|
+
}, [s.isTransitioning, f]);
|
|
871
|
+
let x = o.useMemo(() => ({
|
|
872
|
+
createHref: e.createHref,
|
|
873
|
+
encodeLocation: e.encodeLocation,
|
|
874
|
+
go: (y) => e.navigate(y),
|
|
875
|
+
push: (y, C, E) => e.navigate(y, {
|
|
876
|
+
state: C,
|
|
877
|
+
preventScrollReset: E == null ? void 0 : E.preventScrollReset
|
|
878
|
+
}),
|
|
879
|
+
replace: (y, C, E) => e.navigate(y, {
|
|
880
|
+
replace: !0,
|
|
881
|
+
state: C,
|
|
882
|
+
preventScrollReset: E == null ? void 0 : E.preventScrollReset
|
|
883
|
+
})
|
|
884
|
+
}), [e]), h = e.basename || "/", w = o.useMemo(
|
|
885
|
+
() => ({
|
|
886
|
+
router: e,
|
|
887
|
+
navigator: x,
|
|
888
|
+
static: !1,
|
|
889
|
+
basename: h
|
|
890
|
+
}),
|
|
891
|
+
[e, x, h]
|
|
892
|
+
);
|
|
893
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(I.Provider, { value: w }, /* @__PURE__ */ o.createElement(W.Provider, { value: n }, /* @__PURE__ */ o.createElement(ge.Provider, { value: d.current }, /* @__PURE__ */ o.createElement(Q.Provider, { value: s }, /* @__PURE__ */ o.createElement(
|
|
894
|
+
Ct,
|
|
895
|
+
{
|
|
896
|
+
basename: h,
|
|
897
|
+
location: n.location,
|
|
898
|
+
navigationType: n.historyAction,
|
|
899
|
+
navigator: x
|
|
900
|
+
},
|
|
901
|
+
/* @__PURE__ */ o.createElement(
|
|
902
|
+
xt,
|
|
903
|
+
{
|
|
904
|
+
routes: e.routes,
|
|
905
|
+
future: e.future,
|
|
906
|
+
state: n
|
|
907
|
+
}
|
|
908
|
+
)
|
|
909
|
+
))))), null);
|
|
910
|
+
}
|
|
911
|
+
var xt = o.memo(Et);
|
|
912
|
+
function Et({
|
|
913
|
+
routes: e,
|
|
914
|
+
future: t,
|
|
915
|
+
state: n
|
|
916
|
+
}) {
|
|
917
|
+
return ot(e, void 0, n, t);
|
|
918
|
+
}
|
|
919
|
+
function Ct({
|
|
920
|
+
basename: e = "/",
|
|
921
|
+
children: t = null,
|
|
922
|
+
location: n,
|
|
923
|
+
navigationType: i = "POP",
|
|
924
|
+
navigator: r,
|
|
925
|
+
static: a = !1
|
|
926
|
+
}) {
|
|
927
|
+
R(
|
|
928
|
+
!U(),
|
|
929
|
+
"You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
|
|
930
|
+
);
|
|
931
|
+
let s = e.replace(/^\/*/, "/"), c = o.useMemo(
|
|
932
|
+
() => ({
|
|
933
|
+
basename: s,
|
|
934
|
+
navigator: r,
|
|
935
|
+
static: a,
|
|
936
|
+
future: {}
|
|
937
|
+
}),
|
|
938
|
+
[s, r, a]
|
|
939
|
+
);
|
|
940
|
+
typeof n == "string" && (n = Y(n));
|
|
941
|
+
let {
|
|
942
|
+
pathname: l = "/",
|
|
943
|
+
search: u = "",
|
|
944
|
+
hash: m = "",
|
|
945
|
+
state: p = null,
|
|
946
|
+
key: f = "default"
|
|
947
|
+
} = n, v = o.useMemo(() => {
|
|
948
|
+
let d = M(l, s);
|
|
949
|
+
return d == null ? null : {
|
|
950
|
+
location: {
|
|
951
|
+
pathname: d,
|
|
952
|
+
search: u,
|
|
953
|
+
hash: m,
|
|
954
|
+
state: p,
|
|
955
|
+
key: f
|
|
956
|
+
},
|
|
957
|
+
navigationType: i
|
|
958
|
+
};
|
|
959
|
+
}, [s, l, u, m, p, f, i]);
|
|
960
|
+
return k(
|
|
961
|
+
v != null,
|
|
962
|
+
`<Router basename="${s}"> is not able to match the URL "${l}${u}${m}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
963
|
+
), v == null ? null : /* @__PURE__ */ o.createElement($.Provider, { value: c }, /* @__PURE__ */ o.createElement(J.Provider, { children: t, value: v }));
|
|
964
|
+
}
|
|
965
|
+
var V = "get", z = "application/x-www-form-urlencoded";
|
|
966
|
+
function K(e) {
|
|
967
|
+
return e != null && typeof e.tagName == "string";
|
|
968
|
+
}
|
|
969
|
+
function Rt(e) {
|
|
970
|
+
return K(e) && e.tagName.toLowerCase() === "button";
|
|
971
|
+
}
|
|
972
|
+
function bt(e) {
|
|
973
|
+
return K(e) && e.tagName.toLowerCase() === "form";
|
|
974
|
+
}
|
|
975
|
+
function St(e) {
|
|
976
|
+
return K(e) && e.tagName.toLowerCase() === "input";
|
|
977
|
+
}
|
|
978
|
+
function Pt(e) {
|
|
979
|
+
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
980
|
+
}
|
|
981
|
+
function Lt(e, t) {
|
|
982
|
+
return e.button === 0 && // Ignore everything but left clicks
|
|
983
|
+
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
984
|
+
!Pt(e);
|
|
985
|
+
}
|
|
986
|
+
var H = null;
|
|
987
|
+
function kt() {
|
|
988
|
+
if (H === null)
|
|
989
|
+
try {
|
|
990
|
+
new FormData(
|
|
991
|
+
document.createElement("form"),
|
|
992
|
+
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
993
|
+
0
|
|
994
|
+
), H = !1;
|
|
995
|
+
} catch {
|
|
996
|
+
H = !0;
|
|
997
|
+
}
|
|
998
|
+
return H;
|
|
999
|
+
}
|
|
1000
|
+
var $t = /* @__PURE__ */ new Set([
|
|
1001
|
+
"application/x-www-form-urlencoded",
|
|
1002
|
+
"multipart/form-data",
|
|
1003
|
+
"text/plain"
|
|
1004
|
+
]);
|
|
1005
|
+
function G(e) {
|
|
1006
|
+
return e != null && !$t.has(e) ? (k(
|
|
1007
|
+
!1,
|
|
1008
|
+
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${z}"`
|
|
1009
|
+
), null) : e;
|
|
1010
|
+
}
|
|
1011
|
+
function Tt(e, t) {
|
|
1012
|
+
let n, i, r, a, s;
|
|
1013
|
+
if (bt(e)) {
|
|
1014
|
+
let c = e.getAttribute("action");
|
|
1015
|
+
i = c ? M(c, t) : null, n = e.getAttribute("method") || V, r = G(e.getAttribute("enctype")) || z, a = new FormData(e);
|
|
1016
|
+
} else if (Rt(e) || St(e) && (e.type === "submit" || e.type === "image")) {
|
|
1017
|
+
let c = e.form;
|
|
1018
|
+
if (c == null)
|
|
1019
|
+
throw new Error(
|
|
1020
|
+
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1021
|
+
);
|
|
1022
|
+
let l = e.getAttribute("formaction") || c.getAttribute("action");
|
|
1023
|
+
if (i = l ? M(l, t) : null, n = e.getAttribute("formmethod") || c.getAttribute("method") || V, r = G(e.getAttribute("formenctype")) || G(c.getAttribute("enctype")) || z, a = new FormData(c, e), !kt()) {
|
|
1024
|
+
let { name: u, type: m, value: p } = e;
|
|
1025
|
+
if (m === "image") {
|
|
1026
|
+
let f = u ? `${u}.` : "";
|
|
1027
|
+
a.append(`${f}x`, "0"), a.append(`${f}y`, "0");
|
|
1028
|
+
} else u && a.append(u, p);
|
|
1029
|
+
}
|
|
1030
|
+
} else {
|
|
1031
|
+
if (K(e))
|
|
1032
|
+
throw new Error(
|
|
1033
|
+
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
1034
|
+
);
|
|
1035
|
+
n = V, i = null, r = z, s = e;
|
|
1036
|
+
}
|
|
1037
|
+
return a && r === "text/plain" && (s = a, a = void 0), { action: i, method: n.toLowerCase(), encType: r, formData: a, body: s };
|
|
1038
|
+
}
|
|
1039
|
+
function ne(e, t) {
|
|
1040
|
+
if (e === !1 || e === null || typeof e > "u")
|
|
1041
|
+
throw new Error(t);
|
|
1042
|
+
}
|
|
1043
|
+
async function Mt(e, t) {
|
|
1044
|
+
if (e.id in t)
|
|
1045
|
+
return t[e.id];
|
|
1046
|
+
try {
|
|
1047
|
+
let n = await import(
|
|
1048
|
+
/* @vite-ignore */
|
|
1049
|
+
/* webpackIgnore: true */
|
|
1050
|
+
e.module
|
|
1051
|
+
);
|
|
1052
|
+
return t[e.id] = n, n;
|
|
1053
|
+
} catch (n) {
|
|
1054
|
+
return console.error(
|
|
1055
|
+
`Error loading route module \`${e.module}\`, reloading page...`
|
|
1056
|
+
), console.error(n), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
function Dt(e) {
|
|
1061
|
+
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";
|
|
1062
|
+
}
|
|
1063
|
+
async function At(e, t, n) {
|
|
1064
|
+
let i = await Promise.all(
|
|
1065
|
+
e.map(async (r) => {
|
|
1066
|
+
let a = t.routes[r.route.id];
|
|
1067
|
+
if (a) {
|
|
1068
|
+
let s = await Mt(a, n);
|
|
1069
|
+
return s.links ? s.links() : [];
|
|
1070
|
+
}
|
|
1071
|
+
return [];
|
|
1072
|
+
})
|
|
1073
|
+
);
|
|
1074
|
+
return Ft(
|
|
1075
|
+
i.flat(1).filter(Dt).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
|
|
1076
|
+
(r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
|
|
1077
|
+
)
|
|
1078
|
+
);
|
|
1079
|
+
}
|
|
1080
|
+
function ce(e, t, n, i, r, a) {
|
|
1081
|
+
let s = (l, u) => n[u] ? l.route.id !== n[u].route.id : !0, c = (l, u) => {
|
|
1082
|
+
var m;
|
|
1083
|
+
return (
|
|
1084
|
+
// param change, /users/123 -> /users/456
|
|
1085
|
+
n[u].pathname !== l.pathname || // splat param changed, which is not present in match.path
|
|
1086
|
+
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1087
|
+
((m = n[u].route.path) == null ? void 0 : m.endsWith("*")) && n[u].params["*"] !== l.params["*"]
|
|
1088
|
+
);
|
|
1089
|
+
};
|
|
1090
|
+
return a === "assets" ? t.filter(
|
|
1091
|
+
(l, u) => s(l, u) || c(l, u)
|
|
1092
|
+
) : a === "data" ? t.filter((l, u) => {
|
|
1093
|
+
var p;
|
|
1094
|
+
let m = i.routes[l.route.id];
|
|
1095
|
+
if (!m || !m.hasLoader)
|
|
1096
|
+
return !1;
|
|
1097
|
+
if (s(l, u) || c(l, u))
|
|
1098
|
+
return !0;
|
|
1099
|
+
if (l.route.shouldRevalidate) {
|
|
1100
|
+
let f = l.route.shouldRevalidate({
|
|
1101
|
+
currentUrl: new URL(
|
|
1102
|
+
r.pathname + r.search + r.hash,
|
|
1103
|
+
window.origin
|
|
1104
|
+
),
|
|
1105
|
+
currentParams: ((p = n[0]) == null ? void 0 : p.params) || {},
|
|
1106
|
+
nextUrl: new URL(e, window.origin),
|
|
1107
|
+
nextParams: l.params,
|
|
1108
|
+
defaultShouldRevalidate: !0
|
|
1109
|
+
});
|
|
1110
|
+
if (typeof f == "boolean")
|
|
1111
|
+
return f;
|
|
1112
|
+
}
|
|
1113
|
+
return !0;
|
|
1114
|
+
}) : [];
|
|
1115
|
+
}
|
|
1116
|
+
function It(e, t, { includeHydrateFallback: n } = {}) {
|
|
1117
|
+
return Nt(
|
|
1118
|
+
e.map((i) => {
|
|
1119
|
+
let r = t.routes[i.route.id];
|
|
1120
|
+
if (!r) return [];
|
|
1121
|
+
let a = [r.module];
|
|
1122
|
+
return r.clientActionModule && (a = a.concat(r.clientActionModule)), r.clientLoaderModule && (a = a.concat(r.clientLoaderModule)), n && r.hydrateFallbackModule && (a = a.concat(r.hydrateFallbackModule)), r.imports && (a = a.concat(r.imports)), a;
|
|
1123
|
+
}).flat(1)
|
|
1124
|
+
);
|
|
1125
|
+
}
|
|
1126
|
+
function Nt(e) {
|
|
1127
|
+
return [...new Set(e)];
|
|
1128
|
+
}
|
|
1129
|
+
function Ot(e) {
|
|
1130
|
+
let t = {}, n = Object.keys(e).sort();
|
|
1131
|
+
for (let i of n)
|
|
1132
|
+
t[i] = e[i];
|
|
1133
|
+
return t;
|
|
1134
|
+
}
|
|
1135
|
+
function Ft(e, t) {
|
|
1136
|
+
let n = /* @__PURE__ */ new Set();
|
|
1137
|
+
return new Set(t), e.reduce((i, r) => {
|
|
1138
|
+
let a = JSON.stringify(Ot(r));
|
|
1139
|
+
return n.has(a) || (n.add(a), i.push({ key: a, link: r })), i;
|
|
1140
|
+
}, []);
|
|
1141
|
+
}
|
|
1142
|
+
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
1143
|
+
var Bt = /* @__PURE__ */ new Set([100, 101, 204, 205]);
|
|
1144
|
+
function Wt(e, t) {
|
|
1145
|
+
let n = typeof e == "string" ? new URL(
|
|
1146
|
+
e,
|
|
1147
|
+
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1148
|
+
// don't assume window is available
|
|
1149
|
+
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1150
|
+
) : e;
|
|
1151
|
+
return n.pathname === "/" ? n.pathname = "_root.data" : t && M(n.pathname, t) === "/" ? n.pathname = `${t.replace(/\/$/, "")}/_root.data` : n.pathname = `${n.pathname.replace(/\/$/, "")}.data`, n;
|
|
1152
|
+
}
|
|
1153
|
+
function Ee() {
|
|
1154
|
+
let e = o.useContext(I);
|
|
1155
|
+
return ne(
|
|
1156
|
+
e,
|
|
1157
|
+
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1158
|
+
), e;
|
|
1159
|
+
}
|
|
1160
|
+
function Ut() {
|
|
1161
|
+
let e = o.useContext(W);
|
|
1162
|
+
return ne(
|
|
1163
|
+
e,
|
|
1164
|
+
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1165
|
+
), e;
|
|
1166
|
+
}
|
|
1167
|
+
var re = o.createContext(void 0);
|
|
1168
|
+
re.displayName = "FrameworkContext";
|
|
1169
|
+
function Ce() {
|
|
1170
|
+
let e = o.useContext(re);
|
|
1171
|
+
return ne(
|
|
1172
|
+
e,
|
|
1173
|
+
"You must render this element inside a <HydratedRouter> element"
|
|
1174
|
+
), e;
|
|
1175
|
+
}
|
|
1176
|
+
function _t(e, t) {
|
|
1177
|
+
let n = o.useContext(re), [i, r] = o.useState(!1), [a, s] = o.useState(!1), { onFocus: c, onBlur: l, onMouseEnter: u, onMouseLeave: m, onTouchStart: p } = t, f = o.useRef(null);
|
|
1178
|
+
o.useEffect(() => {
|
|
1179
|
+
if (e === "render" && s(!0), e === "viewport") {
|
|
1180
|
+
let g = (h) => {
|
|
1181
|
+
h.forEach((w) => {
|
|
1182
|
+
s(w.isIntersecting);
|
|
1183
|
+
});
|
|
1184
|
+
}, x = new IntersectionObserver(g, { threshold: 0.5 });
|
|
1185
|
+
return f.current && x.observe(f.current), () => {
|
|
1186
|
+
x.disconnect();
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
}, [e]), o.useEffect(() => {
|
|
1190
|
+
if (i) {
|
|
1191
|
+
let g = setTimeout(() => {
|
|
1192
|
+
s(!0);
|
|
1193
|
+
}, 100);
|
|
1194
|
+
return () => {
|
|
1195
|
+
clearTimeout(g);
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
}, [i]);
|
|
1199
|
+
let v = () => {
|
|
1200
|
+
r(!0);
|
|
1201
|
+
}, d = () => {
|
|
1202
|
+
r(!1), s(!1);
|
|
1203
|
+
};
|
|
1204
|
+
return n ? e !== "intent" ? [a, f, {}] : [
|
|
1205
|
+
a,
|
|
1206
|
+
f,
|
|
1207
|
+
{
|
|
1208
|
+
onFocus: B(c, v),
|
|
1209
|
+
onBlur: B(l, d),
|
|
1210
|
+
onMouseEnter: B(u, v),
|
|
1211
|
+
onMouseLeave: B(m, d),
|
|
1212
|
+
onTouchStart: B(p, v)
|
|
1213
|
+
}
|
|
1214
|
+
] : [!1, f, {}];
|
|
1215
|
+
}
|
|
1216
|
+
function B(e, t) {
|
|
1217
|
+
return (n) => {
|
|
1218
|
+
e && e(n), n.defaultPrevented || t(n);
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
function Ht({
|
|
1222
|
+
page: e,
|
|
1223
|
+
...t
|
|
1224
|
+
}) {
|
|
1225
|
+
let { router: n } = Ee(), i = o.useMemo(
|
|
1226
|
+
() => de(n.routes, e, n.basename),
|
|
1227
|
+
[n.routes, e, n.basename]
|
|
1228
|
+
);
|
|
1229
|
+
return i ? /* @__PURE__ */ o.createElement(zt, { page: e, matches: i, ...t }) : null;
|
|
1230
|
+
}
|
|
1231
|
+
function Vt(e) {
|
|
1232
|
+
let { manifest: t, routeModules: n } = Ce(), [i, r] = o.useState([]);
|
|
1233
|
+
return o.useEffect(() => {
|
|
1234
|
+
let a = !1;
|
|
1235
|
+
return At(e, t, n).then(
|
|
1236
|
+
(s) => {
|
|
1237
|
+
a || r(s);
|
|
1238
|
+
}
|
|
1239
|
+
), () => {
|
|
1240
|
+
a = !0;
|
|
1241
|
+
};
|
|
1242
|
+
}, [e, t, n]), i;
|
|
1243
|
+
}
|
|
1244
|
+
function zt({
|
|
1245
|
+
page: e,
|
|
1246
|
+
matches: t,
|
|
1247
|
+
...n
|
|
1248
|
+
}) {
|
|
1249
|
+
let i = N(), { manifest: r, routeModules: a } = Ce(), { basename: s } = Ee(), { loaderData: c, matches: l } = Ut(), u = o.useMemo(
|
|
1250
|
+
() => ce(
|
|
1251
|
+
e,
|
|
1252
|
+
t,
|
|
1253
|
+
l,
|
|
1254
|
+
r,
|
|
1255
|
+
i,
|
|
1256
|
+
"data"
|
|
1257
|
+
),
|
|
1258
|
+
[e, t, l, r, i]
|
|
1259
|
+
), m = o.useMemo(
|
|
1260
|
+
() => ce(
|
|
1261
|
+
e,
|
|
1262
|
+
t,
|
|
1263
|
+
l,
|
|
1264
|
+
r,
|
|
1265
|
+
i,
|
|
1266
|
+
"assets"
|
|
1267
|
+
),
|
|
1268
|
+
[e, t, l, r, i]
|
|
1269
|
+
), p = o.useMemo(() => {
|
|
1270
|
+
if (e === i.pathname + i.search + i.hash)
|
|
1271
|
+
return [];
|
|
1272
|
+
let d = /* @__PURE__ */ new Set(), g = !1;
|
|
1273
|
+
if (t.forEach((h) => {
|
|
1274
|
+
var y;
|
|
1275
|
+
let w = r.routes[h.route.id];
|
|
1276
|
+
!w || !w.hasLoader || (!u.some((C) => C.route.id === h.route.id) && h.route.id in c && ((y = a[h.route.id]) != null && y.shouldRevalidate) || w.hasClientLoader ? g = !0 : d.add(h.route.id));
|
|
1277
|
+
}), d.size === 0)
|
|
1278
|
+
return [];
|
|
1279
|
+
let x = Wt(e, s);
|
|
1280
|
+
return g && d.size > 0 && x.searchParams.set(
|
|
1281
|
+
"_routes",
|
|
1282
|
+
t.filter((h) => d.has(h.route.id)).map((h) => h.route.id).join(",")
|
|
1283
|
+
), [x.pathname + x.search];
|
|
1284
|
+
}, [
|
|
1285
|
+
s,
|
|
1286
|
+
c,
|
|
1287
|
+
i,
|
|
1288
|
+
r,
|
|
1289
|
+
u,
|
|
1290
|
+
t,
|
|
1291
|
+
e,
|
|
1292
|
+
a
|
|
1293
|
+
]), f = o.useMemo(
|
|
1294
|
+
() => It(m, r),
|
|
1295
|
+
[m, r]
|
|
1296
|
+
), v = Vt(m);
|
|
1297
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, p.map((d) => /* @__PURE__ */ o.createElement("link", { key: d, rel: "prefetch", as: "fetch", href: d, ...n })), f.map((d) => /* @__PURE__ */ o.createElement("link", { key: d, rel: "modulepreload", href: d, ...n })), v.map(({ key: d, link: g }) => (
|
|
1298
|
+
// these don't spread `linkProps` because they are full link descriptors
|
|
1299
|
+
// already with their own props
|
|
1300
|
+
/* @__PURE__ */ o.createElement("link", { key: d, ...g })
|
|
1301
|
+
)));
|
|
1302
|
+
}
|
|
1303
|
+
function jt(...e) {
|
|
1304
|
+
return (t) => {
|
|
1305
|
+
e.forEach((n) => {
|
|
1306
|
+
typeof n == "function" ? n(t) : n != null && (n.current = t);
|
|
1307
|
+
});
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
var Re = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1311
|
+
try {
|
|
1312
|
+
Re && (window.__reactRouterVersion = "7.6.2");
|
|
1313
|
+
} catch {
|
|
1314
|
+
}
|
|
1315
|
+
var be = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Se = o.forwardRef(
|
|
1316
|
+
function({
|
|
1317
|
+
onClick: t,
|
|
1318
|
+
discover: n = "render",
|
|
1319
|
+
prefetch: i = "none",
|
|
1320
|
+
relative: r,
|
|
1321
|
+
reloadDocument: a,
|
|
1322
|
+
replace: s,
|
|
1323
|
+
state: c,
|
|
1324
|
+
target: l,
|
|
1325
|
+
to: u,
|
|
1326
|
+
preventScrollReset: m,
|
|
1327
|
+
viewTransition: p,
|
|
1328
|
+
...f
|
|
1329
|
+
}, v) {
|
|
1330
|
+
let { basename: d } = o.useContext($), g = typeof u == "string" && be.test(u), x, h = !1;
|
|
1331
|
+
if (typeof u == "string" && g && (x = u, Re))
|
|
1332
|
+
try {
|
|
1333
|
+
let P = new URL(window.location.href), A = u.startsWith("//") ? new URL(P.protocol + u) : new URL(u), ae = M(A.pathname, d);
|
|
1334
|
+
A.origin === P.origin && ae != null ? u = ae + A.search + A.hash : h = !0;
|
|
1335
|
+
} catch {
|
|
1336
|
+
k(
|
|
1337
|
+
!1,
|
|
1338
|
+
`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
let w = rt(u, { relative: r }), [y, C, E] = _t(
|
|
1342
|
+
i,
|
|
1343
|
+
f
|
|
1344
|
+
), b = qt(u, {
|
|
1345
|
+
replace: s,
|
|
1346
|
+
state: c,
|
|
1347
|
+
target: l,
|
|
1348
|
+
preventScrollReset: m,
|
|
1349
|
+
relative: r,
|
|
1350
|
+
viewTransition: p
|
|
1351
|
+
});
|
|
1352
|
+
function L(P) {
|
|
1353
|
+
t && t(P), P.defaultPrevented || b(P);
|
|
1354
|
+
}
|
|
1355
|
+
let S = (
|
|
1356
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1357
|
+
/* @__PURE__ */ o.createElement(
|
|
1358
|
+
"a",
|
|
1359
|
+
{
|
|
1360
|
+
...f,
|
|
1361
|
+
...E,
|
|
1362
|
+
href: x || w,
|
|
1363
|
+
onClick: h || a ? t : L,
|
|
1364
|
+
ref: jt(v, C),
|
|
1365
|
+
target: l,
|
|
1366
|
+
"data-discover": !g && n === "render" ? "true" : void 0
|
|
1367
|
+
}
|
|
1368
|
+
)
|
|
1369
|
+
);
|
|
1370
|
+
return y && !g ? /* @__PURE__ */ o.createElement(o.Fragment, null, S, /* @__PURE__ */ o.createElement(Ht, { page: w })) : S;
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
Se.displayName = "Link";
|
|
1374
|
+
var Yt = o.forwardRef(
|
|
1375
|
+
function({
|
|
1376
|
+
"aria-current": t = "page",
|
|
1377
|
+
caseSensitive: n = !1,
|
|
1378
|
+
className: i = "",
|
|
1379
|
+
end: r = !1,
|
|
1380
|
+
style: a,
|
|
1381
|
+
to: s,
|
|
1382
|
+
viewTransition: c,
|
|
1383
|
+
children: l,
|
|
1384
|
+
...u
|
|
1385
|
+
}, m) {
|
|
1386
|
+
let p = _(s, { relative: u.relative }), f = N(), v = o.useContext(W), { navigator: d, basename: g } = o.useContext($), x = v != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1387
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1388
|
+
en(p) && c === !0, h = d.encodeLocation ? d.encodeLocation(p).pathname : p.pathname, w = f.pathname, y = v && v.navigation && v.navigation.location ? v.navigation.location.pathname : null;
|
|
1389
|
+
n || (w = w.toLowerCase(), y = y ? y.toLowerCase() : null, h = h.toLowerCase()), y && g && (y = M(y, g) || y);
|
|
1390
|
+
const C = h !== "/" && h.endsWith("/") ? h.length - 1 : h.length;
|
|
1391
|
+
let E = w === h || !r && w.startsWith(h) && w.charAt(C) === "/", b = y != null && (y === h || !r && y.startsWith(h) && y.charAt(h.length) === "/"), L = {
|
|
1392
|
+
isActive: E,
|
|
1393
|
+
isPending: b,
|
|
1394
|
+
isTransitioning: x
|
|
1395
|
+
}, S = E ? t : void 0, P;
|
|
1396
|
+
typeof i == "function" ? P = i(L) : P = [
|
|
1397
|
+
i,
|
|
1398
|
+
E ? "active" : null,
|
|
1399
|
+
b ? "pending" : null,
|
|
1400
|
+
x ? "transitioning" : null
|
|
1401
|
+
].filter(Boolean).join(" ");
|
|
1402
|
+
let A = typeof a == "function" ? a(L) : a;
|
|
1403
|
+
return /* @__PURE__ */ o.createElement(
|
|
1404
|
+
Se,
|
|
1405
|
+
{
|
|
1406
|
+
...u,
|
|
1407
|
+
"aria-current": S,
|
|
1408
|
+
className: P,
|
|
1409
|
+
ref: m,
|
|
1410
|
+
style: A,
|
|
1411
|
+
to: s,
|
|
1412
|
+
viewTransition: c
|
|
1413
|
+
},
|
|
1414
|
+
typeof l == "function" ? l(L) : l
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
);
|
|
1418
|
+
Yt.displayName = "NavLink";
|
|
1419
|
+
var Jt = o.forwardRef(
|
|
1420
|
+
({
|
|
1421
|
+
discover: e = "render",
|
|
1422
|
+
fetcherKey: t,
|
|
1423
|
+
navigate: n,
|
|
1424
|
+
reloadDocument: i,
|
|
1425
|
+
replace: r,
|
|
1426
|
+
state: a,
|
|
1427
|
+
method: s = V,
|
|
1428
|
+
action: c,
|
|
1429
|
+
onSubmit: l,
|
|
1430
|
+
relative: u,
|
|
1431
|
+
preventScrollReset: m,
|
|
1432
|
+
viewTransition: p,
|
|
1433
|
+
...f
|
|
1434
|
+
}, v) => {
|
|
1435
|
+
let d = Qt(), g = Zt(c, { relative: u }), x = s.toLowerCase() === "get" ? "get" : "post", h = typeof c == "string" && be.test(c), w = (y) => {
|
|
1436
|
+
if (l && l(y), y.defaultPrevented) return;
|
|
1437
|
+
y.preventDefault();
|
|
1438
|
+
let C = y.nativeEvent.submitter, E = (C == null ? void 0 : C.getAttribute("formmethod")) || s;
|
|
1439
|
+
d(C || y.currentTarget, {
|
|
1440
|
+
fetcherKey: t,
|
|
1441
|
+
method: E,
|
|
1442
|
+
navigate: n,
|
|
1443
|
+
replace: r,
|
|
1444
|
+
state: a,
|
|
1445
|
+
relative: u,
|
|
1446
|
+
preventScrollReset: m,
|
|
1447
|
+
viewTransition: p
|
|
1448
|
+
});
|
|
1449
|
+
};
|
|
1450
|
+
return /* @__PURE__ */ o.createElement(
|
|
1451
|
+
"form",
|
|
1452
|
+
{
|
|
1453
|
+
ref: v,
|
|
1454
|
+
method: x,
|
|
1455
|
+
action: g,
|
|
1456
|
+
onSubmit: i ? l : w,
|
|
1457
|
+
...f,
|
|
1458
|
+
"data-discover": !h && e === "render" ? "true" : void 0
|
|
1459
|
+
}
|
|
1460
|
+
);
|
|
1461
|
+
}
|
|
1462
|
+
);
|
|
1463
|
+
Jt.displayName = "Form";
|
|
1464
|
+
function Kt(e) {
|
|
1465
|
+
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1466
|
+
}
|
|
1467
|
+
function Pe(e) {
|
|
1468
|
+
let t = o.useContext(I);
|
|
1469
|
+
return R(t, Kt(e)), t;
|
|
1470
|
+
}
|
|
1471
|
+
function qt(e, {
|
|
1472
|
+
target: t,
|
|
1473
|
+
replace: n,
|
|
1474
|
+
state: i,
|
|
1475
|
+
preventScrollReset: r,
|
|
1476
|
+
relative: a,
|
|
1477
|
+
viewTransition: s
|
|
1478
|
+
} = {}) {
|
|
1479
|
+
let c = at(), l = N(), u = _(e, { relative: a });
|
|
1480
|
+
return o.useCallback(
|
|
1481
|
+
(m) => {
|
|
1482
|
+
if (Lt(m, t)) {
|
|
1483
|
+
m.preventDefault();
|
|
1484
|
+
let p = n !== void 0 ? n : X(l) === X(u);
|
|
1485
|
+
c(e, {
|
|
1486
|
+
replace: p,
|
|
1487
|
+
state: i,
|
|
1488
|
+
preventScrollReset: r,
|
|
1489
|
+
relative: a,
|
|
1490
|
+
viewTransition: s
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
[
|
|
1495
|
+
l,
|
|
1496
|
+
c,
|
|
1497
|
+
u,
|
|
1498
|
+
n,
|
|
1499
|
+
i,
|
|
1500
|
+
t,
|
|
1501
|
+
e,
|
|
1502
|
+
r,
|
|
1503
|
+
a,
|
|
1504
|
+
s
|
|
1505
|
+
]
|
|
1506
|
+
);
|
|
1507
|
+
}
|
|
1508
|
+
var Gt = 0, Xt = () => `__${String(++Gt)}__`;
|
|
1509
|
+
function Qt() {
|
|
1510
|
+
let { router: e } = Pe(
|
|
1511
|
+
"useSubmit"
|
|
1512
|
+
/* UseSubmit */
|
|
1513
|
+
), { basename: t } = o.useContext($), n = pt();
|
|
1514
|
+
return o.useCallback(
|
|
1515
|
+
async (i, r = {}) => {
|
|
1516
|
+
let { action: a, method: s, encType: c, formData: l, body: u } = Tt(
|
|
1517
|
+
i,
|
|
1518
|
+
t
|
|
1519
|
+
);
|
|
1520
|
+
if (r.navigate === !1) {
|
|
1521
|
+
let m = r.fetcherKey || Xt();
|
|
1522
|
+
await e.fetch(m, n, r.action || a, {
|
|
1523
|
+
preventScrollReset: r.preventScrollReset,
|
|
1524
|
+
formData: l,
|
|
1525
|
+
body: u,
|
|
1526
|
+
formMethod: r.method || s,
|
|
1527
|
+
formEncType: r.encType || c,
|
|
1528
|
+
flushSync: r.flushSync
|
|
1529
|
+
});
|
|
1530
|
+
} else
|
|
1531
|
+
await e.navigate(r.action || a, {
|
|
1532
|
+
preventScrollReset: r.preventScrollReset,
|
|
1533
|
+
formData: l,
|
|
1534
|
+
body: u,
|
|
1535
|
+
formMethod: r.method || s,
|
|
1536
|
+
formEncType: r.encType || c,
|
|
1537
|
+
replace: r.replace,
|
|
1538
|
+
state: r.state,
|
|
1539
|
+
fromRouteId: n,
|
|
1540
|
+
flushSync: r.flushSync,
|
|
1541
|
+
viewTransition: r.viewTransition
|
|
1542
|
+
});
|
|
1543
|
+
},
|
|
1544
|
+
[e, t, n]
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
function Zt(e, { relative: t } = {}) {
|
|
1548
|
+
let { basename: n } = o.useContext($), i = o.useContext(D);
|
|
1549
|
+
R(i, "useFormAction must be used inside a RouteContext");
|
|
1550
|
+
let [r] = i.matches.slice(-1), a = { ..._(e || ".", { relative: t }) }, s = N();
|
|
1551
|
+
if (e == null) {
|
|
1552
|
+
a.search = s.search;
|
|
1553
|
+
let c = new URLSearchParams(a.search), l = c.getAll("index");
|
|
1554
|
+
if (l.some((m) => m === "")) {
|
|
1555
|
+
c.delete("index"), l.filter((p) => p).forEach((p) => c.append("index", p));
|
|
1556
|
+
let m = c.toString();
|
|
1557
|
+
a.search = m ? `?${m}` : "";
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
return (!e || e === ".") && r.route.index && (a.search = a.search ? a.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (a.pathname = a.pathname === "/" ? n : T([n, a.pathname])), X(a);
|
|
1561
|
+
}
|
|
1562
|
+
function en(e, t = {}) {
|
|
1563
|
+
let n = o.useContext(Q);
|
|
1564
|
+
R(
|
|
1565
|
+
n != null,
|
|
1566
|
+
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1567
|
+
);
|
|
1568
|
+
let { basename: i } = Pe(
|
|
1569
|
+
"useViewTransitionState"
|
|
1570
|
+
/* useViewTransitionState */
|
|
1571
|
+
), r = _(e, { relative: t.relative });
|
|
1572
|
+
if (!n.isTransitioning)
|
|
1573
|
+
return !1;
|
|
1574
|
+
let a = M(n.currentLocation.pathname, i) || n.currentLocation.pathname, s = M(n.nextLocation.pathname, i) || n.nextLocation.pathname;
|
|
1575
|
+
return j(r.pathname, s) != null || j(r.pathname, a) != null;
|
|
1576
|
+
}
|
|
1577
|
+
[
|
|
1578
|
+
...Bt
|
|
1579
|
+
];
|
|
1580
|
+
/**
|
|
1581
|
+
* react-router v7.6.2
|
|
1582
|
+
*
|
|
1583
|
+
* Copyright (c) Remix Software Inc.
|
|
1584
|
+
*
|
|
1585
|
+
* This source code is licensed under the MIT license found in the
|
|
1586
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
1587
|
+
*
|
|
1588
|
+
* @license MIT
|
|
1589
|
+
*/
|
|
1590
|
+
function tn(e) {
|
|
1591
|
+
return /* @__PURE__ */ o.createElement(wt, { flushSync: Me.flushSync, ...e });
|
|
1592
|
+
}
|
|
1593
|
+
function cn({ theme: e = $e, store: t, router: n }) {
|
|
1594
|
+
return /* @__PURE__ */ O(ke, { injectFirst: !0, children: /* @__PURE__ */ O(Le, { theme: e, children: /* @__PURE__ */ O(Ae, { store: t, children: /* @__PURE__ */ O(
|
|
1595
|
+
Te,
|
|
1596
|
+
{
|
|
1597
|
+
fallback: /* @__PURE__ */ O(
|
|
1598
|
+
De,
|
|
1599
|
+
{
|
|
1600
|
+
loading: !0,
|
|
1601
|
+
message: "..."
|
|
1602
|
+
}
|
|
1603
|
+
),
|
|
1604
|
+
children: /* @__PURE__ */ O(tn, { router: n })
|
|
1605
|
+
}
|
|
1606
|
+
) }) }) });
|
|
1607
|
+
}
|
|
1608
|
+
export {
|
|
1609
|
+
cn as default
|
|
1610
|
+
};
|