@tailor-platform/app-shell 0.25.0 → 0.26.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.js +426 -377
- 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,41 +801,41 @@ 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
|
+
[ct, S, L, l, w, c, O, C, h, f]
|
|
832
831
|
);
|
|
833
|
-
return /* @__PURE__ */ a(jt.Provider, { value:
|
|
832
|
+
return /* @__PURE__ */ a(jt.Provider, { value: Yt, children: /* @__PURE__ */ a(nt, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
834
833
|
"div",
|
|
835
834
|
{
|
|
836
835
|
"data-slot": "sidebar-wrapper",
|
|
837
836
|
style: {
|
|
838
837
|
"--sidebar-width": Wt,
|
|
839
|
-
"--sidebar-width-icon":
|
|
838
|
+
"--sidebar-width-icon": Ye,
|
|
840
839
|
...n
|
|
841
840
|
},
|
|
842
841
|
className: m(
|
|
@@ -848,7 +847,7 @@ function Xe({
|
|
|
848
847
|
}
|
|
849
848
|
) }) });
|
|
850
849
|
}
|
|
851
|
-
function
|
|
850
|
+
function Je({
|
|
852
851
|
side: t = "left",
|
|
853
852
|
variant: e = "sidebar",
|
|
854
853
|
collapsible: s = "offcanvas",
|
|
@@ -876,18 +875,18 @@ function Ze({
|
|
|
876
875
|
"data-mobile": "true",
|
|
877
876
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
878
877
|
style: {
|
|
879
|
-
"--sidebar-width":
|
|
878
|
+
"--sidebar-width": Qe
|
|
880
879
|
},
|
|
881
880
|
side: t,
|
|
882
881
|
children: [
|
|
883
|
-
/* @__PURE__ */ d(
|
|
884
|
-
/* @__PURE__ */ a(
|
|
882
|
+
/* @__PURE__ */ d(pt, { className: "astw:sr-only", children: [
|
|
883
|
+
/* @__PURE__ */ a(gt, { children: "Sidebar" }),
|
|
885
884
|
/* @__PURE__ */ a(bt, { children: "Displays the mobile sidebar." })
|
|
886
885
|
] }),
|
|
887
886
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
888
887
|
]
|
|
889
888
|
}
|
|
890
|
-
) }) : c && s === "icon" ? /* @__PURE__ */ d(
|
|
889
|
+
) }) : c && s === "icon" ? /* @__PURE__ */ d(E, { children: [
|
|
891
890
|
/* @__PURE__ */ d(
|
|
892
891
|
"div",
|
|
893
892
|
{
|
|
@@ -944,8 +943,8 @@ function Ze({
|
|
|
944
943
|
},
|
|
945
944
|
side: t,
|
|
946
945
|
children: [
|
|
947
|
-
/* @__PURE__ */ d(
|
|
948
|
-
/* @__PURE__ */ a(
|
|
946
|
+
/* @__PURE__ */ d(pt, { className: "astw:sr-only", children: [
|
|
947
|
+
/* @__PURE__ */ a(gt, { children: "Sidebar" }),
|
|
949
948
|
/* @__PURE__ */ a(bt, { children: "Displays the sidebar overlay." })
|
|
950
949
|
] }),
|
|
951
950
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
@@ -1021,13 +1020,13 @@ function Kt({
|
|
|
1021
1020
|
},
|
|
1022
1021
|
...s,
|
|
1023
1022
|
children: [
|
|
1024
|
-
/* @__PURE__ */ a(
|
|
1023
|
+
/* @__PURE__ */ a(ue, { className: "astw:size-4.5" }),
|
|
1025
1024
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
1026
1025
|
]
|
|
1027
1026
|
}
|
|
1028
1027
|
);
|
|
1029
1028
|
}
|
|
1030
|
-
function
|
|
1029
|
+
function ta({ className: t, ...e }) {
|
|
1031
1030
|
return /* @__PURE__ */ a(
|
|
1032
1031
|
"main",
|
|
1033
1032
|
{
|
|
@@ -1042,7 +1041,7 @@ function Je({ className: t, ...e }) {
|
|
|
1042
1041
|
}
|
|
1043
1042
|
);
|
|
1044
1043
|
}
|
|
1045
|
-
function
|
|
1044
|
+
function ea({ className: t, ...e }) {
|
|
1046
1045
|
return /* @__PURE__ */ a(
|
|
1047
1046
|
"div",
|
|
1048
1047
|
{
|
|
@@ -1053,7 +1052,7 @@ function ta({ className: t, ...e }) {
|
|
|
1053
1052
|
}
|
|
1054
1053
|
);
|
|
1055
1054
|
}
|
|
1056
|
-
function
|
|
1055
|
+
function aa({ className: t, ...e }) {
|
|
1057
1056
|
return /* @__PURE__ */ a(
|
|
1058
1057
|
"div",
|
|
1059
1058
|
{
|
|
@@ -1075,7 +1074,7 @@ function Vt({ className: t, ...e }) {
|
|
|
1075
1074
|
}
|
|
1076
1075
|
);
|
|
1077
1076
|
}
|
|
1078
|
-
function
|
|
1077
|
+
function Ut({ className: t, ...e }) {
|
|
1079
1078
|
return /* @__PURE__ */ a(
|
|
1080
1079
|
"ul",
|
|
1081
1080
|
{
|
|
@@ -1086,7 +1085,7 @@ function Ht({ className: t, ...e }) {
|
|
|
1086
1085
|
}
|
|
1087
1086
|
);
|
|
1088
1087
|
}
|
|
1089
|
-
function
|
|
1088
|
+
function Ht({ className: t, ...e }) {
|
|
1090
1089
|
return /* @__PURE__ */ a(
|
|
1091
1090
|
"li",
|
|
1092
1091
|
{
|
|
@@ -1097,7 +1096,7 @@ function Ut({ className: t, ...e }) {
|
|
|
1097
1096
|
}
|
|
1098
1097
|
);
|
|
1099
1098
|
}
|
|
1100
|
-
const
|
|
1099
|
+
const sa = Z(
|
|
1101
1100
|
"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
1101
|
{
|
|
1103
1102
|
variants: {
|
|
@@ -1133,16 +1132,16 @@ function xt({
|
|
|
1133
1132
|
"data-sidebar": "menu-button",
|
|
1134
1133
|
"data-size": r,
|
|
1135
1134
|
"data-active": e,
|
|
1136
|
-
className: m(
|
|
1135
|
+
className: m(sa({ variant: s, size: r }), o),
|
|
1137
1136
|
...i
|
|
1138
1137
|
}
|
|
1139
1138
|
);
|
|
1140
1139
|
return n ? (typeof n == "string" && (n = {
|
|
1141
1140
|
children: n
|
|
1142
|
-
}), /* @__PURE__ */ d(
|
|
1143
|
-
/* @__PURE__ */ a(
|
|
1141
|
+
}), /* @__PURE__ */ d(ot, { children: [
|
|
1142
|
+
/* @__PURE__ */ a(it, { asChild: !0, children: c }),
|
|
1144
1143
|
/* @__PURE__ */ a(
|
|
1145
|
-
|
|
1144
|
+
lt,
|
|
1146
1145
|
{
|
|
1147
1146
|
side: "right",
|
|
1148
1147
|
align: "center",
|
|
@@ -1178,7 +1177,7 @@ function vt({
|
|
|
1178
1177
|
}
|
|
1179
1178
|
);
|
|
1180
1179
|
}
|
|
1181
|
-
function
|
|
1180
|
+
function ra({ className: t, ...e }) {
|
|
1182
1181
|
return /* @__PURE__ */ a(
|
|
1183
1182
|
"ul",
|
|
1184
1183
|
{
|
|
@@ -1193,7 +1192,7 @@ function sa({ className: t, ...e }) {
|
|
|
1193
1192
|
}
|
|
1194
1193
|
);
|
|
1195
1194
|
}
|
|
1196
|
-
function
|
|
1195
|
+
function na({
|
|
1197
1196
|
className: t,
|
|
1198
1197
|
...e
|
|
1199
1198
|
}) {
|
|
@@ -1207,7 +1206,7 @@ function ra({
|
|
|
1207
1206
|
}
|
|
1208
1207
|
);
|
|
1209
1208
|
}
|
|
1210
|
-
function
|
|
1209
|
+
function oa({
|
|
1211
1210
|
asChild: t = !1,
|
|
1212
1211
|
size: e = "md",
|
|
1213
1212
|
isActive: s = !1,
|
|
@@ -1233,9 +1232,9 @@ function na({
|
|
|
1233
1232
|
}
|
|
1234
1233
|
);
|
|
1235
1234
|
}
|
|
1236
|
-
function
|
|
1235
|
+
function Y({ to: t, children: e, ...s }) {
|
|
1237
1236
|
try {
|
|
1238
|
-
return
|
|
1237
|
+
return ne(t), /* @__PURE__ */ a(oe, { to: t, ...s, children: e });
|
|
1239
1238
|
} catch {
|
|
1240
1239
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1241
1240
|
}
|
|
@@ -1256,7 +1255,7 @@ function Nt({ className: t, ...e }) {
|
|
|
1256
1255
|
}
|
|
1257
1256
|
);
|
|
1258
1257
|
}
|
|
1259
|
-
function
|
|
1258
|
+
function St({ className: t, ...e }) {
|
|
1260
1259
|
return /* @__PURE__ */ a(
|
|
1261
1260
|
"li",
|
|
1262
1261
|
{
|
|
@@ -1266,14 +1265,14 @@ function Ct({ className: t, ...e }) {
|
|
|
1266
1265
|
}
|
|
1267
1266
|
);
|
|
1268
1267
|
}
|
|
1269
|
-
function
|
|
1268
|
+
function Ct({
|
|
1270
1269
|
asChild: t,
|
|
1271
1270
|
className: e,
|
|
1272
1271
|
children: s,
|
|
1273
1272
|
...r
|
|
1274
1273
|
}) {
|
|
1275
1274
|
return /* @__PURE__ */ a(
|
|
1276
|
-
t ? z :
|
|
1275
|
+
t ? z : Y,
|
|
1277
1276
|
{
|
|
1278
1277
|
"data-slot": "breadcrumb-link",
|
|
1279
1278
|
className: m("astw:hover:text-foreground astw:transition-colors", e),
|
|
@@ -1282,7 +1281,7 @@ function St({
|
|
|
1282
1281
|
}
|
|
1283
1282
|
);
|
|
1284
1283
|
}
|
|
1285
|
-
function
|
|
1284
|
+
function ia({
|
|
1286
1285
|
children: t,
|
|
1287
1286
|
className: e,
|
|
1288
1287
|
...s
|
|
@@ -1295,18 +1294,18 @@ function oa({
|
|
|
1295
1294
|
"aria-hidden": "true",
|
|
1296
1295
|
className: m("astw:[&>svg]:size-3.5", e),
|
|
1297
1296
|
...s,
|
|
1298
|
-
children: t ?? /* @__PURE__ */ a(
|
|
1297
|
+
children: t ?? /* @__PURE__ */ a(Q, {})
|
|
1299
1298
|
}
|
|
1300
1299
|
);
|
|
1301
1300
|
}
|
|
1302
|
-
function
|
|
1301
|
+
function la(t, e) {
|
|
1303
1302
|
if (!e.trim()) return t;
|
|
1304
1303
|
const s = e.toLowerCase();
|
|
1305
1304
|
return t.filter(
|
|
1306
1305
|
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1307
1306
|
);
|
|
1308
1307
|
}
|
|
1309
|
-
const
|
|
1308
|
+
const da = (t, e) => {
|
|
1310
1309
|
const s = Pt(e);
|
|
1311
1310
|
return t.reduce(
|
|
1312
1311
|
(r, n) => {
|
|
@@ -1335,18 +1334,18 @@ const la = (t, e) => {
|
|
|
1335
1334
|
{}
|
|
1336
1335
|
);
|
|
1337
1336
|
};
|
|
1338
|
-
function
|
|
1339
|
-
const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i =
|
|
1337
|
+
function ca(t, e, s, r) {
|
|
1338
|
+
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
1339
|
const c = o.slice(0, w + 1).join("/");
|
|
1341
1340
|
let h = i[c];
|
|
1342
1341
|
if (!h) {
|
|
1343
|
-
const
|
|
1344
|
-
([
|
|
1345
|
-
const
|
|
1346
|
-
return new RegExp(`^${
|
|
1342
|
+
const p = Object.entries(i).find(
|
|
1343
|
+
([P]) => {
|
|
1344
|
+
const S = P.split("/").map((C) => C.startsWith(":") ? "[^/]+" : C).join("/");
|
|
1345
|
+
return new RegExp(`^${S}$`).test(c);
|
|
1347
1346
|
}
|
|
1348
1347
|
)?.[1];
|
|
1349
|
-
|
|
1348
|
+
p && (h = p);
|
|
1350
1349
|
}
|
|
1351
1350
|
let f;
|
|
1352
1351
|
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 +1359,28 @@ function da(t, e, s, r) {
|
|
|
1360
1359
|
segments: l
|
|
1361
1360
|
};
|
|
1362
1361
|
}
|
|
1363
|
-
const
|
|
1362
|
+
const wa = () => {
|
|
1364
1363
|
const { open: t, isIconMode: e } = F();
|
|
1365
1364
|
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 =
|
|
1365
|
+
}, hs = (t) => {
|
|
1366
|
+
const e = t.children ? t.children({ Outlet: ut }) : null, s = We(), r = () => {
|
|
1368
1367
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1369
1368
|
};
|
|
1370
|
-
return /* @__PURE__ */ a(
|
|
1371
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1372
|
-
/* @__PURE__ */ d(
|
|
1369
|
+
return /* @__PURE__ */ a(Ze, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ d("div", { className: "astw:flex astw:flex-1", children: [
|
|
1370
|
+
t.sidebar ?? /* @__PURE__ */ a(ua, {}),
|
|
1371
|
+
/* @__PURE__ */ d(ta, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1373
1372
|
/* @__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
1373
|
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1375
|
-
/* @__PURE__ */ a(
|
|
1374
|
+
/* @__PURE__ */ a(wa, {}),
|
|
1376
1375
|
/* @__PURE__ */ a(ga, {})
|
|
1377
1376
|
] }),
|
|
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(
|
|
1377
|
+
/* @__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
1378
|
] }) }),
|
|
1380
1379
|
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(ut, {}) })
|
|
1381
1380
|
] })
|
|
1382
1381
|
] }) });
|
|
1383
|
-
},
|
|
1384
|
-
const { title: e, icon: s } =
|
|
1382
|
+
}, ua = (t) => {
|
|
1383
|
+
const { title: e, icon: s } = A(), { pathname: r } = Et(), { isIconMode: n } = F(), o = /* @__PURE__ */ d(ea, { children: [
|
|
1385
1384
|
s,
|
|
1386
1385
|
/* @__PURE__ */ a(
|
|
1387
1386
|
"h1",
|
|
@@ -1394,23 +1393,23 @@ const ca = () => {
|
|
|
1394
1393
|
}
|
|
1395
1394
|
)
|
|
1396
1395
|
] });
|
|
1397
|
-
return /* @__PURE__ */ d(
|
|
1396
|
+
return /* @__PURE__ */ d(Je, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
|
|
1398
1397
|
!n && /* @__PURE__ */ d("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1399
1398
|
t.header ?? o,
|
|
1400
1399
|
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(Kt, { className: "astw:-ml-1" }) })
|
|
1401
1400
|
] }),
|
|
1402
|
-
/* @__PURE__ */ a(
|
|
1401
|
+
/* @__PURE__ */ a(aa, { children: /* @__PURE__ */ a(Dt, { fallback: /* @__PURE__ */ a(fa, {}), children: /* @__PURE__ */ a(ma, { currentPath: r }) }) }),
|
|
1403
1402
|
t.footer ?? null
|
|
1404
1403
|
] });
|
|
1405
|
-
},
|
|
1404
|
+
}, ma = ({ currentPath: t }) => {
|
|
1406
1405
|
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(
|
|
1406
|
+
return /* @__PURE__ */ a(Bt, { resolve: e, children: (s) => /* @__PURE__ */ a(ha, { items: s ?? [], currentPath: t }) });
|
|
1407
|
+
}, ha = (t) => {
|
|
1408
|
+
const e = D();
|
|
1409
|
+
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: [
|
|
1410
|
+
s.url ? /* @__PURE__ */ d(E, { children: [
|
|
1412
1411
|
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d(
|
|
1413
|
-
|
|
1412
|
+
Y,
|
|
1414
1413
|
{
|
|
1415
1414
|
to: s.url,
|
|
1416
1415
|
className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1421,10 +1420,10 @@ const ca = () => {
|
|
|
1421
1420
|
}
|
|
1422
1421
|
) }),
|
|
1423
1422
|
!!s.items?.length && /* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(vt, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1424
|
-
/* @__PURE__ */ a(
|
|
1423
|
+
/* @__PURE__ */ a(Q, {}),
|
|
1425
1424
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1426
1425
|
] }) })
|
|
1427
|
-
] }) : /* @__PURE__ */ a(
|
|
1426
|
+
] }) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ d(mt, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1428
1427
|
/* @__PURE__ */ a(xt, { asChild: !0, tooltip: s.title, children: /* @__PURE__ */ d("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1429
1428
|
s.icon,
|
|
1430
1429
|
/* @__PURE__ */ a("span", { children: s.title })
|
|
@@ -1435,14 +1434,14 @@ const ca = () => {
|
|
|
1435
1434
|
className: "astw-rotate-target",
|
|
1436
1435
|
asChild: !0,
|
|
1437
1436
|
children: /* @__PURE__ */ d("span", { children: [
|
|
1438
|
-
/* @__PURE__ */ a(
|
|
1437
|
+
/* @__PURE__ */ a(Q, {}),
|
|
1439
1438
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
|
|
1440
1439
|
] })
|
|
1441
1440
|
}
|
|
1442
1441
|
)
|
|
1443
1442
|
] }) }),
|
|
1444
|
-
!!s.items?.length && /* @__PURE__ */ a(
|
|
1445
|
-
|
|
1443
|
+
!!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(
|
|
1444
|
+
Y,
|
|
1446
1445
|
{
|
|
1447
1446
|
to: r.url,
|
|
1448
1447
|
className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1450,9 +1449,9 @@ const ca = () => {
|
|
|
1450
1449
|
}
|
|
1451
1450
|
) }) }, r.title)) }) })
|
|
1452
1451
|
] }) }, s.title)) }) });
|
|
1453
|
-
},
|
|
1452
|
+
}, fa = () => {
|
|
1454
1453
|
const e = [...[112, 96, 80, 104, 88, 100, 92, 84]].sort(() => Math.random() - 0.5);
|
|
1455
|
-
return /* @__PURE__ */ a(Vt, { children: /* @__PURE__ */ a(
|
|
1454
|
+
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
1455
|
/* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
|
|
1457
1456
|
/* @__PURE__ */ a(
|
|
1458
1457
|
"div",
|
|
@@ -1462,39 +1461,39 @@ const ca = () => {
|
|
|
1462
1461
|
}
|
|
1463
1462
|
)
|
|
1464
1463
|
] }) }, r)) }) });
|
|
1465
|
-
},
|
|
1466
|
-
const { configurations: t } =
|
|
1467
|
-
return
|
|
1464
|
+
}, pa = () => {
|
|
1465
|
+
const { configurations: t } = A(), e = Et();
|
|
1466
|
+
return ca(
|
|
1468
1467
|
e.pathname,
|
|
1469
1468
|
t.basePath,
|
|
1470
1469
|
t.modules,
|
|
1471
1470
|
t.locale
|
|
1472
1471
|
);
|
|
1473
1472
|
}, 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(
|
|
1473
|
+
const { segments: t } = pa(), e = ie("/:prefix/settings/:suffix"), s = D();
|
|
1474
|
+
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
1475
|
"div",
|
|
1477
1476
|
{
|
|
1478
1477
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1479
1478
|
children: [
|
|
1480
|
-
/* @__PURE__ */ a(
|
|
1481
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1479
|
+
/* @__PURE__ */ a(St, { children: /* @__PURE__ */ a(Ct, { to: r.path, children: r.title }) }),
|
|
1480
|
+
n < t.length - 1 && /* @__PURE__ */ a(ia, {})
|
|
1482
1481
|
]
|
|
1483
1482
|
},
|
|
1484
1483
|
n
|
|
1485
1484
|
)) }) });
|
|
1486
1485
|
};
|
|
1487
|
-
function
|
|
1486
|
+
function ba({
|
|
1488
1487
|
...t
|
|
1489
1488
|
}) {
|
|
1490
1489
|
return /* @__PURE__ */ a(b.Root, { "data-slot": "dialog", ...t });
|
|
1491
1490
|
}
|
|
1492
|
-
function
|
|
1491
|
+
function xa({
|
|
1493
1492
|
...t
|
|
1494
1493
|
}) {
|
|
1495
1494
|
return /* @__PURE__ */ a(b.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1496
1495
|
}
|
|
1497
|
-
function
|
|
1496
|
+
function va({
|
|
1498
1497
|
className: t,
|
|
1499
1498
|
...e
|
|
1500
1499
|
}) {
|
|
@@ -1510,13 +1509,13 @@ function xa({
|
|
|
1510
1509
|
}
|
|
1511
1510
|
);
|
|
1512
1511
|
}
|
|
1513
|
-
function
|
|
1512
|
+
function ya({
|
|
1514
1513
|
className: t,
|
|
1515
1514
|
children: e,
|
|
1516
1515
|
...s
|
|
1517
1516
|
}) {
|
|
1518
|
-
return /* @__PURE__ */ d(
|
|
1519
|
-
/* @__PURE__ */ a(
|
|
1517
|
+
return /* @__PURE__ */ d(xa, { "data-slot": "dialog-portal", children: [
|
|
1518
|
+
/* @__PURE__ */ a(va, {}),
|
|
1520
1519
|
/* @__PURE__ */ d(
|
|
1521
1520
|
b.Content,
|
|
1522
1521
|
{
|
|
@@ -1529,7 +1528,7 @@ function va({
|
|
|
1529
1528
|
children: [
|
|
1530
1529
|
e,
|
|
1531
1530
|
/* @__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(
|
|
1531
|
+
/* @__PURE__ */ a(At, {}),
|
|
1533
1532
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1534
1533
|
] })
|
|
1535
1534
|
]
|
|
@@ -1537,7 +1536,7 @@ function va({
|
|
|
1537
1536
|
)
|
|
1538
1537
|
] });
|
|
1539
1538
|
}
|
|
1540
|
-
function
|
|
1539
|
+
function Na({
|
|
1541
1540
|
className: t,
|
|
1542
1541
|
...e
|
|
1543
1542
|
}) {
|
|
@@ -1550,7 +1549,7 @@ function ya({
|
|
|
1550
1549
|
}
|
|
1551
1550
|
);
|
|
1552
1551
|
}
|
|
1553
|
-
function
|
|
1552
|
+
function Sa(t) {
|
|
1554
1553
|
const e = [], s = (r, n, o) => {
|
|
1555
1554
|
r.forEach((i) => {
|
|
1556
1555
|
const l = [...o, i.title];
|
|
@@ -1574,13 +1573,13 @@ function Na(t) {
|
|
|
1574
1573
|
function Ca({
|
|
1575
1574
|
routes: t
|
|
1576
1575
|
}) {
|
|
1577
|
-
const e =
|
|
1578
|
-
() =>
|
|
1576
|
+
const e = le(), s = be(null), [r, n] = M(!1), [o, i] = M(""), [l, u] = M(0), w = k(
|
|
1577
|
+
() => la(t, o),
|
|
1579
1578
|
[t, o]
|
|
1580
1579
|
);
|
|
1581
1580
|
y(() => {
|
|
1582
|
-
const f = (
|
|
1583
|
-
(
|
|
1581
|
+
const f = (p) => {
|
|
1582
|
+
(p.metaKey || p.ctrlKey) && p.key === "k" && (p.preventDefault(), n((P) => !P));
|
|
1584
1583
|
};
|
|
1585
1584
|
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
1586
1585
|
}, []), y(() => {
|
|
@@ -1590,22 +1589,22 @@ function Ca({
|
|
|
1590
1589
|
}, [r]), y(() => {
|
|
1591
1590
|
s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
|
|
1592
1591
|
}, [l]);
|
|
1593
|
-
const c =
|
|
1592
|
+
const c = W(
|
|
1594
1593
|
(f) => {
|
|
1595
1594
|
e(f.path), n(!1), i("");
|
|
1596
1595
|
},
|
|
1597
1596
|
[e]
|
|
1598
|
-
), h =
|
|
1597
|
+
), h = W(
|
|
1599
1598
|
(f) => {
|
|
1600
1599
|
if (!f.nativeEvent.isComposing)
|
|
1601
1600
|
switch (f.key) {
|
|
1602
1601
|
case "ArrowDown":
|
|
1603
1602
|
f.preventDefault(), u(
|
|
1604
|
-
(
|
|
1603
|
+
(p) => p < w.length - 1 ? p + 1 : p
|
|
1605
1604
|
);
|
|
1606
1605
|
break;
|
|
1607
1606
|
case "ArrowUp":
|
|
1608
|
-
f.preventDefault(), u((
|
|
1607
|
+
f.preventDefault(), u((p) => p > 0 ? p - 1 : p);
|
|
1609
1608
|
break;
|
|
1610
1609
|
case "Enter":
|
|
1611
1610
|
f.preventDefault(), w[l] && c(w[l]);
|
|
@@ -1626,10 +1625,10 @@ function Ca({
|
|
|
1626
1625
|
listRef: s
|
|
1627
1626
|
};
|
|
1628
1627
|
}
|
|
1629
|
-
function
|
|
1628
|
+
function Ta({
|
|
1630
1629
|
navItems: t
|
|
1631
1630
|
}) {
|
|
1632
|
-
const e =
|
|
1631
|
+
const e = D(), s = k(() => Sa(t), [t]), {
|
|
1633
1632
|
open: r,
|
|
1634
1633
|
setOpen: n,
|
|
1635
1634
|
search: o,
|
|
@@ -1640,16 +1639,16 @@ function Sa({
|
|
|
1640
1639
|
handleKeyDown: c,
|
|
1641
1640
|
listRef: h
|
|
1642
1641
|
} = Ca({ routes: s });
|
|
1643
|
-
return /* @__PURE__ */ a(
|
|
1644
|
-
|
|
1642
|
+
return /* @__PURE__ */ a(ba, { open: r, onOpenChange: n, children: /* @__PURE__ */ d(
|
|
1643
|
+
ya,
|
|
1645
1644
|
{
|
|
1646
1645
|
className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
|
|
1647
1646
|
onKeyDown: c,
|
|
1648
1647
|
"aria-describedby": void 0,
|
|
1649
1648
|
children: [
|
|
1650
|
-
/* @__PURE__ */ a(
|
|
1649
|
+
/* @__PURE__ */ a(Na, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
|
|
1651
1650
|
/* @__PURE__ */ d("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
|
|
1652
|
-
/* @__PURE__ */ a(
|
|
1651
|
+
/* @__PURE__ */ a(he, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1653
1652
|
/* @__PURE__ */ a(
|
|
1654
1653
|
He,
|
|
1655
1654
|
{
|
|
@@ -1666,14 +1665,14 @@ function Sa({
|
|
|
1666
1665
|
{
|
|
1667
1666
|
ref: h,
|
|
1668
1667
|
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,
|
|
1668
|
+
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
1669
|
"button",
|
|
1671
1670
|
{
|
|
1672
|
-
"data-index":
|
|
1671
|
+
"data-index": p,
|
|
1673
1672
|
onClick: () => w(f),
|
|
1674
1673
|
className: m(
|
|
1675
1674
|
"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
|
-
|
|
1675
|
+
p === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1677
1676
|
),
|
|
1678
1677
|
children: [
|
|
1679
1678
|
/* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
|
|
@@ -1691,50 +1690,98 @@ function Sa({
|
|
|
1691
1690
|
}
|
|
1692
1691
|
) });
|
|
1693
1692
|
}
|
|
1694
|
-
function
|
|
1693
|
+
function fs() {
|
|
1695
1694
|
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
|
-
|
|
1695
|
+
return /* @__PURE__ */ a(Dt, { fallback: null, children: /* @__PURE__ */ a(Bt, { resolve: t, children: (e) => /* @__PURE__ */ a(Ta, { navItems: e ?? [] }) }) });
|
|
1696
|
+
}
|
|
1697
|
+
function ka(t) {
|
|
1698
|
+
const e = new URLSearchParams(t.search);
|
|
1699
|
+
e.delete("code"), e.delete("state");
|
|
1700
|
+
const s = e.toString();
|
|
1701
|
+
return t.pathname + (s ? `?${s}` : "") + t.hash;
|
|
1702
|
+
}
|
|
1703
|
+
function ps(t) {
|
|
1704
|
+
const e = Ne(t), { appUri: s } = t;
|
|
1705
|
+
return {
|
|
1706
|
+
...e,
|
|
1707
|
+
getAppUri() {
|
|
1708
|
+
return s;
|
|
1709
|
+
},
|
|
1710
|
+
async getAuthHeadersForQuery(n = "/query", o = "POST") {
|
|
1711
|
+
const i = `${s}${n}`;
|
|
1712
|
+
return e.getAuthHeaders(i, o);
|
|
1713
|
+
}
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
const qt = j(null), gs = (t) => {
|
|
1717
|
+
const e = t.client, s = W(
|
|
1718
|
+
(l) => e.addEventListener((u) => {
|
|
1719
|
+
u.type === "auth_state_changed" && l();
|
|
1715
1720
|
}),
|
|
1716
1721
|
[e]
|
|
1717
|
-
);
|
|
1718
|
-
|
|
1722
|
+
), r = W(() => e.getState(), [e]), n = xe(s, r);
|
|
1723
|
+
y(() => {
|
|
1724
|
+
(async () => {
|
|
1725
|
+
if (new URLSearchParams(window.location.search).has("code"))
|
|
1726
|
+
try {
|
|
1727
|
+
await e.handleCallback();
|
|
1728
|
+
const w = ka(
|
|
1729
|
+
new URL(window.location.href)
|
|
1730
|
+
);
|
|
1731
|
+
window.history.replaceState({}, "", w);
|
|
1732
|
+
} catch (w) {
|
|
1733
|
+
console.error("Failed to handle callback:", w);
|
|
1734
|
+
}
|
|
1735
|
+
else
|
|
1736
|
+
await e.checkAuthStatus();
|
|
1737
|
+
})();
|
|
1738
|
+
}, [e]), y(() => {
|
|
1739
|
+
t.autoLogin && (!n.isReady || n.isAuthenticated || e.login());
|
|
1740
|
+
}, [n.isReady, n.isAuthenticated, t.autoLogin, e]);
|
|
1741
|
+
const o = n.isAuthenticated, i = t.guardComponent && (!n.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1719
1742
|
return /* @__PURE__ */ a(
|
|
1720
|
-
|
|
1743
|
+
qt.Provider,
|
|
1721
1744
|
{
|
|
1722
1745
|
value: {
|
|
1723
|
-
authState:
|
|
1724
|
-
login:
|
|
1725
|
-
logout:
|
|
1726
|
-
checkAuthStatus:
|
|
1727
|
-
|
|
1746
|
+
authState: n,
|
|
1747
|
+
login: () => e.login(),
|
|
1748
|
+
logout: () => e.logout(),
|
|
1749
|
+
checkAuthStatus: () => e.checkAuthStatus(),
|
|
1750
|
+
ready: () => e.ready()
|
|
1728
1751
|
},
|
|
1729
|
-
children:
|
|
1752
|
+
children: i
|
|
1730
1753
|
}
|
|
1731
1754
|
);
|
|
1732
|
-
},
|
|
1733
|
-
const t =
|
|
1755
|
+
}, Gt = () => {
|
|
1756
|
+
const t = B(qt);
|
|
1734
1757
|
if (!t)
|
|
1735
|
-
throw new Error(
|
|
1758
|
+
throw new Error(
|
|
1759
|
+
"useAuth/useAuthSuspense must be used within an AuthProvider"
|
|
1760
|
+
);
|
|
1736
1761
|
return t;
|
|
1737
|
-
},
|
|
1762
|
+
}, bs = () => {
|
|
1763
|
+
const t = Gt(), { isAuthenticated: e, error: s, isReady: r } = t.authState;
|
|
1764
|
+
return {
|
|
1765
|
+
error: s,
|
|
1766
|
+
isAuthenticated: e,
|
|
1767
|
+
isReady: r,
|
|
1768
|
+
login: t.login,
|
|
1769
|
+
logout: t.logout,
|
|
1770
|
+
checkAuthStatus: t.checkAuthStatus
|
|
1771
|
+
};
|
|
1772
|
+
}, xs = () => {
|
|
1773
|
+
const t = Gt();
|
|
1774
|
+
if (!t.authState.isReady)
|
|
1775
|
+
throw t.ready();
|
|
1776
|
+
const { isAuthenticated: e, error: s } = t.authState;
|
|
1777
|
+
return {
|
|
1778
|
+
error: s,
|
|
1779
|
+
isAuthenticated: e,
|
|
1780
|
+
login: t.login,
|
|
1781
|
+
logout: t.logout,
|
|
1782
|
+
checkAuthStatus: t.checkAuthStatus
|
|
1783
|
+
};
|
|
1784
|
+
}, vs = () => ye, Ra = Z(
|
|
1738
1785
|
"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
1786
|
{
|
|
1740
1787
|
variants: {
|
|
@@ -1756,38 +1803,38 @@ const Qt = W(null), fs = (t) => {
|
|
|
1756
1803
|
variant: "default"
|
|
1757
1804
|
}
|
|
1758
1805
|
}
|
|
1759
|
-
),
|
|
1806
|
+
), Ea = {
|
|
1760
1807
|
"outline-success": "astw:bg-green-500",
|
|
1761
1808
|
"outline-warning": "astw:bg-orange-500",
|
|
1762
1809
|
"outline-error": "astw:bg-red-500",
|
|
1763
1810
|
"outline-info": "astw:bg-blue-500",
|
|
1764
1811
|
"outline-neutral": "astw:bg-neutral-400"
|
|
1765
1812
|
};
|
|
1766
|
-
function
|
|
1767
|
-
const e =
|
|
1813
|
+
function Ba({ variant: t }) {
|
|
1814
|
+
const e = Ea[t];
|
|
1768
1815
|
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
1816
|
}
|
|
1770
|
-
function
|
|
1817
|
+
function Aa({ className: t, variant: e, children: s, ...r }) {
|
|
1771
1818
|
const n = e?.toString().startsWith("outline-");
|
|
1772
1819
|
return /* @__PURE__ */ d(
|
|
1773
1820
|
"div",
|
|
1774
1821
|
{
|
|
1775
|
-
className: m(
|
|
1822
|
+
className: m(Ra({ variant: e }), t),
|
|
1776
1823
|
...r,
|
|
1777
1824
|
children: [
|
|
1778
|
-
n && /* @__PURE__ */ a(
|
|
1825
|
+
n && /* @__PURE__ */ a(Ba, { variant: e }),
|
|
1779
1826
|
s
|
|
1780
1827
|
]
|
|
1781
1828
|
}
|
|
1782
1829
|
);
|
|
1783
1830
|
}
|
|
1784
|
-
function
|
|
1831
|
+
function Da(t) {
|
|
1785
1832
|
return t.type === "divider";
|
|
1786
1833
|
}
|
|
1787
|
-
function
|
|
1834
|
+
function Pa(t) {
|
|
1788
1835
|
return t.type !== "divider" && "key" in t;
|
|
1789
1836
|
}
|
|
1790
|
-
function
|
|
1837
|
+
function U(t, e) {
|
|
1791
1838
|
return e.split(".").reduce((s, r) => {
|
|
1792
1839
|
if (s && typeof s == "object" && r in s)
|
|
1793
1840
|
return s[r];
|
|
@@ -1799,7 +1846,7 @@ function v(t) {
|
|
|
1799
1846
|
function La(t) {
|
|
1800
1847
|
return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
|
|
1801
1848
|
}
|
|
1802
|
-
function
|
|
1849
|
+
function Ma(t, e = "medium") {
|
|
1803
1850
|
if (v(t)) return "";
|
|
1804
1851
|
const s = t instanceof Date ? t : new Date(String(t));
|
|
1805
1852
|
if (isNaN(s.getTime())) return String(t);
|
|
@@ -1831,7 +1878,7 @@ function Pa(t, e = "medium") {
|
|
|
1831
1878
|
return s.toLocaleDateString();
|
|
1832
1879
|
}
|
|
1833
1880
|
}
|
|
1834
|
-
function
|
|
1881
|
+
function Ia(t, e) {
|
|
1835
1882
|
if (v(t)) return "";
|
|
1836
1883
|
const s = typeof t == "number" ? t : parseFloat(String(t));
|
|
1837
1884
|
if (isNaN(s)) return String(t);
|
|
@@ -1844,7 +1891,7 @@ function Ma(t, e) {
|
|
|
1844
1891
|
return `${e || "$"}${s.toFixed(2)}`;
|
|
1845
1892
|
}
|
|
1846
1893
|
}
|
|
1847
|
-
function
|
|
1894
|
+
function _a(t) {
|
|
1848
1895
|
if (v(t)) return [];
|
|
1849
1896
|
if (typeof t == "string")
|
|
1850
1897
|
return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
|
|
@@ -1860,10 +1907,10 @@ function Ia(t) {
|
|
|
1860
1907
|
}
|
|
1861
1908
|
return [String(t)];
|
|
1862
1909
|
}
|
|
1863
|
-
function
|
|
1864
|
-
const [e, s] =
|
|
1865
|
-
return /* @__PURE__ */ d(
|
|
1866
|
-
/* @__PURE__ */ a(
|
|
1910
|
+
function Qt({ value: t }) {
|
|
1911
|
+
const [e, s] = g.useState(!1);
|
|
1912
|
+
return /* @__PURE__ */ d(ot, { children: [
|
|
1913
|
+
/* @__PURE__ */ a(it, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1867
1914
|
"button",
|
|
1868
1915
|
{
|
|
1869
1916
|
onClick: async (n) => {
|
|
@@ -1874,16 +1921,16 @@ function qt({ value: t }) {
|
|
|
1874
1921
|
}
|
|
1875
1922
|
},
|
|
1876
1923
|
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(
|
|
1924
|
+
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
1925
|
}
|
|
1879
1926
|
) }),
|
|
1880
|
-
/* @__PURE__ */ a(
|
|
1927
|
+
/* @__PURE__ */ a(lt, { side: "top", children: e ? "Copied!" : "Copy" })
|
|
1881
1928
|
] });
|
|
1882
1929
|
}
|
|
1883
1930
|
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
|
-
|
|
1931
|
+
function za({ field: t }) {
|
|
1932
|
+
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);
|
|
1933
|
+
g.useEffect(() => {
|
|
1887
1934
|
if (!r) {
|
|
1888
1935
|
i(!1);
|
|
1889
1936
|
return;
|
|
@@ -1913,35 +1960,35 @@ function Aa({ field: t }) {
|
|
|
1913
1960
|
children: e
|
|
1914
1961
|
}
|
|
1915
1962
|
),
|
|
1916
|
-
s && /* @__PURE__ */ a(
|
|
1963
|
+
s && /* @__PURE__ */ a(Qt, { value: String(t.value) })
|
|
1917
1964
|
] });
|
|
1918
|
-
return r && o ? /* @__PURE__ */ d(
|
|
1919
|
-
/* @__PURE__ */ a(
|
|
1920
|
-
/* @__PURE__ */ a(
|
|
1965
|
+
return r && o ? /* @__PURE__ */ d(ot, { children: [
|
|
1966
|
+
/* @__PURE__ */ a(it, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "astw:cursor-default", children: u }) }),
|
|
1967
|
+
/* @__PURE__ */ a(lt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
|
|
1921
1968
|
] }) : u;
|
|
1922
1969
|
}
|
|
1923
|
-
function
|
|
1970
|
+
function Fa({ field: t }) {
|
|
1924
1971
|
if (v(t.value))
|
|
1925
1972
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1926
1973
|
const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
|
|
1927
|
-
return /* @__PURE__ */ a(
|
|
1974
|
+
return /* @__PURE__ */ a(Aa, { variant: n, className: "astw:w-fit", children: La(e) });
|
|
1928
1975
|
}
|
|
1929
|
-
function
|
|
1976
|
+
function Oa({ field: t }) {
|
|
1930
1977
|
if (v(t.value))
|
|
1931
1978
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1932
|
-
const e = t.meta?.currencyKey || "currency", s =
|
|
1979
|
+
const e = t.meta?.currencyKey || "currency", s = U(t.data, e), r = Ia(t.value, s);
|
|
1933
1980
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
|
|
1934
1981
|
}
|
|
1935
|
-
function
|
|
1982
|
+
function $a({ field: t }) {
|
|
1936
1983
|
if (v(t.value))
|
|
1937
1984
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1938
|
-
const e = t.meta?.dateFormat || "medium", s =
|
|
1985
|
+
const e = t.meta?.dateFormat || "medium", s = Ma(t.value, e);
|
|
1939
1986
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
|
|
1940
1987
|
}
|
|
1941
|
-
function
|
|
1988
|
+
function Wa({ field: t }) {
|
|
1942
1989
|
if (v(t.value))
|
|
1943
1990
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1944
|
-
const e = t.meta?.hrefKey, s = e ?
|
|
1991
|
+
const e = t.meta?.hrefKey, s = e ? U(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
|
|
1945
1992
|
return s ? /* @__PURE__ */ d(
|
|
1946
1993
|
"a",
|
|
1947
1994
|
{
|
|
@@ -1951,28 +1998,28 @@ function Oa({ field: t }) {
|
|
|
1951
1998
|
className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
|
|
1952
1999
|
children: [
|
|
1953
2000
|
n,
|
|
1954
|
-
r && /* @__PURE__ */ a(
|
|
2001
|
+
r && /* @__PURE__ */ a(fe, { className: "astw:h-3 astw:w-3" })
|
|
1955
2002
|
]
|
|
1956
2003
|
}
|
|
1957
2004
|
) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
1958
2005
|
}
|
|
1959
|
-
function
|
|
2006
|
+
function ja({ field: t }) {
|
|
1960
2007
|
if (v(t.value))
|
|
1961
2008
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1962
|
-
const e =
|
|
2009
|
+
const e = _a(t.value), s = t.meta?.copyable && !v(t.value), r = e.join(`
|
|
1963
2010
|
`);
|
|
1964
2011
|
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(
|
|
2012
|
+
/* @__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
2013
|
n,
|
|
1967
2014
|
o < e.length - 1 && /* @__PURE__ */ a("br", {})
|
|
1968
2015
|
] }, o)) }),
|
|
1969
|
-
s && /* @__PURE__ */ a(
|
|
2016
|
+
s && /* @__PURE__ */ a(Qt, { value: r })
|
|
1970
2017
|
] });
|
|
1971
2018
|
}
|
|
1972
|
-
function
|
|
2019
|
+
function Ka({ field: t }) {
|
|
1973
2020
|
if (v(t.value))
|
|
1974
2021
|
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 ?
|
|
2022
|
+
const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? U(t.data, e) : void 0, n = String(t.value);
|
|
1976
2023
|
if (!r || !s)
|
|
1977
2024
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
|
|
1978
2025
|
const o = s.replace("{id}", r);
|
|
@@ -1981,33 +2028,33 @@ function Wa({ field: t }) {
|
|
|
1981
2028
|
function Tt(t) {
|
|
1982
2029
|
switch (t.type) {
|
|
1983
2030
|
case "text":
|
|
1984
|
-
return /* @__PURE__ */ a(
|
|
2031
|
+
return /* @__PURE__ */ a(za, { field: t });
|
|
1985
2032
|
case "badge":
|
|
1986
|
-
return /* @__PURE__ */ a(
|
|
2033
|
+
return /* @__PURE__ */ a(Fa, { field: t });
|
|
1987
2034
|
case "money":
|
|
1988
|
-
return /* @__PURE__ */ a(
|
|
2035
|
+
return /* @__PURE__ */ a(Oa, { field: t });
|
|
1989
2036
|
case "date":
|
|
1990
|
-
return /* @__PURE__ */ a(
|
|
2037
|
+
return /* @__PURE__ */ a($a, { field: t });
|
|
1991
2038
|
case "link":
|
|
1992
|
-
return /* @__PURE__ */ a(
|
|
2039
|
+
return /* @__PURE__ */ a(Wa, { field: t });
|
|
1993
2040
|
case "address":
|
|
1994
|
-
return /* @__PURE__ */ a(
|
|
2041
|
+
return /* @__PURE__ */ a(ja, { field: t });
|
|
1995
2042
|
case "reference":
|
|
1996
|
-
return /* @__PURE__ */ a(
|
|
2043
|
+
return /* @__PURE__ */ a(Ka, { field: t });
|
|
1997
2044
|
default:
|
|
1998
2045
|
return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: N });
|
|
1999
2046
|
}
|
|
2000
2047
|
}
|
|
2001
|
-
function
|
|
2048
|
+
function Va(t) {
|
|
2002
2049
|
if (t.emptyBehavior !== "hide") return !1;
|
|
2003
2050
|
const e = t.value;
|
|
2004
2051
|
return e == null || e === "";
|
|
2005
2052
|
}
|
|
2006
|
-
function
|
|
2053
|
+
function Ua(t) {
|
|
2007
2054
|
return !1;
|
|
2008
2055
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const r =
|
|
2056
|
+
function Ha(t, e, s) {
|
|
2057
|
+
const r = U(e, t.key);
|
|
2011
2058
|
return {
|
|
2012
2059
|
id: `${t.key}-${s}`,
|
|
2013
2060
|
label: t.label,
|
|
@@ -2018,15 +2065,15 @@ function Va(t, e, s) {
|
|
|
2018
2065
|
data: e
|
|
2019
2066
|
};
|
|
2020
2067
|
}
|
|
2021
|
-
function
|
|
2068
|
+
function qa(t, e) {
|
|
2022
2069
|
const s = [];
|
|
2023
2070
|
let r = [], n = 0, o = 0;
|
|
2024
2071
|
for (const i of t)
|
|
2025
|
-
if (
|
|
2072
|
+
if (Da(i))
|
|
2026
2073
|
r.length > 0 && (s.push({ id: `section-${n}`, fields: r }), n++, r = []);
|
|
2027
|
-
else if (
|
|
2028
|
-
const l =
|
|
2029
|
-
o++,
|
|
2074
|
+
else if (Pa(i)) {
|
|
2075
|
+
const l = Ha(i, e, o);
|
|
2076
|
+
o++, Va(l) || r.push(l);
|
|
2030
2077
|
}
|
|
2031
2078
|
return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
|
|
2032
2079
|
}
|
|
@@ -2045,7 +2092,7 @@ function kt({ label: t, children: e, fullWidth: s }) {
|
|
|
2045
2092
|
}
|
|
2046
2093
|
);
|
|
2047
2094
|
}
|
|
2048
|
-
function
|
|
2095
|
+
function ys({
|
|
2049
2096
|
data: t,
|
|
2050
2097
|
title: e,
|
|
2051
2098
|
fields: s,
|
|
@@ -2053,7 +2100,7 @@ function bs({
|
|
|
2053
2100
|
className: n,
|
|
2054
2101
|
headerAction: o
|
|
2055
2102
|
}) {
|
|
2056
|
-
const i =
|
|
2103
|
+
const i = qa(s, t), l = i.some((c) => c.fields.length > 0), u = m(
|
|
2057
2104
|
"astw:grid astw:gap-x-6 astw:gap-y-4",
|
|
2058
2105
|
// Default: 1 column
|
|
2059
2106
|
"astw:grid-cols-1",
|
|
@@ -2066,13 +2113,13 @@ function bs({
|
|
|
2066
2113
|
"astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
|
|
2067
2114
|
)
|
|
2068
2115
|
), w = (c) => {
|
|
2069
|
-
const h = c.fields.filter((
|
|
2116
|
+
const h = c.fields.filter((p) => !0), f = c.fields.filter((p) => Ua());
|
|
2070
2117
|
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((
|
|
2118
|
+
h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((p) => /* @__PURE__ */ a(kt, { label: p.label, children: Tt(p) }, p.id)) }),
|
|
2119
|
+
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
2120
|
] }, c.id);
|
|
2074
2121
|
};
|
|
2075
|
-
return /* @__PURE__ */ a(
|
|
2122
|
+
return /* @__PURE__ */ a(nt, { delayDuration: 300, children: /* @__PURE__ */ d(
|
|
2076
2123
|
"div",
|
|
2077
2124
|
{
|
|
2078
2125
|
className: m(
|
|
@@ -2084,7 +2131,7 @@ function bs({
|
|
|
2084
2131
|
/* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
|
|
2085
2132
|
o && /* @__PURE__ */ a("div", { children: o })
|
|
2086
2133
|
] }),
|
|
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(
|
|
2134
|
+
/* @__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
2135
|
h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
|
|
2089
2136
|
w(c)
|
|
2090
2137
|
] }, c.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
|
|
@@ -2092,7 +2139,7 @@ function bs({
|
|
|
2092
2139
|
}
|
|
2093
2140
|
) });
|
|
2094
2141
|
}
|
|
2095
|
-
const
|
|
2142
|
+
const dt = g.forwardRef(
|
|
2096
2143
|
({ className: t, children: e, ...s }, r) => /* @__PURE__ */ a(
|
|
2097
2144
|
"div",
|
|
2098
2145
|
{
|
|
@@ -2103,8 +2150,8 @@ const lt = p.forwardRef(
|
|
|
2103
2150
|
}
|
|
2104
2151
|
)
|
|
2105
2152
|
);
|
|
2106
|
-
|
|
2107
|
-
function
|
|
2153
|
+
dt.displayName = "Layout.Column";
|
|
2154
|
+
function Ga({
|
|
2108
2155
|
columns: t,
|
|
2109
2156
|
className: e,
|
|
2110
2157
|
gap: s = 4,
|
|
@@ -2113,7 +2160,7 @@ function Ua({
|
|
|
2113
2160
|
children: o
|
|
2114
2161
|
}) {
|
|
2115
2162
|
if (process.env.NODE_ENV !== "production") {
|
|
2116
|
-
const h =
|
|
2163
|
+
const h = g.Children.toArray(o).reduce((f, p) => g.isValidElement(p) && p.type === dt ? f + 1 : f, 0);
|
|
2117
2164
|
if (h !== t)
|
|
2118
2165
|
throw new Error(
|
|
2119
2166
|
`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 +2184,13 @@ function Ua({
|
|
|
2137
2184
|
"astw:xl:flex-row"
|
|
2138
2185
|
],
|
|
2139
2186
|
e
|
|
2140
|
-
), u =
|
|
2187
|
+
), 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
2188
|
className: m(
|
|
2142
2189
|
c.props.className,
|
|
2143
2190
|
h === 0 ? "astw:lg:flex-1" : "astw:lg:min-w-[280px]"
|
|
2144
2191
|
// Second column: fixed 280px
|
|
2145
2192
|
)
|
|
2146
|
-
}) : c) : t === 3 ?
|
|
2193
|
+
}) : c) : t === 3 ? g.Children.map(o, (c, h) => g.isValidElement(c) ? g.cloneElement(c, {
|
|
2147
2194
|
className: m(
|
|
2148
2195
|
c.props.className,
|
|
2149
2196
|
h === 0 ? "astw:xl:min-w-[320px]" : h === 2 ? "astw:xl:min-w-[280px]" : "astw:xl:flex-1"
|
|
@@ -2158,40 +2205,42 @@ function Ua({
|
|
|
2158
2205
|
style: { padding: "1.5rem", paddingBottom: "1rem" },
|
|
2159
2206
|
children: [
|
|
2160
2207
|
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(
|
|
2208
|
+
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
2209
|
]
|
|
2163
2210
|
}
|
|
2164
2211
|
),
|
|
2165
2212
|
/* @__PURE__ */ a("div", { style: { padding: w ? "0 1.5rem 1.5rem 1.5rem" : "1.5rem" }, children: /* @__PURE__ */ a("div", { className: l, children: u }) })
|
|
2166
2213
|
] });
|
|
2167
2214
|
}
|
|
2168
|
-
|
|
2215
|
+
Ga.Column = dt;
|
|
2169
2216
|
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
|
-
|
|
2217
|
+
ms as AppShell,
|
|
2218
|
+
gs as AuthProvider,
|
|
2219
|
+
Aa as Badge,
|
|
2220
|
+
fs as CommandPalette,
|
|
2221
|
+
ua as DefaultSidebar,
|
|
2222
|
+
ys as DescriptionCard,
|
|
2223
|
+
Ga as Layout,
|
|
2224
|
+
Cs as Link,
|
|
2225
|
+
hs as SidebarLayout,
|
|
2226
|
+
Ra as badgeVariants,
|
|
2227
|
+
ps as createAuthClient,
|
|
2228
|
+
Ee as defineI18nLabels,
|
|
2229
|
+
ws as defineModule,
|
|
2230
|
+
us as defineResource,
|
|
2231
|
+
ds as hidden,
|
|
2232
|
+
ls as pass,
|
|
2233
|
+
cs as redirectTo,
|
|
2234
|
+
ke as useAppShell,
|
|
2235
|
+
A as useAppShellConfig,
|
|
2236
|
+
is as useAppShellData,
|
|
2237
|
+
bs as useAuth,
|
|
2238
|
+
xs as useAuthSuspense,
|
|
2239
|
+
Ts as useLocation,
|
|
2240
|
+
ks as useNavigate,
|
|
2241
|
+
Rs as useParams,
|
|
2242
|
+
Es as useRouteError,
|
|
2243
|
+
Bs as useSearchParams,
|
|
2244
|
+
We as useTheme,
|
|
2245
|
+
vs as useToast
|
|
2197
2246
|
};
|