@viglet/viglet-design-system 2026.3.2 → 2026.3.3

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.
Files changed (177) hide show
  1. package/README.md +277 -7
  2. package/dist/assets.cjs +1 -0
  3. package/dist/assets.es.js +2 -0
  4. package/dist/badge-locale-BxI9TwkE.js +579 -0
  5. package/dist/badge-locale-sIsBdP_e.cjs +7 -0
  6. package/dist/bento/bento-actions-menu.d.ts +42 -0
  7. package/dist/bento/bento-actions-menu.d.ts.map +1 -0
  8. package/dist/bento/bento-back-to-top.d.ts +11 -0
  9. package/dist/bento/bento-back-to-top.d.ts.map +1 -0
  10. package/dist/bento/bento-command-palette.d.ts +28 -0
  11. package/dist/bento/bento-command-palette.d.ts.map +1 -0
  12. package/dist/bento/bento-count-tile.d.ts +18 -0
  13. package/dist/bento/bento-count-tile.d.ts.map +1 -0
  14. package/dist/bento/bento-empty-state.d.ts +35 -0
  15. package/dist/bento/bento-empty-state.d.ts.map +1 -0
  16. package/dist/bento/bento-entity-shell.d.ts +123 -0
  17. package/dist/bento/bento-entity-shell.d.ts.map +1 -0
  18. package/dist/bento/bento-entity-tile.d.ts +40 -0
  19. package/dist/bento/bento-entity-tile.d.ts.map +1 -0
  20. package/dist/bento/bento-form-hero.d.ts +91 -0
  21. package/dist/bento/bento-form-hero.d.ts.map +1 -0
  22. package/dist/bento/bento-form-section.d.ts +31 -0
  23. package/dist/bento/bento-form-section.d.ts.map +1 -0
  24. package/dist/bento/bento-hero-icon-picker.d.ts +35 -0
  25. package/dist/bento/bento-hero-icon-picker.d.ts.map +1 -0
  26. package/dist/bento/bento-hero.d.ts +62 -0
  27. package/dist/bento/bento-hero.d.ts.map +1 -0
  28. package/dist/bento/bento-inline-edit.d.ts +52 -0
  29. package/dist/bento/bento-inline-edit.d.ts.map +1 -0
  30. package/dist/bento/bento-layout.d.ts +52 -0
  31. package/dist/bento/bento-layout.d.ts.map +1 -0
  32. package/dist/bento/bento-list-page.d.ts +124 -0
  33. package/dist/bento/bento-list-page.d.ts.map +1 -0
  34. package/dist/bento/bento-nav-rail.d.ts +32 -0
  35. package/dist/bento/bento-nav-rail.d.ts.map +1 -0
  36. package/dist/bento/bento-nav.d.ts +69 -0
  37. package/dist/bento/bento-nav.d.ts.map +1 -0
  38. package/dist/bento/bento-save-bar.d.ts +36 -0
  39. package/dist/bento/bento-save-bar.d.ts.map +1 -0
  40. package/dist/bento/bento-scroll-fade.d.ts +20 -0
  41. package/dist/bento/bento-scroll-fade.d.ts.map +1 -0
  42. package/dist/bento/bento-scroll-save-bar.d.ts +22 -0
  43. package/dist/bento/bento-scroll-save-bar.d.ts.map +1 -0
  44. package/dist/bento/bento-section-chrome.d.ts +60 -0
  45. package/dist/bento/bento-section-chrome.d.ts.map +1 -0
  46. package/dist/bento/bento-section.d.ts +27 -0
  47. package/dist/bento/bento-section.d.ts.map +1 -0
  48. package/dist/bento/bento-shortcuts-dialog.d.ts +15 -0
  49. package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -0
  50. package/dist/bento/bento-status-marker.d.ts +26 -0
  51. package/dist/bento/bento-status-marker.d.ts.map +1 -0
  52. package/dist/bento/bento-tile.d.ts +42 -0
  53. package/dist/bento/bento-tile.d.ts.map +1 -0
  54. package/dist/bento/bento-tones.d.ts +33 -0
  55. package/dist/bento/bento-tones.d.ts.map +1 -0
  56. package/dist/bento/bento-user-menu.d.ts +31 -0
  57. package/dist/bento/bento-user-menu.d.ts.map +1 -0
  58. package/dist/bento/index.d.ts +59 -0
  59. package/dist/bento/index.d.ts.map +1 -0
  60. package/dist/bento.cjs +1 -0
  61. package/dist/bento.css +442 -0
  62. package/dist/bento.es.js +1501 -0
  63. package/dist/breadcrumb.context-CTnZ4rD0.cjs +1 -0
  64. package/dist/breadcrumb.context-h2A2IEJ_.js +928 -0
  65. package/dist/components/badge-locale.d.ts.map +1 -1
  66. package/dist/components/error-boundary.d.ts.map +1 -1
  67. package/dist/components/language-select.d.ts.map +1 -1
  68. package/dist/components/router/blank-slate.d.ts +10 -0
  69. package/dist/components/router/blank-slate.d.ts.map +1 -1
  70. package/dist/components/router/grid.list.d.ts +13 -0
  71. package/dist/components/router/grid.list.d.ts.map +1 -1
  72. package/dist/components/router/internal.sidebar.d.ts +27 -2
  73. package/dist/components/router/internal.sidebar.d.ts.map +1 -1
  74. package/dist/components/router/loading-provider.d.ts +6 -1
  75. package/dist/components/router/loading-provider.d.ts.map +1 -1
  76. package/dist/components/router/nav-main.d.ts +10 -0
  77. package/dist/components/router/nav-main.d.ts.map +1 -1
  78. package/dist/components/router/nav-user.d.ts +13 -0
  79. package/dist/components/router/nav-user.d.ts.map +1 -1
  80. package/dist/components/router/page-content.d.ts +10 -0
  81. package/dist/components/router/page-content.d.ts.map +1 -1
  82. package/dist/components/router/page-header.d.ts +13 -0
  83. package/dist/components/router/page-header.d.ts.map +1 -1
  84. package/dist/components/router/page.d.ts +13 -0
  85. package/dist/components/router/page.d.ts.map +1 -1
  86. package/dist/components/router/sticky.page.header.d.ts +14 -0
  87. package/dist/components/router/sticky.page.header.d.ts.map +1 -1
  88. package/dist/components/router/sub.page.d.ts +15 -11
  89. package/dist/components/router/sub.page.d.ts.map +1 -1
  90. package/dist/components/router/sub.page.header.d.ts +13 -0
  91. package/dist/components/router/sub.page.header.d.ts.map +1 -1
  92. package/dist/components/startup-first/startup-first.d.ts.map +1 -1
  93. package/dist/components/ui/floating-formulas-bg.d.ts +8 -1
  94. package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
  95. package/dist/components/ui/form.d.ts +2 -2
  96. package/dist/components/ui/form.d.ts.map +1 -1
  97. package/dist/components/ui/gradient-button.d.ts.map +1 -1
  98. package/dist/components/ui/gradient-switch.d.ts.map +1 -1
  99. package/dist/components/ui/icon-picker-dialog.d.ts +35 -0
  100. package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -0
  101. package/dist/components/ui/index.d.ts +1 -0
  102. package/dist/components/ui/index.d.ts.map +1 -1
  103. package/dist/components/ui/section-card.d.ts +3 -3
  104. package/dist/components/ui/section-card.d.ts.map +1 -1
  105. package/dist/components/ui/sidebar.d.ts.map +1 -1
  106. package/dist/components/ui/slider.d.ts +1 -1
  107. package/dist/components/ui/slider.d.ts.map +1 -1
  108. package/dist/contexts/user.context.d.ts +24 -0
  109. package/dist/contexts/user.context.d.ts.map +1 -1
  110. package/dist/exports.json +404 -0
  111. package/dist/floating-formulas-bg.cjs +1 -0
  112. package/dist/floating-formulas-bg.css +21 -0
  113. package/dist/floating-formulas-bg.es.js +83 -56
  114. package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  115. package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
  116. package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
  117. package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
  118. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  119. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  120. package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
  121. package/dist/fonts/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2 +0 -0
  122. package/dist/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2 +0 -0
  123. package/dist/fonts/plus-jakarta-sans-latin-wght-normal.woff2 +0 -0
  124. package/dist/fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2 +0 -0
  125. package/dist/fonts.css +126 -0
  126. package/dist/hooks/use-grid-adapter.d.ts.map +1 -1
  127. package/dist/hooks/use-mobile.d.ts +10 -0
  128. package/dist/hooks/use-mobile.d.ts.map +1 -1
  129. package/dist/hooks/use-sub-page-breadcrumb.d.ts.map +1 -1
  130. package/dist/i18n/index.d.ts +136 -0
  131. package/dist/i18n/index.d.ts.map +1 -1
  132. package/dist/i18n/locales/en/bento.json.d.ts +51 -0
  133. package/dist/i18n/locales/en/common.json.d.ts +7 -1
  134. package/dist/i18n/locales/en/forms.json.d.ts +15 -1
  135. package/dist/i18n/locales/en/nav.json.d.ts +3 -1
  136. package/dist/i18n/locales/pt/bento.json.d.ts +51 -0
  137. package/dist/i18n/locales/pt/common.json.d.ts +7 -1
  138. package/dist/i18n/locales/pt/forms.json.d.ts +15 -1
  139. package/dist/i18n/locales/pt/nav.json.d.ts +3 -1
  140. package/dist/i18n-DoNdMLEd.cjs +1 -0
  141. package/dist/{i18n-C94rDRaM.js → i18n-DuNITbWa.js} +155 -27
  142. package/dist/{i18n.cjs.js → i18n.cjs} +1 -1
  143. package/dist/i18n.es.js +1 -1
  144. package/dist/index.cjs +1 -0
  145. package/dist/index.d.ts +0 -1
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.es.js +492 -750
  148. package/dist/lib/axios.d.ts.map +1 -1
  149. package/dist/lib/export-xlsx.d.ts +7 -1
  150. package/dist/lib/export-xlsx.d.ts.map +1 -1
  151. package/dist/lib/react-markers.d.ts +17 -0
  152. package/dist/lib/react-markers.d.ts.map +1 -0
  153. package/dist/lib/utils.d.ts +22 -0
  154. package/dist/lib/utils.d.ts.map +1 -1
  155. package/dist/loading-provider-1mgM91iY.cjs +1 -0
  156. package/dist/loading-provider-CMnOuvdR.js +224 -0
  157. package/dist/preset.css +103 -3
  158. package/dist/products-DL_YYXkV.cjs +1 -0
  159. package/dist/products-Du9KB6Xl.js +9 -0
  160. package/dist/{rolldown-runtime-CMqjfN_6.cjs → rolldown-runtime-BocRIvOZ.cjs} +1 -1
  161. package/dist/router.cjs +1 -0
  162. package/dist/router.es.js +358 -555
  163. package/dist/user.context-kPAqKN4o.js +512 -0
  164. package/dist/user.context-r50nSWER.cjs +1 -0
  165. package/dist/viglet-design-system.css +1 -1
  166. package/dist/vite/boot-loader.d.ts +14 -4
  167. package/dist/vite/boot-loader.d.ts.map +1 -1
  168. package/dist/{vite.cjs.js → vite.cjs} +8 -8
  169. package/dist/vite.es.js +29 -16
  170. package/package.json +66 -22
  171. package/scripts/check-duplicates.mjs +198 -0
  172. package/dist/breadcrumb.context-C7VCfh49.js +0 -1501
  173. package/dist/breadcrumb.context-Td6Tjc_z.cjs +0 -7
  174. package/dist/floating-formulas-bg.cjs.js +0 -1
  175. package/dist/i18n-DN_2YzjB.cjs +0 -1
  176. package/dist/index.cjs.js +0 -1
  177. package/dist/router.cjs.js +0 -1
@@ -0,0 +1,1501 @@
1
+ import { A as e, D as t, E as n, F as r, M as i, U as a, _ as o, a as s, f as c, g as l, h as u, i as d, k as f, l as p, m, o as h, s as g, u as _, x as v } from "./badge-locale-BxI9TwkE.js";
2
+ import { c as y, l as b, n as x, o as S, r as C, s as w } from "./user.context-kPAqKN4o.js";
3
+ import { i as T, t as E } from "./loading-provider-CMnOuvdR.js";
4
+ import { Children as D, createContext as O, isValidElement as k, useContext as A, useEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as ee } from "react";
5
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
6
+ import { IconAdjustmentsHorizontal as R, IconAlertTriangle as te, IconArrowBackUp as z, IconArrowLeft as ne, IconArrowRight as re, IconArrowUp as B, IconBuildingCommunity as ie, IconBuildingSkyscraper as ae, IconChevronRight as V, IconDeviceFloppy as H, IconDotsVertical as oe, IconExternalLink as se, IconGripVertical as ce, IconHome as le, IconKeyboard as ue, IconLogout as de, IconPalette as fe, IconPlus as pe, IconSearch as me, IconSparkles as U, IconTrash as he, IconUserCircle as ge, IconUsers as _e, IconX as W } from "@tabler/icons-react";
7
+ import { useTranslation as G } from "react-i18next";
8
+ import { Icon as K } from "@iconify/react";
9
+ import { Link as q, useLocation as ve, useNavigate as J } from "react-router-dom";
10
+ import { DndContext as ye, KeyboardSensor as be, PointerSensor as xe, closestCenter as Se, useSensor as Ce, useSensors as we } from "@dnd-kit/core";
11
+ import { SortableContext as Te, arrayMove as Ee, rectSortingStrategy as De, useSortable as Oe } from "@dnd-kit/sortable";
12
+ import { CSS as ke } from "@dnd-kit/utilities";
13
+ //#region src/bento/bento-actions-menu.tsx
14
+ var Ae = {
15
+ default: "",
16
+ destructive: "bento-item-danger"
17
+ };
18
+ function je({ actions: e, triggerLabel: t }) {
19
+ let { t: r } = G();
20
+ return e.length === 0 ? null : /* @__PURE__ */ L(c, { children: [/* @__PURE__ */ I(n, {
21
+ asChild: !0,
22
+ children: /* @__PURE__ */ I("button", {
23
+ type: "button",
24
+ "aria-label": t ?? r("forms.formActions.moreActions", { defaultValue: "More actions" }),
25
+ className: "bento-tile-clickable inline-flex h-9 w-9 items-center justify-center rounded-full border border-border/60 bg-card/60 text-muted-foreground backdrop-blur transition-colors duration-200 hover:text-foreground",
26
+ children: /* @__PURE__ */ I(oe, { size: 18 })
27
+ })
28
+ }), /* @__PURE__ */ I(m, {
29
+ align: "end",
30
+ sideOffset: 8,
31
+ className: "bento-dropdown min-w-44 p-1.5",
32
+ children: e.map((e) => {
33
+ let t = e.icon, n = Ae[e.tone ?? "default"];
34
+ return /* @__PURE__ */ L(l, {
35
+ onSelect: e.onSelect,
36
+ disabled: e.disabled,
37
+ className: `bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${n}`,
38
+ children: [/* @__PURE__ */ I(t, { size: 16 }), e.label]
39
+ }, e.label);
40
+ })
41
+ })] });
42
+ }
43
+ //#endregion
44
+ //#region src/bento/bento-tones.ts
45
+ var Y = {
46
+ blue: "bento-tone-blue",
47
+ indigo: "bento-tone-indigo",
48
+ violet: "bento-tone-violet",
49
+ emerald: "bento-tone-emerald",
50
+ amber: "bento-tone-amber",
51
+ rose: "bento-tone-rose",
52
+ slate: "bento-tone-slate"
53
+ }, Me = Object.keys(Y);
54
+ function X(e) {
55
+ return `bento-chip ${Y[e] ?? Y.slate}`;
56
+ }
57
+ //#endregion
58
+ //#region src/bento/bento-count-tile.tsx
59
+ function Ne({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
60
+ let o = /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
61
+ className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${X(n)}`,
62
+ children: /* @__PURE__ */ I(t, { size: 18 })
63
+ }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("div", {
64
+ className: "text-3xl font-semibold tabular-nums tracking-tight",
65
+ children: i
66
+ }), /* @__PURE__ */ I("div", {
67
+ className: "text-[11px] uppercase tracking-wider text-muted-foreground",
68
+ children: r
69
+ })] })] }), s = `bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${a}${e ? " bento-tile-clickable" : ""}`;
70
+ return e ? /* @__PURE__ */ I(q, {
71
+ to: e,
72
+ className: s,
73
+ children: o
74
+ }) : /* @__PURE__ */ I("div", {
75
+ className: s,
76
+ children: o
77
+ });
78
+ }
79
+ //#endregion
80
+ //#region src/bento/bento-empty-state.tsx
81
+ function Pe({ icon: e = U, tone: t = "indigo", title: n, description: r, action: i, align: o = "center", className: s }) {
82
+ let c = X(t), l = o === "center";
83
+ return /* @__PURE__ */ L("div", {
84
+ className: a("bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8", l ? "items-center text-center" : "items-start text-left", s),
85
+ children: [
86
+ /* @__PURE__ */ I("span", {
87
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${c} text-white shadow-md`,
88
+ children: /* @__PURE__ */ I(e, { size: 24 })
89
+ }),
90
+ /* @__PURE__ */ I("div", {
91
+ className: "text-lg font-semibold tracking-tight",
92
+ children: n
93
+ }),
94
+ r && /* @__PURE__ */ I("p", {
95
+ className: a("max-w-md text-sm text-muted-foreground", l && "mx-auto"),
96
+ children: r
97
+ }),
98
+ i && /* @__PURE__ */ I("div", {
99
+ className: a("mt-1", l && "mx-auto"),
100
+ children: i
101
+ })
102
+ ]
103
+ });
104
+ }
105
+ //#endregion
106
+ //#region src/bento/bento-hero.tsx
107
+ function Z({ to: e, children: t }) {
108
+ return /* @__PURE__ */ L(q, {
109
+ to: e,
110
+ className: "inline-flex items-center gap-1 hover:text-foreground",
111
+ children: [/* @__PURE__ */ I(ne, {
112
+ size: 14,
113
+ "aria-hidden": !0
114
+ }), t]
115
+ });
116
+ }
117
+ function Q({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading: a, trailing: o }) {
118
+ let s = e ?? (t == null ? null : /* @__PURE__ */ I(Z, {
119
+ to: t,
120
+ children: n
121
+ }));
122
+ return /* @__PURE__ */ I("header", {
123
+ className: "bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10",
124
+ children: /* @__PURE__ */ L("div", {
125
+ className: "flex w-full items-start gap-4",
126
+ children: [
127
+ a && /* @__PURE__ */ I("div", {
128
+ className: "shrink-0",
129
+ children: a
130
+ }),
131
+ /* @__PURE__ */ L("div", {
132
+ className: "flex flex-1 flex-col gap-1",
133
+ children: [
134
+ s && /* @__PURE__ */ I("span", {
135
+ className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
136
+ children: s
137
+ }),
138
+ /* @__PURE__ */ I("h1", {
139
+ className: "text-3xl font-semibold tracking-tight md:text-4xl",
140
+ children: r
141
+ }),
142
+ i && /* @__PURE__ */ I("p", {
143
+ className: "max-w-2xl text-sm text-muted-foreground",
144
+ children: i
145
+ })
146
+ ]
147
+ }),
148
+ o && /* @__PURE__ */ I("div", {
149
+ className: "ml-auto flex shrink-0 items-center gap-2",
150
+ children: o
151
+ })
152
+ ]
153
+ })
154
+ });
155
+ }
156
+ //#endregion
157
+ //#region src/bento/bento-hero-icon-picker.tsx
158
+ function Fe({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
159
+ let { t: c } = G(), [l, u] = P(!1);
160
+ return s ? /* @__PURE__ */ I("span", {
161
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${X(i)} text-white shadow-md`,
162
+ children: e ? /* @__PURE__ */ I(K, {
163
+ icon: e,
164
+ className: "size-6 text-white"
165
+ }) : /* @__PURE__ */ I(r, { size: 24 })
166
+ }) : /* @__PURE__ */ L("div", {
167
+ className: "group relative",
168
+ children: [
169
+ /* @__PURE__ */ L("button", {
170
+ type: "button",
171
+ onClick: () => u(!0),
172
+ "aria-label": c("forms.iconPicker.chooseAnIcon"),
173
+ className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${X(i)} text-white shadow-md outline-none transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:scale-105 focus-visible:ring-2 focus-visible:ring-ring active:scale-95`,
174
+ children: [e ? /* @__PURE__ */ I(K, {
175
+ icon: e,
176
+ className: "size-6 text-white"
177
+ }) : /* @__PURE__ */ I(r, { size: 24 }), /* @__PURE__ */ I("span", {
178
+ className: "pointer-events-none absolute inset-0 grid place-items-center bg-black/40 opacity-0 transition-opacity duration-200 group-hover/icon:opacity-100",
179
+ children: /* @__PURE__ */ I(fe, { className: "size-5 text-white" })
180
+ })]
181
+ }),
182
+ e && n && /* @__PURE__ */ I("button", {
183
+ type: "button",
184
+ onClick: (e) => {
185
+ e.stopPropagation(), n();
186
+ },
187
+ "aria-label": c("forms.common.remove"),
188
+ title: c("forms.common.remove"),
189
+ className: "absolute -right-1.5 -top-1.5 grid h-5 w-5 cursor-pointer place-items-center rounded-full border border-border/60 bg-card/90 text-foreground opacity-0 shadow-md backdrop-blur transition-opacity duration-200 bento-clear focus-visible:opacity-100 group-hover:opacity-100",
190
+ children: /* @__PURE__ */ I(W, { size: 12 })
191
+ }),
192
+ /* @__PURE__ */ I(y, {
193
+ open: l,
194
+ onOpenChange: u,
195
+ value: e,
196
+ onSelect: t,
197
+ onClear: n,
198
+ title: a,
199
+ description: o
200
+ })
201
+ ]
202
+ });
203
+ }
204
+ //#endregion
205
+ //#region src/bento/bento-inline-edit.tsx
206
+ function Ie({ value: e, onSave: t, multiline: n = !1, placeholder: r, className: i = "", ariaLabel: a, autoFocus: o = !1, readOnly: s = !1, commitOnChange: c = !1 }) {
207
+ let { t: l } = G(), [u, d] = P(o), [f, m] = P(e), [h, g] = P(!1), _ = N(null), [v, y] = P(e);
208
+ !u && e !== v && (y(e), m(e)), j(() => {
209
+ u && _.current && (_.current.focus(), _.current.select());
210
+ }, [u]);
211
+ async function b() {
212
+ let n = f.trim();
213
+ if (n === e) {
214
+ d(!1);
215
+ return;
216
+ }
217
+ if (!n && !r) {
218
+ m(e), d(!1);
219
+ return;
220
+ }
221
+ g(!0);
222
+ try {
223
+ await t(n);
224
+ } catch {
225
+ m(e);
226
+ } finally {
227
+ g(!1), d(!1);
228
+ }
229
+ }
230
+ function x() {
231
+ m(e), d(!1);
232
+ }
233
+ function S(e) {
234
+ m(e), c && t(e);
235
+ }
236
+ let C = !e;
237
+ if (s) return /* @__PURE__ */ I("span", {
238
+ className: `block w-full ${i}`,
239
+ "aria-label": a,
240
+ children: e || /* @__PURE__ */ I("span", {
241
+ className: "text-muted-foreground/80",
242
+ children: r ?? "—"
243
+ })
244
+ });
245
+ let w = `w-full bg-transparent outline-none border-b transition-colors duration-200 ${i}`, T = `${w} cursor-text rounded-sm ${C ? "border-dashed border-border/70 hover:border-foreground/40" : "border-transparent hover:border-border/60 focus-visible:border-border/80"} ${h ? "opacity-60" : ""}`, E = `${w} bento-editing`;
246
+ if (!u) return /* @__PURE__ */ I("button", {
247
+ type: "button",
248
+ onClick: () => d(!0),
249
+ className: `${T} text-left`,
250
+ "aria-label": a ?? l("forms.formActions.edit"),
251
+ disabled: h,
252
+ children: e || /* @__PURE__ */ I("span", {
253
+ className: "text-muted-foreground/80",
254
+ children: r ?? "—"
255
+ })
256
+ });
257
+ function D(e) {
258
+ if (e.key === "Escape") {
259
+ e.preventDefault(), x();
260
+ return;
261
+ }
262
+ e.key === "Enter" && (!n || e.metaKey || e.ctrlKey) && (e.preventDefault(), b());
263
+ }
264
+ return n ? /* @__PURE__ */ I("textarea", {
265
+ ref: _,
266
+ value: f,
267
+ onChange: (e) => S(e.target.value),
268
+ onBlur: b,
269
+ onKeyDown: D,
270
+ placeholder: r,
271
+ "aria-label": a,
272
+ rows: 3,
273
+ className: `${E} resize-none py-0.5 leading-snug`
274
+ }) : /* @__PURE__ */ I(p, {
275
+ ref: _,
276
+ value: f,
277
+ onChange: (e) => S(e.target.value),
278
+ onBlur: b,
279
+ onKeyDown: D,
280
+ placeholder: r,
281
+ "aria-label": a,
282
+ className: `${E} h-auto px-0 py-0 shadow-none focus-visible:ring-0`
283
+ });
284
+ }
285
+ //#endregion
286
+ //#region src/bento/bento-status-marker.tsx
287
+ function Le({ titleMissing: e, dirty: t, className: n }) {
288
+ let { t: r } = G();
289
+ if (!e && !t) return null;
290
+ let i = "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal";
291
+ return e ? /* @__PURE__ */ L("span", {
292
+ className: `${i} bento-status bento-status-error ${n ?? ""}`,
293
+ children: [/* @__PURE__ */ I(te, { className: "size-3" }), r("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
294
+ }) : /* @__PURE__ */ L("span", {
295
+ className: `${i} bento-status bento-status-warn ${n ?? ""}`,
296
+ children: [/* @__PURE__ */ I("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), r("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
297
+ });
298
+ }
299
+ //#endregion
300
+ //#region src/bento/bento-scroll-fade.ts
301
+ function Re(e) {
302
+ j(() => {
303
+ let t = e.current;
304
+ if (!t) return;
305
+ let n = document.documentElement, r = 0, i = () => {
306
+ r = 0;
307
+ let e = t.getBoundingClientRect().top, i = Math.max(0, Math.min(1, (160 - e) / 80));
308
+ n.style.setProperty("--bento-fade", String(i)), n.classList.toggle("bento-fade-half", i > .5);
309
+ }, a = () => {
310
+ r ||= requestAnimationFrame(i);
311
+ };
312
+ return i(), window.addEventListener("scroll", a, { passive: !0 }), window.addEventListener("resize", a), () => {
313
+ r && cancelAnimationFrame(r), window.removeEventListener("scroll", a), window.removeEventListener("resize", a), n.style.removeProperty("--bento-fade"), n.classList.remove("bento-fade-half");
314
+ };
315
+ }, [e]);
316
+ }
317
+ //#endregion
318
+ //#region src/bento/bento-entity-shell.tsx
319
+ function ze(e, t) {
320
+ let n = {};
321
+ for (let r of Object.keys(e)) Object.assign(n, { [r]: t[r] });
322
+ return n;
323
+ }
324
+ function Be({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i, icon: a, tone: o, formId: s, feature: c, hasStatus: l = !1, hideIcon: u = !1, readOnly: d = !1, autosaveOnly: f = !1, badge: p, notice: m, onUpdate: h, onDelete: g, extraActions: v, children: y }) {
325
+ let { t: b } = G(), x = J(), [C, w] = P(!1), [E, D] = P({
326
+ isDirty: !1,
327
+ isSubmitting: !1
328
+ }), O = N(null);
329
+ Re(O);
330
+ let k = {
331
+ title: e.title ?? "",
332
+ description: e.description ?? "",
333
+ icon: e.icon ?? null,
334
+ enabled: e.enabled ?? 1
335
+ }, [A, j] = P(k), [M, ee] = P(k);
336
+ (k.title !== M.title || k.description !== M.description || k.icon !== M.icon || k.enabled !== M.enabled) && (ee(k), j(k));
337
+ async function R(n) {
338
+ if (j((e) => ({
339
+ ...e,
340
+ ...n
341
+ })), t || !h) return;
342
+ let r = n.title ?? A.title;
343
+ try {
344
+ await h({
345
+ ...e,
346
+ ...n
347
+ }), S.success(b("forms.common.updated", {
348
+ name: r,
349
+ feature: c
350
+ }));
351
+ } catch (e) {
352
+ console.error("Failed to update entity field", e), j((e) => ({
353
+ ...e,
354
+ ...ze(n, k)
355
+ })), S.error(b("forms.common.notUpdated", {
356
+ name: k.title || r,
357
+ feature: c
358
+ }));
359
+ }
360
+ }
361
+ async function te() {
362
+ if (g) {
363
+ try {
364
+ await g() ? (S.success(b("forms.common.deleted", {
365
+ name: A.title,
366
+ feature: c
367
+ })), x(i)) : S.error(b("forms.common.notDeleted", {
368
+ name: A.title,
369
+ feature: c
370
+ }));
371
+ } catch (e) {
372
+ console.error("Failed to delete entity", e), S.error(b("forms.common.notDeleted", {
373
+ name: A.title,
374
+ feature: c
375
+ }));
376
+ }
377
+ w(!1);
378
+ }
379
+ }
380
+ let z = A.enabled === 1, ne = !d, re = !(f && !t), B = !A.title.trim(), ie = !t && !E.isDirty, ae = B || ie, V = [...v ?? [], ...g && !d ? [{
381
+ label: b("forms.formActions.delete"),
382
+ icon: he,
383
+ tone: "destructive",
384
+ onSelect: () => w(!0)
385
+ }] : []];
386
+ return /* @__PURE__ */ L(F, { children: [
387
+ /* @__PURE__ */ I(Q, {
388
+ eyebrow: /* @__PURE__ */ L("span", {
389
+ className: "inline-flex items-center gap-2",
390
+ children: [/* @__PURE__ */ I(Z, {
391
+ to: i,
392
+ children: r
393
+ }), !d && /* @__PURE__ */ I(Le, {
394
+ titleMissing: B,
395
+ dirty: t || E.isDirty
396
+ })]
397
+ }),
398
+ leading: /* @__PURE__ */ I(Fe, {
399
+ value: A.icon,
400
+ onChange: (e) => R({ icon: e }),
401
+ onClear: () => R({ icon: null }),
402
+ defaultIcon: a,
403
+ tone: o,
404
+ title: A.title,
405
+ description: A.description,
406
+ readOnly: d || u
407
+ }),
408
+ title: /* @__PURE__ */ I(Ie, {
409
+ value: A.title,
410
+ onSave: (e) => R({ title: e }),
411
+ placeholder: n,
412
+ className: "text-3xl font-semibold tracking-tight md:text-4xl",
413
+ ariaLabel: b("forms.common.title"),
414
+ autoFocus: t,
415
+ commitOnChange: t,
416
+ readOnly: d
417
+ }),
418
+ subtitle: /* @__PURE__ */ I(Ie, {
419
+ value: A.description,
420
+ onSave: (e) => R({ description: e }),
421
+ multiline: !0,
422
+ placeholder: b("forms.common.description"),
423
+ className: "max-w-2xl text-sm text-muted-foreground",
424
+ ariaLabel: b("forms.common.description"),
425
+ commitOnChange: t,
426
+ readOnly: d
427
+ }),
428
+ trailing: /* @__PURE__ */ L(F, { children: [
429
+ ne && /* @__PURE__ */ L("div", {
430
+ className: "bento-fade-out flex shrink-0 items-center gap-2",
431
+ children: [re && /* @__PURE__ */ L(_, {
432
+ type: "submit",
433
+ form: s,
434
+ size: "sm",
435
+ loading: E.isSubmitting,
436
+ disabled: ae,
437
+ children: [/* @__PURE__ */ I(H, { className: "size-4" }), b("forms.formActions.saveChanges")]
438
+ }), /* @__PURE__ */ L(_, {
439
+ type: "button",
440
+ size: "sm",
441
+ variant: "outline",
442
+ onClick: () => x(i),
443
+ children: [/* @__PURE__ */ I(W, { className: "size-4" }), b("forms.formActions.cancel")]
444
+ })]
445
+ }),
446
+ p,
447
+ l && (d ? /* @__PURE__ */ L("span", {
448
+ className: `flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${z ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
449
+ children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${z ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), z ? b("common.active", { defaultValue: "Active" }) : b("common.idle", { defaultValue: "Idle" })]
450
+ }) : /* @__PURE__ */ L("button", {
451
+ type: "button",
452
+ onClick: () => R({ enabled: +!z }),
453
+ "aria-label": b("forms.common.enabled"),
454
+ title: b(z ? "common.activeToggleHint" : "common.idleToggleHint"),
455
+ className: `bento-tile-clickable flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider transition-colors duration-200 ${z ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"}`,
456
+ children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${z ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), z ? b("common.active", { defaultValue: "Active" }) : b("common.idle", { defaultValue: "Idle" })]
457
+ })),
458
+ !t && V.length > 0 && /* @__PURE__ */ I(je, { actions: V })
459
+ ] })
460
+ }),
461
+ /* @__PURE__ */ I("div", {
462
+ ref: O,
463
+ "aria-hidden": !0,
464
+ className: "h-px"
465
+ }),
466
+ m,
467
+ !t && g && /* @__PURE__ */ I(T, {
468
+ feature: c,
469
+ name: A.title,
470
+ onDelete: te,
471
+ open: C,
472
+ setOpen: w,
473
+ trigger: /* @__PURE__ */ I("span", {
474
+ className: "hidden",
475
+ "aria-hidden": !0
476
+ })
477
+ }),
478
+ y({
479
+ staged: A,
480
+ onStateChange: D
481
+ })
482
+ ] });
483
+ }
484
+ //#endregion
485
+ //#region src/bento/bento-layout.ts
486
+ var Ve = {
487
+ LARGE: "col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2",
488
+ MEDIUM: "col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
489
+ SMALL: "col-span-1 row-span-1"
490
+ }, He = {
491
+ SMALL: "MEDIUM",
492
+ MEDIUM: "LARGE",
493
+ LARGE: "SMALL"
494
+ };
495
+ function Ue(e, t, n) {
496
+ if (!n || n.length === 0) return e.map((e, n) => ({
497
+ item: e,
498
+ key: t(e),
499
+ emphasis: n === 0 ? "LARGE" : "MEDIUM"
500
+ }));
501
+ let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
502
+ for (let e of n) r.set(e.itemId, e.displayOrder), i.set(e.itemId, e.emphasis);
503
+ return e.map((e, n) => ({
504
+ item: e,
505
+ key: t(e),
506
+ idx: n
507
+ })).sort((e, t) => {
508
+ let n = r.has(e.key) ? r.get(e.key) : 2 ** 53 - 1, i = r.has(t.key) ? r.get(t.key) : 2 ** 53 - 1;
509
+ return n === i ? e.idx - t.idx : n - i;
510
+ }).map(({ item: e, key: t }) => ({
511
+ item: e,
512
+ key: t,
513
+ emphasis: i.get(t) ?? "MEDIUM"
514
+ }));
515
+ }
516
+ function We(e) {
517
+ return e.map((e, t) => ({
518
+ itemId: e.key,
519
+ emphasis: e.emphasis,
520
+ displayOrder: t
521
+ }));
522
+ }
523
+ //#endregion
524
+ //#region src/bento/bento-entity-tile.tsx
525
+ function Ge({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, tone: a = "indigo", title: o, description: s, meta: c, enabled: l, hasStatus: u = !1, viewTransitionName: d }) {
526
+ let { t: f } = G(), p = X(a), m = t ?? (n ? "LARGE" : "MEDIUM"), h = m === "LARGE", g = m === "SMALL", _ = Ve[m], v = l === 1, y = h ? "p-6 md:p-7" : g ? "p-4" : "p-5", b = h ? "h-14 w-14" : g ? "h-8 w-8" : "h-9 w-9", x = h ? 28 : g ? 16 : 18, S = h ? "text-xl md:text-2xl" : g ? "text-sm" : "text-base md:text-lg";
527
+ return /* @__PURE__ */ L(q, {
528
+ to: e,
529
+ className: `bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${h ? "gap-5" : "gap-4"} overflow-hidden ${y} ${_}`,
530
+ style: d ? { viewTransitionName: d } : void 0,
531
+ children: [
532
+ h && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
533
+ "aria-hidden": !0,
534
+ className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${p} opacity-40 blur-2xl dark:opacity-50`
535
+ }), /* @__PURE__ */ I("div", {
536
+ "aria-hidden": !0,
537
+ className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${p} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
538
+ })] }),
539
+ /* @__PURE__ */ L("div", {
540
+ className: "relative z-1 flex items-center justify-between",
541
+ children: [/* @__PURE__ */ I("span", {
542
+ className: `grid place-items-center rounded-2xl ${p} text-white shadow-md ${b}`,
543
+ children: i ? /* @__PURE__ */ I(K, {
544
+ icon: i,
545
+ className: h ? "size-7 text-white" : "size-4.5 text-white"
546
+ }) : /* @__PURE__ */ I(r, { size: x })
547
+ }), u && /* @__PURE__ */ L("span", {
548
+ className: `flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${v ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
549
+ children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${v ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), v ? f("common.active", { defaultValue: "Active" }) : f("common.idle", { defaultValue: "Idle" })]
550
+ })]
551
+ }),
552
+ /* @__PURE__ */ L("div", {
553
+ className: "relative z-1",
554
+ children: [
555
+ /* @__PURE__ */ I("div", {
556
+ className: `font-semibold tracking-tight ${S}`,
557
+ children: o
558
+ }),
559
+ !g && c && /* @__PURE__ */ I("div", {
560
+ className: "mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",
561
+ children: c
562
+ }),
563
+ !g && s && /* @__PURE__ */ I("p", {
564
+ className: "mt-2 text-sm text-muted-foreground",
565
+ children: s
566
+ })
567
+ ]
568
+ })
569
+ ]
570
+ });
571
+ }
572
+ //#endregion
573
+ //#region src/bento/bento-list-page.tsx
574
+ var Ke = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
575
+ function qe({ items: e, error: t, tryAgainUrl: n, listId: r, eyebrow: i, backTo: a, backLabel: o, heroIcon: s, title: c, subtitle: l, tone: u = "indigo", headerAction: d, newRoute: f, newLabel: p, newSubtitle: m, hideNew: h = !1, itemKey: g, renderTile: _, emptyTitle: v, emptyDescription: y, layout: x }) {
576
+ let { t: S } = G(), C = X(u), [w, T] = P(!1), D = M(() => Ue(e ?? [], g, x?.data?.entries), [
577
+ e,
578
+ g,
579
+ x?.data?.entries
580
+ ]), O = !!r && !!x && (e?.length ?? 0) > 0;
581
+ return /* @__PURE__ */ L(E, {
582
+ checkIsNotUndefined: e,
583
+ error: t ?? null,
584
+ tryAgainUrl: n,
585
+ children: [
586
+ /* @__PURE__ */ I(Q, {
587
+ eyebrow: i,
588
+ backTo: a,
589
+ backLabel: o,
590
+ leading: /* @__PURE__ */ I("span", {
591
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${C} text-white shadow-md`,
592
+ children: /* @__PURE__ */ I(s, { size: 24 })
593
+ }),
594
+ title: c,
595
+ subtitle: l
596
+ }),
597
+ (d || O && !w) && /* @__PURE__ */ L("div", {
598
+ className: "mb-4 flex flex-wrap items-center gap-2",
599
+ children: [d, O && !w && /* @__PURE__ */ L(b, {
600
+ variant: "outline",
601
+ size: "sm",
602
+ onClick: () => T(!0),
603
+ className: "ml-auto gap-2",
604
+ children: [/* @__PURE__ */ I(R, { size: 16 }), S("bento.layout.customize", { defaultValue: "Customize layout" })]
605
+ })]
606
+ }),
607
+ w && r && x ? /* @__PURE__ */ I(Xe, {
608
+ layout: x,
609
+ resolved: D,
610
+ canEditGlobal: x?.data?.canEditGlobal ?? !1,
611
+ isCustomized: x?.data?.source === "USER",
612
+ renderTile: _,
613
+ chip: C,
614
+ hideNew: h,
615
+ newRoute: f,
616
+ newLabel: p,
617
+ newSubtitle: m,
618
+ onClose: () => T(!1)
619
+ }) : /* @__PURE__ */ I(Ye, {
620
+ resolved: D,
621
+ renderTile: _,
622
+ chip: C,
623
+ hideNew: h,
624
+ newRoute: f,
625
+ newLabel: p,
626
+ newSubtitle: m,
627
+ isEmpty: e?.length === 0,
628
+ emptyTitle: v,
629
+ emptyDescription: y
630
+ })
631
+ ]
632
+ });
633
+ }
634
+ function Je({ items: e, error: t, tryAgainUrl: n, tone: r = "indigo", newRoute: i, newLabel: a, newSubtitle: o, hideNew: s = !1, itemKey: c, renderTile: l, emptyTitle: u, emptyDescription: d }) {
635
+ let f = X(r);
636
+ return /* @__PURE__ */ I(E, {
637
+ checkIsNotUndefined: e,
638
+ error: t ?? null,
639
+ tryAgainUrl: n,
640
+ children: /* @__PURE__ */ L("div", {
641
+ className: Ke,
642
+ children: [
643
+ !s && i && a ? /* @__PURE__ */ I(et, {
644
+ route: i,
645
+ label: a,
646
+ subtitle: o,
647
+ chip: f
648
+ }) : null,
649
+ (e ?? []).map((e) => /* @__PURE__ */ I("span", {
650
+ className: "contents",
651
+ children: l(e)
652
+ }, c(e))),
653
+ e?.length === 0 && /* @__PURE__ */ I(tt, {
654
+ title: u,
655
+ description: d
656
+ })
657
+ ]
658
+ })
659
+ });
660
+ }
661
+ function Ye({ resolved: e, renderTile: t, chip: n, hideNew: r, newRoute: i, newLabel: o, newSubtitle: s, isEmpty: c, emptyTitle: l, emptyDescription: u }) {
662
+ let d = e.some((e) => e.emphasis === "SMALL");
663
+ return /* @__PURE__ */ L("div", {
664
+ className: a(Ke, d && "grid-flow-dense"),
665
+ children: [
666
+ !r && /* @__PURE__ */ I(et, {
667
+ route: i,
668
+ label: o,
669
+ subtitle: s,
670
+ chip: n
671
+ }),
672
+ e.map(({ item: e, key: n, emphasis: r }) => /* @__PURE__ */ I("span", {
673
+ className: "contents",
674
+ children: t(e, r)
675
+ }, n)),
676
+ c && /* @__PURE__ */ I(tt, {
677
+ title: l,
678
+ description: u
679
+ })
680
+ ]
681
+ });
682
+ }
683
+ function Xe({ layout: e, resolved: t, canEditGlobal: n, isCustomized: r, renderTile: i, chip: o, hideNew: s, newRoute: c, newLabel: l, newSubtitle: u, onClose: d }) {
684
+ let { t: f } = G(), [p, m] = P(t), h = e.saving ?? !1, [g, _] = P(!1), v = (e) => async () => {
685
+ if (e) {
686
+ _(!1);
687
+ try {
688
+ await e(), d();
689
+ } catch (e) {
690
+ console.error("Failed to save the bento layout", e), _(!0);
691
+ }
692
+ }
693
+ }, y = we(Ce(xe, { activationConstraint: { distance: 8 } }), Ce(be));
694
+ function x(e) {
695
+ let { active: t, over: n } = e;
696
+ !n || t.id === n.id || m((e) => {
697
+ let r = e.findIndex((e) => e.key === t.id), i = e.findIndex((e) => e.key === n.id);
698
+ return r < 0 || i < 0 ? e : Ee(e, r, i);
699
+ });
700
+ }
701
+ function S(e, t) {
702
+ m((n) => n.map((n) => n.key === e ? {
703
+ ...n,
704
+ emphasis: t
705
+ } : n));
706
+ }
707
+ let C = M(() => We(p), [p]), w = p.some((e) => e.emphasis === "SMALL");
708
+ return /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("div", {
709
+ className: "mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md",
710
+ children: [
711
+ /* @__PURE__ */ I("span", {
712
+ className: "mr-auto text-sm text-muted-foreground",
713
+ children: f("bento.layout.editHint", { defaultValue: "Drag tiles to reorder · tap the size button to resize" })
714
+ }),
715
+ r && e.onReset && /* @__PURE__ */ L(b, {
716
+ variant: "ghost",
717
+ size: "sm",
718
+ className: "gap-2",
719
+ disabled: h,
720
+ onClick: v(e.onReset),
721
+ children: [/* @__PURE__ */ I(z, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
722
+ }),
723
+ n && e.onSaveGlobal && /* @__PURE__ */ L(b, {
724
+ variant: "outline",
725
+ size: "sm",
726
+ className: "gap-2",
727
+ disabled: h,
728
+ onClick: v(() => e.onSaveGlobal?.(C)),
729
+ children: [/* @__PURE__ */ I(_e, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
730
+ }),
731
+ /* @__PURE__ */ L(b, {
732
+ variant: "ghost",
733
+ size: "sm",
734
+ className: "gap-2",
735
+ disabled: h,
736
+ onClick: d,
737
+ children: [/* @__PURE__ */ I(W, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
738
+ }),
739
+ /* @__PURE__ */ L(b, {
740
+ size: "sm",
741
+ className: "gap-2",
742
+ disabled: h,
743
+ onClick: v(() => e.onSave(C)),
744
+ children: [/* @__PURE__ */ I(H, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
745
+ }),
746
+ g && /* @__PURE__ */ I("p", {
747
+ role: "alert",
748
+ className: "w-full text-sm text-destructive",
749
+ children: f("bento.layout.saveFailed", { defaultValue: "The layout could not be saved. Nothing has changed — try again." })
750
+ })
751
+ ]
752
+ }), /* @__PURE__ */ I(ye, {
753
+ sensors: y,
754
+ collisionDetection: Se,
755
+ onDragEnd: x,
756
+ children: /* @__PURE__ */ I(Te, {
757
+ items: p.map((e) => e.key),
758
+ strategy: De,
759
+ children: /* @__PURE__ */ L("div", {
760
+ className: a(Ke, w && "grid-flow-dense"),
761
+ children: [!s && /* @__PURE__ */ I(et, {
762
+ route: c,
763
+ label: l,
764
+ subtitle: u,
765
+ chip: o
766
+ }), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ I($e, {
767
+ id: t,
768
+ emphasis: n,
769
+ onSetEmphasis: (e) => S(t, e),
770
+ children: i(e, n)
771
+ }, t))]
772
+ })
773
+ })
774
+ })] });
775
+ }
776
+ var Ze = [
777
+ "SMALL",
778
+ "MEDIUM",
779
+ "LARGE"
780
+ ], Qe = {
781
+ SMALL: {
782
+ key: "bento.layout.size.small",
783
+ def: "Small"
784
+ },
785
+ MEDIUM: {
786
+ key: "bento.layout.size.medium",
787
+ def: "Medium"
788
+ },
789
+ LARGE: {
790
+ key: "bento.layout.size.large",
791
+ def: "Large"
792
+ }
793
+ };
794
+ function $e({ id: e, emphasis: t, onSetEmphasis: n, children: r }) {
795
+ let { t: i } = G(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = Oe({ id: e }), f = {
796
+ transform: ke.Translate.toString(l),
797
+ transition: u,
798
+ opacity: d ? .6 : 1,
799
+ zIndex: d ? 50 : void 0
800
+ };
801
+ return /* @__PURE__ */ L("div", {
802
+ ref: c,
803
+ style: f,
804
+ className: a("relative h-full", Ve[t]),
805
+ children: [/* @__PURE__ */ I("div", {
806
+ className: "pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full",
807
+ children: r
808
+ }), /* @__PURE__ */ L("div", {
809
+ className: "absolute right-2 top-2 z-10 flex items-center gap-1",
810
+ children: [/* @__PURE__ */ I("div", {
811
+ role: "group",
812
+ "aria-label": i("bento.layout.sizeGroup", { defaultValue: "Tile size" }),
813
+ className: "flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur",
814
+ children: Ze.map((e) => {
815
+ let r = e === t, o = i(Qe[e].key, { defaultValue: Qe[e].def });
816
+ return /* @__PURE__ */ I("button", {
817
+ type: "button",
818
+ onClick: () => n(e),
819
+ "aria-pressed": r,
820
+ "aria-label": o,
821
+ title: o,
822
+ className: a("grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors", r ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-muted"),
823
+ children: o.charAt(0)
824
+ }, e);
825
+ })
826
+ }), /* @__PURE__ */ I("button", {
827
+ type: "button",
828
+ ...o,
829
+ ...s,
830
+ "aria-label": i("bento.layout.dragToReorder", { defaultValue: "Drag to reorder" }),
831
+ className: "grid h-7 w-7 cursor-grab place-items-center rounded-full border border-border/60 bg-background/80 shadow-sm backdrop-blur hover:bg-background active:cursor-grabbing",
832
+ children: /* @__PURE__ */ I(ce, {
833
+ size: 14,
834
+ className: "text-muted-foreground"
835
+ })
836
+ })]
837
+ })]
838
+ });
839
+ }
840
+ function et({ route: e, label: t, subtitle: n, chip: r }) {
841
+ let { t: i } = G();
842
+ return /* @__PURE__ */ L(q, {
843
+ to: e,
844
+ className: "bento-tile bento-tile-clickable col-span-2 row-span-1 flex flex-col gap-3 rounded-3xl border-2 border-dashed border-border/60 bg-card/30 p-5 backdrop-blur-md bento-new-tile hover:bg-card/50 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
845
+ children: [/* @__PURE__ */ L("div", {
846
+ className: "flex items-center gap-3",
847
+ children: [/* @__PURE__ */ I("span", {
848
+ className: `bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,
849
+ children: /* @__PURE__ */ I(pe, { size: 20 })
850
+ }), /* @__PURE__ */ I("span", {
851
+ className: "text-[11px] uppercase tracking-wider text-muted-foreground",
852
+ children: i("forms.formActions.new", { defaultValue: "New" })
853
+ })]
854
+ }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("div", {
855
+ className: "text-base font-semibold tracking-tight md:text-lg",
856
+ children: /* @__PURE__ */ I("span", {
857
+ className: `${r} bg-clip-text text-transparent`,
858
+ children: t
859
+ })
860
+ }), n && /* @__PURE__ */ I("p", {
861
+ className: "mt-1 text-sm text-muted-foreground",
862
+ children: n
863
+ })] })]
864
+ });
865
+ }
866
+ function tt({ title: e, description: t }) {
867
+ return /* @__PURE__ */ I(Pe, {
868
+ icon: U,
869
+ title: e,
870
+ description: t,
871
+ align: "start",
872
+ className: "col-span-2 row-span-2 justify-end md:col-span-4"
873
+ });
874
+ }
875
+ //#endregion
876
+ //#region src/bento/bento-save-bar.tsx
877
+ function nt({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: a, dirty: o, titleMissing: s }) {
878
+ let { t: c } = G();
879
+ return /* @__PURE__ */ L("div", {
880
+ className: "bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl",
881
+ children: [/* @__PURE__ */ L("div", {
882
+ className: "flex min-w-0 items-center gap-3",
883
+ children: [
884
+ e && /* @__PURE__ */ I("p", {
885
+ className: "truncate text-base font-semibold tracking-tight md:text-lg",
886
+ children: e
887
+ }),
888
+ /* @__PURE__ */ I(Le, {
889
+ titleMissing: s,
890
+ dirty: o
891
+ }),
892
+ t && /* @__PURE__ */ I("div", {
893
+ className: "flex shrink-0 items-center gap-1.5",
894
+ children: t
895
+ })
896
+ ]
897
+ }), /* @__PURE__ */ I("div", {
898
+ className: "flex shrink-0 gap-2",
899
+ children: n ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(_, {
900
+ type: "submit",
901
+ size: "sm",
902
+ loading: i,
903
+ disabled: a,
904
+ children: [/* @__PURE__ */ I(H, { className: "size-4" }), c("forms.formActions.saveChanges")]
905
+ }), r && /* @__PURE__ */ L(_, {
906
+ type: "button",
907
+ variant: "outline",
908
+ size: "sm",
909
+ onClick: r,
910
+ children: [/* @__PURE__ */ I(W, { className: "size-4" }), c("forms.formActions.cancel")]
911
+ })] })
912
+ })]
913
+ });
914
+ }
915
+ function rt({ children: e }) {
916
+ return /* @__PURE__ */ I("span", {
917
+ className: "rounded-full border border-border/60 bg-card/50 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground backdrop-blur",
918
+ children: e
919
+ });
920
+ }
921
+ nt.Badge = rt;
922
+ //#endregion
923
+ //#region src/bento/bento-scroll-save-bar.tsx
924
+ function it(e) {
925
+ let t = N(null);
926
+ return Re(t), /* @__PURE__ */ L(F, { children: [
927
+ /* @__PURE__ */ I("div", {
928
+ ref: t,
929
+ "aria-hidden": !0,
930
+ className: "h-px"
931
+ }),
932
+ /* @__PURE__ */ I("div", {
933
+ "aria-hidden": !0,
934
+ className: "bento-save-bar-spacer"
935
+ }),
936
+ /* @__PURE__ */ I("div", {
937
+ className: "bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8",
938
+ children: /* @__PURE__ */ I(nt, { ...e })
939
+ })
940
+ ] });
941
+ }
942
+ //#endregion
943
+ //#region src/bento/bento-form-hero.tsx
944
+ function at({ eyebrow: e, backTo: t, backLabel: n, leading: r, title: i, subtitle: a, trailing: o, onCancel: s, actions: c, loading: l, dirty: u, titleMissing: d, saveDisabled: f, stickyTitle: p, stickyBadges: m }) {
945
+ let { t: h } = G(), g = f ?? (!!d || !u);
946
+ return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(Q, {
947
+ eyebrow: t === void 0 ? e : /* @__PURE__ */ I(Z, {
948
+ to: t,
949
+ children: n
950
+ }),
951
+ leading: r,
952
+ title: i,
953
+ subtitle: a,
954
+ trailing: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
955
+ className: "bento-fade-out flex shrink-0 items-center gap-2",
956
+ children: c ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(_, {
957
+ type: "submit",
958
+ size: "sm",
959
+ loading: l,
960
+ disabled: g,
961
+ children: [/* @__PURE__ */ I(H, { className: "size-4" }), h("forms.formActions.saveChanges")]
962
+ }), /* @__PURE__ */ L(_, {
963
+ type: "button",
964
+ variant: "outline",
965
+ size: "sm",
966
+ onClick: s,
967
+ children: [/* @__PURE__ */ I(W, { className: "size-4" }), h("forms.formActions.cancel")]
968
+ })] })
969
+ }), o] })
970
+ }), /* @__PURE__ */ I(it, {
971
+ title: p,
972
+ badges: m,
973
+ actions: c,
974
+ onCancel: s,
975
+ loading: l,
976
+ disabled: g,
977
+ dirty: u,
978
+ titleMissing: d
979
+ })] });
980
+ }
981
+ //#endregion
982
+ //#region src/bento/bento-form-section.tsx
983
+ function ot({ icon: e, tone: t, title: n, description: r, children: i, trailing: a, as: o = "h2" }) {
984
+ return /* @__PURE__ */ L("section", {
985
+ className: "bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6",
986
+ children: [/* @__PURE__ */ L("header", {
987
+ className: "flex items-start justify-between gap-3",
988
+ children: [/* @__PURE__ */ L("div", {
989
+ className: "flex items-center gap-3",
990
+ children: [/* @__PURE__ */ I("span", {
991
+ className: `grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${X(t)}`,
992
+ children: /* @__PURE__ */ I(e, { size: 20 })
993
+ }), /* @__PURE__ */ L("div", {
994
+ className: "flex flex-col gap-0.5",
995
+ children: [/* @__PURE__ */ I(o, {
996
+ className: "text-base font-semibold tracking-tight md:text-lg",
997
+ children: n
998
+ }), r && /* @__PURE__ */ I("p", {
999
+ className: "text-sm text-muted-foreground",
1000
+ children: r
1001
+ })]
1002
+ })]
1003
+ }), a && /* @__PURE__ */ I("div", {
1004
+ className: "shrink-0",
1005
+ children: a
1006
+ })]
1007
+ }), /* @__PURE__ */ I("div", {
1008
+ className: "flex flex-col gap-5",
1009
+ children: i
1010
+ })]
1011
+ });
1012
+ }
1013
+ //#endregion
1014
+ //#region src/bento/bento-back-to-top.tsx
1015
+ var st = 480;
1016
+ function ct(e) {
1017
+ return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
1018
+ }
1019
+ function lt() {
1020
+ return window.scrollY > st;
1021
+ }
1022
+ function ut() {
1023
+ let e = ee(ct, lt, () => !1);
1024
+ return /* @__PURE__ */ I("button", {
1025
+ type: "button",
1026
+ "aria-label": "Back to top",
1027
+ tabIndex: e ? 0 : -1,
1028
+ onClick: () => window.scrollTo({
1029
+ top: 0,
1030
+ behavior: "smooth"
1031
+ }),
1032
+ className: `fixed bottom-6 right-6 z-40 grid h-11 w-11 place-items-center rounded-full border border-border/60 bg-card/80 text-foreground shadow-lg backdrop-blur-xl transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:-translate-y-0.5 hover:shadow-xl active:scale-95 ${e ? "translate-y-0 scale-100 opacity-100" : "pointer-events-none translate-y-4 scale-90 opacity-0"}`,
1033
+ children: /* @__PURE__ */ I(B, { size: 18 })
1034
+ });
1035
+ }
1036
+ //#endregion
1037
+ //#region src/bento/bento-nav.ts
1038
+ function dt(e) {
1039
+ return e.bentoRoute ?? e.fallbackRoute;
1040
+ }
1041
+ //#endregion
1042
+ //#region src/bento/bento-command-palette.tsx
1043
+ function ft({ open: n, onOpenChange: i, items: a }) {
1044
+ let { t: o } = G(), s = J(), [c, l] = P(""), [u, d] = P(0), p = N(null), m = M(() => {
1045
+ let e = c.trim().toLowerCase(), t = a.map((e) => ({
1046
+ item: e,
1047
+ label: o(e.titleKey),
1048
+ description: o(e.descriptionKey)
1049
+ }));
1050
+ if (!e) return t;
1051
+ let n = [], r = [];
1052
+ for (let i of t) i.label.toLowerCase().includes(e) ? n.push(i) : i.description.toLowerCase().includes(e) && r.push(i);
1053
+ return [...n, ...r];
1054
+ }, [
1055
+ a,
1056
+ c,
1057
+ o
1058
+ ]), [h, g] = P(n);
1059
+ n !== h && (g(n), n && (l(""), d(0)));
1060
+ let _ = m.length === 0 ? 0 : m.length - 1;
1061
+ u > _ && d(_), j(() => {
1062
+ (p.current?.querySelector(`[data-index="${u}"]`))?.scrollIntoView({ block: "nearest" });
1063
+ }, [u]);
1064
+ function v(e) {
1065
+ i(!1), s(dt(e));
1066
+ }
1067
+ function y(e) {
1068
+ if (e.key === "ArrowDown") e.preventDefault(), d((e) => m.length === 0 ? 0 : (e + 1) % m.length);
1069
+ else if (e.key === "ArrowUp") e.preventDefault(), d((e) => m.length === 0 ? 0 : (e - 1 + m.length) % m.length);
1070
+ else if (e.key === "Enter") {
1071
+ e.preventDefault();
1072
+ let t = m[u];
1073
+ t && v(t.item);
1074
+ }
1075
+ }
1076
+ return /* @__PURE__ */ I(t, {
1077
+ open: n,
1078
+ onOpenChange: i,
1079
+ children: /* @__PURE__ */ L(f, {
1080
+ showCloseButton: !1,
1081
+ className: "top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0",
1082
+ onKeyDown: y,
1083
+ children: [
1084
+ /* @__PURE__ */ I(r, {
1085
+ className: "sr-only",
1086
+ children: o("bento.palette.title", { defaultValue: "Command palette" })
1087
+ }),
1088
+ /* @__PURE__ */ I(e, {
1089
+ className: "sr-only",
1090
+ children: o("bento.palette.description", { defaultValue: "Search and jump to any area" })
1091
+ }),
1092
+ /* @__PURE__ */ L("div", {
1093
+ className: "flex items-center gap-3 border-b border-border/60 px-4",
1094
+ children: [/* @__PURE__ */ I(me, {
1095
+ size: 18,
1096
+ className: "shrink-0 text-muted-foreground"
1097
+ }), /* @__PURE__ */ I("input", {
1098
+ autoFocus: !0,
1099
+ type: "text",
1100
+ role: "combobox",
1101
+ "aria-expanded": "true",
1102
+ "aria-controls": "bento-palette-list",
1103
+ "aria-activedescendant": m[u] ? `bento-palette-opt-${u}` : void 0,
1104
+ value: c,
1105
+ onChange: (e) => l(e.target.value),
1106
+ placeholder: o("bento.palette.placeholder", { defaultValue: "Search areas…" }),
1107
+ className: "h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
1108
+ })]
1109
+ }),
1110
+ /* @__PURE__ */ L("div", {
1111
+ ref: p,
1112
+ id: "bento-palette-list",
1113
+ role: "listbox",
1114
+ "aria-label": o("bento.palette.title", { defaultValue: "Command palette" }),
1115
+ className: "max-h-80 overflow-y-auto p-2",
1116
+ children: [m.length === 0 && /* @__PURE__ */ I("p", {
1117
+ className: "px-3 py-6 text-center text-sm text-muted-foreground",
1118
+ children: o("bento.palette.noResults", { defaultValue: "No matches" })
1119
+ }), m.map(({ item: e, label: t }, n) => {
1120
+ let r = !e.bentoRoute, i = n === u, a = e.icon;
1121
+ return /* @__PURE__ */ L("button", {
1122
+ type: "button",
1123
+ id: `bento-palette-opt-${n}`,
1124
+ "data-index": n,
1125
+ role: "option",
1126
+ "aria-selected": i ? "true" : "false",
1127
+ onMouseEnter: () => d(n),
1128
+ onClick: () => v(e),
1129
+ className: `flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${i ? "bg-accent text-accent-foreground" : "text-foreground"}`,
1130
+ children: [
1131
+ /* @__PURE__ */ I(a, {
1132
+ size: 18,
1133
+ className: "shrink-0 text-muted-foreground"
1134
+ }),
1135
+ /* @__PURE__ */ I("span", {
1136
+ className: "flex-1 truncate",
1137
+ children: t
1138
+ }),
1139
+ r ? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(se, {
1140
+ "aria-hidden": !0,
1141
+ size: 15,
1142
+ className: "shrink-0 text-muted-foreground/70"
1143
+ }), /* @__PURE__ */ I("span", {
1144
+ className: "sr-only",
1145
+ children: o("bento.palette.opensConsole", { defaultValue: "Opens in console" })
1146
+ })] }) : i && /* @__PURE__ */ I(re, {
1147
+ "aria-hidden": !0,
1148
+ size: 15,
1149
+ className: "shrink-0 text-muted-foreground"
1150
+ })
1151
+ ]
1152
+ }, e.id);
1153
+ })]
1154
+ })
1155
+ ]
1156
+ })
1157
+ });
1158
+ }
1159
+ //#endregion
1160
+ //#region src/bento/bento-shortcuts-dialog.tsx
1161
+ function pt({ open: n, onOpenChange: a, isMac: o }) {
1162
+ let { t: s } = G(), c = o ? "⌘" : "Ctrl", l = [{
1163
+ heading: s("bento.shortcuts.global", { defaultValue: "Global" }),
1164
+ rows: [{
1165
+ keys: [c, "K"],
1166
+ label: s("bento.palette.open", { defaultValue: "Open command palette" })
1167
+ }, {
1168
+ keys: ["?"],
1169
+ label: s("bento.shortcuts.openGuide", { defaultValue: "Show keyboard shortcuts" })
1170
+ }]
1171
+ }, {
1172
+ heading: s("bento.shortcuts.palette", { defaultValue: "Command palette" }),
1173
+ rows: [
1174
+ {
1175
+ keys: ["↑", "↓"],
1176
+ label: s("bento.shortcuts.navigate", { defaultValue: "Move between results" })
1177
+ },
1178
+ {
1179
+ keys: ["↵"],
1180
+ label: s("bento.shortcuts.openSelected", { defaultValue: "Open the selected area" })
1181
+ },
1182
+ {
1183
+ keys: ["Esc"],
1184
+ label: s("bento.shortcuts.dismiss", { defaultValue: "Close the palette or a dialog" })
1185
+ }
1186
+ ]
1187
+ }];
1188
+ return /* @__PURE__ */ I(t, {
1189
+ open: n,
1190
+ onOpenChange: a,
1191
+ children: /* @__PURE__ */ L(f, {
1192
+ className: "max-w-md",
1193
+ children: [/* @__PURE__ */ L(i, { children: [/* @__PURE__ */ L(r, {
1194
+ className: "flex items-center gap-2",
1195
+ children: [/* @__PURE__ */ I(ue, {
1196
+ size: 20,
1197
+ className: "bento-accent-icon"
1198
+ }), s("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
1199
+ }), /* @__PURE__ */ I(e, { children: s("bento.shortcuts.description", { defaultValue: "Move around Turing without leaving the keyboard." }) })] }), /* @__PURE__ */ I("div", {
1200
+ className: "flex flex-col gap-5",
1201
+ children: l.map((e) => /* @__PURE__ */ L("section", { children: [/* @__PURE__ */ I("h3", {
1202
+ className: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
1203
+ children: e.heading
1204
+ }), /* @__PURE__ */ I("ul", {
1205
+ className: "flex flex-col gap-1.5",
1206
+ children: e.rows.map((e) => /* @__PURE__ */ L("li", {
1207
+ className: "flex items-center justify-between gap-4",
1208
+ children: [/* @__PURE__ */ I("span", {
1209
+ className: "text-sm text-foreground",
1210
+ children: e.label
1211
+ }), /* @__PURE__ */ I("span", {
1212
+ className: "flex shrink-0 items-center gap-1",
1213
+ children: e.keys.map((e) => /* @__PURE__ */ I("kbd", {
1214
+ className: "inline-flex min-w-6 items-center justify-center rounded-md border border-border/60 bg-muted px-1.5 py-0.5 text-[11px] font-medium tracking-wide",
1215
+ children: e
1216
+ }, e))
1217
+ })]
1218
+ }, e.label))
1219
+ })] }, e.heading))
1220
+ })]
1221
+ })
1222
+ });
1223
+ }
1224
+ //#endregion
1225
+ //#region src/bento/bento-nav-rail.tsx
1226
+ function mt(e, t) {
1227
+ return e === t || e.startsWith(`${t}/`);
1228
+ }
1229
+ function ht(e, t) {
1230
+ return t.section.areaRoute && mt(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && mt(e, t.bentoRoute));
1231
+ }
1232
+ function gt({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
1233
+ let { t: i } = G(), { pathname: a } = ve(), o = M(() => e.filter((e) => e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
1234
+ return /* @__PURE__ */ I(h, {
1235
+ delayDuration: 200,
1236
+ children: /* @__PURE__ */ L("nav", {
1237
+ "aria-label": i("bento.nav.label", { defaultValue: "Primary" }),
1238
+ className: "fixed inset-y-0 left-0 z-40 hidden w-16 flex-col items-center gap-1 overflow-y-auto overflow-x-hidden border-r border-border/40 bg-background/55 pt-20 pb-4 backdrop-blur-xl backdrop-saturate-150 md:flex",
1239
+ children: [
1240
+ /* @__PURE__ */ I(_t, {
1241
+ to: t,
1242
+ icon: le,
1243
+ label: r ?? i("home.title", { defaultValue: "Home" }),
1244
+ active: s
1245
+ }),
1246
+ o.length > 0 && /* @__PURE__ */ I("span", {
1247
+ "aria-hidden": !0,
1248
+ className: "my-1 h-px w-6 bg-border/60"
1249
+ }),
1250
+ o.map((e) => /* @__PURE__ */ I(_t, {
1251
+ to: e.section.areaRoute,
1252
+ icon: e.section.icon,
1253
+ label: i(e.section.labelKey),
1254
+ active: ht(a, e)
1255
+ }, e.section.id))
1256
+ ]
1257
+ })
1258
+ });
1259
+ }
1260
+ function _t({ to: e, icon: t, label: n, active: r }) {
1261
+ return /* @__PURE__ */ L(d, { children: [/* @__PURE__ */ I(g, {
1262
+ asChild: !0,
1263
+ children: /* @__PURE__ */ I(q, {
1264
+ to: e,
1265
+ "aria-label": n,
1266
+ "aria-current": r ? "page" : void 0,
1267
+ className: `bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${r ? "bento-rail-active" : "border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground"}`,
1268
+ children: /* @__PURE__ */ I(t, { size: 20 })
1269
+ })
1270
+ }), /* @__PURE__ */ I(s, {
1271
+ side: "right",
1272
+ children: n
1273
+ })] });
1274
+ }
1275
+ //#endregion
1276
+ //#region src/bento/bento-user-menu.tsx
1277
+ function vt({ accountRoute: e, logoutUrl: t, organizationsRoute: r, tenantAdminRoute: i, onOpenShortcuts: a, onReplayTour: s }) {
1278
+ let { user: d, status: f } = x(), { t: p } = G(), h = J(), g = `${d.firstName ?? ""} ${d.lastName ?? ""}`.trim() || d.username || "";
1279
+ return f === "loading" ? /* @__PURE__ */ I("div", {
1280
+ className: "h-9 w-9 rounded-full bg-muted/40",
1281
+ "aria-hidden": !0
1282
+ }) : /* @__PURE__ */ L(c, { children: [/* @__PURE__ */ I(n, {
1283
+ asChild: !0,
1284
+ children: /* @__PURE__ */ I("button", {
1285
+ type: "button",
1286
+ title: g || d.username,
1287
+ className: "bento-tile-clickable cursor-pointer rounded-full p-0.5 ring-1 ring-border/60 outline-none transition-shadow duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] bento-ring hover:ring-2 focus-visible:ring-2 focus-visible:ring-ring",
1288
+ children: /* @__PURE__ */ I(C, {
1289
+ givenName: d.firstName,
1290
+ familyName: d.lastName,
1291
+ name: g || d.username,
1292
+ src: d.avatarUrl || void 0,
1293
+ alt: d.username
1294
+ })
1295
+ })
1296
+ }), /* @__PURE__ */ L(m, {
1297
+ align: "end",
1298
+ sideOffset: 10,
1299
+ className: "bento-dropdown min-w-64 p-2",
1300
+ children: [
1301
+ /* @__PURE__ */ I(o, {
1302
+ className: "p-0 font-normal",
1303
+ children: /* @__PURE__ */ L("div", {
1304
+ className: "flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm",
1305
+ children: [/* @__PURE__ */ I("span", {
1306
+ className: "rounded-full p-0.5 ring-1 ring-border/60",
1307
+ children: /* @__PURE__ */ I(C, {
1308
+ givenName: d.firstName,
1309
+ familyName: d.lastName,
1310
+ name: g || d.username,
1311
+ src: d.avatarUrl || void 0,
1312
+ alt: d.username
1313
+ })
1314
+ }), /* @__PURE__ */ L("div", {
1315
+ className: "grid flex-1 text-left text-sm leading-tight",
1316
+ children: [g && /* @__PURE__ */ I("span", {
1317
+ className: "truncate font-medium",
1318
+ children: g
1319
+ }), d.email && /* @__PURE__ */ I("span", {
1320
+ className: "truncate text-xs text-muted-foreground",
1321
+ children: d.email
1322
+ })]
1323
+ })]
1324
+ })
1325
+ }),
1326
+ /* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }),
1327
+ /* @__PURE__ */ L(u, { children: [
1328
+ /* @__PURE__ */ L(l, {
1329
+ onSelect: () => h(e),
1330
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1331
+ children: [/* @__PURE__ */ I(ge, { size: 18 }), p("nav.account")]
1332
+ }),
1333
+ r && /* @__PURE__ */ L(l, {
1334
+ onSelect: () => h(r),
1335
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1336
+ children: [/* @__PURE__ */ I(ie, { size: 18 }), p("nav.organizations", { defaultValue: "Organizations" })]
1337
+ }),
1338
+ i && /* @__PURE__ */ L(l, {
1339
+ onSelect: () => h(i),
1340
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1341
+ children: [/* @__PURE__ */ I(ae, { size: 18 }), p("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
1342
+ })
1343
+ ] }),
1344
+ (a || s) && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ L(u, { children: [s && /* @__PURE__ */ L(l, {
1345
+ onSelect: () => s(),
1346
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1347
+ children: [/* @__PURE__ */ I(U, { size: 18 }), p("bento.tour.replay", { defaultValue: "Take the tour" })]
1348
+ }), a && /* @__PURE__ */ L(l, {
1349
+ onSelect: () => a(),
1350
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1351
+ children: [/* @__PURE__ */ I(ue, { size: 18 }), p("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
1352
+ })] })] }),
1353
+ /* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }),
1354
+ /* @__PURE__ */ L(l, {
1355
+ onSelect: () => {
1356
+ globalThis.location.href = t;
1357
+ },
1358
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger",
1359
+ children: [/* @__PURE__ */ I(de, { size: 18 }), p("nav.logOut")]
1360
+ })
1361
+ ]
1362
+ })] });
1363
+ }
1364
+ //#endregion
1365
+ //#region src/bento/bento-section-chrome.tsx
1366
+ var yt = O("console");
1367
+ function bt({ chrome: e, children: t }) {
1368
+ return /* @__PURE__ */ I(yt.Provider, {
1369
+ value: e,
1370
+ children: t
1371
+ });
1372
+ }
1373
+ function xt() {
1374
+ return A(yt);
1375
+ }
1376
+ var St = {
1377
+ blue: "blue",
1378
+ violet: "violet",
1379
+ emerald: "emerald",
1380
+ amber: "amber",
1381
+ rose: "rose",
1382
+ slate: "slate",
1383
+ cyan: "blue",
1384
+ orange: "amber"
1385
+ };
1386
+ function $({ variant: e = "blue", defaultOpen: t, className: n, children: r }) {
1387
+ let i = A(yt), a, o;
1388
+ return i === "bento" && D.forEach(r, (e) => {
1389
+ if (!k(e)) return;
1390
+ let { type: t } = e;
1391
+ t === w.Header || t === w.StaticHeader ? a = e.props : t === w.Content && (o = e.props.children);
1392
+ }), i === "bento" && a ? /* @__PURE__ */ I(ot, {
1393
+ icon: a.icon,
1394
+ tone: St[e] ?? "blue",
1395
+ title: a.title,
1396
+ description: a.description,
1397
+ children: o
1398
+ }) : /* @__PURE__ */ I(w, {
1399
+ variant: e,
1400
+ defaultOpen: t,
1401
+ className: n,
1402
+ children: r
1403
+ });
1404
+ }
1405
+ $.Header = w.Header, $.StaticHeader = w.StaticHeader, $.Content = w.Content;
1406
+ //#endregion
1407
+ //#region src/bento/bento-section.tsx
1408
+ var Ct = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
1409
+ function wt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = Ct }) {
1410
+ let o = /* @__PURE__ */ I("h2", {
1411
+ className: "text-xl font-semibold tracking-tight md:text-2xl",
1412
+ children: t
1413
+ });
1414
+ return /* @__PURE__ */ L("section", {
1415
+ className: "mb-8 md:mb-10",
1416
+ children: [/* @__PURE__ */ L("header", {
1417
+ className: "bento-shell-header mb-4 flex flex-col gap-0.5",
1418
+ children: [
1419
+ e && /* @__PURE__ */ I("span", {
1420
+ className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
1421
+ children: e
1422
+ }),
1423
+ r ? /* @__PURE__ */ L(q, {
1424
+ to: r,
1425
+ className: "group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary",
1426
+ children: [o, /* @__PURE__ */ I(V, {
1427
+ size: 20,
1428
+ className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
1429
+ })]
1430
+ }) : o,
1431
+ n && /* @__PURE__ */ I("p", {
1432
+ className: "max-w-2xl text-sm text-muted-foreground",
1433
+ children: n
1434
+ })
1435
+ ]
1436
+ }), /* @__PURE__ */ I("div", {
1437
+ className: a,
1438
+ children: i
1439
+ })]
1440
+ });
1441
+ }
1442
+ //#endregion
1443
+ //#region src/bento/bento-tile.tsx
1444
+ function Tt({ to: e, onClick: t, disabled: n = !1, disabledHint: r, icon: i, tone: a, eyebrow: o, title: s, span: c, featured: l = !1, children: u }) {
1445
+ let d = !n && !!(e || t), f = l ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", p = l ? 28 : 18, m = l ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", h = /* @__PURE__ */ L(F, { children: [
1446
+ l && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1447
+ "aria-hidden": !0,
1448
+ className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${X(a)} opacity-40 blur-2xl dark:opacity-50`
1449
+ }), /* @__PURE__ */ I("div", {
1450
+ "aria-hidden": !0,
1451
+ className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${X(a)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
1452
+ })] }),
1453
+ /* @__PURE__ */ L("div", {
1454
+ className: "relative z-1 flex items-center justify-between",
1455
+ children: [/* @__PURE__ */ I("span", {
1456
+ className: `grid place-items-center ${X(a)} text-white shadow-md ${f}`,
1457
+ children: /* @__PURE__ */ I(i, { size: p })
1458
+ }), d && /* @__PURE__ */ I(V, {
1459
+ size: l ? 18 : 16,
1460
+ className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
1461
+ })]
1462
+ }),
1463
+ /* @__PURE__ */ L("div", {
1464
+ className: "relative z-1",
1465
+ children: [
1466
+ /* @__PURE__ */ I("div", {
1467
+ className: "text-[11px] uppercase tracking-wider text-muted-foreground",
1468
+ children: o
1469
+ }),
1470
+ /* @__PURE__ */ I("div", {
1471
+ className: `mt-0.5 ${m}`,
1472
+ children: s
1473
+ }),
1474
+ u && /* @__PURE__ */ I("div", {
1475
+ className: "mt-2",
1476
+ children: u
1477
+ })
1478
+ ]
1479
+ })
1480
+ ] }), g = `bento-tile bento-glass group relative flex flex-col ${l ? "gap-5" : "gap-4"} overflow-hidden text-left ${l ? "p-6 md:p-7" : "p-5"} ${c}${d ? " bento-tile-clickable" : ""}${n ? " cursor-not-allowed opacity-60" : ""}`;
1481
+ return n ? /* @__PURE__ */ I("div", {
1482
+ className: g,
1483
+ "aria-disabled": "true",
1484
+ title: r,
1485
+ children: h
1486
+ }) : e ? /* @__PURE__ */ I(q, {
1487
+ to: e,
1488
+ className: g,
1489
+ children: h
1490
+ }) : t ? /* @__PURE__ */ I("button", {
1491
+ type: "button",
1492
+ onClick: t,
1493
+ className: `${g} w-full`,
1494
+ children: h
1495
+ }) : /* @__PURE__ */ I("div", {
1496
+ className: g,
1497
+ children: h
1498
+ });
1499
+ }
1500
+ //#endregion
1501
+ export { $ as AdaptiveSectionCard, He as BENTO_EMPHASIS_NEXT, Ve as BENTO_EMPHASIS_SPAN, Me as BENTO_TONES, Y as BENTO_TONE_CLASS, je as BentoActionsMenu, Z as BentoBackLink, ut as BentoBackToTop, ft as BentoCommandPalette, Ne as BentoCountTile, Pe as BentoEmptyState, Be as BentoEntityShell, Ge as BentoEntityTile, at as BentoFormHero, ot as BentoFormSection, Q as BentoHero, Fe as BentoHeroIconPicker, Ie as BentoInlineEdit, qe as BentoListPage, gt as BentoNavRail, nt as BentoSaveBar, it as BentoScrollSaveBar, wt as BentoSection, pt as BentoShortcutsDialog, Le as BentoStatusMarker, Tt as BentoTile, Je as BentoTileGrid, vt as BentoUserMenu, bt as SectionCardChromeProvider, X as bentoChipClass, dt as bentoNavTarget, Ue as resolveBentoLayout, We as toBentoLayoutEntries, Re as useBentoScrollFade, xt as useSectionChrome };