@tailor-platform/app-shell 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-shell.css +1 -1
- package/dist/app-shell.js +547 -297
- package/dist/index.d.ts +2 -0
- package/package.json +7 -6
package/dist/app-shell.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as a, jsxs as c, Fragment as
|
|
2
|
-
import { AlertCircle as
|
|
3
|
-
import * as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { useRouteError as
|
|
6
|
-
import { Link as
|
|
7
|
-
import { Slot as
|
|
8
|
-
import { cva as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
11
|
-
import { capitalCase as
|
|
12
|
-
import { Toaster as
|
|
13
|
-
import * as
|
|
1
|
+
import { jsx as a, jsxs as c, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { AlertCircle as q, Table as gt, XIcon as rt, PanelLeftIcon as bt, ChevronRight as z, SunIcon as pt, SearchIcon as vt } from "lucide-react";
|
|
3
|
+
import * as y from "react";
|
|
4
|
+
import { createContext as j, useContext as U, useState as T, useMemo as A, useEffect as C, useRef as xt, useCallback as O } from "react";
|
|
5
|
+
import { useRouteError as yt, isRouteErrorResponse as Nt, Outlet as W, NavLink as Ct, redirect as nt, Navigate as St, createMemoryRouter as Tt, createBrowserRouter as kt, RouterProvider as Rt, useHref as Et, Link as Bt, useLocation as ot, useMatch as At, useNavigate as Pt } from "react-router";
|
|
6
|
+
import { Link as ma, useLocation as ha, useNavigate as fa, useParams as ga, useRouteError as ba, useSearchParams as pa } from "react-router";
|
|
7
|
+
import { Slot as D } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva as it } from "class-variance-authority";
|
|
9
|
+
import { clsx as Lt } from "clsx";
|
|
10
|
+
import { twMerge as Dt } from "tailwind-merge";
|
|
11
|
+
import { capitalCase as P } from "change-case";
|
|
12
|
+
import { Toaster as It } from "sonner";
|
|
13
|
+
import * as H from "@radix-ui/react-collapsible";
|
|
14
14
|
import "@radix-ui/react-separator";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import { print as
|
|
15
|
+
import * as v from "@radix-ui/react-dialog";
|
|
16
|
+
import * as k from "@radix-ui/react-tooltip";
|
|
17
|
+
import { print as _t } from "graphql";
|
|
18
18
|
import { createAuthClient as Mt } from "@tailor-platform/auth-browser-client";
|
|
19
19
|
function u(...t) {
|
|
20
|
-
return
|
|
20
|
+
return Dt(Lt(t));
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const zt = it(
|
|
23
23
|
"astw:inline-flex astw:items-center astw:justify-center astw:gap-2 astw:whitespace-nowrap astw:rounded-md astw:text-sm astw:font-medium astw:transition-all astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:[&_svg]:pointer-events-none astw:[&_svg:not([class*='size-'])]:size-4 astw:shrink-0 astw:[&_svg]:shrink-0 astw:outline-none astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px] astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
@@ -44,7 +44,7 @@ const _t = rt(
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
function
|
|
47
|
+
function L({
|
|
48
48
|
className: t,
|
|
49
49
|
variant: e,
|
|
50
50
|
size: s,
|
|
@@ -52,31 +52,31 @@ function B({
|
|
|
52
52
|
...n
|
|
53
53
|
}) {
|
|
54
54
|
return /* @__PURE__ */ a(
|
|
55
|
-
r ?
|
|
55
|
+
r ? D : "button",
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "button",
|
|
58
|
-
className: u(
|
|
58
|
+
className: u(zt({ variant: e, size: s, className: t })),
|
|
59
59
|
...n
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const E = "en", Ot = () => {
|
|
64
64
|
try {
|
|
65
65
|
if (typeof navigator > "u")
|
|
66
|
-
return
|
|
66
|
+
return E;
|
|
67
67
|
const t = navigator.languages?.[0] ?? navigator.language;
|
|
68
|
-
return t ? new Intl.Locale(t).language :
|
|
68
|
+
return t ? new Intl.Locale(t).language : E;
|
|
69
69
|
} catch {
|
|
70
|
-
return
|
|
70
|
+
return E;
|
|
71
71
|
}
|
|
72
|
-
}, F = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s,
|
|
72
|
+
}, F = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Q = (t) => {
|
|
73
73
|
const e = F(t);
|
|
74
|
-
return (s, r) => e(s, typeof s == "string" ? s :
|
|
75
|
-
},
|
|
76
|
-
const { configurations: t } =
|
|
74
|
+
return (s, r) => e(s, typeof s == "string" ? s : P(r));
|
|
75
|
+
}, $t = () => {
|
|
76
|
+
const { configurations: t } = S(), e = F(t.locale);
|
|
77
77
|
return (s, r) => e(s, r);
|
|
78
|
-
},
|
|
79
|
-
const e = (s) => (r) => t[s ??
|
|
78
|
+
}, Kt = (t) => {
|
|
79
|
+
const e = (s) => (r) => t[s ?? E]?.[r] ?? t.en[r];
|
|
80
80
|
return {
|
|
81
81
|
/**
|
|
82
82
|
* Hook to get the translated label resolver function.
|
|
@@ -98,7 +98,7 @@ const C = "en", Pt = () => {
|
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
100
|
useT: () => {
|
|
101
|
-
const { configurations: s } =
|
|
101
|
+
const { configurations: s } = S(), r = e(s.locale);
|
|
102
102
|
return ((n, ...o) => {
|
|
103
103
|
const l = r(n);
|
|
104
104
|
return typeof l == "function" ? l(o[0]) : l;
|
|
@@ -131,7 +131,7 @@ const C = "en", Pt = () => {
|
|
|
131
131
|
return typeof o == "function" ? o(r[0]) : o;
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
},
|
|
134
|
+
}, jt = Kt({
|
|
135
135
|
en: {
|
|
136
136
|
error404Title: "404 Not Found",
|
|
137
137
|
error404Body: "The page you requested could not be found.",
|
|
@@ -147,7 +147,9 @@ const C = "en", Pt = () => {
|
|
|
147
147
|
sidebar: "Sidebar",
|
|
148
148
|
sidebarDesc: "Displays the mobile sidebar.",
|
|
149
149
|
close: "Close",
|
|
150
|
-
more: "More"
|
|
150
|
+
more: "More",
|
|
151
|
+
commandPaletteSearch: "Search pages...",
|
|
152
|
+
commandPaletteNoResults: "No results found"
|
|
151
153
|
},
|
|
152
154
|
ja: {
|
|
153
155
|
error404Title: "404 ページが見つかりません",
|
|
@@ -164,21 +166,23 @@ const C = "en", Pt = () => {
|
|
|
164
166
|
sidebar: "サイドバー",
|
|
165
167
|
sidebarDesc: "モバイル用サイドバーを表示します。",
|
|
166
168
|
close: "閉じる",
|
|
167
|
-
more: "その他"
|
|
169
|
+
more: "その他",
|
|
170
|
+
commandPaletteSearch: "ページを検索...",
|
|
171
|
+
commandPaletteNoResults: "結果が見つかりません"
|
|
168
172
|
}
|
|
169
|
-
}),
|
|
170
|
-
const t =
|
|
173
|
+
}), R = jt.useT, I = () => {
|
|
174
|
+
const t = yt(), e = R(), s = {
|
|
171
175
|
role: "alert",
|
|
172
176
|
"aria-label": "default-error-boundary"
|
|
173
177
|
};
|
|
174
|
-
if (
|
|
178
|
+
if (Nt(t) && t.status === 404)
|
|
175
179
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
176
|
-
/* @__PURE__ */ a(
|
|
180
|
+
/* @__PURE__ */ a(q, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
177
181
|
/* @__PURE__ */ c("div", { children: [
|
|
178
182
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
|
|
179
183
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
|
|
180
184
|
/* @__PURE__ */ a(
|
|
181
|
-
|
|
185
|
+
L,
|
|
182
186
|
{
|
|
183
187
|
variant: "outline",
|
|
184
188
|
size: "sm",
|
|
@@ -191,12 +195,12 @@ const C = "en", Pt = () => {
|
|
|
191
195
|
] }) });
|
|
192
196
|
const r = t instanceof Error ? t.message : e("errorUnexpected");
|
|
193
197
|
return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
|
|
194
|
-
/* @__PURE__ */ a(
|
|
198
|
+
/* @__PURE__ */ a(q, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
|
|
195
199
|
/* @__PURE__ */ c("div", { children: [
|
|
196
200
|
/* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
|
|
197
201
|
/* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
|
|
198
202
|
/* @__PURE__ */ a(
|
|
199
|
-
|
|
203
|
+
L,
|
|
200
204
|
{
|
|
201
205
|
variant: "outline",
|
|
202
206
|
size: "sm",
|
|
@@ -207,36 +211,36 @@ const C = "en", Pt = () => {
|
|
|
207
211
|
)
|
|
208
212
|
] })
|
|
209
213
|
] }) });
|
|
210
|
-
},
|
|
214
|
+
}, Ut = (t) => ({
|
|
211
215
|
modules: t.modules,
|
|
212
216
|
settingsResources: t.settingsResources ?? [],
|
|
213
|
-
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(
|
|
217
|
+
errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(I, {}),
|
|
214
218
|
basePath: t.basePath,
|
|
215
|
-
locale: t.locale ??
|
|
216
|
-
}),
|
|
219
|
+
locale: t.locale ?? Ot()
|
|
220
|
+
}), lt = j({
|
|
217
221
|
navItems: [],
|
|
218
222
|
configurations: {
|
|
219
223
|
modules: [],
|
|
220
224
|
settingsResources: [],
|
|
221
|
-
errorBoundary: /* @__PURE__ */ a(
|
|
222
|
-
locale:
|
|
225
|
+
errorBoundary: /* @__PURE__ */ a(I, {}),
|
|
226
|
+
locale: E
|
|
223
227
|
}
|
|
224
|
-
}),
|
|
225
|
-
const t =
|
|
226
|
-
return /* @__PURE__ */ c(
|
|
228
|
+
}), S = () => U(lt), Wt = () => {
|
|
229
|
+
const t = R();
|
|
230
|
+
return /* @__PURE__ */ c(B, { children: [
|
|
227
231
|
/* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
|
|
228
232
|
/* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
|
|
229
233
|
] });
|
|
230
|
-
},
|
|
231
|
-
/* @__PURE__ */ a(
|
|
232
|
-
/* @__PURE__ */ a(
|
|
233
|
-
] }),
|
|
234
|
-
const { configurations: t } =
|
|
234
|
+
}, X = () => /* @__PURE__ */ c(B, { children: [
|
|
235
|
+
/* @__PURE__ */ a(W, {}),
|
|
236
|
+
/* @__PURE__ */ a(It, {})
|
|
237
|
+
] }), Ht = () => {
|
|
238
|
+
const { configurations: t } = S(), e = R(), s = $t();
|
|
235
239
|
return /* @__PURE__ */ c("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: [
|
|
236
240
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ c("nav", { className: "astw:bg-card astw:md:w-xs astw:rounded-md astw:border astw:p-3 astw:shadow-xs", children: [
|
|
237
241
|
/* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
|
|
238
|
-
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
239
|
-
|
|
242
|
+
/* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(Ct, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ c(
|
|
243
|
+
L,
|
|
240
244
|
{
|
|
241
245
|
variant: n ? "secondary" : "ghost",
|
|
242
246
|
className: "astw:w-full astw:justify-start",
|
|
@@ -247,29 +251,29 @@ const C = "en", Pt = () => {
|
|
|
247
251
|
}
|
|
248
252
|
) }) }, r.path)) })
|
|
249
253
|
] }) }),
|
|
250
|
-
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(
|
|
254
|
+
/* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(W, {}) })
|
|
251
255
|
] });
|
|
252
256
|
};
|
|
253
|
-
function
|
|
257
|
+
function sa(t) {
|
|
254
258
|
return {
|
|
255
259
|
redirectTo: t
|
|
256
260
|
};
|
|
257
261
|
}
|
|
258
|
-
function
|
|
262
|
+
function $(t) {
|
|
259
263
|
return typeof t == "object" && t !== null && "redirectTo" in t;
|
|
260
264
|
}
|
|
261
|
-
const
|
|
262
|
-
const { configurations: s } =
|
|
265
|
+
const dt = (t, e) => () => {
|
|
266
|
+
const { configurations: s } = S(), { metaTitle: r, fallbackTitle: n } = t, l = F(s.locale)(r, n);
|
|
263
267
|
return e(l);
|
|
264
268
|
};
|
|
265
|
-
function
|
|
266
|
-
const { path: e, meta: s, component: r, resources: n, errorBoundary: o } = t, l = s?.title ??
|
|
269
|
+
function ra(t) {
|
|
270
|
+
const { path: e, meta: s, component: r, resources: n, errorBoundary: o } = t, l = s?.title ?? P(e), d = P(e), i = $(r) ? {
|
|
267
271
|
// Use loader for redirects
|
|
268
272
|
component: () => null,
|
|
269
|
-
loader: () =>
|
|
273
|
+
loader: () => nt(r.redirectTo)
|
|
270
274
|
} : {
|
|
271
275
|
// Regular component with locale-aware title
|
|
272
|
-
component:
|
|
276
|
+
component: dt(
|
|
273
277
|
{ metaTitle: l, fallbackTitle: d },
|
|
274
278
|
(w) => r({ title: w, resources: n })
|
|
275
279
|
)
|
|
@@ -283,15 +287,15 @@ function Qe(t) {
|
|
|
283
287
|
title: l,
|
|
284
288
|
...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
|
|
285
289
|
...s,
|
|
286
|
-
menuItemClickable:
|
|
290
|
+
menuItemClickable: !$(r),
|
|
287
291
|
icon: t.meta?.icon
|
|
288
292
|
},
|
|
289
293
|
resources: n,
|
|
290
|
-
errorBoundary: o || /* @__PURE__ */ a(
|
|
294
|
+
errorBoundary: o || /* @__PURE__ */ a(I, {})
|
|
291
295
|
};
|
|
292
296
|
}
|
|
293
|
-
function
|
|
294
|
-
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o } = t, l = n?.title ??
|
|
297
|
+
function na(t) {
|
|
298
|
+
const { path: e, component: s, subResources: r, meta: n, errorBoundary: o } = t, l = n?.title ?? P(e), d = P(e);
|
|
295
299
|
return {
|
|
296
300
|
_type: "resource",
|
|
297
301
|
type: "component",
|
|
@@ -301,15 +305,15 @@ function Ke(t) {
|
|
|
301
305
|
icon: n?.icon,
|
|
302
306
|
...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
|
|
303
307
|
},
|
|
304
|
-
component:
|
|
308
|
+
component: dt(
|
|
305
309
|
{ metaTitle: l, fallbackTitle: d },
|
|
306
310
|
(i) => s({ title: i, resources: r })
|
|
307
311
|
),
|
|
308
312
|
subResources: r,
|
|
309
|
-
errorBoundary: o ?? /* @__PURE__ */ a(
|
|
313
|
+
errorBoundary: o ?? /* @__PURE__ */ a(I, {})
|
|
310
314
|
};
|
|
311
315
|
}
|
|
312
|
-
const
|
|
316
|
+
const G = (t) => () => /* @__PURE__ */ a(B, { children: t }), ct = (t, e, s) => {
|
|
313
317
|
const r = t.errorBoundary || s, n = {
|
|
314
318
|
index: !0,
|
|
315
319
|
Component: t.component,
|
|
@@ -318,38 +322,38 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
318
322
|
return {
|
|
319
323
|
path: t.path,
|
|
320
324
|
...t.errorBoundary && {
|
|
321
|
-
ErrorBoundary:
|
|
325
|
+
ErrorBoundary: G(t.errorBoundary)
|
|
322
326
|
},
|
|
323
327
|
...e && e.length > 0 ? {
|
|
324
328
|
children: [
|
|
325
329
|
n,
|
|
326
330
|
...e.map(
|
|
327
|
-
(o) =>
|
|
331
|
+
(o) => ct(o, o.subResources, r)
|
|
328
332
|
)
|
|
329
333
|
]
|
|
330
334
|
} : {
|
|
331
335
|
children: [n]
|
|
332
336
|
}
|
|
333
337
|
};
|
|
334
|
-
},
|
|
335
|
-
(e) =>
|
|
336
|
-
),
|
|
338
|
+
}, Ft = (t) => t.map(
|
|
339
|
+
(e) => ct(e, e.resources, e.errorBoundary)
|
|
340
|
+
), Qt = ({
|
|
337
341
|
modules: t,
|
|
338
342
|
settingsResources: e,
|
|
339
343
|
rootComponent: s
|
|
340
344
|
}) => {
|
|
341
|
-
const r =
|
|
345
|
+
const r = $(s) ? {
|
|
342
346
|
index: !0,
|
|
343
|
-
loader: () =>
|
|
347
|
+
loader: () => nt(s.redirectTo)
|
|
344
348
|
} : {
|
|
345
349
|
index: !0,
|
|
346
|
-
Component: s ??
|
|
350
|
+
Component: s ?? Wt
|
|
347
351
|
}, n = e.length > 0 ? [
|
|
348
352
|
{
|
|
349
353
|
path: "settings",
|
|
350
354
|
index: !0,
|
|
351
355
|
Component: () => /* @__PURE__ */ a(
|
|
352
|
-
|
|
356
|
+
St,
|
|
353
357
|
{
|
|
354
358
|
to: e[0].path,
|
|
355
359
|
relative: "path",
|
|
@@ -359,12 +363,12 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
359
363
|
},
|
|
360
364
|
{
|
|
361
365
|
path: "settings",
|
|
362
|
-
Component:
|
|
366
|
+
Component: Ht,
|
|
363
367
|
children: e.map((o) => ({
|
|
364
368
|
path: o.path,
|
|
365
369
|
Component: o.component,
|
|
366
370
|
...o.errorBoundary && {
|
|
367
|
-
ErrorBoundary:
|
|
371
|
+
ErrorBoundary: G(o.errorBoundary)
|
|
368
372
|
}
|
|
369
373
|
}))
|
|
370
374
|
}
|
|
@@ -372,7 +376,7 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
372
376
|
return [
|
|
373
377
|
r,
|
|
374
378
|
{
|
|
375
|
-
children:
|
|
379
|
+
children: Ft(t)
|
|
376
380
|
},
|
|
377
381
|
...n,
|
|
378
382
|
{
|
|
@@ -382,8 +386,8 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
382
386
|
}
|
|
383
387
|
}
|
|
384
388
|
];
|
|
385
|
-
},
|
|
386
|
-
const { configurations: e } =
|
|
389
|
+
}, Gt = (t) => {
|
|
390
|
+
const { configurations: e } = S(), { rootComponent: s, children: r } = t, n = Qt({
|
|
387
391
|
modules: e.modules,
|
|
388
392
|
settingsResources: e.settingsResources,
|
|
389
393
|
rootComponent: s
|
|
@@ -392,8 +396,8 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
392
396
|
element: r,
|
|
393
397
|
children: o ? [
|
|
394
398
|
{
|
|
395
|
-
element: /* @__PURE__ */ a(
|
|
396
|
-
ErrorBoundary:
|
|
399
|
+
element: /* @__PURE__ */ a(W, {}),
|
|
400
|
+
ErrorBoundary: G(o),
|
|
397
401
|
children: n
|
|
398
402
|
}
|
|
399
403
|
] : n
|
|
@@ -401,25 +405,25 @@ const Q = (t) => () => /* @__PURE__ */ a(S, { children: t }), lt = (t, e, s) =>
|
|
|
401
405
|
], d = e.basePath ? "/" + e.basePath : void 0, i = t.memory ? Tt(l, {
|
|
402
406
|
basename: d,
|
|
403
407
|
...t.initialEntries ? { initialEntries: t.initialEntries } : {}
|
|
404
|
-
}) :
|
|
408
|
+
}) : kt(l, {
|
|
405
409
|
basename: d
|
|
406
410
|
});
|
|
407
|
-
return /* @__PURE__ */ a(
|
|
408
|
-
},
|
|
411
|
+
return /* @__PURE__ */ a(Rt, { router: i });
|
|
412
|
+
}, Vt = {
|
|
409
413
|
resolvedTheme: "light",
|
|
410
414
|
theme: "system",
|
|
411
415
|
setTheme: () => null
|
|
412
|
-
},
|
|
413
|
-
function
|
|
416
|
+
}, wt = j(Vt);
|
|
417
|
+
function qt({
|
|
414
418
|
children: t,
|
|
415
419
|
storageKey: e,
|
|
416
420
|
defaultTheme: s = "system",
|
|
417
421
|
...r
|
|
418
422
|
}) {
|
|
419
|
-
const [n, o] =
|
|
423
|
+
const [n, o] = T(
|
|
420
424
|
() => localStorage.getItem(e) || s
|
|
421
|
-
), l =
|
|
422
|
-
|
|
425
|
+
), l = A(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
|
|
426
|
+
C(() => {
|
|
423
427
|
const i = window.document.documentElement;
|
|
424
428
|
i.classList.remove("light", "dark"), i.classList.add(l);
|
|
425
429
|
}, [l]);
|
|
@@ -430,37 +434,37 @@ function Qt({
|
|
|
430
434
|
localStorage.setItem(e, i), o(i);
|
|
431
435
|
}
|
|
432
436
|
};
|
|
433
|
-
return /* @__PURE__ */ a(
|
|
437
|
+
return /* @__PURE__ */ a(wt.Provider, { ...r, value: d, children: t });
|
|
434
438
|
}
|
|
435
|
-
const
|
|
436
|
-
const t =
|
|
439
|
+
const Xt = () => {
|
|
440
|
+
const t = U(wt);
|
|
437
441
|
if (t === void 0)
|
|
438
442
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
439
443
|
return t;
|
|
440
|
-
},
|
|
441
|
-
const [e, s] =
|
|
442
|
-
|
|
444
|
+
}, oa = (t) => {
|
|
445
|
+
const [e, s] = T(!1);
|
|
446
|
+
C(function() {
|
|
443
447
|
s(!0);
|
|
444
448
|
}, []);
|
|
445
|
-
const r =
|
|
446
|
-
const o = t.modules, l =
|
|
449
|
+
const r = Ut(t), n = A(() => {
|
|
450
|
+
const o = t.modules, l = Q(r.locale);
|
|
447
451
|
return o.map((d) => {
|
|
448
|
-
const i = l(d.meta.title, d.path), w = d.resources.map((
|
|
449
|
-
title: l(
|
|
450
|
-
url: `${d.path}/${
|
|
452
|
+
const i = l(d.meta.title, d.path), w = d.resources.map((h) => ({
|
|
453
|
+
title: l(h.meta.title, h.path),
|
|
454
|
+
url: `${d.path}/${h.path}`
|
|
451
455
|
}));
|
|
452
456
|
return {
|
|
453
457
|
title: i,
|
|
454
458
|
url: d.meta.menuItemClickable ? d.path : void 0,
|
|
455
459
|
clickable: d.component,
|
|
456
|
-
icon: d.meta.icon || /* @__PURE__ */ a(
|
|
460
|
+
icon: d.meta.icon || /* @__PURE__ */ a(gt, {}),
|
|
457
461
|
isActive: !0,
|
|
458
462
|
items: w
|
|
459
463
|
};
|
|
460
464
|
});
|
|
461
465
|
}, [t.modules, r.locale]);
|
|
462
466
|
return e ? /* @__PURE__ */ a(
|
|
463
|
-
|
|
467
|
+
lt.Provider,
|
|
464
468
|
{
|
|
465
469
|
value: {
|
|
466
470
|
title: t.title,
|
|
@@ -468,63 +472,79 @@ const Kt = () => {
|
|
|
468
472
|
configurations: r,
|
|
469
473
|
navItems: n
|
|
470
474
|
},
|
|
471
|
-
children: /* @__PURE__ */ a(
|
|
475
|
+
children: /* @__PURE__ */ a(qt, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Gt, { rootComponent: t.rootComponent, children: t.children }) })
|
|
472
476
|
}
|
|
473
477
|
) : null;
|
|
474
478
|
};
|
|
475
|
-
function
|
|
479
|
+
function Yt({
|
|
476
480
|
...t
|
|
477
481
|
}) {
|
|
478
|
-
return /* @__PURE__ */ a(
|
|
482
|
+
return /* @__PURE__ */ a(H.Root, { "data-slot": "collapsible", ...t });
|
|
479
483
|
}
|
|
480
|
-
function
|
|
484
|
+
function Y({
|
|
481
485
|
...t
|
|
482
486
|
}) {
|
|
483
487
|
return /* @__PURE__ */ a(
|
|
484
|
-
|
|
488
|
+
H.CollapsibleTrigger,
|
|
485
489
|
{
|
|
486
490
|
"data-slot": "collapsible-trigger",
|
|
487
491
|
...t
|
|
488
492
|
}
|
|
489
493
|
);
|
|
490
494
|
}
|
|
491
|
-
function
|
|
495
|
+
function Jt({
|
|
492
496
|
...t
|
|
493
497
|
}) {
|
|
494
498
|
return /* @__PURE__ */ a(
|
|
495
|
-
|
|
499
|
+
H.CollapsibleContent,
|
|
496
500
|
{
|
|
497
501
|
"data-slot": "collapsible-content",
|
|
498
502
|
...t
|
|
499
503
|
}
|
|
500
504
|
);
|
|
501
505
|
}
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const [t, e] =
|
|
506
|
+
const M = 768;
|
|
507
|
+
function Zt() {
|
|
508
|
+
const [t, e] = y.useState(
|
|
505
509
|
void 0
|
|
506
510
|
);
|
|
507
|
-
return
|
|
508
|
-
const s = window.matchMedia(`(max-width: ${
|
|
509
|
-
e(window.innerWidth <
|
|
511
|
+
return y.useEffect(() => {
|
|
512
|
+
const s = window.matchMedia(`(max-width: ${M - 1}px)`), r = () => {
|
|
513
|
+
e(window.innerWidth < M);
|
|
510
514
|
};
|
|
511
|
-
return s.addEventListener("change", r), e(window.innerWidth <
|
|
515
|
+
return s.addEventListener("change", r), e(window.innerWidth < M), () => s.removeEventListener("change", r);
|
|
512
516
|
}, []), !!t;
|
|
513
517
|
}
|
|
514
|
-
function
|
|
515
|
-
return /* @__PURE__ */ a(
|
|
518
|
+
function te({ className: t, type: e, ...s }) {
|
|
519
|
+
return /* @__PURE__ */ a(
|
|
520
|
+
"input",
|
|
521
|
+
{
|
|
522
|
+
type: e,
|
|
523
|
+
"data-slot": "input",
|
|
524
|
+
className: u(
|
|
525
|
+
"astw:file:text-foreground astw:placeholder:text-muted-foreground astw:selection:bg-primary astw:selection:text-primary-foreground astw:dark:bg-input/30 astw:border-input astw:flex astw:h-9 astw:w-full astw:min-w-0 astw:rounded-md astw:border astw:bg-transparent astw:px-3 astw:py-1 astw:text-base astw:shadow-xs astw:transition-[color,box-shadow] astw:outline-none astw:file:inline-flex astw:file:h-7 astw:file:border-0 astw:file:bg-transparent astw:file:text-sm astw:file:font-medium astw:disabled:pointer-events-none astw:disabled:cursor-not-allowed astw:disabled:opacity-50 astw:md:text-sm",
|
|
526
|
+
"astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px]",
|
|
527
|
+
"astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
|
|
528
|
+
t
|
|
529
|
+
),
|
|
530
|
+
...s
|
|
531
|
+
}
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
function ee({ ...t }) {
|
|
535
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "sheet", ...t });
|
|
516
536
|
}
|
|
517
|
-
function
|
|
537
|
+
function ae({
|
|
518
538
|
...t
|
|
519
539
|
}) {
|
|
520
|
-
return /* @__PURE__ */ a(
|
|
540
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "sheet-portal", ...t });
|
|
521
541
|
}
|
|
522
|
-
function
|
|
542
|
+
function se({
|
|
523
543
|
className: t,
|
|
524
544
|
...e
|
|
525
545
|
}) {
|
|
526
546
|
return /* @__PURE__ */ a(
|
|
527
|
-
|
|
547
|
+
v.Overlay,
|
|
528
548
|
{
|
|
529
549
|
"data-slot": "sheet-overlay",
|
|
530
550
|
className: u(
|
|
@@ -535,16 +555,16 @@ function Jt({
|
|
|
535
555
|
}
|
|
536
556
|
);
|
|
537
557
|
}
|
|
538
|
-
function
|
|
558
|
+
function re({
|
|
539
559
|
className: t,
|
|
540
560
|
children: e,
|
|
541
561
|
side: s = "right",
|
|
542
562
|
...r
|
|
543
563
|
}) {
|
|
544
|
-
return /* @__PURE__ */ c(
|
|
545
|
-
/* @__PURE__ */ a(
|
|
564
|
+
return /* @__PURE__ */ c(ae, { children: [
|
|
565
|
+
/* @__PURE__ */ a(se, {}),
|
|
546
566
|
/* @__PURE__ */ c(
|
|
547
|
-
|
|
567
|
+
v.Content,
|
|
548
568
|
{
|
|
549
569
|
"data-slot": "sheet-content",
|
|
550
570
|
className: u(
|
|
@@ -558,8 +578,8 @@ function Zt({
|
|
|
558
578
|
...r,
|
|
559
579
|
children: [
|
|
560
580
|
e,
|
|
561
|
-
/* @__PURE__ */ c(
|
|
562
|
-
/* @__PURE__ */ a(
|
|
581
|
+
/* @__PURE__ */ c(v.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-secondary astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none", children: [
|
|
582
|
+
/* @__PURE__ */ a(rt, { className: "astw:size-4" }),
|
|
563
583
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
564
584
|
] })
|
|
565
585
|
]
|
|
@@ -567,7 +587,7 @@ function Zt({
|
|
|
567
587
|
)
|
|
568
588
|
] });
|
|
569
589
|
}
|
|
570
|
-
function
|
|
590
|
+
function ne({ className: t, ...e }) {
|
|
571
591
|
return /* @__PURE__ */ a(
|
|
572
592
|
"div",
|
|
573
593
|
{
|
|
@@ -577,12 +597,12 @@ function te({ className: t, ...e }) {
|
|
|
577
597
|
}
|
|
578
598
|
);
|
|
579
599
|
}
|
|
580
|
-
function
|
|
600
|
+
function oe({
|
|
581
601
|
className: t,
|
|
582
602
|
...e
|
|
583
603
|
}) {
|
|
584
604
|
return /* @__PURE__ */ a(
|
|
585
|
-
|
|
605
|
+
v.Title,
|
|
586
606
|
{
|
|
587
607
|
"data-slot": "sheet-title",
|
|
588
608
|
className: u("astw:text-foreground astw:font-semibold", t),
|
|
@@ -590,12 +610,12 @@ function ee({
|
|
|
590
610
|
}
|
|
591
611
|
);
|
|
592
612
|
}
|
|
593
|
-
function
|
|
613
|
+
function ie({
|
|
594
614
|
className: t,
|
|
595
615
|
...e
|
|
596
616
|
}) {
|
|
597
617
|
return /* @__PURE__ */ a(
|
|
598
|
-
|
|
618
|
+
v.Description,
|
|
599
619
|
{
|
|
600
620
|
"data-slot": "sheet-description",
|
|
601
621
|
className: u("astw:text-muted-foreground astw:text-sm", t),
|
|
@@ -603,12 +623,12 @@ function ae({
|
|
|
603
623
|
}
|
|
604
624
|
);
|
|
605
625
|
}
|
|
606
|
-
function
|
|
626
|
+
function ut({
|
|
607
627
|
delayDuration: t = 0,
|
|
608
628
|
...e
|
|
609
629
|
}) {
|
|
610
630
|
return /* @__PURE__ */ a(
|
|
611
|
-
|
|
631
|
+
k.Provider,
|
|
612
632
|
{
|
|
613
633
|
"data-slot": "tooltip-provider",
|
|
614
634
|
delayDuration: t,
|
|
@@ -616,24 +636,24 @@ function ct({
|
|
|
616
636
|
}
|
|
617
637
|
);
|
|
618
638
|
}
|
|
619
|
-
function
|
|
639
|
+
function le({
|
|
620
640
|
...t
|
|
621
641
|
}) {
|
|
622
|
-
return /* @__PURE__ */ a(
|
|
642
|
+
return /* @__PURE__ */ a(ut, { children: /* @__PURE__ */ a(k.Root, { "data-slot": "tooltip", ...t }) });
|
|
623
643
|
}
|
|
624
|
-
function
|
|
644
|
+
function de({
|
|
625
645
|
...t
|
|
626
646
|
}) {
|
|
627
|
-
return /* @__PURE__ */ a(
|
|
647
|
+
return /* @__PURE__ */ a(k.Trigger, { "data-slot": "tooltip-trigger", ...t });
|
|
628
648
|
}
|
|
629
|
-
function
|
|
649
|
+
function ce({
|
|
630
650
|
className: t,
|
|
631
651
|
sideOffset: e = 0,
|
|
632
652
|
children: s,
|
|
633
653
|
...r
|
|
634
654
|
}) {
|
|
635
|
-
return /* @__PURE__ */ a(
|
|
636
|
-
|
|
655
|
+
return /* @__PURE__ */ a(k.Portal, { children: /* @__PURE__ */ c(
|
|
656
|
+
k.Content,
|
|
637
657
|
{
|
|
638
658
|
"data-slot": "tooltip-content",
|
|
639
659
|
sideOffset: e,
|
|
@@ -644,19 +664,19 @@ function ne({
|
|
|
644
664
|
...r,
|
|
645
665
|
children: [
|
|
646
666
|
s,
|
|
647
|
-
/* @__PURE__ */ a(
|
|
667
|
+
/* @__PURE__ */ a(k.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]" })
|
|
648
668
|
]
|
|
649
669
|
}
|
|
650
670
|
) });
|
|
651
671
|
}
|
|
652
|
-
const
|
|
672
|
+
const we = "sidebar_state", ue = 3600 * 24 * 7, me = "16rem", he = "18rem", fe = "3rem", ge = "b", mt = y.createContext(null);
|
|
653
673
|
function _() {
|
|
654
|
-
const t =
|
|
674
|
+
const t = y.useContext(mt);
|
|
655
675
|
if (!t)
|
|
656
676
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
657
677
|
return t;
|
|
658
678
|
}
|
|
659
|
-
function
|
|
679
|
+
function be({
|
|
660
680
|
defaultOpen: t = !0,
|
|
661
681
|
open: e,
|
|
662
682
|
onOpenChange: s,
|
|
@@ -665,38 +685,38 @@ function ue({
|
|
|
665
685
|
children: o,
|
|
666
686
|
...l
|
|
667
687
|
}) {
|
|
668
|
-
const d =
|
|
669
|
-
(
|
|
670
|
-
const
|
|
671
|
-
s ? s(
|
|
688
|
+
const d = Zt(), [i, w] = y.useState(!1), [h, f] = y.useState(t), b = e ?? h, m = y.useCallback(
|
|
689
|
+
(p) => {
|
|
690
|
+
const N = typeof p == "function" ? p(b) : p;
|
|
691
|
+
s ? s(N) : f(N), document.cookie = `${we}=${N}; path=/; max-age=${ue}`;
|
|
672
692
|
},
|
|
673
|
-
[s,
|
|
674
|
-
),
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
|
|
693
|
+
[s, b]
|
|
694
|
+
), g = y.useCallback(() => d ? w((p) => !p) : m((p) => !p), [d, m, w]);
|
|
695
|
+
y.useEffect(() => {
|
|
696
|
+
const p = (N) => {
|
|
697
|
+
N.key === ge && (N.metaKey || N.ctrlKey) && (N.preventDefault(), g());
|
|
678
698
|
};
|
|
679
|
-
return window.addEventListener("keydown",
|
|
680
|
-
}, [
|
|
681
|
-
const
|
|
699
|
+
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
700
|
+
}, [g]);
|
|
701
|
+
const x = b ? "expanded" : "collapsed", V = y.useMemo(
|
|
682
702
|
() => ({
|
|
683
|
-
state:
|
|
684
|
-
open:
|
|
685
|
-
setOpen:
|
|
703
|
+
state: x,
|
|
704
|
+
open: b,
|
|
705
|
+
setOpen: m,
|
|
686
706
|
isMobile: d,
|
|
687
707
|
openMobile: i,
|
|
688
708
|
setOpenMobile: w,
|
|
689
|
-
toggleSidebar:
|
|
709
|
+
toggleSidebar: g
|
|
690
710
|
}),
|
|
691
|
-
[
|
|
711
|
+
[x, b, m, d, i, w, g]
|
|
692
712
|
);
|
|
693
|
-
return /* @__PURE__ */ a(
|
|
713
|
+
return /* @__PURE__ */ a(mt.Provider, { value: V, children: /* @__PURE__ */ a(ut, { delayDuration: 0, children: /* @__PURE__ */ a(
|
|
694
714
|
"div",
|
|
695
715
|
{
|
|
696
716
|
"data-slot": "sidebar-wrapper",
|
|
697
717
|
style: {
|
|
698
|
-
"--sidebar-width":
|
|
699
|
-
"--sidebar-width-icon":
|
|
718
|
+
"--sidebar-width": me,
|
|
719
|
+
"--sidebar-width-icon": fe,
|
|
700
720
|
...n
|
|
701
721
|
},
|
|
702
722
|
className: u(
|
|
@@ -708,7 +728,7 @@ function ue({
|
|
|
708
728
|
}
|
|
709
729
|
) }) });
|
|
710
730
|
}
|
|
711
|
-
function
|
|
731
|
+
function pe({
|
|
712
732
|
side: t = "left",
|
|
713
733
|
variant: e = "sidebar",
|
|
714
734
|
collapsible: s = "offcanvas",
|
|
@@ -728,21 +748,21 @@ function me({
|
|
|
728
748
|
...o,
|
|
729
749
|
children: n
|
|
730
750
|
}
|
|
731
|
-
) : l ? /* @__PURE__ */ a(
|
|
732
|
-
|
|
751
|
+
) : l ? /* @__PURE__ */ a(ee, { open: i, onOpenChange: w, ...o, children: /* @__PURE__ */ c(
|
|
752
|
+
re,
|
|
733
753
|
{
|
|
734
754
|
"data-sidebar": "sidebar",
|
|
735
755
|
"data-slot": "sidebar",
|
|
736
756
|
"data-mobile": "true",
|
|
737
757
|
className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
|
|
738
758
|
style: {
|
|
739
|
-
"--sidebar-width":
|
|
759
|
+
"--sidebar-width": he
|
|
740
760
|
},
|
|
741
761
|
side: t,
|
|
742
762
|
children: [
|
|
743
|
-
/* @__PURE__ */ c(
|
|
744
|
-
/* @__PURE__ */ a(
|
|
745
|
-
/* @__PURE__ */ a(
|
|
763
|
+
/* @__PURE__ */ c(ne, { className: "astw:sr-only", children: [
|
|
764
|
+
/* @__PURE__ */ a(oe, { children: "Sidebar" }),
|
|
765
|
+
/* @__PURE__ */ a(ie, { children: "Displays the mobile sidebar." })
|
|
746
766
|
] }),
|
|
747
767
|
/* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: n })
|
|
748
768
|
]
|
|
@@ -797,14 +817,14 @@ function me({
|
|
|
797
817
|
}
|
|
798
818
|
);
|
|
799
819
|
}
|
|
800
|
-
function
|
|
820
|
+
function ht({
|
|
801
821
|
className: t,
|
|
802
822
|
onClick: e,
|
|
803
823
|
...s
|
|
804
824
|
}) {
|
|
805
825
|
const { toggleSidebar: r } = _();
|
|
806
826
|
return /* @__PURE__ */ c(
|
|
807
|
-
|
|
827
|
+
L,
|
|
808
828
|
{
|
|
809
829
|
"data-sidebar": "trigger",
|
|
810
830
|
"data-slot": "sidebar-trigger",
|
|
@@ -816,13 +836,13 @@ function ut({
|
|
|
816
836
|
},
|
|
817
837
|
...s,
|
|
818
838
|
children: [
|
|
819
|
-
/* @__PURE__ */ a(
|
|
839
|
+
/* @__PURE__ */ a(bt, { className: "astw:size-4.5" }),
|
|
820
840
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
|
|
821
841
|
]
|
|
822
842
|
}
|
|
823
843
|
);
|
|
824
844
|
}
|
|
825
|
-
function
|
|
845
|
+
function ve({ className: t, ...e }) {
|
|
826
846
|
return /* @__PURE__ */ a(
|
|
827
847
|
"main",
|
|
828
848
|
{
|
|
@@ -837,7 +857,7 @@ function he({ className: t, ...e }) {
|
|
|
837
857
|
}
|
|
838
858
|
);
|
|
839
859
|
}
|
|
840
|
-
function
|
|
860
|
+
function xe({ className: t, ...e }) {
|
|
841
861
|
return /* @__PURE__ */ a(
|
|
842
862
|
"div",
|
|
843
863
|
{
|
|
@@ -848,7 +868,7 @@ function be({ className: t, ...e }) {
|
|
|
848
868
|
}
|
|
849
869
|
);
|
|
850
870
|
}
|
|
851
|
-
function
|
|
871
|
+
function ye({ className: t, ...e }) {
|
|
852
872
|
return /* @__PURE__ */ a(
|
|
853
873
|
"div",
|
|
854
874
|
{
|
|
@@ -862,7 +882,7 @@ function fe({ className: t, ...e }) {
|
|
|
862
882
|
}
|
|
863
883
|
);
|
|
864
884
|
}
|
|
865
|
-
function
|
|
885
|
+
function Ne({ className: t, ...e }) {
|
|
866
886
|
return /* @__PURE__ */ a(
|
|
867
887
|
"div",
|
|
868
888
|
{
|
|
@@ -873,7 +893,7 @@ function ge({ className: t, ...e }) {
|
|
|
873
893
|
}
|
|
874
894
|
);
|
|
875
895
|
}
|
|
876
|
-
function
|
|
896
|
+
function Ce({ className: t, ...e }) {
|
|
877
897
|
return /* @__PURE__ */ a(
|
|
878
898
|
"ul",
|
|
879
899
|
{
|
|
@@ -884,7 +904,7 @@ function pe({ className: t, ...e }) {
|
|
|
884
904
|
}
|
|
885
905
|
);
|
|
886
906
|
}
|
|
887
|
-
function
|
|
907
|
+
function Se({ className: t, ...e }) {
|
|
888
908
|
return /* @__PURE__ */ a(
|
|
889
909
|
"li",
|
|
890
910
|
{
|
|
@@ -895,7 +915,7 @@ function ve({ className: t, ...e }) {
|
|
|
895
915
|
}
|
|
896
916
|
);
|
|
897
917
|
}
|
|
898
|
-
const
|
|
918
|
+
const Te = it(
|
|
899
919
|
"astw:peer/menu-button astw:flex astw:w-full astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:p-2 astw:text-left astw:text-sm astw:outline-hidden astw:ring-sidebar-ring astw:transition-[width,height,padding] astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:focus-visible:ring-2 astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:group-has-data-[sidebar=menu-action]/menu-item:pr-8 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:font-medium astw:data-[active=true]:text-sidebar-accent-foreground astw:data-[state=open]:hover:bg-sidebar-accent astw:data-[state=open]:hover:text-sidebar-accent-foreground astw:group-data-[collapsible=icon]:size-8! astw:group-data-[collapsible=icon]:p-2! astw:[&>span:last-child]:truncate astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
|
|
900
920
|
{
|
|
901
921
|
variants: {
|
|
@@ -915,7 +935,7 @@ const xe = rt(
|
|
|
915
935
|
}
|
|
916
936
|
}
|
|
917
937
|
);
|
|
918
|
-
function
|
|
938
|
+
function J({
|
|
919
939
|
asChild: t = !1,
|
|
920
940
|
isActive: e = !1,
|
|
921
941
|
variant: s = "default",
|
|
@@ -924,23 +944,23 @@ function X({
|
|
|
924
944
|
className: o,
|
|
925
945
|
...l
|
|
926
946
|
}) {
|
|
927
|
-
const d = t ?
|
|
947
|
+
const d = t ? D : "button", { isMobile: i, state: w } = _(), h = /* @__PURE__ */ a(
|
|
928
948
|
d,
|
|
929
949
|
{
|
|
930
950
|
"data-slot": "sidebar-menu-button",
|
|
931
951
|
"data-sidebar": "menu-button",
|
|
932
952
|
"data-size": r,
|
|
933
953
|
"data-active": e,
|
|
934
|
-
className: u(
|
|
954
|
+
className: u(Te({ variant: s, size: r }), o),
|
|
935
955
|
...l
|
|
936
956
|
}
|
|
937
957
|
);
|
|
938
958
|
return n ? (typeof n == "string" && (n = {
|
|
939
959
|
children: n
|
|
940
|
-
}), /* @__PURE__ */ c(
|
|
941
|
-
/* @__PURE__ */ a(
|
|
960
|
+
}), /* @__PURE__ */ c(le, { children: [
|
|
961
|
+
/* @__PURE__ */ a(de, { asChild: !0, children: h }),
|
|
942
962
|
/* @__PURE__ */ a(
|
|
943
|
-
|
|
963
|
+
ce,
|
|
944
964
|
{
|
|
945
965
|
side: "right",
|
|
946
966
|
align: "center",
|
|
@@ -948,16 +968,16 @@ function X({
|
|
|
948
968
|
...n
|
|
949
969
|
}
|
|
950
970
|
)
|
|
951
|
-
] })) :
|
|
971
|
+
] })) : h;
|
|
952
972
|
}
|
|
953
|
-
function
|
|
973
|
+
function Z({
|
|
954
974
|
className: t,
|
|
955
975
|
asChild: e = !1,
|
|
956
976
|
showOnHover: s = !1,
|
|
957
977
|
...r
|
|
958
978
|
}) {
|
|
959
979
|
return /* @__PURE__ */ a(
|
|
960
|
-
e ?
|
|
980
|
+
e ? D : "button",
|
|
961
981
|
{
|
|
962
982
|
"data-slot": "sidebar-menu-action",
|
|
963
983
|
"data-sidebar": "menu-action",
|
|
@@ -976,7 +996,7 @@ function Y({
|
|
|
976
996
|
}
|
|
977
997
|
);
|
|
978
998
|
}
|
|
979
|
-
function
|
|
999
|
+
function ke({ className: t, ...e }) {
|
|
980
1000
|
return /* @__PURE__ */ a(
|
|
981
1001
|
"ul",
|
|
982
1002
|
{
|
|
@@ -991,7 +1011,7 @@ function ye({ className: t, ...e }) {
|
|
|
991
1011
|
}
|
|
992
1012
|
);
|
|
993
1013
|
}
|
|
994
|
-
function
|
|
1014
|
+
function Re({
|
|
995
1015
|
className: t,
|
|
996
1016
|
...e
|
|
997
1017
|
}) {
|
|
@@ -1005,7 +1025,7 @@ function Te({
|
|
|
1005
1025
|
}
|
|
1006
1026
|
);
|
|
1007
1027
|
}
|
|
1008
|
-
function
|
|
1028
|
+
function Ee({
|
|
1009
1029
|
asChild: t = !1,
|
|
1010
1030
|
size: e = "md",
|
|
1011
1031
|
isActive: s = !1,
|
|
@@ -1013,7 +1033,7 @@ function Ne({
|
|
|
1013
1033
|
...n
|
|
1014
1034
|
}) {
|
|
1015
1035
|
return /* @__PURE__ */ a(
|
|
1016
|
-
t ?
|
|
1036
|
+
t ? D : "a",
|
|
1017
1037
|
{
|
|
1018
1038
|
"data-slot": "sidebar-menu-sub-button",
|
|
1019
1039
|
"data-sidebar": "menu-sub-button",
|
|
@@ -1031,17 +1051,17 @@ function Ne({
|
|
|
1031
1051
|
}
|
|
1032
1052
|
);
|
|
1033
1053
|
}
|
|
1034
|
-
function
|
|
1054
|
+
function K({ to: t, children: e, ...s }) {
|
|
1035
1055
|
try {
|
|
1036
|
-
return
|
|
1056
|
+
return Et(t), /* @__PURE__ */ a(Bt, { to: t, ...s, children: e });
|
|
1037
1057
|
} catch {
|
|
1038
1058
|
return /* @__PURE__ */ a("a", { href: t, ...s, children: e });
|
|
1039
1059
|
}
|
|
1040
1060
|
}
|
|
1041
|
-
function
|
|
1061
|
+
function tt({ ...t }) {
|
|
1042
1062
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
|
|
1043
1063
|
}
|
|
1044
|
-
function
|
|
1064
|
+
function et({ className: t, ...e }) {
|
|
1045
1065
|
return /* @__PURE__ */ a(
|
|
1046
1066
|
"ol",
|
|
1047
1067
|
{
|
|
@@ -1054,7 +1074,7 @@ function Z({ className: t, ...e }) {
|
|
|
1054
1074
|
}
|
|
1055
1075
|
);
|
|
1056
1076
|
}
|
|
1057
|
-
function
|
|
1077
|
+
function at({ className: t, ...e }) {
|
|
1058
1078
|
return /* @__PURE__ */ a(
|
|
1059
1079
|
"li",
|
|
1060
1080
|
{
|
|
@@ -1064,14 +1084,14 @@ function tt({ className: t, ...e }) {
|
|
|
1064
1084
|
}
|
|
1065
1085
|
);
|
|
1066
1086
|
}
|
|
1067
|
-
function
|
|
1087
|
+
function st({
|
|
1068
1088
|
asChild: t,
|
|
1069
1089
|
className: e,
|
|
1070
1090
|
children: s,
|
|
1071
1091
|
...r
|
|
1072
1092
|
}) {
|
|
1073
1093
|
return /* @__PURE__ */ a(
|
|
1074
|
-
t ?
|
|
1094
|
+
t ? D : K,
|
|
1075
1095
|
{
|
|
1076
1096
|
"data-slot": "breadcrumb-link",
|
|
1077
1097
|
className: u("astw:hover:text-foreground astw:transition-colors", e),
|
|
@@ -1080,7 +1100,7 @@ function et({
|
|
|
1080
1100
|
}
|
|
1081
1101
|
);
|
|
1082
1102
|
}
|
|
1083
|
-
function
|
|
1103
|
+
function Be({
|
|
1084
1104
|
children: t,
|
|
1085
1105
|
className: e,
|
|
1086
1106
|
...s
|
|
@@ -1093,12 +1113,39 @@ function Ce({
|
|
|
1093
1113
|
"aria-hidden": "true",
|
|
1094
1114
|
className: u("astw:[&>svg]:size-3.5", e),
|
|
1095
1115
|
...s,
|
|
1096
|
-
children: t ?? /* @__PURE__ */ a(
|
|
1116
|
+
children: t ?? /* @__PURE__ */ a(z, {})
|
|
1097
1117
|
}
|
|
1098
1118
|
);
|
|
1099
1119
|
}
|
|
1100
|
-
|
|
1101
|
-
const s =
|
|
1120
|
+
function Ae(t, e) {
|
|
1121
|
+
const s = Q(e), r = [], n = (o, l) => {
|
|
1122
|
+
if (o.path.startsWith(":")) return;
|
|
1123
|
+
const d = `${l}/${o.path}`;
|
|
1124
|
+
r.push({
|
|
1125
|
+
path: d,
|
|
1126
|
+
title: s(o.meta.title, o.path),
|
|
1127
|
+
icon: o.meta.icon
|
|
1128
|
+
}), o.subResources && o.subResources.forEach((i) => n(i, d));
|
|
1129
|
+
};
|
|
1130
|
+
return t.forEach((o) => {
|
|
1131
|
+
o.path.startsWith(":") || (o.meta.menuItemClickable && r.push({
|
|
1132
|
+
path: o.path,
|
|
1133
|
+
title: s(o.meta.title, o.path),
|
|
1134
|
+
icon: o.meta.icon
|
|
1135
|
+
}), o.resources.forEach(
|
|
1136
|
+
(l) => n(l, o.path)
|
|
1137
|
+
));
|
|
1138
|
+
}), r;
|
|
1139
|
+
}
|
|
1140
|
+
function Pe(t, e) {
|
|
1141
|
+
if (!e.trim()) return t;
|
|
1142
|
+
const s = e.toLowerCase();
|
|
1143
|
+
return t.filter(
|
|
1144
|
+
(r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
const Le = (t, e) => {
|
|
1148
|
+
const s = Q(e);
|
|
1102
1149
|
return t.reduce(
|
|
1103
1150
|
(r, n) => {
|
|
1104
1151
|
const o = s(n.meta.title, n.path);
|
|
@@ -1108,16 +1155,16 @@ const Se = (t, e) => {
|
|
|
1108
1155
|
};
|
|
1109
1156
|
const l = (d, i) => {
|
|
1110
1157
|
!d || d.length === 0 || d.forEach((w) => {
|
|
1111
|
-
const
|
|
1158
|
+
const h = `${i}/${w.path}`, f = s(
|
|
1112
1159
|
w.meta.title,
|
|
1113
1160
|
w.path
|
|
1114
1161
|
);
|
|
1115
|
-
r[
|
|
1116
|
-
title:
|
|
1162
|
+
r[h] = {
|
|
1163
|
+
title: f,
|
|
1117
1164
|
breadcrumbTitle: w.meta.breadcrumbTitle
|
|
1118
1165
|
}, w.subResources && w.subResources.length > 0 && l(
|
|
1119
1166
|
w.subResources,
|
|
1120
|
-
|
|
1167
|
+
h
|
|
1121
1168
|
);
|
|
1122
1169
|
});
|
|
1123
1170
|
};
|
|
@@ -1126,24 +1173,24 @@ const Se = (t, e) => {
|
|
|
1126
1173
|
{}
|
|
1127
1174
|
);
|
|
1128
1175
|
};
|
|
1129
|
-
function
|
|
1130
|
-
const n = t.split("/").filter((i) => i !== ""), o = e && n[0] === e ? n.slice(1) : n, l =
|
|
1131
|
-
const
|
|
1132
|
-
let
|
|
1133
|
-
if (!
|
|
1134
|
-
const
|
|
1135
|
-
([
|
|
1136
|
-
const
|
|
1137
|
-
return new RegExp(`^${
|
|
1176
|
+
function De(t, e, s, r) {
|
|
1177
|
+
const n = t.split("/").filter((i) => i !== ""), o = e && n[0] === e ? n.slice(1) : n, l = Le(s, r), d = o.map((i, w) => {
|
|
1178
|
+
const h = o.slice(0, w + 1).join("/");
|
|
1179
|
+
let f = l[h];
|
|
1180
|
+
if (!f) {
|
|
1181
|
+
const m = Object.entries(l).find(
|
|
1182
|
+
([g]) => {
|
|
1183
|
+
const x = g.split("/").map((p) => p.startsWith(":") ? "[^/]+" : p).join("/");
|
|
1184
|
+
return new RegExp(`^${x}$`).test(h);
|
|
1138
1185
|
}
|
|
1139
1186
|
)?.[1];
|
|
1140
|
-
|
|
1187
|
+
m && (f = m);
|
|
1141
1188
|
}
|
|
1142
|
-
let
|
|
1143
|
-
return
|
|
1189
|
+
let b;
|
|
1190
|
+
return f ? typeof f.breadcrumbTitle == "function" ? b = f.breadcrumbTitle(i) : typeof f.breadcrumbTitle == "string" ? b = f.breadcrumbTitle : b = f.title : b = decodeURIComponent(i), {
|
|
1144
1191
|
segment: i,
|
|
1145
|
-
path:
|
|
1146
|
-
title:
|
|
1192
|
+
path: h,
|
|
1193
|
+
title: b
|
|
1147
1194
|
};
|
|
1148
1195
|
});
|
|
1149
1196
|
return {
|
|
@@ -1151,45 +1198,45 @@ function ke(t, e, s, r) {
|
|
|
1151
1198
|
segments: d
|
|
1152
1199
|
};
|
|
1153
1200
|
}
|
|
1154
|
-
const
|
|
1201
|
+
const Ie = () => {
|
|
1155
1202
|
const { open: t } = _();
|
|
1156
|
-
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(
|
|
1157
|
-
},
|
|
1158
|
-
const e = t.children ? t.children({ Outlet:
|
|
1203
|
+
return /* @__PURE__ */ a("div", { className: t ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(ht, { className: "astw:-ml-2.5" }) });
|
|
1204
|
+
}, ia = (t) => {
|
|
1205
|
+
const e = t.children ? t.children({ Outlet: X }) : null, s = Xt(), r = () => {
|
|
1159
1206
|
s.setTheme(s.theme === "dark" ? "light" : "dark");
|
|
1160
1207
|
};
|
|
1161
|
-
return /* @__PURE__ */ a(
|
|
1162
|
-
t.sidebar ?? /* @__PURE__ */ a(
|
|
1163
|
-
/* @__PURE__ */ c(
|
|
1208
|
+
return /* @__PURE__ */ a(be, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
|
|
1209
|
+
t.sidebar ?? /* @__PURE__ */ a(_e, {}),
|
|
1210
|
+
/* @__PURE__ */ c(ve, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
|
|
1164
1211
|
/* @__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__ */ c("div", { className: "astw:flex astw:w-full astw:items-center astw:justify-between", children: [
|
|
1165
1212
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
|
|
1166
|
-
/* @__PURE__ */ a(
|
|
1167
|
-
/* @__PURE__ */ a(
|
|
1213
|
+
/* @__PURE__ */ a(Ie, {}),
|
|
1214
|
+
/* @__PURE__ */ a(ze, {})
|
|
1168
1215
|
] }),
|
|
1169
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(
|
|
1216
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(L, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(pt, {}) }) })
|
|
1170
1217
|
] }) }),
|
|
1171
|
-
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(
|
|
1218
|
+
/* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4", children: e ?? /* @__PURE__ */ a(X, {}) })
|
|
1172
1219
|
] })
|
|
1173
1220
|
] }) });
|
|
1174
|
-
},
|
|
1175
|
-
const { title: e, icon: s, navItems: r } =
|
|
1221
|
+
}, _e = (t) => {
|
|
1222
|
+
const { title: e, icon: s, navItems: r } = S(), { pathname: n } = ot(), o = R(), l = /* @__PURE__ */ c(xe, { children: [
|
|
1176
1223
|
s,
|
|
1177
1224
|
/* @__PURE__ */ a("h1", { className: "astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", children: e })
|
|
1178
1225
|
] });
|
|
1179
|
-
return /* @__PURE__ */ c(
|
|
1226
|
+
return /* @__PURE__ */ c(pe, { variant: "inset", children: [
|
|
1180
1227
|
/* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
|
|
1181
1228
|
t.header ?? l,
|
|
1182
|
-
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(
|
|
1229
|
+
/* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(ht, { className: "astw:-ml-1" }) })
|
|
1183
1230
|
] }),
|
|
1184
|
-
/* @__PURE__ */ a(
|
|
1185
|
-
|
|
1231
|
+
/* @__PURE__ */ a(ye, { children: /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ a(Ce, { children: r.map((i) => /* @__PURE__ */ a(
|
|
1232
|
+
Yt,
|
|
1186
1233
|
{
|
|
1187
1234
|
asChild: !0,
|
|
1188
1235
|
defaultOpen: i.isActive,
|
|
1189
|
-
children: /* @__PURE__ */ c(
|
|
1190
|
-
i.url ? /* @__PURE__ */ c(
|
|
1191
|
-
/* @__PURE__ */ a(
|
|
1192
|
-
|
|
1236
|
+
children: /* @__PURE__ */ c(Se, { children: [
|
|
1237
|
+
i.url ? /* @__PURE__ */ c(B, { children: [
|
|
1238
|
+
/* @__PURE__ */ a(J, { asChild: !0, tooltip: i.title, children: /* @__PURE__ */ c(
|
|
1239
|
+
K,
|
|
1193
1240
|
{
|
|
1194
1241
|
to: i.url,
|
|
1195
1242
|
className: i.url === n ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1199,29 +1246,29 @@ const Be = () => {
|
|
|
1199
1246
|
]
|
|
1200
1247
|
}
|
|
1201
1248
|
) }),
|
|
1202
|
-
!!i.items?.length && /* @__PURE__ */ a(
|
|
1203
|
-
/* @__PURE__ */ a(
|
|
1249
|
+
!!i.items?.length && /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ c(Z, { className: "astw:data-[state=open]:rotate-90", children: [
|
|
1250
|
+
/* @__PURE__ */ a(z, {}),
|
|
1204
1251
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: o("toggle") })
|
|
1205
1252
|
] }) })
|
|
1206
|
-
] }) : /* @__PURE__ */ a(
|
|
1207
|
-
/* @__PURE__ */ a(
|
|
1253
|
+
] }) : /* @__PURE__ */ a(B, { children: /* @__PURE__ */ c(Y, { className: "astw:flex astw:w-[100%] astw:[&[data-state=open]_.astw-rotate-target]:rotate-90", children: [
|
|
1254
|
+
/* @__PURE__ */ a(J, { asChild: !0, tooltip: i.title, children: /* @__PURE__ */ c("span", { className: "astw:flex astw:w-[100%]", children: [
|
|
1208
1255
|
i.icon,
|
|
1209
1256
|
/* @__PURE__ */ a("span", { children: i.title })
|
|
1210
1257
|
] }) }),
|
|
1211
1258
|
!!i.items?.length && /* @__PURE__ */ a(
|
|
1212
|
-
|
|
1259
|
+
Z,
|
|
1213
1260
|
{
|
|
1214
1261
|
className: "astw-rotate-target",
|
|
1215
1262
|
asChild: !0,
|
|
1216
1263
|
children: /* @__PURE__ */ c("span", { children: [
|
|
1217
|
-
/* @__PURE__ */ a(
|
|
1264
|
+
/* @__PURE__ */ a(z, {}),
|
|
1218
1265
|
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: o("toggle") })
|
|
1219
1266
|
] })
|
|
1220
1267
|
}
|
|
1221
1268
|
)
|
|
1222
1269
|
] }) }),
|
|
1223
|
-
!!i.items?.length && /* @__PURE__ */ a(
|
|
1224
|
-
|
|
1270
|
+
!!i.items?.length && /* @__PURE__ */ a(Jt, { children: /* @__PURE__ */ a(ke, { children: i.items?.map((w) => /* @__PURE__ */ a(Re, { children: /* @__PURE__ */ a(Ee, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1271
|
+
K,
|
|
1225
1272
|
{
|
|
1226
1273
|
to: w.url,
|
|
1227
1274
|
className: w.url === n ? "astw:bg-sidebar-accent astw:font-medium" : void 0,
|
|
@@ -1234,42 +1281,244 @@ const Be = () => {
|
|
|
1234
1281
|
)) }) }) }),
|
|
1235
1282
|
t.footer ?? null
|
|
1236
1283
|
] });
|
|
1237
|
-
},
|
|
1238
|
-
const { configurations: t } =
|
|
1239
|
-
return
|
|
1284
|
+
}, Me = () => {
|
|
1285
|
+
const { configurations: t } = S(), e = ot();
|
|
1286
|
+
return De(
|
|
1240
1287
|
e.pathname,
|
|
1241
1288
|
t.basePath,
|
|
1242
1289
|
t.modules,
|
|
1243
1290
|
t.locale
|
|
1244
1291
|
);
|
|
1245
|
-
},
|
|
1246
|
-
const { segments: t } =
|
|
1247
|
-
return e ? /* @__PURE__ */ a(
|
|
1292
|
+
}, ze = () => {
|
|
1293
|
+
const { segments: t } = Me(), e = At("/:prefix/settings/:suffix"), s = R();
|
|
1294
|
+
return e ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(et, { children: t.map((r, n) => /* @__PURE__ */ c(
|
|
1248
1295
|
"div",
|
|
1249
1296
|
{
|
|
1250
1297
|
className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
|
|
1251
1298
|
children: [
|
|
1252
|
-
/* @__PURE__ */ a(
|
|
1253
|
-
n < t.length - 1 && /* @__PURE__ */ a(
|
|
1299
|
+
/* @__PURE__ */ a(at, { children: /* @__PURE__ */ a(st, { to: r.path, children: r.title }) }),
|
|
1300
|
+
n < t.length - 1 && /* @__PURE__ */ a(Be, {})
|
|
1254
1301
|
]
|
|
1255
1302
|
},
|
|
1256
1303
|
n
|
|
1257
1304
|
)) }) });
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1305
|
+
};
|
|
1306
|
+
function Oe({
|
|
1307
|
+
...t
|
|
1308
|
+
}) {
|
|
1309
|
+
return /* @__PURE__ */ a(v.Root, { "data-slot": "dialog", ...t });
|
|
1310
|
+
}
|
|
1311
|
+
function $e({
|
|
1312
|
+
...t
|
|
1313
|
+
}) {
|
|
1314
|
+
return /* @__PURE__ */ a(v.Portal, { "data-slot": "dialog-portal", ...t });
|
|
1315
|
+
}
|
|
1316
|
+
function Ke({
|
|
1317
|
+
className: t,
|
|
1318
|
+
...e
|
|
1319
|
+
}) {
|
|
1320
|
+
return /* @__PURE__ */ a(
|
|
1321
|
+
v.Overlay,
|
|
1322
|
+
{
|
|
1323
|
+
"data-slot": "dialog-overlay",
|
|
1324
|
+
className: u(
|
|
1325
|
+
"astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=open]:fade-in-0 astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
|
|
1326
|
+
t
|
|
1327
|
+
),
|
|
1328
|
+
...e
|
|
1329
|
+
}
|
|
1330
|
+
);
|
|
1331
|
+
}
|
|
1332
|
+
function je({
|
|
1333
|
+
className: t,
|
|
1334
|
+
children: e,
|
|
1335
|
+
...s
|
|
1336
|
+
}) {
|
|
1337
|
+
return /* @__PURE__ */ c($e, { "data-slot": "dialog-portal", children: [
|
|
1338
|
+
/* @__PURE__ */ a(Ke, {}),
|
|
1339
|
+
/* @__PURE__ */ c(
|
|
1340
|
+
v.Content,
|
|
1341
|
+
{
|
|
1342
|
+
"data-slot": "dialog-content",
|
|
1343
|
+
className: u(
|
|
1344
|
+
"astw:bg-background astw:data-[state=open]:animate-in astw:data-[state=closed]:animate-out astw:data-[state=closed]:fade-out-0 astw:data-[state=open]:fade-in-0 astw:data-[state=closed]:zoom-out-95 astw:data-[state=open]:zoom-in-95 astw:fixed astw:top-[50%] astw:left-[50%] astw:z-50 astw:grid astw:w-full astw:max-w-[calc(100%-2rem)] astw:translate-x-[-50%] astw:translate-y-[-50%] astw:gap-4 astw:rounded-lg astw:border astw:p-6 astw:shadow-lg astw:duration-200 astw:sm:max-w-lg",
|
|
1345
|
+
t
|
|
1346
|
+
),
|
|
1347
|
+
...s,
|
|
1348
|
+
children: [
|
|
1349
|
+
e,
|
|
1350
|
+
/* @__PURE__ */ c(v.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-[state=open]:bg-accent astw:data-[state=open]:text-muted-foreground astw:absolute astw:top-4 astw:right-4 astw:rounded-xs astw:opacity-70 astw:transition-opacity astw:hover:opacity-100 astw:focus:ring-2 astw:focus:ring-offset-2 astw:focus:outline-hidden astw:disabled:pointer-events-none astw:[&_svg]:pointer-events-none astw:[&_svg]:shrink-0 astw:[&_svg:not([class*='size-'])]:size-4", children: [
|
|
1351
|
+
/* @__PURE__ */ a(rt, {}),
|
|
1352
|
+
/* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
|
|
1353
|
+
] })
|
|
1354
|
+
]
|
|
1355
|
+
}
|
|
1356
|
+
)
|
|
1357
|
+
] });
|
|
1358
|
+
}
|
|
1359
|
+
function Ue({
|
|
1360
|
+
className: t,
|
|
1361
|
+
...e
|
|
1362
|
+
}) {
|
|
1363
|
+
return /* @__PURE__ */ a(
|
|
1364
|
+
v.Title,
|
|
1365
|
+
{
|
|
1366
|
+
"data-slot": "dialog-title",
|
|
1367
|
+
className: u("astw:text-lg astw:leading-none astw:font-semibold", t),
|
|
1368
|
+
...e
|
|
1369
|
+
}
|
|
1370
|
+
);
|
|
1371
|
+
}
|
|
1372
|
+
function We({
|
|
1373
|
+
modules: t,
|
|
1374
|
+
locale: e,
|
|
1375
|
+
onNavigate: s
|
|
1376
|
+
}) {
|
|
1377
|
+
const [r, n] = T(!1), [o, l] = T(""), [d, i] = T(0), w = A(
|
|
1378
|
+
() => Ae(t, e),
|
|
1379
|
+
[t, e]
|
|
1380
|
+
), h = A(
|
|
1381
|
+
() => Pe(w, o),
|
|
1382
|
+
[w, o]
|
|
1383
|
+
);
|
|
1384
|
+
C(() => {
|
|
1385
|
+
i(0);
|
|
1386
|
+
}, [h]), C(() => {
|
|
1387
|
+
r || (l(""), i(0));
|
|
1388
|
+
}, [r]);
|
|
1389
|
+
const f = O(
|
|
1390
|
+
(m) => {
|
|
1391
|
+
s(m.path), n(!1), l("");
|
|
1392
|
+
},
|
|
1393
|
+
[s]
|
|
1394
|
+
), b = O(
|
|
1395
|
+
(m, g) => {
|
|
1396
|
+
if (!g)
|
|
1397
|
+
switch (m) {
|
|
1398
|
+
case "ArrowDown":
|
|
1399
|
+
i(
|
|
1400
|
+
(x) => x < h.length - 1 ? x + 1 : x
|
|
1401
|
+
);
|
|
1402
|
+
break;
|
|
1403
|
+
case "ArrowUp":
|
|
1404
|
+
i((x) => x > 0 ? x - 1 : x);
|
|
1405
|
+
break;
|
|
1406
|
+
case "Enter":
|
|
1407
|
+
h[d] && f(h[d]);
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
[h, d, f]
|
|
1412
|
+
);
|
|
1413
|
+
return {
|
|
1414
|
+
open: r,
|
|
1415
|
+
setOpen: n,
|
|
1416
|
+
search: o,
|
|
1417
|
+
setSearch: l,
|
|
1418
|
+
selectedIndex: d,
|
|
1419
|
+
filteredRoutes: h,
|
|
1420
|
+
handleSelect: f,
|
|
1421
|
+
handleKeyDown: b
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
function la() {
|
|
1425
|
+
const t = xt(null), { configurations: e } = S(), s = Pt(), r = R(), {
|
|
1426
|
+
open: n,
|
|
1427
|
+
setOpen: o,
|
|
1428
|
+
search: l,
|
|
1429
|
+
setSearch: d,
|
|
1430
|
+
selectedIndex: i,
|
|
1431
|
+
filteredRoutes: w,
|
|
1432
|
+
handleSelect: h,
|
|
1433
|
+
handleKeyDown: f
|
|
1434
|
+
} = We({
|
|
1435
|
+
modules: e.modules,
|
|
1436
|
+
locale: e.locale,
|
|
1437
|
+
onNavigate: s
|
|
1438
|
+
});
|
|
1439
|
+
C(() => {
|
|
1440
|
+
t.current && t.current.querySelector(
|
|
1441
|
+
`[data-index="${i}"]`
|
|
1442
|
+
)?.scrollIntoView({ block: "nearest" });
|
|
1443
|
+
}, [i]);
|
|
1444
|
+
const b = O(
|
|
1445
|
+
(m) => {
|
|
1446
|
+
["ArrowDown", "ArrowUp", "Enter"].includes(m.key) && m.preventDefault(), f(m.key, m.nativeEvent.isComposing);
|
|
1447
|
+
},
|
|
1448
|
+
[f]
|
|
1449
|
+
);
|
|
1450
|
+
return C(() => {
|
|
1451
|
+
const m = (g) => {
|
|
1452
|
+
(g.metaKey || g.ctrlKey) && g.key === "k" && (g.preventDefault(), o(!n));
|
|
1453
|
+
};
|
|
1454
|
+
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
1455
|
+
}, [n, o]), /* @__PURE__ */ a(Oe, { open: n, onOpenChange: o, children: /* @__PURE__ */ c(
|
|
1456
|
+
je,
|
|
1457
|
+
{
|
|
1458
|
+
className: "astw:p-0 astw:gap-0 astw:max-w-lg astw:overflow-hidden",
|
|
1459
|
+
onKeyDown: b,
|
|
1460
|
+
"aria-describedby": void 0,
|
|
1461
|
+
children: [
|
|
1462
|
+
/* @__PURE__ */ a(Ue, { className: "astw:sr-only", children: r("commandPaletteSearch") }),
|
|
1463
|
+
/* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3", children: [
|
|
1464
|
+
/* @__PURE__ */ a(vt, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
|
|
1465
|
+
/* @__PURE__ */ a(
|
|
1466
|
+
te,
|
|
1467
|
+
{
|
|
1468
|
+
value: l,
|
|
1469
|
+
onChange: (m) => d(m.target.value),
|
|
1470
|
+
placeholder: r("commandPaletteSearch"),
|
|
1471
|
+
className: "astw:flex astw:h-11 astw:w-full astw:rounded-md astw:bg-transparent astw:py-3 astw:text-sm astw:outline-none astw:border-0 astw:shadow-none astw:focus-visible:ring-0 astw:placeholder:text-muted-foreground astw:disabled:cursor-not-allowed astw:disabled:opacity-50",
|
|
1472
|
+
autoFocus: !0
|
|
1473
|
+
}
|
|
1474
|
+
)
|
|
1475
|
+
] }),
|
|
1476
|
+
/* @__PURE__ */ a(
|
|
1477
|
+
"div",
|
|
1478
|
+
{
|
|
1479
|
+
ref: t,
|
|
1480
|
+
className: "astw:max-h-[300px] astw:overflow-y-auto astw:overflow-x-hidden",
|
|
1481
|
+
children: w.length === 0 ? /* @__PURE__ */ a("div", { className: "astw:py-6 astw:text-center astw:text-sm astw:text-muted-foreground", children: r("commandPaletteNoResults") }) : /* @__PURE__ */ a("div", { className: "astw:p-1", children: w.map((m, g) => /* @__PURE__ */ c(
|
|
1482
|
+
"button",
|
|
1483
|
+
{
|
|
1484
|
+
"data-index": g,
|
|
1485
|
+
onClick: () => h(m),
|
|
1486
|
+
className: u(
|
|
1487
|
+
"astw:relative astw:flex astw:w-full astw:cursor-pointer astw:select-none astw:items-center astw:gap-2 astw:rounded-sm astw:px-2 astw:py-1.5 astw:text-sm astw:outline-none",
|
|
1488
|
+
g === i ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
|
|
1489
|
+
),
|
|
1490
|
+
children: [
|
|
1491
|
+
m.icon && /* @__PURE__ */ a("span", { className: "astw:flex astw:h-4 astw:w-4 astw:items-center astw:justify-center astw:shrink-0 astw:[&_svg]:h-4 astw:[&_svg]:w-4", children: m.icon }),
|
|
1492
|
+
/* @__PURE__ */ a("span", { className: "astw:flex-1 astw:text-left astw:truncate", children: m.title }),
|
|
1493
|
+
/* @__PURE__ */ c("span", { className: "astw:text-xs astw:text-muted-foreground astw:truncate astw:max-w-[200px]", children: [
|
|
1494
|
+
"/",
|
|
1495
|
+
m.path
|
|
1496
|
+
] })
|
|
1497
|
+
]
|
|
1498
|
+
},
|
|
1499
|
+
m.path
|
|
1500
|
+
)) })
|
|
1501
|
+
}
|
|
1502
|
+
)
|
|
1503
|
+
]
|
|
1504
|
+
}
|
|
1505
|
+
) });
|
|
1506
|
+
}
|
|
1507
|
+
const ft = j(null), da = (t) => {
|
|
1508
|
+
const e = A(
|
|
1260
1509
|
() => Mt({
|
|
1261
1510
|
clientId: t.clientId,
|
|
1262
1511
|
appUri: t.apiEndpoint,
|
|
1263
1512
|
redirectUri: t.redirectUri,
|
|
1264
|
-
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery :
|
|
1513
|
+
meQuery: t.meQuery && (typeof t.meQuery == "string" ? t.meQuery : _t(t.meQuery))
|
|
1265
1514
|
}),
|
|
1266
1515
|
[t.clientId, t.apiEndpoint, t.redirectUri, t.meQuery]
|
|
1267
|
-
), [s, r] =
|
|
1516
|
+
), [s, r] = T(
|
|
1268
1517
|
() => e.getState()
|
|
1269
1518
|
);
|
|
1270
|
-
|
|
1519
|
+
C(() => {
|
|
1271
1520
|
t.autoLogin && (s.isLoading || s.isAuthenticated || (async () => await e.login())());
|
|
1272
|
-
}, [s.isLoading, s.isAuthenticated, t.autoLogin]),
|
|
1521
|
+
}, [s.isLoading, s.isAuthenticated, t.autoLogin]), C(
|
|
1273
1522
|
() => e.addEventListener((o) => {
|
|
1274
1523
|
o.type === "auth_state_changed" && r(o.data);
|
|
1275
1524
|
}),
|
|
@@ -1277,7 +1526,7 @@ const Be = () => {
|
|
|
1277
1526
|
);
|
|
1278
1527
|
const n = t.guardComponent && (s.isLoading || !s.isAuthenticated) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
|
|
1279
1528
|
return /* @__PURE__ */ a(
|
|
1280
|
-
|
|
1529
|
+
ft.Provider,
|
|
1281
1530
|
{
|
|
1282
1531
|
value: {
|
|
1283
1532
|
authState: s,
|
|
@@ -1289,28 +1538,29 @@ const Be = () => {
|
|
|
1289
1538
|
children: n
|
|
1290
1539
|
}
|
|
1291
1540
|
);
|
|
1292
|
-
},
|
|
1293
|
-
const t =
|
|
1541
|
+
}, ca = () => {
|
|
1542
|
+
const t = U(ft);
|
|
1294
1543
|
if (!t)
|
|
1295
1544
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
1296
1545
|
return t;
|
|
1297
1546
|
};
|
|
1298
1547
|
export {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1548
|
+
oa as AppShell,
|
|
1549
|
+
da as AuthProvider,
|
|
1550
|
+
la as CommandPalette,
|
|
1551
|
+
_e as DefaultSidebar,
|
|
1552
|
+
ma as Link,
|
|
1553
|
+
ia as SidebarLayout,
|
|
1554
|
+
Kt as defineI18nLabels,
|
|
1555
|
+
ra as defineModule,
|
|
1556
|
+
na as defineResource,
|
|
1557
|
+
sa as redirectToResource,
|
|
1558
|
+
S as useAppShell,
|
|
1559
|
+
ca as useAuth,
|
|
1560
|
+
ha as useLocation,
|
|
1561
|
+
fa as useNavigate,
|
|
1562
|
+
ga as useParams,
|
|
1563
|
+
ba as useRouteError,
|
|
1564
|
+
pa as useSearchParams,
|
|
1565
|
+
Xt as useTheme
|
|
1316
1566
|
};
|