@viglet/viglet-design-system 2026.3.9 → 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.
- package/README.md +528 -44
- package/consumers.json +186 -0
- package/dist/badge-locale-CJkHDlPg.cjs +1 -0
- package/dist/badge-locale-DxDp8Q3S.js +397 -0
- package/dist/bento/bento-actions-menu.d.ts +8 -0
- package/dist/bento/bento-actions-menu.d.ts.map +1 -1
- package/dist/bento/bento-back-to-top.d.ts +9 -1
- package/dist/bento/bento-back-to-top.d.ts.map +1 -1
- package/dist/bento/bento-command-palette.d.ts +56 -9
- package/dist/bento/bento-command-palette.d.ts.map +1 -1
- package/dist/bento/bento-data-table.d.ts +81 -0
- package/dist/bento/bento-data-table.d.ts.map +1 -0
- package/dist/bento/bento-diff.d.ts +41 -0
- package/dist/bento/bento-diff.d.ts.map +1 -0
- package/dist/bento/bento-empty-state.d.ts +8 -1
- package/dist/bento/bento-empty-state.d.ts.map +1 -1
- package/dist/bento/bento-entity-shell.d.ts.map +1 -1
- package/dist/bento/bento-filter-bar.d.ts +60 -0
- package/dist/bento/bento-filter-bar.d.ts.map +1 -0
- package/dist/bento/bento-form-section.d.ts +14 -1
- package/dist/bento/bento-form-section.d.ts.map +1 -1
- package/dist/bento/bento-inline-edit.d.ts.map +1 -1
- package/dist/bento/bento-nav-rail.d.ts +13 -13
- package/dist/bento/bento-nav-rail.d.ts.map +1 -1
- package/dist/bento/bento-nav.d.ts +10 -2
- package/dist/bento/bento-nav.d.ts.map +1 -1
- package/dist/bento/bento-palette-trigger.d.ts +18 -0
- package/dist/bento/bento-palette-trigger.d.ts.map +1 -0
- package/dist/bento/bento-section-chrome.d.ts +19 -39
- package/dist/bento/bento-section-chrome.d.ts.map +1 -1
- package/dist/bento/bento-shell-shortcuts.d.ts +67 -0
- package/dist/bento/bento-shell-shortcuts.d.ts.map +1 -0
- package/dist/bento/bento-shell.d.ts +53 -0
- package/dist/bento/bento-shell.d.ts.map +1 -0
- package/dist/bento/bento-shortcuts-dialog.d.ts +9 -7
- package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -1
- package/dist/bento/bento-status-marker.d.ts +5 -2
- package/dist/bento/bento-status-marker.d.ts.map +1 -1
- package/dist/bento/bento-tile.d.ts.map +1 -1
- package/dist/bento/bento-user-menu.d.ts +9 -8
- package/dist/bento/bento-user-menu.d.ts.map +1 -1
- package/dist/bento/bento-version-rail.d.ts +31 -0
- package/dist/bento/bento-version-rail.d.ts.map +1 -0
- package/dist/bento/index.d.ts +15 -6
- package/dist/bento/index.d.ts.map +1 -1
- package/dist/bento.cjs +5 -1
- package/dist/bento.css +70 -4
- package/dist/bento.es.js +1778 -701
- package/dist/catalogue.json +5283 -0
- package/dist/components/app-footer.d.ts +7 -0
- package/dist/components/app-footer.d.ts.map +1 -1
- package/dist/components/app-switcher.d.ts.map +1 -1
- package/dist/components/backend-status.d.ts +19 -11
- package/dist/components/backend-status.d.ts.map +1 -1
- package/dist/components/badge-colorful.d.ts +13 -0
- package/dist/components/badge-colorful.d.ts.map +1 -1
- package/dist/components/badge-locale.d.ts +7 -0
- package/dist/components/badge-locale.d.ts.map +1 -1
- package/dist/components/error-boundary.d.ts +15 -13
- package/dist/components/error-boundary.d.ts.map +1 -1
- package/dist/components/language-select.d.ts +8 -0
- package/dist/components/language-select.d.ts.map +1 -1
- package/dist/components/login/login.d.ts +27 -0
- package/dist/components/login/login.d.ts.map +1 -1
- package/dist/components/mode-toggle.d.ts +9 -0
- package/dist/components/mode-toggle.d.ts.map +1 -1
- package/dist/components/nav-secondary.d.ts +7 -0
- package/dist/components/nav-secondary.d.ts.map +1 -1
- package/dist/components/router/dialog.delete.d.ts +8 -0
- package/dist/components/router/dialog.delete.d.ts.map +1 -1
- package/dist/components/router/gradient-button-link.d.ts +6 -0
- package/dist/components/router/gradient-button-link.d.ts.map +1 -1
- package/dist/components/router/index.d.ts +0 -11
- package/dist/components/router/index.d.ts.map +1 -1
- package/dist/components/router/loading-provider.d.ts +4 -0
- package/dist/components/router/loading-provider.d.ts.map +1 -1
- package/dist/components/startup-first/startup-first.d.ts +29 -0
- package/dist/components/startup-first/startup-first.d.ts.map +1 -1
- package/dist/components/ui/accordion.d.ts +17 -0
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +14 -0
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +6 -0
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +25 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +15 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +27 -0
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +36 -0
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +35 -0
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/floating-formulas-bg.d.ts +8 -0
- package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
- package/dist/components/ui/form-actions.d.ts +7 -0
- package/dist/components/ui/form-actions.d.ts.map +1 -1
- package/dist/components/ui/form-item-two-columns.d.ts +7 -0
- package/dist/components/ui/form-item-two-columns.d.ts.map +1 -1
- package/dist/components/ui/form.d.ts +25 -0
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/glass-card.d.ts +18 -14
- package/dist/components/ui/glass-card.d.ts.map +1 -1
- package/dist/components/ui/gradient-button.d.ts +15 -1
- package/dist/components/ui/gradient-button.d.ts.map +1 -1
- package/dist/components/ui/gradient-switch.d.ts +6 -0
- package/dist/components/ui/gradient-switch.d.ts.map +1 -1
- package/dist/components/ui/hover-card.d.ts +14 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +6 -4
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +41 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +25 -0
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/popover.d.ts +24 -0
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/pulse-ring.d.ts +9 -11
- package/dist/components/ui/pulse-ring.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +11 -0
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/section-card.d.ts +9 -0
- package/dist/components/ui/section-card.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +36 -0
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +29 -0
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +83 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +16 -0
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/stepper.d.ts +8 -0
- package/dist/components/ui/stepper.d.ts.map +1 -1
- package/dist/components/ui/sticky-save-bar.d.ts +7 -0
- package/dist/components/ui/sticky-save-bar.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +31 -0
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +16 -0
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +7 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +4 -0
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +18 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/user-avatar.d.ts +2 -1
- package/dist/components/ui/user-avatar.d.ts.map +1 -1
- package/dist/components/ui/viglet-assistant.d.ts +103 -0
- package/dist/components/ui/viglet-assistant.d.ts.map +1 -0
- package/dist/components/ui/viglet-avatar.d.ts +44 -0
- package/dist/components/ui/viglet-avatar.d.ts.map +1 -0
- package/dist/contexts/breadcrumb.context.d.ts +7 -0
- package/dist/contexts/breadcrumb.context.d.ts.map +1 -1
- package/dist/contexts/user.context.d.ts +8 -0
- package/dist/contexts/user.context.d.ts.map +1 -1
- package/dist/exports.json +359 -30
- package/dist/floating-formulas-bg.cjs +1 -1
- package/dist/floating-formulas-bg.es.js +56 -55
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-assistant-notifications.d.ts +15 -0
- package/dist/hooks/use-assistant-notifications.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +168 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/assistant.json.d.ts +25 -0
- package/dist/i18n/locales/en/bento.json.d.ts +48 -2
- package/dist/i18n/locales/en/common.json.d.ts +6 -1
- package/dist/i18n/locales/en/language.json.d.ts +8 -0
- package/dist/i18n/locales/pt/assistant.json.d.ts +25 -0
- package/dist/i18n/locales/pt/bento.json.d.ts +48 -2
- package/dist/i18n/locales/pt/common.json.d.ts +6 -1
- package/dist/i18n/locales/pt/language.json.d.ts +8 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +572 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +2280 -733
- package/dist/lib/busy.d.ts +26 -0
- package/dist/lib/busy.d.ts.map +1 -0
- package/dist/lib/corner-slot.d.ts +15 -0
- package/dist/lib/corner-slot.d.ts.map +1 -0
- package/dist/{loading-provider-BWWhhfEn.js → loading-provider-ClDkFPuv.js} +84 -81
- package/dist/loading-provider-DGuCfsl9.cjs +1 -0
- package/dist/preset.css +7 -10
- package/dist/router.cjs +1 -1
- package/dist/router.es.js +2 -776
- package/dist/user.context-Cr3GAQ_r.js +762 -0
- package/dist/user.context-hbdvmXOn.cjs +1 -0
- package/dist/utils-Fk5jmzzb.js +41 -0
- package/dist/utils-Oagwe_oa.cjs +1 -0
- package/dist/viglet-design-system.css +1 -1
- package/dist/vite/boot-loader.d.ts +33 -2
- package/dist/vite/boot-loader.d.ts.map +1 -1
- package/dist/vite.cjs +16 -5
- package/dist/vite.es.js +27 -14
- package/docs/BENTO-AUTHORING.md +81 -11
- package/docs/reference/grounds.dc.html +9 -9
- package/package.json +16 -4
- package/scripts/consumer-entries.mjs +209 -0
- package/scripts/lib/contrast.mjs +301 -0
- package/scripts/mcp.mjs +300 -0
- package/scripts/page-lint.mjs +428 -0
- package/scripts/page-reference.mjs +54 -10
- package/dist/badge-locale-CoEEv7s5.js +0 -581
- package/dist/badge-locale-hQyWhAKe.cjs +0 -7
- package/dist/breadcrumb.context-KQut7j8U.js +0 -917
- package/dist/breadcrumb.context-Vwc3lAlf.cjs +0 -1
- package/dist/components/router/blank-slate.d.ts +0 -21
- package/dist/components/router/blank-slate.d.ts.map +0 -1
- package/dist/components/router/grid.list.d.ts +0 -39
- package/dist/components/router/grid.list.d.ts.map +0 -1
- package/dist/components/router/internal.sidebar.d.ts +0 -61
- package/dist/components/router/internal.sidebar.d.ts.map +0 -1
- package/dist/components/router/nav-main.d.ts +0 -25
- package/dist/components/router/nav-main.d.ts.map +0 -1
- package/dist/components/router/nav-user.d.ts +0 -24
- package/dist/components/router/nav-user.d.ts.map +0 -1
- package/dist/components/router/page-content.d.ts +0 -12
- package/dist/components/router/page-content.d.ts.map +0 -1
- package/dist/components/router/page-header.d.ts +0 -23
- package/dist/components/router/page-header.d.ts.map +0 -1
- package/dist/components/router/page.d.ts +0 -22
- package/dist/components/router/page.d.ts.map +0 -1
- package/dist/components/router/sticky.page.header.d.ts +0 -85
- package/dist/components/router/sticky.page.header.d.ts.map +0 -1
- package/dist/components/router/sub.page.d.ts +0 -50
- package/dist/components/router/sub.page.d.ts.map +0 -1
- package/dist/components/router/sub.page.header.d.ts +0 -37
- package/dist/components/router/sub.page.header.d.ts.map +0 -1
- package/dist/i18n-DD3rQOWi.js +0 -426
- package/dist/i18n-DrBq-qJJ.cjs +0 -1
- package/dist/lib/react-markers.d.ts +0 -17
- package/dist/lib/react-markers.d.ts.map +0 -1
- package/dist/loading-provider-CmeMqLGk.cjs +0 -1
- package/dist/user.context-B9vIBzY5.cjs +0 -1
- package/dist/user.context-D1PxP4D4.js +0 -512
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How wide the reading column is, by name. Each one is a custom property in
|
|
4
|
+
* `bento.css` (`--bento-column-default`, `-narrow`, `-wide`), so a product
|
|
5
|
+
* re-keys a width once rather than a page picking a Tailwind class:
|
|
6
|
+
*
|
|
7
|
+
* - `default` — every page, unless it is one of the two below.
|
|
8
|
+
* - `narrow` — a single-question form, where a long line is harder to read.
|
|
9
|
+
* - `wide` — a table or a board that needs the width more than the margin.
|
|
10
|
+
* - `full` — a tool that owns the viewport, such as a chat or an explorer:
|
|
11
|
+
* edge to edge, the full height, and its own internal scroll.
|
|
12
|
+
*/
|
|
13
|
+
export type BentoShellColumn = "default" | "narrow" | "wide" | "full";
|
|
14
|
+
export interface BentoShellProps {
|
|
15
|
+
/**
|
|
16
|
+
* The nav rail, already handed the product's groups. The shell reserves its
|
|
17
|
+
* gutter when one is given, so no wrapper has to remember the class.
|
|
18
|
+
*/
|
|
19
|
+
rail?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The header's leading edge: the mark and wordmark, a back control where the
|
|
22
|
+
* route has a parent, and the palette trigger.
|
|
23
|
+
*/
|
|
24
|
+
headerStart?: ReactNode;
|
|
25
|
+
/** The header's trailing edge: the locale, the ground and the signed-in user. */
|
|
26
|
+
headerEnd?: ReactNode;
|
|
27
|
+
/** The reading column. A page inside it sets no width, gutter or rhythm of its own. */
|
|
28
|
+
column?: BentoShellColumn;
|
|
29
|
+
/**
|
|
30
|
+
* The assistant dock, usually a `VigletAssistant`. It takes the corner, and
|
|
31
|
+
* renders in flow there without being told to.
|
|
32
|
+
*/
|
|
33
|
+
dock?: ReactNode;
|
|
34
|
+
/** Whether the back-to-top control sits in the corner, above the dock. On by default. */
|
|
35
|
+
backToTop?: boolean;
|
|
36
|
+
/** The routed page. */
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* VDS131 — the page shell every bento screen renders in: the nav rail's gutter,
|
|
41
|
+
* the header, `main` with its reading column, and the corner, each owned once.
|
|
42
|
+
*
|
|
43
|
+
* The contract gave the reading column to the shell and the package shipped only
|
|
44
|
+
* the pieces around it, so every product composed its own `main` and every page
|
|
45
|
+
* set its own width: three widths across six pages of one product, which is a
|
|
46
|
+
* defect that exists only between screens and so is invisible reviewing any one.
|
|
47
|
+
*
|
|
48
|
+
* Still no provider. The rail is fixed, one width and hidden below `md`, so there
|
|
49
|
+
* is no state between the pieces for a context to carry; the palette, the
|
|
50
|
+
* shortcuts dialog and the product's own overlays render beside the shell.
|
|
51
|
+
*/
|
|
52
|
+
export declare function BentoShell({ rail, headerStart, headerEnd, column, dock, backToTop, children, }: Readonly<BentoShellProps>): import("react").JSX.Element;
|
|
53
|
+
//# sourceMappingURL=bento-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-shell.d.ts","sourceRoot":"","sources":["../../src/bento/bento-shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;AASjF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,iFAAiF;IACjF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uFAAuF;IACvF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,WAAW,EACX,SAAS,EACT,MAAkB,EAClB,IAAI,EACJ,SAAgB,EAChB,QAAQ,GACT,EAAE,QAAQ,CAAC,eAAe,CAAC,+BA+E3B"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
export interface BentoShortcutsDialogProps {
|
|
2
2
|
open: boolean;
|
|
3
3
|
onOpenChange: (open: boolean) => void;
|
|
4
|
-
/** True on macOS
|
|
5
|
-
isMac
|
|
4
|
+
/** True on macOS, which swaps Ctrl for the ⌘ glyph. Detected from the platform when omitted. */
|
|
5
|
+
isMac?: boolean;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* The keyboard-shortcut guide (T572)
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* The keyboard-shortcut guide (T572): a reference sheet for the shortcuts the
|
|
9
|
+
* bento shell binds and the keys that drive the command palette.
|
|
10
|
+
*
|
|
11
|
+
* Its global rows are `BENTO_SHELL_SHORTCUTS`, the set `useBentoShellShortcuts`
|
|
12
|
+
* binds (VDS149), one row per action with each key that reaches it. It used to
|
|
13
|
+
* be its own list, and a product binding a different key got a guide to a key
|
|
14
|
+
* that did nothing.
|
|
13
15
|
*/
|
|
14
16
|
export declare function BentoShortcutsDialog({ open, onOpenChange, isMac }: Readonly<BentoShortcutsDialogProps>): import("react").JSX.Element;
|
|
15
17
|
//# sourceMappingURL=bento-shortcuts-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-shortcuts-dialog.d.ts","sourceRoot":"","sources":["../../src/bento/bento-shortcuts-dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bento-shortcuts-dialog.d.ts","sourceRoot":"","sources":["../../src/bento/bento-shortcuts-dialog.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,gGAAgG;IAChG,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAuB,EAAE,EAAE,QAAQ,CAAC,yBAAyB,CAAC,+BAiFxH"}
|
|
@@ -9,8 +9,11 @@ export interface BentoStatusMarkerProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* A small chip in a bento hero's eyebrow saying a form cannot be saved yet or has
|
|
13
|
+
* unsaved changes.
|
|
14
|
+
*
|
|
15
|
+
* It carries the two save-state cues the bento detail pages kept from the console's
|
|
16
|
+
* sticky header:
|
|
14
17
|
*
|
|
15
18
|
* - `titleMissing` → a red "Title required" blocker (Save is also disabled).
|
|
16
19
|
* - `dirty` → an amber "Unsaved changes" cue with a pulsing dot.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-status-marker.d.ts","sourceRoot":"","sources":["../../src/bento/bento-status-marker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bento-status-marker.d.ts","sourceRoot":"","sources":["../../src/bento/bento-status-marker.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,sBAAsB,CAAC,sCA2BrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-tile.d.ts","sourceRoot":"","sources":["../../src/bento/bento-tile.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bento-tile.d.ts","sourceRoot":"","sources":["../../src/bento/bento-tile.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,OAAO,EACP,QAAgB,EAChB,YAAY,EACZ,IAAI,EAAE,IAAI,EACV,IAAI,EACJ,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAgB,EAChB,QAAQ,GACT,EAAE,QAAQ,CAAC,cAAc,CAAC,+BAoF1B"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User avatar + dropdown styled to harmonize with the Bento UI.
|
|
3
|
-
*
|
|
4
|
-
* Uses the same Radix DropdownMenu primitives as the design-system
|
|
5
|
-
* `UserMenu`, but the surface (`.bento-dropdown`) and items
|
|
6
|
-
* (`.bento-dropdown-item`) carry the frosted-glass look and iOS spring
|
|
7
|
-
* easing so it feels like part of the bento language.
|
|
8
|
-
*/
|
|
9
1
|
export interface BentoUserMenuProps {
|
|
10
2
|
/** Where the account entry leads. */
|
|
11
3
|
accountRoute: string;
|
|
@@ -27,5 +19,14 @@ export interface BentoUserMenuProps {
|
|
|
27
19
|
/** Replay the first-run tour. Omit to hide the entry. */
|
|
28
20
|
onReplayTour?: () => void;
|
|
29
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The signed-in user's avatar and menu at the end of a bento header: account,
|
|
24
|
+
* the tenancy routes a product passes, the shortcut guide, the tour and sign-out.
|
|
25
|
+
*
|
|
26
|
+
* It reads the user from `UserProvider`, which has to be mounted above it. The
|
|
27
|
+
* Radix DropdownMenu primitives are the console's, and the surface and items take
|
|
28
|
+
* the frosted bento look and its spring easing. It replaced `NavUser`, which left
|
|
29
|
+
* with the console era in VDS147.
|
|
30
|
+
*/
|
|
30
31
|
export declare function BentoUserMenu({ accountRoute, logoutUrl, organizationsRoute, tenantAdminRoute, onOpenShortcuts, onReplayTour, }: Readonly<BentoUserMenuProps>): import("react").JSX.Element;
|
|
31
32
|
//# sourceMappingURL=bento-user-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-user-menu.d.ts","sourceRoot":"","sources":["../../src/bento/bento-user-menu.tsx"],"names":[],"mappings":"AAeA
|
|
1
|
+
{"version":3,"file":"bento-user-menu.d.ts","sourceRoot":"","sources":["../../src/bento/bento-user-menu.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,YAAY,GACb,EAAE,QAAQ,CAAC,kBAAkB,CAAC,+BAmI9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface BentoVersion {
|
|
2
|
+
id: string;
|
|
3
|
+
/** Who made it, already a display name. */
|
|
4
|
+
author: string;
|
|
5
|
+
/** A person, or an agent acting for one. */
|
|
6
|
+
actor: "human" | "agent";
|
|
7
|
+
at: Date | number | string;
|
|
8
|
+
/** What changed, in a line, already translated. */
|
|
9
|
+
summary?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BentoVersionRailProps {
|
|
12
|
+
/** Newest first. */
|
|
13
|
+
versions: readonly BentoVersion[];
|
|
14
|
+
/** The one or two versions being compared, older first. */
|
|
15
|
+
selected: readonly string[];
|
|
16
|
+
/** Called with the new pair, older first, whenever a reader picks. */
|
|
17
|
+
onSelect: (ids: string[]) => void;
|
|
18
|
+
/** The rail's accessible name. */
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* VDS140 — the list of revisions two are compared from.
|
|
23
|
+
*
|
|
24
|
+
* Each revision shows who made it, whether a person or an agent did, and when:
|
|
25
|
+
* a review of an agent's change reads differently from a colleague's, and the
|
|
26
|
+
* rail says which before the diff does. It is a listbox of up to two selected
|
|
27
|
+
* options: arrows move, Space or Enter picks, and a third pick lets go of the
|
|
28
|
+
* one picked longest ago, so the pair is always the last two the reader chose.
|
|
29
|
+
*/
|
|
30
|
+
export declare function BentoVersionRail({ versions, selected, onSelect, label }: Readonly<BentoVersionRailProps>): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=bento-version-rail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-version-rail.d.ts","sourceRoot":"","sources":["../../src/bento/bento-version-rail.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,EAAE,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3B,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,oBAAoB;IACpB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,qBAAqB,CAAC,+BAmHxG"}
|
package/dist/bento/index.d.ts
CHANGED
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
*
|
|
18
18
|
* import "@viglet/viglet-design-system/bento.css"
|
|
19
19
|
*
|
|
20
|
-
* The shell is
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* The shell is BentoShell, and no provider: it reserves the gutter for the
|
|
21
|
+
* BentoNavRail passed as `rail`, lays out the header's two edges (BentoUserMenu
|
|
22
|
+
* goes in the trailing one), owns `main` and its reading column, and puts
|
|
23
|
+
* BentoBackToTop at the corner. The routed page is its children and sets no
|
|
24
|
+
* width of its own.
|
|
23
25
|
*
|
|
24
26
|
* There is deliberately no sidebar provider here, and no context between them.
|
|
25
27
|
* The console era needs one because its sidebar collapses, remembers and
|
|
@@ -32,17 +34,23 @@
|
|
|
32
34
|
*/
|
|
33
35
|
export { BentoActionsMenu, type BentoActionsMenuItem, type BentoActionsMenuProps, type BentoActionTone } from './bento-actions-menu';
|
|
34
36
|
export { BentoCountTile, type BentoCountTileProps } from './bento-count-tile';
|
|
37
|
+
export { BentoDataTable, type BentoDataTableAction, type BentoDataTableColumn, type BentoDataTableLayout, type BentoDataTableProps, } from './bento-data-table';
|
|
35
38
|
export { BentoEmptyState, type BentoEmptyStateProps } from './bento-empty-state';
|
|
36
39
|
export { BentoEntityShell, type BentoEntityShellProps, type BentoEntityShellRenderArgs, type BentoIdentity, type BentoShellFormState, } from './bento-entity-shell';
|
|
40
|
+
export { BentoDiff, type BentoDiffField, type BentoDiffFieldKind, type BentoDiffProps, type BentoDiffSide, } from './bento-diff';
|
|
37
41
|
export { BentoEntityTile, type BentoEntityTileProps } from './bento-entity-tile';
|
|
42
|
+
export { BentoFilterBar, EMPTY_FILTERS, type BentoFilterBarProps, type BentoFilterChoiceFacet, type BentoFilterDateFacet, type BentoFilterDateRange, type BentoFilterFacet, type BentoFilterValue, } from './bento-filter-bar';
|
|
38
43
|
export { BentoListPage, type BentoListPageProps, type BentoListLayout, BentoTileGrid, type BentoTileGridProps, } from './bento-list-page';
|
|
39
44
|
export { BentoHeroIconPicker, type BentoHeroIconPickerProps } from './bento-hero-icon-picker';
|
|
40
45
|
export { BentoInlineEdit, type BentoInlineEditProps } from './bento-inline-edit';
|
|
41
46
|
export { BentoFormHero, type BentoFormHeroProps } from './bento-form-hero';
|
|
42
47
|
export { BentoFormSection, type BentoFormSectionProps } from './bento-form-section';
|
|
43
48
|
export { BentoPanel, type BentoPanelProps } from './bento-panel';
|
|
44
|
-
export { BentoBackToTop } from './bento-back-to-top';
|
|
45
|
-
export { BentoCommandPalette, type BentoCommandPaletteProps } from './bento-command-palette';
|
|
49
|
+
export { BentoBackToTop, type BentoBackToTopProps } from './bento-back-to-top';
|
|
50
|
+
export { BentoCommandPalette, type BentoCommandPaletteGroup, type BentoCommandPaletteProps, type BentoCommandPaletteResult, } from './bento-command-palette';
|
|
51
|
+
export { BentoShell, type BentoShellColumn, type BentoShellProps } from './bento-shell';
|
|
52
|
+
export { BENTO_SHELL_SHORTCUTS, useBentoShellShortcuts, type BentoShellAction, type BentoShellShortcut, type BentoShellShortcutsOptions, } from './bento-shell-shortcuts';
|
|
53
|
+
export { BentoPaletteTrigger, type BentoPaletteTriggerProps } from './bento-palette-trigger';
|
|
46
54
|
export { BentoShortcutsDialog, type BentoShortcutsDialogProps } from './bento-shortcuts-dialog';
|
|
47
55
|
export { BentoNavRail, type BentoNavRailProps } from './bento-nav-rail';
|
|
48
56
|
export { BentoUserMenu, type BentoUserMenuProps } from './bento-user-menu';
|
|
@@ -51,10 +59,11 @@ export { BentoBackLink, BentoHero, type BentoHeroProps } from './bento-hero';
|
|
|
51
59
|
export { BentoSaveBar, type BentoSaveBarProps } from './bento-save-bar';
|
|
52
60
|
export { useBentoScrollFade } from './bento-scroll-fade';
|
|
53
61
|
export { BentoScrollSaveBar } from './bento-scroll-save-bar';
|
|
54
|
-
export { AdaptiveSectionCard, type AdaptiveSectionCardProps
|
|
62
|
+
export { AdaptiveSectionCard, type AdaptiveSectionCardProps } from './bento-section-chrome';
|
|
55
63
|
export { BentoSection, type BentoSectionProps } from './bento-section';
|
|
56
64
|
export { BentoStatusMarker, type BentoStatusMarkerProps } from './bento-status-marker';
|
|
57
65
|
export { BentoTile, type BentoTileProps } from './bento-tile';
|
|
66
|
+
export { BentoVersionRail, type BentoVersion, type BentoVersionRailProps } from './bento-version-rail';
|
|
58
67
|
export { BENTO_TONES, BENTO_TONE_CLASS, bentoChipClass, type BentoTone, } from './bento-tones';
|
|
59
68
|
export { BENTO_EMPHASIS_NEXT, BENTO_EMPHASIS_SPAN, resolveBentoLayout, toBentoLayoutEntries, type BentoEmphasis, type BentoLayoutEntry, type BentoLayoutResponse, type BentoLayoutSource, type ResolvedBentoItem, } from './bento-layout';
|
|
60
69
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bento/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bento/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrI,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEvG,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC"}
|
package/dist/bento.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./badge-locale-hQyWhAKe.cjs"),t=require("./user.context-B9vIBzY5.cjs"),n=require("./loading-provider-CmeMqLGk.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("react-i18next"),o=require("@tabler/icons-react"),s=require("@iconify/react"),c=require("react-router-dom"),l=require("@dnd-kit/core"),u=require("@dnd-kit/sortable"),d=require("@dnd-kit/utilities"),f=require("sonner");var p={default:``,destructive:`bento-item-danger`};function m({actions:t,triggerLabel:n}){let{t:r}=(0,a.useTranslation)();return t.length===0?null:(0,i.jsxs)(e.f,{children:[(0,i.jsx)(e.E,{asChild:!0,children:(0,i.jsx)(`button`,{type:`button`,"aria-label":n??r(`forms.formActions.moreActions`,{defaultValue:`More actions`}),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`,children:(0,i.jsx)(o.IconDotsVertical,{size:18})})}),(0,i.jsx)(e.m,{align:`end`,sideOffset:8,className:`bento-dropdown min-w-44 p-1.5`,children:t.map(t=>{let n=t.icon,r=p[t.tone??`default`];return(0,i.jsxs)(e.g,{onSelect:t.onSelect,disabled:t.disabled,className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${r}`,children:[(0,i.jsx)(n,{size:16}),t.label]},t.label)})})]})}var h={blue:`bento-tone-blue`,indigo:`bento-tone-indigo`,violet:`bento-tone-violet`,emerald:`bento-tone-emerald`,amber:`bento-tone-amber`,rose:`bento-tone-rose`,slate:`bento-tone-slate`},g=Object.keys(h);function _(e){return`bento-chip ${h[e]??h.slate}`}function v({to:e,icon:t,tone:n,label:r,count:a,span:o}){let s=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`span`,{className:`grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${_(n)}`,children:(0,i.jsx)(t,{size:18})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-3xl font-semibold tabular-nums tracking-tight`,children:a}),(0,i.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:r})]})]}),l=`bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${o}${e?` bento-tile-clickable`:``}`;return e?(0,i.jsx)(c.Link,{to:e,className:l,children:s}):(0,i.jsx)(`div`,{className:l,children:s})}function y({icon:t=o.IconSparkles,tone:n=`indigo`,title:r,description:a,action:s,align:c=`center`,className:l}){let u=_(n),d=c===`center`;return(0,i.jsxs)(`div`,{className:e.U(`bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8`,d?`items-center text-center`:`items-start text-left`,l),children:[(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${u} text-white shadow-md`,children:(0,i.jsx)(t,{size:24})}),(0,i.jsx)(`div`,{className:`text-lg font-semibold tracking-tight`,children:r}),a&&(0,i.jsx)(`p`,{className:e.U(`max-w-md text-sm text-muted-foreground`,d&&`mx-auto`),children:a}),s&&(0,i.jsx)(`div`,{className:e.U(`mt-1`,d&&`mx-auto`),children:s})]})}function b({to:e,children:t}){return(0,i.jsxs)(c.Link,{to:e,className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,i.jsx)(o.IconArrowLeft,{size:14,"aria-hidden":!0}),t]})}function x({eyebrow:e,backTo:t,backLabel:n,title:r,subtitle:a,leading:o,trailing:s}){let c=e??(t==null?null:(0,i.jsx)(b,{to:t,children:n}));return(0,i.jsx)(`header`,{className:`bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10`,children:(0,i.jsxs)(`div`,{className:`flex w-full items-start gap-4`,children:[o&&(0,i.jsx)(`div`,{className:`shrink-0`,children:o}),(0,i.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[c&&(0,i.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:c}),(0,i.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight md:text-4xl`,children:r}),a&&(0,i.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:a})]}),s&&(0,i.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:s})]})})}function S({value:e,onChange:n,onClear:c,defaultIcon:l,tone:u,title:d,description:f,readOnly:p=!1}){let{t:m}=(0,a.useTranslation)(),[h,g]=(0,r.useState)(!1);return p?(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${_(u)} text-white shadow-md`,children:e?(0,i.jsx)(s.Icon,{icon:e,className:`size-6 text-white`}):(0,i.jsx)(l,{size:24})}):(0,i.jsxs)(`div`,{className:`group relative`,children:[(0,i.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":m(`forms.iconPicker.chooseAnIcon`),className:`group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${_(u)} 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`,children:[e?(0,i.jsx)(s.Icon,{icon:e,className:`size-6 text-white`}):(0,i.jsx)(l,{size:24}),(0,i.jsx)(`span`,{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`,children:(0,i.jsx)(o.IconPalette,{className:`size-5 text-white`})})]}),e&&c&&(0,i.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},"aria-label":m(`forms.common.remove`),title:m(`forms.common.remove`),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`,children:(0,i.jsx)(o.IconX,{size:12})}),(0,i.jsx)(t.s,{open:h,onOpenChange:g,value:e,onSelect:n,onClear:c,title:d,description:f})]})}function C({value:t,onSave:n,multiline:o=!1,placeholder:s,className:c=``,ariaLabel:l,autoFocus:u=!1,readOnly:d=!1,commitOnChange:f=!1}){let{t:p}=(0,a.useTranslation)(),[m,h]=(0,r.useState)(u),[g,_]=(0,r.useState)(t),[v,y]=(0,r.useState)(!1),b=(0,r.useRef)(null),[x,S]=(0,r.useState)(t);!m&&t!==x&&(S(t),_(t)),(0,r.useEffect)(()=>{m&&b.current&&(b.current.focus(),b.current.select())},[m]);async function C(){let e=g.trim();if(e===t){h(!1);return}if(!e&&!s){_(t),h(!1);return}y(!0);try{await n(e)}catch{_(t)}finally{y(!1),h(!1)}}function w(){_(t),h(!1)}function T(e){_(e),f&&n(e)}let E=!t;if(d)return(0,i.jsx)(`span`,{className:`block w-full ${c}`,"aria-label":l,children:t||(0,i.jsx)(`span`,{className:`text-muted-foreground/80`,children:s??`—`})});let D=`w-full bg-transparent outline-none border-b transition-colors duration-200 ${c}`,O=`${D} cursor-text rounded-sm ${E?`border-dashed border-border/70 hover:border-foreground/40`:`border-transparent hover:border-border/60 focus-visible:border-border/80`} ${v?`opacity-60`:``}`,k=`${D} bento-editing`;if(!m)return(0,i.jsx)(`button`,{type:`button`,onClick:()=>h(!0),className:`${O} text-left`,"aria-label":l??p(`forms.formActions.edit`),disabled:v,children:t||(0,i.jsx)(`span`,{className:`text-muted-foreground/80`,children:s??`—`})});function A(e){if(e.key===`Escape`){e.preventDefault(),w();return}e.key===`Enter`&&(!o||e.metaKey||e.ctrlKey)&&(e.preventDefault(),C())}return o?(0,i.jsx)(`textarea`,{ref:b,value:g,onChange:e=>T(e.target.value),onBlur:C,onKeyDown:A,placeholder:s,"aria-label":l,rows:3,className:`${k} resize-none py-0.5 leading-snug`}):(0,i.jsx)(e.l,{ref:b,value:g,onChange:e=>T(e.target.value),onBlur:C,onKeyDown:A,placeholder:s,"aria-label":l,className:`${k} h-auto px-0 py-0 shadow-none focus-visible:ring-0`})}function w({titleMissing:e,dirty:t,className:n}){let{t:r}=(0,a.useTranslation)();if(!e&&!t)return null;let s=`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal`;return e?(0,i.jsxs)(`span`,{className:`${s} bento-status bento-status-error ${n??``}`,children:[(0,i.jsx)(o.IconAlertTriangle,{className:`size-3`}),r(`bento.saveBar.titleRequired`,{defaultValue:`Title required`})]}):(0,i.jsxs)(`span`,{className:`${s} bento-status bento-status-warn ${n??``}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse`}),r(`bento.saveBar.unsaved`,{defaultValue:`Unsaved changes`})]})}function T(e){(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=0,i=()=>{r=0;let e=t.getBoundingClientRect().top,i=Math.max(0,Math.min(1,(160-e)/80));n.style.setProperty(`--bento-fade`,String(i)),n.classList.toggle(`bento-fade-half`,i>.5)},a=()=>{r||=requestAnimationFrame(i)};return i(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{r&&cancelAnimationFrame(r),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n.style.removeProperty(`--bento-fade`),n.classList.remove(`bento-fade-half`)}},[e])}function E(e,t){let n={};for(let r of Object.keys(e))Object.assign(n,{[r]:t[r]});return n}function D({entity:t,isNew:s,headlineFallback:l,eyebrow:u,listRoute:d,icon:p,tone:h,formId:g,feature:_,hasStatus:v=!1,hideIcon:y=!1,readOnly:D=!1,autosaveOnly:O=!1,badge:k,notice:A,onUpdate:j,onDelete:M,extraActions:N,children:P}){let{t:F}=(0,a.useTranslation)(),I=(0,c.useNavigate)(),[L,R]=(0,r.useState)(!1),[z,B]=(0,r.useState)({isDirty:!1,isSubmitting:!1}),V=(0,r.useRef)(null);T(V);let H={title:t.title??``,description:t.description??``,icon:t.icon??null,enabled:t.enabled??1},[U,W]=(0,r.useState)(H),[G,K]=(0,r.useState)(H);(H.title!==G.title||H.description!==G.description||H.icon!==G.icon||H.enabled!==G.enabled)&&(K(H),W(H));async function q(e){if(W(t=>({...t,...e})),s||!j)return;let n=e.title??U.title;try{await j({...t,...e}),f.toast.success(F(`forms.common.updated`,{name:n,feature:_}))}catch(t){console.error(`Failed to update entity field`,t),W(t=>({...t,...E(e,H)})),f.toast.error(F(`forms.common.notUpdated`,{name:H.title||n,feature:_}))}}async function ee(){if(M){try{await M()?(f.toast.success(F(`forms.common.deleted`,{name:U.title,feature:_})),I(d)):f.toast.error(F(`forms.common.notDeleted`,{name:U.title,feature:_}))}catch(e){console.error(`Failed to delete entity`,e),f.toast.error(F(`forms.common.notDeleted`,{name:U.title,feature:_}))}R(!1)}}let J=U.enabled===1,te=!D,ne=!(O&&!s),Y=!U.title.trim(),X=!s&&!z.isDirty,re=Y||X,Z=[...N??[],...M&&!D?[{label:F(`forms.formActions.delete`),icon:o.IconTrash,tone:`destructive`,onSelect:()=>R(!0)}]:[]];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x,{eyebrow:(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,i.jsx)(b,{to:d,children:u}),!D&&(0,i.jsx)(w,{titleMissing:Y,dirty:s||z.isDirty})]}),leading:(0,i.jsx)(S,{value:U.icon,onChange:e=>q({icon:e}),onClear:()=>q({icon:null}),defaultIcon:p,tone:h,title:U.title,description:U.description,readOnly:D||y}),title:(0,i.jsx)(C,{value:U.title,onSave:e=>q({title:e}),placeholder:l,className:`text-3xl font-semibold tracking-tight md:text-4xl`,ariaLabel:F(`forms.common.title`),autoFocus:s,commitOnChange:s,readOnly:D}),subtitle:(0,i.jsx)(C,{value:U.description,onSave:e=>q({description:e}),multiline:!0,placeholder:F(`forms.common.description`),className:`max-w-2xl text-sm text-muted-foreground`,ariaLabel:F(`forms.common.description`),commitOnChange:s,readOnly:D}),trailing:(0,i.jsxs)(i.Fragment,{children:[te&&(0,i.jsxs)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:[ne&&(0,i.jsxs)(e.u,{type:`submit`,form:g,size:`sm`,loading:z.isSubmitting,disabled:re,children:[(0,i.jsx)(o.IconDeviceFloppy,{className:`size-4`}),F(`forms.formActions.saveChanges`)]}),(0,i.jsxs)(e.u,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>I(d),children:[(0,i.jsx)(o.IconX,{className:`size-4`}),F(`forms.formActions.cancel`)]})]}),k,v&&(D?(0,i.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${J?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${J?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),J?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]}):(0,i.jsxs)(`button`,{type:`button`,onClick:()=>q({enabled:+!J}),"aria-label":F(`forms.common.enabled`),title:F(J?`common.activeToggleHint`:`common.idleToggleHint`),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 ${J?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground hover:bg-muted/80`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${J?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),J?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]})),!s&&Z.length>0&&(0,i.jsx)(m,{actions:Z})]})}),(0,i.jsx)(`div`,{ref:V,"aria-hidden":!0,className:`h-px`}),A,!s&&M&&(0,i.jsx)(n.i,{feature:_,name:U.title,onDelete:ee,open:L,setOpen:R,trigger:(0,i.jsx)(`span`,{className:`hidden`,"aria-hidden":!0})}),P({staged:U,onStateChange:B})]})}var O={LARGE:`col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2`,MEDIUM:`col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,SMALL:`col-span-1 row-span-1`},k={SMALL:`MEDIUM`,MEDIUM:`LARGE`,LARGE:`SMALL`};function A(e,t,n){if(!n||n.length===0)return e.map((e,n)=>({item:e,key:t(e),emphasis:n===0?`LARGE`:`MEDIUM`}));let r=new Map,i=new Map;for(let e of n)r.set(e.itemId,e.displayOrder),i.set(e.itemId,e.emphasis);return e.map((e,n)=>({item:e,key:t(e),idx:n})).sort((e,t)=>{let n=r.has(e.key)?r.get(e.key):2**53-1,i=r.has(t.key)?r.get(t.key):2**53-1;return n===i?e.idx-t.idx:n-i}).map(({item:e,key:t})=>({item:e,key:t,emphasis:i.get(t)??`MEDIUM`}))}function j(e){return e.map((e,t)=>({itemId:e.key,emphasis:e.emphasis,displayOrder:t}))}function M({to:e,emphasis:t,featured:n,defaultIcon:r,icon:o,tone:l=`indigo`,title:u,description:d,meta:f,enabled:p,hasStatus:m=!1,viewTransitionName:h}){let{t:g}=(0,a.useTranslation)(),v=_(l),y=t??(n?`LARGE`:`MEDIUM`),b=y===`LARGE`,x=y===`SMALL`,S=O[y],C=p===1,w=b?`p-6 md:p-7`:x?`p-4`:`p-5`,T=b?`h-14 w-14`:x?`h-8 w-8`:`h-9 w-9`,E=b?28:x?16:18,D=b?`text-xl md:text-2xl`:x?`text-sm`:`text-base md:text-lg`;return(0,i.jsxs)(c.Link,{to:e,className:`bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${b?`gap-5`:`gap-4`} overflow-hidden ${w} ${S}`,style:h?{viewTransitionName:h}:void 0,children:[b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${v} opacity-40 blur-2xl dark:opacity-50`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${v} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,i.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`grid place-items-center rounded-2xl ${v} text-white shadow-md ${T}`,children:o?(0,i.jsx)(s.Icon,{icon:o,className:b?`size-7 text-white`:`size-4.5 text-white`}):(0,i.jsx)(r,{size:E})}),m&&(0,i.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${C?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${C?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),C?g(`common.active`,{defaultValue:`Active`}):g(`common.idle`,{defaultValue:`Idle`})]})]}),(0,i.jsxs)(`div`,{className:`relative z-1`,children:[(0,i.jsx)(`div`,{className:`font-semibold tracking-tight ${D}`,children:u}),!x&&f&&(0,i.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:f}),!x&&d&&(0,i.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:d})]})]})}var N=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function P({items:e,error:s,tryAgainUrl:c,listId:l,eyebrow:u,backTo:d,backLabel:f,heroIcon:p,title:m,subtitle:h,tone:g=`indigo`,headerAction:v,newRoute:y,newLabel:b,newSubtitle:S,hideNew:C=!1,itemKey:w,renderTile:T,emptyTitle:E,emptyDescription:D,layout:O}){let{t:k}=(0,a.useTranslation)(),j=_(g),[M,N]=(0,r.useState)(!1),P=(0,r.useMemo)(()=>A(e??[],w,O?.data?.entries),[e,w,O?.data?.entries]),F=!!l&&!!O&&(e?.length??0)>0;return(0,i.jsxs)(n.t,{checkIsNotUndefined:e,error:s??null,tryAgainUrl:c,children:[(0,i.jsx)(x,{eyebrow:u,backTo:d,backLabel:f,leading:(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${j} text-white shadow-md`,children:(0,i.jsx)(p,{size:24})}),title:m,subtitle:h}),(v||F&&!M)&&(0,i.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[v,F&&!M&&(0,i.jsxs)(t.c,{variant:`outline`,size:`sm`,onClick:()=>N(!0),className:`ml-auto gap-2`,children:[(0,i.jsx)(o.IconAdjustmentsHorizontal,{size:16}),k(`bento.layout.customize`,{defaultValue:`Customize layout`})]})]}),M&&l&&O?(0,i.jsx)(L,{layout:O,resolved:P,canEditGlobal:O?.data?.canEditGlobal??!1,isCustomized:O?.data?.source===`USER`,renderTile:T,chip:j,hideNew:C,newRoute:y,newLabel:b,newSubtitle:S,onClose:()=>N(!1)}):(0,i.jsx)(I,{resolved:P,renderTile:T,chip:j,hideNew:C,newRoute:y,newLabel:b,newSubtitle:S,isEmpty:e?.length===0,emptyTitle:E,emptyDescription:D})]})}function F({items:e,error:t,tryAgainUrl:r,tone:a=`indigo`,newRoute:o,newLabel:s,newSubtitle:c,hideNew:l=!1,itemKey:u,renderTile:d,emptyTitle:f,emptyDescription:p}){let m=_(a);return(0,i.jsx)(n.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:r,children:(0,i.jsxs)(`div`,{className:N,children:[!l&&o&&s?(0,i.jsx)(V,{route:o,label:s,subtitle:c,chip:m}):null,(e??[]).map(e=>(0,i.jsx)(`span`,{className:`contents`,children:d(e)},u(e))),e?.length===0&&(0,i.jsx)(H,{title:f,description:p})]})})}function I({resolved:t,renderTile:n,chip:r,hideNew:a,newRoute:o,newLabel:s,newSubtitle:c,isEmpty:l,emptyTitle:u,emptyDescription:d}){let f=t.some(e=>e.emphasis===`SMALL`);return(0,i.jsxs)(`div`,{className:e.U(N,f&&`grid-flow-dense`),children:[!a&&(0,i.jsx)(V,{route:o,label:s,subtitle:c,chip:r}),t.map(({item:e,key:t,emphasis:r})=>(0,i.jsx)(`span`,{className:`contents`,children:n(e,r)},t)),l&&(0,i.jsx)(H,{title:u,description:d})]})}function L({layout:n,resolved:s,canEditGlobal:c,isCustomized:d,renderTile:f,chip:p,hideNew:m,newRoute:h,newLabel:g,newSubtitle:_,onClose:v}){let{t:y}=(0,a.useTranslation)(),[b,x]=(0,r.useState)(s),S=n.saving??!1,[C,w]=(0,r.useState)(!1),T=e=>async()=>{if(e){w(!1);try{await e(),v()}catch(e){console.error(`Failed to save the bento layout`,e),w(!0)}}},E=(0,l.useSensors)((0,l.useSensor)(l.PointerSensor,{activationConstraint:{distance:8}}),(0,l.useSensor)(l.KeyboardSensor));function D(e){let{active:t,over:n}=e;!n||t.id===n.id||x(e=>{let r=e.findIndex(e=>e.key===t.id),i=e.findIndex(e=>e.key===n.id);return r<0||i<0?e:(0,u.arrayMove)(e,r,i)})}function O(e,t){x(n=>n.map(n=>n.key===e?{...n,emphasis:t}:n))}let k=(0,r.useMemo)(()=>j(b),[b]),A=b.some(e=>e.emphasis===`SMALL`);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md`,children:[(0,i.jsx)(`span`,{className:`mr-auto text-sm text-muted-foreground`,children:y(`bento.layout.editHint`,{defaultValue:`Drag tiles to reorder · tap the size button to resize`})}),d&&n.onReset&&(0,i.jsxs)(t.c,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(n.onReset),children:[(0,i.jsx)(o.IconArrowBackUp,{size:16}),y(`bento.layout.reset`,{defaultValue:`Reset to default`})]}),c&&n.onSaveGlobal&&(0,i.jsxs)(t.c,{variant:`outline`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>n.onSaveGlobal?.(k)),children:[(0,i.jsx)(o.IconUsers,{size:16}),y(`bento.layout.saveGlobal`,{defaultValue:`Set as default for everyone`})]}),(0,i.jsxs)(t.c,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:v,children:[(0,i.jsx)(o.IconX,{size:16}),y(`common.cancel`,{defaultValue:`Cancel`})]}),(0,i.jsxs)(t.c,{size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>n.onSave(k)),children:[(0,i.jsx)(o.IconDeviceFloppy,{size:16}),y(`bento.layout.save`,{defaultValue:`Save layout`})]}),C&&(0,i.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-destructive`,children:y(`bento.layout.saveFailed`,{defaultValue:`The layout could not be saved. Nothing has changed — try again.`})})]}),(0,i.jsx)(l.DndContext,{sensors:E,collisionDetection:l.closestCenter,onDragEnd:D,children:(0,i.jsx)(u.SortableContext,{items:b.map(e=>e.key),strategy:u.rectSortingStrategy,children:(0,i.jsxs)(`div`,{className:e.U(N,A&&`grid-flow-dense`),children:[!m&&(0,i.jsx)(V,{route:h,label:g,subtitle:_,chip:p}),b.map(({item:e,key:t,emphasis:n})=>(0,i.jsx)(B,{id:t,emphasis:n,onSetEmphasis:e=>O(t,e),children:f(e,n)},t))]})})})]})}var R=[`SMALL`,`MEDIUM`,`LARGE`],z={SMALL:{key:`bento.layout.size.small`,def:`Small`},MEDIUM:{key:`bento.layout.size.medium`,def:`Medium`},LARGE:{key:`bento.layout.size.large`,def:`Large`}};function B({id:t,emphasis:n,onSetEmphasis:r,children:s}){let{t:c}=(0,a.useTranslation)(),{attributes:l,listeners:f,setNodeRef:p,transform:m,transition:h,isDragging:g}=(0,u.useSortable)({id:t}),_={transform:d.CSS.Translate.toString(m),transition:h,opacity:g?.6:1,zIndex:g?50:void 0};return(0,i.jsxs)(`div`,{ref:p,style:_,className:e.U(`relative h-full`,O[n]),children:[(0,i.jsx)(`div`,{className:`pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full`,children:s}),(0,i.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1`,children:[(0,i.jsx)(`div`,{role:`group`,"aria-label":c(`bento.layout.sizeGroup`,{defaultValue:`Tile size`}),className:`flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur`,children:R.map(t=>{let a=t===n,o=c(z[t].key,{defaultValue:z[t].def});return(0,i.jsx)(`button`,{type:`button`,onClick:()=>r(t),"aria-pressed":a,"aria-label":o,title:o,className:e.U(`grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors`,a?`bg-primary text-primary-foreground shadow`:`text-muted-foreground hover:bg-muted`),children:o.charAt(0)},t)})}),(0,i.jsx)(`button`,{type:`button`,...l,...f,"aria-label":c(`bento.layout.dragToReorder`,{defaultValue:`Drag to reorder`}),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`,children:(0,i.jsx)(o.IconGripVertical,{size:14,className:`text-muted-foreground`})})]})]})}function V({route:e,label:t,subtitle:n,chip:r}){let{t:s}=(0,a.useTranslation)();return(0,i.jsxs)(c.Link,{to:e,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`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,children:(0,i.jsx)(o.IconPlus,{size:20})}),(0,i.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:s(`forms.formActions.new`,{defaultValue:`New`})})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-base font-semibold tracking-tight md:text-lg`,children:(0,i.jsx)(`span`,{className:`${r} bg-clip-text text-transparent`,children:t})}),n&&(0,i.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]})}function H({title:e,description:t}){return(0,i.jsx)(y,{icon:o.IconSparkles,title:e,description:t,align:`start`,className:`col-span-2 row-span-2 justify-end md:col-span-4`})}function U({title:t,badges:n,actions:r,onCancel:s,loading:c,disabled:l,dirty:u,titleMissing:d}){let{t:f}=(0,a.useTranslation)();return(0,i.jsxs)(`div`,{className:`bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl`,children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[t&&(0,i.jsx)(`p`,{className:`truncate text-base font-semibold tracking-tight md:text-lg`,children:t}),(0,i.jsx)(w,{titleMissing:d,dirty:u}),n&&(0,i.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n})]}),(0,i.jsx)(`div`,{className:`flex shrink-0 gap-2`,children:r??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.u,{type:`submit`,size:`sm`,loading:c,disabled:l,children:[(0,i.jsx)(o.IconDeviceFloppy,{className:`size-4`}),f(`forms.formActions.saveChanges`)]}),s&&(0,i.jsxs)(e.u,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,i.jsx)(o.IconX,{className:`size-4`}),f(`forms.formActions.cancel`)]})]})})]})}function W({children:e}){return(0,i.jsx)(`span`,{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`,children:e})}U.Badge=W;function G(e){let t=(0,r.useRef)(null);return T(t),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{ref:t,"aria-hidden":!0,className:`h-px`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`bento-save-bar-spacer`}),(0,i.jsx)(`div`,{className:`bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8`,children:(0,i.jsx)(U,{...e})})]})}function K({eyebrow:t,backTo:n,backLabel:r,leading:s,title:c,subtitle:l,trailing:u,onCancel:d,actions:f,loading:p,dirty:m,titleMissing:h,saveDisabled:g,stickyTitle:_,stickyBadges:v}){let{t:y}=(0,a.useTranslation)(),S=g??(!!h||!m);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x,{eyebrow:n===void 0?t:(0,i.jsx)(b,{to:n,children:r}),leading:s,title:c,subtitle:l,trailing:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:f??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.u,{type:`submit`,size:`sm`,loading:p,disabled:S,children:[(0,i.jsx)(o.IconDeviceFloppy,{className:`size-4`}),y(`forms.formActions.saveChanges`)]}),(0,i.jsxs)(e.u,{type:`button`,variant:`outline`,size:`sm`,onClick:d,children:[(0,i.jsx)(o.IconX,{className:`size-4`}),y(`forms.formActions.cancel`)]})]})}),u]})}),(0,i.jsx)(G,{title:_,badges:v,actions:f,onCancel:d,loading:p,disabled:S,dirty:m,titleMissing:h})]})}function q({icon:e,tone:t,title:n,description:r,children:a,trailing:o,as:s=`h2`}){return(0,i.jsxs)(`section`,{className:`bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6`,children:[(0,i.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${_(t)}`,children:(0,i.jsx)(e,{size:20})}),(0,i.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,i.jsx)(s,{className:`text-base font-semibold tracking-tight md:text-lg`,children:n}),r&&(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r})]})]}),o&&(0,i.jsx)(`div`,{className:`shrink-0`,children:o})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-5`,children:a})]})}function ee({children:t,className:n,contentClassName:r}){return(0,i.jsx)(`div`,{className:e.U(`bento-glass rounded-2xl shadow-md`,n),children:(0,i.jsx)(`div`,{className:r,children:t})})}var J=480;function te(e){return window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)}function ne(){return window.scrollY>J}function Y(){let{t:e}=(0,a.useTranslation)(),t=(0,r.useSyncExternalStore)(te,ne,()=>!1);return(0,i.jsx)(`button`,{type:`button`,"aria-label":e(`bento.backToTop`,{defaultValue:`Back to top`}),tabIndex:t?0:-1,onClick:()=>window.scrollTo({top:0,behavior:`smooth`}),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`}`,children:(0,i.jsx)(o.IconArrowUp,{size:18})})}function X(e){return e.bentoRoute??e.fallbackRoute}function re({open:t,onOpenChange:n,items:s}){let{t:l}=(0,a.useTranslation)(),u=(0,c.useNavigate)(),[d,f]=(0,r.useState)(``),[p,m]=(0,r.useState)(0),h=(0,r.useRef)(null),g=(0,r.useMemo)(()=>{let e=d.trim().toLowerCase(),t=s.map(e=>({item:e,label:l(e.titleKey),description:l(e.descriptionKey)}));if(!e)return t;let n=[],r=[];for(let i of t)i.label.toLowerCase().includes(e)?n.push(i):i.description.toLowerCase().includes(e)&&r.push(i);return[...n,...r]},[s,d,l]),[_,v]=(0,r.useState)(t);t!==_&&(v(t),t&&(f(``),m(0)));let y=g.length===0?0:g.length-1;p>y&&m(y),(0,r.useEffect)(()=>{(h.current?.querySelector(`[data-index="${p}"]`))?.scrollIntoView({block:`nearest`})},[p]);function b(e){n(!1),u(X(e))}function x(e){if(e.key===`ArrowDown`)e.preventDefault(),m(e=>g.length===0?0:(e+1)%g.length);else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>g.length===0?0:(e-1+g.length)%g.length);else if(e.key===`Enter`){e.preventDefault();let t=g[p];t&&b(t.item)}}return(0,i.jsx)(e.D,{open:t,onOpenChange:n,children:(0,i.jsxs)(e.k,{showCloseButton:!1,className:`top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0`,onKeyDown:x,children:[(0,i.jsx)(e.F,{className:`sr-only`,children:l(`bento.palette.title`,{defaultValue:`Command palette`})}),(0,i.jsx)(e.A,{className:`sr-only`,children:l(`bento.palette.description`,{defaultValue:`Search and jump to any area`})}),(0,i.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4`,children:[(0,i.jsx)(o.IconSearch,{size:18,className:`shrink-0 text-muted-foreground`}),(0,i.jsx)(`input`,{autoFocus:!0,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`bento-palette-list`,"aria-activedescendant":g[p]?`bento-palette-opt-${p}`:void 0,value:d,onChange:e=>f(e.target.value),placeholder:l(`bento.palette.placeholder`,{defaultValue:`Search areas…`}),className:`h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,i.jsxs)(`div`,{ref:h,id:`bento-palette-list`,role:`listbox`,"aria-label":l(`bento.palette.title`,{defaultValue:`Command palette`}),className:`max-h-80 overflow-y-auto p-2`,children:[g.length===0&&(0,i.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:l(`bento.palette.noResults`,{defaultValue:`No matches`})}),g.map(({item:e,label:t},n)=>{let r=!e.bentoRoute,a=n===p,s=e.icon;return(0,i.jsxs)(`button`,{type:`button`,id:`bento-palette-opt-${n}`,"data-index":n,role:`option`,"aria-selected":a?`true`:`false`,onMouseEnter:()=>m(n),onClick:()=>b(e),className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${a?`bg-accent text-accent-foreground`:`text-foreground`}`,children:[(0,i.jsx)(s,{size:18,className:`shrink-0 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`flex-1 truncate`,children:t}),r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.IconExternalLink,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground/70`}),(0,i.jsx)(`span`,{className:`sr-only`,children:l(`bento.palette.opensConsole`,{defaultValue:`Opens in console`})})]}):a&&(0,i.jsx)(o.IconArrowRight,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground`})]},e.id)})]})]})})}function Z({open:t,onOpenChange:n,isMac:r}){let{t:s}=(0,a.useTranslation)(),c=r?`⌘`:`Ctrl`,l=[{heading:s(`bento.shortcuts.global`,{defaultValue:`Global`}),rows:[{keys:[c,`K`],label:s(`bento.palette.open`,{defaultValue:`Open command palette`})},{keys:[`?`],label:s(`bento.shortcuts.openGuide`,{defaultValue:`Show keyboard shortcuts`})}]},{heading:s(`bento.shortcuts.palette`,{defaultValue:`Command palette`}),rows:[{keys:[`↑`,`↓`],label:s(`bento.shortcuts.navigate`,{defaultValue:`Move between results`})},{keys:[`↵`],label:s(`bento.shortcuts.openSelected`,{defaultValue:`Open the selected area`})},{keys:[`Esc`],label:s(`bento.shortcuts.dismiss`,{defaultValue:`Close the palette or a dialog`})}]}];return(0,i.jsx)(e.D,{open:t,onOpenChange:n,children:(0,i.jsxs)(e.k,{className:`max-w-md`,children:[(0,i.jsxs)(e.M,{children:[(0,i.jsxs)(e.F,{className:`flex items-center gap-2`,children:[(0,i.jsx)(o.IconKeyboard,{size:20,className:`bento-accent-icon`}),s(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]}),(0,i.jsx)(e.A,{children:s(`bento.shortcuts.description`,{defaultValue:`Move around Turing without leaving the keyboard.`})})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,i.jsxs)(`section`,{children:[(0,i.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.heading}),(0,i.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.rows.map(e=>(0,i.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,i.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,i.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.keys.map(e=>(0,i.jsx)(`kbd`,{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`,children:e},e))})]},e.label))})]},e.heading))})]})})}function ie(e,t){return e===t||e.startsWith(`${t}/`)}function ae(e,t){return t.section.areaRoute&&ie(e,t.section.areaRoute)?!0:t.items.some(t=>t.bentoRoute&&ie(e,t.bentoRoute))}function oe({groups:t,homeRoute:n,homeAliases:s,homeLabel:l}){let{t:u}=(0,a.useTranslation)(),{pathname:d}=(0,c.useLocation)(),f=(0,r.useMemo)(()=>t.filter(e=>e.section.areaRoute),[t]),p=d===n||(s?.includes(d)??!1);return(0,i.jsx)(e.o,{delayDuration:200,children:(0,i.jsxs)(`nav`,{"aria-label":u(`bento.nav.label`,{defaultValue:`Primary`}),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`,children:[(0,i.jsx)(se,{to:n,icon:o.IconHome,label:l??u(`home.title`,{defaultValue:`Home`}),active:p}),f.length>0&&(0,i.jsx)(`span`,{"aria-hidden":!0,className:`my-1 h-px w-6 bg-border/60`}),f.map(e=>(0,i.jsx)(se,{to:e.section.areaRoute,icon:e.section.icon,label:u(e.section.labelKey),active:ae(d,e)},e.section.id))]})})}function se({to:t,icon:n,label:r,active:a}){return(0,i.jsxs)(e.i,{children:[(0,i.jsx)(e.s,{asChild:!0,children:(0,i.jsx)(c.Link,{to:t,"aria-label":r,"aria-current":a?`page`:void 0,className:`bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${a?`bento-rail-active`:`border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground`}`,children:(0,i.jsx)(n,{size:20})})}),(0,i.jsx)(e.a,{side:`right`,children:r})]})}function ce({accountRoute:n,logoutUrl:r,organizationsRoute:s,tenantAdminRoute:l,onOpenShortcuts:u,onReplayTour:d}){let{user:f,status:p}=t.n(),{t:m}=(0,a.useTranslation)(),h=(0,c.useNavigate)(),g=`${f.firstName??``} ${f.lastName??``}`.trim()||f.username||``;return p===`loading`?(0,i.jsx)(`div`,{className:`h-9 w-9 rounded-full bg-muted/40`,"aria-hidden":!0}):(0,i.jsxs)(e.f,{children:[(0,i.jsx)(e.E,{asChild:!0,children:(0,i.jsx)(`button`,{type:`button`,title:g||f.username,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`,children:(0,i.jsx)(t.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})})}),(0,i.jsxs)(e.m,{align:`end`,sideOffset:10,className:`bento-dropdown min-w-64 p-2`,children:[(0,i.jsx)(e._,{className:`p-0 font-normal`,children:(0,i.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm`,children:[(0,i.jsx)(`span`,{className:`rounded-full p-0.5 ring-1 ring-border/60`,children:(0,i.jsx)(t.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})}),(0,i.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[g&&(0,i.jsx)(`span`,{className:`truncate font-medium`,children:g}),f.email&&(0,i.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:f.email})]})]})}),(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.h,{children:[(0,i.jsxs)(e.g,{onSelect:()=>h(n),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(o.IconUserCircle,{size:18}),m(`nav.account`)]}),s&&(0,i.jsxs)(e.g,{onSelect:()=>h(s),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(o.IconBuildingCommunity,{size:18}),m(`nav.organizations`,{defaultValue:`Organizations`})]}),l&&(0,i.jsxs)(e.g,{onSelect:()=>h(l),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(o.IconBuildingSkyscraper,{size:18}),m(`nav.tenantAdmin`,{defaultValue:`Tenant administration`})]})]}),(u||d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.h,{children:[d&&(0,i.jsxs)(e.g,{onSelect:()=>d(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(o.IconSparkles,{size:18}),m(`bento.tour.replay`,{defaultValue:`Take the tour`})]}),u&&(0,i.jsxs)(e.g,{onSelect:()=>u(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(o.IconKeyboard,{size:18}),m(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]})]})]}),(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.g,{onSelect:()=>{globalThis.location.href=r},className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger`,children:[(0,i.jsx)(o.IconLogout,{size:18}),m(`nav.logOut`)]})]})]})}var Q=(0,r.createContext)(`console`);function le({chrome:e,children:t}){return(0,i.jsx)(Q.Provider,{value:e,children:t})}function ue(){return(0,r.useContext)(Q)}var de={blue:`blue`,violet:`violet`,emerald:`emerald`,amber:`amber`,rose:`rose`,slate:`slate`,cyan:`blue`,orange:`amber`};function $({variant:e=`blue`,defaultOpen:n,className:a,children:o}){let s=(0,r.useContext)(Q),c,l;return s===`bento`&&r.Children.forEach(o,e=>{if(!(0,r.isValidElement)(e))return;let{type:n}=e;n===t.o.Header||n===t.o.StaticHeader?c=e.props:n===t.o.Content&&(l=e.props.children)}),s===`bento`&&c?(0,i.jsx)(q,{icon:c.icon,tone:de[e]??`blue`,title:c.title,description:c.description,children:l}):(0,i.jsx)(t.o,{variant:e,defaultOpen:n,className:a,children:o})}$.Header=t.o.Header,$.StaticHeader=t.o.StaticHeader,$.Content=t.o.Content;var fe=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function pe({eyebrow:e,title:t,description:n,titleHref:r,children:a,gridClassName:s=fe}){let l=(0,i.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight md:text-2xl`,children:t});return(0,i.jsxs)(`section`,{className:`mb-8 md:mb-10`,children:[(0,i.jsxs)(`header`,{className:`bento-shell-header mb-4 flex flex-col gap-0.5`,children:[e&&(0,i.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:e}),r?(0,i.jsxs)(c.Link,{to:r,className:`group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary`,children:[l,(0,i.jsx)(o.IconChevronRight,{size:20,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}):l,n&&(0,i.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:n})]}),(0,i.jsx)(`div`,{className:s,children:a})]})}function me({to:e,onClick:t,disabled:n=!1,disabledHint:r,icon:a,tone:s,eyebrow:l,title:u,span:d,featured:f=!1,children:p}){let m=!n&&!!(e||t),h=f?`h-14 w-14 rounded-2xl`:`h-9 w-9 rounded-2xl`,g=f?28:18,v=f?`text-xl font-semibold tracking-tight md:text-2xl`:`text-base font-semibold tracking-tight md:text-lg`,y=(0,i.jsxs)(i.Fragment,{children:[f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_(s)} opacity-40 blur-2xl dark:opacity-50`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_(s)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,i.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`grid place-items-center ${_(s)} text-white shadow-md ${h}`,children:(0,i.jsx)(a,{size:g})}),m&&(0,i.jsx)(o.IconChevronRight,{size:f?18:16,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}),(0,i.jsxs)(`div`,{className:`relative z-1`,children:[(0,i.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:l}),(0,i.jsx)(`div`,{className:`mt-0.5 ${v}`,children:u}),p&&(0,i.jsx)(`div`,{className:`mt-2`,children:p})]})]}),b=`bento-tile bento-glass group relative flex flex-col ${f?`gap-5`:`gap-4`} overflow-hidden text-left ${f?`p-6 md:p-7`:`p-5`} ${d}${m?` bento-tile-clickable`:``}${n?` cursor-not-allowed opacity-60`:``}`;return n?(0,i.jsx)(`div`,{className:b,"aria-disabled":`true`,title:r,children:y}):e?(0,i.jsx)(c.Link,{to:e,className:b,children:y}):t?(0,i.jsx)(`button`,{type:`button`,onClick:t,className:`${b} w-full`,children:y}):(0,i.jsx)(`div`,{className:b,children:y})}exports.AdaptiveSectionCard=$,exports.BENTO_EMPHASIS_NEXT=k,exports.BENTO_EMPHASIS_SPAN=O,exports.BENTO_TONES=g,exports.BENTO_TONE_CLASS=h,exports.BentoActionsMenu=m,exports.BentoBackLink=b,exports.BentoBackToTop=Y,exports.BentoCommandPalette=re,exports.BentoCountTile=v,exports.BentoEmptyState=y,exports.BentoEntityShell=D,exports.BentoEntityTile=M,exports.BentoFormHero=K,exports.BentoFormSection=q,exports.BentoHero=x,exports.BentoHeroIconPicker=S,exports.BentoInlineEdit=C,exports.BentoListPage=P,exports.BentoNavRail=oe,exports.BentoPanel=ee,exports.BentoSaveBar=U,exports.BentoScrollSaveBar=G,exports.BentoSection=pe,exports.BentoShortcutsDialog=Z,exports.BentoStatusMarker=w,exports.BentoTile=me,exports.BentoTileGrid=F,exports.BentoUserMenu=ce,exports.SectionCardChromeProvider=le,exports.bentoChipClass=_,exports.bentoNavTarget=X,exports.resolveBentoLayout=A,exports.toBentoLayoutEntries=j,exports.useBentoScrollFade=T,exports.useSectionChrome=ue;
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-Oagwe_oa.cjs"),t=require("./badge-locale-CJkHDlPg.cjs"),n=require("./user.context-hbdvmXOn.cjs"),r=require("./loading-provider-DGuCfsl9.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("react-i18next"),s=require("@tabler/icons-react"),c=require("@iconify/react"),l=require("react-router-dom"),u=require("@tanstack/react-table"),d=require("@dnd-kit/core"),f=require("@dnd-kit/sortable"),p=require("@dnd-kit/utilities"),m=require("sonner");var h={default:``,destructive:`bento-item-danger`},g=new Set;function _(e){process.env.NODE_ENV===`production`||g.has(e)||(g.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.`))}function v({actions:e,triggerLabel:t}){let{t:r}=(0,o.useTranslation)();if(e.length===0)return null;for(let t of e)t.id||_(t.label);return(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,"aria-label":t??r(`forms.formActions.moreActions`,{defaultValue:`More actions`}),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`,children:(0,a.jsx)(s.IconDotsVertical,{size:18})})}),(0,a.jsx)(n.w,{align:`end`,sideOffset:8,className:`bento-dropdown min-w-44 p-1.5`,children:e.map(e=>{let t=e.icon,r=h[e.tone??`default`];return(0,a.jsxs)(n.E,{"data-action-id":e.id,onSelect:e.onSelect,disabled:e.disabled,className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${r}`,children:[(0,a.jsx)(t,{size:16}),e.label]},e.id??e.label)})})]})}var y={blue:`bento-tone-blue`,indigo:`bento-tone-indigo`,violet:`bento-tone-violet`,emerald:`bento-tone-emerald`,amber:`bento-tone-amber`,rose:`bento-tone-rose`,slate:`bento-tone-slate`},b=Object.keys(y);function x(e){return`bento-chip ${y[e]??y.slate}`}function S({to:e,icon:t,tone:n,label:r,count:i,span:o}){let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:`grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${x(n)}`,children:(0,a.jsx)(t,{size:18})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`text-3xl font-semibold tabular-nums tracking-tight`,children:i}),(0,a.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:r})]})]}),c=`bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${o}${e?` bento-tile-clickable`:``}`;return e?(0,a.jsx)(l.Link,{to:e,className:c,children:s}):(0,a.jsx)(`div`,{className:c,children:s})}var C=6,w={rowSortingFeature:u.rowSortingFeature,coreRowModel:(0,u.createCoreRowModel)(),sortedRowModel:(0,u.createSortedRowModel)()};function T({rows:t,getRowId:r,columns:c,label:l,getRowLabel:d,rowActions:f,selectionActions:p,onSelectionChange:m,selectionScope:h,layout:g,onLayoutChange:_,onRowOpen:y,rowHeight:b=44,height:x=480,empty:S}){let{t:T}=(0,o.useTranslation)(),[E,D]=(0,i.useState)([]),[O,k]=(0,i.useState)({hidden:[]}),[A,j]=(0,i.useState)(new Set),[M,N]=(0,i.useState)(null),[P,F]=(0,i.useState)(h);P!==h&&(F(h),j(new Set),N(null));let I=(0,i.useRef)(h);(0,i.useEffect)(()=>{I.current!==h&&(I.current=h,m?.([]))},[h,m]);let[L,R]=(0,i.useState)(0),[z,ee]=(0,i.useState)(0),te=(0,i.useRef)(null),B=(0,i.useRef)(new Map),V=(0,i.useRef)(!1),H=(p?.length??0)>0,U=e=>d?.(e)??r(e),ne=(0,i.useMemo)(()=>c.map(e=>({id:e.id,accessorFn:t=>e.sortValue?.(t)??null,enableSorting:e.sortValue!==void 0})),[c]),W=(0,u.useTable)({features:w,data:t,columns:ne,state:{sorting:E},onSortingChange:D}).getRowModel().rows.map(e=>e.original),G=g??O,K=c.filter(e=>e.hideable===!1||!G.hidden.includes(e.id)),q=[H?`2.75rem`:null,...K.map(e=>e.width??`minmax(8rem, 1fr)`),f?.length?`3.25rem`:null].filter(Boolean).join(` `),J=W.length,Y=Math.max(1,Math.floor(x/b)),re=Math.max(0,Math.floor(z/b)-C),ie=Math.min(J,Math.ceil((z+x)/b)+C),X=Math.min(L,Math.max(0,J-1));(0,i.useEffect)(()=>{V.current&&(V.current=!1,B.current.get(X)?.focus())},[X,re]);function Z(e){j(e),m?.([...e])}function ae(e,t){let[n,i]=e<=t?[e,t]:[t,e];Z(new Set(W.slice(n,i+1).map(r)))}function oe(e){let t=r(W[e]),n=new Set(A);n.has(t)?n.delete(t):n.add(t),Z(n),N(e)}function Q(e,t){let n=Math.max(0,Math.min(J-1,e));if(t&&H){let e=M??X;N(e),ae(e,n)}let r=te.current,i=n*b;if(r){let e=r.scrollTop;i<e?e=i:i+b>e+x&&(e=i+b-x),e!==r.scrollTop&&(r.scrollTop=e,ee(e))}V.current=!0,R(n)}function se(e,t){if(e.target!==e.currentTarget)return;let n=e.shiftKey;switch(e.key){case`ArrowDown`:Q(t+1,n);break;case`ArrowUp`:Q(t-1,n);break;case`PageDown`:Q(t+Y,n);break;case`PageUp`:Q(t-Y,n);break;case`Home`:Q(0,n);break;case`End`:Q(J-1,n);break;case` `:if(!H)return;oe(t);break;case`Enter`:if(!y)return;y(W[t]);break;case`Escape`:if(!H||A.size===0)return;Z(new Set),N(null);break;case`a`:case`A`:if(!H||!(e.ctrlKey||e.metaKey))return;Z(new Set(W.map(r)));break;default:return}e.preventDefault()}function ce(e,t){if(!e.target.closest(`button, a, input, [role='checkbox']`)&&(R(t),H)){if(e.shiftKey){let e=M??X;N(e),ae(e,t)}else e.metaKey||e.ctrlKey?oe(t):(Z(new Set([r(W[t])])),N(t))}}function le(e){let t=E.find(t=>t.id===e);t?t.desc?D([]):D([{id:e,desc:!0}]):D([{id:e,desc:!1}])}function ue(e,t){let n={hidden:t?[...G.hidden,e]:G.hidden.filter(t=>t!==e)};g===void 0&&k(n),_?.(n)}let $=W.filter(e=>A.has(r(e))),de=J>0&&$.length===J,fe=c.filter(e=>e.hideable!==!1);return(0,a.jsxs)(`div`,{"data-slot":`bento-data-table`,className:`bento-glass overflow-hidden rounded-2xl`,children:[(0,a.jsxs)(`div`,{className:`flex min-h-12 flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,a.jsx)(`span`,{"aria-live":`polite`,className:`text-sm font-medium`,children:$.length>0?T(`bento.table.selected`,{defaultValue:`{{count}} selected`,count:$.length}):``}),$.length>0&&(0,a.jsxs)(`div`,{role:`toolbar`,"aria-label":T(`bento.table.selectionActions`,{defaultValue:`Actions on the selection`}),className:`flex flex-wrap items-center gap-2`,children:[p?.map(t=>{let r=t.icon;return(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,className:e.t(`gap-1.5`,t.tone===`destructive`&&`bento-item-danger`),onClick:()=>t.onSelect($),children:[(0,a.jsx)(r,{size:16}),t.label]},t.id)}),(0,a.jsx)(n.R,{variant:`ghost`,size:`sm`,onClick:()=>Z(new Set),children:T(`bento.table.clearSelection`,{defaultValue:`Clear selection`})})]}),fe.length>0&&(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsxs)(n.R,{variant:`ghost`,size:`sm`,className:`ml-auto gap-1.5`,children:[(0,a.jsx)(s.IconColumns3,{size:16,"aria-hidden":`true`}),T(`bento.table.columns`,{defaultValue:`Columns`})]})}),(0,a.jsx)(n.w,{align:`end`,className:`bento-dropdown min-w-44 p-1.5`,children:fe.map(e=>(0,a.jsx)(n.C,{checked:!G.hidden.includes(e.id),onCheckedChange:t=>ue(e.id,t!==!0),onSelect:e=>e.preventDefault(),children:e.header},e.id))})]})]}),(0,a.jsxs)(`div`,{role:`grid`,"aria-label":l,"aria-rowcount":J+1,"aria-colcount":K.length+ +!!H+ +!!f?.length,"aria-multiselectable":H?`true`:void 0,children:[(0,a.jsx)(`div`,{role:`rowgroup`,children:(0,a.jsxs)(`div`,{role:`row`,"aria-rowindex":1,className:`grid items-center border-b border-border/50 px-1 text-xs font-medium text-muted-foreground`,style:{gridTemplateColumns:q,minHeight:b},children:[H&&(0,a.jsx)(`div`,{role:`columnheader`,className:`grid place-items-center`,children:(0,a.jsx)(n.L,{"aria-label":T(`bento.table.selectAll`,{defaultValue:`Select all rows`}),checked:de?!0:$.length>0&&`indeterminate`,onCheckedChange:()=>Z(de?new Set:new Set(W.map(r)))})}),K.map(e=>{let t=E.find(t=>t.id===e.id),n=t?t.desc?`descending`:`ascending`:`none`;return(0,a.jsx)(`div`,{role:`columnheader`,"aria-sort":e.sortValue?n:void 0,className:`min-w-0 px-2`,children:e.sortValue?(0,a.jsxs)(`button`,{type:`button`,onClick:()=>le(e.id),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`,children:[(0,a.jsx)(`span`,{className:`truncate`,children:e.header}),n===`ascending`&&(0,a.jsx)(s.IconArrowUp,{size:14,"aria-hidden":`true`}),n===`descending`&&(0,a.jsx)(s.IconArrowDown,{size:14,"aria-hidden":`true`}),n===`none`&&(0,a.jsx)(s.IconArrowsSort,{size:14,"aria-hidden":`true`,className:`opacity-40`})]}):(0,a.jsx)(`span`,{className:`block truncate py-1`,children:e.header})},e.id)}),f?.length?(0,a.jsx)(`div`,{role:`columnheader`,className:`px-2`,children:(0,a.jsx)(`span`,{className:`sr-only`,children:T(`bento.table.actions`,{defaultValue:`Actions`})})}):null]})}),J===0?(0,a.jsx)(`div`,{role:`rowgroup`,children:(0,a.jsx)(`div`,{role:`row`,"aria-rowindex":2,children:(0,a.jsx)(`div`,{role:`gridcell`,className:`px-4 py-10 text-center text-sm text-muted-foreground`,children:S??T(`bento.table.empty`,{defaultValue:`Nothing to show`})})})}):(0,a.jsx)(`div`,{role:`rowgroup`,ref:te,onScroll:e=>ee(e.currentTarget.scrollTop),className:`relative overflow-y-auto`,style:{height:x},children:(0,a.jsx)(`div`,{style:{height:J*b},className:`relative`,children:W.slice(re,ie).map((t,i)=>{let o=re+i,s=r(t),c=A.has(s),l=U(t);return(0,a.jsxs)(`div`,{ref:e=>{e?B.current.set(o,e):B.current.delete(o)},role:`row`,"aria-rowindex":o+2,"aria-selected":H?c?`true`:`false`:void 0,tabIndex:o===X?0:-1,onKeyDown:e=>se(e,o),onClick:e=>ce(e,o),onDoubleClick:()=>y?.(t),onFocus:e=>{e.target===e.currentTarget&&R(o)},className:e.t(`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`,c&&`bg-primary/10 hover:bg-primary/15`),style:{top:o*b,height:b,gridTemplateColumns:q},children:[H&&(0,a.jsx)(`div`,{role:`gridcell`,className:`grid place-items-center`,children:(0,a.jsx)(n.L,{tabIndex:-1,"aria-label":T(`bento.table.selectRow`,{defaultValue:`Select {{row}}`,row:l}),checked:c,onCheckedChange:()=>oe(o)})}),K.map(e=>(0,a.jsx)(`div`,{role:`gridcell`,className:`min-w-0 truncate px-2`,children:e.cell(t)},e.id)),f?.length?(0,a.jsx)(`div`,{role:`gridcell`,className:`grid place-items-center`,children:(0,a.jsx)(v,{triggerLabel:T(`bento.table.rowActions`,{defaultValue:`Actions for {{row}}`,row:l}),actions:f.map(e=>({id:e.id,label:e.label,icon:e.icon,tone:e.tone,onSelect:()=>e.onSelect([t])}))})}):null]},s)})})})]})]})}function E({icon:t=s.IconSparkles,tone:n=`indigo`,title:r,description:i,action:o,align:c=`center`,titleLevel:l=2,className:u}){let d=x(n),f=c===`center`,p=`h${l}`;return(0,a.jsxs)(`div`,{className:e.t(`bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8`,f?`items-center text-center`:`items-start text-left`,u),children:[(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${d} text-white shadow-md`,children:(0,a.jsx)(t,{size:24})}),(0,a.jsx)(p,{className:`m-0 text-lg font-semibold tracking-tight`,children:r}),i&&(0,a.jsx)(`p`,{className:e.t(`max-w-md text-sm text-muted-foreground`,f&&`mx-auto`),children:i}),o&&(0,a.jsx)(`div`,{className:e.t(`mt-1`,f&&`mx-auto`),children:o})]})}function D({to:e,children:t}){return(0,a.jsxs)(l.Link,{to:e,className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,a.jsx)(s.IconArrowLeft,{size:14,"aria-hidden":!0}),t]})}function O({eyebrow:e,backTo:t,backLabel:n,title:r,subtitle:i,leading:o,trailing:s}){let c=e??(t==null?null:(0,a.jsx)(D,{to:t,children:n}));return(0,a.jsx)(`header`,{className:`bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10`,children:(0,a.jsxs)(`div`,{className:`flex w-full items-start gap-4`,children:[o&&(0,a.jsx)(`div`,{className:`shrink-0`,children:o}),(0,a.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[c&&(0,a.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:c}),(0,a.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight md:text-4xl`,children:r}),i&&(0,a.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:i})]}),s&&(0,a.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:s})]})})}function k({value:e,onChange:t,onClear:r,defaultIcon:l,tone:u,title:d,description:f,readOnly:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,i.useState)(!1);return p?(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${x(u)} text-white shadow-md`,children:e?(0,a.jsx)(c.Icon,{icon:e,className:`size-6 text-white`}):(0,a.jsx)(l,{size:24})}):(0,a.jsxs)(`div`,{className:`group relative`,children:[(0,a.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":m(`forms.iconPicker.chooseAnIcon`),className:`group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${x(u)} 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`,children:[e?(0,a.jsx)(c.Icon,{icon:e,className:`size-6 text-white`}):(0,a.jsx)(l,{size:24}),(0,a.jsx)(`span`,{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`,children:(0,a.jsx)(s.IconPalette,{className:`size-5 text-white`})})]}),e&&r&&(0,a.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r()},"aria-label":m(`forms.common.remove`),title:m(`forms.common.remove`),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`,children:(0,a.jsx)(s.IconX,{size:12})}),(0,a.jsx)(n.x,{open:h,onOpenChange:g,value:e,onSelect:t,onClear:r,title:d,description:f})]})}function A({value:n,onSave:r,multiline:s=!1,placeholder:c,className:l,ariaLabel:u,autoFocus:d=!1,readOnly:f=!1,commitOnChange:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,i.useState)(d),[_,v]=(0,i.useState)(n),[y,b]=(0,i.useState)(!1),x=(0,i.useRef)(null),S=(0,i.useRef)(null),C=(0,i.useRef)(!1),w=(0,i.useRef)(!1),[T,E]=(0,i.useState)(n);!h&&n!==T&&(E(n),v(n)),(0,i.useEffect)(()=>{h&&x.current?(x.current.focus(),x.current.select()):!h&&w.current&&(w.current=!1,S.current?.focus())},[h]);function D(){w.current=x.current!==null&&document.activeElement===x.current,g(!1)}async function O(){if(C.current)return;let e=_.trim();if(e===n){D();return}if(!e&&!c){v(n),D();return}C.current=!0,b(!0);try{await r(e)}catch{v(n)}finally{C.current=!1,b(!1),D()}}function k(){v(n),D()}function A(e){v(e),p&&r(e)}let j=!n;if(f)return(0,a.jsx)(`span`,{className:e.t(`block w-full`,l),"aria-label":u,children:n||(0,a.jsx)(`span`,{className:`text-muted-foreground/80`,children:c??`—`})});let M=`w-full bg-transparent outline-none border-b transition-colors duration-200`,N=e.t(M,`cursor-text rounded-sm`,j?`border-dashed border-border/70 hover:border-foreground/40`:`border-transparent hover:border-border/60 focus-visible:border-border/80`),P=e.t(M,`bento-editing`);if(!h)return(0,a.jsx)(`button`,{ref:S,type:`button`,onClick:()=>g(!0),className:e.t(N,`text-left`,l),"aria-label":u??m(`forms.formActions.edit`),children:n||(0,a.jsx)(`span`,{className:`text-muted-foreground/80`,children:c??`—`})});function F(e){if(e.key===`Escape`){e.preventDefault(),k();return}e.key===`Enter`&&(!s||e.metaKey||e.ctrlKey)&&(e.preventDefault(),O())}return s?(0,a.jsx)(`textarea`,{ref:x,value:_,onChange:e=>A(e.target.value),onBlur:O,onKeyDown:F,placeholder:c,"aria-label":u,"aria-busy":y||void 0,rows:3,className:e.t(P,`resize-none py-0.5 leading-snug`,l)}):(0,a.jsx)(t.a,{ref:x,value:_,onChange:e=>A(e.target.value),onBlur:O,onKeyDown:F,placeholder:c,"aria-label":u,"aria-busy":y||void 0,className:e.t(P,`h-auto px-0 py-0 shadow-none focus-visible:ring-0`,l)})}function j({titleMissing:t,dirty:n,className:r}){let{t:i}=(0,o.useTranslation)();if(!t&&!n)return null;let c=`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal`;return t?(0,a.jsxs)(`span`,{className:e.t(c,`bento-status bento-status-error`,r),children:[(0,a.jsx)(s.IconAlertTriangle,{className:`size-3`}),i(`bento.saveBar.titleRequired`,{defaultValue:`Title required`})]}):(0,a.jsxs)(`span`,{className:e.t(c,`bento-status bento-status-warn`,r),children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse`}),i(`bento.saveBar.unsaved`,{defaultValue:`Unsaved changes`})]})}function M(e){(0,i.useEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=0,i=()=>{r=0;let e=t.getBoundingClientRect().top,i=Math.max(0,Math.min(1,(160-e)/80));n.style.setProperty(`--bento-fade`,String(i)),n.classList.toggle(`bento-fade-half`,i>.5)},a=()=>{r||=requestAnimationFrame(i)};return i(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{r&&cancelAnimationFrame(r),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n.style.removeProperty(`--bento-fade`),n.classList.remove(`bento-fade-half`)}},[e])}function N(e,t){let n={};for(let r of Object.keys(e))Object.assign(n,{[r]:t[r]});return n}function P({entity:e,isNew:n,headlineFallback:c,eyebrow:u,listRoute:d,icon:f,tone:p,formId:h,feature:g,hasStatus:_=!1,hideIcon:y=!1,readOnly:b=!1,autosaveOnly:x=!1,badge:S,notice:C,onUpdate:w,onDelete:T,extraActions:E,children:P}){let{t:F}=(0,o.useTranslation)(),I=(0,l.useNavigate)(),[L,R]=(0,i.useState)(!1),[z,ee]=(0,i.useState)({isDirty:!1,isSubmitting:!1}),te=(0,i.useRef)(null);M(te);let B={title:e.title??``,description:e.description??``,icon:e.icon??null,enabled:e.enabled??1},[V,H]=(0,i.useState)(B),[U,ne]=(0,i.useState)(B);(B.title!==U.title||B.description!==U.description||B.icon!==U.icon||B.enabled!==U.enabled)&&(ne(B),H(B));async function W(t){if(H(e=>({...e,...t})),n||!w)return;let r=t.title??V.title;try{await w({...e,...t}),m.toast.success(F(`forms.common.updated`,{name:r,feature:g}))}catch(e){console.error(`Failed to update entity field`,e),H(e=>({...e,...N(t,B)})),m.toast.error(F(`forms.common.notUpdated`,{name:B.title||r,feature:g}))}}async function G(){if(T){try{await T()?(m.toast.success(F(`forms.common.deleted`,{name:V.title,feature:g})),I(d)):m.toast.error(F(`forms.common.notDeleted`,{name:V.title,feature:g}))}catch(e){console.error(`Failed to delete entity`,e),m.toast.error(F(`forms.common.notDeleted`,{name:V.title,feature:g}))}R(!1)}}let K=V.enabled===1,q=!b,J=!(x&&!n),Y=!V.title.trim(),re=!n&&!z.isDirty,ie=Y||re,X=[...E??[],...T&&!b?[{id:`entity.delete`,label:F(`forms.formActions.delete`),icon:s.IconTrash,tone:`destructive`,onSelect:()=>R(!0)}]:[]];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{eyebrow:(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,a.jsx)(D,{to:d,children:u}),!b&&(0,a.jsx)(j,{titleMissing:Y,dirty:n||z.isDirty})]}),leading:(0,a.jsx)(k,{value:V.icon,onChange:e=>W({icon:e}),onClear:()=>W({icon:null}),defaultIcon:f,tone:p,title:V.title,description:V.description,readOnly:b||y}),title:(0,a.jsx)(A,{value:V.title,onSave:e=>W({title:e}),placeholder:c,className:`text-3xl font-semibold tracking-tight md:text-4xl`,ariaLabel:F(`forms.common.title`),autoFocus:n,commitOnChange:n,readOnly:b}),subtitle:(0,a.jsx)(A,{value:V.description,onSave:e=>W({description:e}),multiline:!0,placeholder:F(`forms.common.description`),className:`max-w-2xl text-sm text-muted-foreground`,ariaLabel:F(`forms.common.description`),commitOnChange:n,readOnly:b}),trailing:(0,a.jsxs)(a.Fragment,{children:[q&&(0,a.jsxs)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:[J&&(0,a.jsxs)(t.o,{type:`submit`,form:h,size:`sm`,loading:z.isSubmitting,"aria-disabled":ie?`true`:void 0,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),F(`forms.formActions.saveChanges`)]}),(0,a.jsxs)(t.o,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>I(d),children:[(0,a.jsx)(s.IconX,{className:`size-4`}),F(`forms.formActions.cancel`)]})]}),S,_&&(b?(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${K?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${K?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),K?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]}):(0,a.jsxs)(`button`,{type:`button`,onClick:()=>W({enabled:+!K}),"aria-label":F(`forms.common.enabled`),title:F(K?`common.activeToggleHint`:`common.idleToggleHint`),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 ${K?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground hover:bg-muted/80`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${K?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),K?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]})),!n&&X.length>0&&(0,a.jsx)(v,{actions:X})]})}),(0,a.jsx)(`div`,{ref:te,"aria-hidden":!0,className:`h-px`}),C,!n&&T&&(0,a.jsx)(r.r,{feature:g,name:V.title,onDelete:G,open:L,setOpen:R,trigger:(0,a.jsx)(`span`,{className:`hidden`,"aria-hidden":!0})}),P({staged:V,onStateChange:ee})]})}function F(e,t,n=!0){let r=e.length,i=t.length;if(r*i>4e5)return null;let a=Array.from({length:r+1},()=>new Uint32Array(i+1));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]);let o=[],s=(e,t)=>{let r=o[o.length-1];n&&r?.op===e?r.text+=t:o.push({op:e,text:t})},c=0,l=0;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++]);for(;c<r;)s(`remove`,e[c++]);for(;l<i;)s(`add`,t[l++]);return o}var I=e=>e.split(/(\s+)/).filter(e=>e!==``);function L(e){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);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();return n.length>0?n:r?[r]:[]}var R=e=>e==null?``:String(e);function z({before:t,after:n,fields:r,showUnchanged:c=!1}){let{t:l}=(0,o.useTranslation)(),[u,d]=(0,i.useState)(c),f=r.map(e=>{let r=t?.[e.id],i=n?.[e.id],a=e.kind??`text`,o=a===`rich`?L(R(r)).join(`
|
|
2
|
+
`)===L(R(i)).join(`
|
|
3
|
+
`):a===`value`?JSON.stringify(r??null)===JSON.stringify(i??null):R(r)===R(i),s=`changed`;return t===null||(r==null||r===``)&&!o?s=`added`:n===null||(i==null||i===``)&&!o?s=`removed`:o&&(s=`unchanged`),{field:e,a:r,b:i,kind:a,state:s}}),p=f.filter(e=>e.state!==`unchanged`),m=f.filter(e=>e.state===`unchanged`),h={added:l(`bento.diff.added`,{defaultValue:`Added`}),removed:l(`bento.diff.removed`,{defaultValue:`Removed`}),changed:l(`bento.diff.changed`,{defaultValue:`Changed`}),unchanged:l(`bento.diff.unchanged`,{defaultValue:`Unchanged`})};return(0,a.jsxs)(`div`,{"data-slot":`bento-diff`,className:`flex flex-col gap-3`,children:[(t===null||n===null)&&(0,a.jsx)(`p`,{className:`m-0 text-sm font-medium`,children:t===null?l(`bento.diff.created`,{defaultValue:`Created in this version`}):l(`bento.diff.deleted`,{defaultValue:`Deleted in this version`})}),p.length===0&&(0,a.jsx)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:l(`bento.diff.noChanges`,{defaultValue:`No field changed`})}),(0,a.jsx)(`dl`,{className:`m-0 flex flex-col gap-3`,children:p.map(e=>(0,a.jsx)(ee,{label:e.field.label,status:h[e.state],state:e.state,children:(0,a.jsx)(te,{row:e})},e.field.id))}),m.length>0&&(0,a.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,a.jsxs)(`button`,{type:`button`,"aria-expanded":u?`true`:`false`,onClick:()=>d(!u),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`,children:[(0,a.jsx)(s.IconChevronRight,{size:14,"aria-hidden":`true`,className:e.t(`transition-transform`,u&&`rotate-90`)}),l(`bento.diff.unchangedCount`,{defaultValue:`{{count}} unchanged`,count:m.length})]}),u&&(0,a.jsx)(`dl`,{className:`m-0 flex flex-col gap-3`,children:m.map(e=>(0,a.jsx)(ee,{label:e.field.label,status:h.unchanged,state:`unchanged`,children:(0,a.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm text-muted-foreground`,children:e.kind===`rich`?L(R(e.b)).join(`
|
|
4
|
+
|
|
5
|
+
`):e.field.format?e.field.format(e.b):R(e.b)})},e.field.id))})]})]})}function ee({label:t,status:n,state:r,children:i}){return(0,a.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card/40 p-3`,children:[(0,a.jsxs)(`dt`,{className:`mb-1.5 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,a.jsx)(`span`,{children:t}),(0,a.jsx)(`span`,{className:e.t(`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`),children:n})]}),(0,a.jsx)(`dd`,{className:`m-0`,children:i})]})}function te({row:e}){let{t}=(0,o.useTranslation)(),{field:n,a:r,b:i,kind:s,state:c}=e;if(s===`value`){let e=e=>n.format?n.format(e):R(e);return(0,a.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[c!==`added`&&(0,a.jsx)(V,{children:e(r)}),c===`changed`&&(0,a.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),c!==`removed`&&(0,a.jsx)(B,{children:e(i)})]})}let l=s===`rich`?L(R(r)):[R(r)].filter(Boolean),u=s===`rich`?L(R(i)):[R(i)].filter(Boolean),d=F(l,u,!1)??[...l.map(e=>({op:`remove`,text:e})),...u.map(e=>({op:`add`,text:e}))],f=[];for(let e=0;e<d.length;e++){let t=d[e],n=d[e+1];if(t.op===`remove`&&n?.op===`add`){let r=F(I(t.text),I(n.text));f.push((0,a.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm leading-relaxed`,children:r?r.map((e,t)=>e.op===`same`?(0,a.jsx)(`span`,{children:e.text},t):e.op===`add`?(0,a.jsx)(B,{children:e.text},t):(0,a.jsx)(V,{children:e.text},t)):[(0,a.jsx)(V,{children:t.text},`r`),` `,(0,a.jsx)(B,{children:n.text},`a`)]},e)),e++}else f.push((0,a.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm leading-relaxed`,children:t.op===`same`?t.text:t.op===`add`?(0,a.jsx)(B,{children:t.text}):(0,a.jsx)(V,{children:t.text})},e))}return f.length===0?(0,a.jsx)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:t(`bento.diff.empty`,{defaultValue:`Empty`})}):(0,a.jsx)(`div`,{className:`flex flex-col gap-2`,children:f})}function B({children:e}){let{t}=(0,o.useTranslation)();return(0,a.jsxs)(`ins`,{className:`bento-status bento-status-on rounded-sm px-0.5 underline decoration-2 underline-offset-2`,children:[(0,a.jsxs)(`span`,{className:`sr-only`,children:[t(`bento.diff.addedStart`,{defaultValue:`added:`}),` `]}),e]})}function V({children:e}){let{t}=(0,o.useTranslation)();return(0,a.jsxs)(`del`,{className:`bento-status bento-status-error rounded-sm px-0.5 line-through decoration-2`,children:[(0,a.jsxs)(`span`,{className:`sr-only`,children:[t(`bento.diff.removedStart`,{defaultValue:`removed:`}),` `]}),e]})}var H={LARGE:`col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2`,MEDIUM:`col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,SMALL:`col-span-1 row-span-1`},U={SMALL:`MEDIUM`,MEDIUM:`LARGE`,LARGE:`SMALL`};function ne(e,t,n){if(!n||n.length===0)return e.map((e,n)=>({item:e,key:t(e),emphasis:n===0?`LARGE`:`MEDIUM`}));let r=new Map,i=new Map;for(let e of n)r.set(e.itemId,e.displayOrder),i.set(e.itemId,e.emphasis);return e.map((e,n)=>({item:e,key:t(e),idx:n})).sort((e,t)=>{let n=r.has(e.key)?r.get(e.key):2**53-1,i=r.has(t.key)?r.get(t.key):2**53-1;return n===i?e.idx-t.idx:n-i}).map(({item:e,key:t})=>({item:e,key:t,emphasis:i.get(t)??`MEDIUM`}))}function W(e){return e.map((e,t)=>({itemId:e.key,emphasis:e.emphasis,displayOrder:t}))}function G({to:e,emphasis:t,featured:n,defaultIcon:r,icon:i,tone:s=`indigo`,title:u,description:d,meta:f,enabled:p,hasStatus:m=!1,viewTransitionName:h}){let{t:g}=(0,o.useTranslation)(),_=x(s),v=t??(n?`LARGE`:`MEDIUM`),y=v===`LARGE`,b=v===`SMALL`,S=H[v],C=p===1,w=y?`p-6 md:p-7`:b?`p-4`:`p-5`,T=y?`h-14 w-14`:b?`h-8 w-8`:`h-9 w-9`,E=y?28:b?16:18,D=y?`text-xl md:text-2xl`:b?`text-sm`:`text-base md:text-lg`;return(0,a.jsxs)(l.Link,{to:e,className:`bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${y?`gap-5`:`gap-4`} overflow-hidden ${w} ${S}`,style:h?{viewTransitionName:h}:void 0,children:[y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_} opacity-40 blur-2xl dark:opacity-50`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,a.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,a.jsx)(`span`,{className:`grid place-items-center rounded-2xl ${_} text-white shadow-md ${T}`,children:i?(0,a.jsx)(c.Icon,{icon:i,className:y?`size-7 text-white`:`size-4.5 text-white`}):(0,a.jsx)(r,{size:E})}),m&&(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${C?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${C?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),C?g(`common.active`,{defaultValue:`Active`}):g(`common.idle`,{defaultValue:`Idle`})]})]}),(0,a.jsxs)(`div`,{className:`relative z-1`,children:[(0,a.jsx)(`div`,{className:`font-semibold tracking-tight ${D}`,children:u}),!b&&f&&(0,a.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:f}),!b&&d&&(0,a.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:d})]})]})}var K={query:``,facets:{}},q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),J=e=>Array.isArray(e)?e:[];function Y(e,t,n){let r={...e.facets};return n===void 0||Array.isArray(n)&&n.length===0||q(n)&&!n.from&&!n.to?delete r[t]:r[t]=n,{...e,facets:r}}function re({value:e,onChange:r,facets:c,queryLabel:l,queryDelay:u=300,views:d}){let{t:f}=(0,o.useTranslation)(),[p,m]=(0,i.useState)({source:e.query,text:e.query}),[h,g]=(0,i.useState)(null);p.source!==e.query&&m({source:e.query,text:e.query===h?p.text:e.query}),(0,i.useEffect)(()=>{if(p.text===e.query)return;let t=setTimeout(()=>{g(p.text),r({...e,query:p.text})},u);return()=>clearTimeout(t)},[p.text,e,r,u]);let _=[];for(let t of c){let n=e.facets[t.id];if(t.kind===`choice`)for(let r of J(n)){let i=t.options.find(e=>e.value===r);_.push({key:`${t.id}:${r}`,text:`${t.label}: ${i?.label??r}`,remove:()=>Y(e,t.id,J(n).filter(e=>e!==r))})}else q(n)&&(n.from||n.to)&&_.push({key:t.id,text:`${t.label}: ${n.from??`…`} – ${n.to??`…`}`,remove:()=>Y(e,t.id,void 0)})}let v=_.length>0||e.query!==``,y=l??f(`bento.filters.search`,{defaultValue:`Search`});return(0,a.jsxs)(`div`,{role:`search`,"aria-label":f(`bento.filters.label`,{defaultValue:`Filters`}),"data-slot":`bento-filter-bar`,className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,a.jsxs)(`div`,{className:`relative min-w-48 flex-1`,children:[(0,a.jsx)(s.IconSearch,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground`}),(0,a.jsx)(t.a,{type:`search`,value:p.text,placeholder:y,"aria-label":y,onChange:e=>m({...p,text:e.target.value}),className:`pl-9`})]}),c.map(t=>t.kind===`choice`?(0,a.jsx)(X,{facet:t,value:e,onChange:r},t.id):(0,a.jsx)(Z,{facet:t,value:e,onChange:r},t.id)),d]}),v&&(0,a.jsxs)(`ul`,{className:`m-0 flex list-none flex-wrap items-center gap-1.5 p-0`,"aria-label":f(`bento.filters.active`,{defaultValue:`Active filters`}),children:[_.map(e=>(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,"aria-label":f(`bento.filters.remove`,{defaultValue:`Remove filter {{filter}}`,filter:e.text}),onClick:()=>r(e.remove()),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`,children:[e.text,(0,a.jsx)(s.IconX,{size:12,"aria-hidden":`true`})]})},e.key)),(0,a.jsx)(`li`,{children:(0,a.jsx)(n.R,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>{m({source:``,text:``}),r(K)},children:f(`bento.filters.clearAll`,{defaultValue:`Clear all`})})})]})]})}function ie({label:e,count:t,...r}){return(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,className:`gap-1.5`,...r,children:[e,t>0&&(0,a.jsx)(`span`,{className:`rounded-full bg-primary px-1.5 text-[0.6875rem] leading-4 text-primary-foreground`,children:t}),(0,a.jsx)(s.IconChevronDown,{size:14,"aria-hidden":`true`})]})}function X({facet:e,value:t,onChange:r}){let i=J(t.facets[e.id]);return(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsx)(ie,{label:e.label,count:i.length})}),(0,a.jsx)(n.w,{align:`start`,className:`bento-dropdown min-w-44 p-1.5`,children:e.multiple?e.options.map(o=>(0,a.jsx)(n.C,{checked:i.includes(o.value),onCheckedChange:n=>r(Y(t,e.id,n===!0?[...i,o.value]:i.filter(e=>e!==o.value))),onSelect:e=>e.preventDefault(),children:o.label},o.value)):(0,a.jsx)(n.k,{value:i[0]??``,onValueChange:n=>r(Y(t,e.id,n===i[0]?[]:[n])),children:e.options.map(e=>(0,a.jsx)(n.A,{value:e.value,children:e.label},e.value))})})]})}function Z({facet:e,value:r,onChange:s}){let{t:c}=(0,o.useTranslation)(),l=r.facets[e.id],u=q(l)?l:{},[d,f]=(0,i.useState)(!1),[p,m]=(0,i.useState)(u.from??``),[h,g]=(0,i.useState)(u.to??``),_=(0,i.useId)(),v=(0,i.useId)();return(0,a.jsxs)(n.m,{open:d,onOpenChange:e=>{e&&(m(u.from??``),g(u.to??``)),f(e)},children:[(0,a.jsx)(n.b,{asChild:!0,children:(0,a.jsx)(ie,{label:e.label,count:u.from||u.to?1:0})}),(0,a.jsx)(n.g,{align:`start`,className:`bento-dropdown w-64 p-3`,children:(0,a.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:t=>{t.preventDefault(),s(Y(r,e.id,{from:p||void 0,to:h||void 0})),f(!1)},children:[(0,a.jsx)(`label`,{htmlFor:_,className:`text-xs text-muted-foreground`,children:c(`bento.filters.from`,{defaultValue:`From`})}),(0,a.jsx)(t.a,{id:_,type:`date`,value:p,max:h||void 0,onChange:e=>m(e.target.value)}),(0,a.jsx)(`label`,{htmlFor:v,className:`text-xs text-muted-foreground`,children:c(`bento.filters.to`,{defaultValue:`To`})}),(0,a.jsx)(t.a,{id:v,type:`date`,value:h,min:p||void 0,onChange:e=>g(e.target.value)}),(0,a.jsx)(n.R,{type:`submit`,size:`sm`,className:`mt-1`,children:c(`bento.filters.apply`,{defaultValue:`Apply`})})]})})]})}var ae=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function oe({items:e,error:t,tryAgainUrl:c,listId:l,eyebrow:u,backTo:d,backLabel:f,heroIcon:p,title:m,subtitle:h,tone:g=`indigo`,headerAction:_,newRoute:v,newLabel:y,newSubtitle:b,hideNew:S=!1,itemKey:C,renderTile:w,emptyTitle:T,emptyDescription:E,layout:D}){let{t:k}=(0,o.useTranslation)(),A=x(g),[j,M]=(0,i.useState)(!1),N=(0,i.useMemo)(()=>ne(e??[],C,D?.data?.entries),[e,C,D?.data?.entries]),P=!!l&&!!D&&(e?.length??0)>0;return(0,a.jsxs)(r.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:c,children:[(0,a.jsx)(O,{eyebrow:u,backTo:d,backLabel:f,leading:(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${A} text-white shadow-md`,children:(0,a.jsx)(p,{size:24})}),title:m,subtitle:h}),(_||P&&!j)&&(0,a.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[_,P&&!j&&(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,onClick:()=>M(!0),className:`ml-auto gap-2`,children:[(0,a.jsx)(s.IconAdjustmentsHorizontal,{size:16}),k(`bento.layout.customize`,{defaultValue:`Customize layout`})]})]}),j&&l&&D?(0,a.jsx)(ce,{layout:D,resolved:N,canEditGlobal:D?.data?.canEditGlobal??!1,isCustomized:D?.data?.source===`USER`,renderTile:w,chip:A,hideNew:S,newRoute:v,newLabel:y,newSubtitle:b,onClose:()=>M(!1)}):(0,a.jsx)(se,{resolved:N,renderTile:w,chip:A,hideNew:S,newRoute:v,newLabel:y,newSubtitle:b,isEmpty:e?.length===0,emptyTitle:T,emptyDescription:E})]})}function Q({items:e,error:t,tryAgainUrl:n,tone:i=`indigo`,newRoute:o,newLabel:s,newSubtitle:c,hideNew:l=!1,itemKey:u,renderTile:d,emptyTitle:f,emptyDescription:p}){let m=x(i);return(0,a.jsx)(r.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:n,children:(0,a.jsxs)(`div`,{className:ae,children:[!l&&o&&s?(0,a.jsx)(de,{route:o,label:s,subtitle:c,chip:m}):null,(e??[]).map(e=>(0,a.jsx)(`span`,{className:`contents`,children:d(e)},u(e))),e?.length===0&&(0,a.jsx)(fe,{title:f,description:p})]})})}function se({resolved:t,renderTile:n,chip:r,hideNew:i,newRoute:o,newLabel:s,newSubtitle:c,isEmpty:l,emptyTitle:u,emptyDescription:d}){let f=t.some(e=>e.emphasis===`SMALL`);return(0,a.jsxs)(`div`,{className:e.t(ae,f&&`grid-flow-dense`),children:[!i&&(0,a.jsx)(de,{route:o,label:s,subtitle:c,chip:r}),t.map(({item:e,key:t,emphasis:r})=>(0,a.jsx)(`span`,{className:`contents`,children:n(e,r)},t)),l&&(0,a.jsx)(fe,{title:u,description:d})]})}function ce({layout:t,resolved:r,canEditGlobal:c,isCustomized:l,renderTile:u,chip:p,hideNew:m,newRoute:h,newLabel:g,newSubtitle:_,onClose:v}){let{t:y}=(0,o.useTranslation)(),[b,x]=(0,i.useState)(r),[S,C]=(0,i.useState)(null),w=(t.saving??!1)||S!==null,T=e=>w&&S===e?{loading:!0}:{"aria-disabled":w||void 0},[E,D]=(0,i.useState)(!1),O=(e,t)=>async()=>{if(t){C(e),D(!1);try{await t(),v()}catch(e){console.error(`Failed to save the bento layout`,e),D(!0)}finally{C(null)}}},k=(0,d.useSensors)((0,d.useSensor)(d.PointerSensor,{activationConstraint:{distance:8}}),(0,d.useSensor)(d.KeyboardSensor));function A(e){let{active:t,over:n}=e;!n||t.id===n.id||x(e=>{let r=e.findIndex(e=>e.key===t.id),i=e.findIndex(e=>e.key===n.id);return r<0||i<0?e:(0,f.arrayMove)(e,r,i)})}function j(e,t){x(n=>n.map(n=>n.key===e?{...n,emphasis:t}:n))}let M=(0,i.useMemo)(()=>W(b),[b]),N=b.some(e=>e.emphasis===`SMALL`);return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md`,children:[(0,a.jsx)(`span`,{className:`mr-auto text-sm text-muted-foreground`,children:y(`bento.layout.editHint`,{defaultValue:`Drag tiles to reorder · tap the size button to resize`})}),l&&t.onReset&&(0,a.jsxs)(n.R,{variant:`ghost`,size:`sm`,className:`gap-2`,...T(`reset`),onClick:O(`reset`,t.onReset),children:[S!==`reset`&&(0,a.jsx)(s.IconArrowBackUp,{size:16}),y(`bento.layout.reset`,{defaultValue:`Reset to default`})]}),c&&t.onSaveGlobal&&(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,className:`gap-2`,...T(`global`),onClick:O(`global`,()=>t.onSaveGlobal?.(M)),children:[S!==`global`&&(0,a.jsx)(s.IconUsers,{size:16}),y(`bento.layout.saveGlobal`,{defaultValue:`Set as default for everyone`})]}),(0,a.jsxs)(n.R,{variant:`ghost`,size:`sm`,className:`gap-2`,...T(`cancel`),onClick:v,children:[(0,a.jsx)(s.IconX,{size:16}),y(`common.cancel`,{defaultValue:`Cancel`})]}),(0,a.jsxs)(n.R,{size:`sm`,className:`gap-2`,...T(`save`),onClick:O(`save`,()=>t.onSave(M)),children:[S!==`save`&&(0,a.jsx)(s.IconDeviceFloppy,{size:16}),y(`bento.layout.save`,{defaultValue:`Save layout`})]}),E&&(0,a.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-destructive`,children:y(`bento.layout.saveFailed`,{defaultValue:`The layout could not be saved. Nothing has changed — try again.`})})]}),(0,a.jsx)(d.DndContext,{sensors:k,collisionDetection:d.closestCenter,onDragEnd:A,children:(0,a.jsx)(f.SortableContext,{items:b.map(e=>e.key),strategy:f.rectSortingStrategy,children:(0,a.jsxs)(`div`,{className:e.t(ae,N&&`grid-flow-dense`),children:[!m&&(0,a.jsx)(de,{route:h,label:g,subtitle:_,chip:p}),b.map(({item:e,key:t,emphasis:n})=>(0,a.jsx)($,{id:t,emphasis:n,onSetEmphasis:e=>j(t,e),children:u(e,n)},t))]})})})]})}var le=[`SMALL`,`MEDIUM`,`LARGE`],ue={SMALL:{key:`bento.layout.size.small`,def:`Small`},MEDIUM:{key:`bento.layout.size.medium`,def:`Medium`},LARGE:{key:`bento.layout.size.large`,def:`Large`}};function $({id:t,emphasis:n,onSetEmphasis:r,children:i}){let{t:c}=(0,o.useTranslation)(),{attributes:l,listeners:u,setNodeRef:d,transform:m,transition:h,isDragging:g}=(0,f.useSortable)({id:t}),_={transform:p.CSS.Translate.toString(m),transition:h,opacity:g?.6:1,zIndex:g?50:void 0};return(0,a.jsxs)(`div`,{ref:d,style:_,className:e.t(`relative h-full`,H[n]),children:[(0,a.jsx)(`div`,{className:`pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full`,children:i}),(0,a.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1`,children:[(0,a.jsx)(`div`,{role:`group`,"aria-label":c(`bento.layout.sizeGroup`,{defaultValue:`Tile size`}),className:`flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur`,children:le.map(t=>{let i=t===n,o=c(ue[t].key,{defaultValue:ue[t].def});return(0,a.jsx)(`button`,{type:`button`,onClick:()=>r(t),"aria-pressed":i,"aria-label":o,title:o,className:e.t(`grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors`,i?`bg-primary text-primary-foreground shadow`:`text-muted-foreground hover:bg-muted`),children:o.charAt(0)},t)})}),(0,a.jsx)(`button`,{type:`button`,...l,...u,"aria-label":c(`bento.layout.dragToReorder`,{defaultValue:`Drag to reorder`}),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`,children:(0,a.jsx)(s.IconGripVertical,{size:14,className:`text-muted-foreground`})})]})]})}function de({route:e,label:t,subtitle:n,chip:r}){let{t:i}=(0,o.useTranslation)();return(0,a.jsxs)(l.Link,{to:e,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`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`span`,{className:`bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,children:(0,a.jsx)(s.IconPlus,{size:20})}),(0,a.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:i(`forms.formActions.new`,{defaultValue:`New`})})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`text-base font-semibold tracking-tight md:text-lg`,children:(0,a.jsx)(`span`,{className:`${r} bg-clip-text text-transparent`,children:t})}),n&&(0,a.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]})}function fe({title:e,description:t}){return(0,a.jsx)(E,{icon:s.IconSparkles,title:e,description:t,align:`start`,className:`col-span-2 row-span-2 justify-end md:col-span-4`})}function pe({title:e,badges:n,actions:r,onCancel:i,loading:c,disabled:l,dirty:u,titleMissing:d}){let{t:f}=(0,o.useTranslation)();return(0,a.jsxs)(`div`,{className:`bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl`,children:[(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[e&&(0,a.jsx)(`p`,{className:`truncate text-base font-semibold tracking-tight md:text-lg`,children:e}),(0,a.jsx)(j,{titleMissing:d,dirty:u}),n&&(0,a.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n})]}),(0,a.jsx)(`div`,{className:`flex shrink-0 gap-2`,children:r??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.o,{type:`submit`,size:`sm`,loading:c,"aria-disabled":l?`true`:void 0,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),f(`forms.formActions.saveChanges`)]}),i&&(0,a.jsxs)(t.o,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:[(0,a.jsx)(s.IconX,{className:`size-4`}),f(`forms.formActions.cancel`)]})]})})]})}function me({children:e}){return(0,a.jsx)(`span`,{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`,children:e})}pe.Badge=me;function he(e){let t=(0,i.useRef)(null);return M(t),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{ref:t,"aria-hidden":!0,className:`h-px`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`bento-save-bar-spacer`}),(0,a.jsx)(`div`,{className:`bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8`,children:(0,a.jsx)(pe,{...e})})]})}function ge({eyebrow:e,backTo:n,backLabel:r,leading:i,title:c,subtitle:l,trailing:u,onCancel:d,actions:f,loading:p,dirty:m,titleMissing:h,saveDisabled:g,stickyTitle:_,stickyBadges:v}){let{t:y}=(0,o.useTranslation)(),b=g??(!!h||!m);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{eyebrow:n===void 0?e:(0,a.jsx)(D,{to:n,children:r}),leading:i,title:c,subtitle:l,trailing:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:f??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.o,{type:`submit`,size:`sm`,loading:p,"aria-disabled":b?`true`:void 0,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),y(`forms.formActions.saveChanges`)]}),(0,a.jsxs)(t.o,{type:`button`,variant:`outline`,size:`sm`,onClick:d,children:[(0,a.jsx)(s.IconX,{className:`size-4`}),y(`forms.formActions.cancel`)]})]})}),u]})}),(0,a.jsx)(he,{title:_,badges:v,actions:f,onCancel:d,loading:p,disabled:b,dirty:m,titleMissing:h})]})}var _e=`bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6`;function ve({icon:t,tone:n,title:r,description:i,children:o,trailing:s,as:c=`h2`,className:l}){return(0,a.jsxs)(`section`,{className:e.t(_e,l),children:[(0,a.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${x(n)}`,children:(0,a.jsx)(t,{size:20})}),(0,a.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,a.jsx)(c,{className:`text-base font-semibold tracking-tight md:text-lg`,children:r}),i&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i})]})]}),s&&(0,a.jsx)(`div`,{className:`shrink-0`,children:s})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-5`,children:o})]})}function ye({children:t,className:n,contentClassName:r}){return(0,a.jsx)(`div`,{className:e.t(`bento-glass rounded-2xl shadow-md`,n),children:(0,a.jsx)(`div`,{className:r,children:t})})}var be=480;function xe(e){return window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)}function Se(){return window.scrollY>be}function Ce({inline:e=!1}={}){let{t}=(0,o.useTranslation)(),r=n.i(),c=e||r,l=(0,i.useSyncExternalStore)(xe,Se,()=>!1);return(0,a.jsx)(`button`,{type:`button`,"aria-label":t(`bento.backToTop`,{defaultValue:`Back to top`}),tabIndex:l?0:-1,onClick:()=>window.scrollTo({top:0,behavior:`smooth`}),className:`${c?`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 ${l?`pointer-events-auto translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-4 scale-90 opacity-0`}`,children:(0,a.jsx)(s.IconArrowUp,{size:18})})}function we(e){return e.bentoRoute??e.fallbackRoute}function Te({label:e,children:t}){return e?(0,a.jsxs)(`div`,{role:`group`,"aria-label":e,children:[(0,a.jsx)(`p`,{className:`px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground`,children:e}),t]}):(0,a.jsx)(a.Fragment,{children:t})}function Ee({index:e,active:t,icon:n,label:r,description:i,trailing:o,onActivate:c,onChoose:l}){return(0,a.jsxs)(`button`,{type:`button`,id:`bento-palette-opt-${e}`,"data-index":e,role:`option`,"aria-selected":t?`true`:`false`,onMouseEnter:c,onClick:l,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`}`,children:[n&&(0,a.jsx)(n,{size:18,className:`shrink-0 text-muted-foreground`}),(0,a.jsxs)(`span`,{className:`flex-1 truncate`,children:[r,i&&(0,a.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:i})]}),o??(t&&(0,a.jsx)(s.IconArrowRight,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground`}))]})}function De({open:e,onOpenChange:n,items:r,group:c,onQueryChange:u}){let{t:d}=(0,o.useTranslation)(),f=(0,l.useNavigate)(),[p,m]=(0,i.useState)(``),[h,g]=(0,i.useState)(0),_=(0,i.useRef)(null),v=(0,i.useMemo)(()=>{let e=p.trim().toLowerCase(),t=r.map(e=>({item:e,label:d(e.titleKey),description:d(e.descriptionKey)}));if(!e)return t;let n=[],i=[];for(let r of t)r.label.toLowerCase().includes(e)?n.push(r):r.description.toLowerCase().includes(e)&&i.push(r);return[...n,...i]},[r,p,d]),y=(0,i.useMemo)(()=>[...v.map(e=>({kind:`nav`,entry:e})),...(c?.items??[]).map(e=>({kind:`supplied`,item:e}))],[v,c]),b=(0,i.useRef)(u);(0,i.useEffect)(()=>{b.current=u}),(0,i.useEffect)(()=>{b.current?.(p)},[p]);let[x,S]=(0,i.useState)(e);e!==x&&(S(e),e&&(m(``),g(0)));let C=y.length===0?0:y.length-1;h>C&&g(C),(0,i.useEffect)(()=>{(_.current?.querySelector(`[data-index="${h}"]`))?.scrollIntoView({block:`nearest`})},[h]);function w(e){n(!1),e.kind===`nav`?f(we(e.entry.item)):c?.onSelect(e.item)}function T(e){if(e.key===`ArrowDown`)e.preventDefault(),g(e=>y.length===0?0:(e+1)%y.length);else if(e.key===`ArrowUp`)e.preventDefault(),g(e=>y.length===0?0:(e-1+y.length)%y.length);else if(e.key===`Enter`){e.preventDefault();let t=y[h];t&&w(t)}}return(0,a.jsx)(t.c,{open:e,onOpenChange:n,children:(0,a.jsxs)(t.u,{showCloseButton:!1,className:`top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0`,onKeyDown:T,children:[(0,a.jsx)(t.g,{className:`sr-only`,children:d(`bento.palette.title`,{defaultValue:`Command palette`})}),(0,a.jsx)(t.d,{className:`sr-only`,children:d(`bento.palette.description`,{defaultValue:`Search and jump to any area`})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4`,children:[(0,a.jsx)(s.IconSearch,{size:18,className:`shrink-0 text-muted-foreground`}),(0,a.jsx)(`input`,{autoFocus:!0,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`bento-palette-list`,"aria-activedescendant":y[h]?`bento-palette-opt-${h}`:void 0,value:p,onChange:e=>m(e.target.value),placeholder:d(`bento.palette.placeholder`,{defaultValue:`Search areas…`}),className:`h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,a.jsxs)(`div`,{ref:_,id:`bento-palette-list`,role:`listbox`,"aria-label":d(`bento.palette.title`,{defaultValue:`Command palette`}),className:`max-h-80 overflow-y-auto p-2`,children:[y.length===0&&!c?.pending&&(0,a.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:d(`bento.palette.noResults`,{defaultValue:`No matches`})}),(0,a.jsx)(Te,{label:c&&v.length>0?d(`bento.palette.areas`,{defaultValue:`Areas`}):void 0,children:v.map(({item:e,label:t},n)=>(0,a.jsx)(Ee,{index:n,active:n===h,icon:e.icon,label:t,onActivate:()=>g(n),onChoose:()=>w(y[n]),trailing:e.bentoRoute?void 0:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.IconExternalLink,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground/70`}),(0,a.jsx)(`span`,{className:`sr-only`,children:d(`bento.palette.opensConsole`,{defaultValue:`Opens in console`})})]})},e.id))}),c&&(0,a.jsxs)(Te,{label:c.label,children:[c.items.map((e,t)=>{let n=v.length+t;return(0,a.jsx)(Ee,{index:n,active:n===h,icon:e.icon,label:e.label,description:e.description,onActivate:()=>g(n),onChoose:()=>w(y[n])},e.id)}),c.pending&&(0,a.jsx)(`p`,{className:`px-3 py-2.5 text-sm text-muted-foreground`,children:d(`bento.palette.searching`,{defaultValue:`Searching…`})})]})]})]})})}function Oe({rail:t,headerStart:r,headerEnd:s,column:c=`default`,dock:u,backToTop:d=!0,children:f}){let{t:p}=(0,o.useTranslation)(),m=(0,l.useInRouterContext)(),h=(0,i.useId)(),g=(0,i.useRef)(null),_=(0,i.useRef)(null),v=c===`full`,y=r!=null||s!=null,b=d||u!=null;return(0,a.jsxs)(`div`,{"data-slot":`bento-shell`,className:e.t(`relative w-full bg-background text-foreground`,t!=null&&`bento-rail-gutter`,v?`flex h-svh flex-col overflow-hidden`:`min-h-svh`),children:[(0,a.jsx)(`a`,{href:`#${h}`,onClick:e=>{e.preventDefault(),g.current?.focus()},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]`,children:p(`bento.shell.skip`,{defaultValue:`Skip to content`})}),(0,a.jsx)(`span`,{ref:_,role:`status`,"aria-live":`polite`,className:`sr-only`}),m&&(0,a.jsx)(ke,{main:g,announcer:_}),t,y&&(0,a.jsxs)(`header`,{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`,children:[(0,a.jsx)(`div`,{className:`flex min-w-0 items-center gap-3`,children:r}),(0,a.jsx)(`div`,{className:`flex items-center gap-2`,children:s})]}),(0,a.jsx)(`main`,{ref:g,id:h,tabIndex:-1,"aria-label":p(`bento.shell.main`,{defaultValue:`Main content`}),"data-column":c,className:`bento-shell-main`,children:f}),b&&(0,a.jsx)(`div`,{"data-slot":`bento-shell-corner`,className:`pointer-events-none fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3`,children:(0,a.jsxs)(n.r.Provider,{value:!0,children:[d&&(0,a.jsx)(Ce,{}),u]})})]})}function ke({main:e,announcer:t}){let{pathname:n}=(0,l.useLocation)(),r=(0,i.useRef)(n);return(0,i.useEffect)(()=>{if(r.current===n)return;r.current=n;let i=0,a,o=()=>{let n=e.current?.querySelector(`h1`)??null;if(!n&&i++<20){a=setTimeout(o,50);return}n&&!n.hasAttribute(`tabindex`)&&n.setAttribute(`tabindex`,`-1`),(n??e.current)?.focus(),t.current&&(t.current.textContent=n?.textContent?.trim()||document.title)};return o(),()=>clearTimeout(a)},[n,e,t]),null}var Ae=Object.freeze([{action:`palette`,key:`k`,mod:!0},{action:`palette`,key:`/`},{action:`shortcuts`,key:`?`}]);function je(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent||``)}function Me(e,t){let n=e.key.length===1?e.key.toUpperCase():e.key;return e.mod?[t?`⌘`:`Ctrl`,n]:[n]}function Ne(e){if(!(e instanceof HTMLElement))return!1;if([`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName)||e.isContentEditable)return!0;let t=e.closest(`[contenteditable]`);return t!==null&&t.getAttribute(`contenteditable`)!==`false`}function Pe(e,t){if(e.defaultPrevented||e.isComposing||e.repeat)return;let n=e.key.toLowerCase();return Ae.find(r=>n===r.key?r.mod?(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey:e.metaKey||Ne(e.target)?!1:e.ctrlKey===e.altKey:!1)}function Fe({onPalette:e,onShortcuts:t,isMac:n=je()}){let r=(0,i.useRef)({onPalette:e,onShortcuts:t});(0,i.useEffect)(()=>{r.current={onPalette:e,onShortcuts:t}}),(0,i.useEffect)(()=>{function e(e){let t=Pe(e,n),i=t?.action===`palette`?r.current.onPalette:t&&r.current.onShortcuts;i&&(e.preventDefault(),i())}return globalThis.addEventListener(`keydown`,e),()=>globalThis.removeEventListener(`keydown`,e)},[n])}function Ie({onClick:t,isMac:n=je(),className:r}){let{t:i}=(0,o.useTranslation)(),c=Ae.filter(e=>e.action===`palette`),l=c.find(e=>e.mod);return(0,a.jsxs)(`button`,{type:`button`,onClick:t,"aria-keyshortcuts":c.map(e=>e.mod?`${n?`Meta`:`Control`}+${e.key.toUpperCase()}`:e.key).join(` `),className:e.t(`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),children:[(0,a.jsx)(s.IconSearch,{"aria-hidden":!0,size:16}),(0,a.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:i(`bento.palette.search`,{defaultValue:`Search`})}),l&&(0,a.jsx)(`kbd`,{"aria-hidden":!0,className:`hidden rounded border border-border/60 bg-muted px-1.5 py-0.5 text-[10px] font-medium tracking-wide sm:inline`,children:Me(l,n).join(n?``:` `)})]})}function Le({open:e,onOpenChange:n,isMac:r=je()}){let{t:c}=(0,o.useTranslation)(),l={palette:c(`bento.palette.open`,{defaultValue:`Open command palette`}),shortcuts:c(`bento.shortcuts.openGuide`,{defaultValue:`Show keyboard shortcuts`})},u=[...new Set(Ae.map(e=>e.action))],d=[{heading:c(`bento.shortcuts.global`,{defaultValue:`Global`}),rows:u.map(e=>({id:e,label:l[e],combos:Ae.filter(t=>t.action===e).map(e=>Me(e,r))}))},{heading:c(`bento.shortcuts.palette`,{defaultValue:`Command palette`}),rows:[{id:`navigate`,combos:[[`↑`,`↓`]],label:c(`bento.shortcuts.navigate`,{defaultValue:`Move between results`})},{id:`open`,combos:[[`↵`]],label:c(`bento.shortcuts.openSelected`,{defaultValue:`Open the selected area`})},{id:`dismiss`,combos:[[`Esc`]],label:c(`bento.shortcuts.dismiss`,{defaultValue:`Close the palette or a dialog`})}]}];return(0,a.jsx)(t.c,{open:e,onOpenChange:n,children:(0,a.jsxs)(t.u,{className:`max-w-md`,children:[(0,a.jsxs)(t.p,{children:[(0,a.jsxs)(t.g,{className:`flex items-center gap-2`,children:[(0,a.jsx)(s.IconKeyboard,{size:20,className:`bento-accent-icon`}),c(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]}),(0,a.jsx)(t.d,{children:c(`bento.shortcuts.description`,{defaultValue:`Move around without leaving the keyboard.`})})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-5`,children:d.map(e=>(0,a.jsxs)(`section`,{children:[(0,a.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.heading}),(0,a.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.rows.map(e=>(0,a.jsxs)(`li`,{"data-shortcut":e.id,className:`flex items-center justify-between gap-4`,children:[(0,a.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,a.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.combos.map((e,t)=>(0,a.jsxs)(i.Fragment,{children:[t>0&&(0,a.jsx)(`span`,{className:`px-0.5 text-[11px] text-muted-foreground`,children:c(`bento.shortcuts.or`,{defaultValue:`or`})}),e.map(e=>(0,a.jsx)(`kbd`,{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`,children:e},e))]},e.join(`+`)))})]},e.id))})]},e.heading))})]})})}var Re=s.IconLayoutGrid;function ze(e,t){return e===t||e.startsWith(`${t}/`)}function Be(e,t){return t.section.areaRoute&&ze(e,t.section.areaRoute)?!0:t.items.some(t=>t.bentoRoute&&ze(e,t.bentoRoute))}function Ve({groups:e,homeRoute:t,homeAliases:r,homeLabel:c}){let{t:u}=(0,o.useTranslation)(),{pathname:d}=(0,l.useLocation)(),f=(0,i.useMemo)(()=>e.filter(e=>!!e.section.areaRoute),[e]),p=d===t||(r?.includes(d)??!1);return(0,a.jsx)(n.u,{delayDuration:200,children:(0,a.jsxs)(`nav`,{"aria-label":u(`bento.nav.label`,{defaultValue:`Primary`}),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`,children:[(0,a.jsx)(He,{to:t,icon:s.IconHome,label:c??u(`home.title`,{defaultValue:`Home`}),active:p}),f.length>0&&(0,a.jsx)(`span`,{"aria-hidden":!0,className:`my-1 h-px w-6 bg-border/60`}),f.map(e=>(0,a.jsx)(He,{to:e.section.areaRoute,icon:e.section.icon??Re,label:e.section.labelKey?u(e.section.labelKey):e.section.id,active:Be(d,e)},e.section.id))]})})}function He({to:e,icon:t,label:r,active:i}){return(0,a.jsxs)(n.c,{children:[(0,a.jsx)(n.d,{asChild:!0,children:(0,a.jsx)(l.Link,{to:e,"aria-label":r,"aria-current":i?`page`:void 0,className:`bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${i?`bento-rail-active`:`border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground`}`,children:(0,a.jsx)(t,{size:20})})}),(0,a.jsx)(n.l,{side:`right`,children:r})]})}function Ue({accountRoute:e,logoutUrl:t,organizationsRoute:r,tenantAdminRoute:i,onOpenShortcuts:c,onReplayTour:u}){let{user:d,status:f}=n.n(),{t:p}=(0,o.useTranslation)(),m=(0,l.useNavigate)(),h=`${d.firstName??``} ${d.lastName??``}`.trim()||d.username||``;return f===`loading`?(0,a.jsx)(`div`,{className:`h-9 w-9 rounded-full bg-muted/40`,"aria-hidden":!0}):(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,title:h||d.username,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`,children:(0,a.jsx)(n.a,{givenName:d.firstName,familyName:d.lastName,name:h||d.username,src:d.avatarUrl||void 0,alt:d.username})})}),(0,a.jsxs)(n.w,{align:`end`,sideOffset:10,className:`bento-dropdown min-w-64 p-2`,children:[(0,a.jsx)(n.D,{className:`p-0 font-normal`,children:(0,a.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm`,children:[(0,a.jsx)(`span`,{className:`rounded-full p-0.5 ring-1 ring-border/60`,children:(0,a.jsx)(n.a,{givenName:d.firstName,familyName:d.lastName,name:h||d.username,src:d.avatarUrl||void 0,alt:d.username})}),(0,a.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[h&&(0,a.jsx)(`span`,{className:`truncate font-medium`,children:h}),d.email&&(0,a.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:d.email})]})]})}),(0,a.jsx)(n.j,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(n.T,{children:[(0,a.jsxs)(n.E,{onSelect:()=>m(e),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconUserCircle,{size:18}),p(`nav.account`)]}),r&&(0,a.jsxs)(n.E,{onSelect:()=>m(r),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconBuildingCommunity,{size:18}),p(`nav.organizations`,{defaultValue:`Organizations`})]}),i&&(0,a.jsxs)(n.E,{onSelect:()=>m(i),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconBuildingSkyscraper,{size:18}),p(`nav.tenantAdmin`,{defaultValue:`Tenant administration`})]})]}),(c||u)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.j,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(n.T,{children:[u&&(0,a.jsxs)(n.E,{onSelect:()=>u(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconSparkles,{size:18}),p(`bento.tour.replay`,{defaultValue:`Take the tour`})]}),c&&(0,a.jsxs)(n.E,{onSelect:()=>c(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconKeyboard,{size:18}),p(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]})]})]}),(0,a.jsx)(n.j,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(n.E,{onSelect:()=>{globalThis.location.href=t},className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger`,children:[(0,a.jsx)(s.IconLogout,{size:18}),p(`nav.logOut`)]})]})]})}var We={blue:`blue`,violet:`violet`,emerald:`emerald`,amber:`amber`,rose:`rose`,slate:`slate`,cyan:`blue`,orange:`amber`};function Ge({variant:t=`blue`,className:r,children:o}){let s;i.Children.forEach(o,e=>{if(!(0,i.isValidElement)(e))return;let{type:t}=e;(t===n.f.Header||t===n.f.StaticHeader)&&(s??=e.props)});let c=i.Children.map(o,e=>{if(!(0,i.isValidElement)(e))return e;let{type:t}=e;return t===n.f.Header||t===n.f.StaticHeader?null:t===n.f.Content?e.props.children:e});return s?(0,a.jsx)(ve,{icon:s.icon,tone:We[t]??`blue`,title:s.title,description:s.description,className:r,children:c}):(0,a.jsx)(`section`,{className:e.t(_e,r),children:c})}Ge.Header=n.f.Header,Ge.StaticHeader=n.f.StaticHeader,Ge.Content=n.f.Content;var Ke=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function qe({eyebrow:e,title:t,description:n,titleHref:r,children:i,gridClassName:o=Ke}){let c=(0,a.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight md:text-2xl`,children:t});return(0,a.jsxs)(`section`,{className:`mb-8 md:mb-10`,children:[(0,a.jsxs)(`header`,{className:`bento-shell-header mb-4 flex flex-col gap-0.5`,children:[e&&(0,a.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:e}),r?(0,a.jsxs)(l.Link,{to:r,className:`group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary`,children:[c,(0,a.jsx)(s.IconChevronRight,{size:20,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}):c,n&&(0,a.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:n})]}),(0,a.jsx)(`div`,{className:o,children:i})]})}function Je({to:t,onClick:n,disabled:r=!1,disabledHint:i,icon:o,tone:c,eyebrow:u,title:d,span:f,featured:p=!1,children:m}){let h=!r&&!!(t||n),g=p?`h-14 w-14 rounded-2xl`:`h-9 w-9 rounded-2xl`,_=p?28:18,v=p?`text-xl font-semibold tracking-tight md:text-2xl`:`text-base font-semibold tracking-tight md:text-lg`,y=(0,a.jsxs)(a.Fragment,{children:[p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${x(c)} opacity-40 blur-2xl dark:opacity-50`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${x(c)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,a.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,a.jsx)(`span`,{className:`grid place-items-center ${x(c)} text-white shadow-md ${g}`,children:(0,a.jsx)(o,{size:_})}),h&&(0,a.jsx)(s.IconChevronRight,{size:p?18:16,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}),(0,a.jsxs)(`div`,{className:`relative z-1`,children:[(0,a.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:u}),(0,a.jsx)(`div`,{className:`mt-0.5 ${v}`,children:d}),m&&(0,a.jsx)(`div`,{className:`mt-2`,children:m})]})]}),b=`bento-tile bento-glass group relative flex flex-col ${p?`gap-5`:`gap-4`} overflow-hidden text-left ${p?`p-6 md:p-7`:`p-5`} ${f}${h?` bento-tile-clickable`:``}${r?` cursor-not-allowed opacity-60`:``}`;return r?(0,a.jsx)(`div`,{className:b,"aria-disabled":`true`,title:i,children:y}):t?(0,a.jsx)(l.Link,{to:t,className:b,children:y}):n?(0,a.jsx)(`button`,{type:`button`,onClick:n,className:e.t(`w-full`,b),children:y}):(0,a.jsx)(`div`,{className:b,children:y})}function Ye({versions:t,selected:n,onSelect:r,label:c}){let{t:l,i18n:u}=(0,o.useTranslation)(),[d,f]=(0,i.useState)(0),[p,m]=(0,i.useState)([]),h=(0,i.useRef)(new Map),g=e=>[...e].sort((e,n)=>t.findIndex(e=>e.id===n)-t.findIndex(t=>t.id===e));function _(e){if(n.includes(e)){m(p.filter(t=>t!==e)),r(n.filter(t=>t!==e));return}let t=[...n.filter(e=>!p.includes(e)),...p.filter(e=>n.includes(e))],i=t.length>=2?t.slice(t.length-1):t;m([...i,e]),r(g([...i,e]))}function v(e){let n=Math.max(0,Math.min(t.length-1,e));f(n),h.current.get(n)?.focus()}function y(e,n){switch(e.key){case`ArrowDown`:v(n+1);break;case`ArrowUp`:v(n-1);break;case`Home`:v(0);break;case`End`:v(t.length-1);break;case` `:case`Enter`:_(t[n].id);break;default:return}e.preventDefault()}let b=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?{iso:void 0,text:String(e)}:{iso:t.toISOString(),text:new Intl.DateTimeFormat(u?.resolvedLanguage,{dateStyle:`medium`,timeStyle:`short`}).format(t)}};return(0,a.jsx)(`ul`,{role:`listbox`,"aria-label":c??l(`bento.versions.label`,{defaultValue:`Versions`}),"aria-multiselectable":`true`,"data-slot":`bento-version-rail`,className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.map((r,i)=>{let o=n.includes(r.id),c=b(r.at),u=r.actor===`agent`?s.IconRobot:s.IconUser;return(0,a.jsxs)(`li`,{ref:e=>{e?h.current.set(i,e):h.current.delete(i)},role:`option`,"aria-selected":o?`true`:`false`,tabIndex:i===Math.min(d,t.length-1)?0:-1,onKeyDown:e=>y(e,i),onClick:()=>{f(i),_(r.id)},className:e.t(`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`),children:[(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,a.jsx)(u,{size:14,"aria-hidden":`true`}),r.author,(0,a.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:r.actor===`agent`?l(`bento.versions.agent`,{defaultValue:`Agent`}):l(`bento.versions.human`,{defaultValue:`Person`})})]}),(0,a.jsx)(`time`,{dateTime:c.iso,className:`text-xs text-muted-foreground`,children:c.text}),r.summary&&(0,a.jsx)(`span`,{className:`text-xs`,children:r.summary})]},r.id)})})}exports.AdaptiveSectionCard=Ge,exports.BENTO_EMPHASIS_NEXT=U,exports.BENTO_EMPHASIS_SPAN=H,exports.BENTO_SHELL_SHORTCUTS=Ae,exports.BENTO_TONES=b,exports.BENTO_TONE_CLASS=y,exports.BentoActionsMenu=v,exports.BentoBackLink=D,exports.BentoBackToTop=Ce,exports.BentoCommandPalette=De,exports.BentoCountTile=S,exports.BentoDataTable=T,exports.BentoDiff=z,exports.BentoEmptyState=E,exports.BentoEntityShell=P,exports.BentoEntityTile=G,exports.BentoFilterBar=re,exports.BentoFormHero=ge,exports.BentoFormSection=ve,exports.BentoHero=O,exports.BentoHeroIconPicker=k,exports.BentoInlineEdit=A,exports.BentoListPage=oe,exports.BentoNavRail=Ve,exports.BentoPaletteTrigger=Ie,exports.BentoPanel=ye,exports.BentoSaveBar=pe,exports.BentoScrollSaveBar=he,exports.BentoSection=qe,exports.BentoShell=Oe,exports.BentoShortcutsDialog=Le,exports.BentoStatusMarker=j,exports.BentoTile=Je,exports.BentoTileGrid=Q,exports.BentoUserMenu=Ue,exports.BentoVersionRail=Ye,exports.EMPTY_FILTERS=K,exports.bentoChipClass=x,exports.bentoNavTarget=we,exports.resolveBentoLayout=ne,exports.toBentoLayoutEntries=W,exports.useBentoScrollFade=M,exports.useBentoShellShortcuts=Fe;
|