@viglet/viglet-design-system 2026.3.10 → 2026.3.11

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 (232) hide show
  1. package/README.md +323 -36
  2. package/consumers.json +186 -0
  3. package/dist/badge-locale-CJkHDlPg.cjs +1 -0
  4. package/dist/{badge-locale-Du41PpLA.js → badge-locale-DxDp8Q3S.js} +91 -227
  5. package/dist/bento/bento-actions-menu.d.ts +8 -0
  6. package/dist/bento/bento-actions-menu.d.ts.map +1 -1
  7. package/dist/bento/bento-back-to-top.d.ts +9 -1
  8. package/dist/bento/bento-back-to-top.d.ts.map +1 -1
  9. package/dist/bento/bento-command-palette.d.ts +12 -0
  10. package/dist/bento/bento-command-palette.d.ts.map +1 -1
  11. package/dist/bento/bento-data-table.d.ts +81 -0
  12. package/dist/bento/bento-data-table.d.ts.map +1 -0
  13. package/dist/bento/bento-diff.d.ts +41 -0
  14. package/dist/bento/bento-diff.d.ts.map +1 -0
  15. package/dist/bento/bento-empty-state.d.ts +8 -1
  16. package/dist/bento/bento-empty-state.d.ts.map +1 -1
  17. package/dist/bento/bento-entity-shell.d.ts.map +1 -1
  18. package/dist/bento/bento-filter-bar.d.ts +60 -0
  19. package/dist/bento/bento-filter-bar.d.ts.map +1 -0
  20. package/dist/bento/bento-form-section.d.ts +10 -3
  21. package/dist/bento/bento-form-section.d.ts.map +1 -1
  22. package/dist/bento/bento-inline-edit.d.ts.map +1 -1
  23. package/dist/bento/bento-nav-rail.d.ts +13 -13
  24. package/dist/bento/bento-nav-rail.d.ts.map +1 -1
  25. package/dist/bento/bento-palette-trigger.d.ts +18 -0
  26. package/dist/bento/bento-palette-trigger.d.ts.map +1 -0
  27. package/dist/bento/bento-section-chrome.d.ts +17 -42
  28. package/dist/bento/bento-section-chrome.d.ts.map +1 -1
  29. package/dist/bento/bento-shell-shortcuts.d.ts +67 -0
  30. package/dist/bento/bento-shell-shortcuts.d.ts.map +1 -0
  31. package/dist/bento/bento-shell.d.ts +53 -0
  32. package/dist/bento/bento-shell.d.ts.map +1 -0
  33. package/dist/bento/bento-shortcuts-dialog.d.ts +9 -7
  34. package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -1
  35. package/dist/bento/bento-status-marker.d.ts +5 -2
  36. package/dist/bento/bento-status-marker.d.ts.map +1 -1
  37. package/dist/bento/bento-user-menu.d.ts +9 -8
  38. package/dist/bento/bento-user-menu.d.ts.map +1 -1
  39. package/dist/bento/bento-version-rail.d.ts +31 -0
  40. package/dist/bento/bento-version-rail.d.ts.map +1 -0
  41. package/dist/bento/index.d.ts +14 -5
  42. package/dist/bento/index.d.ts.map +1 -1
  43. package/dist/bento.cjs +5 -1
  44. package/dist/bento.css +70 -4
  45. package/dist/bento.es.js +1642 -625
  46. package/dist/catalogue.json +5283 -0
  47. package/dist/components/app-footer.d.ts +7 -0
  48. package/dist/components/app-footer.d.ts.map +1 -1
  49. package/dist/components/backend-status.d.ts +19 -11
  50. package/dist/components/backend-status.d.ts.map +1 -1
  51. package/dist/components/badge-colorful.d.ts +4 -0
  52. package/dist/components/badge-colorful.d.ts.map +1 -1
  53. package/dist/components/badge-locale.d.ts +7 -0
  54. package/dist/components/badge-locale.d.ts.map +1 -1
  55. package/dist/components/error-boundary.d.ts +15 -13
  56. package/dist/components/error-boundary.d.ts.map +1 -1
  57. package/dist/components/language-select.d.ts +8 -0
  58. package/dist/components/language-select.d.ts.map +1 -1
  59. package/dist/components/login/login.d.ts +27 -0
  60. package/dist/components/login/login.d.ts.map +1 -1
  61. package/dist/components/mode-toggle.d.ts +9 -0
  62. package/dist/components/mode-toggle.d.ts.map +1 -1
  63. package/dist/components/nav-secondary.d.ts +7 -0
  64. package/dist/components/nav-secondary.d.ts.map +1 -1
  65. package/dist/components/router/dialog.delete.d.ts +8 -0
  66. package/dist/components/router/dialog.delete.d.ts.map +1 -1
  67. package/dist/components/router/gradient-button-link.d.ts +6 -0
  68. package/dist/components/router/gradient-button-link.d.ts.map +1 -1
  69. package/dist/components/router/index.d.ts +0 -11
  70. package/dist/components/router/index.d.ts.map +1 -1
  71. package/dist/components/router/loading-provider.d.ts +4 -0
  72. package/dist/components/router/loading-provider.d.ts.map +1 -1
  73. package/dist/components/startup-first/startup-first.d.ts +29 -0
  74. package/dist/components/startup-first/startup-first.d.ts.map +1 -1
  75. package/dist/components/ui/accordion.d.ts +17 -0
  76. package/dist/components/ui/accordion.d.ts.map +1 -1
  77. package/dist/components/ui/avatar.d.ts +14 -0
  78. package/dist/components/ui/avatar.d.ts.map +1 -1
  79. package/dist/components/ui/badge.d.ts +6 -0
  80. package/dist/components/ui/badge.d.ts.map +1 -1
  81. package/dist/components/ui/breadcrumb.d.ts +25 -0
  82. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  83. package/dist/components/ui/button.d.ts +15 -1
  84. package/dist/components/ui/button.d.ts.map +1 -1
  85. package/dist/components/ui/card.d.ts +27 -0
  86. package/dist/components/ui/card.d.ts.map +1 -1
  87. package/dist/components/ui/checkbox.d.ts +4 -0
  88. package/dist/components/ui/checkbox.d.ts.map +1 -1
  89. package/dist/components/ui/dialog.d.ts +36 -0
  90. package/dist/components/ui/dialog.d.ts.map +1 -1
  91. package/dist/components/ui/drawer.d.ts +35 -0
  92. package/dist/components/ui/drawer.d.ts.map +1 -1
  93. package/dist/components/ui/dropdown-menu.d.ts +53 -0
  94. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  95. package/dist/components/ui/floating-formulas-bg.d.ts +8 -0
  96. package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
  97. package/dist/components/ui/form-actions.d.ts +7 -0
  98. package/dist/components/ui/form-actions.d.ts.map +1 -1
  99. package/dist/components/ui/form-item-two-columns.d.ts +7 -0
  100. package/dist/components/ui/form-item-two-columns.d.ts.map +1 -1
  101. package/dist/components/ui/form.d.ts +25 -0
  102. package/dist/components/ui/form.d.ts.map +1 -1
  103. package/dist/components/ui/glass-card.d.ts +13 -14
  104. package/dist/components/ui/glass-card.d.ts.map +1 -1
  105. package/dist/components/ui/gradient-button.d.ts +15 -1
  106. package/dist/components/ui/gradient-button.d.ts.map +1 -1
  107. package/dist/components/ui/gradient-switch.d.ts +6 -0
  108. package/dist/components/ui/gradient-switch.d.ts.map +1 -1
  109. package/dist/components/ui/hover-card.d.ts +14 -0
  110. package/dist/components/ui/hover-card.d.ts.map +1 -1
  111. package/dist/components/ui/index.d.ts +1 -1
  112. package/dist/components/ui/index.d.ts.map +1 -1
  113. package/dist/components/ui/input.d.ts +6 -0
  114. package/dist/components/ui/input.d.ts.map +1 -1
  115. package/dist/components/ui/label.d.ts +4 -0
  116. package/dist/components/ui/label.d.ts.map +1 -1
  117. package/dist/components/ui/navigation-menu.d.ts +29 -2
  118. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  119. package/dist/components/ui/pagination.d.ts +25 -0
  120. package/dist/components/ui/pagination.d.ts.map +1 -1
  121. package/dist/components/ui/popover.d.ts +24 -0
  122. package/dist/components/ui/popover.d.ts.map +1 -1
  123. package/dist/components/ui/progress.d.ts +4 -0
  124. package/dist/components/ui/progress.d.ts.map +1 -1
  125. package/dist/components/ui/pulse-ring.d.ts +9 -11
  126. package/dist/components/ui/pulse-ring.d.ts.map +1 -1
  127. package/dist/components/ui/resizable.d.ts +11 -0
  128. package/dist/components/ui/resizable.d.ts.map +1 -1
  129. package/dist/components/ui/section-card.d.ts +9 -0
  130. package/dist/components/ui/section-card.d.ts.map +1 -1
  131. package/dist/components/ui/select.d.ts +36 -0
  132. package/dist/components/ui/select.d.ts.map +1 -1
  133. package/dist/components/ui/separator.d.ts +4 -0
  134. package/dist/components/ui/separator.d.ts.map +1 -1
  135. package/dist/components/ui/sheet.d.ts +29 -0
  136. package/dist/components/ui/sheet.d.ts.map +1 -1
  137. package/dist/components/ui/sidebar.d.ts +83 -0
  138. package/dist/components/ui/sidebar.d.ts.map +1 -1
  139. package/dist/components/ui/skeleton.d.ts +4 -0
  140. package/dist/components/ui/skeleton.d.ts.map +1 -1
  141. package/dist/components/ui/slider.d.ts +4 -0
  142. package/dist/components/ui/slider.d.ts.map +1 -1
  143. package/dist/components/ui/sonner.d.ts +6 -2
  144. package/dist/components/ui/sonner.d.ts.map +1 -1
  145. package/dist/components/ui/stepper.d.ts +8 -0
  146. package/dist/components/ui/stepper.d.ts.map +1 -1
  147. package/dist/components/ui/sticky-save-bar.d.ts +7 -0
  148. package/dist/components/ui/sticky-save-bar.d.ts.map +1 -1
  149. package/dist/components/ui/switch.d.ts +4 -0
  150. package/dist/components/ui/switch.d.ts.map +1 -1
  151. package/dist/components/ui/table.d.ts +31 -0
  152. package/dist/components/ui/table.d.ts.map +1 -1
  153. package/dist/components/ui/tabs.d.ts +16 -0
  154. package/dist/components/ui/tabs.d.ts.map +1 -1
  155. package/dist/components/ui/textarea.d.ts +4 -0
  156. package/dist/components/ui/textarea.d.ts.map +1 -1
  157. package/dist/components/ui/toggle-group.d.ts +7 -0
  158. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  159. package/dist/components/ui/toggle.d.ts +4 -0
  160. package/dist/components/ui/toggle.d.ts.map +1 -1
  161. package/dist/components/ui/tooltip.d.ts +18 -0
  162. package/dist/components/ui/tooltip.d.ts.map +1 -1
  163. package/dist/components/ui/user-avatar.d.ts +2 -1
  164. package/dist/components/ui/user-avatar.d.ts.map +1 -1
  165. package/dist/components/ui/viglet-assistant.d.ts +71 -28
  166. package/dist/components/ui/viglet-assistant.d.ts.map +1 -1
  167. package/dist/components/ui/viglet-avatar.d.ts +14 -12
  168. package/dist/components/ui/viglet-avatar.d.ts.map +1 -1
  169. package/dist/contexts/breadcrumb.context.d.ts +7 -0
  170. package/dist/contexts/breadcrumb.context.d.ts.map +1 -1
  171. package/dist/contexts/user.context.d.ts +8 -0
  172. package/dist/contexts/user.context.d.ts.map +1 -1
  173. package/dist/exports.json +338 -28
  174. package/dist/i18n/index.d.ts +94 -0
  175. package/dist/i18n/index.d.ts.map +1 -1
  176. package/dist/i18n/locales/en/assistant.json.d.ts +4 -1
  177. package/dist/i18n/locales/en/bento.json.d.ts +45 -1
  178. package/dist/i18n/locales/pt/assistant.json.d.ts +4 -1
  179. package/dist/i18n/locales/pt/bento.json.d.ts +45 -1
  180. package/dist/i18n.cjs +1 -1
  181. package/dist/i18n.es.js +98 -4
  182. package/dist/index.cjs +1 -1
  183. package/dist/index.es.js +1741 -807
  184. package/dist/lib/busy.d.ts +26 -0
  185. package/dist/lib/busy.d.ts.map +1 -0
  186. package/dist/lib/corner-slot.d.ts +15 -0
  187. package/dist/lib/corner-slot.d.ts.map +1 -0
  188. package/dist/{loading-provider-E3fbcekM.js → loading-provider-ClDkFPuv.js} +71 -69
  189. package/dist/loading-provider-DGuCfsl9.cjs +1 -0
  190. package/dist/preset.css +7 -10
  191. package/dist/router.cjs +1 -1
  192. package/dist/router.es.js +2 -776
  193. package/dist/user.context-Cr3GAQ_r.js +762 -0
  194. package/dist/user.context-hbdvmXOn.cjs +1 -0
  195. package/dist/viglet-design-system.css +1 -1
  196. package/docs/BENTO-AUTHORING.md +61 -9
  197. package/package.json +13 -2
  198. package/scripts/consumer-entries.mjs +209 -0
  199. package/scripts/lib/contrast.mjs +301 -0
  200. package/scripts/mcp.mjs +300 -0
  201. package/scripts/page-lint.mjs +428 -0
  202. package/scripts/page-reference.mjs +54 -10
  203. package/dist/badge-locale-Bij94NwL.cjs +0 -1
  204. package/dist/breadcrumb.context-BssgEydx.js +0 -926
  205. package/dist/breadcrumb.context-DLsiMS59.cjs +0 -1
  206. package/dist/components/router/blank-slate.d.ts +0 -21
  207. package/dist/components/router/blank-slate.d.ts.map +0 -1
  208. package/dist/components/router/grid.list.d.ts +0 -39
  209. package/dist/components/router/grid.list.d.ts.map +0 -1
  210. package/dist/components/router/internal.sidebar.d.ts +0 -61
  211. package/dist/components/router/internal.sidebar.d.ts.map +0 -1
  212. package/dist/components/router/nav-main.d.ts +0 -25
  213. package/dist/components/router/nav-main.d.ts.map +0 -1
  214. package/dist/components/router/nav-user.d.ts +0 -24
  215. package/dist/components/router/nav-user.d.ts.map +0 -1
  216. package/dist/components/router/page-content.d.ts +0 -12
  217. package/dist/components/router/page-content.d.ts.map +0 -1
  218. package/dist/components/router/page-header.d.ts +0 -23
  219. package/dist/components/router/page-header.d.ts.map +0 -1
  220. package/dist/components/router/page.d.ts +0 -22
  221. package/dist/components/router/page.d.ts.map +0 -1
  222. package/dist/components/router/sticky.page.header.d.ts +0 -85
  223. package/dist/components/router/sticky.page.header.d.ts.map +0 -1
  224. package/dist/components/router/sub.page.d.ts +0 -50
  225. package/dist/components/router/sub.page.d.ts.map +0 -1
  226. package/dist/components/router/sub.page.header.d.ts +0 -37
  227. package/dist/components/router/sub.page.header.d.ts.map +0 -1
  228. package/dist/lib/react-markers.d.ts +0 -17
  229. package/dist/lib/react-markers.d.ts.map +0 -1
  230. package/dist/loading-provider-B6-R2ONB.cjs +0 -1
  231. package/dist/user.context-CPmUBBLa.js +0 -522
  232. package/dist/user.context-xsJgPpcO.cjs +0 -1
package/dist/bento.es.js CHANGED
@@ -1,50 +1,57 @@
1
1
  "use client";
2
2
  import { t as e } from "./utils-Fk5jmzzb.js";
3
- import { A as t, D as n, E as r, F as i, M 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-Du41PpLA.js";
4
- import { l as y, n as b, o as x, r as S, s as C, u as w } from "./user.context-CPmUBBLa.js";
5
- import { i as T, t as E } from "./loading-provider-E3fbcekM.js";
6
- 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";
7
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
8
- import { useTranslation as R } from "react-i18next";
9
- import { IconAdjustmentsHorizontal as z, IconAlertTriangle as te, IconArrowBackUp as B, IconArrowLeft as ne, IconArrowRight as re, IconArrowUp as ie, IconBuildingCommunity as ae, IconBuildingSkyscraper as oe, IconChevronRight as V, IconDeviceFloppy as H, IconDotsVertical as se, IconExternalLink as ce, IconGripVertical as le, IconHome as ue, IconKeyboard as de, IconLayoutGrid as fe, IconLogout as pe, IconPalette as me, IconPlus as he, IconSearch as ge, IconSparkles as U, IconTrash as _e, IconUserCircle as ve, IconUsers as ye, IconX as W } from "@tabler/icons-react";
10
- import { Icon as G } from "@iconify/react";
11
- import { Link as K, useLocation as be, useNavigate as q } from "react-router-dom";
12
- import { DndContext as xe, KeyboardSensor as Se, PointerSensor as Ce, closestCenter as we, useSensor as Te, useSensors as Ee } from "@dnd-kit/core";
13
- import { SortableContext as De, arrayMove as Oe, rectSortingStrategy as ke, useSortable as Ae } from "@dnd-kit/sortable";
14
- import { CSS as je } from "@dnd-kit/utilities";
3
+ import { a as t, c as n, d as r, g as i, o as a, p as o, u as s } from "./badge-locale-DxDp8Q3S.js";
4
+ import { A as c, C as l, D as u, E as d, L as f, M as p, O as m, R as h, S as g, T as _, _ as v, a as y, c as b, d as x, f as S, h as C, i as w, j as T, l as E, n as D, p as O, r as k, u as A, w as j, x as M, z as N } from "./user.context-Cr3GAQ_r.js";
5
+ import { r as ee, t as te } from "./loading-provider-ClDkFPuv.js";
6
+ import { Children as P, Fragment as ne, isValidElement as re, useEffect as F, useId as I, useMemo as L, useRef as R, useState as z, useSyncExternalStore as ie } from "react";
7
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
8
+ import { useTranslation as U } from "react-i18next";
9
+ import { IconAdjustmentsHorizontal as ae, IconAlertTriangle as oe, IconArrowBackUp as W, IconArrowDown as se, IconArrowLeft as ce, IconArrowRight as le, IconArrowUp as ue, IconArrowsSort as de, IconBuildingCommunity as fe, IconBuildingSkyscraper as G, IconChevronDown as pe, IconChevronRight as K, IconColumns3 as me, IconDeviceFloppy as he, IconDotsVertical as q, IconExternalLink as J, IconGripVertical as ge, IconHome as _e, IconKeyboard as Y, IconLayoutGrid as ve, IconLogout as ye, IconPalette as be, IconPlus as xe, IconRobot as X, IconSearch as Se, IconSparkles as Ce, IconTrash as we, IconUser as Te, IconUserCircle as Ee, IconUsers as De, IconX as Oe } from "@tabler/icons-react";
10
+ import { Icon as ke } from "@iconify/react";
11
+ import { Link as Z, useInRouterContext as Ae, useLocation as je, useNavigate as Me } from "react-router-dom";
12
+ import { createCoreRowModel as Ne, createSortedRowModel as Pe, rowSortingFeature as Fe, useTable as Ie } from "@tanstack/react-table";
13
+ import { DndContext as Le, KeyboardSensor as Re, PointerSensor as ze, closestCenter as Be, useSensor as Ve, useSensors as He } from "@dnd-kit/core";
14
+ import { SortableContext as Ue, arrayMove as We, rectSortingStrategy as Ge, useSortable as Ke } from "@dnd-kit/sortable";
15
+ import { CSS as qe } from "@dnd-kit/utilities";
15
16
  //#region src/bento/bento-actions-menu.tsx
16
- var Me = {
17
+ var Je = {
17
18
  default: "",
18
19
  destructive: "bento-item-danger"
19
- };
20
- function Ne({ actions: e, triggerLabel: t }) {
21
- let { t: n } = R();
22
- return e.length === 0 ? null : /* @__PURE__ */ L(c, { children: [/* @__PURE__ */ I(r, {
20
+ }, Ye = /* @__PURE__ */ new Set();
21
+ function Xe(e) {
22
+ process.env.NODE_ENV === "production" || Ye.has(e) || (Ye.add(e), console.warn(`BentoActionsMenu: the action "${e}" has no id. Give it a stable name, such as "post.delete": it is rendered as data-action-id so a console verb can be matched to an agent verb, and it becomes required in the next release.`));
23
+ }
24
+ function Ze({ actions: e, triggerLabel: t }) {
25
+ let { t: n } = U();
26
+ if (e.length === 0) return null;
27
+ for (let t of e) t.id || Xe(t.label);
28
+ return /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
23
29
  asChild: !0,
24
- children: /* @__PURE__ */ I("button", {
30
+ children: /* @__PURE__ */ V("button", {
25
31
  type: "button",
26
32
  "aria-label": t ?? n("forms.formActions.moreActions", { defaultValue: "More actions" }),
27
33
  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",
28
- children: /* @__PURE__ */ I(se, { size: 18 })
34
+ children: /* @__PURE__ */ V(q, { size: 18 })
29
35
  })
30
- }), /* @__PURE__ */ I(m, {
36
+ }), /* @__PURE__ */ V(_, {
31
37
  align: "end",
32
38
  sideOffset: 8,
33
39
  className: "bento-dropdown min-w-44 p-1.5",
34
40
  children: e.map((e) => {
35
- let t = e.icon, n = Me[e.tone ?? "default"];
36
- return /* @__PURE__ */ L(l, {
41
+ let t = e.icon, n = Je[e.tone ?? "default"];
42
+ return /* @__PURE__ */ H(u, {
43
+ "data-action-id": e.id,
37
44
  onSelect: e.onSelect,
38
45
  disabled: e.disabled,
39
46
  className: `bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${n}`,
40
- children: [/* @__PURE__ */ I(t, { size: 16 }), e.label]
41
- }, e.label);
47
+ children: [/* @__PURE__ */ V(t, { size: 16 }), e.label]
48
+ }, e.id ?? e.label);
42
49
  })
43
50
  })] });
44
51
  }
45
52
  //#endregion
46
53
  //#region src/bento/bento-tones.ts
47
- var J = {
54
+ var Qe = {
48
55
  blue: "bento-tone-blue",
49
56
  indigo: "bento-tone-indigo",
50
57
  violet: "bento-tone-violet",
@@ -52,53 +59,388 @@ var J = {
52
59
  amber: "bento-tone-amber",
53
60
  rose: "bento-tone-rose",
54
61
  slate: "bento-tone-slate"
55
- }, Pe = Object.keys(J);
56
- function Y(e) {
57
- return `bento-chip ${J[e] ?? J.slate}`;
62
+ }, $e = Object.keys(Qe);
63
+ function Q(e) {
64
+ return `bento-chip ${Qe[e] ?? Qe.slate}`;
58
65
  }
59
66
  //#endregion
60
67
  //#region src/bento/bento-count-tile.tsx
61
- function Fe({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
62
- let o = /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
63
- className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${Y(n)}`,
64
- children: /* @__PURE__ */ I(t, { size: 18 })
65
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("div", {
68
+ function et({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
69
+ let o = /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
70
+ className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${Q(n)}`,
71
+ children: /* @__PURE__ */ V(t, { size: 18 })
72
+ }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("div", {
66
73
  className: "text-3xl font-semibold tabular-nums tracking-tight",
67
74
  children: i
68
- }), /* @__PURE__ */ I("div", {
75
+ }), /* @__PURE__ */ V("div", {
69
76
  className: "text-[11px] uppercase tracking-wider text-muted-foreground",
70
77
  children: r
71
78
  })] })] }), s = `bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${a}${e ? " bento-tile-clickable" : ""}`;
72
- return e ? /* @__PURE__ */ I(K, {
79
+ return e ? /* @__PURE__ */ V(Z, {
73
80
  to: e,
74
81
  className: s,
75
82
  children: o
76
- }) : /* @__PURE__ */ I("div", {
83
+ }) : /* @__PURE__ */ V("div", {
77
84
  className: s,
78
85
  children: o
79
86
  });
80
87
  }
81
88
  //#endregion
89
+ //#region src/bento/bento-data-table.tsx
90
+ var tt = 6, nt = {
91
+ rowSortingFeature: Fe,
92
+ coreRowModel: Ne(),
93
+ sortedRowModel: Pe()
94
+ };
95
+ function rt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowActions: o, selectionActions: s, onSelectionChange: c, selectionScope: u, layout: d, onLayoutChange: p, onRowOpen: m, rowHeight: g = 44, height: v = 480, empty: y }) {
96
+ let { t: b } = U(), [x, S] = z([]), [C, w] = z({ hidden: [] }), [T, E] = z(/* @__PURE__ */ new Set()), [D, O] = z(null), [k, A] = z(u);
97
+ k !== u && (A(u), E(/* @__PURE__ */ new Set()), O(null));
98
+ let M = R(u);
99
+ F(() => {
100
+ M.current !== u && (M.current = u, c?.([]));
101
+ }, [u, c]);
102
+ let [ee, te] = z(0), [P, ne] = z(0), re = R(null), I = R(/* @__PURE__ */ new Map()), ie = R(!1), B = (s?.length ?? 0) > 0, ae = (e) => a?.(e) ?? n(e), oe = L(() => r.map((e) => ({
103
+ id: e.id,
104
+ accessorFn: (t) => e.sortValue?.(t) ?? null,
105
+ enableSorting: e.sortValue !== void 0
106
+ })), [r]), W = Ie({
107
+ features: nt,
108
+ data: t,
109
+ columns: oe,
110
+ state: { sorting: x },
111
+ onSortingChange: S
112
+ }).getRowModel().rows.map((e) => e.original), ce = d ?? C, le = r.filter((e) => e.hideable === !1 || !ce.hidden.includes(e.id)), fe = [
113
+ B ? "2.75rem" : null,
114
+ ...le.map((e) => e.width ?? "minmax(8rem, 1fr)"),
115
+ o?.length ? "3.25rem" : null
116
+ ].filter(Boolean).join(" "), G = W.length, pe = Math.max(1, Math.floor(v / g)), K = Math.max(0, Math.floor(P / g) - tt), he = Math.min(G, Math.ceil((P + v) / g) + tt), q = Math.min(ee, Math.max(0, G - 1));
117
+ F(() => {
118
+ ie.current && (ie.current = !1, I.current.get(q)?.focus());
119
+ }, [q, K]);
120
+ function J(e) {
121
+ E(e), c?.([...e]);
122
+ }
123
+ function ge(e, t) {
124
+ let [r, i] = e <= t ? [e, t] : [t, e];
125
+ J(new Set(W.slice(r, i + 1).map(n)));
126
+ }
127
+ function _e(e) {
128
+ let t = n(W[e]), r = new Set(T);
129
+ r.has(t) ? r.delete(t) : r.add(t), J(r), O(e);
130
+ }
131
+ function Y(e, t) {
132
+ let n = Math.max(0, Math.min(G - 1, e));
133
+ if (t && B) {
134
+ let e = D ?? q;
135
+ O(e), ge(e, n);
136
+ }
137
+ let r = re.current, i = n * g;
138
+ if (r) {
139
+ let e = r.scrollTop;
140
+ i < e ? e = i : i + g > e + v && (e = i + g - v), e !== r.scrollTop && (r.scrollTop = e, ne(e));
141
+ }
142
+ ie.current = !0, te(n);
143
+ }
144
+ function ve(e, t) {
145
+ if (e.target !== e.currentTarget) return;
146
+ let r = e.shiftKey;
147
+ switch (e.key) {
148
+ case "ArrowDown":
149
+ Y(t + 1, r);
150
+ break;
151
+ case "ArrowUp":
152
+ Y(t - 1, r);
153
+ break;
154
+ case "PageDown":
155
+ Y(t + pe, r);
156
+ break;
157
+ case "PageUp":
158
+ Y(t - pe, r);
159
+ break;
160
+ case "Home":
161
+ Y(0, r);
162
+ break;
163
+ case "End":
164
+ Y(G - 1, r);
165
+ break;
166
+ case " ":
167
+ if (!B) return;
168
+ _e(t);
169
+ break;
170
+ case "Enter":
171
+ if (!m) return;
172
+ m(W[t]);
173
+ break;
174
+ case "Escape":
175
+ if (!B || T.size === 0) return;
176
+ J(/* @__PURE__ */ new Set()), O(null);
177
+ break;
178
+ case "a":
179
+ case "A":
180
+ if (!B || !(e.ctrlKey || e.metaKey)) return;
181
+ J(new Set(W.map(n)));
182
+ break;
183
+ default: return;
184
+ }
185
+ e.preventDefault();
186
+ }
187
+ function ye(e, t) {
188
+ if (!e.target.closest("button, a, input, [role='checkbox']") && (te(t), B)) {
189
+ if (e.shiftKey) {
190
+ let e = D ?? q;
191
+ O(e), ge(e, t);
192
+ } else e.metaKey || e.ctrlKey ? _e(t) : (J(/* @__PURE__ */ new Set([n(W[t])])), O(t));
193
+ }
194
+ }
195
+ function be(e) {
196
+ let t = x.find((t) => t.id === e);
197
+ t ? t.desc ? S([]) : S([{
198
+ id: e,
199
+ desc: !0
200
+ }]) : S([{
201
+ id: e,
202
+ desc: !1
203
+ }]);
204
+ }
205
+ function xe(e, t) {
206
+ let n = { hidden: t ? [...ce.hidden, e] : ce.hidden.filter((t) => t !== e) };
207
+ d === void 0 && w(n), p?.(n);
208
+ }
209
+ let X = W.filter((e) => T.has(n(e))), Se = G > 0 && X.length === G, Ce = r.filter((e) => e.hideable !== !1);
210
+ return /* @__PURE__ */ H("div", {
211
+ "data-slot": "bento-data-table",
212
+ className: "bento-glass overflow-hidden rounded-2xl",
213
+ children: [/* @__PURE__ */ H("div", {
214
+ className: "flex min-h-12 flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2",
215
+ children: [
216
+ /* @__PURE__ */ V("span", {
217
+ "aria-live": "polite",
218
+ className: "text-sm font-medium",
219
+ children: X.length > 0 ? b("bento.table.selected", {
220
+ defaultValue: "{{count}} selected",
221
+ count: X.length
222
+ }) : ""
223
+ }),
224
+ X.length > 0 && /* @__PURE__ */ H("div", {
225
+ role: "toolbar",
226
+ "aria-label": b("bento.table.selectionActions", { defaultValue: "Actions on the selection" }),
227
+ className: "flex flex-wrap items-center gap-2",
228
+ children: [s?.map((t) => {
229
+ let n = t.icon;
230
+ return /* @__PURE__ */ H(N, {
231
+ variant: "outline",
232
+ size: "sm",
233
+ className: e("gap-1.5", t.tone === "destructive" && "bento-item-danger"),
234
+ onClick: () => t.onSelect(X),
235
+ children: [/* @__PURE__ */ V(n, { size: 16 }), t.label]
236
+ }, t.id);
237
+ }), /* @__PURE__ */ V(N, {
238
+ variant: "ghost",
239
+ size: "sm",
240
+ onClick: () => J(/* @__PURE__ */ new Set()),
241
+ children: b("bento.table.clearSelection", { defaultValue: "Clear selection" })
242
+ })]
243
+ }),
244
+ Ce.length > 0 && /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
245
+ asChild: !0,
246
+ children: /* @__PURE__ */ H(N, {
247
+ variant: "ghost",
248
+ size: "sm",
249
+ className: "ml-auto gap-1.5",
250
+ children: [/* @__PURE__ */ V(me, {
251
+ size: 16,
252
+ "aria-hidden": "true"
253
+ }), b("bento.table.columns", { defaultValue: "Columns" })]
254
+ })
255
+ }), /* @__PURE__ */ V(_, {
256
+ align: "end",
257
+ className: "bento-dropdown min-w-44 p-1.5",
258
+ children: Ce.map((e) => /* @__PURE__ */ V(j, {
259
+ checked: !ce.hidden.includes(e.id),
260
+ onCheckedChange: (t) => xe(e.id, t !== !0),
261
+ onSelect: (e) => e.preventDefault(),
262
+ children: e.header
263
+ }, e.id))
264
+ })] })
265
+ ]
266
+ }), /* @__PURE__ */ H("div", {
267
+ role: "grid",
268
+ "aria-label": i,
269
+ "aria-rowcount": G + 1,
270
+ "aria-colcount": le.length + +!!B + +!!o?.length,
271
+ "aria-multiselectable": B ? "true" : void 0,
272
+ children: [/* @__PURE__ */ V("div", {
273
+ role: "rowgroup",
274
+ children: /* @__PURE__ */ H("div", {
275
+ role: "row",
276
+ "aria-rowindex": 1,
277
+ className: "grid items-center border-b border-border/50 px-1 text-xs font-medium text-muted-foreground",
278
+ style: {
279
+ gridTemplateColumns: fe,
280
+ minHeight: g
281
+ },
282
+ children: [
283
+ B && /* @__PURE__ */ V("div", {
284
+ role: "columnheader",
285
+ className: "grid place-items-center",
286
+ children: /* @__PURE__ */ V(h, {
287
+ "aria-label": b("bento.table.selectAll", { defaultValue: "Select all rows" }),
288
+ checked: Se ? !0 : X.length > 0 && "indeterminate",
289
+ onCheckedChange: () => J(Se ? /* @__PURE__ */ new Set() : new Set(W.map(n)))
290
+ })
291
+ }),
292
+ le.map((e) => {
293
+ let t = x.find((t) => t.id === e.id), n = t ? t.desc ? "descending" : "ascending" : "none";
294
+ return /* @__PURE__ */ V("div", {
295
+ role: "columnheader",
296
+ "aria-sort": e.sortValue ? n : void 0,
297
+ className: "min-w-0 px-2",
298
+ children: e.sortValue ? /* @__PURE__ */ H("button", {
299
+ type: "button",
300
+ onClick: () => be(e.id),
301
+ className: "inline-flex max-w-full items-center gap-1 rounded-md py-1 hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",
302
+ children: [
303
+ /* @__PURE__ */ V("span", {
304
+ className: "truncate",
305
+ children: e.header
306
+ }),
307
+ n === "ascending" && /* @__PURE__ */ V(ue, {
308
+ size: 14,
309
+ "aria-hidden": "true"
310
+ }),
311
+ n === "descending" && /* @__PURE__ */ V(se, {
312
+ size: 14,
313
+ "aria-hidden": "true"
314
+ }),
315
+ n === "none" && /* @__PURE__ */ V(de, {
316
+ size: 14,
317
+ "aria-hidden": "true",
318
+ className: "opacity-40"
319
+ })
320
+ ]
321
+ }) : /* @__PURE__ */ V("span", {
322
+ className: "block truncate py-1",
323
+ children: e.header
324
+ })
325
+ }, e.id);
326
+ }),
327
+ o?.length ? /* @__PURE__ */ V("div", {
328
+ role: "columnheader",
329
+ className: "px-2",
330
+ children: /* @__PURE__ */ V("span", {
331
+ className: "sr-only",
332
+ children: b("bento.table.actions", { defaultValue: "Actions" })
333
+ })
334
+ }) : null
335
+ ]
336
+ })
337
+ }), G === 0 ? /* @__PURE__ */ V("div", {
338
+ role: "rowgroup",
339
+ children: /* @__PURE__ */ V("div", {
340
+ role: "row",
341
+ "aria-rowindex": 2,
342
+ children: /* @__PURE__ */ V("div", {
343
+ role: "gridcell",
344
+ className: "px-4 py-10 text-center text-sm text-muted-foreground",
345
+ children: y ?? b("bento.table.empty", { defaultValue: "Nothing to show" })
346
+ })
347
+ })
348
+ }) : /* @__PURE__ */ V("div", {
349
+ role: "rowgroup",
350
+ ref: re,
351
+ onScroll: (e) => ne(e.currentTarget.scrollTop),
352
+ className: "relative overflow-y-auto",
353
+ style: { height: v },
354
+ children: /* @__PURE__ */ V("div", {
355
+ style: { height: G * g },
356
+ className: "relative",
357
+ children: W.slice(K, he).map((t, r) => {
358
+ let i = K + r, a = n(t), s = T.has(a), c = ae(t);
359
+ return /* @__PURE__ */ H("div", {
360
+ ref: (e) => {
361
+ e ? I.current.set(i, e) : I.current.delete(i);
362
+ },
363
+ role: "row",
364
+ "aria-rowindex": i + 2,
365
+ "aria-selected": B ? s ? "true" : "false" : void 0,
366
+ tabIndex: i === q ? 0 : -1,
367
+ onKeyDown: (e) => ve(e, i),
368
+ onClick: (e) => ye(e, i),
369
+ onDoubleClick: () => m?.(t),
370
+ onFocus: (e) => {
371
+ e.target === e.currentTarget && te(i);
372
+ },
373
+ className: e("absolute inset-x-0 grid items-center border-b border-border/30 px-1 text-sm outline-none transition-colors", "hover:bg-muted/40 focus-visible:bg-muted/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring", s && "bg-primary/10 hover:bg-primary/15"),
374
+ style: {
375
+ top: i * g,
376
+ height: g,
377
+ gridTemplateColumns: fe
378
+ },
379
+ children: [
380
+ B && /* @__PURE__ */ V("div", {
381
+ role: "gridcell",
382
+ className: "grid place-items-center",
383
+ children: /* @__PURE__ */ V(h, {
384
+ tabIndex: -1,
385
+ "aria-label": b("bento.table.selectRow", {
386
+ defaultValue: "Select {{row}}",
387
+ row: c
388
+ }),
389
+ checked: s,
390
+ onCheckedChange: () => _e(i)
391
+ })
392
+ }),
393
+ le.map((e) => /* @__PURE__ */ V("div", {
394
+ role: "gridcell",
395
+ className: "min-w-0 truncate px-2",
396
+ children: e.cell(t)
397
+ }, e.id)),
398
+ o?.length ? /* @__PURE__ */ V("div", {
399
+ role: "gridcell",
400
+ className: "grid place-items-center",
401
+ children: /* @__PURE__ */ V(Ze, {
402
+ triggerLabel: b("bento.table.rowActions", {
403
+ defaultValue: "Actions for {{row}}",
404
+ row: c
405
+ }),
406
+ actions: o.map((e) => ({
407
+ id: e.id,
408
+ label: e.label,
409
+ icon: e.icon,
410
+ tone: e.tone,
411
+ onSelect: () => e.onSelect([t])
412
+ }))
413
+ })
414
+ }) : null
415
+ ]
416
+ }, a);
417
+ })
418
+ })
419
+ })]
420
+ })]
421
+ });
422
+ }
423
+ //#endregion
82
424
  //#region src/bento/bento-empty-state.tsx
83
- function Ie({ icon: t = U, tone: n = "indigo", title: r, description: i, action: a, align: o = "center", className: s }) {
84
- let c = Y(n), l = o === "center";
85
- return /* @__PURE__ */ L("div", {
86
- className: e("bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8", l ? "items-center text-center" : "items-start text-left", s),
425
+ function it({ icon: t = Ce, tone: n = "indigo", title: r, description: i, action: a, align: o = "center", titleLevel: s = 2, className: c }) {
426
+ let l = Q(n), u = o === "center", d = `h${s}`;
427
+ return /* @__PURE__ */ H("div", {
428
+ className: e("bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8", u ? "items-center text-center" : "items-start text-left", c),
87
429
  children: [
88
- /* @__PURE__ */ I("span", {
89
- className: `grid h-12 w-12 place-items-center rounded-2xl ${c} text-white shadow-md`,
90
- children: /* @__PURE__ */ I(t, { size: 24 })
430
+ /* @__PURE__ */ V("span", {
431
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${l} text-white shadow-md`,
432
+ children: /* @__PURE__ */ V(t, { size: 24 })
91
433
  }),
92
- /* @__PURE__ */ I("div", {
93
- className: "text-lg font-semibold tracking-tight",
434
+ /* @__PURE__ */ V(d, {
435
+ className: "m-0 text-lg font-semibold tracking-tight",
94
436
  children: r
95
437
  }),
96
- i && /* @__PURE__ */ I("p", {
97
- className: e("max-w-md text-sm text-muted-foreground", l && "mx-auto"),
438
+ i && /* @__PURE__ */ V("p", {
439
+ className: e("max-w-md text-sm text-muted-foreground", u && "mx-auto"),
98
440
  children: i
99
441
  }),
100
- a && /* @__PURE__ */ I("div", {
101
- className: e("mt-1", l && "mx-auto"),
442
+ a && /* @__PURE__ */ V("div", {
443
+ className: e("mt-1", u && "mx-auto"),
102
444
  children: a
103
445
  })
104
446
  ]
@@ -106,48 +448,48 @@ function Ie({ icon: t = U, tone: n = "indigo", title: r, description: i, action:
106
448
  }
107
449
  //#endregion
108
450
  //#region src/bento/bento-hero.tsx
109
- function X({ to: e, children: t }) {
110
- return /* @__PURE__ */ L(K, {
451
+ function at({ to: e, children: t }) {
452
+ return /* @__PURE__ */ H(Z, {
111
453
  to: e,
112
454
  className: "inline-flex items-center gap-1 hover:text-foreground",
113
- children: [/* @__PURE__ */ I(ne, {
455
+ children: [/* @__PURE__ */ V(ce, {
114
456
  size: 14,
115
457
  "aria-hidden": !0
116
458
  }), t]
117
459
  });
118
460
  }
119
- function Z({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading: a, trailing: o }) {
120
- let s = e ?? (t == null ? null : /* @__PURE__ */ I(X, {
461
+ function ot({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading: a, trailing: o }) {
462
+ let s = e ?? (t == null ? null : /* @__PURE__ */ V(at, {
121
463
  to: t,
122
464
  children: n
123
465
  }));
124
- return /* @__PURE__ */ I("header", {
466
+ return /* @__PURE__ */ V("header", {
125
467
  className: "bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10",
126
- children: /* @__PURE__ */ L("div", {
468
+ children: /* @__PURE__ */ H("div", {
127
469
  className: "flex w-full items-start gap-4",
128
470
  children: [
129
- a && /* @__PURE__ */ I("div", {
471
+ a && /* @__PURE__ */ V("div", {
130
472
  className: "shrink-0",
131
473
  children: a
132
474
  }),
133
- /* @__PURE__ */ L("div", {
475
+ /* @__PURE__ */ H("div", {
134
476
  className: "flex flex-1 flex-col gap-1",
135
477
  children: [
136
- s && /* @__PURE__ */ I("span", {
478
+ s && /* @__PURE__ */ V("span", {
137
479
  className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
138
480
  children: s
139
481
  }),
140
- /* @__PURE__ */ I("h1", {
482
+ /* @__PURE__ */ V("h1", {
141
483
  className: "text-3xl font-semibold tracking-tight md:text-4xl",
142
484
  children: r
143
485
  }),
144
- i && /* @__PURE__ */ I("p", {
486
+ i && /* @__PURE__ */ V("p", {
145
487
  className: "max-w-2xl text-sm text-muted-foreground",
146
488
  children: i
147
489
  })
148
490
  ]
149
491
  }),
150
- o && /* @__PURE__ */ I("div", {
492
+ o && /* @__PURE__ */ V("div", {
151
493
  className: "ml-auto flex shrink-0 items-center gap-2",
152
494
  children: o
153
495
  })
@@ -157,31 +499,31 @@ function Z({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading
157
499
  }
158
500
  //#endregion
159
501
  //#region src/bento/bento-hero-icon-picker.tsx
160
- function Le({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
161
- let { t: c } = R(), [l, u] = P(!1);
162
- return s ? /* @__PURE__ */ I("span", {
163
- className: `grid h-12 w-12 place-items-center rounded-2xl ${Y(i)} text-white shadow-md`,
164
- children: e ? /* @__PURE__ */ I(G, {
502
+ function st({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
503
+ let { t: c } = U(), [l, u] = z(!1);
504
+ return s ? /* @__PURE__ */ V("span", {
505
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${Q(i)} text-white shadow-md`,
506
+ children: e ? /* @__PURE__ */ V(ke, {
165
507
  icon: e,
166
508
  className: "size-6 text-white"
167
- }) : /* @__PURE__ */ I(r, { size: 24 })
168
- }) : /* @__PURE__ */ L("div", {
509
+ }) : /* @__PURE__ */ V(r, { size: 24 })
510
+ }) : /* @__PURE__ */ H("div", {
169
511
  className: "group relative",
170
512
  children: [
171
- /* @__PURE__ */ L("button", {
513
+ /* @__PURE__ */ H("button", {
172
514
  type: "button",
173
515
  onClick: () => u(!0),
174
516
  "aria-label": c("forms.iconPicker.chooseAnIcon"),
175
- className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${Y(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`,
176
- children: [e ? /* @__PURE__ */ I(G, {
517
+ className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${Q(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`,
518
+ children: [e ? /* @__PURE__ */ V(ke, {
177
519
  icon: e,
178
520
  className: "size-6 text-white"
179
- }) : /* @__PURE__ */ I(r, { size: 24 }), /* @__PURE__ */ I("span", {
521
+ }) : /* @__PURE__ */ V(r, { size: 24 }), /* @__PURE__ */ V("span", {
180
522
  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",
181
- children: /* @__PURE__ */ I(me, { className: "size-5 text-white" })
523
+ children: /* @__PURE__ */ V(be, { className: "size-5 text-white" })
182
524
  })]
183
525
  }),
184
- e && n && /* @__PURE__ */ I("button", {
526
+ e && n && /* @__PURE__ */ V("button", {
185
527
  type: "button",
186
528
  onClick: (e) => {
187
529
  e.stopPropagation(), n();
@@ -189,9 +531,9 @@ function Le({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
189
531
  "aria-label": c("forms.common.remove"),
190
532
  title: c("forms.common.remove"),
191
533
  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",
192
- children: /* @__PURE__ */ I(W, { size: 12 })
534
+ children: /* @__PURE__ */ V(Oe, { size: 12 })
193
535
  }),
194
- /* @__PURE__ */ I(y, {
536
+ /* @__PURE__ */ V(g, {
195
537
  open: l,
196
538
  onOpenChange: u,
197
539
  value: e,
@@ -205,103 +547,109 @@ function Le({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
205
547
  }
206
548
  //#endregion
207
549
  //#region src/bento/bento-inline-edit.tsx
208
- function Re({ value: t, onSave: n, multiline: r = !1, placeholder: i, className: a, ariaLabel: o, autoFocus: s = !1, readOnly: c = !1, commitOnChange: l = !1 }) {
209
- let { t: u } = R(), [d, f] = P(s), [m, h] = P(t), [g, _] = P(!1), v = N(null), [y, b] = P(t);
210
- !d && t !== y && (b(t), h(t)), j(() => {
211
- d && v.current && (v.current.focus(), v.current.select());
212
- }, [d]);
213
- async function x() {
550
+ function ct({ value: n, onSave: r, multiline: i = !1, placeholder: a, className: o, ariaLabel: s, autoFocus: c = !1, readOnly: l = !1, commitOnChange: u = !1 }) {
551
+ let { t: d } = U(), [f, p] = z(c), [m, h] = z(n), [g, _] = z(!1), v = R(null), y = R(null), b = R(!1), x = R(!1), [S, C] = z(n);
552
+ !f && n !== S && (C(n), h(n)), F(() => {
553
+ f && v.current ? (v.current.focus(), v.current.select()) : !f && x.current && (x.current = !1, y.current?.focus());
554
+ }, [f]);
555
+ function w() {
556
+ x.current = v.current !== null && document.activeElement === v.current, p(!1);
557
+ }
558
+ async function T() {
559
+ if (b.current) return;
214
560
  let e = m.trim();
215
- if (e === t) {
216
- f(!1);
561
+ if (e === n) {
562
+ w();
217
563
  return;
218
564
  }
219
- if (!e && !i) {
220
- h(t), f(!1);
565
+ if (!e && !a) {
566
+ h(n), w();
221
567
  return;
222
568
  }
223
- _(!0);
569
+ b.current = !0, _(!0);
224
570
  try {
225
- await n(e);
571
+ await r(e);
226
572
  } catch {
227
- h(t);
573
+ h(n);
228
574
  } finally {
229
- _(!1), f(!1);
575
+ b.current = !1, _(!1), w();
230
576
  }
231
577
  }
232
- function S() {
233
- h(t), f(!1);
578
+ function E() {
579
+ h(n), w();
234
580
  }
235
- function C(e) {
236
- h(e), l && n(e);
581
+ function D(e) {
582
+ h(e), u && r(e);
237
583
  }
238
- let w = !t;
239
- if (c) return /* @__PURE__ */ I("span", {
240
- className: e("block w-full", a),
241
- "aria-label": o,
242
- children: t || /* @__PURE__ */ I("span", {
584
+ let O = !n;
585
+ if (l) return /* @__PURE__ */ V("span", {
586
+ className: e("block w-full", o),
587
+ "aria-label": s,
588
+ children: n || /* @__PURE__ */ V("span", {
243
589
  className: "text-muted-foreground/80",
244
- children: i ?? "—"
590
+ children: a ?? "—"
245
591
  })
246
592
  });
247
- let T = "w-full bg-transparent outline-none border-b transition-colors duration-200", E = e(T, "cursor-text rounded-sm", w ? "border-dashed border-border/70 hover:border-foreground/40" : "border-transparent hover:border-border/60 focus-visible:border-border/80", g && "opacity-60"), D = e(T, "bento-editing");
248
- if (!d) return /* @__PURE__ */ I("button", {
593
+ let k = "w-full bg-transparent outline-none border-b transition-colors duration-200", A = e(k, "cursor-text rounded-sm", O ? "border-dashed border-border/70 hover:border-foreground/40" : "border-transparent hover:border-border/60 focus-visible:border-border/80"), j = e(k, "bento-editing");
594
+ if (!f) return /* @__PURE__ */ V("button", {
595
+ ref: y,
249
596
  type: "button",
250
- onClick: () => f(!0),
251
- className: e(E, "text-left", a),
252
- "aria-label": o ?? u("forms.formActions.edit"),
253
- disabled: g,
254
- children: t || /* @__PURE__ */ I("span", {
597
+ onClick: () => p(!0),
598
+ className: e(A, "text-left", o),
599
+ "aria-label": s ?? d("forms.formActions.edit"),
600
+ children: n || /* @__PURE__ */ V("span", {
255
601
  className: "text-muted-foreground/80",
256
- children: i ?? "—"
602
+ children: a ?? "—"
257
603
  })
258
604
  });
259
- function O(e) {
605
+ function M(e) {
260
606
  if (e.key === "Escape") {
261
- e.preventDefault(), S();
607
+ e.preventDefault(), E();
262
608
  return;
263
609
  }
264
- e.key === "Enter" && (!r || e.metaKey || e.ctrlKey) && (e.preventDefault(), x());
610
+ e.key === "Enter" && (!i || e.metaKey || e.ctrlKey) && (e.preventDefault(), T());
265
611
  }
266
- return r ? /* @__PURE__ */ I("textarea", {
612
+ return i ? /* @__PURE__ */ V("textarea", {
267
613
  ref: v,
268
614
  value: m,
269
- onChange: (e) => C(e.target.value),
270
- onBlur: x,
271
- onKeyDown: O,
272
- placeholder: i,
273
- "aria-label": o,
615
+ onChange: (e) => D(e.target.value),
616
+ onBlur: T,
617
+ onKeyDown: M,
618
+ placeholder: a,
619
+ "aria-label": s,
620
+ "aria-busy": g || void 0,
274
621
  rows: 3,
275
- className: e(D, "resize-none py-0.5 leading-snug", a)
276
- }) : /* @__PURE__ */ I(p, {
622
+ className: e(j, "resize-none py-0.5 leading-snug", o)
623
+ }) : /* @__PURE__ */ V(t, {
277
624
  ref: v,
278
625
  value: m,
279
- onChange: (e) => C(e.target.value),
280
- onBlur: x,
281
- onKeyDown: O,
282
- placeholder: i,
283
- "aria-label": o,
284
- className: e(D, "h-auto px-0 py-0 shadow-none focus-visible:ring-0", a)
626
+ onChange: (e) => D(e.target.value),
627
+ onBlur: T,
628
+ onKeyDown: M,
629
+ placeholder: a,
630
+ "aria-label": s,
631
+ "aria-busy": g || void 0,
632
+ className: e(j, "h-auto px-0 py-0 shadow-none focus-visible:ring-0", o)
285
633
  });
286
634
  }
287
635
  //#endregion
288
636
  //#region src/bento/bento-status-marker.tsx
289
- function ze({ titleMissing: t, dirty: n, className: r }) {
290
- let { t: i } = R();
637
+ function lt({ titleMissing: t, dirty: n, className: r }) {
638
+ let { t: i } = U();
291
639
  if (!t && !n) return null;
292
640
  let a = "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal";
293
- return t ? /* @__PURE__ */ L("span", {
641
+ return t ? /* @__PURE__ */ H("span", {
294
642
  className: e(a, "bento-status bento-status-error", r),
295
- children: [/* @__PURE__ */ I(te, { className: "size-3" }), i("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
296
- }) : /* @__PURE__ */ L("span", {
643
+ children: [/* @__PURE__ */ V(oe, { className: "size-3" }), i("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
644
+ }) : /* @__PURE__ */ H("span", {
297
645
  className: e(a, "bento-status bento-status-warn", r),
298
- children: [/* @__PURE__ */ I("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), i("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
646
+ children: [/* @__PURE__ */ V("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), i("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
299
647
  });
300
648
  }
301
649
  //#endregion
302
650
  //#region src/bento/bento-scroll-fade.ts
303
- function Be(e) {
304
- j(() => {
651
+ function ut(e) {
652
+ F(() => {
305
653
  let t = e.current;
306
654
  if (!t) return;
307
655
  let n = document.documentElement, r = 0, i = () => {
@@ -318,183 +666,361 @@ function Be(e) {
318
666
  }
319
667
  //#endregion
320
668
  //#region src/bento/bento-entity-shell.tsx
321
- function Ve(e, t) {
669
+ function dt(e, t) {
322
670
  let n = {};
323
671
  for (let r of Object.keys(e)) Object.assign(n, { [r]: t[r] });
324
672
  return n;
325
673
  }
326
- function He({ 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 }) {
327
- let { t: b } = R(), S = q(), [C, w] = P(!1), [E, D] = P({
674
+ function ft({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i, icon: o, tone: s, formId: c, feature: l, hasStatus: u = !1, hideIcon: d = !1, readOnly: f = !1, autosaveOnly: p = !1, badge: m, notice: h, onUpdate: g, onDelete: _, extraActions: v, children: y }) {
675
+ let { t: x } = U(), S = Me(), [C, w] = z(!1), [T, E] = z({
328
676
  isDirty: !1,
329
677
  isSubmitting: !1
330
- }), O = N(null);
331
- Be(O);
332
- let k = {
678
+ }), D = R(null);
679
+ ut(D);
680
+ let O = {
333
681
  title: e.title ?? "",
334
682
  description: e.description ?? "",
335
683
  icon: e.icon ?? null,
336
684
  enabled: e.enabled ?? 1
337
- }, [A, j] = P(k), [M, ee] = P(k);
338
- (k.title !== M.title || k.description !== M.description || k.icon !== M.icon || k.enabled !== M.enabled) && (ee(k), j(k));
339
- async function z(n) {
340
- if (j((e) => ({
685
+ }, [k, A] = z(O), [j, M] = z(O);
686
+ (O.title !== j.title || O.description !== j.description || O.icon !== j.icon || O.enabled !== j.enabled) && (M(O), A(O));
687
+ async function N(n) {
688
+ if (A((e) => ({
341
689
  ...e,
342
690
  ...n
343
- })), t || !h) return;
344
- let r = n.title ?? A.title;
691
+ })), t || !g) return;
692
+ let r = n.title ?? k.title;
345
693
  try {
346
- await h({
694
+ await g({
347
695
  ...e,
348
696
  ...n
349
- }), x.success(b("forms.common.updated", {
697
+ }), b.success(x("forms.common.updated", {
350
698
  name: r,
351
- feature: c
699
+ feature: l
352
700
  }));
353
701
  } catch (e) {
354
- console.error("Failed to update entity field", e), j((e) => ({
702
+ console.error("Failed to update entity field", e), A((e) => ({
355
703
  ...e,
356
- ...Ve(n, k)
357
- })), x.error(b("forms.common.notUpdated", {
358
- name: k.title || r,
359
- feature: c
704
+ ...dt(n, O)
705
+ })), b.error(x("forms.common.notUpdated", {
706
+ name: O.title || r,
707
+ feature: l
360
708
  }));
361
709
  }
362
710
  }
363
711
  async function te() {
364
- if (g) {
712
+ if (_) {
365
713
  try {
366
- await g() ? (x.success(b("forms.common.deleted", {
367
- name: A.title,
368
- feature: c
369
- })), S(i)) : x.error(b("forms.common.notDeleted", {
370
- name: A.title,
371
- feature: c
714
+ await _() ? (b.success(x("forms.common.deleted", {
715
+ name: k.title,
716
+ feature: l
717
+ })), S(i)) : b.error(x("forms.common.notDeleted", {
718
+ name: k.title,
719
+ feature: l
372
720
  }));
373
721
  } catch (e) {
374
- console.error("Failed to delete entity", e), x.error(b("forms.common.notDeleted", {
375
- name: A.title,
376
- feature: c
722
+ console.error("Failed to delete entity", e), b.error(x("forms.common.notDeleted", {
723
+ name: k.title,
724
+ feature: l
377
725
  }));
378
726
  }
379
727
  w(!1);
380
728
  }
381
729
  }
382
- let B = A.enabled === 1, ne = !d, re = !(f && !t), ie = !A.title.trim(), ae = !t && !E.isDirty, oe = ie || ae, V = [...v ?? [], ...g && !d ? [{
383
- label: b("forms.formActions.delete"),
384
- icon: _e,
730
+ let P = k.enabled === 1, ne = !f, re = !(p && !t), F = !k.title.trim(), I = !t && !T.isDirty, L = F || I, ie = [...v ?? [], ..._ && !f ? [{
731
+ id: "entity.delete",
732
+ label: x("forms.formActions.delete"),
733
+ icon: we,
385
734
  tone: "destructive",
386
735
  onSelect: () => w(!0)
387
736
  }] : []];
388
- return /* @__PURE__ */ L(F, { children: [
389
- /* @__PURE__ */ I(Z, {
390
- eyebrow: /* @__PURE__ */ L("span", {
737
+ return /* @__PURE__ */ H(B, { children: [
738
+ /* @__PURE__ */ V(ot, {
739
+ eyebrow: /* @__PURE__ */ H("span", {
391
740
  className: "inline-flex items-center gap-2",
392
- children: [/* @__PURE__ */ I(X, {
741
+ children: [/* @__PURE__ */ V(at, {
393
742
  to: i,
394
743
  children: r
395
- }), !d && /* @__PURE__ */ I(ze, {
396
- titleMissing: ie,
397
- dirty: t || E.isDirty
744
+ }), !f && /* @__PURE__ */ V(lt, {
745
+ titleMissing: F,
746
+ dirty: t || T.isDirty
398
747
  })]
399
748
  }),
400
- leading: /* @__PURE__ */ I(Le, {
401
- value: A.icon,
402
- onChange: (e) => z({ icon: e }),
403
- onClear: () => z({ icon: null }),
404
- defaultIcon: a,
405
- tone: o,
406
- title: A.title,
407
- description: A.description,
408
- readOnly: d || u
749
+ leading: /* @__PURE__ */ V(st, {
750
+ value: k.icon,
751
+ onChange: (e) => N({ icon: e }),
752
+ onClear: () => N({ icon: null }),
753
+ defaultIcon: o,
754
+ tone: s,
755
+ title: k.title,
756
+ description: k.description,
757
+ readOnly: f || d
409
758
  }),
410
- title: /* @__PURE__ */ I(Re, {
411
- value: A.title,
412
- onSave: (e) => z({ title: e }),
759
+ title: /* @__PURE__ */ V(ct, {
760
+ value: k.title,
761
+ onSave: (e) => N({ title: e }),
413
762
  placeholder: n,
414
763
  className: "text-3xl font-semibold tracking-tight md:text-4xl",
415
- ariaLabel: b("forms.common.title"),
764
+ ariaLabel: x("forms.common.title"),
416
765
  autoFocus: t,
417
766
  commitOnChange: t,
418
- readOnly: d
767
+ readOnly: f
419
768
  }),
420
- subtitle: /* @__PURE__ */ I(Re, {
421
- value: A.description,
422
- onSave: (e) => z({ description: e }),
769
+ subtitle: /* @__PURE__ */ V(ct, {
770
+ value: k.description,
771
+ onSave: (e) => N({ description: e }),
423
772
  multiline: !0,
424
- placeholder: b("forms.common.description"),
773
+ placeholder: x("forms.common.description"),
425
774
  className: "max-w-2xl text-sm text-muted-foreground",
426
- ariaLabel: b("forms.common.description"),
775
+ ariaLabel: x("forms.common.description"),
427
776
  commitOnChange: t,
428
- readOnly: d
777
+ readOnly: f
429
778
  }),
430
- trailing: /* @__PURE__ */ L(F, { children: [
431
- ne && /* @__PURE__ */ L("div", {
779
+ trailing: /* @__PURE__ */ H(B, { children: [
780
+ ne && /* @__PURE__ */ H("div", {
432
781
  className: "bento-fade-out flex shrink-0 items-center gap-2",
433
- children: [re && /* @__PURE__ */ L(_, {
782
+ children: [re && /* @__PURE__ */ H(a, {
434
783
  type: "submit",
435
- form: s,
784
+ form: c,
436
785
  size: "sm",
437
- loading: E.isSubmitting,
438
- disabled: oe,
439
- children: [/* @__PURE__ */ I(H, { className: "size-4" }), b("forms.formActions.saveChanges")]
440
- }), /* @__PURE__ */ L(_, {
786
+ loading: T.isSubmitting,
787
+ "aria-disabled": L ? "true" : void 0,
788
+ children: [/* @__PURE__ */ V(he, { className: "size-4" }), x("forms.formActions.saveChanges")]
789
+ }), /* @__PURE__ */ H(a, {
441
790
  type: "button",
442
791
  size: "sm",
443
792
  variant: "outline",
444
793
  onClick: () => S(i),
445
- children: [/* @__PURE__ */ I(W, { className: "size-4" }), b("forms.formActions.cancel")]
794
+ children: [/* @__PURE__ */ V(Oe, { className: "size-4" }), x("forms.formActions.cancel")]
446
795
  })]
447
796
  }),
448
- p,
449
- l && (d ? /* @__PURE__ */ L("span", {
450
- className: `flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${B ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
451
- children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${B ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), B ? b("common.active", { defaultValue: "Active" }) : b("common.idle", { defaultValue: "Idle" })]
452
- }) : /* @__PURE__ */ L("button", {
797
+ m,
798
+ u && (f ? /* @__PURE__ */ H("span", {
799
+ className: `flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${P ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
800
+ children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full ${P ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), P ? x("common.active", { defaultValue: "Active" }) : x("common.idle", { defaultValue: "Idle" })]
801
+ }) : /* @__PURE__ */ H("button", {
453
802
  type: "button",
454
- onClick: () => z({ enabled: +!B }),
455
- "aria-label": b("forms.common.enabled"),
456
- title: b(B ? "common.activeToggleHint" : "common.idleToggleHint"),
457
- 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 ${B ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"}`,
458
- children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${B ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), B ? b("common.active", { defaultValue: "Active" }) : b("common.idle", { defaultValue: "Idle" })]
803
+ onClick: () => N({ enabled: +!P }),
804
+ "aria-label": x("forms.common.enabled"),
805
+ title: x(P ? "common.activeToggleHint" : "common.idleToggleHint"),
806
+ 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 ${P ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"}`,
807
+ children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full ${P ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), P ? x("common.active", { defaultValue: "Active" }) : x("common.idle", { defaultValue: "Idle" })]
459
808
  })),
460
- !t && V.length > 0 && /* @__PURE__ */ I(Ne, { actions: V })
809
+ !t && ie.length > 0 && /* @__PURE__ */ V(Ze, { actions: ie })
461
810
  ] })
462
811
  }),
463
- /* @__PURE__ */ I("div", {
464
- ref: O,
812
+ /* @__PURE__ */ V("div", {
813
+ ref: D,
465
814
  "aria-hidden": !0,
466
815
  className: "h-px"
467
816
  }),
468
- m,
469
- !t && g && /* @__PURE__ */ I(T, {
470
- feature: c,
471
- name: A.title,
817
+ h,
818
+ !t && _ && /* @__PURE__ */ V(ee, {
819
+ feature: l,
820
+ name: k.title,
472
821
  onDelete: te,
473
822
  open: C,
474
823
  setOpen: w,
475
- trigger: /* @__PURE__ */ I("span", {
824
+ trigger: /* @__PURE__ */ V("span", {
476
825
  className: "hidden",
477
826
  "aria-hidden": !0
478
827
  })
479
828
  }),
480
829
  y({
481
- staged: A,
482
- onStateChange: D
830
+ staged: k,
831
+ onStateChange: E
483
832
  })
484
833
  ] });
485
834
  }
486
835
  //#endregion
836
+ //#region src/bento/bento-diff.tsx
837
+ function pt(e, t, n = !0) {
838
+ let r = e.length, i = t.length;
839
+ if (r * i > 4e5) return null;
840
+ let a = Array.from({ length: r + 1 }, () => new Uint32Array(i + 1));
841
+ for (let n = r - 1; n >= 0; n--) for (let r = i - 1; r >= 0; r--) a[n][r] = e[n] === t[r] ? a[n + 1][r + 1] + 1 : Math.max(a[n + 1][r], a[n][r + 1]);
842
+ let o = [], s = (e, t) => {
843
+ let r = o[o.length - 1];
844
+ n && r?.op === e ? r.text += t : o.push({
845
+ op: e,
846
+ text: t
847
+ });
848
+ }, c = 0, l = 0;
849
+ for (; c < r && l < i;) e[c] === t[l] ? (s("same", e[c]), c++, l++) : a[c + 1][l] >= a[c][l + 1] ? s("remove", e[c++]) : s("add", t[l++]);
850
+ for (; c < r;) s("remove", e[c++]);
851
+ for (; l < i;) s("add", t[l++]);
852
+ return o;
853
+ }
854
+ var mt = (e) => e.split(/(\s+)/).filter((e) => e !== "");
855
+ function ht(e) {
856
+ if (typeof DOMParser > "u") return e.split(/<\/(?:p|h[1-6]|li|blockquote|pre|div)>/i).map((e) => e.replace(/<[^>]*>/g, "").replace(/\s+/g, " ").trim()).filter(Boolean);
857
+ let t = new DOMParser().parseFromString(e, "text/html"), n = [...t.body.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, blockquote, pre")].filter((e) => !e.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote, pre")).map((e) => (e.textContent ?? "").replace(/\s+/g, " ").trim()).filter(Boolean), r = (t.body.textContent ?? "").replace(/\s+/g, " ").trim();
858
+ return n.length > 0 ? n : r ? [r] : [];
859
+ }
860
+ var $ = (e) => e == null ? "" : String(e);
861
+ function gt({ before: t, after: n, fields: r, showUnchanged: i = !1 }) {
862
+ let { t: a } = U(), [o, s] = z(i), c = r.map((e) => {
863
+ let r = t?.[e.id], i = n?.[e.id], a = e.kind ?? "text", o = a === "rich" ? ht($(r)).join("\n") === ht($(i)).join("\n") : a === "value" ? JSON.stringify(r ?? null) === JSON.stringify(i ?? null) : $(r) === $(i), s = "changed";
864
+ return t === null || (r == null || r === "") && !o ? s = "added" : n === null || (i == null || i === "") && !o ? s = "removed" : o && (s = "unchanged"), {
865
+ field: e,
866
+ a: r,
867
+ b: i,
868
+ kind: a,
869
+ state: s
870
+ };
871
+ }), l = c.filter((e) => e.state !== "unchanged"), u = c.filter((e) => e.state === "unchanged"), d = {
872
+ added: a("bento.diff.added", { defaultValue: "Added" }),
873
+ removed: a("bento.diff.removed", { defaultValue: "Removed" }),
874
+ changed: a("bento.diff.changed", { defaultValue: "Changed" }),
875
+ unchanged: a("bento.diff.unchanged", { defaultValue: "Unchanged" })
876
+ };
877
+ return /* @__PURE__ */ H("div", {
878
+ "data-slot": "bento-diff",
879
+ className: "flex flex-col gap-3",
880
+ children: [
881
+ (t === null || n === null) && /* @__PURE__ */ V("p", {
882
+ className: "m-0 text-sm font-medium",
883
+ children: t === null ? a("bento.diff.created", { defaultValue: "Created in this version" }) : a("bento.diff.deleted", { defaultValue: "Deleted in this version" })
884
+ }),
885
+ l.length === 0 && /* @__PURE__ */ V("p", {
886
+ className: "m-0 text-sm text-muted-foreground",
887
+ children: a("bento.diff.noChanges", { defaultValue: "No field changed" })
888
+ }),
889
+ /* @__PURE__ */ V("dl", {
890
+ className: "m-0 flex flex-col gap-3",
891
+ children: l.map((e) => /* @__PURE__ */ V(_t, {
892
+ label: e.field.label,
893
+ status: d[e.state],
894
+ state: e.state,
895
+ children: /* @__PURE__ */ V(vt, { row: e })
896
+ }, e.field.id))
897
+ }),
898
+ u.length > 0 && /* @__PURE__ */ H("div", {
899
+ className: "flex flex-col gap-3",
900
+ children: [/* @__PURE__ */ H("button", {
901
+ type: "button",
902
+ "aria-expanded": o ? "true" : "false",
903
+ onClick: () => s(!o),
904
+ className: "inline-flex items-center gap-1 self-start rounded-md text-sm text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",
905
+ children: [/* @__PURE__ */ V(K, {
906
+ size: 14,
907
+ "aria-hidden": "true",
908
+ className: e("transition-transform", o && "rotate-90")
909
+ }), a("bento.diff.unchangedCount", {
910
+ defaultValue: "{{count}} unchanged",
911
+ count: u.length
912
+ })]
913
+ }), o && /* @__PURE__ */ V("dl", {
914
+ className: "m-0 flex flex-col gap-3",
915
+ children: u.map((e) => /* @__PURE__ */ V(_t, {
916
+ label: e.field.label,
917
+ status: d.unchanged,
918
+ state: "unchanged",
919
+ children: /* @__PURE__ */ V("p", {
920
+ className: "m-0 whitespace-pre-wrap text-sm text-muted-foreground",
921
+ children: e.kind === "rich" ? ht($(e.b)).join("\n\n") : e.field.format ? e.field.format(e.b) : $(e.b)
922
+ })
923
+ }, e.field.id))
924
+ })]
925
+ })
926
+ ]
927
+ });
928
+ }
929
+ function _t({ label: t, status: n, state: r, children: i }) {
930
+ return /* @__PURE__ */ H("div", {
931
+ className: "rounded-xl border border-border/60 bg-card/40 p-3",
932
+ children: [/* @__PURE__ */ H("dt", {
933
+ className: "mb-1.5 flex items-center gap-2 text-xs font-medium text-muted-foreground",
934
+ children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("span", {
935
+ className: e("rounded-full border px-1.5 leading-4", r === "added" && "bento-status bento-status-on", r === "removed" && "bento-status bento-status-error", r === "changed" && "bento-status bento-status-warn"),
936
+ children: n
937
+ })]
938
+ }), /* @__PURE__ */ V("dd", {
939
+ className: "m-0",
940
+ children: i
941
+ })]
942
+ });
943
+ }
944
+ function vt({ row: e }) {
945
+ let { t } = U(), { field: n, a: r, b: i, kind: a, state: o } = e;
946
+ if (a === "value") {
947
+ let e = (e) => n.format ? n.format(e) : $(e);
948
+ return /* @__PURE__ */ H("p", {
949
+ className: "m-0 flex flex-wrap items-center gap-2 text-sm",
950
+ children: [
951
+ o !== "added" && /* @__PURE__ */ V(bt, { children: e(r) }),
952
+ o === "changed" && /* @__PURE__ */ V("span", {
953
+ "aria-hidden": "true",
954
+ children: "→"
955
+ }),
956
+ o !== "removed" && /* @__PURE__ */ V(yt, { children: e(i) })
957
+ ]
958
+ });
959
+ }
960
+ let s = a === "rich" ? ht($(r)) : [$(r)].filter(Boolean), c = a === "rich" ? ht($(i)) : [$(i)].filter(Boolean), l = pt(s, c, !1) ?? [...s.map((e) => ({
961
+ op: "remove",
962
+ text: e
963
+ })), ...c.map((e) => ({
964
+ op: "add",
965
+ text: e
966
+ }))], u = [];
967
+ for (let e = 0; e < l.length; e++) {
968
+ let t = l[e], n = l[e + 1];
969
+ if (t.op === "remove" && n?.op === "add") {
970
+ let r = pt(mt(t.text), mt(n.text));
971
+ u.push(/* @__PURE__ */ V("p", {
972
+ className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
973
+ children: r ? r.map((e, t) => e.op === "same" ? /* @__PURE__ */ V("span", { children: e.text }, t) : e.op === "add" ? /* @__PURE__ */ V(yt, { children: e.text }, t) : /* @__PURE__ */ V(bt, { children: e.text }, t)) : [
974
+ /* @__PURE__ */ V(bt, { children: t.text }, "r"),
975
+ " ",
976
+ /* @__PURE__ */ V(yt, { children: n.text }, "a")
977
+ ]
978
+ }, e)), e++;
979
+ } else u.push(/* @__PURE__ */ V("p", {
980
+ className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
981
+ children: t.op === "same" ? t.text : t.op === "add" ? /* @__PURE__ */ V(yt, { children: t.text }) : /* @__PURE__ */ V(bt, { children: t.text })
982
+ }, e));
983
+ }
984
+ return u.length === 0 ? /* @__PURE__ */ V("p", {
985
+ className: "m-0 text-sm text-muted-foreground",
986
+ children: t("bento.diff.empty", { defaultValue: "Empty" })
987
+ }) : /* @__PURE__ */ V("div", {
988
+ className: "flex flex-col gap-2",
989
+ children: u
990
+ });
991
+ }
992
+ function yt({ children: e }) {
993
+ let { t } = U();
994
+ return /* @__PURE__ */ H("ins", {
995
+ className: "bento-status bento-status-on rounded-sm px-0.5 underline decoration-2 underline-offset-2",
996
+ children: [/* @__PURE__ */ H("span", {
997
+ className: "sr-only",
998
+ children: [t("bento.diff.addedStart", { defaultValue: "added:" }), " "]
999
+ }), e]
1000
+ });
1001
+ }
1002
+ function bt({ children: e }) {
1003
+ let { t } = U();
1004
+ return /* @__PURE__ */ H("del", {
1005
+ className: "bento-status bento-status-error rounded-sm px-0.5 line-through decoration-2",
1006
+ children: [/* @__PURE__ */ H("span", {
1007
+ className: "sr-only",
1008
+ children: [t("bento.diff.removedStart", { defaultValue: "removed:" }), " "]
1009
+ }), e]
1010
+ });
1011
+ }
1012
+ //#endregion
487
1013
  //#region src/bento/bento-layout.ts
488
- var Ue = {
1014
+ var xt = {
489
1015
  LARGE: "col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2",
490
1016
  MEDIUM: "col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
491
1017
  SMALL: "col-span-1 row-span-1"
492
- }, We = {
1018
+ }, St = {
493
1019
  SMALL: "MEDIUM",
494
1020
  MEDIUM: "LARGE",
495
1021
  LARGE: "SMALL"
496
1022
  };
497
- function Ge(e, t, n) {
1023
+ function Ct(e, t, n) {
498
1024
  if (!n || n.length === 0) return e.map((e, n) => ({
499
1025
  item: e,
500
1026
  key: t(e),
@@ -515,7 +1041,7 @@ function Ge(e, t, n) {
515
1041
  emphasis: i.get(t) ?? "MEDIUM"
516
1042
  }));
517
1043
  }
518
- function Ke(e) {
1044
+ function wt(e) {
519
1045
  return e.map((e, t) => ({
520
1046
  itemId: e.key,
521
1047
  emphasis: e.emphasis,
@@ -524,45 +1050,45 @@ function Ke(e) {
524
1050
  }
525
1051
  //#endregion
526
1052
  //#region src/bento/bento-entity-tile.tsx
527
- function qe({ 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 }) {
528
- let { t: f } = R(), p = Y(a), m = t ?? (n ? "LARGE" : "MEDIUM"), h = m === "LARGE", g = m === "SMALL", _ = Ue[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";
529
- return /* @__PURE__ */ L(K, {
1053
+ function Tt({ 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 }) {
1054
+ let { t: f } = U(), p = Q(a), m = t ?? (n ? "LARGE" : "MEDIUM"), h = m === "LARGE", g = m === "SMALL", _ = xt[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";
1055
+ return /* @__PURE__ */ H(Z, {
530
1056
  to: e,
531
1057
  className: `bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${h ? "gap-5" : "gap-4"} overflow-hidden ${y} ${_}`,
532
1058
  style: d ? { viewTransitionName: d } : void 0,
533
1059
  children: [
534
- h && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1060
+ h && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
535
1061
  "aria-hidden": !0,
536
1062
  className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${p} opacity-40 blur-2xl dark:opacity-50`
537
- }), /* @__PURE__ */ I("div", {
1063
+ }), /* @__PURE__ */ V("div", {
538
1064
  "aria-hidden": !0,
539
1065
  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`
540
1066
  })] }),
541
- /* @__PURE__ */ L("div", {
1067
+ /* @__PURE__ */ H("div", {
542
1068
  className: "relative z-1 flex items-center justify-between",
543
- children: [/* @__PURE__ */ I("span", {
1069
+ children: [/* @__PURE__ */ V("span", {
544
1070
  className: `grid place-items-center rounded-2xl ${p} text-white shadow-md ${b}`,
545
- children: i ? /* @__PURE__ */ I(G, {
1071
+ children: i ? /* @__PURE__ */ V(ke, {
546
1072
  icon: i,
547
1073
  className: h ? "size-7 text-white" : "size-4.5 text-white"
548
- }) : /* @__PURE__ */ I(r, { size: x })
549
- }), u && /* @__PURE__ */ L("span", {
1074
+ }) : /* @__PURE__ */ V(r, { size: x })
1075
+ }), u && /* @__PURE__ */ H("span", {
550
1076
  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"}`,
551
- 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" })]
1077
+ children: [/* @__PURE__ */ V("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" })]
552
1078
  })]
553
1079
  }),
554
- /* @__PURE__ */ L("div", {
1080
+ /* @__PURE__ */ H("div", {
555
1081
  className: "relative z-1",
556
1082
  children: [
557
- /* @__PURE__ */ I("div", {
1083
+ /* @__PURE__ */ V("div", {
558
1084
  className: `font-semibold tracking-tight ${S}`,
559
1085
  children: o
560
1086
  }),
561
- !g && c && /* @__PURE__ */ I("div", {
1087
+ !g && c && /* @__PURE__ */ V("div", {
562
1088
  className: "mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",
563
1089
  children: c
564
1090
  }),
565
- !g && s && /* @__PURE__ */ I("p", {
1091
+ !g && s && /* @__PURE__ */ V("p", {
566
1092
  className: "mt-2 text-sm text-muted-foreground",
567
1093
  children: s
568
1094
  })
@@ -572,43 +1098,269 @@ function qe({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, tone: a
572
1098
  });
573
1099
  }
574
1100
  //#endregion
1101
+ //#region src/bento/bento-filter-bar.tsx
1102
+ var Et = {
1103
+ query: "",
1104
+ facets: {}
1105
+ }, Dt = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ot = (e) => Array.isArray(e) ? e : [];
1106
+ function kt(e, t, n) {
1107
+ let r = { ...e.facets };
1108
+ return n === void 0 || Array.isArray(n) && n.length === 0 || Dt(n) && !n.from && !n.to ? delete r[t] : r[t] = n, {
1109
+ ...e,
1110
+ facets: r
1111
+ };
1112
+ }
1113
+ function At({ value: e, onChange: n, facets: r, queryLabel: i, queryDelay: a = 300, views: o }) {
1114
+ let { t: s } = U(), [c, l] = z({
1115
+ source: e.query,
1116
+ text: e.query
1117
+ }), [u, d] = z(null);
1118
+ c.source !== e.query && l({
1119
+ source: e.query,
1120
+ text: e.query === u ? c.text : e.query
1121
+ }), F(() => {
1122
+ if (c.text === e.query) return;
1123
+ let t = setTimeout(() => {
1124
+ d(c.text), n({
1125
+ ...e,
1126
+ query: c.text
1127
+ });
1128
+ }, a);
1129
+ return () => clearTimeout(t);
1130
+ }, [
1131
+ c.text,
1132
+ e,
1133
+ n,
1134
+ a
1135
+ ]);
1136
+ let f = [];
1137
+ for (let t of r) {
1138
+ let n = e.facets[t.id];
1139
+ if (t.kind === "choice") for (let r of Ot(n)) {
1140
+ let i = t.options.find((e) => e.value === r);
1141
+ f.push({
1142
+ key: `${t.id}:${r}`,
1143
+ text: `${t.label}: ${i?.label ?? r}`,
1144
+ remove: () => kt(e, t.id, Ot(n).filter((e) => e !== r))
1145
+ });
1146
+ }
1147
+ else Dt(n) && (n.from || n.to) && f.push({
1148
+ key: t.id,
1149
+ text: `${t.label}: ${n.from ?? "…"} – ${n.to ?? "…"}`,
1150
+ remove: () => kt(e, t.id, void 0)
1151
+ });
1152
+ }
1153
+ let p = f.length > 0 || e.query !== "", m = i ?? s("bento.filters.search", { defaultValue: "Search" });
1154
+ return /* @__PURE__ */ H("div", {
1155
+ role: "search",
1156
+ "aria-label": s("bento.filters.label", { defaultValue: "Filters" }),
1157
+ "data-slot": "bento-filter-bar",
1158
+ className: "flex flex-col gap-2",
1159
+ children: [/* @__PURE__ */ H("div", {
1160
+ className: "flex flex-wrap items-center gap-2",
1161
+ children: [
1162
+ /* @__PURE__ */ H("div", {
1163
+ className: "relative min-w-48 flex-1",
1164
+ children: [/* @__PURE__ */ V(Se, {
1165
+ size: 16,
1166
+ "aria-hidden": "true",
1167
+ className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
1168
+ }), /* @__PURE__ */ V(t, {
1169
+ type: "search",
1170
+ value: c.text,
1171
+ placeholder: m,
1172
+ "aria-label": m,
1173
+ onChange: (e) => l({
1174
+ ...c,
1175
+ text: e.target.value
1176
+ }),
1177
+ className: "pl-9"
1178
+ })]
1179
+ }),
1180
+ r.map((t) => t.kind === "choice" ? /* @__PURE__ */ V(Mt, {
1181
+ facet: t,
1182
+ value: e,
1183
+ onChange: n
1184
+ }, t.id) : /* @__PURE__ */ V(Nt, {
1185
+ facet: t,
1186
+ value: e,
1187
+ onChange: n
1188
+ }, t.id)),
1189
+ o
1190
+ ]
1191
+ }), p && /* @__PURE__ */ H("ul", {
1192
+ className: "m-0 flex list-none flex-wrap items-center gap-1.5 p-0",
1193
+ "aria-label": s("bento.filters.active", { defaultValue: "Active filters" }),
1194
+ children: [f.map((e) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H("button", {
1195
+ type: "button",
1196
+ "aria-label": s("bento.filters.remove", {
1197
+ defaultValue: "Remove filter {{filter}}",
1198
+ filter: e.text
1199
+ }),
1200
+ onClick: () => n(e.remove()),
1201
+ className: "bento-clear inline-flex items-center gap-1 rounded-full border border-border/60 bg-card/60 py-0.5 pl-2.5 pr-1.5 text-xs",
1202
+ children: [e.text, /* @__PURE__ */ V(Oe, {
1203
+ size: 12,
1204
+ "aria-hidden": "true"
1205
+ })]
1206
+ }) }, e.key)), /* @__PURE__ */ V("li", { children: /* @__PURE__ */ V(N, {
1207
+ variant: "ghost",
1208
+ size: "sm",
1209
+ className: "h-6 px-2 text-xs",
1210
+ onClick: () => {
1211
+ l({
1212
+ source: "",
1213
+ text: ""
1214
+ }), n(Et);
1215
+ },
1216
+ children: s("bento.filters.clearAll", { defaultValue: "Clear all" })
1217
+ }) })]
1218
+ })]
1219
+ });
1220
+ }
1221
+ function jt({ label: e, count: t, ...n }) {
1222
+ return /* @__PURE__ */ H(N, {
1223
+ variant: "outline",
1224
+ size: "sm",
1225
+ className: "gap-1.5",
1226
+ ...n,
1227
+ children: [
1228
+ e,
1229
+ t > 0 && /* @__PURE__ */ V("span", {
1230
+ className: "rounded-full bg-primary px-1.5 text-[0.6875rem] leading-4 text-primary-foreground",
1231
+ children: t
1232
+ }),
1233
+ /* @__PURE__ */ V(pe, {
1234
+ size: 14,
1235
+ "aria-hidden": "true"
1236
+ })
1237
+ ]
1238
+ });
1239
+ }
1240
+ function Mt({ facet: e, value: t, onChange: n }) {
1241
+ let r = Ot(t.facets[e.id]);
1242
+ return /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
1243
+ asChild: !0,
1244
+ children: /* @__PURE__ */ V(jt, {
1245
+ label: e.label,
1246
+ count: r.length
1247
+ })
1248
+ }), /* @__PURE__ */ V(_, {
1249
+ align: "start",
1250
+ className: "bento-dropdown min-w-44 p-1.5",
1251
+ children: e.multiple ? e.options.map((i) => /* @__PURE__ */ V(j, {
1252
+ checked: r.includes(i.value),
1253
+ onCheckedChange: (a) => n(kt(t, e.id, a === !0 ? [...r, i.value] : r.filter((e) => e !== i.value))),
1254
+ onSelect: (e) => e.preventDefault(),
1255
+ children: i.label
1256
+ }, i.value)) : /* @__PURE__ */ V(c, {
1257
+ value: r[0] ?? "",
1258
+ onValueChange: (i) => n(kt(t, e.id, i === r[0] ? [] : [i])),
1259
+ children: e.options.map((e) => /* @__PURE__ */ V(T, {
1260
+ value: e.value,
1261
+ children: e.label
1262
+ }, e.value))
1263
+ })
1264
+ })] });
1265
+ }
1266
+ function Nt({ facet: e, value: n, onChange: r }) {
1267
+ let { t: i } = U(), a = n.facets[e.id], o = Dt(a) ? a : {}, [s, c] = z(!1), [l, u] = z(o.from ?? ""), [d, f] = z(o.to ?? ""), p = I(), m = I();
1268
+ return /* @__PURE__ */ H(C, {
1269
+ open: s,
1270
+ onOpenChange: (e) => {
1271
+ e && (u(o.from ?? ""), f(o.to ?? "")), c(e);
1272
+ },
1273
+ children: [/* @__PURE__ */ V(M, {
1274
+ asChild: !0,
1275
+ children: /* @__PURE__ */ V(jt, {
1276
+ label: e.label,
1277
+ count: o.from || o.to ? 1 : 0
1278
+ })
1279
+ }), /* @__PURE__ */ V(v, {
1280
+ align: "start",
1281
+ className: "bento-dropdown w-64 p-3",
1282
+ children: /* @__PURE__ */ H("form", {
1283
+ className: "flex flex-col gap-2",
1284
+ onSubmit: (t) => {
1285
+ t.preventDefault(), r(kt(n, e.id, {
1286
+ from: l || void 0,
1287
+ to: d || void 0
1288
+ })), c(!1);
1289
+ },
1290
+ children: [
1291
+ /* @__PURE__ */ V("label", {
1292
+ htmlFor: p,
1293
+ className: "text-xs text-muted-foreground",
1294
+ children: i("bento.filters.from", { defaultValue: "From" })
1295
+ }),
1296
+ /* @__PURE__ */ V(t, {
1297
+ id: p,
1298
+ type: "date",
1299
+ value: l,
1300
+ max: d || void 0,
1301
+ onChange: (e) => u(e.target.value)
1302
+ }),
1303
+ /* @__PURE__ */ V("label", {
1304
+ htmlFor: m,
1305
+ className: "text-xs text-muted-foreground",
1306
+ children: i("bento.filters.to", { defaultValue: "To" })
1307
+ }),
1308
+ /* @__PURE__ */ V(t, {
1309
+ id: m,
1310
+ type: "date",
1311
+ value: d,
1312
+ min: l || void 0,
1313
+ onChange: (e) => f(e.target.value)
1314
+ }),
1315
+ /* @__PURE__ */ V(N, {
1316
+ type: "submit",
1317
+ size: "sm",
1318
+ className: "mt-1",
1319
+ children: i("bento.filters.apply", { defaultValue: "Apply" })
1320
+ })
1321
+ ]
1322
+ })
1323
+ })]
1324
+ });
1325
+ }
1326
+ //#endregion
575
1327
  //#region src/bento/bento-list-page.tsx
576
- var Je = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
577
- function Ye({ 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: b }) {
578
- let { t: x } = R(), S = Y(u), [C, T] = P(!1), D = M(() => Ge(e ?? [], g, b?.data?.entries), [
1328
+ var Pt = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
1329
+ function Ft({ 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: b }) {
1330
+ let { t: x } = U(), S = Q(u), [C, w] = z(!1), T = L(() => Ct(e ?? [], g, b?.data?.entries), [
579
1331
  e,
580
1332
  g,
581
1333
  b?.data?.entries
582
- ]), O = !!r && !!b && (e?.length ?? 0) > 0;
583
- return /* @__PURE__ */ L(E, {
1334
+ ]), E = !!r && !!b && (e?.length ?? 0) > 0;
1335
+ return /* @__PURE__ */ H(te, {
584
1336
  checkIsNotUndefined: e,
585
1337
  error: t ?? null,
586
1338
  tryAgainUrl: n,
587
1339
  children: [
588
- /* @__PURE__ */ I(Z, {
1340
+ /* @__PURE__ */ V(ot, {
589
1341
  eyebrow: i,
590
1342
  backTo: a,
591
1343
  backLabel: o,
592
- leading: /* @__PURE__ */ I("span", {
1344
+ leading: /* @__PURE__ */ V("span", {
593
1345
  className: `grid h-12 w-12 place-items-center rounded-2xl ${S} text-white shadow-md`,
594
- children: /* @__PURE__ */ I(s, { size: 24 })
1346
+ children: /* @__PURE__ */ V(s, { size: 24 })
595
1347
  }),
596
1348
  title: c,
597
1349
  subtitle: l
598
1350
  }),
599
- (d || O && !C) && /* @__PURE__ */ L("div", {
1351
+ (d || E && !C) && /* @__PURE__ */ H("div", {
600
1352
  className: "mb-4 flex flex-wrap items-center gap-2",
601
- children: [d, O && !C && /* @__PURE__ */ L(w, {
1353
+ children: [d, E && !C && /* @__PURE__ */ H(N, {
602
1354
  variant: "outline",
603
1355
  size: "sm",
604
- onClick: () => T(!0),
1356
+ onClick: () => w(!0),
605
1357
  className: "ml-auto gap-2",
606
- children: [/* @__PURE__ */ I(z, { size: 16 }), x("bento.layout.customize", { defaultValue: "Customize layout" })]
1358
+ children: [/* @__PURE__ */ V(ae, { size: 16 }), x("bento.layout.customize", { defaultValue: "Customize layout" })]
607
1359
  })]
608
1360
  }),
609
- C && r && b ? /* @__PURE__ */ I(Qe, {
1361
+ C && r && b ? /* @__PURE__ */ V(Rt, {
610
1362
  layout: b,
611
- resolved: D,
1363
+ resolved: T,
612
1364
  canEditGlobal: b?.data?.canEditGlobal ?? !1,
613
1365
  isCustomized: b?.data?.source === "USER",
614
1366
  renderTile: _,
@@ -617,9 +1369,9 @@ function Ye({ items: e, error: t, tryAgainUrl: n, listId: r, eyebrow: i, backTo:
617
1369
  newRoute: f,
618
1370
  newLabel: p,
619
1371
  newSubtitle: m,
620
- onClose: () => T(!1)
621
- }) : /* @__PURE__ */ I(Ze, {
622
- resolved: D,
1372
+ onClose: () => w(!1)
1373
+ }) : /* @__PURE__ */ V(Lt, {
1374
+ resolved: T,
623
1375
  renderTile: _,
624
1376
  chip: S,
625
1377
  hideNew: h,
@@ -633,26 +1385,26 @@ function Ye({ items: e, error: t, tryAgainUrl: n, listId: r, eyebrow: i, backTo:
633
1385
  ]
634
1386
  });
635
1387
  }
636
- function Xe({ 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 }) {
637
- let f = Y(r);
638
- return /* @__PURE__ */ I(E, {
1388
+ function It({ 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 }) {
1389
+ let f = Q(r);
1390
+ return /* @__PURE__ */ V(te, {
639
1391
  checkIsNotUndefined: e,
640
1392
  error: t ?? null,
641
1393
  tryAgainUrl: n,
642
- children: /* @__PURE__ */ L("div", {
643
- className: Je,
1394
+ children: /* @__PURE__ */ H("div", {
1395
+ className: Pt,
644
1396
  children: [
645
- !s && i && a ? /* @__PURE__ */ I(nt, {
1397
+ !s && i && a ? /* @__PURE__ */ V(Ht, {
646
1398
  route: i,
647
1399
  label: a,
648
1400
  subtitle: o,
649
1401
  chip: f
650
1402
  }) : null,
651
- (e ?? []).map((e) => /* @__PURE__ */ I("span", {
1403
+ (e ?? []).map((e) => /* @__PURE__ */ V("span", {
652
1404
  className: "contents",
653
1405
  children: l(e)
654
1406
  }, c(e))),
655
- e?.length === 0 && /* @__PURE__ */ I(rt, {
1407
+ e?.length === 0 && /* @__PURE__ */ V(Ut, {
656
1408
  title: u,
657
1409
  description: d
658
1410
  })
@@ -660,126 +1412,128 @@ function Xe({ items: e, error: t, tryAgainUrl: n, tone: r = "indigo", newRoute:
660
1412
  })
661
1413
  });
662
1414
  }
663
- function Ze({ resolved: t, renderTile: n, chip: r, hideNew: i, newRoute: a, newLabel: o, newSubtitle: s, isEmpty: c, emptyTitle: l, emptyDescription: u }) {
1415
+ function Lt({ resolved: t, renderTile: n, chip: r, hideNew: i, newRoute: a, newLabel: o, newSubtitle: s, isEmpty: c, emptyTitle: l, emptyDescription: u }) {
664
1416
  let d = t.some((e) => e.emphasis === "SMALL");
665
- return /* @__PURE__ */ L("div", {
666
- className: e(Je, d && "grid-flow-dense"),
1417
+ return /* @__PURE__ */ H("div", {
1418
+ className: e(Pt, d && "grid-flow-dense"),
667
1419
  children: [
668
- !i && /* @__PURE__ */ I(nt, {
1420
+ !i && /* @__PURE__ */ V(Ht, {
669
1421
  route: a,
670
1422
  label: o,
671
1423
  subtitle: s,
672
1424
  chip: r
673
1425
  }),
674
- t.map(({ item: e, key: t, emphasis: r }) => /* @__PURE__ */ I("span", {
1426
+ t.map(({ item: e, key: t, emphasis: r }) => /* @__PURE__ */ V("span", {
675
1427
  className: "contents",
676
1428
  children: n(e, r)
677
1429
  }, t)),
678
- c && /* @__PURE__ */ I(rt, {
1430
+ c && /* @__PURE__ */ V(Ut, {
679
1431
  title: l,
680
1432
  description: u
681
1433
  })
682
1434
  ]
683
1435
  });
684
1436
  }
685
- function Qe({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderTile: a, chip: o, hideNew: s, newRoute: c, newLabel: l, newSubtitle: u, onClose: d }) {
686
- let { t: f } = R(), [p, m] = P(n), h = t.saving ?? !1, [g, _] = P(!1), v = (e) => async () => {
687
- if (e) {
688
- _(!1);
1437
+ function Rt({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderTile: a, chip: o, hideNew: s, newRoute: c, newLabel: l, newSubtitle: u, onClose: d }) {
1438
+ let { t: f } = U(), [p, m] = z(n), [h, g] = z(null), _ = (t.saving ?? !1) || h !== null, v = (e) => _ && h === e ? { loading: !0 } : { "aria-disabled": _ || void 0 }, [y, b] = z(!1), x = (e, t) => async () => {
1439
+ if (t) {
1440
+ g(e), b(!1);
689
1441
  try {
690
- await e(), d();
1442
+ await t(), d();
691
1443
  } catch (e) {
692
- console.error("Failed to save the bento layout", e), _(!0);
1444
+ console.error("Failed to save the bento layout", e), b(!0);
1445
+ } finally {
1446
+ g(null);
693
1447
  }
694
1448
  }
695
- }, y = Ee(Te(Ce, { activationConstraint: { distance: 8 } }), Te(Se));
696
- function b(e) {
1449
+ }, S = He(Ve(ze, { activationConstraint: { distance: 8 } }), Ve(Re));
1450
+ function C(e) {
697
1451
  let { active: t, over: n } = e;
698
1452
  !n || t.id === n.id || m((e) => {
699
1453
  let r = e.findIndex((e) => e.key === t.id), i = e.findIndex((e) => e.key === n.id);
700
- return r < 0 || i < 0 ? e : Oe(e, r, i);
1454
+ return r < 0 || i < 0 ? e : We(e, r, i);
701
1455
  });
702
1456
  }
703
- function x(e, t) {
1457
+ function w(e, t) {
704
1458
  m((n) => n.map((n) => n.key === e ? {
705
1459
  ...n,
706
1460
  emphasis: t
707
1461
  } : n));
708
1462
  }
709
- let S = M(() => Ke(p), [p]), C = p.some((e) => e.emphasis === "SMALL");
710
- return /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("div", {
1463
+ let T = L(() => wt(p), [p]), E = p.some((e) => e.emphasis === "SMALL");
1464
+ return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("div", {
711
1465
  className: "mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md",
712
1466
  children: [
713
- /* @__PURE__ */ I("span", {
1467
+ /* @__PURE__ */ V("span", {
714
1468
  className: "mr-auto text-sm text-muted-foreground",
715
1469
  children: f("bento.layout.editHint", { defaultValue: "Drag tiles to reorder · tap the size button to resize" })
716
1470
  }),
717
- i && t.onReset && /* @__PURE__ */ L(w, {
1471
+ i && t.onReset && /* @__PURE__ */ H(N, {
718
1472
  variant: "ghost",
719
1473
  size: "sm",
720
1474
  className: "gap-2",
721
- disabled: h,
722
- onClick: v(t.onReset),
723
- children: [/* @__PURE__ */ I(B, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
1475
+ ...v("reset"),
1476
+ onClick: x("reset", t.onReset),
1477
+ children: [h !== "reset" && /* @__PURE__ */ V(W, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
724
1478
  }),
725
- r && t.onSaveGlobal && /* @__PURE__ */ L(w, {
1479
+ r && t.onSaveGlobal && /* @__PURE__ */ H(N, {
726
1480
  variant: "outline",
727
1481
  size: "sm",
728
1482
  className: "gap-2",
729
- disabled: h,
730
- onClick: v(() => t.onSaveGlobal?.(S)),
731
- children: [/* @__PURE__ */ I(ye, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
1483
+ ...v("global"),
1484
+ onClick: x("global", () => t.onSaveGlobal?.(T)),
1485
+ children: [h !== "global" && /* @__PURE__ */ V(De, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
732
1486
  }),
733
- /* @__PURE__ */ L(w, {
1487
+ /* @__PURE__ */ H(N, {
734
1488
  variant: "ghost",
735
1489
  size: "sm",
736
1490
  className: "gap-2",
737
- disabled: h,
1491
+ ...v("cancel"),
738
1492
  onClick: d,
739
- children: [/* @__PURE__ */ I(W, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
1493
+ children: [/* @__PURE__ */ V(Oe, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
740
1494
  }),
741
- /* @__PURE__ */ L(w, {
1495
+ /* @__PURE__ */ H(N, {
742
1496
  size: "sm",
743
1497
  className: "gap-2",
744
- disabled: h,
745
- onClick: v(() => t.onSave(S)),
746
- children: [/* @__PURE__ */ I(H, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
1498
+ ...v("save"),
1499
+ onClick: x("save", () => t.onSave(T)),
1500
+ children: [h !== "save" && /* @__PURE__ */ V(he, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
747
1501
  }),
748
- g && /* @__PURE__ */ I("p", {
1502
+ y && /* @__PURE__ */ V("p", {
749
1503
  role: "alert",
750
1504
  className: "w-full text-sm text-destructive",
751
1505
  children: f("bento.layout.saveFailed", { defaultValue: "The layout could not be saved. Nothing has changed — try again." })
752
1506
  })
753
1507
  ]
754
- }), /* @__PURE__ */ I(xe, {
755
- sensors: y,
756
- collisionDetection: we,
757
- onDragEnd: b,
758
- children: /* @__PURE__ */ I(De, {
1508
+ }), /* @__PURE__ */ V(Le, {
1509
+ sensors: S,
1510
+ collisionDetection: Be,
1511
+ onDragEnd: C,
1512
+ children: /* @__PURE__ */ V(Ue, {
759
1513
  items: p.map((e) => e.key),
760
- strategy: ke,
761
- children: /* @__PURE__ */ L("div", {
762
- className: e(Je, C && "grid-flow-dense"),
763
- children: [!s && /* @__PURE__ */ I(nt, {
1514
+ strategy: Ge,
1515
+ children: /* @__PURE__ */ H("div", {
1516
+ className: e(Pt, E && "grid-flow-dense"),
1517
+ children: [!s && /* @__PURE__ */ V(Ht, {
764
1518
  route: c,
765
1519
  label: l,
766
1520
  subtitle: u,
767
1521
  chip: o
768
- }), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ I(tt, {
1522
+ }), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ V(Vt, {
769
1523
  id: t,
770
1524
  emphasis: n,
771
- onSetEmphasis: (e) => x(t, e),
1525
+ onSetEmphasis: (e) => w(t, e),
772
1526
  children: a(e, n)
773
1527
  }, t))]
774
1528
  })
775
1529
  })
776
1530
  })] });
777
1531
  }
778
- var $e = [
1532
+ var zt = [
779
1533
  "SMALL",
780
1534
  "MEDIUM",
781
1535
  "LARGE"
782
- ], et = {
1536
+ ], Bt = {
783
1537
  SMALL: {
784
1538
  key: "bento.layout.size.small",
785
1539
  def: "Small"
@@ -793,29 +1547,29 @@ var $e = [
793
1547
  def: "Large"
794
1548
  }
795
1549
  };
796
- function tt({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
797
- let { t: a } = R(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = Ae({ id: t }), f = {
798
- transform: je.Translate.toString(l),
1550
+ function Vt({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
1551
+ let { t: a } = U(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = Ke({ id: t }), f = {
1552
+ transform: qe.Translate.toString(l),
799
1553
  transition: u,
800
1554
  opacity: d ? .6 : 1,
801
1555
  zIndex: d ? 50 : void 0
802
1556
  };
803
- return /* @__PURE__ */ L("div", {
1557
+ return /* @__PURE__ */ H("div", {
804
1558
  ref: c,
805
1559
  style: f,
806
- className: e("relative h-full", Ue[n]),
807
- children: [/* @__PURE__ */ I("div", {
1560
+ className: e("relative h-full", xt[n]),
1561
+ children: [/* @__PURE__ */ V("div", {
808
1562
  className: "pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full",
809
1563
  children: i
810
- }), /* @__PURE__ */ L("div", {
1564
+ }), /* @__PURE__ */ H("div", {
811
1565
  className: "absolute right-2 top-2 z-10 flex items-center gap-1",
812
- children: [/* @__PURE__ */ I("div", {
1566
+ children: [/* @__PURE__ */ V("div", {
813
1567
  role: "group",
814
1568
  "aria-label": a("bento.layout.sizeGroup", { defaultValue: "Tile size" }),
815
1569
  className: "flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur",
816
- children: $e.map((t) => {
817
- let i = t === n, o = a(et[t].key, { defaultValue: et[t].def });
818
- return /* @__PURE__ */ I("button", {
1570
+ children: zt.map((t) => {
1571
+ let i = t === n, o = a(Bt[t].key, { defaultValue: Bt[t].def });
1572
+ return /* @__PURE__ */ V("button", {
819
1573
  type: "button",
820
1574
  onClick: () => r(t),
821
1575
  "aria-pressed": i,
@@ -825,13 +1579,13 @@ function tt({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
825
1579
  children: o.charAt(0)
826
1580
  }, t);
827
1581
  })
828
- }), /* @__PURE__ */ I("button", {
1582
+ }), /* @__PURE__ */ V("button", {
829
1583
  type: "button",
830
1584
  ...o,
831
1585
  ...s,
832
1586
  "aria-label": a("bento.layout.dragToReorder", { defaultValue: "Drag to reorder" }),
833
1587
  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",
834
- children: /* @__PURE__ */ I(le, {
1588
+ children: /* @__PURE__ */ V(ge, {
835
1589
  size: 14,
836
1590
  className: "text-muted-foreground"
837
1591
  })
@@ -839,35 +1593,35 @@ function tt({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
839
1593
  })]
840
1594
  });
841
1595
  }
842
- function nt({ route: e, label: t, subtitle: n, chip: r }) {
843
- let { t: i } = R();
844
- return /* @__PURE__ */ L(K, {
1596
+ function Ht({ route: e, label: t, subtitle: n, chip: r }) {
1597
+ let { t: i } = U();
1598
+ return /* @__PURE__ */ H(Z, {
845
1599
  to: e,
846
1600
  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",
847
- children: [/* @__PURE__ */ L("div", {
1601
+ children: [/* @__PURE__ */ H("div", {
848
1602
  className: "flex items-center gap-3",
849
- children: [/* @__PURE__ */ I("span", {
1603
+ children: [/* @__PURE__ */ V("span", {
850
1604
  className: `bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,
851
- children: /* @__PURE__ */ I(he, { size: 20 })
852
- }), /* @__PURE__ */ I("span", {
1605
+ children: /* @__PURE__ */ V(xe, { size: 20 })
1606
+ }), /* @__PURE__ */ V("span", {
853
1607
  className: "text-[11px] uppercase tracking-wider text-muted-foreground",
854
1608
  children: i("forms.formActions.new", { defaultValue: "New" })
855
1609
  })]
856
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("div", {
1610
+ }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("div", {
857
1611
  className: "text-base font-semibold tracking-tight md:text-lg",
858
- children: /* @__PURE__ */ I("span", {
1612
+ children: /* @__PURE__ */ V("span", {
859
1613
  className: `${r} bg-clip-text text-transparent`,
860
1614
  children: t
861
1615
  })
862
- }), n && /* @__PURE__ */ I("p", {
1616
+ }), n && /* @__PURE__ */ V("p", {
863
1617
  className: "mt-1 text-sm text-muted-foreground",
864
1618
  children: n
865
1619
  })] })]
866
1620
  });
867
1621
  }
868
- function rt({ title: e, description: t }) {
869
- return /* @__PURE__ */ I(Ie, {
870
- icon: U,
1622
+ function Ut({ title: e, description: t }) {
1623
+ return /* @__PURE__ */ V(it, {
1624
+ icon: Ce,
871
1625
  title: e,
872
1626
  description: t,
873
1627
  align: "start",
@@ -876,137 +1630,138 @@ function rt({ title: e, description: t }) {
876
1630
  }
877
1631
  //#endregion
878
1632
  //#region src/bento/bento-save-bar.tsx
879
- function Q({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: a, dirty: o, titleMissing: s }) {
880
- let { t: c } = R();
881
- return /* @__PURE__ */ L("div", {
1633
+ function Wt({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: o, dirty: s, titleMissing: c }) {
1634
+ let { t: l } = U();
1635
+ return /* @__PURE__ */ H("div", {
882
1636
  className: "bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl",
883
- children: [/* @__PURE__ */ L("div", {
1637
+ children: [/* @__PURE__ */ H("div", {
884
1638
  className: "flex min-w-0 items-center gap-3",
885
1639
  children: [
886
- e && /* @__PURE__ */ I("p", {
1640
+ e && /* @__PURE__ */ V("p", {
887
1641
  className: "truncate text-base font-semibold tracking-tight md:text-lg",
888
1642
  children: e
889
1643
  }),
890
- /* @__PURE__ */ I(ze, {
891
- titleMissing: s,
892
- dirty: o
1644
+ /* @__PURE__ */ V(lt, {
1645
+ titleMissing: c,
1646
+ dirty: s
893
1647
  }),
894
- t && /* @__PURE__ */ I("div", {
1648
+ t && /* @__PURE__ */ V("div", {
895
1649
  className: "flex shrink-0 items-center gap-1.5",
896
1650
  children: t
897
1651
  })
898
1652
  ]
899
- }), /* @__PURE__ */ I("div", {
1653
+ }), /* @__PURE__ */ V("div", {
900
1654
  className: "flex shrink-0 gap-2",
901
- children: n ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(_, {
1655
+ children: n ?? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H(a, {
902
1656
  type: "submit",
903
1657
  size: "sm",
904
1658
  loading: i,
905
- disabled: a,
906
- children: [/* @__PURE__ */ I(H, { className: "size-4" }), c("forms.formActions.saveChanges")]
907
- }), r && /* @__PURE__ */ L(_, {
1659
+ "aria-disabled": o ? "true" : void 0,
1660
+ children: [/* @__PURE__ */ V(he, { className: "size-4" }), l("forms.formActions.saveChanges")]
1661
+ }), r && /* @__PURE__ */ H(a, {
908
1662
  type: "button",
909
1663
  variant: "outline",
910
1664
  size: "sm",
911
1665
  onClick: r,
912
- children: [/* @__PURE__ */ I(W, { className: "size-4" }), c("forms.formActions.cancel")]
1666
+ children: [/* @__PURE__ */ V(Oe, { className: "size-4" }), l("forms.formActions.cancel")]
913
1667
  })] })
914
1668
  })]
915
1669
  });
916
1670
  }
917
- function it({ children: e }) {
918
- return /* @__PURE__ */ I("span", {
1671
+ function Gt({ children: e }) {
1672
+ return /* @__PURE__ */ V("span", {
919
1673
  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",
920
1674
  children: e
921
1675
  });
922
1676
  }
923
- Q.Badge = it;
1677
+ Wt.Badge = Gt;
924
1678
  //#endregion
925
1679
  //#region src/bento/bento-scroll-save-bar.tsx
926
- function at(e) {
927
- let t = N(null);
928
- return Be(t), /* @__PURE__ */ L(F, { children: [
929
- /* @__PURE__ */ I("div", {
1680
+ function Kt(e) {
1681
+ let t = R(null);
1682
+ return ut(t), /* @__PURE__ */ H(B, { children: [
1683
+ /* @__PURE__ */ V("div", {
930
1684
  ref: t,
931
1685
  "aria-hidden": !0,
932
1686
  className: "h-px"
933
1687
  }),
934
- /* @__PURE__ */ I("div", {
1688
+ /* @__PURE__ */ V("div", {
935
1689
  "aria-hidden": !0,
936
1690
  className: "bento-save-bar-spacer"
937
1691
  }),
938
- /* @__PURE__ */ I("div", {
1692
+ /* @__PURE__ */ V("div", {
939
1693
  className: "bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8",
940
- children: /* @__PURE__ */ I(Q, { ...e })
1694
+ children: /* @__PURE__ */ V(Wt, { ...e })
941
1695
  })
942
1696
  ] });
943
1697
  }
944
1698
  //#endregion
945
1699
  //#region src/bento/bento-form-hero.tsx
946
- function ot({ 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 }) {
947
- let { t: h } = R(), g = f ?? (!!d || !u);
948
- return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(Z, {
949
- eyebrow: t === void 0 ? e : /* @__PURE__ */ I(X, {
1700
+ function qt({ eyebrow: e, backTo: t, backLabel: n, leading: r, title: i, subtitle: o, trailing: s, onCancel: c, actions: l, loading: u, dirty: d, titleMissing: f, saveDisabled: p, stickyTitle: m, stickyBadges: h }) {
1701
+ let { t: g } = U(), _ = p ?? (!!f || !d);
1702
+ return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(ot, {
1703
+ eyebrow: t === void 0 ? e : /* @__PURE__ */ V(at, {
950
1704
  to: t,
951
1705
  children: n
952
1706
  }),
953
1707
  leading: r,
954
1708
  title: i,
955
- subtitle: a,
956
- trailing: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1709
+ subtitle: o,
1710
+ trailing: /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
957
1711
  className: "bento-fade-out flex shrink-0 items-center gap-2",
958
- children: c ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(_, {
1712
+ children: l ?? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H(a, {
959
1713
  type: "submit",
960
1714
  size: "sm",
961
- loading: l,
962
- disabled: g,
963
- children: [/* @__PURE__ */ I(H, { className: "size-4" }), h("forms.formActions.saveChanges")]
964
- }), /* @__PURE__ */ L(_, {
1715
+ loading: u,
1716
+ "aria-disabled": _ ? "true" : void 0,
1717
+ children: [/* @__PURE__ */ V(he, { className: "size-4" }), g("forms.formActions.saveChanges")]
1718
+ }), /* @__PURE__ */ H(a, {
965
1719
  type: "button",
966
1720
  variant: "outline",
967
1721
  size: "sm",
968
- onClick: s,
969
- children: [/* @__PURE__ */ I(W, { className: "size-4" }), h("forms.formActions.cancel")]
1722
+ onClick: c,
1723
+ children: [/* @__PURE__ */ V(Oe, { className: "size-4" }), g("forms.formActions.cancel")]
970
1724
  })] })
971
- }), o] })
972
- }), /* @__PURE__ */ I(at, {
973
- title: p,
974
- badges: m,
975
- actions: c,
976
- onCancel: s,
977
- loading: l,
978
- disabled: g,
979
- dirty: u,
980
- titleMissing: d
1725
+ }), s] })
1726
+ }), /* @__PURE__ */ V(Kt, {
1727
+ title: m,
1728
+ badges: h,
1729
+ actions: l,
1730
+ onCancel: c,
1731
+ loading: u,
1732
+ disabled: _,
1733
+ dirty: d,
1734
+ titleMissing: f
981
1735
  })] });
982
1736
  }
983
1737
  //#endregion
984
1738
  //#region src/bento/bento-form-section.tsx
985
- function st({ icon: t, tone: n, title: r, description: i, children: a, trailing: o, as: s = "h2", className: c }) {
986
- return /* @__PURE__ */ L("section", {
987
- className: e("bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6", c),
988
- children: [/* @__PURE__ */ L("header", {
1739
+ var Jt = "bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6";
1740
+ function Yt({ icon: t, tone: n, title: r, description: i, children: a, trailing: o, as: s = "h2", className: c }) {
1741
+ return /* @__PURE__ */ H("section", {
1742
+ className: e(Jt, c),
1743
+ children: [/* @__PURE__ */ H("header", {
989
1744
  className: "flex items-start justify-between gap-3",
990
- children: [/* @__PURE__ */ L("div", {
1745
+ children: [/* @__PURE__ */ H("div", {
991
1746
  className: "flex items-center gap-3",
992
- children: [/* @__PURE__ */ I("span", {
993
- className: `grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${Y(n)}`,
994
- children: /* @__PURE__ */ I(t, { size: 20 })
995
- }), /* @__PURE__ */ L("div", {
1747
+ children: [/* @__PURE__ */ V("span", {
1748
+ className: `grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${Q(n)}`,
1749
+ children: /* @__PURE__ */ V(t, { size: 20 })
1750
+ }), /* @__PURE__ */ H("div", {
996
1751
  className: "flex flex-col gap-0.5",
997
- children: [/* @__PURE__ */ I(s, {
1752
+ children: [/* @__PURE__ */ V(s, {
998
1753
  className: "text-base font-semibold tracking-tight md:text-lg",
999
1754
  children: r
1000
- }), i && /* @__PURE__ */ I("p", {
1755
+ }), i && /* @__PURE__ */ V("p", {
1001
1756
  className: "text-sm text-muted-foreground",
1002
1757
  children: i
1003
1758
  })]
1004
1759
  })]
1005
- }), o && /* @__PURE__ */ I("div", {
1760
+ }), o && /* @__PURE__ */ V("div", {
1006
1761
  className: "shrink-0",
1007
1762
  children: o
1008
1763
  })]
1009
- }), /* @__PURE__ */ I("div", {
1764
+ }), /* @__PURE__ */ V("div", {
1010
1765
  className: "flex flex-col gap-5",
1011
1766
  children: a
1012
1767
  })]
@@ -1014,10 +1769,10 @@ function st({ icon: t, tone: n, title: r, description: i, children: a, trailing:
1014
1769
  }
1015
1770
  //#endregion
1016
1771
  //#region src/bento/bento-panel.tsx
1017
- function ct({ children: t, className: n, contentClassName: r }) {
1018
- return /* @__PURE__ */ I("div", {
1772
+ function Xt({ children: t, className: n, contentClassName: r }) {
1773
+ return /* @__PURE__ */ V("div", {
1019
1774
  className: e("bento-glass rounded-2xl shadow-md", n),
1020
- children: /* @__PURE__ */ I("div", {
1775
+ children: /* @__PURE__ */ V("div", {
1021
1776
  className: r,
1022
1777
  children: t
1023
1778
  })
@@ -1025,46 +1780,46 @@ function ct({ children: t, className: n, contentClassName: r }) {
1025
1780
  }
1026
1781
  //#endregion
1027
1782
  //#region src/bento/bento-back-to-top.tsx
1028
- var lt = 480;
1029
- function ut(e) {
1783
+ var Zt = 480;
1784
+ function Qt(e) {
1030
1785
  return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
1031
1786
  }
1032
- function dt() {
1033
- return window.scrollY > lt;
1787
+ function $t() {
1788
+ return window.scrollY > Zt;
1034
1789
  }
1035
- function ft() {
1036
- let { t: e } = R(), t = ee(ut, dt, () => !1);
1037
- return /* @__PURE__ */ I("button", {
1790
+ function en({ inline: e = !1 } = {}) {
1791
+ let { t } = U(), n = w(), r = e || n, i = ie(Qt, $t, () => !1);
1792
+ return /* @__PURE__ */ V("button", {
1038
1793
  type: "button",
1039
- "aria-label": e("bento.backToTop", { defaultValue: "Back to top" }),
1040
- tabIndex: t ? 0 : -1,
1794
+ "aria-label": t("bento.backToTop", { defaultValue: "Back to top" }),
1795
+ tabIndex: i ? 0 : -1,
1041
1796
  onClick: () => window.scrollTo({
1042
1797
  top: 0,
1043
1798
  behavior: "smooth"
1044
1799
  }),
1045
- 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 ${t ? "translate-y-0 scale-100 opacity-100" : "pointer-events-none translate-y-4 scale-90 opacity-0"}`,
1046
- children: /* @__PURE__ */ I(ie, { size: 18 })
1800
+ className: `${r ? "relative" : "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 ${i ? "pointer-events-auto translate-y-0 scale-100 opacity-100" : "pointer-events-none translate-y-4 scale-90 opacity-0"}`,
1801
+ children: /* @__PURE__ */ V(ue, { size: 18 })
1047
1802
  });
1048
1803
  }
1049
1804
  //#endregion
1050
1805
  //#region src/bento/bento-nav.ts
1051
- function pt(e) {
1806
+ function tn(e) {
1052
1807
  return e.bentoRoute ?? e.fallbackRoute;
1053
1808
  }
1054
1809
  //#endregion
1055
1810
  //#region src/bento/bento-command-palette.tsx
1056
- function mt({ label: e, children: t }) {
1057
- return e ? /* @__PURE__ */ L("div", {
1811
+ function nn({ label: e, children: t }) {
1812
+ return e ? /* @__PURE__ */ H("div", {
1058
1813
  role: "group",
1059
1814
  "aria-label": e,
1060
- children: [/* @__PURE__ */ I("p", {
1815
+ children: [/* @__PURE__ */ V("p", {
1061
1816
  className: "px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground",
1062
1817
  children: e
1063
1818
  }), t]
1064
- }) : /* @__PURE__ */ I(F, { children: t });
1819
+ }) : /* @__PURE__ */ V(B, { children: t });
1065
1820
  }
1066
- function ht({ index: e, active: t, icon: n, label: r, description: i, trailing: a, onActivate: o, onChoose: s }) {
1067
- return /* @__PURE__ */ L("button", {
1821
+ function rn({ index: e, active: t, icon: n, label: r, description: i, trailing: a, onActivate: o, onChoose: s }) {
1822
+ return /* @__PURE__ */ H("button", {
1068
1823
  type: "button",
1069
1824
  id: `bento-palette-opt-${e}`,
1070
1825
  "data-index": e,
@@ -1074,18 +1829,18 @@ function ht({ index: e, active: t, icon: n, label: r, description: i, trailing:
1074
1829
  onClick: s,
1075
1830
  className: `flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${t ? "bg-accent text-accent-foreground" : "text-foreground"}`,
1076
1831
  children: [
1077
- n && /* @__PURE__ */ I(n, {
1832
+ n && /* @__PURE__ */ V(n, {
1078
1833
  size: 18,
1079
1834
  className: "shrink-0 text-muted-foreground"
1080
1835
  }),
1081
- /* @__PURE__ */ L("span", {
1836
+ /* @__PURE__ */ H("span", {
1082
1837
  className: "flex-1 truncate",
1083
- children: [r, i && /* @__PURE__ */ I("span", {
1838
+ children: [r, i && /* @__PURE__ */ V("span", {
1084
1839
  className: "ml-2 text-muted-foreground",
1085
1840
  children: i
1086
1841
  })]
1087
1842
  }),
1088
- a ?? (t && /* @__PURE__ */ I(re, {
1843
+ a ?? (t && /* @__PURE__ */ V(le, {
1089
1844
  "aria-hidden": !0,
1090
1845
  size: 15,
1091
1846
  className: "shrink-0 text-muted-foreground"
@@ -1093,12 +1848,12 @@ function ht({ index: e, active: t, icon: n, label: r, description: i, trailing:
1093
1848
  ]
1094
1849
  });
1095
1850
  }
1096
- function gt({ open: e, onOpenChange: r, items: a, group: o, onQueryChange: s }) {
1097
- let { t: c } = R(), l = q(), [u, d] = P(""), [p, m] = P(0), h = N(null), g = M(() => {
1098
- let e = u.trim().toLowerCase(), t = a.map((e) => ({
1851
+ function an({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c }) {
1852
+ let { t: l } = U(), u = Me(), [d, f] = z(""), [p, m] = z(0), h = R(null), g = L(() => {
1853
+ let e = d.trim().toLowerCase(), t = a.map((e) => ({
1099
1854
  item: e,
1100
- label: c(e.titleKey),
1101
- description: c(e.descriptionKey)
1855
+ label: l(e.titleKey),
1856
+ description: l(e.descriptionKey)
1102
1857
  }));
1103
1858
  if (!e) return t;
1104
1859
  let n = [], r = [];
@@ -1106,28 +1861,28 @@ function gt({ open: e, onOpenChange: r, items: a, group: o, onQueryChange: s })
1106
1861
  return [...n, ...r];
1107
1862
  }, [
1108
1863
  a,
1109
- u,
1110
- c
1111
- ]), _ = M(() => [...g.map((e) => ({
1864
+ d,
1865
+ l
1866
+ ]), _ = L(() => [...g.map((e) => ({
1112
1867
  kind: "nav",
1113
1868
  entry: e
1114
1869
  })), ...(o?.items ?? []).map((e) => ({
1115
1870
  kind: "supplied",
1116
1871
  item: e
1117
- }))], [g, o]), v = N(s);
1118
- j(() => {
1119
- v.current = s;
1120
- }), j(() => {
1121
- v.current?.(u);
1122
- }, [u]);
1123
- let [y, b] = P(e);
1124
- e !== y && (b(e), e && (d(""), m(0)));
1872
+ }))], [g, o]), v = R(c);
1873
+ F(() => {
1874
+ v.current = c;
1875
+ }), F(() => {
1876
+ v.current?.(d);
1877
+ }, [d]);
1878
+ let [y, b] = z(e);
1879
+ e !== y && (b(e), e && (f(""), m(0)));
1125
1880
  let x = _.length === 0 ? 0 : _.length - 1;
1126
- p > x && m(x), j(() => {
1881
+ p > x && m(x), F(() => {
1127
1882
  (h.current?.querySelector(`[data-index="${p}"]`))?.scrollIntoView({ block: "nearest" });
1128
1883
  }, [p]);
1129
1884
  function S(e) {
1130
- r(!1), e.kind === "nav" ? l(pt(e.entry.item)) : o?.onSelect(e.item);
1885
+ t(!1), e.kind === "nav" ? u(tn(e.entry.item)) : o?.onSelect(e.item);
1131
1886
  }
1132
1887
  function C(e) {
1133
1888
  if (e.key === "ArrowDown") e.preventDefault(), m((e) => _.length === 0 ? 0 : (e + 1) % _.length);
@@ -1138,75 +1893,75 @@ function gt({ open: e, onOpenChange: r, items: a, group: o, onQueryChange: s })
1138
1893
  t && S(t);
1139
1894
  }
1140
1895
  }
1141
- return /* @__PURE__ */ I(n, {
1896
+ return /* @__PURE__ */ V(n, {
1142
1897
  open: e,
1143
- onOpenChange: r,
1144
- children: /* @__PURE__ */ L(f, {
1898
+ onOpenChange: t,
1899
+ children: /* @__PURE__ */ H(s, {
1145
1900
  showCloseButton: !1,
1146
1901
  className: "top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0",
1147
1902
  onKeyDown: C,
1148
1903
  children: [
1149
- /* @__PURE__ */ I(i, {
1904
+ /* @__PURE__ */ V(i, {
1150
1905
  className: "sr-only",
1151
- children: c("bento.palette.title", { defaultValue: "Command palette" })
1906
+ children: l("bento.palette.title", { defaultValue: "Command palette" })
1152
1907
  }),
1153
- /* @__PURE__ */ I(t, {
1908
+ /* @__PURE__ */ V(r, {
1154
1909
  className: "sr-only",
1155
- children: c("bento.palette.description", { defaultValue: "Search and jump to any area" })
1910
+ children: l("bento.palette.description", { defaultValue: "Search and jump to any area" })
1156
1911
  }),
1157
- /* @__PURE__ */ L("div", {
1912
+ /* @__PURE__ */ H("div", {
1158
1913
  className: "flex items-center gap-3 border-b border-border/60 px-4",
1159
- children: [/* @__PURE__ */ I(ge, {
1914
+ children: [/* @__PURE__ */ V(Se, {
1160
1915
  size: 18,
1161
1916
  className: "shrink-0 text-muted-foreground"
1162
- }), /* @__PURE__ */ I("input", {
1917
+ }), /* @__PURE__ */ V("input", {
1163
1918
  autoFocus: !0,
1164
1919
  type: "text",
1165
1920
  role: "combobox",
1166
1921
  "aria-expanded": "true",
1167
1922
  "aria-controls": "bento-palette-list",
1168
1923
  "aria-activedescendant": _[p] ? `bento-palette-opt-${p}` : void 0,
1169
- value: u,
1170
- onChange: (e) => d(e.target.value),
1171
- placeholder: c("bento.palette.placeholder", { defaultValue: "Search areas…" }),
1924
+ value: d,
1925
+ onChange: (e) => f(e.target.value),
1926
+ placeholder: l("bento.palette.placeholder", { defaultValue: "Search areas…" }),
1172
1927
  className: "h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
1173
1928
  })]
1174
1929
  }),
1175
- /* @__PURE__ */ L("div", {
1930
+ /* @__PURE__ */ H("div", {
1176
1931
  ref: h,
1177
1932
  id: "bento-palette-list",
1178
1933
  role: "listbox",
1179
- "aria-label": c("bento.palette.title", { defaultValue: "Command palette" }),
1934
+ "aria-label": l("bento.palette.title", { defaultValue: "Command palette" }),
1180
1935
  className: "max-h-80 overflow-y-auto p-2",
1181
1936
  children: [
1182
- _.length === 0 && !o?.pending && /* @__PURE__ */ I("p", {
1937
+ _.length === 0 && !o?.pending && /* @__PURE__ */ V("p", {
1183
1938
  className: "px-3 py-6 text-center text-sm text-muted-foreground",
1184
- children: c("bento.palette.noResults", { defaultValue: "No matches" })
1939
+ children: l("bento.palette.noResults", { defaultValue: "No matches" })
1185
1940
  }),
1186
- /* @__PURE__ */ I(mt, {
1187
- label: o && g.length > 0 ? c("bento.palette.areas", { defaultValue: "Areas" }) : void 0,
1188
- children: g.map(({ item: e, label: t }, n) => /* @__PURE__ */ I(ht, {
1941
+ /* @__PURE__ */ V(nn, {
1942
+ label: o && g.length > 0 ? l("bento.palette.areas", { defaultValue: "Areas" }) : void 0,
1943
+ children: g.map(({ item: e, label: t }, n) => /* @__PURE__ */ V(rn, {
1189
1944
  index: n,
1190
1945
  active: n === p,
1191
1946
  icon: e.icon,
1192
1947
  label: t,
1193
1948
  onActivate: () => m(n),
1194
1949
  onChoose: () => S(_[n]),
1195
- trailing: e.bentoRoute ? void 0 : /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(ce, {
1950
+ trailing: e.bentoRoute ? void 0 : /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(J, {
1196
1951
  "aria-hidden": !0,
1197
1952
  size: 15,
1198
1953
  className: "shrink-0 text-muted-foreground/70"
1199
- }), /* @__PURE__ */ I("span", {
1954
+ }), /* @__PURE__ */ V("span", {
1200
1955
  className: "sr-only",
1201
- children: c("bento.palette.opensConsole", { defaultValue: "Opens in console" })
1956
+ children: l("bento.palette.opensConsole", { defaultValue: "Opens in console" })
1202
1957
  })] })
1203
1958
  }, e.id))
1204
1959
  }),
1205
- o && /* @__PURE__ */ L(mt, {
1960
+ o && /* @__PURE__ */ H(nn, {
1206
1961
  label: o.label,
1207
1962
  children: [o.items.map((e, t) => {
1208
1963
  let n = g.length + t;
1209
- return /* @__PURE__ */ I(ht, {
1964
+ return /* @__PURE__ */ V(rn, {
1210
1965
  index: n,
1211
1966
  active: n === p,
1212
1967
  icon: e.icon,
@@ -1215,9 +1970,9 @@ function gt({ open: e, onOpenChange: r, items: a, group: o, onQueryChange: s })
1215
1970
  onActivate: () => m(n),
1216
1971
  onChoose: () => S(_[n])
1217
1972
  }, e.id);
1218
- }), o.pending && /* @__PURE__ */ I("p", {
1973
+ }), o.pending && /* @__PURE__ */ V("p", {
1219
1974
  className: "px-3 py-2.5 text-sm text-muted-foreground",
1220
- children: c("bento.palette.searching", { defaultValue: "Searching…" })
1975
+ children: l("bento.palette.searching", { defaultValue: "Searching…" })
1221
1976
  })]
1222
1977
  })
1223
1978
  ]
@@ -1227,65 +1982,233 @@ function gt({ open: e, onOpenChange: r, items: a, group: o, onQueryChange: s })
1227
1982
  });
1228
1983
  }
1229
1984
  //#endregion
1985
+ //#region src/bento/bento-shell.tsx
1986
+ function on({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock: a, backToTop: o = !0, children: s }) {
1987
+ let { t: c } = U(), l = Ae(), u = I(), d = R(null), f = R(null), p = i === "full", m = n != null || r != null, h = o || a != null;
1988
+ return /* @__PURE__ */ H("div", {
1989
+ "data-slot": "bento-shell",
1990
+ className: e("relative w-full bg-background text-foreground", t != null && "bento-rail-gutter", p ? "flex h-svh flex-col overflow-hidden" : "min-h-svh"),
1991
+ children: [
1992
+ /* @__PURE__ */ V("a", {
1993
+ href: `#${u}`,
1994
+ onClick: (e) => {
1995
+ e.preventDefault(), d.current?.focus();
1996
+ },
1997
+ className: "sr-only rounded-full border border-border/60 bg-card px-4 py-2 text-sm shadow-lg focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[60]",
1998
+ children: c("bento.shell.skip", { defaultValue: "Skip to content" })
1999
+ }),
2000
+ /* @__PURE__ */ V("span", {
2001
+ ref: f,
2002
+ role: "status",
2003
+ "aria-live": "polite",
2004
+ className: "sr-only"
2005
+ }),
2006
+ l && /* @__PURE__ */ V(sn, {
2007
+ main: d,
2008
+ announcer: f
2009
+ }),
2010
+ t,
2011
+ m && /* @__PURE__ */ H("header", {
2012
+ className: "bento-shell-header bento-shell-bar sticky top-0 z-30 flex shrink-0 items-center justify-between gap-3 border-b border-border/40 bg-background/55 py-3 backdrop-blur-xl backdrop-saturate-150",
2013
+ children: [/* @__PURE__ */ V("div", {
2014
+ className: "flex min-w-0 items-center gap-3",
2015
+ children: n
2016
+ }), /* @__PURE__ */ V("div", {
2017
+ className: "flex items-center gap-2",
2018
+ children: r
2019
+ })]
2020
+ }),
2021
+ /* @__PURE__ */ V("main", {
2022
+ ref: d,
2023
+ id: u,
2024
+ tabIndex: -1,
2025
+ "aria-label": c("bento.shell.main", { defaultValue: "Main content" }),
2026
+ "data-column": i,
2027
+ className: "bento-shell-main",
2028
+ children: s
2029
+ }),
2030
+ h && /* @__PURE__ */ V("div", {
2031
+ "data-slot": "bento-shell-corner",
2032
+ className: "pointer-events-none fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",
2033
+ children: /* @__PURE__ */ H(k.Provider, {
2034
+ value: !0,
2035
+ children: [o && /* @__PURE__ */ V(en, {}), a]
2036
+ })
2037
+ })
2038
+ ]
2039
+ });
2040
+ }
2041
+ function sn({ main: e, announcer: t }) {
2042
+ let { pathname: n } = je(), r = R(n);
2043
+ return F(() => {
2044
+ if (r.current === n) return;
2045
+ r.current = n;
2046
+ let i = 0, a, o = () => {
2047
+ let n = e.current?.querySelector("h1") ?? null;
2048
+ if (!n && i++ < 20) {
2049
+ a = setTimeout(o, 50);
2050
+ return;
2051
+ }
2052
+ n && !n.hasAttribute("tabindex") && n.setAttribute("tabindex", "-1"), (n ?? e.current)?.focus(), t.current && (t.current.textContent = n?.textContent?.trim() || document.title);
2053
+ };
2054
+ return o(), () => clearTimeout(a);
2055
+ }, [
2056
+ n,
2057
+ e,
2058
+ t
2059
+ ]), null;
2060
+ }
2061
+ //#endregion
2062
+ //#region src/bento/bento-shell-shortcuts.ts
2063
+ var cn = Object.freeze([
2064
+ {
2065
+ action: "palette",
2066
+ key: "k",
2067
+ mod: !0
2068
+ },
2069
+ {
2070
+ action: "palette",
2071
+ key: "/"
2072
+ },
2073
+ {
2074
+ action: "shortcuts",
2075
+ key: "?"
2076
+ }
2077
+ ]);
2078
+ function ln() {
2079
+ return typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
2080
+ }
2081
+ function un(e, t) {
2082
+ let n = e.key.length === 1 ? e.key.toUpperCase() : e.key;
2083
+ return e.mod ? [t ? "⌘" : "Ctrl", n] : [n];
2084
+ }
2085
+ function dn(e) {
2086
+ if (!(e instanceof HTMLElement)) return !1;
2087
+ if ([
2088
+ "INPUT",
2089
+ "TEXTAREA",
2090
+ "SELECT"
2091
+ ].includes(e.tagName) || e.isContentEditable) return !0;
2092
+ let t = e.closest("[contenteditable]");
2093
+ return t !== null && t.getAttribute("contenteditable") !== "false";
2094
+ }
2095
+ function fn(e, t) {
2096
+ if (e.defaultPrevented || e.isComposing || e.repeat) return;
2097
+ let n = e.key.toLowerCase();
2098
+ return cn.find((r) => n === r.key ? r.mod ? (t ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey) && !e.altKey && !e.shiftKey : e.metaKey || dn(e.target) ? !1 : e.ctrlKey === e.altKey : !1);
2099
+ }
2100
+ function pn({ onPalette: e, onShortcuts: t, isMac: n = ln() }) {
2101
+ let r = R({
2102
+ onPalette: e,
2103
+ onShortcuts: t
2104
+ });
2105
+ F(() => {
2106
+ r.current = {
2107
+ onPalette: e,
2108
+ onShortcuts: t
2109
+ };
2110
+ }), F(() => {
2111
+ function e(e) {
2112
+ let t = fn(e, n), i = t?.action === "palette" ? r.current.onPalette : t && r.current.onShortcuts;
2113
+ i && (e.preventDefault(), i());
2114
+ }
2115
+ return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
2116
+ }, [n]);
2117
+ }
2118
+ //#endregion
2119
+ //#region src/bento/bento-palette-trigger.tsx
2120
+ function mn({ onClick: t, isMac: n = ln(), className: r }) {
2121
+ let { t: i } = U(), a = cn.filter((e) => e.action === "palette"), o = a.find((e) => e.mod);
2122
+ return /* @__PURE__ */ H("button", {
2123
+ type: "button",
2124
+ onClick: t,
2125
+ "aria-keyshortcuts": a.map((e) => e.mod ? `${n ? "Meta" : "Control"}+${e.key.toUpperCase()}` : e.key).join(" "),
2126
+ className: e("bento-tile bento-tile-clickable inline-flex items-center gap-2 rounded-full border border-border/60 bg-card/60 py-1.5 pl-3 pr-2 text-sm text-muted-foreground backdrop-blur hover:text-foreground", r),
2127
+ children: [
2128
+ /* @__PURE__ */ V(Se, {
2129
+ "aria-hidden": !0,
2130
+ size: 16
2131
+ }),
2132
+ /* @__PURE__ */ V("span", {
2133
+ className: "sr-only sm:not-sr-only",
2134
+ children: i("bento.palette.search", { defaultValue: "Search" })
2135
+ }),
2136
+ o && /* @__PURE__ */ V("kbd", {
2137
+ "aria-hidden": !0,
2138
+ className: "hidden rounded border border-border/60 bg-muted px-1.5 py-0.5 text-[10px] font-medium tracking-wide sm:inline",
2139
+ children: un(o, n).join(n ? "" : " ")
2140
+ })
2141
+ ]
2142
+ });
2143
+ }
2144
+ //#endregion
1230
2145
  //#region src/bento/bento-shortcuts-dialog.tsx
1231
- function _t({ open: e, onOpenChange: r, isMac: o }) {
1232
- let { t: s } = R(), c = o ? "⌘" : "Ctrl", l = [{
1233
- heading: s("bento.shortcuts.global", { defaultValue: "Global" }),
1234
- rows: [{
1235
- keys: [c, "K"],
1236
- label: s("bento.palette.open", { defaultValue: "Open command palette" })
1237
- }, {
1238
- keys: ["?"],
1239
- label: s("bento.shortcuts.openGuide", { defaultValue: "Show keyboard shortcuts" })
1240
- }]
2146
+ function hn({ open: e, onOpenChange: t, isMac: a = ln() }) {
2147
+ let { t: c } = U(), l = {
2148
+ palette: c("bento.palette.open", { defaultValue: "Open command palette" }),
2149
+ shortcuts: c("bento.shortcuts.openGuide", { defaultValue: "Show keyboard shortcuts" })
2150
+ }, u = [...new Set(cn.map((e) => e.action))], d = [{
2151
+ heading: c("bento.shortcuts.global", { defaultValue: "Global" }),
2152
+ rows: u.map((e) => ({
2153
+ id: e,
2154
+ label: l[e],
2155
+ combos: cn.filter((t) => t.action === e).map((e) => un(e, a))
2156
+ }))
1241
2157
  }, {
1242
- heading: s("bento.shortcuts.palette", { defaultValue: "Command palette" }),
2158
+ heading: c("bento.shortcuts.palette", { defaultValue: "Command palette" }),
1243
2159
  rows: [
1244
2160
  {
1245
- keys: ["↑", "↓"],
1246
- label: s("bento.shortcuts.navigate", { defaultValue: "Move between results" })
2161
+ id: "navigate",
2162
+ combos: [["↑", "↓"]],
2163
+ label: c("bento.shortcuts.navigate", { defaultValue: "Move between results" })
1247
2164
  },
1248
2165
  {
1249
- keys: ["↵"],
1250
- label: s("bento.shortcuts.openSelected", { defaultValue: "Open the selected area" })
2166
+ id: "open",
2167
+ combos: [["↵"]],
2168
+ label: c("bento.shortcuts.openSelected", { defaultValue: "Open the selected area" })
1251
2169
  },
1252
2170
  {
1253
- keys: ["Esc"],
1254
- label: s("bento.shortcuts.dismiss", { defaultValue: "Close the palette or a dialog" })
2171
+ id: "dismiss",
2172
+ combos: [["Esc"]],
2173
+ label: c("bento.shortcuts.dismiss", { defaultValue: "Close the palette or a dialog" })
1255
2174
  }
1256
2175
  ]
1257
2176
  }];
1258
- return /* @__PURE__ */ I(n, {
2177
+ return /* @__PURE__ */ V(n, {
1259
2178
  open: e,
1260
- onOpenChange: r,
1261
- children: /* @__PURE__ */ L(f, {
2179
+ onOpenChange: t,
2180
+ children: /* @__PURE__ */ H(s, {
1262
2181
  className: "max-w-md",
1263
- children: [/* @__PURE__ */ L(a, { children: [/* @__PURE__ */ L(i, {
2182
+ children: [/* @__PURE__ */ H(o, { children: [/* @__PURE__ */ H(i, {
1264
2183
  className: "flex items-center gap-2",
1265
- children: [/* @__PURE__ */ I(de, {
2184
+ children: [/* @__PURE__ */ V(Y, {
1266
2185
  size: 20,
1267
2186
  className: "bento-accent-icon"
1268
- }), s("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
1269
- }), /* @__PURE__ */ I(t, { children: s("bento.shortcuts.description", { defaultValue: "Move around without leaving the keyboard." }) })] }), /* @__PURE__ */ I("div", {
2187
+ }), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
2188
+ }), /* @__PURE__ */ V(r, { children: c("bento.shortcuts.description", { defaultValue: "Move around without leaving the keyboard." }) })] }), /* @__PURE__ */ V("div", {
1270
2189
  className: "flex flex-col gap-5",
1271
- children: l.map((e) => /* @__PURE__ */ L("section", { children: [/* @__PURE__ */ I("h3", {
2190
+ children: d.map((e) => /* @__PURE__ */ H("section", { children: [/* @__PURE__ */ V("h3", {
1272
2191
  className: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
1273
2192
  children: e.heading
1274
- }), /* @__PURE__ */ I("ul", {
2193
+ }), /* @__PURE__ */ V("ul", {
1275
2194
  className: "flex flex-col gap-1.5",
1276
- children: e.rows.map((e) => /* @__PURE__ */ L("li", {
2195
+ children: e.rows.map((e) => /* @__PURE__ */ H("li", {
2196
+ "data-shortcut": e.id,
1277
2197
  className: "flex items-center justify-between gap-4",
1278
- children: [/* @__PURE__ */ I("span", {
2198
+ children: [/* @__PURE__ */ V("span", {
1279
2199
  className: "text-sm text-foreground",
1280
2200
  children: e.label
1281
- }), /* @__PURE__ */ I("span", {
2201
+ }), /* @__PURE__ */ V("span", {
1282
2202
  className: "flex shrink-0 items-center gap-1",
1283
- children: e.keys.map((e) => /* @__PURE__ */ I("kbd", {
2203
+ children: e.combos.map((e, t) => /* @__PURE__ */ H(ne, { children: [t > 0 && /* @__PURE__ */ V("span", {
2204
+ className: "px-0.5 text-[11px] text-muted-foreground",
2205
+ children: c("bento.shortcuts.or", { defaultValue: "or" })
2206
+ }), e.map((e) => /* @__PURE__ */ V("kbd", {
1284
2207
  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",
1285
2208
  children: e
1286
- }, e))
2209
+ }, e))] }, e.join("+")))
1287
2210
  })]
1288
- }, e.label))
2211
+ }, e.id))
1289
2212
  })] }, e.heading))
1290
2213
  })]
1291
2214
  })
@@ -1293,158 +2216,148 @@ function _t({ open: e, onOpenChange: r, isMac: o }) {
1293
2216
  }
1294
2217
  //#endregion
1295
2218
  //#region src/bento/bento-nav-rail.tsx
1296
- var vt = fe;
1297
- function yt(e, t) {
2219
+ var gn = ve;
2220
+ function _n(e, t) {
1298
2221
  return e === t || e.startsWith(`${t}/`);
1299
2222
  }
1300
- function bt(e, t) {
1301
- return t.section.areaRoute && yt(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && yt(e, t.bentoRoute));
2223
+ function vn(e, t) {
2224
+ return t.section.areaRoute && _n(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && _n(e, t.bentoRoute));
1302
2225
  }
1303
- function xt({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
1304
- let { t: i } = R(), { pathname: a } = be(), o = M(() => e.filter((e) => !!e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
1305
- return /* @__PURE__ */ I(h, {
2226
+ function yn({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
2227
+ let { t: i } = U(), { pathname: a } = je(), o = L(() => e.filter((e) => !!e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
2228
+ return /* @__PURE__ */ V(x, {
1306
2229
  delayDuration: 200,
1307
- children: /* @__PURE__ */ L("nav", {
2230
+ children: /* @__PURE__ */ H("nav", {
1308
2231
  "aria-label": i("bento.nav.label", { defaultValue: "Primary" }),
1309
2232
  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",
1310
2233
  children: [
1311
- /* @__PURE__ */ I(St, {
2234
+ /* @__PURE__ */ V(bn, {
1312
2235
  to: t,
1313
- icon: ue,
2236
+ icon: _e,
1314
2237
  label: r ?? i("home.title", { defaultValue: "Home" }),
1315
2238
  active: s
1316
2239
  }),
1317
- o.length > 0 && /* @__PURE__ */ I("span", {
2240
+ o.length > 0 && /* @__PURE__ */ V("span", {
1318
2241
  "aria-hidden": !0,
1319
2242
  className: "my-1 h-px w-6 bg-border/60"
1320
2243
  }),
1321
- o.map((e) => /* @__PURE__ */ I(St, {
2244
+ o.map((e) => /* @__PURE__ */ V(bn, {
1322
2245
  to: e.section.areaRoute,
1323
- icon: e.section.icon ?? vt,
2246
+ icon: e.section.icon ?? gn,
1324
2247
  label: e.section.labelKey ? i(e.section.labelKey) : e.section.id,
1325
- active: bt(a, e)
2248
+ active: vn(a, e)
1326
2249
  }, e.section.id))
1327
2250
  ]
1328
2251
  })
1329
2252
  });
1330
2253
  }
1331
- function St({ to: e, icon: t, label: n, active: r }) {
1332
- return /* @__PURE__ */ L(d, { children: [/* @__PURE__ */ I(g, {
2254
+ function bn({ to: e, icon: t, label: n, active: r }) {
2255
+ return /* @__PURE__ */ H(E, { children: [/* @__PURE__ */ V(S, {
1333
2256
  asChild: !0,
1334
- children: /* @__PURE__ */ I(K, {
2257
+ children: /* @__PURE__ */ V(Z, {
1335
2258
  to: e,
1336
2259
  "aria-label": n,
1337
2260
  "aria-current": r ? "page" : void 0,
1338
2261
  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"}`,
1339
- children: /* @__PURE__ */ I(t, { size: 20 })
2262
+ children: /* @__PURE__ */ V(t, { size: 20 })
1340
2263
  })
1341
- }), /* @__PURE__ */ I(s, {
2264
+ }), /* @__PURE__ */ V(A, {
1342
2265
  side: "right",
1343
2266
  children: n
1344
2267
  })] });
1345
2268
  }
1346
2269
  //#endregion
1347
2270
  //#region src/bento/bento-user-menu.tsx
1348
- function Ct({ accountRoute: e, logoutUrl: t, organizationsRoute: n, tenantAdminRoute: i, onOpenShortcuts: a, onReplayTour: s }) {
1349
- let { user: d, status: f } = b(), { t: p } = R(), h = q(), g = `${d.firstName ?? ""} ${d.lastName ?? ""}`.trim() || d.username || "";
1350
- return f === "loading" ? /* @__PURE__ */ I("div", {
2271
+ function xn({ accountRoute: e, logoutUrl: t, organizationsRoute: n, tenantAdminRoute: r, onOpenShortcuts: i, onReplayTour: a }) {
2272
+ let { user: o, status: s } = D(), { t: c } = U(), h = Me(), g = `${o.firstName ?? ""} ${o.lastName ?? ""}`.trim() || o.username || "";
2273
+ return s === "loading" ? /* @__PURE__ */ V("div", {
1351
2274
  className: "h-9 w-9 rounded-full bg-muted/40",
1352
2275
  "aria-hidden": !0
1353
- }) : /* @__PURE__ */ L(c, { children: [/* @__PURE__ */ I(r, {
2276
+ }) : /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
1354
2277
  asChild: !0,
1355
- children: /* @__PURE__ */ I("button", {
2278
+ children: /* @__PURE__ */ V("button", {
1356
2279
  type: "button",
1357
- title: g || d.username,
2280
+ title: g || o.username,
1358
2281
  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",
1359
- children: /* @__PURE__ */ I(S, {
1360
- givenName: d.firstName,
1361
- familyName: d.lastName,
1362
- name: g || d.username,
1363
- src: d.avatarUrl || void 0,
1364
- alt: d.username
2282
+ children: /* @__PURE__ */ V(y, {
2283
+ givenName: o.firstName,
2284
+ familyName: o.lastName,
2285
+ name: g || o.username,
2286
+ src: o.avatarUrl || void 0,
2287
+ alt: o.username
1365
2288
  })
1366
2289
  })
1367
- }), /* @__PURE__ */ L(m, {
2290
+ }), /* @__PURE__ */ H(_, {
1368
2291
  align: "end",
1369
2292
  sideOffset: 10,
1370
2293
  className: "bento-dropdown min-w-64 p-2",
1371
2294
  children: [
1372
- /* @__PURE__ */ I(o, {
2295
+ /* @__PURE__ */ V(m, {
1373
2296
  className: "p-0 font-normal",
1374
- children: /* @__PURE__ */ L("div", {
2297
+ children: /* @__PURE__ */ H("div", {
1375
2298
  className: "flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm",
1376
- children: [/* @__PURE__ */ I("span", {
2299
+ children: [/* @__PURE__ */ V("span", {
1377
2300
  className: "rounded-full p-0.5 ring-1 ring-border/60",
1378
- children: /* @__PURE__ */ I(S, {
1379
- givenName: d.firstName,
1380
- familyName: d.lastName,
1381
- name: g || d.username,
1382
- src: d.avatarUrl || void 0,
1383
- alt: d.username
2301
+ children: /* @__PURE__ */ V(y, {
2302
+ givenName: o.firstName,
2303
+ familyName: o.lastName,
2304
+ name: g || o.username,
2305
+ src: o.avatarUrl || void 0,
2306
+ alt: o.username
1384
2307
  })
1385
- }), /* @__PURE__ */ L("div", {
2308
+ }), /* @__PURE__ */ H("div", {
1386
2309
  className: "grid flex-1 text-left text-sm leading-tight",
1387
- children: [g && /* @__PURE__ */ I("span", {
2310
+ children: [g && /* @__PURE__ */ V("span", {
1388
2311
  className: "truncate font-medium",
1389
2312
  children: g
1390
- }), d.email && /* @__PURE__ */ I("span", {
2313
+ }), o.email && /* @__PURE__ */ V("span", {
1391
2314
  className: "truncate text-xs text-muted-foreground",
1392
- children: d.email
2315
+ children: o.email
1393
2316
  })]
1394
2317
  })]
1395
2318
  })
1396
2319
  }),
1397
- /* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }),
1398
- /* @__PURE__ */ L(u, { children: [
1399
- /* @__PURE__ */ L(l, {
2320
+ /* @__PURE__ */ V(p, { className: "my-1.5 bg-border/50" }),
2321
+ /* @__PURE__ */ H(d, { children: [
2322
+ /* @__PURE__ */ H(u, {
1400
2323
  onSelect: () => h(e),
1401
2324
  className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1402
- children: [/* @__PURE__ */ I(ve, { size: 18 }), p("nav.account")]
2325
+ children: [/* @__PURE__ */ V(Ee, { size: 18 }), c("nav.account")]
1403
2326
  }),
1404
- n && /* @__PURE__ */ L(l, {
2327
+ n && /* @__PURE__ */ H(u, {
1405
2328
  onSelect: () => h(n),
1406
2329
  className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1407
- children: [/* @__PURE__ */ I(ae, { size: 18 }), p("nav.organizations", { defaultValue: "Organizations" })]
2330
+ children: [/* @__PURE__ */ V(fe, { size: 18 }), c("nav.organizations", { defaultValue: "Organizations" })]
1408
2331
  }),
1409
- i && /* @__PURE__ */ L(l, {
1410
- onSelect: () => h(i),
2332
+ r && /* @__PURE__ */ H(u, {
2333
+ onSelect: () => h(r),
1411
2334
  className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1412
- children: [/* @__PURE__ */ I(oe, { size: 18 }), p("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
2335
+ children: [/* @__PURE__ */ V(G, { size: 18 }), c("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
1413
2336
  })
1414
2337
  ] }),
1415
- (a || s) && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ L(u, { children: [s && /* @__PURE__ */ L(l, {
1416
- onSelect: () => s(),
1417
- className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1418
- children: [/* @__PURE__ */ I(U, { size: 18 }), p("bento.tour.replay", { defaultValue: "Take the tour" })]
1419
- }), a && /* @__PURE__ */ L(l, {
2338
+ (i || a) && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(p, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ H(d, { children: [a && /* @__PURE__ */ H(u, {
1420
2339
  onSelect: () => a(),
1421
2340
  className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1422
- children: [/* @__PURE__ */ I(de, { size: 18 }), p("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
2341
+ children: [/* @__PURE__ */ V(Ce, { size: 18 }), c("bento.tour.replay", { defaultValue: "Take the tour" })]
2342
+ }), i && /* @__PURE__ */ H(u, {
2343
+ onSelect: () => i(),
2344
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
2345
+ children: [/* @__PURE__ */ V(Y, { size: 18 }), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
1423
2346
  })] })] }),
1424
- /* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }),
1425
- /* @__PURE__ */ L(l, {
2347
+ /* @__PURE__ */ V(p, { className: "my-1.5 bg-border/50" }),
2348
+ /* @__PURE__ */ H(u, {
1426
2349
  onSelect: () => {
1427
2350
  globalThis.location.href = t;
1428
2351
  },
1429
2352
  className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger",
1430
- children: [/* @__PURE__ */ I(pe, { size: 18 }), p("nav.logOut")]
2353
+ children: [/* @__PURE__ */ V(ye, { size: 18 }), c("nav.logOut")]
1431
2354
  })
1432
2355
  ]
1433
2356
  })] });
1434
2357
  }
1435
2358
  //#endregion
1436
2359
  //#region src/bento/bento-section-chrome.tsx
1437
- var wt = O("console");
1438
- function Tt({ chrome: e, children: t }) {
1439
- return /* @__PURE__ */ I(wt.Provider, {
1440
- value: e,
1441
- children: t
1442
- });
1443
- }
1444
- function Et() {
1445
- return A(wt);
1446
- }
1447
- var Dt = {
2360
+ var Sn = {
1448
2361
  blue: "blue",
1449
2362
  violet: "violet",
1450
2363
  emerald: "emerald",
@@ -1454,58 +2367,62 @@ var Dt = {
1454
2367
  cyan: "blue",
1455
2368
  orange: "amber"
1456
2369
  };
1457
- function $({ variant: e = "blue", defaultOpen: t, className: n, children: r }) {
1458
- let i = A(wt), a, o;
1459
- return i === "bento" && D.forEach(r, (e) => {
1460
- if (!k(e)) return;
2370
+ function Cn({ variant: t = "blue", className: n, children: r }) {
2371
+ let i;
2372
+ P.forEach(r, (e) => {
2373
+ if (!re(e)) return;
1461
2374
  let { type: t } = e;
1462
- t === C.Header || t === C.StaticHeader ? a = e.props : t === C.Content && (o = e.props.children);
1463
- }), i === "bento" && a ? /* @__PURE__ */ I(st, {
1464
- icon: a.icon,
1465
- tone: Dt[e] ?? "blue",
1466
- title: a.title,
1467
- description: a.description,
1468
- className: n,
1469
- children: o
1470
- }) : /* @__PURE__ */ I(C, {
1471
- variant: e,
1472
- defaultOpen: t,
2375
+ (t === O.Header || t === O.StaticHeader) && (i ??= e.props);
2376
+ });
2377
+ let a = P.map(r, (e) => {
2378
+ if (!re(e)) return e;
2379
+ let { type: t } = e;
2380
+ return t === O.Header || t === O.StaticHeader ? null : t === O.Content ? e.props.children : e;
2381
+ });
2382
+ return i ? /* @__PURE__ */ V(Yt, {
2383
+ icon: i.icon,
2384
+ tone: Sn[t] ?? "blue",
2385
+ title: i.title,
2386
+ description: i.description,
1473
2387
  className: n,
1474
- children: r
2388
+ children: a
2389
+ }) : /* @__PURE__ */ V("section", {
2390
+ className: e(Jt, n),
2391
+ children: a
1475
2392
  });
1476
2393
  }
1477
- $.Header = C.Header, $.StaticHeader = C.StaticHeader, $.Content = C.Content;
2394
+ Cn.Header = O.Header, Cn.StaticHeader = O.StaticHeader, Cn.Content = O.Content;
1478
2395
  //#endregion
1479
2396
  //#region src/bento/bento-section.tsx
1480
- var Ot = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
1481
- function kt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = Ot }) {
1482
- let o = /* @__PURE__ */ I("h2", {
2397
+ var wn = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
2398
+ function Tn({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = wn }) {
2399
+ let o = /* @__PURE__ */ V("h2", {
1483
2400
  className: "text-xl font-semibold tracking-tight md:text-2xl",
1484
2401
  children: t
1485
2402
  });
1486
- return /* @__PURE__ */ L("section", {
2403
+ return /* @__PURE__ */ H("section", {
1487
2404
  className: "mb-8 md:mb-10",
1488
- children: [/* @__PURE__ */ L("header", {
2405
+ children: [/* @__PURE__ */ H("header", {
1489
2406
  className: "bento-shell-header mb-4 flex flex-col gap-0.5",
1490
2407
  children: [
1491
- e && /* @__PURE__ */ I("span", {
2408
+ e && /* @__PURE__ */ V("span", {
1492
2409
  className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
1493
2410
  children: e
1494
2411
  }),
1495
- r ? /* @__PURE__ */ L(K, {
2412
+ r ? /* @__PURE__ */ H(Z, {
1496
2413
  to: r,
1497
2414
  className: "group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary",
1498
- children: [o, /* @__PURE__ */ I(V, {
2415
+ children: [o, /* @__PURE__ */ V(K, {
1499
2416
  size: 20,
1500
2417
  className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
1501
2418
  })]
1502
2419
  }) : o,
1503
- n && /* @__PURE__ */ I("p", {
2420
+ n && /* @__PURE__ */ V("p", {
1504
2421
  className: "max-w-2xl text-sm text-muted-foreground",
1505
2422
  children: n
1506
2423
  })
1507
2424
  ]
1508
- }), /* @__PURE__ */ I("div", {
2425
+ }), /* @__PURE__ */ V("div", {
1509
2426
  className: a,
1510
2427
  children: i
1511
2428
  })]
@@ -1513,61 +2430,161 @@ function kt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, g
1513
2430
  }
1514
2431
  //#endregion
1515
2432
  //#region src/bento/bento-tile.tsx
1516
- function At({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, tone: o, eyebrow: s, title: c, span: l, featured: u = !1, children: d }) {
1517
- let f = !r && !!(t || n), p = u ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", m = u ? 28 : 18, h = u ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", g = /* @__PURE__ */ L(F, { children: [
1518
- u && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
2433
+ function En({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, tone: o, eyebrow: s, title: c, span: l, featured: u = !1, children: d }) {
2434
+ let f = !r && !!(t || n), p = u ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", m = u ? 28 : 18, h = u ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", g = /* @__PURE__ */ H(B, { children: [
2435
+ u && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
1519
2436
  "aria-hidden": !0,
1520
- className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${Y(o)} opacity-40 blur-2xl dark:opacity-50`
1521
- }), /* @__PURE__ */ I("div", {
2437
+ className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${Q(o)} opacity-40 blur-2xl dark:opacity-50`
2438
+ }), /* @__PURE__ */ V("div", {
1522
2439
  "aria-hidden": !0,
1523
- className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${Y(o)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
2440
+ className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${Q(o)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
1524
2441
  })] }),
1525
- /* @__PURE__ */ L("div", {
2442
+ /* @__PURE__ */ H("div", {
1526
2443
  className: "relative z-1 flex items-center justify-between",
1527
- children: [/* @__PURE__ */ I("span", {
1528
- className: `grid place-items-center ${Y(o)} text-white shadow-md ${p}`,
1529
- children: /* @__PURE__ */ I(a, { size: m })
1530
- }), f && /* @__PURE__ */ I(V, {
2444
+ children: [/* @__PURE__ */ V("span", {
2445
+ className: `grid place-items-center ${Q(o)} text-white shadow-md ${p}`,
2446
+ children: /* @__PURE__ */ V(a, { size: m })
2447
+ }), f && /* @__PURE__ */ V(K, {
1531
2448
  size: u ? 18 : 16,
1532
2449
  className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
1533
2450
  })]
1534
2451
  }),
1535
- /* @__PURE__ */ L("div", {
2452
+ /* @__PURE__ */ H("div", {
1536
2453
  className: "relative z-1",
1537
2454
  children: [
1538
- /* @__PURE__ */ I("div", {
2455
+ /* @__PURE__ */ V("div", {
1539
2456
  className: "text-[11px] uppercase tracking-wider text-muted-foreground",
1540
2457
  children: s
1541
2458
  }),
1542
- /* @__PURE__ */ I("div", {
2459
+ /* @__PURE__ */ V("div", {
1543
2460
  className: `mt-0.5 ${h}`,
1544
2461
  children: c
1545
2462
  }),
1546
- d && /* @__PURE__ */ I("div", {
2463
+ d && /* @__PURE__ */ V("div", {
1547
2464
  className: "mt-2",
1548
2465
  children: d
1549
2466
  })
1550
2467
  ]
1551
2468
  })
1552
2469
  ] }), _ = `bento-tile bento-glass group relative flex flex-col ${u ? "gap-5" : "gap-4"} overflow-hidden text-left ${u ? "p-6 md:p-7" : "p-5"} ${l}${f ? " bento-tile-clickable" : ""}${r ? " cursor-not-allowed opacity-60" : ""}`;
1553
- return r ? /* @__PURE__ */ I("div", {
2470
+ return r ? /* @__PURE__ */ V("div", {
1554
2471
  className: _,
1555
2472
  "aria-disabled": "true",
1556
2473
  title: i,
1557
2474
  children: g
1558
- }) : t ? /* @__PURE__ */ I(K, {
2475
+ }) : t ? /* @__PURE__ */ V(Z, {
1559
2476
  to: t,
1560
2477
  className: _,
1561
2478
  children: g
1562
- }) : n ? /* @__PURE__ */ I("button", {
2479
+ }) : n ? /* @__PURE__ */ V("button", {
1563
2480
  type: "button",
1564
2481
  onClick: n,
1565
2482
  className: e("w-full", _),
1566
2483
  children: g
1567
- }) : /* @__PURE__ */ I("div", {
2484
+ }) : /* @__PURE__ */ V("div", {
1568
2485
  className: _,
1569
2486
  children: g
1570
2487
  });
1571
2488
  }
1572
2489
  //#endregion
1573
- export { $ as AdaptiveSectionCard, We as BENTO_EMPHASIS_NEXT, Ue as BENTO_EMPHASIS_SPAN, Pe as BENTO_TONES, J as BENTO_TONE_CLASS, Ne as BentoActionsMenu, X as BentoBackLink, ft as BentoBackToTop, gt as BentoCommandPalette, Fe as BentoCountTile, Ie as BentoEmptyState, He as BentoEntityShell, qe as BentoEntityTile, ot as BentoFormHero, st as BentoFormSection, Z as BentoHero, Le as BentoHeroIconPicker, Re as BentoInlineEdit, Ye as BentoListPage, xt as BentoNavRail, ct as BentoPanel, Q as BentoSaveBar, at as BentoScrollSaveBar, kt as BentoSection, _t as BentoShortcutsDialog, ze as BentoStatusMarker, At as BentoTile, Xe as BentoTileGrid, Ct as BentoUserMenu, Tt as SectionCardChromeProvider, Y as bentoChipClass, pt as bentoNavTarget, Ge as resolveBentoLayout, Ke as toBentoLayoutEntries, Be as useBentoScrollFade, Et as useSectionChrome };
2490
+ //#region src/bento/bento-version-rail.tsx
2491
+ function Dn({ versions: t, selected: n, onSelect: r, label: i }) {
2492
+ let { t: a, i18n: o } = U(), [s, c] = z(0), [l, u] = z([]), d = R(/* @__PURE__ */ new Map()), f = (e) => [...e].sort((e, n) => t.findIndex((e) => e.id === n) - t.findIndex((t) => t.id === e));
2493
+ function p(e) {
2494
+ if (n.includes(e)) {
2495
+ u(l.filter((t) => t !== e)), r(n.filter((t) => t !== e));
2496
+ return;
2497
+ }
2498
+ let t = [...n.filter((e) => !l.includes(e)), ...l.filter((e) => n.includes(e))], i = t.length >= 2 ? t.slice(t.length - 1) : t;
2499
+ u([...i, e]), r(f([...i, e]));
2500
+ }
2501
+ function m(e) {
2502
+ let n = Math.max(0, Math.min(t.length - 1, e));
2503
+ c(n), d.current.get(n)?.focus();
2504
+ }
2505
+ function h(e, n) {
2506
+ switch (e.key) {
2507
+ case "ArrowDown":
2508
+ m(n + 1);
2509
+ break;
2510
+ case "ArrowUp":
2511
+ m(n - 1);
2512
+ break;
2513
+ case "Home":
2514
+ m(0);
2515
+ break;
2516
+ case "End":
2517
+ m(t.length - 1);
2518
+ break;
2519
+ case " ":
2520
+ case "Enter":
2521
+ p(t[n].id);
2522
+ break;
2523
+ default: return;
2524
+ }
2525
+ e.preventDefault();
2526
+ }
2527
+ let g = (e) => {
2528
+ let t = new Date(e);
2529
+ return Number.isNaN(t.getTime()) ? {
2530
+ iso: void 0,
2531
+ text: String(e)
2532
+ } : {
2533
+ iso: t.toISOString(),
2534
+ text: new Intl.DateTimeFormat(o?.resolvedLanguage, {
2535
+ dateStyle: "medium",
2536
+ timeStyle: "short"
2537
+ }).format(t)
2538
+ };
2539
+ };
2540
+ return /* @__PURE__ */ V("ul", {
2541
+ role: "listbox",
2542
+ "aria-label": i ?? a("bento.versions.label", { defaultValue: "Versions" }),
2543
+ "aria-multiselectable": "true",
2544
+ "data-slot": "bento-version-rail",
2545
+ className: "m-0 flex list-none flex-col gap-1 p-0",
2546
+ children: t.map((r, i) => {
2547
+ let o = n.includes(r.id), l = g(r.at), u = r.actor === "agent" ? X : Te;
2548
+ return /* @__PURE__ */ H("li", {
2549
+ ref: (e) => {
2550
+ e ? d.current.set(i, e) : d.current.delete(i);
2551
+ },
2552
+ role: "option",
2553
+ "aria-selected": o ? "true" : "false",
2554
+ tabIndex: i === Math.min(s, t.length - 1) ? 0 : -1,
2555
+ onKeyDown: (e) => h(e, i),
2556
+ onClick: () => {
2557
+ c(i), p(r.id);
2558
+ },
2559
+ className: e("flex cursor-pointer flex-col gap-0.5 rounded-xl border px-3 py-2 text-sm outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring", o ? "border-primary/50 bg-primary/10" : "border-transparent hover:bg-muted/50"),
2560
+ children: [
2561
+ /* @__PURE__ */ H("span", {
2562
+ className: "flex items-center gap-1.5 font-medium",
2563
+ children: [
2564
+ /* @__PURE__ */ V(u, {
2565
+ size: 14,
2566
+ "aria-hidden": "true"
2567
+ }),
2568
+ r.author,
2569
+ /* @__PURE__ */ V("span", {
2570
+ className: "text-xs font-normal text-muted-foreground",
2571
+ children: r.actor === "agent" ? a("bento.versions.agent", { defaultValue: "Agent" }) : a("bento.versions.human", { defaultValue: "Person" })
2572
+ })
2573
+ ]
2574
+ }),
2575
+ /* @__PURE__ */ V("time", {
2576
+ dateTime: l.iso,
2577
+ className: "text-xs text-muted-foreground",
2578
+ children: l.text
2579
+ }),
2580
+ r.summary && /* @__PURE__ */ V("span", {
2581
+ className: "text-xs",
2582
+ children: r.summary
2583
+ })
2584
+ ]
2585
+ }, r.id);
2586
+ })
2587
+ });
2588
+ }
2589
+ //#endregion
2590
+ export { Cn as AdaptiveSectionCard, St as BENTO_EMPHASIS_NEXT, xt as BENTO_EMPHASIS_SPAN, cn as BENTO_SHELL_SHORTCUTS, $e as BENTO_TONES, Qe as BENTO_TONE_CLASS, Ze as BentoActionsMenu, at as BentoBackLink, en as BentoBackToTop, an as BentoCommandPalette, et as BentoCountTile, rt as BentoDataTable, gt as BentoDiff, it as BentoEmptyState, ft as BentoEntityShell, Tt as BentoEntityTile, At as BentoFilterBar, qt as BentoFormHero, Yt as BentoFormSection, ot as BentoHero, st as BentoHeroIconPicker, ct as BentoInlineEdit, Ft as BentoListPage, yn as BentoNavRail, mn as BentoPaletteTrigger, Xt as BentoPanel, Wt as BentoSaveBar, Kt as BentoScrollSaveBar, Tn as BentoSection, on as BentoShell, hn as BentoShortcutsDialog, lt as BentoStatusMarker, En as BentoTile, It as BentoTileGrid, xn as BentoUserMenu, Dn as BentoVersionRail, Et as EMPTY_FILTERS, Q as bentoChipClass, tn as bentoNavTarget, Ct as resolveBentoLayout, wt as toBentoLayoutEntries, ut as useBentoScrollFade, pn as useBentoShellShortcuts };