@pstdio/ui 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/{MermaidComponent-DBJsTOmj.js → MermaidComponent-BCMQqPqu.js} +11 -11
  2. package/dist/{MermaidComponent-DBJsTOmj.js.map → MermaidComponent-BCMQqPqu.js.map} +1 -1
  3. package/dist/browser-storage-BinyFNJX.js +40 -0
  4. package/dist/browser-storage-BinyFNJX.js.map +1 -0
  5. package/dist/chat-ui.js +1188 -1147
  6. package/dist/chat-ui.js.map +1 -1
  7. package/dist/checkbox-D5AzFRlb.js +70 -0
  8. package/dist/checkbox-D5AzFRlb.js.map +1 -0
  9. package/dist/components/chat-ui/components/ai-conversation.d.ts +1 -1
  10. package/dist/components/chat-ui/components/ai-message.d.ts +1 -1
  11. package/dist/components/chat-ui/components/ai-response.d.ts +0 -1
  12. package/dist/components/chat-ui/components/attachment-list.d.ts +1 -1
  13. package/dist/components/chat-ui/components/auto-scroll.d.ts +27 -0
  14. package/dist/components/chat-ui/components/chat-message-animation.d.ts +22 -0
  15. package/dist/components/chat-ui/components/timeline.d.ts +0 -2
  16. package/dist/components/chat-ui/performance/chat-performance-fixtures.d.ts +0 -1
  17. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -12
  18. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  19. package/dist/components/chat-ui/tool-rendering/types.d.ts +1 -2
  20. package/dist/components/command-palette/index.d.ts +4 -0
  21. package/dist/components/data-renderer/data-renderer-board.d.ts +1 -1
  22. package/dist/components/data-renderer/data-renderer-card.d.ts +1 -1
  23. package/dist/components/data-renderer/data-renderer-list.d.ts +1 -1
  24. package/dist/components/data-renderer/data-renderer.d.ts +1 -1
  25. package/dist/components/data-renderer/index.d.ts +18 -0
  26. package/dist/components/data-renderer/types.d.ts +0 -6
  27. package/dist/components/diff-viewer/diff-card.d.ts +1 -0
  28. package/dist/components/diff-viewer/diff-drawer-scroll.d.ts +0 -19
  29. package/dist/components/diff-viewer/diff-drawer.d.ts +1 -0
  30. package/dist/components/diff-viewer/index.d.ts +2 -0
  31. package/dist/components/diff-viewer/use-selected-diff-scroll.d.ts +7 -3
  32. package/dist/components/internal/style-guide.d.ts +14 -0
  33. package/dist/components/internal/token-editor-controls.d.ts +8 -0
  34. package/dist/components/internal/token-editor-data.d.ts +40 -0
  35. package/dist/components/internal/token-editor-state.d.ts +22 -0
  36. package/dist/components/layout/index.d.ts +6 -0
  37. package/dist/components/list-row/list-row.types.d.ts +1 -1
  38. package/dist/components/overlays/index.d.ts +12 -0
  39. package/dist/components/{search-modal-content.d.ts → overlays/search-modal-content.d.ts} +1 -1
  40. package/dist/components/{searchable-menu.d.ts → overlays/searchable-menu.d.ts} +1 -1
  41. package/dist/components/param-editor/index.d.ts +23 -0
  42. package/dist/components/param-editor/inputs/action-input.d.ts +13 -0
  43. package/dist/components/param-editor/inputs/anchor-grid-input.d.ts +12 -0
  44. package/dist/components/param-editor/inputs/anchor-grid.d.ts +4 -0
  45. package/dist/components/param-editor/inputs/file-accept.d.ts +22 -0
  46. package/dist/components/param-editor/inputs/file-drop-input.d.ts +14 -0
  47. package/dist/components/param-editor/inputs/numeric-value.d.ts +6 -0
  48. package/dist/components/param-editor/inputs/range-input.d.ts +17 -0
  49. package/dist/components/param-editor/inputs/range-value.d.ts +5 -0
  50. package/dist/components/param-editor/inputs/resource-input-chips.d.ts +15 -0
  51. package/dist/components/param-editor/inputs/resource-input.d.ts +18 -0
  52. package/dist/components/param-editor/inputs/segmented-input.d.ts +14 -0
  53. package/dist/components/param-editor/inputs/slider-marks.d.ts +5 -0
  54. package/dist/components/param-editor/inputs/vector-input.d.ts +17 -0
  55. package/dist/components/param-editor/inputs/vector-value.d.ts +7 -0
  56. package/dist/components/param-editor/param-editor-control-item.d.ts +15 -0
  57. package/dist/components/param-editor/param-editor-control-list.d.ts +5 -0
  58. package/dist/components/param-editor/param-editor-field-label.d.ts +1 -0
  59. package/dist/components/param-editor/param-editor-field.d.ts +11 -0
  60. package/dist/components/param-editor/param-editor-inline-group.d.ts +5 -0
  61. package/dist/components/param-editor/param-editor-section.d.ts +16 -0
  62. package/dist/components/param-editor/param-editor.d.ts +2 -1
  63. package/dist/components/param-editor/param-editor.types.d.ts +101 -19
  64. package/dist/components/{breadcrumb.d.ts → primitives/breadcrumb.d.ts} +1 -1
  65. package/dist/components/primitives/index.d.ts +28 -0
  66. package/dist/components/{number-input.d.ts → primitives/number-input.d.ts} +0 -2
  67. package/dist/components/{session-indicator.d.ts → primitives/session-indicator.d.ts} +2 -1
  68. package/dist/components/{tooltip.d.ts → primitives/tooltip.d.ts} +0 -1
  69. package/dist/components/rich-text/prompt-input/commands.d.ts +0 -17
  70. package/dist/components/rich-text/prompt-input/events.d.ts +0 -13
  71. package/dist/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.d.ts +1 -2
  72. package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.d.ts +1 -2
  73. package/dist/components/rich-text/prompt-input/utils.d.ts +1 -2
  74. package/dist/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.d.ts +0 -1
  75. package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
  76. package/dist/components/sidebar/sidebar.types.d.ts +1 -1
  77. package/dist/components/tab-strip/tab-visibility-filter.d.ts +1 -1
  78. package/dist/components/tag-editor/tag-editor-row.d.ts +1 -1
  79. package/dist/components/tag-editor/tag-editor.types.d.ts +1 -1
  80. package/dist/components/terminal/bind-session.d.ts +33 -0
  81. package/dist/components/terminal/index.d.ts +6 -0
  82. package/dist/components/terminal/scripted-bridge.d.ts +35 -0
  83. package/dist/components/terminal/terminal-contract.d.ts +22 -0
  84. package/dist/components/terminal/terminal-theme.d.ts +12 -0
  85. package/dist/components/terminal/terminal.d.ts +45 -0
  86. package/dist/components/terminal/types.d.ts +35 -0
  87. package/dist/components/terminal/use-terminal-session.d.ts +21 -0
  88. package/dist/components/tree-list/tree-list-order-filter.d.ts +1 -2
  89. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +1 -1
  90. package/dist/components/tree-list/tree-list.d.ts +1 -1
  91. package/dist/data-renderer.js +1669 -0
  92. package/dist/data-renderer.js.map +1 -0
  93. package/dist/diff-editor-BnfV8cYB.js +182 -0
  94. package/dist/diff-editor-BnfV8cYB.js.map +1 -0
  95. package/dist/diff.js +1313 -0
  96. package/dist/diff.js.map +1 -0
  97. package/dist/empty-state-Bo4HVrgr.js +34 -0
  98. package/dist/empty-state-Bo4HVrgr.js.map +1 -0
  99. package/dist/foundations/gallery/gallery-frame.d.ts +21 -0
  100. package/dist/foundations/gallery/sections/badges-section.d.ts +1 -0
  101. package/dist/foundations/gallery/sections/buttons-section.d.ts +1 -0
  102. package/dist/foundations/gallery/sections/composite-chat-section.d.ts +1 -0
  103. package/dist/foundations/gallery/sections/composites-section.d.ts +1 -0
  104. package/dist/foundations/gallery/sections/feedback-section.d.ts +1 -0
  105. package/dist/foundations/gallery/sections/input-authoring-card.d.ts +1 -0
  106. package/dist/foundations/gallery/sections/inputs-section.d.ts +1 -0
  107. package/dist/foundations/gallery/sections/layout-section.d.ts +1 -0
  108. package/dist/foundations/gallery/sections/navigation-identity-section.d.ts +1 -0
  109. package/dist/foundations/gallery/sections/overlays-section.d.ts +1 -0
  110. package/dist/foundations/gallery/sections/panels-section.d.ts +1 -0
  111. package/dist/foundations/gallery/sections/param-editor-composite-card.d.ts +1 -0
  112. package/dist/foundations/gallery/sections/settings-composite-cards.d.ts +1 -0
  113. package/dist/index.d.ts +11 -84
  114. package/dist/index.js +3570 -7569
  115. package/dist/index.js.map +1 -1
  116. package/dist/list-row-mi3Hn-Um.js +740 -0
  117. package/dist/list-row-mi3Hn-Um.js.map +1 -0
  118. package/dist/mermaid-renderer-DZo3qj6D.js +425 -0
  119. package/dist/mermaid-renderer-DZo3qj6D.js.map +1 -0
  120. package/dist/mermaid.js +5 -0
  121. package/dist/mermaid.js.map +1 -0
  122. package/dist/radio-cLMEBBZk.js +76 -0
  123. package/dist/radio-cLMEBBZk.js.map +1 -0
  124. package/dist/resource-badge-qCWHP-wQ.js +99 -0
  125. package/dist/resource-badge-qCWHP-wQ.js.map +1 -0
  126. package/dist/{rich-message-DNSEhxXh.js → rich-message-DBf_5YlW.js} +462 -481
  127. package/dist/rich-message-DBf_5YlW.js.map +1 -0
  128. package/dist/rich-text.js +300 -299
  129. package/dist/rich-text.js.map +1 -1
  130. package/dist/scroll-area-BMbg1WcD.js +91 -0
  131. package/dist/scroll-area-BMbg1WcD.js.map +1 -0
  132. package/dist/style.css +1 -1
  133. package/dist/terminal.js +339 -0
  134. package/dist/terminal.js.map +1 -0
  135. package/dist/theme/global.d.ts +3 -0
  136. package/dist/theme/recipes/badge.d.ts +50 -0
  137. package/dist/theme/recipes/button.d.ts +24 -19
  138. package/dist/theme/recipes/color-picker.d.ts +1 -0
  139. package/dist/theme/recipes/dialog.d.ts +1 -1
  140. package/dist/theme/recipes/drawer.d.ts +1 -1
  141. package/dist/theme/recipes/input.d.ts +55 -0
  142. package/dist/theme/recipes/number-input.d.ts +98 -0
  143. package/dist/theme/recipes/tabs.d.ts +49 -28
  144. package/dist/theme/recipes/textarea.d.ts +62 -1
  145. package/dist/theme/recipes/timeline.d.ts +74 -0
  146. package/dist/theme/tokens/borders.d.ts +0 -3
  147. package/dist/theme/tokens/colors.d.ts +100 -70
  148. package/dist/{theme-25P7ij4C.js → theme-CJBYBJaA.js} +1194 -315
  149. package/dist/theme-CJBYBJaA.js.map +1 -0
  150. package/dist/theme-preference-DOzHx64J.js +123 -0
  151. package/dist/theme-preference-DOzHx64J.js.map +1 -0
  152. package/dist/theme.js +1 -1
  153. package/dist/tree-list-CcuZMLS5.js +930 -0
  154. package/dist/tree-list-CcuZMLS5.js.map +1 -0
  155. package/dist/workspace-badge-Fuo-1zPj.js +314 -0
  156. package/dist/workspace-badge-Fuo-1zPj.js.map +1 -0
  157. package/package.json +23 -3
  158. package/dist/components/file-tree-helpers.d.ts +0 -8
  159. package/dist/components/open-source-notices-screen.d.ts +0 -20
  160. package/dist/components/param-editor/input-group.d.ts +0 -10
  161. package/dist/components/rich-text/shared/plugins/MermaidPlugin/index.d.ts +0 -1
  162. package/dist/components/rich-text/shared/plugins/TableActionMenuPlugin/TableActionMenuPlugin.d.ts +0 -5
  163. package/dist/components/rich-text/shared/plugins/TableCellResizerPlugin/TableCellResizerPlugin.d.ts +0 -2
  164. package/dist/components/rich-text/theme/report-theme.d.ts +0 -3
  165. package/dist/components/style-guide-data.d.ts +0 -40
  166. package/dist/components/style-guide.d.ts +0 -1
  167. package/dist/mermaid-renderer-CPGj6vsb.js +0 -570
  168. package/dist/mermaid-renderer-CPGj6vsb.js.map +0 -1
  169. package/dist/radio-DJtQY9po.js +0 -286
  170. package/dist/radio-DJtQY9po.js.map +0 -1
  171. package/dist/resource-badge-CeJTOn8F.js +0 -188
  172. package/dist/resource-badge-CeJTOn8F.js.map +0 -1
  173. package/dist/rich-message-DNSEhxXh.js.map +0 -1
  174. package/dist/theme-25P7ij4C.js.map +0 -1
  175. package/dist/utils/formats.d.ts +0 -7
  176. /package/dist/components/{palette-filter.d.ts → command-palette/palette-filter.d.ts} +0 -0
  177. /package/dist/components/{palette-list.d.ts → command-palette/palette-list.d.ts} +0 -0
  178. /package/dist/components/{palette-shortcut.d.ts → command-palette/palette-shortcut.d.ts} +0 -0
  179. /package/dist/components/{palette.d.ts → command-palette/palette.d.ts} +0 -0
  180. /package/dist/components/{code-editor.d.ts → diff-viewer/code-editor.d.ts} +0 -0
  181. /package/dist/components/{column-file-browser.d.ts → file-browser/column-file-browser.d.ts} +0 -0
  182. /package/dist/components/{performance-panel.d.ts → internal/performance-panel.d.ts} +0 -0
  183. /package/dist/components/{header.d.ts → layout/header.d.ts} +0 -0
  184. /package/dist/components/{horizontal-menu-stack.d.ts → layout/horizontal-menu-stack.d.ts} +0 -0
  185. /package/dist/components/{item-section.d.ts → layout/item-section.d.ts} +0 -0
  186. /package/dist/components/{panel-header.constants.d.ts → layout/panel-header.constants.d.ts} +0 -0
  187. /package/dist/components/{resizable-split-layout.d.ts → layout/resizable-split-layout.d.ts} +0 -0
  188. /package/dist/components/{resizable-split-layout.handle.d.ts → layout/resizable-split-layout.handle.d.ts} +0 -0
  189. /package/dist/components/{attached-panel.d.ts → overlays/attached-panel.d.ts} +0 -0
  190. /package/dist/components/{bubble-button.d.ts → overlays/bubble-button.d.ts} +0 -0
  191. /package/dist/components/{bubble-panel.d.ts → overlays/bubble-panel.d.ts} +0 -0
  192. /package/dist/components/{delete-confirmation-modal.d.ts → overlays/delete-confirmation-modal.d.ts} +0 -0
  193. /package/dist/components/{repo-picker-dialog.d.ts → overlays/repo-picker-dialog.d.ts} +0 -0
  194. /package/dist/components/{resource-context-menu.d.ts → overlays/resource-context-menu.d.ts} +0 -0
  195. /package/dist/components/param-editor/{color-input.d.ts → inputs/color-input.d.ts} +0 -0
  196. /package/dist/components/param-editor/{date-input.d.ts → inputs/date-input.d.ts} +0 -0
  197. /package/dist/components/param-editor/{horizontal-text-input.d.ts → inputs/horizontal-text-input.d.ts} +0 -0
  198. /package/dist/components/param-editor/{number-input.d.ts → inputs/number-input.d.ts} +0 -0
  199. /package/dist/components/param-editor/{selection-input.d.ts → inputs/selection-input.d.ts} +0 -0
  200. /package/dist/components/param-editor/{text-input.d.ts → inputs/text-input.d.ts} +0 -0
  201. /package/dist/components/{alert.d.ts → primitives/alert.d.ts} +0 -0
  202. /package/dist/components/{checkbox.d.ts → primitives/checkbox.d.ts} +0 -0
  203. /package/dist/components/{content-placeholder.d.ts → primitives/content-placeholder.d.ts} +0 -0
  204. /package/dist/components/{empty-state.d.ts → primitives/empty-state.d.ts} +0 -0
  205. /package/dist/components/{error-boundary.d.ts → primitives/error-boundary.d.ts} +0 -0
  206. /package/dist/components/{icon-color-picker.d.ts → primitives/icon-color-picker.d.ts} +0 -0
  207. /package/dist/components/{info-card.d.ts → primitives/info-card.d.ts} +0 -0
  208. /package/dist/components/{integration-card.d.ts → primitives/integration-card.d.ts} +0 -0
  209. /package/dist/components/{radio.d.ts → primitives/radio.d.ts} +0 -0
  210. /package/dist/components/{resource-badge.d.ts → primitives/resource-badge.d.ts} +0 -0
  211. /package/dist/components/{scroll-area.d.ts → primitives/scroll-area.d.ts} +0 -0
  212. /package/dist/components/{simple-card.d.ts → primitives/simple-card.d.ts} +0 -0
  213. /package/dist/components/{slider.d.ts → primitives/slider.d.ts} +0 -0
  214. /package/dist/components/{switch.d.ts → primitives/switch.d.ts} +0 -0
  215. /package/dist/components/{toaster.d.ts → primitives/toaster.d.ts} +0 -0
  216. /package/dist/components/{workspace-badge.d.ts → primitives/workspace-badge.d.ts} +0 -0
@@ -0,0 +1,1669 @@
1
+ import { jsx as a, jsxs as _, Fragment as Te } from "react/jsx-runtime";
2
+ import { c as H } from "react/compiler-runtime";
3
+ import { Text as Q, Badge as ue, IconButton as be, Icon as Y, Menu as j, Spacer as vt, HStack as Z, Portal as Oe, Wrap as nt, Stack as te, Box as se, Popover as le, Button as he, Separator as $e } from "@chakra-ui/react";
4
+ import { E as xt } from "./empty-state-Bo4HVrgr.js";
5
+ import { useState as oe, createElement as Ct, useRef as Se, useEffect as Me, Fragment as St, useReducer as wt } from "react";
6
+ import { L as pe, R as rt, H as ze } from "./list-row-mi3Hn-Um.js";
7
+ import { T as Dt, S as we } from "./scroll-area-BMbg1WcD.js";
8
+ import { Plus as It, MoreHorizontal as kt, X as Gt, SquareCheck as At, Square as Rt, Check as ot, ChevronDown as it, ChevronRight as Pt, ArrowDownAZ as Tt, ArrowDownZA as Et, Settings2 as Ot, List as Mt, KanbanSquare as _t, Filter as Bt } from "lucide-react";
9
+ import { g as Ve, W as lt } from "./workspace-badge-Fuo-1zPj.js";
10
+ import { C as Lt } from "./checkbox-D5AzFRlb.js";
11
+ import { useStore as Ft } from "zustand";
12
+ import { persist as $t, createJSONStorage as zt } from "zustand/middleware";
13
+ import { createStore as Vt } from "zustand/vanilla";
14
+ import { c as Nt } from "./browser-storage-BinyFNJX.js";
15
+ const N = "none", ee = "manual", _e = (t) => !Array.isArray(t), Lr = (t) => !Array.isArray(t), Wt = {
16
+ viewMode: "board",
17
+ columnGrouping: N,
18
+ rowGrouping: N,
19
+ ordering: {
20
+ attributeId: ee,
21
+ direction: "asc"
22
+ },
23
+ displayProperties: []
24
+ }, ne = (t, e) => {
25
+ if (!(!e || e === N || e === ee))
26
+ return t.find((n) => n.id === e);
27
+ }, Kt = async (t) => {
28
+ const {
29
+ settings: e,
30
+ rowId: n,
31
+ targetColumnId: r,
32
+ targetGroupKey: i,
33
+ beforeItemId: o,
34
+ onAttributeChange: l,
35
+ onReorder: s
36
+ } = t;
37
+ e.columnGrouping !== N && l && await l(n, e.columnGrouping, r), e.rowGrouping !== N && i && l && await l(n, e.rowGrouping, i), e.ordering.attributeId === ee && await s?.(n, o);
38
+ }, Ht = async (t) => {
39
+ const {
40
+ settings: e,
41
+ rowId: n,
42
+ targetGroupKey: r,
43
+ beforeItemId: i,
44
+ onAttributeChange: o,
45
+ onReorder: l
46
+ } = t;
47
+ e.rowGrouping === N || !o || (await o(n, e.rowGrouping, r), e.ordering.attributeId === ee && await l?.(n, i));
48
+ }, jt = (t) => {
49
+ const e = H(21), {
50
+ column: n,
51
+ onCreateStart: r,
52
+ onColumnAction: i
53
+ } = t;
54
+ let o;
55
+ e[0] !== n.label ? (o = /* @__PURE__ */ a(Q, { textStyle: "label/S/medium", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
56
+ const l = n.color ?? "gray";
57
+ let s;
58
+ e[2] !== n.items.length || e[3] !== l ? (s = /* @__PURE__ */ a(ue, { variant: "number", colorPalette: l, children: n.items.length }), e[2] = n.items.length, e[3] = l, e[4] = s) : s = e[4];
59
+ let d;
60
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ a(vt, {}), e[5] = d) : d = e[5];
61
+ let g;
62
+ e[6] !== n.canCreate || e[7] !== n.createLabel || e[8] !== n.id || e[9] !== r ? (g = n.canCreate && r && /* @__PURE__ */ a(Dt, { content: n.createLabel ?? "Create new row", children: /* @__PURE__ */ a(be, { size: "2xs", variant: "outline", onClick: () => r(n.id), "aria-label": n.createLabel ?? "Create row", children: /* @__PURE__ */ a(Y, { as: It, boxSize: "12px" }) }) }), e[6] = n.canCreate, e[7] = n.createLabel, e[8] = n.id, e[9] = r, e[10] = g) : g = e[10];
63
+ let p;
64
+ e[11] !== n.actions || e[12] !== n.id || e[13] !== n.label || e[14] !== i ? (p = n.actions.length > 0 && /* @__PURE__ */ _(j.Root, { children: [
65
+ /* @__PURE__ */ a(j.Trigger, { asChild: !0, children: /* @__PURE__ */ a(be, { size: "2xs", variant: "ghost", "aria-label": `Column actions for ${n.label}`, children: /* @__PURE__ */ a(Y, { as: kt, boxSize: "12px" }) }) }),
66
+ /* @__PURE__ */ a(j.Positioner, { children: /* @__PURE__ */ a(j.Content, { minW: "180px", bg: "bg", children: n.actions.map((f) => /* @__PURE__ */ a(j.Item, { value: f.id, asChild: !0, children: /* @__PURE__ */ a(pe, { asChild: !0, variant: "full-width", label: f.label, icon: /* @__PURE__ */ a(Y, { as: f.icon, boxSize: "16px" }), onActivate: () => i?.(n.id, f.id) }) }, f.id)) }) })
67
+ ] }), e[11] = n.actions, e[12] = n.id, e[13] = n.label, e[14] = i, e[15] = p) : p = e[15];
68
+ let c;
69
+ return e[16] !== o || e[17] !== s || e[18] !== g || e[19] !== p ? (c = /* @__PURE__ */ _(Z, { minH: "2.5rem", padding: "xs", gap: "xs", alignItems: "center", children: [
70
+ o,
71
+ s,
72
+ d,
73
+ g,
74
+ p
75
+ ] }), e[16] = o, e[17] = s, e[18] = g, e[19] = p, e[20] = c) : c = e[20], c;
76
+ }, st = "__pstdioDataRendererCardClickSuppressionUntil", at = () => globalThis, Ut = () => {
77
+ at()[st] = Date.now() + 1500;
78
+ }, Xt = () => Date.now() <= (at()[st] ?? 0), fe = (t) => t.stopPropagation(), ce = () => Ut(), Ne = (t) => {
79
+ ce(), t.stopPropagation();
80
+ }, qt = (t) => Array.isArray(t.value) ? t.value : t.value ? [t.value] : [], Zt = (t, e) => t.includes(e) ? t.filter((n) => n !== e) : [...t, e], We = {
81
+ bg: {
82
+ _light: "bg.muted",
83
+ _dark: "bg.subtle"
84
+ },
85
+ color: "fg.muted",
86
+ _hover: {
87
+ bg: {
88
+ _light: "bg.subtle",
89
+ _dark: "bg.hover"
90
+ }
91
+ }
92
+ }, Jt = (t) => t.color ? `${t.color}.fg` : "fg.muted", Ke = (t) => t.isMultiValue ? t.isSelected ? /* @__PURE__ */ a(At, { size: 14 }) : /* @__PURE__ */ a(Rt, { size: 14 }) : t.isSelected ? /* @__PURE__ */ a(ot, { size: 14 }) : null, ct = (t) => {
93
+ const e = H(61), {
94
+ badge: n,
95
+ onChange: r
96
+ } = t;
97
+ let i, o, l, s, d, g, p, c, f, u, m, h, v, C, k, T, R, P;
98
+ if (e[0] !== n || e[1] !== r) {
99
+ u = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
100
+ e: {
101
+ const y = n.options ?? [], b = !!(r && n.isEditable && y.length > 0), w = Array.isArray(n.value), D = qt(n), M = n.attributeLabel ?? n.label;
102
+ let E;
103
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
104
+ onClickCapture: ce,
105
+ onPointerDownCapture: ce,
106
+ onKeyDown: fe
107
+ }, e[20] = E) : E = e[20];
108
+ const W = E, K = (F) => {
109
+ const $ = w ? Zt(D, F) : F;
110
+ r?.(n.attributeId, $);
111
+ };
112
+ let z;
113
+ e[21] !== n.attributeId || e[22] !== w || e[23] !== r ? (z = () => r?.(n.attributeId, w ? [] : ""), e[21] = n.attributeId, e[22] = w, e[23] = r, e[24] = z) : z = e[24];
114
+ const V = z;
115
+ let A;
116
+ e[25] !== n ? (A = n.icon ? /* @__PURE__ */ a(Y, { as: Ve(n.icon), boxSize: "3.5", color: Jt(n) }) : null, e[25] = n, e[26] = A) : A = e[26];
117
+ let O;
118
+ e[27] !== b ? (O = b ? /* @__PURE__ */ a(Y, { as: it, boxSize: "3", color: "fg.muted" }) : null, e[27] = b, e[28] = O) : O = e[28];
119
+ let B;
120
+ e[29] !== n.label || e[30] !== A || e[31] !== O ? (B = /* @__PURE__ */ _(Te, { children: [
121
+ A,
122
+ n.label,
123
+ O
124
+ ] }), e[29] = n.label, e[30] = A, e[31] = O, e[32] = B) : B = e[32];
125
+ const L = B;
126
+ if (!b) {
127
+ let F;
128
+ e[33] !== L ? (F = /* @__PURE__ */ a(ue, { variant: "subtle", gap: "2xs", textStyle: "label/XS/medium", ...We, children: L }), e[33] = L, e[34] = F) : F = e[34], u = F;
129
+ break e;
130
+ }
131
+ s = j.Root, c = !w, e[35] !== L ? (f = /* @__PURE__ */ a(j.Trigger, { asChild: !0, children: /* @__PURE__ */ a(ue, { as: "span", role: "button", tabIndex: 0, variant: "subtle", gap: "2xs", textStyle: "label/XS/medium", cursor: "pointer", ...We, onClickCapture: ce, onClick: fe, onPointerDownCapture: ce, onPointerDown: Ne, onKeyDown: fe, children: L }) }), e[35] = L, e[36] = f) : f = e[36], l = Oe, o = j.Positioner, i = j.Content, d = "180px", g = "bg", m = "0", h = "0", v = ce, C = fe, k = ce, T = Ne, R = fe, P = w ? null : /* @__PURE__ */ _(Te, { children: [
132
+ /* @__PURE__ */ a(j.Item, { value: "__clear", asChild: !0, children: /* @__PURE__ */ a(pe, { asChild: !0, role: "menuitemradio", "aria-checked": D.length === 0, variant: "full-width", id: "__clear", label: `No ${M}`, icon: /* @__PURE__ */ a(Gt, { size: 16 }), iconColor: "gray.500", isSelected: D.length === 0, endContent: Ke({
133
+ isMultiValue: !1,
134
+ isSelected: D.length === 0
135
+ }), onActivate: V, ...W }) }),
136
+ /* @__PURE__ */ a(j.Separator, { margin: "0" })
137
+ ] }), p = y.map((F) => {
138
+ const $ = D.includes(F.value);
139
+ return /* @__PURE__ */ a(j.Item, { value: F.value, asChild: !0, children: /* @__PURE__ */ a(pe, { asChild: !0, role: w ? "menuitemcheckbox" : "menuitemradio", "aria-checked": $, variant: "full-width", id: F.value, label: F.label, icon: /* @__PURE__ */ a(Y, { as: Ve(F.icon), boxSize: "16px" }), iconColor: `${F.color ?? "gray"}.500`, isSelected: $, endContent: Ke({
140
+ isMultiValue: w,
141
+ isSelected: $
142
+ }), onActivate: () => K(F.value), ...W }) }, F.value);
143
+ });
144
+ }
145
+ e[0] = n, e[1] = r, e[2] = i, e[3] = o, e[4] = l, e[5] = s, e[6] = d, e[7] = g, e[8] = p, e[9] = c, e[10] = f, e[11] = u, e[12] = m, e[13] = h, e[14] = v, e[15] = C, e[16] = k, e[17] = T, e[18] = R, e[19] = P;
146
+ } else
147
+ i = e[2], o = e[3], l = e[4], s = e[5], d = e[6], g = e[7], p = e[8], c = e[9], f = e[10], u = e[11], m = e[12], h = e[13], v = e[14], C = e[15], k = e[16], T = e[17], R = e[18], P = e[19];
148
+ if (u !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
149
+ return u;
150
+ let G;
151
+ e[37] !== i || e[38] !== d || e[39] !== g || e[40] !== p || e[41] !== m || e[42] !== h || e[43] !== v || e[44] !== C || e[45] !== k || e[46] !== T || e[47] !== R || e[48] !== P ? (G = /* @__PURE__ */ _(i, { minW: d, bg: g, p: m, gap: h, onClickCapture: v, onClick: C, onPointerDownCapture: k, onPointerDown: T, onKeyDown: R, children: [
152
+ P,
153
+ p
154
+ ] }), e[37] = i, e[38] = d, e[39] = g, e[40] = p, e[41] = m, e[42] = h, e[43] = v, e[44] = C, e[45] = k, e[46] = T, e[47] = R, e[48] = P, e[49] = G) : G = e[49];
155
+ let S;
156
+ e[50] !== o || e[51] !== G ? (S = /* @__PURE__ */ a(o, { children: G }), e[50] = o, e[51] = G, e[52] = S) : S = e[52];
157
+ let x;
158
+ e[53] !== l || e[54] !== S ? (x = /* @__PURE__ */ a(l, { children: S }), e[53] = l, e[54] = S, e[55] = x) : x = e[55];
159
+ let I;
160
+ return e[56] !== s || e[57] !== c || e[58] !== f || e[59] !== x ? (I = /* @__PURE__ */ _(s, { closeOnSelect: c, children: [
161
+ f,
162
+ x
163
+ ] }), e[56] = s, e[57] = c, e[58] = f, e[59] = x, e[60] = I) : I = e[60], I;
164
+ }, dt = (t) => {
165
+ const e = H(31), {
166
+ title: n,
167
+ badges: r,
168
+ customSlots: i,
169
+ workspaceBadge: o,
170
+ isSelected: l,
171
+ draggable: s,
172
+ onBadgeChange: d,
173
+ onDragStart: g,
174
+ onDragEnd: p,
175
+ onClick: c
176
+ } = t;
177
+ let f;
178
+ e[0] !== r ? (f = r === void 0 ? [] : r, e[0] = r, e[1] = f) : f = e[1];
179
+ const u = f;
180
+ let m;
181
+ e[2] !== i ? (m = i === void 0 ? [] : i, e[2] = i, e[3] = m) : m = e[3];
182
+ const h = m, v = l === void 0 ? !1 : l, C = u.length > 0 || h.length > 0, k = s ? "grab" : c ? "pointer" : "default";
183
+ let T;
184
+ e[4] !== c ? (T = (E) => {
185
+ Xt() || E.defaultPrevented || !(E.target instanceof Node) || !E.currentTarget.contains(E.target) || c?.();
186
+ }, e[4] = c, e[5] = T) : T = e[5];
187
+ const R = T, P = v ? "border.accent" : "border.subtle", G = v ? "border.accent" : "border.accent-light";
188
+ let S;
189
+ e[6] !== G ? (S = {
190
+ borderColor: G
191
+ }, e[6] = G, e[7] = S) : S = e[7];
192
+ const x = c ? R : void 0, I = v ? "true" : void 0;
193
+ let y;
194
+ e[8] !== n ? (y = /* @__PURE__ */ a(Q, { textStyle: "label/S/regular", flex: "1", minW: "0", overflowWrap: "anywhere", children: n }), e[8] = n, e[9] = y) : y = e[9];
195
+ let b;
196
+ e[10] !== o ? (b = o ? /* @__PURE__ */ a(lt, { ...o }) : null, e[10] = o, e[11] = b) : b = e[11];
197
+ let w;
198
+ e[12] !== y || e[13] !== b ? (w = /* @__PURE__ */ _(Z, { align: "start", gap: "2xs", flexWrap: "wrap", minW: "0", children: [
199
+ y,
200
+ b
201
+ ] }), e[12] = y, e[13] = b, e[14] = w) : w = e[14];
202
+ let D;
203
+ e[15] !== u || e[16] !== h || e[17] !== C || e[18] !== d ? (D = C && /* @__PURE__ */ _(nt, { gap: "2xs", children: [
204
+ u.map((E) => /* @__PURE__ */ a(ct, { badge: E, onChange: d }, E.attributeId)),
205
+ h
206
+ ] }), e[15] = u, e[16] = h, e[17] = C, e[18] = d, e[19] = D) : D = e[19];
207
+ let M;
208
+ return e[20] !== k || e[21] !== s || e[22] !== p || e[23] !== g || e[24] !== I || e[25] !== w || e[26] !== D || e[27] !== P || e[28] !== S || e[29] !== x ? (M = /* @__PURE__ */ _(te, { gap: "xs", padding: "sm", borderRadius: "xs", borderWidth: "1px", borderColor: P, width: "100%", background: "bg", transition: "border-color 0.2s ease-in-out, background 0.2s ease-in-out", _hover: S, cursor: k, draggable: s, onDragStart: g, onDragEnd: p, onClick: x, "data-selected": I, "data-testid": "renderer-card", children: [
209
+ w,
210
+ D
211
+ ] }), e[20] = k, e[21] = s, e[22] = p, e[23] = g, e[24] = I, e[25] = w, e[26] = D, e[27] = P, e[28] = S, e[29] = x, e[30] = M) : M = e[30], M;
212
+ }, Yt = (t) => {
213
+ const e = H(30), {
214
+ columnId: n,
215
+ group: r,
216
+ selectedItemId: i,
217
+ canDragIn: o,
218
+ canDragOut: l,
219
+ isDropTarget: s,
220
+ onDragStart: d,
221
+ onDragEnd: g,
222
+ onGroupDragOver: p,
223
+ onGroupDragLeave: c,
224
+ onGroupDrop: f
225
+ } = t, [u, m] = oe(!0), h = s ? "bg.subtle" : "transparent", v = o ? p : void 0, C = o ? c : void 0, k = o ? f : void 0;
226
+ let T;
227
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = {
228
+ bg: "bg.hover"
229
+ }, e[0] = T) : T = e[0];
230
+ let R;
231
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = () => m(Qt), e[1] = R) : R = e[1];
232
+ const P = u ? "rotate(90deg)" : "rotate(0deg)";
233
+ let G;
234
+ e[2] !== P ? (G = /* @__PURE__ */ a(se, { display: "flex", alignItems: "center", flexShrink: 0, children: /* @__PURE__ */ a(Y, { as: Pt, boxSize: "14px", color: "fg.muted", transform: P, transition: "transform 0.15s ease" }) }), e[2] = P, e[3] = G) : G = e[3];
235
+ let S;
236
+ e[4] !== r.label ? (S = /* @__PURE__ */ a(Q, { textStyle: "label/S/medium", color: "fg.muted", children: r.label }), e[4] = r.label, e[5] = S) : S = e[5];
237
+ let x;
238
+ e[6] !== r.items.length ? (x = /* @__PURE__ */ a(ue, { variant: "number", colorPalette: "gray", size: "sm", children: r.items.length }), e[6] = r.items.length, e[7] = x) : x = e[7];
239
+ let I;
240
+ e[8] !== G || e[9] !== S || e[10] !== x ? (I = /* @__PURE__ */ _(Z, { px: "xs", py: "2xs", gap: "2xs", cursor: "pointer", _hover: T, borderRadius: "sm", onClick: R, children: [
241
+ G,
242
+ S,
243
+ x
244
+ ] }), e[8] = G, e[9] = S, e[10] = x, e[11] = I) : I = e[11];
245
+ let y;
246
+ e[12] !== o || e[13] !== l || e[14] !== u || e[15] !== r.items || e[16] !== g || e[17] !== d || e[18] !== f || e[19] !== i ? (y = u && /* @__PURE__ */ a(te, { gap: "sm", pt: "xs", children: r.items.map((w) => /* @__PURE__ */ a(rt, { actions: w.contextMenuActions ?? [], children: /* @__PURE__ */ a(se, { onDragOver: o ? en : void 0, onDrop: o ? (D) => {
247
+ D.preventDefault(), D.stopPropagation();
248
+ const M = D.dataTransfer.getData("text/plain");
249
+ !M || M === w.id || f(D, w.id);
250
+ } : void 0, children: /* @__PURE__ */ a(dt, { ...w.cardProps, isSelected: w.id === i, draggable: l, onDragStart: l ? d(w.id) : void 0, onDragEnd: l ? g : void 0 }) }) }, w.id)) }), e[12] = o, e[13] = l, e[14] = u, e[15] = r.items, e[16] = g, e[17] = d, e[18] = f, e[19] = i, e[20] = y) : y = e[20];
251
+ let b;
252
+ return e[21] !== n || e[22] !== r.key || e[23] !== h || e[24] !== v || e[25] !== I || e[26] !== y || e[27] !== C || e[28] !== k ? (b = /* @__PURE__ */ _(te, { "data-column-id": n, "data-group-key": r.key, gap: "0", borderRadius: "sm", background: h, transition: "background 150ms ease", onDragOver: v, onDragLeave: C, onDrop: k, children: [
253
+ I,
254
+ y
255
+ ] }), e[21] = n, e[22] = r.key, e[23] = h, e[24] = v, e[25] = I, e[26] = y, e[27] = C, e[28] = k, e[29] = b) : b = e[29], b;
256
+ };
257
+ function Qt(t) {
258
+ return !t;
259
+ }
260
+ function en(t) {
261
+ t.preventDefault(), t.stopPropagation(), t.dataTransfer.dropEffect = "move";
262
+ }
263
+ const tn = (t) => {
264
+ const e = H(27), {
265
+ columns: n,
266
+ selectedItemId: r,
267
+ onMoveItem: i,
268
+ onMoveToGroup: o,
269
+ onCreateStart: l,
270
+ onColumnAction: s
271
+ } = t, d = r === void 0 ? null : r, [g, p] = oe(null), [c, f] = oe(null), u = nn;
272
+ let m;
273
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = () => {
274
+ p(null), f(null);
275
+ }, e[0] = m) : m = e[0];
276
+ const h = m;
277
+ let v;
278
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = (I) => (y) => {
279
+ y.preventDefault(), y.dataTransfer.dropEffect = "move", p(I);
280
+ }, e[1] = v) : v = e[1];
281
+ const C = v;
282
+ let k;
283
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = (I) => {
284
+ I.currentTarget.contains(I.relatedTarget) || p(null);
285
+ }, e[2] = k) : k = e[2];
286
+ const T = k;
287
+ let R;
288
+ e[3] !== i ? (R = (I) => (y) => {
289
+ y.preventDefault(), p(null);
290
+ const b = y.dataTransfer.getData("text/plain");
291
+ b && i?.(b, I);
292
+ }, e[3] = i, e[4] = R) : R = e[4];
293
+ const P = R;
294
+ let G;
295
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = {
296
+ display: "flex",
297
+ alignItems: "stretch",
298
+ gap: "0",
299
+ pb: "2xs",
300
+ minH: "100%"
301
+ }, e[5] = G) : G = e[5];
302
+ let S;
303
+ if (e[6] !== g || e[7] !== c || e[8] !== n || e[9] !== P || e[10] !== s || e[11] !== l || e[12] !== i || e[13] !== o || e[14] !== d) {
304
+ let I;
305
+ e[16] !== g || e[17] !== c || e[18] !== P || e[19] !== s || e[20] !== l || e[21] !== i || e[22] !== o || e[23] !== d ? (I = (y) => /* @__PURE__ */ _(te, { "data-testid": `board-column-${y.id}`, gap: "0", _notFirst: {
306
+ borderLeft: "1px solid",
307
+ borderColor: "border.subtle"
308
+ }, background: g === y.id ? "bg.subtle" : "bg", transition: "background 150ms ease", height: "100%", minH: "240px", overflow: "hidden", minW: "260px", flex: "1 0 260px", onDragOver: y.canDragIn ? C(y.id) : void 0, onDragLeave: y.canDragIn ? T : void 0, onDrop: y.canDragIn ? P(y.id) : void 0, children: [
309
+ /* @__PURE__ */ a(jt, { column: y, onCreateStart: l, onColumnAction: s }),
310
+ /* @__PURE__ */ a(we, { flex: "1", minH: "0", size: "xs", verticalScrollbarProps: {
311
+ margin: "0"
312
+ }, contentProps: {
313
+ spaceY: "sm",
314
+ ps: "xs",
315
+ pe: "xs"
316
+ }, children: y.groups && y.groups.length > 0 ? y.groups.map((b) => {
317
+ const w = `${y.id}::${b.key}`;
318
+ return /* @__PURE__ */ a(Yt, { columnId: y.id, group: b, selectedItemId: d, canDragIn: y.canDragIn, canDragOut: y.canDragOut, isDropTarget: c === w, onDragStart: u, onDragEnd: h, onGroupDragOver: (D) => {
319
+ D.preventDefault(), D.stopPropagation(), D.dataTransfer.dropEffect = "move", f(w), p(null);
320
+ }, onGroupDragLeave: (D) => {
321
+ D.currentTarget.contains(D.relatedTarget) || f(null);
322
+ }, onGroupDrop: (D, M) => {
323
+ D.preventDefault(), D.stopPropagation(), f(null), p(null);
324
+ const E = D.dataTransfer.getData("text/plain");
325
+ if (E) {
326
+ if (i) {
327
+ i(E, y.id, {
328
+ beforeItemId: M,
329
+ targetGroupKey: b.key
330
+ });
331
+ return;
332
+ }
333
+ o?.(E, b.key, {
334
+ beforeItemId: M
335
+ });
336
+ }
337
+ } }, b.key);
338
+ }) : y.items.map((b) => /* @__PURE__ */ a(rt, { actions: b.contextMenuActions ?? [], children: /* @__PURE__ */ a(se, { onDragOver: y.canDragIn ? (w) => {
339
+ w.preventDefault(), w.stopPropagation(), w.dataTransfer.dropEffect = "move", p(y.id);
340
+ } : void 0, onDrop: y.canDragIn ? (w) => {
341
+ w.preventDefault(), w.stopPropagation(), p(null);
342
+ const D = w.dataTransfer.getData("text/plain");
343
+ !D || D === b.id || i?.(D, y.id, {
344
+ beforeItemId: b.id
345
+ });
346
+ } : void 0, children: /* @__PURE__ */ a(dt, { ...b.cardProps, isSelected: b.id === d, draggable: y.canDragOut, onDragStart: y.canDragOut ? u(b.id) : void 0, onDragEnd: y.canDragOut ? h : void 0 }) }) }, b.id)) })
347
+ ] }, y.id), e[16] = g, e[17] = c, e[18] = P, e[19] = s, e[20] = l, e[21] = i, e[22] = o, e[23] = d, e[24] = I) : I = e[24], S = n.map(I), e[6] = g, e[7] = c, e[8] = n, e[9] = P, e[10] = s, e[11] = l, e[12] = i, e[13] = o, e[14] = d, e[15] = S;
348
+ } else
349
+ S = e[15];
350
+ let x;
351
+ return e[25] !== S ? (x = /* @__PURE__ */ a(we, { height: "100%", size: "xs", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, contentProps: G, children: S }), e[25] = S, e[26] = x) : x = e[26], x;
352
+ };
353
+ function nn(t) {
354
+ return (e) => {
355
+ e.dataTransfer.setData("text/plain", t), e.dataTransfer.effectAllowed = "move";
356
+ };
357
+ }
358
+ const ut = (t, e, n = 0) => {
359
+ const r = [];
360
+ for (const i of t) {
361
+ const o = (i.children?.length ?? 0) > 0;
362
+ r.push({
363
+ id: i.id,
364
+ item: i,
365
+ depth: n,
366
+ canExpand: o
367
+ }), o && gt(e, i.id) && r.push(...ut(i.children ?? [], e, n + 1));
368
+ }
369
+ return r;
370
+ }, rn = (t, e) => {
371
+ if (t)
372
+ return {
373
+ _before: {
374
+ content: '""',
375
+ position: "absolute",
376
+ bg: "border.accent",
377
+ left: "0",
378
+ top: "0",
379
+ width: e ? "3px" : "100%",
380
+ height: e ? "100%" : "2px"
381
+ }
382
+ };
383
+ }, gt = (t, e) => t[e] !== !1, on = (t, e, n) => ({
384
+ ...t,
385
+ [e]: n
386
+ }), ln = (t) => /* @__PURE__ */ _(Z, { gap: "xs", minW: "0", maxW: "full", flex: "1", children: [
387
+ /* @__PURE__ */ a(Q, { textStyle: "label/S/regular", minW: "0", truncate: !0, children: t.title }),
388
+ typeof t.countBadge == "number" ? /* @__PURE__ */ a(ue, { variant: "number", size: "sm", flexShrink: 0, colorPalette: t.countColorPalette ?? "gray", children: t.countBadge }) : null
389
+ ] }), sn = (t) => (t.badges?.length ?? 0) > 0 || (t.customSlots?.length ?? 0) > 0 ? /* @__PURE__ */ a(Z, { gap: "xs", flexShrink: 0, children: /* @__PURE__ */ _(nt, { gap: "2xs", flexShrink: 0, children: [
390
+ t.badges?.map((n) => /* @__PURE__ */ a(ct, { badge: n, onChange: t.onBadgeChange }, n.attributeId)),
391
+ t.customSlots
392
+ ] }) }) : null, an = (t, e) => ({
393
+ id: t.id,
394
+ label: ln(t),
395
+ icon: t.statusIcon ? /* @__PURE__ */ a(Y, { as: t.statusIcon, boxSize: "16px" }) : void 0,
396
+ iconColor: t.statusColor ?? "fg.muted",
397
+ endContent: sn(t),
398
+ isContainer: e,
399
+ contextMenuItems: t.contextMenuActions?.map((n) => ({
400
+ id: n.key,
401
+ label: n.label,
402
+ icon: n.icon ?? void 0,
403
+ disabled: n.isDisabled,
404
+ separatorBefore: n.separatorBefore,
405
+ endContent: n.endContent,
406
+ onAction: n.onClick
407
+ }))
408
+ }), cn = (t) => {
409
+ const e = H(24), {
410
+ items: n,
411
+ selectedItemId: r,
412
+ expandedGroups: i,
413
+ onItemClick: o,
414
+ onExpandedGroupChange: l
415
+ } = t, s = r === void 0 ? null : r;
416
+ let d;
417
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = {}, e[0] = d) : d = e[0];
418
+ const [g, p] = oe(d), [c, f] = oe(null), [u, m] = oe(null), h = i ?? g;
419
+ let v, C;
420
+ if (e[1] !== c || e[2] !== u || e[3] !== h || e[4] !== i || e[5] !== n || e[6] !== l || e[7] !== o || e[8] !== s) {
421
+ const T = ut(n, h);
422
+ let R;
423
+ e[11] !== i || e[12] !== l ? (R = (S, x) => {
424
+ l?.(S, x), i === void 0 && p((I) => on(I, S, x));
425
+ }, e[11] = i, e[12] = l, e[13] = R) : R = e[13];
426
+ const P = R;
427
+ v = se;
428
+ let G;
429
+ e[14] !== c || e[15] !== u || e[16] !== h || e[17] !== P || e[18] !== o || e[19] !== s ? (G = (S) => /* @__PURE__ */ a(dn, { row: S, isExpanded: gt(h, S.id), selectedItemId: s, activeDropTargetId: c, draggedItemId: u, onDraggedItemChange: m, onDropTargetChange: f, onItemClick: o, onExpandedChange: P }, S.id), e[14] = c, e[15] = u, e[16] = h, e[17] = P, e[18] = o, e[19] = s, e[20] = G) : G = e[20], C = T.map(G), e[1] = c, e[2] = u, e[3] = h, e[4] = i, e[5] = n, e[6] = l, e[7] = o, e[8] = s, e[9] = v, e[10] = C;
430
+ } else
431
+ v = e[9], C = e[10];
432
+ let k;
433
+ return e[21] !== v || e[22] !== C ? (k = /* @__PURE__ */ a(v, { children: C }), e[21] = v, e[22] = C, e[23] = k) : k = e[23], k;
434
+ }, dn = (t) => {
435
+ const e = H(53), {
436
+ row: n,
437
+ isExpanded: r,
438
+ selectedItemId: i,
439
+ activeDropTargetId: o,
440
+ draggedItemId: l,
441
+ onDraggedItemChange: s,
442
+ onDropTargetChange: d,
443
+ onItemClick: g,
444
+ onExpandedChange: p
445
+ } = t, {
446
+ item: c,
447
+ canExpand: f
448
+ } = n, u = c.id === i, m = !!c.onDropRow && c.id !== l, h = m && c.id === o;
449
+ let v;
450
+ e[0] !== f || e[1] !== c ? (v = an(c, f), e[0] = f, e[1] = c, e[2] = v) : v = e[2];
451
+ const C = v;
452
+ let k;
453
+ e[3] !== r || e[4] !== p || e[5] !== n.id ? (k = () => p(n.id, !r), e[3] = r, e[4] = p, e[5] = n.id, e[6] = k) : k = e[6];
454
+ const T = k;
455
+ let R;
456
+ e[7] !== f || e[8] !== c || e[9] !== g || e[10] !== T ? (R = () => {
457
+ if (f) {
458
+ T();
459
+ return;
460
+ }
461
+ c.onClick?.(), g?.(c);
462
+ }, e[7] = f, e[8] = c, e[9] = g, e[10] = T, e[11] = R) : R = e[11];
463
+ const P = R;
464
+ let G;
465
+ e[12] !== c.draggable || e[13] !== c.id || e[14] !== s || e[15] !== d ? (G = (L) => {
466
+ c.draggable && (L.stopPropagation(), L.dataTransfer.setData("text/plain", c.id), L.dataTransfer.effectAllowed = "move", s(c.id), d(null));
467
+ }, e[12] = c.draggable, e[13] = c.id, e[14] = s, e[15] = d, e[16] = G) : G = e[16];
468
+ const S = G;
469
+ let x;
470
+ e[17] !== m || e[18] !== c.id || e[19] !== d ? (x = (L) => {
471
+ m && (L.preventDefault(), L.stopPropagation(), L.dataTransfer.dropEffect = "move", d(c.id));
472
+ }, e[17] = m, e[18] = c.id, e[19] = d, e[20] = x) : x = e[20];
473
+ const I = x;
474
+ let y;
475
+ e[21] !== d ? (y = (L) => {
476
+ L.currentTarget.contains(L.relatedTarget) || d(null);
477
+ }, e[21] = d, e[22] = y) : y = e[22];
478
+ const b = y;
479
+ let w;
480
+ e[23] !== m || e[24] !== c || e[25] !== s || e[26] !== d ? (w = (L) => {
481
+ if (!m || !c.onDropRow)
482
+ return;
483
+ L.preventDefault(), L.stopPropagation(), d(null), s(null);
484
+ const F = L.dataTransfer.getData("text/plain");
485
+ !F || F === c.id || c.onDropRow(F);
486
+ }, e[23] = m, e[24] = c, e[25] = s, e[26] = d, e[27] = w) : w = e[27];
487
+ const D = w;
488
+ let M;
489
+ e[28] !== s || e[29] !== d ? (M = () => {
490
+ d(null), s(null);
491
+ }, e[28] = s, e[29] = d, e[30] = M) : M = e[30];
492
+ const E = M, W = h ? "true" : void 0, K = h ? "bg.subtle" : "transparent", z = c.draggable;
493
+ let V;
494
+ e[31] !== f || e[32] !== h ? (V = rn(h, f), e[31] = f, e[32] = h, e[33] = V) : V = e[33];
495
+ const A = c.onDropRow ? b : void 0;
496
+ let O;
497
+ e[34] !== f || e[35] !== P || e[36] !== r || e[37] !== u || e[38] !== n.depth || e[39] !== C || e[40] !== T ? (O = /* @__PURE__ */ a(pe, { ...C, variant: "tree", depth: n.depth, isSelected: u, isExpanded: r, showExpandToggle: f, onActivate: P, onToggleExpand: T }), e[34] = f, e[35] = P, e[36] = r, e[37] = u, e[38] = n.depth, e[39] = C, e[40] = T, e[41] = O) : O = e[41];
498
+ let B;
499
+ return e[42] !== E || e[43] !== I || e[44] !== S || e[45] !== D || e[46] !== c.draggable || e[47] !== V || e[48] !== A || e[49] !== O || e[50] !== W || e[51] !== K ? (B = /* @__PURE__ */ a(se, { "data-drop-target": W, position: "relative", borderBottomWidth: "1px", borderBottomColor: "border.subtle", bg: K, draggable: z, transition: "background 120ms ease", ...V, onDragStart: S, onDragOver: I, onDragLeave: A, onDragEnd: E, onDrop: D, children: O }), e[42] = E, e[43] = I, e[44] = S, e[45] = D, e[46] = c.draggable, e[47] = V, e[48] = A, e[49] = O, e[50] = W, e[51] = K, e[52] = B) : B = e[52], B;
500
+ }, He = (t) => {
501
+ const e = H(7), {
502
+ emptyState: n,
503
+ title: r,
504
+ description: i,
505
+ height: o
506
+ } = t;
507
+ if (n !== void 0) {
508
+ let s;
509
+ return e[0] !== n || e[1] !== o ? (s = o ? /* @__PURE__ */ a(se, { height: o, children: n }) : n, e[0] = n, e[1] = o, e[2] = s) : s = e[2], s;
510
+ }
511
+ let l;
512
+ return e[3] !== i || e[4] !== o || e[5] !== r ? (l = /* @__PURE__ */ a(xt, { title: r, description: i, height: o }), e[3] = i, e[4] = o, e[5] = r, e[6] = l) : l = e[6], l;
513
+ }, un = (t) => {
514
+ const e = H(20), {
515
+ viewMode: n,
516
+ boardColumns: r,
517
+ listItems: i,
518
+ listExpandedGroups: o,
519
+ selectedRowId: l,
520
+ emptyState: s,
521
+ emptyTitle: d,
522
+ emptyDescription: g,
523
+ onBoardMoveItem: p,
524
+ onBoardMoveToGroup: c,
525
+ onCreateRow: f,
526
+ onColumnAction: u,
527
+ onListExpandedGroupChange: m,
528
+ listKey: h
529
+ } = t;
530
+ if (n === "board") {
531
+ let C;
532
+ return e[0] !== r || e[1] !== g || e[2] !== s || e[3] !== d || e[4] !== p || e[5] !== c || e[6] !== u || e[7] !== f || e[8] !== l ? (C = /* @__PURE__ */ a(se, { flex: "1", minH: "0", children: r.length > 0 ? /* @__PURE__ */ a(tn, { columns: r, selectedItemId: l, onMoveItem: p, onMoveToGroup: c, onCreateStart: f, onColumnAction: u }) : /* @__PURE__ */ a(He, { emptyState: s, title: d, description: g, height: "100%" }) }), e[0] = r, e[1] = g, e[2] = s, e[3] = d, e[4] = p, e[5] = c, e[6] = u, e[7] = f, e[8] = l, e[9] = C) : C = e[9], C;
533
+ }
534
+ if (i.length > 0) {
535
+ let C;
536
+ return e[10] !== o || e[11] !== i || e[12] !== h || e[13] !== m || e[14] !== l ? (C = /* @__PURE__ */ a(cn, { items: i, selectedItemId: l, expandedGroups: o, onExpandedGroupChange: m }, h), e[10] = o, e[11] = i, e[12] = h, e[13] = m, e[14] = l, e[15] = C) : C = e[15], C;
537
+ }
538
+ let v;
539
+ return e[16] !== g || e[17] !== s || e[18] !== d ? (v = /* @__PURE__ */ a(He, { emptyState: s, title: d, description: g }), e[16] = g, e[17] = s, e[18] = d, e[19] = v) : v = e[19], v;
540
+ }, gn = (t) => {
541
+ const e = /* @__PURE__ */ new Set();
542
+ return t.filter((n) => e.has(n.value) ? !1 : (e.add(n.value), !0));
543
+ }, ie = (t) => {
544
+ if (t.kind !== "enum" && t.kind !== "enum-multi") return [];
545
+ const e = _e(t.options) ? t.options.getSnapshot() : t.options;
546
+ return gn(e);
547
+ }, ye = (t) => t.replaceAll("_", " ").split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), ve = (t, e) => {
548
+ if (!(t.kind !== "enum" && t.kind !== "enum-multi"))
549
+ return ie(t).find((n) => n.value === e);
550
+ }, Ce = (t, e) => ve(t, e)?.label ?? ye(e), pn = (t, e) => t.length === 0 ? null : t.length <= 2 ? t.map((n) => Ce(e, n)).join(", ") : `${Ce(e, t[0])}, ${Ce(e, t[1])} +${t.length - 2}`, fn = (t, e, n) => {
551
+ if (e.kind !== "enum") return null;
552
+ const r = typeof n == "string" ? n : null, i = t.editable === !0;
553
+ if (!r)
554
+ return i ? {
555
+ attributeId: t.id,
556
+ attributeLabel: t.label,
557
+ label: t.label,
558
+ value: r ?? void 0,
559
+ options: ie(e),
560
+ isEditable: !0
561
+ } : null;
562
+ const o = ve(e, r);
563
+ return {
564
+ attributeId: t.id,
565
+ attributeLabel: t.label,
566
+ label: o?.label ?? ye(r),
567
+ color: o?.color,
568
+ icon: o?.icon,
569
+ ...i ? {
570
+ value: r,
571
+ options: ie(e),
572
+ isEditable: !0
573
+ } : {}
574
+ };
575
+ }, mn = (t, e, n) => {
576
+ if (e.kind !== "enum-multi") return null;
577
+ const r = Array.isArray(n) ? n.filter((s) => typeof s == "string") : [], i = pn(r, e), o = t.editable === !0;
578
+ if (!i)
579
+ return o ? {
580
+ attributeId: t.id,
581
+ attributeLabel: t.label,
582
+ label: t.label,
583
+ value: r,
584
+ options: ie(e),
585
+ isEditable: !0
586
+ } : null;
587
+ const l = r[0] ? ve(e, r[0]) : void 0;
588
+ return {
589
+ attributeId: t.id,
590
+ attributeLabel: t.label,
591
+ label: i,
592
+ color: l?.color,
593
+ icon: l?.icon,
594
+ ...o ? {
595
+ value: r,
596
+ options: ie(e),
597
+ isEditable: !0
598
+ } : {}
599
+ };
600
+ }, de = (t, e) => {
601
+ const n = t.attributes[e.id];
602
+ return e.type.kind === "enum-multi" ? Array.isArray(n) ? n.filter((r) => typeof r == "string") : [] : n;
603
+ }, ge = (t, e) => {
604
+ const n = de(t, e);
605
+ return e.type.kind === "enum-multi" ? n : n == null ? [] : typeof n == "string" ? n === "" ? [] : [n] : typeof n == "number" ? [String(n)] : [];
606
+ }, bn = (t) => {
607
+ if (typeof t != "string" || t === "") return null;
608
+ const e = new Date(t);
609
+ return Number.isNaN(e.getTime()) ? null : e.toLocaleDateString();
610
+ }, hn = (t) => typeof t == "number" && Number.isFinite(t) ? String(t) : typeof t == "string" && t !== "" && !Number.isNaN(Number(t)) ? t : null, pt = (t) => t == null ? null : typeof t == "string" ? t === "" ? null : t : String(t), yn = (t) => pt(t), vn = (t) => t != null && t !== !1, xn = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Ae = (t) => typeof t == "string" && t.trim() ? t.trim() : void 0, Cn = (t) => t === "current_branch" ? "current_branch" : "worktree", Sn = (t) => Array.isArray(t) ? t.flatMap((e) => {
611
+ if (!xn(e)) return [];
612
+ const n = Ae(e.id);
613
+ if (!n) return [];
614
+ const r = Ae(e.shorthand), i = Ae(e.name) ?? r ?? n;
615
+ return [{
616
+ id: n,
617
+ name: i,
618
+ ...r ? {
619
+ shorthand: r
620
+ } : {},
621
+ type: Cn(e.type)
622
+ }];
623
+ }) : [], wn = (t, e, n) => {
624
+ if (t.display?.kind !== "workspace-badge") return null;
625
+ const r = Sn(n.attributes[t.display.itemsAttributeId]);
626
+ if (r.length === 0) return null;
627
+ const i = typeof e == "string" ? e : void 0, o = r.find((l) => l.id === i) ?? r[0];
628
+ return o ? Ct(lt, {
629
+ workspaceType: o.type,
630
+ shorthand: o.shorthand ?? o.name,
631
+ hasMultipleWorkspaces: r.length > 1,
632
+ showLeadingSessionIndicator: !1
633
+ }) : null;
634
+ }, Dn = (t, e) => {
635
+ const n = t.type, r = de(e, t);
636
+ if (t.render || t.display) return null;
637
+ if (n.kind === "enum") return fn(t, n, r);
638
+ if (n.kind === "enum-multi") return mn(t, n, r);
639
+ if (n.kind === "date") {
640
+ const o = bn(r);
641
+ return o ? {
642
+ attributeId: t.id,
643
+ label: o
644
+ } : null;
645
+ }
646
+ if (n.kind === "number") {
647
+ const o = hn(r);
648
+ return o ? {
649
+ attributeId: t.id,
650
+ label: o
651
+ } : null;
652
+ }
653
+ if (n.kind === "user") {
654
+ const o = yn(r);
655
+ return o ? {
656
+ attributeId: t.id,
657
+ label: o,
658
+ color: "blue"
659
+ } : null;
660
+ }
661
+ const i = pt(r);
662
+ return i ? {
663
+ attributeId: t.id,
664
+ label: i
665
+ } : null;
666
+ }, ft = (t, e, n) => {
667
+ const r = [];
668
+ for (const i of n) {
669
+ const o = ne(e, i);
670
+ if (!o || o.displayable === !1) continue;
671
+ const l = Dn(o, t);
672
+ l && r.push(l);
673
+ }
674
+ return r;
675
+ }, mt = (t, e, n) => {
676
+ const r = [];
677
+ for (const i of n) {
678
+ const o = ne(e, i);
679
+ if (!o || o.displayable === !1) continue;
680
+ const l = de(t, o), s = o.render ? o.render(l, t) : wn(o, l, t);
681
+ vn(s) && r.push(s);
682
+ }
683
+ return r;
684
+ }, je = (t, e) => {
685
+ const n = /* @__PURE__ */ new Set();
686
+ for (const r of t)
687
+ for (const i of ge(r, e)) n.add(i);
688
+ return n;
689
+ }, In = (t, e) => {
690
+ const n = [];
691
+ for (const r of t) {
692
+ if (!r.filterable) continue;
693
+ if (r.type.kind === "enum" || r.type.kind === "enum-multi") {
694
+ const o = ie(r.type), l = je(e, r), s = new Set(o.map((g) => g.value)), d = [...l].filter((g) => !s.has(g)).sort((g, p) => g.localeCompare(p, void 0, {
695
+ numeric: !0
696
+ })).map((g) => ({
697
+ value: g,
698
+ label: ye(g)
699
+ }));
700
+ n.push({
701
+ id: r.id,
702
+ label: r.label,
703
+ selectionMode: "multiple",
704
+ options: [...o.map((g) => ({
705
+ value: g.value,
706
+ label: g.label,
707
+ color: g.color
708
+ })), ...d]
709
+ });
710
+ continue;
711
+ }
712
+ const i = [...je(e, r)].sort((o, l) => o.localeCompare(l, void 0, {
713
+ numeric: !0
714
+ })).map((o) => ({
715
+ value: o,
716
+ label: ye(o)
717
+ }));
718
+ n.push({
719
+ id: r.id,
720
+ label: r.label,
721
+ selectionMode: "multiple",
722
+ options: i
723
+ });
724
+ }
725
+ return n;
726
+ }, kn = (t) => {
727
+ const e = [{
728
+ value: N,
729
+ label: "None"
730
+ }];
731
+ for (const n of t)
732
+ n.groupable && n.type.kind !== "enum-multi" && e.push({
733
+ value: n.id,
734
+ label: n.label
735
+ });
736
+ return e;
737
+ }, Gn = (t) => {
738
+ const e = [{
739
+ value: ee,
740
+ label: "Manual"
741
+ }];
742
+ e.push({
743
+ value: "title",
744
+ label: "Title"
745
+ });
746
+ for (const n of t)
747
+ n.sortable && e.push({
748
+ value: n.id,
749
+ label: n.label
750
+ });
751
+ return e;
752
+ }, An = (t) => {
753
+ const e = [];
754
+ for (const n of t)
755
+ n.displayable && e.push({
756
+ value: n.id,
757
+ label: n.label
758
+ });
759
+ return e;
760
+ }, Rn = (t, e) => e === N ? t.filter((n) => n.value === N) : t.filter((n) => n.value === N || n.value !== e), Pn = (t, e) => t === N ? "all" : e?.columnKey, Tn = (t, e, n) => {
761
+ if (t === N) return;
762
+ const r = ne(e, t), i = n?.[t];
763
+ if (r && i && i.length > 0) return Be(r, i);
764
+ if (r && r.type.kind === "enum")
765
+ return ie(r.type).map((o) => o.value);
766
+ }, Be = (t, e) => e, Ue = (t, e) => {
767
+ const n = {
768
+ ...t
769
+ };
770
+ return delete n[e], n;
771
+ }, Fr = (t, e) => {
772
+ const n = new Set(e.map((g) => g.id)), r = (g) => g === N || n.has(g), i = (g) => g === ee || g === "title" || n.has(g), o = r(t.columnGrouping) ? t.columnGrouping : N, l = r(t.rowGrouping) ? t.rowGrouping : N, s = i(t.ordering.attributeId) ? t.ordering.attributeId : ee, d = t.displayProperties.filter(r);
773
+ return {
774
+ viewMode: t.viewMode,
775
+ columnGrouping: o,
776
+ rowGrouping: l,
777
+ ordering: {
778
+ attributeId: s,
779
+ direction: t.ordering.direction
780
+ },
781
+ displayProperties: d
782
+ };
783
+ }, $r = (t, e) => {
784
+ const n = new Map(e.map((i) => [i.id, i])), r = {};
785
+ for (const [i, o] of Object.entries(t)) {
786
+ const l = n.get(i);
787
+ l && (!o || o.length === 0 || (r[i] = Be(l, o)));
788
+ }
789
+ return r;
790
+ }, En = "Unassigned", Xe = (t) => `No ${t.label.toLowerCase()}`, qe = (t, e) => e ? e.type.kind === "enum" || e.type.kind === "enum-multi" ? Ce(e.type, t) : t : t === N ? "All" : t, Ze = (t, e) => {
791
+ if (t !== void 0)
792
+ return e.type.kind !== "enum" && e.type.kind !== "enum-multi" || ie(e.type).some((n) => n.value === t) ? t : void 0;
793
+ }, Je = (t, e, n) => {
794
+ if (n === N || !e) return "all";
795
+ if (e.type.kind === "enum-multi") {
796
+ const [i] = ge(t, e);
797
+ return Ze(i, e) ?? Xe(e);
798
+ }
799
+ const [r] = ge(t, e);
800
+ return Ze(r, e) ?? Xe(e);
801
+ }, On = (t, e) => t.localeCompare(e, void 0, {
802
+ numeric: !0
803
+ }), Ye = (t, e, n) => {
804
+ if (n && (n.type.kind === "enum" || n.type.kind === "enum-multi")) {
805
+ const r = bt(t, e, n.type);
806
+ if (r !== 0) return r;
807
+ }
808
+ return On(t, e);
809
+ }, Qe = (t, e) => e === "asc" ? t : t * -1, bt = (t, e, n) => {
810
+ if (n.kind !== "enum" && n.kind !== "enum-multi") return 0;
811
+ const r = ie(n), i = (o) => {
812
+ if (o === void 0) return r.length;
813
+ const l = r.findIndex((s) => s.value === o);
814
+ return l === -1 ? r.length + 1 : l;
815
+ };
816
+ return i(t) - i(e);
817
+ }, Mn = (t, e, n) => {
818
+ if (n.compare) return n.compare(de(t, n), de(e, n));
819
+ const r = de(t, n), i = de(e, n);
820
+ if (n.type.kind === "date") {
821
+ const s = typeof r == "string" ? new Date(r).getTime() : 0, d = typeof i == "string" ? new Date(i).getTime() : 0;
822
+ return s - d;
823
+ }
824
+ if (n.type.kind === "number") {
825
+ const s = typeof r == "number" ? r : Number(r ?? 0), d = typeof i == "number" ? i : Number(i ?? 0);
826
+ return s - d;
827
+ }
828
+ if (n.type.kind === "enum" || n.type.kind === "enum-multi") {
829
+ const [s] = ge(t, n), [d] = ge(e, n);
830
+ return bt(s, d, n.type);
831
+ }
832
+ const o = typeof r == "string" ? r : String(r ?? ""), l = typeof i == "string" ? i : String(i ?? "");
833
+ return o.localeCompare(l, void 0, {
834
+ numeric: !0
835
+ });
836
+ }, De = (t, e, n) => {
837
+ if (e.attributeId === ee) return t;
838
+ if (e.attributeId === "title")
839
+ return [...t].sort((i, o) => Qe(i.title.localeCompare(o.title), e.direction));
840
+ const r = ne(n, e.attributeId);
841
+ return r ? [...t].sort((i, o) => Qe(Mn(i, o, r), e.direction)) : t;
842
+ }, _n = (t, e) => {
843
+ const {
844
+ attributes: n,
845
+ columnGrouping: r,
846
+ rowGrouping: i,
847
+ knownColumnKeys: o
848
+ } = e, l = ne(n, r), s = ne(n, i), d = /* @__PURE__ */ new Map();
849
+ if (o)
850
+ for (const p of o) d.set(p, []);
851
+ for (const p of t) {
852
+ const c = Je(p, l, r);
853
+ d.set(c, [...d.get(c) ?? [], p]);
854
+ }
855
+ return [...d.entries()].sort(([p], [c]) => Ye(p, c, l)).map(([p, c]) => {
856
+ const f = qe(p, l);
857
+ if (i === N)
858
+ return {
859
+ key: p,
860
+ label: f,
861
+ rows: c,
862
+ subgroups: []
863
+ };
864
+ const u = /* @__PURE__ */ new Map();
865
+ for (const h of c) {
866
+ const v = Je(h, s, i);
867
+ u.set(v, [...u.get(v) ?? [], h]);
868
+ }
869
+ const m = [...u.entries()].sort(([h], [v]) => Ye(h, v, s)).map(([h, v]) => ({
870
+ key: h,
871
+ label: qe(h, s) || ye(h || En),
872
+ rows: v
873
+ }));
874
+ return {
875
+ key: p,
876
+ label: f,
877
+ rows: c,
878
+ subgroups: m
879
+ };
880
+ });
881
+ }, Bn = (t, e, n) => {
882
+ const r = ge(t, e), i = Be(e, n);
883
+ return r.some((o) => i.includes(o));
884
+ }, Ln = (t, e, n) => {
885
+ const r = Object.entries(e).filter((i) => Array.isArray(i[1]) && i[1].length > 0);
886
+ return r.length === 0 ? t : t.filter((i) => r.every(([o, l]) => {
887
+ const s = ne(n, o);
888
+ return s ? Bn(i, s, l) : !0;
889
+ }));
890
+ }, Fn = (t, e, n) => {
891
+ const r = {}, i = ne(n, e);
892
+ if (!i) return r;
893
+ for (const o of t)
894
+ for (const l of ge(o, i))
895
+ r[l] = (r[l] ?? 0) + 1;
896
+ return r;
897
+ }, Ee = (t) => {
898
+ const e = H(2);
899
+ let n;
900
+ return e[0] !== t.children ? (n = /* @__PURE__ */ a(Q, { textStyle: "label/XS/medium", color: "fg.muted", children: t.children }), e[0] = t.children, e[1] = n) : n = e[1], n;
901
+ }, $n = [{
902
+ value: "list",
903
+ label: "List",
904
+ icon: Mt
905
+ }, {
906
+ value: "board",
907
+ label: "Board",
908
+ icon: _t
909
+ }], Re = (t) => {
910
+ const e = H(21);
911
+ let n;
912
+ e[0] !== t.label || e[1] !== t.options || e[2] !== t.value ? (n = t.options.find((u) => u.value === t.value)?.label ?? t.label, e[0] = t.label, e[1] = t.options, e[2] = t.value, e[3] = n) : n = e[3];
913
+ const r = n, i = t.options[0]?.value === "none", o = t.flex;
914
+ let l;
915
+ e[4] !== t.label ? (l = /* @__PURE__ */ a(Ee, { children: t.label }), e[4] = t.label, e[5] = l) : l = e[5];
916
+ let s;
917
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ a(Y, { as: it, color: "fg.muted" }), e[6] = s) : s = e[6];
918
+ let d;
919
+ e[7] !== r ? (d = /* @__PURE__ */ a(j.Trigger, { asChild: !0, children: /* @__PURE__ */ _(he, { size: "sm", variant: "outline", width: "full", justifyContent: "space-between", children: [
920
+ r,
921
+ s
922
+ ] }) }), e[7] = r, e[8] = d) : d = e[8];
923
+ let g;
924
+ e[9] !== i || e[10] !== t ? (g = t.options.map((u, m) => /* @__PURE__ */ _(St, { children: [
925
+ i && m === 1 ? /* @__PURE__ */ a(j.Separator, {}) : null,
926
+ /* @__PURE__ */ a(j.Item, { value: u.value, onClick: () => t.onSelect(u.value), children: /* @__PURE__ */ _(Z, { gap: "2", justifyContent: "space-between", width: "full", children: [
927
+ /* @__PURE__ */ a(Q, { textStyle: "label/S/regular", children: u.label }),
928
+ u.value === t.value ? /* @__PURE__ */ a(Y, { as: ot, boxSize: "14px", color: "fg.muted" }) : null
929
+ ] }) })
930
+ ] }, u.value)), e[9] = i, e[10] = t, e[11] = g) : g = e[11];
931
+ let p;
932
+ e[12] !== g ? (p = /* @__PURE__ */ a(j.Positioner, { children: /* @__PURE__ */ a(j.Content, { minW: "260px", bg: "bg", children: g }) }), e[12] = g, e[13] = p) : p = e[13];
933
+ let c;
934
+ e[14] !== d || e[15] !== p ? (c = /* @__PURE__ */ _(j.Root, { children: [
935
+ d,
936
+ p
937
+ ] }), e[14] = d, e[15] = p, e[16] = c) : c = e[16];
938
+ let f;
939
+ return e[17] !== t.flex || e[18] !== l || e[19] !== c ? (f = /* @__PURE__ */ _(te, { gap: "2xs", flex: o, children: [
940
+ l,
941
+ c
942
+ ] }), e[17] = t.flex, e[18] = l, e[19] = c, e[20] = f) : f = e[20], f;
943
+ }, zn = (t) => {
944
+ const e = H(61), {
945
+ settings: n,
946
+ groupingOptions: r,
947
+ orderingOptions: i,
948
+ displayPropertyOptions: o,
949
+ onViewModeChange: l,
950
+ onColumnGroupingChange: s,
951
+ onRowGroupingChange: d,
952
+ onOrderingAttributeIdChange: g,
953
+ onSortDirectionToggle: p,
954
+ onDisplayPropertyToggle: c
955
+ } = t, f = Se(null), u = Se(null), [m, h] = oe(!1), v = n.ordering.direction === "asc" ? Tt : Et;
956
+ let C, k;
957
+ e[0] !== m ? (C = () => {
958
+ if (!m)
959
+ return;
960
+ const $ = (U) => {
961
+ const q = U.target;
962
+ q instanceof Node && (u.current?.contains(q) || f.current?.contains(q) || h(!1));
963
+ };
964
+ return document.addEventListener("pointerdown", $), () => document.removeEventListener("pointerdown", $);
965
+ }, k = [m], e[0] = m, e[1] = C, e[2] = k) : (C = e[1], k = e[2]), Me(C, k);
966
+ let T, R;
967
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = {
968
+ placement: "bottom-end",
969
+ offset: {
970
+ mainAxis: 8
971
+ }
972
+ }, R = ($) => h($.open), e[3] = T, e[4] = R) : (T = e[3], R = e[4]);
973
+ let P;
974
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ a(le.Trigger, { asChild: !0, children: /* @__PURE__ */ a(be, { ref: f, "aria-label": "Display settings", variant: "ghost", size: "sm", children: /* @__PURE__ */ a(Y, { as: Ot, boxSize: "14px" }) }) }), e[5] = P) : P = e[5];
975
+ let G;
976
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ a(Ee, { children: "View" }), e[6] = G) : G = e[6];
977
+ let S;
978
+ e[7] !== l || e[8] !== n.viewMode ? (S = $n.map(($) => {
979
+ const U = $.icon, q = n.viewMode === $.value;
980
+ return /* @__PURE__ */ _(he, { flex: "1", size: "sm", variant: q ? "primary" : "outline", "aria-pressed": q, onClick: () => l($.value), children: [
981
+ /* @__PURE__ */ a(U, { size: 14 }),
982
+ $.label
983
+ ] }, $.value);
984
+ }), e[7] = l, e[8] = n.viewMode, e[9] = S) : S = e[9];
985
+ let x;
986
+ e[10] !== S ? (x = /* @__PURE__ */ a(Z, { gap: "2xs", children: S }), e[10] = S, e[11] = x) : x = e[11];
987
+ let I;
988
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ a($e, {}), e[12] = I) : I = e[12];
989
+ let y;
990
+ e[13] !== s || e[14] !== d || e[15] !== n.rowGrouping ? (y = ($) => {
991
+ s($), ($ === "none" || $ === n.rowGrouping) && d("none");
992
+ }, e[13] = s, e[14] = d, e[15] = n.rowGrouping, e[16] = y) : y = e[16];
993
+ let b;
994
+ e[17] !== r || e[18] !== n.columnGrouping || e[19] !== y ? (b = /* @__PURE__ */ a(Re, { label: "Grouping", value: n.columnGrouping, options: r, onSelect: y }), e[17] = r, e[18] = n.columnGrouping, e[19] = y, e[20] = b) : b = e[20];
995
+ const w = n.rowGrouping;
996
+ let D;
997
+ e[21] !== r || e[22] !== n.columnGrouping ? (D = Rn(r, n.columnGrouping), e[21] = r, e[22] = n.columnGrouping, e[23] = D) : D = e[23];
998
+ let M;
999
+ e[24] !== d || e[25] !== n.rowGrouping || e[26] !== D ? (M = /* @__PURE__ */ a(Re, { label: "Sub-grouping", value: w, options: D, onSelect: d }), e[24] = d, e[25] = n.rowGrouping, e[26] = D, e[27] = M) : M = e[27];
1000
+ let E;
1001
+ e[28] !== g || e[29] !== i || e[30] !== n.ordering.attributeId ? (E = /* @__PURE__ */ a(Re, { label: "Sort by", value: n.ordering.attributeId, options: i, onSelect: g, flex: "1" }), e[28] = g, e[29] = i, e[30] = n.ordering.attributeId, e[31] = E) : E = e[31];
1002
+ let W;
1003
+ e[32] !== v ? (W = /* @__PURE__ */ a(Y, { as: v }), e[32] = v, e[33] = W) : W = e[33];
1004
+ let K;
1005
+ e[34] !== p || e[35] !== n.ordering.direction || e[36] !== W ? (K = /* @__PURE__ */ a(be, { "aria-label": "Toggle sort direction", size: "sm", variant: "outline", onClick: p, "data-direction": n.ordering.direction, children: W }), e[34] = p, e[35] = n.ordering.direction, e[36] = W, e[37] = K) : K = e[37];
1006
+ let z;
1007
+ e[38] !== E || e[39] !== K ? (z = /* @__PURE__ */ _(Z, { gap: "2xs", alignItems: "end", children: [
1008
+ E,
1009
+ K
1010
+ ] }), e[38] = E, e[39] = K, e[40] = z) : z = e[40];
1011
+ let V;
1012
+ e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ a($e, {}), e[41] = V) : V = e[41];
1013
+ let A;
1014
+ e[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ a(Ee, { children: "Display properties" }), e[42] = A) : A = e[42];
1015
+ let O;
1016
+ if (e[43] !== o || e[44] !== c || e[45] !== n.displayProperties) {
1017
+ let $;
1018
+ e[47] !== c || e[48] !== n.displayProperties ? ($ = (U) => {
1019
+ const q = n.displayProperties.includes(U.value);
1020
+ return /* @__PURE__ */ a(he, { size: "2xs", variant: q ? "primary" : "outline", onClick: () => c(U.value), children: U.label }, U.value);
1021
+ }, e[47] = c, e[48] = n.displayProperties, e[49] = $) : $ = e[49], O = o.map($), e[43] = o, e[44] = c, e[45] = n.displayProperties, e[46] = O;
1022
+ } else
1023
+ O = e[46];
1024
+ let B;
1025
+ e[50] !== O ? (B = /* @__PURE__ */ _(te, { gap: "2xs", children: [
1026
+ A,
1027
+ /* @__PURE__ */ a(Z, { flexWrap: "wrap", gap: "2xs", children: O })
1028
+ ] }), e[50] = O, e[51] = B) : B = e[51];
1029
+ let L;
1030
+ e[52] !== b || e[53] !== M || e[54] !== z || e[55] !== B || e[56] !== x ? (L = /* @__PURE__ */ a(Oe, { children: /* @__PURE__ */ a(le.Positioner, { children: /* @__PURE__ */ a(le.Content, { ref: u, width: "320px", p: "sm", bg: "bg", children: /* @__PURE__ */ _(te, { gap: "sm", children: [
1031
+ G,
1032
+ x,
1033
+ I,
1034
+ b,
1035
+ M,
1036
+ z,
1037
+ V,
1038
+ B
1039
+ ] }) }) }) }), e[52] = b, e[53] = M, e[54] = z, e[55] = B, e[56] = x, e[57] = L) : L = e[57];
1040
+ let F;
1041
+ return e[58] !== m || e[59] !== L ? (F = /* @__PURE__ */ _(le.Root, { open: m, closeOnInteractOutside: !1, positioning: T, onOpenChange: R, children: [
1042
+ P,
1043
+ L
1044
+ ] }), e[58] = m, e[59] = L, e[60] = F) : F = e[60], F;
1045
+ }, et = {
1046
+ p: "xs",
1047
+ display: "flex",
1048
+ flexDirection: "column",
1049
+ gap: "1px"
1050
+ }, Vn = (t) => !t || t.length === 0 ? [] : t, Nn = (t, e) => {
1051
+ const n = {};
1052
+ for (const r of t) {
1053
+ const i = Vn(e[r.id]);
1054
+ i.length > 0 && (n[r.id] = i);
1055
+ }
1056
+ return n;
1057
+ }, Wn = (t) => Object.values(t).reduce((e, n) => e + (n?.length ?? 0), 0), Kn = (t, e) => {
1058
+ if (e.length === 0) return;
1059
+ const n = e.map((r) => t.options.find((i) => i.value === r)?.label ?? r);
1060
+ return n.length <= 2 ? n.join(", ") : `${n.slice(0, 2).join(", ")} +${n.length - 2}`;
1061
+ }, Hn = (t) => {
1062
+ const e = H(7), {
1063
+ label: n,
1064
+ selectedDescription: r
1065
+ } = t;
1066
+ let i;
1067
+ e[0] !== n ? (i = /* @__PURE__ */ a(Q, { as: "span", textStyle: "label/S/regular", color: "inherit", flexShrink: 0, truncate: !0, children: n }), e[0] = n, e[1] = i) : i = e[1];
1068
+ let o;
1069
+ e[2] !== r ? (o = r ? /* @__PURE__ */ a(Q, { as: "span", textStyle: "label/XS", color: "fg.menu-item.secondary", minW: "0", truncate: !0, children: r }) : null, e[2] = r, e[3] = o) : o = e[3];
1070
+ let l;
1071
+ return e[4] !== i || e[5] !== o ? (l = /* @__PURE__ */ _(Z, { gap: "2xs", minW: "0", width: "full", children: [
1072
+ i,
1073
+ o
1074
+ ] }), e[4] = i, e[5] = o, e[6] = l) : l = e[6], l;
1075
+ }, jn = (t) => {
1076
+ const e = H(8), {
1077
+ label: n,
1078
+ checked: r
1079
+ } = t;
1080
+ let i;
1081
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = {
1082
+ tabIndex: -1,
1083
+ "aria-hidden": !0
1084
+ }, e[0] = i) : i = e[0];
1085
+ let o;
1086
+ e[1] !== r ? (o = /* @__PURE__ */ a(Lt, { checked: r, readOnly: !0, "aria-readonly": "true", inputProps: i, pointerEvents: "none", size: "sm" }), e[1] = r, e[2] = o) : o = e[2];
1087
+ let l;
1088
+ e[3] !== n ? (l = /* @__PURE__ */ a(Q, { textStyle: "label/S/regular", color: "inherit", truncate: !0, children: n }), e[3] = n, e[4] = l) : l = e[4];
1089
+ let s;
1090
+ return e[5] !== o || e[6] !== l ? (s = /* @__PURE__ */ _(Z, { gap: "2", minW: "0", children: [
1091
+ o,
1092
+ l
1093
+ ] }), e[5] = o, e[6] = l, e[7] = s) : s = e[7], s;
1094
+ }, Un = (t) => {
1095
+ const e = H(12), {
1096
+ option: n,
1097
+ checked: r,
1098
+ count: i,
1099
+ onSelect: o
1100
+ } = t;
1101
+ let l;
1102
+ e[0] !== r || e[1] !== n.label ? (l = /* @__PURE__ */ a(jn, { label: n.label, checked: r }), e[0] = r, e[1] = n.label, e[2] = l) : l = e[2];
1103
+ let s;
1104
+ e[3] !== i ? (s = /* @__PURE__ */ a(Q, { textStyle: "label/XS/regular", color: "fg.muted", children: i }), e[3] = i, e[4] = s) : s = e[4];
1105
+ let d;
1106
+ return e[5] !== r || e[6] !== o || e[7] !== n.label || e[8] !== n.value || e[9] !== l || e[10] !== s ? (d = /* @__PURE__ */ a(pe, { id: n.value, role: "checkbox", "aria-label": n.label, "aria-checked": r, variant: "compact", label: l, endContent: s, onActivate: o }), e[5] = r, e[6] = o, e[7] = n.label, e[8] = n.value, e[9] = l, e[10] = s, e[11] = d) : d = e[11], d;
1107
+ }, Xn = (t) => {
1108
+ const e = H(17), {
1109
+ categories: n,
1110
+ filters: r,
1111
+ countsByCategory: i,
1112
+ onToggleFilterValue: o,
1113
+ onClearFilter: l,
1114
+ onClearAll: s
1115
+ } = t, d = Se(null), g = Se(null), [p, c] = oe(!1), [f, u] = oe(n[0]?.id ?? ""), m = n.find((A) => A.id === f) ?? n[0], h = Nn(n, r), v = Wn(h);
1116
+ let C;
1117
+ e[0] !== o ? (C = (A, O) => {
1118
+ o(A.id, O);
1119
+ }, e[0] = o, e[1] = C) : C = e[1];
1120
+ const k = C;
1121
+ let T, R;
1122
+ e[2] !== p ? (T = () => {
1123
+ if (!p)
1124
+ return;
1125
+ const A = (O) => {
1126
+ const B = O.target;
1127
+ B instanceof Node && (g.current?.contains(B) || d.current?.contains(B) || c(!1));
1128
+ };
1129
+ return document.addEventListener("pointerdown", A), () => document.removeEventListener("pointerdown", A);
1130
+ }, R = [p], e[2] = p, e[3] = T, e[4] = R) : (T = e[3], R = e[4]), Me(T, R);
1131
+ let P, G;
1132
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (P = {
1133
+ placement: "bottom-end",
1134
+ offset: {
1135
+ mainAxis: 8
1136
+ }
1137
+ }, G = (A) => c(A.open), e[5] = P, e[6] = G) : (P = e[5], G = e[6]);
1138
+ let S;
1139
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ a(Y, { as: Bt, boxSize: "14px" }), e[7] = S) : S = e[7];
1140
+ const x = v > 0 ? /* @__PURE__ */ a(ue, { variant: "number", colorPalette: "blue", children: v }) : null;
1141
+ let I;
1142
+ e[8] !== x ? (I = /* @__PURE__ */ a(le.Trigger, { asChild: !0, children: /* @__PURE__ */ a(be, { ref: d, "aria-label": "Filter rows", variant: "ghost", size: "sm", children: /* @__PURE__ */ _(Z, { gap: "2xs", children: [
1143
+ S,
1144
+ x
1145
+ ] }) }) }), e[8] = x, e[9] = I) : I = e[9];
1146
+ let y;
1147
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ a(Q, { textStyle: "label/XS/medium", color: "fg.muted", children: "Filters" }), e[10] = y) : y = e[10];
1148
+ let b;
1149
+ e[11] !== s ? (b = /* @__PURE__ */ _(ze, { variant: "narrow", justifyContent: "space-between", borderBottomWidth: "1px", borderColor: "border.subtle", children: [
1150
+ y,
1151
+ /* @__PURE__ */ a(he, { size: "2xs", variant: "ghost", onClick: s, children: "Clear all" })
1152
+ ] }), e[11] = s, e[12] = b) : b = e[12];
1153
+ let w;
1154
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = {
1155
+ overscrollBehavior: "contain"
1156
+ }, e[13] = w) : w = e[13];
1157
+ const D = te, M = "1", E = "0", W = "0", K = "0", z = m ? /* @__PURE__ */ _(Te, { children: [
1158
+ /* @__PURE__ */ _(ze, { variant: "narrow", justifyContent: "space-between", borderBottomWidth: "1px", borderColor: "border.subtle", children: [
1159
+ /* @__PURE__ */ a(Q, { textStyle: "label/S/medium", children: m.label }),
1160
+ /* @__PURE__ */ a(he, { size: "2xs", variant: "ghost", onClick: () => l(m.id), children: "Clear" })
1161
+ ] }),
1162
+ /* @__PURE__ */ a(we, { flex: "1", minH: "0", viewportProps: {
1163
+ overscrollBehavior: "contain"
1164
+ }, contentProps: et, children: m.options.map((A) => {
1165
+ const O = (h[m.id] ?? []).includes(A.value), B = i[m.id]?.[A.value] ?? 0;
1166
+ return /* @__PURE__ */ a(Un, { option: A, checked: O, count: B, onSelect: () => k(m, A.value) }, A.value);
1167
+ }) })
1168
+ ] }) : null;
1169
+ let V;
1170
+ return e[14] !== D || e[15] !== z ? (V = /* @__PURE__ */ a(D, { flex: M, gap: E, minW: W, minH: K, children: z }), e[14] = D, e[15] = z, e[16] = V) : V = e[16], /* @__PURE__ */ _(le.Root, { open: p, closeOnInteractOutside: !1, positioning: P, onOpenChange: G, children: [
1171
+ I,
1172
+ /* @__PURE__ */ a(Oe, { children: /* @__PURE__ */ a(le.Positioner, { children: /* @__PURE__ */ a(le.Content, { ref: g, width: "min(440px, calc(100vw - 32px))", height: "min(320px, calc(100vh - 32px))", p: "0", bg: "bg", gap: "0", overflow: "hidden", children: /* @__PURE__ */ _(Z, { align: "stretch", gap: "0", minH: "0", height: "full", children: [
1173
+ /* @__PURE__ */ _(te, { minWidth: "188px", borderRightWidth: "1px", borderColor: "border.subtle", gap: "0", minH: "0", children: [
1174
+ b,
1175
+ /* @__PURE__ */ a(we, { flex: "1", minH: "0", viewportProps: w, contentProps: et, children: n.map((A) => {
1176
+ const O = h[A.id] ?? [], B = Kn(A, O);
1177
+ return /* @__PURE__ */ a(pe, { id: A.id, label: /* @__PURE__ */ a(Hn, { label: A.label, selectedDescription: B }), role: "button", variant: "compact", isSelected: m?.id === A.id, endContent: O.length > 0 ? /* @__PURE__ */ a(ue, { variant: "number", colorPalette: "gray", children: O.length }) : void 0, onActivate: () => u(A.id) }, A.id);
1178
+ }) })
1179
+ ] }),
1180
+ V
1181
+ ] }) }) }) })
1182
+ ] });
1183
+ }, qn = "pstdio/ui/data-renderer", Zn = (t) => `${qn}/${t}`, Pe = {
1184
+ settings: Wt,
1185
+ filters: {},
1186
+ expandedGroups: {}
1187
+ }, Jn = (t) => ({
1188
+ settings: {
1189
+ ...Pe.settings,
1190
+ ...t?.settings ?? {}
1191
+ },
1192
+ filters: t?.filters ?? Pe.filters,
1193
+ expandedGroups: t?.expandedGroups ?? Pe.expandedGroups
1194
+ }), Yn = (t, e) => t.includes(e) ? t.filter((n) => n !== e) : [...t, e], me = (t) => t.startsWith("tag:") ? t.slice(4) : t, Qn = (t) => {
1195
+ const e = t.ordering, n = typeof e?.attributeId == "string" ? e.attributeId : typeof e?.field == "string" ? me(e.field) : ee, r = e?.direction === "desc" ? "desc" : "asc", i = typeof t.columnGrouping == "string" ? me(t.columnGrouping) : N, o = typeof t.rowGrouping == "string" ? me(t.rowGrouping) : N, l = Array.isArray(t.displayProperties) ? t.displayProperties.filter((s) => typeof s == "string").map(me) : [];
1196
+ return {
1197
+ viewMode: t.viewMode === "list" ? "list" : "board",
1198
+ columnGrouping: i,
1199
+ rowGrouping: o,
1200
+ ordering: {
1201
+ attributeId: n === "manual" ? ee : n,
1202
+ direction: r
1203
+ },
1204
+ displayProperties: l
1205
+ };
1206
+ }, er = (t) => {
1207
+ const e = {};
1208
+ for (const [n, r] of Object.entries(t)) {
1209
+ if (!Array.isArray(r)) continue;
1210
+ const i = r.filter((o) => typeof o == "string");
1211
+ i.length !== 0 && (e[me(n)] = i);
1212
+ }
1213
+ return e;
1214
+ }, tr = (t) => {
1215
+ const {
1216
+ storageKey: e,
1217
+ initialState: n
1218
+ } = t, r = Jn(n);
1219
+ return Vt()($t((i) => ({
1220
+ ...r,
1221
+ setViewMode: (o) => i((l) => ({
1222
+ ...l,
1223
+ settings: {
1224
+ ...l.settings,
1225
+ viewMode: o
1226
+ }
1227
+ })),
1228
+ setColumnGrouping: (o) => i((l) => ({
1229
+ ...l,
1230
+ settings: {
1231
+ ...l.settings,
1232
+ columnGrouping: o
1233
+ }
1234
+ })),
1235
+ setRowGrouping: (o) => i((l) => ({
1236
+ ...l,
1237
+ settings: {
1238
+ ...l.settings,
1239
+ rowGrouping: o
1240
+ }
1241
+ })),
1242
+ setOrdering: (o) => i((l) => ({
1243
+ ...l,
1244
+ settings: {
1245
+ ...l.settings,
1246
+ ordering: o
1247
+ }
1248
+ })),
1249
+ setOrderingAttributeId: (o) => i((l) => ({
1250
+ ...l,
1251
+ settings: {
1252
+ ...l.settings,
1253
+ ordering: {
1254
+ ...l.settings.ordering,
1255
+ attributeId: o
1256
+ }
1257
+ }
1258
+ })),
1259
+ setDisplayProperties: (o) => i((l) => ({
1260
+ ...l,
1261
+ settings: {
1262
+ ...l.settings,
1263
+ displayProperties: o
1264
+ }
1265
+ })),
1266
+ toggleSortDirection: () => i((o) => ({
1267
+ ...o,
1268
+ settings: {
1269
+ ...o.settings,
1270
+ ordering: {
1271
+ ...o.settings.ordering,
1272
+ direction: o.settings.ordering.direction === "asc" ? "desc" : "asc"
1273
+ }
1274
+ }
1275
+ })),
1276
+ toggleDisplayProperty: (o) => i((l) => {
1277
+ const s = l.settings.displayProperties.includes(o) ? l.settings.displayProperties.filter((d) => d !== o) : [...l.settings.displayProperties, o];
1278
+ return {
1279
+ ...l,
1280
+ settings: {
1281
+ ...l.settings,
1282
+ displayProperties: s
1283
+ }
1284
+ };
1285
+ }),
1286
+ setFilter: (o, l) => i((s) => ({
1287
+ ...s,
1288
+ filters: {
1289
+ ...s.filters,
1290
+ [o]: l
1291
+ }
1292
+ })),
1293
+ toggleFilterValue: (o, l) => i((s) => {
1294
+ const d = s.filters[o] ?? [], g = Yn(d, l), p = g.length === 0 ? Ue(s.filters, o) : {
1295
+ ...s.filters,
1296
+ [o]: g
1297
+ };
1298
+ return {
1299
+ ...s,
1300
+ filters: p
1301
+ };
1302
+ }),
1303
+ clearFilter: (o) => i((l) => ({
1304
+ ...l,
1305
+ filters: Ue(l.filters, o)
1306
+ })),
1307
+ clearAllFilters: () => i((o) => ({
1308
+ ...o,
1309
+ filters: {}
1310
+ })),
1311
+ setExpandedGroup: (o, l) => i((s) => ({
1312
+ ...s,
1313
+ expandedGroups: {
1314
+ ...s.expandedGroups,
1315
+ [o]: l
1316
+ }
1317
+ })),
1318
+ reset: () => i(r)
1319
+ }), {
1320
+ name: Zn(e),
1321
+ version: 2,
1322
+ migrate: (i, o) => {
1323
+ if (!i || typeof i != "object") return i;
1324
+ const l = i;
1325
+ if (o >= 2) {
1326
+ const s = l;
1327
+ return {
1328
+ ...s,
1329
+ expandedGroups: s.expandedGroups ?? {}
1330
+ };
1331
+ }
1332
+ return {
1333
+ settings: Qn(l.settings ?? {}),
1334
+ filters: er(l.filters ?? {}),
1335
+ expandedGroups: {}
1336
+ };
1337
+ },
1338
+ storage: zt(Nt),
1339
+ partialize: (i) => ({
1340
+ settings: i.settings,
1341
+ filters: i.filters,
1342
+ expandedGroups: i.expandedGroups
1343
+ })
1344
+ }));
1345
+ }, tt = /* @__PURE__ */ new Map(), nr = (t, e) => {
1346
+ const n = tt.get(t);
1347
+ if (n) return n;
1348
+ const r = tr({
1349
+ storageKey: t,
1350
+ initialState: e
1351
+ });
1352
+ return tt.set(t, r), r;
1353
+ }, X = (t, e, n) => {
1354
+ const r = H(3);
1355
+ let i;
1356
+ return r[0] !== n || r[1] !== t ? (i = nr(t, n), r[0] = n, r[1] = t, r[2] = i) : i = r[2], Ft(i, e);
1357
+ }, rr = (t) => {
1358
+ const e = [];
1359
+ for (const n of t)
1360
+ n.type.kind !== "enum" && n.type.kind !== "enum-multi" || _e(n.type.options) && e.push(n.type.options);
1361
+ return e;
1362
+ }, or = (t) => t.map((e) => e.type.kind !== "enum" && e.type.kind !== "enum-multi" || !_e(e.type.options) ? e : {
1363
+ ...e,
1364
+ type: {
1365
+ ...e.type,
1366
+ options: e.type.options.getSnapshot()
1367
+ }
1368
+ }), ht = (t) => {
1369
+ const e = H(7), [, n] = wt(ir, 0);
1370
+ let r;
1371
+ e[0] !== t || e[1] !== n ? (r = () => {
1372
+ const l = rr(t);
1373
+ if (l.length === 0)
1374
+ return;
1375
+ const s = () => n(), d = l.map((g) => g.subscribe(s));
1376
+ return () => {
1377
+ for (const g of d)
1378
+ g();
1379
+ };
1380
+ }, e[0] = t, e[1] = n, e[2] = r) : r = e[2];
1381
+ let i;
1382
+ e[3] !== t ? (i = [t], e[3] = t, e[4] = i) : i = e[4], Me(r, i);
1383
+ let o;
1384
+ return e[5] !== t ? (o = or(t), e[5] = t, e[6] = o) : o = e[6], o;
1385
+ };
1386
+ function ir(t) {
1387
+ return t + 1;
1388
+ }
1389
+ const lr = (t) => {
1390
+ const e = H(39), {
1391
+ rows: n,
1392
+ storageKey: r,
1393
+ attributes: i,
1394
+ defaultSettings: o,
1395
+ defaultFilters: l,
1396
+ leading: s,
1397
+ align: d
1398
+ } = t, g = d === void 0 ? "split" : d, p = ht(i);
1399
+ let c;
1400
+ e[0] !== p ? (c = kn(p), e[0] = p, e[1] = c) : c = e[1];
1401
+ const f = c;
1402
+ let u;
1403
+ e[2] !== p ? (u = Gn(p), e[2] = p, e[3] = u) : u = e[3];
1404
+ const m = u;
1405
+ let h;
1406
+ e[4] !== p ? (h = An(p), e[4] = p, e[5] = h) : h = e[5];
1407
+ const v = h;
1408
+ let C;
1409
+ e[6] !== l || e[7] !== o ? (C = {
1410
+ settings: o,
1411
+ filters: l
1412
+ }, e[6] = l, e[7] = o, e[8] = C) : C = e[8];
1413
+ const k = C, T = X(r, sr, k), R = X(r, ar, k), P = X(r, cr, k), G = X(r, dr, k), S = X(r, ur, k), x = X(r, gr, k), I = X(r, pr, k), y = X(r, fr, k), b = X(r, mr, k), w = X(r, br, k), D = X(r, hr, k);
1414
+ let M, E;
1415
+ e[9] !== p || e[10] !== n ? (M = In(p, n), E = Object.fromEntries(M.map((B) => [B.id, Fn(n, B.id, p)])), e[9] = p, e[10] = n, e[11] = M, e[12] = E) : (M = e[11], E = e[12]);
1416
+ const W = E, K = g === "split" ? "full" : void 0;
1417
+ let z;
1418
+ e[13] !== g ? (z = g === "split" ? /* @__PURE__ */ a(se, { flex: "1" }) : null, e[13] = g, e[14] = z) : z = e[14];
1419
+ let V;
1420
+ e[15] !== M || e[16] !== D || e[17] !== w || e[18] !== W || e[19] !== R || e[20] !== b ? (V = /* @__PURE__ */ a(Xn, { categories: M, filters: R, countsByCategory: W, onToggleFilterValue: b, onClearFilter: w, onClearAll: D }), e[15] = M, e[16] = D, e[17] = w, e[18] = W, e[19] = R, e[20] = b, e[21] = V) : V = e[21];
1421
+ let A;
1422
+ e[22] !== v || e[23] !== f || e[24] !== m || e[25] !== G || e[26] !== x || e[27] !== S || e[28] !== P || e[29] !== T || e[30] !== y || e[31] !== I ? (A = /* @__PURE__ */ a(zn, { settings: T, groupingOptions: f, orderingOptions: m, displayPropertyOptions: v, onViewModeChange: P, onColumnGroupingChange: G, onRowGroupingChange: S, onOrderingAttributeIdChange: x, onSortDirectionToggle: I, onDisplayPropertyToggle: y }), e[22] = v, e[23] = f, e[24] = m, e[25] = G, e[26] = x, e[27] = S, e[28] = P, e[29] = T, e[30] = y, e[31] = I, e[32] = A) : A = e[32];
1423
+ let O;
1424
+ return e[33] !== s || e[34] !== K || e[35] !== z || e[36] !== V || e[37] !== A ? (O = /* @__PURE__ */ _(Z, { gap: "2xs", minW: "0", w: K, flexShrink: 0, borderBottomWidth: "1px", borderColor: "border.subtle", padding: "2xs", children: [
1425
+ s,
1426
+ z,
1427
+ V,
1428
+ A
1429
+ ] }), e[33] = s, e[34] = K, e[35] = z, e[36] = V, e[37] = A, e[38] = O) : O = e[38], O;
1430
+ };
1431
+ function sr(t) {
1432
+ return t.settings;
1433
+ }
1434
+ function ar(t) {
1435
+ return t.filters;
1436
+ }
1437
+ function cr(t) {
1438
+ return t.setViewMode;
1439
+ }
1440
+ function dr(t) {
1441
+ return t.setColumnGrouping;
1442
+ }
1443
+ function ur(t) {
1444
+ return t.setRowGrouping;
1445
+ }
1446
+ function gr(t) {
1447
+ return t.setOrderingAttributeId;
1448
+ }
1449
+ function pr(t) {
1450
+ return t.toggleSortDirection;
1451
+ }
1452
+ function fr(t) {
1453
+ return t.toggleDisplayProperty;
1454
+ }
1455
+ function mr(t) {
1456
+ return t.toggleFilterValue;
1457
+ }
1458
+ function br(t) {
1459
+ return t.clearFilter;
1460
+ }
1461
+ function hr(t) {
1462
+ return t.clearAllFilters;
1463
+ }
1464
+ const yr = (t) => {
1465
+ const {
1466
+ settings: e,
1467
+ visibleRows: n,
1468
+ grouped: r,
1469
+ attributes: i,
1470
+ onRowClick: o,
1471
+ onAttributeChange: l,
1472
+ onReorder: s,
1473
+ getRowContextMenuActions: d
1474
+ } = t, g = e.ordering.attributeId === ee, p = (u, m) => {
1475
+ const h = ne(i, u);
1476
+ return h ? ve(h.type, m)?.color : void 0;
1477
+ }, c = (u, m) => ({
1478
+ id: u.id,
1479
+ title: u.title,
1480
+ badges: ft(u, i, e.displayProperties),
1481
+ customSlots: mt(u, i, e.displayProperties),
1482
+ contextMenuActions: d?.(u),
1483
+ onClick: () => o?.(u),
1484
+ onBadgeChange: l ? (h, v) => l(u.id, h, v) : void 0,
1485
+ draggable: !!(l || s),
1486
+ onDropRow: g && (l || s) ? (h) => {
1487
+ const v = Pn(e.columnGrouping, m);
1488
+ v && e.columnGrouping !== N && l && l(h, e.columnGrouping, v), e.rowGrouping !== N && m?.rowKey && l && l(h, e.rowGrouping, m.rowKey), s?.(h, u.id);
1489
+ } : void 0
1490
+ }), f = (u, m) => ({
1491
+ id: m ? `group::${m.columnKey}::${u.key}` : `group::${u.key}`,
1492
+ title: u.label,
1493
+ countBadge: u.rows.length,
1494
+ countColorPalette: p(m ? e.rowGrouping : e.columnGrouping, u.key),
1495
+ onDropRow: l && e.columnGrouping !== N ? (h) => {
1496
+ const v = m?.columnKey ?? u.key;
1497
+ l(h, e.columnGrouping, v), e.rowGrouping !== N && m && l(h, e.rowGrouping, u.key);
1498
+ } : void 0,
1499
+ children: De(u.rows, e.ordering, i).map((h) => c(h, {
1500
+ columnKey: m?.columnKey ?? u.key,
1501
+ rowKey: m ? u.key : void 0
1502
+ }))
1503
+ });
1504
+ return e.columnGrouping === N ? De(n, e.ordering, i).map((u) => c(u)) : r.map((u) => u.subgroups.length > 0 ? {
1505
+ id: `group::${u.key}`,
1506
+ title: u.label,
1507
+ countBadge: u.rows.length,
1508
+ countColorPalette: p(e.columnGrouping, u.key),
1509
+ onDropRow: l ? (m) => l(m, e.columnGrouping, u.key) : void 0,
1510
+ children: u.subgroups.map((m) => f(m, {
1511
+ columnKey: u.key
1512
+ }))
1513
+ } : f(u));
1514
+ }, zr = (t) => {
1515
+ const e = H(54), {
1516
+ rows: n,
1517
+ storageKey: r,
1518
+ attributes: i,
1519
+ selectedRowId: o,
1520
+ emptyState: l,
1521
+ emptyTitle: s,
1522
+ emptyDescription: d,
1523
+ defaultSettings: g,
1524
+ defaultFilters: p,
1525
+ onRowClick: c,
1526
+ onAttributeChange: f,
1527
+ onReorder: u,
1528
+ onCreateRow: m,
1529
+ onColumnAction: h,
1530
+ getBoardColumnConfig: v,
1531
+ getRowContextMenuActions: C,
1532
+ hideToolbar: k,
1533
+ toolbarLeading: T
1534
+ } = t, R = o === void 0 ? null : o, P = s === void 0 ? "No rows found" : s, G = d === void 0 ? "Try changing filters or display settings." : d, S = k === void 0 ? !1 : k, x = ht(i);
1535
+ let I;
1536
+ e[0] !== p || e[1] !== g ? (I = {
1537
+ settings: g,
1538
+ filters: p
1539
+ }, e[0] = p, e[1] = g, e[2] = I) : I = e[2];
1540
+ const y = I, b = X(r, vr, y), w = X(r, xr, y), D = X(r, Cr, y), M = X(r, Sr, y);
1541
+ let E, W;
1542
+ if (e[3] !== x || e[4] !== w || e[5] !== v || e[6] !== C || e[7] !== f || e[8] !== u || e[9] !== c || e[10] !== n || e[11] !== b) {
1543
+ const U = Ln(n, w, x), q = Tn(b.columnGrouping, x, w), ae = _n(U, {
1544
+ attributes: x,
1545
+ columnGrouping: b.columnGrouping,
1546
+ rowGrouping: b.rowGrouping,
1547
+ knownColumnKeys: q
1548
+ });
1549
+ E = yr({
1550
+ settings: b,
1551
+ visibleRows: U,
1552
+ grouped: ae,
1553
+ attributes: x,
1554
+ onRowClick: c,
1555
+ onAttributeChange: f,
1556
+ onReorder: u,
1557
+ getRowContextMenuActions: C
1558
+ });
1559
+ let xe;
1560
+ e[14] !== x || e[15] !== C || e[16] !== f || e[17] !== c || e[18] !== b.displayProperties ? (xe = (re) => re.map((J) => ({
1561
+ id: J.id,
1562
+ contextMenuActions: C?.(J),
1563
+ cardProps: {
1564
+ title: J.title,
1565
+ badges: ft(J, x, b.displayProperties),
1566
+ customSlots: mt(J, x, b.displayProperties),
1567
+ onBadgeChange: f ? (Ie, ke) => f(J.id, Ie, ke) : void 0,
1568
+ onClick: () => c?.(J)
1569
+ }
1570
+ })), e[14] = x, e[15] = C, e[16] = f, e[17] = c, e[18] = b.displayProperties, e[19] = xe) : xe = e[19];
1571
+ const Le = xe, Fe = ne(x, b.columnGrouping);
1572
+ W = ae.map((re) => {
1573
+ const J = v?.(re.key) ?? {}, Ie = De(re.rows, b.ordering, x), ke = Fe ? ve(Fe.type, re.key)?.color : void 0, yt = re.subgroups.length > 0 ? re.subgroups.map((Ge) => ({
1574
+ key: Ge.key,
1575
+ label: Ge.label,
1576
+ items: Le(De(Ge.rows, b.ordering, x))
1577
+ })) : void 0;
1578
+ return {
1579
+ id: re.key,
1580
+ label: re.label,
1581
+ color: J.color ?? ke,
1582
+ canDragIn: J.canDragIn ?? !1,
1583
+ canDragOut: J.canDragOut ?? !1,
1584
+ canCreate: J.canCreate ?? !1,
1585
+ actions: J.actions ?? [],
1586
+ items: Le(Ie),
1587
+ groups: yt
1588
+ };
1589
+ }), e[3] = x, e[4] = w, e[5] = v, e[6] = C, e[7] = f, e[8] = u, e[9] = c, e[10] = n, e[11] = b, e[12] = E, e[13] = W;
1590
+ } else
1591
+ E = e[12], W = e[13];
1592
+ const K = W;
1593
+ let z;
1594
+ e[20] !== f || e[21] !== u || e[22] !== b ? (z = async (U, q, ae) => {
1595
+ await Kt({
1596
+ settings: b,
1597
+ rowId: U,
1598
+ targetColumnId: q,
1599
+ targetGroupKey: ae?.targetGroupKey,
1600
+ beforeItemId: ae?.beforeItemId,
1601
+ onAttributeChange: f,
1602
+ onReorder: u
1603
+ });
1604
+ }, e[20] = f, e[21] = u, e[22] = b, e[23] = z) : z = e[23];
1605
+ const V = z;
1606
+ let A;
1607
+ e[24] !== f || e[25] !== u || e[26] !== b ? (A = async (U, q, ae) => {
1608
+ await Ht({
1609
+ settings: b,
1610
+ rowId: U,
1611
+ targetGroupKey: q,
1612
+ beforeItemId: ae?.beforeItemId,
1613
+ onAttributeChange: f,
1614
+ onReorder: u
1615
+ });
1616
+ }, e[24] = f, e[25] = u, e[26] = b, e[27] = A) : A = e[27];
1617
+ const O = A;
1618
+ let B;
1619
+ e[28] !== x || e[29] !== p || e[30] !== g || e[31] !== S || e[32] !== n || e[33] !== r || e[34] !== T ? (B = S ? null : /* @__PURE__ */ a(lr, { rows: n, storageKey: r, attributes: x, defaultSettings: g, defaultFilters: p, leading: T }), e[28] = x, e[29] = p, e[30] = g, e[31] = S, e[32] = n, e[33] = r, e[34] = T, e[35] = B) : B = e[35];
1620
+ const L = `${b.columnGrouping}:${b.rowGrouping}`;
1621
+ let F;
1622
+ e[36] !== K || e[37] !== G || e[38] !== l || e[39] !== P || e[40] !== D || e[41] !== V || e[42] !== O || e[43] !== E || e[44] !== h || e[45] !== m || e[46] !== R || e[47] !== M || e[48] !== b.viewMode || e[49] !== L ? (F = /* @__PURE__ */ a(un, { viewMode: b.viewMode, boardColumns: K, listItems: E, listExpandedGroups: D, selectedRowId: R, emptyState: l, emptyTitle: P, emptyDescription: G, onBoardMoveItem: V, onBoardMoveToGroup: O, onCreateRow: m, onColumnAction: h, onListExpandedGroupChange: M, listKey: L }), e[36] = K, e[37] = G, e[38] = l, e[39] = P, e[40] = D, e[41] = V, e[42] = O, e[43] = E, e[44] = h, e[45] = m, e[46] = R, e[47] = M, e[48] = b.viewMode, e[49] = L, e[50] = F) : F = e[50];
1623
+ let $;
1624
+ return e[51] !== F || e[52] !== B ? ($ = /* @__PURE__ */ _(te, { height: "100%", minH: "0", gap: "0", children: [
1625
+ B,
1626
+ F
1627
+ ] }), e[51] = F, e[52] = B, e[53] = $) : $ = e[53], $;
1628
+ };
1629
+ function vr(t) {
1630
+ return t.settings;
1631
+ }
1632
+ function xr(t) {
1633
+ return t.filters;
1634
+ }
1635
+ function Cr(t) {
1636
+ return t.expandedGroups;
1637
+ }
1638
+ function Sr(t) {
1639
+ return t.setExpandedGroup;
1640
+ }
1641
+ export {
1642
+ zr as DataRenderer,
1643
+ tn as DataRendererBoard,
1644
+ dt as DataRendererCard,
1645
+ cn as DataRendererList,
1646
+ lr as DataRendererToolbar,
1647
+ zn as DisplayMenu,
1648
+ Xn as FilterMenu,
1649
+ ee as MANUAL_ORDERING,
1650
+ N as NO_GROUPING,
1651
+ An as buildDisplayPropertyOptions,
1652
+ In as buildFilterCategories,
1653
+ kn as buildGroupingOptions,
1654
+ Gn as buildOrderingOptions,
1655
+ ft as collectDisplayBadges,
1656
+ ne as findAttribute,
1657
+ ge as getAttributeStringValues,
1658
+ de as getAttributeValue,
1659
+ ie as getEnumOptions,
1660
+ Lr as isAttributesSource,
1661
+ _e as isEnumOptionsSource,
1662
+ Dn as renderAttributeBadge,
1663
+ or as resolveAttributeOptions,
1664
+ $r as sanitizeFilters,
1665
+ Fr as sanitizeSettings,
1666
+ X as useDataRendererStore,
1667
+ ht as useResolvedAttributes
1668
+ };
1669
+ //# sourceMappingURL=data-renderer.js.map