@tailor-platform/app-shell 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-shell.css +1 -1
- package/dist/app-shell.js +749 -389
- package/dist/index.d.ts +131 -0
- package/package.json +1 -1
package/dist/app-shell.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as l, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { useRouteError as
|
|
5
|
-
import { Link as
|
|
6
|
-
import { Slot as
|
|
7
|
-
import { cva as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { twMerge as
|
|
10
|
-
import { AlertCircle as
|
|
11
|
-
import { capitalCase as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import * as
|
|
1
|
+
import { jsx as a, jsxs as l, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { createContext as K, useContext as U, useState as k, useMemo as _, useEffect as C, Suspense as ht, useRef as _t, useCallback as at } from "react";
|
|
4
|
+
import { useRouteError as zt, isRouteErrorResponse as Ft, Outlet as H, NavLink as Ot, redirect as ft, Navigate as $t, useRouteLoaderData as Wt, createMemoryRouter as jt, createBrowserRouter as Kt, RouterProvider as Ut, useHref as Ht, Link as Vt, useLocation as gt, useMatch as Qt, Await as pt, useNavigate as qt } from "react-router";
|
|
5
|
+
import { Link as ns, useLocation as os, useNavigate as is, useParams as ls, useRouteError as ds, useSearchParams as cs } from "react-router";
|
|
6
|
+
import { Slot as P } from "@radix-ui/react-slot";
|
|
7
|
+
import { cva as V } from "class-variance-authority";
|
|
8
|
+
import { clsx as Gt } from "clsx";
|
|
9
|
+
import { twMerge as Yt } from "tailwind-merge";
|
|
10
|
+
import { AlertCircle as st, Table as Xt, XIcon as bt, PanelLeftIcon as Zt, ChevronRight as $, SunIcon as Jt, SearchIcon as te, ExternalLink as ee, Check as ae, Copy as se } from "lucide-react";
|
|
11
|
+
import { capitalCase as L } from "change-case";
|
|
12
|
+
import { Toaster as re } from "sonner";
|
|
13
|
+
import * as Q from "@radix-ui/react-collapsible";
|
|
14
14
|
import "@radix-ui/react-separator";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import { print as
|
|
18
|
-
import { createAuthClient as
|
|
15
|
+
import * as v from "@radix-ui/react-dialog";
|
|
16
|
+
import * as R from "@radix-ui/react-tooltip";
|
|
17
|
+
import { print as ne } from "graphql";
|
|
18
|
+
import { createAuthClient as oe } from "@tailor-platform/auth-browser-client";
|
|
19
19
|
function u(...t) {
|
|
20
|
-
return
|
|
20
|
+
return Yt(Gt(t));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const ie = V(
|
|
23
23
|
"astw:inline-flex astw:items-center astw:justify-center astw:gap-2 astw:whitespace-nowrap astw:rounded-md astw:text-sm astw:font-medium astw:transition-all astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:[&_svg]:pointer-events-none astw:[&_svg:not([class*='size-'])]:size-4 astw:shrink-0 astw:[&_svg]:shrink-0 astw:outline-none astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px] astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
@@ -44,7 +44,7 @@ const Gt = lt(
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
function
|
|
47
|
+
function D({
|
|
48
48
|
className: t,
|
|
49
49
|
variant: e,
|
|
50
50
|
size: s,
|
|
@@ -52,30 +52,30 @@ function P({
|
|
|
52
52
|
...n
|
|
53
53
|
}) {
|
|
54
54
|
return /* @__PURE__ */ a(
|
|
55
|
-
r ?
|
|
55
|
+
r ? P : "button",
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "button",
|
|
58
|
-
className: u(
|
|
58
|
+
className: u(ie({ variant: e, size: s, className: t })),
|
|
59
59
|
...n
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const I = "en", le = () => {
|
|
64
64
|
try {
|
|
65
65
|
if (typeof navigator > "u")
|
|
66
|
-
return
|
|
66
|
+
return I;
|
|
67
67
|
const t = navigator.languages?.[0] ?? navigator.language;
|
|
68
|
-
return t ? new Intl.Locale(t).language :
|
|
68
|
+
return t ? new Intl.Locale(t).language : I;
|
|
69
69
|
} catch {
|
|
70
|
-
return
|
|
70
|
+
return I;
|
|
71
71
|
}
|
|
72
|
-
},
|
|
73
|
-
const e =
|
|
74
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
75
|
-
},
|
|
76
|
-
const { configurations: t } =
|
|
72
|
+
}, q = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, vt = (t) => {
|
|
73
|
+
const e = q(t);
|
|
74
|
+
return (s, r) => e(s, typeof s == "string" ? s : L(r));
|
|
75
|
+
}, de = () => {
|
|
76
|
+
const { configurations: t } = T(), e = q(t.locale);
|
|
77
77
|
return (s, r) => e(s, r);
|
|
78
|
-
},
|
|
78
|
+
}, ce = (t) => {
|
|
79
79
|
const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
|
|
80
80
|
return {
|
|
81
81
|
/**
|
|
@@ -98,7 +98,7 @@ const D = "en", Xt = () => {
|
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
100
|
useT: () => {
|
|
101
|
-
const { configurations: s } =
|
|
101
|
+
const { configurations: s } = T(), r = e(s.locale);
|
|
102
102
|
return ((n, ...o) => {
|
|
103
103
|
const i = r(n);
|
|
104
104
|
return typeof i == "function" ? i(o[0]) : i;
|
|
@@ -131,7 +131,7 @@ const D = "en", Xt = () => {
|
|
|
131
131
|
return typeof o == "function" ? o(r[0]) : o;
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
},
|
|
134
|
+
}, we = ce({
|
|
135
135
|
en: {
|
|
136
136
|
error404Title: "404 Not Found",
|
|
137
137
|
error404Body: "The page you requested could not be found.",
|
|
@@ -170,19 +170,19 @@ const D = "en", Xt = () => {
|
|
|
170
170
|
commandPaletteSearch: "ページを検索...",
|
|
171
171
|
commandPaletteNoResults: "結果が見つかりません"
|
|
172
172
|
}
|
|
173
|
-
}),
|
|
174
|
-
const t =
|
|
173
|
+
}), B = we.useT, M = () => {
|
|
174
|
+
const t = zt(), e = B(), s = {
|
|
175
175
|
role: "alert",
|
|
176
176
|
"aria-label": "default-error-boundary"
|
|
177
177
|
};
|
|
178
|
-
if (
|
|
178
|
+
if (Ft(t) && t.status === 404)
|
|
179
179
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
180
|
-
/* @__PURE__ */ a(
|
|
180
|
+
/* @__PURE__ */ a(st, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
181
181
|
/* @__PURE__ */ l("div", { children: [
|
|
182
182
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
183
183
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
184
184
|
/* @__PURE__ */ a(
|
|
185
|
-
|
|
185
|
+
D,
|
|
186
186
|
{
|
|
187
187
|
variant: "outline",
|
|
188
188
|
size: "sm",
|
|
@@ -195,12 +195,12 @@ const D = "en", Xt = () => {
|
|
|
195
195
|
] }) });
|
|
196
196
|
const r = t instanceof Error ? t.message : e("errorUnexpected");
|
|
197
197
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
198
|
-
/* @__PURE__ */ a(
|
|
198
|
+
/* @__PURE__ */ a(st, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
199
199
|
/* @__PURE__ */ l("div", { children: [
|
|
200
200
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
201
201
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
|
|
202
202
|
/* @__PURE__ */ a(
|
|
203
|
-
|
|
203
|
+
D,
|
|
204
204
|
{
|
|
205
205
|
variant: "outline",
|
|
206
206
|
size: "sm",
|
|
@@ -211,35 +211,35 @@ const D = "en", Xt = () => {
|
|
|
211
211
|
)
|
|
212
212
|
] })
|
|
213
213
|
] }) });
|
|
214
|
-
},
|
|
214
|
+
}, ue = (t) => ({
|
|
215
215
|
modules: t.modules,
|
|
216
216
|
settingsResources: t.settingsResources ?? [],
|
|
217
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
217
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(M, {}),
|
|
218
218
|
basePath: t.basePath,
|
|
219
|
-
locale: t.locale ??
|
|
220
|
-
}),
|
|
219
|
+
locale: t.locale ?? le()
|
|
220
|
+
}), xt = K({
|
|
221
221
|
configurations: {
|
|
222
222
|
modules: [],
|
|
223
223
|
settingsResources: [],
|
|
224
|
-
errorBoundary: /* @__PURE__ */ a(
|
|
225
|
-
locale:
|
|
224
|
+
errorBoundary: /* @__PURE__ */ a(M, {}),
|
|
225
|
+
locale: I
|
|
226
226
|
}
|
|
227
|
-
}),
|
|
228
|
-
const t =
|
|
229
|
-
return /* @__PURE__ */ l(
|
|
227
|
+
}), T = () => U(xt), me = () => {
|
|
228
|
+
const t = B();
|
|
229
|
+
return /* @__PURE__ */ l(E, { children: [
|
|
230
230
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
231
231
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
232
232
|
] });
|
|
233
|
-
},
|
|
234
|
-
/* @__PURE__ */ a(
|
|
235
|
-
/* @__PURE__ */ a(
|
|
236
|
-
] }),
|
|
237
|
-
const { configurations: t } =
|
|
233
|
+
}, rt = () => /* @__PURE__ */ l(E, { children: [
|
|
234
|
+
/* @__PURE__ */ a(H, {}),
|
|
235
|
+
/* @__PURE__ */ a(re, {})
|
|
236
|
+
] }), he = () => {
|
|
237
|
+
const { configurations: t } = T(), e = B(), s = de();
|
|
238
238
|
return /* @__PURE__ */ l("div", { className: "astw:mx-auto astw:flex-col astw:flex astw:md:flex-row astw:max-w-5xl astw:gap-[10px] astw:w-full", children: [
|
|
239
239
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ l("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
|
|
240
240
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
241
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
242
|
-
|
|
241
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Ot, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ l(
|
|
242
|
+
D,
|
|
243
243
|
{
|
|
244
244
|
variant: n ? "secondary" : "ghost",
|
|
245
245
|
className: "astw:w-full astw:justify-start",
|
|
@@ -250,9 +250,9 @@ const D = "en", Xt = () => {
|
|
|
250
250
|
}
|
|
251
251
|
) }) }, r.path)) })
|
|
252
252
|
] }) }),
|
|
253
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
253
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(H, {}) })
|
|
254
254
|
] });
|
|
255
|
-
},
|
|
255
|
+
}, yt = () => new Response("Not Found", { status: 404 }), G = async (t, e) => {
|
|
256
256
|
if (!t) return { state: "visible" };
|
|
257
257
|
const s = new URL(e.request.url);
|
|
258
258
|
return await t({
|
|
@@ -260,59 +260,59 @@ const D = "en", Xt = () => {
|
|
|
260
260
|
searchParams: s.searchParams,
|
|
261
261
|
signal: e.request.signal
|
|
262
262
|
}) ?? { state: "visible" };
|
|
263
|
-
},
|
|
264
|
-
switch ((await
|
|
263
|
+
}, Nt = (t, e) => async (s) => {
|
|
264
|
+
switch ((await G(t, s)).state) {
|
|
265
265
|
case "hidden":
|
|
266
|
-
throw
|
|
266
|
+
throw yt();
|
|
267
267
|
case "visible":
|
|
268
268
|
return e ? e(s) : null;
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
|
-
function
|
|
271
|
+
function qa(t) {
|
|
272
272
|
return {
|
|
273
273
|
redirectTo: t
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function W(t) {
|
|
277
277
|
return typeof t == "object" && t !== null && "redirectTo" in t;
|
|
278
278
|
}
|
|
279
|
-
const
|
|
280
|
-
const { configurations: s } =
|
|
279
|
+
const Ct = (t, e) => () => {
|
|
280
|
+
const { configurations: s } = T(), { metaTitle: r, fallbackTitle: n } = t, i = q(s.locale)(r, n);
|
|
281
281
|
return e(i);
|
|
282
282
|
};
|
|
283
|
-
function
|
|
284
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, d = s?.title ??
|
|
283
|
+
function Ga(t) {
|
|
284
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, accessControl: i } = t, d = s?.title ?? L(e), w = L(e), c = W(r) ? {
|
|
285
285
|
// Use loader for redirects
|
|
286
286
|
component: () => null,
|
|
287
|
-
baseLoader: () =>
|
|
287
|
+
baseLoader: () => ft(r.redirectTo)
|
|
288
288
|
} : {
|
|
289
289
|
// Regular component with locale-aware title
|
|
290
|
-
component:
|
|
290
|
+
component: Ct(
|
|
291
291
|
{ metaTitle: d, fallbackTitle: w },
|
|
292
|
-
(
|
|
292
|
+
(g) => r({ title: g, resources: n })
|
|
293
293
|
),
|
|
294
294
|
baseLoader: void 0
|
|
295
|
-
},
|
|
295
|
+
}, m = i || c.baseLoader ? Nt(i, c.baseLoader) : void 0;
|
|
296
296
|
return {
|
|
297
297
|
path: e,
|
|
298
298
|
type: "component",
|
|
299
299
|
_type: "module",
|
|
300
300
|
component: c.component,
|
|
301
|
-
loader:
|
|
301
|
+
loader: m,
|
|
302
302
|
meta: {
|
|
303
303
|
title: d,
|
|
304
304
|
...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
|
|
305
305
|
...s,
|
|
306
|
-
menuItemClickable: !
|
|
306
|
+
menuItemClickable: !W(r),
|
|
307
307
|
icon: t.meta?.icon
|
|
308
308
|
},
|
|
309
309
|
resources: n,
|
|
310
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
310
|
+
errorBoundary: o || /* @__PURE__ */ a(M, {}),
|
|
311
311
|
accessControl: i
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, d = n?.title ??
|
|
314
|
+
function Ya(t) {
|
|
315
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, accessControl: i } = t, d = n?.title ?? L(e), w = L(e), c = i ? Nt(i) : void 0;
|
|
316
316
|
return {
|
|
317
317
|
_type: "resource",
|
|
318
318
|
type: "component",
|
|
@@ -322,17 +322,17 @@ function xa(t) {
|
|
|
322
322
|
icon: n?.icon,
|
|
323
323
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
324
324
|
},
|
|
325
|
-
component:
|
|
325
|
+
component: Ct(
|
|
326
326
|
{ metaTitle: d, fallbackTitle: w },
|
|
327
|
-
(
|
|
327
|
+
(m) => s({ title: m, resources: r })
|
|
328
328
|
),
|
|
329
329
|
subResources: r,
|
|
330
|
-
errorBoundary: o ?? /* @__PURE__ */ a(
|
|
330
|
+
errorBoundary: o ?? /* @__PURE__ */ a(M, {}),
|
|
331
331
|
accessControl: i,
|
|
332
332
|
loader: c
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const Y = (t) => () => /* @__PURE__ */ a(E, { children: t }), St = (t, e, s) => {
|
|
336
336
|
const r = t.errorBoundary || s, n = {
|
|
337
337
|
index: !0,
|
|
338
338
|
Component: t.component,
|
|
@@ -341,38 +341,38 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
341
341
|
return {
|
|
342
342
|
path: t.path,
|
|
343
343
|
...t.errorBoundary && {
|
|
344
|
-
ErrorBoundary:
|
|
344
|
+
ErrorBoundary: Y(t.errorBoundary)
|
|
345
345
|
},
|
|
346
346
|
...e && e.length > 0 ? {
|
|
347
347
|
children: [
|
|
348
348
|
n,
|
|
349
349
|
...e.map(
|
|
350
|
-
(o) =>
|
|
350
|
+
(o) => St(o, o.subResources, r)
|
|
351
351
|
)
|
|
352
352
|
]
|
|
353
353
|
} : {
|
|
354
354
|
children: [n]
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
},
|
|
358
|
-
(e) =>
|
|
359
|
-
),
|
|
357
|
+
}, fe = (t) => t.map(
|
|
358
|
+
(e) => St(e, e.resources, e.errorBoundary)
|
|
359
|
+
), ge = ({
|
|
360
360
|
modules: t,
|
|
361
361
|
settingsResources: e,
|
|
362
362
|
rootComponent: s
|
|
363
363
|
}) => {
|
|
364
|
-
const r =
|
|
364
|
+
const r = W(s) ? {
|
|
365
365
|
index: !0,
|
|
366
|
-
loader: () =>
|
|
366
|
+
loader: () => ft(s.redirectTo)
|
|
367
367
|
} : {
|
|
368
368
|
index: !0,
|
|
369
|
-
Component: s ??
|
|
369
|
+
Component: s ?? me
|
|
370
370
|
}, n = e.length > 0 ? [
|
|
371
371
|
{
|
|
372
372
|
path: "settings",
|
|
373
373
|
index: !0,
|
|
374
374
|
Component: () => /* @__PURE__ */ a(
|
|
375
|
-
|
|
375
|
+
$t,
|
|
376
376
|
{
|
|
377
377
|
to: e[0].path,
|
|
378
378
|
relative: "path",
|
|
@@ -382,12 +382,12 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
382
382
|
},
|
|
383
383
|
{
|
|
384
384
|
path: "settings",
|
|
385
|
-
Component:
|
|
385
|
+
Component: he,
|
|
386
386
|
children: e.map((o) => ({
|
|
387
387
|
path: o.path,
|
|
388
388
|
Component: o.component,
|
|
389
389
|
...o.errorBoundary && {
|
|
390
|
-
ErrorBoundary:
|
|
390
|
+
ErrorBoundary: Y(o.errorBoundary)
|
|
391
391
|
}
|
|
392
392
|
}))
|
|
393
393
|
}
|
|
@@ -395,29 +395,29 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
395
395
|
return [
|
|
396
396
|
r,
|
|
397
397
|
{
|
|
398
|
-
children:
|
|
398
|
+
children: fe(t)
|
|
399
399
|
},
|
|
400
400
|
...n,
|
|
401
401
|
{
|
|
402
402
|
path: "*",
|
|
403
403
|
loader: () => {
|
|
404
|
-
throw
|
|
404
|
+
throw yt();
|
|
405
405
|
},
|
|
406
406
|
// Component is required to suppress React Router's warning about empty leaf routes,
|
|
407
407
|
// even though the loader always throws and this component will never render.
|
|
408
408
|
Component: () => null,
|
|
409
|
-
ErrorBoundary:
|
|
409
|
+
ErrorBoundary: M
|
|
410
410
|
}
|
|
411
411
|
];
|
|
412
|
-
},
|
|
413
|
-
loaderID:
|
|
414
|
-
loader: async (e) => ({ navItems:
|
|
415
|
-
}),
|
|
416
|
-
const s =
|
|
412
|
+
}, Tt = "appshell-root-nav", pe = (t) => ({
|
|
413
|
+
loaderID: Tt,
|
|
414
|
+
loader: async (e) => ({ navItems: be(t, e) })
|
|
415
|
+
}), kt = () => Wt(Tt)?.navItems, be = async (t, e) => {
|
|
416
|
+
const s = vt(t.locale);
|
|
417
417
|
return (await Promise.all(
|
|
418
418
|
t.modules.map(async (n) => {
|
|
419
|
-
if (n.path.startsWith(":") || (await
|
|
420
|
-
const i = await
|
|
419
|
+
if (n.path.startsWith(":") || (await G(n.accessControl, e)).state !== "visible") return null;
|
|
420
|
+
const i = await Rt(
|
|
421
421
|
n.resources,
|
|
422
422
|
n.path,
|
|
423
423
|
e,
|
|
@@ -428,13 +428,13 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
428
428
|
)).filter((n) => n !== null).map(({ module: n, resources: o }) => ({
|
|
429
429
|
title: s(n.meta.title, n.path),
|
|
430
430
|
url: n.meta.menuItemClickable ? n.path : void 0,
|
|
431
|
-
icon: n.meta.icon || /* @__PURE__ */ a(
|
|
431
|
+
icon: n.meta.icon || /* @__PURE__ */ a(Xt, {}),
|
|
432
432
|
items: o
|
|
433
433
|
}));
|
|
434
|
-
},
|
|
434
|
+
}, Rt = async (t, e, s, r) => (await Promise.all(
|
|
435
435
|
t.map(async (o) => {
|
|
436
|
-
if (o.path.startsWith(":") || (await
|
|
437
|
-
const d = `${e}/${o.path}`, w = r(o.meta.title, o.path), c = o.subResources ? await
|
|
436
|
+
if (o.path.startsWith(":") || (await G(o.accessControl, s)).state !== "visible") return null;
|
|
437
|
+
const d = `${e}/${o.path}`, w = r(o.meta.title, o.path), c = o.subResources ? await Rt(
|
|
438
438
|
o.subResources,
|
|
439
439
|
d,
|
|
440
440
|
s,
|
|
@@ -446,12 +446,12 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
446
446
|
items: c && c.length > 0 ? c : void 0
|
|
447
447
|
};
|
|
448
448
|
})
|
|
449
|
-
)).filter((o) => o !== null),
|
|
450
|
-
const { configurations: e } =
|
|
449
|
+
)).filter((o) => o !== null), ve = (t) => {
|
|
450
|
+
const { configurations: e } = T(), { rootComponent: s, children: r } = t, n = ge({
|
|
451
451
|
modules: e.modules,
|
|
452
452
|
settingsResources: e.settingsResources,
|
|
453
453
|
rootComponent: s
|
|
454
|
-
}), o = e.errorBoundary, { loaderID: i, loader: d } =
|
|
454
|
+
}), o = e.errorBoundary, { loaderID: i, loader: d } = pe({
|
|
455
455
|
modules: e.modules,
|
|
456
456
|
locale: e.locale
|
|
457
457
|
}), w = [
|
|
@@ -461,8 +461,8 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
461
461
|
element: r,
|
|
462
462
|
children: o ? [
|
|
463
463
|
{
|
|
464
|
-
element: /* @__PURE__ */ a(
|
|
465
|
-
ErrorBoundary:
|
|
464
|
+
element: /* @__PURE__ */ a(H, {}),
|
|
465
|
+
ErrorBoundary: Y(o),
|
|
466
466
|
children: n
|
|
467
467
|
}
|
|
468
468
|
] : n,
|
|
@@ -472,28 +472,28 @@ const Q = (t) => () => /* @__PURE__ */ a(R, { children: t }), ft = (t, e, s) =>
|
|
|
472
472
|
*/
|
|
473
473
|
HydrateFallback: () => null
|
|
474
474
|
}
|
|
475
|
-
], c = e.basePath ? "/" + e.basePath : void 0,
|
|
475
|
+
], c = e.basePath ? "/" + e.basePath : void 0, m = t.memory ? jt(w, {
|
|
476
476
|
basename: c,
|
|
477
477
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
478
|
-
}) :
|
|
478
|
+
}) : Kt(w, {
|
|
479
479
|
basename: c
|
|
480
480
|
});
|
|
481
|
-
return /* @__PURE__ */ a(
|
|
482
|
-
},
|
|
481
|
+
return /* @__PURE__ */ a(Ut, { router: m });
|
|
482
|
+
}, xe = {
|
|
483
483
|
resolvedTheme: "light",
|
|
484
484
|
theme: "system",
|
|
485
485
|
setTheme: () => null
|
|
486
|
-
},
|
|
487
|
-
function
|
|
486
|
+
}, Bt = K(xe);
|
|
487
|
+
function ye({
|
|
488
488
|
children: t,
|
|
489
489
|
storageKey: e,
|
|
490
490
|
defaultTheme: s = "system",
|
|
491
491
|
...r
|
|
492
492
|
}) {
|
|
493
|
-
const [n, o] =
|
|
493
|
+
const [n, o] = k(
|
|
494
494
|
() => localStorage.getItem(e) || s
|
|
495
|
-
), i =
|
|
496
|
-
|
|
495
|
+
), i = _(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
496
|
+
C(() => {
|
|
497
497
|
const w = window.document.documentElement;
|
|
498
498
|
w.classList.remove("light", "dark"), w.classList.add(i);
|
|
499
499
|
}, [i]);
|
|
@@ -504,69 +504,69 @@ function de({
|
|
|
504
504
|
localStorage.setItem(e, w), o(w);
|
|
505
505
|
}
|
|
506
506
|
};
|
|
507
|
-
return /* @__PURE__ */ a(
|
|
507
|
+
return /* @__PURE__ */ a(Bt.Provider, { ...r, value: d, children: t });
|
|
508
508
|
}
|
|
509
|
-
const
|
|
510
|
-
const t =
|
|
509
|
+
const Ne = () => {
|
|
510
|
+
const t = U(Bt);
|
|
511
511
|
if (t === void 0)
|
|
512
512
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
513
513
|
return t;
|
|
514
|
-
},
|
|
515
|
-
const [e, s] =
|
|
516
|
-
return
|
|
514
|
+
}, Xa = (t) => {
|
|
515
|
+
const [e, s] = k(!1);
|
|
516
|
+
return C(function() {
|
|
517
517
|
s(!0);
|
|
518
518
|
}, []), e ? /* @__PURE__ */ a(
|
|
519
|
-
|
|
519
|
+
xt.Provider,
|
|
520
520
|
{
|
|
521
521
|
value: {
|
|
522
522
|
title: t.title,
|
|
523
523
|
icon: t.icon,
|
|
524
|
-
configurations:
|
|
524
|
+
configurations: ue(t)
|
|
525
525
|
},
|
|
526
|
-
children: /* @__PURE__ */ a(
|
|
526
|
+
children: /* @__PURE__ */ a(ye, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ve, { rootComponent: t.rootComponent, children: t.children }) })
|
|
527
527
|
}
|
|
528
528
|
) : null;
|
|
529
529
|
};
|
|
530
|
-
function
|
|
530
|
+
function Ce({
|
|
531
531
|
...t
|
|
532
532
|
}) {
|
|
533
|
-
return /* @__PURE__ */ a(
|
|
533
|
+
return /* @__PURE__ */ a(Q.Root, { "data-slot": "collapsible", ...t });
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function nt({
|
|
536
536
|
...t
|
|
537
537
|
}) {
|
|
538
538
|
return /* @__PURE__ */ a(
|
|
539
|
-
|
|
539
|
+
Q.CollapsibleTrigger,
|
|
540
540
|
{
|
|
541
541
|
"data-slot": "collapsible-trigger",
|
|
542
542
|
...t
|
|
543
543
|
}
|
|
544
544
|
);
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function Se({
|
|
547
547
|
...t
|
|
548
548
|
}) {
|
|
549
549
|
return /* @__PURE__ */ a(
|
|
550
|
-
|
|
550
|
+
Q.CollapsibleContent,
|
|
551
551
|
{
|
|
552
552
|
"data-slot": "collapsible-content",
|
|
553
553
|
...t
|
|
554
554
|
}
|
|
555
555
|
);
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
559
|
-
const [t, e] =
|
|
557
|
+
const O = 768;
|
|
558
|
+
function Te() {
|
|
559
|
+
const [t, e] = p.useState(
|
|
560
560
|
void 0
|
|
561
561
|
);
|
|
562
|
-
return
|
|
563
|
-
const s = window.matchMedia(`(max-width: ${
|
|
564
|
-
e(window.innerWidth <
|
|
562
|
+
return p.useEffect(() => {
|
|
563
|
+
const s = window.matchMedia(`(max-width: ${O - 1}px)`), r = () => {
|
|
564
|
+
e(window.innerWidth < O);
|
|
565
565
|
};
|
|
566
|
-
return s.addEventListener("change", r), e(window.innerWidth <
|
|
566
|
+
return s.addEventListener("change", r), e(window.innerWidth < O), () => s.removeEventListener("change", r);
|
|
567
567
|
}, []), !!t;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function ke({ className: t, type: e, ...s }) {
|
|
570
570
|
return /* @__PURE__ */ a(
|
|
571
571
|
"input",
|
|
572
572
|
{
|
|
@@ -582,20 +582,20 @@ function he({ className: t, type: e, ...s }) {
|
|
|
582
582
|
}
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
return /* @__PURE__ */ a(
|
|
585
|
+
function Re({ ...t }) {
|
|
586
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function Be({
|
|
589
589
|
...t
|
|
590
590
|
}) {
|
|
591
|
-
return /* @__PURE__ */ a(
|
|
591
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Ee({
|
|
594
594
|
className: t,
|
|
595
595
|
...e
|
|
596
596
|
}) {
|
|
597
597
|
return /* @__PURE__ */ a(
|
|
598
|
-
|
|
598
|
+
v.Overlay,
|
|
599
599
|
{
|
|
600
600
|
"data-slot": "sheet-overlay",
|
|
601
601
|
className: u(
|
|
@@ -606,16 +606,16 @@ function ge({
|
|
|
606
606
|
}
|
|
607
607
|
);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function Le({
|
|
610
610
|
className: t,
|
|
611
611
|
children: e,
|
|
612
612
|
side: s = "right",
|
|
613
613
|
...r
|
|
614
614
|
}) {
|
|
615
|
-
return /* @__PURE__ */ l(
|
|
616
|
-
/* @__PURE__ */ a(
|
|
615
|
+
return /* @__PURE__ */ l(Be, { children: [
|
|
616
|
+
/* @__PURE__ */ a(Ee, {}),
|
|
617
617
|
/* @__PURE__ */ l(
|
|
618
|
-
|
|
618
|
+
v.Content,
|
|
619
619
|
{
|
|
620
620
|
"data-slot": "sheet-content",
|
|
621
621
|
className: u(
|
|
@@ -629,8 +629,8 @@ function pe({
|
|
|
629
629
|
...r,
|
|
630
630
|
children: [
|
|
631
631
|
e,
|
|
632
|
-
/* @__PURE__ */ l(
|
|
633
|
-
/* @__PURE__ */ a(
|
|
632
|
+
/* @__PURE__ */ l(v.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
|
|
633
|
+
/* @__PURE__ */ a(bt, { className: "astw:size-4" }),
|
|
634
634
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
635
635
|
] })
|
|
636
636
|
]
|
|
@@ -638,7 +638,7 @@ function pe({
|
|
|
638
638
|
)
|
|
639
639
|
] });
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function De({ className: t, ...e }) {
|
|
642
642
|
return /* @__PURE__ */ a(
|
|
643
643
|
"div",
|
|
644
644
|
{
|
|
@@ -648,12 +648,12 @@ function ve({ className: t, ...e }) {
|
|
|
648
648
|
}
|
|
649
649
|
);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function Pe({
|
|
652
652
|
className: t,
|
|
653
653
|
...e
|
|
654
654
|
}) {
|
|
655
655
|
return /* @__PURE__ */ a(
|
|
656
|
-
|
|
656
|
+
v.Title,
|
|
657
657
|
{
|
|
658
658
|
"data-slot": "sheet-title",
|
|
659
659
|
className: u("astw:text-foreground astw:font-semibold", t),
|
|
@@ -661,12 +661,12 @@ function xe({
|
|
|
661
661
|
}
|
|
662
662
|
);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Me({
|
|
665
665
|
className: t,
|
|
666
666
|
...e
|
|
667
667
|
}) {
|
|
668
668
|
return /* @__PURE__ */ a(
|
|
669
|
-
|
|
669
|
+
v.Description,
|
|
670
670
|
{
|
|
671
671
|
"data-slot": "sheet-description",
|
|
672
672
|
className: u("astw:text-muted-foreground astw:text-sm", t),
|
|
@@ -674,12 +674,12 @@ function ye({
|
|
|
674
674
|
}
|
|
675
675
|
);
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function X({
|
|
678
678
|
delayDuration: t = 0,
|
|
679
679
|
...e
|
|
680
680
|
}) {
|
|
681
681
|
return /* @__PURE__ */ a(
|
|
682
|
-
|
|
682
|
+
R.Provider,
|
|
683
683
|
{
|
|
684
684
|
"data-slot": "tooltip-provider",
|
|
685
685
|
delayDuration: t,
|
|
@@ -687,24 +687,24 @@ function xt({
|
|
|
687
687
|
}
|
|
688
688
|
);
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Z({
|
|
691
691
|
...t
|
|
692
692
|
}) {
|
|
693
|
-
return /* @__PURE__ */ a(
|
|
693
|
+
return /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(R.Root, { "data-slot": "tooltip", ...t }) });
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function J({
|
|
696
696
|
...t
|
|
697
697
|
}) {
|
|
698
|
-
return /* @__PURE__ */ a(
|
|
698
|
+
return /* @__PURE__ */ a(R.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function tt({
|
|
701
701
|
className: t,
|
|
702
702
|
sideOffset: e = 0,
|
|
703
703
|
children: s,
|
|
704
704
|
...r
|
|
705
705
|
}) {
|
|
706
|
-
return /* @__PURE__ */ a(
|
|
707
|
-
|
|
706
|
+
return /* @__PURE__ */ a(R.Portal, { children: /* @__PURE__ */ l(
|
|
707
|
+
R.Content,
|
|
708
708
|
{
|
|
709
709
|
"data-slot": "tooltip-content",
|
|
710
710
|
sideOffset: e,
|
|
@@ -715,19 +715,19 @@ function Se({
|
|
|
715
715
|
...r,
|
|
716
716
|
children: [
|
|
717
717
|
s,
|
|
718
|
-
/* @__PURE__ */ a(
|
|
718
|
+
/* @__PURE__ */ a(R.Arrow, { className: "astw:bg-primary astw:fill-primary astw:z-50 astw:size-2.5 astw:translate-y-[calc(-50%_-_2px)] astw:rotate-45 astw:rounded-[2px]" })
|
|
719
719
|
]
|
|
720
720
|
}
|
|
721
721
|
) });
|
|
722
722
|
}
|
|
723
|
-
const
|
|
724
|
-
function
|
|
725
|
-
const t =
|
|
723
|
+
const Ae = "sidebar_state", Ie = 3600 * 24 * 7, _e = "16rem", ze = "18rem", Fe = "3rem", Oe = "b", Et = p.createContext(null);
|
|
724
|
+
function z() {
|
|
725
|
+
const t = p.useContext(Et);
|
|
726
726
|
if (!t)
|
|
727
727
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
728
728
|
return t;
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function $e({
|
|
731
731
|
defaultOpen: t = !0,
|
|
732
732
|
open: e,
|
|
733
733
|
onOpenChange: s,
|
|
@@ -736,38 +736,38 @@ function Le({
|
|
|
736
736
|
children: o,
|
|
737
737
|
...i
|
|
738
738
|
}) {
|
|
739
|
-
const d =
|
|
740
|
-
(
|
|
741
|
-
const
|
|
742
|
-
s ? s(
|
|
739
|
+
const d = Te(), [w, c] = p.useState(!1), [m, g] = p.useState(t), f = e ?? m, h = p.useCallback(
|
|
740
|
+
(b) => {
|
|
741
|
+
const N = typeof b == "function" ? b(f) : b;
|
|
742
|
+
s ? s(N) : g(N), document.cookie = `${Ae}=${N}; path=/; max-age=${Ie}`;
|
|
743
743
|
},
|
|
744
|
-
[s,
|
|
745
|
-
),
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
|
|
744
|
+
[s, f]
|
|
745
|
+
), y = p.useCallback(() => d ? c((b) => !b) : h((b) => !b), [d, h, c]);
|
|
746
|
+
p.useEffect(() => {
|
|
747
|
+
const b = (N) => {
|
|
748
|
+
N.key === Oe && (N.metaKey || N.ctrlKey) && (N.preventDefault(), y());
|
|
749
749
|
};
|
|
750
|
-
return window.addEventListener("keydown",
|
|
751
|
-
}, [
|
|
752
|
-
const A =
|
|
750
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
751
|
+
}, [y]);
|
|
752
|
+
const A = f ? "expanded" : "collapsed", et = p.useMemo(
|
|
753
753
|
() => ({
|
|
754
754
|
state: A,
|
|
755
|
-
open:
|
|
756
|
-
setOpen:
|
|
755
|
+
open: f,
|
|
756
|
+
setOpen: h,
|
|
757
757
|
isMobile: d,
|
|
758
758
|
openMobile: w,
|
|
759
759
|
setOpenMobile: c,
|
|
760
|
-
toggleSidebar:
|
|
760
|
+
toggleSidebar: y
|
|
761
761
|
}),
|
|
762
|
-
[A,
|
|
762
|
+
[A, f, h, d, w, c, y]
|
|
763
763
|
);
|
|
764
|
-
return /* @__PURE__ */ a(
|
|
764
|
+
return /* @__PURE__ */ a(Et.Provider, { value: et, children: /* @__PURE__ */ a(X, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
765
765
|
"div",
|
|
766
766
|
{
|
|
767
767
|
"data-slot": "sidebar-wrapper",
|
|
768
768
|
style: {
|
|
769
|
-
"--sidebar-width":
|
|
770
|
-
"--sidebar-width-icon":
|
|
769
|
+
"--sidebar-width": _e,
|
|
770
|
+
"--sidebar-width-icon": Fe,
|
|
771
771
|
...n
|
|
772
772
|
},
|
|
773
773
|
className: u(
|
|
@@ -779,7 +779,7 @@ function Le({
|
|
|
779
779
|
}
|
|
780
780
|
) }) });
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function We({
|
|
783
783
|
side: t = "left",
|
|
784
784
|
variant: e = "sidebar",
|
|
785
785
|
collapsible: s = "offcanvas",
|
|
@@ -787,7 +787,7 @@ function Ae({
|
|
|
787
787
|
children: n,
|
|
788
788
|
...o
|
|
789
789
|
}) {
|
|
790
|
-
const { isMobile: i, state: d, openMobile: w, setOpenMobile: c } =
|
|
790
|
+
const { isMobile: i, state: d, openMobile: w, setOpenMobile: c } = z();
|
|
791
791
|
return s === "none" ? /* @__PURE__ */ a(
|
|
792
792
|
"div",
|
|
793
793
|
{
|
|
@@ -799,21 +799,21 @@ function Ae({
|
|
|
799
799
|
...o,
|
|
800
800
|
children: n
|
|
801
801
|
}
|
|
802
|
-
) : i ? /* @__PURE__ */ a(
|
|
803
|
-
|
|
802
|
+
) : i ? /* @__PURE__ */ a(Re, { open: w, onOpenChange: c, ...o, children: /* @__PURE__ */ l(
|
|
803
|
+
Le,
|
|
804
804
|
{
|
|
805
805
|
"data-sidebar": "sidebar",
|
|
806
806
|
"data-slot": "sidebar",
|
|
807
807
|
"data-mobile": "true",
|
|
808
808
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
809
809
|
style: {
|
|
810
|
-
"--sidebar-width":
|
|
810
|
+
"--sidebar-width": ze
|
|
811
811
|
},
|
|
812
812
|
side: t,
|
|
813
813
|
children: [
|
|
814
|
-
/* @__PURE__ */ l(
|
|
815
|
-
/* @__PURE__ */ a(
|
|
816
|
-
/* @__PURE__ */ a(
|
|
814
|
+
/* @__PURE__ */ l(De, { className: "astw:sr-only", children: [
|
|
815
|
+
/* @__PURE__ */ a(Pe, { children: "Sidebar" }),
|
|
816
|
+
/* @__PURE__ */ a(Me, { children: "Displays the mobile sidebar." })
|
|
817
817
|
] }),
|
|
818
818
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
819
819
|
]
|
|
@@ -868,14 +868,14 @@ function Ae({
|
|
|
868
868
|
}
|
|
869
869
|
);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Lt({
|
|
872
872
|
className: t,
|
|
873
873
|
onClick: e,
|
|
874
874
|
...s
|
|
875
875
|
}) {
|
|
876
|
-
const { toggleSidebar: r } =
|
|
876
|
+
const { toggleSidebar: r } = z();
|
|
877
877
|
return /* @__PURE__ */ l(
|
|
878
|
-
|
|
878
|
+
D,
|
|
879
879
|
{
|
|
880
880
|
"data-sidebar": "trigger",
|
|
881
881
|
"data-slot": "sidebar-trigger",
|
|
@@ -887,13 +887,13 @@ function Nt({
|
|
|
887
887
|
},
|
|
888
888
|
...s,
|
|
889
889
|
children: [
|
|
890
|
-
/* @__PURE__ */ a(
|
|
890
|
+
/* @__PURE__ */ a(Zt, { className: "astw:size-4.5" }),
|
|
891
891
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
892
892
|
]
|
|
893
893
|
}
|
|
894
894
|
);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function je({ className: t, ...e }) {
|
|
897
897
|
return /* @__PURE__ */ a(
|
|
898
898
|
"main",
|
|
899
899
|
{
|
|
@@ -908,7 +908,7 @@ function De({ className: t, ...e }) {
|
|
|
908
908
|
}
|
|
909
909
|
);
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function Ke({ className: t, ...e }) {
|
|
912
912
|
return /* @__PURE__ */ a(
|
|
913
913
|
"div",
|
|
914
914
|
{
|
|
@@ -919,7 +919,7 @@ function Ie({ className: t, ...e }) {
|
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function Ue({ className: t, ...e }) {
|
|
923
923
|
return /* @__PURE__ */ a(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
@@ -933,7 +933,7 @@ function Me({ className: t, ...e }) {
|
|
|
933
933
|
}
|
|
934
934
|
);
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Dt({ className: t, ...e }) {
|
|
937
937
|
return /* @__PURE__ */ a(
|
|
938
938
|
"div",
|
|
939
939
|
{
|
|
@@ -944,7 +944,7 @@ function Ct({ className: t, ...e }) {
|
|
|
944
944
|
}
|
|
945
945
|
);
|
|
946
946
|
}
|
|
947
|
-
function
|
|
947
|
+
function Pt({ className: t, ...e }) {
|
|
948
948
|
return /* @__PURE__ */ a(
|
|
949
949
|
"ul",
|
|
950
950
|
{
|
|
@@ -955,7 +955,7 @@ function St({ className: t, ...e }) {
|
|
|
955
955
|
}
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Mt({ className: t, ...e }) {
|
|
959
959
|
return /* @__PURE__ */ a(
|
|
960
960
|
"li",
|
|
961
961
|
{
|
|
@@ -966,7 +966,7 @@ function Tt({ className: t, ...e }) {
|
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
968
|
}
|
|
969
|
-
const
|
|
969
|
+
const He = V(
|
|
970
970
|
"astw:peer/menu-button astw:flex astw:w-full astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:p-2 astw:text-left astw:text-sm astw:outline-hidden astw:ring-sidebar-ring astw:transition-[width,height,padding] astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:focus-visible:ring-2 astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:font-medium astw:data-[active=true]:text-sidebar-accent-foreground astw:data-[state=open]:hover:bg-sidebar-accent astw:data-[state=open]:hover:text-sidebar-accent-foreground astw:group-data-[collapsible=icon]:size-8! astw:group-data-[collapsible=icon]:p-2! astw:[&>span:last-child]:truncate astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
971
971
|
{
|
|
972
972
|
variants: {
|
|
@@ -986,7 +986,7 @@ const _e = lt(
|
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
);
|
|
989
|
-
function
|
|
989
|
+
function ot({
|
|
990
990
|
asChild: t = !1,
|
|
991
991
|
isActive: e = !1,
|
|
992
992
|
variant: s = "default",
|
|
@@ -995,23 +995,23 @@ function J({
|
|
|
995
995
|
className: o,
|
|
996
996
|
...i
|
|
997
997
|
}) {
|
|
998
|
-
const d = t ?
|
|
998
|
+
const d = t ? P : "button", { isMobile: w, state: c } = z(), m = /* @__PURE__ */ a(
|
|
999
999
|
d,
|
|
1000
1000
|
{
|
|
1001
1001
|
"data-slot": "sidebar-menu-button",
|
|
1002
1002
|
"data-sidebar": "menu-button",
|
|
1003
1003
|
"data-size": r,
|
|
1004
1004
|
"data-active": e,
|
|
1005
|
-
className: u(
|
|
1005
|
+
className: u(He({ variant: s, size: r }), o),
|
|
1006
1006
|
...i
|
|
1007
1007
|
}
|
|
1008
1008
|
);
|
|
1009
1009
|
return n ? (typeof n == "string" && (n = {
|
|
1010
1010
|
children: n
|
|
1011
|
-
}), /* @__PURE__ */ l(
|
|
1012
|
-
/* @__PURE__ */ a(
|
|
1011
|
+
}), /* @__PURE__ */ l(Z, { children: [
|
|
1012
|
+
/* @__PURE__ */ a(J, { asChild: !0, children: m }),
|
|
1013
1013
|
/* @__PURE__ */ a(
|
|
1014
|
-
|
|
1014
|
+
tt,
|
|
1015
1015
|
{
|
|
1016
1016
|
side: "right",
|
|
1017
1017
|
align: "center",
|
|
@@ -1019,16 +1019,16 @@ function J({
|
|
|
1019
1019
|
...n
|
|
1020
1020
|
}
|
|
1021
1021
|
)
|
|
1022
|
-
] })) :
|
|
1022
|
+
] })) : m;
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function it({
|
|
1025
1025
|
className: t,
|
|
1026
1026
|
asChild: e = !1,
|
|
1027
1027
|
showOnHover: s = !1,
|
|
1028
1028
|
...r
|
|
1029
1029
|
}) {
|
|
1030
1030
|
return /* @__PURE__ */ a(
|
|
1031
|
-
e ?
|
|
1031
|
+
e ? P : "button",
|
|
1032
1032
|
{
|
|
1033
1033
|
"data-slot": "sidebar-menu-action",
|
|
1034
1034
|
"data-sidebar": "menu-action",
|
|
@@ -1047,7 +1047,7 @@ function Z({
|
|
|
1047
1047
|
}
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function Ve({ className: t, ...e }) {
|
|
1051
1051
|
return /* @__PURE__ */ a(
|
|
1052
1052
|
"ul",
|
|
1053
1053
|
{
|
|
@@ -1062,7 +1062,7 @@ function ze({ className: t, ...e }) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
);
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function Qe({
|
|
1066
1066
|
className: t,
|
|
1067
1067
|
...e
|
|
1068
1068
|
}) {
|
|
@@ -1076,7 +1076,7 @@ function Oe({
|
|
|
1076
1076
|
}
|
|
1077
1077
|
);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function qe({
|
|
1080
1080
|
asChild: t = !1,
|
|
1081
1081
|
size: e = "md",
|
|
1082
1082
|
isActive: s = !1,
|
|
@@ -1084,7 +1084,7 @@ function $e({
|
|
|
1084
1084
|
...n
|
|
1085
1085
|
}) {
|
|
1086
1086
|
return /* @__PURE__ */ a(
|
|
1087
|
-
t ?
|
|
1087
|
+
t ? P : "a",
|
|
1088
1088
|
{
|
|
1089
1089
|
"data-slot": "sidebar-menu-sub-button",
|
|
1090
1090
|
"data-sidebar": "menu-sub-button",
|
|
@@ -1102,17 +1102,17 @@ function $e({
|
|
|
1102
1102
|
}
|
|
1103
1103
|
);
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function j({ to: t, children: e, ...s }) {
|
|
1106
1106
|
try {
|
|
1107
|
-
return
|
|
1107
|
+
return Ht(t), /* @__PURE__ */ a(Vt, { to: t, ...s, children: e });
|
|
1108
1108
|
} catch {
|
|
1109
1109
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1112
|
+
function lt({ ...t }) {
|
|
1113
1113
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function dt({ className: t, ...e }) {
|
|
1116
1116
|
return /* @__PURE__ */ a(
|
|
1117
1117
|
"ol",
|
|
1118
1118
|
{
|
|
@@ -1125,7 +1125,7 @@ function et({ className: t, ...e }) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
);
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function ct({ className: t, ...e }) {
|
|
1129
1129
|
return /* @__PURE__ */ a(
|
|
1130
1130
|
"li",
|
|
1131
1131
|
{
|
|
@@ -1135,14 +1135,14 @@ function at({ className: t, ...e }) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
);
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function wt({
|
|
1139
1139
|
asChild: t,
|
|
1140
1140
|
className: e,
|
|
1141
1141
|
children: s,
|
|
1142
1142
|
...r
|
|
1143
1143
|
}) {
|
|
1144
1144
|
return /* @__PURE__ */ a(
|
|
1145
|
-
t ?
|
|
1145
|
+
t ? P : j,
|
|
1146
1146
|
{
|
|
1147
1147
|
"data-slot": "breadcrumb-link",
|
|
1148
1148
|
className: u("astw:hover:text-foreground astw:transition-colors", e),
|
|
@@ -1151,7 +1151,7 @@ function st({
|
|
|
1151
1151
|
}
|
|
1152
1152
|
);
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Ge({
|
|
1155
1155
|
children: t,
|
|
1156
1156
|
className: e,
|
|
1157
1157
|
...s
|
|
@@ -1164,19 +1164,19 @@ function je({
|
|
|
1164
1164
|
"aria-hidden": "true",
|
|
1165
1165
|
className: u("astw:[&>svg]:size-3.5", e),
|
|
1166
1166
|
...s,
|
|
1167
|
-
children: t ?? /* @__PURE__ */ a(
|
|
1167
|
+
children: t ?? /* @__PURE__ */ a($, {})
|
|
1168
1168
|
}
|
|
1169
1169
|
);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Ye(t, e) {
|
|
1172
1172
|
if (!e.trim()) return t;
|
|
1173
1173
|
const s = e.toLowerCase();
|
|
1174
1174
|
return t.filter(
|
|
1175
1175
|
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1176
1176
|
);
|
|
1177
1177
|
}
|
|
1178
|
-
const
|
|
1179
|
-
const s =
|
|
1178
|
+
const Xe = (t, e) => {
|
|
1179
|
+
const s = vt(e);
|
|
1180
1180
|
return t.reduce(
|
|
1181
1181
|
(r, n) => {
|
|
1182
1182
|
const o = s(n.meta.title, n.path);
|
|
@@ -1186,16 +1186,16 @@ const Ue = (t, e) => {
|
|
|
1186
1186
|
};
|
|
1187
1187
|
const i = (d, w) => {
|
|
1188
1188
|
!d || d.length === 0 || d.forEach((c) => {
|
|
1189
|
-
const
|
|
1189
|
+
const m = `${w}/${c.path}`, g = s(
|
|
1190
1190
|
c.meta.title,
|
|
1191
1191
|
c.path
|
|
1192
1192
|
);
|
|
1193
|
-
r[
|
|
1194
|
-
title:
|
|
1193
|
+
r[m] = {
|
|
1194
|
+
title: g,
|
|
1195
1195
|
breadcrumbTitle: c.meta.breadcrumbTitle
|
|
1196
1196
|
}, c.subResources && c.subResources.length > 0 && i(
|
|
1197
1197
|
c.subResources,
|
|
1198
|
-
|
|
1198
|
+
m
|
|
1199
1199
|
);
|
|
1200
1200
|
});
|
|
1201
1201
|
};
|
|
@@ -1204,24 +1204,24 @@ const Ue = (t, e) => {
|
|
|
1204
1204
|
{}
|
|
1205
1205
|
);
|
|
1206
1206
|
};
|
|
1207
|
-
function
|
|
1208
|
-
const n = t.split("/").filter((w) => w !== ""), o = e && n[0] === e ? n.slice(1) : n, i =
|
|
1209
|
-
const
|
|
1210
|
-
let
|
|
1211
|
-
if (!
|
|
1212
|
-
const
|
|
1213
|
-
([
|
|
1214
|
-
const A =
|
|
1215
|
-
return new RegExp(`^${A}$`).test(
|
|
1207
|
+
function Ze(t, e, s, r) {
|
|
1208
|
+
const n = t.split("/").filter((w) => w !== ""), o = e && n[0] === e ? n.slice(1) : n, i = Xe(s, r), d = o.map((w, c) => {
|
|
1209
|
+
const m = o.slice(0, c + 1).join("/");
|
|
1210
|
+
let g = i[m];
|
|
1211
|
+
if (!g) {
|
|
1212
|
+
const h = Object.entries(i).find(
|
|
1213
|
+
([y]) => {
|
|
1214
|
+
const A = y.split("/").map((b) => b.startsWith(":") ? "[^/]+" : b).join("/");
|
|
1215
|
+
return new RegExp(`^${A}$`).test(m);
|
|
1216
1216
|
}
|
|
1217
1217
|
)?.[1];
|
|
1218
|
-
|
|
1218
|
+
h && (g = h);
|
|
1219
1219
|
}
|
|
1220
|
-
let
|
|
1221
|
-
return
|
|
1220
|
+
let f;
|
|
1221
|
+
return g ? typeof g.breadcrumbTitle == "function" ? f = g.breadcrumbTitle(w) : typeof g.breadcrumbTitle == "string" ? f = g.breadcrumbTitle : f = g.title : f = decodeURIComponent(w), {
|
|
1222
1222
|
segment: w,
|
|
1223
|
-
path:
|
|
1224
|
-
title:
|
|
1223
|
+
path: m,
|
|
1224
|
+
title: f
|
|
1225
1225
|
};
|
|
1226
1226
|
});
|
|
1227
1227
|
return {
|
|
@@ -1229,48 +1229,48 @@ function Fe(t, e, s, r) {
|
|
|
1229
1229
|
segments: d
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
|
-
const
|
|
1233
|
-
const { open: t } =
|
|
1234
|
-
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(
|
|
1235
|
-
},
|
|
1236
|
-
const e = t.children ? t.children({ Outlet:
|
|
1232
|
+
const Je = () => {
|
|
1233
|
+
const { open: t } = z();
|
|
1234
|
+
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Lt, { className: "astw:-ml-2.5" }) });
|
|
1235
|
+
}, Za = (t) => {
|
|
1236
|
+
const e = t.children ? t.children({ Outlet: rt }) : null, s = Ne(), r = () => {
|
|
1237
1237
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1238
1238
|
};
|
|
1239
|
-
return /* @__PURE__ */ a(
|
|
1240
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1241
|
-
/* @__PURE__ */ l(
|
|
1239
|
+
return /* @__PURE__ */ a($e, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:flex-1", children: [
|
|
1240
|
+
t.sidebar ?? /* @__PURE__ */ a(ta, {}),
|
|
1241
|
+
/* @__PURE__ */ l(je, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1242
1242
|
/* @__PURE__ */ a("header", { className: "astw:flex astw:h-14 astw:shrink-0 astw:items-center astw:gap-2 astw:transition-[width,height] astw:ease-linear astw:group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ l("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
|
|
1243
1243
|
/* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1244
|
-
/* @__PURE__ */ a(
|
|
1245
|
-
/* @__PURE__ */ a(
|
|
1244
|
+
/* @__PURE__ */ a(Je, {}),
|
|
1245
|
+
/* @__PURE__ */ a(na, {})
|
|
1246
1246
|
] }),
|
|
1247
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(
|
|
1247
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(D, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(Jt, {}) }) })
|
|
1248
1248
|
] }) }),
|
|
1249
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(
|
|
1249
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(rt, {}) })
|
|
1250
1250
|
] })
|
|
1251
1251
|
] }) });
|
|
1252
|
-
},
|
|
1253
|
-
const { title: e, icon: s } =
|
|
1252
|
+
}, ta = (t) => {
|
|
1253
|
+
const { title: e, icon: s } = T(), { pathname: r } = gt(), n = /* @__PURE__ */ l(Ke, { children: [
|
|
1254
1254
|
s,
|
|
1255
1255
|
/* @__PURE__ */ a("h1", { className: "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", children: e })
|
|
1256
1256
|
] });
|
|
1257
|
-
return /* @__PURE__ */ l(
|
|
1257
|
+
return /* @__PURE__ */ l(We, { variant: "inset", children: [
|
|
1258
1258
|
/* @__PURE__ */ l("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1259
1259
|
t.header ?? n,
|
|
1260
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(
|
|
1260
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Lt, { className: "astw:-ml-1" }) })
|
|
1261
1261
|
] }),
|
|
1262
|
-
/* @__PURE__ */ a(
|
|
1262
|
+
/* @__PURE__ */ a(Ue, { children: /* @__PURE__ */ a(ht, { fallback: /* @__PURE__ */ a(sa, {}), children: /* @__PURE__ */ a(ea, { currentPath: r }) }) }),
|
|
1263
1263
|
t.footer ?? null
|
|
1264
1264
|
] });
|
|
1265
|
-
},
|
|
1266
|
-
const e =
|
|
1267
|
-
return /* @__PURE__ */ a(
|
|
1268
|
-
},
|
|
1269
|
-
const e =
|
|
1270
|
-
return /* @__PURE__ */ a(
|
|
1271
|
-
s.url ? /* @__PURE__ */ l(
|
|
1272
|
-
/* @__PURE__ */ a(
|
|
1273
|
-
|
|
1265
|
+
}, ea = ({ currentPath: t }) => {
|
|
1266
|
+
const e = kt();
|
|
1267
|
+
return /* @__PURE__ */ a(pt, { resolve: e, children: (s) => /* @__PURE__ */ a(aa, { items: s ?? [], currentPath: t }) });
|
|
1268
|
+
}, aa = (t) => {
|
|
1269
|
+
const e = B();
|
|
1270
|
+
return /* @__PURE__ */ a(Dt, { children: /* @__PURE__ */ a(Pt, { children: t.items.map((s) => /* @__PURE__ */ a(Ce, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ l(Mt, { children: [
|
|
1271
|
+
s.url ? /* @__PURE__ */ l(E, { children: [
|
|
1272
|
+
/* @__PURE__ */ a(ot, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l(
|
|
1273
|
+
j,
|
|
1274
1274
|
{
|
|
1275
1275
|
to: s.url,
|
|
1276
1276
|
className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1280,29 +1280,29 @@ const We = () => {
|
|
|
1280
1280
|
]
|
|
1281
1281
|
}
|
|
1282
1282
|
) }),
|
|
1283
|
-
!!s.items?.length && /* @__PURE__ */ a(
|
|
1284
|
-
/* @__PURE__ */ a(
|
|
1283
|
+
!!s.items?.length && /* @__PURE__ */ a(nt, { asChild: !0, children: /* @__PURE__ */ l(it, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1284
|
+
/* @__PURE__ */ a($, {}),
|
|
1285
1285
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1286
1286
|
] }) })
|
|
1287
|
-
] }) : /* @__PURE__ */ a(
|
|
1288
|
-
/* @__PURE__ */ a(
|
|
1287
|
+
] }) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ l(nt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1288
|
+
/* @__PURE__ */ a(ot, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ l("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1289
1289
|
s.icon,
|
|
1290
1290
|
/* @__PURE__ */ a("span", { children: s.title })
|
|
1291
1291
|
] }) }),
|
|
1292
1292
|
!!s.items?.length && /* @__PURE__ */ a(
|
|
1293
|
-
|
|
1293
|
+
it,
|
|
1294
1294
|
{
|
|
1295
1295
|
className: "astw-rotate-target",
|
|
1296
1296
|
asChild: !0,
|
|
1297
1297
|
children: /* @__PURE__ */ l("span", { children: [
|
|
1298
|
-
/* @__PURE__ */ a(
|
|
1298
|
+
/* @__PURE__ */ a($, {}),
|
|
1299
1299
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1300
1300
|
] })
|
|
1301
1301
|
}
|
|
1302
1302
|
)
|
|
1303
1303
|
] }) }),
|
|
1304
|
-
!!s.items?.length && /* @__PURE__ */ a(
|
|
1305
|
-
|
|
1304
|
+
!!s.items?.length && /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a(Ve, { children: s.items?.map((r) => /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a(qe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1305
|
+
j,
|
|
1306
1306
|
{
|
|
1307
1307
|
to: r.url,
|
|
1308
1308
|
className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1310,9 +1310,9 @@ const We = () => {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
) }) }, r.title)) }) })
|
|
1312
1312
|
] }) }, s.title)) }) });
|
|
1313
|
-
},
|
|
1313
|
+
}, sa = () => {
|
|
1314
1314
|
const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
|
|
1315
|
-
return /* @__PURE__ */ a(
|
|
1315
|
+
return /* @__PURE__ */ a(Dt, { children: /* @__PURE__ */ a(Pt, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1316
1316
|
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1317
1317
|
/* @__PURE__ */ a(
|
|
1318
1318
|
"div",
|
|
@@ -1322,44 +1322,44 @@ const We = () => {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
)
|
|
1324
1324
|
] }) }, r)) }) });
|
|
1325
|
-
},
|
|
1326
|
-
const { configurations: t } =
|
|
1327
|
-
return
|
|
1325
|
+
}, ra = () => {
|
|
1326
|
+
const { configurations: t } = T(), e = gt();
|
|
1327
|
+
return Ze(
|
|
1328
1328
|
e.pathname,
|
|
1329
1329
|
t.basePath,
|
|
1330
1330
|
t.modules,
|
|
1331
1331
|
t.locale
|
|
1332
1332
|
);
|
|
1333
|
-
},
|
|
1334
|
-
const { segments: t } =
|
|
1335
|
-
return e ? /* @__PURE__ */ a(
|
|
1333
|
+
}, na = () => {
|
|
1334
|
+
const { segments: t } = ra(), e = Qt("/:prefix/settings/:suffix"), s = B();
|
|
1335
|
+
return e ? /* @__PURE__ */ a(lt, { children: /* @__PURE__ */ a(dt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(ct, { children: /* @__PURE__ */ a(wt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(lt, { children: /* @__PURE__ */ a(dt, { children: t.map((r, n) => /* @__PURE__ */ l(
|
|
1336
1336
|
"div",
|
|
1337
1337
|
{
|
|
1338
1338
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1339
1339
|
children: [
|
|
1340
|
-
/* @__PURE__ */ a(
|
|
1341
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1340
|
+
/* @__PURE__ */ a(ct, { children: /* @__PURE__ */ a(wt, { to: r.path, children: r.title }) }),
|
|
1341
|
+
n < t.length - 1 && /* @__PURE__ */ a(Ge, {})
|
|
1342
1342
|
]
|
|
1343
1343
|
},
|
|
1344
1344
|
n
|
|
1345
1345
|
)) }) });
|
|
1346
1346
|
};
|
|
1347
|
-
function
|
|
1347
|
+
function oa({
|
|
1348
1348
|
...t
|
|
1349
1349
|
}) {
|
|
1350
|
-
return /* @__PURE__ */ a(
|
|
1350
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function ia({
|
|
1353
1353
|
...t
|
|
1354
1354
|
}) {
|
|
1355
|
-
return /* @__PURE__ */ a(
|
|
1355
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function la({
|
|
1358
1358
|
className: t,
|
|
1359
1359
|
...e
|
|
1360
1360
|
}) {
|
|
1361
1361
|
return /* @__PURE__ */ a(
|
|
1362
|
-
|
|
1362
|
+
v.Overlay,
|
|
1363
1363
|
{
|
|
1364
1364
|
"data-slot": "dialog-overlay",
|
|
1365
1365
|
className: u(
|
|
@@ -1370,15 +1370,15 @@ function Ze({
|
|
|
1370
1370
|
}
|
|
1371
1371
|
);
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1373
|
+
function da({
|
|
1374
1374
|
className: t,
|
|
1375
1375
|
children: e,
|
|
1376
1376
|
...s
|
|
1377
1377
|
}) {
|
|
1378
|
-
return /* @__PURE__ */ l(
|
|
1379
|
-
/* @__PURE__ */ a(
|
|
1378
|
+
return /* @__PURE__ */ l(ia, { "data-slot": "dialog-portal", children: [
|
|
1379
|
+
/* @__PURE__ */ a(la, {}),
|
|
1380
1380
|
/* @__PURE__ */ l(
|
|
1381
|
-
|
|
1381
|
+
v.Content,
|
|
1382
1382
|
{
|
|
1383
1383
|
"data-slot": "dialog-content",
|
|
1384
1384
|
className: u(
|
|
@@ -1388,8 +1388,8 @@ function ta({
|
|
|
1388
1388
|
...s,
|
|
1389
1389
|
children: [
|
|
1390
1390
|
e,
|
|
1391
|
-
/* @__PURE__ */ l(
|
|
1392
|
-
/* @__PURE__ */ a(
|
|
1391
|
+
/* @__PURE__ */ l(v.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
|
|
1392
|
+
/* @__PURE__ */ a(bt, {}),
|
|
1393
1393
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1394
1394
|
] })
|
|
1395
1395
|
]
|
|
@@ -1397,12 +1397,12 @@ function ta({
|
|
|
1397
1397
|
)
|
|
1398
1398
|
] });
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function ca({
|
|
1401
1401
|
className: t,
|
|
1402
1402
|
...e
|
|
1403
1403
|
}) {
|
|
1404
1404
|
return /* @__PURE__ */ a(
|
|
1405
|
-
|
|
1405
|
+
v.Title,
|
|
1406
1406
|
{
|
|
1407
1407
|
"data-slot": "dialog-title",
|
|
1408
1408
|
className: u("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
@@ -1410,7 +1410,7 @@ function ea({
|
|
|
1410
1410
|
}
|
|
1411
1411
|
);
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1413
|
+
function wa(t) {
|
|
1414
1414
|
const e = [], s = (r, n, o) => {
|
|
1415
1415
|
r.forEach((i) => {
|
|
1416
1416
|
const d = [...o, i.title];
|
|
@@ -1431,48 +1431,48 @@ function aa(t) {
|
|
|
1431
1431
|
}), s(r.items, r.icon, [r.title]);
|
|
1432
1432
|
}), e;
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function ua({
|
|
1435
1435
|
routes: t
|
|
1436
1436
|
}) {
|
|
1437
|
-
const e =
|
|
1438
|
-
() =>
|
|
1437
|
+
const e = qt(), s = _t(null), [r, n] = k(!1), [o, i] = k(""), [d, w] = k(0), c = _(
|
|
1438
|
+
() => Ye(t, o),
|
|
1439
1439
|
[t, o]
|
|
1440
1440
|
);
|
|
1441
|
-
|
|
1442
|
-
const
|
|
1443
|
-
(
|
|
1441
|
+
C(() => {
|
|
1442
|
+
const f = (h) => {
|
|
1443
|
+
(h.metaKey || h.ctrlKey) && h.key === "k" && (h.preventDefault(), n((y) => !y));
|
|
1444
1444
|
};
|
|
1445
|
-
return document.addEventListener("keydown",
|
|
1446
|
-
}, []),
|
|
1445
|
+
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
1446
|
+
}, []), C(() => {
|
|
1447
1447
|
w(0);
|
|
1448
|
-
}, [c]),
|
|
1448
|
+
}, [c]), C(() => {
|
|
1449
1449
|
r || (i(""), w(0));
|
|
1450
|
-
}, [r]),
|
|
1450
|
+
}, [r]), C(() => {
|
|
1451
1451
|
s.current && s.current.querySelector(`[data-index="${d}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1452
1452
|
}, [d]);
|
|
1453
|
-
const
|
|
1454
|
-
(
|
|
1455
|
-
e(
|
|
1453
|
+
const m = at(
|
|
1454
|
+
(f) => {
|
|
1455
|
+
e(f.path), n(!1), i("");
|
|
1456
1456
|
},
|
|
1457
1457
|
[e]
|
|
1458
|
-
),
|
|
1459
|
-
(
|
|
1460
|
-
if (!
|
|
1461
|
-
switch (
|
|
1458
|
+
), g = at(
|
|
1459
|
+
(f) => {
|
|
1460
|
+
if (!f.nativeEvent.isComposing)
|
|
1461
|
+
switch (f.key) {
|
|
1462
1462
|
case "ArrowDown":
|
|
1463
|
-
|
|
1464
|
-
(
|
|
1463
|
+
f.preventDefault(), w(
|
|
1464
|
+
(h) => h < c.length - 1 ? h + 1 : h
|
|
1465
1465
|
);
|
|
1466
1466
|
break;
|
|
1467
1467
|
case "ArrowUp":
|
|
1468
|
-
|
|
1468
|
+
f.preventDefault(), w((h) => h > 0 ? h - 1 : h);
|
|
1469
1469
|
break;
|
|
1470
1470
|
case "Enter":
|
|
1471
|
-
|
|
1471
|
+
f.preventDefault(), c[d] && m(c[d]);
|
|
1472
1472
|
break;
|
|
1473
1473
|
}
|
|
1474
1474
|
},
|
|
1475
|
-
[c, d,
|
|
1475
|
+
[c, d, m]
|
|
1476
1476
|
);
|
|
1477
1477
|
return {
|
|
1478
1478
|
open: r,
|
|
@@ -1481,15 +1481,15 @@ function sa({
|
|
|
1481
1481
|
setSearch: i,
|
|
1482
1482
|
selectedIndex: d,
|
|
1483
1483
|
filteredRoutes: c,
|
|
1484
|
-
handleSelect:
|
|
1485
|
-
handleKeyDown:
|
|
1484
|
+
handleSelect: m,
|
|
1485
|
+
handleKeyDown: g,
|
|
1486
1486
|
listRef: s
|
|
1487
1487
|
};
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function ma({
|
|
1490
1490
|
navItems: t
|
|
1491
1491
|
}) {
|
|
1492
|
-
const e =
|
|
1492
|
+
const e = B(), s = _(() => wa(t), [t]), {
|
|
1493
1493
|
open: r,
|
|
1494
1494
|
setOpen: n,
|
|
1495
1495
|
search: o,
|
|
@@ -1497,24 +1497,24 @@ function ra({
|
|
|
1497
1497
|
selectedIndex: d,
|
|
1498
1498
|
filteredRoutes: w,
|
|
1499
1499
|
handleSelect: c,
|
|
1500
|
-
handleKeyDown:
|
|
1501
|
-
listRef:
|
|
1502
|
-
} =
|
|
1503
|
-
return /* @__PURE__ */ a(
|
|
1504
|
-
|
|
1500
|
+
handleKeyDown: m,
|
|
1501
|
+
listRef: g
|
|
1502
|
+
} = ua({ routes: s });
|
|
1503
|
+
return /* @__PURE__ */ a(oa, { open: r, onOpenChange: n, children: /* @__PURE__ */ l(
|
|
1504
|
+
da,
|
|
1505
1505
|
{
|
|
1506
1506
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1507
|
-
onKeyDown:
|
|
1507
|
+
onKeyDown: m,
|
|
1508
1508
|
"aria-describedby": void 0,
|
|
1509
1509
|
children: [
|
|
1510
|
-
/* @__PURE__ */ a(
|
|
1510
|
+
/* @__PURE__ */ a(ca, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1511
1511
|
/* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1512
|
-
/* @__PURE__ */ a(
|
|
1512
|
+
/* @__PURE__ */ a(te, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1513
1513
|
/* @__PURE__ */ a(
|
|
1514
|
-
|
|
1514
|
+
ke,
|
|
1515
1515
|
{
|
|
1516
1516
|
value: o,
|
|
1517
|
-
onChange: (
|
|
1517
|
+
onChange: (f) => i(f.target.value),
|
|
1518
1518
|
placeholder: e("commandPaletteSearch"),
|
|
1519
1519
|
className: "astw:flex astw:h-10 astw:w-full astw:rounded-md astw:bg-transparent astw:py-3 astw:text-sm astw:outline-none astw:border-0 astw:shadow-none astw:focus-visible:ring-0 astw:placeholder:text-muted-foreground astw:disabled:cursor-not-allowed astw:disabled:opacity-50",
|
|
1520
1520
|
autoFocus: !0
|
|
@@ -1524,26 +1524,26 @@ function ra({
|
|
|
1524
1524
|
/* @__PURE__ */ a(
|
|
1525
1525
|
"div",
|
|
1526
1526
|
{
|
|
1527
|
-
ref:
|
|
1527
|
+
ref: g,
|
|
1528
1528
|
className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1529
|
-
children: w.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: w.map((
|
|
1529
|
+
children: w.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: e("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: w.map((f, h) => /* @__PURE__ */ l(
|
|
1530
1530
|
"button",
|
|
1531
1531
|
{
|
|
1532
|
-
"data-index":
|
|
1533
|
-
onClick: () => c(
|
|
1532
|
+
"data-index": h,
|
|
1533
|
+
onClick: () => c(f),
|
|
1534
1534
|
className: u(
|
|
1535
1535
|
"astw:relative astw:flex astw:flex-col astw:w-full astw:cursor-pointer astw:select-none astw:items-start astw:rounded-sm astw:px-2 astw:py-2 astw:text-sm astw:outline-none astw:text-left",
|
|
1536
|
-
|
|
1536
|
+
h === d ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1537
1537
|
),
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children:
|
|
1539
|
+
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
|
|
1540
1540
|
/* @__PURE__ */ l("span", { className: "astw:text-[11px] astw:text-muted-foreground astw:truncate astw:w-full astw:text-left", children: [
|
|
1541
1541
|
"/",
|
|
1542
|
-
|
|
1542
|
+
f.path
|
|
1543
1543
|
] })
|
|
1544
1544
|
]
|
|
1545
1545
|
},
|
|
1546
|
-
|
|
1546
|
+
f.path
|
|
1547
1547
|
)) })
|
|
1548
1548
|
}
|
|
1549
1549
|
)
|
|
@@ -1551,25 +1551,25 @@ function ra({
|
|
|
1551
1551
|
}
|
|
1552
1552
|
) });
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1555
|
-
const t =
|
|
1556
|
-
return /* @__PURE__ */ a(
|
|
1554
|
+
function Ja() {
|
|
1555
|
+
const t = kt();
|
|
1556
|
+
return /* @__PURE__ */ a(ht, { fallback: null, children: /* @__PURE__ */ a(pt, { resolve: t, children: (e) => /* @__PURE__ */ a(ma, { navItems: e ?? [] }) }) });
|
|
1557
1557
|
}
|
|
1558
|
-
const
|
|
1559
|
-
const e =
|
|
1560
|
-
() =>
|
|
1558
|
+
const At = K(null), ts = (t) => {
|
|
1559
|
+
const e = _(
|
|
1560
|
+
() => oe({
|
|
1561
1561
|
clientId: t.clientId,
|
|
1562
1562
|
appUri: t.apiEndpoint,
|
|
1563
1563
|
redirectUri: t.redirectUri,
|
|
1564
|
-
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery :
|
|
1564
|
+
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : ne(t.meQuery))
|
|
1565
1565
|
}),
|
|
1566
1566
|
[t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
|
|
1567
|
-
), [s, r] =
|
|
1567
|
+
), [s, r] = k(
|
|
1568
1568
|
() => e.getState()
|
|
1569
1569
|
);
|
|
1570
|
-
|
|
1570
|
+
C(() => {
|
|
1571
1571
|
t.autoLogin && (s.isLoading || s.isAuthenticated || (async () => await e.login())());
|
|
1572
|
-
}, [s.isLoading, s.isAuthenticated, t.autoLogin]),
|
|
1572
|
+
}, [s.isLoading, s.isAuthenticated, t.autoLogin]), C(
|
|
1573
1573
|
() => e.addEventListener((o) => {
|
|
1574
1574
|
o.type === "auth_state_changed" && r(o.data);
|
|
1575
1575
|
}),
|
|
@@ -1577,7 +1577,7 @@ const kt = j(null), Sa = (t) => {
|
|
|
1577
1577
|
);
|
|
1578
1578
|
const n = t.guardComponent && (s.isLoading || !s.isAuthenticated) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1579
1579
|
return /* @__PURE__ */ a(
|
|
1580
|
-
|
|
1580
|
+
At.Provider,
|
|
1581
1581
|
{
|
|
1582
1582
|
value: {
|
|
1583
1583
|
authState: s,
|
|
@@ -1589,29 +1589,389 @@ const kt = j(null), Sa = (t) => {
|
|
|
1589
1589
|
children: n
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
|
-
},
|
|
1593
|
-
const t =
|
|
1592
|
+
}, es = () => {
|
|
1593
|
+
const t = U(At);
|
|
1594
1594
|
if (!t)
|
|
1595
1595
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
1596
1596
|
return t;
|
|
1597
|
+
}, ha = V(
|
|
1598
|
+
"astw:inline-flex astw:items-center astw:rounded-md astw:border astw:px-2 astw:py-0.5 astw:text-xs astw:font-medium astw:transition-colors astw:focus:outline-none astw:focus:ring-2 astw:focus:ring-ring astw:focus:ring-offset-2",
|
|
1599
|
+
{
|
|
1600
|
+
variants: {
|
|
1601
|
+
variant: {
|
|
1602
|
+
default: "astw:border-transparent astw:bg-primary astw:text-primary-foreground astw:hover:bg-primary/80",
|
|
1603
|
+
success: "astw:border-transparent astw:bg-green-500 astw:text-white astw:hover:bg-green-600",
|
|
1604
|
+
warning: "astw:border-transparent astw:bg-yellow-500 astw:text-white astw:hover:bg-yellow-600",
|
|
1605
|
+
error: "astw:border-transparent astw:bg-destructive astw:text-destructive-foreground astw:hover:bg-destructive/80",
|
|
1606
|
+
neutral: "astw:border-transparent astw:bg-secondary astw:text-secondary-foreground astw:hover:bg-secondary/80",
|
|
1607
|
+
// Outline variants with status dots - matches Figma design
|
|
1608
|
+
"outline-success": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
|
|
1609
|
+
"outline-warning": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
|
|
1610
|
+
"outline-error": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
|
|
1611
|
+
"outline-info": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground",
|
|
1612
|
+
"outline-neutral": "astw:gap-0.5 astw:pl-1.5 astw:pr-2 astw:border-border astw:bg-card astw:text-foreground"
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
defaultVariants: {
|
|
1616
|
+
variant: "default"
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
), fa = {
|
|
1620
|
+
"outline-success": "astw:bg-green-500",
|
|
1621
|
+
"outline-warning": "astw:bg-orange-500",
|
|
1622
|
+
"outline-error": "astw:bg-red-500",
|
|
1623
|
+
"outline-info": "astw:bg-blue-500",
|
|
1624
|
+
"outline-neutral": "astw:bg-neutral-400"
|
|
1597
1625
|
};
|
|
1626
|
+
function ga({ variant: t }) {
|
|
1627
|
+
const e = fa[t];
|
|
1628
|
+
return e ? /* @__PURE__ */ a("div", { className: "astw:size-3 astw:shrink-0 astw:flex astw:items-center astw:justify-center", children: /* @__PURE__ */ a("div", { className: u("astw:size-[7px] astw:rounded-full", e) }) }) : null;
|
|
1629
|
+
}
|
|
1630
|
+
function pa({ className: t, variant: e, children: s, ...r }) {
|
|
1631
|
+
const n = e?.toString().startsWith("outline-");
|
|
1632
|
+
return /* @__PURE__ */ l(
|
|
1633
|
+
"div",
|
|
1634
|
+
{
|
|
1635
|
+
className: u(ha({ variant: e }), t),
|
|
1636
|
+
...r,
|
|
1637
|
+
children: [
|
|
1638
|
+
n && /* @__PURE__ */ a(ga, { variant: e }),
|
|
1639
|
+
s
|
|
1640
|
+
]
|
|
1641
|
+
}
|
|
1642
|
+
);
|
|
1643
|
+
}
|
|
1644
|
+
function ba(t) {
|
|
1645
|
+
return t.type === "divider";
|
|
1646
|
+
}
|
|
1647
|
+
function va(t) {
|
|
1648
|
+
return t.type !== "divider" && "key" in t;
|
|
1649
|
+
}
|
|
1650
|
+
function F(t, e) {
|
|
1651
|
+
return e.split(".").reduce((s, r) => {
|
|
1652
|
+
if (s && typeof s == "object" && r in s)
|
|
1653
|
+
return s[r];
|
|
1654
|
+
}, t);
|
|
1655
|
+
}
|
|
1656
|
+
function x(t) {
|
|
1657
|
+
return t == null || t === "";
|
|
1658
|
+
}
|
|
1659
|
+
function xa(t) {
|
|
1660
|
+
return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
1661
|
+
}
|
|
1662
|
+
function ya(t, e = "medium") {
|
|
1663
|
+
if (x(t)) return "";
|
|
1664
|
+
const s = t instanceof Date ? t : new Date(String(t));
|
|
1665
|
+
if (isNaN(s.getTime())) return String(t);
|
|
1666
|
+
switch (e) {
|
|
1667
|
+
case "short":
|
|
1668
|
+
return s.toLocaleDateString(void 0, {
|
|
1669
|
+
month: "numeric",
|
|
1670
|
+
day: "numeric",
|
|
1671
|
+
year: "2-digit"
|
|
1672
|
+
});
|
|
1673
|
+
case "medium":
|
|
1674
|
+
return s.toLocaleDateString(void 0, {
|
|
1675
|
+
month: "short",
|
|
1676
|
+
day: "numeric",
|
|
1677
|
+
year: "numeric"
|
|
1678
|
+
});
|
|
1679
|
+
case "long":
|
|
1680
|
+
return s.toLocaleDateString(void 0, {
|
|
1681
|
+
weekday: "long",
|
|
1682
|
+
month: "long",
|
|
1683
|
+
day: "numeric",
|
|
1684
|
+
year: "numeric"
|
|
1685
|
+
});
|
|
1686
|
+
case "relative": {
|
|
1687
|
+
const n = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), o = Math.floor(n / (1e3 * 60 * 60 * 24));
|
|
1688
|
+
return o === 0 ? "Today" : o === 1 ? "Yesterday" : o < 7 ? `${o} days ago` : o < 30 ? `${Math.floor(o / 7)} weeks ago` : o < 365 ? `${Math.floor(o / 30)} months ago` : `${Math.floor(o / 365)} years ago`;
|
|
1689
|
+
}
|
|
1690
|
+
default:
|
|
1691
|
+
return s.toLocaleDateString();
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
function Na(t, e) {
|
|
1695
|
+
if (x(t)) return "";
|
|
1696
|
+
const s = typeof t == "number" ? t : parseFloat(String(t));
|
|
1697
|
+
if (isNaN(s)) return String(t);
|
|
1698
|
+
try {
|
|
1699
|
+
return new Intl.NumberFormat(void 0, {
|
|
1700
|
+
style: "currency",
|
|
1701
|
+
currency: e || "USD"
|
|
1702
|
+
}).format(s);
|
|
1703
|
+
} catch {
|
|
1704
|
+
return `${e || "$"}${s.toFixed(2)}`;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
function Ca(t) {
|
|
1708
|
+
if (x(t)) return [];
|
|
1709
|
+
if (typeof t == "string")
|
|
1710
|
+
return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
|
|
1711
|
+
if (typeof t == "object" && t !== null) {
|
|
1712
|
+
const e = t, s = [];
|
|
1713
|
+
e.line1 && s.push(String(e.line1)), e.line2 && s.push(String(e.line2));
|
|
1714
|
+
const r = [
|
|
1715
|
+
e.city,
|
|
1716
|
+
e.state || e.province,
|
|
1717
|
+
e.zip || e.postalCode
|
|
1718
|
+
].filter(Boolean).join(", ");
|
|
1719
|
+
return r && s.push(r), e.country && s.push(String(e.country)), s;
|
|
1720
|
+
}
|
|
1721
|
+
return [String(t)];
|
|
1722
|
+
}
|
|
1723
|
+
function It({ value: t }) {
|
|
1724
|
+
const [e, s] = p.useState(!1);
|
|
1725
|
+
return /* @__PURE__ */ l(Z, { children: [
|
|
1726
|
+
/* @__PURE__ */ a(J, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1727
|
+
"button",
|
|
1728
|
+
{
|
|
1729
|
+
onClick: async (n) => {
|
|
1730
|
+
n.stopPropagation();
|
|
1731
|
+
try {
|
|
1732
|
+
await navigator.clipboard.writeText(t), s(!0), setTimeout(() => s(!1), 2e3);
|
|
1733
|
+
} catch {
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
className: "astw:ml-0.5 astw:inline-flex astw:items-center astw:justify-center astw:p-1 astw:rounded astw:hover:bg-muted astw:transition-colors astw:text-muted-foreground astw:hover:text-foreground",
|
|
1737
|
+
children: e ? /* @__PURE__ */ a(ae, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(se, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
|
|
1738
|
+
}
|
|
1739
|
+
) }),
|
|
1740
|
+
/* @__PURE__ */ a(tt, { side: "top", children: e ? "Copied!" : "Copy" })
|
|
1741
|
+
] });
|
|
1742
|
+
}
|
|
1743
|
+
const S = "–";
|
|
1744
|
+
function Sa({ field: t }) {
|
|
1745
|
+
const e = x(t.value) ? S : String(t.value), s = t.meta?.copyable && !x(t.value), r = t.meta?.truncateLines, n = p.useRef(null), [o, i] = p.useState(!1);
|
|
1746
|
+
p.useEffect(() => {
|
|
1747
|
+
if (!r) {
|
|
1748
|
+
i(!1);
|
|
1749
|
+
return;
|
|
1750
|
+
}
|
|
1751
|
+
const c = () => {
|
|
1752
|
+
if (n.current) {
|
|
1753
|
+
const g = n.current;
|
|
1754
|
+
i(g.scrollHeight > g.clientHeight + 1);
|
|
1755
|
+
}
|
|
1756
|
+
}, m = setTimeout(c, 50);
|
|
1757
|
+
return window.addEventListener("resize", c), () => {
|
|
1758
|
+
clearTimeout(m), window.removeEventListener("resize", c);
|
|
1759
|
+
};
|
|
1760
|
+
}, [e, r]);
|
|
1761
|
+
const d = r && r > 0 ? {
|
|
1762
|
+
display: "-webkit-box",
|
|
1763
|
+
WebkitLineClamp: r,
|
|
1764
|
+
WebkitBoxOrient: "vertical",
|
|
1765
|
+
overflow: "hidden"
|
|
1766
|
+
} : void 0, w = /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
1767
|
+
/* @__PURE__ */ a(
|
|
1768
|
+
"p",
|
|
1769
|
+
{
|
|
1770
|
+
ref: n,
|
|
1771
|
+
className: "astw:text-sm astw:font-medium astw:text-foreground astw:break-words astw:m-0",
|
|
1772
|
+
style: d,
|
|
1773
|
+
children: e
|
|
1774
|
+
}
|
|
1775
|
+
),
|
|
1776
|
+
s && /* @__PURE__ */ a(It, { value: String(t.value) })
|
|
1777
|
+
] });
|
|
1778
|
+
return r && o ? /* @__PURE__ */ l(Z, { children: [
|
|
1779
|
+
/* @__PURE__ */ a(J, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: w }) }),
|
|
1780
|
+
/* @__PURE__ */ a(tt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
|
|
1781
|
+
] }) : w;
|
|
1782
|
+
}
|
|
1783
|
+
function Ta({ field: t }) {
|
|
1784
|
+
if (x(t.value))
|
|
1785
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1786
|
+
const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
|
|
1787
|
+
return /* @__PURE__ */ a(pa, { variant: n, className: "astw:w-fit", children: xa(e) });
|
|
1788
|
+
}
|
|
1789
|
+
function ka({ field: t }) {
|
|
1790
|
+
if (x(t.value))
|
|
1791
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1792
|
+
const e = t.meta?.currencyKey || "currency", s = F(t.data, e), r = Na(t.value, s);
|
|
1793
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
|
|
1794
|
+
}
|
|
1795
|
+
function Ra({ field: t }) {
|
|
1796
|
+
if (x(t.value))
|
|
1797
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1798
|
+
const e = t.meta?.dateFormat || "medium", s = ya(t.value, e);
|
|
1799
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
|
|
1800
|
+
}
|
|
1801
|
+
function Ba({ field: t }) {
|
|
1802
|
+
if (x(t.value))
|
|
1803
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1804
|
+
const e = t.meta?.hrefKey, s = e ? F(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
|
|
1805
|
+
return s ? /* @__PURE__ */ l(
|
|
1806
|
+
"a",
|
|
1807
|
+
{
|
|
1808
|
+
href: s,
|
|
1809
|
+
target: r ? "_blank" : void 0,
|
|
1810
|
+
rel: r ? "noopener noreferrer" : void 0,
|
|
1811
|
+
className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
|
|
1812
|
+
children: [
|
|
1813
|
+
n,
|
|
1814
|
+
r && /* @__PURE__ */ a(ee, { className: "astw:h-3 astw:w-3" })
|
|
1815
|
+
]
|
|
1816
|
+
}
|
|
1817
|
+
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
1818
|
+
}
|
|
1819
|
+
function Ea({ field: t }) {
|
|
1820
|
+
if (x(t.value))
|
|
1821
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1822
|
+
const e = Ca(t.value), s = t.meta?.copyable && !x(t.value), r = e.join(`
|
|
1823
|
+
`);
|
|
1824
|
+
return /* @__PURE__ */ l("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
1825
|
+
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ l(p.Fragment, { children: [
|
|
1826
|
+
n,
|
|
1827
|
+
o < e.length - 1 && /* @__PURE__ */ a("br", {})
|
|
1828
|
+
] }, o)) }),
|
|
1829
|
+
s && /* @__PURE__ */ a(It, { value: r })
|
|
1830
|
+
] });
|
|
1831
|
+
}
|
|
1832
|
+
function La({ field: t }) {
|
|
1833
|
+
if (x(t.value))
|
|
1834
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1835
|
+
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? F(t.data, e) : void 0, n = String(t.value);
|
|
1836
|
+
if (!r || !s)
|
|
1837
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
1838
|
+
const o = s.replace("{id}", r);
|
|
1839
|
+
return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
|
|
1840
|
+
}
|
|
1841
|
+
function ut(t) {
|
|
1842
|
+
switch (t.type) {
|
|
1843
|
+
case "text":
|
|
1844
|
+
return /* @__PURE__ */ a(Sa, { field: t });
|
|
1845
|
+
case "badge":
|
|
1846
|
+
return /* @__PURE__ */ a(Ta, { field: t });
|
|
1847
|
+
case "money":
|
|
1848
|
+
return /* @__PURE__ */ a(ka, { field: t });
|
|
1849
|
+
case "date":
|
|
1850
|
+
return /* @__PURE__ */ a(Ra, { field: t });
|
|
1851
|
+
case "link":
|
|
1852
|
+
return /* @__PURE__ */ a(Ba, { field: t });
|
|
1853
|
+
case "address":
|
|
1854
|
+
return /* @__PURE__ */ a(Ea, { field: t });
|
|
1855
|
+
case "reference":
|
|
1856
|
+
return /* @__PURE__ */ a(La, { field: t });
|
|
1857
|
+
default:
|
|
1858
|
+
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: S });
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
function Da(t) {
|
|
1862
|
+
if (t.emptyBehavior !== "hide") return !1;
|
|
1863
|
+
const e = t.value;
|
|
1864
|
+
return e == null || e === "";
|
|
1865
|
+
}
|
|
1866
|
+
function Pa(t) {
|
|
1867
|
+
return !1;
|
|
1868
|
+
}
|
|
1869
|
+
function Ma(t, e, s) {
|
|
1870
|
+
const r = F(e, t.key);
|
|
1871
|
+
return {
|
|
1872
|
+
id: `${t.key}-${s}`,
|
|
1873
|
+
label: t.label,
|
|
1874
|
+
type: t.type ?? "text",
|
|
1875
|
+
value: r,
|
|
1876
|
+
emptyBehavior: t.emptyBehavior ?? "dash",
|
|
1877
|
+
meta: t.meta,
|
|
1878
|
+
data: e
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
function Aa(t, e) {
|
|
1882
|
+
const s = [];
|
|
1883
|
+
let r = [], n = 0, o = 0;
|
|
1884
|
+
for (const i of t)
|
|
1885
|
+
if (ba(i))
|
|
1886
|
+
r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
|
|
1887
|
+
else if (va(i)) {
|
|
1888
|
+
const d = Ma(i, e, o);
|
|
1889
|
+
o++, Da(d) || r.push(d);
|
|
1890
|
+
}
|
|
1891
|
+
return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
|
|
1892
|
+
}
|
|
1893
|
+
function mt({ label: t, children: e, fullWidth: s }) {
|
|
1894
|
+
return /* @__PURE__ */ l(
|
|
1895
|
+
"div",
|
|
1896
|
+
{
|
|
1897
|
+
className: u(
|
|
1898
|
+
"astw:flex astw:flex-col astw:gap-1 astw:min-w-0 astw:py-2",
|
|
1899
|
+
s && "astw:col-span-full"
|
|
1900
|
+
),
|
|
1901
|
+
children: [
|
|
1902
|
+
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:font-medium astw:text-muted-foreground astw:leading-none", children: t }),
|
|
1903
|
+
/* @__PURE__ */ a("div", { className: "astw:min-w-0", children: e })
|
|
1904
|
+
]
|
|
1905
|
+
}
|
|
1906
|
+
);
|
|
1907
|
+
}
|
|
1908
|
+
function as({
|
|
1909
|
+
data: t,
|
|
1910
|
+
title: e,
|
|
1911
|
+
fields: s,
|
|
1912
|
+
columns: r = 3,
|
|
1913
|
+
className: n,
|
|
1914
|
+
headerAction: o
|
|
1915
|
+
}) {
|
|
1916
|
+
const i = Aa(s, t), d = i.some((m) => m.fields.length > 0), w = u(
|
|
1917
|
+
"astw:grid astw:gap-x-6 astw:gap-y-4",
|
|
1918
|
+
// Default: 1 column
|
|
1919
|
+
"astw:grid-cols-1",
|
|
1920
|
+
// Container queries for responsive columns
|
|
1921
|
+
r === 4 ? (
|
|
1922
|
+
// 4-column mode: 1 → 2 → 3 → 4 columns
|
|
1923
|
+
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3 astw:@[800px]:grid-cols-4"
|
|
1924
|
+
) : (
|
|
1925
|
+
// 3-column mode: 1 → 2 → 3 columns
|
|
1926
|
+
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
|
|
1927
|
+
)
|
|
1928
|
+
), c = (m) => {
|
|
1929
|
+
const g = m.fields.filter((h) => !0), f = m.fields.filter((h) => Pa());
|
|
1930
|
+
return /* @__PURE__ */ l("div", { className: "astw:space-y-4", children: [
|
|
1931
|
+
g.length > 0 && /* @__PURE__ */ a("div", { className: w, children: g.map((h) => /* @__PURE__ */ a(mt, { label: h.label, children: ut(h) }, h.id)) }),
|
|
1932
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: w, children: f.map((h) => /* @__PURE__ */ a(mt, { label: h.label, fullWidth: !0, children: ut(h) }, h.id)) })
|
|
1933
|
+
] }, m.id);
|
|
1934
|
+
};
|
|
1935
|
+
return /* @__PURE__ */ a(X, { delayDuration: 300, children: /* @__PURE__ */ l(
|
|
1936
|
+
"div",
|
|
1937
|
+
{
|
|
1938
|
+
className: u(
|
|
1939
|
+
"astw:@container astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border",
|
|
1940
|
+
n
|
|
1941
|
+
),
|
|
1942
|
+
children: [
|
|
1943
|
+
/* @__PURE__ */ l("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
|
|
1944
|
+
/* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
|
|
1945
|
+
o && /* @__PURE__ */ a("div", { children: o })
|
|
1946
|
+
] }),
|
|
1947
|
+
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: d ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((m, g) => /* @__PURE__ */ l(p.Fragment, { children: [
|
|
1948
|
+
g > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
|
|
1949
|
+
c(m)
|
|
1950
|
+
] }, m.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
|
|
1951
|
+
]
|
|
1952
|
+
}
|
|
1953
|
+
) });
|
|
1954
|
+
}
|
|
1598
1955
|
export {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1956
|
+
Xa as AppShell,
|
|
1957
|
+
ts as AuthProvider,
|
|
1958
|
+
pa as Badge,
|
|
1959
|
+
Ja as CommandPalette,
|
|
1960
|
+
ta as DefaultSidebar,
|
|
1961
|
+
as as DescriptionCard,
|
|
1962
|
+
ns as Link,
|
|
1963
|
+
Za as SidebarLayout,
|
|
1964
|
+
ha as badgeVariants,
|
|
1965
|
+
ce as defineI18nLabels,
|
|
1966
|
+
Ga as defineModule,
|
|
1967
|
+
Ya as defineResource,
|
|
1968
|
+
qa as redirectToResource,
|
|
1969
|
+
T as useAppShell,
|
|
1970
|
+
es as useAuth,
|
|
1971
|
+
os as useLocation,
|
|
1972
|
+
is as useNavigate,
|
|
1973
|
+
ls as useParams,
|
|
1974
|
+
ds as useRouteError,
|
|
1975
|
+
cs as useSearchParams,
|
|
1976
|
+
Ne as useTheme
|
|
1617
1977
|
};
|