@tailor-platform/app-shell 0.29.0 → 0.30.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 CHANGED
@@ -1,24 +1,25 @@
1
- import { jsx as a, jsxs as c, Fragment as S } from "react/jsx-runtime";
2
- import { capitalCase as E } from "change-case";
3
- import { useRouteError as me, isRouteErrorResponse as he, redirect as pe, Outlet as ot, NavLink as fe, Navigate as ge, useRouteLoaderData as be, createMemoryRouter as ve, createBrowserRouter as xe, RouterProvider as ye, useLocation as X, Link as $, Await as $t, useMatch as Ne, useNavigate as Se } from "react-router";
4
- import { Link as mn, useLocation as hn, useNavigate as pn, useParams as fn, useRouteError as gn, useSearchParams as bn } from "react-router";
5
- import { cva as it } from "class-variance-authority";
6
- import { useRender as j } from "@base-ui/react/use-render";
7
- import { clsx as Ce } from "clsx";
8
- import { twMerge as Te } from "tailwind-merge";
9
- import { AlertCircle as St, Table as ke, XIcon as Wt, PanelLeftIcon as Re, ExternalLink as Ft, ChevronRight as W, SunIcon as Pe, SearchIcon as Ae, Check as Be, Copy as De } from "lucide-react";
10
- import * as g from "react";
11
- import { createContext as Z, useContext as I, useState as V, useMemo as M, useEffect as F, useSyncExternalStore as Ot, Suspense as lt, useRef as jt, useCallback as D } from "react";
12
- import { Toaster as Me, toast as Ee } from "sonner";
13
- import { parsePath as Ie } from "@tailor-platform/app-shell-vite-plugin/parser";
14
- import { Dialog as x } from "@base-ui/react/dialog";
15
- import { Tooltip as A } from "@base-ui/react/tooltip";
16
- import { Collapsible as ct } from "@base-ui/react/collapsible";
17
- import { createAuthClient as Le } from "@tailor-platform/auth-public-client";
18
- function m(...t) {
19
- return Te(Ce(t));
20
- }
21
- const _e = it(
1
+ import { jsx as a, jsxs as c, Fragment as T } from "react/jsx-runtime";
2
+ import { capitalCase as _ } from "change-case";
3
+ import { useRouteError as ze, isRouteErrorResponse as Fe, redirect as Oe, Outlet as lt, NavLink as We, Navigate as je, useRouteLoaderData as He, createMemoryRouter as Ue, createBrowserRouter as Ke, RouterProvider as Ve, useLocation as tt, Link as H, Await as Mt, useMatch as Ge, useNavigate as Ye } from "react-router";
4
+ import { Link as Er, useLocation as Ir, useNavigate as Lr, useParams as $r, useRouteError as _r, useSearchParams as zr } from "react-router";
5
+ import { cva as ct } from "class-variance-authority";
6
+ import { useRender as G } from "@base-ui/react/use-render";
7
+ import { clsx as Xe } from "clsx";
8
+ import { twMerge as qe } from "tailwind-merge";
9
+ import { AlertCircle as xt, Table as Qe, XIcon as At, PanelLeftIcon as Ze, ExternalLink as Bt, ChevronRight as U, SunIcon as Je, SearchIcon as ta, Check as ea, Copy as aa } from "lucide-react";
10
+ import * as b from "react";
11
+ import { createContext as et, useContext as z, useState as q, useMemo as $, useEffect as K, useSyncExternalStore as Et, Suspense as dt, useRef as It, useCallback as L } from "react";
12
+ import { Toaster as sa, toast as ra } from "sonner";
13
+ import { parsePath as na } from "@tailor-platform/app-shell-vite-plugin/parser";
14
+ import { Drawer as S } from "@base-ui/react/drawer";
15
+ import { Tooltip as E } from "@base-ui/react/tooltip";
16
+ import { Collapsible as R } from "@base-ui/react/collapsible";
17
+ import { Dialog as P } from "@base-ui/react/dialog";
18
+ import { createAuthClient as oa } from "@tailor-platform/auth-public-client";
19
+ function w(...t) {
20
+ return qe(Xe(t));
21
+ }
22
+ const ia = ct(
22
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",
23
24
  {
24
25
  variants: {
@@ -43,48 +44,41 @@ const _e = it(
43
44
  }
44
45
  }
45
46
  );
46
- function O({
47
- className: t,
48
- variant: e,
49
- size: s,
50
- render: n,
51
- children: r,
52
- ...o
53
- }) {
54
- return j({
47
+ function V({ className: t, variant: e, size: s, render: r, children: n, ...o }) {
48
+ return G({
55
49
  defaultTagName: "button",
56
- render: n,
50
+ render: r,
57
51
  props: {
58
52
  "data-slot": "button",
59
- className: m(_e({ variant: e, size: s, className: t })),
60
- children: r,
53
+ className: w(ia({ variant: e, size: s, className: t })),
54
+ children: n,
61
55
  ...o
62
56
  }
63
57
  });
64
58
  }
65
- const G = "en", ze = () => {
59
+ const Q = "en", la = () => {
66
60
  try {
67
61
  if (typeof navigator > "u")
68
- return G;
62
+ return Q;
69
63
  const t = navigator.languages?.[0] ?? navigator.language;
70
- return t ? new Intl.Locale(t).language : G;
64
+ return t ? new Intl.Locale(t).language : Q;
71
65
  } catch {
72
- return G;
66
+ return Q;
73
67
  }
74
- }, U = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Ut = (t) => {
75
- const e = U(t);
76
- return (s, n) => e(s, typeof s == "string" ? s : E(n));
77
- }, $e = (t) => ({
68
+ }, Y = (t) => (e, s) => e ? typeof e == "string" ? e : e(t) ?? s : s, Lt = (t) => {
69
+ const e = Y(t);
70
+ return (s, r) => e(s, typeof s == "string" ? s : _(r));
71
+ }, ca = (t) => ({
78
72
  modules: t.modules,
79
73
  settingsResources: t.settingsResources ?? [],
80
- errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(z, {}),
74
+ errorBoundary: t.errorBoundary ?? /* @__PURE__ */ a(W, {}),
81
75
  basePath: t.basePath,
82
- locale: t.locale ?? ze()
83
- }), dt = Z({
76
+ locale: t.locale ?? la()
77
+ }), wt = et({
84
78
  configurations: {
85
79
  modules: [],
86
80
  settingsResources: [],
87
- locale: G,
81
+ locale: Q,
88
82
  // Using null! to avoid circular dependency issues.
89
83
  // DefaultErrorBoundary imports useT from i18n-labels, which imports
90
84
  // defineI18nLabels from hooks/i18n, which imports useAppShellConfig
@@ -93,19 +87,19 @@ const G = "en", ze = () => {
93
87
  // always provides the context via AppShellConfigContext.Provider.
94
88
  errorBoundary: null
95
89
  }
96
- }), ut = Z({
90
+ }), ut = et({
97
91
  contextData: {}
98
- }), C = () => I(dt), Hs = () => I(ut), Ht = () => {
99
- const t = I(dt), e = I(ut);
92
+ }), D = () => z(wt), dr = () => z(ut), $t = () => {
93
+ const t = z(wt), e = z(ut);
100
94
  return {
101
95
  ...t,
102
96
  ...e
103
97
  };
104
- }, We = () => {
105
- const { configurations: t } = C(), e = U(t.locale);
106
- return (s, n) => e(s, n);
107
- }, Fe = (t) => {
108
- const e = (s) => (n) => t[s]?.[n] ?? t.en[n];
98
+ }, da = () => {
99
+ const { configurations: t } = D(), e = Y(t.locale);
100
+ return (s, r) => e(s, r);
101
+ }, wa = (t) => {
102
+ const e = (s) => (r) => t[s]?.[r] ?? t.en[r];
109
103
  return {
110
104
  /**
111
105
  * Hook to get the translated label resolver function.
@@ -127,14 +121,14 @@ const G = "en", ze = () => {
127
121
  * ```
128
122
  */
129
123
  useT: () => {
130
- const { configurations: s } = C(), n = e(s.locale), r = ((o, ...i) => {
131
- const l = n(o);
124
+ const { configurations: s } = D(), r = e(s.locale), n = ((o, ...i) => {
125
+ const l = r(o);
132
126
  return typeof l == "function" ? l(i[0]) : l;
133
127
  });
134
- return r.dynamic = (o, i) => {
128
+ return n.dynamic = (o, i) => {
135
129
  const l = t[s.locale]?.[o] ?? t.en[o];
136
130
  return l === void 0 || typeof l == "function" ? i : l;
137
- }, r;
131
+ }, n;
138
132
  },
139
133
  /**
140
134
  * A function to get the translater for a specific label key.
@@ -158,12 +152,12 @@ const G = "en", ze = () => {
158
152
  * });
159
153
  * ```
160
154
  */
161
- t: (s, ...n) => (r) => {
162
- const o = e(r)(s);
163
- return typeof o == "function" ? o(n[0]) : o;
155
+ t: (s, ...r) => (n) => {
156
+ const o = e(n)(s);
157
+ return typeof o == "function" ? o(r[0]) : o;
164
158
  }
165
159
  };
166
- }, Oe = Fe({
160
+ }, ua = wa({
167
161
  en: {
168
162
  error404Title: "404 Not Found",
169
163
  error404Body: "The page you requested could not be found.",
@@ -202,19 +196,19 @@ const G = "en", ze = () => {
202
196
  commandPaletteSearch: "ページを検索...",
203
197
  commandPaletteNoResults: "結果が見つかりません"
204
198
  }
205
- }), B = Oe.useT, z = () => {
206
- const t = me(), e = B(), s = {
199
+ }), I = ua.useT, W = () => {
200
+ const t = ze(), e = I(), s = {
207
201
  role: "alert",
208
202
  "aria-label": "default-error-boundary"
209
203
  };
210
- if (he(t) && t.status === 404)
204
+ if (Fe(t) && t.status === 404)
211
205
  return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
212
- /* @__PURE__ */ a(St, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
206
+ /* @__PURE__ */ a(xt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
213
207
  /* @__PURE__ */ c("div", { children: [
214
208
  /* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("error404Title") }),
215
209
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: e("error404Body") }),
216
210
  /* @__PURE__ */ a(
217
- O,
211
+ V,
218
212
  {
219
213
  variant: "outline",
220
214
  size: "sm",
@@ -225,14 +219,14 @@ const G = "en", ze = () => {
225
219
  )
226
220
  ] })
227
221
  ] }) });
228
- const n = t instanceof Error ? t.message : e("errorUnexpected");
222
+ const r = t instanceof Error ? t.message : e("errorUnexpected");
229
223
  return /* @__PURE__ */ a("div", { ...s, className: "astw:p-6", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-4", children: [
230
- /* @__PURE__ */ a(St, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
224
+ /* @__PURE__ */ a(xt, { className: "astw:h-5 astw:w-5 astw:text-destructive astw:flex-shrink-0 astw:mt-0.5" }),
231
225
  /* @__PURE__ */ c("div", { children: [
232
226
  /* @__PURE__ */ a("h1", { className: "astw:font-semibold astw:text-lg", children: e("errorTitle") }),
233
- /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: n }),
227
+ /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground astw:mt-1", children: r }),
234
228
  /* @__PURE__ */ a(
235
- O,
229
+ V,
236
230
  {
237
231
  variant: "outline",
238
232
  size: "sm",
@@ -244,61 +238,61 @@ const G = "en", ze = () => {
244
238
  ] })
245
239
  ] }) });
246
240
  };
247
- let Kt = {};
248
- const je = (t) => {
249
- Kt = t;
250
- }, Ks = () => ({ type: "pass" }), Vs = () => ({ type: "hidden" }), Gs = (t) => ({
241
+ let _t = {};
242
+ const ma = (t) => {
243
+ _t = t;
244
+ }, wr = () => ({ type: "pass" }), ur = () => ({ type: "hidden" }), mr = (t) => ({
251
245
  type: "redirect",
252
246
  to: t
253
- }), q = () => new Response("Not Found", { status: 404 }), wt = async (t) => {
247
+ }), Z = () => new Response("Not Found", { status: 404 }), mt = async (t) => {
254
248
  if (!t || t.length === 0) return { type: "pass" };
255
249
  const e = {
256
- context: Kt
250
+ context: _t
257
251
  };
258
252
  for (const s of t) {
259
- const n = await s(e);
260
- if (n.type !== "pass")
261
- return n;
253
+ const r = await s(e);
254
+ if (r.type !== "pass")
255
+ return r;
262
256
  }
263
257
  return { type: "pass" };
264
- }, Vt = (t, e) => async (s) => {
265
- const n = await wt(t);
266
- switch (n.type) {
258
+ }, zt = (t, e) => async (s) => {
259
+ const r = await mt(t);
260
+ switch (r.type) {
267
261
  case "hidden":
268
- throw q();
262
+ throw Z();
269
263
  case "redirect":
270
- return pe(n.to);
264
+ return Oe(r.to);
271
265
  case "pass":
272
266
  return e ? e(s) : null;
273
267
  }
274
- }, Gt = (t, e) => () => {
275
- const { configurations: s } = C(), { metaTitle: n, fallbackTitle: r } = t, i = U(s.locale)(n, r);
268
+ }, Ft = (t, e) => () => {
269
+ const { configurations: s } = D(), { metaTitle: r, fallbackTitle: n } = t, i = Y(s.locale)(r, n);
276
270
  return e(i);
277
271
  };
278
- function qs(t) {
279
- const { path: e, meta: s, component: n, resources: r, errorBoundary: o, guards: i } = t, l = s?.title ?? E(e), u = E(e), d = i && i.length > 0 ? Vt(i) : void 0, w = n ? Gt({ metaTitle: l, fallbackTitle: u }, (h) => n({ title: h, resources: r })) : void 0;
272
+ function hr(t) {
273
+ const { path: e, meta: s, component: r, resources: n, errorBoundary: o, guards: i } = t, l = s?.title ?? _(e), u = _(e), d = i && i.length > 0 ? zt(i) : void 0, m = r ? Ft({ metaTitle: l, fallbackTitle: u }, (h) => r({ title: h, resources: n })) : void 0;
280
274
  return {
281
275
  path: e,
282
276
  type: "component",
283
277
  _type: "module",
284
- component: w,
278
+ component: m,
285
279
  loader: d,
286
280
  meta: {
287
281
  title: l,
288
282
  ...s?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: s.breadcrumbTitle } : {},
289
283
  ...s,
290
- menuItemClickable: n !== void 0,
284
+ menuItemClickable: r !== void 0,
291
285
  icon: t.meta?.icon
292
286
  },
293
- resources: r,
294
- errorBoundary: o || /* @__PURE__ */ a(z, {}),
287
+ resources: n,
288
+ errorBoundary: o || /* @__PURE__ */ a(W, {}),
295
289
  guards: i
296
290
  };
297
291
  }
298
- function Ys(t) {
299
- const { path: e, component: s, subResources: n, meta: r, errorBoundary: o, guards: i } = t, l = r?.title ?? E(e), u = E(e), d = i && i.length > 0 ? Vt(i) : void 0, w = s ? Gt(
292
+ function fr(t) {
293
+ const { path: e, component: s, subResources: r, meta: n, errorBoundary: o, guards: i } = t, l = n?.title ?? _(e), u = _(e), d = i && i.length > 0 ? zt(i) : void 0, m = s ? Ft(
300
294
  { metaTitle: l, fallbackTitle: u },
301
- (h) => s({ title: h, resources: n })
295
+ (h) => s({ title: h, resources: r })
302
296
  ) : void 0;
303
297
  return {
304
298
  _type: "resource",
@@ -306,45 +300,45 @@ function Ys(t) {
306
300
  path: e,
307
301
  meta: {
308
302
  title: l,
309
- icon: r?.icon,
310
- ...r?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: r.breadcrumbTitle } : {}
303
+ icon: n?.icon,
304
+ ...n?.breadcrumbTitle !== void 0 ? { breadcrumbTitle: n.breadcrumbTitle } : {}
311
305
  },
312
- component: w,
313
- subResources: n,
314
- errorBoundary: o ?? /* @__PURE__ */ a(z, {}),
306
+ component: m,
307
+ subResources: r,
308
+ errorBoundary: o ?? /* @__PURE__ */ a(W, {}),
315
309
  guards: i,
316
310
  loader: d
317
311
  };
318
312
  }
319
- const Ue = () => {
320
- const t = B();
321
- return /* @__PURE__ */ c(S, { children: [
313
+ const ha = () => {
314
+ const t = I();
315
+ return /* @__PURE__ */ c(T, { children: [
322
316
  /* @__PURE__ */ a("p", { className: "astw:font-semibold astw:leading-none astw:tracking-tight", children: t("welcomeTitle") }),
323
317
  /* @__PURE__ */ a("p", { className: "pt-4", children: t("welcomeBody") })
324
318
  ] });
325
- }, Ct = () => /* @__PURE__ */ c(S, { children: [
326
- /* @__PURE__ */ a(ot, {}),
327
- /* @__PURE__ */ a(Me, {})
328
- ] }), He = () => {
329
- const { configurations: t } = Ht(), e = B(), s = We();
319
+ }, yt = () => /* @__PURE__ */ c(T, { children: [
320
+ /* @__PURE__ */ a(lt, {}),
321
+ /* @__PURE__ */ a(sa, {})
322
+ ] }), fa = () => {
323
+ const { configurations: t } = $t(), e = I(), s = da();
330
324
  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: [
331
325
  /* @__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: [
332
326
  /* @__PURE__ */ a("h2", { className: "astw:text-sm astw:leading-[36px] astw:mb-2 astw:font-bold ", children: e("settings") }),
333
- /* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((n) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(fe, { to: `./${n.path}`, children: ({ isActive: r }) => /* @__PURE__ */ c(
334
- O,
327
+ /* @__PURE__ */ a("ul", { className: "astw:flex astw:flex-col astw:gap-1", children: t.settingsResources.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(We, { to: `./${r.path}`, children: ({ isActive: n }) => /* @__PURE__ */ c(
328
+ V,
335
329
  {
336
- variant: r ? "secondary" : "ghost",
330
+ variant: n ? "secondary" : "ghost",
337
331
  className: "astw:w-full astw:justify-start",
338
332
  children: [
339
- n.meta.icon,
340
- s(n.meta.title, n.path)
333
+ r.meta.icon,
334
+ s(r.meta.title, r.path)
341
335
  ]
342
336
  }
343
- ) }) }, n.path)) })
337
+ ) }) }, r.path)) })
344
338
  ] }) }),
345
- /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(ot, {}) })
339
+ /* @__PURE__ */ a("section", { className: "astw:bg-card astw:flex-1 astw:rounded-md astw:border astw:shadow-xs", children: /* @__PURE__ */ a(lt, {}) })
346
340
  ] });
347
- }, mt = (t) => () => /* @__PURE__ */ a(S, { children: t }), Ke = (t) => t.component ? {
341
+ }, ht = (t) => () => /* @__PURE__ */ a(T, { children: t }), pa = (t) => t.component ? {
348
342
  index: !0,
349
343
  Component: t.component,
350
344
  ...t.loader && { loader: t.loader }
@@ -357,42 +351,42 @@ const Ue = () => {
357
351
  loader: async (e) => {
358
352
  const s = await t.loader(e);
359
353
  if (s instanceof Response) return s;
360
- throw q();
354
+ throw Z();
361
355
  }
362
356
  } : {
363
357
  index: !0,
364
358
  Component: () => null,
365
359
  loader: () => {
366
- throw q();
360
+ throw Z();
367
361
  }
368
- }, qt = (t, e, s) => {
369
- const n = t.errorBoundary || s, r = (e ?? []).map(
370
- (l) => qt(l, l.subResources, n)
371
- ), i = [Ke(t), ...r];
362
+ }, Ot = (t, e, s) => {
363
+ const r = t.errorBoundary || s, n = (e ?? []).map(
364
+ (l) => Ot(l, l.subResources, r)
365
+ ), i = [pa(t), ...n];
372
366
  return {
373
367
  path: t.path,
374
368
  ...t.errorBoundary && {
375
- ErrorBoundary: mt(t.errorBoundary)
369
+ ErrorBoundary: ht(t.errorBoundary)
376
370
  },
377
371
  ...i.length > 0 ? { children: i } : {}
378
372
  };
379
- }, Ve = (t) => t.map((e) => qt(e, e.resources, e.errorBoundary)), Ge = ({
373
+ }, ga = (t) => t.map((e) => Ot(e, e.resources, e.errorBoundary)), ba = ({
380
374
  modules: t,
381
375
  settingsResources: e,
382
376
  rootComponent: s
383
377
  }) => {
384
- const n = {
378
+ const r = {
385
379
  index: !0,
386
- Component: s ?? Ue
387
- }, r = e.length > 0 ? [
380
+ Component: s ?? ha
381
+ }, n = e.length > 0 ? [
388
382
  {
389
383
  path: "settings",
390
384
  index: !0,
391
- Component: () => /* @__PURE__ */ a(ge, { to: e[0].path, relative: "path", replace: !0 })
385
+ Component: () => /* @__PURE__ */ a(je, { to: e[0].path, relative: "path", replace: !0 })
392
386
  },
393
387
  {
394
388
  path: "settings",
395
- Component: He,
389
+ Component: fa,
396
390
  children: e.map((o) => {
397
391
  if (!o.component)
398
392
  throw new Error(`Settings resource "${o.path}" must have a component.`);
@@ -400,130 +394,130 @@ const Ue = () => {
400
394
  path: o.path,
401
395
  Component: o.component,
402
396
  ...o.errorBoundary && {
403
- ErrorBoundary: mt(o.errorBoundary)
397
+ ErrorBoundary: ht(o.errorBoundary)
404
398
  }
405
399
  };
406
400
  })
407
401
  }
408
402
  ] : [];
409
403
  return [
410
- n,
404
+ r,
411
405
  {
412
- children: Ve(t)
406
+ children: ga(t)
413
407
  },
414
- ...r,
408
+ ...n,
415
409
  {
416
410
  path: "*",
417
411
  loader: () => {
418
- throw q();
412
+ throw Z();
419
413
  },
420
414
  // Component is required to suppress React Router's warning about empty leaf routes,
421
415
  // even though the loader always throws and this component will never render.
422
416
  Component: () => null,
423
- ErrorBoundary: z
417
+ ErrorBoundary: W
424
418
  }
425
419
  ];
426
- }, Yt = "appshell-root-nav", qe = (t) => ({
427
- loaderID: Yt,
428
- loader: async () => ({ navItems: Ye(t) })
429
- }), Qt = () => be(Yt)?.navItems, Ye = async (t) => {
430
- const e = Ut(t.locale);
420
+ }, Wt = "appshell-root-nav", va = (t) => ({
421
+ loaderID: Wt,
422
+ loader: async () => ({ navItems: xa(t) })
423
+ }), jt = () => He(Wt)?.navItems, xa = async (t) => {
424
+ const e = Lt(t.locale);
431
425
  return (await Promise.all(
432
- t.modules.map(async (n) => {
433
- if (n.path.startsWith(":") || (await wt(n.guards)).type !== "pass") return null;
434
- const o = await Xt(
435
- n.resources,
436
- n.path,
426
+ t.modules.map(async (r) => {
427
+ if (r.path.startsWith(":") || (await mt(r.guards)).type !== "pass") return null;
428
+ const o = await Ht(
429
+ r.resources,
430
+ r.path,
437
431
  e
438
432
  );
439
- return o.length === 0 ? null : { module: n, resources: o };
433
+ return o.length === 0 ? null : { module: r, resources: o };
440
434
  })
441
- )).filter((n) => n !== null).map(({ module: n, resources: r }) => ({
442
- title: e(n.meta.title, n.path),
443
- url: n.meta.menuItemClickable ? n.path : void 0,
444
- icon: n.meta.icon || /* @__PURE__ */ a(ke, {}),
445
- items: r
435
+ )).filter((r) => r !== null).map(({ module: r, resources: n }) => ({
436
+ title: e(r.meta.title, r.path),
437
+ url: r.meta.menuItemClickable ? r.path : void 0,
438
+ icon: r.meta.icon || /* @__PURE__ */ a(Qe, {}),
439
+ items: n
446
440
  }));
447
- }, Xt = async (t, e, s) => (await Promise.all(
448
- t.map(async (r) => {
449
- if (r.path.startsWith(":") || (await wt(r.guards)).type !== "pass") return null;
450
- const i = `${e}/${r.path}`, l = s(r.meta.title, r.path), u = r.component !== void 0, d = r.subResources ? await Xt(r.subResources, i, s) : void 0, w = d && d.length > 0;
451
- return !u && !w ? null : {
441
+ }, Ht = async (t, e, s) => (await Promise.all(
442
+ t.map(async (n) => {
443
+ if (n.path.startsWith(":") || (await mt(n.guards)).type !== "pass") return null;
444
+ const i = `${e}/${n.path}`, l = s(n.meta.title, n.path), u = n.component !== void 0, d = n.subResources ? await Ht(n.subResources, i, s) : void 0, m = d && d.length > 0;
445
+ return !u && !m ? null : {
452
446
  title: l,
453
447
  url: u ? i : void 0,
454
- items: w ? d : void 0
448
+ items: m ? d : void 0
455
449
  };
456
450
  })
457
- )).filter((r) => r !== null), Qe = (t) => {
458
- const { configurations: e } = C(), { rootComponent: s, children: n } = t, r = Ge({
451
+ )).filter((n) => n !== null), ya = (t) => {
452
+ const { configurations: e } = D(), { rootComponent: s, children: r } = t, n = ba({
459
453
  modules: e.modules,
460
454
  settingsResources: e.settingsResources,
461
455
  rootComponent: s
462
- }), o = e.errorBoundary, { loaderID: i, loader: l } = qe({
456
+ }), o = e.errorBoundary, { loaderID: i, loader: l } = va({
463
457
  modules: e.modules,
464
458
  locale: e.locale
465
459
  }), u = [
466
460
  {
467
461
  id: i,
468
462
  loader: l,
469
- element: n,
463
+ element: r,
470
464
  children: o ? [
471
465
  {
472
- element: /* @__PURE__ */ a(ot, {}),
473
- ErrorBoundary: mt(o),
474
- children: r
466
+ element: /* @__PURE__ */ a(lt, {}),
467
+ ErrorBoundary: ht(o),
468
+ children: n
475
469
  }
476
- ] : r,
470
+ ] : n,
477
471
  /*
478
472
  * Hydration fallback is unused in CSR-only usage of AppShell.
479
473
  * return null to silence hydration warnings.
480
474
  */
481
475
  HydrateFallback: () => null
482
476
  }
483
- ], d = e.basePath ? "/" + e.basePath : void 0, w = t.memory ? ve(u, {
477
+ ], d = e.basePath ? "/" + e.basePath : void 0, m = t.memory ? Ue(u, {
484
478
  basename: d,
485
479
  ...t.initialEntries ? { initialEntries: t.initialEntries } : {}
486
- }) : xe(u, {
480
+ }) : Ke(u, {
487
481
  basename: d
488
482
  });
489
- return /* @__PURE__ */ a(ye, { router: w });
490
- }, Xe = {
483
+ return /* @__PURE__ */ a(Ve, { router: m });
484
+ }, Na = {
491
485
  resolvedTheme: "light",
492
486
  theme: "system",
493
487
  setTheme: () => null
494
- }, Zt = Z(Xe);
495
- function Ze({
488
+ }, Ut = et(Na);
489
+ function Sa({
496
490
  children: t,
497
491
  storageKey: e,
498
492
  defaultTheme: s = "system",
499
- ...n
493
+ ...r
500
494
  }) {
501
- const [r, o] = V(
495
+ const [n, o] = q(
502
496
  () => localStorage.getItem(e) || s
503
- ), i = M(() => r !== "system" ? r : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [r]);
504
- F(() => {
497
+ ), i = $(() => n !== "system" ? n : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", [n]);
498
+ K(() => {
505
499
  const u = window.document.documentElement;
506
500
  u.classList.remove("light", "dark"), u.classList.add(i);
507
501
  }, [i]);
508
502
  const l = {
509
503
  resolvedTheme: i,
510
- theme: r,
504
+ theme: n,
511
505
  setTheme: (u) => {
512
506
  localStorage.setItem(e, u), o(u);
513
507
  }
514
508
  };
515
- return /* @__PURE__ */ a(Zt.Provider, { ...n, value: l, children: t });
509
+ return /* @__PURE__ */ a(Ut.Provider, { ...r, value: l, children: t });
516
510
  }
517
- const Je = () => {
518
- const t = I(Zt);
511
+ const Ca = () => {
512
+ const t = z(Ut);
519
513
  if (t === void 0) throw new Error("useTheme must be used within a ThemeProvider");
520
514
  return t;
521
- }, ta = () => () => {
522
- }, ea = () => !0, aa = () => !1;
523
- function sa() {
524
- return Ot(ta, ea, aa);
515
+ }, Ta = () => () => {
516
+ }, ka = () => !0, Ra = () => !1;
517
+ function Pa() {
518
+ return Et(Ta, ka, Ra);
525
519
  }
526
- function na(t) {
520
+ function Da(t) {
527
521
  const e = {
528
522
  path: "",
529
523
  fullPath: "",
@@ -531,151 +525,151 @@ function na(t) {
531
525
  children: /* @__PURE__ */ new Map()
532
526
  };
533
527
  for (const s of t) {
534
- const n = Ie(s.path);
535
- let r = e, o = "";
536
- for (const i of n)
537
- i.type !== "group" && (o = o ? `${o}/${i.converted}` : i.converted, r.children.has(i.converted) || r.children.set(i.converted, {
528
+ const r = na(s.path);
529
+ let n = e, o = "";
530
+ for (const i of r)
531
+ i.type !== "group" && (o = o ? `${o}/${i.converted}` : i.converted, n.children.has(i.converted) || n.children.set(i.converted, {
538
532
  path: i.converted,
539
533
  fullPath: o,
540
534
  guards: [],
541
535
  children: /* @__PURE__ */ new Map()
542
- }), r = r.children.get(i.converted));
543
- r.component = s.component, r.guards = s.component.appShellPageProps?.guards ?? [];
536
+ }), n = n.children.get(i.converted));
537
+ n.component = s.component, n.guards = s.component.appShellPageProps?.guards ?? [];
544
538
  }
545
539
  return e;
546
540
  }
547
- function Jt(t, e) {
548
- return t?.appShellPageProps?.meta?.title ?? E(e || "home");
541
+ function Kt(t, e) {
542
+ return t?.appShellPageProps?.meta?.title ?? _(e || "home");
549
543
  }
550
- function te(t) {
551
- const e = t.component, s = Jt(e, t.path), n = e?.appShellPageProps?.meta?.icon, r = e?.appShellPageProps?.loader, o = [];
544
+ function Vt(t) {
545
+ const e = t.component, s = Kt(e, t.path), r = e?.appShellPageProps?.meta?.icon, n = e?.appShellPageProps?.loader, o = [];
552
546
  for (const i of t.children.values())
553
- o.push(te(i));
547
+ o.push(Vt(i));
554
548
  return {
555
549
  _type: "resource",
556
550
  type: "component",
557
551
  path: t.path,
558
552
  meta: {
559
553
  title: s,
560
- icon: n
554
+ icon: r
561
555
  },
562
556
  component: e ? () => /* @__PURE__ */ a(e, {}) : void 0,
563
557
  subResources: o.length > 0 ? o : void 0,
564
- errorBoundary: /* @__PURE__ */ a(z, {}),
558
+ errorBoundary: /* @__PURE__ */ a(W, {}),
565
559
  guards: t.guards,
566
- loader: r
560
+ loader: n
567
561
  };
568
562
  }
569
- function Tt(t) {
570
- const e = t.component, s = Jt(e, t.path), n = e?.appShellPageProps?.meta?.icon, r = e?.appShellPageProps?.loader, o = [];
563
+ function Nt(t) {
564
+ const e = t.component, s = Kt(e, t.path), r = e?.appShellPageProps?.meta?.icon, n = e?.appShellPageProps?.loader, o = [];
571
565
  for (const i of t.children.values())
572
- o.push(te(i));
566
+ o.push(Vt(i));
573
567
  return {
574
568
  _type: "module",
575
569
  type: "component",
576
570
  path: t.path,
577
571
  meta: {
578
572
  title: s,
579
- icon: n,
573
+ icon: r,
580
574
  menuItemClickable: e !== void 0
581
575
  },
582
576
  component: e ? () => /* @__PURE__ */ a(e, {}) : void 0,
583
577
  resources: o,
584
- errorBoundary: /* @__PURE__ */ a(z, {}),
578
+ errorBoundary: /* @__PURE__ */ a(W, {}),
585
579
  guards: t.guards,
586
- loader: r
580
+ loader: n
587
581
  };
588
582
  }
589
- function ra(t) {
583
+ function Ma(t) {
590
584
  if (t.length === 0)
591
585
  return [];
592
- const e = na(t), s = [];
586
+ const e = Da(t), s = [];
593
587
  if (e.component) {
594
- const n = Tt({
588
+ const r = Nt({
595
589
  ...e,
596
590
  path: "",
597
591
  children: /* @__PURE__ */ new Map()
598
592
  // Root module doesn't include children as resources
599
593
  });
600
- s.push(n);
594
+ s.push(r);
601
595
  }
602
- for (const n of e.children.values())
603
- s.push(Tt(n));
596
+ for (const r of e.children.values())
597
+ s.push(Nt(r));
604
598
  return s;
605
599
  }
606
- const ee = (t) => {
607
- const e = sa(), s = t.contextData ?? {};
608
- je(s);
609
- const n = t.modules, r = M(
610
- () => n ? $e({
611
- modules: n,
600
+ const Gt = (t) => {
601
+ const e = Pa(), s = t.contextData ?? {};
602
+ ma(s);
603
+ const r = t.modules, n = $(
604
+ () => r ? ca({
605
+ modules: r,
612
606
  settingsResources: t.settingsResources,
613
607
  basePath: t.basePath,
614
608
  errorBoundary: t.errorBoundary,
615
609
  locale: t.locale
616
610
  }) : null,
617
- [n, t.settingsResources, t.basePath, t.errorBoundary, t.locale]
618
- ), o = M(
619
- () => r ? { title: t.title, icon: t.icon, configurations: r } : null,
620
- [t.title, t.icon, r]
621
- ), i = M(
611
+ [r, t.settingsResources, t.basePath, t.errorBoundary, t.locale]
612
+ ), o = $(
613
+ () => n ? { title: t.title, icon: t.icon, configurations: n } : null,
614
+ [t.title, t.icon, n]
615
+ ), i = $(
622
616
  () => ({ contextData: t.contextData ?? {} }),
623
617
  [t.contextData]
624
618
  );
625
- if (!n || !o) {
619
+ if (!r || !o) {
626
620
  const l = "[AppShell] No routes configured. Either use the appShellRoutes() vite-plugin for automatic page configuration, or pass the 'modules' prop for manual configuration.";
627
621
  return console.error(l), /* @__PURE__ */ a("div", { className: "astw:flex astw:min-h-screen astw:items-center astw:justify-center astw:bg-background astw:p-4", children: /* @__PURE__ */ c("div", { className: "astw:max-w-md astw:rounded-lg astw:border astw:border-destructive/50 astw:bg-destructive/10 astw:p-6 astw:text-center", children: [
628
622
  /* @__PURE__ */ a("h1", { className: "astw:mb-2 astw:text-lg astw:font-semibold astw:text-destructive", children: "Configuration Error" }),
629
623
  /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: l })
630
624
  ] }) });
631
625
  }
632
- return e ? /* @__PURE__ */ a(dt.Provider, { value: o, children: /* @__PURE__ */ a(ut.Provider, { value: i, children: /* @__PURE__ */ a(Ze, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(Qe, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
626
+ return e ? /* @__PURE__ */ a(wt.Provider, { value: o, children: /* @__PURE__ */ a(ut.Provider, { value: i, children: /* @__PURE__ */ a(Sa, { defaultTheme: "system", storageKey: "appshell-ui-theme", children: /* @__PURE__ */ a(ya, { rootComponent: t.rootComponent, children: t.children }) }) }) }) : null;
633
627
  };
634
- function oa(t) {
635
- const e = ra(t), s = e.find((o) => o.path === ""), n = e.filter((o) => o.path !== "");
628
+ function Aa(t) {
629
+ const e = Ma(t), s = e.find((o) => o.path === ""), r = e.filter((o) => o.path !== "");
636
630
  return (o) => /* @__PURE__ */ a(
637
- ee,
631
+ Gt,
638
632
  {
639
633
  ...o,
640
- modules: n,
634
+ modules: r,
641
635
  rootComponent: o.rootComponent ?? s?.component
642
636
  }
643
637
  );
644
638
  }
645
- ee.WithPages = oa;
646
- const tt = 768;
647
- function ia() {
648
- const [t, e] = g.useState(void 0);
649
- return g.useEffect(() => {
650
- const s = window.matchMedia(`(max-width: ${tt - 1}px)`), n = () => {
651
- e(window.innerWidth < tt);
639
+ Gt.WithPages = Aa;
640
+ const st = 768;
641
+ function Ba() {
642
+ const [t, e] = b.useState(void 0);
643
+ return b.useEffect(() => {
644
+ const s = window.matchMedia(`(max-width: ${st - 1}px)`), r = () => {
645
+ e(window.innerWidth < st);
652
646
  };
653
- return s.addEventListener("change", n), e(window.innerWidth < tt), () => s.removeEventListener("change", n);
647
+ return s.addEventListener("change", r), e(window.innerWidth < st), () => s.removeEventListener("change", r);
654
648
  }, []), !!t;
655
649
  }
656
- const et = 768, at = 1199;
657
- function la() {
658
- const [t, e] = g.useState(void 0);
659
- return g.useEffect(() => {
650
+ const rt = 768, nt = 1199;
651
+ function Ea() {
652
+ const [t, e] = b.useState(void 0);
653
+ return b.useEffect(() => {
660
654
  const s = window.matchMedia(
661
- `(min-width: ${et}px) and (max-width: ${at}px)`
662
- ), n = () => {
655
+ `(min-width: ${rt}px) and (max-width: ${nt}px)`
656
+ ), r = () => {
663
657
  e(
664
- window.innerWidth >= et && window.innerWidth <= at
658
+ window.innerWidth >= rt && window.innerWidth <= nt
665
659
  );
666
660
  };
667
- return s.addEventListener("change", n), e(
668
- window.innerWidth >= et && window.innerWidth <= at
669
- ), () => s.removeEventListener("change", n);
661
+ return s.addEventListener("change", r), e(
662
+ window.innerWidth >= rt && window.innerWidth <= nt
663
+ ), () => s.removeEventListener("change", r);
670
664
  }, []), !!t;
671
665
  }
672
- function ca({ className: t, type: e, ...s }) {
666
+ function Ia({ className: t, type: e, ...s }) {
673
667
  return /* @__PURE__ */ a(
674
668
  "input",
675
669
  {
676
670
  type: e,
677
671
  "data-slot": "input",
678
- className: m(
672
+ className: w(
679
673
  "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",
680
674
  "astw:focus-visible:border-ring astw:focus-visible:ring-ring/50 astw:focus-visible:ring-[3px]",
681
675
  "astw:aria-invalid:ring-destructive/20 astw:dark:aria-invalid:ring-destructive/40 astw:aria-invalid:border-destructive",
@@ -685,11 +679,11 @@ function ca({ className: t, type: e, ...s }) {
685
679
  }
686
680
  );
687
681
  }
688
- function da({
682
+ function La({
689
683
  className: t,
690
684
  orientation: e = "horizontal",
691
685
  decorative: s = !0,
692
- ...n
686
+ ...r
693
687
  }) {
694
688
  return /* @__PURE__ */ a(
695
689
  "div",
@@ -698,249 +692,302 @@ function da({
698
692
  role: s ? "none" : "separator",
699
693
  "aria-orientation": s ? void 0 : e,
700
694
  "data-orientation": e,
701
- className: m(
695
+ className: w(
702
696
  "astw:bg-border astw:shrink-0",
703
697
  e === "horizontal" ? "astw:h-px astw:w-full" : "astw:h-full astw:w-px",
704
698
  t
705
699
  ),
706
- ...n
700
+ ...r
707
701
  }
708
702
  );
709
703
  }
710
- function kt({ ...t }) {
711
- return /* @__PURE__ */ a(x.Root, { "data-slot": "sheet", ...t });
712
- }
713
- function ua({ ...t }) {
714
- return /* @__PURE__ */ a(x.Portal, { "data-slot": "sheet-portal", ...t });
715
- }
716
- function wa({ className: t, ...e }) {
704
+ const $a = {
705
+ top: "up",
706
+ right: "right",
707
+ bottom: "down",
708
+ left: "left"
709
+ }, Yt = b.createContext("right");
710
+ function Xt({ side: t = "right", ...e }) {
711
+ return /* @__PURE__ */ a(Yt.Provider, { value: t, children: /* @__PURE__ */ a(S.Root, { "data-slot": "sheet", swipeDirection: $a[t], ...e }) });
712
+ }
713
+ Xt.displayName = "Sheet.Root";
714
+ function qt({ ...t }) {
715
+ return /* @__PURE__ */ a(S.Trigger, { "data-slot": "sheet-trigger", ...t });
716
+ }
717
+ qt.displayName = "Sheet.Trigger";
718
+ function Qt({ ...t }) {
719
+ return /* @__PURE__ */ a(S.Close, { "data-slot": "sheet-close", ...t });
720
+ }
721
+ Qt.displayName = "Sheet.Close";
722
+ function Zt({ ...t }) {
723
+ return /* @__PURE__ */ a(S.Portal, { "data-slot": "sheet-portal", ...t });
724
+ }
725
+ Zt.displayName = "Sheet.Portal";
726
+ function Jt({ className: t, ...e }) {
717
727
  return /* @__PURE__ */ a(
718
- x.Backdrop,
728
+ S.Backdrop,
719
729
  {
720
730
  "data-slot": "sheet-overlay",
721
- className: m(
722
- "astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
731
+ className: w(
732
+ "astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
723
733
  t
724
734
  ),
725
735
  ...e
726
736
  }
727
737
  );
728
738
  }
729
- function Rt({
730
- className: t,
731
- children: e,
732
- side: s = "right",
733
- ...n
734
- }) {
735
- return /* @__PURE__ */ c(ua, { children: [
736
- /* @__PURE__ */ a(wa, {}),
737
- /* @__PURE__ */ c(
738
- x.Popup,
739
+ Jt.displayName = "Sheet.Overlay";
740
+ function te({ className: t, children: e, ...s }) {
741
+ const r = b.useContext(Yt);
742
+ return /* @__PURE__ */ c(Zt, { children: [
743
+ /* @__PURE__ */ a(Jt, {}),
744
+ /* @__PURE__ */ a(
745
+ S.Viewport,
739
746
  {
740
- "data-slot": "sheet-content",
741
- className: m(
742
- "astw:bg-background astw:data-open:animate-in astw:data-ending-style:animate-out astw:fixed astw:z-50 astw:flex astw:flex-col astw:gap-4 astw:shadow-lg astw:transition astw:ease-in-out astw:data-ending-style:duration-300 astw:data-open:duration-500",
743
- s === "right" && "astw:data-ending-style:slide-out-to-right astw:data-open:slide-in-from-right astw:inset-y-0 astw:right-0 astw:h-full astw:w-3/4 astw:border-l astw:sm:max-w-sm",
744
- s === "left" && "astw:data-ending-style:slide-out-to-left astw:data-open:slide-in-from-left astw:inset-y-0 astw:left-0 astw:h-full astw:w-3/4 astw:border-r astw:sm:max-w-sm",
745
- s === "top" && "astw:data-ending-style:slide-out-to-top astw:data-open:slide-in-from-top astw:inset-x-0 astw:top-0 astw:h-auto astw:border-b",
746
- s === "bottom" && "astw:data-ending-style:slide-out-to-bottom astw:data-open:slide-in-from-bottom astw:inset-x-0 astw:bottom-0 astw:h-auto astw:border-t",
747
- t
747
+ "data-slot": "sheet-viewport",
748
+ className: w(
749
+ "astw:fixed astw:inset-0 astw:z-50 astw:flex",
750
+ r === "right" && "astw:items-stretch astw:justify-end",
751
+ r === "left" && "astw:items-stretch astw:justify-start",
752
+ r === "top" && "astw:items-start astw:justify-stretch",
753
+ r === "bottom" && "astw:items-end astw:justify-stretch"
748
754
  ),
749
- ...n,
750
- children: [
751
- e,
752
- /* @__PURE__ */ c(x.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-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: [
753
- /* @__PURE__ */ a(Wt, { className: "astw:size-4" }),
754
- /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
755
- ] })
756
- ]
755
+ children: /* @__PURE__ */ c(
756
+ S.Popup,
757
+ {
758
+ "data-slot": "sheet-content",
759
+ className: w(
760
+ "astw:bg-background astw:flex astw:flex-col astw:gap-4 astw:shadow-lg astw:transition-transform astw:ease-[cubic-bezier(0.32,0.72,0,1)] astw:duration-[450ms]",
761
+ r === "right" && "astw:h-full astw:w-3/4 astw:border-l astw:sm:max-w-sm astw:[transform:translateX(var(--drawer-swipe-movement-x))] astw:data-ending-style:[transform:translateX(100%)] astw:data-starting-style:[transform:translateX(100%)]",
762
+ r === "left" && "astw:h-full astw:w-3/4 astw:border-r astw:sm:max-w-sm astw:[transform:translateX(var(--drawer-swipe-movement-x))] astw:data-ending-style:[transform:translateX(-100%)] astw:data-starting-style:[transform:translateX(-100%)]",
763
+ r === "top" && "astw:w-full astw:h-auto astw:border-b astw:[transform:translateY(var(--drawer-swipe-movement-y))] astw:data-ending-style:[transform:translateY(-100%)] astw:data-starting-style:[transform:translateY(-100%)]",
764
+ r === "bottom" && "astw:w-full astw:h-auto astw:border-t astw:[transform:translateY(var(--drawer-swipe-movement-y))] astw:data-ending-style:[transform:translateY(100%)] astw:data-starting-style:[transform:translateY(100%)]",
765
+ "astw:data-swiping:select-none",
766
+ t
767
+ ),
768
+ ...s,
769
+ children: [
770
+ /* @__PURE__ */ a(S.Content, { "data-slot": "sheet-inner-content", className: "astw:contents", children: e }),
771
+ /* @__PURE__ */ c(S.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-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: [
772
+ /* @__PURE__ */ a(At, { className: "astw:size-4" }),
773
+ /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
774
+ ] })
775
+ ]
776
+ }
777
+ )
757
778
  }
758
779
  )
759
780
  ] });
760
781
  }
761
- function Pt({ className: t, ...e }) {
782
+ te.displayName = "Sheet.Content";
783
+ function ee({ className: t, ...e }) {
762
784
  return /* @__PURE__ */ a(
763
785
  "div",
764
786
  {
765
787
  "data-slot": "sheet-header",
766
- className: m("astw:flex astw:flex-col astw:gap-1.5 astw:p-4", t),
788
+ className: w("astw:flex astw:flex-col astw:gap-1.5 astw:p-4", t),
767
789
  ...e
768
790
  }
769
791
  );
770
792
  }
771
- function At({ className: t, ...e }) {
793
+ ee.displayName = "Sheet.Header";
794
+ function ae({ className: t, ...e }) {
772
795
  return /* @__PURE__ */ a(
773
- x.Title,
796
+ "div",
797
+ {
798
+ "data-slot": "sheet-footer",
799
+ className: w("astw:mt-auto astw:flex astw:flex-col astw:gap-2 astw:p-4", t),
800
+ ...e
801
+ }
802
+ );
803
+ }
804
+ ae.displayName = "Sheet.Footer";
805
+ function se({ className: t, ...e }) {
806
+ return /* @__PURE__ */ a(
807
+ S.Title,
774
808
  {
775
809
  "data-slot": "sheet-title",
776
- className: m("astw:text-foreground astw:font-semibold", t),
810
+ className: w("astw:text-foreground astw:font-semibold", t),
777
811
  ...e
778
812
  }
779
813
  );
780
814
  }
781
- function Bt({
782
- className: t,
783
- ...e
784
- }) {
815
+ se.displayName = "Sheet.Title";
816
+ function re({ className: t, ...e }) {
785
817
  return /* @__PURE__ */ a(
786
- x.Description,
818
+ S.Description,
787
819
  {
788
820
  "data-slot": "sheet-description",
789
- className: m("astw:text-muted-foreground astw:text-sm", t),
821
+ className: w("astw:text-muted-foreground astw:text-sm", t),
790
822
  ...e
791
823
  }
792
824
  );
793
825
  }
794
- function ht({
795
- delayDuration: t = 0,
796
- children: e,
797
- ...s
798
- }) {
799
- return /* @__PURE__ */ a(A.Provider, { "data-slot": "tooltip-provider", delay: t, ...s, children: e });
826
+ re.displayName = "Sheet.Description";
827
+ const k = {
828
+ Root: Xt,
829
+ Trigger: qt,
830
+ Close: Qt,
831
+ Content: te,
832
+ Header: ee,
833
+ Footer: ae,
834
+ Title: se,
835
+ Description: re
836
+ };
837
+ function ne({ delay: t = 0, children: e, ...s }) {
838
+ return /* @__PURE__ */ a(E.Provider, { "data-slot": "tooltip-provider", delay: t, ...s, children: e });
800
839
  }
801
- function pt({ children: t, ...e }) {
802
- return /* @__PURE__ */ a(ht, { children: /* @__PURE__ */ a(A.Root, { "data-slot": "tooltip", ...e, children: t }) });
840
+ ne.displayName = "Tooltip.Provider";
841
+ function oe({ children: t, ...e }) {
842
+ return /* @__PURE__ */ a(E.Root, { "data-slot": "tooltip", ...e, children: t });
803
843
  }
804
- function ft({ ...t }) {
805
- return /* @__PURE__ */ a(A.Trigger, { "data-slot": "tooltip-trigger", ...t });
844
+ oe.displayName = "Tooltip.Root";
845
+ function ie({ ...t }) {
846
+ return /* @__PURE__ */ a(E.Trigger, { "data-slot": "tooltip-trigger", ...t });
806
847
  }
807
- function gt({
848
+ ie.displayName = "Tooltip.Trigger";
849
+ function le({
808
850
  className: t,
809
- sideOffset: e = 0,
851
+ sideOffset: e = 5,
810
852
  side: s = "top",
811
- align: n = "center",
812
- children: r,
853
+ align: r = "center",
854
+ children: n,
813
855
  ...o
814
856
  }) {
815
- return /* @__PURE__ */ a(A.Portal, { children: /* @__PURE__ */ a(A.Positioner, { sideOffset: e, side: s, align: n, children: /* @__PURE__ */ c(
816
- A.Popup,
857
+ return /* @__PURE__ */ a(E.Portal, { children: /* @__PURE__ */ a(E.Positioner, { sideOffset: e, side: s, align: r, children: /* @__PURE__ */ c(
858
+ E.Popup,
817
859
  {
818
860
  "data-slot": "tooltip-content",
819
- className: m(
820
- "astw:bg-primary astw:text-primary-foreground astw:animate-in astw:fade-in-0 astw:zoom-in-95 astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-ending-style:zoom-out-95 astw:data-[side=bottom]:slide-in-from-top-2 astw:data-[side=left]:slide-in-from-right-2 astw:data-[side=right]:slide-in-from-left-2 astw:data-[side=top]:slide-in-from-bottom-2 astw:z-50 astw:w-fit astw:origin-(--transform-origin) astw:rounded-md astw:px-3 astw:py-1.5 astw:text-xs astw:text-balance",
861
+ className: w(
862
+ "astw:bg-primary astw:text-primary-foreground astw:animate-in astw:fade-in-0 astw:zoom-in-95 astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-ending-style:zoom-out-95 astw:data-[side=bottom]:slide-in-from-top-2 astw:data-[side=left]:slide-in-from-right-2 astw:data-[side=right]:slide-in-from-left-2 astw:data-[side=top]:slide-in-from-bottom-2 astw:z-50 astw:w-fit astw:overflow-visible astw:origin-(--transform-origin) astw:rounded-md astw:px-3 astw:py-1.5 astw:text-xs astw:text-balance",
821
863
  t
822
864
  ),
823
865
  ...o,
824
866
  children: [
825
- r,
826
- /* @__PURE__ */ a(A.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]" })
867
+ n,
868
+ /* @__PURE__ */ a(E.Arrow, { className: "astw:size-2.5 astw:rotate-45 astw:bg-primary astw:data-[side=top]:-bottom-1 astw:data-[side=bottom]:-top-1 astw:data-[side=left]:-right-1 astw:data-[side=right]:-left-1" })
827
869
  ]
828
870
  }
829
871
  ) }) });
830
872
  }
831
- const ae = "16rem", ma = "18rem", ha = "3rem", pa = "b", se = g.createContext(null);
832
- function H() {
833
- const t = g.useContext(se);
873
+ le.displayName = "Tooltip.Content";
874
+ const C = {
875
+ Root: oe,
876
+ Trigger: ie,
877
+ Content: le,
878
+ Provider: ne
879
+ }, ce = "16rem", _a = "18rem", za = "3rem", Fa = "b", de = b.createContext(null);
880
+ function j() {
881
+ const t = b.useContext(de);
834
882
  if (!t)
835
883
  throw new Error("useSidebar must be used within a SidebarProvider.");
836
884
  return t;
837
885
  }
838
- function fa({
886
+ function Oa({
839
887
  defaultOpen: t = !0,
840
888
  open: e,
841
889
  onOpenChange: s,
842
- className: n,
843
- style: r,
890
+ className: r,
891
+ style: n,
844
892
  children: o,
845
893
  ...i
846
894
  }) {
847
- const l = ia(), u = la(), [d, w] = g.useState(!1), [h, f] = g.useState(!1), [b, p] = g.useState(t), v = e ?? b, k = g.useCallback(
895
+ const l = Ba(), u = Ea(), [d, m] = b.useState(!1), [h, f] = b.useState(!1), [v, g] = b.useState(t), p = e ?? v, x = b.useCallback(
848
896
  (y) => {
849
- const P = typeof y == "function" ? y(v) : y;
850
- s ? s(P) : p(P);
897
+ const B = typeof y == "function" ? y(p) : y;
898
+ s ? s(B) : g(B);
851
899
  },
852
- [s, v]
853
- ), R = u && !l, K = g.useCallback(() => l ? w((y) => !y) : R ? f((y) => !y) : k((y) => !y), [l, R, k, w]);
854
- g.useEffect(() => {
855
- const y = (P) => {
856
- P.key === pa && (P.metaKey || P.ctrlKey) && (P.preventDefault(), K());
900
+ [s, p]
901
+ ), A = u && !l, X = b.useCallback(() => l ? m((y) => !y) : A ? f((y) => !y) : x((y) => !y), [l, A, x, m]);
902
+ b.useEffect(() => {
903
+ const y = (B) => {
904
+ B.key === Fa && (B.metaKey || B.ctrlKey) && (B.preventDefault(), X());
857
905
  };
858
906
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
859
- }, [K]);
860
- const Nt = v ? "expanded" : "collapsed", we = g.useMemo(
907
+ }, [X]);
908
+ const vt = p ? "expanded" : "collapsed", _e = b.useMemo(
861
909
  () => ({
862
- state: Nt,
863
- open: v,
864
- setOpen: k,
910
+ state: vt,
911
+ open: p,
912
+ setOpen: x,
865
913
  isMobile: l,
866
914
  openMobile: d,
867
- setOpenMobile: w,
868
- toggleSidebar: K,
869
- isIconMode: R,
915
+ setOpenMobile: m,
916
+ toggleSidebar: X,
917
+ isIconMode: A,
870
918
  openIconMode: h,
871
919
  setOpenIconMode: f
872
920
  }),
873
921
  [
874
- Nt,
875
- v,
876
- k,
922
+ vt,
923
+ p,
924
+ x,
877
925
  l,
878
926
  d,
879
- w,
880
- K,
881
- R,
927
+ m,
928
+ X,
929
+ A,
882
930
  h,
883
931
  f
884
932
  ]
885
933
  );
886
- return /* @__PURE__ */ a(se.Provider, { value: we, children: /* @__PURE__ */ a(ht, { delayDuration: 0, children: /* @__PURE__ */ a(
934
+ return /* @__PURE__ */ a(de.Provider, { value: _e, children: /* @__PURE__ */ a(C.Provider, { delay: 0, children: /* @__PURE__ */ a(
887
935
  "div",
888
936
  {
889
937
  "data-slot": "sidebar-wrapper",
890
938
  style: {
891
- "--sidebar-width": ae,
892
- "--sidebar-width-icon": ha,
893
- ...r
939
+ "--sidebar-width": ce,
940
+ "--sidebar-width-icon": za,
941
+ ...n
894
942
  },
895
- className: m(
943
+ className: w(
896
944
  "astw:group/sidebar-wrapper astw:has-data-[variant=inset]:bg-sidebar astw:flex astw:min-h-svh astw:w-full astw:overflow-hidden",
897
- n
945
+ r
898
946
  ),
899
947
  ...i,
900
948
  children: o
901
949
  }
902
950
  ) }) });
903
951
  }
904
- function ga({
952
+ function Wa({
905
953
  side: t = "left",
906
954
  variant: e = "sidebar",
907
955
  collapsible: s = "offcanvas",
908
- className: n,
909
- children: r,
956
+ className: r,
957
+ children: n,
910
958
  ...o
911
959
  }) {
912
- const { isMobile: i, state: l, openMobile: u, setOpenMobile: d, isIconMode: w, openIconMode: h, setOpenIconMode: f } = H();
960
+ const { isMobile: i, state: l, openMobile: u, setOpenMobile: d, isIconMode: m, openIconMode: h, setOpenIconMode: f } = j();
913
961
  return s === "none" ? /* @__PURE__ */ a(
914
962
  "div",
915
963
  {
916
964
  "data-slot": "sidebar",
917
- className: m(
965
+ className: w(
918
966
  "astw:bg-sidebar astw:text-sidebar-foreground astw:flex astw:h-full astw:w-(--sidebar-width) astw:flex-col",
919
- n
967
+ r
920
968
  ),
921
969
  ...o,
922
- children: r
970
+ children: n
923
971
  }
924
- ) : i ? /* @__PURE__ */ a(kt, { open: u, onOpenChange: d, ...o, children: /* @__PURE__ */ c(
925
- Rt,
972
+ ) : i ? /* @__PURE__ */ a(k.Root, { open: u, onOpenChange: d, side: t, ...o, children: /* @__PURE__ */ c(
973
+ k.Content,
926
974
  {
927
975
  "data-sidebar": "sidebar",
928
976
  "data-slot": "sidebar",
929
977
  "data-mobile": "true",
930
978
  className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
931
979
  style: {
932
- "--sidebar-width": ma
980
+ "--sidebar-width": _a
933
981
  },
934
- side: t,
935
982
  children: [
936
- /* @__PURE__ */ c(Pt, { className: "astw:sr-only", children: [
937
- /* @__PURE__ */ a(At, { children: "Sidebar" }),
938
- /* @__PURE__ */ a(Bt, { children: "Displays the mobile sidebar." })
983
+ /* @__PURE__ */ c(k.Header, { className: "astw:sr-only", children: [
984
+ /* @__PURE__ */ a(k.Title, { children: "Sidebar" }),
985
+ /* @__PURE__ */ a(k.Description, { children: "Displays the mobile sidebar." })
939
986
  ] }),
940
- /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: r })
987
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:h-full astw:w-full astw:flex-col", children: n })
941
988
  ]
942
989
  }
943
- ) }) : w && s === "icon" ? /* @__PURE__ */ c(S, { children: [
990
+ ) }) : m && s === "icon" ? /* @__PURE__ */ c(T, { children: [
944
991
  /* @__PURE__ */ c(
945
992
  "div",
946
993
  {
@@ -955,7 +1002,7 @@ function ga({
955
1002
  "div",
956
1003
  {
957
1004
  "data-slot": "sidebar-gap",
958
- className: m(
1005
+ className: w(
959
1006
  "astw:relative astw:bg-transparent astw:transition-[width] astw:duration-200 astw:ease-linear",
960
1007
  e === "floating" || e === "inset" ? "astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
961
1008
  )
@@ -965,7 +1012,7 @@ function ga({
965
1012
  "div",
966
1013
  {
967
1014
  "data-slot": "sidebar-container",
968
- className: m(
1015
+ className: w(
969
1016
  "astw:fixed astw:inset-y-0 astw:z-10 astw:hidden astw:h-svh astw:transition-[left,right,width] astw:duration-200 astw:ease-linear astw:md:flex",
970
1017
  t === "left" ? "astw:left-0" : "astw:right-0",
971
1018
  e === "floating" || e === "inset" ? "astw:p-2 astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon) astw:group-data-[side=left]:border-r astw:group-data-[side=right]:border-l",
@@ -977,7 +1024,7 @@ function ga({
977
1024
  "data-sidebar": "sidebar",
978
1025
  "data-slot": "sidebar-inner",
979
1026
  className: "astw:bg-sidebar astw:group-data-[variant=floating]:border-sidebar-border astw:flex astw:h-full astw:w-full astw:flex-col astw:overflow-hidden astw:group-data-[variant=floating]:rounded-lg astw:group-data-[variant=floating]:border astw:group-data-[variant=floating]:shadow-sm",
980
- children: r
1027
+ children: n
981
1028
  }
982
1029
  )
983
1030
  }
@@ -985,23 +1032,22 @@ function ga({
985
1032
  ]
986
1033
  }
987
1034
  ),
988
- /* @__PURE__ */ a(kt, { open: h, onOpenChange: f, ...o, children: /* @__PURE__ */ c(
989
- Rt,
1035
+ /* @__PURE__ */ a(k.Root, { open: h, onOpenChange: f, side: t, ...o, children: /* @__PURE__ */ c(
1036
+ k.Content,
990
1037
  {
991
1038
  "data-sidebar": "sidebar",
992
1039
  "data-slot": "sidebar-overlay",
993
1040
  "data-icon-mode": "true",
994
1041
  className: "astw:bg-sidebar astw:text-sidebar-foreground astw:w-(--sidebar-width) astw:p-0 astw:[&>button]:hidden",
995
1042
  style: {
996
- "--sidebar-width": ae
1043
+ "--sidebar-width": ce
997
1044
  },
998
- side: t,
999
1045
  children: [
1000
- /* @__PURE__ */ c(Pt, { className: "astw:sr-only", children: [
1001
- /* @__PURE__ */ a(At, { children: "Sidebar" }),
1002
- /* @__PURE__ */ a(Bt, { children: "Displays the sidebar overlay." })
1046
+ /* @__PURE__ */ c(k.Header, { className: "astw:sr-only", children: [
1047
+ /* @__PURE__ */ a(k.Title, { children: "Sidebar" }),
1048
+ /* @__PURE__ */ a(k.Description, { children: "Displays the sidebar overlay." })
1003
1049
  ] }),
1004
- /* @__PURE__ */ a("div", { className: "flex h-full w-full flex-col", children: r })
1050
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:h-full astw:w-full astw:flex-col", children: n })
1005
1051
  ]
1006
1052
  }
1007
1053
  ) })
@@ -1019,7 +1065,7 @@ function ga({
1019
1065
  "div",
1020
1066
  {
1021
1067
  "data-slot": "sidebar-gap",
1022
- className: m(
1068
+ className: w(
1023
1069
  "astw:relative astw:w-(--sidebar-width) astw:bg-transparent astw:transition-[width] astw:duration-200 astw:ease-linear",
1024
1070
  "astw:group-data-[collapsible=offcanvas]:w-0",
1025
1071
  "astw:group-data-[side=right]:rotate-180",
@@ -1031,13 +1077,13 @@ function ga({
1031
1077
  "div",
1032
1078
  {
1033
1079
  "data-slot": "sidebar-container",
1034
- className: m(
1080
+ className: w(
1035
1081
  "astw:fixed astw:inset-y-0 astw:z-10 astw:hidden astw:h-svh astw:w-(--sidebar-width) astw:transition-[left,right,width] astw:duration-200 astw:ease-linear astw:md:flex",
1036
1082
  t === "left" ? "astw:left-0 astw:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "astw:right-0 astw:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
1037
1083
  // Adjust the padding for floating and inset variants.
1038
1084
  e === "floating" || e === "inset" ? "astw:p-2 astw:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "astw:group-data-[collapsible=icon]:w-(--sidebar-width-icon) astw:group-data-[side=left]:border-r astw:group-data-[side=right]:border-l",
1039
1085
  e === "inset" && "astw:border-x astw:border-x-border",
1040
- n
1086
+ r
1041
1087
  ),
1042
1088
  ...o,
1043
1089
  children: /* @__PURE__ */ a(
@@ -1046,7 +1092,7 @@ function ga({
1046
1092
  "data-sidebar": "sidebar",
1047
1093
  "data-slot": "sidebar-inner",
1048
1094
  className: "astw:bg-sidebar astw:group-data-[variant=floating]:border-sidebar-border astw:flex astw:h-full astw:w-full astw:flex-col astw:group-data-[variant=floating]:rounded-lg astw:group-data-[variant=floating]:border astw:group-data-[variant=floating]:shadow-sm",
1049
- children: r
1095
+ children: n
1050
1096
  }
1051
1097
  )
1052
1098
  }
@@ -1055,33 +1101,33 @@ function ga({
1055
1101
  }
1056
1102
  );
1057
1103
  }
1058
- function ne({ className: t, onClick: e, ...s }) {
1059
- const { toggleSidebar: n } = H();
1104
+ function we({ className: t, onClick: e, ...s }) {
1105
+ const { toggleSidebar: r } = j();
1060
1106
  return /* @__PURE__ */ c(
1061
- O,
1107
+ V,
1062
1108
  {
1063
1109
  "data-sidebar": "trigger",
1064
1110
  "data-slot": "sidebar-trigger",
1065
1111
  variant: "ghost",
1066
1112
  size: "icon",
1067
- className: m("astw:text-muted-foreground", t),
1068
- onClick: (r) => {
1069
- e?.(r), n();
1113
+ className: w("astw:text-muted-foreground", t),
1114
+ onClick: (n) => {
1115
+ e?.(n), r();
1070
1116
  },
1071
1117
  ...s,
1072
1118
  children: [
1073
- /* @__PURE__ */ a(Re, { className: "astw:size-4.5" }),
1119
+ /* @__PURE__ */ a(Ze, { className: "astw:size-4.5" }),
1074
1120
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Toggle Sidebar" })
1075
1121
  ]
1076
1122
  }
1077
1123
  );
1078
1124
  }
1079
- function ba({ className: t, ...e }) {
1125
+ function ja({ className: t, ...e }) {
1080
1126
  return /* @__PURE__ */ a(
1081
1127
  "main",
1082
1128
  {
1083
1129
  "data-slot": "sidebar-inset",
1084
- className: m(
1130
+ className: w(
1085
1131
  "astw:bg-background astw:relative astw:flex astw:w-full astw:flex-1 astw:flex-col",
1086
1132
  "astw:px-4 astw:md:peer-data-[variant=inset]:px-8 astw:md:peer-data-[variant=inset]:py-2",
1087
1133
  // astw:md:peer-data-[variant=inset]:peer-data-[state=collapsed]:pl-2
@@ -1091,35 +1137,35 @@ function ba({ className: t, ...e }) {
1091
1137
  }
1092
1138
  );
1093
1139
  }
1094
- function va({ className: t, ...e }) {
1140
+ function Ha({ className: t, ...e }) {
1095
1141
  return /* @__PURE__ */ a(
1096
1142
  "div",
1097
1143
  {
1098
1144
  "data-slot": "sidebar-header",
1099
1145
  "data-sidebar": "header",
1100
- className: m("astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2", t),
1146
+ className: w("astw:flex astw:flex-row astw:items-center astw:gap-0.5 astw:p-2", t),
1101
1147
  ...e
1102
1148
  }
1103
1149
  );
1104
1150
  }
1105
- function xa({ className: t, ...e }) {
1151
+ function Ua({ className: t, ...e }) {
1106
1152
  return /* @__PURE__ */ a(
1107
- da,
1153
+ La,
1108
1154
  {
1109
1155
  "data-slot": "sidebar-separator",
1110
1156
  "data-sidebar": "separator",
1111
- className: m("astw:bg-sidebar-border astw:mx-2 astw:w-auto", t),
1157
+ className: w("astw:bg-sidebar-border astw:mx-2 astw:w-auto", t),
1112
1158
  ...e
1113
1159
  }
1114
1160
  );
1115
1161
  }
1116
- function ya({ className: t, ...e }) {
1162
+ function Ka({ className: t, ...e }) {
1117
1163
  return /* @__PURE__ */ a(
1118
1164
  "div",
1119
1165
  {
1120
1166
  "data-slot": "sidebar-content",
1121
1167
  "data-sidebar": "content",
1122
- className: m(
1168
+ className: w(
1123
1169
  "astw:flex astw:min-h-0 astw:flex-1 astw:flex-col astw:gap-2 astw:overflow-auto astw:group-data-[collapsible=icon]:overflow-hidden",
1124
1170
  t
1125
1171
  ),
@@ -1127,13 +1173,13 @@ function ya({ className: t, ...e }) {
1127
1173
  }
1128
1174
  );
1129
1175
  }
1130
- function bt({ className: t, ...e }) {
1176
+ function ft({ className: t, ...e }) {
1131
1177
  return /* @__PURE__ */ a(
1132
1178
  "div",
1133
1179
  {
1134
1180
  "data-slot": "sidebar-group",
1135
1181
  "data-sidebar": "group",
1136
- className: m(
1182
+ className: w(
1137
1183
  "astw:relative astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:p-2",
1138
1184
  t
1139
1185
  ),
@@ -1141,29 +1187,29 @@ function bt({ className: t, ...e }) {
1141
1187
  }
1142
1188
  );
1143
1189
  }
1144
- function vt({ className: t, ...e }) {
1190
+ function pt({ className: t, ...e }) {
1145
1191
  return /* @__PURE__ */ a(
1146
1192
  "ul",
1147
1193
  {
1148
1194
  "data-slot": "sidebar-menu",
1149
1195
  "data-sidebar": "menu",
1150
- className: m("astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1", t),
1196
+ className: w("astw:flex astw:w-full astw:min-w-0 astw:flex-col astw:gap-1", t),
1151
1197
  ...e
1152
1198
  }
1153
1199
  );
1154
1200
  }
1155
- function L({ className: t, ...e }) {
1201
+ function F({ className: t, ...e }) {
1156
1202
  return /* @__PURE__ */ a(
1157
1203
  "li",
1158
1204
  {
1159
1205
  "data-slot": "sidebar-menu-item",
1160
1206
  "data-sidebar": "menu-item",
1161
- className: m("astw:group/menu-item astw:relative", t),
1207
+ className: w("astw:group/menu-item astw:relative", t),
1162
1208
  ...e
1163
1209
  }
1164
1210
  );
1165
1211
  }
1166
- const Na = it(
1212
+ const Va = ct(
1167
1213
  "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",
1168
1214
  {
1169
1215
  variants: {
@@ -1183,58 +1229,65 @@ const Na = it(
1183
1229
  }
1184
1230
  }
1185
1231
  );
1186
- function _({
1232
+ function O({
1187
1233
  render: t,
1188
1234
  isActive: e = !1,
1189
1235
  variant: s = "default",
1190
- size: n = "default",
1191
- tooltip: r,
1236
+ size: r = "default",
1237
+ tooltip: n,
1192
1238
  className: o,
1193
1239
  children: i,
1194
- ...l
1240
+ onClick: l,
1241
+ ...u
1195
1242
  }) {
1196
- const { isMobile: u, state: d } = H(), w = j({
1243
+ const { isMobile: d, state: m, setOpenMobile: h, openIconMode: f, setOpenIconMode: v } = j(), g = b.useCallback(
1244
+ (x) => {
1245
+ l?.(x), !x.defaultPrevented && (d ? h(!1) : f && v(!1));
1246
+ },
1247
+ [l, d, h, f, v]
1248
+ ), p = G({
1197
1249
  defaultTagName: "button",
1198
1250
  render: t,
1199
1251
  props: {
1200
1252
  "data-slot": "sidebar-menu-button",
1201
1253
  "data-sidebar": "menu-button",
1202
- "data-size": n,
1254
+ "data-size": r,
1203
1255
  "data-active": e,
1204
- className: m(Na({ variant: s, size: n }), o),
1256
+ className: w(Va({ variant: s, size: r }), o),
1257
+ onClick: g,
1205
1258
  children: i,
1206
- ...l
1259
+ ...u
1207
1260
  }
1208
1261
  });
1209
- return r ? (typeof r == "string" && (r = {
1210
- children: r
1211
- }), /* @__PURE__ */ c(pt, { children: [
1212
- /* @__PURE__ */ a(ft, { render: w }),
1262
+ return n ? (typeof n == "string" && (n = {
1263
+ children: n
1264
+ }), /* @__PURE__ */ c(C.Root, { children: [
1265
+ /* @__PURE__ */ a(C.Trigger, { render: p }),
1213
1266
  /* @__PURE__ */ a(
1214
- gt,
1267
+ C.Content,
1215
1268
  {
1216
1269
  side: "right",
1217
1270
  align: "center",
1218
- hidden: d !== "collapsed" || u,
1219
- ...r
1271
+ hidden: m !== "collapsed" || d,
1272
+ ...n
1220
1273
  }
1221
1274
  )
1222
- ] })) : w;
1275
+ ] })) : p;
1223
1276
  }
1224
- function Y({
1277
+ function J({
1225
1278
  className: t,
1226
1279
  render: e,
1227
1280
  showOnHover: s = !1,
1228
- children: n,
1229
- ...r
1281
+ children: r,
1282
+ ...n
1230
1283
  }) {
1231
- return j({
1284
+ return G({
1232
1285
  defaultTagName: "button",
1233
1286
  render: e,
1234
1287
  props: {
1235
1288
  "data-slot": "sidebar-menu-action",
1236
1289
  "data-sidebar": "menu-action",
1237
- className: m(
1290
+ className: w(
1238
1291
  "astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:peer-hover/menu-button:text-sidebar-accent-foreground astw:absolute astw:top-1.5 astw:right-1 astw:flex astw:aspect-square astw:w-5 astw:items-center astw:justify-center astw:rounded-md astw:p-0 astw:outline-hidden astw:transition-transform astw:focus-visible:ring-2 astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
1239
1292
  // Increases the hit area of the button on mobile.
1240
1293
  "astw:after:absolute astw:after:-inset-2 astw:md:after:hidden",
@@ -1245,18 +1298,18 @@ function Y({
1245
1298
  s && "astw:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground astw:group-focus-within/menu-item:opacity-100 astw:group-hover/menu-item:opacity-100 astw:data-[state=open]:opacity-100 astw:md:opacity-0",
1246
1299
  t
1247
1300
  ),
1248
- children: n,
1249
- ...r
1301
+ children: r,
1302
+ ...n
1250
1303
  }
1251
1304
  });
1252
1305
  }
1253
- function st({ className: t, ...e }) {
1306
+ function it({ className: t, ...e }) {
1254
1307
  return /* @__PURE__ */ a(
1255
1308
  "ul",
1256
1309
  {
1257
1310
  "data-slot": "sidebar-menu-sub",
1258
1311
  "data-sidebar": "menu-sub",
1259
- className: m(
1312
+ className: w(
1260
1313
  "astw:border-sidebar-border astw:ml-3.5 astw:mr-0 astw:flex astw:min-w-0 astw:translate-x-px astw:flex-col astw:gap-1 astw:border-l astw:pl-2.5 astw:pr-0 astw:py-0.5",
1261
1314
  "astw:group-data-[collapsible=icon]:hidden",
1262
1315
  t
@@ -1265,26 +1318,33 @@ function st({ className: t, ...e }) {
1265
1318
  }
1266
1319
  );
1267
1320
  }
1268
- function Sa({ className: t, ...e }) {
1321
+ function Ga({ className: t, ...e }) {
1269
1322
  return /* @__PURE__ */ a(
1270
1323
  "li",
1271
1324
  {
1272
1325
  "data-slot": "sidebar-menu-sub-item",
1273
1326
  "data-sidebar": "menu-sub-item",
1274
- className: m("astw:group/menu-sub-item astw:relative", t),
1327
+ className: w("astw:group/menu-sub-item astw:relative", t),
1275
1328
  ...e
1276
1329
  }
1277
1330
  );
1278
1331
  }
1279
- function Ca({
1332
+ function Ya({
1280
1333
  render: t,
1281
1334
  size: e = "md",
1282
1335
  isActive: s = !1,
1283
- className: n,
1284
- children: r,
1285
- ...o
1336
+ className: r,
1337
+ children: n,
1338
+ onClick: o,
1339
+ ...i
1286
1340
  }) {
1287
- return j({
1341
+ const { isMobile: l, setOpenMobile: u, openIconMode: d, setOpenIconMode: m } = j(), h = b.useCallback(
1342
+ (f) => {
1343
+ o?.(f), !f.defaultPrevented && (l ? u(!1) : d && m(!1));
1344
+ },
1345
+ [o, l, u, d, m]
1346
+ );
1347
+ return G({
1288
1348
  defaultTagName: "a",
1289
1349
  render: t,
1290
1350
  props: {
@@ -1292,74 +1352,75 @@ function Ca({
1292
1352
  "data-sidebar": "menu-sub-button",
1293
1353
  "data-size": e,
1294
1354
  "data-active": s,
1295
- className: m(
1355
+ onClick: h,
1356
+ className: w(
1296
1357
  "astw:text-sidebar-foreground astw:ring-sidebar-ring astw:hover:bg-sidebar-accent astw:hover:text-sidebar-accent-foreground astw:active:bg-sidebar-accent astw:active:text-sidebar-accent-foreground astw:[&>svg]:text-sidebar-accent-foreground astw:flex astw:h-7 astw:min-w-0 astw:-translate-x-px astw:items-center astw:gap-2 astw:overflow-hidden astw:rounded-md astw:px-2 astw:outline-hidden astw:focus-visible:ring-2 astw:disabled:pointer-events-none astw:disabled:opacity-50 astw:aria-disabled:pointer-events-none astw:aria-disabled:opacity-50 astw:[&>span:last-child]:truncate astw:group-data-[collapsible=icon]:[&>span:last-child]:hidden astw:[&>svg]:size-4 astw:[&>svg]:shrink-0",
1297
1358
  "astw:data-[active=true]:bg-sidebar-accent astw:data-[active=true]:text-sidebar-accent-foreground",
1298
1359
  e === "sm" && "astw:text-xs",
1299
1360
  e === "md" && "astw:text-sm",
1300
1361
  "astw:group-data-[collapsible=icon]:hidden",
1301
- n
1362
+ r
1302
1363
  ),
1303
- children: r,
1304
- ...o
1364
+ children: n,
1365
+ ...i
1305
1366
  }
1306
1367
  });
1307
1368
  }
1308
- const Ta = (t) => {
1309
- const { configurations: e } = C(), { modules: s, locale: n } = e;
1310
- return ka(t) ? null : Ra(t, s, n);
1311
- }, ka = (t) => t.startsWith("http://") || t.startsWith("https://"), Ra = (t, e, s) => {
1312
- const n = U(s), r = Dt(t);
1369
+ const Xa = (t) => {
1370
+ const { configurations: e } = D(), { modules: s, locale: r } = e;
1371
+ return qa(t) ? null : Qa(t, s, r);
1372
+ }, qa = (t) => t.startsWith("http://") || t.startsWith("https://"), Qa = (t, e, s) => {
1373
+ const r = Y(s), n = St(t);
1313
1374
  for (const o of e) {
1314
- const i = Dt(o.path);
1315
- if (re(r, i))
1375
+ const i = St(o.path);
1376
+ if (ue(n, i))
1316
1377
  return {
1317
- title: n(o.meta.title, o.path),
1378
+ title: r(o.meta.title, o.path),
1318
1379
  icon: o.meta.icon
1319
1380
  };
1320
- const l = oe(r, i, o.resources, n);
1381
+ const l = me(n, i, o.resources, r);
1321
1382
  if (l)
1322
1383
  return l;
1323
1384
  }
1324
1385
  return null;
1325
- }, re = (t, e) => {
1386
+ }, ue = (t, e) => {
1326
1387
  if (t === e) return !0;
1327
- const s = t.split("/"), n = e.split("/");
1328
- return s.length !== n.length ? !1 : n.every((r, o) => r.startsWith(":") || r === s[o]);
1329
- }, Dt = (t) => {
1388
+ const s = t.split("/"), r = e.split("/");
1389
+ return s.length !== r.length ? !1 : r.every((n, o) => n.startsWith(":") || n === s[o]);
1390
+ }, St = (t) => {
1330
1391
  let e = t;
1331
1392
  return e.startsWith("/") || (e = `/${e}`), e.length > 1 && e.endsWith("/") && (e = e.slice(0, -1)), e;
1332
- }, oe = (t, e, s, n) => {
1333
- for (const r of s) {
1334
- const o = `${e}/${r.path}`;
1335
- if (re(t, o))
1393
+ }, me = (t, e, s, r) => {
1394
+ for (const n of s) {
1395
+ const o = `${e}/${n.path}`;
1396
+ if (ue(t, o))
1336
1397
  return {
1337
- title: n(r.meta.title, r.path),
1338
- icon: r.meta.icon
1398
+ title: r(n.meta.title, n.path),
1399
+ icon: n.meta.icon
1339
1400
  };
1340
- if (r.subResources) {
1341
- const i = oe(t, o, r.subResources, n);
1401
+ if (n.subResources) {
1402
+ const i = me(t, o, n.subResources, r);
1342
1403
  if (i)
1343
1404
  return i;
1344
1405
  }
1345
1406
  }
1346
1407
  return null;
1347
- }, Qs = (t) => {
1408
+ }, pr = (t) => {
1348
1409
  const {
1349
1410
  to: e,
1350
1411
  external: s,
1351
- render: n,
1352
- activeMatch: r = "prefix",
1412
+ render: r,
1413
+ activeMatch: n = "prefix",
1353
1414
  title: o,
1354
1415
  icon: i
1355
- } = t, { pathname: l } = X(), u = Ta(e), d = r === "exact" ? l === e : l === e || l.startsWith(`${e}/`), w = o ?? u?.title ?? Pa(e), h = i ?? u?.icon, f = {
1356
- title: w,
1416
+ } = t, { pathname: l } = tt(), u = Xa(e), d = n === "exact" ? l === e : l === e || l.startsWith(`${e}/`), m = o ?? u?.title ?? Za(e), h = i ?? u?.icon, f = {
1417
+ title: m,
1357
1418
  url: e,
1358
1419
  icon: h,
1359
1420
  isActive: d
1360
1421
  };
1361
- return s || ie(e) ? /* @__PURE__ */ a(L, { children: /* @__PURE__ */ a(
1362
- _,
1422
+ return s || he(e) ? /* @__PURE__ */ a(F, { children: /* @__PURE__ */ a(
1423
+ O,
1363
1424
  {
1364
1425
  render: (
1365
1426
  // oxlint-disable-next-line jsx-a11y/anchor-has-content -- content is provided by SidebarMenuButton's children
@@ -1373,130 +1434,121 @@ const Ta = (t) => {
1373
1434
  }
1374
1435
  )
1375
1436
  ),
1376
- tooltip: w,
1377
- children: n ? n(f) : /* @__PURE__ */ c(S, { children: [
1378
- h ?? /* @__PURE__ */ a(Ft, { className: "astw:size-4" }),
1379
- /* @__PURE__ */ a("span", { children: w })
1437
+ tooltip: m,
1438
+ children: r ? r(f) : /* @__PURE__ */ c(T, { children: [
1439
+ h ?? /* @__PURE__ */ a(Bt, { className: "astw:size-4" }),
1440
+ /* @__PURE__ */ a("span", { children: m })
1380
1441
  ] })
1381
1442
  }
1382
- ) }) : /* @__PURE__ */ a(L, { children: /* @__PURE__ */ a(
1383
- _,
1443
+ ) }) : /* @__PURE__ */ a(F, { children: /* @__PURE__ */ a(
1444
+ O,
1384
1445
  {
1385
1446
  render: /* @__PURE__ */ a(
1386
- $,
1447
+ H,
1387
1448
  {
1388
1449
  to: e,
1389
1450
  className: d ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1390
1451
  }
1391
1452
  ),
1392
- tooltip: w,
1393
- children: n ? n(f) : /* @__PURE__ */ c(S, { children: [
1453
+ tooltip: m,
1454
+ children: r ? r(f) : /* @__PURE__ */ c(T, { children: [
1394
1455
  h,
1395
- /* @__PURE__ */ a("span", { children: w })
1456
+ /* @__PURE__ */ a("span", { children: m })
1396
1457
  ] })
1397
1458
  }
1398
1459
  ) });
1399
- }, ie = (t) => t.startsWith("http://") || t.startsWith("https://"), Pa = (t) => {
1400
- if (ie(t))
1460
+ }, he = (t) => t.startsWith("http://") || t.startsWith("https://"), Za = (t) => {
1461
+ if (he(t))
1401
1462
  try {
1402
1463
  return new URL(t).hostname;
1403
1464
  } catch {
1404
1465
  return t;
1405
1466
  }
1406
1467
  const e = t.split("/").filter(Boolean);
1407
- return (e[e.length - 1] ?? t).split("-").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ");
1408
- };
1409
- function nt({ ...t }) {
1410
- return /* @__PURE__ */ a(ct.Root, { "data-slot": "collapsible", ...t });
1411
- }
1412
- function Q({ ...t }) {
1413
- return /* @__PURE__ */ a(ct.Trigger, { "data-slot": "collapsible-trigger", ...t });
1414
- }
1415
- function rt({ ...t }) {
1416
- return /* @__PURE__ */ a(ct.Panel, { "data-slot": "collapsible-content", ...t });
1417
- }
1418
- const Xs = (t) => {
1419
- const { title: e, icon: s, to: n, defaultOpen: r = !0, children: o } = t, { pathname: i } = X(), { configurations: l } = C(), u = U(l.locale), d = B(), w = u(e, typeof e == "string" ? e : ""), h = n ? i === n : !1;
1420
- return n ? /* @__PURE__ */ c(nt, { render: /* @__PURE__ */ a(L, {}), defaultOpen: r, children: [
1468
+ return (e[e.length - 1] ?? t).split("-").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
1469
+ }, gr = (t) => {
1470
+ const { title: e, icon: s, to: r, defaultOpen: n = !0, children: o } = t, { pathname: i } = tt(), { configurations: l } = D(), u = Y(l.locale), d = I(), m = u(e, typeof e == "string" ? e : ""), h = r ? i === r : !1;
1471
+ return r ? /* @__PURE__ */ c(R.Root, { render: /* @__PURE__ */ a(F, {}), defaultOpen: n, children: [
1421
1472
  /* @__PURE__ */ c(
1422
- _,
1473
+ O,
1423
1474
  {
1424
1475
  render: /* @__PURE__ */ a(
1425
- $,
1476
+ H,
1426
1477
  {
1427
- to: n,
1478
+ to: r,
1428
1479
  className: h ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1429
1480
  }
1430
1481
  ),
1431
- tooltip: w,
1482
+ tooltip: m,
1432
1483
  children: [
1433
1484
  s,
1434
- /* @__PURE__ */ a("span", { children: w })
1485
+ /* @__PURE__ */ a("span", { children: m })
1435
1486
  ]
1436
1487
  }
1437
1488
  ),
1438
1489
  /* @__PURE__ */ c(
1439
- Q,
1490
+ R.Trigger,
1440
1491
  {
1441
- render: /* @__PURE__ */ a(Y, { className: "astw:data-panel-open:rotate-90" }),
1492
+ render: /* @__PURE__ */ a(J, { className: "astw:data-panel-open:rotate-90" }),
1442
1493
  children: [
1443
- /* @__PURE__ */ a(W, {}),
1494
+ /* @__PURE__ */ a(U, {}),
1444
1495
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: d("toggle") })
1445
1496
  ]
1446
1497
  }
1447
1498
  ),
1448
- /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(st, { children: o }) })
1449
- ] }) : /* @__PURE__ */ c(nt, { render: /* @__PURE__ */ a(L, {}), defaultOpen: r, children: [
1450
- /* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1499
+ /* @__PURE__ */ a(R.Panel, { children: /* @__PURE__ */ a(it, { children: o }) })
1500
+ ] }) : /* @__PURE__ */ c(R.Root, { render: /* @__PURE__ */ a(F, {}), defaultOpen: n, children: [
1501
+ /* @__PURE__ */ c(R.Trigger, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1451
1502
  /* @__PURE__ */ c(
1452
- _,
1503
+ O,
1453
1504
  {
1454
1505
  render: /* @__PURE__ */ a("span", { className: "astw:flex astw:w-full" }),
1455
- tooltip: w,
1506
+ tooltip: m,
1507
+ onClick: (f) => f.preventDefault(),
1456
1508
  children: [
1457
1509
  s,
1458
- /* @__PURE__ */ a("span", { children: w })
1510
+ /* @__PURE__ */ a("span", { children: m })
1459
1511
  ]
1460
1512
  }
1461
1513
  ),
1462
- /* @__PURE__ */ c(Y, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
1463
- /* @__PURE__ */ a(W, {}),
1514
+ /* @__PURE__ */ c(J, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
1515
+ /* @__PURE__ */ a(U, {}),
1464
1516
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: d("toggle") })
1465
1517
  ] })
1466
1518
  ] }),
1467
- /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(st, { children: o }) })
1519
+ /* @__PURE__ */ a(R.Panel, { children: /* @__PURE__ */ a(it, { children: o }) })
1468
1520
  ] });
1469
- }, Zs = () => /* @__PURE__ */ a(xa, {}), Aa = (t) => {
1470
- const { title: e, icon: s } = C(), { pathname: n } = X(), { isIconMode: r } = H(), o = /* @__PURE__ */ c(va, { children: [
1521
+ }, br = () => /* @__PURE__ */ a(Ua, {}), Ja = (t) => {
1522
+ const { title: e, icon: s } = D(), { pathname: r } = tt(), { isIconMode: n } = j(), o = /* @__PURE__ */ c(Ha, { children: [
1471
1523
  s,
1472
- /* @__PURE__ */ a("h1", { className: m("astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", r && "astw:hidden"), children: e })
1524
+ /* @__PURE__ */ a("h1", { className: w("astw:text-sm astw:mb-2 astw:mt-2 astw:px-2", n && "astw:hidden"), children: e })
1473
1525
  ] });
1474
- return /* @__PURE__ */ c(ga, { variant: "inset", collapsible: r ? "icon" : "offcanvas", children: [
1475
- !r && /* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1526
+ return /* @__PURE__ */ c(Wa, { variant: "inset", collapsible: n ? "icon" : "offcanvas", children: [
1527
+ !n && /* @__PURE__ */ c("div", { className: "astw:flex astw:justify-between astw:items-center", children: [
1476
1528
  t.header ?? o,
1477
- /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(ne, { className: "astw:-ml-1" }) })
1529
+ /* @__PURE__ */ a("div", { className: "astw:hidden astw:md:block", children: /* @__PURE__ */ a(we, { className: "astw:-ml-1" }) })
1478
1530
  ] }),
1479
- /* @__PURE__ */ a(ya, { children: t.children ? (
1531
+ /* @__PURE__ */ a(Ka, { children: t.children ? (
1480
1532
  // New API: children-based explicit definition
1481
- /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(vt, { children: t.children }) })
1533
+ /* @__PURE__ */ a(ft, { children: /* @__PURE__ */ a(pt, { children: t.children }) })
1482
1534
  ) : (
1483
1535
  // Existing behavior: auto-generation from resources
1484
- /* @__PURE__ */ a(lt, { fallback: /* @__PURE__ */ a(Ea, {}), children: /* @__PURE__ */ a(Ba, { currentPath: n }) })
1536
+ /* @__PURE__ */ a(dt, { fallback: /* @__PURE__ */ a(ss, {}), children: /* @__PURE__ */ a(ts, { currentPath: r }) })
1485
1537
  ) }),
1486
1538
  t.footer ?? null
1487
1539
  ] });
1488
- }, Ba = ({ currentPath: t }) => {
1489
- const e = Qt();
1490
- return /* @__PURE__ */ a($t, { resolve: e, children: (s) => /* @__PURE__ */ a(Da, { items: s ?? [], currentPath: t }) });
1491
- }, Da = (t) => {
1492
- const e = B();
1493
- return /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(vt, { children: t.items.map((s) => /* @__PURE__ */ c(nt, { render: /* @__PURE__ */ a(L, {}), defaultOpen: !0, children: [
1494
- s.url ? /* @__PURE__ */ c(S, { children: [
1540
+ }, ts = ({ currentPath: t }) => {
1541
+ const e = jt();
1542
+ return /* @__PURE__ */ a(Mt, { resolve: e, children: (s) => /* @__PURE__ */ a(es, { items: s ?? [], currentPath: t }) });
1543
+ }, es = (t) => {
1544
+ const e = I();
1545
+ return /* @__PURE__ */ a(ft, { children: /* @__PURE__ */ a(pt, { children: t.items.map((s) => /* @__PURE__ */ c(R.Root, { render: /* @__PURE__ */ a(F, {}), defaultOpen: !0, children: [
1546
+ s.url ? /* @__PURE__ */ c(T, { children: [
1495
1547
  /* @__PURE__ */ c(
1496
- _,
1548
+ O,
1497
1549
  {
1498
1550
  render: /* @__PURE__ */ a(
1499
- $,
1551
+ H,
1500
1552
  {
1501
1553
  to: s.url,
1502
1554
  className: s.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
@@ -1510,47 +1562,52 @@ const Xs = (t) => {
1510
1562
  }
1511
1563
  ),
1512
1564
  !!s.items?.length && /* @__PURE__ */ c(
1513
- Q,
1565
+ R.Trigger,
1514
1566
  {
1515
- render: /* @__PURE__ */ a(Y, { className: "astw:data-panel-open:rotate-90" }),
1567
+ render: /* @__PURE__ */ a(J, { className: "astw:data-panel-open:rotate-90" }),
1516
1568
  children: [
1517
- /* @__PURE__ */ a(W, {}),
1569
+ /* @__PURE__ */ a(U, {}),
1518
1570
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1519
1571
  ]
1520
1572
  }
1521
1573
  )
1522
- ] }) : /* @__PURE__ */ a(S, { children: /* @__PURE__ */ c(Q, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1574
+ ] }) : /* @__PURE__ */ a(T, { children: /* @__PURE__ */ c(R.Trigger, { className: "astw:flex astw:w-full astw:[&[data-panel-open]_.astw-rotate-target]:rotate-90", children: [
1523
1575
  /* @__PURE__ */ c(
1524
- _,
1576
+ O,
1525
1577
  {
1526
1578
  render: /* @__PURE__ */ a("span", { className: "astw:flex astw:w-full" }),
1527
1579
  tooltip: s.title,
1580
+ onClick: (r) => (
1581
+ // Prevent SidebarMenuButton's auto-close behavior so the mobile sidebar
1582
+ // stays open when toggling a collapsible group.
1583
+ r.preventDefault()
1584
+ ),
1528
1585
  children: [
1529
1586
  s.icon,
1530
1587
  /* @__PURE__ */ a("span", { children: s.title })
1531
1588
  ]
1532
1589
  }
1533
1590
  ),
1534
- !!s.items?.length && /* @__PURE__ */ c(Y, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
1535
- /* @__PURE__ */ a(W, {}),
1591
+ !!s.items?.length && /* @__PURE__ */ c(J, { className: "astw-rotate-target", render: /* @__PURE__ */ a("span", {}), children: [
1592
+ /* @__PURE__ */ a(U, {}),
1536
1593
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: e("toggle") })
1537
1594
  ] })
1538
1595
  ] }) }),
1539
- !!s.items?.length && /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ a(st, { children: s.items?.filter((n) => n.url).map((n) => /* @__PURE__ */ a(Sa, { children: /* @__PURE__ */ a(
1540
- Ca,
1596
+ !!s.items?.length && /* @__PURE__ */ a(R.Panel, { children: /* @__PURE__ */ a(it, { children: s.items?.filter((r) => r.url).map((r) => /* @__PURE__ */ a(Ga, { children: /* @__PURE__ */ a(
1597
+ Ya,
1541
1598
  {
1542
1599
  render: /* @__PURE__ */ a(
1543
- $,
1600
+ H,
1544
1601
  {
1545
- to: n.url,
1546
- className: n.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1602
+ to: r.url,
1603
+ className: r.url === t.currentPath ? "astw:bg-sidebar-accent astw:font-medium" : void 0
1547
1604
  }
1548
1605
  ),
1549
- children: /* @__PURE__ */ a("span", { children: n.title })
1606
+ children: /* @__PURE__ */ a("span", { children: r.title })
1550
1607
  }
1551
- ) }, n.title)) }) })
1608
+ ) }, r.title)) }) })
1552
1609
  ] }, s.title)) }) });
1553
- }, Ma = [104, 80, 112, 88, 96, 100, 84, 92], Ea = () => /* @__PURE__ */ a(bt, { children: /* @__PURE__ */ a(vt, { className: "astw:px-2", children: Ma.map((t, e) => /* @__PURE__ */ a(L, { children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1610
+ }, as = [104, 80, 112, 88, 96, 100, 84, 92], ss = () => /* @__PURE__ */ a(ft, { children: /* @__PURE__ */ a(pt, { className: "astw:px-2", children: as.map((t, e) => /* @__PURE__ */ a(F, { children: /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2 astw:py-1.5", children: [
1554
1611
  /* @__PURE__ */ a("div", { className: "astw:h-4 astw:w-4 astw:rounded-md astw:bg-muted" }),
1555
1612
  /* @__PURE__ */ a(
1556
1613
  "div",
@@ -1560,15 +1617,15 @@ const Xs = (t) => {
1560
1617
  }
1561
1618
  )
1562
1619
  ] }) }, e)) }) });
1563
- function Mt({ ...t }) {
1620
+ function Ct({ ...t }) {
1564
1621
  return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...t });
1565
1622
  }
1566
- function Et({ className: t, ...e }) {
1623
+ function Tt({ className: t, ...e }) {
1567
1624
  return /* @__PURE__ */ a(
1568
1625
  "ol",
1569
1626
  {
1570
1627
  "data-slot": "breadcrumb-list",
1571
- className: m(
1628
+ className: w(
1572
1629
  "astw:text-muted-foreground astw:flex astw:flex-wrap astw:items-center astw:gap-1.5 astw:text-sm astw:break-words astw:sm:gap-2.5",
1573
1630
  t
1574
1631
  ),
@@ -1576,95 +1633,95 @@ function Et({ className: t, ...e }) {
1576
1633
  }
1577
1634
  );
1578
1635
  }
1579
- function It({ className: t, ...e }) {
1636
+ function kt({ className: t, ...e }) {
1580
1637
  return /* @__PURE__ */ a(
1581
1638
  "li",
1582
1639
  {
1583
1640
  "data-slot": "breadcrumb-item",
1584
- className: m("astw:inline-flex astw:items-center astw:gap-1.5", t),
1641
+ className: w("astw:inline-flex astw:items-center astw:gap-1.5", t),
1585
1642
  ...e
1586
1643
  }
1587
1644
  );
1588
1645
  }
1589
- function Lt({
1646
+ function Rt({
1590
1647
  render: t,
1591
1648
  className: e,
1592
1649
  children: s,
1593
- to: n,
1594
- ...r
1650
+ to: r,
1651
+ ...n
1595
1652
  }) {
1596
- const o = m("astw:hover:text-foreground astw:transition-colors", e);
1597
- return j({
1653
+ const o = w("astw:hover:text-foreground astw:transition-colors", e);
1654
+ return G({
1598
1655
  defaultTagName: "a",
1599
- render: t ?? /* @__PURE__ */ a($, { to: n }),
1656
+ render: t ?? /* @__PURE__ */ a(H, { to: r }),
1600
1657
  props: {
1601
1658
  "data-slot": "breadcrumb-link",
1602
1659
  className: o,
1603
1660
  children: s,
1604
- ...t ? r : { to: n, ...r }
1661
+ ...t ? n : { to: r, ...n }
1605
1662
  }
1606
1663
  });
1607
1664
  }
1608
- function Ia({ children: t, className: e, ...s }) {
1665
+ function rs({ children: t, className: e, ...s }) {
1609
1666
  return /* @__PURE__ */ a(
1610
1667
  "li",
1611
1668
  {
1612
1669
  "data-slot": "breadcrumb-separator",
1613
1670
  role: "presentation",
1614
1671
  "aria-hidden": "true",
1615
- className: m("astw:[&>svg]:size-3.5", e),
1672
+ className: w("astw:[&>svg]:size-3.5", e),
1616
1673
  ...s,
1617
- children: t ?? /* @__PURE__ */ a(W, {})
1674
+ children: t ?? /* @__PURE__ */ a(U, {})
1618
1675
  }
1619
1676
  );
1620
1677
  }
1621
- function La(t, e) {
1678
+ function ns(t, e) {
1622
1679
  if (!e.trim()) return t;
1623
1680
  const s = e.toLowerCase();
1624
1681
  return t.filter(
1625
- (n) => n.title.toLowerCase().includes(s) || n.path.toLowerCase().includes(s)
1682
+ (r) => r.title.toLowerCase().includes(s) || r.path.toLowerCase().includes(s)
1626
1683
  );
1627
1684
  }
1628
- const _a = (t, e) => {
1629
- const s = Ut(e);
1685
+ const os = (t, e) => {
1686
+ const s = Lt(e);
1630
1687
  return t.reduce(
1631
- (n, r) => {
1632
- const o = s(r.meta.title, r.path);
1633
- n[r.path] = {
1688
+ (r, n) => {
1689
+ const o = s(n.meta.title, n.path);
1690
+ r[n.path] = {
1634
1691
  title: o,
1635
1692
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
1636
- breadcrumbTitle: r.meta.breadcrumbTitle
1693
+ breadcrumbTitle: n.meta.breadcrumbTitle
1637
1694
  };
1638
1695
  const i = (l, u) => {
1639
1696
  !l || l.length === 0 || l.forEach((d) => {
1640
- const w = `${u}/${d.path}`, h = s(d.meta.title, d.path);
1641
- n[w] = {
1697
+ const m = `${u}/${d.path}`, h = s(d.meta.title, d.path);
1698
+ r[m] = {
1642
1699
  title: h,
1643
1700
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- breadcrumbTitle exists at runtime but not in CommonPageResource type
1644
1701
  breadcrumbTitle: d.meta.breadcrumbTitle
1645
- }, d.subResources && d.subResources.length > 0 && i(d.subResources, w);
1702
+ }, d.subResources && d.subResources.length > 0 && i(d.subResources, m);
1646
1703
  });
1647
1704
  };
1648
- return r.resources && r.resources.length > 0 && i(r.resources, r.path), n;
1705
+ return n.resources && n.resources.length > 0 && i(n.resources, n.path), r;
1649
1706
  },
1650
1707
  {}
1651
1708
  );
1652
1709
  };
1653
- function za(t, e, s, n) {
1654
- const r = t.split("/").filter((u) => u !== ""), o = e && r[0] === e ? r.slice(1) : r, i = _a(s, n), l = o.map((u, d) => {
1655
- const w = o.slice(0, d + 1).join("/");
1656
- let h = i[w];
1710
+ function is(t, e, s, r) {
1711
+ const n = t.split("/").filter((u) => u !== ""), o = e && n[0] === e ? n.slice(1) : n, i = os(s, r), l = o.map((u, d) => {
1712
+ const m = o.slice(0, d + 1).join("/");
1713
+ let h = i[m];
1657
1714
  if (!h) {
1658
- const b = Object.entries(i).find(([p]) => {
1659
- const v = p.split("/").map((R) => R.startsWith(":") ? "[^/]+" : R).join("/");
1660
- return new RegExp(`^${v}$`).test(w);
1715
+ const v = Object.entries(i).find(([g]) => {
1716
+ const p = g.split("/").map((A) => A.startsWith(":") ? "[^/]+" : A).join("/");
1717
+ return new RegExp(`^${p}$`).test(m);
1661
1718
  })?.[1];
1662
- b && (h = b);
1719
+ v && (h = v);
1663
1720
  }
1664
1721
  let f;
1665
1722
  return h ? typeof h.breadcrumbTitle == "function" ? f = h.breadcrumbTitle(u) : typeof h.breadcrumbTitle == "string" ? f = h.breadcrumbTitle : f = h.title : f = decodeURIComponent(u), {
1666
1723
  segment: u,
1667
- path: w,
1724
+ path: m,
1668
1725
  title: f
1669
1726
  };
1670
1727
  });
@@ -1673,87 +1730,94 @@ function za(t, e, s, n) {
1673
1730
  segments: l
1674
1731
  };
1675
1732
  }
1676
- const $a = () => {
1677
- const { configurations: t } = C(), e = X();
1678
- return za(
1733
+ const ls = () => {
1734
+ const { configurations: t } = D(), e = tt();
1735
+ return is(
1679
1736
  e.pathname,
1680
1737
  t.basePath,
1681
1738
  t.modules,
1682
1739
  t.locale
1683
1740
  );
1684
- }, Wa = () => {
1685
- const { segments: t } = $a(), e = Ne("/:prefix/settings/:suffix"), s = B();
1686
- return e ? /* @__PURE__ */ a(Mt, { 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(It, { children: /* @__PURE__ */ a(Lt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(Mt, { children: /* @__PURE__ */ a(Et, { children: t.map((n, r) => /* @__PURE__ */ c(
1741
+ }, cs = () => {
1742
+ const { segments: t } = ls(), e = Ge("/:prefix/settings/:suffix"), s = I();
1743
+ return e ? /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(Tt, { children: /* @__PURE__ */ a("div", { className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground", children: /* @__PURE__ */ a(kt, { children: /* @__PURE__ */ a(Rt, { to: `/${e.params.prefix}/settings`, children: s("settings") }) }) }) }) }) : /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(Tt, { children: t.map((r, n) => /* @__PURE__ */ c(
1687
1744
  "div",
1688
1745
  {
1689
1746
  className: "astw:inline-flex astw:items-center astw:gap-3 astw:last:text-foreground",
1690
1747
  children: [
1691
- /* @__PURE__ */ a(It, { children: /* @__PURE__ */ a(Lt, { to: n.path, children: n.title }) }),
1692
- r < t.length - 1 && /* @__PURE__ */ a(Ia, {})
1748
+ /* @__PURE__ */ a(kt, { children: /* @__PURE__ */ a(Rt, { to: r.path, children: r.title }) }),
1749
+ n < t.length - 1 && /* @__PURE__ */ a(rs, {})
1693
1750
  ]
1694
1751
  },
1695
- r
1752
+ n
1696
1753
  )) }) });
1697
- }, Fa = () => {
1698
- const { open: t, isIconMode: e } = H();
1699
- return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(ne, { className: "astw:-ml-2.5" }) });
1700
- }, Js = (t) => {
1701
- const e = t.children ? t.children({ Outlet: Ct }) : null, s = Je(), n = () => {
1754
+ }, ds = () => {
1755
+ const { open: t, isIconMode: e } = j();
1756
+ return /* @__PURE__ */ a("div", { className: t && !e ? "astw:md:hidden" : void 0, children: /* @__PURE__ */ a(we, { className: "astw:-ml-2.5" }) });
1757
+ }, vr = (t) => {
1758
+ const e = t.children ? t.children({ Outlet: yt }) : null, s = Ca(), r = () => {
1702
1759
  s.setTheme(s.theme === "dark" ? "light" : "dark");
1703
1760
  };
1704
- return /* @__PURE__ */ a(fa, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
1705
- t.sidebar ?? /* @__PURE__ */ a(Aa, {}),
1706
- /* @__PURE__ */ c(ba, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1761
+ return /* @__PURE__ */ a(Oa, { className: "astw:flex astw:flex-col", children: /* @__PURE__ */ c("div", { className: "astw:flex astw:flex-1", children: [
1762
+ t.sidebar ?? /* @__PURE__ */ a(Ja, {}),
1763
+ /* @__PURE__ */ c(ja, { className: "astw:w-[calc(100%-var(--sidebar-width))]", children: [
1707
1764
  /* @__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: [
1708
1765
  /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:gap-2", children: [
1709
- /* @__PURE__ */ a(Fa, {}),
1710
- /* @__PURE__ */ a(Wa, {})
1766
+ /* @__PURE__ */ a(ds, {}),
1767
+ /* @__PURE__ */ a(cs, {})
1711
1768
  ] }),
1712
- /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(O, { variant: "outline", size: "icon", onClick: n, children: /* @__PURE__ */ a(Pe, {}) }) })
1769
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:items-center astw:gap-2", children: /* @__PURE__ */ a(V, { variant: "outline", size: "icon", onClick: r, children: /* @__PURE__ */ a(Je, {}) }) })
1713
1770
  ] }) }),
1714
- /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(Ct, {}) })
1771
+ /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0", children: e ?? /* @__PURE__ */ a(yt, {}) })
1715
1772
  ] })
1716
1773
  ] }) });
1717
1774
  };
1718
- function Oa({ ...t }) {
1719
- return /* @__PURE__ */ a(x.Root, { "data-slot": "dialog", ...t });
1775
+ function fe({ ...t }) {
1776
+ return /* @__PURE__ */ a(P.Root, { "data-slot": "dialog", ...t });
1720
1777
  }
1721
- function ja({ ...t }) {
1722
- return /* @__PURE__ */ a(x.Portal, { "data-slot": "dialog-portal", ...t });
1778
+ fe.displayName = "Dialog.Root";
1779
+ function pe({ ...t }) {
1780
+ return /* @__PURE__ */ a(P.Trigger, { "data-slot": "dialog-trigger", ...t });
1723
1781
  }
1724
- function Ua({ className: t, ...e }) {
1782
+ pe.displayName = "Dialog.Trigger";
1783
+ function ge({ ...t }) {
1784
+ return /* @__PURE__ */ a(P.Portal, { "data-slot": "dialog-portal", ...t });
1785
+ }
1786
+ ge.displayName = "Dialog.Portal";
1787
+ function be({ ...t }) {
1788
+ return /* @__PURE__ */ a(P.Close, { "data-slot": "dialog-close", ...t });
1789
+ }
1790
+ be.displayName = "Dialog.Close";
1791
+ function ve({ className: t, ...e }) {
1725
1792
  return /* @__PURE__ */ a(
1726
- x.Backdrop,
1793
+ P.Backdrop,
1727
1794
  {
1728
1795
  "data-slot": "dialog-overlay",
1729
- className: m(
1730
- "astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
1796
+ className: w(
1797
+ "astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:fill-mode-forwards astw:fixed astw:inset-0 astw:z-50 astw:bg-black/50",
1731
1798
  t
1732
1799
  ),
1733
1800
  ...e
1734
1801
  }
1735
1802
  );
1736
1803
  }
1737
- function Ha({
1738
- className: t,
1739
- children: e,
1740
- ...s
1741
- }) {
1742
- return /* @__PURE__ */ c(ja, { "data-slot": "dialog-portal", children: [
1743
- /* @__PURE__ */ a(Ua, {}),
1804
+ ve.displayName = "Dialog.Overlay";
1805
+ function xe({ className: t, children: e, ...s }) {
1806
+ return /* @__PURE__ */ c(ge, { "data-slot": "dialog-portal", children: [
1807
+ /* @__PURE__ */ a(ve, {}),
1744
1808
  /* @__PURE__ */ c(
1745
- x.Popup,
1809
+ P.Popup,
1746
1810
  {
1747
1811
  "data-slot": "dialog-content",
1748
- className: m(
1749
- "astw:bg-background astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-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",
1812
+ className: w(
1813
+ "astw:bg-background astw:data-open:animate-in astw:data-ending-style:animate-out astw:data-ending-style:fade-out-0 astw:data-open:fade-in-0 astw:data-ending-style:zoom-out-95 astw:data-open:zoom-in-95 astw:fill-mode-forwards 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",
1750
1814
  t
1751
1815
  ),
1752
1816
  ...s,
1753
1817
  children: [
1754
1818
  e,
1755
- /* @__PURE__ */ c(x.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-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: [
1756
- /* @__PURE__ */ a(Wt, {}),
1819
+ /* @__PURE__ */ c(P.Close, { className: "astw:ring-offset-bg astw:focus:ring-ring astw:data-open:bg-accent astw:data-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: [
1820
+ /* @__PURE__ */ a(At, {}),
1757
1821
  /* @__PURE__ */ a("span", { className: "astw:sr-only", children: "Close" })
1758
1822
  ] })
1759
1823
  ]
@@ -1761,111 +1825,162 @@ function Ha({
1761
1825
  )
1762
1826
  ] });
1763
1827
  }
1764
- function Ka({ className: t, ...e }) {
1828
+ xe.displayName = "Dialog.Content";
1829
+ function ye({ className: t, ...e }) {
1830
+ return /* @__PURE__ */ a(
1831
+ "div",
1832
+ {
1833
+ "data-slot": "dialog-header",
1834
+ className: w(
1835
+ "astw:flex astw:flex-col astw:gap-2 astw:text-center astw:sm:text-left",
1836
+ t
1837
+ ),
1838
+ ...e
1839
+ }
1840
+ );
1841
+ }
1842
+ ye.displayName = "Dialog.Header";
1843
+ function Ne({ className: t, ...e }) {
1765
1844
  return /* @__PURE__ */ a(
1766
- x.Title,
1845
+ "div",
1846
+ {
1847
+ "data-slot": "dialog-footer",
1848
+ className: w(
1849
+ "astw:flex astw:flex-col-reverse astw:gap-2 astw:sm:flex-row astw:sm:justify-end",
1850
+ t
1851
+ ),
1852
+ ...e
1853
+ }
1854
+ );
1855
+ }
1856
+ Ne.displayName = "Dialog.Footer";
1857
+ function Se({ className: t, ...e }) {
1858
+ return /* @__PURE__ */ a(
1859
+ P.Title,
1767
1860
  {
1768
1861
  "data-slot": "dialog-title",
1769
- className: m("astw:text-lg astw:leading-none astw:font-semibold", t),
1862
+ className: w("astw:text-lg astw:leading-none astw:font-semibold", t),
1770
1863
  ...e
1771
1864
  }
1772
1865
  );
1773
1866
  }
1774
- function Va(t) {
1775
- const e = [], s = (n, r, o) => {
1776
- n.forEach((i) => {
1867
+ Se.displayName = "Dialog.Title";
1868
+ function Ce({ className: t, ...e }) {
1869
+ return /* @__PURE__ */ a(
1870
+ P.Description,
1871
+ {
1872
+ "data-slot": "dialog-description",
1873
+ className: w("astw:text-muted-foreground astw:text-sm", t),
1874
+ ...e
1875
+ }
1876
+ );
1877
+ }
1878
+ Ce.displayName = "Dialog.Description";
1879
+ const ot = {
1880
+ Root: fe,
1881
+ Close: be,
1882
+ Content: xe,
1883
+ Description: Ce,
1884
+ Footer: Ne,
1885
+ Header: ye,
1886
+ Title: Se,
1887
+ Trigger: pe
1888
+ };
1889
+ function ws(t) {
1890
+ const e = [], s = (r, n, o) => {
1891
+ r.forEach((i) => {
1777
1892
  const l = [...o, i.title];
1778
1893
  i.url && e.push({
1779
1894
  path: i.url,
1780
1895
  title: i.title,
1781
- icon: r,
1896
+ icon: n,
1782
1897
  breadcrumb: l
1783
- }), i.items && i.items.length > 0 && s(i.items, r, l);
1898
+ }), i.items && i.items.length > 0 && s(i.items, n, l);
1784
1899
  });
1785
1900
  };
1786
- return t.forEach((n) => {
1787
- n.url && e.push({
1788
- path: n.url,
1789
- title: n.title,
1790
- icon: n.icon,
1791
- breadcrumb: [n.title]
1792
- }), s(n.items, n.icon, [n.title]);
1901
+ return t.forEach((r) => {
1902
+ r.url && e.push({
1903
+ path: r.url,
1904
+ title: r.title,
1905
+ icon: r.icon,
1906
+ breadcrumb: [r.title]
1907
+ }), s(r.items, r.icon, [r.title]);
1793
1908
  }), e;
1794
1909
  }
1795
- function Ga({ routes: t }) {
1796
- const e = Se(), s = jt(null), [n, r] = V(!1), [o, i] = V(""), [l, u] = V(0), d = M(() => La(t, o), [t, o]), w = D((p) => {
1797
- i(p), u(0);
1910
+ function us({ routes: t }) {
1911
+ const e = Ye(), s = It(null), [r, n] = q(!1), [o, i] = q(""), [l, u] = q(0), d = $(() => ns(t, o), [t, o]), m = L((g) => {
1912
+ i(g), u(0);
1798
1913
  }, []);
1799
- F(() => {
1800
- const p = (v) => {
1801
- (v.metaKey || v.ctrlKey) && v.key === "k" && (v.preventDefault(), r((k) => !k));
1914
+ K(() => {
1915
+ const g = (p) => {
1916
+ (p.metaKey || p.ctrlKey) && p.key === "k" && (p.preventDefault(), n((x) => !x));
1802
1917
  };
1803
- return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
1918
+ return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
1804
1919
  }, []);
1805
- const h = D((p) => {
1806
- r(p), p || (i(""), u(0));
1920
+ const h = L((g) => {
1921
+ n(g), g || (i(""), u(0));
1807
1922
  }, []);
1808
- F(() => {
1923
+ K(() => {
1809
1924
  s.current && s.current.querySelector(`[data-index="${l}"]`)?.scrollIntoView({ block: "nearest" });
1810
1925
  }, [l]);
1811
- const f = D(
1812
- (p) => {
1813
- e(p.path), r(!1), i("");
1926
+ const f = L(
1927
+ (g) => {
1928
+ e(g.path), n(!1), i("");
1814
1929
  },
1815
1930
  [e]
1816
- ), b = D(
1817
- (p) => {
1818
- if (!p.nativeEvent.isComposing)
1819
- switch (p.key) {
1931
+ ), v = L(
1932
+ (g) => {
1933
+ if (!g.nativeEvent.isComposing)
1934
+ switch (g.key) {
1820
1935
  case "ArrowDown":
1821
- p.preventDefault(), u((v) => v < d.length - 1 ? v + 1 : v);
1936
+ g.preventDefault(), u((p) => p < d.length - 1 ? p + 1 : p);
1822
1937
  break;
1823
1938
  case "ArrowUp":
1824
- p.preventDefault(), u((v) => v > 0 ? v - 1 : v);
1939
+ g.preventDefault(), u((p) => p > 0 ? p - 1 : p);
1825
1940
  break;
1826
1941
  case "Enter":
1827
- p.preventDefault(), d[l] && f(d[l]);
1942
+ g.preventDefault(), d[l] && f(d[l]);
1828
1943
  break;
1829
1944
  }
1830
1945
  },
1831
1946
  [d, l, f]
1832
1947
  );
1833
1948
  return {
1834
- open: n,
1949
+ open: r,
1835
1950
  handleOpenChange: h,
1836
1951
  search: o,
1837
- setSearch: w,
1952
+ setSearch: m,
1838
1953
  selectedIndex: l,
1839
1954
  filteredRoutes: d,
1840
1955
  handleSelect: f,
1841
- handleKeyDown: b,
1956
+ handleKeyDown: v,
1842
1957
  listRef: s
1843
1958
  };
1844
1959
  }
1845
- function qa({ navItems: t }) {
1846
- const e = B(), s = M(() => Va(t), [t]), {
1847
- open: n,
1848
- handleOpenChange: r,
1960
+ function ms({ navItems: t }) {
1961
+ const e = I(), s = $(() => ws(t), [t]), {
1962
+ open: r,
1963
+ handleOpenChange: n,
1849
1964
  search: o,
1850
1965
  setSearch: i,
1851
1966
  selectedIndex: l,
1852
1967
  filteredRoutes: u,
1853
1968
  handleSelect: d,
1854
- handleKeyDown: w,
1969
+ handleKeyDown: m,
1855
1970
  listRef: h
1856
- } = Ga({ routes: s });
1857
- return /* @__PURE__ */ a(Oa, { open: n, onOpenChange: r, children: /* @__PURE__ */ c(
1858
- Ha,
1971
+ } = us({ routes: s });
1972
+ return /* @__PURE__ */ a(ot.Root, { open: r, onOpenChange: n, children: /* @__PURE__ */ c(
1973
+ ot.Content,
1859
1974
  {
1860
1975
  className: "astw:p-0 astw:gap-0 astw:sm:max-w-2xl astw:overflow-hidden",
1861
- onKeyDown: w,
1976
+ onKeyDown: m,
1862
1977
  "aria-describedby": void 0,
1863
1978
  children: [
1864
- /* @__PURE__ */ a(Ka, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1979
+ /* @__PURE__ */ a(ot.Title, { className: "astw:sr-only", children: e("commandPaletteSearch") }),
1865
1980
  /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:border-b astw:px-3 astw:py-1", children: [
1866
- /* @__PURE__ */ a(Ae, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
1981
+ /* @__PURE__ */ a(ta, { className: "astw:mr-2 astw:h-4 astw:w-4 astw:shrink-0 astw:opacity-50" }),
1867
1982
  /* @__PURE__ */ a(
1868
- ca,
1983
+ Ia,
1869
1984
  {
1870
1985
  value: o,
1871
1986
  onChange: (f) => i(f.target.value),
@@ -1875,14 +1990,14 @@ function qa({ navItems: t }) {
1875
1990
  }
1876
1991
  )
1877
1992
  ] }),
1878
- /* @__PURE__ */ a("div", { ref: h, className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden", 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, b) => /* @__PURE__ */ c(
1993
+ /* @__PURE__ */ a("div", { ref: h, className: "astw:max-h-75 astw:overflow-y-auto astw:overflow-x-hidden", 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, v) => /* @__PURE__ */ c(
1879
1994
  "button",
1880
1995
  {
1881
- "data-index": b,
1996
+ "data-index": v,
1882
1997
  onClick: () => d(f),
1883
- className: m(
1998
+ className: w(
1884
1999
  "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",
1885
- b === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
2000
+ v === l ? "astw:bg-accent astw:text-accent-foreground" : "astw:hover:bg-accent astw:hover:text-accent-foreground"
1886
2001
  ),
1887
2002
  children: [
1888
2003
  /* @__PURE__ */ a("span", { className: "astw:truncate astw:w-full astw:text-left", children: f.breadcrumb.join(" > ") }),
@@ -1898,30 +2013,30 @@ function qa({ navItems: t }) {
1898
2013
  }
1899
2014
  ) });
1900
2015
  }
1901
- function tn() {
1902
- const t = Qt();
1903
- return /* @__PURE__ */ a(lt, { fallback: null, children: /* @__PURE__ */ a($t, { resolve: t, children: (e) => /* @__PURE__ */ a(qa, { navItems: e ?? [] }) }) });
2016
+ function xr() {
2017
+ const t = jt();
2018
+ return /* @__PURE__ */ a(dt, { fallback: null, children: /* @__PURE__ */ a(Mt, { resolve: t, children: (e) => /* @__PURE__ */ a(ms, { navItems: e ?? [] }) }) });
1904
2019
  }
1905
- function Ya(t, e, s) {
2020
+ function hs(t, e, s) {
1906
2021
  if (s.current === null || s.current.contextData !== e || s.current.guards !== t) {
1907
- const n = Za(t, e), r = {
2022
+ const r = gs(t, e), n = {
1908
2023
  contextData: e,
1909
2024
  guards: t,
1910
- promise: n,
1911
- state: { status: "pending", promise: n }
2025
+ promise: r,
2026
+ state: { status: "pending", promise: r }
1912
2027
  };
1913
- n.then(
2028
+ r.then(
1914
2029
  (o) => {
1915
- r.state = { status: "fulfilled", value: o };
2030
+ n.state = { status: "fulfilled", value: o };
1916
2031
  },
1917
2032
  (o) => {
1918
- r.state = { status: "rejected", error: o };
2033
+ n.state = { status: "rejected", error: o };
1919
2034
  }
1920
- ), s.current = r;
2035
+ ), s.current = n;
1921
2036
  }
1922
2037
  return s.current;
1923
2038
  }
1924
- function Qa(t) {
2039
+ function fs(t) {
1925
2040
  const { state: e } = t;
1926
2041
  switch (e.status) {
1927
2042
  case "fulfilled":
@@ -1932,20 +2047,20 @@ function Qa(t) {
1932
2047
  throw e.promise;
1933
2048
  }
1934
2049
  }
1935
- const en = (t) => {
1936
- const { guards: e, children: s, fallback: n = null, loading: r = null } = t, { contextData: o } = Ht(), i = jt(null), l = Ya(e, o, i);
1937
- return /* @__PURE__ */ a(lt, { fallback: r, children: /* @__PURE__ */ a(Xa, { cache: l, fallback: n, children: s }) });
1938
- }, Xa = (t) => Qa(t.cache).type === "pass" ? /* @__PURE__ */ a(S, { children: t.children }) : /* @__PURE__ */ a(S, { children: t.fallback }), Za = async (t, e) => {
2050
+ const yr = (t) => {
2051
+ const { guards: e, children: s, fallback: r = null, loading: n = null } = t, { contextData: o } = $t(), i = It(null), l = hs(e, o, i);
2052
+ return /* @__PURE__ */ a(dt, { fallback: n, children: /* @__PURE__ */ a(ps, { cache: l, fallback: r, children: s }) });
2053
+ }, ps = (t) => fs(t.cache).type === "pass" ? /* @__PURE__ */ a(T, { children: t.children }) : /* @__PURE__ */ a(T, { children: t.fallback }), gs = async (t, e) => {
1939
2054
  const s = { context: e };
1940
- for (const n of t) {
1941
- const r = await n(s);
1942
- if (r.type !== "pass")
1943
- return r;
2055
+ for (const r of t) {
2056
+ const n = await r(s);
2057
+ if (n.type !== "pass")
2058
+ return n;
1944
2059
  }
1945
2060
  return { type: "pass" };
1946
2061
  };
1947
- function an(t) {
1948
- const e = Le(t), { appUri: s } = t;
2062
+ function Nr(t) {
2063
+ const e = oa(t), { appUri: s } = t;
1949
2064
  return {
1950
2065
  ...e,
1951
2066
  getAppUri() {
@@ -1953,25 +2068,25 @@ function an(t) {
1953
2068
  }
1954
2069
  };
1955
2070
  }
1956
- function Ja(t) {
2071
+ function bs(t) {
1957
2072
  const e = new URLSearchParams(t.search);
1958
2073
  e.delete("code"), e.delete("state");
1959
2074
  const s = e.toString();
1960
2075
  return t.pathname + (s ? `?${s}` : "") + t.hash;
1961
2076
  }
1962
- const le = Z(null), sn = (t) => {
1963
- const e = t.client, s = D(
2077
+ const Te = et(null), Sr = (t) => {
2078
+ const e = t.client, s = L(
1964
2079
  (l) => e.addEventListener((u) => {
1965
2080
  u.type === "auth_state_changed" && l();
1966
2081
  }),
1967
2082
  [e]
1968
- ), n = D(() => e.getState(), [e]), r = Ot(s, n);
1969
- F(() => {
2083
+ ), r = L(() => e.getState(), [e]), n = Et(s, r);
2084
+ K(() => {
1970
2085
  (async () => {
1971
2086
  if (new URLSearchParams(window.location.search).has("code"))
1972
2087
  try {
1973
2088
  await e.handleCallback();
1974
- const d = Ja(new URL(window.location.href));
2089
+ const d = bs(new URL(window.location.href));
1975
2090
  window.history.replaceState({}, "", d);
1976
2091
  } catch (d) {
1977
2092
  console.error("Failed to handle callback:", d);
@@ -1979,15 +2094,15 @@ const le = Z(null), sn = (t) => {
1979
2094
  else
1980
2095
  await e.checkAuthStatus();
1981
2096
  })();
1982
- }, [e]), F(() => {
1983
- t.autoLogin && (!r.isReady || r.isAuthenticated || e.login());
1984
- }, [r.isReady, r.isAuthenticated, t.autoLogin, e]);
1985
- const o = r.isAuthenticated, i = t.guardComponent && (!r.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
2097
+ }, [e]), K(() => {
2098
+ t.autoLogin && (!n.isReady || n.isAuthenticated || e.login());
2099
+ }, [n.isReady, n.isAuthenticated, t.autoLogin, e]);
2100
+ const o = n.isAuthenticated, i = t.guardComponent && (!n.isReady || !o) ? /* @__PURE__ */ a(t.guardComponent, {}) : t.children;
1986
2101
  return /* @__PURE__ */ a(
1987
- le.Provider,
2102
+ Te.Provider,
1988
2103
  {
1989
2104
  value: {
1990
- authState: r,
2105
+ authState: n,
1991
2106
  login: () => e.login(),
1992
2107
  logout: () => e.logout(),
1993
2108
  checkAuthStatus: () => e.checkAuthStatus(),
@@ -1996,23 +2111,23 @@ const le = Z(null), sn = (t) => {
1996
2111
  children: i
1997
2112
  }
1998
2113
  );
1999
- }, ce = () => {
2000
- const t = I(le);
2114
+ }, ke = () => {
2115
+ const t = z(Te);
2001
2116
  if (!t)
2002
2117
  throw new Error("useAuth/useAuthSuspense must be used within an AuthProvider");
2003
2118
  return t;
2004
- }, nn = () => {
2005
- const t = ce(), { isAuthenticated: e, error: s, isReady: n } = t.authState;
2119
+ }, Cr = () => {
2120
+ const t = ke(), { isAuthenticated: e, error: s, isReady: r } = t.authState;
2006
2121
  return {
2007
2122
  error: s,
2008
2123
  isAuthenticated: e,
2009
- isReady: n,
2124
+ isReady: r,
2010
2125
  login: t.login,
2011
2126
  logout: t.logout,
2012
2127
  checkAuthStatus: t.checkAuthStatus
2013
2128
  };
2014
- }, rn = () => {
2015
- const t = ce();
2129
+ }, Tr = () => {
2130
+ const t = ke();
2016
2131
  if (!t.authState.isReady)
2017
2132
  throw t.ready();
2018
2133
  const { isAuthenticated: e, error: s } = t.authState;
@@ -2023,7 +2138,16 @@ const le = Z(null), sn = (t) => {
2023
2138
  logout: t.logout,
2024
2139
  checkAuthStatus: t.checkAuthStatus
2025
2140
  };
2026
- }, on = () => Ee, ts = it(
2141
+ };
2142
+ function kr() {
2143
+ return {
2144
+ for(t, ...e) {
2145
+ const s = e[0];
2146
+ return s ? t.replace(/:([^/?]+)|\*([^/?]+)/g, (r, n, o) => n ? encodeURIComponent(s[n] ?? "") : (s[o] ?? "").split("/").map((l) => encodeURIComponent(l)).join("/")) : t;
2147
+ }
2148
+ };
2149
+ }
2150
+ const Rr = () => ra, vs = ct(
2027
2151
  "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",
2028
2152
  {
2029
2153
  variants: {
@@ -2045,43 +2169,43 @@ const le = Z(null), sn = (t) => {
2045
2169
  variant: "default"
2046
2170
  }
2047
2171
  }
2048
- ), es = {
2172
+ ), xs = {
2049
2173
  "outline-success": "astw:bg-green-500",
2050
2174
  "outline-warning": "astw:bg-orange-500",
2051
2175
  "outline-error": "astw:bg-red-500",
2052
2176
  "outline-info": "astw:bg-blue-500",
2053
2177
  "outline-neutral": "astw:bg-neutral-400"
2054
2178
  };
2055
- function as({ variant: t }) {
2056
- const e = es[t];
2057
- 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;
2058
- }
2059
- function ss({ className: t, variant: e, children: s, ...n }) {
2060
- const r = e?.toString().startsWith("outline-");
2061
- return /* @__PURE__ */ c("div", { className: m(ts({ variant: e }), t), ...n, children: [
2062
- r && /* @__PURE__ */ a(as, { variant: e }),
2179
+ function ys({ variant: t }) {
2180
+ const e = xs[t];
2181
+ 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: w("astw:size-1.75 astw:rounded-full", e) }) }) : null;
2182
+ }
2183
+ function Ns({ className: t, variant: e, children: s, ...r }) {
2184
+ const n = e?.toString().startsWith("outline-");
2185
+ return /* @__PURE__ */ c("div", { className: w(vs({ variant: e }), t), ...r, children: [
2186
+ n && /* @__PURE__ */ a(ys, { variant: e }),
2063
2187
  s
2064
2188
  ] });
2065
2189
  }
2066
- function ns(t) {
2190
+ function Ss(t) {
2067
2191
  return t.type === "divider";
2068
2192
  }
2069
- function rs(t) {
2193
+ function Cs(t) {
2070
2194
  return t.type !== "divider" && "key" in t;
2071
2195
  }
2072
- function J(t, e) {
2073
- return e.split(".").reduce((s, n) => {
2074
- if (s && typeof s == "object" && n in s)
2075
- return s[n];
2196
+ function at(t, e) {
2197
+ return e.split(".").reduce((s, r) => {
2198
+ if (s && typeof s == "object" && r in s)
2199
+ return s[r];
2076
2200
  }, t);
2077
2201
  }
2078
2202
  function N(t) {
2079
2203
  return t == null || t === "";
2080
2204
  }
2081
- function os(t) {
2205
+ function Ts(t) {
2082
2206
  return t.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
2083
2207
  }
2084
- function is(t, e = "medium") {
2208
+ function ks(t, e = "medium") {
2085
2209
  if (N(t)) return "";
2086
2210
  const s = t instanceof Date ? t : new Date(String(t));
2087
2211
  if (isNaN(s.getTime())) return String(t);
@@ -2106,14 +2230,14 @@ function is(t, e = "medium") {
2106
2230
  year: "numeric"
2107
2231
  });
2108
2232
  case "relative": {
2109
- const r = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), o = Math.floor(r / (1e3 * 60 * 60 * 24));
2233
+ const n = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), o = Math.floor(n / (1e3 * 60 * 60 * 24));
2110
2234
  return o === 0 ? "Today" : o === 1 ? "Yesterday" : o < 7 ? `${o} days ago` : o < 30 ? `${Math.floor(o / 7)} weeks ago` : o < 365 ? `${Math.floor(o / 30)} months ago` : `${Math.floor(o / 365)} years ago`;
2111
2235
  }
2112
2236
  default:
2113
2237
  return s.toLocaleDateString();
2114
2238
  }
2115
2239
  }
2116
- function ls(t, e) {
2240
+ function Rs(t, e) {
2117
2241
  if (N(t)) return "";
2118
2242
  const s = typeof t == "number" ? t : parseFloat(String(t));
2119
2243
  if (isNaN(s)) return String(t);
@@ -2126,201 +2250,201 @@ function ls(t, e) {
2126
2250
  return `${e || "$"}${s.toFixed(2)}`;
2127
2251
  }
2128
2252
  }
2129
- function cs(t) {
2253
+ function Ps(t) {
2130
2254
  if (N(t)) return [];
2131
2255
  if (typeof t == "string")
2132
2256
  return t.split(/[,\n]/).map((e) => e.trim()).filter(Boolean);
2133
2257
  if (typeof t == "object" && t !== null) {
2134
2258
  const e = t, s = [];
2135
2259
  e.line1 && s.push(String(e.line1)), e.line2 && s.push(String(e.line2));
2136
- const n = [e.city, e.state || e.province, e.zip || e.postalCode].filter(Boolean).join(", ");
2137
- return n && s.push(n), e.country && s.push(String(e.country)), s;
2260
+ const r = [e.city, e.state || e.province, e.zip || e.postalCode].filter(Boolean).join(", ");
2261
+ return r && s.push(r), e.country && s.push(String(e.country)), s;
2138
2262
  }
2139
2263
  return [String(t)];
2140
2264
  }
2141
- function de({ value: t }) {
2142
- const [e, s] = g.useState(!1);
2143
- return /* @__PURE__ */ c(pt, { children: [
2265
+ function Re({ value: t }) {
2266
+ const [e, s] = b.useState(!1), r = async (n) => {
2267
+ n.stopPropagation();
2268
+ try {
2269
+ await navigator.clipboard.writeText(t), s(!0), setTimeout(() => s(!1), 2e3);
2270
+ } catch {
2271
+ }
2272
+ };
2273
+ return /* @__PURE__ */ c(C.Root, { children: [
2144
2274
  /* @__PURE__ */ a(
2145
- ft,
2275
+ C.Trigger,
2146
2276
  {
2147
2277
  render: /* @__PURE__ */ a(
2148
2278
  "button",
2149
2279
  {
2150
- onClick: async (r) => {
2151
- r.stopPropagation();
2152
- try {
2153
- await navigator.clipboard.writeText(t), s(!0), setTimeout(() => s(!1), 2e3);
2154
- } catch {
2155
- }
2156
- },
2280
+ onClick: r,
2157
2281
  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"
2158
2282
  }
2159
2283
  ),
2160
- children: e ? /* @__PURE__ */ a(Be, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(De, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
2284
+ children: e ? /* @__PURE__ */ a(ea, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 }) : /* @__PURE__ */ a(aa, { className: "astw:h-3 astw:w-3", strokeWidth: 2.5 })
2161
2285
  }
2162
2286
  ),
2163
- /* @__PURE__ */ a(gt, { side: "top", children: e ? "Copied!" : "Copy" })
2287
+ /* @__PURE__ */ a(C.Content, { side: "top", children: e ? "Copied!" : "Copy" })
2164
2288
  ] });
2165
2289
  }
2166
- const T = "–";
2167
- function ds({ field: t }) {
2168
- const e = N(t.value) ? T : String(t.value), s = t.meta?.copyable && !N(t.value), n = t.meta?.truncateLines, r = g.useRef(null), [o, i] = g.useState(!1);
2169
- g.useEffect(() => {
2170
- if (!n) {
2290
+ const M = "–";
2291
+ function Ds({ field: t }) {
2292
+ const e = N(t.value) ? M : String(t.value), s = t.meta?.copyable && !N(t.value), r = t.meta?.truncateLines, n = b.useRef(null), [o, i] = b.useState(!1);
2293
+ b.useEffect(() => {
2294
+ if (!r) {
2171
2295
  i(!1);
2172
2296
  return;
2173
2297
  }
2174
2298
  const d = () => {
2175
- if (r.current) {
2176
- const h = r.current;
2299
+ if (n.current) {
2300
+ const h = n.current;
2177
2301
  i(h.scrollHeight > h.clientHeight + 1);
2178
2302
  }
2179
- }, w = setTimeout(d, 50);
2303
+ }, m = setTimeout(d, 50);
2180
2304
  return window.addEventListener("resize", d), () => {
2181
- clearTimeout(w), window.removeEventListener("resize", d);
2305
+ clearTimeout(m), window.removeEventListener("resize", d);
2182
2306
  };
2183
- }, [e, n]);
2184
- const l = n && n > 0 ? {
2307
+ }, [e, r]);
2308
+ const l = r && r > 0 ? {
2185
2309
  display: "-webkit-box",
2186
- WebkitLineClamp: n,
2310
+ WebkitLineClamp: r,
2187
2311
  WebkitBoxOrient: "vertical",
2188
2312
  overflow: "hidden"
2189
2313
  } : void 0, u = /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
2190
2314
  /* @__PURE__ */ a(
2191
2315
  "p",
2192
2316
  {
2193
- ref: r,
2317
+ ref: n,
2194
2318
  className: "astw:text-sm astw:font-medium astw:text-foreground astw:wrap-break-word astw:m-0",
2195
2319
  style: l,
2196
2320
  children: e
2197
2321
  }
2198
2322
  ),
2199
- s && /* @__PURE__ */ a(de, { value: String(t.value) })
2323
+ s && /* @__PURE__ */ a(Re, { value: String(t.value) })
2200
2324
  ] });
2201
- return n && o ? /* @__PURE__ */ c(pt, { children: [
2202
- /* @__PURE__ */ a(ft, { render: /* @__PURE__ */ a("span", { className: "astw:cursor-default" }), children: u }),
2203
- /* @__PURE__ */ a(gt, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
2325
+ return r && o ? /* @__PURE__ */ c(C.Root, { children: [
2326
+ /* @__PURE__ */ a(C.Trigger, { render: /* @__PURE__ */ a("span", { className: "astw:cursor-default" }), children: u }),
2327
+ /* @__PURE__ */ a(C.Content, { side: "bottom", style: { maxWidth: 320 }, children: /* @__PURE__ */ a("p", { className: "astw:text-sm", children: e }) })
2204
2328
  ] }) : u;
2205
2329
  }
2206
- function us({ field: t }) {
2330
+ function Ms({ field: t }) {
2207
2331
  if (N(t.value))
2208
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2209
- const e = String(t.value), s = t.meta?.badgeVariantMap || {}, n = e.toLowerCase(), r = s[e] || s[n] || "outline-neutral";
2210
- return /* @__PURE__ */ a(ss, { variant: r, className: "astw:w-fit", children: os(e) });
2332
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2333
+ const e = String(t.value), s = t.meta?.badgeVariantMap || {}, r = e.toLowerCase(), n = s[e] || s[r] || "outline-neutral";
2334
+ return /* @__PURE__ */ a(Ns, { variant: n, className: "astw:w-fit", children: Ts(e) });
2211
2335
  }
2212
- function ws({ field: t }) {
2336
+ function As({ field: t }) {
2213
2337
  if (N(t.value))
2214
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2215
- const e = t.meta?.currencyKey || "currency", s = J(t.data, e), n = ls(t.value, s);
2216
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: n });
2338
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2339
+ const e = t.meta?.currencyKey || "currency", s = at(t.data, e), r = Rs(t.value, s);
2340
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:tabular-nums", children: r });
2217
2341
  }
2218
- function ms({ field: t }) {
2342
+ function Bs({ field: t }) {
2219
2343
  if (N(t.value))
2220
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2221
- const e = t.meta?.dateFormat || "medium", s = is(t.value, e);
2344
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2345
+ const e = t.meta?.dateFormat || "medium", s = ks(t.value, e);
2222
2346
  return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: s });
2223
2347
  }
2224
- function hs({ field: t }) {
2348
+ function Es({ field: t }) {
2225
2349
  if (N(t.value))
2226
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2227
- const e = t.meta?.hrefKey, s = e ? J(t.data, e) : void 0, n = t.meta?.external ?? !1, r = String(t.value);
2350
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2351
+ const e = t.meta?.hrefKey, s = e ? at(t.data, e) : void 0, r = t.meta?.external ?? !1, n = String(t.value);
2228
2352
  return s ? /* @__PURE__ */ c(
2229
2353
  "a",
2230
2354
  {
2231
2355
  href: s,
2232
- target: n ? "_blank" : void 0,
2233
- rel: n ? "noopener noreferrer" : void 0,
2356
+ target: r ? "_blank" : void 0,
2357
+ rel: r ? "noopener noreferrer" : void 0,
2234
2358
  className: "astw:inline-flex astw:items-center astw:gap-1 astw:text-sm astw:text-primary astw:hover:underline",
2235
2359
  children: [
2236
- r,
2237
- n && /* @__PURE__ */ a(Ft, { className: "astw:h-3 astw:w-3" })
2360
+ n,
2361
+ r && /* @__PURE__ */ a(Bt, { className: "astw:h-3 astw:w-3" })
2238
2362
  ]
2239
2363
  }
2240
- ) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: r });
2364
+ ) : /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
2241
2365
  }
2242
- function ps({ field: t }) {
2366
+ function Is({ field: t }) {
2243
2367
  if (N(t.value))
2244
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2245
- const e = cs(t.value), s = t.meta?.copyable && !N(t.value), n = e.join(`
2368
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2369
+ const e = Ps(t.value), s = t.meta?.copyable && !N(t.value), r = e.join(`
2246
2370
  `);
2247
2371
  return /* @__PURE__ */ c("div", { className: "astw:flex astw:items-start astw:gap-1 astw:min-w-0", children: [
2248
- /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((r, o) => /* @__PURE__ */ c(g.Fragment, { children: [
2249
- r,
2372
+ /* @__PURE__ */ a("address", { className: "astw:text-sm astw:font-medium astw:text-foreground astw:not-italic", children: e.map((n, o) => /* @__PURE__ */ c(b.Fragment, { children: [
2373
+ n,
2250
2374
  o < e.length - 1 && /* @__PURE__ */ a("br", {})
2251
2375
  ] }, o)) }),
2252
- s && /* @__PURE__ */ a(de, { value: n })
2376
+ s && /* @__PURE__ */ a(Re, { value: r })
2253
2377
  ] });
2254
2378
  }
2255
- function fs({ field: t }) {
2379
+ function Ls({ field: t }) {
2256
2380
  if (N(t.value))
2257
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2258
- const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, n = e ? J(t.data, e) : void 0, r = String(t.value);
2259
- if (!n || !s)
2260
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: r });
2261
- const o = s.replace("{id}", n);
2262
- return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: r });
2263
- }
2264
- function _t(t) {
2381
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2382
+ const e = t.meta?.referenceIdKey, s = t.meta?.referenceUrlPattern, r = e ? at(t.data, e) : void 0, n = String(t.value);
2383
+ if (!r || !s)
2384
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: n });
2385
+ const o = s.replace("{id}", r);
2386
+ return /* @__PURE__ */ a("a", { href: o, className: "astw:text-sm astw:text-primary astw:hover:underline", children: n });
2387
+ }
2388
+ function Pt(t) {
2265
2389
  switch (t.type) {
2266
2390
  case "text":
2267
- return /* @__PURE__ */ a(ds, { field: t });
2391
+ return /* @__PURE__ */ a(Ds, { field: t });
2268
2392
  case "badge":
2269
- return /* @__PURE__ */ a(us, { field: t });
2393
+ return /* @__PURE__ */ a(Ms, { field: t });
2270
2394
  case "money":
2271
- return /* @__PURE__ */ a(ws, { field: t });
2395
+ return /* @__PURE__ */ a(As, { field: t });
2272
2396
  case "date":
2273
- return /* @__PURE__ */ a(ms, { field: t });
2397
+ return /* @__PURE__ */ a(Bs, { field: t });
2274
2398
  case "link":
2275
- return /* @__PURE__ */ a(hs, { field: t });
2399
+ return /* @__PURE__ */ a(Es, { field: t });
2276
2400
  case "address":
2277
- return /* @__PURE__ */ a(ps, { field: t });
2401
+ return /* @__PURE__ */ a(Is, { field: t });
2278
2402
  case "reference":
2279
- return /* @__PURE__ */ a(fs, { field: t });
2403
+ return /* @__PURE__ */ a(Ls, { field: t });
2280
2404
  default:
2281
- return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: T });
2405
+ return /* @__PURE__ */ a("span", { className: "astw:text-sm astw:font-medium astw:text-foreground", children: M });
2282
2406
  }
2283
2407
  }
2284
- function gs(t) {
2408
+ function $s(t) {
2285
2409
  if (t.emptyBehavior !== "hide") return !1;
2286
2410
  const e = t.value;
2287
2411
  return e == null || e === "";
2288
2412
  }
2289
- function bs(t) {
2413
+ function _s(t) {
2290
2414
  return !1;
2291
2415
  }
2292
- function vs(t, e, s) {
2293
- const n = J(e, t.key);
2416
+ function zs(t, e, s) {
2417
+ const r = at(e, t.key);
2294
2418
  return {
2295
2419
  id: `${t.key}-${s}`,
2296
2420
  label: t.label,
2297
2421
  type: t.type ?? "text",
2298
- value: n,
2422
+ value: r,
2299
2423
  emptyBehavior: t.emptyBehavior ?? "dash",
2300
2424
  meta: t.meta,
2301
2425
  data: e
2302
2426
  };
2303
2427
  }
2304
- function xs(t, e) {
2428
+ function Fs(t, e) {
2305
2429
  const s = [];
2306
- let n = [], r = 0, o = 0;
2430
+ let r = [], n = 0, o = 0;
2307
2431
  for (const i of t)
2308
- if (ns(i))
2309
- n.length > 0 && (s.push({
2310
- id: `section-${r}`,
2311
- fields: n
2312
- }), r++, n = []);
2313
- else if (rs(i)) {
2314
- const l = vs(i, e, o);
2315
- o++, gs(l) || n.push(l);
2316
- }
2317
- return n.length > 0 && s.push({ id: `section-${r}`, fields: n }), s;
2318
- }
2319
- function zt({ label: t, children: e, fullWidth: s }) {
2432
+ if (Ss(i))
2433
+ r.length > 0 && (s.push({
2434
+ id: `section-${n}`,
2435
+ fields: r
2436
+ }), n++, r = []);
2437
+ else if (Cs(i)) {
2438
+ const l = zs(i, e, o);
2439
+ o++, $s(l) || r.push(l);
2440
+ }
2441
+ return r.length > 0 && s.push({ id: `section-${n}`, fields: r }), s;
2442
+ }
2443
+ function Dt({ label: t, children: e, fullWidth: s }) {
2320
2444
  return /* @__PURE__ */ c(
2321
2445
  "div",
2322
2446
  {
2323
- className: m(
2447
+ className: w(
2324
2448
  "astw:flex astw:flex-col astw:gap-1 astw:min-w-0 astw:py-2",
2325
2449
  s && "astw:col-span-full"
2326
2450
  ),
@@ -2331,54 +2455,56 @@ function zt({ label: t, children: e, fullWidth: s }) {
2331
2455
  }
2332
2456
  );
2333
2457
  }
2334
- function ln({
2458
+ function Pr({
2335
2459
  data: t,
2336
2460
  title: e,
2337
2461
  fields: s,
2338
- columns: n = 3,
2339
- className: r,
2340
- headerAction: o
2462
+ columns: r = 3,
2463
+ className: n,
2464
+ style: o,
2465
+ headerAction: i
2341
2466
  }) {
2342
- const i = xs(s, t), l = i.some((w) => w.fields.length > 0), u = m(
2467
+ const l = Fs(s, t), u = l.some((h) => h.fields.length > 0), d = w(
2343
2468
  "astw:grid astw:gap-x-6 astw:gap-y-4",
2344
2469
  // Default: 1 column
2345
2470
  "astw:grid-cols-1",
2346
2471
  // Container queries for responsive columns
2347
- n === 4 ? (
2472
+ r === 4 ? (
2348
2473
  // 4-column mode: 1 → 2 → 3 → 4 columns
2349
2474
  "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3 astw:@[800px]:grid-cols-4"
2350
2475
  ) : (
2351
2476
  // 3-column mode: 1 → 2 → 3 columns
2352
2477
  "astw:@[400px]:grid-cols-2 astw:@[600px]:grid-cols-3"
2353
2478
  )
2354
- ), d = (w) => {
2355
- const h = w.fields.filter((b) => !0), f = w.fields.filter((b) => bs());
2479
+ ), m = (h) => {
2480
+ const f = h.fields.filter((g) => !0), v = h.fields.filter((g) => _s());
2356
2481
  return /* @__PURE__ */ c("div", { className: "astw:space-y-4", children: [
2357
- h.length > 0 && /* @__PURE__ */ a("div", { className: u, children: h.map((b) => /* @__PURE__ */ a(zt, { label: b.label, children: _t(b) }, b.id)) }),
2358
- f.length > 0 && /* @__PURE__ */ a("div", { className: u, children: f.map((b) => /* @__PURE__ */ a(zt, { label: b.label, fullWidth: !0, children: _t(b) }, b.id)) })
2359
- ] }, w.id);
2482
+ f.length > 0 && /* @__PURE__ */ a("div", { className: d, children: f.map((g) => /* @__PURE__ */ a(Dt, { label: g.label, children: Pt(g) }, g.id)) }),
2483
+ v.length > 0 && /* @__PURE__ */ a("div", { className: d, children: v.map((g) => /* @__PURE__ */ a(Dt, { label: g.label, fullWidth: !0, children: Pt(g) }, g.id)) })
2484
+ ] }, h.id);
2360
2485
  };
2361
- return /* @__PURE__ */ a(ht, { delayDuration: 300, children: /* @__PURE__ */ c(
2486
+ return /* @__PURE__ */ a(C.Provider, { delay: 300, children: /* @__PURE__ */ c(
2362
2487
  "div",
2363
2488
  {
2364
- className: m(
2489
+ className: w(
2365
2490
  "astw:@container astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border",
2366
- r
2491
+ n
2367
2492
  ),
2493
+ style: o,
2368
2494
  children: [
2369
2495
  /* @__PURE__ */ c("div", { className: "astw:flex astw:items-center astw:justify-between astw:px-6 astw:py-6", children: [
2370
2496
  /* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none", children: e }),
2371
- o && /* @__PURE__ */ a("div", { children: o })
2497
+ i && /* @__PURE__ */ a("div", { children: i })
2372
2498
  ] }),
2373
- /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: l ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: i.map((w, h) => /* @__PURE__ */ c(g.Fragment, { children: [
2374
- h > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
2375
- d(w)
2376
- ] }, w.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
2499
+ /* @__PURE__ */ a("div", { className: "astw:px-6 astw:pb-4", children: u ? /* @__PURE__ */ a("div", { className: "astw:space-y-4", children: l.map((h, f) => /* @__PURE__ */ c(b.Fragment, { children: [
2500
+ f > 0 && /* @__PURE__ */ a("div", { className: "astw:h-px astw:bg-border", role: "separator" }),
2501
+ m(h)
2502
+ ] }, h.id)) }) : /* @__PURE__ */ a("p", { className: "astw:text-sm astw:text-muted-foreground", children: "No information available" }) })
2377
2503
  ]
2378
2504
  }
2379
2505
  ) });
2380
2506
  }
2381
- const ys = "astw:flex astw:size-4 astw:items-center astw:justify-center", Ns = () => /* @__PURE__ */ a(
2507
+ const Os = "astw:flex astw:size-4 astw:items-center astw:justify-center", Ws = () => /* @__PURE__ */ a(
2382
2508
  "svg",
2383
2509
  {
2384
2510
  className: "astw:size-4 astw:animate-spin",
@@ -2400,25 +2526,25 @@ const ys = "astw:flex astw:size-4 astw:items-center astw:justify-center", Ns = (
2400
2526
  }
2401
2527
  )
2402
2528
  }
2403
- ), Ss = m(
2529
+ ), js = w(
2404
2530
  "astw:flex astw:items-center astw:gap-2 astw:w-full astw:rounded-md astw:px-3 astw:py-2",
2405
2531
  "astw:text-sm astw:font-medium astw:transition-colors astw:border astw:border-transparent",
2406
2532
  "astw:bg-transparent astw:text-left astw:cursor-pointer astw:[&_svg]:size-4 astw:[&_svg]:shrink-0"
2407
- ), Cs = "astw:hover:bg-accent astw:hover:text-accent-foreground astw:outline-none astw:focus-visible:ring-2 astw:focus-visible:ring-ring astw:focus-visible:ring-offset-2", Ts = "astw:pointer-events-none astw:opacity-50";
2408
- function ks({ action: t }) {
2409
- const { key: e, label: s, icon: n, onClick: r, disabled: o, loading: i } = t, l = !!o || !!i, u = /* @__PURE__ */ c(S, { children: [
2410
- /* @__PURE__ */ a("span", { className: ys, "aria-hidden": !0, children: i ? /* @__PURE__ */ a(Ns, {}) : n }),
2533
+ ), Hs = "astw:hover:bg-accent astw:hover:text-accent-foreground astw:outline-none astw:focus-visible:ring-2 astw:focus-visible:ring-ring astw:focus-visible:ring-offset-2", Us = "astw:pointer-events-none astw:opacity-50";
2534
+ function Ks({ action: t }) {
2535
+ const { key: e, label: s, icon: r, onClick: n, disabled: o, loading: i } = t, l = !!o || !!i, u = /* @__PURE__ */ c(T, { children: [
2536
+ /* @__PURE__ */ a("span", { className: Os, "aria-hidden": !0, children: i ? /* @__PURE__ */ a(Ws, {}) : r }),
2411
2537
  /* @__PURE__ */ a("span", { className: "astw:min-w-0 astw:truncate", children: s })
2412
- ] }), d = m(
2413
- Ss,
2414
- l ? Ts : Cs
2538
+ ] }), d = w(
2539
+ js,
2540
+ l ? Us : Hs
2415
2541
  );
2416
2542
  return /* @__PURE__ */ a(
2417
2543
  "button",
2418
2544
  {
2419
2545
  type: "button",
2420
2546
  className: d,
2421
- onClick: l ? void 0 : r,
2547
+ onClick: l ? void 0 : n,
2422
2548
  disabled: l,
2423
2549
  "aria-disabled": l,
2424
2550
  "aria-busy": i,
@@ -2428,143 +2554,244 @@ function ks({ action: t }) {
2428
2554
  }
2429
2555
  );
2430
2556
  }
2431
- function cn({ title: t, actions: e, className: s }) {
2557
+ function Dr({ title: t, actions: e, className: s }) {
2432
2558
  return /* @__PURE__ */ c(
2433
2559
  "div",
2434
2560
  {
2435
- className: m(
2561
+ className: w(
2436
2562
  "astw:min-w-[278px] astw:w-full astw:bg-card astw:text-card-foreground astw:rounded-xl astw:border astw:shadow-xs",
2437
2563
  s
2438
2564
  ),
2439
2565
  children: [
2440
2566
  /* @__PURE__ */ a("div", { className: "astw:px-4 astw:pt-6 astw:pb-4", children: /* @__PURE__ */ a("h3", { className: "astw:text-lg astw:font-semibold astw:leading-none astw:pl-3", children: t }) }),
2441
- /* @__PURE__ */ a("div", { className: "astw:px-4 astw:pb-4", children: e.length === 0 ? /* @__PURE__ */ a("p", { className: "astw:py-2 astw:pl-3 astw:text-sm astw:text-muted-foreground", children: "No actions available" }) : /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-0", role: "list", children: e.map((n) => /* @__PURE__ */ a("div", { role: "listitem", children: /* @__PURE__ */ a(ks, { action: n }) }, n.key)) }) })
2567
+ /* @__PURE__ */ a("div", { className: "astw:px-4 astw:pb-4", children: e.length === 0 ? /* @__PURE__ */ a("p", { className: "astw:py-2 astw:pl-3 astw:text-sm astw:text-muted-foreground", children: "No actions available" }) : /* @__PURE__ */ a("div", { className: "astw:flex astw:flex-col astw:gap-0", role: "list", children: e.map((r) => /* @__PURE__ */ a("div", { role: "listitem", children: /* @__PURE__ */ a(Ks, { action: r }) }, r.key)) }) })
2442
2568
  ]
2443
2569
  }
2444
2570
  );
2445
2571
  }
2446
- const xt = g.forwardRef(
2447
- ({ className: t, children: e, area: s, ...n }, r) => /* @__PURE__ */ a(
2572
+ const gt = b.forwardRef(
2573
+ ({ className: t, style: e, children: s, area: r, ...n }, o) => /* @__PURE__ */ a(
2448
2574
  "div",
2449
2575
  {
2450
- ref: r,
2576
+ ref: o,
2451
2577
  "data-layout-column": "",
2452
- ...s ? { "data-area": s } : {},
2453
- className: m("astw:min-w-0 astw:flex astw:flex-col astw:gap-4", t),
2578
+ ...r ? { "data-area": r } : {},
2579
+ className: w("astw:min-w-0 astw:flex astw:flex-col astw:gap-4", t),
2580
+ style: e,
2454
2581
  ...n,
2455
- children: e
2582
+ children: s
2456
2583
  }
2457
2584
  )
2458
2585
  );
2459
- xt.displayName = "Layout.Column";
2460
- function yt({ title: t, actions: e, children: s }) {
2461
- const n = t || e != null && e.length > 0;
2586
+ gt.displayName = "Layout.Column";
2587
+ function bt({ title: t, actions: e, children: s }) {
2588
+ const r = t || e != null && e.length > 0;
2462
2589
  return /* @__PURE__ */ c("header", { "data-layout-header": "", className: "astw:flex astw:w-full astw:flex-col", children: [
2463
- n && /* @__PURE__ */ c("div", { className: "astw:flex astw:w-full astw:flex-1 astw:items-center astw:justify-between astw:pt-4", children: [
2590
+ r && /* @__PURE__ */ c("div", { className: "astw:flex astw:w-full astw:flex-1 astw:items-center astw:justify-between astw:pt-4", children: [
2464
2591
  t && /* @__PURE__ */ a("h1", { className: "astw:text-2xl astw:font-bold astw:tracking-tight", children: t }),
2465
- e != null && e.length > 0 && /* @__PURE__ */ a("div", { className: "astw:ml-auto astw:flex astw:gap-2 astw:items-center", children: e.map((r, o) => /* @__PURE__ */ a(g.Fragment, { children: r }, o)) })
2592
+ e != null && e.length > 0 && /* @__PURE__ */ a("div", { className: "astw:ml-auto astw:flex astw:gap-2 astw:items-center", children: e.map((n, o) => /* @__PURE__ */ a(b.Fragment, { children: n }, o)) })
2466
2593
  ] }),
2467
2594
  s != null && s !== !1 && /* @__PURE__ */ a("div", { className: "astw:w-full", children: s })
2468
2595
  ] });
2469
2596
  }
2470
- yt.displayName = "Layout.Header";
2471
- const Rs = {
2597
+ bt.displayName = "Layout.Header";
2598
+ const Vs = {
2472
2599
  left: "320px",
2473
2600
  main: "1fr",
2474
2601
  right: "280px"
2475
- }, Ps = {
2602
+ }, Gs = {
2476
2603
  2: "1fr 280px",
2477
2604
  3: "320px 1fr 280px"
2478
2605
  };
2479
- function ue({ columns: t, className: e, gap: s, title: n, actions: r, children: o }) {
2480
- const i = [];
2481
- let l = !1;
2482
- g.Children.forEach(o, (p) => {
2483
- g.isValidElement(p) && (p.type === yt ? l = !0 : p.type === xt && i.push(p.props.area));
2606
+ function Pe({ columns: t, className: e, style: s, gap: r, title: n, actions: o, children: i }) {
2607
+ const l = [];
2608
+ let u = !1;
2609
+ b.Children.forEach(i, (p) => {
2610
+ b.isValidElement(p) && (p.type === bt ? u = !0 : p.type === gt && l.push(p.props.area));
2484
2611
  });
2485
- const u = i.length, d = t ?? u;
2486
- t !== void 0 && t !== u && console.warn(
2487
- `Layout: \`columns\` prop (${t}) does not match Layout.Column child count (${u}). The \`columns\` prop is deprecated; remove it to use auto-detection.`
2612
+ const d = l.length, m = t ?? d;
2613
+ t !== void 0 && t !== d && console.warn(
2614
+ `Layout: \`columns\` prop (${t}) does not match Layout.Column child count (${d}). The \`columns\` prop is deprecated; remove it to use auto-detection.`
2488
2615
  );
2489
- const w = i.some((p) => p != null);
2490
- let h;
2491
- d >= 2 && (w ? h = i.map((p) => p ? Rs[p] : "1fr").join(" ") : h = Ps[d] ?? `repeat(${d}, 1fr)`);
2492
- const f = s === void 0 || s === 4 ? "astw:gap-4" : s === 6 ? "astw:gap-6" : s === 8 ? "astw:gap-8" : "astw:gap-4", b = !l && (n || r != null && r.length > 0);
2616
+ const h = l.some((p) => p != null);
2617
+ let f;
2618
+ m >= 2 && (h ? f = l.map((p) => p ? Vs[p] : "1fr").join(" ") : f = Gs[m] ?? `repeat(${m}, 1fr)`);
2619
+ const v = r === void 0 || r === 4 ? "astw:gap-4" : r === 6 ? "astw:gap-6" : r === 8 ? "astw:gap-8" : "astw:gap-4", g = !u && (n || o != null && o.length > 0);
2493
2620
  return /* @__PURE__ */ c(
2494
2621
  "div",
2495
2622
  {
2496
- className: m(
2623
+ className: w(
2497
2624
  "astw:grid astw:grid-cols-1 astw:w-full",
2498
- l || b ? "astw:pb-4" : "astw:py-4",
2499
- f,
2625
+ u || g ? "astw:pb-4" : "astw:py-4",
2626
+ v,
2500
2627
  "astw:[&>[data-layout-header]]:col-span-full",
2501
- d === 2 && h && "astw:lg:grid-cols-[var(--layout-cols)]",
2502
- d >= 3 && h && "astw:xl:grid-cols-[var(--layout-cols)]",
2628
+ m === 2 && f && "astw:lg:grid-cols-[var(--layout-cols)]",
2629
+ m >= 3 && f && "astw:xl:grid-cols-[var(--layout-cols)]",
2503
2630
  e
2504
2631
  ),
2505
- style: h ? { "--layout-cols": h } : void 0,
2632
+ style: {
2633
+ ...s,
2634
+ ...f ? { "--layout-cols": f } : void 0
2635
+ },
2506
2636
  children: [
2507
- b && /* @__PURE__ */ c(
2637
+ g && /* @__PURE__ */ c(
2508
2638
  "header",
2509
2639
  {
2510
2640
  "data-layout-header": "",
2511
2641
  className: "astw:w-full astw:flex astw:justify-between astw:items-center astw:pt-4",
2512
2642
  children: [
2513
2643
  n && /* @__PURE__ */ a("h1", { className: "astw:text-2xl astw:font-bold astw:tracking-tight", children: n }),
2514
- r != null && r.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: r.map((p, v) => /* @__PURE__ */ a(g.Fragment, { children: p }, v)) })
2644
+ o != null && o.length > 0 && /* @__PURE__ */ a("div", { className: "astw:flex astw:gap-2 astw:items-center", children: o.map((p, x) => /* @__PURE__ */ a(b.Fragment, { children: p }, x)) })
2515
2645
  ]
2516
2646
  }
2517
2647
  ),
2518
- o
2648
+ i
2519
2649
  ]
2520
2650
  }
2521
2651
  );
2522
2652
  }
2523
- ue.Column = xt;
2524
- ue.Header = yt;
2525
- function dn() {
2526
- return {
2527
- for(t, ...e) {
2528
- const s = e[0];
2529
- return s ? t.replace(/:([^/?]+)|\*([^/?]+)/g, (n, r, o) => r ? encodeURIComponent(s[r] ?? "") : (s[o] ?? "").split("/").map((l) => encodeURIComponent(l)).join("/")) : t;
2653
+ Pe.Column = gt;
2654
+ Pe.Header = bt;
2655
+ function De({ className: t, containerClassName: e, ...s }) {
2656
+ return /* @__PURE__ */ a(
2657
+ "div",
2658
+ {
2659
+ "data-slot": "table-container",
2660
+ className: w("astw:relative astw:w-full astw:overflow-x-auto", e),
2661
+ children: /* @__PURE__ */ a(
2662
+ "table",
2663
+ {
2664
+ "data-slot": "table",
2665
+ className: w("astw:w-full astw:caption-bottom astw:text-sm", t),
2666
+ ...s
2667
+ }
2668
+ )
2530
2669
  }
2531
- };
2670
+ );
2671
+ }
2672
+ De.displayName = "Table.Root";
2673
+ function Me({ className: t, ...e }) {
2674
+ return /* @__PURE__ */ a("thead", { "data-slot": "table-header", className: w("astw:[&_tr]:border-b", t), ...e });
2675
+ }
2676
+ Me.displayName = "Table.Header";
2677
+ function Ae({ className: t, ...e }) {
2678
+ return /* @__PURE__ */ a(
2679
+ "tbody",
2680
+ {
2681
+ "data-slot": "table-body",
2682
+ className: w("astw:[&_tr:last-child]:border-0", t),
2683
+ ...e
2684
+ }
2685
+ );
2686
+ }
2687
+ Ae.displayName = "Table.Body";
2688
+ function Be({ className: t, ...e }) {
2689
+ return /* @__PURE__ */ a(
2690
+ "tfoot",
2691
+ {
2692
+ "data-slot": "table-footer",
2693
+ className: w("astw:border-t astw:font-medium astw:[&>tr]:last:border-b-0", t),
2694
+ ...e
2695
+ }
2696
+ );
2697
+ }
2698
+ Be.displayName = "Table.Footer";
2699
+ function Ee({ className: t, ...e }) {
2700
+ return /* @__PURE__ */ a(
2701
+ "tr",
2702
+ {
2703
+ "data-slot": "table-row",
2704
+ className: w(
2705
+ "astw:hover:bg-muted/50 astw:data-[state=selected]:bg-muted astw:border-b astw:transition-colors",
2706
+ t
2707
+ ),
2708
+ ...e
2709
+ }
2710
+ );
2711
+ }
2712
+ Ee.displayName = "Table.Row";
2713
+ function Ie({ className: t, ...e }) {
2714
+ return /* @__PURE__ */ a(
2715
+ "th",
2716
+ {
2717
+ "data-slot": "table-head",
2718
+ className: w(
2719
+ "astw:text-foreground astw:h-10 astw:px-2 astw:text-left astw:align-middle astw:font-medium astw:whitespace-nowrap astw:[&:has([role=checkbox])]:pr-0 astw:[&>[role=checkbox]]:translate-y-[2px]",
2720
+ t
2721
+ ),
2722
+ ...e
2723
+ }
2724
+ );
2725
+ }
2726
+ Ie.displayName = "Table.Head";
2727
+ function Le({ className: t, ...e }) {
2728
+ return /* @__PURE__ */ a(
2729
+ "td",
2730
+ {
2731
+ "data-slot": "table-cell",
2732
+ className: w(
2733
+ "astw:p-2 astw:align-middle astw:whitespace-nowrap astw:[&:has([role=checkbox])]:pr-0 astw:[&>[role=checkbox]]:translate-y-[2px]",
2734
+ t
2735
+ ),
2736
+ ...e
2737
+ }
2738
+ );
2739
+ }
2740
+ Le.displayName = "Table.Cell";
2741
+ function $e({ className: t, ...e }) {
2742
+ return /* @__PURE__ */ a(
2743
+ "caption",
2744
+ {
2745
+ "data-slot": "table-caption",
2746
+ className: w("astw:text-muted-foreground astw:mt-4 astw:text-sm", t),
2747
+ ...e
2748
+ }
2749
+ );
2532
2750
  }
2751
+ $e.displayName = "Table.Caption";
2752
+ const Mr = { Root: De, Header: Me, Body: Ae, Footer: Be, Row: Ee, Head: Ie, Cell: Le, Caption: $e };
2533
2753
  export {
2534
- cn as ActionPanel,
2535
- ee as AppShell,
2536
- sn as AuthProvider,
2537
- ss as Badge,
2538
- tn as CommandPalette,
2539
- Aa as DefaultSidebar,
2540
- ln as DescriptionCard,
2541
- ue as Layout,
2542
- mn as Link,
2543
- Xs as SidebarGroup,
2544
- Qs as SidebarItem,
2545
- Js as SidebarLayout,
2546
- Zs as SidebarSeparator,
2547
- en as WithGuard,
2548
- ts as badgeVariants,
2549
- an as createAuthClient,
2550
- dn as createTypedPaths,
2551
- Fe as defineI18nLabels,
2552
- qs as defineModule,
2553
- Ys as defineResource,
2554
- Vs as hidden,
2555
- Ks as pass,
2556
- Gs as redirectTo,
2557
- Ht as useAppShell,
2558
- C as useAppShellConfig,
2559
- Hs as useAppShellData,
2560
- nn as useAuth,
2561
- rn as useAuthSuspense,
2562
- hn as useLocation,
2563
- pn as useNavigate,
2564
- Ta as usePageMeta,
2565
- fn as useParams,
2566
- gn as useRouteError,
2567
- bn as useSearchParams,
2568
- Je as useTheme,
2569
- on as useToast
2754
+ Dr as ActionPanel,
2755
+ Gt as AppShell,
2756
+ Sr as AuthProvider,
2757
+ Ns as Badge,
2758
+ V as Button,
2759
+ xr as CommandPalette,
2760
+ Ja as DefaultSidebar,
2761
+ Pr as DescriptionCard,
2762
+ ot as Dialog,
2763
+ Ia as Input,
2764
+ Pe as Layout,
2765
+ Er as Link,
2766
+ k as Sheet,
2767
+ gr as SidebarGroup,
2768
+ pr as SidebarItem,
2769
+ vr as SidebarLayout,
2770
+ br as SidebarSeparator,
2771
+ Mr as Table,
2772
+ C as Tooltip,
2773
+ yr as WithGuard,
2774
+ vs as badgeVariants,
2775
+ ia as buttonVariants,
2776
+ Nr as createAuthClient,
2777
+ kr as createTypedPaths,
2778
+ wa as defineI18nLabels,
2779
+ hr as defineModule,
2780
+ fr as defineResource,
2781
+ ur as hidden,
2782
+ wr as pass,
2783
+ mr as redirectTo,
2784
+ $t as useAppShell,
2785
+ D as useAppShellConfig,
2786
+ dr as useAppShellData,
2787
+ Cr as useAuth,
2788
+ Tr as useAuthSuspense,
2789
+ Ir as useLocation,
2790
+ Lr as useNavigate,
2791
+ Xa as usePageMeta,
2792
+ $r as useParams,
2793
+ _r as useRouteError,
2794
+ zr as useSearchParams,
2795
+ Ca as useTheme,
2796
+ Rr as useToast
2570
2797
  };