@sudobility/marketing-components 2.0.1 → 2.0.4
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/hero-banner-with-badge.d.ts.map +1 -1
- package/dist/index.esm.js +205 -205
- package/dist/index.umd.js +3 -3
- package/dist/use-case-grid.d.ts.map +1 -1
- package/package.json +24 -6
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as c from "react";
|
|
2
2
|
import fe from "react";
|
|
3
3
|
import { cn as R } from "@sudobility/components";
|
|
4
4
|
import { textVariants as Y, ui as Ze } from "@sudobility/design";
|
|
@@ -12,8 +12,8 @@ function Qe() {
|
|
|
12
12
|
var l = null;
|
|
13
13
|
if (o !== void 0 && (l = "" + o), a.key !== void 0 && (l = "" + a.key), "key" in a) {
|
|
14
14
|
o = {};
|
|
15
|
-
for (var
|
|
16
|
-
|
|
15
|
+
for (var u in a)
|
|
16
|
+
u !== "key" && (o[u] = a[u]);
|
|
17
17
|
} else o = a;
|
|
18
18
|
return a = o.ref, {
|
|
19
19
|
$$typeof: e,
|
|
@@ -117,7 +117,7 @@ function et() {
|
|
|
117
117
|
}
|
|
118
118
|
return s.key !== void 0;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function u(s, x) {
|
|
121
121
|
function C() {
|
|
122
122
|
ke || (ke = !0, console.error(
|
|
123
123
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
@@ -129,7 +129,7 @@ function et() {
|
|
|
129
129
|
configurable: !0
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function i() {
|
|
133
133
|
var s = e(this.type);
|
|
134
134
|
return Ee[s] || (Ee[s] = !0, console.error(
|
|
135
135
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
@@ -145,7 +145,7 @@ function et() {
|
|
|
145
145
|
_owner: S
|
|
146
146
|
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(s, "ref", {
|
|
147
147
|
enumerable: !1,
|
|
148
|
-
get:
|
|
148
|
+
get: i
|
|
149
149
|
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
150
150
|
configurable: !1,
|
|
151
151
|
enumerable: !1,
|
|
@@ -204,7 +204,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
204
204
|
for (var se in x)
|
|
205
205
|
se !== "key" && (C[se] = x[se]);
|
|
206
206
|
} else C = x;
|
|
207
|
-
return N &&
|
|
207
|
+
return N && u(
|
|
208
208
|
C,
|
|
209
209
|
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
210
210
|
), f(
|
|
@@ -309,7 +309,7 @@ function rt({
|
|
|
309
309
|
titleId: r,
|
|
310
310
|
...t
|
|
311
311
|
}, n) {
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ c.createElement("svg", Object.assign({
|
|
313
313
|
xmlns: "http://www.w3.org/2000/svg",
|
|
314
314
|
fill: "none",
|
|
315
315
|
viewBox: "0 0 24 24",
|
|
@@ -319,15 +319,15 @@ function rt({
|
|
|
319
319
|
"data-slot": "icon",
|
|
320
320
|
ref: n,
|
|
321
321
|
"aria-labelledby": r
|
|
322
|
-
}, t), e ? /* @__PURE__ */
|
|
322
|
+
}, t), e ? /* @__PURE__ */ c.createElement("title", {
|
|
323
323
|
id: r
|
|
324
|
-
}, e) : null, /* @__PURE__ */
|
|
324
|
+
}, e) : null, /* @__PURE__ */ c.createElement("path", {
|
|
325
325
|
strokeLinecap: "round",
|
|
326
326
|
strokeLinejoin: "round",
|
|
327
327
|
d: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
328
328
|
}));
|
|
329
329
|
}
|
|
330
|
-
const nt = /* @__PURE__ */
|
|
330
|
+
const nt = /* @__PURE__ */ c.forwardRef(rt), Pr = ({
|
|
331
331
|
title: e,
|
|
332
332
|
description: r,
|
|
333
333
|
icon: t = nt,
|
|
@@ -341,7 +341,7 @@ const nt = /* @__PURE__ */ u.forwardRef(rt), Pr = ({
|
|
|
341
341
|
warning: "bg-yellow-400 text-yellow-900",
|
|
342
342
|
info: "bg-cyan-400 text-cyan-900",
|
|
343
343
|
gradient: "bg-gradient-to-br from-blue-400 to-purple-500 text-white"
|
|
344
|
-
},
|
|
344
|
+
}, i = {
|
|
345
345
|
sm: {
|
|
346
346
|
container: "gap-2",
|
|
347
347
|
icon: "p-1.5",
|
|
@@ -364,25 +364,25 @@ const nt = /* @__PURE__ */ u.forwardRef(rt), Pr = ({
|
|
|
364
364
|
description: Y.body.md()
|
|
365
365
|
}
|
|
366
366
|
}[a];
|
|
367
|
-
return /* @__PURE__ */ h.jsxs("div", { className: R("flex items-start",
|
|
367
|
+
return /* @__PURE__ */ h.jsxs("div", { className: R("flex items-start", i.container, o), children: [
|
|
368
368
|
/* @__PURE__ */ h.jsx(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
371
|
className: R(
|
|
372
372
|
"rounded-full flex-shrink-0",
|
|
373
|
-
|
|
373
|
+
i.icon,
|
|
374
374
|
l[n]
|
|
375
375
|
),
|
|
376
|
-
children: /* @__PURE__ */ h.jsx(t, { className:
|
|
376
|
+
children: /* @__PURE__ */ h.jsx(t, { className: i.iconSize })
|
|
377
377
|
}
|
|
378
378
|
),
|
|
379
379
|
/* @__PURE__ */ h.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
380
|
-
/* @__PURE__ */ h.jsx("h4", { className:
|
|
380
|
+
/* @__PURE__ */ h.jsx("h4", { className: i.title, children: e }),
|
|
381
381
|
r && /* @__PURE__ */ h.jsx(
|
|
382
382
|
"p",
|
|
383
383
|
{
|
|
384
384
|
className: R(
|
|
385
|
-
|
|
385
|
+
i.description,
|
|
386
386
|
"mt-1 text-gray-600 dark:text-gray-300"
|
|
387
387
|
),
|
|
388
388
|
children: r
|
|
@@ -420,11 +420,11 @@ const nt = /* @__PURE__ */ u.forwardRef(rt), Pr = ({
|
|
|
420
420
|
subtitle: a,
|
|
421
421
|
description: o,
|
|
422
422
|
primaryButton: l,
|
|
423
|
-
secondaryButton:
|
|
424
|
-
className:
|
|
423
|
+
secondaryButton: u,
|
|
424
|
+
className: i,
|
|
425
425
|
children: f
|
|
426
426
|
}) => {
|
|
427
|
-
const
|
|
427
|
+
const m = "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", p = {
|
|
428
428
|
blue: "bg-blue-100 dark:bg-blue-900/30 border-blue-300 dark:border-blue-700 text-blue-800 dark:text-blue-200",
|
|
429
429
|
green: "bg-green-100 dark:bg-green-900/30 border-green-300 dark:border-green-700 text-green-800 dark:text-green-200",
|
|
430
430
|
purple: "bg-purple-100 dark:bg-purple-900/30 border-purple-300 dark:border-purple-700 text-purple-800 dark:text-purple-200",
|
|
@@ -432,13 +432,13 @@ const nt = /* @__PURE__ */ u.forwardRef(rt), Pr = ({
|
|
|
432
432
|
pink: "bg-pink-100 dark:bg-pink-900/30 border-pink-300 dark:border-pink-700 text-pink-800 dark:text-pink-200",
|
|
433
433
|
gray: "bg-gray-100 dark:bg-gray-900/30 border-gray-300 dark:border-gray-700 text-gray-800 dark:text-gray-200"
|
|
434
434
|
}[t];
|
|
435
|
-
return /* @__PURE__ */ h.jsx("section", { className: R("py-20",
|
|
435
|
+
return /* @__PURE__ */ h.jsx("section", { className: R("py-20", i), children: /* @__PURE__ */ h.jsxs("div", { className: `${m} text-center`, children: [
|
|
436
436
|
/* @__PURE__ */ h.jsxs(
|
|
437
437
|
"div",
|
|
438
438
|
{
|
|
439
439
|
className: R(
|
|
440
440
|
"inline-flex items-center border px-6 py-3 rounded-full mb-6",
|
|
441
|
-
|
|
441
|
+
p
|
|
442
442
|
),
|
|
443
443
|
children: [
|
|
444
444
|
e && /* @__PURE__ */ h.jsx("span", { className: "mr-3", children: e }),
|
|
@@ -451,7 +451,7 @@ const nt = /* @__PURE__ */ u.forwardRef(rt), Pr = ({
|
|
|
451
451
|
a && /* @__PURE__ */ h.jsx("span", { className: "text-blue-600 dark:text-blue-400 block", children: a })
|
|
452
452
|
] }),
|
|
453
453
|
/* @__PURE__ */ h.jsx("p", { className: "text-xl text-gray-600 dark:text-gray-300 mb-8 max-w-4xl mx-auto leading-relaxed", children: o }),
|
|
454
|
-
(l ||
|
|
454
|
+
(l || u) && /* @__PURE__ */ h.jsxs("div", { className: "flex flex-col sm:flex-row gap-4 justify-center mb-8", children: [
|
|
455
455
|
l && (l.href ? /* @__PURE__ */ h.jsx(
|
|
456
456
|
"a",
|
|
457
457
|
{
|
|
@@ -473,25 +473,25 @@ const nt = /* @__PURE__ */ u.forwardRef(rt), Pr = ({
|
|
|
473
473
|
children: l.text
|
|
474
474
|
}
|
|
475
475
|
)),
|
|
476
|
-
|
|
476
|
+
u && (u.href ? /* @__PURE__ */ h.jsx(
|
|
477
477
|
"a",
|
|
478
478
|
{
|
|
479
|
-
href:
|
|
479
|
+
href: u.href,
|
|
480
480
|
className: R(
|
|
481
481
|
"px-8 py-3 rounded-md border-2 border-gray-300 dark:border-gray-600 hover:border-gray-400 transition-colors inline-block",
|
|
482
|
-
|
|
482
|
+
u.className
|
|
483
483
|
),
|
|
484
|
-
children:
|
|
484
|
+
children: u.text
|
|
485
485
|
}
|
|
486
486
|
) : /* @__PURE__ */ h.jsx(
|
|
487
487
|
"button",
|
|
488
488
|
{
|
|
489
|
-
onClick:
|
|
489
|
+
onClick: u.onClick,
|
|
490
490
|
className: R(
|
|
491
491
|
"px-8 py-3 rounded-md border-2 border-gray-300 dark:border-gray-600 hover:border-gray-400 transition-colors",
|
|
492
|
-
|
|
492
|
+
u.className
|
|
493
493
|
),
|
|
494
|
-
children:
|
|
494
|
+
children: u.text
|
|
495
495
|
}
|
|
496
496
|
))
|
|
497
497
|
] }),
|
|
@@ -537,27 +537,27 @@ function at(e, r, t, n) {
|
|
|
537
537
|
return null;
|
|
538
538
|
let l = Oe(e);
|
|
539
539
|
ot(l);
|
|
540
|
-
let
|
|
541
|
-
for (let
|
|
540
|
+
let u = null;
|
|
541
|
+
for (let i = 0; u == null && i < l.length; ++i) {
|
|
542
542
|
let f = gt(o);
|
|
543
|
-
|
|
544
|
-
l[
|
|
543
|
+
u = ht(
|
|
544
|
+
l[i],
|
|
545
545
|
f,
|
|
546
546
|
n
|
|
547
547
|
);
|
|
548
548
|
}
|
|
549
|
-
return
|
|
549
|
+
return u;
|
|
550
550
|
}
|
|
551
551
|
function Oe(e, r = [], t = [], n = "", a = !1) {
|
|
552
|
-
let o = (l,
|
|
552
|
+
let o = (l, u, i = a, f) => {
|
|
553
553
|
let m = {
|
|
554
554
|
relativePath: f === void 0 ? l.path || "" : f,
|
|
555
555
|
caseSensitive: l.caseSensitive === !0,
|
|
556
|
-
childrenIndex:
|
|
556
|
+
childrenIndex: u,
|
|
557
557
|
route: l
|
|
558
558
|
};
|
|
559
559
|
if (m.relativePath.startsWith("/")) {
|
|
560
|
-
if (!m.relativePath.startsWith(n) &&
|
|
560
|
+
if (!m.relativePath.startsWith(n) && i)
|
|
561
561
|
return;
|
|
562
562
|
P(
|
|
563
563
|
m.relativePath.startsWith(n),
|
|
@@ -575,19 +575,19 @@ function Oe(e, r = [], t = [], n = "", a = !1) {
|
|
|
575
575
|
r,
|
|
576
576
|
p,
|
|
577
577
|
d,
|
|
578
|
-
|
|
578
|
+
i
|
|
579
579
|
)), !(l.path == null && !l.index) && r.push({
|
|
580
580
|
path: d,
|
|
581
581
|
score: ft(d, l.index),
|
|
582
582
|
routesMeta: p
|
|
583
583
|
});
|
|
584
584
|
};
|
|
585
|
-
return e.forEach((l,
|
|
585
|
+
return e.forEach((l, u) => {
|
|
586
586
|
if (l.path === "" || !l.path?.includes("?"))
|
|
587
|
-
o(l,
|
|
587
|
+
o(l, u);
|
|
588
588
|
else
|
|
589
|
-
for (let
|
|
590
|
-
o(l,
|
|
589
|
+
for (let i of Ue(l.path))
|
|
590
|
+
o(l, u, !0, i);
|
|
591
591
|
}), r;
|
|
592
592
|
}
|
|
593
593
|
function Ue(e) {
|
|
@@ -596,13 +596,13 @@ function Ue(e) {
|
|
|
596
596
|
let [t, ...n] = r, a = t.endsWith("?"), o = t.replace(/\?$/, "");
|
|
597
597
|
if (n.length === 0)
|
|
598
598
|
return a ? [o, ""] : [o];
|
|
599
|
-
let l = Ue(n.join("/")),
|
|
600
|
-
return
|
|
599
|
+
let l = Ue(n.join("/")), u = [];
|
|
600
|
+
return u.push(
|
|
601
601
|
...l.map(
|
|
602
|
-
(
|
|
602
|
+
(i) => i === "" ? o : [o, i].join("/")
|
|
603
603
|
)
|
|
604
|
-
), a &&
|
|
605
|
-
(
|
|
604
|
+
), a && u.push(...l), u.map(
|
|
605
|
+
(i) => e.startsWith("/") && i === "" ? "/" : i
|
|
606
606
|
);
|
|
607
607
|
}
|
|
608
608
|
function ot(e) {
|
|
@@ -636,15 +636,15 @@ function mt(e, r) {
|
|
|
636
636
|
}
|
|
637
637
|
function ht(e, r, t = !1) {
|
|
638
638
|
let { routesMeta: n } = e, a = {}, o = "/", l = [];
|
|
639
|
-
for (let
|
|
640
|
-
let
|
|
641
|
-
{ path:
|
|
639
|
+
for (let u = 0; u < n.length; ++u) {
|
|
640
|
+
let i = n[u], f = u === n.length - 1, m = o === "/" ? r : r.slice(o.length) || "/", d = te(
|
|
641
|
+
{ path: i.relativePath, caseSensitive: i.caseSensitive, end: f },
|
|
642
642
|
m
|
|
643
|
-
), p =
|
|
643
|
+
), p = i.route;
|
|
644
644
|
if (!d && f && t && !n[n.length - 1].route.index && (d = te(
|
|
645
645
|
{
|
|
646
|
-
path:
|
|
647
|
-
caseSensitive:
|
|
646
|
+
path: i.relativePath,
|
|
647
|
+
caseSensitive: i.caseSensitive,
|
|
648
648
|
end: !1
|
|
649
649
|
},
|
|
650
650
|
m
|
|
@@ -670,15 +670,15 @@ function te(e, r) {
|
|
|
670
670
|
e.end
|
|
671
671
|
), a = r.match(t);
|
|
672
672
|
if (!a) return null;
|
|
673
|
-
let o = a[0], l = o.replace(/(.)\/+$/, "$1"),
|
|
673
|
+
let o = a[0], l = o.replace(/(.)\/+$/, "$1"), u = a.slice(1);
|
|
674
674
|
return {
|
|
675
675
|
params: n.reduce(
|
|
676
676
|
(f, { paramName: m, isOptional: d }, p) => {
|
|
677
677
|
if (m === "*") {
|
|
678
|
-
let y =
|
|
678
|
+
let y = u[p] || "";
|
|
679
679
|
l = o.slice(0, o.length - y.length).replace(/(.)\/+$/, "$1");
|
|
680
680
|
}
|
|
681
|
-
const g =
|
|
681
|
+
const g = u[p];
|
|
682
682
|
return d && !g ? f[m] = void 0 : f[m] = (g || "").replace(/%2F/g, "/"), f;
|
|
683
683
|
},
|
|
684
684
|
{}
|
|
@@ -695,7 +695,7 @@ function pt(e, r = !1, t = !0) {
|
|
|
695
695
|
);
|
|
696
696
|
let n = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
697
697
|
/\/:([\w-]+)(\?)?/g,
|
|
698
|
-
(l,
|
|
698
|
+
(l, u, i) => (n.push({ paramName: u, isOptional: i != null }), i ? "/?([^\\/]+)?" : "/([^\\/]+)")
|
|
699
699
|
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
700
700
|
return e.endsWith("*") ? (n.push({ paramName: "*" }), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : t ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, r ? void 0 : "i"), n];
|
|
701
701
|
}
|
|
@@ -778,9 +778,9 @@ function Ie(e, r, t, n = !1) {
|
|
|
778
778
|
!a.search || !a.search.includes("#"),
|
|
779
779
|
ue("#", "search", "hash", a)
|
|
780
780
|
));
|
|
781
|
-
let o = e === "" || a.pathname === "", l = o ? "/" : a.pathname,
|
|
781
|
+
let o = e === "" || a.pathname === "", l = o ? "/" : a.pathname, u;
|
|
782
782
|
if (l == null)
|
|
783
|
-
|
|
783
|
+
u = t;
|
|
784
784
|
else {
|
|
785
785
|
let d = r.length - 1;
|
|
786
786
|
if (!n && l.startsWith("..")) {
|
|
@@ -789,10 +789,10 @@ function Ie(e, r, t, n = !1) {
|
|
|
789
789
|
p.shift(), d -= 1;
|
|
790
790
|
a.pathname = p.join("/");
|
|
791
791
|
}
|
|
792
|
-
|
|
792
|
+
u = d >= 0 ? r[d] : "/";
|
|
793
793
|
}
|
|
794
|
-
let
|
|
795
|
-
return !
|
|
794
|
+
let i = yt(a, u), f = l && l !== "/" && l.endsWith("/"), m = (o || l === ".") && t.endsWith("/");
|
|
795
|
+
return !i.pathname.endsWith("/") && (f || m) && (i.pathname += "/"), i;
|
|
796
796
|
}
|
|
797
797
|
var L = (e) => e.join("/").replace(/\/\/+/g, "/"), wt = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), kt = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Et = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
|
|
798
798
|
function Rt(e) {
|
|
@@ -813,36 +813,36 @@ var Ct = [
|
|
|
813
813
|
...De
|
|
814
814
|
];
|
|
815
815
|
new Set(Ct);
|
|
816
|
-
var H =
|
|
816
|
+
var H = c.createContext(null);
|
|
817
817
|
H.displayName = "DataRouter";
|
|
818
|
-
var re =
|
|
818
|
+
var re = c.createContext(null);
|
|
819
819
|
re.displayName = "DataRouterState";
|
|
820
|
-
|
|
821
|
-
var Me =
|
|
820
|
+
c.createContext(!1);
|
|
821
|
+
var Me = c.createContext({
|
|
822
822
|
isTransitioning: !1
|
|
823
823
|
});
|
|
824
824
|
Me.displayName = "ViewTransition";
|
|
825
|
-
var St =
|
|
825
|
+
var St = c.createContext(
|
|
826
826
|
/* @__PURE__ */ new Map()
|
|
827
827
|
);
|
|
828
828
|
St.displayName = "Fetchers";
|
|
829
|
-
var Nt =
|
|
829
|
+
var Nt = c.createContext(null);
|
|
830
830
|
Nt.displayName = "Await";
|
|
831
|
-
var $ =
|
|
831
|
+
var $ = c.createContext(
|
|
832
832
|
null
|
|
833
833
|
);
|
|
834
834
|
$.displayName = "Navigation";
|
|
835
|
-
var he =
|
|
835
|
+
var he = c.createContext(
|
|
836
836
|
null
|
|
837
837
|
);
|
|
838
838
|
he.displayName = "Location";
|
|
839
|
-
var A =
|
|
839
|
+
var A = c.createContext({
|
|
840
840
|
outlet: null,
|
|
841
841
|
matches: [],
|
|
842
842
|
isDataRoute: !1
|
|
843
843
|
});
|
|
844
844
|
A.displayName = "Route";
|
|
845
|
-
var pe =
|
|
845
|
+
var pe = c.createContext(null);
|
|
846
846
|
pe.displayName = "RouteError";
|
|
847
847
|
function Pt(e, { relative: r } = {}) {
|
|
848
848
|
P(
|
|
@@ -851,11 +851,11 @@ function Pt(e, { relative: r } = {}) {
|
|
|
851
851
|
// router loaded. We can help them understand how to avoid that.
|
|
852
852
|
"useHref() may be used only in the context of a <Router> component."
|
|
853
853
|
);
|
|
854
|
-
let { basename: t, navigator: n } =
|
|
855
|
-
return t !== "/" && (
|
|
854
|
+
let { basename: t, navigator: n } = c.useContext($), { hash: a, pathname: o, search: l } = G(e, { relative: r }), u = o;
|
|
855
|
+
return t !== "/" && (u = o === "/" ? t : L([t, o])), n.createHref({ pathname: u, search: l, hash: a });
|
|
856
856
|
}
|
|
857
857
|
function ne() {
|
|
858
|
-
return
|
|
858
|
+
return c.useContext(he) != null;
|
|
859
859
|
}
|
|
860
860
|
function D() {
|
|
861
861
|
return P(
|
|
@@ -863,14 +863,14 @@ function D() {
|
|
|
863
863
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
864
864
|
// router loaded. We can help them understand how to avoid that.
|
|
865
865
|
"useLocation() may be used only in the context of a <Router> component."
|
|
866
|
-
),
|
|
866
|
+
), c.useContext(he).location;
|
|
867
867
|
}
|
|
868
868
|
var We = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
869
869
|
function ze(e) {
|
|
870
|
-
|
|
870
|
+
c.useContext($).static || c.useLayoutEffect(e);
|
|
871
871
|
}
|
|
872
872
|
function jt() {
|
|
873
|
-
let { isDataRoute: e } =
|
|
873
|
+
let { isDataRoute: e } = c.useContext(A);
|
|
874
874
|
return e ? zt() : _t();
|
|
875
875
|
}
|
|
876
876
|
function _t() {
|
|
@@ -880,18 +880,18 @@ function _t() {
|
|
|
880
880
|
// router loaded. We can help them understand how to avoid that.
|
|
881
881
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
882
882
|
);
|
|
883
|
-
let e =
|
|
883
|
+
let e = c.useContext(H), { basename: r, navigator: t } = c.useContext($), { matches: n } = c.useContext(A), { pathname: a } = D(), o = JSON.stringify(Fe(n)), l = c.useRef(!1);
|
|
884
884
|
return ze(() => {
|
|
885
885
|
l.current = !0;
|
|
886
|
-
}),
|
|
887
|
-
(
|
|
886
|
+
}), c.useCallback(
|
|
887
|
+
(i, f = {}) => {
|
|
888
888
|
if (_(l.current, We), !l.current) return;
|
|
889
|
-
if (typeof
|
|
890
|
-
t.go(
|
|
889
|
+
if (typeof i == "number") {
|
|
890
|
+
t.go(i);
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
893
893
|
let m = Ie(
|
|
894
|
-
|
|
894
|
+
i,
|
|
895
895
|
JSON.parse(o),
|
|
896
896
|
a,
|
|
897
897
|
f.relative === "path"
|
|
@@ -911,10 +911,10 @@ function _t() {
|
|
|
911
911
|
]
|
|
912
912
|
);
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
c.createContext(null);
|
|
915
915
|
function G(e, { relative: r } = {}) {
|
|
916
|
-
let { matches: t } =
|
|
917
|
-
return
|
|
916
|
+
let { matches: t } = c.useContext(A), { pathname: n } = D(), a = JSON.stringify(Fe(t));
|
|
917
|
+
return c.useMemo(
|
|
918
918
|
() => Ie(
|
|
919
919
|
e,
|
|
920
920
|
JSON.parse(a),
|
|
@@ -931,7 +931,7 @@ function Tt(e, r, t, n, a) {
|
|
|
931
931
|
// router loaded. We can help them understand how to avoid that.
|
|
932
932
|
"useRoutes() may be used only in the context of a <Router> component."
|
|
933
933
|
);
|
|
934
|
-
let { navigator: o } =
|
|
934
|
+
let { navigator: o } = c.useContext($), { matches: l } = c.useContext(A), u = l[l.length - 1], i = u ? u.params : {}, f = u ? u.pathname : "/", m = u ? u.pathnameBase : "/", d = u && u.route;
|
|
935
935
|
{
|
|
936
936
|
let b = d && d.path || "";
|
|
937
937
|
Ye(
|
|
@@ -959,7 +959,7 @@ Please change the parent <Route path="${b}"> to <Route path="${b === "/" ? "*" :
|
|
|
959
959
|
), Ut(
|
|
960
960
|
w && w.map(
|
|
961
961
|
(b) => Object.assign({}, b, {
|
|
962
|
-
params: Object.assign({},
|
|
962
|
+
params: Object.assign({}, i, b.params),
|
|
963
963
|
pathname: L([
|
|
964
964
|
m,
|
|
965
965
|
// Re-encode pathnames that were decoded inside matchRoutes.
|
|
@@ -993,9 +993,9 @@ function Lt() {
|
|
|
993
993
|
return console.error(
|
|
994
994
|
"Error handled by React Router default ErrorBoundary:",
|
|
995
995
|
e
|
|
996
|
-
), l = /* @__PURE__ */
|
|
996
|
+
), l = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ c.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ c.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ c.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ c.createElement("h3", { style: { fontStyle: "italic" } }, r), t ? /* @__PURE__ */ c.createElement("pre", { style: a }, t) : null, l);
|
|
997
997
|
}
|
|
998
|
-
var $t = /* @__PURE__ */
|
|
998
|
+
var $t = /* @__PURE__ */ c.createElement(Lt, null), At = class extends c.Component {
|
|
999
999
|
constructor(e) {
|
|
1000
1000
|
super(e), this.state = {
|
|
1001
1001
|
location: e.location,
|
|
@@ -1024,7 +1024,7 @@ var $t = /* @__PURE__ */ u.createElement(Lt, null), At = class extends u.Compone
|
|
|
1024
1024
|
);
|
|
1025
1025
|
}
|
|
1026
1026
|
render() {
|
|
1027
|
-
return this.state.error !== void 0 ? /* @__PURE__ */
|
|
1027
|
+
return this.state.error !== void 0 ? /* @__PURE__ */ c.createElement(A.Provider, { value: this.props.routeContext }, /* @__PURE__ */ c.createElement(
|
|
1028
1028
|
pe.Provider,
|
|
1029
1029
|
{
|
|
1030
1030
|
value: this.state.error,
|
|
@@ -1034,8 +1034,8 @@ var $t = /* @__PURE__ */ u.createElement(Lt, null), At = class extends u.Compone
|
|
|
1034
1034
|
}
|
|
1035
1035
|
};
|
|
1036
1036
|
function Ot({ routeContext: e, match: r, children: t }) {
|
|
1037
|
-
let n =
|
|
1038
|
-
return n && n.static && n.staticContext && (r.route.errorElement || r.route.ErrorBoundary) && (n.staticContext._deepestRenderedBoundaryId = r.route.id), /* @__PURE__ */
|
|
1037
|
+
let n = c.useContext(H);
|
|
1038
|
+
return n && n.static && n.staticContext && (r.route.errorElement || r.route.ErrorBoundary) && (n.staticContext._deepestRenderedBoundaryId = r.route.id), /* @__PURE__ */ c.createElement(A.Provider, { value: e }, t);
|
|
1039
1039
|
}
|
|
1040
1040
|
function Ut(e, r = [], t = null, n = null, a = null) {
|
|
1041
1041
|
if (e == null) {
|
|
@@ -1063,14 +1063,14 @@ function Ut(e, r = [], t = null, n = null, a = null) {
|
|
|
1063
1063
|
Math.min(o.length, m + 1)
|
|
1064
1064
|
);
|
|
1065
1065
|
}
|
|
1066
|
-
let
|
|
1066
|
+
let u = !1, i = -1;
|
|
1067
1067
|
if (t)
|
|
1068
1068
|
for (let m = 0; m < o.length; m++) {
|
|
1069
1069
|
let d = o[m];
|
|
1070
|
-
if ((d.route.HydrateFallback || d.route.hydrateFallbackElement) && (
|
|
1070
|
+
if ((d.route.HydrateFallback || d.route.hydrateFallbackElement) && (i = m), d.route.id) {
|
|
1071
1071
|
let { loaderData: p, errors: g } = t, y = d.route.loader && !p.hasOwnProperty(d.route.id) && (!g || g[d.route.id] === void 0);
|
|
1072
1072
|
if (d.route.lazy || y) {
|
|
1073
|
-
|
|
1073
|
+
u = !0, i >= 0 ? o = o.slice(0, i + 1) : o = [o[0]];
|
|
1074
1074
|
break;
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
@@ -1085,14 +1085,14 @@ function Ut(e, r = [], t = null, n = null, a = null) {
|
|
|
1085
1085
|
return o.reduceRight(
|
|
1086
1086
|
(m, d, p) => {
|
|
1087
1087
|
let g, y = !1, E = null, w = null;
|
|
1088
|
-
t && (g = l && d.route.id ? l[d.route.id] : void 0, E = d.route.errorElement || $t,
|
|
1088
|
+
t && (g = l && d.route.id ? l[d.route.id] : void 0, E = d.route.errorElement || $t, u && (i < 0 && p === 0 ? (Ye(
|
|
1089
1089
|
"route-fallback",
|
|
1090
1090
|
!1,
|
|
1091
1091
|
"No `HydrateFallback` element provided to render during initial hydration"
|
|
1092
|
-
), y = !0, w = null) :
|
|
1092
|
+
), y = !0, w = null) : i === p && (y = !0, w = d.route.hydrateFallbackElement || null)));
|
|
1093
1093
|
let v = r.concat(o.slice(0, p + 1)), b = () => {
|
|
1094
1094
|
let k;
|
|
1095
|
-
return g ? k = E : y ? k = w : d.route.Component ? k = /* @__PURE__ */
|
|
1095
|
+
return g ? k = E : y ? k = w : d.route.Component ? k = /* @__PURE__ */ c.createElement(d.route.Component, null) : d.route.element ? k = d.route.element : k = m, /* @__PURE__ */ c.createElement(
|
|
1096
1096
|
Ot,
|
|
1097
1097
|
{
|
|
1098
1098
|
match: d,
|
|
@@ -1105,7 +1105,7 @@ function Ut(e, r = [], t = null, n = null, a = null) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
);
|
|
1107
1107
|
};
|
|
1108
|
-
return t && (d.route.ErrorBoundary || d.route.errorElement || p === 0) ? /* @__PURE__ */
|
|
1108
|
+
return t && (d.route.ErrorBoundary || d.route.errorElement || p === 0) ? /* @__PURE__ */ c.createElement(
|
|
1109
1109
|
At,
|
|
1110
1110
|
{
|
|
1111
1111
|
location: t.location,
|
|
@@ -1125,15 +1125,15 @@ function ge(e) {
|
|
|
1125
1125
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1126
1126
|
}
|
|
1127
1127
|
function Ft(e) {
|
|
1128
|
-
let r =
|
|
1128
|
+
let r = c.useContext(H);
|
|
1129
1129
|
return P(r, ge(e)), r;
|
|
1130
1130
|
}
|
|
1131
1131
|
function It(e) {
|
|
1132
|
-
let r =
|
|
1132
|
+
let r = c.useContext(re);
|
|
1133
1133
|
return P(r, ge(e)), r;
|
|
1134
1134
|
}
|
|
1135
1135
|
function Dt(e) {
|
|
1136
|
-
let r =
|
|
1136
|
+
let r = c.useContext(A);
|
|
1137
1137
|
return P(r, ge(e)), r;
|
|
1138
1138
|
}
|
|
1139
1139
|
function be(e) {
|
|
@@ -1150,7 +1150,7 @@ function Mt() {
|
|
|
1150
1150
|
);
|
|
1151
1151
|
}
|
|
1152
1152
|
function Wt() {
|
|
1153
|
-
let e =
|
|
1153
|
+
let e = c.useContext(pe), r = It(
|
|
1154
1154
|
"useRouteError"
|
|
1155
1155
|
/* UseRouteError */
|
|
1156
1156
|
), t = be(
|
|
@@ -1166,10 +1166,10 @@ function zt() {
|
|
|
1166
1166
|
), r = be(
|
|
1167
1167
|
"useNavigate"
|
|
1168
1168
|
/* UseNavigateStable */
|
|
1169
|
-
), t =
|
|
1169
|
+
), t = c.useRef(!1);
|
|
1170
1170
|
return ze(() => {
|
|
1171
1171
|
t.current = !0;
|
|
1172
|
-
}),
|
|
1172
|
+
}), c.useCallback(
|
|
1173
1173
|
async (a, o = {}) => {
|
|
1174
1174
|
_(t.current, We), t.current && (typeof a == "number" ? e.navigate(a) : await e.navigate(a, { fromRouteId: r, ...o }));
|
|
1175
1175
|
},
|
|
@@ -1180,7 +1180,7 @@ var Le = {};
|
|
|
1180
1180
|
function Ye(e, r, t) {
|
|
1181
1181
|
!r && !Le[e] && (Le[e] = !0, _(!1, t));
|
|
1182
1182
|
}
|
|
1183
|
-
|
|
1183
|
+
c.memo(Yt);
|
|
1184
1184
|
function Yt({
|
|
1185
1185
|
routes: e,
|
|
1186
1186
|
future: r,
|
|
@@ -1238,16 +1238,16 @@ function ce(e) {
|
|
|
1238
1238
|
function Kt(e, r) {
|
|
1239
1239
|
let t, n, a, o, l;
|
|
1240
1240
|
if (Vt(e)) {
|
|
1241
|
-
let
|
|
1242
|
-
n =
|
|
1241
|
+
let u = e.getAttribute("action");
|
|
1242
|
+
n = u ? F(u, r) : null, t = e.getAttribute("method") || Q, a = ce(e.getAttribute("enctype")) || ee, o = new FormData(e);
|
|
1243
1243
|
} else if (Ht(e) || Bt(e) && (e.type === "submit" || e.type === "image")) {
|
|
1244
|
-
let
|
|
1245
|
-
if (
|
|
1244
|
+
let u = e.form;
|
|
1245
|
+
if (u == null)
|
|
1246
1246
|
throw new Error(
|
|
1247
1247
|
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
1248
1248
|
);
|
|
1249
|
-
let
|
|
1250
|
-
if (n =
|
|
1249
|
+
let i = e.getAttribute("formaction") || u.getAttribute("action");
|
|
1250
|
+
if (n = i ? F(i, r) : null, t = e.getAttribute("formmethod") || u.getAttribute("method") || Q, a = ce(e.getAttribute("formenctype")) || ce(u.getAttribute("enctype")) || ee, o = new FormData(u, e), !qt()) {
|
|
1251
1251
|
let { name: f, type: m, value: d } = e;
|
|
1252
1252
|
if (m === "image") {
|
|
1253
1253
|
let p = f ? `${f}.` : "";
|
|
@@ -1315,29 +1315,29 @@ async function tr(e, r, t) {
|
|
|
1315
1315
|
);
|
|
1316
1316
|
}
|
|
1317
1317
|
function $e(e, r, t, n, a, o) {
|
|
1318
|
-
let l = (
|
|
1318
|
+
let l = (i, f) => t[f] ? i.route.id !== t[f].route.id : !0, u = (i, f) => (
|
|
1319
1319
|
// param change, /users/123 -> /users/456
|
|
1320
|
-
t[f].pathname !==
|
|
1320
|
+
t[f].pathname !== i.pathname || // splat param changed, which is not present in match.path
|
|
1321
1321
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1322
|
-
t[f].route.path?.endsWith("*") && t[f].params["*"] !==
|
|
1322
|
+
t[f].route.path?.endsWith("*") && t[f].params["*"] !== i.params["*"]
|
|
1323
1323
|
);
|
|
1324
1324
|
return o === "assets" ? r.filter(
|
|
1325
|
-
(
|
|
1326
|
-
) : o === "data" ? r.filter((
|
|
1327
|
-
let m = n.routes[
|
|
1325
|
+
(i, f) => l(i, f) || u(i, f)
|
|
1326
|
+
) : o === "data" ? r.filter((i, f) => {
|
|
1327
|
+
let m = n.routes[i.route.id];
|
|
1328
1328
|
if (!m || !m.hasLoader)
|
|
1329
1329
|
return !1;
|
|
1330
|
-
if (l(
|
|
1330
|
+
if (l(i, f) || u(i, f))
|
|
1331
1331
|
return !0;
|
|
1332
|
-
if (
|
|
1333
|
-
let d =
|
|
1332
|
+
if (i.route.shouldRevalidate) {
|
|
1333
|
+
let d = i.route.shouldRevalidate({
|
|
1334
1334
|
currentUrl: new URL(
|
|
1335
1335
|
a.pathname + a.search + a.hash,
|
|
1336
1336
|
window.origin
|
|
1337
1337
|
),
|
|
1338
1338
|
currentParams: t[0]?.params || {},
|
|
1339
1339
|
nextUrl: new URL(e, window.origin),
|
|
1340
|
-
nextParams:
|
|
1340
|
+
nextParams: i.params,
|
|
1341
1341
|
defaultShouldRevalidate: !0
|
|
1342
1342
|
});
|
|
1343
1343
|
if (typeof d == "boolean")
|
|
@@ -1373,31 +1373,31 @@ function or(e, r) {
|
|
|
1373
1373
|
}, []);
|
|
1374
1374
|
}
|
|
1375
1375
|
function He() {
|
|
1376
|
-
let e =
|
|
1376
|
+
let e = c.useContext(H);
|
|
1377
1377
|
return xe(
|
|
1378
1378
|
e,
|
|
1379
1379
|
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1380
1380
|
), e;
|
|
1381
1381
|
}
|
|
1382
1382
|
function lr() {
|
|
1383
|
-
let e =
|
|
1383
|
+
let e = c.useContext(re);
|
|
1384
1384
|
return xe(
|
|
1385
1385
|
e,
|
|
1386
1386
|
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1387
1387
|
), e;
|
|
1388
1388
|
}
|
|
1389
|
-
var ye =
|
|
1389
|
+
var ye = c.createContext(void 0);
|
|
1390
1390
|
ye.displayName = "FrameworkContext";
|
|
1391
1391
|
function Ve() {
|
|
1392
|
-
let e =
|
|
1392
|
+
let e = c.useContext(ye);
|
|
1393
1393
|
return xe(
|
|
1394
1394
|
e,
|
|
1395
1395
|
"You must render this element inside a <HydratedRouter> element"
|
|
1396
1396
|
), e;
|
|
1397
1397
|
}
|
|
1398
1398
|
function ir(e, r) {
|
|
1399
|
-
let t =
|
|
1400
|
-
|
|
1399
|
+
let t = c.useContext(ye), [n, a] = c.useState(!1), [o, l] = c.useState(!1), { onFocus: u, onBlur: i, onMouseEnter: f, onMouseLeave: m, onTouchStart: d } = r, p = c.useRef(null);
|
|
1400
|
+
c.useEffect(() => {
|
|
1401
1401
|
if (e === "render" && l(!0), e === "viewport") {
|
|
1402
1402
|
let E = (v) => {
|
|
1403
1403
|
v.forEach((b) => {
|
|
@@ -1408,7 +1408,7 @@ function ir(e, r) {
|
|
|
1408
1408
|
w.disconnect();
|
|
1409
1409
|
};
|
|
1410
1410
|
}
|
|
1411
|
-
}, [e]),
|
|
1411
|
+
}, [e]), c.useEffect(() => {
|
|
1412
1412
|
if (n) {
|
|
1413
1413
|
let E = setTimeout(() => {
|
|
1414
1414
|
l(!0);
|
|
@@ -1427,8 +1427,8 @@ function ir(e, r) {
|
|
|
1427
1427
|
o,
|
|
1428
1428
|
p,
|
|
1429
1429
|
{
|
|
1430
|
-
onFocus: J(
|
|
1431
|
-
onBlur: J(
|
|
1430
|
+
onFocus: J(u, g),
|
|
1431
|
+
onBlur: J(i, y),
|
|
1432
1432
|
onMouseEnter: J(f, g),
|
|
1433
1433
|
onMouseLeave: J(m, y),
|
|
1434
1434
|
onTouchStart: J(d, g)
|
|
@@ -1441,15 +1441,15 @@ function J(e, r) {
|
|
|
1441
1441
|
};
|
|
1442
1442
|
}
|
|
1443
1443
|
function sr({ page: e, ...r }) {
|
|
1444
|
-
let { router: t } = He(), n =
|
|
1444
|
+
let { router: t } = He(), n = c.useMemo(
|
|
1445
1445
|
() => Ae(t.routes, e, t.basename),
|
|
1446
1446
|
[t.routes, e, t.basename]
|
|
1447
1447
|
);
|
|
1448
|
-
return n ? /* @__PURE__ */
|
|
1448
|
+
return n ? /* @__PURE__ */ c.createElement(cr, { page: e, matches: n, ...r }) : null;
|
|
1449
1449
|
}
|
|
1450
1450
|
function ur(e) {
|
|
1451
|
-
let { manifest: r, routeModules: t } = Ve(), [n, a] =
|
|
1452
|
-
return
|
|
1451
|
+
let { manifest: r, routeModules: t } = Ve(), [n, a] = c.useState([]);
|
|
1452
|
+
return c.useEffect(() => {
|
|
1453
1453
|
let o = !1;
|
|
1454
1454
|
return tr(e, r, t).then(
|
|
1455
1455
|
(l) => {
|
|
@@ -1465,33 +1465,33 @@ function cr({
|
|
|
1465
1465
|
matches: r,
|
|
1466
1466
|
...t
|
|
1467
1467
|
}) {
|
|
1468
|
-
let n = D(), { manifest: a, routeModules: o } = Ve(), { basename: l } = He(), { loaderData:
|
|
1468
|
+
let n = D(), { manifest: a, routeModules: o } = Ve(), { basename: l } = He(), { loaderData: u, matches: i } = lr(), f = c.useMemo(
|
|
1469
1469
|
() => $e(
|
|
1470
1470
|
e,
|
|
1471
1471
|
r,
|
|
1472
|
-
|
|
1472
|
+
i,
|
|
1473
1473
|
a,
|
|
1474
1474
|
n,
|
|
1475
1475
|
"data"
|
|
1476
1476
|
),
|
|
1477
|
-
[e, r,
|
|
1478
|
-
), m =
|
|
1477
|
+
[e, r, i, a, n]
|
|
1478
|
+
), m = c.useMemo(
|
|
1479
1479
|
() => $e(
|
|
1480
1480
|
e,
|
|
1481
1481
|
r,
|
|
1482
|
-
|
|
1482
|
+
i,
|
|
1483
1483
|
a,
|
|
1484
1484
|
n,
|
|
1485
1485
|
"assets"
|
|
1486
1486
|
),
|
|
1487
|
-
[e, r,
|
|
1488
|
-
), d =
|
|
1487
|
+
[e, r, i, a, n]
|
|
1488
|
+
), d = c.useMemo(() => {
|
|
1489
1489
|
if (e === n.pathname + n.search + n.hash)
|
|
1490
1490
|
return [];
|
|
1491
1491
|
let y = /* @__PURE__ */ new Set(), E = !1;
|
|
1492
1492
|
if (r.forEach((v) => {
|
|
1493
1493
|
let b = a.routes[v.route.id];
|
|
1494
|
-
!b || !b.hasLoader || (!f.some((k) => k.route.id === v.route.id) && v.route.id in
|
|
1494
|
+
!b || !b.hasLoader || (!f.some((k) => k.route.id === v.route.id) && v.route.id in u && o[v.route.id]?.shouldRevalidate || b.hasClientLoader ? E = !0 : y.add(v.route.id));
|
|
1495
1495
|
}), y.size === 0)
|
|
1496
1496
|
return [];
|
|
1497
1497
|
let w = Zt(e, l, "data");
|
|
@@ -1501,21 +1501,21 @@ function cr({
|
|
|
1501
1501
|
), [w.pathname + w.search];
|
|
1502
1502
|
}, [
|
|
1503
1503
|
l,
|
|
1504
|
-
|
|
1504
|
+
u,
|
|
1505
1505
|
n,
|
|
1506
1506
|
a,
|
|
1507
1507
|
f,
|
|
1508
1508
|
r,
|
|
1509
1509
|
e,
|
|
1510
1510
|
o
|
|
1511
|
-
]), p =
|
|
1511
|
+
]), p = c.useMemo(
|
|
1512
1512
|
() => rr(m, a),
|
|
1513
1513
|
[m, a]
|
|
1514
1514
|
), g = ur(m);
|
|
1515
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ c.createElement(c.Fragment, null, d.map((y) => /* @__PURE__ */ c.createElement("link", { key: y, rel: "prefetch", as: "fetch", href: y, ...t })), p.map((y) => /* @__PURE__ */ c.createElement("link", { key: y, rel: "modulepreload", href: y, ...t })), g.map(({ key: y, link: E }) => (
|
|
1516
1516
|
// these don't spread `linkProps` because they are full link descriptors
|
|
1517
1517
|
// already with their own props
|
|
1518
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ c.createElement("link", { key: y, nonce: t.nonce, ...E })
|
|
1519
1519
|
)));
|
|
1520
1520
|
}
|
|
1521
1521
|
function dr(...e) {
|
|
@@ -1531,7 +1531,7 @@ try {
|
|
|
1531
1531
|
"7.9.6");
|
|
1532
1532
|
} catch {
|
|
1533
1533
|
}
|
|
1534
|
-
var Je = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ve =
|
|
1534
|
+
var Je = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ve = c.forwardRef(
|
|
1535
1535
|
function({
|
|
1536
1536
|
onClick: r,
|
|
1537
1537
|
discover: t = "render",
|
|
@@ -1539,14 +1539,14 @@ var Je = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ve = u.forwardRef(
|
|
|
1539
1539
|
relative: a,
|
|
1540
1540
|
reloadDocument: o,
|
|
1541
1541
|
replace: l,
|
|
1542
|
-
state:
|
|
1543
|
-
target:
|
|
1542
|
+
state: u,
|
|
1543
|
+
target: i,
|
|
1544
1544
|
to: f,
|
|
1545
1545
|
preventScrollReset: m,
|
|
1546
1546
|
viewTransition: d,
|
|
1547
1547
|
...p
|
|
1548
1548
|
}, g) {
|
|
1549
|
-
let { basename: y } =
|
|
1549
|
+
let { basename: y } = c.useContext($), E = typeof f == "string" && Je.test(f), w, v = !1;
|
|
1550
1550
|
if (typeof f == "string" && E && (w = f, Be))
|
|
1551
1551
|
try {
|
|
1552
1552
|
let j = new URL(window.location.href), U = f.startsWith("//") ? new URL(j.protocol + f) : new URL(f), q = F(U.pathname, y);
|
|
@@ -1562,8 +1562,8 @@ var Je = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ve = u.forwardRef(
|
|
|
1562
1562
|
p
|
|
1563
1563
|
), M = pr(f, {
|
|
1564
1564
|
replace: l,
|
|
1565
|
-
state:
|
|
1566
|
-
target:
|
|
1565
|
+
state: u,
|
|
1566
|
+
target: i,
|
|
1567
1567
|
preventScrollReset: m,
|
|
1568
1568
|
relative: a,
|
|
1569
1569
|
viewTransition: d
|
|
@@ -1573,7 +1573,7 @@ var Je = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ve = u.forwardRef(
|
|
|
1573
1573
|
}
|
|
1574
1574
|
let W = (
|
|
1575
1575
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1576
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ c.createElement(
|
|
1577
1577
|
"a",
|
|
1578
1578
|
{
|
|
1579
1579
|
...p,
|
|
@@ -1581,16 +1581,16 @@ var Je = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, ve = u.forwardRef(
|
|
|
1581
1581
|
href: w || b,
|
|
1582
1582
|
onClick: v || o ? r : I,
|
|
1583
1583
|
ref: dr(g, O),
|
|
1584
|
-
target:
|
|
1584
|
+
target: i,
|
|
1585
1585
|
"data-discover": !E && t === "render" ? "true" : void 0
|
|
1586
1586
|
}
|
|
1587
1587
|
)
|
|
1588
1588
|
);
|
|
1589
|
-
return k && !E ? /* @__PURE__ */
|
|
1589
|
+
return k && !E ? /* @__PURE__ */ c.createElement(c.Fragment, null, W, /* @__PURE__ */ c.createElement(sr, { page: b })) : W;
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
ve.displayName = "Link";
|
|
1593
|
-
var fr =
|
|
1593
|
+
var fr = c.forwardRef(
|
|
1594
1594
|
function({
|
|
1595
1595
|
"aria-current": r = "page",
|
|
1596
1596
|
caseSensitive: t = !1,
|
|
@@ -1598,13 +1598,13 @@ var fr = u.forwardRef(
|
|
|
1598
1598
|
end: a = !1,
|
|
1599
1599
|
style: o,
|
|
1600
1600
|
to: l,
|
|
1601
|
-
viewTransition:
|
|
1602
|
-
children:
|
|
1601
|
+
viewTransition: u,
|
|
1602
|
+
children: i,
|
|
1603
1603
|
...f
|
|
1604
1604
|
}, m) {
|
|
1605
|
-
let d = G(l, { relative: f.relative }), p = D(), g =
|
|
1605
|
+
let d = G(l, { relative: f.relative }), p = D(), g = c.useContext(re), { navigator: y, basename: E } = c.useContext($), w = g != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1606
1606
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1607
|
-
vr(d) &&
|
|
1607
|
+
vr(d) && u === !0, v = y.encodeLocation ? y.encodeLocation(d).pathname : d.pathname, b = p.pathname, k = g && g.navigation && g.navigation.location ? g.navigation.location.pathname : null;
|
|
1608
1608
|
t || (b = b.toLowerCase(), k = k ? k.toLowerCase() : null, v = v.toLowerCase()), k && E && (k = F(k, E) || k);
|
|
1609
1609
|
const O = v !== "/" && v.endsWith("/") ? v.length - 1 : v.length;
|
|
1610
1610
|
let T = b === v || !a && b.startsWith(v) && b.charAt(O) === "/", M = k != null && (k === v || !a && k.startsWith(v) && k.charAt(v.length) === "/"), I = {
|
|
@@ -1619,7 +1619,7 @@ var fr = u.forwardRef(
|
|
|
1619
1619
|
w ? "transitioning" : null
|
|
1620
1620
|
].filter(Boolean).join(" ");
|
|
1621
1621
|
let U = typeof o == "function" ? o(I) : o;
|
|
1622
|
-
return /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ c.createElement(
|
|
1623
1623
|
ve,
|
|
1624
1624
|
{
|
|
1625
1625
|
...f,
|
|
@@ -1628,14 +1628,14 @@ var fr = u.forwardRef(
|
|
|
1628
1628
|
ref: m,
|
|
1629
1629
|
style: U,
|
|
1630
1630
|
to: l,
|
|
1631
|
-
viewTransition:
|
|
1631
|
+
viewTransition: u
|
|
1632
1632
|
},
|
|
1633
|
-
typeof
|
|
1633
|
+
typeof i == "function" ? i(I) : i
|
|
1634
1634
|
);
|
|
1635
1635
|
}
|
|
1636
1636
|
);
|
|
1637
1637
|
fr.displayName = "NavLink";
|
|
1638
|
-
var mr =
|
|
1638
|
+
var mr = c.forwardRef(
|
|
1639
1639
|
({
|
|
1640
1640
|
discover: e = "render",
|
|
1641
1641
|
fetcherKey: r,
|
|
@@ -1644,15 +1644,15 @@ var mr = u.forwardRef(
|
|
|
1644
1644
|
replace: a,
|
|
1645
1645
|
state: o,
|
|
1646
1646
|
method: l = Q,
|
|
1647
|
-
action:
|
|
1648
|
-
onSubmit:
|
|
1647
|
+
action: u,
|
|
1648
|
+
onSubmit: i,
|
|
1649
1649
|
relative: f,
|
|
1650
1650
|
preventScrollReset: m,
|
|
1651
1651
|
viewTransition: d,
|
|
1652
1652
|
...p
|
|
1653
1653
|
}, g) => {
|
|
1654
|
-
let y = xr(), E = yr(
|
|
1655
|
-
if (
|
|
1654
|
+
let y = xr(), E = yr(u, { relative: f }), w = l.toLowerCase() === "get" ? "get" : "post", v = typeof u == "string" && Je.test(u), b = (k) => {
|
|
1655
|
+
if (i && i(k), k.defaultPrevented) return;
|
|
1656
1656
|
k.preventDefault();
|
|
1657
1657
|
let O = k.nativeEvent.submitter, T = O?.getAttribute("formmethod") || l;
|
|
1658
1658
|
y(O || k.currentTarget, {
|
|
@@ -1666,13 +1666,13 @@ var mr = u.forwardRef(
|
|
|
1666
1666
|
viewTransition: d
|
|
1667
1667
|
});
|
|
1668
1668
|
};
|
|
1669
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ c.createElement(
|
|
1670
1670
|
"form",
|
|
1671
1671
|
{
|
|
1672
1672
|
ref: g,
|
|
1673
1673
|
method: w,
|
|
1674
1674
|
action: E,
|
|
1675
|
-
onSubmit: n ?
|
|
1675
|
+
onSubmit: n ? i : b,
|
|
1676
1676
|
...p,
|
|
1677
1677
|
"data-discover": !v && e === "render" ? "true" : void 0
|
|
1678
1678
|
}
|
|
@@ -1684,7 +1684,7 @@ function hr(e) {
|
|
|
1684
1684
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1685
1685
|
}
|
|
1686
1686
|
function Ge(e) {
|
|
1687
|
-
let r =
|
|
1687
|
+
let r = c.useContext(H);
|
|
1688
1688
|
return P(r, hr(e)), r;
|
|
1689
1689
|
}
|
|
1690
1690
|
function pr(e, {
|
|
@@ -1695,13 +1695,13 @@ function pr(e, {
|
|
|
1695
1695
|
relative: o,
|
|
1696
1696
|
viewTransition: l
|
|
1697
1697
|
} = {}) {
|
|
1698
|
-
let
|
|
1699
|
-
return
|
|
1698
|
+
let u = jt(), i = D(), f = G(e, { relative: o });
|
|
1699
|
+
return c.useCallback(
|
|
1700
1700
|
(m) => {
|
|
1701
1701
|
if (Gt(m, r)) {
|
|
1702
1702
|
m.preventDefault();
|
|
1703
|
-
let d = t !== void 0 ? t : de(
|
|
1704
|
-
|
|
1703
|
+
let d = t !== void 0 ? t : de(i) === de(f);
|
|
1704
|
+
u(e, {
|
|
1705
1705
|
replace: d,
|
|
1706
1706
|
state: n,
|
|
1707
1707
|
preventScrollReset: a,
|
|
@@ -1711,8 +1711,8 @@ function pr(e, {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
},
|
|
1713
1713
|
[
|
|
1714
|
-
c,
|
|
1715
1714
|
i,
|
|
1715
|
+
u,
|
|
1716
1716
|
f,
|
|
1717
1717
|
t,
|
|
1718
1718
|
n,
|
|
@@ -1729,10 +1729,10 @@ function xr() {
|
|
|
1729
1729
|
let { router: e } = Ge(
|
|
1730
1730
|
"useSubmit"
|
|
1731
1731
|
/* UseSubmit */
|
|
1732
|
-
), { basename: r } =
|
|
1733
|
-
return
|
|
1732
|
+
), { basename: r } = c.useContext($), t = Mt();
|
|
1733
|
+
return c.useCallback(
|
|
1734
1734
|
async (n, a = {}) => {
|
|
1735
|
-
let { action: o, method: l, encType:
|
|
1735
|
+
let { action: o, method: l, encType: u, formData: i, body: f } = Kt(
|
|
1736
1736
|
n,
|
|
1737
1737
|
r
|
|
1738
1738
|
);
|
|
@@ -1740,19 +1740,19 @@ function xr() {
|
|
|
1740
1740
|
let m = a.fetcherKey || br();
|
|
1741
1741
|
await e.fetch(m, t, a.action || o, {
|
|
1742
1742
|
preventScrollReset: a.preventScrollReset,
|
|
1743
|
-
formData:
|
|
1743
|
+
formData: i,
|
|
1744
1744
|
body: f,
|
|
1745
1745
|
formMethod: a.method || l,
|
|
1746
|
-
formEncType: a.encType ||
|
|
1746
|
+
formEncType: a.encType || u,
|
|
1747
1747
|
flushSync: a.flushSync
|
|
1748
1748
|
});
|
|
1749
1749
|
} else
|
|
1750
1750
|
await e.navigate(a.action || o, {
|
|
1751
1751
|
preventScrollReset: a.preventScrollReset,
|
|
1752
|
-
formData:
|
|
1752
|
+
formData: i,
|
|
1753
1753
|
body: f,
|
|
1754
1754
|
formMethod: a.method || l,
|
|
1755
|
-
formEncType: a.encType ||
|
|
1755
|
+
formEncType: a.encType || u,
|
|
1756
1756
|
replace: a.replace,
|
|
1757
1757
|
state: a.state,
|
|
1758
1758
|
fromRouteId: t,
|
|
@@ -1764,22 +1764,22 @@ function xr() {
|
|
|
1764
1764
|
);
|
|
1765
1765
|
}
|
|
1766
1766
|
function yr(e, { relative: r } = {}) {
|
|
1767
|
-
let { basename: t } =
|
|
1767
|
+
let { basename: t } = c.useContext($), n = c.useContext(A);
|
|
1768
1768
|
P(n, "useFormAction must be used inside a RouteContext");
|
|
1769
1769
|
let [a] = n.matches.slice(-1), o = { ...G(e || ".", { relative: r }) }, l = D();
|
|
1770
1770
|
if (e == null) {
|
|
1771
1771
|
o.search = l.search;
|
|
1772
|
-
let
|
|
1773
|
-
if (
|
|
1774
|
-
|
|
1775
|
-
let m =
|
|
1772
|
+
let u = new URLSearchParams(o.search), i = u.getAll("index");
|
|
1773
|
+
if (i.some((m) => m === "")) {
|
|
1774
|
+
u.delete("index"), i.filter((d) => d).forEach((d) => u.append("index", d));
|
|
1775
|
+
let m = u.toString();
|
|
1776
1776
|
o.search = m ? `?${m}` : "";
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
1779
1779
|
return (!e || e === ".") && a.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), t !== "/" && (o.pathname = o.pathname === "/" ? t : L([t, o.pathname])), de(o);
|
|
1780
1780
|
}
|
|
1781
1781
|
function vr(e, { relative: r } = {}) {
|
|
1782
|
-
let t =
|
|
1782
|
+
let t = c.useContext(Me);
|
|
1783
1783
|
P(
|
|
1784
1784
|
t != null,
|
|
1785
1785
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
@@ -1868,9 +1868,9 @@ const wr = {
|
|
|
1868
1868
|
troubleshooting: "Troubleshooting guide"
|
|
1869
1869
|
}
|
|
1870
1870
|
};
|
|
1871
|
-
return /* @__PURE__ */ h.jsx("span", { className: R("text-sm text-gray-600 dark:text-gray-400", t), children: Object.entries(n).map(([o, l],
|
|
1871
|
+
return /* @__PURE__ */ h.jsx("span", { className: R("text-sm text-gray-600 dark:text-gray-400", t), children: Object.entries(n).map(([o, l], u) => /* @__PURE__ */ h.jsxs(fe.Fragment, { children: [
|
|
1872
1872
|
/* @__PURE__ */ h.jsx(qe, { to: l, variant: "primary", children: a[e][o] }),
|
|
1873
|
-
|
|
1873
|
+
u < Object.keys(n).length - 1 && " • "
|
|
1874
1874
|
] }, o)) });
|
|
1875
1875
|
}, Lr = ({
|
|
1876
1876
|
title: e = "Related:",
|
|
@@ -2023,36 +2023,36 @@ const wr = {
|
|
|
2023
2023
|
columns: n = 3,
|
|
2024
2024
|
className: a
|
|
2025
2025
|
}) => {
|
|
2026
|
-
const o = {
|
|
2026
|
+
const o = "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", l = {
|
|
2027
2027
|
blue: "text-blue-600 dark:text-blue-400",
|
|
2028
2028
|
green: "text-green-600 dark:text-green-400",
|
|
2029
2029
|
purple: "text-purple-600 dark:text-purple-400",
|
|
2030
2030
|
orange: "text-orange-600 dark:text-orange-400",
|
|
2031
2031
|
pink: "text-pink-600 dark:text-pink-400",
|
|
2032
2032
|
gray: "text-gray-600 dark:text-gray-400"
|
|
2033
|
-
},
|
|
2033
|
+
}, u = {
|
|
2034
2034
|
2: "grid-cols-1 md:grid-cols-2",
|
|
2035
2035
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
2036
2036
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
2037
2037
|
};
|
|
2038
|
-
return /* @__PURE__ */ h.jsx("section", { className: R(Ze.section.gradient, a), children: /* @__PURE__ */ h.jsxs("div", { className:
|
|
2038
|
+
return /* @__PURE__ */ h.jsx("section", { className: R(Ze.section.gradient, a), children: /* @__PURE__ */ h.jsxs("div", { className: o, children: [
|
|
2039
2039
|
(e || r) && /* @__PURE__ */ h.jsxs("div", { className: "text-center mb-12", children: [
|
|
2040
2040
|
e && /* @__PURE__ */ h.jsx("h2", { className: "text-3xl font-bold text-gray-900 dark:text-white mb-4", children: e }),
|
|
2041
2041
|
r && /* @__PURE__ */ h.jsx("p", { className: "text-xl text-gray-600 dark:text-gray-300 max-w-3xl mx-auto", children: r })
|
|
2042
2042
|
] }),
|
|
2043
|
-
/* @__PURE__ */ h.jsx("div", { className: R("grid gap-8",
|
|
2044
|
-
const
|
|
2043
|
+
/* @__PURE__ */ h.jsx("div", { className: R("grid gap-8", u[n]), children: t.map((i, f) => {
|
|
2044
|
+
const m = i.color ? l[i.color] : l.blue;
|
|
2045
2045
|
return /* @__PURE__ */ h.jsxs(
|
|
2046
2046
|
"div",
|
|
2047
2047
|
{
|
|
2048
2048
|
className: "bg-white dark:bg-gray-800 rounded-xl p-6 border border-gray-200 dark:border-gray-700 hover:shadow-lg transition-shadow",
|
|
2049
2049
|
children: [
|
|
2050
|
-
/* @__PURE__ */ h.jsx("div", { className: R("flex-shrink-0 mb-4",
|
|
2050
|
+
/* @__PURE__ */ h.jsx("div", { className: R("flex-shrink-0 mb-4", m), children: i.icon }),
|
|
2051
2051
|
/* @__PURE__ */ h.jsx("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-3", children: i.title }),
|
|
2052
2052
|
/* @__PURE__ */ h.jsx("p", { className: "text-gray-600 dark:text-gray-300 mb-4", children: i.description }),
|
|
2053
2053
|
i.examples && i.examples.length > 0 && /* @__PURE__ */ h.jsxs("div", { children: [
|
|
2054
2054
|
/* @__PURE__ */ h.jsx("h4", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2", children: "Examples:" }),
|
|
2055
|
-
/* @__PURE__ */ h.jsx("ul", { className: "space-y-1", children: i.examples.map((
|
|
2055
|
+
/* @__PURE__ */ h.jsx("ul", { className: "space-y-1", children: i.examples.map((d, p) => /* @__PURE__ */ h.jsxs("li", { className: "flex items-start", children: [
|
|
2056
2056
|
/* @__PURE__ */ h.jsx(
|
|
2057
2057
|
"div",
|
|
2058
2058
|
{
|
|
@@ -2062,12 +2062,12 @@ const wr = {
|
|
|
2062
2062
|
)
|
|
2063
2063
|
}
|
|
2064
2064
|
),
|
|
2065
|
-
/* @__PURE__ */ h.jsx("span", { className: "text-sm text-gray-600 dark:text-gray-400", children:
|
|
2066
|
-
] },
|
|
2065
|
+
/* @__PURE__ */ h.jsx("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: d })
|
|
2066
|
+
] }, p)) })
|
|
2067
2067
|
] })
|
|
2068
2068
|
]
|
|
2069
2069
|
},
|
|
2070
|
-
|
|
2070
|
+
f
|
|
2071
2071
|
);
|
|
2072
2072
|
}) })
|
|
2073
2073
|
] }) });
|