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