@tailor-platform/app-shell 0.25.0 → 0.26.1
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.js +464 -384
- package/dist/index.d.ts +150 -117
- package/package.json +2 -2
package/dist/app-shell.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { jsx as a, jsxs as d, Fragment as
|
|
2
|
-
import { capitalCase as
|
|
3
|
-
import { useRouteError as
|
|
4
|
-
import { Link as
|
|
1
|
+
import { jsx as a, jsxs as d, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { capitalCase as I } from "change-case";
|
|
3
|
+
import { useRouteError as Xt, isRouteErrorResponse as Zt, redirect as Rt, Outlet as X, NavLink as Jt, Navigate as te, useRouteLoaderData as ee, createMemoryRouter as ae, createBrowserRouter as se, RouterProvider as re, useHref as ne, Link as oe, useLocation as Et, Await as Bt, useMatch as ie, useNavigate as le } from "react-router";
|
|
4
|
+
import { Link as Cs, useLocation as Ts, useNavigate as ks, useParams as Rs, useRouteError as Es, useSearchParams as Bs } from "react-router";
|
|
5
5
|
import { Slot as z } from "@radix-ui/react-slot";
|
|
6
|
-
import { cva as
|
|
7
|
-
import { clsx as
|
|
8
|
-
import { twMerge as
|
|
9
|
-
import { AlertCircle as
|
|
10
|
-
import * as
|
|
11
|
-
import { createContext as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import * as
|
|
6
|
+
import { cva as Z } from "class-variance-authority";
|
|
7
|
+
import { clsx as de } from "clsx";
|
|
8
|
+
import { twMerge as ce } from "tailwind-merge";
|
|
9
|
+
import { AlertCircle as wt, Table as we, XIcon as At, PanelLeftIcon as ue, ChevronRight as Q, SunIcon as me, SearchIcon as he, ExternalLink as fe, Check as pe, Copy as ge } from "lucide-react";
|
|
10
|
+
import * as g from "react";
|
|
11
|
+
import { createContext as j, useContext as B, useState as M, useMemo as k, useEffect as y, Suspense as Dt, useRef as be, useCallback as W, useSyncExternalStore as xe } from "react";
|
|
12
|
+
import { Toaster as ve, toast as ye } from "sonner";
|
|
13
|
+
import * as J from "@radix-ui/react-collapsible";
|
|
14
14
|
import "@radix-ui/react-separator";
|
|
15
15
|
import * as b from "@radix-ui/react-dialog";
|
|
16
|
-
import * as
|
|
17
|
-
import {
|
|
18
|
-
import { createAuthClient as ye } from "@tailor-platform/auth-browser-client";
|
|
16
|
+
import * as R from "@radix-ui/react-tooltip";
|
|
17
|
+
import { createAuthClient as Ne } from "@tailor-platform/auth-public-client";
|
|
19
18
|
function m(...t) {
|
|
20
|
-
return de(
|
|
19
|
+
return ce(de(t));
|
|
21
20
|
}
|
|
22
|
-
const
|
|
21
|
+
const Se = Z(
|
|
23
22
|
"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
23
|
{
|
|
25
24
|
variants: {
|
|
@@ -55,7 +54,7 @@ function _({
|
|
|
55
54
|
r ? z : "button",
|
|
56
55
|
{
|
|
57
56
|
"data-slot": "button",
|
|
58
|
-
className: m(
|
|
57
|
+
className: m(Se({ variant: e, size: s, className: t })),
|
|
59
58
|
...n
|
|
60
59
|
}
|
|
61
60
|
);
|
|
@@ -69,16 +68,16 @@ const $ = "en", Ce = () => {
|
|
|
69
68
|
} catch {
|
|
70
69
|
return $;
|
|
71
70
|
}
|
|
72
|
-
},
|
|
73
|
-
const e =
|
|
74
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
75
|
-
},
|
|
71
|
+
}, tt = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Pt = (t) => {
|
|
72
|
+
const e = tt(t);
|
|
73
|
+
return (s, r) => e(s, typeof s == "string" ? s : I(r));
|
|
74
|
+
}, Te = (t) => ({
|
|
76
75
|
modules: t.modules,
|
|
77
76
|
settingsResources: t.settingsResources ?? [],
|
|
78
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
77
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(K, {}),
|
|
79
78
|
basePath: t.basePath,
|
|
80
79
|
locale: t.locale ?? Ce()
|
|
81
|
-
}),
|
|
80
|
+
}), et = j({
|
|
82
81
|
configurations: {
|
|
83
82
|
modules: [],
|
|
84
83
|
settingsResources: [],
|
|
@@ -91,18 +90,18 @@ const $ = "en", Ce = () => {
|
|
|
91
90
|
// always provides the context via AppShellConfigContext.Provider.
|
|
92
91
|
errorBoundary: null
|
|
93
92
|
}
|
|
94
|
-
}),
|
|
93
|
+
}), at = j({
|
|
95
94
|
contextData: {}
|
|
96
|
-
}),
|
|
97
|
-
const t =
|
|
95
|
+
}), A = () => B(et), is = () => B(at), ke = () => {
|
|
96
|
+
const t = B(et), e = B(at);
|
|
98
97
|
return {
|
|
99
98
|
...t,
|
|
100
99
|
...e
|
|
101
100
|
};
|
|
102
|
-
},
|
|
103
|
-
const { configurations: t } =
|
|
101
|
+
}, Re = () => {
|
|
102
|
+
const { configurations: t } = A(), e = tt(t.locale);
|
|
104
103
|
return (s, r) => e(s, r);
|
|
105
|
-
},
|
|
104
|
+
}, Ee = (t) => {
|
|
106
105
|
const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
|
|
107
106
|
return {
|
|
108
107
|
/**
|
|
@@ -125,7 +124,7 @@ const $ = "en", Ce = () => {
|
|
|
125
124
|
* ```
|
|
126
125
|
*/
|
|
127
126
|
useT: () => {
|
|
128
|
-
const { configurations: s } =
|
|
127
|
+
const { configurations: s } = A(), r = e(s.locale), n = ((o, ...i) => {
|
|
129
128
|
const l = r(o);
|
|
130
129
|
return typeof l == "function" ? l(i[0]) : l;
|
|
131
130
|
});
|
|
@@ -161,7 +160,7 @@ const $ = "en", Ce = () => {
|
|
|
161
160
|
return typeof o == "function" ? o(r[0]) : o;
|
|
162
161
|
}
|
|
163
162
|
};
|
|
164
|
-
},
|
|
163
|
+
}, Be = Ee({
|
|
165
164
|
en: {
|
|
166
165
|
error404Title: "404 Not Found",
|
|
167
166
|
error404Body: "The page you requested could not be found.",
|
|
@@ -200,14 +199,14 @@ const $ = "en", Ce = () => {
|
|
|
200
199
|
commandPaletteSearch: "ページを検索...",
|
|
201
200
|
commandPaletteNoResults: "結果が見つかりません"
|
|
202
201
|
}
|
|
203
|
-
}),
|
|
204
|
-
const t =
|
|
202
|
+
}), D = Be.useT, K = () => {
|
|
203
|
+
const t = Xt(), e = D(), s = {
|
|
205
204
|
role: "alert",
|
|
206
205
|
"aria-label": "default-error-boundary"
|
|
207
206
|
};
|
|
208
|
-
if (
|
|
207
|
+
if (Zt(t) && t.status === 404)
|
|
209
208
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
210
|
-
/* @__PURE__ */ a(
|
|
209
|
+
/* @__PURE__ */ a(wt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
211
210
|
/* @__PURE__ */ d("div", { children: [
|
|
212
211
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
213
212
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
@@ -225,7 +224,7 @@ const $ = "en", Ce = () => {
|
|
|
225
224
|
] }) });
|
|
226
225
|
const r = t instanceof Error ? t.message : e("errorUnexpected");
|
|
227
226
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
228
|
-
/* @__PURE__ */ a(
|
|
227
|
+
/* @__PURE__ */ a(wt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
229
228
|
/* @__PURE__ */ d("div", { children: [
|
|
230
229
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
231
230
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
|
|
@@ -242,19 +241,19 @@ const $ = "en", Ce = () => {
|
|
|
242
241
|
] })
|
|
243
242
|
] }) });
|
|
244
243
|
};
|
|
245
|
-
let
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
},
|
|
244
|
+
let Lt = {};
|
|
245
|
+
const Ae = (t) => {
|
|
246
|
+
Lt = t;
|
|
247
|
+
}, ls = () => ({ type: "pass" }), ds = () => ({ type: "hidden" }), cs = (t) => ({
|
|
249
248
|
type: "redirect",
|
|
250
249
|
to: t
|
|
251
|
-
}),
|
|
250
|
+
}), st = () => new Response("Not Found", { status: 404 }), V = async (t, e) => {
|
|
252
251
|
if (!t || t.length === 0) return { type: "pass" };
|
|
253
252
|
const s = new URL(e.request.url), r = {
|
|
254
253
|
params: e.params,
|
|
255
254
|
searchParams: s.searchParams,
|
|
256
255
|
signal: e.request.signal,
|
|
257
|
-
context:
|
|
256
|
+
context: Lt
|
|
258
257
|
};
|
|
259
258
|
for (const n of t) {
|
|
260
259
|
const o = await n(r);
|
|
@@ -262,22 +261,22 @@ const Be = (t) => {
|
|
|
262
261
|
return o;
|
|
263
262
|
}
|
|
264
263
|
return { type: "pass" };
|
|
265
|
-
},
|
|
266
|
-
const r = await
|
|
264
|
+
}, Mt = (t, e) => async (s) => {
|
|
265
|
+
const r = await V(t, s);
|
|
267
266
|
switch (r.type) {
|
|
268
267
|
case "hidden":
|
|
269
|
-
throw
|
|
268
|
+
throw st();
|
|
270
269
|
case "redirect":
|
|
271
270
|
return Rt(r.to);
|
|
272
271
|
case "pass":
|
|
273
272
|
return e ? e(s) : null;
|
|
274
273
|
}
|
|
275
|
-
},
|
|
276
|
-
const { configurations: s } =
|
|
274
|
+
}, It = (t, e) => () => {
|
|
275
|
+
const { configurations: s } = A(), { metaTitle: r, fallbackTitle: n } = t, i = tt(s.locale)(r, n);
|
|
277
276
|
return e(i);
|
|
278
277
|
};
|
|
279
|
-
function
|
|
280
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ??
|
|
278
|
+
function ws(t) {
|
|
279
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ?? I(e), u = I(e), w = i && i.length > 0 ? Mt(i) : void 0, c = r ? It(
|
|
281
280
|
{ metaTitle: l, fallbackTitle: u },
|
|
282
281
|
(h) => r({ title: h, resources: n })
|
|
283
282
|
) : void 0;
|
|
@@ -295,12 +294,12 @@ function cs(t) {
|
|
|
295
294
|
icon: t.meta?.icon
|
|
296
295
|
},
|
|
297
296
|
resources: n,
|
|
298
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
297
|
+
errorBoundary: o || /* @__PURE__ */ a(K, {}),
|
|
299
298
|
guards: i
|
|
300
299
|
};
|
|
301
300
|
}
|
|
302
|
-
function
|
|
303
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ??
|
|
301
|
+
function us(t) {
|
|
302
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ?? I(e), u = I(e), w = i && i.length > 0 ? Mt(i) : void 0;
|
|
304
303
|
return {
|
|
305
304
|
_type: "resource",
|
|
306
305
|
type: "component",
|
|
@@ -310,31 +309,31 @@ function ws(t) {
|
|
|
310
309
|
icon: n?.icon,
|
|
311
310
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
312
311
|
},
|
|
313
|
-
component:
|
|
312
|
+
component: It(
|
|
314
313
|
{ metaTitle: l, fallbackTitle: u },
|
|
315
314
|
(c) => s({ title: c, resources: r })
|
|
316
315
|
),
|
|
317
316
|
subResources: r,
|
|
318
|
-
errorBoundary: o ?? /* @__PURE__ */ a(
|
|
317
|
+
errorBoundary: o ?? /* @__PURE__ */ a(K, {}),
|
|
319
318
|
guards: i,
|
|
320
319
|
loader: w
|
|
321
320
|
};
|
|
322
321
|
}
|
|
323
322
|
const De = () => {
|
|
324
|
-
const t =
|
|
325
|
-
return /* @__PURE__ */ d(
|
|
323
|
+
const t = D();
|
|
324
|
+
return /* @__PURE__ */ d(E, { children: [
|
|
326
325
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
327
326
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
328
327
|
] });
|
|
329
|
-
}, ut = () => /* @__PURE__ */ d(
|
|
330
|
-
/* @__PURE__ */ a(
|
|
331
|
-
/* @__PURE__ */ a(
|
|
332
|
-
] }),
|
|
333
|
-
const { configurations: t } =
|
|
328
|
+
}, ut = () => /* @__PURE__ */ d(E, { children: [
|
|
329
|
+
/* @__PURE__ */ a(X, {}),
|
|
330
|
+
/* @__PURE__ */ a(ve, {})
|
|
331
|
+
] }), Pe = () => {
|
|
332
|
+
const { configurations: t } = ke(), e = D(), s = Re();
|
|
334
333
|
return /* @__PURE__ */ d("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: [
|
|
335
334
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ d("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
|
|
336
335
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
337
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
336
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Jt, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ d(
|
|
338
337
|
_,
|
|
339
338
|
{
|
|
340
339
|
variant: n ? "secondary" : "ghost",
|
|
@@ -346,9 +345,9 @@ const De = () => {
|
|
|
346
345
|
}
|
|
347
346
|
) }) }, r.path)) })
|
|
348
347
|
] }) }),
|
|
349
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
348
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(X, {}) })
|
|
350
349
|
] });
|
|
351
|
-
},
|
|
350
|
+
}, rt = (t) => () => /* @__PURE__ */ a(E, { children: t }), _t = (t, e, s) => {
|
|
352
351
|
const r = t.errorBoundary || s, n = t.component ? {
|
|
353
352
|
index: !0,
|
|
354
353
|
Component: t.component
|
|
@@ -357,7 +356,7 @@ const De = () => {
|
|
|
357
356
|
path: t.path,
|
|
358
357
|
...t.loader && { loader: t.loader },
|
|
359
358
|
...t.errorBoundary && {
|
|
360
|
-
ErrorBoundary:
|
|
359
|
+
ErrorBoundary: rt(t.errorBoundary)
|
|
361
360
|
},
|
|
362
361
|
...e && e.length > 0 ? {
|
|
363
362
|
children: [
|
|
@@ -370,7 +369,7 @@ const De = () => {
|
|
|
370
369
|
children: [n]
|
|
371
370
|
} : {}
|
|
372
371
|
};
|
|
373
|
-
},
|
|
372
|
+
}, Le = (t) => {
|
|
374
373
|
const e = _t(t, t.resources, t.errorBoundary);
|
|
375
374
|
if (!t.component && t.resources.length > 0) {
|
|
376
375
|
const s = {
|
|
@@ -380,9 +379,9 @@ const De = () => {
|
|
|
380
379
|
Component: () => null,
|
|
381
380
|
loader: async (n) => {
|
|
382
381
|
for (const o of t.resources)
|
|
383
|
-
if ((await
|
|
382
|
+
if ((await V(o.guards, n)).type === "pass")
|
|
384
383
|
return Rt(o.path);
|
|
385
|
-
throw
|
|
384
|
+
throw st();
|
|
386
385
|
}
|
|
387
386
|
}, r = {
|
|
388
387
|
path: e.path,
|
|
@@ -392,7 +391,7 @@ const De = () => {
|
|
|
392
391
|
return e.ErrorBoundary && (r.ErrorBoundary = e.ErrorBoundary), r;
|
|
393
392
|
}
|
|
394
393
|
return e;
|
|
395
|
-
}, Me = (t) => t.map((e) =>
|
|
394
|
+
}, Me = (t) => t.map((e) => Le(e)), Ie = ({
|
|
396
395
|
modules: t,
|
|
397
396
|
settingsResources: e,
|
|
398
397
|
rootComponent: s
|
|
@@ -405,7 +404,7 @@ const De = () => {
|
|
|
405
404
|
path: "settings",
|
|
406
405
|
index: !0,
|
|
407
406
|
Component: () => /* @__PURE__ */ a(
|
|
408
|
-
|
|
407
|
+
te,
|
|
409
408
|
{
|
|
410
409
|
to: e[0].path,
|
|
411
410
|
relative: "path",
|
|
@@ -415,12 +414,12 @@ const De = () => {
|
|
|
415
414
|
},
|
|
416
415
|
{
|
|
417
416
|
path: "settings",
|
|
418
|
-
Component:
|
|
417
|
+
Component: Pe,
|
|
419
418
|
children: e.map((o) => ({
|
|
420
419
|
path: o.path,
|
|
421
420
|
Component: o.component,
|
|
422
421
|
...o.errorBoundary && {
|
|
423
|
-
ErrorBoundary:
|
|
422
|
+
ErrorBoundary: rt(o.errorBoundary)
|
|
424
423
|
}
|
|
425
424
|
}))
|
|
426
425
|
}
|
|
@@ -434,22 +433,22 @@ const De = () => {
|
|
|
434
433
|
{
|
|
435
434
|
path: "*",
|
|
436
435
|
loader: () => {
|
|
437
|
-
throw
|
|
436
|
+
throw st();
|
|
438
437
|
},
|
|
439
438
|
// Component is required to suppress React Router's warning about empty leaf routes,
|
|
440
439
|
// even though the loader always throws and this component will never render.
|
|
441
440
|
Component: () => null,
|
|
442
|
-
ErrorBoundary:
|
|
441
|
+
ErrorBoundary: K
|
|
443
442
|
}
|
|
444
443
|
];
|
|
445
|
-
}, zt = "appshell-root-nav",
|
|
444
|
+
}, zt = "appshell-root-nav", _e = (t) => ({
|
|
446
445
|
loaderID: zt,
|
|
447
|
-
loader: async (e) => ({ navItems:
|
|
448
|
-
}), Ft = () =>
|
|
446
|
+
loader: async (e) => ({ navItems: ze(t, e) })
|
|
447
|
+
}), Ft = () => ee(zt)?.navItems, ze = async (t, e) => {
|
|
449
448
|
const s = Pt(t.locale);
|
|
450
449
|
return (await Promise.all(
|
|
451
450
|
t.modules.map(async (n) => {
|
|
452
|
-
if (n.path.startsWith(":") || (await
|
|
451
|
+
if (n.path.startsWith(":") || (await V(n.guards, e)).type !== "pass") return null;
|
|
453
452
|
const i = await Ot(
|
|
454
453
|
n.resources,
|
|
455
454
|
n.path,
|
|
@@ -461,12 +460,12 @@ const De = () => {
|
|
|
461
460
|
)).filter((n) => n !== null).map(({ module: n, resources: o }) => ({
|
|
462
461
|
title: s(n.meta.title, n.path),
|
|
463
462
|
url: n.meta.menuItemClickable ? n.path : void 0,
|
|
464
|
-
icon: n.meta.icon || /* @__PURE__ */ a(
|
|
463
|
+
icon: n.meta.icon || /* @__PURE__ */ a(we, {}),
|
|
465
464
|
items: o
|
|
466
465
|
}));
|
|
467
466
|
}, Ot = async (t, e, s, r) => (await Promise.all(
|
|
468
467
|
t.map(async (o) => {
|
|
469
|
-
if (o.path.startsWith(":") || (await
|
|
468
|
+
if (o.path.startsWith(":") || (await V(o.guards, s)).type !== "pass") return null;
|
|
470
469
|
const l = `${e}/${o.path}`, u = r(o.meta.title, o.path), w = o.subResources ? await Ot(
|
|
471
470
|
o.subResources,
|
|
472
471
|
l,
|
|
@@ -479,12 +478,12 @@ const De = () => {
|
|
|
479
478
|
items: w && w.length > 0 ? w : void 0
|
|
480
479
|
};
|
|
481
480
|
})
|
|
482
|
-
)).filter((o) => o !== null),
|
|
483
|
-
const { configurations: e } =
|
|
481
|
+
)).filter((o) => o !== null), Fe = (t) => {
|
|
482
|
+
const { configurations: e } = A(), { rootComponent: s, children: r } = t, n = Ie({
|
|
484
483
|
modules: e.modules,
|
|
485
484
|
settingsResources: e.settingsResources,
|
|
486
485
|
rootComponent: s
|
|
487
|
-
}), o = e.errorBoundary, { loaderID: i, loader: l } =
|
|
486
|
+
}), o = e.errorBoundary, { loaderID: i, loader: l } = _e({
|
|
488
487
|
modules: e.modules,
|
|
489
488
|
locale: e.locale
|
|
490
489
|
}), u = [
|
|
@@ -494,8 +493,8 @@ const De = () => {
|
|
|
494
493
|
element: r,
|
|
495
494
|
children: o ? [
|
|
496
495
|
{
|
|
497
|
-
element: /* @__PURE__ */ a(
|
|
498
|
-
ErrorBoundary:
|
|
496
|
+
element: /* @__PURE__ */ a(X, {}),
|
|
497
|
+
ErrorBoundary: rt(o),
|
|
499
498
|
children: n
|
|
500
499
|
}
|
|
501
500
|
] : n,
|
|
@@ -505,25 +504,25 @@ const De = () => {
|
|
|
505
504
|
*/
|
|
506
505
|
HydrateFallback: () => null
|
|
507
506
|
}
|
|
508
|
-
], w = e.basePath ? "/" + e.basePath : void 0, c = t.memory ?
|
|
507
|
+
], w = e.basePath ? "/" + e.basePath : void 0, c = t.memory ? ae(u, {
|
|
509
508
|
basename: w,
|
|
510
509
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
511
|
-
}) :
|
|
510
|
+
}) : se(u, {
|
|
512
511
|
basename: w
|
|
513
512
|
});
|
|
514
|
-
return /* @__PURE__ */ a(
|
|
515
|
-
},
|
|
513
|
+
return /* @__PURE__ */ a(re, { router: c });
|
|
514
|
+
}, Oe = {
|
|
516
515
|
resolvedTheme: "light",
|
|
517
516
|
theme: "system",
|
|
518
517
|
setTheme: () => null
|
|
519
|
-
}, $t =
|
|
520
|
-
function
|
|
518
|
+
}, $t = j(Oe);
|
|
519
|
+
function $e({
|
|
521
520
|
children: t,
|
|
522
521
|
storageKey: e,
|
|
523
522
|
defaultTheme: s = "system",
|
|
524
523
|
...r
|
|
525
524
|
}) {
|
|
526
|
-
const [n, o] =
|
|
525
|
+
const [n, o] = M(
|
|
527
526
|
() => localStorage.getItem(e) || s
|
|
528
527
|
), i = k(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
529
528
|
y(() => {
|
|
@@ -539,20 +538,20 @@ function Oe({
|
|
|
539
538
|
};
|
|
540
539
|
return /* @__PURE__ */ a($t.Provider, { ...r, value: l, children: t });
|
|
541
540
|
}
|
|
542
|
-
const
|
|
543
|
-
const t =
|
|
541
|
+
const We = () => {
|
|
542
|
+
const t = B($t);
|
|
544
543
|
if (t === void 0)
|
|
545
544
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
546
545
|
return t;
|
|
547
|
-
},
|
|
548
|
-
const [e, s] =
|
|
546
|
+
}, ms = (t) => {
|
|
547
|
+
const [e, s] = M(!1);
|
|
549
548
|
y(function() {
|
|
550
549
|
s(!0);
|
|
551
550
|
}, []);
|
|
552
551
|
const r = t.contextData ?? {};
|
|
553
|
-
|
|
552
|
+
Ae(r);
|
|
554
553
|
const n = k(
|
|
555
|
-
() =>
|
|
554
|
+
() => Te({
|
|
556
555
|
modules: t.modules,
|
|
557
556
|
settingsResources: t.settingsResources,
|
|
558
557
|
basePath: t.basePath,
|
|
@@ -573,29 +572,29 @@ const $e = () => {
|
|
|
573
572
|
() => ({ contextData: t.contextData ?? {} }),
|
|
574
573
|
[t.contextData]
|
|
575
574
|
);
|
|
576
|
-
return e ? /* @__PURE__ */ a(
|
|
575
|
+
return e ? /* @__PURE__ */ a(et.Provider, { value: o, children: /* @__PURE__ */ a(at.Provider, { value: i, children: /* @__PURE__ */ a($e, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Fe, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
|
|
577
576
|
};
|
|
578
|
-
function
|
|
577
|
+
function je({
|
|
579
578
|
...t
|
|
580
579
|
}) {
|
|
581
|
-
return /* @__PURE__ */ a(
|
|
580
|
+
return /* @__PURE__ */ a(J.Root, { "data-slot": "collapsible", ...t });
|
|
582
581
|
}
|
|
583
582
|
function mt({
|
|
584
583
|
...t
|
|
585
584
|
}) {
|
|
586
585
|
return /* @__PURE__ */ a(
|
|
587
|
-
|
|
586
|
+
J.CollapsibleTrigger,
|
|
588
587
|
{
|
|
589
588
|
"data-slot": "collapsible-trigger",
|
|
590
589
|
...t
|
|
591
590
|
}
|
|
592
591
|
);
|
|
593
592
|
}
|
|
594
|
-
function
|
|
593
|
+
function Ke({
|
|
595
594
|
...t
|
|
596
595
|
}) {
|
|
597
596
|
return /* @__PURE__ */ a(
|
|
598
|
-
|
|
597
|
+
J.CollapsibleContent,
|
|
599
598
|
{
|
|
600
599
|
"data-slot": "collapsible-content",
|
|
601
600
|
...t
|
|
@@ -603,32 +602,32 @@ function je({
|
|
|
603
602
|
);
|
|
604
603
|
}
|
|
605
604
|
const H = 768;
|
|
606
|
-
function
|
|
607
|
-
const [t, e] =
|
|
605
|
+
function Ve() {
|
|
606
|
+
const [t, e] = g.useState(
|
|
608
607
|
void 0
|
|
609
608
|
);
|
|
610
|
-
return
|
|
609
|
+
return g.useEffect(() => {
|
|
611
610
|
const s = window.matchMedia(`(max-width: ${H - 1}px)`), r = () => {
|
|
612
611
|
e(window.innerWidth < H);
|
|
613
612
|
};
|
|
614
613
|
return s.addEventListener("change", r), e(window.innerWidth < H), () => s.removeEventListener("change", r);
|
|
615
614
|
}, []), !!t;
|
|
616
615
|
}
|
|
617
|
-
const
|
|
618
|
-
function
|
|
619
|
-
const [t, e] =
|
|
616
|
+
const q = 768, G = 1199;
|
|
617
|
+
function Ue() {
|
|
618
|
+
const [t, e] = g.useState(
|
|
620
619
|
void 0
|
|
621
620
|
);
|
|
622
|
-
return
|
|
621
|
+
return g.useEffect(() => {
|
|
623
622
|
const s = window.matchMedia(
|
|
624
|
-
`(min-width: ${
|
|
623
|
+
`(min-width: ${q}px) and (max-width: ${G}px)`
|
|
625
624
|
), r = () => {
|
|
626
625
|
e(
|
|
627
|
-
window.innerWidth >=
|
|
626
|
+
window.innerWidth >= q && window.innerWidth <= G
|
|
628
627
|
);
|
|
629
628
|
};
|
|
630
629
|
return s.addEventListener("change", r), e(
|
|
631
|
-
window.innerWidth >=
|
|
630
|
+
window.innerWidth >= q && window.innerWidth <= G
|
|
632
631
|
), () => s.removeEventListener("change", r);
|
|
633
632
|
}, []), !!t;
|
|
634
633
|
}
|
|
@@ -651,12 +650,12 @@ function He({ className: t, type: e, ...s }) {
|
|
|
651
650
|
function ht({ ...t }) {
|
|
652
651
|
return /* @__PURE__ */ a(b.Root, { "data-slot": "sheet", ...t });
|
|
653
652
|
}
|
|
654
|
-
function
|
|
653
|
+
function qe({
|
|
655
654
|
...t
|
|
656
655
|
}) {
|
|
657
656
|
return /* @__PURE__ */ a(b.Portal, { "data-slot": "sheet-portal", ...t });
|
|
658
657
|
}
|
|
659
|
-
function
|
|
658
|
+
function Ge({
|
|
660
659
|
className: t,
|
|
661
660
|
...e
|
|
662
661
|
}) {
|
|
@@ -678,8 +677,8 @@ function ft({
|
|
|
678
677
|
side: s = "right",
|
|
679
678
|
...r
|
|
680
679
|
}) {
|
|
681
|
-
return /* @__PURE__ */ d(
|
|
682
|
-
/* @__PURE__ */ a(
|
|
680
|
+
return /* @__PURE__ */ d(qe, { children: [
|
|
681
|
+
/* @__PURE__ */ a(Ge, {}),
|
|
683
682
|
/* @__PURE__ */ d(
|
|
684
683
|
b.Content,
|
|
685
684
|
{
|
|
@@ -696,7 +695,7 @@ function ft({
|
|
|
696
695
|
children: [
|
|
697
696
|
e,
|
|
698
697
|
/* @__PURE__ */ d(b.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: [
|
|
699
|
-
/* @__PURE__ */ a(
|
|
698
|
+
/* @__PURE__ */ a(At, { className: "astw:size-4" }),
|
|
700
699
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
701
700
|
] })
|
|
702
701
|
]
|
|
@@ -704,7 +703,7 @@ function ft({
|
|
|
704
703
|
)
|
|
705
704
|
] });
|
|
706
705
|
}
|
|
707
|
-
function
|
|
706
|
+
function pt({ className: t, ...e }) {
|
|
708
707
|
return /* @__PURE__ */ a(
|
|
709
708
|
"div",
|
|
710
709
|
{
|
|
@@ -714,7 +713,7 @@ function gt({ className: t, ...e }) {
|
|
|
714
713
|
}
|
|
715
714
|
);
|
|
716
715
|
}
|
|
717
|
-
function
|
|
716
|
+
function gt({
|
|
718
717
|
className: t,
|
|
719
718
|
...e
|
|
720
719
|
}) {
|
|
@@ -740,12 +739,12 @@ function bt({
|
|
|
740
739
|
}
|
|
741
740
|
);
|
|
742
741
|
}
|
|
743
|
-
function
|
|
742
|
+
function nt({
|
|
744
743
|
delayDuration: t = 0,
|
|
745
744
|
...e
|
|
746
745
|
}) {
|
|
747
746
|
return /* @__PURE__ */ a(
|
|
748
|
-
|
|
747
|
+
R.Provider,
|
|
749
748
|
{
|
|
750
749
|
"data-slot": "tooltip-provider",
|
|
751
750
|
delayDuration: t,
|
|
@@ -753,24 +752,24 @@ function rt({
|
|
|
753
752
|
}
|
|
754
753
|
);
|
|
755
754
|
}
|
|
756
|
-
function
|
|
755
|
+
function ot({
|
|
757
756
|
...t
|
|
758
757
|
}) {
|
|
759
|
-
return /* @__PURE__ */ a(
|
|
758
|
+
return /* @__PURE__ */ a(nt, { children: /* @__PURE__ */ a(R.Root, { "data-slot": "tooltip", ...t }) });
|
|
760
759
|
}
|
|
761
|
-
function
|
|
760
|
+
function it({
|
|
762
761
|
...t
|
|
763
762
|
}) {
|
|
764
|
-
return /* @__PURE__ */ a(
|
|
763
|
+
return /* @__PURE__ */ a(R.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
765
764
|
}
|
|
766
|
-
function
|
|
765
|
+
function lt({
|
|
767
766
|
className: t,
|
|
768
767
|
sideOffset: e = 0,
|
|
769
768
|
children: s,
|
|
770
769
|
...r
|
|
771
770
|
}) {
|
|
772
|
-
return /* @__PURE__ */ a(
|
|
773
|
-
|
|
771
|
+
return /* @__PURE__ */ a(R.Portal, { children: /* @__PURE__ */ d(
|
|
772
|
+
R.Content,
|
|
774
773
|
{
|
|
775
774
|
"data-slot": "tooltip-content",
|
|
776
775
|
sideOffset: e,
|
|
@@ -781,19 +780,19 @@ function it({
|
|
|
781
780
|
...r,
|
|
782
781
|
children: [
|
|
783
782
|
s,
|
|
784
|
-
/* @__PURE__ */ a(
|
|
783
|
+
/* @__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]" })
|
|
785
784
|
]
|
|
786
785
|
}
|
|
787
786
|
) });
|
|
788
787
|
}
|
|
789
|
-
const Wt = "16rem",
|
|
788
|
+
const Wt = "16rem", Qe = "18rem", Ye = "3rem", Xe = "b", jt = g.createContext(null);
|
|
790
789
|
function F() {
|
|
791
|
-
const t =
|
|
790
|
+
const t = g.useContext(jt);
|
|
792
791
|
if (!t)
|
|
793
792
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
794
793
|
return t;
|
|
795
794
|
}
|
|
796
|
-
function
|
|
795
|
+
function Ze({
|
|
797
796
|
defaultOpen: t = !0,
|
|
798
797
|
open: e,
|
|
799
798
|
onOpenChange: s,
|
|
@@ -802,45 +801,56 @@ function Xe({
|
|
|
802
801
|
children: o,
|
|
803
802
|
...i
|
|
804
803
|
}) {
|
|
805
|
-
const l =
|
|
804
|
+
const l = Ve(), u = Ue(), [w, c] = g.useState(!1), [h, f] = g.useState(!1), [p, P] = g.useState(t), S = e ?? p, L = g.useCallback(
|
|
806
805
|
(x) => {
|
|
807
|
-
const T = typeof x == "function" ? x(
|
|
808
|
-
s ? s(T) :
|
|
806
|
+
const T = typeof x == "function" ? x(S) : x;
|
|
807
|
+
s ? s(T) : P(T);
|
|
809
808
|
},
|
|
810
|
-
[s,
|
|
811
|
-
),
|
|
812
|
-
|
|
809
|
+
[s, S]
|
|
810
|
+
), C = u && !l, O = g.useCallback(() => l ? c((x) => !x) : C ? f((x) => !x) : L((x) => !x), [l, C, L, c]);
|
|
811
|
+
g.useEffect(() => {
|
|
813
812
|
const x = (T) => {
|
|
814
|
-
T.key ===
|
|
813
|
+
T.key === Xe && (T.metaKey || T.ctrlKey) && (T.preventDefault(), O());
|
|
815
814
|
};
|
|
816
815
|
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
817
816
|
}, [O]);
|
|
818
|
-
const
|
|
817
|
+
const ct = S ? "expanded" : "collapsed", Yt = g.useMemo(
|
|
819
818
|
() => ({
|
|
820
|
-
state:
|
|
821
|
-
open:
|
|
822
|
-
setOpen:
|
|
819
|
+
state: ct,
|
|
820
|
+
open: S,
|
|
821
|
+
setOpen: L,
|
|
823
822
|
isMobile: l,
|
|
824
823
|
openMobile: w,
|
|
825
824
|
setOpenMobile: c,
|
|
826
825
|
toggleSidebar: O,
|
|
827
|
-
isIconMode:
|
|
826
|
+
isIconMode: C,
|
|
828
827
|
openIconMode: h,
|
|
829
828
|
setOpenIconMode: f
|
|
830
829
|
}),
|
|
831
|
-
[
|
|
830
|
+
[
|
|
831
|
+
ct,
|
|
832
|
+
S,
|
|
833
|
+
L,
|
|
834
|
+
l,
|
|
835
|
+
w,
|
|
836
|
+
c,
|
|
837
|
+
O,
|
|
838
|
+
C,
|
|
839
|
+
h,
|
|
840
|
+
f
|
|
841
|
+
]
|
|
832
842
|
);
|
|
833
|
-
return /* @__PURE__ */ a(jt.Provider, { value:
|
|
843
|
+
return /* @__PURE__ */ a(jt.Provider, { value: Yt, children: /* @__PURE__ */ a(nt, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
834
844
|
"div",
|
|
835
845
|
{
|
|
836
846
|
"data-slot": "sidebar-wrapper",
|
|
837
847
|
style: {
|
|
838
848
|
"--sidebar-width": Wt,
|
|
839
|
-
"--sidebar-width-icon":
|
|
849
|
+
"--sidebar-width-icon": Ye,
|
|
840
850
|
...n
|
|
841
851
|
},
|
|
842
852
|
className: m(
|
|
843
|
-
"astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full",
|
|
853
|
+
"astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full astw:overflow-hidden",
|
|
844
854
|
r
|
|
845
855
|
),
|
|
846
856
|
...i,
|
|
@@ -848,7 +858,7 @@ function Xe({
|
|
|
848
858
|
}
|
|
849
859
|
) }) });
|
|
850
860
|
}
|
|
851
|
-
function
|
|
861
|
+
function Je({
|
|
852
862
|
side: t = "left",
|
|
853
863
|
variant: e = "sidebar",
|
|
854
864
|
collapsible: s = "offcanvas",
|
|
@@ -856,7 +866,15 @@ function Ze({
|
|
|
856
866
|
children: n,
|
|
857
867
|
...o
|
|
858
868
|
}) {
|
|
859
|
-
const {
|
|
869
|
+
const {
|
|
870
|
+
isMobile: i,
|
|
871
|
+
state: l,
|
|
872
|
+
openMobile: u,
|
|
873
|
+
setOpenMobile: w,
|
|
874
|
+
isIconMode: c,
|
|
875
|
+
openIconMode: h,
|
|
876
|
+
setOpenIconMode: f
|
|
877
|
+
} = F();
|
|
860
878
|
return s === "none" ? /* @__PURE__ */ a(
|
|
861
879
|
"div",
|
|
862
880
|
{
|
|
@@ -876,18 +894,18 @@ function Ze({
|
|
|
876
894
|
"data-mobile": "true",
|
|
877
895
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
878
896
|
style: {
|
|
879
|
-
"--sidebar-width":
|
|
897
|
+
"--sidebar-width": Qe
|
|
880
898
|
},
|
|
881
899
|
side: t,
|
|
882
900
|
children: [
|
|
883
|
-
/* @__PURE__ */ d(
|
|
884
|
-
/* @__PURE__ */ a(
|
|
901
|
+
/* @__PURE__ */ d(pt, { className: "astw:sr-only", children: [
|
|
902
|
+
/* @__PURE__ */ a(gt, { children: "Sidebar" }),
|
|
885
903
|
/* @__PURE__ */ a(bt, { children: "Displays the mobile sidebar." })
|
|
886
904
|
] }),
|
|
887
905
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
888
906
|
]
|
|
889
907
|
}
|
|
890
|
-
) }) : c && s === "icon" ? /* @__PURE__ */ d(
|
|
908
|
+
) }) : c && s === "icon" ? /* @__PURE__ */ d(E, { children: [
|
|
891
909
|
/* @__PURE__ */ d(
|
|
892
910
|
"div",
|
|
893
911
|
{
|
|
@@ -944,8 +962,8 @@ function Ze({
|
|
|
944
962
|
},
|
|
945
963
|
side: t,
|
|
946
964
|
children: [
|
|
947
|
-
/* @__PURE__ */ d(
|
|
948
|
-
/* @__PURE__ */ a(
|
|
965
|
+
/* @__PURE__ */ d(pt, { className: "astw:sr-only", children: [
|
|
966
|
+
/* @__PURE__ */ a(gt, { children: "Sidebar" }),
|
|
949
967
|
/* @__PURE__ */ a(bt, { children: "Displays the sidebar overlay." })
|
|
950
968
|
] }),
|
|
951
969
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
@@ -1021,13 +1039,13 @@ function Kt({
|
|
|
1021
1039
|
},
|
|
1022
1040
|
...s,
|
|
1023
1041
|
children: [
|
|
1024
|
-
/* @__PURE__ */ a(
|
|
1042
|
+
/* @__PURE__ */ a(ue, { className: "astw:size-4.5" }),
|
|
1025
1043
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
1026
1044
|
]
|
|
1027
1045
|
}
|
|
1028
1046
|
);
|
|
1029
1047
|
}
|
|
1030
|
-
function
|
|
1048
|
+
function ta({ className: t, ...e }) {
|
|
1031
1049
|
return /* @__PURE__ */ a(
|
|
1032
1050
|
"main",
|
|
1033
1051
|
{
|
|
@@ -1042,24 +1060,30 @@ function Je({ className: t, ...e }) {
|
|
|
1042
1060
|
}
|
|
1043
1061
|
);
|
|
1044
1062
|
}
|
|
1045
|
-
function
|
|
1063
|
+
function ea({ className: t, ...e }) {
|
|
1046
1064
|
return /* @__PURE__ */ a(
|
|
1047
1065
|
"div",
|
|
1048
1066
|
{
|
|
1049
1067
|
"data-slot": "sidebar-header",
|
|
1050
1068
|
"data-sidebar": "header",
|
|
1051
|
-
className: m(
|
|
1069
|
+
className: m(
|
|
1070
|
+
"astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2",
|
|
1071
|
+
t
|
|
1072
|
+
),
|
|
1052
1073
|
...e
|
|
1053
1074
|
}
|
|
1054
1075
|
);
|
|
1055
1076
|
}
|
|
1056
|
-
function
|
|
1077
|
+
function aa({ className: t, ...e }) {
|
|
1057
1078
|
return /* @__PURE__ */ a(
|
|
1058
1079
|
"div",
|
|
1059
1080
|
{
|
|
1060
1081
|
"data-slot": "sidebar-content",
|
|
1061
1082
|
"data-sidebar": "content",
|
|
1062
|
-
className: m(
|
|
1083
|
+
className: m(
|
|
1084
|
+
"astw:flex astw:min-h-0 astw:flex-1 astw:flex-col astw:gap-2 astw:overflow-auto astw:group-data-[collapsible=icon]:overflow-hidden",
|
|
1085
|
+
t
|
|
1086
|
+
),
|
|
1063
1087
|
...e
|
|
1064
1088
|
}
|
|
1065
1089
|
);
|
|
@@ -1070,23 +1094,29 @@ function Vt({ className: t, ...e }) {
|
|
|
1070
1094
|
{
|
|
1071
1095
|
"data-slot": "sidebar-group",
|
|
1072
1096
|
"data-sidebar": "group",
|
|
1073
|
-
className: m(
|
|
1097
|
+
className: m(
|
|
1098
|
+
"astw:relative astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:p-2",
|
|
1099
|
+
t
|
|
1100
|
+
),
|
|
1074
1101
|
...e
|
|
1075
1102
|
}
|
|
1076
1103
|
);
|
|
1077
1104
|
}
|
|
1078
|
-
function
|
|
1105
|
+
function Ut({ className: t, ...e }) {
|
|
1079
1106
|
return /* @__PURE__ */ a(
|
|
1080
1107
|
"ul",
|
|
1081
1108
|
{
|
|
1082
1109
|
"data-slot": "sidebar-menu",
|
|
1083
1110
|
"data-sidebar": "menu",
|
|
1084
|
-
className: m(
|
|
1111
|
+
className: m(
|
|
1112
|
+
"astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1",
|
|
1113
|
+
t
|
|
1114
|
+
),
|
|
1085
1115
|
...e
|
|
1086
1116
|
}
|
|
1087
1117
|
);
|
|
1088
1118
|
}
|
|
1089
|
-
function
|
|
1119
|
+
function Ht({ className: t, ...e }) {
|
|
1090
1120
|
return /* @__PURE__ */ a(
|
|
1091
1121
|
"li",
|
|
1092
1122
|
{
|
|
@@ -1097,7 +1127,7 @@ function Ut({ className: t, ...e }) {
|
|
|
1097
1127
|
}
|
|
1098
1128
|
);
|
|
1099
1129
|
}
|
|
1100
|
-
const
|
|
1130
|
+
const sa = Z(
|
|
1101
1131
|
"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:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
1102
1132
|
{
|
|
1103
1133
|
variants: {
|
|
@@ -1133,16 +1163,16 @@ function xt({
|
|
|
1133
1163
|
"data-sidebar": "menu-button",
|
|
1134
1164
|
"data-size": r,
|
|
1135
1165
|
"data-active": e,
|
|
1136
|
-
className: m(
|
|
1166
|
+
className: m(sa({ variant: s, size: r }), o),
|
|
1137
1167
|
...i
|
|
1138
1168
|
}
|
|
1139
1169
|
);
|
|
1140
1170
|
return n ? (typeof n == "string" && (n = {
|
|
1141
1171
|
children: n
|
|
1142
|
-
}), /* @__PURE__ */ d(
|
|
1143
|
-
/* @__PURE__ */ a(
|
|
1172
|
+
}), /* @__PURE__ */ d(ot, { children: [
|
|
1173
|
+
/* @__PURE__ */ a(it, { asChild: !0, children: c }),
|
|
1144
1174
|
/* @__PURE__ */ a(
|
|
1145
|
-
|
|
1175
|
+
lt,
|
|
1146
1176
|
{
|
|
1147
1177
|
side: "right",
|
|
1148
1178
|
align: "center",
|
|
@@ -1178,7 +1208,7 @@ function vt({
|
|
|
1178
1208
|
}
|
|
1179
1209
|
);
|
|
1180
1210
|
}
|
|
1181
|
-
function
|
|
1211
|
+
function ra({ className: t, ...e }) {
|
|
1182
1212
|
return /* @__PURE__ */ a(
|
|
1183
1213
|
"ul",
|
|
1184
1214
|
{
|
|
@@ -1193,7 +1223,7 @@ function sa({ className: t, ...e }) {
|
|
|
1193
1223
|
}
|
|
1194
1224
|
);
|
|
1195
1225
|
}
|
|
1196
|
-
function
|
|
1226
|
+
function na({
|
|
1197
1227
|
className: t,
|
|
1198
1228
|
...e
|
|
1199
1229
|
}) {
|
|
@@ -1207,7 +1237,7 @@ function ra({
|
|
|
1207
1237
|
}
|
|
1208
1238
|
);
|
|
1209
1239
|
}
|
|
1210
|
-
function
|
|
1240
|
+
function oa({
|
|
1211
1241
|
asChild: t = !1,
|
|
1212
1242
|
size: e = "md",
|
|
1213
1243
|
isActive: s = !1,
|
|
@@ -1233,9 +1263,9 @@ function na({
|
|
|
1233
1263
|
}
|
|
1234
1264
|
);
|
|
1235
1265
|
}
|
|
1236
|
-
function
|
|
1266
|
+
function Y({ to: t, children: e, ...s }) {
|
|
1237
1267
|
try {
|
|
1238
|
-
return
|
|
1268
|
+
return ne(t), /* @__PURE__ */ a(oe, { to: t, ...s, children: e });
|
|
1239
1269
|
} catch {
|
|
1240
1270
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1241
1271
|
}
|
|
@@ -1256,7 +1286,7 @@ function Nt({ className: t, ...e }) {
|
|
|
1256
1286
|
}
|
|
1257
1287
|
);
|
|
1258
1288
|
}
|
|
1259
|
-
function
|
|
1289
|
+
function St({ className: t, ...e }) {
|
|
1260
1290
|
return /* @__PURE__ */ a(
|
|
1261
1291
|
"li",
|
|
1262
1292
|
{
|
|
@@ -1266,14 +1296,14 @@ function Ct({ className: t, ...e }) {
|
|
|
1266
1296
|
}
|
|
1267
1297
|
);
|
|
1268
1298
|
}
|
|
1269
|
-
function
|
|
1299
|
+
function Ct({
|
|
1270
1300
|
asChild: t,
|
|
1271
1301
|
className: e,
|
|
1272
1302
|
children: s,
|
|
1273
1303
|
...r
|
|
1274
1304
|
}) {
|
|
1275
1305
|
return /* @__PURE__ */ a(
|
|
1276
|
-
t ? z :
|
|
1306
|
+
t ? z : Y,
|
|
1277
1307
|
{
|
|
1278
1308
|
"data-slot": "breadcrumb-link",
|
|
1279
1309
|
className: m("astw:hover:text-foreground astw:transition-colors", e),
|
|
@@ -1282,7 +1312,7 @@ function St({
|
|
|
1282
1312
|
}
|
|
1283
1313
|
);
|
|
1284
1314
|
}
|
|
1285
|
-
function
|
|
1315
|
+
function ia({
|
|
1286
1316
|
children: t,
|
|
1287
1317
|
className: e,
|
|
1288
1318
|
...s
|
|
@@ -1295,18 +1325,18 @@ function oa({
|
|
|
1295
1325
|
"aria-hidden": "true",
|
|
1296
1326
|
className: m("astw:[&>svg]:size-3.5", e),
|
|
1297
1327
|
...s,
|
|
1298
|
-
children: t ?? /* @__PURE__ */ a(
|
|
1328
|
+
children: t ?? /* @__PURE__ */ a(Q, {})
|
|
1299
1329
|
}
|
|
1300
1330
|
);
|
|
1301
1331
|
}
|
|
1302
|
-
function
|
|
1332
|
+
function la(t, e) {
|
|
1303
1333
|
if (!e.trim()) return t;
|
|
1304
1334
|
const s = e.toLowerCase();
|
|
1305
1335
|
return t.filter(
|
|
1306
1336
|
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1307
1337
|
);
|
|
1308
1338
|
}
|
|
1309
|
-
const
|
|
1339
|
+
const da = (t, e) => {
|
|
1310
1340
|
const s = Pt(e);
|
|
1311
1341
|
return t.reduce(
|
|
1312
1342
|
(r, n) => {
|
|
@@ -1335,18 +1365,18 @@ const la = (t, e) => {
|
|
|
1335
1365
|
{}
|
|
1336
1366
|
);
|
|
1337
1367
|
};
|
|
1338
|
-
function
|
|
1339
|
-
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i =
|
|
1368
|
+
function ca(t, e, s, r) {
|
|
1369
|
+
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = da(s, r), l = o.map((u, w) => {
|
|
1340
1370
|
const c = o.slice(0, w + 1).join("/");
|
|
1341
1371
|
let h = i[c];
|
|
1342
1372
|
if (!h) {
|
|
1343
|
-
const
|
|
1344
|
-
([
|
|
1345
|
-
const
|
|
1346
|
-
return new RegExp(`^${
|
|
1373
|
+
const p = Object.entries(i).find(
|
|
1374
|
+
([P]) => {
|
|
1375
|
+
const S = P.split("/").map((C) => C.startsWith(":") ? "[^/]+" : C).join("/");
|
|
1376
|
+
return new RegExp(`^${S}$`).test(c);
|
|
1347
1377
|
}
|
|
1348
1378
|
)?.[1];
|
|
1349
|
-
|
|
1379
|
+
p && (h = p);
|
|
1350
1380
|
}
|
|
1351
1381
|
let f;
|
|
1352
1382
|
return h ? typeof h.breadcrumbTitle == "function" ? f = h.breadcrumbTitle(u) : typeof h.breadcrumbTitle == "string" ? f = h.breadcrumbTitle : f = h.title : f = decodeURIComponent(u), {
|
|
@@ -1360,28 +1390,28 @@ function da(t, e, s, r) {
|
|
|
1360
1390
|
segments: l
|
|
1361
1391
|
};
|
|
1362
1392
|
}
|
|
1363
|
-
const
|
|
1393
|
+
const wa = () => {
|
|
1364
1394
|
const { open: t, isIconMode: e } = F();
|
|
1365
1395
|
return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-2.5" }) });
|
|
1366
|
-
},
|
|
1367
|
-
const e = t.children ? t.children({ Outlet: ut }) : null, s =
|
|
1396
|
+
}, hs = (t) => {
|
|
1397
|
+
const e = t.children ? t.children({ Outlet: ut }) : null, s = We(), r = () => {
|
|
1368
1398
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1369
1399
|
};
|
|
1370
|
-
return /* @__PURE__ */ a(
|
|
1371
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1372
|
-
/* @__PURE__ */ d(
|
|
1400
|
+
return /* @__PURE__ */ a(Ze, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
|
|
1401
|
+
t.sidebar ?? /* @__PURE__ */ a(ua, {}),
|
|
1402
|
+
/* @__PURE__ */ d(ta, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1373
1403
|
/* @__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__ */ d("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
|
|
1374
1404
|
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1375
|
-
/* @__PURE__ */ a(
|
|
1405
|
+
/* @__PURE__ */ a(wa, {}),
|
|
1376
1406
|
/* @__PURE__ */ a(ga, {})
|
|
1377
1407
|
] }),
|
|
1378
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(_, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(
|
|
1408
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(_, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(me, {}) }) })
|
|
1379
1409
|
] }) }),
|
|
1380
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ut, {}) })
|
|
1410
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(ut, {}) })
|
|
1381
1411
|
] })
|
|
1382
1412
|
] }) });
|
|
1383
|
-
},
|
|
1384
|
-
const { title: e, icon: s } =
|
|
1413
|
+
}, ua = (t) => {
|
|
1414
|
+
const { title: e, icon: s } = A(), { pathname: r } = Et(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(ea, { children: [
|
|
1385
1415
|
s,
|
|
1386
1416
|
/* @__PURE__ */ a(
|
|
1387
1417
|
"h1",
|
|
@@ -1394,23 +1424,23 @@ const ca = () => {
|
|
|
1394
1424
|
}
|
|
1395
1425
|
)
|
|
1396
1426
|
] });
|
|
1397
|
-
return /* @__PURE__ */ d(
|
|
1427
|
+
return /* @__PURE__ */ d(Je, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
|
|
1398
1428
|
!n && /* @__PURE__ */ d("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1399
1429
|
t.header ?? o,
|
|
1400
1430
|
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-1" }) })
|
|
1401
1431
|
] }),
|
|
1402
|
-
/* @__PURE__ */ a(
|
|
1432
|
+
/* @__PURE__ */ a(aa, { children: /* @__PURE__ */ a(Dt, { fallback: /* @__PURE__ */ a(fa, {}), children: /* @__PURE__ */ a(ma, { currentPath: r }) }) }),
|
|
1403
1433
|
t.footer ?? null
|
|
1404
1434
|
] });
|
|
1405
|
-
},
|
|
1435
|
+
}, ma = ({ currentPath: t }) => {
|
|
1406
1436
|
const e = Ft();
|
|
1407
|
-
return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(
|
|
1408
|
-
},
|
|
1409
|
-
const e =
|
|
1410
|
-
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(
|
|
1411
|
-
s.url ? /* @__PURE__ */ d(
|
|
1437
|
+
return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(ha, { items: s ?? [], currentPath: t }) });
|
|
1438
|
+
}, ha = (t) => {
|
|
1439
|
+
const e = D();
|
|
1440
|
+
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ut, { children: t.items.map((s) => /* @__PURE__ */ a(je, { asChild: !0, defaultOpen: !0, children: /* @__PURE__ */ d(Ht, { children: [
|
|
1441
|
+
s.url ? /* @__PURE__ */ d(E, { children: [
|
|
1412
1442
|
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
|
|
1413
|
-
|
|
1443
|
+
Y,
|
|
1414
1444
|
{
|
|
1415
1445
|
to: s.url,
|
|
1416
1446
|
className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1421,10 +1451,10 @@ const ca = () => {
|
|
|
1421
1451
|
}
|
|
1422
1452
|
) }),
|
|
1423
1453
|
!!s.items?.length && /* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(vt, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1424
|
-
/* @__PURE__ */ a(
|
|
1454
|
+
/* @__PURE__ */ a(Q, {}),
|
|
1425
1455
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1426
1456
|
] }) })
|
|
1427
|
-
] }) : /* @__PURE__ */ a(
|
|
1457
|
+
] }) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ d(mt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1428
1458
|
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1429
1459
|
s.icon,
|
|
1430
1460
|
/* @__PURE__ */ a("span", { children: s.title })
|
|
@@ -1435,14 +1465,14 @@ const ca = () => {
|
|
|
1435
1465
|
className: "astw-rotate-target",
|
|
1436
1466
|
asChild: !0,
|
|
1437
1467
|
children: /* @__PURE__ */ d("span", { children: [
|
|
1438
|
-
/* @__PURE__ */ a(
|
|
1468
|
+
/* @__PURE__ */ a(Q, {}),
|
|
1439
1469
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1440
1470
|
] })
|
|
1441
1471
|
}
|
|
1442
1472
|
)
|
|
1443
1473
|
] }) }),
|
|
1444
|
-
!!s.items?.length && /* @__PURE__ */ a(
|
|
1445
|
-
|
|
1474
|
+
!!s.items?.length && /* @__PURE__ */ a(Ke, { children: /* @__PURE__ */ a(ra, { children: s.items?.map((r) => /* @__PURE__ */ a(na, { children: /* @__PURE__ */ a(oa, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1475
|
+
Y,
|
|
1446
1476
|
{
|
|
1447
1477
|
to: r.url,
|
|
1448
1478
|
className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1450,9 +1480,9 @@ const ca = () => {
|
|
|
1450
1480
|
}
|
|
1451
1481
|
) }) }, r.title)) }) })
|
|
1452
1482
|
] }) }, s.title)) }) });
|
|
1453
|
-
},
|
|
1483
|
+
}, fa = () => {
|
|
1454
1484
|
const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
|
|
1455
|
-
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(
|
|
1485
|
+
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(Ut, { className: "astw:px-2", children: e.map((s, r) => /* @__PURE__ */ a(Ht, { children: /* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
|
|
1456
1486
|
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1457
1487
|
/* @__PURE__ */ a(
|
|
1458
1488
|
"div",
|
|
@@ -1462,39 +1492,39 @@ const ca = () => {
|
|
|
1462
1492
|
}
|
|
1463
1493
|
)
|
|
1464
1494
|
] }) }, r)) }) });
|
|
1465
|
-
},
|
|
1466
|
-
const { configurations: t } =
|
|
1467
|
-
return
|
|
1495
|
+
}, pa = () => {
|
|
1496
|
+
const { configurations: t } = A(), e = Et();
|
|
1497
|
+
return ca(
|
|
1468
1498
|
e.pathname,
|
|
1469
1499
|
t.basePath,
|
|
1470
1500
|
t.modules,
|
|
1471
1501
|
t.locale
|
|
1472
1502
|
);
|
|
1473
1503
|
}, ga = () => {
|
|
1474
|
-
const { segments: t } =
|
|
1475
|
-
return e ? /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(
|
|
1504
|
+
const { segments: t } = pa(), e = ie("/:prefix/settings/:suffix"), s = D();
|
|
1505
|
+
return e ? /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(St, { children: /* @__PURE__ */ a(Ct, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(yt, { children: /* @__PURE__ */ a(Nt, { children: t.map((r, n) => /* @__PURE__ */ d(
|
|
1476
1506
|
"div",
|
|
1477
1507
|
{
|
|
1478
1508
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1479
1509
|
children: [
|
|
1480
|
-
/* @__PURE__ */ a(
|
|
1481
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1510
|
+
/* @__PURE__ */ a(St, { children: /* @__PURE__ */ a(Ct, { to: r.path, children: r.title }) }),
|
|
1511
|
+
n < t.length - 1 && /* @__PURE__ */ a(ia, {})
|
|
1482
1512
|
]
|
|
1483
1513
|
},
|
|
1484
1514
|
n
|
|
1485
1515
|
)) }) });
|
|
1486
1516
|
};
|
|
1487
|
-
function
|
|
1517
|
+
function ba({
|
|
1488
1518
|
...t
|
|
1489
1519
|
}) {
|
|
1490
1520
|
return /* @__PURE__ */ a(b.Root, { "data-slot": "dialog", ...t });
|
|
1491
1521
|
}
|
|
1492
|
-
function
|
|
1522
|
+
function xa({
|
|
1493
1523
|
...t
|
|
1494
1524
|
}) {
|
|
1495
1525
|
return /* @__PURE__ */ a(b.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1496
1526
|
}
|
|
1497
|
-
function
|
|
1527
|
+
function va({
|
|
1498
1528
|
className: t,
|
|
1499
1529
|
...e
|
|
1500
1530
|
}) {
|
|
@@ -1510,13 +1540,13 @@ function xa({
|
|
|
1510
1540
|
}
|
|
1511
1541
|
);
|
|
1512
1542
|
}
|
|
1513
|
-
function
|
|
1543
|
+
function ya({
|
|
1514
1544
|
className: t,
|
|
1515
1545
|
children: e,
|
|
1516
1546
|
...s
|
|
1517
1547
|
}) {
|
|
1518
|
-
return /* @__PURE__ */ d(
|
|
1519
|
-
/* @__PURE__ */ a(
|
|
1548
|
+
return /* @__PURE__ */ d(xa, { "data-slot": "dialog-portal", children: [
|
|
1549
|
+
/* @__PURE__ */ a(va, {}),
|
|
1520
1550
|
/* @__PURE__ */ d(
|
|
1521
1551
|
b.Content,
|
|
1522
1552
|
{
|
|
@@ -1529,7 +1559,7 @@ function va({
|
|
|
1529
1559
|
children: [
|
|
1530
1560
|
e,
|
|
1531
1561
|
/* @__PURE__ */ d(b.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: [
|
|
1532
|
-
/* @__PURE__ */ a(
|
|
1562
|
+
/* @__PURE__ */ a(At, {}),
|
|
1533
1563
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1534
1564
|
] })
|
|
1535
1565
|
]
|
|
@@ -1537,7 +1567,7 @@ function va({
|
|
|
1537
1567
|
)
|
|
1538
1568
|
] });
|
|
1539
1569
|
}
|
|
1540
|
-
function
|
|
1570
|
+
function Na({
|
|
1541
1571
|
className: t,
|
|
1542
1572
|
...e
|
|
1543
1573
|
}) {
|
|
@@ -1550,7 +1580,7 @@ function ya({
|
|
|
1550
1580
|
}
|
|
1551
1581
|
);
|
|
1552
1582
|
}
|
|
1553
|
-
function
|
|
1583
|
+
function Sa(t) {
|
|
1554
1584
|
const e = [], s = (r, n, o) => {
|
|
1555
1585
|
r.forEach((i) => {
|
|
1556
1586
|
const l = [...o, i.title];
|
|
@@ -1574,13 +1604,13 @@ function Na(t) {
|
|
|
1574
1604
|
function Ca({
|
|
1575
1605
|
routes: t
|
|
1576
1606
|
}) {
|
|
1577
|
-
const e =
|
|
1578
|
-
() =>
|
|
1607
|
+
const e = le(), s = be(null), [r, n] = M(!1), [o, i] = M(""), [l, u] = M(0), w = k(
|
|
1608
|
+
() => la(t, o),
|
|
1579
1609
|
[t, o]
|
|
1580
1610
|
);
|
|
1581
1611
|
y(() => {
|
|
1582
|
-
const f = (
|
|
1583
|
-
(
|
|
1612
|
+
const f = (p) => {
|
|
1613
|
+
(p.metaKey || p.ctrlKey) && p.key === "k" && (p.preventDefault(), n((P) => !P));
|
|
1584
1614
|
};
|
|
1585
1615
|
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
1586
1616
|
}, []), y(() => {
|
|
@@ -1590,22 +1620,22 @@ function Ca({
|
|
|
1590
1620
|
}, [r]), y(() => {
|
|
1591
1621
|
s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1592
1622
|
}, [l]);
|
|
1593
|
-
const c =
|
|
1623
|
+
const c = W(
|
|
1594
1624
|
(f) => {
|
|
1595
1625
|
e(f.path), n(!1), i("");
|
|
1596
1626
|
},
|
|
1597
1627
|
[e]
|
|
1598
|
-
), h =
|
|
1628
|
+
), h = W(
|
|
1599
1629
|
(f) => {
|
|
1600
1630
|
if (!f.nativeEvent.isComposing)
|
|
1601
1631
|
switch (f.key) {
|
|
1602
1632
|
case "ArrowDown":
|
|
1603
1633
|
f.preventDefault(), u(
|
|
1604
|
-
(
|
|
1634
|
+
(p) => p < w.length - 1 ? p + 1 : p
|
|
1605
1635
|
);
|
|
1606
1636
|
break;
|
|
1607
1637
|
case "ArrowUp":
|
|
1608
|
-
f.preventDefault(), u((
|
|
1638
|
+
f.preventDefault(), u((p) => p > 0 ? p - 1 : p);
|
|
1609
1639
|
break;
|
|
1610
1640
|
case "Enter":
|
|
1611
1641
|
f.preventDefault(), w[l] && c(w[l]);
|
|
@@ -1626,10 +1656,10 @@ function Ca({
|
|
|
1626
1656
|
listRef: s
|
|
1627
1657
|
};
|
|
1628
1658
|
}
|
|
1629
|
-
function
|
|
1659
|
+
function Ta({
|
|
1630
1660
|
navItems: t
|
|
1631
1661
|
}) {
|
|
1632
|
-
const e =
|
|
1662
|
+
const e = D(), s = k(() => Sa(t), [t]), {
|
|
1633
1663
|
open: r,
|
|
1634
1664
|
setOpen: n,
|
|
1635
1665
|
search: o,
|
|
@@ -1640,16 +1670,16 @@ function Sa({
|
|
|
1640
1670
|
handleKeyDown: c,
|
|
1641
1671
|
listRef: h
|
|
1642
1672
|
} = Ca({ routes: s });
|
|
1643
|
-
return /* @__PURE__ */ a(
|
|
1644
|
-
|
|
1673
|
+
return /* @__PURE__ */ a(ba, { open: r, onOpenChange: n, children: /* @__PURE__ */ d(
|
|
1674
|
+
ya,
|
|
1645
1675
|
{
|
|
1646
1676
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1647
1677
|
onKeyDown: c,
|
|
1648
1678
|
"aria-describedby": void 0,
|
|
1649
1679
|
children: [
|
|
1650
|
-
/* @__PURE__ */ a(
|
|
1680
|
+
/* @__PURE__ */ a(Na, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1651
1681
|
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1652
|
-
/* @__PURE__ */ a(
|
|
1682
|
+
/* @__PURE__ */ a(he, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1653
1683
|
/* @__PURE__ */ a(
|
|
1654
1684
|
He,
|
|
1655
1685
|
{
|
|
@@ -1666,14 +1696,14 @@ function Sa({
|
|
|
1666
1696
|
{
|
|
1667
1697
|
ref: h,
|
|
1668
1698
|
className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1669
|
-
children: u.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: u.map((f,
|
|
1699
|
+
children: u.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: u.map((f, p) => /* @__PURE__ */ d(
|
|
1670
1700
|
"button",
|
|
1671
1701
|
{
|
|
1672
|
-
"data-index":
|
|
1702
|
+
"data-index": p,
|
|
1673
1703
|
onClick: () => w(f),
|
|
1674
1704
|
className: m(
|
|
1675
1705
|
"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",
|
|
1676
|
-
|
|
1706
|
+
p === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1677
1707
|
),
|
|
1678
1708
|
children: [
|
|
1679
1709
|
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
|
|
@@ -1691,50 +1721,98 @@ function Sa({
|
|
|
1691
1721
|
}
|
|
1692
1722
|
) });
|
|
1693
1723
|
}
|
|
1694
|
-
function
|
|
1724
|
+
function fs() {
|
|
1695
1725
|
const t = Ft();
|
|
1696
|
-
return /* @__PURE__ */ a(
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
const e =
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
()
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1726
|
+
return /* @__PURE__ */ a(Dt, { fallback: null, children: /* @__PURE__ */ a(Bt, { resolve: t, children: (e) => /* @__PURE__ */ a(Ta, { navItems: e ?? [] }) }) });
|
|
1727
|
+
}
|
|
1728
|
+
function ka(t) {
|
|
1729
|
+
const e = new URLSearchParams(t.search);
|
|
1730
|
+
e.delete("code"), e.delete("state");
|
|
1731
|
+
const s = e.toString();
|
|
1732
|
+
return t.pathname + (s ? `?${s}` : "") + t.hash;
|
|
1733
|
+
}
|
|
1734
|
+
function ps(t) {
|
|
1735
|
+
const e = Ne(t), { appUri: s } = t;
|
|
1736
|
+
return {
|
|
1737
|
+
...e,
|
|
1738
|
+
getAppUri() {
|
|
1739
|
+
return s;
|
|
1740
|
+
},
|
|
1741
|
+
async getAuthHeadersForQuery(n = "/query", o = "POST") {
|
|
1742
|
+
const i = `${s}${n}`;
|
|
1743
|
+
return e.getAuthHeaders(i, o);
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
const qt = j(null), gs = (t) => {
|
|
1748
|
+
const e = t.client, s = W(
|
|
1749
|
+
(l) => e.addEventListener((u) => {
|
|
1750
|
+
u.type === "auth_state_changed" && l();
|
|
1715
1751
|
}),
|
|
1716
1752
|
[e]
|
|
1717
|
-
);
|
|
1718
|
-
|
|
1753
|
+
), r = W(() => e.getState(), [e]), n = xe(s, r);
|
|
1754
|
+
y(() => {
|
|
1755
|
+
(async () => {
|
|
1756
|
+
if (new URLSearchParams(window.location.search).has("code"))
|
|
1757
|
+
try {
|
|
1758
|
+
await e.handleCallback();
|
|
1759
|
+
const w = ka(
|
|
1760
|
+
new URL(window.location.href)
|
|
1761
|
+
);
|
|
1762
|
+
window.history.replaceState({}, "", w);
|
|
1763
|
+
} catch (w) {
|
|
1764
|
+
console.error("Failed to handle callback:", w);
|
|
1765
|
+
}
|
|
1766
|
+
else
|
|
1767
|
+
await e.checkAuthStatus();
|
|
1768
|
+
})();
|
|
1769
|
+
}, [e]), y(() => {
|
|
1770
|
+
t.autoLogin && (!n.isReady || n.isAuthenticated || e.login());
|
|
1771
|
+
}, [n.isReady, n.isAuthenticated, t.autoLogin, e]);
|
|
1772
|
+
const o = n.isAuthenticated, i = t.guardComponent && (!n.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1719
1773
|
return /* @__PURE__ */ a(
|
|
1720
|
-
|
|
1774
|
+
qt.Provider,
|
|
1721
1775
|
{
|
|
1722
1776
|
value: {
|
|
1723
|
-
authState:
|
|
1724
|
-
login:
|
|
1725
|
-
logout:
|
|
1726
|
-
checkAuthStatus:
|
|
1727
|
-
|
|
1777
|
+
authState: n,
|
|
1778
|
+
login: () => e.login(),
|
|
1779
|
+
logout: () => e.logout(),
|
|
1780
|
+
checkAuthStatus: () => e.checkAuthStatus(),
|
|
1781
|
+
ready: () => e.ready()
|
|
1728
1782
|
},
|
|
1729
|
-
children:
|
|
1783
|
+
children: i
|
|
1730
1784
|
}
|
|
1731
1785
|
);
|
|
1732
|
-
},
|
|
1733
|
-
const t =
|
|
1786
|
+
}, Gt = () => {
|
|
1787
|
+
const t = B(qt);
|
|
1734
1788
|
if (!t)
|
|
1735
|
-
throw new Error(
|
|
1789
|
+
throw new Error(
|
|
1790
|
+
"useAuth/useAuthSuspense must be used within an AuthProvider"
|
|
1791
|
+
);
|
|
1736
1792
|
return t;
|
|
1737
|
-
},
|
|
1793
|
+
}, bs = () => {
|
|
1794
|
+
const t = Gt(), { isAuthenticated: e, error: s, isReady: r } = t.authState;
|
|
1795
|
+
return {
|
|
1796
|
+
error: s,
|
|
1797
|
+
isAuthenticated: e,
|
|
1798
|
+
isReady: r,
|
|
1799
|
+
login: t.login,
|
|
1800
|
+
logout: t.logout,
|
|
1801
|
+
checkAuthStatus: t.checkAuthStatus
|
|
1802
|
+
};
|
|
1803
|
+
}, xs = () => {
|
|
1804
|
+
const t = Gt();
|
|
1805
|
+
if (!t.authState.isReady)
|
|
1806
|
+
throw t.ready();
|
|
1807
|
+
const { isAuthenticated: e, error: s } = t.authState;
|
|
1808
|
+
return {
|
|
1809
|
+
error: s,
|
|
1810
|
+
isAuthenticated: e,
|
|
1811
|
+
login: t.login,
|
|
1812
|
+
logout: t.logout,
|
|
1813
|
+
checkAuthStatus: t.checkAuthStatus
|
|
1814
|
+
};
|
|
1815
|
+
}, vs = () => ye, Ra = Z(
|
|
1738
1816
|
"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",
|
|
1739
1817
|
{
|
|
1740
1818
|
variants: {
|
|
@@ -1756,38 +1834,38 @@ const Qt = W(null), fs = (t) => {
|
|
|
1756
1834
|
variant: "default"
|
|
1757
1835
|
}
|
|
1758
1836
|
}
|
|
1759
|
-
),
|
|
1837
|
+
), Ea = {
|
|
1760
1838
|
"outline-success": "astw:bg-green-500",
|
|
1761
1839
|
"outline-warning": "astw:bg-orange-500",
|
|
1762
1840
|
"outline-error": "astw:bg-red-500",
|
|
1763
1841
|
"outline-info": "astw:bg-blue-500",
|
|
1764
1842
|
"outline-neutral": "astw:bg-neutral-400"
|
|
1765
1843
|
};
|
|
1766
|
-
function
|
|
1767
|
-
const e =
|
|
1844
|
+
function Ba({ variant: t }) {
|
|
1845
|
+
const e = Ea[t];
|
|
1768
1846
|
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: m("astw:size-[7px] astw:rounded-full", e) }) }) : null;
|
|
1769
1847
|
}
|
|
1770
|
-
function
|
|
1848
|
+
function Aa({ className: t, variant: e, children: s, ...r }) {
|
|
1771
1849
|
const n = e?.toString().startsWith("outline-");
|
|
1772
1850
|
return /* @__PURE__ */ d(
|
|
1773
1851
|
"div",
|
|
1774
1852
|
{
|
|
1775
|
-
className: m(
|
|
1853
|
+
className: m(Ra({ variant: e }), t),
|
|
1776
1854
|
...r,
|
|
1777
1855
|
children: [
|
|
1778
|
-
n && /* @__PURE__ */ a(
|
|
1856
|
+
n && /* @__PURE__ */ a(Ba, { variant: e }),
|
|
1779
1857
|
s
|
|
1780
1858
|
]
|
|
1781
1859
|
}
|
|
1782
1860
|
);
|
|
1783
1861
|
}
|
|
1784
|
-
function
|
|
1862
|
+
function Da(t) {
|
|
1785
1863
|
return t.type === "divider";
|
|
1786
1864
|
}
|
|
1787
|
-
function
|
|
1865
|
+
function Pa(t) {
|
|
1788
1866
|
return t.type !== "divider" && "key" in t;
|
|
1789
1867
|
}
|
|
1790
|
-
function
|
|
1868
|
+
function U(t, e) {
|
|
1791
1869
|
return e.split(".").reduce((s, r) => {
|
|
1792
1870
|
if (s && typeof s == "object" && r in s)
|
|
1793
1871
|
return s[r];
|
|
@@ -1799,7 +1877,7 @@ function v(t) {
|
|
|
1799
1877
|
function La(t) {
|
|
1800
1878
|
return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
1801
1879
|
}
|
|
1802
|
-
function
|
|
1880
|
+
function Ma(t, e = "medium") {
|
|
1803
1881
|
if (v(t)) return "";
|
|
1804
1882
|
const s = t instanceof Date ? t : new Date(String(t));
|
|
1805
1883
|
if (isNaN(s.getTime())) return String(t);
|
|
@@ -1831,7 +1909,7 @@ function Pa(t, e = "medium") {
|
|
|
1831
1909
|
return s.toLocaleDateString();
|
|
1832
1910
|
}
|
|
1833
1911
|
}
|
|
1834
|
-
function
|
|
1912
|
+
function Ia(t, e) {
|
|
1835
1913
|
if (v(t)) return "";
|
|
1836
1914
|
const s = typeof t == "number" ? t : parseFloat(String(t));
|
|
1837
1915
|
if (isNaN(s)) return String(t);
|
|
@@ -1844,7 +1922,7 @@ function Ma(t, e) {
|
|
|
1844
1922
|
return `${e || "$"}${s.toFixed(2)}`;
|
|
1845
1923
|
}
|
|
1846
1924
|
}
|
|
1847
|
-
function
|
|
1925
|
+
function _a(t) {
|
|
1848
1926
|
if (v(t)) return [];
|
|
1849
1927
|
if (typeof t == "string")
|
|
1850
1928
|
return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
|
|
@@ -1860,10 +1938,10 @@ function Ia(t) {
|
|
|
1860
1938
|
}
|
|
1861
1939
|
return [String(t)];
|
|
1862
1940
|
}
|
|
1863
|
-
function
|
|
1864
|
-
const [e, s] =
|
|
1865
|
-
return /* @__PURE__ */ d(
|
|
1866
|
-
/* @__PURE__ */ a(
|
|
1941
|
+
function Qt({ value: t }) {
|
|
1942
|
+
const [e, s] = g.useState(!1);
|
|
1943
|
+
return /* @__PURE__ */ d(ot, { children: [
|
|
1944
|
+
/* @__PURE__ */ a(it, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1867
1945
|
"button",
|
|
1868
1946
|
{
|
|
1869
1947
|
onClick: async (n) => {
|
|
@@ -1874,16 +1952,16 @@ function qt({ value: t }) {
|
|
|
1874
1952
|
}
|
|
1875
1953
|
},
|
|
1876
1954
|
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",
|
|
1877
|
-
children: e ? /* @__PURE__ */ a(
|
|
1955
|
+
children: e ? /* @__PURE__ */ a(pe, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(ge, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
|
|
1878
1956
|
}
|
|
1879
1957
|
) }),
|
|
1880
|
-
/* @__PURE__ */ a(
|
|
1958
|
+
/* @__PURE__ */ a(lt, { side: "top", children: e ? "Copied!" : "Copy" })
|
|
1881
1959
|
] });
|
|
1882
1960
|
}
|
|
1883
1961
|
const N = "–";
|
|
1884
|
-
function
|
|
1885
|
-
const e = v(t.value) ? N : String(t.value), s = t.meta?.copyable && !v(t.value), r = t.meta?.truncateLines, n =
|
|
1886
|
-
|
|
1962
|
+
function za({ field: t }) {
|
|
1963
|
+
const e = v(t.value) ? N : String(t.value), s = t.meta?.copyable && !v(t.value), r = t.meta?.truncateLines, n = g.useRef(null), [o, i] = g.useState(!1);
|
|
1964
|
+
g.useEffect(() => {
|
|
1887
1965
|
if (!r) {
|
|
1888
1966
|
i(!1);
|
|
1889
1967
|
return;
|
|
@@ -1913,35 +1991,35 @@ function Aa({ field: t }) {
|
|
|
1913
1991
|
children: e
|
|
1914
1992
|
}
|
|
1915
1993
|
),
|
|
1916
|
-
s && /* @__PURE__ */ a(
|
|
1994
|
+
s && /* @__PURE__ */ a(Qt, { value: String(t.value) })
|
|
1917
1995
|
] });
|
|
1918
|
-
return r && o ? /* @__PURE__ */ d(
|
|
1919
|
-
/* @__PURE__ */ a(
|
|
1920
|
-
/* @__PURE__ */ a(
|
|
1996
|
+
return r && o ? /* @__PURE__ */ d(ot, { children: [
|
|
1997
|
+
/* @__PURE__ */ a(it, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
|
|
1998
|
+
/* @__PURE__ */ a(lt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
|
|
1921
1999
|
] }) : u;
|
|
1922
2000
|
}
|
|
1923
|
-
function
|
|
2001
|
+
function Fa({ field: t }) {
|
|
1924
2002
|
if (v(t.value))
|
|
1925
2003
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1926
2004
|
const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
|
|
1927
|
-
return /* @__PURE__ */ a(
|
|
2005
|
+
return /* @__PURE__ */ a(Aa, { variant: n, className: "astw:w-fit", children: La(e) });
|
|
1928
2006
|
}
|
|
1929
|
-
function
|
|
2007
|
+
function Oa({ field: t }) {
|
|
1930
2008
|
if (v(t.value))
|
|
1931
2009
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1932
|
-
const e = t.meta?.currencyKey || "currency", s =
|
|
2010
|
+
const e = t.meta?.currencyKey || "currency", s = U(t.data, e), r = Ia(t.value, s);
|
|
1933
2011
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
|
|
1934
2012
|
}
|
|
1935
|
-
function
|
|
2013
|
+
function $a({ field: t }) {
|
|
1936
2014
|
if (v(t.value))
|
|
1937
2015
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1938
|
-
const e = t.meta?.dateFormat || "medium", s =
|
|
2016
|
+
const e = t.meta?.dateFormat || "medium", s = Ma(t.value, e);
|
|
1939
2017
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
|
|
1940
2018
|
}
|
|
1941
|
-
function
|
|
2019
|
+
function Wa({ field: t }) {
|
|
1942
2020
|
if (v(t.value))
|
|
1943
2021
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1944
|
-
const e = t.meta?.hrefKey, s = e ?
|
|
2022
|
+
const e = t.meta?.hrefKey, s = e ? U(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
|
|
1945
2023
|
return s ? /* @__PURE__ */ d(
|
|
1946
2024
|
"a",
|
|
1947
2025
|
{
|
|
@@ -1951,28 +2029,28 @@ function Oa({ field: t }) {
|
|
|
1951
2029
|
className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
|
|
1952
2030
|
children: [
|
|
1953
2031
|
n,
|
|
1954
|
-
r && /* @__PURE__ */ a(
|
|
2032
|
+
r && /* @__PURE__ */ a(fe, { className: "astw:h-3 astw:w-3" })
|
|
1955
2033
|
]
|
|
1956
2034
|
}
|
|
1957
2035
|
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
1958
2036
|
}
|
|
1959
|
-
function
|
|
2037
|
+
function ja({ field: t }) {
|
|
1960
2038
|
if (v(t.value))
|
|
1961
2039
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1962
|
-
const e =
|
|
2040
|
+
const e = _a(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
|
|
1963
2041
|
`);
|
|
1964
2042
|
return /* @__PURE__ */ d("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
|
|
1965
|
-
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ d(
|
|
2043
|
+
/* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ d(g.Fragment, { children: [
|
|
1966
2044
|
n,
|
|
1967
2045
|
o < e.length - 1 && /* @__PURE__ */ a("br", {})
|
|
1968
2046
|
] }, o)) }),
|
|
1969
|
-
s && /* @__PURE__ */ a(
|
|
2047
|
+
s && /* @__PURE__ */ a(Qt, { value: r })
|
|
1970
2048
|
] });
|
|
1971
2049
|
}
|
|
1972
|
-
function
|
|
2050
|
+
function Ka({ field: t }) {
|
|
1973
2051
|
if (v(t.value))
|
|
1974
2052
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1975
|
-
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ?
|
|
2053
|
+
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? U(t.data, e) : void 0, n = String(t.value);
|
|
1976
2054
|
if (!r || !s)
|
|
1977
2055
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
1978
2056
|
const o = s.replace("{id}", r);
|
|
@@ -1981,33 +2059,33 @@ function Wa({ field: t }) {
|
|
|
1981
2059
|
function Tt(t) {
|
|
1982
2060
|
switch (t.type) {
|
|
1983
2061
|
case "text":
|
|
1984
|
-
return /* @__PURE__ */ a(
|
|
2062
|
+
return /* @__PURE__ */ a(za, { field: t });
|
|
1985
2063
|
case "badge":
|
|
1986
|
-
return /* @__PURE__ */ a(
|
|
2064
|
+
return /* @__PURE__ */ a(Fa, { field: t });
|
|
1987
2065
|
case "money":
|
|
1988
|
-
return /* @__PURE__ */ a(
|
|
2066
|
+
return /* @__PURE__ */ a(Oa, { field: t });
|
|
1989
2067
|
case "date":
|
|
1990
|
-
return /* @__PURE__ */ a(
|
|
2068
|
+
return /* @__PURE__ */ a($a, { field: t });
|
|
1991
2069
|
case "link":
|
|
1992
|
-
return /* @__PURE__ */ a(
|
|
2070
|
+
return /* @__PURE__ */ a(Wa, { field: t });
|
|
1993
2071
|
case "address":
|
|
1994
|
-
return /* @__PURE__ */ a(
|
|
2072
|
+
return /* @__PURE__ */ a(ja, { field: t });
|
|
1995
2073
|
case "reference":
|
|
1996
|
-
return /* @__PURE__ */ a(
|
|
2074
|
+
return /* @__PURE__ */ a(Ka, { field: t });
|
|
1997
2075
|
default:
|
|
1998
2076
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1999
2077
|
}
|
|
2000
2078
|
}
|
|
2001
|
-
function
|
|
2079
|
+
function Va(t) {
|
|
2002
2080
|
if (t.emptyBehavior !== "hide") return !1;
|
|
2003
2081
|
const e = t.value;
|
|
2004
2082
|
return e == null || e === "";
|
|
2005
2083
|
}
|
|
2006
|
-
function
|
|
2084
|
+
function Ua(t) {
|
|
2007
2085
|
return !1;
|
|
2008
2086
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const r =
|
|
2087
|
+
function Ha(t, e, s) {
|
|
2088
|
+
const r = U(e, t.key);
|
|
2011
2089
|
return {
|
|
2012
2090
|
id: `${t.key}-${s}`,
|
|
2013
2091
|
label: t.label,
|
|
@@ -2018,15 +2096,15 @@ function Va(t, e, s) {
|
|
|
2018
2096
|
data: e
|
|
2019
2097
|
};
|
|
2020
2098
|
}
|
|
2021
|
-
function
|
|
2099
|
+
function qa(t, e) {
|
|
2022
2100
|
const s = [];
|
|
2023
2101
|
let r = [], n = 0, o = 0;
|
|
2024
2102
|
for (const i of t)
|
|
2025
|
-
if (
|
|
2103
|
+
if (Da(i))
|
|
2026
2104
|
r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
|
|
2027
|
-
else if (
|
|
2028
|
-
const l =
|
|
2029
|
-
o++,
|
|
2105
|
+
else if (Pa(i)) {
|
|
2106
|
+
const l = Ha(i, e, o);
|
|
2107
|
+
o++, Va(l) || r.push(l);
|
|
2030
2108
|
}
|
|
2031
2109
|
return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
|
|
2032
2110
|
}
|
|
@@ -2045,7 +2123,7 @@ function kt({ label: t, children: e, fullWidth: s }) {
|
|
|
2045
2123
|
}
|
|
2046
2124
|
);
|
|
2047
2125
|
}
|
|
2048
|
-
function
|
|
2126
|
+
function ys({
|
|
2049
2127
|
data: t,
|
|
2050
2128
|
title: e,
|
|
2051
2129
|
fields: s,
|
|
@@ -2053,7 +2131,7 @@ function bs({
|
|
|
2053
2131
|
className: n,
|
|
2054
2132
|
headerAction: o
|
|
2055
2133
|
}) {
|
|
2056
|
-
const i =
|
|
2134
|
+
const i = qa(s, t), l = i.some((c) => c.fields.length > 0), u = m(
|
|
2057
2135
|
"astw:grid astw:gap-x-6 astw:gap-y-4",
|
|
2058
2136
|
// Default: 1 column
|
|
2059
2137
|
"astw:grid-cols-1",
|
|
@@ -2066,13 +2144,13 @@ function bs({
|
|
|
2066
2144
|
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
|
|
2067
2145
|
)
|
|
2068
2146
|
), w = (c) => {
|
|
2069
|
-
const h = c.fields.filter((
|
|
2147
|
+
const h = c.fields.filter((p) => !0), f = c.fields.filter((p) => Ua());
|
|
2070
2148
|
return /* @__PURE__ */ d("div", { className: "astw:space-y-4", children: [
|
|
2071
|
-
h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((
|
|
2072
|
-
f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((
|
|
2149
|
+
h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((p) => /* @__PURE__ */ a(kt, { label: p.label, children: Tt(p) }, p.id)) }),
|
|
2150
|
+
f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((p) => /* @__PURE__ */ a(kt, { label: p.label, fullWidth: !0, children: Tt(p) }, p.id)) })
|
|
2073
2151
|
] }, c.id);
|
|
2074
2152
|
};
|
|
2075
|
-
return /* @__PURE__ */ a(
|
|
2153
|
+
return /* @__PURE__ */ a(nt, { delayDuration: 300, children: /* @__PURE__ */ d(
|
|
2076
2154
|
"div",
|
|
2077
2155
|
{
|
|
2078
2156
|
className: m(
|
|
@@ -2084,7 +2162,7 @@ function bs({
|
|
|
2084
2162
|
/* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
|
|
2085
2163
|
o && /* @__PURE__ */ a("div", { children: o })
|
|
2086
2164
|
] }),
|
|
2087
|
-
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((c, h) => /* @__PURE__ */ d(
|
|
2165
|
+
/* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((c, h) => /* @__PURE__ */ d(g.Fragment, { children: [
|
|
2088
2166
|
h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
|
|
2089
2167
|
w(c)
|
|
2090
2168
|
] }, c.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
|
|
@@ -2092,7 +2170,7 @@ function bs({
|
|
|
2092
2170
|
}
|
|
2093
2171
|
) });
|
|
2094
2172
|
}
|
|
2095
|
-
const
|
|
2173
|
+
const dt = g.forwardRef(
|
|
2096
2174
|
({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
|
|
2097
2175
|
"div",
|
|
2098
2176
|
{
|
|
@@ -2103,8 +2181,8 @@ const lt = p.forwardRef(
|
|
|
2103
2181
|
}
|
|
2104
2182
|
)
|
|
2105
2183
|
);
|
|
2106
|
-
|
|
2107
|
-
function
|
|
2184
|
+
dt.displayName = "Layout.Column";
|
|
2185
|
+
function Ga({
|
|
2108
2186
|
columns: t,
|
|
2109
2187
|
className: e,
|
|
2110
2188
|
gap: s = 4,
|
|
@@ -2113,7 +2191,7 @@ function Ua({
|
|
|
2113
2191
|
children: o
|
|
2114
2192
|
}) {
|
|
2115
2193
|
if (process.env.NODE_ENV !== "production") {
|
|
2116
|
-
const h =
|
|
2194
|
+
const h = g.Children.toArray(o).reduce((f, p) => g.isValidElement(p) && p.type === dt ? f + 1 : f, 0);
|
|
2117
2195
|
if (h !== t)
|
|
2118
2196
|
throw new Error(
|
|
2119
2197
|
`Layout: Expected exactly ${t} Layout.Column child${t === 1 ? "" : "ren"}, but found ${h}. Please ensure the number of <Layout.Column> children matches the \`columns={${t}}\` prop.`
|
|
@@ -2137,13 +2215,13 @@ function Ua({
|
|
|
2137
2215
|
"astw:xl:flex-row"
|
|
2138
2216
|
],
|
|
2139
2217
|
e
|
|
2140
|
-
), u =
|
|
2218
|
+
), u = g.useMemo(() => t === 1 ? g.Children.map(o, (c) => c) : t === 2 ? g.Children.map(o, (c, h) => g.isValidElement(c) ? g.cloneElement(c, {
|
|
2141
2219
|
className: m(
|
|
2142
2220
|
c.props.className,
|
|
2143
2221
|
h === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
|
|
2144
2222
|
// Second column: fixed 280px
|
|
2145
2223
|
)
|
|
2146
|
-
}) : c) : t === 3 ?
|
|
2224
|
+
}) : c) : t === 3 ? g.Children.map(o, (c, h) => g.isValidElement(c) ? g.cloneElement(c, {
|
|
2147
2225
|
className: m(
|
|
2148
2226
|
c.props.className,
|
|
2149
2227
|
h === 0 ? "astw:xl:min-w-[320px]" : h === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
|
|
@@ -2158,40 +2236,42 @@ function Ua({
|
|
|
2158
2236
|
style: { padding: "1.5rem", paddingBottom: "1rem" },
|
|
2159
2237
|
children: [
|
|
2160
2238
|
r && /* @__PURE__ */ a("h1", { style: { fontSize: "1.5rem", fontWeight: "bold" }, children: r }),
|
|
2161
|
-
n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((c, h) => /* @__PURE__ */ a(
|
|
2239
|
+
n && n.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: n.map((c, h) => /* @__PURE__ */ a(g.Fragment, { children: c }, h)) })
|
|
2162
2240
|
]
|
|
2163
2241
|
}
|
|
2164
2242
|
),
|
|
2165
2243
|
/* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
|
|
2166
2244
|
] });
|
|
2167
2245
|
}
|
|
2168
|
-
|
|
2246
|
+
Ga.Column = dt;
|
|
2169
2247
|
export {
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
ws as
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2248
|
+
ms as AppShell,
|
|
2249
|
+
gs as AuthProvider,
|
|
2250
|
+
Aa as Badge,
|
|
2251
|
+
fs as CommandPalette,
|
|
2252
|
+
ua as DefaultSidebar,
|
|
2253
|
+
ys as DescriptionCard,
|
|
2254
|
+
Ga as Layout,
|
|
2255
|
+
Cs as Link,
|
|
2256
|
+
hs as SidebarLayout,
|
|
2257
|
+
Ra as badgeVariants,
|
|
2258
|
+
ps as createAuthClient,
|
|
2259
|
+
Ee as defineI18nLabels,
|
|
2260
|
+
ws as defineModule,
|
|
2261
|
+
us as defineResource,
|
|
2262
|
+
ds as hidden,
|
|
2263
|
+
ls as pass,
|
|
2264
|
+
cs as redirectTo,
|
|
2265
|
+
ke as useAppShell,
|
|
2266
|
+
A as useAppShellConfig,
|
|
2267
|
+
is as useAppShellData,
|
|
2268
|
+
bs as useAuth,
|
|
2269
|
+
xs as useAuthSuspense,
|
|
2270
|
+
Ts as useLocation,
|
|
2271
|
+
ks as useNavigate,
|
|
2272
|
+
Rs as useParams,
|
|
2273
|
+
Es as useRouteError,
|
|
2274
|
+
Bs as useSearchParams,
|
|
2275
|
+
We as useTheme,
|
|
2276
|
+
vs as useToast
|
|
2197
2277
|
};
|