pelatform-ui 1.1.21 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/animations.css +48 -0
- package/css/shadcn/gray.css +105 -0
- package/css/shadcn/neutral.css +105 -0
- package/css/shadcn/slate.css +105 -0
- package/css/shadcn/stone.css +105 -0
- package/css/shadcn/zinc.css +105 -0
- package/css/styles/style-lyra.css +1335 -0
- package/css/styles/style-maia.css +1360 -0
- package/css/styles/style-mira.css +1362 -0
- package/css/styles/style-nova.css +1360 -0
- package/css/styles/style-vega.css +1356 -0
- package/css/theme.css +122 -182
- package/dist/animation.d.ts +3 -7
- package/dist/animation.js +40 -2
- package/dist/base.d.ts +1 -1
- package/dist/base.js +873 -2
- package/dist/chunk-4OZO7TEB.js +57803 -0
- package/dist/chunk-4VNS5WPM.js +42 -0
- package/dist/{chunk-M2YFAZ2T.js → chunk-5YSCAE7Y.js} +9 -3
- package/dist/chunk-7EOSDFS3.js +10 -0
- package/dist/chunk-B3I74Y4P.js +11228 -0
- package/dist/chunk-BQXV2NHY.js +100 -0
- package/dist/chunk-FC24ZVEO.js +553 -0
- package/dist/chunk-HW52LCWN.js +22 -0
- package/dist/chunk-WFCSII5G.js +28043 -0
- package/dist/colors-CUDWvz1g.d.ts +42 -0
- package/dist/components-B1rw2xzN.d.ts +46 -0
- package/dist/components.d.ts +23 -224
- package/dist/components.js +2378 -730
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +896 -4
- package/dist/index.d.ts +130 -2
- package/dist/index.js +637 -3
- package/dist/radix.d.ts +1 -0
- package/dist/radix.js +20737 -0
- package/package.json +20 -32
- package/css/components/apexcharts.css +0 -101
- package/css/components/book.css +0 -19
- package/css/components/extra.css +0 -12
- package/css/components/image-input.css +0 -51
- package/css/components/leaflet.css +0 -25
- package/css/components/patterns.css +0 -34
- package/css/components/rating.css +0 -89
- package/css/components/scrollable.css +0 -118
- package/css/components/theme-transition.css +0 -51
- package/dist/aria.d.ts +0 -1
- package/dist/aria.js +0 -2
- package/dist/default.d.ts +0 -1
- package/dist/default.js +0 -2
- package/dist/server.d.ts +0 -1
- package/dist/server.js +0 -2
package/dist/components.js
CHANGED
|
@@ -1,35 +1,109 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
HoverBackground,
|
|
4
|
+
motion,
|
|
5
|
+
useAnimationFrame,
|
|
6
|
+
useMotionTemplate,
|
|
7
|
+
useMotionValue,
|
|
8
|
+
useTransform
|
|
9
|
+
} from "./chunk-B3I74Y4P.js";
|
|
10
|
+
import {
|
|
11
|
+
Alert,
|
|
12
|
+
AlertDialog,
|
|
13
|
+
AlertDialogAction,
|
|
14
|
+
AlertDialogCancel,
|
|
15
|
+
AlertDialogContent,
|
|
16
|
+
AlertDialogDescription,
|
|
17
|
+
AlertDialogFooter,
|
|
18
|
+
AlertDialogHeader,
|
|
19
|
+
AlertDialogTitle,
|
|
20
|
+
AlertTitle,
|
|
21
|
+
Avatar,
|
|
22
|
+
AvatarFallback,
|
|
23
|
+
AvatarImage,
|
|
24
|
+
Badge,
|
|
25
|
+
Button,
|
|
26
|
+
Card,
|
|
27
|
+
CardContent,
|
|
28
|
+
Collapsible,
|
|
29
|
+
CollapsibleContent,
|
|
30
|
+
CollapsibleTrigger,
|
|
31
|
+
CommandDialog,
|
|
32
|
+
CommandInput,
|
|
33
|
+
CommandList,
|
|
34
|
+
Drawer,
|
|
35
|
+
DrawerContent,
|
|
36
|
+
DrawerDescription,
|
|
37
|
+
DrawerTitle,
|
|
38
|
+
DrawerTrigger,
|
|
39
|
+
DropdownMenu,
|
|
40
|
+
DropdownMenuContent,
|
|
41
|
+
DropdownMenuItem,
|
|
42
|
+
DropdownMenuRadioGroup,
|
|
43
|
+
DropdownMenuRadioItem,
|
|
44
|
+
DropdownMenuSub,
|
|
45
|
+
DropdownMenuSubContent,
|
|
46
|
+
DropdownMenuSubTrigger,
|
|
47
|
+
DropdownMenuTrigger,
|
|
48
|
+
TooltipProvider
|
|
49
|
+
} from "./chunk-WFCSII5G.js";
|
|
2
50
|
import {
|
|
3
51
|
useMetaColor
|
|
4
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-5YSCAE7Y.js";
|
|
53
|
+
import {
|
|
54
|
+
cn
|
|
55
|
+
} from "./chunk-7EOSDFS3.js";
|
|
56
|
+
import {
|
|
57
|
+
DEFAULT_THEME_MODE,
|
|
58
|
+
THEME_MODES
|
|
59
|
+
} from "./chunk-HW52LCWN.js";
|
|
60
|
+
import {
|
|
61
|
+
toast
|
|
62
|
+
} from "./chunk-4OZO7TEB.js";
|
|
63
|
+
import {
|
|
64
|
+
ArrowUpRight,
|
|
65
|
+
Check,
|
|
66
|
+
ChevronDown,
|
|
67
|
+
ChevronLeft,
|
|
68
|
+
CircleAlert,
|
|
69
|
+
CircleCheck,
|
|
70
|
+
CircleX,
|
|
71
|
+
Download,
|
|
72
|
+
Globe,
|
|
73
|
+
Info,
|
|
74
|
+
Languages,
|
|
75
|
+
Loader,
|
|
76
|
+
Menu,
|
|
77
|
+
Monitor,
|
|
78
|
+
Moon,
|
|
79
|
+
Plus,
|
|
80
|
+
Search,
|
|
81
|
+
Sun,
|
|
82
|
+
TriangleAlert
|
|
83
|
+
} from "./chunk-FC24ZVEO.js";
|
|
84
|
+
import {
|
|
85
|
+
J,
|
|
86
|
+
z
|
|
87
|
+
} from "./chunk-BQXV2NHY.js";
|
|
88
|
+
import "./chunk-4VNS5WPM.js";
|
|
5
89
|
|
|
6
90
|
// src/components/feedback/alert.tsx
|
|
7
|
-
import {
|
|
8
|
-
CheckIcon,
|
|
9
|
-
CircleAlertIcon,
|
|
10
|
-
CircleCheckIcon,
|
|
11
|
-
CircleXIcon,
|
|
12
|
-
InfoIcon,
|
|
13
|
-
TriangleAlertIcon
|
|
14
|
-
} from "lucide-react";
|
|
15
|
-
import { toast } from "sonner";
|
|
16
|
-
import { Alert, AlertIcon, AlertTitle } from "@pelatform/ui.default";
|
|
17
91
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
92
|
var iconMap = {
|
|
19
|
-
primary: /* @__PURE__ */ jsx(
|
|
20
|
-
success: /* @__PURE__ */ jsx(
|
|
21
|
-
info: /* @__PURE__ */ jsx(
|
|
22
|
-
warning: /* @__PURE__ */ jsx(
|
|
23
|
-
destructive: /* @__PURE__ */ jsx(
|
|
93
|
+
primary: /* @__PURE__ */ jsx(CircleAlert, {}),
|
|
94
|
+
success: /* @__PURE__ */ jsx(CircleCheck, {}),
|
|
95
|
+
info: /* @__PURE__ */ jsx(Info, {}),
|
|
96
|
+
warning: /* @__PURE__ */ jsx(TriangleAlert, {}),
|
|
97
|
+
destructive: /* @__PURE__ */ jsx(CircleX, {})
|
|
24
98
|
};
|
|
25
99
|
function AlertToast({
|
|
26
100
|
message = "This is a toast",
|
|
27
101
|
icon = "success",
|
|
28
|
-
variant = "
|
|
102
|
+
variant = "default"
|
|
29
103
|
}) {
|
|
30
104
|
toast.custom(
|
|
31
|
-
() => /* @__PURE__ */ jsxs(Alert, { variant,
|
|
32
|
-
|
|
105
|
+
() => /* @__PURE__ */ jsxs(Alert, { variant, children: [
|
|
106
|
+
iconMap[icon ?? "success"],
|
|
33
107
|
/* @__PURE__ */ jsx(AlertTitle, { children: message })
|
|
34
108
|
] }),
|
|
35
109
|
{
|
|
@@ -45,30 +119,29 @@ function AlertNotification({ message, variant = "info" }) {
|
|
|
45
119
|
const getIcon = () => {
|
|
46
120
|
switch (variant) {
|
|
47
121
|
case "destructive":
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
+
return /* @__PURE__ */ jsx(CircleAlert, {});
|
|
49
123
|
case "success":
|
|
50
|
-
return /* @__PURE__ */ jsx(
|
|
124
|
+
return /* @__PURE__ */ jsx(Check, {});
|
|
51
125
|
case "info":
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
126
|
+
return /* @__PURE__ */ jsx(Info, {});
|
|
53
127
|
case "warning":
|
|
54
|
-
return /* @__PURE__ */ jsx(
|
|
128
|
+
return /* @__PURE__ */ jsx(TriangleAlert, {});
|
|
55
129
|
default:
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
130
|
+
return /* @__PURE__ */ jsx(Info, {});
|
|
57
131
|
}
|
|
58
132
|
};
|
|
59
133
|
return /* @__PURE__ */ jsxs(Alert, { variant, children: [
|
|
60
|
-
|
|
134
|
+
getIcon(),
|
|
61
135
|
/* @__PURE__ */ jsx(AlertTitle, { children: message })
|
|
62
136
|
] });
|
|
63
137
|
}
|
|
64
138
|
var AlertComingsoon = ({
|
|
65
139
|
message = "This feature is coming soon.",
|
|
66
|
-
|
|
67
|
-
variant = "mono"
|
|
140
|
+
variant = "default"
|
|
68
141
|
} = {}) => {
|
|
69
142
|
toast.custom(
|
|
70
|
-
() => /* @__PURE__ */ jsxs(Alert, { variant,
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
143
|
+
() => /* @__PURE__ */ jsxs(Alert, { variant, children: [
|
|
144
|
+
/* @__PURE__ */ jsx(CircleAlert, {}),
|
|
72
145
|
/* @__PURE__ */ jsx(AlertTitle, { children: message })
|
|
73
146
|
] }),
|
|
74
147
|
{
|
|
@@ -83,16 +156,6 @@ var AlertComingsoon = ({
|
|
|
83
156
|
};
|
|
84
157
|
|
|
85
158
|
// src/components/feedback/dialog.tsx
|
|
86
|
-
import {
|
|
87
|
-
AlertDialog,
|
|
88
|
-
AlertDialogAction,
|
|
89
|
-
AlertDialogCancel,
|
|
90
|
-
AlertDialogContent,
|
|
91
|
-
AlertDialogDescription,
|
|
92
|
-
AlertDialogFooter,
|
|
93
|
-
AlertDialogHeader,
|
|
94
|
-
AlertDialogTitle
|
|
95
|
-
} from "@pelatform/ui.default";
|
|
96
159
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
97
160
|
var ConfirmDismissDialog = ({
|
|
98
161
|
open,
|
|
@@ -125,19 +188,17 @@ var ConfirmDismissDialog = ({
|
|
|
125
188
|
};
|
|
126
189
|
|
|
127
190
|
// src/components/feedback/screen-loader.tsx
|
|
128
|
-
import { LoaderIcon } from "lucide-react";
|
|
129
|
-
import { cn } from "@pelatform/utils";
|
|
130
191
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
131
192
|
function ScreenLoader({
|
|
132
193
|
loadingText = "Loading...",
|
|
133
194
|
className = "",
|
|
134
|
-
spinnerClassName = "size-6
|
|
195
|
+
spinnerClassName = "size-6",
|
|
135
196
|
textClassName = "text-muted-foreground font-medium text-sm",
|
|
136
197
|
contentLoader = false
|
|
137
198
|
} = {}) {
|
|
138
199
|
if (contentLoader) {
|
|
139
200
|
return /* @__PURE__ */ jsx3("div", { className: cn("flex w-full grow items-center justify-center", className), children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2.5", children: [
|
|
140
|
-
/* @__PURE__ */ jsx3(
|
|
201
|
+
/* @__PURE__ */ jsx3(Loader, { className: cn("animate-spin", spinnerClassName) }),
|
|
141
202
|
/* @__PURE__ */ jsx3("span", { className: textClassName, children: loadingText })
|
|
142
203
|
] }) });
|
|
143
204
|
}
|
|
@@ -152,7 +213,7 @@ function ScreenLoader({
|
|
|
152
213
|
"aria-live": "polite",
|
|
153
214
|
"aria-label": loadingText,
|
|
154
215
|
children: [
|
|
155
|
-
/* @__PURE__ */ jsx3(
|
|
216
|
+
/* @__PURE__ */ jsx3(Loader, { className: cn("animate-spin", spinnerClassName) }),
|
|
156
217
|
/* @__PURE__ */ jsx3("div", { className: textClassName, children: loadingText })
|
|
157
218
|
]
|
|
158
219
|
}
|
|
@@ -160,8 +221,6 @@ function ScreenLoader({
|
|
|
160
221
|
}
|
|
161
222
|
|
|
162
223
|
// src/components/layout/auth.tsx
|
|
163
|
-
import { Card, CardContent } from "@pelatform/ui.default";
|
|
164
|
-
import { cn as cn2 } from "@pelatform/utils";
|
|
165
224
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
166
225
|
function LayoutAuth({
|
|
167
226
|
children,
|
|
@@ -171,7 +230,7 @@ function LayoutAuth({
|
|
|
171
230
|
return /* @__PURE__ */ jsxs4(
|
|
172
231
|
"div",
|
|
173
232
|
{
|
|
174
|
-
className:
|
|
233
|
+
className: cn("flex min-h-screen grow flex-col items-center justify-center p-4", className),
|
|
175
234
|
children: [
|
|
176
235
|
logo && /* @__PURE__ */ jsx4("div", { className: "m-5", children: logo }),
|
|
177
236
|
/* @__PURE__ */ jsx4(Card, { className: "w-full max-w-md", children: /* @__PURE__ */ jsx4(CardContent, { className: "p-6", children }) })
|
|
@@ -180,12 +239,8 @@ function LayoutAuth({
|
|
|
180
239
|
);
|
|
181
240
|
}
|
|
182
241
|
|
|
183
|
-
// src/components/layout/blank.tsx
|
|
184
|
-
import { cn as cn4 } from "@pelatform/utils";
|
|
185
|
-
|
|
186
242
|
// src/components/layout/grid.tsx
|
|
187
243
|
import { useId } from "react";
|
|
188
|
-
import { cn as cn3 } from "@pelatform/utils";
|
|
189
244
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
190
245
|
function Grid({
|
|
191
246
|
cellSize = 12,
|
|
@@ -197,7 +252,7 @@ function Grid({
|
|
|
197
252
|
return /* @__PURE__ */ jsxs5(
|
|
198
253
|
"svg",
|
|
199
254
|
{
|
|
200
|
-
className:
|
|
255
|
+
className: cn("pointer-events-none absolute inset-0 text-foreground/10", className),
|
|
201
256
|
width: "100%",
|
|
202
257
|
height: "100%",
|
|
203
258
|
children: [
|
|
@@ -234,7 +289,7 @@ function LayoutBlank({ children, footer, className, logo }) {
|
|
|
234
289
|
/* @__PURE__ */ jsx6("div", { className: "absolute inset-0 isolate overflow-hidden bg-background", children: /* @__PURE__ */ jsx6(
|
|
235
290
|
"div",
|
|
236
291
|
{
|
|
237
|
-
className:
|
|
292
|
+
className: cn(
|
|
238
293
|
"absolute inset-y-0 start-1/2 w-[1200px] -translate-x-1/2",
|
|
239
294
|
"mask-intersect mask-[linear-gradient(black,transparent_320px),linear-gradient(90deg,transparent,black_5%,black_95%,transparent)]"
|
|
240
295
|
),
|
|
@@ -244,7 +299,7 @@ function LayoutBlank({ children, footer, className, logo }) {
|
|
|
244
299
|
/* @__PURE__ */ jsxs6(
|
|
245
300
|
"div",
|
|
246
301
|
{
|
|
247
|
-
className:
|
|
302
|
+
className: cn(
|
|
248
303
|
"relative flex min-h-screen w-full flex-col items-center justify-between",
|
|
249
304
|
className
|
|
250
305
|
),
|
|
@@ -259,22 +314,19 @@ function LayoutBlank({ children, footer, className, logo }) {
|
|
|
259
314
|
}
|
|
260
315
|
|
|
261
316
|
// src/components/layout/body.tsx
|
|
262
|
-
import { cn as cn5 } from "@pelatform/utils";
|
|
263
317
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
264
318
|
function useMode(slug) {
|
|
265
319
|
return Array.isArray(slug) && slug.length > 0 ? slug[0] : void 0;
|
|
266
320
|
}
|
|
267
321
|
function Body({ slug, children, className }) {
|
|
268
322
|
const mode = useMode(slug);
|
|
269
|
-
return /* @__PURE__ */ jsx7("body", { className:
|
|
323
|
+
return /* @__PURE__ */ jsx7("body", { className: cn(mode, className), children });
|
|
270
324
|
}
|
|
271
325
|
|
|
272
326
|
// src/components/layout/comingsoon.tsx
|
|
273
|
-
import { HoverBackground } from "@pelatform/ui.animation";
|
|
274
|
-
import { cn as cn6 } from "@pelatform/utils";
|
|
275
327
|
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
276
328
|
function ComingSoon({ className, title, description }) {
|
|
277
|
-
return /* @__PURE__ */ jsx8("div", { className:
|
|
329
|
+
return /* @__PURE__ */ jsx8("div", { className: cn("h-[calc(100vh-54px)] w-full overflow-hidden", className), children: /* @__PURE__ */ jsx8(
|
|
278
330
|
HoverBackground,
|
|
279
331
|
{
|
|
280
332
|
colors: {
|
|
@@ -299,18 +351,17 @@ function ComingSoon({ className, title, description }) {
|
|
|
299
351
|
}
|
|
300
352
|
|
|
301
353
|
// src/components/layout/error.tsx
|
|
302
|
-
import { Badge } from "@pelatform/ui.default";
|
|
303
|
-
import { assetsUrl, cn as cn7 } from "@pelatform/utils";
|
|
304
354
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
305
355
|
function ErrorComponents({
|
|
306
356
|
className,
|
|
307
357
|
type = "default",
|
|
308
358
|
textTitle,
|
|
309
359
|
textSubtitle,
|
|
310
|
-
button
|
|
360
|
+
button,
|
|
361
|
+
assetsUrl = (path) => path
|
|
311
362
|
}) {
|
|
312
363
|
if (type === "404") {
|
|
313
|
-
return /* @__PURE__ */ jsxs8("div", { className:
|
|
364
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("flex h-[95%] grow flex-col items-center justify-center", className), children: [
|
|
314
365
|
/* @__PURE__ */ jsxs8("div", { className: "mb-10", children: [
|
|
315
366
|
/* @__PURE__ */ jsx9(
|
|
316
367
|
"img",
|
|
@@ -329,13 +380,13 @@ function ErrorComponents({
|
|
|
329
380
|
}
|
|
330
381
|
)
|
|
331
382
|
] }),
|
|
332
|
-
/* @__PURE__ */ jsx9(Badge, { variant: "destructive",
|
|
383
|
+
/* @__PURE__ */ jsx9(Badge, { variant: "destructive", className: "mb-3", children: "404 Error" }),
|
|
333
384
|
/* @__PURE__ */ jsx9("h3", { className: "mb-2 text-center font-semibold text-2xl text-foreground", children: textTitle }),
|
|
334
385
|
/* @__PURE__ */ jsx9("div", { className: "mb-10 text-center text-base text-secondary-foreground", children: textSubtitle })
|
|
335
386
|
] });
|
|
336
387
|
}
|
|
337
388
|
if (type === "500") {
|
|
338
|
-
return /* @__PURE__ */ jsxs8("div", { className:
|
|
389
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("flex h-[95%] grow flex-col items-center justify-center", className), children: [
|
|
339
390
|
/* @__PURE__ */ jsxs8("div", { className: "mb-10", children: [
|
|
340
391
|
/* @__PURE__ */ jsx9(
|
|
341
392
|
"img",
|
|
@@ -354,13 +405,13 @@ function ErrorComponents({
|
|
|
354
405
|
}
|
|
355
406
|
)
|
|
356
407
|
] }),
|
|
357
|
-
/* @__PURE__ */ jsx9(Badge, { variant: "destructive",
|
|
408
|
+
/* @__PURE__ */ jsx9(Badge, { variant: "destructive", className: "mb-3", children: "500 Error" }),
|
|
358
409
|
/* @__PURE__ */ jsx9("h3", { className: "mb-2 text-center font-semibold text-2xl text-foreground", children: textTitle }),
|
|
359
410
|
/* @__PURE__ */ jsx9("div", { className: "mb-10 text-center text-base text-secondary-foreground", children: textSubtitle }),
|
|
360
411
|
button
|
|
361
412
|
] });
|
|
362
413
|
}
|
|
363
|
-
return /* @__PURE__ */ jsxs8("div", { className:
|
|
414
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("flex h-[95%] grow flex-col items-center justify-center", className), children: [
|
|
364
415
|
/* @__PURE__ */ jsxs8("div", { className: "mb-10", children: [
|
|
365
416
|
/* @__PURE__ */ jsx9(
|
|
366
417
|
"img",
|
|
@@ -384,12 +435,7 @@ function ErrorComponents({
|
|
|
384
435
|
] });
|
|
385
436
|
}
|
|
386
437
|
|
|
387
|
-
// src/components/layout/section.tsx
|
|
388
|
-
import { PlusIcon } from "lucide-react";
|
|
389
|
-
import { cn as cn9 } from "@pelatform/utils";
|
|
390
|
-
|
|
391
438
|
// src/components/ui/grid-background.tsx
|
|
392
|
-
import { cn as cn8 } from "@pelatform/utils";
|
|
393
439
|
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
394
440
|
var GridBackground = ({
|
|
395
441
|
columns = 4,
|
|
@@ -408,53 +454,58 @@ var GridBackground = ({
|
|
|
408
454
|
},
|
|
409
455
|
i
|
|
410
456
|
));
|
|
411
|
-
return /* @__PURE__ */ jsx10("div", { className:
|
|
457
|
+
return /* @__PURE__ */ jsx10("div", { className: cn("stripe-grid absolute inset-0 -z-50 h-full w-full", className), children: /* @__PURE__ */ jsx10("div", { className: "relative h-full w-full overflow-hidden", children: /* @__PURE__ */ jsx10(
|
|
412
458
|
"div",
|
|
413
459
|
{
|
|
414
|
-
className:
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
460
|
+
className: "pointer-events-none absolute start-0 top-0 h-full w-full",
|
|
461
|
+
"aria-hidden": "true",
|
|
462
|
+
children: /* @__PURE__ */ jsxs9(
|
|
463
|
+
"div",
|
|
464
|
+
{
|
|
465
|
+
className: cn("relative mx-auto grid h-full grid-cols-4 grid-rows-1", maxWidthClass),
|
|
466
|
+
children: [
|
|
467
|
+
columnElements,
|
|
468
|
+
/* @__PURE__ */ jsx10(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
className: "absolute end-0 top-0 h-full w-px",
|
|
472
|
+
style: { backgroundColor: "var(--grid-base-color)" }
|
|
473
|
+
}
|
|
474
|
+
)
|
|
475
|
+
]
|
|
476
|
+
}
|
|
477
|
+
)
|
|
425
478
|
}
|
|
426
|
-
) }) })
|
|
479
|
+
) }) });
|
|
427
480
|
};
|
|
428
481
|
|
|
429
482
|
// src/components/layout/section.tsx
|
|
430
483
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
431
484
|
var Cross = () => /* @__PURE__ */ jsxs10("div", { className: "relative h-6 w-6", children: [
|
|
432
|
-
/* @__PURE__ */ jsx11("div", { className: "absolute
|
|
485
|
+
/* @__PURE__ */ jsx11("div", { className: "absolute start-3 h-6 w-px bg-background" }),
|
|
433
486
|
/* @__PURE__ */ jsx11("div", { className: "absolute top-3 h-px w-6 bg-background" }),
|
|
434
|
-
/* @__PURE__ */ jsx11("div", { className: "absolute
|
|
487
|
+
/* @__PURE__ */ jsx11("div", { className: "absolute start-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx11(Plus, { size: 20, className: "text-border/70 dark:text-border" }) })
|
|
435
488
|
] });
|
|
436
489
|
var Section = ({ children, sectionClassName, className, ...props }) => /* @__PURE__ */ jsx11("section", { className: sectionClassName, ...props, children: /* @__PURE__ */ jsxs10("div", { className: "grid-container relative mx-auto", children: [
|
|
437
490
|
/* @__PURE__ */ jsx11(GridBackground, { maxWidthClass: "grid-container" }),
|
|
438
|
-
/* @__PURE__ */ jsx11("div", { className:
|
|
439
|
-
/* @__PURE__ */ jsx11("div", { className: "absolute -
|
|
440
|
-
/* @__PURE__ */ jsx11("div", { className: "absolute -
|
|
491
|
+
/* @__PURE__ */ jsx11("div", { className: cn(className), children }),
|
|
492
|
+
/* @__PURE__ */ jsx11("div", { className: "absolute -start-3 -bottom-3 z-10 hidden h-6 sm:block", children: /* @__PURE__ */ jsx11(Cross, {}) }),
|
|
493
|
+
/* @__PURE__ */ jsx11("div", { className: "absolute -end-3 -bottom-3 z-10 hidden h-6 -translate-x-px sm:block", children: /* @__PURE__ */ jsx11(Cross, {}) })
|
|
441
494
|
] }) });
|
|
442
495
|
|
|
443
496
|
// src/components/layout/site-footer.tsx
|
|
444
|
-
import { cn as cn10 } from "@pelatform/utils";
|
|
445
497
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
446
498
|
function SiteFooter({ children, className }) {
|
|
447
|
-
return /* @__PURE__ */ jsx12("footer", { className:
|
|
499
|
+
return /* @__PURE__ */ jsx12("footer", { className: cn("border-border border-t py-5 md:py-0", className), children: /* @__PURE__ */ jsx12("div", { className: "container flex flex-col items-center justify-between gap-4 py-4 md:h-16 md:flex-row", children }) });
|
|
448
500
|
}
|
|
449
501
|
|
|
450
502
|
// src/components/layout/site-header.tsx
|
|
451
|
-
import { cn as cn11 } from "@pelatform/utils";
|
|
452
503
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
453
504
|
function SiteHeader({ className, children }) {
|
|
454
505
|
return /* @__PURE__ */ jsx13(
|
|
455
506
|
"header",
|
|
456
507
|
{
|
|
457
|
-
className:
|
|
508
|
+
className: cn(
|
|
458
509
|
"sticky top-0 z-50 w-full border-border border-b bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60",
|
|
459
510
|
className
|
|
460
511
|
),
|
|
@@ -464,10 +515,9 @@ function SiteHeader({ className, children }) {
|
|
|
464
515
|
}
|
|
465
516
|
|
|
466
517
|
// src/components/layout/wrapper.tsx
|
|
467
|
-
import { cn as cn12 } from "@pelatform/utils";
|
|
468
518
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
469
519
|
function MaxWidthWrapper({ className, children }) {
|
|
470
|
-
return /* @__PURE__ */ jsx14("div", { className:
|
|
520
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("mx-auto w-full max-w-7xl p-3 lg:px-10", className), children });
|
|
471
521
|
}
|
|
472
522
|
|
|
473
523
|
// src/components/mdx/code-display.tsx
|
|
@@ -483,20 +533,14 @@ function CodeDisplay({
|
|
|
483
533
|
}
|
|
484
534
|
|
|
485
535
|
// src/components/mdx/download.tsx
|
|
486
|
-
import { DownloadIcon } from "lucide-react";
|
|
487
|
-
import { Button } from "@pelatform/ui.default";
|
|
488
|
-
import { cn as cn13 } from "@pelatform/utils";
|
|
489
536
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
490
537
|
function DownloadFile({ children, className, href }) {
|
|
491
|
-
return /* @__PURE__ */ jsx16("div", { className: "inline-flex pb-4", children: /* @__PURE__ */ jsx16(Button, { size: "lg", className:
|
|
492
|
-
/* @__PURE__ */ jsx16(
|
|
538
|
+
return /* @__PURE__ */ jsx16("div", { className: "inline-flex pb-4", children: /* @__PURE__ */ jsx16(Button, { size: "lg", className: cn("rounded-full", className), children: /* @__PURE__ */ jsxs12("a", { href, target: "_blank", rel: "noopener noreferrer", children: [
|
|
539
|
+
/* @__PURE__ */ jsx16(Download, { className: "me-2 size-5" }),
|
|
493
540
|
children
|
|
494
541
|
] }) }) });
|
|
495
542
|
}
|
|
496
543
|
|
|
497
|
-
// src/components/mdx/link.tsx
|
|
498
|
-
import { cn as cn14 } from "@pelatform/utils";
|
|
499
|
-
|
|
500
544
|
// src/components/utils/shared.tsx
|
|
501
545
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
502
546
|
var DefaultImage = ({ src, alt, className }) => /* @__PURE__ */ jsx17("img", { src, alt, className });
|
|
@@ -519,27 +563,25 @@ function ExtraLink({
|
|
|
519
563
|
{
|
|
520
564
|
href,
|
|
521
565
|
target,
|
|
522
|
-
className:
|
|
566
|
+
className: cn("font-medium underline underline-offset-4", className),
|
|
523
567
|
children
|
|
524
568
|
}
|
|
525
569
|
);
|
|
526
570
|
}
|
|
527
571
|
|
|
528
572
|
// src/components/mdx/video.tsx
|
|
529
|
-
import { cn as cn15 } from "@pelatform/utils";
|
|
530
573
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
531
574
|
function Video({ className, ...props }) {
|
|
532
|
-
return /* @__PURE__ */ jsx19("video", { className:
|
|
575
|
+
return /* @__PURE__ */ jsx19("video", { className: cn("w-full rounded-lg border", className), controls: true, loop: true, ...props });
|
|
533
576
|
}
|
|
534
577
|
|
|
535
578
|
// src/components/mdx/wrapper.tsx
|
|
536
|
-
import { cn as cn16 } from "@pelatform/utils";
|
|
537
579
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
538
580
|
function Wrapper({ children, className }) {
|
|
539
581
|
return /* @__PURE__ */ jsx20(
|
|
540
582
|
"div",
|
|
541
583
|
{
|
|
542
|
-
className:
|
|
584
|
+
className: cn(
|
|
543
585
|
"prose-no-margin rounded-lg border border-fd-primary/10 bg-radial-[at_bottom] from-blue-500/20 bg-origin-border p-4 dark:bg-black/20",
|
|
544
586
|
className
|
|
545
587
|
),
|
|
@@ -570,27 +612,24 @@ function Youtube({ id }) {
|
|
|
570
612
|
}
|
|
571
613
|
|
|
572
614
|
// src/components/navigation/back-link.tsx
|
|
573
|
-
import { ChevronLeftIcon } from "lucide-react";
|
|
574
|
-
import { Button as Button2 } from "@pelatform/ui.default";
|
|
575
|
-
import { cn as cn17 } from "@pelatform/utils";
|
|
576
615
|
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
577
616
|
function BackLink({ Link = DefaultLink, children, href, className }) {
|
|
578
617
|
return /* @__PURE__ */ jsxs13(
|
|
579
618
|
Link,
|
|
580
619
|
{
|
|
581
620
|
href,
|
|
582
|
-
className:
|
|
621
|
+
className: cn(
|
|
583
622
|
"group flex items-center gap-2 text-foreground transition-colors duration-100 hover:text-foreground/75",
|
|
584
623
|
className
|
|
585
624
|
),
|
|
586
625
|
children: [
|
|
587
626
|
/* @__PURE__ */ jsx22(
|
|
588
|
-
|
|
627
|
+
Button,
|
|
589
628
|
{
|
|
629
|
+
size: "icon",
|
|
590
630
|
variant: "secondary",
|
|
591
|
-
mode: "icon",
|
|
592
631
|
className: "size-7.5! transition-transform duration-100 group-hover:-translate-x-0.5",
|
|
593
|
-
children: /* @__PURE__ */ jsx22(
|
|
632
|
+
children: /* @__PURE__ */ jsx22(ChevronLeft, {})
|
|
594
633
|
}
|
|
595
634
|
),
|
|
596
635
|
/* @__PURE__ */ jsx22("span", { className: "font-semibold text-lg", children })
|
|
@@ -601,9 +640,6 @@ function BackLink({ Link = DefaultLink, children, href, className }) {
|
|
|
601
640
|
|
|
602
641
|
// src/components/navigation/command-menu.tsx
|
|
603
642
|
import * as React from "react";
|
|
604
|
-
import { SearchIcon } from "lucide-react";
|
|
605
|
-
import { Button as Button3, CommandDialog, CommandInput, CommandList } from "@pelatform/ui.default";
|
|
606
|
-
import { cn as cn18, googleTrackEvent } from "@pelatform/utils";
|
|
607
643
|
import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
608
644
|
function CommandMenu({
|
|
609
645
|
children,
|
|
@@ -626,17 +662,6 @@ function CommandMenu({
|
|
|
626
662
|
e.preventDefault();
|
|
627
663
|
setOpen((currentOpen) => {
|
|
628
664
|
const newState = !currentOpen;
|
|
629
|
-
if (newState) {
|
|
630
|
-
googleTrackEvent({
|
|
631
|
-
name: "site_header_search_trigger_shortcut",
|
|
632
|
-
properties: {
|
|
633
|
-
method: e.key === "/" ? "slash" : "cmd_k",
|
|
634
|
-
category: "search",
|
|
635
|
-
label: `Search Trigger - ${e.key === "/" ? "Slash" : "Cmd+K"}`,
|
|
636
|
-
timestamp: Date.now()
|
|
637
|
-
}
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
665
|
return newState;
|
|
641
666
|
});
|
|
642
667
|
}
|
|
@@ -644,39 +669,26 @@ function CommandMenu({
|
|
|
644
669
|
document.addEventListener("keydown", handleKeyDown);
|
|
645
670
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
646
671
|
}, []);
|
|
647
|
-
const handleButtonClick = React.useCallback(() => {
|
|
648
|
-
googleTrackEvent({
|
|
649
|
-
name: "site_header_search_trigger_click",
|
|
650
|
-
properties: {
|
|
651
|
-
method: "button_click",
|
|
652
|
-
category: "search",
|
|
653
|
-
label: "Search Trigger - Button Click",
|
|
654
|
-
timestamp: Date.now()
|
|
655
|
-
}
|
|
656
|
-
});
|
|
657
|
-
}, []);
|
|
658
672
|
const handleOpenMenu = React.useCallback(() => {
|
|
659
673
|
setOpen(true);
|
|
660
|
-
|
|
661
|
-
}, [handleButtonClick]);
|
|
674
|
+
}, []);
|
|
662
675
|
return /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
663
676
|
/* @__PURE__ */ jsxs14(
|
|
664
|
-
|
|
677
|
+
Button,
|
|
665
678
|
{
|
|
666
|
-
variant: "outline",
|
|
667
|
-
mode: "input",
|
|
668
679
|
size: "sm",
|
|
669
|
-
|
|
680
|
+
variant: "outline",
|
|
681
|
+
className: cn("relative h-8 w-full py-0 ps-2 sm:w-40 sm:pe-12 lg:w-48", classButton),
|
|
670
682
|
onClick: handleOpenMenu,
|
|
671
683
|
"aria-label": `Open command menu (${keyHint})`,
|
|
672
684
|
...props,
|
|
673
685
|
children: [
|
|
674
|
-
/* @__PURE__ */ jsx23(
|
|
686
|
+
/* @__PURE__ */ jsx23(Search, { className: "me-2 size-4" }),
|
|
675
687
|
/* @__PURE__ */ jsx23("span", { className: "inline-flex text-muted-foreground", children: searchButtonText }),
|
|
676
688
|
/* @__PURE__ */ jsx23(
|
|
677
689
|
"kbd",
|
|
678
690
|
{
|
|
679
|
-
className: "pointer-events-none absolute top-1/2
|
|
691
|
+
className: "pointer-events-none absolute end-[5px] top-1/2 hidden h-5 -translate-y-1/2 select-none items-center gap-1 rounded border bg-muted px-1.5 font-medium font-mono text-[10px] opacity-100 sm:flex",
|
|
680
692
|
"aria-label": `Keyboard shortcut: ${keyHint}`,
|
|
681
693
|
children: keyHint
|
|
682
694
|
}
|
|
@@ -689,7 +701,7 @@ function CommandMenu({
|
|
|
689
701
|
{
|
|
690
702
|
open,
|
|
691
703
|
onOpenChange: setOpen,
|
|
692
|
-
className:
|
|
704
|
+
className: cn(
|
|
693
705
|
"**:data-dialog-close:end-[0.925rem] **:data-dialog-close:top-[0.925rem]",
|
|
694
706
|
classDialog
|
|
695
707
|
),
|
|
@@ -703,20 +715,9 @@ function CommandMenu({
|
|
|
703
715
|
}
|
|
704
716
|
|
|
705
717
|
// src/components/navigation/main-nav.tsx
|
|
706
|
-
import { ArrowUpRightIcon, ChevronDownIcon } from "lucide-react";
|
|
707
|
-
import {
|
|
708
|
-
DropdownMenu,
|
|
709
|
-
DropdownMenuContent,
|
|
710
|
-
DropdownMenuItem,
|
|
711
|
-
DropdownMenuSub,
|
|
712
|
-
DropdownMenuSubContent,
|
|
713
|
-
DropdownMenuSubTrigger,
|
|
714
|
-
DropdownMenuTrigger
|
|
715
|
-
} from "@pelatform/ui.default";
|
|
716
|
-
import { cn as cn19, googleTrackEvent as googleTrackEvent2 } from "@pelatform/utils";
|
|
717
718
|
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
718
719
|
function MainNav({ Link = DefaultLink, pathname, items, className }) {
|
|
719
|
-
return /* @__PURE__ */ jsx24("div", { className:
|
|
720
|
+
return /* @__PURE__ */ jsx24("div", { className: cn("me-4 hidden items-center justify-center md:flex", className), children: /* @__PURE__ */ jsx24("nav", { className: "flex items-center gap-4 font-medium text-sm xl:gap-6", children: items.map((item) => /* @__PURE__ */ jsx24(NavItemRenderer, { Link, item, pathname, level: 1 }, item.title)) }) });
|
|
720
721
|
}
|
|
721
722
|
function NavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
722
723
|
const hasChildren = item.children && item.children.length > 0;
|
|
@@ -727,17 +728,17 @@ function NavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
|
727
728
|
) ?? false : item.href === pathname || item.href !== "/" && item.href && pathname?.startsWith(item.href);
|
|
728
729
|
if (hasChildren && level <= 3) {
|
|
729
730
|
return /* @__PURE__ */ jsxs15(DropdownMenu, { children: [
|
|
730
|
-
/* @__PURE__ */ jsx24(DropdownMenuTrigger, {
|
|
731
|
+
/* @__PURE__ */ jsx24(DropdownMenuTrigger, { children: /* @__PURE__ */ jsxs15(
|
|
731
732
|
"button",
|
|
732
733
|
{
|
|
733
|
-
className:
|
|
734
|
+
className: cn(
|
|
734
735
|
"inline-flex cursor-pointer items-center gap-1 transition-colors hover:text-foreground/80 focus-visible:outline-0",
|
|
735
736
|
isActive ? "text-foreground" : "text-foreground/60"
|
|
736
737
|
),
|
|
737
738
|
children: [
|
|
738
739
|
item.icon && /* @__PURE__ */ jsx24(item.icon, {}),
|
|
739
740
|
item.title,
|
|
740
|
-
/* @__PURE__ */ jsx24(
|
|
741
|
+
/* @__PURE__ */ jsx24(ChevronDown, { className: "size-3.5" })
|
|
741
742
|
]
|
|
742
743
|
}
|
|
743
744
|
) }),
|
|
@@ -767,15 +768,14 @@ function NavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
|
767
768
|
{
|
|
768
769
|
href: item.href ?? "#",
|
|
769
770
|
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
770
|
-
className:
|
|
771
|
+
className: cn(
|
|
771
772
|
"relative inline-flex items-center gap-1 transition-colors hover:text-foreground/80",
|
|
772
773
|
isActive ? "text-foreground" : "text-foreground/60"
|
|
773
774
|
),
|
|
774
|
-
onClick: () => handleMenuClick(item),
|
|
775
775
|
children: [
|
|
776
776
|
item.icon && /* @__PURE__ */ jsx24(item.icon, {}),
|
|
777
777
|
item.title,
|
|
778
|
-
item.external && /* @__PURE__ */ jsx24(
|
|
778
|
+
item.external && /* @__PURE__ */ jsx24(ArrowUpRight, { className: "size-3.5 opacity-60" })
|
|
779
779
|
]
|
|
780
780
|
}
|
|
781
781
|
);
|
|
@@ -790,7 +790,7 @@ function ChildNavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
|
790
790
|
/* @__PURE__ */ jsxs15(
|
|
791
791
|
DropdownMenuSubTrigger,
|
|
792
792
|
{
|
|
793
|
-
className:
|
|
793
|
+
className: cn(
|
|
794
794
|
"flex w-full items-center justify-between text-muted-foreground hover:text-foreground",
|
|
795
795
|
isChildActive && "font-medium text-foreground"
|
|
796
796
|
),
|
|
@@ -811,52 +811,26 @@ function ChildNavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
|
811
811
|
)) })
|
|
812
812
|
] });
|
|
813
813
|
}
|
|
814
|
-
return /* @__PURE__ */ jsx24(DropdownMenuItem, {
|
|
814
|
+
return /* @__PURE__ */ jsx24(DropdownMenuItem, { children: /* @__PURE__ */ jsxs15(
|
|
815
815
|
Link,
|
|
816
816
|
{
|
|
817
817
|
href: item.href || "",
|
|
818
818
|
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
819
|
-
className:
|
|
819
|
+
className: cn(
|
|
820
820
|
"block w-full cursor-pointer transition-colors",
|
|
821
821
|
isChildActive ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
822
822
|
),
|
|
823
|
-
onClick: () => handleMenuClick(item),
|
|
824
823
|
children: [
|
|
825
824
|
item.icon && /* @__PURE__ */ jsx24(item.icon, {}),
|
|
826
825
|
item.title,
|
|
827
|
-
item.external && /* @__PURE__ */ jsx24(
|
|
826
|
+
item.external && /* @__PURE__ */ jsx24(ArrowUpRight, { className: "size-3.5 opacity-60" })
|
|
828
827
|
]
|
|
829
828
|
}
|
|
830
829
|
) });
|
|
831
830
|
}
|
|
832
|
-
function handleMenuClick(item) {
|
|
833
|
-
googleTrackEvent2({
|
|
834
|
-
name: `site_header_menu_${item.title.toLowerCase().replace(/\s+/g, "_")}_link_click`,
|
|
835
|
-
properties: {
|
|
836
|
-
menu_item: item.title,
|
|
837
|
-
menu_path: item.href || "#",
|
|
838
|
-
is_external: !!item.external,
|
|
839
|
-
category: "navigation",
|
|
840
|
-
label: `Header Menu ${item.title} Click`
|
|
841
|
-
}
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
831
|
|
|
845
832
|
// src/components/navigation/mobile-nav.tsx
|
|
846
833
|
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
847
|
-
import { ArrowUpRightIcon as ArrowUpRightIcon2, ChevronDownIcon as ChevronDownIcon2, MenuIcon } from "lucide-react";
|
|
848
|
-
import {
|
|
849
|
-
Button as Button4,
|
|
850
|
-
Collapsible,
|
|
851
|
-
CollapsibleContent,
|
|
852
|
-
CollapsibleTrigger,
|
|
853
|
-
Drawer,
|
|
854
|
-
DrawerContent,
|
|
855
|
-
DrawerDescription,
|
|
856
|
-
DrawerTitle,
|
|
857
|
-
DrawerTrigger
|
|
858
|
-
} from "@pelatform/ui.default";
|
|
859
|
-
import { cn as cn20 } from "@pelatform/utils";
|
|
860
834
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
861
835
|
function MobileNav({ children, className }) {
|
|
862
836
|
const { setMetaColor, metaColor } = useMetaColor();
|
|
@@ -868,9 +842,9 @@ function MobileNav({ children, className }) {
|
|
|
868
842
|
},
|
|
869
843
|
[setMetaColor, metaColor]
|
|
870
844
|
);
|
|
871
|
-
return /* @__PURE__ */ jsx25("div", { className:
|
|
872
|
-
/* @__PURE__ */ jsx25(DrawerTrigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
873
|
-
/* @__PURE__ */ jsx25(
|
|
845
|
+
return /* @__PURE__ */ jsx25("div", { className: cn("flex items-center gap-2.5 md:hidden", className), children: /* @__PURE__ */ jsxs16(Drawer, { open, onOpenChange, children: [
|
|
846
|
+
/* @__PURE__ */ jsx25(DrawerTrigger, { asChild: true, children: /* @__PURE__ */ jsxs16(Button, { variant: "ghost", className: "group/toggle size-8 px-0 text-foreground", children: [
|
|
847
|
+
/* @__PURE__ */ jsx25(Menu, {}),
|
|
874
848
|
/* @__PURE__ */ jsx25("span", { className: "sr-only", children: "Toggle Menu" })
|
|
875
849
|
] }) }),
|
|
876
850
|
/* @__PURE__ */ jsxs16(DrawerContent, { className: "max-h-[60svh] p-0", children: [
|
|
@@ -902,69 +876,2067 @@ function MobileNavItemRenderer({
|
|
|
902
876
|
/* @__PURE__ */ jsxs16(
|
|
903
877
|
CollapsibleTrigger,
|
|
904
878
|
{
|
|
905
|
-
className:
|
|
906
|
-
"flex w-full cursor-pointer items-center gap-1 text-sm transition-colors",
|
|
907
|
-
isOpen ? "text-foreground" : "text-foreground/60"
|
|
908
|
-
),
|
|
909
|
-
children: [
|
|
910
|
-
item.icon && /* @__PURE__ */ jsx25(item.icon, {}),
|
|
911
|
-
item.title,
|
|
912
|
-
/* @__PURE__ */ jsx25(
|
|
913
|
-
|
|
914
|
-
{
|
|
915
|
-
className:
|
|
916
|
-
"
|
|
917
|
-
isOpen && "rotate-180"
|
|
918
|
-
)
|
|
919
|
-
}
|
|
920
|
-
)
|
|
921
|
-
]
|
|
922
|
-
}
|
|
923
|
-
),
|
|
924
|
-
/* @__PURE__ */ jsx25(CollapsibleContent, { children: /* @__PURE__ */ jsx25("div", { className:
|
|
925
|
-
MobileNavItemRenderer,
|
|
879
|
+
className: cn(
|
|
880
|
+
"flex w-full cursor-pointer items-center gap-1 text-sm transition-colors",
|
|
881
|
+
isOpen ? "text-foreground" : "text-foreground/60"
|
|
882
|
+
),
|
|
883
|
+
children: [
|
|
884
|
+
item.icon && /* @__PURE__ */ jsx25(item.icon, {}),
|
|
885
|
+
item.title,
|
|
886
|
+
/* @__PURE__ */ jsx25(
|
|
887
|
+
ChevronDown,
|
|
888
|
+
{
|
|
889
|
+
className: cn(
|
|
890
|
+
"ms-auto size-3.5 opacity-60 transition-transform",
|
|
891
|
+
isOpen && "rotate-180"
|
|
892
|
+
)
|
|
893
|
+
}
|
|
894
|
+
)
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
),
|
|
898
|
+
/* @__PURE__ */ jsx25(CollapsibleContent, { children: /* @__PURE__ */ jsx25("div", { className: cn("flex flex-col space-y-2.5 pt-3", `ps-5`), children: item.children.map((child) => /* @__PURE__ */ jsx25(
|
|
899
|
+
MobileNavItemRenderer,
|
|
900
|
+
{
|
|
901
|
+
item: child,
|
|
902
|
+
pathname,
|
|
903
|
+
level: level + 1,
|
|
904
|
+
onOpenChange
|
|
905
|
+
},
|
|
906
|
+
child.title
|
|
907
|
+
)) }) })
|
|
908
|
+
] });
|
|
909
|
+
}
|
|
910
|
+
return /* @__PURE__ */ jsxs16(
|
|
911
|
+
Link,
|
|
912
|
+
{
|
|
913
|
+
href: item.href || "#",
|
|
914
|
+
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
915
|
+
onClick: () => {
|
|
916
|
+
if (!item.external && item.href) {
|
|
917
|
+
router(item.href.toString());
|
|
918
|
+
}
|
|
919
|
+
onOpenChange?.(false);
|
|
920
|
+
},
|
|
921
|
+
className: cn(
|
|
922
|
+
"inline-flex items-center gap-1 text-sm transition-colors",
|
|
923
|
+
isActive ? "text-foreground" : "text-foreground/60"
|
|
924
|
+
),
|
|
925
|
+
children: [
|
|
926
|
+
item.icon && /* @__PURE__ */ jsx25(item.icon, {}),
|
|
927
|
+
item.title,
|
|
928
|
+
item.external && /* @__PURE__ */ jsx25(ArrowUpRight, { className: "ms-1 size-3.5 opacity-60" })
|
|
929
|
+
]
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// src/components/providers/query-provider.tsx
|
|
935
|
+
import { useState as useState3 } from "react";
|
|
936
|
+
|
|
937
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
938
|
+
var Subscribable = class {
|
|
939
|
+
constructor() {
|
|
940
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
941
|
+
this.subscribe = this.subscribe.bind(this);
|
|
942
|
+
}
|
|
943
|
+
subscribe(listener) {
|
|
944
|
+
this.listeners.add(listener);
|
|
945
|
+
this.onSubscribe();
|
|
946
|
+
return () => {
|
|
947
|
+
this.listeners.delete(listener);
|
|
948
|
+
this.onUnsubscribe();
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
hasListeners() {
|
|
952
|
+
return this.listeners.size > 0;
|
|
953
|
+
}
|
|
954
|
+
onSubscribe() {
|
|
955
|
+
}
|
|
956
|
+
onUnsubscribe() {
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
|
|
961
|
+
var defaultTimeoutProvider = {
|
|
962
|
+
// We need the wrapper function syntax below instead of direct references to
|
|
963
|
+
// global setTimeout etc.
|
|
964
|
+
//
|
|
965
|
+
// BAD: `setTimeout: setTimeout`
|
|
966
|
+
// GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`
|
|
967
|
+
//
|
|
968
|
+
// If we use direct references here, then anything that wants to spy on or
|
|
969
|
+
// replace the global setTimeout (like tests) won't work since we'll already
|
|
970
|
+
// have a hard reference to the original implementation at the time when this
|
|
971
|
+
// file was imported.
|
|
972
|
+
setTimeout: (callback, delay) => setTimeout(callback, delay),
|
|
973
|
+
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
|
|
974
|
+
setInterval: (callback, delay) => setInterval(callback, delay),
|
|
975
|
+
clearInterval: (intervalId) => clearInterval(intervalId)
|
|
976
|
+
};
|
|
977
|
+
var TimeoutManager = class {
|
|
978
|
+
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
979
|
+
// type at app boot; and if we leave that type, then any new timer provider
|
|
980
|
+
// would need to support ReturnType<typeof setTimeout>, which is infeasible.
|
|
981
|
+
//
|
|
982
|
+
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
983
|
+
// this class is unsafe internally to allow for extension.
|
|
984
|
+
#provider = defaultTimeoutProvider;
|
|
985
|
+
#providerCalled = false;
|
|
986
|
+
setTimeoutProvider(provider) {
|
|
987
|
+
if (process.env.NODE_ENV !== "production") {
|
|
988
|
+
if (this.#providerCalled && provider !== this.#provider) {
|
|
989
|
+
console.error(
|
|
990
|
+
`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,
|
|
991
|
+
{ previous: this.#provider, provider }
|
|
992
|
+
);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
this.#provider = provider;
|
|
996
|
+
if (process.env.NODE_ENV !== "production") {
|
|
997
|
+
this.#providerCalled = false;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
setTimeout(callback, delay) {
|
|
1001
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1002
|
+
this.#providerCalled = true;
|
|
1003
|
+
}
|
|
1004
|
+
return this.#provider.setTimeout(callback, delay);
|
|
1005
|
+
}
|
|
1006
|
+
clearTimeout(timeoutId) {
|
|
1007
|
+
this.#provider.clearTimeout(timeoutId);
|
|
1008
|
+
}
|
|
1009
|
+
setInterval(callback, delay) {
|
|
1010
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1011
|
+
this.#providerCalled = true;
|
|
1012
|
+
}
|
|
1013
|
+
return this.#provider.setInterval(callback, delay);
|
|
1014
|
+
}
|
|
1015
|
+
clearInterval(intervalId) {
|
|
1016
|
+
this.#provider.clearInterval(intervalId);
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
var timeoutManager = new TimeoutManager();
|
|
1020
|
+
function systemSetTimeoutZero(callback) {
|
|
1021
|
+
setTimeout(callback, 0);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/utils.js
|
|
1025
|
+
var isServer = typeof window === "undefined" || "Deno" in globalThis;
|
|
1026
|
+
function noop() {
|
|
1027
|
+
}
|
|
1028
|
+
function functionalUpdate(updater, input) {
|
|
1029
|
+
return typeof updater === "function" ? updater(input) : updater;
|
|
1030
|
+
}
|
|
1031
|
+
function isValidTimeout(value) {
|
|
1032
|
+
return typeof value === "number" && value >= 0 && value !== Infinity;
|
|
1033
|
+
}
|
|
1034
|
+
function timeUntilStale(updatedAt, staleTime) {
|
|
1035
|
+
return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
|
|
1036
|
+
}
|
|
1037
|
+
function resolveStaleTime(staleTime, query) {
|
|
1038
|
+
return typeof staleTime === "function" ? staleTime(query) : staleTime;
|
|
1039
|
+
}
|
|
1040
|
+
function resolveEnabled(enabled, query) {
|
|
1041
|
+
return typeof enabled === "function" ? enabled(query) : enabled;
|
|
1042
|
+
}
|
|
1043
|
+
function matchQuery(filters, query) {
|
|
1044
|
+
const {
|
|
1045
|
+
type = "all",
|
|
1046
|
+
exact,
|
|
1047
|
+
fetchStatus,
|
|
1048
|
+
predicate,
|
|
1049
|
+
queryKey,
|
|
1050
|
+
stale
|
|
1051
|
+
} = filters;
|
|
1052
|
+
if (queryKey) {
|
|
1053
|
+
if (exact) {
|
|
1054
|
+
if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {
|
|
1055
|
+
return false;
|
|
1056
|
+
}
|
|
1057
|
+
} else if (!partialMatchKey(query.queryKey, queryKey)) {
|
|
1058
|
+
return false;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
if (type !== "all") {
|
|
1062
|
+
const isActive = query.isActive();
|
|
1063
|
+
if (type === "active" && !isActive) {
|
|
1064
|
+
return false;
|
|
1065
|
+
}
|
|
1066
|
+
if (type === "inactive" && isActive) {
|
|
1067
|
+
return false;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
if (typeof stale === "boolean" && query.isStale() !== stale) {
|
|
1071
|
+
return false;
|
|
1072
|
+
}
|
|
1073
|
+
if (fetchStatus && fetchStatus !== query.state.fetchStatus) {
|
|
1074
|
+
return false;
|
|
1075
|
+
}
|
|
1076
|
+
if (predicate && !predicate(query)) {
|
|
1077
|
+
return false;
|
|
1078
|
+
}
|
|
1079
|
+
return true;
|
|
1080
|
+
}
|
|
1081
|
+
function matchMutation(filters, mutation) {
|
|
1082
|
+
const { exact, status, predicate, mutationKey } = filters;
|
|
1083
|
+
if (mutationKey) {
|
|
1084
|
+
if (!mutation.options.mutationKey) {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
1087
|
+
if (exact) {
|
|
1088
|
+
if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {
|
|
1089
|
+
return false;
|
|
1090
|
+
}
|
|
1091
|
+
} else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {
|
|
1092
|
+
return false;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
if (status && mutation.state.status !== status) {
|
|
1096
|
+
return false;
|
|
1097
|
+
}
|
|
1098
|
+
if (predicate && !predicate(mutation)) {
|
|
1099
|
+
return false;
|
|
1100
|
+
}
|
|
1101
|
+
return true;
|
|
1102
|
+
}
|
|
1103
|
+
function hashQueryKeyByOptions(queryKey, options) {
|
|
1104
|
+
const hashFn = options?.queryKeyHashFn || hashKey;
|
|
1105
|
+
return hashFn(queryKey);
|
|
1106
|
+
}
|
|
1107
|
+
function hashKey(queryKey) {
|
|
1108
|
+
return JSON.stringify(
|
|
1109
|
+
queryKey,
|
|
1110
|
+
(_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
|
|
1111
|
+
result[key] = val[key];
|
|
1112
|
+
return result;
|
|
1113
|
+
}, {}) : val
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
function partialMatchKey(a, b) {
|
|
1117
|
+
if (a === b) {
|
|
1118
|
+
return true;
|
|
1119
|
+
}
|
|
1120
|
+
if (typeof a !== typeof b) {
|
|
1121
|
+
return false;
|
|
1122
|
+
}
|
|
1123
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
1124
|
+
return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));
|
|
1125
|
+
}
|
|
1126
|
+
return false;
|
|
1127
|
+
}
|
|
1128
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
1129
|
+
function replaceEqualDeep(a, b, depth = 0) {
|
|
1130
|
+
if (a === b) {
|
|
1131
|
+
return a;
|
|
1132
|
+
}
|
|
1133
|
+
if (depth > 500) return b;
|
|
1134
|
+
const array = isPlainArray(a) && isPlainArray(b);
|
|
1135
|
+
if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
|
|
1136
|
+
const aItems = array ? a : Object.keys(a);
|
|
1137
|
+
const aSize = aItems.length;
|
|
1138
|
+
const bItems = array ? b : Object.keys(b);
|
|
1139
|
+
const bSize = bItems.length;
|
|
1140
|
+
const copy = array ? new Array(bSize) : {};
|
|
1141
|
+
let equalItems = 0;
|
|
1142
|
+
for (let i = 0; i < bSize; i++) {
|
|
1143
|
+
const key = array ? i : bItems[i];
|
|
1144
|
+
const aItem = a[key];
|
|
1145
|
+
const bItem = b[key];
|
|
1146
|
+
if (aItem === bItem) {
|
|
1147
|
+
copy[key] = aItem;
|
|
1148
|
+
if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
|
|
1149
|
+
continue;
|
|
1150
|
+
}
|
|
1151
|
+
if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
|
|
1152
|
+
copy[key] = bItem;
|
|
1153
|
+
continue;
|
|
1154
|
+
}
|
|
1155
|
+
const v = replaceEqualDeep(aItem, bItem, depth + 1);
|
|
1156
|
+
copy[key] = v;
|
|
1157
|
+
if (v === aItem) equalItems++;
|
|
1158
|
+
}
|
|
1159
|
+
return aSize === bSize && equalItems === aSize ? a : copy;
|
|
1160
|
+
}
|
|
1161
|
+
function isPlainArray(value) {
|
|
1162
|
+
return Array.isArray(value) && value.length === Object.keys(value).length;
|
|
1163
|
+
}
|
|
1164
|
+
function isPlainObject(o) {
|
|
1165
|
+
if (!hasObjectPrototype(o)) {
|
|
1166
|
+
return false;
|
|
1167
|
+
}
|
|
1168
|
+
const ctor = o.constructor;
|
|
1169
|
+
if (ctor === void 0) {
|
|
1170
|
+
return true;
|
|
1171
|
+
}
|
|
1172
|
+
const prot = ctor.prototype;
|
|
1173
|
+
if (!hasObjectPrototype(prot)) {
|
|
1174
|
+
return false;
|
|
1175
|
+
}
|
|
1176
|
+
if (!prot.hasOwnProperty("isPrototypeOf")) {
|
|
1177
|
+
return false;
|
|
1178
|
+
}
|
|
1179
|
+
if (Object.getPrototypeOf(o) !== Object.prototype) {
|
|
1180
|
+
return false;
|
|
1181
|
+
}
|
|
1182
|
+
return true;
|
|
1183
|
+
}
|
|
1184
|
+
function hasObjectPrototype(o) {
|
|
1185
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
1186
|
+
}
|
|
1187
|
+
function sleep(timeout) {
|
|
1188
|
+
return new Promise((resolve) => {
|
|
1189
|
+
timeoutManager.setTimeout(resolve, timeout);
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
function replaceData(prevData, data, options) {
|
|
1193
|
+
if (typeof options.structuralSharing === "function") {
|
|
1194
|
+
return options.structuralSharing(prevData, data);
|
|
1195
|
+
} else if (options.structuralSharing !== false) {
|
|
1196
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1197
|
+
try {
|
|
1198
|
+
return replaceEqualDeep(prevData, data);
|
|
1199
|
+
} catch (error) {
|
|
1200
|
+
console.error(
|
|
1201
|
+
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`
|
|
1202
|
+
);
|
|
1203
|
+
throw error;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
return replaceEqualDeep(prevData, data);
|
|
1207
|
+
}
|
|
1208
|
+
return data;
|
|
1209
|
+
}
|
|
1210
|
+
function addToEnd(items, item, max = 0) {
|
|
1211
|
+
const newItems = [...items, item];
|
|
1212
|
+
return max && newItems.length > max ? newItems.slice(1) : newItems;
|
|
1213
|
+
}
|
|
1214
|
+
function addToStart(items, item, max = 0) {
|
|
1215
|
+
const newItems = [item, ...items];
|
|
1216
|
+
return max && newItems.length > max ? newItems.slice(0, -1) : newItems;
|
|
1217
|
+
}
|
|
1218
|
+
var skipToken = /* @__PURE__ */ Symbol();
|
|
1219
|
+
function ensureQueryFn(options, fetchOptions) {
|
|
1220
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1221
|
+
if (options.queryFn === skipToken) {
|
|
1222
|
+
console.error(
|
|
1223
|
+
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
if (!options.queryFn && fetchOptions?.initialPromise) {
|
|
1228
|
+
return () => fetchOptions.initialPromise;
|
|
1229
|
+
}
|
|
1230
|
+
if (!options.queryFn || options.queryFn === skipToken) {
|
|
1231
|
+
return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));
|
|
1232
|
+
}
|
|
1233
|
+
return options.queryFn;
|
|
1234
|
+
}
|
|
1235
|
+
function addConsumeAwareSignal(object, getSignal, onCancelled) {
|
|
1236
|
+
let consumed = false;
|
|
1237
|
+
let signal;
|
|
1238
|
+
Object.defineProperty(object, "signal", {
|
|
1239
|
+
enumerable: true,
|
|
1240
|
+
get: () => {
|
|
1241
|
+
signal ??= getSignal();
|
|
1242
|
+
if (consumed) {
|
|
1243
|
+
return signal;
|
|
1244
|
+
}
|
|
1245
|
+
consumed = true;
|
|
1246
|
+
if (signal.aborted) {
|
|
1247
|
+
onCancelled();
|
|
1248
|
+
} else {
|
|
1249
|
+
signal.addEventListener("abort", onCancelled, { once: true });
|
|
1250
|
+
}
|
|
1251
|
+
return signal;
|
|
1252
|
+
}
|
|
1253
|
+
});
|
|
1254
|
+
return object;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/focusManager.js
|
|
1258
|
+
var FocusManager = class extends Subscribable {
|
|
1259
|
+
#focused;
|
|
1260
|
+
#cleanup;
|
|
1261
|
+
#setup;
|
|
1262
|
+
constructor() {
|
|
1263
|
+
super();
|
|
1264
|
+
this.#setup = (onFocus) => {
|
|
1265
|
+
if (!isServer && window.addEventListener) {
|
|
1266
|
+
const listener = () => onFocus();
|
|
1267
|
+
window.addEventListener("visibilitychange", listener, false);
|
|
1268
|
+
return () => {
|
|
1269
|
+
window.removeEventListener("visibilitychange", listener);
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
return;
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
onSubscribe() {
|
|
1276
|
+
if (!this.#cleanup) {
|
|
1277
|
+
this.setEventListener(this.#setup);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
onUnsubscribe() {
|
|
1281
|
+
if (!this.hasListeners()) {
|
|
1282
|
+
this.#cleanup?.();
|
|
1283
|
+
this.#cleanup = void 0;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
setEventListener(setup) {
|
|
1287
|
+
this.#setup = setup;
|
|
1288
|
+
this.#cleanup?.();
|
|
1289
|
+
this.#cleanup = setup((focused) => {
|
|
1290
|
+
if (typeof focused === "boolean") {
|
|
1291
|
+
this.setFocused(focused);
|
|
1292
|
+
} else {
|
|
1293
|
+
this.onFocus();
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
setFocused(focused) {
|
|
1298
|
+
const changed = this.#focused !== focused;
|
|
1299
|
+
if (changed) {
|
|
1300
|
+
this.#focused = focused;
|
|
1301
|
+
this.onFocus();
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
onFocus() {
|
|
1305
|
+
const isFocused = this.isFocused();
|
|
1306
|
+
this.listeners.forEach((listener) => {
|
|
1307
|
+
listener(isFocused);
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
isFocused() {
|
|
1311
|
+
if (typeof this.#focused === "boolean") {
|
|
1312
|
+
return this.#focused;
|
|
1313
|
+
}
|
|
1314
|
+
return globalThis.document?.visibilityState !== "hidden";
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
var focusManager = new FocusManager();
|
|
1318
|
+
|
|
1319
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/thenable.js
|
|
1320
|
+
function pendingThenable() {
|
|
1321
|
+
let resolve;
|
|
1322
|
+
let reject;
|
|
1323
|
+
const thenable = new Promise((_resolve, _reject) => {
|
|
1324
|
+
resolve = _resolve;
|
|
1325
|
+
reject = _reject;
|
|
1326
|
+
});
|
|
1327
|
+
thenable.status = "pending";
|
|
1328
|
+
thenable.catch(() => {
|
|
1329
|
+
});
|
|
1330
|
+
function finalize(data) {
|
|
1331
|
+
Object.assign(thenable, data);
|
|
1332
|
+
delete thenable.resolve;
|
|
1333
|
+
delete thenable.reject;
|
|
1334
|
+
}
|
|
1335
|
+
thenable.resolve = (value) => {
|
|
1336
|
+
finalize({
|
|
1337
|
+
status: "fulfilled",
|
|
1338
|
+
value
|
|
1339
|
+
});
|
|
1340
|
+
resolve(value);
|
|
1341
|
+
};
|
|
1342
|
+
thenable.reject = (reason) => {
|
|
1343
|
+
finalize({
|
|
1344
|
+
status: "rejected",
|
|
1345
|
+
reason
|
|
1346
|
+
});
|
|
1347
|
+
reject(reason);
|
|
1348
|
+
};
|
|
1349
|
+
return thenable;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/notifyManager.js
|
|
1353
|
+
var defaultScheduler = systemSetTimeoutZero;
|
|
1354
|
+
function createNotifyManager() {
|
|
1355
|
+
let queue = [];
|
|
1356
|
+
let transactions = 0;
|
|
1357
|
+
let notifyFn = (callback) => {
|
|
1358
|
+
callback();
|
|
1359
|
+
};
|
|
1360
|
+
let batchNotifyFn = (callback) => {
|
|
1361
|
+
callback();
|
|
1362
|
+
};
|
|
1363
|
+
let scheduleFn = defaultScheduler;
|
|
1364
|
+
const schedule = (callback) => {
|
|
1365
|
+
if (transactions) {
|
|
1366
|
+
queue.push(callback);
|
|
1367
|
+
} else {
|
|
1368
|
+
scheduleFn(() => {
|
|
1369
|
+
notifyFn(callback);
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
const flush = () => {
|
|
1374
|
+
const originalQueue = queue;
|
|
1375
|
+
queue = [];
|
|
1376
|
+
if (originalQueue.length) {
|
|
1377
|
+
scheduleFn(() => {
|
|
1378
|
+
batchNotifyFn(() => {
|
|
1379
|
+
originalQueue.forEach((callback) => {
|
|
1380
|
+
notifyFn(callback);
|
|
1381
|
+
});
|
|
1382
|
+
});
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
return {
|
|
1387
|
+
batch: (callback) => {
|
|
1388
|
+
let result;
|
|
1389
|
+
transactions++;
|
|
1390
|
+
try {
|
|
1391
|
+
result = callback();
|
|
1392
|
+
} finally {
|
|
1393
|
+
transactions--;
|
|
1394
|
+
if (!transactions) {
|
|
1395
|
+
flush();
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
return result;
|
|
1399
|
+
},
|
|
1400
|
+
/**
|
|
1401
|
+
* All calls to the wrapped function will be batched.
|
|
1402
|
+
*/
|
|
1403
|
+
batchCalls: (callback) => {
|
|
1404
|
+
return (...args) => {
|
|
1405
|
+
schedule(() => {
|
|
1406
|
+
callback(...args);
|
|
1407
|
+
});
|
|
1408
|
+
};
|
|
1409
|
+
},
|
|
1410
|
+
schedule,
|
|
1411
|
+
/**
|
|
1412
|
+
* Use this method to set a custom notify function.
|
|
1413
|
+
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
1414
|
+
*/
|
|
1415
|
+
setNotifyFunction: (fn) => {
|
|
1416
|
+
notifyFn = fn;
|
|
1417
|
+
},
|
|
1418
|
+
/**
|
|
1419
|
+
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
1420
|
+
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
1421
|
+
*/
|
|
1422
|
+
setBatchNotifyFunction: (fn) => {
|
|
1423
|
+
batchNotifyFn = fn;
|
|
1424
|
+
},
|
|
1425
|
+
setScheduler: (fn) => {
|
|
1426
|
+
scheduleFn = fn;
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
var notifyManager = createNotifyManager();
|
|
1431
|
+
|
|
1432
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/onlineManager.js
|
|
1433
|
+
var OnlineManager = class extends Subscribable {
|
|
1434
|
+
#online = true;
|
|
1435
|
+
#cleanup;
|
|
1436
|
+
#setup;
|
|
1437
|
+
constructor() {
|
|
1438
|
+
super();
|
|
1439
|
+
this.#setup = (onOnline) => {
|
|
1440
|
+
if (!isServer && window.addEventListener) {
|
|
1441
|
+
const onlineListener = () => onOnline(true);
|
|
1442
|
+
const offlineListener = () => onOnline(false);
|
|
1443
|
+
window.addEventListener("online", onlineListener, false);
|
|
1444
|
+
window.addEventListener("offline", offlineListener, false);
|
|
1445
|
+
return () => {
|
|
1446
|
+
window.removeEventListener("online", onlineListener);
|
|
1447
|
+
window.removeEventListener("offline", offlineListener);
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
return;
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
onSubscribe() {
|
|
1454
|
+
if (!this.#cleanup) {
|
|
1455
|
+
this.setEventListener(this.#setup);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
onUnsubscribe() {
|
|
1459
|
+
if (!this.hasListeners()) {
|
|
1460
|
+
this.#cleanup?.();
|
|
1461
|
+
this.#cleanup = void 0;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
setEventListener(setup) {
|
|
1465
|
+
this.#setup = setup;
|
|
1466
|
+
this.#cleanup?.();
|
|
1467
|
+
this.#cleanup = setup(this.setOnline.bind(this));
|
|
1468
|
+
}
|
|
1469
|
+
setOnline(online) {
|
|
1470
|
+
const changed = this.#online !== online;
|
|
1471
|
+
if (changed) {
|
|
1472
|
+
this.#online = online;
|
|
1473
|
+
this.listeners.forEach((listener) => {
|
|
1474
|
+
listener(online);
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
isOnline() {
|
|
1479
|
+
return this.#online;
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
var onlineManager = new OnlineManager();
|
|
1483
|
+
|
|
1484
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/retryer.js
|
|
1485
|
+
function defaultRetryDelay(failureCount) {
|
|
1486
|
+
return Math.min(1e3 * 2 ** failureCount, 3e4);
|
|
1487
|
+
}
|
|
1488
|
+
function canFetch(networkMode) {
|
|
1489
|
+
return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
|
|
1490
|
+
}
|
|
1491
|
+
var CancelledError = class extends Error {
|
|
1492
|
+
constructor(options) {
|
|
1493
|
+
super("CancelledError");
|
|
1494
|
+
this.revert = options?.revert;
|
|
1495
|
+
this.silent = options?.silent;
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
function createRetryer(config) {
|
|
1499
|
+
let isRetryCancelled = false;
|
|
1500
|
+
let failureCount = 0;
|
|
1501
|
+
let continueFn;
|
|
1502
|
+
const thenable = pendingThenable();
|
|
1503
|
+
const isResolved = () => thenable.status !== "pending";
|
|
1504
|
+
const cancel = (cancelOptions) => {
|
|
1505
|
+
if (!isResolved()) {
|
|
1506
|
+
const error = new CancelledError(cancelOptions);
|
|
1507
|
+
reject(error);
|
|
1508
|
+
config.onCancel?.(error);
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
const cancelRetry = () => {
|
|
1512
|
+
isRetryCancelled = true;
|
|
1513
|
+
};
|
|
1514
|
+
const continueRetry = () => {
|
|
1515
|
+
isRetryCancelled = false;
|
|
1516
|
+
};
|
|
1517
|
+
const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun();
|
|
1518
|
+
const canStart = () => canFetch(config.networkMode) && config.canRun();
|
|
1519
|
+
const resolve = (value) => {
|
|
1520
|
+
if (!isResolved()) {
|
|
1521
|
+
continueFn?.();
|
|
1522
|
+
thenable.resolve(value);
|
|
1523
|
+
}
|
|
1524
|
+
};
|
|
1525
|
+
const reject = (value) => {
|
|
1526
|
+
if (!isResolved()) {
|
|
1527
|
+
continueFn?.();
|
|
1528
|
+
thenable.reject(value);
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
const pause = () => {
|
|
1532
|
+
return new Promise((continueResolve) => {
|
|
1533
|
+
continueFn = (value) => {
|
|
1534
|
+
if (isResolved() || canContinue()) {
|
|
1535
|
+
continueResolve(value);
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
config.onPause?.();
|
|
1539
|
+
}).then(() => {
|
|
1540
|
+
continueFn = void 0;
|
|
1541
|
+
if (!isResolved()) {
|
|
1542
|
+
config.onContinue?.();
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
};
|
|
1546
|
+
const run = () => {
|
|
1547
|
+
if (isResolved()) {
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
let promiseOrValue;
|
|
1551
|
+
const initialPromise = failureCount === 0 ? config.initialPromise : void 0;
|
|
1552
|
+
try {
|
|
1553
|
+
promiseOrValue = initialPromise ?? config.fn();
|
|
1554
|
+
} catch (error) {
|
|
1555
|
+
promiseOrValue = Promise.reject(error);
|
|
1556
|
+
}
|
|
1557
|
+
Promise.resolve(promiseOrValue).then(resolve).catch((error) => {
|
|
1558
|
+
if (isResolved()) {
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
const retry = config.retry ?? (isServer ? 0 : 3);
|
|
1562
|
+
const retryDelay = config.retryDelay ?? defaultRetryDelay;
|
|
1563
|
+
const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay;
|
|
1564
|
+
const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error);
|
|
1565
|
+
if (isRetryCancelled || !shouldRetry) {
|
|
1566
|
+
reject(error);
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
failureCount++;
|
|
1570
|
+
config.onFail?.(failureCount, error);
|
|
1571
|
+
sleep(delay).then(() => {
|
|
1572
|
+
return canContinue() ? void 0 : pause();
|
|
1573
|
+
}).then(() => {
|
|
1574
|
+
if (isRetryCancelled) {
|
|
1575
|
+
reject(error);
|
|
1576
|
+
} else {
|
|
1577
|
+
run();
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
});
|
|
1581
|
+
};
|
|
1582
|
+
return {
|
|
1583
|
+
promise: thenable,
|
|
1584
|
+
status: () => thenable.status,
|
|
1585
|
+
cancel,
|
|
1586
|
+
continue: () => {
|
|
1587
|
+
continueFn?.();
|
|
1588
|
+
return thenable;
|
|
1589
|
+
},
|
|
1590
|
+
cancelRetry,
|
|
1591
|
+
continueRetry,
|
|
1592
|
+
canStart,
|
|
1593
|
+
start: () => {
|
|
1594
|
+
if (canStart()) {
|
|
1595
|
+
run();
|
|
1596
|
+
} else {
|
|
1597
|
+
pause().then(run);
|
|
1598
|
+
}
|
|
1599
|
+
return thenable;
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/removable.js
|
|
1605
|
+
var Removable = class {
|
|
1606
|
+
#gcTimeout;
|
|
1607
|
+
destroy() {
|
|
1608
|
+
this.clearGcTimeout();
|
|
1609
|
+
}
|
|
1610
|
+
scheduleGc() {
|
|
1611
|
+
this.clearGcTimeout();
|
|
1612
|
+
if (isValidTimeout(this.gcTime)) {
|
|
1613
|
+
this.#gcTimeout = timeoutManager.setTimeout(() => {
|
|
1614
|
+
this.optionalRemove();
|
|
1615
|
+
}, this.gcTime);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
updateGcTime(newGcTime) {
|
|
1619
|
+
this.gcTime = Math.max(
|
|
1620
|
+
this.gcTime || 0,
|
|
1621
|
+
newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
clearGcTimeout() {
|
|
1625
|
+
if (this.#gcTimeout) {
|
|
1626
|
+
timeoutManager.clearTimeout(this.#gcTimeout);
|
|
1627
|
+
this.#gcTimeout = void 0;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
};
|
|
1631
|
+
|
|
1632
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/query.js
|
|
1633
|
+
var Query = class extends Removable {
|
|
1634
|
+
#initialState;
|
|
1635
|
+
#revertState;
|
|
1636
|
+
#cache;
|
|
1637
|
+
#client;
|
|
1638
|
+
#retryer;
|
|
1639
|
+
#defaultOptions;
|
|
1640
|
+
#abortSignalConsumed;
|
|
1641
|
+
constructor(config) {
|
|
1642
|
+
super();
|
|
1643
|
+
this.#abortSignalConsumed = false;
|
|
1644
|
+
this.#defaultOptions = config.defaultOptions;
|
|
1645
|
+
this.setOptions(config.options);
|
|
1646
|
+
this.observers = [];
|
|
1647
|
+
this.#client = config.client;
|
|
1648
|
+
this.#cache = this.#client.getQueryCache();
|
|
1649
|
+
this.queryKey = config.queryKey;
|
|
1650
|
+
this.queryHash = config.queryHash;
|
|
1651
|
+
this.#initialState = getDefaultState(this.options);
|
|
1652
|
+
this.state = config.state ?? this.#initialState;
|
|
1653
|
+
this.scheduleGc();
|
|
1654
|
+
}
|
|
1655
|
+
get meta() {
|
|
1656
|
+
return this.options.meta;
|
|
1657
|
+
}
|
|
1658
|
+
get promise() {
|
|
1659
|
+
return this.#retryer?.promise;
|
|
1660
|
+
}
|
|
1661
|
+
setOptions(options) {
|
|
1662
|
+
this.options = { ...this.#defaultOptions, ...options };
|
|
1663
|
+
this.updateGcTime(this.options.gcTime);
|
|
1664
|
+
if (this.state && this.state.data === void 0) {
|
|
1665
|
+
const defaultState = getDefaultState(this.options);
|
|
1666
|
+
if (defaultState.data !== void 0) {
|
|
1667
|
+
this.setState(
|
|
1668
|
+
successState(defaultState.data, defaultState.dataUpdatedAt)
|
|
1669
|
+
);
|
|
1670
|
+
this.#initialState = defaultState;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
optionalRemove() {
|
|
1675
|
+
if (!this.observers.length && this.state.fetchStatus === "idle") {
|
|
1676
|
+
this.#cache.remove(this);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
setData(newData, options) {
|
|
1680
|
+
const data = replaceData(this.state.data, newData, this.options);
|
|
1681
|
+
this.#dispatch({
|
|
1682
|
+
data,
|
|
1683
|
+
type: "success",
|
|
1684
|
+
dataUpdatedAt: options?.updatedAt,
|
|
1685
|
+
manual: options?.manual
|
|
1686
|
+
});
|
|
1687
|
+
return data;
|
|
1688
|
+
}
|
|
1689
|
+
setState(state, setStateOptions) {
|
|
1690
|
+
this.#dispatch({ type: "setState", state, setStateOptions });
|
|
1691
|
+
}
|
|
1692
|
+
cancel(options) {
|
|
1693
|
+
const promise = this.#retryer?.promise;
|
|
1694
|
+
this.#retryer?.cancel(options);
|
|
1695
|
+
return promise ? promise.then(noop).catch(noop) : Promise.resolve();
|
|
1696
|
+
}
|
|
1697
|
+
destroy() {
|
|
1698
|
+
super.destroy();
|
|
1699
|
+
this.cancel({ silent: true });
|
|
1700
|
+
}
|
|
1701
|
+
reset() {
|
|
1702
|
+
this.destroy();
|
|
1703
|
+
this.setState(this.#initialState);
|
|
1704
|
+
}
|
|
1705
|
+
isActive() {
|
|
1706
|
+
return this.observers.some(
|
|
1707
|
+
(observer) => resolveEnabled(observer.options.enabled, this) !== false
|
|
1708
|
+
);
|
|
1709
|
+
}
|
|
1710
|
+
isDisabled() {
|
|
1711
|
+
if (this.getObserversCount() > 0) {
|
|
1712
|
+
return !this.isActive();
|
|
1713
|
+
}
|
|
1714
|
+
return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
1715
|
+
}
|
|
1716
|
+
isStatic() {
|
|
1717
|
+
if (this.getObserversCount() > 0) {
|
|
1718
|
+
return this.observers.some(
|
|
1719
|
+
(observer) => resolveStaleTime(observer.options.staleTime, this) === "static"
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
return false;
|
|
1723
|
+
}
|
|
1724
|
+
isStale() {
|
|
1725
|
+
if (this.getObserversCount() > 0) {
|
|
1726
|
+
return this.observers.some(
|
|
1727
|
+
(observer) => observer.getCurrentResult().isStale
|
|
1728
|
+
);
|
|
1729
|
+
}
|
|
1730
|
+
return this.state.data === void 0 || this.state.isInvalidated;
|
|
1731
|
+
}
|
|
1732
|
+
isStaleByTime(staleTime = 0) {
|
|
1733
|
+
if (this.state.data === void 0) {
|
|
1734
|
+
return true;
|
|
1735
|
+
}
|
|
1736
|
+
if (staleTime === "static") {
|
|
1737
|
+
return false;
|
|
1738
|
+
}
|
|
1739
|
+
if (this.state.isInvalidated) {
|
|
1740
|
+
return true;
|
|
1741
|
+
}
|
|
1742
|
+
return !timeUntilStale(this.state.dataUpdatedAt, staleTime);
|
|
1743
|
+
}
|
|
1744
|
+
onFocus() {
|
|
1745
|
+
const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());
|
|
1746
|
+
observer?.refetch({ cancelRefetch: false });
|
|
1747
|
+
this.#retryer?.continue();
|
|
1748
|
+
}
|
|
1749
|
+
onOnline() {
|
|
1750
|
+
const observer = this.observers.find((x) => x.shouldFetchOnReconnect());
|
|
1751
|
+
observer?.refetch({ cancelRefetch: false });
|
|
1752
|
+
this.#retryer?.continue();
|
|
1753
|
+
}
|
|
1754
|
+
addObserver(observer) {
|
|
1755
|
+
if (!this.observers.includes(observer)) {
|
|
1756
|
+
this.observers.push(observer);
|
|
1757
|
+
this.clearGcTimeout();
|
|
1758
|
+
this.#cache.notify({ type: "observerAdded", query: this, observer });
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
removeObserver(observer) {
|
|
1762
|
+
if (this.observers.includes(observer)) {
|
|
1763
|
+
this.observers = this.observers.filter((x) => x !== observer);
|
|
1764
|
+
if (!this.observers.length) {
|
|
1765
|
+
if (this.#retryer) {
|
|
1766
|
+
if (this.#abortSignalConsumed) {
|
|
1767
|
+
this.#retryer.cancel({ revert: true });
|
|
1768
|
+
} else {
|
|
1769
|
+
this.#retryer.cancelRetry();
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
this.scheduleGc();
|
|
1773
|
+
}
|
|
1774
|
+
this.#cache.notify({ type: "observerRemoved", query: this, observer });
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
getObserversCount() {
|
|
1778
|
+
return this.observers.length;
|
|
1779
|
+
}
|
|
1780
|
+
invalidate() {
|
|
1781
|
+
if (!this.state.isInvalidated) {
|
|
1782
|
+
this.#dispatch({ type: "invalidate" });
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
async fetch(options, fetchOptions) {
|
|
1786
|
+
if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely
|
|
1787
|
+
// re-start the fetch; there is a chance that the query is still in a
|
|
1788
|
+
// pending state when that happens
|
|
1789
|
+
this.#retryer?.status() !== "rejected") {
|
|
1790
|
+
if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {
|
|
1791
|
+
this.cancel({ silent: true });
|
|
1792
|
+
} else if (this.#retryer) {
|
|
1793
|
+
this.#retryer.continueRetry();
|
|
1794
|
+
return this.#retryer.promise;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
if (options) {
|
|
1798
|
+
this.setOptions(options);
|
|
1799
|
+
}
|
|
1800
|
+
if (!this.options.queryFn) {
|
|
1801
|
+
const observer = this.observers.find((x) => x.options.queryFn);
|
|
1802
|
+
if (observer) {
|
|
1803
|
+
this.setOptions(observer.options);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1807
|
+
if (!Array.isArray(this.options.queryKey)) {
|
|
1808
|
+
console.error(
|
|
1809
|
+
`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`
|
|
1810
|
+
);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
const abortController = new AbortController();
|
|
1814
|
+
const addSignalProperty = (object) => {
|
|
1815
|
+
Object.defineProperty(object, "signal", {
|
|
1816
|
+
enumerable: true,
|
|
1817
|
+
get: () => {
|
|
1818
|
+
this.#abortSignalConsumed = true;
|
|
1819
|
+
return abortController.signal;
|
|
1820
|
+
}
|
|
1821
|
+
});
|
|
1822
|
+
};
|
|
1823
|
+
const fetchFn = () => {
|
|
1824
|
+
const queryFn = ensureQueryFn(this.options, fetchOptions);
|
|
1825
|
+
const createQueryFnContext = () => {
|
|
1826
|
+
const queryFnContext2 = {
|
|
1827
|
+
client: this.#client,
|
|
1828
|
+
queryKey: this.queryKey,
|
|
1829
|
+
meta: this.meta
|
|
1830
|
+
};
|
|
1831
|
+
addSignalProperty(queryFnContext2);
|
|
1832
|
+
return queryFnContext2;
|
|
1833
|
+
};
|
|
1834
|
+
const queryFnContext = createQueryFnContext();
|
|
1835
|
+
this.#abortSignalConsumed = false;
|
|
1836
|
+
if (this.options.persister) {
|
|
1837
|
+
return this.options.persister(
|
|
1838
|
+
queryFn,
|
|
1839
|
+
queryFnContext,
|
|
1840
|
+
this
|
|
1841
|
+
);
|
|
1842
|
+
}
|
|
1843
|
+
return queryFn(queryFnContext);
|
|
1844
|
+
};
|
|
1845
|
+
const createFetchContext = () => {
|
|
1846
|
+
const context2 = {
|
|
1847
|
+
fetchOptions,
|
|
1848
|
+
options: this.options,
|
|
1849
|
+
queryKey: this.queryKey,
|
|
1850
|
+
client: this.#client,
|
|
1851
|
+
state: this.state,
|
|
1852
|
+
fetchFn
|
|
1853
|
+
};
|
|
1854
|
+
addSignalProperty(context2);
|
|
1855
|
+
return context2;
|
|
1856
|
+
};
|
|
1857
|
+
const context = createFetchContext();
|
|
1858
|
+
this.options.behavior?.onFetch(context, this);
|
|
1859
|
+
this.#revertState = this.state;
|
|
1860
|
+
if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) {
|
|
1861
|
+
this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta });
|
|
1862
|
+
}
|
|
1863
|
+
this.#retryer = createRetryer({
|
|
1864
|
+
initialPromise: fetchOptions?.initialPromise,
|
|
1865
|
+
fn: context.fetchFn,
|
|
1866
|
+
onCancel: (error) => {
|
|
1867
|
+
if (error instanceof CancelledError && error.revert) {
|
|
1868
|
+
this.setState({
|
|
1869
|
+
...this.#revertState,
|
|
1870
|
+
fetchStatus: "idle"
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
abortController.abort();
|
|
1874
|
+
},
|
|
1875
|
+
onFail: (failureCount, error) => {
|
|
1876
|
+
this.#dispatch({ type: "failed", failureCount, error });
|
|
1877
|
+
},
|
|
1878
|
+
onPause: () => {
|
|
1879
|
+
this.#dispatch({ type: "pause" });
|
|
1880
|
+
},
|
|
1881
|
+
onContinue: () => {
|
|
1882
|
+
this.#dispatch({ type: "continue" });
|
|
1883
|
+
},
|
|
1884
|
+
retry: context.options.retry,
|
|
1885
|
+
retryDelay: context.options.retryDelay,
|
|
1886
|
+
networkMode: context.options.networkMode,
|
|
1887
|
+
canRun: () => true
|
|
1888
|
+
});
|
|
1889
|
+
try {
|
|
1890
|
+
const data = await this.#retryer.start();
|
|
1891
|
+
if (data === void 0) {
|
|
1892
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1893
|
+
console.error(
|
|
1894
|
+
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
throw new Error(`${this.queryHash} data is undefined`);
|
|
1898
|
+
}
|
|
1899
|
+
this.setData(data);
|
|
1900
|
+
this.#cache.config.onSuccess?.(data, this);
|
|
1901
|
+
this.#cache.config.onSettled?.(
|
|
1902
|
+
data,
|
|
1903
|
+
this.state.error,
|
|
1904
|
+
this
|
|
1905
|
+
);
|
|
1906
|
+
return data;
|
|
1907
|
+
} catch (error) {
|
|
1908
|
+
if (error instanceof CancelledError) {
|
|
1909
|
+
if (error.silent) {
|
|
1910
|
+
return this.#retryer.promise;
|
|
1911
|
+
} else if (error.revert) {
|
|
1912
|
+
if (this.state.data === void 0) {
|
|
1913
|
+
throw error;
|
|
1914
|
+
}
|
|
1915
|
+
return this.state.data;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
this.#dispatch({
|
|
1919
|
+
type: "error",
|
|
1920
|
+
error
|
|
1921
|
+
});
|
|
1922
|
+
this.#cache.config.onError?.(
|
|
1923
|
+
error,
|
|
1924
|
+
this
|
|
1925
|
+
);
|
|
1926
|
+
this.#cache.config.onSettled?.(
|
|
1927
|
+
this.state.data,
|
|
1928
|
+
error,
|
|
1929
|
+
this
|
|
1930
|
+
);
|
|
1931
|
+
throw error;
|
|
1932
|
+
} finally {
|
|
1933
|
+
this.scheduleGc();
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
#dispatch(action) {
|
|
1937
|
+
const reducer = (state) => {
|
|
1938
|
+
switch (action.type) {
|
|
1939
|
+
case "failed":
|
|
1940
|
+
return {
|
|
1941
|
+
...state,
|
|
1942
|
+
fetchFailureCount: action.failureCount,
|
|
1943
|
+
fetchFailureReason: action.error
|
|
1944
|
+
};
|
|
1945
|
+
case "pause":
|
|
1946
|
+
return {
|
|
1947
|
+
...state,
|
|
1948
|
+
fetchStatus: "paused"
|
|
1949
|
+
};
|
|
1950
|
+
case "continue":
|
|
1951
|
+
return {
|
|
1952
|
+
...state,
|
|
1953
|
+
fetchStatus: "fetching"
|
|
1954
|
+
};
|
|
1955
|
+
case "fetch":
|
|
1956
|
+
return {
|
|
1957
|
+
...state,
|
|
1958
|
+
...fetchState(state.data, this.options),
|
|
1959
|
+
fetchMeta: action.meta ?? null
|
|
1960
|
+
};
|
|
1961
|
+
case "success":
|
|
1962
|
+
const newState = {
|
|
1963
|
+
...state,
|
|
1964
|
+
...successState(action.data, action.dataUpdatedAt),
|
|
1965
|
+
dataUpdateCount: state.dataUpdateCount + 1,
|
|
1966
|
+
...!action.manual && {
|
|
1967
|
+
fetchStatus: "idle",
|
|
1968
|
+
fetchFailureCount: 0,
|
|
1969
|
+
fetchFailureReason: null
|
|
1970
|
+
}
|
|
1971
|
+
};
|
|
1972
|
+
this.#revertState = action.manual ? newState : void 0;
|
|
1973
|
+
return newState;
|
|
1974
|
+
case "error":
|
|
1975
|
+
const error = action.error;
|
|
1976
|
+
return {
|
|
1977
|
+
...state,
|
|
1978
|
+
error,
|
|
1979
|
+
errorUpdateCount: state.errorUpdateCount + 1,
|
|
1980
|
+
errorUpdatedAt: Date.now(),
|
|
1981
|
+
fetchFailureCount: state.fetchFailureCount + 1,
|
|
1982
|
+
fetchFailureReason: error,
|
|
1983
|
+
fetchStatus: "idle",
|
|
1984
|
+
status: "error",
|
|
1985
|
+
// flag existing data as invalidated if we get a background error
|
|
1986
|
+
// note that "no data" always means stale so we can set unconditionally here
|
|
1987
|
+
isInvalidated: true
|
|
1988
|
+
};
|
|
1989
|
+
case "invalidate":
|
|
1990
|
+
return {
|
|
1991
|
+
...state,
|
|
1992
|
+
isInvalidated: true
|
|
1993
|
+
};
|
|
1994
|
+
case "setState":
|
|
1995
|
+
return {
|
|
1996
|
+
...state,
|
|
1997
|
+
...action.state
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
};
|
|
2001
|
+
this.state = reducer(this.state);
|
|
2002
|
+
notifyManager.batch(() => {
|
|
2003
|
+
this.observers.forEach((observer) => {
|
|
2004
|
+
observer.onQueryUpdate();
|
|
2005
|
+
});
|
|
2006
|
+
this.#cache.notify({ query: this, type: "updated", action });
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
function fetchState(data, options) {
|
|
2011
|
+
return {
|
|
2012
|
+
fetchFailureCount: 0,
|
|
2013
|
+
fetchFailureReason: null,
|
|
2014
|
+
fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
|
|
2015
|
+
...data === void 0 && {
|
|
2016
|
+
error: null,
|
|
2017
|
+
status: "pending"
|
|
2018
|
+
}
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
function successState(data, dataUpdatedAt) {
|
|
2022
|
+
return {
|
|
2023
|
+
data,
|
|
2024
|
+
dataUpdatedAt: dataUpdatedAt ?? Date.now(),
|
|
2025
|
+
error: null,
|
|
2026
|
+
isInvalidated: false,
|
|
2027
|
+
status: "success"
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
function getDefaultState(options) {
|
|
2031
|
+
const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
|
|
2032
|
+
const hasData = data !== void 0;
|
|
2033
|
+
const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
|
|
2034
|
+
return {
|
|
2035
|
+
data,
|
|
2036
|
+
dataUpdateCount: 0,
|
|
2037
|
+
dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,
|
|
2038
|
+
error: null,
|
|
2039
|
+
errorUpdateCount: 0,
|
|
2040
|
+
errorUpdatedAt: 0,
|
|
2041
|
+
fetchFailureCount: 0,
|
|
2042
|
+
fetchFailureReason: null,
|
|
2043
|
+
fetchMeta: null,
|
|
2044
|
+
isInvalidated: false,
|
|
2045
|
+
status: hasData ? "success" : "pending",
|
|
2046
|
+
fetchStatus: "idle"
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
|
|
2051
|
+
function infiniteQueryBehavior(pages) {
|
|
2052
|
+
return {
|
|
2053
|
+
onFetch: (context, query) => {
|
|
2054
|
+
const options = context.options;
|
|
2055
|
+
const direction = context.fetchOptions?.meta?.fetchMore?.direction;
|
|
2056
|
+
const oldPages = context.state.data?.pages || [];
|
|
2057
|
+
const oldPageParams = context.state.data?.pageParams || [];
|
|
2058
|
+
let result = { pages: [], pageParams: [] };
|
|
2059
|
+
let currentPage = 0;
|
|
2060
|
+
const fetchFn = async () => {
|
|
2061
|
+
let cancelled = false;
|
|
2062
|
+
const addSignalProperty = (object) => {
|
|
2063
|
+
addConsumeAwareSignal(
|
|
2064
|
+
object,
|
|
2065
|
+
() => context.signal,
|
|
2066
|
+
() => cancelled = true
|
|
2067
|
+
);
|
|
2068
|
+
};
|
|
2069
|
+
const queryFn = ensureQueryFn(context.options, context.fetchOptions);
|
|
2070
|
+
const fetchPage = async (data, param, previous) => {
|
|
2071
|
+
if (cancelled) {
|
|
2072
|
+
return Promise.reject();
|
|
2073
|
+
}
|
|
2074
|
+
if (param == null && data.pages.length) {
|
|
2075
|
+
return Promise.resolve(data);
|
|
2076
|
+
}
|
|
2077
|
+
const createQueryFnContext = () => {
|
|
2078
|
+
const queryFnContext2 = {
|
|
2079
|
+
client: context.client,
|
|
2080
|
+
queryKey: context.queryKey,
|
|
2081
|
+
pageParam: param,
|
|
2082
|
+
direction: previous ? "backward" : "forward",
|
|
2083
|
+
meta: context.options.meta
|
|
2084
|
+
};
|
|
2085
|
+
addSignalProperty(queryFnContext2);
|
|
2086
|
+
return queryFnContext2;
|
|
2087
|
+
};
|
|
2088
|
+
const queryFnContext = createQueryFnContext();
|
|
2089
|
+
const page = await queryFn(queryFnContext);
|
|
2090
|
+
const { maxPages } = context.options;
|
|
2091
|
+
const addTo = previous ? addToStart : addToEnd;
|
|
2092
|
+
return {
|
|
2093
|
+
pages: addTo(data.pages, page, maxPages),
|
|
2094
|
+
pageParams: addTo(data.pageParams, param, maxPages)
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
if (direction && oldPages.length) {
|
|
2098
|
+
const previous = direction === "backward";
|
|
2099
|
+
const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
|
|
2100
|
+
const oldData = {
|
|
2101
|
+
pages: oldPages,
|
|
2102
|
+
pageParams: oldPageParams
|
|
2103
|
+
};
|
|
2104
|
+
const param = pageParamFn(options, oldData);
|
|
2105
|
+
result = await fetchPage(oldData, param, previous);
|
|
2106
|
+
} else {
|
|
2107
|
+
const remainingPages = pages ?? oldPages.length;
|
|
2108
|
+
do {
|
|
2109
|
+
const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
|
|
2110
|
+
if (currentPage > 0 && param == null) {
|
|
2111
|
+
break;
|
|
2112
|
+
}
|
|
2113
|
+
result = await fetchPage(result, param);
|
|
2114
|
+
currentPage++;
|
|
2115
|
+
} while (currentPage < remainingPages);
|
|
2116
|
+
}
|
|
2117
|
+
return result;
|
|
2118
|
+
};
|
|
2119
|
+
if (context.options.persister) {
|
|
2120
|
+
context.fetchFn = () => {
|
|
2121
|
+
return context.options.persister?.(
|
|
2122
|
+
fetchFn,
|
|
2123
|
+
{
|
|
2124
|
+
client: context.client,
|
|
2125
|
+
queryKey: context.queryKey,
|
|
2126
|
+
meta: context.options.meta,
|
|
2127
|
+
signal: context.signal
|
|
2128
|
+
},
|
|
2129
|
+
query
|
|
2130
|
+
);
|
|
2131
|
+
};
|
|
2132
|
+
} else {
|
|
2133
|
+
context.fetchFn = fetchFn;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
};
|
|
2137
|
+
}
|
|
2138
|
+
function getNextPageParam(options, { pages, pageParams }) {
|
|
2139
|
+
const lastIndex = pages.length - 1;
|
|
2140
|
+
return pages.length > 0 ? options.getNextPageParam(
|
|
2141
|
+
pages[lastIndex],
|
|
2142
|
+
pages,
|
|
2143
|
+
pageParams[lastIndex],
|
|
2144
|
+
pageParams
|
|
2145
|
+
) : void 0;
|
|
2146
|
+
}
|
|
2147
|
+
function getPreviousPageParam(options, { pages, pageParams }) {
|
|
2148
|
+
return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
2152
|
+
var Mutation = class extends Removable {
|
|
2153
|
+
#client;
|
|
2154
|
+
#observers;
|
|
2155
|
+
#mutationCache;
|
|
2156
|
+
#retryer;
|
|
2157
|
+
constructor(config) {
|
|
2158
|
+
super();
|
|
2159
|
+
this.#client = config.client;
|
|
2160
|
+
this.mutationId = config.mutationId;
|
|
2161
|
+
this.#mutationCache = config.mutationCache;
|
|
2162
|
+
this.#observers = [];
|
|
2163
|
+
this.state = config.state || getDefaultState2();
|
|
2164
|
+
this.setOptions(config.options);
|
|
2165
|
+
this.scheduleGc();
|
|
2166
|
+
}
|
|
2167
|
+
setOptions(options) {
|
|
2168
|
+
this.options = options;
|
|
2169
|
+
this.updateGcTime(this.options.gcTime);
|
|
2170
|
+
}
|
|
2171
|
+
get meta() {
|
|
2172
|
+
return this.options.meta;
|
|
2173
|
+
}
|
|
2174
|
+
addObserver(observer) {
|
|
2175
|
+
if (!this.#observers.includes(observer)) {
|
|
2176
|
+
this.#observers.push(observer);
|
|
2177
|
+
this.clearGcTimeout();
|
|
2178
|
+
this.#mutationCache.notify({
|
|
2179
|
+
type: "observerAdded",
|
|
2180
|
+
mutation: this,
|
|
2181
|
+
observer
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
removeObserver(observer) {
|
|
2186
|
+
this.#observers = this.#observers.filter((x) => x !== observer);
|
|
2187
|
+
this.scheduleGc();
|
|
2188
|
+
this.#mutationCache.notify({
|
|
2189
|
+
type: "observerRemoved",
|
|
2190
|
+
mutation: this,
|
|
2191
|
+
observer
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
optionalRemove() {
|
|
2195
|
+
if (!this.#observers.length) {
|
|
2196
|
+
if (this.state.status === "pending") {
|
|
2197
|
+
this.scheduleGc();
|
|
2198
|
+
} else {
|
|
2199
|
+
this.#mutationCache.remove(this);
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
continue() {
|
|
2204
|
+
return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
2205
|
+
this.execute(this.state.variables);
|
|
2206
|
+
}
|
|
2207
|
+
async execute(variables) {
|
|
2208
|
+
const onContinue = () => {
|
|
2209
|
+
this.#dispatch({ type: "continue" });
|
|
2210
|
+
};
|
|
2211
|
+
const mutationFnContext = {
|
|
2212
|
+
client: this.#client,
|
|
2213
|
+
meta: this.options.meta,
|
|
2214
|
+
mutationKey: this.options.mutationKey
|
|
2215
|
+
};
|
|
2216
|
+
this.#retryer = createRetryer({
|
|
2217
|
+
fn: () => {
|
|
2218
|
+
if (!this.options.mutationFn) {
|
|
2219
|
+
return Promise.reject(new Error("No mutationFn found"));
|
|
2220
|
+
}
|
|
2221
|
+
return this.options.mutationFn(variables, mutationFnContext);
|
|
2222
|
+
},
|
|
2223
|
+
onFail: (failureCount, error) => {
|
|
2224
|
+
this.#dispatch({ type: "failed", failureCount, error });
|
|
2225
|
+
},
|
|
2226
|
+
onPause: () => {
|
|
2227
|
+
this.#dispatch({ type: "pause" });
|
|
2228
|
+
},
|
|
2229
|
+
onContinue,
|
|
2230
|
+
retry: this.options.retry ?? 0,
|
|
2231
|
+
retryDelay: this.options.retryDelay,
|
|
2232
|
+
networkMode: this.options.networkMode,
|
|
2233
|
+
canRun: () => this.#mutationCache.canRun(this)
|
|
2234
|
+
});
|
|
2235
|
+
const restored = this.state.status === "pending";
|
|
2236
|
+
const isPaused = !this.#retryer.canStart();
|
|
2237
|
+
try {
|
|
2238
|
+
if (restored) {
|
|
2239
|
+
onContinue();
|
|
2240
|
+
} else {
|
|
2241
|
+
this.#dispatch({ type: "pending", variables, isPaused });
|
|
2242
|
+
if (this.#mutationCache.config.onMutate) {
|
|
2243
|
+
await this.#mutationCache.config.onMutate(
|
|
2244
|
+
variables,
|
|
2245
|
+
this,
|
|
2246
|
+
mutationFnContext
|
|
2247
|
+
);
|
|
2248
|
+
}
|
|
2249
|
+
const context = await this.options.onMutate?.(
|
|
2250
|
+
variables,
|
|
2251
|
+
mutationFnContext
|
|
2252
|
+
);
|
|
2253
|
+
if (context !== this.state.context) {
|
|
2254
|
+
this.#dispatch({
|
|
2255
|
+
type: "pending",
|
|
2256
|
+
context,
|
|
2257
|
+
variables,
|
|
2258
|
+
isPaused
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
const data = await this.#retryer.start();
|
|
2263
|
+
await this.#mutationCache.config.onSuccess?.(
|
|
2264
|
+
data,
|
|
2265
|
+
variables,
|
|
2266
|
+
this.state.context,
|
|
2267
|
+
this,
|
|
2268
|
+
mutationFnContext
|
|
2269
|
+
);
|
|
2270
|
+
await this.options.onSuccess?.(
|
|
2271
|
+
data,
|
|
2272
|
+
variables,
|
|
2273
|
+
this.state.context,
|
|
2274
|
+
mutationFnContext
|
|
2275
|
+
);
|
|
2276
|
+
await this.#mutationCache.config.onSettled?.(
|
|
2277
|
+
data,
|
|
2278
|
+
null,
|
|
2279
|
+
this.state.variables,
|
|
2280
|
+
this.state.context,
|
|
2281
|
+
this,
|
|
2282
|
+
mutationFnContext
|
|
2283
|
+
);
|
|
2284
|
+
await this.options.onSettled?.(
|
|
2285
|
+
data,
|
|
2286
|
+
null,
|
|
2287
|
+
variables,
|
|
2288
|
+
this.state.context,
|
|
2289
|
+
mutationFnContext
|
|
2290
|
+
);
|
|
2291
|
+
this.#dispatch({ type: "success", data });
|
|
2292
|
+
return data;
|
|
2293
|
+
} catch (error) {
|
|
2294
|
+
try {
|
|
2295
|
+
await this.#mutationCache.config.onError?.(
|
|
2296
|
+
error,
|
|
2297
|
+
variables,
|
|
2298
|
+
this.state.context,
|
|
2299
|
+
this,
|
|
2300
|
+
mutationFnContext
|
|
2301
|
+
);
|
|
2302
|
+
} catch (e) {
|
|
2303
|
+
void Promise.reject(e);
|
|
2304
|
+
}
|
|
2305
|
+
try {
|
|
2306
|
+
await this.options.onError?.(
|
|
2307
|
+
error,
|
|
2308
|
+
variables,
|
|
2309
|
+
this.state.context,
|
|
2310
|
+
mutationFnContext
|
|
2311
|
+
);
|
|
2312
|
+
} catch (e) {
|
|
2313
|
+
void Promise.reject(e);
|
|
2314
|
+
}
|
|
2315
|
+
try {
|
|
2316
|
+
await this.#mutationCache.config.onSettled?.(
|
|
2317
|
+
void 0,
|
|
2318
|
+
error,
|
|
2319
|
+
this.state.variables,
|
|
2320
|
+
this.state.context,
|
|
2321
|
+
this,
|
|
2322
|
+
mutationFnContext
|
|
2323
|
+
);
|
|
2324
|
+
} catch (e) {
|
|
2325
|
+
void Promise.reject(e);
|
|
2326
|
+
}
|
|
2327
|
+
try {
|
|
2328
|
+
await this.options.onSettled?.(
|
|
2329
|
+
void 0,
|
|
2330
|
+
error,
|
|
2331
|
+
variables,
|
|
2332
|
+
this.state.context,
|
|
2333
|
+
mutationFnContext
|
|
2334
|
+
);
|
|
2335
|
+
} catch (e) {
|
|
2336
|
+
void Promise.reject(e);
|
|
2337
|
+
}
|
|
2338
|
+
this.#dispatch({ type: "error", error });
|
|
2339
|
+
throw error;
|
|
2340
|
+
} finally {
|
|
2341
|
+
this.#mutationCache.runNext(this);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
#dispatch(action) {
|
|
2345
|
+
const reducer = (state) => {
|
|
2346
|
+
switch (action.type) {
|
|
2347
|
+
case "failed":
|
|
2348
|
+
return {
|
|
2349
|
+
...state,
|
|
2350
|
+
failureCount: action.failureCount,
|
|
2351
|
+
failureReason: action.error
|
|
2352
|
+
};
|
|
2353
|
+
case "pause":
|
|
2354
|
+
return {
|
|
2355
|
+
...state,
|
|
2356
|
+
isPaused: true
|
|
2357
|
+
};
|
|
2358
|
+
case "continue":
|
|
2359
|
+
return {
|
|
2360
|
+
...state,
|
|
2361
|
+
isPaused: false
|
|
2362
|
+
};
|
|
2363
|
+
case "pending":
|
|
2364
|
+
return {
|
|
2365
|
+
...state,
|
|
2366
|
+
context: action.context,
|
|
2367
|
+
data: void 0,
|
|
2368
|
+
failureCount: 0,
|
|
2369
|
+
failureReason: null,
|
|
2370
|
+
error: null,
|
|
2371
|
+
isPaused: action.isPaused,
|
|
2372
|
+
status: "pending",
|
|
2373
|
+
variables: action.variables,
|
|
2374
|
+
submittedAt: Date.now()
|
|
2375
|
+
};
|
|
2376
|
+
case "success":
|
|
2377
|
+
return {
|
|
2378
|
+
...state,
|
|
2379
|
+
data: action.data,
|
|
2380
|
+
failureCount: 0,
|
|
2381
|
+
failureReason: null,
|
|
2382
|
+
error: null,
|
|
2383
|
+
status: "success",
|
|
2384
|
+
isPaused: false
|
|
2385
|
+
};
|
|
2386
|
+
case "error":
|
|
2387
|
+
return {
|
|
2388
|
+
...state,
|
|
2389
|
+
data: void 0,
|
|
2390
|
+
error: action.error,
|
|
2391
|
+
failureCount: state.failureCount + 1,
|
|
2392
|
+
failureReason: action.error,
|
|
2393
|
+
isPaused: false,
|
|
2394
|
+
status: "error"
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2397
|
+
};
|
|
2398
|
+
this.state = reducer(this.state);
|
|
2399
|
+
notifyManager.batch(() => {
|
|
2400
|
+
this.#observers.forEach((observer) => {
|
|
2401
|
+
observer.onMutationUpdate(action);
|
|
2402
|
+
});
|
|
2403
|
+
this.#mutationCache.notify({
|
|
2404
|
+
mutation: this,
|
|
2405
|
+
type: "updated",
|
|
2406
|
+
action
|
|
2407
|
+
});
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
function getDefaultState2() {
|
|
2412
|
+
return {
|
|
2413
|
+
context: void 0,
|
|
2414
|
+
data: void 0,
|
|
2415
|
+
error: null,
|
|
2416
|
+
failureCount: 0,
|
|
2417
|
+
failureReason: null,
|
|
2418
|
+
isPaused: false,
|
|
2419
|
+
status: "idle",
|
|
2420
|
+
variables: void 0,
|
|
2421
|
+
submittedAt: 0
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationCache.js
|
|
2426
|
+
var MutationCache = class extends Subscribable {
|
|
2427
|
+
constructor(config = {}) {
|
|
2428
|
+
super();
|
|
2429
|
+
this.config = config;
|
|
2430
|
+
this.#mutations = /* @__PURE__ */ new Set();
|
|
2431
|
+
this.#scopes = /* @__PURE__ */ new Map();
|
|
2432
|
+
this.#mutationId = 0;
|
|
2433
|
+
}
|
|
2434
|
+
#mutations;
|
|
2435
|
+
#scopes;
|
|
2436
|
+
#mutationId;
|
|
2437
|
+
build(client, options, state) {
|
|
2438
|
+
const mutation = new Mutation({
|
|
2439
|
+
client,
|
|
2440
|
+
mutationCache: this,
|
|
2441
|
+
mutationId: ++this.#mutationId,
|
|
2442
|
+
options: client.defaultMutationOptions(options),
|
|
2443
|
+
state
|
|
2444
|
+
});
|
|
2445
|
+
this.add(mutation);
|
|
2446
|
+
return mutation;
|
|
2447
|
+
}
|
|
2448
|
+
add(mutation) {
|
|
2449
|
+
this.#mutations.add(mutation);
|
|
2450
|
+
const scope = scopeFor(mutation);
|
|
2451
|
+
if (typeof scope === "string") {
|
|
2452
|
+
const scopedMutations = this.#scopes.get(scope);
|
|
2453
|
+
if (scopedMutations) {
|
|
2454
|
+
scopedMutations.push(mutation);
|
|
2455
|
+
} else {
|
|
2456
|
+
this.#scopes.set(scope, [mutation]);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
this.notify({ type: "added", mutation });
|
|
2460
|
+
}
|
|
2461
|
+
remove(mutation) {
|
|
2462
|
+
if (this.#mutations.delete(mutation)) {
|
|
2463
|
+
const scope = scopeFor(mutation);
|
|
2464
|
+
if (typeof scope === "string") {
|
|
2465
|
+
const scopedMutations = this.#scopes.get(scope);
|
|
2466
|
+
if (scopedMutations) {
|
|
2467
|
+
if (scopedMutations.length > 1) {
|
|
2468
|
+
const index = scopedMutations.indexOf(mutation);
|
|
2469
|
+
if (index !== -1) {
|
|
2470
|
+
scopedMutations.splice(index, 1);
|
|
2471
|
+
}
|
|
2472
|
+
} else if (scopedMutations[0] === mutation) {
|
|
2473
|
+
this.#scopes.delete(scope);
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
this.notify({ type: "removed", mutation });
|
|
2479
|
+
}
|
|
2480
|
+
canRun(mutation) {
|
|
2481
|
+
const scope = scopeFor(mutation);
|
|
2482
|
+
if (typeof scope === "string") {
|
|
2483
|
+
const mutationsWithSameScope = this.#scopes.get(scope);
|
|
2484
|
+
const firstPendingMutation = mutationsWithSameScope?.find(
|
|
2485
|
+
(m) => m.state.status === "pending"
|
|
2486
|
+
);
|
|
2487
|
+
return !firstPendingMutation || firstPendingMutation === mutation;
|
|
2488
|
+
} else {
|
|
2489
|
+
return true;
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
runNext(mutation) {
|
|
2493
|
+
const scope = scopeFor(mutation);
|
|
2494
|
+
if (typeof scope === "string") {
|
|
2495
|
+
const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused);
|
|
2496
|
+
return foundMutation?.continue() ?? Promise.resolve();
|
|
2497
|
+
} else {
|
|
2498
|
+
return Promise.resolve();
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
clear() {
|
|
2502
|
+
notifyManager.batch(() => {
|
|
2503
|
+
this.#mutations.forEach((mutation) => {
|
|
2504
|
+
this.notify({ type: "removed", mutation });
|
|
2505
|
+
});
|
|
2506
|
+
this.#mutations.clear();
|
|
2507
|
+
this.#scopes.clear();
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
getAll() {
|
|
2511
|
+
return Array.from(this.#mutations);
|
|
2512
|
+
}
|
|
2513
|
+
find(filters) {
|
|
2514
|
+
const defaultedFilters = { exact: true, ...filters };
|
|
2515
|
+
return this.getAll().find(
|
|
2516
|
+
(mutation) => matchMutation(defaultedFilters, mutation)
|
|
2517
|
+
);
|
|
2518
|
+
}
|
|
2519
|
+
findAll(filters = {}) {
|
|
2520
|
+
return this.getAll().filter((mutation) => matchMutation(filters, mutation));
|
|
2521
|
+
}
|
|
2522
|
+
notify(event) {
|
|
2523
|
+
notifyManager.batch(() => {
|
|
2524
|
+
this.listeners.forEach((listener) => {
|
|
2525
|
+
listener(event);
|
|
2526
|
+
});
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
resumePausedMutations() {
|
|
2530
|
+
const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
|
|
2531
|
+
return notifyManager.batch(
|
|
2532
|
+
() => Promise.all(
|
|
2533
|
+
pausedMutations.map((mutation) => mutation.continue().catch(noop))
|
|
2534
|
+
)
|
|
2535
|
+
);
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
function scopeFor(mutation) {
|
|
2539
|
+
return mutation.options.scope?.id;
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryCache.js
|
|
2543
|
+
var QueryCache = class extends Subscribable {
|
|
2544
|
+
constructor(config = {}) {
|
|
2545
|
+
super();
|
|
2546
|
+
this.config = config;
|
|
2547
|
+
this.#queries = /* @__PURE__ */ new Map();
|
|
2548
|
+
}
|
|
2549
|
+
#queries;
|
|
2550
|
+
build(client, options, state) {
|
|
2551
|
+
const queryKey = options.queryKey;
|
|
2552
|
+
const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
|
|
2553
|
+
let query = this.get(queryHash);
|
|
2554
|
+
if (!query) {
|
|
2555
|
+
query = new Query({
|
|
2556
|
+
client,
|
|
2557
|
+
queryKey,
|
|
2558
|
+
queryHash,
|
|
2559
|
+
options: client.defaultQueryOptions(options),
|
|
2560
|
+
state,
|
|
2561
|
+
defaultOptions: client.getQueryDefaults(queryKey)
|
|
2562
|
+
});
|
|
2563
|
+
this.add(query);
|
|
2564
|
+
}
|
|
2565
|
+
return query;
|
|
2566
|
+
}
|
|
2567
|
+
add(query) {
|
|
2568
|
+
if (!this.#queries.has(query.queryHash)) {
|
|
2569
|
+
this.#queries.set(query.queryHash, query);
|
|
2570
|
+
this.notify({
|
|
2571
|
+
type: "added",
|
|
2572
|
+
query
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
remove(query) {
|
|
2577
|
+
const queryInMap = this.#queries.get(query.queryHash);
|
|
2578
|
+
if (queryInMap) {
|
|
2579
|
+
query.destroy();
|
|
2580
|
+
if (queryInMap === query) {
|
|
2581
|
+
this.#queries.delete(query.queryHash);
|
|
2582
|
+
}
|
|
2583
|
+
this.notify({ type: "removed", query });
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
clear() {
|
|
2587
|
+
notifyManager.batch(() => {
|
|
2588
|
+
this.getAll().forEach((query) => {
|
|
2589
|
+
this.remove(query);
|
|
2590
|
+
});
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
get(queryHash) {
|
|
2594
|
+
return this.#queries.get(queryHash);
|
|
2595
|
+
}
|
|
2596
|
+
getAll() {
|
|
2597
|
+
return [...this.#queries.values()];
|
|
2598
|
+
}
|
|
2599
|
+
find(filters) {
|
|
2600
|
+
const defaultedFilters = { exact: true, ...filters };
|
|
2601
|
+
return this.getAll().find(
|
|
2602
|
+
(query) => matchQuery(defaultedFilters, query)
|
|
2603
|
+
);
|
|
2604
|
+
}
|
|
2605
|
+
findAll(filters = {}) {
|
|
2606
|
+
const queries = this.getAll();
|
|
2607
|
+
return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
|
|
2608
|
+
}
|
|
2609
|
+
notify(event) {
|
|
2610
|
+
notifyManager.batch(() => {
|
|
2611
|
+
this.listeners.forEach((listener) => {
|
|
2612
|
+
listener(event);
|
|
2613
|
+
});
|
|
2614
|
+
});
|
|
2615
|
+
}
|
|
2616
|
+
onFocus() {
|
|
2617
|
+
notifyManager.batch(() => {
|
|
2618
|
+
this.getAll().forEach((query) => {
|
|
2619
|
+
query.onFocus();
|
|
2620
|
+
});
|
|
2621
|
+
});
|
|
2622
|
+
}
|
|
2623
|
+
onOnline() {
|
|
2624
|
+
notifyManager.batch(() => {
|
|
2625
|
+
this.getAll().forEach((query) => {
|
|
2626
|
+
query.onOnline();
|
|
2627
|
+
});
|
|
2628
|
+
});
|
|
2629
|
+
}
|
|
2630
|
+
};
|
|
2631
|
+
|
|
2632
|
+
// ../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryClient.js
|
|
2633
|
+
var QueryClient = class {
|
|
2634
|
+
#queryCache;
|
|
2635
|
+
#mutationCache;
|
|
2636
|
+
#defaultOptions;
|
|
2637
|
+
#queryDefaults;
|
|
2638
|
+
#mutationDefaults;
|
|
2639
|
+
#mountCount;
|
|
2640
|
+
#unsubscribeFocus;
|
|
2641
|
+
#unsubscribeOnline;
|
|
2642
|
+
constructor(config = {}) {
|
|
2643
|
+
this.#queryCache = config.queryCache || new QueryCache();
|
|
2644
|
+
this.#mutationCache = config.mutationCache || new MutationCache();
|
|
2645
|
+
this.#defaultOptions = config.defaultOptions || {};
|
|
2646
|
+
this.#queryDefaults = /* @__PURE__ */ new Map();
|
|
2647
|
+
this.#mutationDefaults = /* @__PURE__ */ new Map();
|
|
2648
|
+
this.#mountCount = 0;
|
|
2649
|
+
}
|
|
2650
|
+
mount() {
|
|
2651
|
+
this.#mountCount++;
|
|
2652
|
+
if (this.#mountCount !== 1) return;
|
|
2653
|
+
this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {
|
|
2654
|
+
if (focused) {
|
|
2655
|
+
await this.resumePausedMutations();
|
|
2656
|
+
this.#queryCache.onFocus();
|
|
2657
|
+
}
|
|
2658
|
+
});
|
|
2659
|
+
this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {
|
|
2660
|
+
if (online) {
|
|
2661
|
+
await this.resumePausedMutations();
|
|
2662
|
+
this.#queryCache.onOnline();
|
|
2663
|
+
}
|
|
2664
|
+
});
|
|
2665
|
+
}
|
|
2666
|
+
unmount() {
|
|
2667
|
+
this.#mountCount--;
|
|
2668
|
+
if (this.#mountCount !== 0) return;
|
|
2669
|
+
this.#unsubscribeFocus?.();
|
|
2670
|
+
this.#unsubscribeFocus = void 0;
|
|
2671
|
+
this.#unsubscribeOnline?.();
|
|
2672
|
+
this.#unsubscribeOnline = void 0;
|
|
2673
|
+
}
|
|
2674
|
+
isFetching(filters) {
|
|
2675
|
+
return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length;
|
|
2676
|
+
}
|
|
2677
|
+
isMutating(filters) {
|
|
2678
|
+
return this.#mutationCache.findAll({ ...filters, status: "pending" }).length;
|
|
2679
|
+
}
|
|
2680
|
+
/**
|
|
2681
|
+
* Imperative (non-reactive) way to retrieve data for a QueryKey.
|
|
2682
|
+
* Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
|
|
2683
|
+
*
|
|
2684
|
+
* Hint: Do not use this function inside a component, because it won't receive updates.
|
|
2685
|
+
* Use `useQuery` to create a `QueryObserver` that subscribes to changes.
|
|
2686
|
+
*/
|
|
2687
|
+
getQueryData(queryKey) {
|
|
2688
|
+
const options = this.defaultQueryOptions({ queryKey });
|
|
2689
|
+
return this.#queryCache.get(options.queryHash)?.state.data;
|
|
2690
|
+
}
|
|
2691
|
+
ensureQueryData(options) {
|
|
2692
|
+
const defaultedOptions = this.defaultQueryOptions(options);
|
|
2693
|
+
const query = this.#queryCache.build(this, defaultedOptions);
|
|
2694
|
+
const cachedData = query.state.data;
|
|
2695
|
+
if (cachedData === void 0) {
|
|
2696
|
+
return this.fetchQuery(options);
|
|
2697
|
+
}
|
|
2698
|
+
if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {
|
|
2699
|
+
void this.prefetchQuery(defaultedOptions);
|
|
2700
|
+
}
|
|
2701
|
+
return Promise.resolve(cachedData);
|
|
2702
|
+
}
|
|
2703
|
+
getQueriesData(filters) {
|
|
2704
|
+
return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
|
|
2705
|
+
const data = state.data;
|
|
2706
|
+
return [queryKey, data];
|
|
2707
|
+
});
|
|
2708
|
+
}
|
|
2709
|
+
setQueryData(queryKey, updater, options) {
|
|
2710
|
+
const defaultedOptions = this.defaultQueryOptions({ queryKey });
|
|
2711
|
+
const query = this.#queryCache.get(
|
|
2712
|
+
defaultedOptions.queryHash
|
|
2713
|
+
);
|
|
2714
|
+
const prevData = query?.state.data;
|
|
2715
|
+
const data = functionalUpdate(updater, prevData);
|
|
2716
|
+
if (data === void 0) {
|
|
2717
|
+
return void 0;
|
|
2718
|
+
}
|
|
2719
|
+
return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });
|
|
2720
|
+
}
|
|
2721
|
+
setQueriesData(filters, updater, options) {
|
|
2722
|
+
return notifyManager.batch(
|
|
2723
|
+
() => this.#queryCache.findAll(filters).map(({ queryKey }) => [
|
|
2724
|
+
queryKey,
|
|
2725
|
+
this.setQueryData(queryKey, updater, options)
|
|
2726
|
+
])
|
|
2727
|
+
);
|
|
2728
|
+
}
|
|
2729
|
+
getQueryState(queryKey) {
|
|
2730
|
+
const options = this.defaultQueryOptions({ queryKey });
|
|
2731
|
+
return this.#queryCache.get(
|
|
2732
|
+
options.queryHash
|
|
2733
|
+
)?.state;
|
|
2734
|
+
}
|
|
2735
|
+
removeQueries(filters) {
|
|
2736
|
+
const queryCache = this.#queryCache;
|
|
2737
|
+
notifyManager.batch(() => {
|
|
2738
|
+
queryCache.findAll(filters).forEach((query) => {
|
|
2739
|
+
queryCache.remove(query);
|
|
2740
|
+
});
|
|
2741
|
+
});
|
|
2742
|
+
}
|
|
2743
|
+
resetQueries(filters, options) {
|
|
2744
|
+
const queryCache = this.#queryCache;
|
|
2745
|
+
return notifyManager.batch(() => {
|
|
2746
|
+
queryCache.findAll(filters).forEach((query) => {
|
|
2747
|
+
query.reset();
|
|
2748
|
+
});
|
|
2749
|
+
return this.refetchQueries(
|
|
2750
|
+
{
|
|
2751
|
+
type: "active",
|
|
2752
|
+
...filters
|
|
2753
|
+
},
|
|
2754
|
+
options
|
|
2755
|
+
);
|
|
2756
|
+
});
|
|
2757
|
+
}
|
|
2758
|
+
cancelQueries(filters, cancelOptions = {}) {
|
|
2759
|
+
const defaultedCancelOptions = { revert: true, ...cancelOptions };
|
|
2760
|
+
const promises = notifyManager.batch(
|
|
2761
|
+
() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))
|
|
2762
|
+
);
|
|
2763
|
+
return Promise.all(promises).then(noop).catch(noop);
|
|
2764
|
+
}
|
|
2765
|
+
invalidateQueries(filters, options = {}) {
|
|
2766
|
+
return notifyManager.batch(() => {
|
|
2767
|
+
this.#queryCache.findAll(filters).forEach((query) => {
|
|
2768
|
+
query.invalidate();
|
|
2769
|
+
});
|
|
2770
|
+
if (filters?.refetchType === "none") {
|
|
2771
|
+
return Promise.resolve();
|
|
2772
|
+
}
|
|
2773
|
+
return this.refetchQueries(
|
|
926
2774
|
{
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
level: level + 1,
|
|
930
|
-
onOpenChange
|
|
2775
|
+
...filters,
|
|
2776
|
+
type: filters?.refetchType ?? filters?.type ?? "active"
|
|
931
2777
|
},
|
|
932
|
-
|
|
933
|
-
)
|
|
934
|
-
|
|
2778
|
+
options
|
|
2779
|
+
);
|
|
2780
|
+
});
|
|
935
2781
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
2782
|
+
refetchQueries(filters, options = {}) {
|
|
2783
|
+
const fetchOptions = {
|
|
2784
|
+
...options,
|
|
2785
|
+
cancelRefetch: options.cancelRefetch ?? true
|
|
2786
|
+
};
|
|
2787
|
+
const promises = notifyManager.batch(
|
|
2788
|
+
() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
|
|
2789
|
+
let promise = query.fetch(void 0, fetchOptions);
|
|
2790
|
+
if (!fetchOptions.throwOnError) {
|
|
2791
|
+
promise = promise.catch(noop);
|
|
944
2792
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
item.title,
|
|
955
|
-
item.external && /* @__PURE__ */ jsx25(ArrowUpRightIcon2, { className: "ml-1 size-3.5 opacity-60" })
|
|
956
|
-
]
|
|
2793
|
+
return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
|
|
2794
|
+
})
|
|
2795
|
+
);
|
|
2796
|
+
return Promise.all(promises).then(noop);
|
|
2797
|
+
}
|
|
2798
|
+
fetchQuery(options) {
|
|
2799
|
+
const defaultedOptions = this.defaultQueryOptions(options);
|
|
2800
|
+
if (defaultedOptions.retry === void 0) {
|
|
2801
|
+
defaultedOptions.retry = false;
|
|
957
2802
|
}
|
|
958
|
-
|
|
959
|
-
|
|
2803
|
+
const query = this.#queryCache.build(this, defaultedOptions);
|
|
2804
|
+
return query.isStaleByTime(
|
|
2805
|
+
resolveStaleTime(defaultedOptions.staleTime, query)
|
|
2806
|
+
) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
|
|
2807
|
+
}
|
|
2808
|
+
prefetchQuery(options) {
|
|
2809
|
+
return this.fetchQuery(options).then(noop).catch(noop);
|
|
2810
|
+
}
|
|
2811
|
+
fetchInfiniteQuery(options) {
|
|
2812
|
+
options.behavior = infiniteQueryBehavior(options.pages);
|
|
2813
|
+
return this.fetchQuery(options);
|
|
2814
|
+
}
|
|
2815
|
+
prefetchInfiniteQuery(options) {
|
|
2816
|
+
return this.fetchInfiniteQuery(options).then(noop).catch(noop);
|
|
2817
|
+
}
|
|
2818
|
+
ensureInfiniteQueryData(options) {
|
|
2819
|
+
options.behavior = infiniteQueryBehavior(options.pages);
|
|
2820
|
+
return this.ensureQueryData(options);
|
|
2821
|
+
}
|
|
2822
|
+
resumePausedMutations() {
|
|
2823
|
+
if (onlineManager.isOnline()) {
|
|
2824
|
+
return this.#mutationCache.resumePausedMutations();
|
|
2825
|
+
}
|
|
2826
|
+
return Promise.resolve();
|
|
2827
|
+
}
|
|
2828
|
+
getQueryCache() {
|
|
2829
|
+
return this.#queryCache;
|
|
2830
|
+
}
|
|
2831
|
+
getMutationCache() {
|
|
2832
|
+
return this.#mutationCache;
|
|
2833
|
+
}
|
|
2834
|
+
getDefaultOptions() {
|
|
2835
|
+
return this.#defaultOptions;
|
|
2836
|
+
}
|
|
2837
|
+
setDefaultOptions(options) {
|
|
2838
|
+
this.#defaultOptions = options;
|
|
2839
|
+
}
|
|
2840
|
+
setQueryDefaults(queryKey, options) {
|
|
2841
|
+
this.#queryDefaults.set(hashKey(queryKey), {
|
|
2842
|
+
queryKey,
|
|
2843
|
+
defaultOptions: options
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
getQueryDefaults(queryKey) {
|
|
2847
|
+
const defaults = [...this.#queryDefaults.values()];
|
|
2848
|
+
const result = {};
|
|
2849
|
+
defaults.forEach((queryDefault) => {
|
|
2850
|
+
if (partialMatchKey(queryKey, queryDefault.queryKey)) {
|
|
2851
|
+
Object.assign(result, queryDefault.defaultOptions);
|
|
2852
|
+
}
|
|
2853
|
+
});
|
|
2854
|
+
return result;
|
|
2855
|
+
}
|
|
2856
|
+
setMutationDefaults(mutationKey, options) {
|
|
2857
|
+
this.#mutationDefaults.set(hashKey(mutationKey), {
|
|
2858
|
+
mutationKey,
|
|
2859
|
+
defaultOptions: options
|
|
2860
|
+
});
|
|
2861
|
+
}
|
|
2862
|
+
getMutationDefaults(mutationKey) {
|
|
2863
|
+
const defaults = [...this.#mutationDefaults.values()];
|
|
2864
|
+
const result = {};
|
|
2865
|
+
defaults.forEach((queryDefault) => {
|
|
2866
|
+
if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
|
|
2867
|
+
Object.assign(result, queryDefault.defaultOptions);
|
|
2868
|
+
}
|
|
2869
|
+
});
|
|
2870
|
+
return result;
|
|
2871
|
+
}
|
|
2872
|
+
defaultQueryOptions(options) {
|
|
2873
|
+
if (options._defaulted) {
|
|
2874
|
+
return options;
|
|
2875
|
+
}
|
|
2876
|
+
const defaultedOptions = {
|
|
2877
|
+
...this.#defaultOptions.queries,
|
|
2878
|
+
...this.getQueryDefaults(options.queryKey),
|
|
2879
|
+
...options,
|
|
2880
|
+
_defaulted: true
|
|
2881
|
+
};
|
|
2882
|
+
if (!defaultedOptions.queryHash) {
|
|
2883
|
+
defaultedOptions.queryHash = hashQueryKeyByOptions(
|
|
2884
|
+
defaultedOptions.queryKey,
|
|
2885
|
+
defaultedOptions
|
|
2886
|
+
);
|
|
2887
|
+
}
|
|
2888
|
+
if (defaultedOptions.refetchOnReconnect === void 0) {
|
|
2889
|
+
defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
|
|
2890
|
+
}
|
|
2891
|
+
if (defaultedOptions.throwOnError === void 0) {
|
|
2892
|
+
defaultedOptions.throwOnError = !!defaultedOptions.suspense;
|
|
2893
|
+
}
|
|
2894
|
+
if (!defaultedOptions.networkMode && defaultedOptions.persister) {
|
|
2895
|
+
defaultedOptions.networkMode = "offlineFirst";
|
|
2896
|
+
}
|
|
2897
|
+
if (defaultedOptions.queryFn === skipToken) {
|
|
2898
|
+
defaultedOptions.enabled = false;
|
|
2899
|
+
}
|
|
2900
|
+
return defaultedOptions;
|
|
2901
|
+
}
|
|
2902
|
+
defaultMutationOptions(options) {
|
|
2903
|
+
if (options?._defaulted) {
|
|
2904
|
+
return options;
|
|
2905
|
+
}
|
|
2906
|
+
return {
|
|
2907
|
+
...this.#defaultOptions.mutations,
|
|
2908
|
+
...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
|
|
2909
|
+
...options,
|
|
2910
|
+
_defaulted: true
|
|
2911
|
+
};
|
|
2912
|
+
}
|
|
2913
|
+
clear() {
|
|
2914
|
+
this.#queryCache.clear();
|
|
2915
|
+
this.#mutationCache.clear();
|
|
2916
|
+
}
|
|
2917
|
+
};
|
|
2918
|
+
|
|
2919
|
+
// ../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
|
|
2920
|
+
import * as React2 from "react";
|
|
2921
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2922
|
+
var QueryClientContext = React2.createContext(
|
|
2923
|
+
void 0
|
|
2924
|
+
);
|
|
2925
|
+
var QueryClientProvider = ({
|
|
2926
|
+
client,
|
|
2927
|
+
children
|
|
2928
|
+
}) => {
|
|
2929
|
+
React2.useEffect(() => {
|
|
2930
|
+
client.mount();
|
|
2931
|
+
return () => {
|
|
2932
|
+
client.unmount();
|
|
2933
|
+
};
|
|
2934
|
+
}, [client]);
|
|
2935
|
+
return /* @__PURE__ */ jsx26(QueryClientContext.Provider, { value: client, children });
|
|
2936
|
+
};
|
|
960
2937
|
|
|
961
2938
|
// src/components/providers/query-provider.tsx
|
|
962
|
-
import {
|
|
963
|
-
import { QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
964
|
-
import { CircleAlertIcon as CircleAlertIcon2 } from "lucide-react";
|
|
965
|
-
import { toast as toast2 } from "sonner";
|
|
966
|
-
import { Alert as Alert2, AlertIcon as AlertIcon2, AlertTitle as AlertTitle2 } from "@pelatform/ui.default";
|
|
967
|
-
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2939
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
968
2940
|
var QueryProvider = ({
|
|
969
2941
|
client: clientProps,
|
|
970
2942
|
children
|
|
@@ -1011,10 +2983,10 @@ var QueryProvider = ({
|
|
|
1011
2983
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1012
2984
|
});
|
|
1013
2985
|
}
|
|
1014
|
-
|
|
1015
|
-
() => /* @__PURE__ */ jsxs17(
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
2986
|
+
toast.custom(
|
|
2987
|
+
() => /* @__PURE__ */ jsxs17(Alert, { variant: "default", children: [
|
|
2988
|
+
/* @__PURE__ */ jsx27(CircleAlert, {}),
|
|
2989
|
+
/* @__PURE__ */ jsx27(AlertTitle, { children: message })
|
|
1018
2990
|
] }),
|
|
1019
2991
|
{
|
|
1020
2992
|
position: "top-center",
|
|
@@ -1028,17 +3000,14 @@ var QueryProvider = ({
|
|
|
1028
3000
|
})
|
|
1029
3001
|
})
|
|
1030
3002
|
);
|
|
1031
|
-
return /* @__PURE__ */
|
|
3003
|
+
return /* @__PURE__ */ jsx27(QueryClientProvider, { client: clientProps ?? queryClient, children });
|
|
1032
3004
|
};
|
|
1033
3005
|
|
|
1034
3006
|
// src/components/providers/theme-provider.tsx
|
|
1035
|
-
import {
|
|
1036
|
-
import { TooltipProvider } from "@pelatform/ui.default";
|
|
1037
|
-
import { DEFAULT_THEME_MODE, THEME_MODES } from "@pelatform/utils";
|
|
1038
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
3007
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1039
3008
|
function ThemeProvider({ children, ...props }) {
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
|
|
3009
|
+
return /* @__PURE__ */ jsx28(
|
|
3010
|
+
J,
|
|
1042
3011
|
{
|
|
1043
3012
|
attribute: "class",
|
|
1044
3013
|
defaultTheme: DEFAULT_THEME_MODE,
|
|
@@ -1048,25 +3017,23 @@ function ThemeProvider({ children, ...props }) {
|
|
|
1048
3017
|
storageKey: "theme",
|
|
1049
3018
|
themes: [THEME_MODES.LIGHT, THEME_MODES.DARK, THEME_MODES.SYSTEM],
|
|
1050
3019
|
...props,
|
|
1051
|
-
children: /* @__PURE__ */
|
|
3020
|
+
children: /* @__PURE__ */ jsx28(TooltipProvider, { delay: 0, children })
|
|
1052
3021
|
}
|
|
1053
3022
|
);
|
|
1054
3023
|
}
|
|
1055
3024
|
|
|
1056
3025
|
// src/components/ui/announcement.tsx
|
|
1057
|
-
import {
|
|
1058
|
-
import { cn as cn21 } from "@pelatform/utils";
|
|
1059
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3026
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1060
3027
|
var Announcement = ({
|
|
1061
3028
|
variant = "outline",
|
|
1062
3029
|
themed = false,
|
|
1063
3030
|
className,
|
|
1064
3031
|
...props
|
|
1065
|
-
}) => /* @__PURE__ */
|
|
1066
|
-
|
|
3032
|
+
}) => /* @__PURE__ */ jsx29(
|
|
3033
|
+
Badge,
|
|
1067
3034
|
{
|
|
1068
3035
|
variant,
|
|
1069
|
-
className:
|
|
3036
|
+
className: cn(
|
|
1070
3037
|
"group max-w-full gap-2 rounded-full bg-background px-3 py-0.5 font-medium shadow-sm transition-all",
|
|
1071
3038
|
"hover:shadow-md",
|
|
1072
3039
|
themed && "announcement-themed border-foreground/5",
|
|
@@ -1075,10 +3042,10 @@ var Announcement = ({
|
|
|
1075
3042
|
...props
|
|
1076
3043
|
}
|
|
1077
3044
|
);
|
|
1078
|
-
var AnnouncementTag = ({ className, ...props }) => /* @__PURE__ */
|
|
3045
|
+
var AnnouncementTag = ({ className, ...props }) => /* @__PURE__ */ jsx29(
|
|
1079
3046
|
"div",
|
|
1080
3047
|
{
|
|
1081
|
-
className:
|
|
3048
|
+
className: cn(
|
|
1082
3049
|
"-ml-2.5 shrink-0 truncate rounded-full bg-foreground/5 px-2.5 py-1 text-xs",
|
|
1083
3050
|
"group-[.announcement-themed]:bg-background/60",
|
|
1084
3051
|
className
|
|
@@ -1086,12 +3053,10 @@ var AnnouncementTag = ({ className, ...props }) => /* @__PURE__ */ jsx28(
|
|
|
1086
3053
|
...props
|
|
1087
3054
|
}
|
|
1088
3055
|
);
|
|
1089
|
-
var AnnouncementTitle = ({ className, ...props }) => /* @__PURE__ */
|
|
3056
|
+
var AnnouncementTitle = ({ className, ...props }) => /* @__PURE__ */ jsx29("div", { className: cn("flex items-center gap-1 truncate py-1", className), ...props });
|
|
1090
3057
|
|
|
1091
3058
|
// src/components/ui/background-paths.tsx
|
|
1092
|
-
import {
|
|
1093
|
-
import { cn as cn22 } from "@pelatform/utils";
|
|
1094
|
-
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3059
|
+
import { jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1095
3060
|
function FloatingPaths({
|
|
1096
3061
|
position,
|
|
1097
3062
|
color = "text-slate-950 dark:text-white"
|
|
@@ -1102,7 +3067,7 @@ function FloatingPaths({
|
|
|
1102
3067
|
color: `rgba(15,23,42,${0.1 + i * 0.03})`,
|
|
1103
3068
|
width: 0.5 + i * 0.03
|
|
1104
3069
|
}));
|
|
1105
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ jsx30("div", { className: "pointer-events-none absolute inset-0 -z-50", children: /* @__PURE__ */ jsx30("svg", { className: cn("h-full w-full", color), viewBox: "0 0 696 316", fill: "none", children: paths.map((path) => /* @__PURE__ */ jsx30(
|
|
1106
3071
|
motion.path,
|
|
1107
3072
|
{
|
|
1108
3073
|
d: path.d,
|
|
@@ -1125,15 +3090,14 @@ function FloatingPaths({
|
|
|
1125
3090
|
)) }) });
|
|
1126
3091
|
}
|
|
1127
3092
|
function BackgroundPaths({ color = "text-slate-950 dark:text-white" }) {
|
|
1128
|
-
return /* @__PURE__ */
|
|
1129
|
-
/* @__PURE__ */
|
|
1130
|
-
/* @__PURE__ */
|
|
3093
|
+
return /* @__PURE__ */ jsx30("div", { className: "relative flex min-h-screen w-full items-center justify-center overflow-hidden bg-white dark:bg-neutral-950", children: /* @__PURE__ */ jsxs18("div", { className: "absolute inset-0", children: [
|
|
3094
|
+
/* @__PURE__ */ jsx30(FloatingPaths, { position: 1, color }),
|
|
3095
|
+
/* @__PURE__ */ jsx30(FloatingPaths, { position: -1, color })
|
|
1131
3096
|
] }) });
|
|
1132
3097
|
}
|
|
1133
3098
|
|
|
1134
3099
|
// src/components/ui/book.tsx
|
|
1135
|
-
import {
|
|
1136
|
-
import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3100
|
+
import { jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1137
3101
|
function Book(props) {
|
|
1138
3102
|
const {
|
|
1139
3103
|
children,
|
|
@@ -1145,10 +3109,10 @@ function Book(props) {
|
|
|
1145
3109
|
illustration,
|
|
1146
3110
|
width
|
|
1147
3111
|
} = props;
|
|
1148
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx31(
|
|
1149
3113
|
"div",
|
|
1150
3114
|
{
|
|
1151
|
-
className:
|
|
3115
|
+
className: cn("group perspective-[900px] inline-block w-fit"),
|
|
1152
3116
|
style: {
|
|
1153
3117
|
"--book-color": color,
|
|
1154
3118
|
"--text-color": textColor,
|
|
@@ -1168,20 +3132,20 @@ function Book(props) {
|
|
|
1168
3132
|
shrink: true,
|
|
1169
3133
|
grow: true,
|
|
1170
3134
|
direction: "row",
|
|
1171
|
-
className:
|
|
3135
|
+
className: cn(
|
|
1172
3136
|
"relative min-w-[calc(var(--book-width))] overflow-hidden bg-(--book-color)"
|
|
1173
3137
|
),
|
|
1174
3138
|
children: [
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
illustration && /* @__PURE__ */
|
|
3139
|
+
/* @__PURE__ */ jsx31("div", { className: "absolute inset-y-0 min-w-[8.2%] bg-book-bind-bg opacity-100 mix-blend-overlay" }),
|
|
3140
|
+
illustration && /* @__PURE__ */ jsx31("div", { className: "object-cover", children: illustration })
|
|
1177
3141
|
]
|
|
1178
3142
|
}
|
|
1179
3143
|
),
|
|
1180
3144
|
/* @__PURE__ */ jsxs19(Stack, { grow: variant === "simple", direction: "row", className: "h-fit", children: [
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
3145
|
+
/* @__PURE__ */ jsx31("div", { className: "h-full min-w-[8.2%] bg-book-bind-bg opacity-100 mix-blend-overlay" }),
|
|
3146
|
+
/* @__PURE__ */ jsx31("div", { className: "w-full contain-inline-size", children })
|
|
1183
3147
|
] }),
|
|
1184
|
-
texture && /* @__PURE__ */
|
|
3148
|
+
texture && /* @__PURE__ */ jsx31(
|
|
1185
3149
|
"div",
|
|
1186
3150
|
{
|
|
1187
3151
|
"aria-hidden": true,
|
|
@@ -1191,7 +3155,7 @@ function Book(props) {
|
|
|
1191
3155
|
]
|
|
1192
3156
|
}
|
|
1193
3157
|
),
|
|
1194
|
-
/* @__PURE__ */
|
|
3158
|
+
/* @__PURE__ */ jsx31(
|
|
1195
3159
|
"div",
|
|
1196
3160
|
{
|
|
1197
3161
|
"aria-hidden": true,
|
|
@@ -1201,7 +3165,7 @@ function Book(props) {
|
|
|
1201
3165
|
}
|
|
1202
3166
|
}
|
|
1203
3167
|
),
|
|
1204
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ jsx31(
|
|
1205
3169
|
"div",
|
|
1206
3170
|
{
|
|
1207
3171
|
"aria-hidden": true,
|
|
@@ -1229,7 +3193,7 @@ function Stack(props) {
|
|
|
1229
3193
|
className,
|
|
1230
3194
|
...etc
|
|
1231
3195
|
} = props;
|
|
1232
|
-
return /* @__PURE__ */
|
|
3196
|
+
return /* @__PURE__ */ jsx31(
|
|
1233
3197
|
"div",
|
|
1234
3198
|
{
|
|
1235
3199
|
className,
|
|
@@ -1253,8 +3217,7 @@ function Stack(props) {
|
|
|
1253
3217
|
|
|
1254
3218
|
// src/components/ui/dots-pattern.tsx
|
|
1255
3219
|
import { useId as useId2 } from "react";
|
|
1256
|
-
import {
|
|
1257
|
-
import { jsx as jsx31, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3220
|
+
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1258
3221
|
function DotsPattern({
|
|
1259
3222
|
dotSize = 2,
|
|
1260
3223
|
gapSize = 10,
|
|
@@ -1265,11 +3228,11 @@ function DotsPattern({
|
|
|
1265
3228
|
return /* @__PURE__ */ jsxs20(
|
|
1266
3229
|
"svg",
|
|
1267
3230
|
{
|
|
1268
|
-
className:
|
|
3231
|
+
className: cn("pointer-events-none absolute inset-0 text-foreground/10", className),
|
|
1269
3232
|
width: "100%",
|
|
1270
3233
|
height: "100%",
|
|
1271
3234
|
children: [
|
|
1272
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ jsx32("defs", { children: /* @__PURE__ */ jsx32(
|
|
1273
3236
|
"pattern",
|
|
1274
3237
|
{
|
|
1275
3238
|
id: `dots-${id}`,
|
|
@@ -1278,38 +3241,37 @@ function DotsPattern({
|
|
|
1278
3241
|
width: dotSize + gapSize,
|
|
1279
3242
|
height: dotSize + gapSize,
|
|
1280
3243
|
patternUnits: "userSpaceOnUse",
|
|
1281
|
-
children: /* @__PURE__ */
|
|
3244
|
+
children: /* @__PURE__ */ jsx32("rect", { x: 1, y: 1, width: dotSize, height: dotSize, fill: "currentColor" })
|
|
1282
3245
|
}
|
|
1283
3246
|
) }),
|
|
1284
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsx32("rect", { fill: `url(#dots-${id})`, width: "100%", height: "100%" })
|
|
1285
3248
|
]
|
|
1286
3249
|
}
|
|
1287
3250
|
);
|
|
1288
3251
|
}
|
|
1289
3252
|
|
|
1290
3253
|
// src/components/ui/hexagon-badge.tsx
|
|
1291
|
-
import {
|
|
1292
|
-
import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3254
|
+
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1293
3255
|
var HexagonBadge = ({ children, classNames }) => {
|
|
1294
|
-
return /* @__PURE__ */ jsxs21("div", { className:
|
|
3256
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn("relative shrink-0", classNames?.base), children: [
|
|
1295
3257
|
/* @__PURE__ */ jsxs21(
|
|
1296
3258
|
"svg",
|
|
1297
3259
|
{
|
|
1298
|
-
className:
|
|
3260
|
+
className: cn("h-full w-full", classNames?.svg),
|
|
1299
3261
|
width: "44",
|
|
1300
3262
|
height: "48",
|
|
1301
3263
|
viewBox: "0 0 44 48",
|
|
1302
3264
|
fill: "none",
|
|
1303
3265
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1304
3266
|
children: [
|
|
1305
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx33(
|
|
1306
3268
|
"path",
|
|
1307
3269
|
{
|
|
1308
3270
|
d: "M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506\n 18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937\n 39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z",
|
|
1309
3271
|
fill: ""
|
|
1310
3272
|
}
|
|
1311
3273
|
),
|
|
1312
|
-
/* @__PURE__ */
|
|
3274
|
+
/* @__PURE__ */ jsx33(
|
|
1313
3275
|
"path",
|
|
1314
3276
|
{
|
|
1315
3277
|
d: "M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506\n 18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937\n 39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z",
|
|
@@ -1319,10 +3281,10 @@ var HexagonBadge = ({ children, classNames }) => {
|
|
|
1319
3281
|
]
|
|
1320
3282
|
}
|
|
1321
3283
|
),
|
|
1322
|
-
/* @__PURE__ */
|
|
3284
|
+
/* @__PURE__ */ jsx33(
|
|
1323
3285
|
"div",
|
|
1324
3286
|
{
|
|
1325
|
-
className:
|
|
3287
|
+
className: cn(
|
|
1326
3288
|
"absolute start-2/4 top-2/4 -translate-x-2/4 -translate-y-2/4 leading-none rtl:translate-x-2/4",
|
|
1327
3289
|
classNames?.wraper
|
|
1328
3290
|
),
|
|
@@ -1338,7 +3300,7 @@ import {
|
|
|
1338
3300
|
useRef,
|
|
1339
3301
|
useState as useState4
|
|
1340
3302
|
} from "react";
|
|
1341
|
-
import { Fragment as Fragment3, jsx as
|
|
3303
|
+
import { Fragment as Fragment3, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1342
3304
|
var DEFAULT_NULL_INDEX = -1;
|
|
1343
3305
|
var DEFAULT_DATA_URL_KEY = "dataURL";
|
|
1344
3306
|
var openFileDialog = (inputRef) => {
|
|
@@ -1475,7 +3437,7 @@ var ImageInput = ({
|
|
|
1475
3437
|
e.dataTransfer.clearData();
|
|
1476
3438
|
};
|
|
1477
3439
|
return /* @__PURE__ */ jsxs22(Fragment3, { children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ jsx34(
|
|
1479
3441
|
"input",
|
|
1480
3442
|
{
|
|
1481
3443
|
ref: inputRef,
|
|
@@ -1509,27 +3471,16 @@ var ImageInput = ({
|
|
|
1509
3471
|
|
|
1510
3472
|
// src/components/ui/language-switcher.tsx
|
|
1511
3473
|
import { useTransition } from "react";
|
|
1512
|
-
import {
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
DropdownMenuContent as DropdownMenuContent2,
|
|
1518
|
-
DropdownMenuItem as DropdownMenuItem2,
|
|
1519
|
-
DropdownMenuRadioGroup,
|
|
1520
|
-
DropdownMenuRadioItem,
|
|
1521
|
-
DropdownMenuSub as DropdownMenuSub2,
|
|
1522
|
-
DropdownMenuSubContent as DropdownMenuSubContent2,
|
|
1523
|
-
DropdownMenuSubTrigger as DropdownMenuSubTrigger2,
|
|
1524
|
-
DropdownMenuTrigger as DropdownMenuTrigger2
|
|
1525
|
-
} from "@pelatform/ui.default";
|
|
1526
|
-
import { cn as cn26, getFlagUrl } from "@pelatform/utils";
|
|
1527
|
-
import { jsx as jsx34, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3474
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3475
|
+
function getFlagUrl(flag) {
|
|
3476
|
+
const flagCode = flag.toLowerCase();
|
|
3477
|
+
return `"https://assets.pelatform.com"/media/flags/${flagCode}.svg`;
|
|
3478
|
+
}
|
|
1528
3479
|
function LanguageSwitcher({
|
|
1529
3480
|
className,
|
|
1530
3481
|
type = "dropdown",
|
|
1531
3482
|
variant = "ghost",
|
|
1532
|
-
size = "
|
|
3483
|
+
size = "default",
|
|
1533
3484
|
showNames = true,
|
|
1534
3485
|
showFlags = true,
|
|
1535
3486
|
label = "Language",
|
|
@@ -1554,71 +3505,63 @@ function LanguageSwitcher({
|
|
|
1554
3505
|
return null;
|
|
1555
3506
|
}
|
|
1556
3507
|
if (type === "dropdown") {
|
|
1557
|
-
return /* @__PURE__ */ jsxs23(
|
|
1558
|
-
/* @__PURE__ */
|
|
1559
|
-
|
|
3508
|
+
return /* @__PURE__ */ jsxs23(DropdownMenu, { children: [
|
|
3509
|
+
/* @__PURE__ */ jsx35(DropdownMenuTrigger, { children: /* @__PURE__ */ jsxs23(
|
|
3510
|
+
Button,
|
|
1560
3511
|
{
|
|
1561
3512
|
variant,
|
|
1562
3513
|
size,
|
|
1563
|
-
className:
|
|
3514
|
+
className: cn(
|
|
1564
3515
|
"group/toggle size-8 px-0 text-foreground ring-0! focus:outline-none! focus:ring-0! focus-visible:outline-none! focus-visible:ring-0! focus-visible:ring-offset-0!",
|
|
1565
3516
|
isPending && "cursor-not-allowed opacity-50",
|
|
1566
3517
|
className
|
|
1567
3518
|
),
|
|
1568
3519
|
disabled: isPending,
|
|
1569
3520
|
children: [
|
|
1570
|
-
/* @__PURE__ */
|
|
1571
|
-
/* @__PURE__ */
|
|
3521
|
+
/* @__PURE__ */ jsx35(Languages, { className: "size-4" }),
|
|
3522
|
+
/* @__PURE__ */ jsx35("span", { className: "sr-only", children: isPending ? "Changing language..." : "Language dropdown" })
|
|
1572
3523
|
]
|
|
1573
3524
|
}
|
|
1574
3525
|
) }),
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
|
|
3526
|
+
/* @__PURE__ */ jsx35(DropdownMenuContent, { align: "end", className: "min-w-[150px]", children: languages.map((lang) => /* @__PURE__ */ jsxs23(
|
|
3527
|
+
DropdownMenuItem,
|
|
1577
3528
|
{
|
|
1578
|
-
|
|
1579
|
-
className: "
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
showNames && /* @__PURE__ */ jsx34("span", { className: "text-sm", children: lang.name }),
|
|
1598
|
-
currentLocale === lang.code && /* @__PURE__ */ jsx34("span", { className: "ms-auto text-muted-foreground text-xs", children: "\u2713" })
|
|
1599
|
-
]
|
|
1600
|
-
},
|
|
1601
|
-
lang.code
|
|
1602
|
-
))
|
|
1603
|
-
}
|
|
1604
|
-
)
|
|
3529
|
+
onClick: () => handleLanguageChange(lang.code),
|
|
3530
|
+
className: cn("gap-2", currentLocale === lang.code && "bg-accent"),
|
|
3531
|
+
children: [
|
|
3532
|
+
showFlags && lang.flag ? /* @__PURE__ */ jsx35(
|
|
3533
|
+
Image2,
|
|
3534
|
+
{
|
|
3535
|
+
src: customFlagUrl ? lang.flag : getFlagUrl(lang.flag),
|
|
3536
|
+
alt: `${lang.name} flag`,
|
|
3537
|
+
className: "size-4 rounded-full object-cover",
|
|
3538
|
+
width: 24,
|
|
3539
|
+
height: 24
|
|
3540
|
+
}
|
|
3541
|
+
) : showFlags ? /* @__PURE__ */ jsx35(Globe, { className: "size-4" }) : null,
|
|
3542
|
+
showNames && /* @__PURE__ */ jsx35("span", { className: "text-sm", children: lang.name }),
|
|
3543
|
+
currentLocale === lang.code && /* @__PURE__ */ jsx35("span", { className: "ms-auto text-muted-foreground text-xs", children: "\u2713" })
|
|
3544
|
+
]
|
|
3545
|
+
},
|
|
3546
|
+
lang.code
|
|
3547
|
+
)) })
|
|
1605
3548
|
] });
|
|
1606
3549
|
}
|
|
1607
|
-
return /* @__PURE__ */ jsxs23(
|
|
3550
|
+
return /* @__PURE__ */ jsxs23(DropdownMenuSub, { children: [
|
|
1608
3551
|
/* @__PURE__ */ jsxs23(
|
|
1609
|
-
|
|
3552
|
+
DropdownMenuSubTrigger,
|
|
1610
3553
|
{
|
|
1611
|
-
className:
|
|
3554
|
+
className: cn(
|
|
1612
3555
|
"flex items-center gap-2 data-[state=open]:**:data-[slot=badge]:border-input **:data-[slot=dropdown-menu-sub-trigger-indicator]:hidden hover:**:data-[slot=badge]:border-input",
|
|
1613
3556
|
className
|
|
1614
3557
|
),
|
|
1615
3558
|
children: [
|
|
1616
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ jsx35(Globe, { className: "size-4" }),
|
|
1617
3560
|
/* @__PURE__ */ jsxs23("span", { className: "relative flex grow items-center justify-between gap-2", children: [
|
|
1618
3561
|
label,
|
|
1619
|
-
currentLanguage && /* @__PURE__ */ jsxs23(
|
|
3562
|
+
currentLanguage && /* @__PURE__ */ jsxs23(Badge, { variant: "outline", className: "absolute end-0 top-1/2 -translate-y-1/2", children: [
|
|
1620
3563
|
currentLanguage.name,
|
|
1621
|
-
showFlags && currentLanguage.flag && /* @__PURE__ */
|
|
3564
|
+
showFlags && currentLanguage.flag && /* @__PURE__ */ jsx35(
|
|
1622
3565
|
Image2,
|
|
1623
3566
|
{
|
|
1624
3567
|
src: customFlagUrl ? currentLanguage.flag : getFlagUrl(currentLanguage.flag),
|
|
@@ -1633,7 +3576,7 @@ function LanguageSwitcher({
|
|
|
1633
3576
|
]
|
|
1634
3577
|
}
|
|
1635
3578
|
),
|
|
1636
|
-
/* @__PURE__ */
|
|
3579
|
+
/* @__PURE__ */ jsx35(DropdownMenuSubContent, { className: "w-48", children: /* @__PURE__ */ jsx35(
|
|
1637
3580
|
DropdownMenuRadioGroup,
|
|
1638
3581
|
{
|
|
1639
3582
|
value: currentLocale,
|
|
@@ -1644,7 +3587,7 @@ function LanguageSwitcher({
|
|
|
1644
3587
|
value: item.code,
|
|
1645
3588
|
className: "flex items-center gap-2",
|
|
1646
3589
|
children: [
|
|
1647
|
-
showFlags && item.flag ? /* @__PURE__ */
|
|
3590
|
+
showFlags && item.flag ? /* @__PURE__ */ jsx35(
|
|
1648
3591
|
Image2,
|
|
1649
3592
|
{
|
|
1650
3593
|
src: customFlagUrl ? item.flag : getFlagUrl(item.flag),
|
|
@@ -1653,8 +3596,8 @@ function LanguageSwitcher({
|
|
|
1653
3596
|
width: 24,
|
|
1654
3597
|
height: 24
|
|
1655
3598
|
}
|
|
1656
|
-
) : showFlags ? /* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */
|
|
3599
|
+
) : showFlags ? /* @__PURE__ */ jsx35(Globe, { className: "size-4" }) : null,
|
|
3600
|
+
/* @__PURE__ */ jsx35("span", { children: item.name })
|
|
1658
3601
|
]
|
|
1659
3602
|
},
|
|
1660
3603
|
item.code
|
|
@@ -1665,16 +3608,15 @@ function LanguageSwitcher({
|
|
|
1665
3608
|
}
|
|
1666
3609
|
|
|
1667
3610
|
// src/components/ui/logo.tsx
|
|
1668
|
-
import {
|
|
1669
|
-
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3611
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1670
3612
|
function Logo({ className }) {
|
|
1671
|
-
return /* @__PURE__ */
|
|
3613
|
+
return /* @__PURE__ */ jsx36(
|
|
1672
3614
|
"svg",
|
|
1673
3615
|
{
|
|
1674
3616
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1675
3617
|
viewBox: "0 0 300 300",
|
|
1676
|
-
className:
|
|
1677
|
-
children: /* @__PURE__ */
|
|
3618
|
+
className: cn("size-8 text-primary", className),
|
|
3619
|
+
children: /* @__PURE__ */ jsx36(
|
|
1678
3620
|
"path",
|
|
1679
3621
|
{
|
|
1680
3622
|
fill: "currentColor",
|
|
@@ -1686,23 +3628,13 @@ function Logo({ className }) {
|
|
|
1686
3628
|
}
|
|
1687
3629
|
|
|
1688
3630
|
// src/components/ui/mode-switcher.tsx
|
|
1689
|
-
import * as
|
|
1690
|
-
import {
|
|
1691
|
-
import { useTheme } from "next-themes";
|
|
1692
|
-
import {
|
|
1693
|
-
Button as Button6,
|
|
1694
|
-
DropdownMenu as DropdownMenu3,
|
|
1695
|
-
DropdownMenuContent as DropdownMenuContent3,
|
|
1696
|
-
DropdownMenuItem as DropdownMenuItem3,
|
|
1697
|
-
DropdownMenuTrigger as DropdownMenuTrigger3
|
|
1698
|
-
} from "@pelatform/ui.default";
|
|
1699
|
-
import { cn as cn28, THEME_MODES as THEME_MODES2 } from "@pelatform/utils";
|
|
1700
|
-
import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3631
|
+
import * as React3 from "react";
|
|
3632
|
+
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1701
3633
|
function ModeSwitcher({
|
|
1702
3634
|
className,
|
|
1703
3635
|
variant = "ghost",
|
|
1704
|
-
size = "
|
|
1705
|
-
cycleOrder = [
|
|
3636
|
+
size = "default",
|
|
3637
|
+
cycleOrder = [THEME_MODES.SYSTEM, THEME_MODES.LIGHT, THEME_MODES.DARK],
|
|
1706
3638
|
type = "toogle",
|
|
1707
3639
|
label = {
|
|
1708
3640
|
system: "System",
|
|
@@ -1710,98 +3642,98 @@ function ModeSwitcher({
|
|
|
1710
3642
|
light: "Light"
|
|
1711
3643
|
}
|
|
1712
3644
|
}) {
|
|
1713
|
-
const { setTheme, theme } =
|
|
1714
|
-
const toggleTheme =
|
|
3645
|
+
const { setTheme, theme } = z();
|
|
3646
|
+
const toggleTheme = React3.useCallback(() => {
|
|
1715
3647
|
const currentIndex = cycleOrder.indexOf(theme);
|
|
1716
3648
|
const nextIndex = (currentIndex + 1) % cycleOrder.length;
|
|
1717
3649
|
const nextTheme = cycleOrder[nextIndex];
|
|
1718
3650
|
setTheme(nextTheme);
|
|
1719
3651
|
}, [theme, setTheme, cycleOrder]);
|
|
1720
3652
|
const getCurrentIcon = (withLabel = false) => {
|
|
1721
|
-
if (theme ===
|
|
3653
|
+
if (theme === THEME_MODES.SYSTEM) {
|
|
1722
3654
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
1723
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx37(Monitor, {}),
|
|
1724
3656
|
" ",
|
|
1725
|
-
withLabel && /* @__PURE__ */
|
|
3657
|
+
withLabel && /* @__PURE__ */ jsx37("span", { children: label.system })
|
|
1726
3658
|
] });
|
|
1727
3659
|
}
|
|
1728
|
-
if (theme ===
|
|
3660
|
+
if (theme === THEME_MODES.DARK) {
|
|
1729
3661
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
1730
|
-
/* @__PURE__ */
|
|
3662
|
+
/* @__PURE__ */ jsx37(Moon, {}),
|
|
1731
3663
|
" ",
|
|
1732
|
-
withLabel && /* @__PURE__ */
|
|
3664
|
+
withLabel && /* @__PURE__ */ jsx37("span", { children: label.dark })
|
|
1733
3665
|
] });
|
|
1734
3666
|
}
|
|
1735
3667
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
1736
|
-
/* @__PURE__ */
|
|
3668
|
+
/* @__PURE__ */ jsx37(Sun, {}),
|
|
1737
3669
|
" ",
|
|
1738
|
-
withLabel && /* @__PURE__ */
|
|
3670
|
+
withLabel && /* @__PURE__ */ jsx37("span", { children: label.light })
|
|
1739
3671
|
] });
|
|
1740
3672
|
};
|
|
1741
3673
|
const isActive = (val) => theme === val;
|
|
1742
3674
|
if (type === "toogle") {
|
|
1743
3675
|
return /* @__PURE__ */ jsxs24(
|
|
1744
|
-
|
|
3676
|
+
Button,
|
|
1745
3677
|
{
|
|
1746
|
-
variant,
|
|
1747
3678
|
size,
|
|
1748
|
-
|
|
3679
|
+
variant,
|
|
3680
|
+
className: cn("group/toggle size-8 px-0 text-foreground", className),
|
|
1749
3681
|
onClick: toggleTheme,
|
|
1750
3682
|
"aria-label": "Switch theme",
|
|
1751
3683
|
children: [
|
|
1752
3684
|
getCurrentIcon(),
|
|
1753
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx37("span", { className: "sr-only", children: "Toggle theme" })
|
|
1754
3686
|
]
|
|
1755
3687
|
}
|
|
1756
3688
|
);
|
|
1757
3689
|
}
|
|
1758
3690
|
if (type === "dropdown") {
|
|
1759
|
-
return /* @__PURE__ */ jsxs24(
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
|
|
3691
|
+
return /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
3692
|
+
/* @__PURE__ */ jsx37(DropdownMenuTrigger, { children: /* @__PURE__ */ jsxs24(
|
|
3693
|
+
Button,
|
|
1762
3694
|
{
|
|
1763
|
-
variant,
|
|
1764
3695
|
size,
|
|
1765
|
-
|
|
3696
|
+
variant,
|
|
3697
|
+
className: cn(
|
|
1766
3698
|
"group/toggle size-8 px-0 text-foreground ring-0! focus:outline-none! focus:ring-0! focus-visible:outline-none! focus-visible:ring-0! focus-visible:ring-offset-0!",
|
|
1767
3699
|
className
|
|
1768
3700
|
),
|
|
1769
3701
|
children: [
|
|
1770
3702
|
getCurrentIcon(),
|
|
1771
|
-
/* @__PURE__ */
|
|
3703
|
+
/* @__PURE__ */ jsx37("span", { className: "sr-only", children: "Toggle theme" })
|
|
1772
3704
|
]
|
|
1773
3705
|
}
|
|
1774
3706
|
) }),
|
|
1775
|
-
/* @__PURE__ */ jsxs24(
|
|
3707
|
+
/* @__PURE__ */ jsxs24(DropdownMenuContent, { align: "end", children: [
|
|
1776
3708
|
/* @__PURE__ */ jsxs24(
|
|
1777
|
-
|
|
3709
|
+
DropdownMenuItem,
|
|
1778
3710
|
{
|
|
1779
3711
|
className: isActive("light") ? "bg-accent" : "",
|
|
1780
3712
|
onClick: () => setTheme("light"),
|
|
1781
3713
|
children: [
|
|
1782
|
-
/* @__PURE__ */
|
|
3714
|
+
/* @__PURE__ */ jsx37(Sun, {}),
|
|
1783
3715
|
label.light
|
|
1784
3716
|
]
|
|
1785
3717
|
}
|
|
1786
3718
|
),
|
|
1787
3719
|
/* @__PURE__ */ jsxs24(
|
|
1788
|
-
|
|
3720
|
+
DropdownMenuItem,
|
|
1789
3721
|
{
|
|
1790
3722
|
className: isActive("dark") ? "bg-accent" : "",
|
|
1791
3723
|
onClick: () => setTheme("dark"),
|
|
1792
3724
|
children: [
|
|
1793
|
-
/* @__PURE__ */
|
|
3725
|
+
/* @__PURE__ */ jsx37(Moon, {}),
|
|
1794
3726
|
label.dark
|
|
1795
3727
|
]
|
|
1796
3728
|
}
|
|
1797
3729
|
),
|
|
1798
3730
|
/* @__PURE__ */ jsxs24(
|
|
1799
|
-
|
|
3731
|
+
DropdownMenuItem,
|
|
1800
3732
|
{
|
|
1801
3733
|
className: isActive("system") ? "bg-accent" : "",
|
|
1802
3734
|
onClick: () => setTheme("system"),
|
|
1803
3735
|
children: [
|
|
1804
|
-
/* @__PURE__ */
|
|
3736
|
+
/* @__PURE__ */ jsx37(Monitor, {}),
|
|
1805
3737
|
label.system
|
|
1806
3738
|
]
|
|
1807
3739
|
}
|
|
@@ -1809,8 +3741,8 @@ function ModeSwitcher({
|
|
|
1809
3741
|
] })
|
|
1810
3742
|
] });
|
|
1811
3743
|
}
|
|
1812
|
-
return /* @__PURE__ */
|
|
1813
|
-
|
|
3744
|
+
return /* @__PURE__ */ jsx37(
|
|
3745
|
+
DropdownMenuItem,
|
|
1814
3746
|
{
|
|
1815
3747
|
className,
|
|
1816
3748
|
onSelect: (e) => {
|
|
@@ -1824,15 +3756,7 @@ function ModeSwitcher({
|
|
|
1824
3756
|
|
|
1825
3757
|
// src/components/ui/moving-border.tsx
|
|
1826
3758
|
import { useRef as useRef2 } from "react";
|
|
1827
|
-
import {
|
|
1828
|
-
motion as motion2,
|
|
1829
|
-
useAnimationFrame,
|
|
1830
|
-
useMotionTemplate,
|
|
1831
|
-
useMotionValue,
|
|
1832
|
-
useTransform
|
|
1833
|
-
} from "motion/react";
|
|
1834
|
-
import { cn as cn29 } from "@pelatform/utils";
|
|
1835
|
-
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3759
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1836
3760
|
function MovingLabel({
|
|
1837
3761
|
borderRadius = "1.75rem",
|
|
1838
3762
|
children,
|
|
@@ -1846,25 +3770,25 @@ function MovingLabel({
|
|
|
1846
3770
|
return /* @__PURE__ */ jsxs25(
|
|
1847
3771
|
Component,
|
|
1848
3772
|
{
|
|
1849
|
-
className:
|
|
3773
|
+
className: cn("relative h-9 overflow-hidden bg-transparent p-px text-xl", containerClassName),
|
|
1850
3774
|
style: {
|
|
1851
3775
|
borderRadius
|
|
1852
3776
|
},
|
|
1853
3777
|
...otherProps,
|
|
1854
3778
|
children: [
|
|
1855
|
-
/* @__PURE__ */
|
|
3779
|
+
/* @__PURE__ */ jsx38("div", { className: "absolute inset-0", style: { borderRadius: `calc(${borderRadius} * 0.96)` }, children: /* @__PURE__ */ jsx38(MovingBorder, { duration, rx: "30%", ry: "30%", children: /* @__PURE__ */ jsx38(
|
|
1856
3780
|
"div",
|
|
1857
3781
|
{
|
|
1858
|
-
className:
|
|
3782
|
+
className: cn(
|
|
1859
3783
|
"h-12 w-20 bg-[radial-gradient(#24B47E_15%,transparent_60%)] opacity-[0.6]",
|
|
1860
3784
|
borderClassName
|
|
1861
3785
|
)
|
|
1862
3786
|
}
|
|
1863
3787
|
) }) }),
|
|
1864
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsx38(
|
|
1865
3789
|
"div",
|
|
1866
3790
|
{
|
|
1867
|
-
className:
|
|
3791
|
+
className: cn(
|
|
1868
3792
|
"relative flex h-full w-full items-center justify-center border border-slate-800 bg-slate-900/50 text-sm text-white antialiased backdrop-blur-xl",
|
|
1869
3793
|
className
|
|
1870
3794
|
),
|
|
@@ -1898,7 +3822,7 @@ var MovingBorder = ({
|
|
|
1898
3822
|
const y = useTransform(progress, (val) => pathRef.current?.getPointAtLength(val).y);
|
|
1899
3823
|
const transform = useMotionTemplate`translateX(${x}px) translateY(${y}px) translateX(-50%) translateY(-50%)`;
|
|
1900
3824
|
return /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
1901
|
-
/* @__PURE__ */
|
|
3825
|
+
/* @__PURE__ */ jsx38(
|
|
1902
3826
|
"svg",
|
|
1903
3827
|
{
|
|
1904
3828
|
preserveAspectRatio: "none",
|
|
@@ -1906,11 +3830,11 @@ var MovingBorder = ({
|
|
|
1906
3830
|
width: "100%",
|
|
1907
3831
|
height: "100%",
|
|
1908
3832
|
...otherProps,
|
|
1909
|
-
children: /* @__PURE__ */
|
|
3833
|
+
children: /* @__PURE__ */ jsx38("rect", { fill: "none", width: "100%", height: "100%", rx, ry, ref: pathRef })
|
|
1910
3834
|
}
|
|
1911
3835
|
),
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
|
|
3836
|
+
/* @__PURE__ */ jsx38(
|
|
3837
|
+
motion.div,
|
|
1914
3838
|
{
|
|
1915
3839
|
style: {
|
|
1916
3840
|
position: "absolute",
|
|
@@ -1925,302 +3849,29 @@ var MovingBorder = ({
|
|
|
1925
3849
|
] });
|
|
1926
3850
|
};
|
|
1927
3851
|
|
|
1928
|
-
// src/components/ui/subscribe.tsx
|
|
1929
|
-
import { useState as useState5 } from "react";
|
|
1930
|
-
import { CircleAlertIcon as CircleAlertIcon4, CircleCheckIcon as CircleCheckIcon2 } from "lucide-react";
|
|
1931
|
-
import { toast as toast4 } from "sonner";
|
|
1932
|
-
import { Alert as Alert4, AlertIcon as AlertIcon4, AlertTitle as AlertTitle4, Button as Button8, Input } from "@pelatform/ui.default";
|
|
1933
|
-
import { googleTrackEvent as googleTrackEvent3 } from "@pelatform/utils";
|
|
1934
|
-
|
|
1935
|
-
// src/components/utils/recaptcha-popover.tsx
|
|
1936
|
-
import { CircleAlertIcon as CircleAlertIcon3 } from "lucide-react";
|
|
1937
|
-
import { Popover } from "radix-ui";
|
|
1938
|
-
import { toast as toast3 } from "sonner";
|
|
1939
|
-
import { Alert as Alert3, AlertIcon as AlertIcon3, AlertTitle as AlertTitle3, Button as Button7 } from "@pelatform/ui.default";
|
|
1940
|
-
import { useRecaptchaV2 } from "@pelatform/ui.hook";
|
|
1941
|
-
import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1942
|
-
function RecaptchaPopover({
|
|
1943
|
-
open,
|
|
1944
|
-
onOpenChange,
|
|
1945
|
-
onVerify,
|
|
1946
|
-
trigger,
|
|
1947
|
-
verifyButtonText = "Verify & Submit"
|
|
1948
|
-
}) {
|
|
1949
|
-
const { containerRef, getToken, resetCaptcha, initializeRecaptcha } = useRecaptchaV2(
|
|
1950
|
-
process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY || ""
|
|
1951
|
-
);
|
|
1952
|
-
const handleOpenChange = (newOpen) => {
|
|
1953
|
-
onOpenChange(newOpen);
|
|
1954
|
-
if (newOpen) {
|
|
1955
|
-
resetCaptcha();
|
|
1956
|
-
setTimeout(() => {
|
|
1957
|
-
initializeRecaptcha();
|
|
1958
|
-
}, 100);
|
|
1959
|
-
}
|
|
1960
|
-
};
|
|
1961
|
-
const handleVerify = () => {
|
|
1962
|
-
try {
|
|
1963
|
-
const token = getToken();
|
|
1964
|
-
if (!token) {
|
|
1965
|
-
toast3.custom(
|
|
1966
|
-
() => /* @__PURE__ */ jsxs26(Alert3, { variant: "mono", icon: "destructive", children: [
|
|
1967
|
-
/* @__PURE__ */ jsx38(AlertIcon3, { children: /* @__PURE__ */ jsx38(CircleAlertIcon3, {}) }),
|
|
1968
|
-
/* @__PURE__ */ jsx38(AlertTitle3, { children: "Please complete the reCAPTCHA verification." })
|
|
1969
|
-
] }),
|
|
1970
|
-
{
|
|
1971
|
-
position: "top-center"
|
|
1972
|
-
}
|
|
1973
|
-
);
|
|
1974
|
-
return;
|
|
1975
|
-
}
|
|
1976
|
-
onVerify(token);
|
|
1977
|
-
} catch (error) {
|
|
1978
|
-
console.error("Error getting reCAPTCHA token:", error);
|
|
1979
|
-
toast3.custom(
|
|
1980
|
-
() => /* @__PURE__ */ jsxs26(Alert3, { variant: "mono", icon: "destructive", children: [
|
|
1981
|
-
/* @__PURE__ */ jsx38(AlertIcon3, { children: /* @__PURE__ */ jsx38(CircleAlertIcon3, {}) }),
|
|
1982
|
-
/* @__PURE__ */ jsx38(AlertTitle3, { children: "Please complete the reCAPTCHA verification." })
|
|
1983
|
-
] }),
|
|
1984
|
-
{
|
|
1985
|
-
position: "top-center"
|
|
1986
|
-
}
|
|
1987
|
-
);
|
|
1988
|
-
return;
|
|
1989
|
-
}
|
|
1990
|
-
};
|
|
1991
|
-
return /* @__PURE__ */ jsxs26(Popover.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
1992
|
-
/* @__PURE__ */ jsx38(Popover.Trigger, { asChild: true, children: trigger }),
|
|
1993
|
-
/* @__PURE__ */ jsx38(Popover.Portal, { children: /* @__PURE__ */ jsxs26(
|
|
1994
|
-
Popover.Content,
|
|
1995
|
-
{
|
|
1996
|
-
className: "z-50 rounded-lg bg-white p-4 shadow-lg",
|
|
1997
|
-
sideOffset: 5,
|
|
1998
|
-
align: "end",
|
|
1999
|
-
onInteractOutside: (e) => {
|
|
2000
|
-
if (e.target.tagName === "IFRAME") {
|
|
2001
|
-
e.preventDefault();
|
|
2002
|
-
}
|
|
2003
|
-
},
|
|
2004
|
-
children: [
|
|
2005
|
-
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-4", children: [
|
|
2006
|
-
/* @__PURE__ */ jsx38("div", { ref: containerRef, className: "min-h-[78px]" }),
|
|
2007
|
-
/* @__PURE__ */ jsx38(Button7, { type: "button", variant: "mono", onClick: handleVerify, className: "w-full", children: verifyButtonText })
|
|
2008
|
-
] }),
|
|
2009
|
-
/* @__PURE__ */ jsx38(Popover.Arrow, { className: "fill-white" })
|
|
2010
|
-
]
|
|
2011
|
-
}
|
|
2012
|
-
) })
|
|
2013
|
-
] });
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
// src/components/ui/subscribe.tsx
|
|
2017
|
-
import { jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2018
|
-
function Subscribe({
|
|
2019
|
-
heading = "Stay notified on every new release",
|
|
2020
|
-
subheading = "Only the updates worth knowing",
|
|
2021
|
-
buttonText = "Subscribe",
|
|
2022
|
-
loadingButtonText = "Subscribing...",
|
|
2023
|
-
inputPlaceholder = "Your email address",
|
|
2024
|
-
successMessage = "Thank you for your subscription. Expect amazing stuff soon!",
|
|
2025
|
-
invalidEmailMessage = "Invalid email address. Please check and try again.",
|
|
2026
|
-
recaptchaMessage = "Please complete the reCAPTCHA verification.",
|
|
2027
|
-
errorMessage = "Oops! Something unexpected happened. Please try again later.",
|
|
2028
|
-
apiEndpoint = "/api/subscribe",
|
|
2029
|
-
verifyButtonText = "Verify & Subscribe",
|
|
2030
|
-
className
|
|
2031
|
-
} = {}) {
|
|
2032
|
-
const [email, setEmail] = useState5("");
|
|
2033
|
-
const [loading, setLoading] = useState5(false);
|
|
2034
|
-
const [showRecaptcha, setShowRecaptcha] = useState5(false);
|
|
2035
|
-
const validateEmail = () => {
|
|
2036
|
-
if (!email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
|
|
2037
|
-
toast4.custom(
|
|
2038
|
-
() => /* @__PURE__ */ jsxs27(Alert4, { variant: "mono", icon: "destructive", children: [
|
|
2039
|
-
/* @__PURE__ */ jsx39(AlertIcon4, { children: /* @__PURE__ */ jsx39(CircleAlertIcon4, {}) }),
|
|
2040
|
-
/* @__PURE__ */ jsx39(AlertTitle4, { children: invalidEmailMessage })
|
|
2041
|
-
] }),
|
|
2042
|
-
{
|
|
2043
|
-
position: "top-center"
|
|
2044
|
-
}
|
|
2045
|
-
);
|
|
2046
|
-
return false;
|
|
2047
|
-
}
|
|
2048
|
-
return true;
|
|
2049
|
-
};
|
|
2050
|
-
const handleSubmit = async (e) => {
|
|
2051
|
-
e.preventDefault();
|
|
2052
|
-
if (!validateEmail()) {
|
|
2053
|
-
setShowRecaptcha(false);
|
|
2054
|
-
return;
|
|
2055
|
-
}
|
|
2056
|
-
setShowRecaptcha(true);
|
|
2057
|
-
};
|
|
2058
|
-
const handleVerifiedSubmit = async (token) => {
|
|
2059
|
-
if (!token) {
|
|
2060
|
-
toast4.custom(
|
|
2061
|
-
() => /* @__PURE__ */ jsxs27(Alert4, { variant: "mono", icon: "destructive", children: [
|
|
2062
|
-
/* @__PURE__ */ jsx39(AlertIcon4, { children: /* @__PURE__ */ jsx39(CircleAlertIcon4, {}) }),
|
|
2063
|
-
/* @__PURE__ */ jsx39(AlertTitle4, { children: recaptchaMessage })
|
|
2064
|
-
] }),
|
|
2065
|
-
{
|
|
2066
|
-
position: "top-center"
|
|
2067
|
-
}
|
|
2068
|
-
);
|
|
2069
|
-
return;
|
|
2070
|
-
}
|
|
2071
|
-
setLoading(true);
|
|
2072
|
-
setShowRecaptcha(false);
|
|
2073
|
-
try {
|
|
2074
|
-
googleTrackEvent3({
|
|
2075
|
-
name: "site_newsletter_subscribe_submit",
|
|
2076
|
-
properties: {
|
|
2077
|
-
category: "conversion",
|
|
2078
|
-
label: "Newsletter Subscribe Submit",
|
|
2079
|
-
email
|
|
2080
|
-
}
|
|
2081
|
-
});
|
|
2082
|
-
const res = await fetch(apiEndpoint, {
|
|
2083
|
-
method: "POST",
|
|
2084
|
-
headers: {
|
|
2085
|
-
"Content-Type": "application/json",
|
|
2086
|
-
"x-recaptcha-token": token
|
|
2087
|
-
},
|
|
2088
|
-
body: JSON.stringify({ email })
|
|
2089
|
-
});
|
|
2090
|
-
const data = await res.json();
|
|
2091
|
-
if (res.ok) {
|
|
2092
|
-
toast4.custom(
|
|
2093
|
-
() => /* @__PURE__ */ jsxs27(Alert4, { variant: "mono", icon: "success", children: [
|
|
2094
|
-
/* @__PURE__ */ jsx39(AlertIcon4, { children: /* @__PURE__ */ jsx39(CircleCheckIcon2, {}) }),
|
|
2095
|
-
/* @__PURE__ */ jsx39(AlertTitle4, { children: successMessage })
|
|
2096
|
-
] }),
|
|
2097
|
-
{
|
|
2098
|
-
position: "top-center"
|
|
2099
|
-
}
|
|
2100
|
-
);
|
|
2101
|
-
googleTrackEvent3({
|
|
2102
|
-
name: "site_newsletter_subscribe_success",
|
|
2103
|
-
properties: {
|
|
2104
|
-
category: "conversion",
|
|
2105
|
-
label: "Newsletter Subscribe Success",
|
|
2106
|
-
email
|
|
2107
|
-
}
|
|
2108
|
-
});
|
|
2109
|
-
setEmail("");
|
|
2110
|
-
} else {
|
|
2111
|
-
toast4.custom(
|
|
2112
|
-
() => /* @__PURE__ */ jsxs27(Alert4, { variant: "mono", icon: "destructive", children: [
|
|
2113
|
-
/* @__PURE__ */ jsx39(AlertIcon4, { children: /* @__PURE__ */ jsx39(CircleAlertIcon4, {}) }),
|
|
2114
|
-
/* @__PURE__ */ jsx39(AlertTitle4, { children: data.message || errorMessage })
|
|
2115
|
-
] }),
|
|
2116
|
-
{
|
|
2117
|
-
position: "top-center"
|
|
2118
|
-
}
|
|
2119
|
-
);
|
|
2120
|
-
}
|
|
2121
|
-
} catch (err) {
|
|
2122
|
-
console.error("Newsletter subscription error:", err);
|
|
2123
|
-
toast4.custom(
|
|
2124
|
-
() => /* @__PURE__ */ jsxs27(Alert4, { variant: "mono", icon: "destructive", children: [
|
|
2125
|
-
/* @__PURE__ */ jsx39(AlertIcon4, { children: /* @__PURE__ */ jsx39(CircleAlertIcon4, {}) }),
|
|
2126
|
-
/* @__PURE__ */ jsx39(AlertTitle4, { children: errorMessage })
|
|
2127
|
-
] }),
|
|
2128
|
-
{
|
|
2129
|
-
position: "top-center"
|
|
2130
|
-
}
|
|
2131
|
-
);
|
|
2132
|
-
} finally {
|
|
2133
|
-
setLoading(false);
|
|
2134
|
-
}
|
|
2135
|
-
};
|
|
2136
|
-
const style = {
|
|
2137
|
-
backgroundImage: `linear-gradient(0deg, transparent 0%, transparent 60%, rgba(183, 183, 183, 0.05) 60%, rgba(183, 183, 183, 0.05) 93%, transparent 93%, transparent 100%), linear-gradient(135deg, transparent 0%, transparent 55%, rgba(183, 183, 183, 0.05) 55%, rgba(183, 183, 183, 0.05) 84%, transparent 84%, transparent 100%), linear-gradient(0deg, transparent 0%, transparent 80%, rgba(183, 183, 183, 0.05) 80%, rgba(183, 183, 183, 0.05) 94%, transparent 94%, transparent 100%), linear-gradient(90deg, rgb(0,0,0), rgb(0,0,0))`
|
|
2138
|
-
};
|
|
2139
|
-
return /* @__PURE__ */ jsx39("footer", { children: /* @__PURE__ */ jsx39("div", { className: "container pt-10", children: /* @__PURE__ */ jsxs27(
|
|
2140
|
-
"div",
|
|
2141
|
-
{
|
|
2142
|
-
className: `mt-10 mb-8 flex flex-wrap items-center justify-between gap-7 rounded-xl px-10 py-16 md:px-20 ${className || ""}`,
|
|
2143
|
-
style,
|
|
2144
|
-
children: [
|
|
2145
|
-
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1.5", children: [
|
|
2146
|
-
/* @__PURE__ */ jsx39("h2", { className: "font-medium text-3xl text-white", children: heading }),
|
|
2147
|
-
/* @__PURE__ */ jsx39("div", { className: "font-medium text-2xl text-white/50", children: subheading })
|
|
2148
|
-
] }),
|
|
2149
|
-
/* @__PURE__ */ jsxs27("form", { onSubmit: handleSubmit, className: "flex gap-2.5", children: [
|
|
2150
|
-
/* @__PURE__ */ jsx39(
|
|
2151
|
-
Input,
|
|
2152
|
-
{
|
|
2153
|
-
type: "email",
|
|
2154
|
-
value: email,
|
|
2155
|
-
onChange: (e) => {
|
|
2156
|
-
setEmail(e.target.value);
|
|
2157
|
-
setShowRecaptcha(false);
|
|
2158
|
-
},
|
|
2159
|
-
placeholder: inputPlaceholder,
|
|
2160
|
-
className: "h-auto rounded-lg border border-input/20 bg-white/5 px-5 py-3 text-white/80 placeholder:text-white/50 focus:outline-none focus:ring md:min-w-64",
|
|
2161
|
-
required: true
|
|
2162
|
-
}
|
|
2163
|
-
),
|
|
2164
|
-
/* @__PURE__ */ jsx39(
|
|
2165
|
-
RecaptchaPopover,
|
|
2166
|
-
{
|
|
2167
|
-
open: showRecaptcha,
|
|
2168
|
-
onOpenChange: (open) => {
|
|
2169
|
-
if (!open) {
|
|
2170
|
-
setShowRecaptcha(false);
|
|
2171
|
-
}
|
|
2172
|
-
},
|
|
2173
|
-
onVerify: handleVerifiedSubmit,
|
|
2174
|
-
verifyButtonText,
|
|
2175
|
-
trigger: /* @__PURE__ */ jsx39(
|
|
2176
|
-
Button8,
|
|
2177
|
-
{
|
|
2178
|
-
type: "submit",
|
|
2179
|
-
className: "h-auto rounded-lg bg-white px-5 py-3 font-semibold text-black/80 hover:bg-white hover:text-black",
|
|
2180
|
-
disabled: loading,
|
|
2181
|
-
children: loading ? loadingButtonText : buttonText
|
|
2182
|
-
}
|
|
2183
|
-
)
|
|
2184
|
-
}
|
|
2185
|
-
)
|
|
2186
|
-
] })
|
|
2187
|
-
]
|
|
2188
|
-
}
|
|
2189
|
-
) }) });
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
3852
|
// src/components/ui/toolbar.tsx
|
|
2193
|
-
import {
|
|
2194
|
-
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3853
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2195
3854
|
var Toolbar = ({ children }) => {
|
|
2196
|
-
return /* @__PURE__ */
|
|
3855
|
+
return /* @__PURE__ */ jsx39("div", { className: "flex grow items-center justify-between gap-2.5 pb-5", children });
|
|
2197
3856
|
};
|
|
2198
3857
|
var ToolbarHeading = ({ children, className }) => {
|
|
2199
|
-
return /* @__PURE__ */
|
|
3858
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("flex flex-col flex-wrap gap-px", className), children });
|
|
2200
3859
|
};
|
|
2201
3860
|
var ToolbarTitle = ({ className, children }) => {
|
|
2202
|
-
return /* @__PURE__ */
|
|
3861
|
+
return /* @__PURE__ */ jsx39("h1", { className: cn("font-semibold text-foreground text-lg", className), children });
|
|
2203
3862
|
};
|
|
2204
3863
|
var ToolbarActions = ({ children }) => {
|
|
2205
|
-
return /* @__PURE__ */
|
|
3864
|
+
return /* @__PURE__ */ jsx39("div", { className: "flex flex-wrap items-center gap-1.5 lg:gap-3.5", children });
|
|
2206
3865
|
};
|
|
2207
3866
|
|
|
2208
3867
|
// src/components/ui/user-avatar.tsx
|
|
2209
|
-
import {
|
|
2210
|
-
|
|
2211
|
-
AvatarFallback,
|
|
2212
|
-
AvatarImage,
|
|
2213
|
-
AvatarIndicator,
|
|
2214
|
-
AvatarStatus
|
|
2215
|
-
} from "@pelatform/ui.default";
|
|
2216
|
-
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2217
|
-
function UserAvatar({ className, indicator = false, src, alt }) {
|
|
3868
|
+
import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3869
|
+
function UserAvatar({ className, src, alt }) {
|
|
2218
3870
|
const name = alt ?? "User";
|
|
2219
3871
|
const initial = getInitials(name);
|
|
2220
|
-
return /* @__PURE__ */
|
|
2221
|
-
/* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2223
|
-
indicator && /* @__PURE__ */ jsx41(AvatarIndicator, { className: "-end-2 -top-2", children: /* @__PURE__ */ jsx41(AvatarStatus, { variant: "online", className: "size-2.5" }) })
|
|
3872
|
+
return /* @__PURE__ */ jsxs26(Avatar, { className, children: [
|
|
3873
|
+
/* @__PURE__ */ jsx40(AvatarImage, { src: src ?? void 0, alt: name }),
|
|
3874
|
+
/* @__PURE__ */ jsx40(AvatarFallback, { children: initial })
|
|
2224
3875
|
] });
|
|
2225
3876
|
}
|
|
2226
3877
|
var getInitials = (name, count) => {
|
|
@@ -2232,7 +3883,7 @@ var getInitials = (name, count) => {
|
|
|
2232
3883
|
};
|
|
2233
3884
|
|
|
2234
3885
|
// src/components/utils/fonts.tsx
|
|
2235
|
-
import { jsx as
|
|
3886
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2236
3887
|
var satoshiFontUrl = "https://assets.pelatform.com/fonts/satoshi/Satoshi-Variable.woff2";
|
|
2237
3888
|
var cssFontFace = `
|
|
2238
3889
|
@font-face {
|
|
@@ -2244,7 +3895,7 @@ var cssFontFace = `
|
|
|
2244
3895
|
}
|
|
2245
3896
|
`;
|
|
2246
3897
|
function SatoshiFontCSS() {
|
|
2247
|
-
return /* @__PURE__ */
|
|
3898
|
+
return /* @__PURE__ */ jsx41("style", { dangerouslySetInnerHTML: { __html: cssFontFace } });
|
|
2248
3899
|
}
|
|
2249
3900
|
export {
|
|
2250
3901
|
AlertComingsoon,
|
|
@@ -2287,14 +3938,12 @@ export {
|
|
|
2287
3938
|
MovingBorder,
|
|
2288
3939
|
MovingLabel,
|
|
2289
3940
|
QueryProvider,
|
|
2290
|
-
RecaptchaPopover,
|
|
2291
3941
|
SatoshiFontCSS,
|
|
2292
3942
|
ScreenLoader,
|
|
2293
3943
|
Section,
|
|
2294
3944
|
SiteFooter,
|
|
2295
3945
|
SiteHeader,
|
|
2296
3946
|
Stack,
|
|
2297
|
-
Subscribe,
|
|
2298
3947
|
ThemeProvider,
|
|
2299
3948
|
Toolbar,
|
|
2300
3949
|
ToolbarActions,
|
|
@@ -2310,7 +3959,6 @@ export {
|
|
|
2310
3959
|
getImage,
|
|
2311
3960
|
getInitials,
|
|
2312
3961
|
getListFiles,
|
|
2313
|
-
handleMenuClick,
|
|
2314
3962
|
openFileDialog,
|
|
2315
3963
|
satoshiFontUrl
|
|
2316
3964
|
};
|