@tailor-platform/app-shell 0.26.3 → 0.27.1

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