@nivaro/react 0.2.54 → 0.2.55

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 (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
@@ -1,80 +1,83 @@
1
- import { jsxs as c, Fragment as ke, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as d, Fragment as ke, jsx as r } from "react/jsx-runtime";
2
2
  import { useSensors as dl, useSensor as ul, PointerSensor as ml, DndContext as bl, closestCenter as pl } from "@dnd-kit/core";
3
3
  import { SortableContext as hl, verticalListSortingStrategy as fl, arrayMove as gl, useSortable as xl } from "@dnd-kit/sortable";
4
4
  import { CSS as yl } from "@dnd-kit/utilities";
5
- import { useQueryClient as kl, useQuery as H, useMutation as ye, useQueries as Ie } from "@tanstack/react-query";
6
- import { Eye as vl, AlertTriangle as wl, FileDiff as _l, RefreshCw as Nl, Rows3 as Ga, Flame as Sl, Sparkles as Cl, BarChart3 as $l, SlidersHorizontal as ql, Rows4 as Fl, Rows2 as Tl, Play as Al, Plus as Bt, ChevronDown as Wa, Star as Rl, Pin as El, Loader2 as Ol, Check as Ll, Save as Dl, Bell as Pl, Inbox as Kl, GripVertical as Ml } from "lucide-react";
7
- import { useState as y, useRef as B, useEffect as j, useMemo as W } from "react";
8
- import { createPortal as Ha } from "react-dom";
9
- import { toast as A } from "sonner";
10
- import { useNivaroClient as tr, useItemEditAuth as Ya, useItemNavigation as Ql, useNavigation as jl, useOverlayState as Bl } from "../../context.js";
11
- import { useDebounced as Il } from "../../hooks/useDebounced.js";
5
+ import { useQueryClient as kl, useQuery as H, useMutation as ye, useQueries as Ve } from "@tanstack/react-query";
6
+ import { AlertTriangle as vl, FileDiff as wl, RefreshCw as _l, Rows3 as Vr, Flame as Nl, Sparkles as Sl, BarChart3 as Cl, SlidersHorizontal as $l, Rows4 as ql, Rows2 as Fl, Play as Rl, Plus as jt, ChevronDown as Gr, Star as Tl, Pin as Al, Loader2 as El, Check as Ol, Save as Ll, Bell as Dl, Inbox as Pl, GripVertical as Kl } from "lucide-react";
7
+ import { useState as k, useRef as B, useEffect as j, useMemo as G } from "react";
8
+ import { createPortal as Wr } from "react-dom";
9
+ import { toast as T } from "sonner";
10
+ import { useNivaroClient as ea, useItemEditAuth as Hr, useItemNavigation as Ml, useNavigation as Ql, useOverlayState as Bl } from "../../context.js";
11
+ import { useDebounced as jl } from "../../hooks/useDebounced.js";
12
12
  import { useElapsedLoading as Ul } from "../../hooks/useElapsedLoading.js";
13
- import { useBulkProgressFeed as Vl } from "../../lib/bulk-progress.js";
14
- import { get as E, post as Z, patch as Ja, del as $n, put as Gl } from "../../lib/commands.js";
15
- import { evaluateExpression as Wl } from "../../lib/expression.js";
16
- import { deliverLive as Hl, releaseLiveOwner as Yl } from "../../lib/focus-mode.js";
17
- import { formatMultiValue as Ue, formatValue as Jl } from "../../lib/format-value.js";
18
- import { expandCoalesced as zl, LIVE_ASPECTS as ht } from "../../lib/live.js";
19
- import { useRowChanges as Xl, useRowLocksByCollection as Zl, lockLabel as eo } from "../../lib/live-list.js";
20
- import { OPEN_IN_TABS_CAP as to, openInTabs as no, openInTabsMessage as za } from "../../lib/open-in-tabs.js";
21
- import { isOwnWrite as ao } from "../../lib/own-writes.js";
22
- import { buildGroups as ro } from "../../lib/queue-grouping.js";
23
- import { useOptionalRealtime as lo } from "../../lib/realtime.js";
24
- import { rowHighlightTextClass as oo, rowHighlightClass as so } from "../../lib/row-highlight.js";
25
- import { useMyScopes as io, matchScopeDimension as co, effectiveScopeSeedIds as uo } from "../../lib/use-my-scopes.js";
26
- import { useNewItemLayouts as mo } from "../../lib/use-new-item-layouts.js";
27
- import { formatNumber as ae, cn as C, titleCase as qn, humanHours as bo, formatRelative as po, formatDateTime as ho, formatDate as fo } from "../../lib/utils.js";
28
- import { usePublishAskContext as go, useAskRecordDrag as xo } from "../ai/ask-context.js";
29
- import { useBuiltinGate as yo, BulkActionButtons as ko } from "../bulk/BulkActionButtons.js";
30
- import { BulkRowMark as vo } from "../bulk/BulkRowMark.js";
31
- import { RowActionsMenu as wo } from "../CollectionBrowserView.js";
32
- import { DataTable as _o } from "../DataTable.js";
33
- import { EmptyState as No } from "../EmptyState.js";
34
- import { FocusModeToggle as So } from "../FocusModeToggle.js";
35
- import { FulfilmentPill as Co, FULFILMENT_FILTER_OPTIONS as $o } from "../FulfilmentPill.js";
36
- import { ImportFromFileButton as qo } from "../import/ImportFromFileButton.js";
37
- import { IntegrationDots as Fo, INTEGRATIONS_FILTER_OPTIONS as To } from "../integrations/IntegrationDots.js";
38
- import { IntegrationsFilterPill as Ao } from "../integrations/IntegrationsFilterPill.js";
39
- import { readQueueReturn as Ro, writeQueueReturn as Xa } from "../item-edit/QueueReturnChip.js";
40
- import { LiveRowMark as Eo } from "../LiveRowMark.js";
41
- import { RealtimeStaleMark as Oo } from "../RealtimeStatusBanner.js";
42
- import { RecordDrilldownSheet as Lo } from "../RecordDrilldownSheet.js";
43
- import { RowHighlightLegend as Do } from "../RowHighlightLegend.js";
13
+ import { useBulkProgressFeed as Il } from "../../lib/bulk-progress.js";
14
+ import { get as E, post as ne, patch as Jr, del as $n, put as Vl } from "../../lib/commands.js";
15
+ import { evaluateExpression as Gl } from "../../lib/expression.js";
16
+ import { deliverLive as Wl, releaseLiveOwner as Hl } from "../../lib/focus-mode.js";
17
+ import { formatMultiValue as Ge, formatValue as Jl } from "../../lib/format-value.js";
18
+ import { createCursorBook as Yl, pageRequest as zl, noteNextCursor as Xl } from "../../lib/keyset-pager.js";
19
+ import { expandCoalesced as Zl, LIVE_ASPECTS as ft } from "../../lib/live.js";
20
+ import { useRowChanges as eo, useRowLocksByCollection as to, lockLabel as no } from "../../lib/live-list.js";
21
+ import { OPEN_IN_TABS_CAP as ro, openInTabs as ao, openInTabsMessage as Yr } from "../../lib/open-in-tabs.js";
22
+ import { isOwnWrite as lo } from "../../lib/own-writes.js";
23
+ import { useRowPresence as oo, rowPresenceKey as so } from "../../lib/presence-hooks.js";
24
+ import { buildGroups as io } from "../../lib/queue-grouping.js";
25
+ import { useOptionalRealtime as co } from "../../lib/realtime.js";
26
+ import { rowHighlightTextClass as uo, rowHighlightClass as mo } from "../../lib/row-highlight.js";
27
+ import { useMyScopes as bo, matchScopeDimension as po, effectiveScopeSeedIds as ho } from "../../lib/use-my-scopes.js";
28
+ import { useNewItemLayouts as fo } from "../../lib/use-new-item-layouts.js";
29
+ import { formatNumber as re, cn as C, titleCase as qn, humanHours as go, formatRelative as xo, formatDateTime as yo, formatDate as ko } from "../../lib/utils.js";
30
+ import { usePublishAskContext as vo, useAskRecordDrag as wo } from "../ai/ask-context.js";
31
+ import { useBuiltinGate as _o, BulkActionButtons as No } from "../bulk/BulkActionButtons.js";
32
+ import { BulkRowMark as So } from "../bulk/BulkRowMark.js";
33
+ import { RowActionsMenu as Co } from "../CollectionBrowserView.js";
34
+ import { DataTable as $o } from "../DataTable.js";
35
+ import { EmptyState as qo } from "../EmptyState.js";
36
+ import { FocusModeToggle as Fo } from "../FocusModeToggle.js";
37
+ import { FulfilmentPill as Ro, FULFILMENT_FILTER_OPTIONS as To } from "../FulfilmentPill.js";
38
+ import { ImportFromFileButton as Ao } from "../import/ImportFromFileButton.js";
39
+ import { IntegrationDots as Eo, INTEGRATIONS_FILTER_OPTIONS as Oo } from "../integrations/IntegrationDots.js";
40
+ import { IntegrationsFilterPill as Lo } from "../integrations/IntegrationsFilterPill.js";
41
+ import { readQueueReturn as Do, writeQueueReturn as zr } from "../item-edit/QueueReturnChip.js";
42
+ import { LiveRowMark as Po } from "../LiveRowMark.js";
43
+ import { RealtimeStaleMark as Ko } from "../RealtimeStatusBanner.js";
44
+ import { RecordDrilldownSheet as Mo } from "../RecordDrilldownSheet.js";
45
+ import { RowHighlightLegend as Qo } from "../RowHighlightLegend.js";
46
+ import { RowPresence as Bo } from "../RowPresence.js";
44
47
  import { TickerNumber as Fn } from "../TickerNumber.js";
45
- import { UnseenDot as Po } from "../UnseenDot.js";
46
- import { Badge as Ko } from "../ui/badge.js";
47
- import { Checkbox as Tn } from "../ui/checkbox.js";
48
- import { Command as Za, CommandInput as Mo, CommandList as er, CommandEmpty as Qo, CommandItem as ft } from "../ui/command.js";
49
- import { Label as jo } from "../ui/label.js";
50
- import { Popover as Ve, PopoverTrigger as Ge, PopoverContent as We } from "../ui/popover.js";
51
- import { Skeleton as Bo } from "../ui/skeleton.js";
52
- import { OwnerAvatars as Io } from "./OwnerAvatars.js";
53
- import { QueueBulkBar as Uo } from "./QueueBulkBar.js";
54
- import { QueueItemSheet as Vo } from "./QueueItemSheet.js";
55
- import { QueueKanbanBoard as Go } from "./QueueKanbanBoard.js";
56
- import { QueueQuickFilters as Wo } from "./QueueQuickFilters.js";
57
- import { QueueWorkloadView as Ho } from "./QueueWorkloadView.js";
58
- function Yo({ summary: l }) {
48
+ import { UnseenDot as jo } from "../UnseenDot.js";
49
+ import { Badge as Uo } from "../ui/badge.js";
50
+ import { Checkbox as Rn } from "../ui/checkbox.js";
51
+ import { Command as Xr, CommandInput as Io, CommandList as Zr, CommandEmpty as Vo, CommandItem as gt } from "../ui/command.js";
52
+ import { Label as Go } from "../ui/label.js";
53
+ import { Popover as We, PopoverTrigger as He, PopoverContent as Je } from "../ui/popover.js";
54
+ import { Skeleton as Wo } from "../ui/skeleton.js";
55
+ import { OwnerAvatars as Ho } from "./OwnerAvatars.js";
56
+ import { QueueBulkBar as Jo } from "./QueueBulkBar.js";
57
+ import { QueueItemSheet as Yo } from "./QueueItemSheet.js";
58
+ import { QueueKanbanBoard as zo } from "./QueueKanbanBoard.js";
59
+ import { QueueQuickFilters as Xo } from "./QueueQuickFilters.js";
60
+ import { QueueWorkloadView as Zo } from "./QueueWorkloadView.js";
61
+ function es({ summary: l }) {
59
62
  if (!l || l.count === 0)
60
- return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
63
+ return /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
61
64
  const f = [l.last_from, l.last_to].filter(Boolean).join(" → "), $ = [
62
65
  f ? `Last: ${f}` : null,
63
- l.last_at ? po(l.last_at) : null,
66
+ l.last_at ? xo(l.last_at) : null,
64
67
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
65
68
  ].filter(Boolean).join(" · ");
66
- return /* @__PURE__ */ c(
69
+ return /* @__PURE__ */ d(
67
70
  "span",
68
71
  {
69
72
  className: "inline-flex max-w-[260px] items-center gap-1.5 truncate rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-[11px] font-medium text-rose-700 dark:border-rose-900/40 dark:bg-rose-900/10 dark:text-rose-300",
70
73
  "data-tip": $,
71
74
  "data-send-backs": l.count,
72
75
  children: [
73
- /* @__PURE__ */ c("span", { className: "tabular-nums", children: [
76
+ /* @__PURE__ */ d("span", { className: "tabular-nums", children: [
74
77
  "↩ ",
75
78
  l.count
76
79
  ] }),
77
- l.last_reason && /* @__PURE__ */ c("span", { className: "truncate font-normal opacity-80", children: [
80
+ l.last_reason && /* @__PURE__ */ d("span", { className: "truncate font-normal opacity-80", children: [
78
81
  "· ",
79
82
  l.last_reason
80
83
  ] })
@@ -82,16 +85,16 @@ function Yo({ summary: l }) {
82
85
  }
83
86
  );
84
87
  }
85
- const Jo = 50, It = "nivaro_addendums", zo = [
88
+ const ts = 50, Ut = "nivaro_addendums", ns = [
86
89
  { value: "mine", label: "My Items" },
87
90
  { value: "unowned", label: "No Owners" },
88
91
  { value: "claimed", label: "Claimed by me" },
89
92
  { value: "all", label: "All Items" }
90
93
  ];
91
- function Xo({ summary: l }) {
92
- if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
93
- const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", O = l.cost_impact, I = O != null && O !== 0 ? `${O > 0 ? "+" : "−"}$${Math.abs(O).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
94
- return /* @__PURE__ */ c(
94
+ function rs({ summary: l }) {
95
+ if (!l || l.total === 0) return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
96
+ const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", O = l.cost_impact, U = O != null && O !== 0 ? `${O > 0 ? "+" : "−"}$${Math.abs(O).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
97
+ return /* @__PURE__ */ d(
95
98
  "span",
96
99
  {
97
100
  title: l.latest_title ?? void 0,
@@ -100,7 +103,7 @@ function Xo({ summary: l }) {
100
103
  f ? "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
101
104
  ),
102
105
  children: [
103
- /* @__PURE__ */ a(
106
+ /* @__PURE__ */ r(
104
107
  "span",
105
108
  {
106
109
  "aria-hidden": !0,
@@ -111,49 +114,49 @@ function Xo({ summary: l }) {
111
114
  }
112
115
  ),
113
116
  f ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${$}` : `${l.total} ${$}`,
114
- I && /* @__PURE__ */ c("span", { className: "tabular-nums opacity-80", children: [
117
+ U && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
115
118
  "· ",
116
- I
119
+ U
117
120
  ] })
118
121
  ]
119
122
  }
120
123
  );
121
124
  }
122
- function Zo(l) {
123
- return bo(l);
125
+ function as(l) {
126
+ return go(l);
124
127
  }
125
- function es({ status: l }) {
126
- return l ? /* @__PURE__ */ a("span", { className: C("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
128
+ function ls({ status: l }) {
129
+ return l ? /* @__PURE__ */ r("span", { className: C("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
127
130
  }
128
- function ts({ points: l, inline: f = !1 }) {
131
+ function os({ points: l, inline: f = !1 }) {
129
132
  if (l.length < 2) return null;
130
- const $ = f ? 40 : 64, O = f ? 14 : 18, I = Math.max(...l), h = Math.min(...l), p = I - h || 1, v = $ / (l.length - 1), V = l.map(
131
- (me, x) => `${x === 0 ? "M" : "L"}${(x * v).toFixed(1)},${(O - 2 - (me - h) / p * (O - 4)).toFixed(1)}`
133
+ const $ = f ? 40 : 64, O = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = $ / (l.length - 1), W = l.map(
134
+ (me, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(O - 2 - (me - h) / p * (O - 4)).toFixed(1)}`
132
135
  ).join(" ");
133
- return /* @__PURE__ */ a(
136
+ return /* @__PURE__ */ r(
134
137
  "svg",
135
138
  {
136
139
  width: $,
137
140
  height: O,
138
141
  className: f ? "opacity-40" : "mt-1.5 opacity-40",
139
142
  "aria-hidden": "true",
140
- children: /* @__PURE__ */ a("path", { d: V, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
143
+ children: /* @__PURE__ */ r("path", { d: W, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
141
144
  }
142
145
  );
143
146
  }
144
- function gt({
147
+ function xt({
145
148
  label: l,
146
149
  count: f,
147
150
  filteredCount: $,
148
151
  active: O,
149
- isLoading: I,
152
+ isLoading: U,
150
153
  tone: h,
151
154
  trend: p,
152
155
  delta: v,
153
- deltaBadIsUp: V,
156
+ deltaBadIsUp: W,
154
157
  onClick: me
155
158
  }) {
156
- return /* @__PURE__ */ a(
159
+ return /* @__PURE__ */ r(
157
160
  "button",
158
161
  {
159
162
  type: "button",
@@ -161,17 +164,17 @@ function gt({
161
164
  className: C(
162
165
  "nvr-section-enter flex items-center gap-1.5 bg-white px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:bg-card dark:hover:bg-card/80",
163
166
  O && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
164
- !O && !I && f === 0 && "opacity-50"
167
+ !O && !U && f === 0 && "opacity-50"
165
168
  ),
166
- children: I ? /* @__PURE__ */ a(Bo, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ c(ke, { children: [
167
- /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ c(ke, { children: [
168
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Fn, { value: $, format: ae }) }),
169
- /* @__PURE__ */ c("span", { className: "text-[11px] font-medium text-slate-400", children: [
169
+ children: U ? /* @__PURE__ */ r(Wo, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(ke, { children: [
170
+ /* @__PURE__ */ r("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ d(ke, { children: [
171
+ /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(Fn, { value: $, format: re }) }),
172
+ /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
170
173
  "/ ",
171
- /* @__PURE__ */ a(Fn, { value: f, format: ae })
174
+ /* @__PURE__ */ r(Fn, { value: f, format: re })
172
175
  ] })
173
- ] }) : /* @__PURE__ */ a(Fn, { value: f, format: ae }) }),
174
- /* @__PURE__ */ a(
176
+ ] }) : /* @__PURE__ */ r(Fn, { value: f, format: re }) }),
177
+ /* @__PURE__ */ r(
175
178
  "span",
176
179
  {
177
180
  className: C(
@@ -181,43 +184,43 @@ function gt({
181
184
  children: l
182
185
  }
183
186
  ),
184
- v != null && v !== 0 && /* @__PURE__ */ c(
187
+ v != null && v !== 0 && /* @__PURE__ */ d(
185
188
  "span",
186
189
  {
187
190
  className: C(
188
191
  "text-[10px] font-medium leading-none",
189
- V ? v > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
192
+ W ? v > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
190
193
  ),
191
194
  children: [
192
195
  v > 0 ? "↑" : "↓",
193
- ae(Math.abs(v))
196
+ re(Math.abs(v))
194
197
  ]
195
198
  }
196
199
  ),
197
- p && f > 0 && /* @__PURE__ */ a(ts, { points: p, inline: !0 })
200
+ p && f > 0 && /* @__PURE__ */ r(os, { points: p, inline: !0 })
198
201
  ] })
199
202
  }
200
203
  );
201
204
  }
202
- function ns({
205
+ function ss({
203
206
  label: l,
204
207
  count: f,
205
208
  filteredCount: $,
206
209
  color: O,
207
- active: I,
210
+ active: U,
208
211
  onClick: h
209
212
  }) {
210
- return /* @__PURE__ */ c(
213
+ return /* @__PURE__ */ d(
211
214
  "button",
212
215
  {
213
216
  type: "button",
214
217
  onClick: h,
215
218
  className: C(
216
219
  "flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
217
- I ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
220
+ U ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
218
221
  ),
219
222
  children: [
220
- /* @__PURE__ */ a(
223
+ /* @__PURE__ */ r(
221
224
  "span",
222
225
  {
223
226
  className: "h-2 w-2 shrink-0 rounded-full",
@@ -225,80 +228,80 @@ function ns({
225
228
  }
226
229
  ),
227
230
  l,
228
- /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ c(ke, { children: [
229
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ae($) }),
230
- /* @__PURE__ */ c("span", { className: "font-normal text-slate-400", children: [
231
+ /* @__PURE__ */ r("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ d(ke, { children: [
232
+ /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: re($) }),
233
+ /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
231
234
  " / ",
232
- ae(f)
235
+ re(f)
233
236
  ] })
234
- ] }) : ae(f) })
237
+ ] }) : re(f) })
235
238
  ]
236
239
  }
237
240
  );
238
241
  }
239
- function xt(l) {
242
+ function yt(l) {
240
243
  return l.split(".").map((f) => f.replace(/_/g, " ").replace(/\b\w/g, ($) => $.toUpperCase())).join(" → ");
241
244
  }
242
- function as({
245
+ function is({
243
246
  id: l,
244
247
  label: f,
245
248
  checked: $,
246
249
  onCheckedChange: O
247
250
  }) {
248
- const { attributes: I, listeners: h, setNodeRef: p, transform: v, transition: V, isDragging: me } = xl({
251
+ const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: me } = xl({
249
252
  id: l
250
- }), x = {
253
+ }), g = {
251
254
  transform: yl.Transform.toString(v),
252
- transition: V,
255
+ transition: W,
253
256
  opacity: me ? 0.4 : 1
254
- }, Y = `col-toggle-${l}`;
255
- return /* @__PURE__ */ c("div", { ref: p, style: x, className: "flex items-center gap-2 text-[12px]", children: [
256
- /* @__PURE__ */ a(
257
+ }, J = `col-toggle-${l}`;
258
+ return /* @__PURE__ */ d("div", { ref: p, style: g, className: "flex items-center gap-2 text-[12px]", children: [
259
+ /* @__PURE__ */ r(
257
260
  "span",
258
261
  {
259
- ...I,
262
+ ...U,
260
263
  ...h,
261
264
  className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
262
- children: /* @__PURE__ */ a(Ml, { className: "h-3.5 w-3.5" })
265
+ children: /* @__PURE__ */ r(Kl, { className: "h-3.5 w-3.5" })
263
266
  }
264
267
  ),
265
- /* @__PURE__ */ a(Tn, { id: Y, checked: $, onCheckedChange: O }),
266
- /* @__PURE__ */ a(jo, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: f })
268
+ /* @__PURE__ */ r(Rn, { id: J, checked: $, onCheckedChange: O }),
269
+ /* @__PURE__ */ r(Go, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
267
270
  ] });
268
271
  }
269
- function ui({
272
+ function yi({
270
273
  queueId: l,
271
274
  realtime: f,
272
275
  renderError: $,
273
276
  hideCreateActions: O = !1,
274
- onAsk: I
277
+ onAsk: U
275
278
  }) {
276
- var Ra, Ea, Oa, La, Da, Pa, Ka, Ma, Qa, ja, Ba, Ia, Ua;
277
- const h = kl(), p = tr(), { userId: v } = Ya(), V = Ql(), { navigate: me } = jl(), [x, Y] = y("all"), [He, L] = y(1), [yt, nr] = y(() => {
279
+ var Tr, Ar, Er, Or, Lr, Dr, Pr, Kr, Mr, Qr, Br, jr, Ur;
280
+ const h = kl(), p = ea(), { userId: v } = Hr(), W = Ml(), { navigate: me } = Ql(), [g, J] = k("all"), [ve, L] = k(1), Tn = B(Yl()), [kt, ta] = k(() => {
278
281
  try {
279
282
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
280
283
  } catch {
281
284
  return "compact";
282
285
  }
283
- }), [R, Fe] = y("table"), [G, Te] = y(""), [w, M] = y({}), [kt, An] = y(() => /* @__PURE__ */ new Set()), [N, Ye] = y(null), [be, Ut] = y(/* @__PURE__ */ new Set()), [Je, Vt] = y(null), [vt, Gt] = y(null), [Wt, wt] = y(0), ve = Xl(), Ht = lo(), Yt = B({}).current, Rn = B(/* @__PURE__ */ new Set()), [ar, rr] = y(0), [En, lr] = y(0), Ae = B(!1), _t = B([]), On = B(null), Ln = B(!1), Dn = B(0), Jt = B("table");
284
- Jt.current = R;
285
- const Pn = 25, { data: s, error: Nt } = H({
286
+ }), [A, Te] = k("table"), [I, Ae] = k(""), [w, M] = k({}), [vt, An] = k(() => /* @__PURE__ */ new Set()), [N, Ye] = k(null), [be, It] = k(/* @__PURE__ */ new Set()), [ze, Vt] = k(null), [wt, Gt] = k(null), [Wt, _t] = k(0), we = eo(), Ht = co(), Jt = B({}).current, En = B(/* @__PURE__ */ new Set()), [na, ra] = k(0), [On, aa] = k(0), Ee = B(!1), Nt = B([]), Ln = B(null), Dn = B(!1), Pn = B(0), Yt = B("table");
287
+ Yt.current = A;
288
+ const zt = 25, { data: s, error: St } = H({
286
289
  queryKey: ["queue-meta", l],
287
290
  queryFn: () => p.request(E(`/queues/${l}`)).then((e) => e.data),
288
291
  enabled: !!l
289
- }), { scopes: ze, ready: Kn } = io(), Mn = B(!1), [Qn, jn] = y(!1), [Re, or] = y({}), pe = B({});
292
+ }), { scopes: Xe, ready: Kn } = bo(), Mn = B(!1), [Qn, Bn] = k(!1), [Oe, la] = k({}), pe = B({});
290
293
  j(() => {
291
294
  if (Mn.current || !Kn || !s) return;
292
295
  Mn.current = !0;
293
296
  const e = (s.extra_field_meta ?? []).filter(
294
297
  (t) => t.kind === "relation" && t.target_collection && t.display_field
295
298
  );
296
- if (e.length === 0 || !ze) {
297
- jn(!0);
299
+ if (e.length === 0 || !Xe) {
300
+ Bn(!0);
298
301
  return;
299
302
  }
300
303
  (async () => {
301
- const t = {}, n = {}, r = async (o, i) => {
304
+ const t = {}, n = {}, a = async (o, i) => {
302
305
  const b = await p.request(
303
306
  E(`/items/${o.target_collection}`, {
304
307
  filter: JSON.stringify({ id: { _in: i } }),
@@ -313,44 +316,44 @@ function ui({
313
316
  ];
314
317
  };
315
318
  for (const o of e) {
316
- const i = co(ze, { collection: o.target_collection });
319
+ const i = po(Xe, { collection: o.target_collection });
317
320
  if (!i) continue;
318
321
  const b = `extra.${o.path}`;
319
322
  try {
320
- const m = ze.restricted[i.name] ?? [];
323
+ const m = Xe.restricted[i.name] ?? [];
321
324
  if (m.length > 0) {
322
- const T = await r(o, m);
323
- T.length > 0 && (n[b.slice(6)] = T);
325
+ const R = await a(o, m);
326
+ R.length > 0 && (n[b.slice(6)] = R);
324
327
  }
325
- const K = uo(ze, i.name);
328
+ const K = ho(Xe, i.name);
326
329
  if (K.length === 0) continue;
327
330
  const F = w[b];
328
331
  if (F && (Array.isArray(F) ? F.length > 0 : F !== ""))
329
332
  continue;
330
- const k = K.length ? await r(o, K) : [];
331
- k.length > 0 && (t[b] = k);
333
+ const y = K.length ? await a(o, K) : [];
334
+ y.length > 0 && (t[b] = y);
332
335
  } catch {
333
336
  }
334
337
  }
335
- Object.keys(n).length > 0 && or(n), Object.keys(t).length > 0 && (pe.current = t, M((o) => ({ ...o, ...t }))), jn(!0);
338
+ Object.keys(n).length > 0 && la(n), Object.keys(t).length > 0 && (pe.current = t, M((o) => ({ ...o, ...t }))), Bn(!0);
336
339
  })();
337
- }, [Kn, ze, s]);
338
- const Ee = ((Ea = (Ra = s == null ? void 0 : s.sources) == null ? void 0 : Ra.find((e) => e.type === "collection")) == null ? void 0 : Ea.collection) ?? null, { data: Bn = [] } = H({
339
- queryKey: ["queue-browser-quick-filters", Ee],
340
- queryFn: () => p.request(E(`/collections/${Ee}`)).then((e) => {
340
+ }, [Kn, Xe, s]);
341
+ const Le = ((Ar = (Tr = s == null ? void 0 : s.sources) == null ? void 0 : Tr.find((e) => e.type === "collection")) == null ? void 0 : Ar.collection) ?? null, { data: jn = [] } = H({
342
+ queryKey: ["queue-browser-quick-filters", Le],
343
+ queryFn: () => p.request(E(`/collections/${Le}`)).then((e) => {
341
344
  var t, n;
342
345
  return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
343
346
  }).catch(() => []),
344
- enabled: !!Ee,
347
+ enabled: !!Le,
345
348
  staleTime: 3e5
346
- }), z = W(() => {
349
+ }), z = G(() => {
347
350
  const e = /* @__PURE__ */ new Set(), t = [];
348
351
  for (const n of (s == null ? void 0 : s.sources) ?? [])
349
352
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
350
353
  return t;
351
- }, [s == null ? void 0 : s.sources]), St = mo(
354
+ }, [s == null ? void 0 : s.sources]), Ct = fo(
352
355
  z.length === 1 ? z[0] : null
353
- ), zt = O === !0 || Array.isArray(O) && z.length > 0 && z.every((e) => O.includes(e)), oe = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, we = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], sr = (u == null ? void 0 : u.work_next) !== !1, Xt = (u == null ? void 0 : u.bulk_actions) !== !1, Zt = yo(
356
+ ), Xt = O === !0 || Array.isArray(O) && z.length > 0 && z.every((e) => O.includes(e)), oe = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, _e = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], oa = (u == null ? void 0 : u.work_next) !== !1, Zt = (u == null ? void 0 : u.bulk_actions) !== !1, en = _o(
354
357
  [
355
358
  ...new Set(
356
359
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -358,105 +361,105 @@ function ui({
358
361
  ],
359
362
  (u == null ? void 0 : u.bulk_action_keys) ?? null
360
363
  ), q = (e, t) => {
361
- var n, r;
362
- return ((r = (n = s == null ? void 0 : s.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
363
- }, In = B(!1);
364
+ var n, a;
365
+ return ((a = (n = s == null ? void 0 : s.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : a.trim()) || t;
366
+ }, Un = B(!1);
364
367
  j(() => {
365
- !s || In.current || (In.current = !0, Te("-priority"));
368
+ !s || Un.current || (Un.current = !0, Ae("-priority"));
366
369
  }, [s]);
367
- const [re, ir] = y(!1);
370
+ const [ae, sa] = k(!1);
368
371
  j(() => {
369
- s != null && s.display_config && !we.includes(R) && Fe(we[0]);
370
- }, [s, R, we]), j(() => {
372
+ s != null && s.display_config && !_e.includes(A) && Te(_e[0]);
373
+ }, [s, A, _e]), j(() => {
371
374
  if (!(s != null && s.sources)) return;
372
- const e = Ht ? (k, T) => Ht.subscribeCollections(k, T) : f == null ? void 0 : f.subscribe;
375
+ const e = Ht ? (y, R) => Ht.subscribeCollections(y, R) : f == null ? void 0 : f.subscribe;
373
376
  if (!e) return;
374
377
  const t = [
375
378
  ...new Set(
376
- s.sources.filter((k) => k.type === "collection" && k.collection).map((k) => k.collection)
379
+ s.sources.filter((y) => y.type === "collection" && y.collection).map((y) => y.collection)
377
380
  )
378
381
  ];
379
382
  if (t.length === 0) return;
380
383
  const n = /* @__PURE__ */ new Set();
381
- let r = null, o = null, i = null;
384
+ let a = null, o = null, i = null;
382
385
  const b = () => {
383
386
  i || (i = setTimeout(() => {
384
- i = null, lr((k) => k + 1);
387
+ i = null, aa((y) => y + 1);
385
388
  }, 1500));
386
389
  }, m = () => {
387
390
  o || (o = setTimeout(() => {
388
- if (o = null, Dn.current > 0 || Ln.current) {
389
- _t.current = [], wt((k) => k + 1);
391
+ if (o = null, Pn.current > 0 || Dn.current) {
392
+ Nt.current = [], _t((y) => y + 1);
390
393
  return;
391
394
  }
392
- Ae.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
395
+ Ee.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
393
396
  }, 900));
394
- }, K = (k) => {
395
- let T = !1, Q = 0, xe = !1;
396
- const qe = k.flatMap(
397
- (_) => _ ? zl(_) : [_]
397
+ }, K = (y) => {
398
+ let R = !1, Q = 0, xe = !1;
399
+ const Re = y.flatMap(
400
+ (_) => _ ? Zl(_) : [_]
398
401
  );
399
- for (const _ of qe) {
400
- const ue = _ == null ? void 0 : _.changed_fields, jt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, Va = jt != null && Rn.current.has(jt);
401
- if (_ && !_.action && (ue != null && ue.length) && ue.every((pt) => pt.startsWith("$"))) {
402
- ue.includes(ht.tasks) && n.add("queue-task-counts"), ue.includes(ht.integrations) && n.add("queue-integrations-summary"), ue.includes(ht.addendums) && n.add("queue-collection-addendums"), ue.includes(ht.lock) && rr((pt) => pt + 1), ue.includes(ht.state) && (xe = !0, (Va || Jt.current === "kanban") && (T = !0)), r || (r = setTimeout(() => {
403
- r = null;
404
- for (const pt of n) h.invalidateQueries({ queryKey: [pt] });
402
+ for (const _ of Re) {
403
+ const ue = _ == null ? void 0 : _.changed_fields, Bt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, Ir = Bt != null && En.current.has(Bt);
404
+ if (_ && !_.action && (ue != null && ue.length) && ue.every((ht) => ht.startsWith("$"))) {
405
+ ue.includes(ft.tasks) && n.add("queue-task-counts"), ue.includes(ft.integrations) && n.add("queue-integrations-summary"), ue.includes(ft.addendums) && n.add("queue-collection-addendums"), ue.includes(ft.lock) && ra((ht) => ht + 1), ue.includes(ft.state) && (xe = !0, (Ir || Yt.current === "kanban") && (R = !0)), a || (a = setTimeout(() => {
406
+ a = null;
407
+ for (const ht of n) h.invalidateQueries({ queryKey: [ht] });
405
408
  n.clear();
406
409
  }, 300));
407
410
  continue;
408
411
  }
409
412
  xe = !0;
410
- const cl = (_ == null ? void 0 : _.collection) != null && ao(_.collection, _.item);
411
- jt && (Va || (_ == null ? void 0 : _.action) === "create" || Jt.current === "kanban") ? (T = !0, cl || _t.current.push({ key: jt, by: null })) : Q += 1;
413
+ const cl = (_ == null ? void 0 : _.collection) != null && lo(_.collection, _.item);
414
+ Bt && (Ir || (_ == null ? void 0 : _.action) === "create" || Yt.current === "kanban") ? (R = !0, cl || Nt.current.push({ key: Bt, by: null })) : Q += 1;
412
415
  }
413
- Q > 0 && wt((_) => _ + Q), T && m(), xe && b();
414
- }, F = e(t, (k) => Hl(Yt, [k ?? {}], K));
416
+ Q > 0 && _t((_) => _ + Q), R && m(), xe && b();
417
+ }, F = e(t, (y) => Wl(Jt, [y ?? {}], K));
415
418
  return () => {
416
- F(), Yl(Yt), r && clearTimeout(r), o && clearTimeout(o), i && clearTimeout(i);
419
+ F(), Hl(Jt), a && clearTimeout(a), o && clearTimeout(o), i && clearTimeout(i);
417
420
  };
418
- }, [Ht, f, s == null ? void 0 : s.sources, h, l, v, Yt]);
419
- const Oe = Il(w, 350), cr = JSON.stringify(Oe) === JSON.stringify(w), en = B(!1), Xe = R === "table" && !!N, Un = (() => {
421
+ }, [Ht, f, s == null ? void 0 : s.sources, h, l, v, Jt]);
422
+ const De = jl(w, 350), ia = JSON.stringify(De) === JSON.stringify(w), tn = B(!1), Ne = A === "table" && !!N, In = (() => {
420
423
  const e = /* @__PURE__ */ new Set();
421
424
  for (const t of (s == null ? void 0 : s.extra_field_meta) ?? [])
422
425
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
423
426
  for (const t of (s == null ? void 0 : s.sources) ?? []) {
424
- for (const [n, r] of Object.entries(t.column_formats ?? {}))
425
- (r == null ? void 0 : r.type) === "number" && e.add(n);
427
+ for (const [n, a] of Object.entries(t.column_formats ?? {}))
428
+ (a == null ? void 0 : a.type) === "number" && e.add(n);
426
429
  t.type === "addendums" && e.add("cost_impact");
427
430
  }
428
431
  return [...e].slice(0, 12);
429
- })(), Ct = (() => {
432
+ })(), Ze = (() => {
430
433
  const e = {};
431
- for (const [t, n] of Object.entries(Oe))
434
+ for (const [t, n] of Object.entries(De))
432
435
  if (n) {
433
436
  if (Array.isArray(n)) {
434
437
  n.length > 0 && (e[t] = n);
435
438
  continue;
436
439
  }
437
440
  if (t === "aging_hours") {
438
- const [r, o] = n.split(":"), i = {};
439
- r && (i.min = Number(r)), o && (i.max = Number(o)), (i.min !== void 0 || i.max !== void 0) && (e[t] = i);
441
+ const [a, o] = n.split(":"), i = {};
442
+ a && (i.min = Number(a)), o && (i.max = Number(o)), (i.min !== void 0 || i.max !== void 0) && (e[t] = i);
440
443
  continue;
441
444
  }
442
445
  e[t] = n;
443
446
  }
444
447
  return e;
445
448
  })();
446
- function Le(e, t) {
449
+ function Pe(e, t) {
447
450
  M((n) => ({ ...n, [e]: n[e] === t ? "" : t })), L(1);
448
451
  }
449
- function dr(e) {
452
+ function ca(e) {
450
453
  M((t) => {
451
- const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((i) => i !== e) : [...r, e];
454
+ const n = t.state, a = Array.isArray(n) ? n : n ? [n] : [], o = a.includes(e) ? a.filter((i) => i !== e) : [...a, e];
452
455
  return { ...t, state: o };
453
456
  }), L(1);
454
457
  }
455
- const ur = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], mr = (e) => !e || Array.isArray(e) && e.length === 0;
456
- function br() {
457
- M({ ...pe.current }), Y("all"), L(1);
458
+ const da = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], ua = (e) => !e || Array.isArray(e) && e.length === 0;
459
+ function ma() {
460
+ M({ ...pe.current }), J("all"), L(1);
458
461
  }
459
- const [Ze, pr] = y(() => {
462
+ const [et, ba] = k(() => {
460
463
  try {
461
464
  return localStorage.getItem("nvr_queue_insights_open") === "1";
462
465
  } catch {
@@ -465,36 +468,36 @@ function ui({
465
468
  });
466
469
  j(() => {
467
470
  try {
468
- localStorage.setItem("nvr_queue_insights_open", Ze ? "1" : "0");
471
+ localStorage.setItem("nvr_queue_insights_open", et ? "1" : "0");
469
472
  } catch {
470
473
  }
471
- }, [Ze]);
472
- const { data: hr = [] } = H({
474
+ }, [et]);
475
+ const { data: pa = [] } = H({
473
476
  queryKey: ["queue-view-subs", l],
474
477
  queryFn: () => p.request(E("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
475
478
  staleTime: 3e4
476
- }), $t = (e) => hr.find((t) => t.queue_view_id === e), fr = (e) => {
479
+ }), $t = (e) => pa.find((t) => t.queue_view_id === e), ha = (e) => {
477
480
  const t = $t(e);
478
481
  (t ? p.request($n(`/notification-subscriptions/${t.id}`)) : p.request(
479
- Z("/notification-subscriptions", {
482
+ ne("/notification-subscriptions", {
480
483
  queue_id: l,
481
484
  queue_view_id: e,
482
485
  digest_frequency: "instant"
483
486
  })
484
487
  )).then(() => {
485
- A.success(
488
+ T.success(
486
489
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
487
490
  ), h.invalidateQueries({ queryKey: ["queue-view-subs", l] });
488
- }).catch((r) => A.error(r instanceof Error ? r.message : "Failed"));
489
- }, [Vn, tn] = y(null), nn = [
491
+ }).catch((a) => T.error(a instanceof Error ? a.message : "Failed"));
492
+ }, [Vn, nn] = k(null), rn = [
490
493
  ...new Set(
491
494
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
492
495
  )
493
- ], { data: gr = {} } = H({
494
- queryKey: ["queue-custom-actions", l, nn.join(",")],
496
+ ], { data: fa = {} } = H({
497
+ queryKey: ["queue-custom-actions", l, rn.join(",")],
495
498
  queryFn: async () => {
496
499
  const e = {};
497
- for (const t of nn.slice(0, 6))
500
+ for (const t of rn.slice(0, 6))
498
501
  try {
499
502
  const n = await p.request(
500
503
  E("/custom-actions", { collection: t })
@@ -505,54 +508,57 @@ function ui({
505
508
  }
506
509
  return e;
507
510
  },
508
- enabled: nn.length > 0,
511
+ enabled: rn.length > 0,
509
512
  staleTime: 6e4
510
- }), xr = (e) => gr[e] ?? [], yr = (e, t) => {
511
- p.request(Z(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
512
- A.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
513
+ }), ga = (e) => fa[e] ?? [], xa = (e, t) => {
514
+ p.request(ne(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
515
+ T.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
513
516
  }).catch((n) => {
514
- const r = n.response;
515
- A.error((r == null ? void 0 : r.error) ?? (n instanceof Error ? n.message : `${e.label} failed`));
517
+ const a = n.response;
518
+ T.error((a == null ? void 0 : a.error) ?? (n instanceof Error ? n.message : `${e.label} failed`));
516
519
  });
517
- }, [Gn, kr] = y({}), { data: an = [] } = H({
520
+ }, { data: an = [] } = H({
518
521
  queryKey: ["queue-triage-labels", l],
519
522
  queryFn: () => p.request(E(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
520
523
  staleTime: 3e4
521
- }), Wn = (e, t) => {
524
+ }), Gn = (e, t) => {
522
525
  p.request(
523
- Z(`/queues/${l}/triage-labels/toggle`, {
526
+ ne(`/queues/${l}/triage-labels/toggle`, {
524
527
  collection: e.collection,
525
528
  item_id: e.item_id,
526
529
  label: t
527
530
  })
528
531
  ).then(() => {
529
532
  h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
530
- }).catch((n) => A.error(n instanceof Error ? n.message : "Label failed"));
531
- }, { data: d, isLoading: Hn, isFetching: rn, isPlaceholderData: vr, dataUpdatedAt: le } = H({
533
+ }).catch((n) => T.error(n instanceof Error ? n.message : "Label failed"));
534
+ }, { data: c, isLoading: Wn, isFetching: ln, isPlaceholderData: ya, dataUpdatedAt: le } = H({
532
535
  queryKey: [
533
536
  "queue-items",
534
537
  l,
535
- x,
536
- G,
537
- Oe,
538
- R === "table" && !N ? He : "all",
538
+ g,
539
+ I,
540
+ De,
541
+ A === "table" && !N ? ve : "all",
539
542
  N
540
543
  ],
541
- queryFn: () => p.request(
542
- E(`/queues/${l}/items`, {
543
- scope: x,
544
- // Last State Change is Aging read the other way round: the newest
545
- // move is the least aged.
546
- sort: G === "state_entered" ? "-aging_hours" : G === "-state_entered" ? "aging_hours" : G,
547
- filters: JSON.stringify(Ct),
548
- // Table + group: headers only (rows load per group on expand, #741).
549
- // Kanban renders the full matching set, grouped client-side.
550
- ...Xe ? {
551
- group_by: N,
552
- ...Un.length ? { group_sums: Un.join(",") } : {}
553
- } : R === "table" ? { page: He, limit: Pn } : {}
554
- })
555
- ),
544
+ queryFn: async () => {
545
+ const e = !Ne && A === "table", t = JSON.stringify([l, g, I, Ze, zt]), n = e ? zl(Tn.current, t, ve, "").after : void 0, a = await p.request(
546
+ E(`/queues/${l}/items`, {
547
+ scope: g,
548
+ // Last State Change is Aging read the other way round: the newest
549
+ // move is the least aged.
550
+ sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
551
+ filters: JSON.stringify(Ze),
552
+ // Table + group: headers only (rows load per group on expand, #741).
553
+ // Kanban renders the full matching set, grouped client-side.
554
+ ...Ne ? {
555
+ group_by: N,
556
+ ...In.length ? { group_sums: In.join(",") } : {}
557
+ } : A === "table" ? { page: ve, limit: zt, ...n ? { after: n } : {} } : {}
558
+ })
559
+ );
560
+ return n && Xl(Tn.current, t, ve, a.next_cursor), a;
561
+ },
556
562
  // Wait for display_config AND scope seeding so the first fetch uses the
557
563
  // configured defaults and already carries the viewer's restricted filters.
558
564
  // #477: the key reads the DEBOUNCED filters (350ms) while seeding writes
@@ -560,187 +566,171 @@ function ui({
560
566
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
561
567
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
562
568
  // waits for the debounced copy to settle; later typing still debounces.
563
- enabled: !!l && re && Qn && (en.current || cr),
569
+ enabled: !!l && ae && Qn && (tn.current || ia),
564
570
  // Keep the previous page rendered while a sort/filter/page change refetches —
565
571
  // swapping to skeletons collapsed the table height and jittered the page.
566
572
  placeholderData: (e) => e
567
573
  });
568
- d && !en.current && (en.current = !0), j(() => {
574
+ c && !tn.current && (tn.current = !0), j(() => {
569
575
  if (typeof window > "u" || !le) return;
570
576
  const e = window;
571
577
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
572
578
  const t = e.__nvrQueueTrace, n = {
573
579
  queue: l,
574
580
  at: le,
575
- scope: x,
576
- sort: G,
577
- filters: JSON.stringify(Oe),
578
- page: He
579
- }, r = t.find((o) => o.queue === l);
580
- t.push(n), t.length > 50 && t.shift(), r && r !== n && le - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
581
+ scope: g,
582
+ sort: I,
583
+ filters: JSON.stringify(De),
584
+ page: ve
585
+ }, a = t.find((o) => o.queue === l);
586
+ t.push(n), t.length > 50 && t.shift(), a && a !== n && le - Number(a.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: a, second: n });
581
587
  }, [le]);
582
- const De = Hn && !d || !re || !Qn && !d, Yn = (rn && !Hn || vr && rn) && !Ae.current, ln = (Xe ? [] : (d == null ? void 0 : d.data) ?? []).slice(0, 100).map((e) => `${e.collection}:${e.item_id}`).join(",");
583
- j(() => {
584
- if (!ln) return;
585
- let e = !0;
586
- const t = ln.split(",").map((o) => {
587
- const i = o.indexOf(":");
588
- return { collection: o.slice(0, i), item_id: o.slice(i + 1) };
589
- }), n = () => {
590
- p.request(Z("/presence/record-viewers", { pairs: t })).then((o) => {
591
- e && kr(o.data ?? {});
592
- }).catch(() => {
593
- });
594
- };
595
- n();
596
- const r = setInterval(n, 3e4);
597
- return () => {
598
- e = !1, clearInterval(r);
599
- };
600
- }, [ln, p]);
601
- const Jn = Ul(rn && !Ae.current);
602
- async function zn(e, t) {
603
- const r = (await p.request(E(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
604
- if (!r || r.states.length === 0)
588
+ const Ke = Wn && !c || !ae || !Qn && !c, Hn = (ln && !Wn || ya && ln) && !Ee.current, ka = G(
589
+ () => (Ne ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
590
+ [Ne, c == null ? void 0 : c.data]
591
+ ), va = oo(ka), Jn = Ul(ln && !Ee.current);
592
+ async function Yn(e, t) {
593
+ const a = (await p.request(E(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
594
+ if (!a || a.states.length === 0)
605
595
  throw new Error("This item has no workflow instance");
606
- const o = r.states.find((b) => b.key === t);
596
+ const o = a.states.find((b) => b.key === t);
607
597
  if (!o) throw new Error("Target state not found");
608
- const i = r.available_transitions.find(
598
+ const i = a.available_transitions.find(
609
599
  (b) => b.to_state === o.id
610
600
  );
611
601
  if (!i) throw new Error("No transition available to move this item here");
612
602
  await p.request(
613
- Z(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
603
+ ne(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
614
604
  transition_id: i.id
615
605
  })
616
606
  );
617
607
  }
618
- const wr = ye({
608
+ const wa = ye({
619
609
  mutationFn: async ({ item: e, targetState: t }) => {
620
- await zn(e, t);
610
+ await Yn(e, t);
621
611
  },
622
612
  onSuccess: () => {
623
- h.invalidateQueries({ queryKey: ["queue-items", l, x] });
613
+ h.invalidateQueries({ queryKey: ["queue-items", l, g] });
624
614
  },
625
615
  onError: (e) => {
626
- A.error(e instanceof Error ? e.message : "Failed to move item"), h.invalidateQueries({ queryKey: ["queue-items", l, x] });
616
+ T.error(e instanceof Error ? e.message : "Failed to move item"), h.invalidateQueries({ queryKey: ["queue-items", l, g] });
627
617
  }
628
- }), _e = ye({
618
+ }), Se = ye({
629
619
  mutationFn: (e) => p.request(
630
- Z(`/queues/${l}/claim`, {
620
+ ne(`/queues/${l}/claim`, {
631
621
  source_collection: e.collection,
632
622
  item_id: e.item_id
633
623
  })
634
624
  ),
635
- onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, x] }),
636
- onError: () => A.error("Failed to claim item")
637
- }), Pe = ye({
625
+ onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
626
+ onError: () => T.error("Failed to claim item")
627
+ }), Me = ye({
638
628
  mutationFn: (e) => p.request(
639
- Z(`/queues/${l}/release`, {
629
+ ne(`/queues/${l}/release`, {
640
630
  source_collection: e.collection,
641
631
  item_id: e.item_id
642
632
  })
643
633
  ),
644
- onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, x] }),
645
- onError: () => A.error("Failed to release item")
646
- }), { data: Ke } = H({
634
+ onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
635
+ onError: () => T.error("Failed to release item")
636
+ }), { data: Qe } = H({
647
637
  queryKey: ["queue-column-prefs", l],
648
638
  queryFn: () => p.request(E(`/queues/${l}/column-prefs`)),
649
639
  enabled: !!l
650
- }), [on, qt] = y(null), [Me, sn] = y(null);
640
+ }), [on, qt] = k(null), [Be, sn] = k(null);
651
641
  j(() => {
652
- Ke && sn(Ke.data.default_view_id);
653
- }, [Ke]);
654
- const [_r, Xn] = y({}), se = Xe ? (d == null ? void 0 : d.groups) ?? null : null, Ft = (se ?? []).filter((e) => !be.has(e.key)).map((e) => e.key).flatMap(
655
- (e) => Array.from({ length: _r[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
656
- ), cn = Ie({
642
+ Qe && sn(Qe.data.default_view_id);
643
+ }, [Qe]);
644
+ const [_a, zn] = k({}), se = Ne ? (c == null ? void 0 : c.groups) ?? null : null, Ft = (se ?? []).filter((e) => !be.has(e.key)).map((e) => e.key).flatMap(
645
+ (e) => Array.from({ length: _a[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
646
+ ), cn = Ve({
657
647
  queries: Ft.map(({ key: e, page: t }) => ({
658
648
  queryKey: [
659
649
  "queue-items",
660
650
  l,
661
651
  "group-rows",
662
- x,
663
- G,
664
- Oe,
652
+ g,
653
+ I,
654
+ De,
665
655
  N,
666
656
  e,
667
657
  t
668
658
  ],
669
659
  queryFn: () => p.request(
670
660
  E(`/queues/${l}/items`, {
671
- scope: x,
672
- sort: G === "state_entered" ? "-aging_hours" : G === "-state_entered" ? "aging_hours" : G,
673
- filters: JSON.stringify(Ct),
661
+ scope: g,
662
+ sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
663
+ filters: JSON.stringify(Ze),
674
664
  group_by: N,
675
665
  group_key: e,
676
666
  page: t,
677
- limit: Jo
667
+ limit: ts
678
668
  })
679
669
  ).then((n) => ({ key: e, rows: n.data })),
680
- enabled: !!d && Xe,
670
+ enabled: !!c && Ne,
681
671
  placeholderData: (n) => n
682
672
  }))
683
- }), Nr = cn.map((e) => e.dataUpdatedAt).join(","), dn = W(() => {
673
+ }), Na = cn.map((e) => e.dataUpdatedAt).join(","), dn = G(() => {
684
674
  const e = /* @__PURE__ */ new Map();
685
675
  return cn.forEach((t, n) => {
686
676
  if (!t.data) return;
687
- const r = Ft[n].key;
688
- e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
677
+ const a = Ft[n].key;
678
+ e.set(a, [...e.get(a) ?? [], ...t.data.rows]);
689
679
  }), e;
690
- }, [Nr, Ft.map((e) => `${e.key}\0${e.page}`).join("")]), Sr = new Set(
680
+ }, [Na, Ft.map((e) => `${e.key}\0${e.page}`).join("")]), Sa = new Set(
691
681
  cn.flatMap((e, t) => e.isFetching ? [Ft[t].key] : [])
692
- ), S = se ? [...dn.values()].flat() : (d == null ? void 0 : d.data) ?? [];
693
- go(
682
+ ), S = se ? [...dn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
683
+ vo(
694
684
  l ? {
695
685
  queue: {
696
686
  id: l,
697
687
  label: s == null ? void 0 : s.name,
698
- scope: x,
699
- filters: JSON.stringify(Ct),
688
+ scope: g,
689
+ filters: JSON.stringify(Ze),
700
690
  items: S.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
701
691
  }
702
692
  } : null
703
693
  );
704
- const Cr = xo(), et = S.some((e) => e.fulfilment !== void 0), tt = S.some((e) => e.send_backs !== void 0), { data: Tt, dataUpdatedAt: $r } = H({
705
- queryKey: ["queue-live-stats", l, x, Oe, En],
694
+ const Ca = wo(), tt = S.some((e) => e.fulfilment !== void 0), nt = S.some((e) => e.send_backs !== void 0), { data: Rt, dataUpdatedAt: $a } = H({
695
+ queryKey: ["queue-live-stats", l, g, De, On],
706
696
  queryFn: () => p.request(
707
697
  E(`/queues/${l}/items`, {
708
- scope: x,
709
- filters: JSON.stringify(Ct),
698
+ scope: g,
699
+ filters: JSON.stringify(Ze),
710
700
  page: 1,
711
701
  limit: 1
712
702
  })
713
703
  ),
714
- enabled: En > 0 && !!d,
704
+ enabled: On > 0 && !!c,
715
705
  staleTime: Number.POSITIVE_INFINITY,
716
706
  placeholderData: (e) => e,
717
707
  retry: !1
718
- }), un = !!Tt && $r > le, g = un ? Tt.stats : d == null ? void 0 : d.stats, J = un ? Tt.filtered_stats ?? null : (d == null ? void 0 : d.filtered_stats) ?? null, Zn = un ? Tt.state_counts : d == null ? void 0 : d.state_counts;
719
- Rn.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
720
- const At = Zl(
708
+ }), un = !!Rt && $a > le, x = un ? Rt.stats : c == null ? void 0 : c.stats, Y = un ? Rt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, Xn = un ? Rt.state_counts : c == null ? void 0 : c.state_counts;
709
+ En.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
710
+ const Tt = to(
721
711
  S.map((e) => ({ collection: e.collection, id: e.item_id })),
722
- ar
723
- ), ea = B(le), ta = B(0);
724
- !Ae.current && le !== ta.current && (ea.current = le), j(() => {
712
+ na
713
+ ), Zn = B(le), er = B(0);
714
+ !Ee.current && le !== er.current && (Zn.current = le), j(() => {
725
715
  const e = new Set(S.map((t) => `${t.collection}:${t.item_id}`));
726
- if (Ae.current) {
727
- Ae.current = !1, ta.current = le;
728
- const t = _t.current;
729
- _t.current = [];
730
- const n = On.current, r = /* @__PURE__ */ new Set();
716
+ if (Ee.current) {
717
+ Ee.current = !1, er.current = le;
718
+ const t = Nt.current;
719
+ Nt.current = [];
720
+ const n = Ln.current, a = /* @__PURE__ */ new Set();
731
721
  for (const o of t)
732
- !e.has(o.key) || r.has(o.key) || (r.add(o.key), ve.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
722
+ !e.has(o.key) || a.has(o.key) || (a.add(o.key), we.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
733
723
  if (n) {
734
- const o = [...e].filter((i) => !n.has(i) && !r.has(i));
735
- o.length > 0 && o.length <= 20 && ve.note(o, null, "create");
724
+ const o = [...e].filter((i) => !n.has(i) && !a.has(i));
725
+ o.length > 0 && o.length <= 20 && we.note(o, null, "create");
736
726
  }
737
727
  }
738
- On.current = e;
728
+ Ln.current = e;
739
729
  }, [le]), j(() => {
740
- wt(0);
741
- }, [d]);
742
- function qr() {
743
- h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), wt(0);
730
+ _t(0);
731
+ }, [c]);
732
+ function qa() {
733
+ h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), _t(0);
744
734
  }
745
735
  const { data: ie } = H({
746
736
  queryKey: ["queue-trends", l],
@@ -750,34 +740,34 @@ function ui({
750
740
  }), { data: ce } = H({
751
741
  queryKey: ["queue-trends", l, "mine"],
752
742
  queryFn: () => p.request(E(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
753
- enabled: !!l && x === "mine",
743
+ enabled: !!l && g === "mine",
754
744
  staleTime: 300 * 1e3
755
745
  });
756
- function nt(e) {
757
- const n = (x === "all" ? ie == null ? void 0 : ie.data : x === "mine" ? ce == null ? void 0 : ce.data : void 0) ?? [];
746
+ function rt(e) {
747
+ const n = (g === "all" ? ie == null ? void 0 : ie.data : g === "mine" ? ce == null ? void 0 : ce.data : void 0) ?? [];
758
748
  if (n.length === 0) return {};
759
- const r = n.map((i) => i[e]), o = n[n.length - 1];
760
- return { trend: r, delta: ((g == null ? void 0 : g[e]) ?? 0) - o[e] };
749
+ const a = n.map((i) => i[e]), o = n[n.length - 1];
750
+ return { trend: a, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
761
751
  }
762
- const de = W(() => {
763
- const t = (x === "all" ? ie == null ? void 0 : ie.data : x === "mine" ? ce == null ? void 0 : ce.data : void 0) ?? [];
764
- if (t.length < 3 || !g) return null;
752
+ const de = G(() => {
753
+ const t = (g === "all" ? ie == null ? void 0 : ie.data : g === "mine" ? ce == null ? void 0 : ce.data : void 0) ?? [];
754
+ if (t.length < 3 || !x) return null;
765
755
  const n = t.map(
766
- (b) => x === "mine" ? b.owned ?? b.total : b.total
767
- ), r = n.slice(1).map((b, m) => b - n[m]), o = r.reduce((b, m) => b + m, 0) / r.length, i = g.total;
756
+ (b) => g === "mine" ? b.owned ?? b.total : b.total
757
+ ), a = n.slice(1).map((b, m) => b - n[m]), o = a.reduce((b, m) => b + m, 0) / a.length, i = x.total;
768
758
  return Math.abs(o) < 0.05 ? { dir: "flat", pace: o, days: null } : o < 0 ? { dir: "down", pace: o, days: Math.max(1, Math.ceil(i / -o)) } : { dir: "up", pace: o, days: null };
769
- }, [ie == null ? void 0 : ie.data, ce == null ? void 0 : ce.data, x, g]), at = W(
759
+ }, [ie == null ? void 0 : ie.data, ce == null ? void 0 : ce.data, g, x]), at = G(
770
760
  () => [
771
761
  ...new Set(
772
762
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
773
763
  )
774
764
  ],
775
765
  [s == null ? void 0 : s.sources]
776
- ), { data: Fr } = H({
766
+ ), { data: Fa } = H({
777
767
  queryKey: ["collections"],
778
768
  queryFn: () => p.request(E("/collections")).then((e) => e.data),
779
769
  staleTime: 300 * 1e3
780
- }), Qe = Ie({
770
+ }), je = Ve({
781
771
  queries: at.map((e) => ({
782
772
  queryKey: ["queue-collection-addendums", e],
783
773
  queryFn: () => p.request(
@@ -792,59 +782,59 @@ function ui({
792
782
  queryKey: ["queue-integrations-collections"],
793
783
  queryFn: () => p.request(E("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
794
784
  staleTime: 300 * 1e3
795
- }), he = at.some((e) => mn.includes(e)), bn = W(() => {
785
+ }), he = at.some((e) => mn.includes(e)), bn = G(() => {
796
786
  var t;
797
787
  const e = {};
798
788
  if (!he) return e;
799
789
  for (const n of S) {
800
790
  if (!mn.includes(n.collection)) continue;
801
- const r = e[t = n.collection] ?? (e[t] = []);
802
- r.length < 500 && r.push(n.item_id);
791
+ const a = e[t = n.collection] ?? (e[t] = []);
792
+ a.length < 500 && a.push(n.item_id);
803
793
  }
804
794
  return e;
805
- }, [S, mn, he]), na = Object.keys(bn), aa = Ie({
806
- queries: na.map((e) => ({
795
+ }, [S, mn, he]), tr = Object.keys(bn), nr = Ve({
796
+ queries: tr.map((e) => ({
807
797
  queryKey: ["queue-integrations-summary", e, bn[e].join(",")],
808
798
  queryFn: () => p.request(
809
- Z("/integration-obligations/summary", {
799
+ ne("/integration-obligations/summary", {
810
800
  collection: e,
811
801
  ids: bn[e]
812
802
  })
813
803
  ).then((t) => t.data ?? {}).catch(() => ({})),
814
804
  staleTime: 3e4
815
805
  }))
816
- }), Tr = aa.map((e) => e.dataUpdatedAt).join(","), Ar = W(() => {
806
+ }), Ra = nr.map((e) => e.dataUpdatedAt).join(","), Ta = G(() => {
817
807
  const e = {};
818
- return na.forEach((t, n) => {
808
+ return tr.forEach((t, n) => {
819
809
  var o;
820
- const r = ((o = aa[n]) == null ? void 0 : o.data) ?? {};
821
- for (const [i, b] of Object.entries(r)) e[`${t}:${i}`] = b;
810
+ const a = ((o = nr[n]) == null ? void 0 : o.data) ?? {};
811
+ for (const [i, b] of Object.entries(a)) e[`${t}:${i}`] = b;
822
812
  }), e;
823
- }, [Tr]), pn = W(() => {
813
+ }, [Ra]), pn = G(() => {
824
814
  var t;
825
815
  const e = {};
826
816
  for (const n of S) {
827
817
  if (!n.collection || n.collection === "tasks" || n.collection.startsWith("nivaro_"))
828
818
  continue;
829
- const r = e[t = n.collection] ?? (e[t] = []);
830
- r.length < 500 && r.push(n.item_id);
819
+ const a = e[t = n.collection] ?? (e[t] = []);
820
+ a.length < 500 && a.push(n.item_id);
831
821
  }
832
822
  return e;
833
- }, [S]), hn = Object.keys(pn), ra = Ie({
823
+ }, [S]), hn = Object.keys(pn), rr = Ve({
834
824
  queries: hn.map((e) => ({
835
825
  queryKey: ["queue-task-counts", e, pn[e].join(",")],
836
826
  queryFn: () => p.request(
837
- Z("/tasks/counts", { collection: e, ids: pn[e] })
827
+ ne("/tasks/counts", { collection: e, ids: pn[e] })
838
828
  ).then((t) => t.data ?? {}).catch(() => ({})),
839
829
  staleTime: 3e4
840
830
  }))
841
- }), Rr = ra.map((e) => e.dataUpdatedAt).join(","), Er = W(() => {
831
+ }), Aa = rr.map((e) => e.dataUpdatedAt).join(","), Ea = G(() => {
842
832
  const e = {};
843
833
  return hn.forEach((t, n) => {
844
- var r;
845
- for (const [o, i] of Object.entries(((r = ra[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = i;
834
+ var a;
835
+ for (const [o, i] of Object.entries(((a = rr[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = i;
846
836
  }), e;
847
- }, [Rr]), la = hn.length > 0, oa = Ie({
837
+ }, [Aa]), ar = hn.length > 0, lr = Ve({
848
838
  queries: at.map((e) => ({
849
839
  queryKey: ["queue-collection-risk-rules", e],
850
840
  queryFn: () => p.request(
@@ -852,18 +842,18 @@ function ui({
852
842
  ).then((t) => t.data ?? []).catch(() => []),
853
843
  staleTime: 300 * 1e3
854
844
  }))
855
- }), Or = oa.map((e) => e.dataUpdatedAt).join(","), sa = W(() => {
845
+ }), Oa = lr.map((e) => e.dataUpdatedAt).join(","), or = G(() => {
856
846
  const e = /* @__PURE__ */ new Map();
857
- for (const t of oa)
847
+ for (const t of lr)
858
848
  for (const n of t.data ?? []) {
859
- const r = e.get(n.name);
849
+ const a = e.get(n.name);
860
850
  e.set(n.name, {
861
851
  label: n.name,
862
- value: r ? `${r.value},${n.id}` : String(n.id)
852
+ value: a ? `${a.value},${n.id}` : String(n.id)
863
853
  });
864
854
  }
865
855
  return [...e.values()];
866
- }, [Or]), ia = Ie({
856
+ }, [Oa]), sr = Ve({
867
857
  queries: at.map((e) => ({
868
858
  queryKey: ["queue-collection-states", e],
869
859
  queryFn: () => p.request(
@@ -871,61 +861,61 @@ function ui({
871
861
  ).then((t) => t.data),
872
862
  staleTime: 300 * 1e3
873
863
  }))
874
- }), ca = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), fe = W(() => {
864
+ }), ir = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), fe = G(() => {
875
865
  const e = {};
876
- for (const t of ia)
877
- (t.data ?? []).forEach((n, r) => {
878
- e[n.key] = { label: n.label, color: n.color, sort: r };
866
+ for (const t of sr)
867
+ (t.data ?? []).forEach((n, a) => {
868
+ e[n.key] = { label: n.label, color: n.color, sort: a };
879
869
  });
880
870
  return e;
881
- }, [ia.map((e) => e.data)]), da = g ? Object.entries(g.by_state).sort(
871
+ }, [sr.map((e) => e.data)]), cr = x ? Object.entries(x.by_state).sort(
882
872
  (e, t) => {
883
- var n, r;
884
- return (((n = fe[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = fe[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
873
+ var n, a;
874
+ return (((n = fe[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((a = fe[t[0]]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER);
885
875
  }
886
- ) : [], ua = (e) => [...e].sort(
876
+ ) : [], dr = (e) => [...e].sort(
887
877
  (t, n) => {
888
- var r, o;
889
- return (((r = fe[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = fe[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
878
+ var a, o;
879
+ return (((a = fe[t]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = fe[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
890
880
  }
891
- ), fn = W(() => {
881
+ ), fn = G(() => {
892
882
  const e = {};
893
883
  for (const [t, n] of Object.entries(fe)) e[t] = n.label;
894
884
  return e;
895
- }, [fe]), Ne = (e) => e ? e === "none" ? "No State" : fn[e] ?? ca(e) : "—", rt = (e) => {
896
- if (e === It) return "Addendums";
897
- const t = (Fr ?? []).find((n) => n.collection === e);
898
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || ca(e);
899
- }, ee = W(() => N ? se ? se.map((e) => ({
885
+ }, [fe]), Ce = (e) => e ? e === "none" ? "No State" : fn[e] ?? ir(e) : "—", lt = (e) => {
886
+ if (e === Ut) return "Addendums";
887
+ const t = (Fa ?? []).find((n) => n.collection === e);
888
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || ir(e);
889
+ }, Z = G(() => N ? se ? se.map((e) => ({
900
890
  key: e.key,
901
891
  rows: dn.get(e.key) ?? [],
902
892
  breached: e.breached,
903
893
  atRisk: e.at_risk,
904
894
  count: e.count,
905
895
  sums: e.sums ?? {}
906
- })) : ro(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, se, dn]), gn = B(null);
896
+ })) : io(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, se, dn]), gn = B(null);
907
897
  j(() => {
908
- if (!N || !ee) {
898
+ if (!N || !Z) {
909
899
  gn.current = null;
910
900
  return;
911
901
  }
912
- if (Xe && !se || gn.current === N) return;
902
+ if (Ne && !se || gn.current === N) return;
913
903
  gn.current = N;
914
- const e = ee.reduce((t, n) => t + n.count, 0);
915
- Ut(e > 200 ? new Set(ee.map((t) => t.key)) : /* @__PURE__ */ new Set()), Xn({});
904
+ const e = Z.reduce((t, n) => t + n.count, 0);
905
+ It(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), zn({});
916
906
  }, [N, se]);
917
- function Lr(e) {
918
- Ut((t) => {
907
+ function La(e) {
908
+ It((t) => {
919
909
  const n = new Set(t);
920
910
  return n.has(e) ? n.delete(e) : n.add(e), n;
921
911
  });
922
912
  }
923
- const te = W(() => ee ? ee.filter((e) => !be.has(e.key)).flatMap((e) => e.rows) : S, [ee, S, be]), D = (e) => `${e.collection}:${e.item_id}`, [ge, Se] = y(null), [Dr, xn] = y(!1), [Rt, Et] = y(null), yn = (e) => {
924
- if (e.collection === It && e.url) {
913
+ const ee = G(() => Z ? Z.filter((e) => !be.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, be]), D = (e) => `${e.collection}:${e.item_id}`, [ge, $e] = k(null), [Da, xn] = k(!1), [At, Et] = k(null), yn = (e) => {
914
+ if (e.collection === Ut && e.url) {
925
915
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
926
916
  if (t) {
927
917
  const n = {};
928
- for (const [r, o] of new URLSearchParams(t[3] ?? "")) n[r] = o;
918
+ for (const [a, o] of new URLSearchParams(t[3] ?? "")) n[a] = o;
929
919
  return {
930
920
  collection: decodeURIComponent(t[1]),
931
921
  itemId: decodeURIComponent(t[2]),
@@ -939,22 +929,22 @@ function ui({
939
929
  itemId: e.item_id,
940
930
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
941
931
  };
942
- }, lt = (e) => {
932
+ }, ot = (e) => {
943
933
  var t;
944
- s && Xa({
934
+ s && zr({
945
935
  queue_id: l,
946
936
  name: s.name,
947
937
  path: `${window.location.pathname}${window.location.search}`,
948
938
  at: Date.now(),
949
939
  scroll: ((t = Dt.current) == null ? void 0 : t.scrollTop) ?? 0,
950
- state: { scope: x, page: He, sort: G, filters: w, group_by: N, view: R }
951
- }), V.open(yn(e));
952
- }, [P, ot] = y(
940
+ state: { scope: g, page: ve, sort: I, filters: w, group_by: N, view: A }
941
+ }), W.open(yn(e));
942
+ }, [P, st] = k(
953
943
  null
954
944
  );
955
945
  j(() => {
956
946
  if (!P) return;
957
- const e = () => ot(null);
947
+ const e = () => st(null);
958
948
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
959
949
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
960
950
  };
@@ -962,12 +952,12 @@ function ui({
962
952
  const Ot = (e) => {
963
953
  Et(D(e));
964
954
  const t = (u == null ? void 0 : u.row_click) ?? "preview";
965
- if (t === "full" || e.collection === It) {
966
- lt(e);
955
+ if (t === "full" || e.collection === Ut) {
956
+ ot(e);
967
957
  return;
968
958
  }
969
959
  if (t === "layout") {
970
- Sa({
960
+ Nr({
971
961
  collection: e.collection,
972
962
  itemId: e.item_id,
973
963
  rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
@@ -976,85 +966,85 @@ function ui({
976
966
  });
977
967
  return;
978
968
  }
979
- Se(e);
969
+ $e(e);
980
970
  };
981
971
  j(() => {
982
972
  if (!ge) return;
983
973
  const e = S.find((t) => D(t) === D(ge));
984
- e && e !== ge && Se(e);
974
+ e && e !== ge && $e(e);
985
975
  }, [S]);
986
- const Pr = (e) => !e.claimed_by || e.claimed_by.id === v;
987
- function ma(e) {
988
- const t = e ? te.findIndex((r) => D(r) === D(e)) + 1 : 0, n = te.slice(t).find(Pr);
976
+ const Pa = (e) => !e.claimed_by || e.claimed_by.id === v;
977
+ function ur(e) {
978
+ const t = e ? ee.findIndex((a) => D(a) === D(e)) + 1 : 0, n = ee.slice(t).find(Pa);
989
979
  if (!n) {
990
- xn(!1), Se(null), A.info("Nothing left to work on — queue clear!");
980
+ xn(!1), $e(null), T.info("Nothing left to work on — queue clear!");
991
981
  return;
992
982
  }
993
- if (Et(D(n)), oe && !n.claimed_by && _e.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
994
- lt(n);
983
+ if (Et(D(n)), oe && !n.claimed_by && Se.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
984
+ ot(n);
995
985
  return;
996
986
  }
997
- xn(!0), Se(n);
987
+ xn(!0), $e(n);
998
988
  }
999
989
  j(() => {
1000
- if (R !== "table") return;
990
+ if (A !== "table") return;
1001
991
  function e(t) {
1002
992
  var o;
1003
993
  const n = t.target;
1004
994
  if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
1005
995
  return;
1006
- const r = Rt ? te.findIndex((i) => D(i) === Rt) : -1;
996
+ const a = At ? ee.findIndex((i) => D(i) === At) : -1;
1007
997
  if (t.key === "j" || t.key === "ArrowDown") {
1008
998
  t.preventDefault();
1009
- const i = te[Math.min(r + 1, te.length - 1)];
999
+ const i = ee[Math.min(a + 1, ee.length - 1)];
1010
1000
  i && Et(D(i));
1011
1001
  } else if (t.key === "k" || t.key === "ArrowUp") {
1012
1002
  t.preventDefault();
1013
- const i = te[Math.max(r - 1, 0)];
1003
+ const i = ee[Math.max(a - 1, 0)];
1014
1004
  i && Et(D(i));
1015
- } else if (t.key === "Enter" && r >= 0 && !ge)
1016
- t.preventDefault(), Ot(te[r]);
1017
- else if (t.key === "c" && r >= 0 && oe) {
1005
+ } else if (t.key === "Enter" && a >= 0 && !ge)
1006
+ t.preventDefault(), Ot(ee[a]);
1007
+ else if (t.key === "c" && a >= 0 && oe) {
1018
1008
  t.preventDefault();
1019
- const i = te[r];
1020
- ((o = i.claimed_by) == null ? void 0 : o.id) === v ? Pe.mutate(i) : _e.mutate(i);
1021
- } else t.key === "o" && r >= 0 && (t.preventDefault(), lt(te[r]));
1009
+ const i = ee[a];
1010
+ ((o = i.claimed_by) == null ? void 0 : o.id) === v ? Me.mutate(i) : Se.mutate(i);
1011
+ } else t.key === "o" && a >= 0 && (t.preventDefault(), ot(ee[a]));
1022
1012
  }
1023
1013
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1024
- }, [R, te, Rt, ge, v, _e, Pe, oe]);
1025
- const { data: U } = H({
1014
+ }, [A, ee, At, ge, v, Se, Me, oe]);
1015
+ const { data: V } = H({
1026
1016
  queryKey: ["queue-views", l],
1027
1017
  queryFn: () => p.request(E(`/queues/${l}/views`)),
1028
1018
  enabled: !!l
1029
- }), [st, it] = y(null), [Kr, kn] = y(!1), [vn, ba] = y(""), [pa, ha] = y(!1), [ct, fa] = y(!1);
1019
+ }), [it, ct] = k(null), [Ka, kn] = k(!1), [vn, mr] = k(""), [br, pr] = k(!1), [dt, hr] = k(!1);
1030
1020
  function Lt(e) {
1031
1021
  const t = e.state ?? {};
1032
- Y(t.scope ?? "all"), M({ ...pe.current, ...t.filters ?? {} }), Te(t.sort ?? ""), Ye(t.group_by ?? null), qt(t.columns ?? null), Gt(t.pins ?? null), t.view && Fe(we.includes(t.view) ? t.view : we[0]), L(1), it(e.id);
1022
+ J(t.scope ?? "all"), M({ ...pe.current, ...t.filters ?? {} }), Ae(t.sort ?? ""), Ye(t.group_by ?? null), qt(t.columns ?? null), Gt(t.pins ?? null), t.view && Te(_e.includes(t.view) ? t.view : _e[0]), L(1), ct(e.id);
1033
1023
  }
1034
- function Mr() {
1024
+ function Ma() {
1035
1025
  var t, n;
1036
- const e = U == null ? void 0 : U.data.find((r) => r.is_default);
1026
+ const e = V == null ? void 0 : V.data.find((a) => a.is_default);
1037
1027
  if (e) {
1038
1028
  Lt(e);
1039
1029
  return;
1040
1030
  }
1041
- Y(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...pe.current }), Te(""), Ye(null), qt(null), Gt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Fe(s.display_config.default_view), L(1), it(null);
1031
+ J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...pe.current }), Ae(""), Ye(null), qt(null), Gt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Te(s.display_config.default_view), L(1), ct(null);
1042
1032
  }
1043
1033
  j(() => {
1044
- if (re || !(s != null && s.display_config) || Ke === void 0 || U === void 0) return;
1045
- const e = Ke.data.default_view_id, t = e != null ? U.data.find((r) => r.id === e) : void 0, n = U.data.find((r) => r.is_default);
1046
- t ? Lt(t) : n ? Lt(n) : (Fe(s.display_config.default_view), Y(s.display_config.default_scope)), ir(!0);
1047
- }, [s, Ke, U, re]);
1034
+ if (ae || !(s != null && s.display_config) || Qe === void 0 || V === void 0) return;
1035
+ const e = Qe.data.default_view_id, t = e != null ? V.data.find((a) => a.id === e) : void 0, n = V.data.find((a) => a.is_default);
1036
+ t ? Lt(t) : n ? Lt(n) : (Te(s.display_config.default_view), J(s.display_config.default_scope)), sa(!0);
1037
+ }, [s, Qe, V, ae]);
1048
1038
  const Dt = B(null), Pt = B(null);
1049
1039
  j(() => {
1050
- if (!re) return;
1051
- const e = Ro();
1040
+ if (!ae) return;
1041
+ const e = Do();
1052
1042
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1053
- Xa({ ...e, restore: !1 });
1043
+ zr({ ...e, restore: !1 });
1054
1044
  const t = e.state ?? {};
1055
- t.scope && Y(t.scope), t.filters && M({ ...pe.current, ...t.filters }), t.sort != null && Te(t.sort), Ye(t.group_by ?? null), t.view && Fe(t.view), t.page && L(t.page), Pt.current = e.scroll ?? 0;
1056
- }, [re, l]), j(() => {
1057
- if (!re || typeof window > "u") return;
1045
+ t.scope && J(t.scope), t.filters && M({ ...pe.current, ...t.filters }), t.sort != null && Ae(t.sort), Ye(t.group_by ?? null), t.view && Te(t.view), t.page && L(t.page), Pt.current = e.scroll ?? 0;
1046
+ }, [ae, l]), j(() => {
1047
+ if (!ae || typeof window > "u") return;
1058
1048
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1059
1049
  if (!t) return;
1060
1050
  e.delete("owner");
@@ -1063,158 +1053,158 @@ function ui({
1063
1053
  window.history.state,
1064
1054
  "",
1065
1055
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1066
- ), Y("all"), M((r) => ({ ...r, owners: [t] })), it(null), L(1);
1067
- }, [re]), j(() => {
1056
+ ), J("all"), M((a) => ({ ...a, owners: [t] })), ct(null), L(1);
1057
+ }, [ae]), j(() => {
1068
1058
  Pt.current == null || S.length === 0 || !Dt.current || (Dt.current.scrollTop = Pt.current, Pt.current = null);
1069
1059
  }, [S]);
1070
- const { isAdmin: Kt } = Ya(), ga = Kt || (s == null ? void 0 : s.owner) != null && s.owner === v, Qr = ye({
1071
- mutationFn: ({ viewId: e, on: t }) => p.request(Ja(`/queues/views/${e}`, { is_default: t })),
1060
+ const { isAdmin: Kt } = Hr(), fr = Kt || (s == null ? void 0 : s.owner) != null && s.owner === v, Qa = ye({
1061
+ mutationFn: ({ viewId: e, on: t }) => p.request(Jr(`/queues/views/${e}`, { is_default: t })),
1072
1062
  onSuccess: () => {
1073
- h.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("Queue default view updated");
1063
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), T.success("Queue default view updated");
1074
1064
  },
1075
- onError: () => A.error("Could not update the queue default view")
1076
- }), xa = ye({
1065
+ onError: () => T.error("Could not update the queue default view")
1066
+ }), gr = ye({
1077
1067
  mutationFn: () => p.request(
1078
- Z(`/queues/${l}/views`, {
1068
+ ne(`/queues/${l}/views`, {
1079
1069
  name: vn.trim(),
1080
- is_shared: pa || ct,
1081
- is_default: ct,
1070
+ is_shared: br || dt,
1071
+ is_default: dt,
1082
1072
  state: {
1083
- scope: x,
1073
+ scope: g,
1084
1074
  filters: w,
1085
- sort: G,
1075
+ sort: I,
1086
1076
  group_by: N,
1087
- view: R,
1077
+ view: A,
1088
1078
  columns: on,
1089
- pins: vt
1079
+ pins: wt
1090
1080
  }
1091
1081
  })
1092
1082
  ),
1093
1083
  onSuccess: (e) => {
1094
- kn(!1), ba(""), ha(!1), fa(!1), it(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("View saved");
1084
+ kn(!1), mr(""), pr(!1), hr(!1), ct(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), T.success("View saved");
1095
1085
  },
1096
- onError: () => A.error("Failed to save view")
1097
- }), [ya, ka] = y(null), Ce = ye({
1086
+ onError: () => T.error("Failed to save view")
1087
+ }), [xr, yr] = k(null), qe = ye({
1098
1088
  mutationFn: (e) => p.request(
1099
- Ja(`/queues/views/${e.id}`, {
1089
+ Jr(`/queues/views/${e.id}`, {
1100
1090
  state: {
1101
- scope: x,
1091
+ scope: g,
1102
1092
  filters: w,
1103
- sort: G,
1093
+ sort: I,
1104
1094
  group_by: N,
1105
- view: R,
1095
+ view: A,
1106
1096
  columns: on,
1107
- pins: vt
1097
+ pins: wt
1108
1098
  }
1109
1099
  })
1110
1100
  ),
1111
1101
  onSuccess: (e, t) => {
1112
- h.invalidateQueries({ queryKey: ["queue-views", l] }), ka(t.id), setTimeout(() => ka((n) => n === t.id ? null : n), 2e3), A.success(`Saved "${t.name}" with the current filters, scope and sort`);
1102
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), yr(t.id), setTimeout(() => yr((n) => n === t.id ? null : n), 2e3), T.success(`Saved "${t.name}" with the current filters, scope and sort`);
1113
1103
  },
1114
- onError: () => A.error("Failed to update view")
1115
- }), jr = ye({
1104
+ onError: () => T.error("Failed to update view")
1105
+ }), Ba = ye({
1116
1106
  mutationFn: (e) => p.request($n(`/queues/views/${e}`)),
1117
1107
  onSuccess: (e, t) => {
1118
- h.invalidateQueries({ queryKey: ["queue-views", l] }), it(null), Me === t && sn(null);
1108
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), ct(null), Be === t && sn(null);
1119
1109
  },
1120
- onError: () => A.error("Failed to delete view")
1121
- }), Br = ye({
1122
- mutationFn: (e) => p.request(Gl(`/queues/${l}/default-view`, { view_id: e })),
1110
+ onError: () => T.error("Failed to delete view")
1111
+ }), ja = ye({
1112
+ mutationFn: (e) => p.request(Vl(`/queues/${l}/default-view`, { view_id: e })),
1123
1113
  onMutate: (e) => sn(e),
1124
1114
  onSuccess: (e, t) => {
1125
- h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.success(
1115
+ h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), T.success(
1126
1116
  t === null ? "Reverted to the general default" : "Set as your default view"
1127
1117
  );
1128
1118
  },
1129
1119
  onError: () => {
1130
- h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.error("Failed to update default view");
1120
+ h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), T.error("Failed to update default view");
1131
1121
  }
1132
- }), [$e, Mt] = y([]);
1133
- Vl(), Dn.current = $e.length;
1134
- const [va, wa] = y(!1);
1122
+ }), [Fe, Mt] = k([]);
1123
+ Il(), Pn.current = Fe.length;
1124
+ const [kr, vr] = k(!1);
1135
1125
  async function wn(e, t) {
1136
- const n = S.filter((b) => $e.includes(D(b)));
1137
- wa(!0);
1138
- const r = await Promise.allSettled(n.map(t)), o = r.filter((b) => b.status === "fulfilled").length, i = r.length - o;
1139
- wa(!1), Mt([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), i ? A.warning(`${e}: ${o} succeeded, ${i} failed`) : A.success(`${e}: ${o} succeeded`);
1126
+ const n = S.filter((b) => Fe.includes(D(b)));
1127
+ vr(!0);
1128
+ const a = await Promise.allSettled(n.map(t)), o = a.filter((b) => b.status === "fulfilled").length, i = a.length - o;
1129
+ vr(!1), Mt([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), i ? T.warning(`${e}: ${o} succeeded, ${i} failed`) : T.success(`${e}: ${o} succeeded`);
1140
1130
  }
1141
- const je = (e) => {
1131
+ const Ue = (e) => {
1142
1132
  var t;
1143
1133
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
1144
- const r = (t = n.column_formats) == null ? void 0 : t[e];
1145
- if (r) return r;
1134
+ const a = (t = n.column_formats) == null ? void 0 : t[e];
1135
+ if (a) return a;
1146
1136
  }
1147
1137
  return null;
1148
- }, Ir = (e) => {
1149
- if (N === "state") return e === "No state" ? e : Ne(e);
1150
- if (N === "collection") return rt(e);
1138
+ }, Ua = (e) => {
1139
+ if (N === "state") return e === "No state" ? e : Ce(e);
1140
+ if (N === "collection") return lt(e);
1151
1141
  if (N != null && N.startsWith("extra.") && e !== "—") {
1152
- const t = je(N.slice(6));
1153
- if (t) return Ue(e, t);
1142
+ const t = Ue(N.slice(6));
1143
+ if (t) return Ge(e, t);
1154
1144
  }
1155
1145
  return e;
1156
- }, Ur = ee == null ? void 0 : ee.map((e) => ({
1146
+ }, Ia = Z == null ? void 0 : Z.map((e) => ({
1157
1147
  key: e.key,
1158
1148
  rows: e.rows,
1159
- header: /* @__PURE__ */ c(ke, { children: [
1160
- /* @__PURE__ */ a("span", { children: Ir(e.key) }),
1161
- /* @__PURE__ */ c("span", { className: "font-normal text-slate-400", children: [
1149
+ header: /* @__PURE__ */ d(ke, { children: [
1150
+ /* @__PURE__ */ r("span", { children: Ua(e.key) }),
1151
+ /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1162
1152
  "(",
1163
- ae(e.count),
1153
+ re(e.count),
1164
1154
  ")"
1165
1155
  ] }),
1166
1156
  Object.entries(e.sums).map(([t, n]) => {
1167
- const r = je(t);
1168
- return /* @__PURE__ */ c(
1157
+ const a = Ue(t);
1158
+ return /* @__PURE__ */ d(
1169
1159
  "span",
1170
1160
  {
1171
1161
  className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
1172
1162
  "data-queue-group-sum": t,
1173
1163
  children: [
1174
- q(`extra.${t}`, xt(t)),
1164
+ q(`extra.${t}`, yt(t)),
1175
1165
  ":",
1176
1166
  " ",
1177
- r ? Ue(String(n), r) : ae(n)
1167
+ a ? Ge(String(n), a) : re(n)
1178
1168
  ]
1179
1169
  },
1180
1170
  t
1181
1171
  );
1182
1172
  }),
1183
- se && !be.has(e.key) && Sr.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1184
- se && !be.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ c(
1173
+ se && !be.has(e.key) && Sa.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1174
+ se && !be.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1185
1175
  "button",
1186
1176
  {
1187
1177
  type: "button",
1188
1178
  "data-queue-group-more": e.key,
1189
1179
  onClick: (t) => {
1190
- t.stopPropagation(), Xn((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1180
+ t.stopPropagation(), zn((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1191
1181
  },
1192
1182
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
1193
1183
  children: [
1194
1184
  "Showing ",
1195
- ae(e.rows.length),
1185
+ re(e.rows.length),
1196
1186
  " of ",
1197
- ae(e.count),
1187
+ re(e.count),
1198
1188
  " · Show more"
1199
1189
  ]
1200
1190
  }
1201
1191
  ),
1202
- e.breached > 0 && /* @__PURE__ */ c("span", { className: "rounded bg-red-50 px-1.5 py-0.5 text-[11px] font-medium text-red-600 dark:bg-red-500/10 dark:text-red-400", children: [
1192
+ e.breached > 0 && /* @__PURE__ */ d("span", { className: "rounded bg-red-50 px-1.5 py-0.5 text-[11px] font-medium text-red-600 dark:bg-red-500/10 dark:text-red-400", children: [
1203
1193
  e.breached,
1204
1194
  " breached"
1205
1195
  ] }),
1206
- e.atRisk > 0 && /* @__PURE__ */ c("span", { className: "rounded bg-amber-50 px-1.5 py-0.5 text-[11px] font-medium text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: [
1196
+ e.atRisk > 0 && /* @__PURE__ */ d("span", { className: "rounded bg-amber-50 px-1.5 py-0.5 text-[11px] font-medium text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: [
1207
1197
  e.atRisk,
1208
1198
  " at risk"
1209
1199
  ] })
1210
1200
  ] })
1211
- })), _n = (((Oa = d == null ? void 0 : d.available_values.collection) == null ? void 0 : Oa.length) ?? 0) > 1, _a = S.some((e) => !!e.unseen) || At.size > 0 || S.some((e) => ve.isNew(D(e))), Na = [
1201
+ })), _n = (((Er = c == null ? void 0 : c.available_values.collection) == null ? void 0 : Er.length) ?? 0) > 1, wr = S.some((e) => !!e.unseen) || Tt.size > 0 || S.some((e) => we.isNew(D(e))), _r = [
1212
1202
  ..._n ? [
1213
1203
  {
1214
1204
  key: "collection",
1215
1205
  header: q("collection", "Collection"),
1216
1206
  sortable: !0,
1217
- render: (e) => /* @__PURE__ */ a(Ko, { variant: "outline", children: rt(e.collection) })
1207
+ render: (e) => /* @__PURE__ */ r(Uo, { variant: "outline", children: lt(e.collection) })
1218
1208
  }
1219
1209
  ] : [],
1220
1210
  {
@@ -1222,23 +1212,23 @@ function ui({
1222
1212
  header: q("label", "Item"),
1223
1213
  sortable: !0,
1224
1214
  // Room in the left padding for the hanging unseen mark (#643).
1225
- className: _a ? "pl-[30px]" : void 0,
1226
- headerClassName: _a ? "pl-[30px]" : void 0,
1215
+ className: wr ? "pl-[30px]" : void 0,
1216
+ headerClassName: wr ? "pl-[30px]" : void 0,
1227
1217
  render: (e) => (
1228
1218
  // Underlined because clicking opens the item. The row is clickable as
1229
1219
  // a whole, but nothing on it said so — an underline is the one
1230
1220
  // convention people already read as "this goes somewhere".
1231
- /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5", children: [
1232
- At.get(D(e)) || ve.isNew(D(e)) ? /* @__PURE__ */ a(
1233
- Eo,
1221
+ /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1222
+ Tt.get(D(e)) || we.isNew(D(e)) ? /* @__PURE__ */ r(
1223
+ Po,
1234
1224
  {
1235
- lock: At.get(D(e)),
1236
- isNew: ve.isNew(D(e)),
1225
+ lock: Tt.get(D(e)),
1226
+ isNew: we.isNew(D(e)),
1237
1227
  dataAttr: "data-queue-live-mark",
1238
1228
  hang: !0
1239
1229
  }
1240
- ) : /* @__PURE__ */ a(Po, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1241
- /* @__PURE__ */ a(
1230
+ ) : /* @__PURE__ */ r(jo, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1231
+ /* @__PURE__ */ r(
1242
1232
  "span",
1243
1233
  {
1244
1234
  className: "block max-w-[160px] truncate font-medium underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover/row:decoration-nvr-cyan dark:decoration-slate-600",
@@ -1246,7 +1236,7 @@ function ui({
1246
1236
  children: e.label
1247
1237
  }
1248
1238
  ),
1249
- (e.labels ?? []).slice(0, 3).map((t) => /* @__PURE__ */ a(
1239
+ (e.labels ?? []).slice(0, 3).map((t) => /* @__PURE__ */ r(
1250
1240
  "span",
1251
1241
  {
1252
1242
  className: "shrink-0 rounded-full bg-violet-100 px-1.5 py-px text-[9.5px] font-medium text-violet-700 dark:bg-violet-500/15 dark:text-violet-300",
@@ -1255,15 +1245,11 @@ function ui({
1255
1245
  },
1256
1246
  t
1257
1247
  )),
1258
- Gn[`${e.collection}:${e.item_id}`] > 1 && /* @__PURE__ */ c(
1259
- "span",
1248
+ /* @__PURE__ */ r(
1249
+ Bo,
1260
1250
  {
1261
- className: "inline-flex shrink-0 items-center gap-0.5 rounded-full bg-slate-100 px-1.5 py-px text-[9.5px] text-slate-500 dark:bg-muted dark:text-muted-foreground",
1262
- "data-tip": "People with this record open right now",
1263
- children: [
1264
- /* @__PURE__ */ a(vl, { className: "h-2.5 w-2.5" }),
1265
- Gn[`${e.collection}:${e.item_id}`]
1266
- ]
1251
+ viewers: va[so(e.collection, e.item_id)],
1252
+ dataAttr: "data-queue-presence"
1267
1253
  }
1268
1254
  )
1269
1255
  ] })
@@ -1273,7 +1259,7 @@ function ui({
1273
1259
  key: "state",
1274
1260
  header: q("state", "State"),
1275
1261
  sortable: !0,
1276
- render: (e) => e.state ? /* @__PURE__ */ c(
1262
+ render: (e) => e.state ? /* @__PURE__ */ d(
1277
1263
  "span",
1278
1264
  {
1279
1265
  className: "inline-block max-w-[190px] truncate whitespace-nowrap rounded px-1.5 py-0.5 align-middle text-[11px] font-medium",
@@ -1281,25 +1267,25 @@ function ui({
1281
1267
  backgroundColor: e.state_color ? `${e.state_color}1a` : void 0,
1282
1268
  color: e.state_color ?? void 0
1283
1269
  },
1284
- title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ne(e.state)}` : Ne(e.state),
1270
+ title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ce(e.state)}` : Ce(e.state),
1285
1271
  children: [
1286
- Ne(e.state),
1287
- e.via_addendum && /* @__PURE__ */ a("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
1272
+ Ce(e.state),
1273
+ e.via_addendum && /* @__PURE__ */ r("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
1288
1274
  ]
1289
1275
  }
1290
- ) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" })
1276
+ ) : /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" })
1291
1277
  },
1292
1278
  {
1293
1279
  key: "owners",
1294
1280
  header: q("owners", "Owners"),
1295
1281
  sortable: !0,
1296
- render: (e) => /* @__PURE__ */ a(Io, { owners: e.owners })
1282
+ render: (e) => /* @__PURE__ */ r(Ho, { owners: e.owners })
1297
1283
  },
1298
1284
  {
1299
1285
  key: "aging_hours",
1300
1286
  header: q("aging_hours", "Aging"),
1301
1287
  sortable: !0,
1302
- render: (e) => Zo(e.aging_hours)
1288
+ render: (e) => as(e.aging_hours)
1303
1289
  },
1304
1290
  {
1305
1291
  // When the record entered its current state — the same moment Aging
@@ -1307,13 +1293,13 @@ function ui({
1307
1293
  key: "state_entered",
1308
1294
  header: q("state_entered", "Last State Change"),
1309
1295
  sortable: !0,
1310
- render: (e) => e.state_entered_at ? Jl(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1296
+ render: (e) => e.state_entered_at ? Jl(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1311
1297
  },
1312
1298
  {
1313
1299
  key: "sla_status",
1314
1300
  header: q("sla_status", "SLA"),
1315
1301
  sortable: !0,
1316
- render: (e) => /* @__PURE__ */ a(es, { status: e.sla_status })
1302
+ render: (e) => /* @__PURE__ */ r(ls, { status: e.sla_status })
1317
1303
  },
1318
1304
  {
1319
1305
  key: "at_risk",
@@ -1321,27 +1307,27 @@ function ui({
1321
1307
  sortable: !0,
1322
1308
  render: (e) => {
1323
1309
  var t;
1324
- return e.at_risk ? /* @__PURE__ */ c("span", { className: oo(e.at_risk_color ?? "red"), children: [
1310
+ return e.at_risk ? /* @__PURE__ */ d("span", { className: uo(e.at_risk_color ?? "red"), children: [
1325
1311
  "⚑ ",
1326
1312
  ((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
1327
- ] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
1313
+ ] }) : e.predicted_risk ? /* @__PURE__ */ r("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
1328
1314
  }
1329
1315
  },
1330
- ...Qe ? [
1316
+ ...je ? [
1331
1317
  {
1332
1318
  key: "addendums",
1333
1319
  header: q("addendums", "Addendums"),
1334
1320
  sortable: !1,
1335
- render: (e) => /* @__PURE__ */ a(Xo, { summary: e.addendums })
1321
+ render: (e) => /* @__PURE__ */ r(rs, { summary: e.addendums })
1336
1322
  }
1337
1323
  ] : [],
1338
- ...et ? [
1324
+ ...tt ? [
1339
1325
  {
1340
1326
  key: "fulfilment",
1341
1327
  header: q("fulfilment", "Shipped"),
1342
1328
  sortable: !0,
1343
- render: (e) => /* @__PURE__ */ a(
1344
- Co,
1329
+ render: (e) => /* @__PURE__ */ r(
1330
+ Ro,
1345
1331
  {
1346
1332
  collection: e.collection,
1347
1333
  itemId: e.item_id,
@@ -1355,17 +1341,17 @@ function ui({
1355
1341
  key: "integrations",
1356
1342
  header: q("integrations", "Integrations"),
1357
1343
  sortable: !1,
1358
- render: (e) => /* @__PURE__ */ a(Fo, { rows: Ar[`${e.collection}:${e.item_id}`] })
1344
+ render: (e) => /* @__PURE__ */ r(Eo, { rows: Ta[`${e.collection}:${e.item_id}`] })
1359
1345
  }
1360
1346
  ] : [],
1361
- ...la ? [
1347
+ ...ar ? [
1362
1348
  {
1363
1349
  key: "tasks",
1364
1350
  header: q("tasks", "Tasks"),
1365
1351
  sortable: !1,
1366
1352
  render: (e) => {
1367
- const t = Er[`${e.collection}:${e.item_id}`];
1368
- return !t || t.open === 0 ? /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ c(
1353
+ const t = Ea[`${e.collection}:${e.item_id}`];
1354
+ return !t || t.open === 0 ? /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
1369
1355
  "span",
1370
1356
  {
1371
1357
  "data-queue-task-count": t.open,
@@ -1379,84 +1365,84 @@ function ui({
1379
1365
  }
1380
1366
  }
1381
1367
  ] : [],
1382
- ...tt ? [
1368
+ ...nt ? [
1383
1369
  {
1384
1370
  key: "send_backs",
1385
1371
  header: q("send_backs", "Sent back"),
1386
1372
  sortable: !0,
1387
- render: (e) => /* @__PURE__ */ a(Yo, { summary: e.send_backs })
1373
+ render: (e) => /* @__PURE__ */ r(es, { summary: e.send_backs })
1388
1374
  }
1389
1375
  ] : []
1390
- ], Vr = {
1376
+ ], Va = {
1391
1377
  key: "claim",
1392
1378
  header: "",
1393
- render: (e) => e.claimed_by ? /* @__PURE__ */ a(
1379
+ render: (e) => e.claimed_by ? /* @__PURE__ */ r(
1394
1380
  "button",
1395
1381
  {
1396
1382
  type: "button",
1397
1383
  onClick: (t) => {
1398
- t.stopPropagation(), Pe.mutate(e);
1384
+ t.stopPropagation(), Me.mutate(e);
1399
1385
  },
1400
1386
  className: "text-[11px] text-slate-400 underline hover:text-slate-600",
1401
1387
  children: "Release"
1402
1388
  }
1403
- ) : /* @__PURE__ */ a(
1389
+ ) : /* @__PURE__ */ r(
1404
1390
  "button",
1405
1391
  {
1406
1392
  type: "button",
1407
1393
  onClick: (t) => {
1408
- t.stopPropagation(), _e.mutate(e);
1394
+ t.stopPropagation(), Se.mutate(e);
1409
1395
  },
1410
1396
  className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
1411
1397
  children: "Claim"
1412
1398
  }
1413
1399
  )
1414
- }, dt = (s == null ? void 0 : s.available_extra_fields) ?? [], ut = Bl("drill.queue"), X = ut.value, Sa = (e) => ut.push([e]), Gr = (e) => {
1400
+ }, ut = (s == null ? void 0 : s.available_extra_fields) ?? [], mt = Bl("drill.queue"), X = mt.value, Nr = (e) => mt.push([e]), Ga = (e) => {
1415
1401
  var t;
1416
1402
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
1417
- const r = (t = n.drilldown) == null ? void 0 : t[e];
1418
- if (r)
1403
+ const a = (t = n.drilldown) == null ? void 0 : t[e];
1404
+ if (a)
1419
1405
  return {
1420
- enabled: r.enabled !== !1,
1421
- layout_id: r.layout_id ?? null,
1422
- width: r.width ?? null
1406
+ enabled: a.enabled !== !1,
1407
+ layout_id: a.layout_id ?? null,
1408
+ width: a.width ?? null
1423
1409
  };
1424
1410
  }
1425
1411
  return { enabled: !0, layout_id: null, width: null };
1426
- }, Wr = W(() => {
1412
+ }, Wa = G(() => {
1427
1413
  const e = {};
1428
1414
  for (const t of (s == null ? void 0 : s.sources) ?? [])
1429
- for (const [n, r] of Object.entries(t.column_formats ?? {}))
1430
- n in e || (e[n] = r);
1415
+ for (const [n, a] of Object.entries(t.column_formats ?? {}))
1416
+ n in e || (e[n] = a);
1431
1417
  return e;
1432
- }, [s == null ? void 0 : s.sources]), Hr = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Yr = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1433
- function Jr(e) {
1434
- if (Hr.test(e)) return { text: e.split("@")[0], title: e };
1435
- if (Yr.test(e)) {
1418
+ }, [s == null ? void 0 : s.sources]), Ha = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ja = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1419
+ function Ya(e) {
1420
+ if (Ha.test(e)) return { text: e.split("@")[0], title: e };
1421
+ if (Ja.test(e)) {
1436
1422
  const t = new Date(e);
1437
1423
  if (!Number.isNaN(t.getTime()))
1438
1424
  return {
1439
- text: fo(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1440
- title: ho(t)
1425
+ text: ko(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1426
+ title: yo(t)
1441
1427
  };
1442
1428
  }
1443
1429
  return { text: e, title: e };
1444
1430
  }
1445
- const zr = dt.map((e) => ({
1431
+ const za = ut.map((e) => ({
1446
1432
  key: `extra.${e}`,
1447
- header: q(`extra.${e}`, xt(e)),
1433
+ header: q(`extra.${e}`, yt(e)),
1448
1434
  sortable: !0,
1449
1435
  render: (t) => {
1450
- var k, T;
1451
- const n = (k = t.extra) == null ? void 0 : k[e];
1452
- if (n == null || n === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
1453
- const r = je(e), o = r ? Ue(String(n), r) : String(n), { text: i, title: b } = Jr(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), K = ((T = t.extra_ids) == null ? void 0 : T[e]) ?? [], F = Gr(e);
1454
- return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && K.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ a(
1436
+ var y, R;
1437
+ const n = (y = t.extra) == null ? void 0 : y[e];
1438
+ if (n == null || n === "") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
1439
+ const a = Ue(e), o = a ? Ge(String(n), a) : String(n), { text: i, title: b } = Ya(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), K = ((R = t.extra_ids) == null ? void 0 : R[e]) ?? [], F = Ga(e);
1440
+ return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && K.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ r(
1455
1441
  "button",
1456
1442
  {
1457
1443
  type: "button",
1458
1444
  onClick: (Q) => {
1459
- Q.stopPropagation(), Sa({
1445
+ Q.stopPropagation(), Nr({
1460
1446
  collection: m.target_collection,
1461
1447
  itemId: K[0],
1462
1448
  layoutId: F.layout_id,
@@ -1468,20 +1454,20 @@ function ui({
1468
1454
  className: "block max-w-[200px] truncate text-left text-[12px] text-slate-700 underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:text-slate-200 dark:hover:text-nvr-cyan",
1469
1455
  children: i
1470
1456
  }
1471
- ) : (m == null ? void 0 : m.kind) === "relation" && m.aggregate ? /* @__PURE__ */ a(
1457
+ ) : (m == null ? void 0 : m.kind) === "relation" && m.aggregate ? /* @__PURE__ */ r(
1472
1458
  "button",
1473
1459
  {
1474
1460
  type: "button",
1475
1461
  onClick: (Q) => {
1476
- Q.stopPropagation(), tn({ row: t, path: e, value: o });
1462
+ Q.stopPropagation(), nn({ row: t, path: e, value: o });
1477
1463
  },
1478
1464
  title: "Show the rows behind this number",
1479
1465
  className: "block max-w-[200px] truncate text-left text-[12px] tabular-nums underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
1480
1466
  children: i
1481
1467
  }
1482
- ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: b, children: i });
1468
+ ) : /* @__PURE__ */ r("span", { className: "block max-w-[200px] truncate text-[12px]", title: b, children: i });
1483
1469
  }
1484
- })), Ca = [
1470
+ })), Sr = [
1485
1471
  ..._n ? ["collection"] : [],
1486
1472
  "state",
1487
1473
  "owners",
@@ -1489,47 +1475,47 @@ function ui({
1489
1475
  "state_entered",
1490
1476
  "sla_status",
1491
1477
  "at_risk",
1492
- ...Qe ? ["addendums"] : [],
1493
- ...et ? ["fulfilment"] : [],
1478
+ ...je ? ["addendums"] : [],
1479
+ ...tt ? ["fulfilment"] : [],
1494
1480
  ...he ? ["integrations"] : [],
1495
- ...tt ? ["send_backs"] : [],
1496
- ...la ? ["tasks"] : [],
1497
- ...dt.map((e) => `extra.${e}`)
1498
- ], Xr = [
1481
+ ...nt ? ["send_backs"] : [],
1482
+ ...ar ? ["tasks"] : [],
1483
+ ...ut.map((e) => `extra.${e}`)
1484
+ ], Xa = [
1499
1485
  ..._n ? ["collection"] : [],
1500
1486
  "state",
1501
1487
  "owners",
1502
- ...Qe ? ["addendums"] : [],
1503
- ...et ? ["fulfilment"] : [],
1488
+ ...je ? ["addendums"] : [],
1489
+ ...tt ? ["fulfilment"] : [],
1504
1490
  ...he ? ["integrations"] : [],
1505
- ...tt ? ["send_backs"] : [],
1491
+ ...nt ? ["send_backs"] : [],
1506
1492
  "aging_hours",
1507
1493
  "sla_status",
1508
1494
  "at_risk",
1509
- ...dt.slice(0, 2).map((e) => `extra.${e}`)
1510
- ], Zr = (u == null ? void 0 : u.default_columns) ?? null, Nn = on ?? Zr, ne = new Set(Nn ?? Xr);
1511
- Qe && !kt.has("addendums") && ne.add("addendums"), et && !kt.has("fulfilment") && ne.add("fulfilment"), he && !kt.has("integrations") && ne.add("integrations"), tt && !kt.has("send_backs") && ne.add("send_backs");
1495
+ ...ut.slice(0, 2).map((e) => `extra.${e}`)
1496
+ ], Za = (u == null ? void 0 : u.default_columns) ?? null, Nn = on ?? Za, te = new Set(Nn ?? Xa);
1497
+ je && !vt.has("addendums") && te.add("addendums"), tt && !vt.has("fulfilment") && te.add("fulfilment"), he && !vt.has("integrations") && te.add("integrations"), nt && !vt.has("send_backs") && te.add("send_backs");
1512
1498
  const el = new Set(Kt ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1513
- for (const e of el) ne.delete(e);
1514
- const Be = [
1515
- ...(Nn ?? []).filter((e) => Ca.includes(e)),
1516
- ...Ca.filter((e) => !(Nn ?? []).includes(e))
1499
+ for (const e of el) te.delete(e);
1500
+ const Ie = [
1501
+ ...(Nn ?? []).filter((e) => Sr.includes(e)),
1502
+ ...Sr.filter((e) => !(Nn ?? []).includes(e))
1517
1503
  ], tl = dl(ul(ml, { activationConstraint: { distance: 4 } }));
1518
1504
  function nl(e) {
1519
1505
  const { active: t, over: n } = e;
1520
1506
  if (!n || t.id === n.id) return;
1521
- const r = Be.indexOf(String(t.id)), o = Be.indexOf(String(n.id));
1522
- r === -1 || o === -1 || qt(
1523
- gl(Be, r, o).filter((i) => ne.has(i))
1507
+ const a = Ie.indexOf(String(t.id)), o = Ie.indexOf(String(n.id));
1508
+ a === -1 || o === -1 || qt(
1509
+ gl(Ie, a, o).filter((i) => te.has(i))
1524
1510
  );
1525
1511
  }
1526
- const $a = Na.find((e) => e.key === "label"), al = {
1527
- ...$a,
1528
- render: (e, ...t) => /* @__PURE__ */ c("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1529
- /* @__PURE__ */ a(vo, { rowId: e.item_id }),
1530
- $a.render(e, ...t)
1512
+ const Cr = _r.find((e) => e.key === "label"), rl = {
1513
+ ...Cr,
1514
+ render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1515
+ /* @__PURE__ */ r(So, { rowId: e.item_id }),
1516
+ Cr.render(e, ...t)
1531
1517
  ] })
1532
- }, rl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1518
+ }, al = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1533
1519
  (e) => ({
1534
1520
  key: `formula.${e.key}`,
1535
1521
  header: e.label,
@@ -1537,32 +1523,32 @@ function ui({
1537
1523
  const n = {
1538
1524
  ...t,
1539
1525
  ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([i, b]) => [`extra.${i}`, b])) : {}
1540
- }, r = Wl(e.formula, (i) => {
1526
+ }, a = Gl(e.formula, (i) => {
1541
1527
  const b = n[i] ?? (t.extra ? t.extra[i] : void 0), m = Number(b);
1542
1528
  return Number.isFinite(m) ? m : b ?? null;
1543
1529
  });
1544
- if (r == null || typeof r == "boolean") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
1545
- const o = Number(r);
1546
- return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
1530
+ if (a == null || typeof a == "boolean") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
1531
+ const o = Number(a);
1532
+ return Number.isFinite(o) ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ r("span", { children: String(a) });
1547
1533
  }
1548
1534
  })
1549
- ), qa = [...Na, ...zr, ...rl], ll = {
1535
+ ), $r = [..._r, ...za, ...al], ll = {
1550
1536
  key: "__actions__",
1551
1537
  header: "",
1552
- render: (e) => e.collection === "tasks" || e.collection === It ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
1553
- wo,
1538
+ render: (e) => e.collection === "tasks" || e.collection === Ut ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
1539
+ Co,
1554
1540
  {
1555
1541
  collection: e.collection,
1556
1542
  id: e.item_id,
1557
1543
  hasPipeline: e.state != null,
1558
- onOpen: () => lt(e),
1559
- onPeek: () => Se(e),
1560
- urlFor: V.urlFor,
1544
+ onOpen: () => ot(e),
1545
+ onPeek: () => $e(e),
1546
+ urlFor: W.urlFor,
1561
1547
  onDeleted: () => {
1562
1548
  p.request($n(`/items/${e.collection}/${e.item_id}`)).then(() => {
1563
- A.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
1549
+ T.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
1564
1550
  }).catch(
1565
- (t) => A.error(t instanceof Error ? t.message : "Delete failed")
1551
+ (t) => T.error(t instanceof Error ? t.message : "Delete failed")
1566
1552
  );
1567
1553
  },
1568
1554
  onAfterTransition: () => void h.invalidateQueries({ queryKey: ["queue-items", l] }),
@@ -1570,23 +1556,23 @@ function ui({
1570
1556
  }
1571
1557
  ) })
1572
1558
  }, Qt = [
1573
- al,
1574
- ...Be.filter((e) => ne.has(e)).map((e) => qa.find((t) => t.key === e)).filter((e) => e !== void 0),
1575
- ...oe ? [Vr] : [],
1559
+ rl,
1560
+ ...Ie.filter((e) => te.has(e)).map((e) => $r.find((t) => t.key === e)).filter((e) => e !== void 0),
1561
+ ...oe ? [Va] : [],
1576
1562
  ll
1577
- ], Fa = W(() => {
1578
- var r;
1579
- const e = u == null ? void 0 : u.default_pins, t = vt ?? (e && Object.keys(e).length > 0 ? e : { [((r = Qt[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(Qt.map((o) => o.key));
1563
+ ], qr = G(() => {
1564
+ var a;
1565
+ const e = u == null ? void 0 : u.default_pins, t = wt ?? (e && Object.keys(e).length > 0 ? e : { [((a = Qt[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(Qt.map((o) => o.key));
1580
1566
  return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
1581
- }, [vt, u == null ? void 0 : u.default_pins, Qt.map((e) => e.key).join("|")]), Ta = [
1567
+ }, [wt, u == null ? void 0 : u.default_pins, Qt.map((e) => e.key).join("|")]), Fr = [
1582
1568
  { value: "state", label: "State" },
1583
1569
  { value: "collection", label: "Collection" },
1584
1570
  { value: "sla_status", label: "SLA status" },
1585
1571
  { value: "at_risk", label: "At risk" },
1586
1572
  { value: "owners", label: "Owner" },
1587
1573
  { value: "aging", label: "Aging" },
1588
- ...dt.filter((e) => ne.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`, xt(e)) }))
1589
- ], Aa = (e) => async (t) => {
1574
+ ...ut.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`, yt(e)) }))
1575
+ ], Rr = (e) => async (t) => {
1590
1576
  if (!e.target_collection || !e.display_field) return [];
1591
1577
  const n = {
1592
1578
  limit: 25,
@@ -1595,22 +1581,22 @@ function ui({
1595
1581
  t.trim() && (n.filter = JSON.stringify({ [e.display_field]: { _contains: t.trim() } }));
1596
1582
  const o = (await p.request(
1597
1583
  E(`/items/${e.target_collection}`, n)
1598
- )).data ?? [], i = je(e.path), b = Re[e.path] ? new Set(Re[e.path]) : null, m = /* @__PURE__ */ new Set(), K = [];
1584
+ )).data ?? [], i = Ue(e.path), b = Oe[e.path] ? new Set(Oe[e.path]) : null, m = /* @__PURE__ */ new Set(), K = [];
1599
1585
  for (const F of o) {
1600
- const k = F[e.display_field];
1601
- if (k == null || k === "") continue;
1602
- const T = String(k);
1603
- m.has(T) || b && !b.has(T) || (m.add(T), K.push({ label: i ? Ue(T, i) : T, value: T }));
1586
+ const y = F[e.display_field];
1587
+ if (y == null || y === "") continue;
1588
+ const R = String(y);
1589
+ m.has(R) || b && !b.has(R) || (m.add(R), K.push({ label: i ? Ge(R, i) : R, value: R }));
1604
1590
  }
1605
1591
  return K;
1606
- }, Sn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), mt = [
1592
+ }, Sn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), bt = [
1607
1593
  {
1608
1594
  key: "collection",
1609
1595
  placeholder: q("collection", "Collection"),
1610
1596
  type: "combobox",
1611
1597
  multi: !0,
1612
- options: ((d == null ? void 0 : d.available_values.collection) ?? []).map((e) => ({
1613
- label: rt(e),
1598
+ options: ((c == null ? void 0 : c.available_values.collection) ?? []).map((e) => ({
1599
+ label: lt(e),
1614
1600
  value: e
1615
1601
  }))
1616
1602
  },
@@ -1621,16 +1607,16 @@ function ui({
1621
1607
  multi: !0,
1622
1608
  // Until the rows land, the pipeline's own states (no counts yet) rather
1623
1609
  // than an empty list.
1624
- options: ua(
1625
- d ? d.available_values.state ?? [] : Object.keys(fe)
1610
+ options: dr(
1611
+ c ? c.available_values.state ?? [] : Object.keys(fe)
1626
1612
  ).map((e) => {
1627
1613
  var t;
1628
1614
  return {
1629
- label: Ne(e),
1615
+ label: Ce(e),
1630
1616
  value: e,
1631
1617
  // How many rows sit in it under the other active filters (the State
1632
1618
  // filter itself left out, or every other state would read 0).
1633
- count: Zn ? Zn[e] ?? 0 : (t = g == null ? void 0 : g.by_state) == null ? void 0 : t[e]
1619
+ count: Xn ? Xn[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1634
1620
  };
1635
1621
  })
1636
1622
  },
@@ -1653,12 +1639,12 @@ function ui({
1653
1639
  { label: "No", value: "no" }
1654
1640
  ]
1655
1641
  },
1656
- ...sa.length > 0 ? [
1642
+ ...or.length > 0 ? [
1657
1643
  {
1658
1644
  key: "at_risk_rule",
1659
1645
  placeholder: "Highlight rule",
1660
1646
  type: "select",
1661
- options: sa
1647
+ options: or
1662
1648
  }
1663
1649
  ] : [],
1664
1650
  {
@@ -1667,7 +1653,7 @@ function ui({
1667
1653
  type: "range",
1668
1654
  range_unit: "h"
1669
1655
  },
1670
- ...Qe ? [
1656
+ ...je ? [
1671
1657
  {
1672
1658
  key: "addendums",
1673
1659
  placeholder: "Addendums",
@@ -1685,18 +1671,18 @@ function ui({
1685
1671
  key: "integrations",
1686
1672
  placeholder: q("integrations", "Integrations"),
1687
1673
  type: "select",
1688
- options: To.map((e) => ({ label: e.label, value: e.value }))
1674
+ options: Oo.map((e) => ({ label: e.label, value: e.value }))
1689
1675
  }
1690
1676
  ] : [],
1691
- ...et ? [
1677
+ ...tt ? [
1692
1678
  {
1693
1679
  key: "fulfilment",
1694
1680
  placeholder: "Shipped",
1695
1681
  type: "select",
1696
- options: $o
1682
+ options: To
1697
1683
  }
1698
1684
  ] : [],
1699
- ...tt ? [
1685
+ ...nt ? [
1700
1686
  {
1701
1687
  key: "send_backs",
1702
1688
  placeholder: "Sent back",
@@ -1731,113 +1717,113 @@ function ui({
1731
1717
  placeholder: q("owners", "Owners"),
1732
1718
  type: "combobox",
1733
1719
  multi: !0,
1734
- options: ((d == null ? void 0 : d.available_values.owners) ?? []).map((e) => ({
1720
+ options: ((c == null ? void 0 : c.available_values.owners) ?? []).map((e) => ({
1735
1721
  label: e.name,
1736
1722
  value: e.id
1737
1723
  }))
1738
1724
  },
1739
- ...dt.map((e) => {
1725
+ ...ut.map((e) => {
1740
1726
  var b, m;
1741
- const t = Sn.get(e), n = q(`extra.${e}`, xt(e)), r = { key: `extra.${e}`, placeholder: n }, o = je(e);
1742
- if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
1743
- if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
1727
+ const t = Sn.get(e), n = q(`extra.${e}`, yt(e)), a = { key: `extra.${e}`, placeholder: n }, o = Ue(e);
1728
+ if ((o == null ? void 0 : o.type) === "datetime") return { ...a, type: "date" };
1729
+ if ((o == null ? void 0 : o.type) === "number") return { ...a, type: "number" };
1744
1730
  if ((o == null ? void 0 : o.type) === "boolean")
1745
1731
  return {
1746
- ...r,
1732
+ ...a,
1747
1733
  type: "select",
1748
1734
  options: [
1749
1735
  { label: o.true_label ?? "Yes", value: "bool:true" },
1750
1736
  { label: o.false_label ?? "No", value: "bool:false" }
1751
1737
  ]
1752
1738
  };
1753
- const i = (b = d == null ? void 0 : d.available_values.extra) == null ? void 0 : b[e];
1739
+ const i = (b = c == null ? void 0 : c.available_values.extra) == null ? void 0 : b[e];
1754
1740
  return i != null && i.length ? {
1755
- ...r,
1741
+ ...a,
1756
1742
  type: "combobox",
1757
1743
  multi: !0,
1758
- options: i.map((K) => ({ label: o ? Ue(K, o) : K, value: K }))
1744
+ options: i.map((K) => ({ label: o ? Ge(K, o) : K, value: K }))
1759
1745
  } : (t == null ? void 0 : t.kind) === "relation" ? {
1760
- ...r,
1746
+ ...a,
1761
1747
  type: "combobox",
1762
1748
  multi: !0,
1763
- restricted: !!((m = Re[e]) != null && m.length),
1764
- loadOptions: Aa(t)
1765
- } : { ...r, placeholder: `Search ${n}…`, type: "text" };
1749
+ restricted: !!((m = Oe[e]) != null && m.length),
1750
+ loadOptions: Rr(t)
1751
+ } : { ...a, placeholder: `Search ${n}…`, type: "text" };
1766
1752
  })
1767
- ], Cn = mt.filter(
1768
- (e) => ne.has(e.key) || e.key === "label" || e.key === "owners"
1769
- ), bt = new Set(Object.keys(pe.current)), ol = ((e) => {
1753
+ ], Cn = bt.filter(
1754
+ (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1755
+ ), pt = new Set(Object.keys(pe.current)), ol = ((e) => {
1770
1756
  var n;
1771
- if (e.some((r) => r.key === "state")) return e;
1772
- const t = mt.find((r) => r.key === "state");
1773
- return !t || d && !((n = d.available_values.state) != null && n.length) ? e : [...e, t];
1757
+ if (e.some((a) => a.key === "state")) return e;
1758
+ const t = bt.find((a) => a.key === "state");
1759
+ return !t || c && !((n = c.available_values.state) != null && n.length) ? e : [...e, t];
1774
1760
  })(
1775
1761
  (() => {
1776
1762
  var o;
1777
1763
  const e = (i) => {
1778
- var Q, xe, qe;
1764
+ var Q, xe, Re;
1779
1765
  if (!i.key.startsWith("extra.")) return null;
1780
1766
  if (i.type === "combobox") return i;
1781
- const b = i.key.slice(6), m = Sn.get(b), K = bt.has(i.key);
1767
+ const b = i.key.slice(6), m = Sn.get(b), K = pt.has(i.key);
1782
1768
  if ((m == null ? void 0 : m.kind) !== "relation" && !K) return null;
1783
- const F = je(b), k = (Q = d == null ? void 0 : d.available_values.extra) == null ? void 0 : Q[b], T = i.placeholder.replace(/^Search (.*)…$/, "$1");
1784
- return k != null && k.length ? {
1769
+ const F = Ue(b), y = (Q = c == null ? void 0 : c.available_values.extra) == null ? void 0 : Q[b], R = i.placeholder.replace(/^Search (.*)…$/, "$1");
1770
+ return y != null && y.length ? {
1785
1771
  key: i.key,
1786
- placeholder: T,
1772
+ placeholder: R,
1787
1773
  type: "combobox",
1788
1774
  multi: !0,
1789
- restricted: !!((xe = Re[b]) != null && xe.length),
1790
- options: k.map((_) => ({
1791
- label: F && F.type !== "number" ? Ue(_, F) : _,
1775
+ restricted: !!((xe = Oe[b]) != null && xe.length),
1776
+ options: y.map((_) => ({
1777
+ label: F && F.type !== "number" ? Ge(_, F) : _,
1792
1778
  value: _
1793
1779
  }))
1794
1780
  } : (m == null ? void 0 : m.kind) === "relation" ? {
1795
1781
  key: i.key,
1796
- placeholder: T,
1782
+ placeholder: R,
1797
1783
  type: "combobox",
1798
1784
  multi: !0,
1799
- restricted: !!((qe = Re[b]) != null && qe.length),
1800
- loadOptions: Aa(m)
1785
+ restricted: !!((Re = Oe[b]) != null && Re.length),
1786
+ loadOptions: Rr(m)
1801
1787
  } : null;
1802
1788
  };
1803
- if (Bn.length > 0) {
1789
+ if (jn.length > 0) {
1804
1790
  const i = [], b = /* @__PURE__ */ new Set();
1805
- for (const m of Bn) {
1791
+ for (const m of jn) {
1806
1792
  const K = (m.path ?? []).join(".");
1807
1793
  let F;
1808
1794
  if (m.key === "state" || /(^|_)state$/.test(((o = m.path) == null ? void 0 : o[0]) ?? ""))
1809
- F = mt.find((k) => k.key === "state");
1795
+ F = bt.find((y) => y.key === "state");
1810
1796
  else {
1811
- const k = mt.filter((Q) => {
1812
- var qe;
1797
+ const y = bt.filter((Q) => {
1798
+ var Re;
1813
1799
  if (!Q.key.startsWith("extra.") || b.has(Q.key)) return !1;
1814
1800
  const xe = Q.key.slice(6);
1815
- return ((qe = Sn.get(xe)) == null ? void 0 : qe.target_collection) === m.collection;
1816
- }), T = k.find((Q) => Q.key.slice(6).startsWith(`${K}.`)) ?? k[0];
1817
- F = T ? e(T) : null;
1801
+ return ((Re = Sn.get(xe)) == null ? void 0 : Re.target_collection) === m.collection;
1802
+ }), R = y.find((Q) => Q.key.slice(6).startsWith(`${K}.`)) ?? y[0];
1803
+ F = R ? e(R) : null;
1818
1804
  }
1819
1805
  !F || b.has(F.key) || (b.add(F.key), i.push(m.label ? { ...F, placeholder: m.label } : F));
1820
1806
  }
1821
- for (const m of mt.map(e))
1822
- m && !b.has(m.key) && (bt.has(m.key) || m.restricted) && i.push(m);
1807
+ for (const m of bt.map(e))
1808
+ m && !b.has(m.key) && (pt.has(m.key) || m.restricted) && i.push(m);
1823
1809
  if (i.length > 0) return i;
1824
1810
  }
1825
- const t = Cn.map(e).filter((i) => i !== null), r = [
1826
- ...t.filter((i) => bt.has(i.key) || i.restricted),
1827
- ...t.filter((i) => !bt.has(i.key) && !i.restricted)
1811
+ const t = Cn.map(e).filter((i) => i !== null), a = [
1812
+ ...t.filter((i) => pt.has(i.key) || i.restricted),
1813
+ ...t.filter((i) => !pt.has(i.key) && !i.restricted)
1828
1814
  ].slice(0, 6);
1829
- return r.length > 0 ? r : Cn.filter((i) => i.key === "state" || i.key === "owners");
1815
+ return a.length > 0 ? a : Cn.filter((i) => i.key === "state" || i.key === "owners");
1830
1816
  })()
1831
1817
  ), sl = (() => {
1832
- if (!g) return null;
1833
- const e = J ?? g, t = [
1818
+ if (!x) return null;
1819
+ const e = Y ?? x, t = [
1834
1820
  {
1835
1821
  key: "breached",
1836
1822
  n: e.sla_breached,
1837
1823
  label: "past SLA",
1838
1824
  tone: "text-red-600 dark:text-red-400",
1839
1825
  on: w.sla_status === "breached",
1840
- toggle: () => Le("sla_status", "breached")
1826
+ toggle: () => Pe("sla_status", "breached")
1841
1827
  },
1842
1828
  {
1843
1829
  key: "warning",
@@ -1845,7 +1831,7 @@ function ui({
1845
1831
  label: "SLA soon",
1846
1832
  tone: "text-amber-700 dark:text-amber-400",
1847
1833
  on: w.sla_status === "warning",
1848
- toggle: () => Le("sla_status", "warning")
1834
+ toggle: () => Pe("sla_status", "warning")
1849
1835
  },
1850
1836
  {
1851
1837
  key: "at_risk",
@@ -1853,26 +1839,26 @@ function ui({
1853
1839
  label: "at risk",
1854
1840
  tone: "text-red-600 dark:text-red-400",
1855
1841
  on: w.at_risk === "yes",
1856
- toggle: () => Le("at_risk", "yes")
1842
+ toggle: () => Pe("at_risk", "yes")
1857
1843
  },
1858
1844
  {
1859
1845
  key: "unowned",
1860
1846
  n: e.unowned,
1861
1847
  label: "unowned",
1862
1848
  tone: "text-slate-600 dark:text-slate-300",
1863
- on: x === "unowned",
1849
+ on: g === "unowned",
1864
1850
  toggle: () => {
1865
- Y(x === "unowned" ? "all" : "unowned"), L(1);
1851
+ J(g === "unowned" ? "all" : "unowned"), L(1);
1866
1852
  }
1867
1853
  }
1868
1854
  ].filter((n) => n.n > 0 || n.on);
1869
- return /* @__PURE__ */ c(
1855
+ return /* @__PURE__ */ d(
1870
1856
  "span",
1871
1857
  {
1872
1858
  className: "flex flex-wrap items-center gap-x-2 text-[11px] text-slate-400",
1873
1859
  "data-queue-summary": !0,
1874
1860
  children: [
1875
- t.map((n) => /* @__PURE__ */ c(
1861
+ t.map((n) => /* @__PURE__ */ d(
1876
1862
  "button",
1877
1863
  {
1878
1864
  type: "button",
@@ -1884,81 +1870,81 @@ function ui({
1884
1870
  ),
1885
1871
  "data-queue-summary-item": n.key,
1886
1872
  children: [
1887
- /* @__PURE__ */ a("span", { className: C("font-semibold", n.tone), children: n.n.toLocaleString() }),
1873
+ /* @__PURE__ */ r("span", { className: C("font-semibold", n.tone), children: n.n.toLocaleString() }),
1888
1874
  " ",
1889
1875
  n.label
1890
1876
  ]
1891
1877
  },
1892
1878
  n.key
1893
1879
  )),
1894
- /* @__PURE__ */ c("span", { className: "tabular-nums", "data-queue-summary-total": !0, children: [
1895
- ((d == null ? void 0 : d.total) ?? e.total).toLocaleString(),
1880
+ /* @__PURE__ */ d("span", { className: "tabular-nums", "data-queue-summary-total": !0, children: [
1881
+ ((c == null ? void 0 : c.total) ?? e.total).toLocaleString(),
1896
1882
  " item",
1897
- ((d == null ? void 0 : d.total) ?? e.total) === 1 ? "" : "s"
1883
+ ((c == null ? void 0 : c.total) ?? e.total) === 1 ? "" : "s"
1898
1884
  ] })
1899
1885
  ]
1900
1886
  }
1901
1887
  );
1902
1888
  })();
1903
1889
  function il(e) {
1904
- const t = new Set(ne);
1890
+ const t = new Set(te);
1905
1891
  t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && An((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && An((n) => {
1906
- const r = new Set(n);
1907
- return r.delete(e), r;
1892
+ const a = new Set(n);
1893
+ return a.delete(e), a;
1908
1894
  })), qt([...t]);
1909
1895
  }
1910
- return Nt ? ($ == null ? void 0 : $((Nt == null ? void 0 : Nt.status) ?? 500)) ?? null : /* @__PURE__ */ c("div", { className: "flex flex-1 min-h-0 flex-col", children: [
1911
- /* @__PURE__ */ c("div", { className: "shrink-0", children: [
1912
- (d == null ? void 0 : d.truncated) && /* @__PURE__ */ c("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
1913
- /* @__PURE__ */ a(wl, { className: "h-4 w-4 shrink-0" }),
1914
- /* @__PURE__ */ a("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
1896
+ return St ? ($ == null ? void 0 : $((St == null ? void 0 : St.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
1897
+ /* @__PURE__ */ d("div", { className: "shrink-0", children: [
1898
+ (c == null ? void 0 : c.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
1899
+ /* @__PURE__ */ r(vl, { className: "h-4 w-4 shrink-0" }),
1900
+ /* @__PURE__ */ r("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
1915
1901
  ] }),
1916
- /* @__PURE__ */ c(
1902
+ /* @__PURE__ */ d(
1917
1903
  "div",
1918
1904
  {
1919
1905
  className: "flex flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900",
1920
1906
  "data-queue-toolbar": !0,
1921
1907
  children: [
1922
- re ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: zo.filter((e) => oe || e.value !== "claimed").map(
1923
- (e, t) => /* @__PURE__ */ a(
1908
+ ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ns.filter((e) => oe || e.value !== "claimed").map(
1909
+ (e, t) => /* @__PURE__ */ r(
1924
1910
  "button",
1925
1911
  {
1926
1912
  type: "button",
1927
1913
  onClick: () => {
1928
- Y(e.value), L(1);
1914
+ J(e.value), L(1);
1929
1915
  },
1930
1916
  className: C(
1931
1917
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
1932
1918
  t > 0 && "border-l border-slate-200 dark:border-border",
1933
- x === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
1919
+ g === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
1934
1920
  ),
1935
1921
  children: e.label
1936
1922
  },
1937
1923
  e.value
1938
1924
  )
1939
- ) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1940
- re ? we.length <= 1 ? null : (
1925
+ ) }) : /* @__PURE__ */ r("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1926
+ ae ? _e.length <= 1 ? null : (
1941
1927
  // One allowed view means nothing to switch to — no button.
1942
- /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
1928
+ /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
1943
1929
  { value: "table", label: "Table" },
1944
1930
  { value: "kanban", label: "Kanban" },
1945
1931
  { value: "workload", label: "Workload" }
1946
- ].filter((e) => we.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
1932
+ ].filter((e) => _e.includes(e.value)).map((e, t) => /* @__PURE__ */ r(
1947
1933
  "button",
1948
1934
  {
1949
1935
  type: "button",
1950
- onClick: () => Fe(e.value),
1936
+ onClick: () => Te(e.value),
1951
1937
  className: C(
1952
1938
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
1953
1939
  t > 0 && "border-l border-slate-200 dark:border-border",
1954
- R === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
1940
+ A === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
1955
1941
  ),
1956
1942
  children: e.label
1957
1943
  },
1958
1944
  e.value
1959
1945
  )) })
1960
- ) : /* @__PURE__ */ a("div", { className: "h-8 w-40 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1961
- /* @__PURE__ */ c(
1946
+ ) : /* @__PURE__ */ r("div", { className: "h-8 w-40 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1947
+ /* @__PURE__ */ d(
1962
1948
  "button",
1963
1949
  {
1964
1950
  type: "button",
@@ -1971,12 +1957,12 @@ function ui({
1971
1957
  }),
1972
1958
  className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${w.unseen === "yes" ? "border-nvr-cyan/40 bg-[#f2fdff] text-nvr-navy dark:border-nvr-cyan/40 dark:bg-[#20303a] dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
1973
1959
  children: [
1974
- /* @__PURE__ */ a("span", { className: "h-2 w-2 rounded-full bg-nvr-cyan" }),
1960
+ /* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-full bg-nvr-cyan" }),
1975
1961
  "Unseen changes"
1976
1962
  ]
1977
1963
  }
1978
1964
  ),
1979
- Qe && /* @__PURE__ */ c(
1965
+ je && /* @__PURE__ */ d(
1980
1966
  "button",
1981
1967
  {
1982
1968
  type: "button",
@@ -1988,13 +1974,13 @@ function ui({
1988
1974
  }),
1989
1975
  className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${w.addendums === "active" ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
1990
1976
  children: [
1991
- /* @__PURE__ */ a(_l, { className: "h-3.5 w-3.5" }),
1977
+ /* @__PURE__ */ r(wl, { className: "h-3.5 w-3.5" }),
1992
1978
  "Active addendums"
1993
1979
  ]
1994
1980
  }
1995
1981
  ),
1996
- he && /* @__PURE__ */ a(
1997
- Ao,
1982
+ he && /* @__PURE__ */ r(
1983
+ Lo,
1998
1984
  {
1999
1985
  label: q("integrations", "Integrations"),
2000
1986
  value: w.integrations,
@@ -2004,16 +1990,16 @@ function ui({
2004
1990
  })
2005
1991
  }
2006
1992
  ),
2007
- /* @__PURE__ */ a(Oo, { className: "h-8" }),
2008
- /* @__PURE__ */ a(So, {}),
2009
- Wt > 0 && /* @__PURE__ */ c(
1993
+ /* @__PURE__ */ r(Ko, { className: "h-8" }),
1994
+ /* @__PURE__ */ r(Fo, {}),
1995
+ Wt > 0 && /* @__PURE__ */ d(
2010
1996
  "button",
2011
1997
  {
2012
1998
  type: "button",
2013
- onClick: qr,
1999
+ onClick: qa,
2014
2000
  className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
2015
2001
  children: [
2016
- /* @__PURE__ */ a(Nl, { className: "h-3 w-3" }),
2002
+ /* @__PURE__ */ r(_l, { className: "h-3 w-3" }),
2017
2003
  Wt,
2018
2004
  " update",
2019
2005
  Wt === 1 ? "" : "s",
@@ -2021,9 +2007,9 @@ function ui({
2021
2007
  ]
2022
2008
  }
2023
2009
  ),
2024
- /* @__PURE__ */ c("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
2025
- R === "table" && /* @__PURE__ */ c(Ve, { children: [
2026
- /* @__PURE__ */ a(Ge, { asChild: !0, children: /* @__PURE__ */ c(
2010
+ /* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
2011
+ A === "table" && /* @__PURE__ */ d(We, { children: [
2012
+ /* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
2027
2013
  "button",
2028
2014
  {
2029
2015
  type: "button",
@@ -2032,18 +2018,18 @@ function ui({
2032
2018
  N ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2033
2019
  ),
2034
2020
  children: [
2035
- /* @__PURE__ */ a(Ga, { className: "h-3.5 w-3.5" }),
2036
- N ? `Group: ${((La = Ta.find((e) => e.value === N)) == null ? void 0 : La.label) ?? N}` : "Group"
2021
+ /* @__PURE__ */ r(Vr, { className: "h-3.5 w-3.5" }),
2022
+ N ? `Group: ${((Or = Fr.find((e) => e.value === N)) == null ? void 0 : Or.label) ?? N}` : "Group"
2037
2023
  ]
2038
2024
  }
2039
2025
  ) }),
2040
- /* @__PURE__ */ a(We, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ c(Za, { children: [
2041
- /* @__PURE__ */ a(Mo, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2042
- /* @__PURE__ */ c(er, { children: [
2043
- /* @__PURE__ */ a(Qo, { children: "No attribute found." }),
2044
- /* @__PURE__ */ a(ft, { value: "__none__", onSelect: () => Ye(null), children: "None" }),
2045
- Ta.map((e) => /* @__PURE__ */ a(
2046
- ft,
2026
+ /* @__PURE__ */ r(Je, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Xr, { children: [
2027
+ /* @__PURE__ */ r(Io, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2028
+ /* @__PURE__ */ d(Zr, { children: [
2029
+ /* @__PURE__ */ r(Vo, { children: "No attribute found." }),
2030
+ /* @__PURE__ */ r(gt, { value: "__none__", onSelect: () => Ye(null), children: "None" }),
2031
+ Fr.map((e) => /* @__PURE__ */ r(
2032
+ gt,
2047
2033
  {
2048
2034
  value: e.label,
2049
2035
  onSelect: () => Ye(e.value),
@@ -2054,118 +2040,118 @@ function ui({
2054
2040
  ] })
2055
2041
  ] }) })
2056
2042
  ] }),
2057
- R === "table" && /* @__PURE__ */ c(
2043
+ A === "table" && /* @__PURE__ */ d(
2058
2044
  "button",
2059
2045
  {
2060
2046
  type: "button",
2061
2047
  onClick: () => {
2062
- Te(G === "-priority" ? "" : "-priority"), L(1);
2048
+ Ae(I === "-priority" ? "" : "-priority"), L(1);
2063
2049
  },
2064
2050
  className: C(
2065
2051
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2066
- G === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2052
+ I === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2067
2053
  ),
2068
2054
  children: [
2069
- /* @__PURE__ */ a(Sl, { className: "h-3.5 w-3.5" }),
2055
+ /* @__PURE__ */ r(Nl, { className: "h-3.5 w-3.5" }),
2070
2056
  "Priority"
2071
2057
  ]
2072
2058
  }
2073
2059
  ),
2074
- R === "table" && N && ee && /* @__PURE__ */ a(
2060
+ A === "table" && N && Z && /* @__PURE__ */ r(
2075
2061
  "button",
2076
2062
  {
2077
2063
  type: "button",
2078
- onClick: () => Ut(
2079
- be.size > 0 ? /* @__PURE__ */ new Set() : new Set(ee.map((e) => e.key))
2064
+ onClick: () => It(
2065
+ be.size > 0 ? /* @__PURE__ */ new Set() : new Set(Z.map((e) => e.key))
2080
2066
  ),
2081
2067
  className: "flex h-8 items-center rounded-md px-2 text-[12px] text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
2082
2068
  children: be.size > 0 ? "Expand all" : "Collapse all"
2083
2069
  }
2084
2070
  ),
2085
- R === "kanban" && /* @__PURE__ */ c(Ve, { children: [
2086
- /* @__PURE__ */ a(Ge, { asChild: !0, children: /* @__PURE__ */ c(
2071
+ A === "kanban" && /* @__PURE__ */ d(We, { children: [
2072
+ /* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
2087
2073
  "button",
2088
2074
  {
2089
2075
  type: "button",
2090
2076
  className: C(
2091
2077
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2092
- Je ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2078
+ ze ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2093
2079
  ),
2094
2080
  children: [
2095
- /* @__PURE__ */ a(Ga, { className: "h-3.5 w-3.5" }),
2096
- Je ? `Lanes: ${Je === "collection" ? "Collection" : "Owner"}` : "Lanes"
2081
+ /* @__PURE__ */ r(Vr, { className: "h-3.5 w-3.5" }),
2082
+ ze ? `Lanes: ${ze === "collection" ? "Collection" : "Owner"}` : "Lanes"
2097
2083
  ]
2098
2084
  }
2099
2085
  ) }),
2100
- /* @__PURE__ */ a(We, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Za, { children: /* @__PURE__ */ c(er, { children: [
2101
- /* @__PURE__ */ a(ft, { value: "none", onSelect: () => Vt(null), children: "None" }),
2102
- /* @__PURE__ */ a(ft, { value: "collection", onSelect: () => Vt("collection"), children: "Collection" }),
2103
- /* @__PURE__ */ a(ft, { value: "owner", onSelect: () => Vt("owners"), children: "Owner" })
2086
+ /* @__PURE__ */ r(Je, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(Xr, { children: /* @__PURE__ */ d(Zr, { children: [
2087
+ /* @__PURE__ */ r(gt, { value: "none", onSelect: () => Vt(null), children: "None" }),
2088
+ /* @__PURE__ */ r(gt, { value: "collection", onSelect: () => Vt("collection"), children: "Collection" }),
2089
+ /* @__PURE__ */ r(gt, { value: "owner", onSelect: () => Vt("owners"), children: "Owner" })
2104
2090
  ] }) }) })
2105
2091
  ] }),
2106
- I && s && /* @__PURE__ */ c(
2092
+ U && s && /* @__PURE__ */ d(
2107
2093
  "button",
2108
2094
  {
2109
2095
  type: "button",
2110
- onClick: () => I({ id: s.id, name: s.name }),
2096
+ onClick: () => U({ id: s.id, name: s.name }),
2111
2097
  "data-tip": "Open Ask AI with a question about this queue",
2112
2098
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2113
2099
  "data-queue-ask": !0,
2114
2100
  children: [
2115
- /* @__PURE__ */ a(Cl, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2101
+ /* @__PURE__ */ r(Sl, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2116
2102
  "Ask about this queue"
2117
2103
  ]
2118
2104
  }
2119
2105
  ),
2120
- /* @__PURE__ */ c(
2106
+ /* @__PURE__ */ d(
2121
2107
  "button",
2122
2108
  {
2123
2109
  type: "button",
2124
- onClick: () => pr((e) => !e),
2125
- "aria-expanded": Ze,
2110
+ onClick: () => ba((e) => !e),
2111
+ "aria-expanded": et,
2126
2112
  title: "Trends, aging, pace and states",
2127
2113
  className: C(
2128
2114
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2129
- Ze ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2115
+ et ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2130
2116
  ),
2131
2117
  "data-queue-insights-toggle": !0,
2132
2118
  children: [
2133
- /* @__PURE__ */ a($l, { className: "h-3.5 w-3.5" }),
2119
+ /* @__PURE__ */ r(Cl, { className: "h-3.5 w-3.5" }),
2134
2120
  "Insights"
2135
2121
  ]
2136
2122
  }
2137
2123
  ),
2138
- R === "table" && /* @__PURE__ */ c(Ve, { children: [
2139
- /* @__PURE__ */ a(Ge, { asChild: !0, children: /* @__PURE__ */ c(
2124
+ A === "table" && /* @__PURE__ */ d(We, { children: [
2125
+ /* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
2140
2126
  "button",
2141
2127
  {
2142
2128
  type: "button",
2143
2129
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2144
2130
  children: [
2145
- /* @__PURE__ */ a(ql, { className: "h-3.5 w-3.5" }),
2131
+ /* @__PURE__ */ r($l, { className: "h-3.5 w-3.5" }),
2146
2132
  "Columns"
2147
2133
  ]
2148
2134
  }
2149
2135
  ) }),
2150
- /* @__PURE__ */ a(We, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
2136
+ /* @__PURE__ */ r(Je, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
2151
2137
  bl,
2152
2138
  {
2153
2139
  sensors: tl,
2154
2140
  collisionDetection: pl,
2155
2141
  onDragEnd: nl,
2156
- children: /* @__PURE__ */ a(
2142
+ children: /* @__PURE__ */ r(
2157
2143
  hl,
2158
2144
  {
2159
- items: Be,
2145
+ items: Ie,
2160
2146
  strategy: fl,
2161
- children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: Be.map((e) => {
2162
- const t = qa.find((n) => n.key === e);
2163
- return /* @__PURE__ */ a(
2164
- as,
2147
+ children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: Ie.map((e) => {
2148
+ const t = $r.find((n) => n.key === e);
2149
+ return /* @__PURE__ */ r(
2150
+ is,
2165
2151
  {
2166
2152
  id: e,
2167
2153
  label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2168
- checked: ne.has(e),
2154
+ checked: te.has(e),
2169
2155
  onCheckedChange: () => il(e)
2170
2156
  },
2171
2157
  e
@@ -2176,56 +2162,56 @@ function ui({
2176
2162
  }
2177
2163
  ) })
2178
2164
  ] }),
2179
- R === "table" && /* @__PURE__ */ a(
2165
+ A === "table" && /* @__PURE__ */ r(
2180
2166
  "button",
2181
2167
  {
2182
2168
  type: "button",
2183
2169
  onClick: () => {
2184
- const e = yt === "compact" ? "comfortable" : "compact";
2185
- nr(e);
2170
+ const e = kt === "compact" ? "comfortable" : "compact";
2171
+ ta(e);
2186
2172
  try {
2187
2173
  localStorage.setItem("nvr_table_density", e);
2188
2174
  } catch {
2189
2175
  }
2190
2176
  },
2191
2177
  "aria-label": "Row density",
2192
- title: yt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2178
+ title: kt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2193
2179
  className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 shadow-sm hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted",
2194
- children: yt === "compact" ? /* @__PURE__ */ a(Fl, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(Tl, { className: "h-3.5 w-3.5" })
2180
+ children: kt === "compact" ? /* @__PURE__ */ r(ql, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Fl, { className: "h-3.5 w-3.5" })
2195
2181
  }
2196
2182
  ),
2197
- R === "table" && sr && te.length > 0 && /* @__PURE__ */ c(
2183
+ A === "table" && oa && ee.length > 0 && /* @__PURE__ */ d(
2198
2184
  "button",
2199
2185
  {
2200
2186
  type: "button",
2201
- onClick: () => ma(),
2187
+ onClick: () => ur(),
2202
2188
  className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110",
2203
2189
  children: [
2204
- /* @__PURE__ */ a(Al, { className: "h-3 w-3 fill-current" }),
2190
+ /* @__PURE__ */ r(Rl, { className: "h-3 w-3 fill-current" }),
2205
2191
  "Work Next"
2206
2192
  ]
2207
2193
  }
2208
2194
  ),
2209
- !zt && z.length === 1 && (St ? /* @__PURE__ */ c(Ve, { children: [
2210
- /* @__PURE__ */ a(Ge, { asChild: !0, children: /* @__PURE__ */ c(
2195
+ !Xt && z.length === 1 && (Ct ? /* @__PURE__ */ d(We, { children: [
2196
+ /* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
2211
2197
  "button",
2212
2198
  {
2213
2199
  type: "button",
2214
2200
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2215
2201
  children: [
2216
- /* @__PURE__ */ a(Bt, { className: "h-3.5 w-3.5" }),
2202
+ /* @__PURE__ */ r(jt, { className: "h-3.5 w-3.5" }),
2217
2203
  "New ",
2218
2204
  qn(z[0]),
2219
- /* @__PURE__ */ a(Wa, { className: "h-3 w-3 opacity-60" })
2205
+ /* @__PURE__ */ r(Gr, { className: "h-3 w-3 opacity-60" })
2220
2206
  ]
2221
2207
  }
2222
2208
  ) }),
2223
- /* @__PURE__ */ c(We, { align: "end", className: "w-60 p-1", children: [
2224
- /* @__PURE__ */ c(
2209
+ /* @__PURE__ */ d(Je, { align: "end", className: "w-60 p-1", children: [
2210
+ /* @__PURE__ */ d(
2225
2211
  "button",
2226
2212
  {
2227
2213
  type: "button",
2228
- onClick: () => V.open({
2214
+ onClick: () => W.open({
2229
2215
  collection: z[0],
2230
2216
  itemId: "new",
2231
2217
  // Same layout the queue opens existing records with.
@@ -2233,16 +2219,16 @@ function ui({
2233
2219
  }),
2234
2220
  className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2235
2221
  children: [
2236
- ((Da = St.active) == null ? void 0 : Da.create_label) ?? ((Pa = St.active) == null ? void 0 : Pa.name) ?? "Default layout",
2237
- /* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2222
+ ((Lr = Ct.active) == null ? void 0 : Lr.create_label) ?? ((Dr = Ct.active) == null ? void 0 : Dr.name) ?? "Default layout",
2223
+ /* @__PURE__ */ r("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2238
2224
  ]
2239
2225
  }
2240
2226
  ),
2241
- St.options.map((e) => /* @__PURE__ */ a(
2227
+ Ct.options.map((e) => /* @__PURE__ */ r(
2242
2228
  "button",
2243
2229
  {
2244
2230
  type: "button",
2245
- onClick: () => V.open({
2231
+ onClick: () => W.open({
2246
2232
  collection: z[0],
2247
2233
  itemId: "new",
2248
2234
  layoutSlug: e.slug
@@ -2253,11 +2239,11 @@ function ui({
2253
2239
  e.id
2254
2240
  ))
2255
2241
  ] })
2256
- ] }) : /* @__PURE__ */ c(
2242
+ ] }) : /* @__PURE__ */ d(
2257
2243
  "button",
2258
2244
  {
2259
2245
  type: "button",
2260
- onClick: () => V.open({
2246
+ onClick: () => W.open({
2261
2247
  collection: z[0],
2262
2248
  itemId: "new",
2263
2249
  // Open a new record on the same layout the queue opens
@@ -2266,48 +2252,48 @@ function ui({
2266
2252
  }),
2267
2253
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2268
2254
  children: [
2269
- /* @__PURE__ */ a(Bt, { className: "h-3.5 w-3.5" }),
2255
+ /* @__PURE__ */ r(jt, { className: "h-3.5 w-3.5" }),
2270
2256
  "New ",
2271
2257
  qn(z[0])
2272
2258
  ]
2273
2259
  }
2274
2260
  )),
2275
- !zt && z.length > 1 && /* @__PURE__ */ c(Ve, { children: [
2276
- /* @__PURE__ */ a(Ge, { asChild: !0, children: /* @__PURE__ */ c(
2261
+ !Xt && z.length > 1 && /* @__PURE__ */ d(We, { children: [
2262
+ /* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
2277
2263
  "button",
2278
2264
  {
2279
2265
  type: "button",
2280
2266
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2281
2267
  children: [
2282
- /* @__PURE__ */ a(Bt, { className: "h-3.5 w-3.5" }),
2268
+ /* @__PURE__ */ r(jt, { className: "h-3.5 w-3.5" }),
2283
2269
  "New",
2284
- /* @__PURE__ */ a(Wa, { className: "h-3 w-3 opacity-60" })
2270
+ /* @__PURE__ */ r(Gr, { className: "h-3 w-3 opacity-60" })
2285
2271
  ]
2286
2272
  }
2287
2273
  ) }),
2288
- /* @__PURE__ */ a(We, { align: "end", className: "w-56 p-1", children: z.map((e) => /* @__PURE__ */ c(
2274
+ /* @__PURE__ */ r(Je, { align: "end", className: "w-56 p-1", children: z.map((e) => /* @__PURE__ */ d(
2289
2275
  "button",
2290
2276
  {
2291
2277
  type: "button",
2292
- onClick: () => V.open({
2278
+ onClick: () => W.open({
2293
2279
  collection: e,
2294
2280
  itemId: "new",
2295
2281
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
2296
2282
  }),
2297
2283
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2298
2284
  children: [
2299
- /* @__PURE__ */ a(Bt, { className: "h-3 w-3 opacity-60" }),
2285
+ /* @__PURE__ */ r(jt, { className: "h-3 w-3 opacity-60" }),
2300
2286
  qn(e)
2301
2287
  ]
2302
2288
  },
2303
2289
  e
2304
2290
  )) })
2305
2291
  ] }),
2306
- !zt && Ee && me && /* @__PURE__ */ a(
2307
- qo,
2292
+ !Xt && Le && me && /* @__PURE__ */ r(
2293
+ Ao,
2308
2294
  {
2309
- collection: Ee,
2310
- onParsed: (e, t) => me(`/collections/${Ee}/new`, {
2295
+ collection: Le,
2296
+ onParsed: (e, t) => me(`/collections/${Le}/new`, {
2311
2297
  state: { importResult: e, importTemplateId: t.id }
2312
2298
  })
2313
2299
  }
@@ -2316,96 +2302,96 @@ function ui({
2316
2302
  ]
2317
2303
  }
2318
2304
  ),
2319
- Ze && /* @__PURE__ */ c(
2305
+ et && /* @__PURE__ */ d(
2320
2306
  "div",
2321
2307
  {
2322
2308
  className: "flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-slate-100 bg-white px-4 py-2.5 dark:border-slate-800 dark:bg-slate-900",
2323
2309
  "data-queue-insights": !0,
2324
2310
  children: [
2325
- /* @__PURE__ */ c("div", { className: "nvr-stagger-direct flex divide-x divide-slate-200 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
2326
- /* @__PURE__ */ a(
2327
- gt,
2311
+ /* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex divide-x divide-slate-200 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
2312
+ /* @__PURE__ */ r(
2313
+ xt,
2328
2314
  {
2329
2315
  label: "Total",
2330
- count: (g == null ? void 0 : g.total) ?? 0,
2331
- filteredCount: J ? J.total : null,
2332
- active: Object.values(w).every(mr) && x === "all",
2333
- isLoading: De,
2334
- ...nt("total"),
2335
- onClick: br
2316
+ count: (x == null ? void 0 : x.total) ?? 0,
2317
+ filteredCount: Y ? Y.total : null,
2318
+ active: Object.values(w).every(ua) && g === "all",
2319
+ isLoading: Ke,
2320
+ ...rt("total"),
2321
+ onClick: ma
2336
2322
  }
2337
2323
  ),
2338
- /* @__PURE__ */ a(
2339
- gt,
2324
+ /* @__PURE__ */ r(
2325
+ xt,
2340
2326
  {
2341
2327
  label: "Warning",
2342
- count: (g == null ? void 0 : g.sla_warning) ?? 0,
2343
- filteredCount: J ? J.sla_warning : null,
2328
+ count: (x == null ? void 0 : x.sla_warning) ?? 0,
2329
+ filteredCount: Y ? Y.sla_warning : null,
2344
2330
  tone: "amber",
2345
2331
  active: w.sla_status === "warning",
2346
- isLoading: De,
2332
+ isLoading: Ke,
2347
2333
  deltaBadIsUp: !0,
2348
- ...nt("sla_warning"),
2349
- onClick: () => Le("sla_status", "warning")
2334
+ ...rt("sla_warning"),
2335
+ onClick: () => Pe("sla_status", "warning")
2350
2336
  }
2351
2337
  ),
2352
- /* @__PURE__ */ a(
2353
- gt,
2338
+ /* @__PURE__ */ r(
2339
+ xt,
2354
2340
  {
2355
2341
  label: "Breached",
2356
- count: (g == null ? void 0 : g.sla_breached) ?? 0,
2357
- filteredCount: J ? J.sla_breached : null,
2342
+ count: (x == null ? void 0 : x.sla_breached) ?? 0,
2343
+ filteredCount: Y ? Y.sla_breached : null,
2358
2344
  tone: "red",
2359
2345
  active: w.sla_status === "breached",
2360
- isLoading: De,
2346
+ isLoading: Ke,
2361
2347
  deltaBadIsUp: !0,
2362
- ...nt("sla_breached"),
2363
- onClick: () => Le("sla_status", "breached")
2348
+ ...rt("sla_breached"),
2349
+ onClick: () => Pe("sla_status", "breached")
2364
2350
  }
2365
2351
  ),
2366
- /* @__PURE__ */ a(
2367
- gt,
2352
+ /* @__PURE__ */ r(
2353
+ xt,
2368
2354
  {
2369
2355
  label: "At Risk",
2370
- count: (g == null ? void 0 : g.at_risk) ?? 0,
2371
- filteredCount: J ? J.at_risk : null,
2356
+ count: (x == null ? void 0 : x.at_risk) ?? 0,
2357
+ filteredCount: Y ? Y.at_risk : null,
2372
2358
  tone: "red",
2373
2359
  active: w.at_risk === "yes",
2374
- isLoading: De,
2360
+ isLoading: Ke,
2375
2361
  deltaBadIsUp: !0,
2376
- ...nt("at_risk"),
2377
- onClick: () => Le("at_risk", "yes")
2362
+ ...rt("at_risk"),
2363
+ onClick: () => Pe("at_risk", "yes")
2378
2364
  }
2379
2365
  ),
2380
- /* @__PURE__ */ a(
2381
- gt,
2366
+ /* @__PURE__ */ r(
2367
+ xt,
2382
2368
  {
2383
2369
  label: "Unowned",
2384
- count: (g == null ? void 0 : g.unowned) ?? 0,
2385
- filteredCount: J ? J.unowned : null,
2386
- active: x === "unowned",
2387
- isLoading: De,
2370
+ count: (x == null ? void 0 : x.unowned) ?? 0,
2371
+ filteredCount: Y ? Y.unowned : null,
2372
+ active: g === "unowned",
2373
+ isLoading: Ke,
2388
2374
  deltaBadIsUp: !0,
2389
- ...nt("unowned"),
2375
+ ...rt("unowned"),
2390
2376
  onClick: () => {
2391
- Y(x === "unowned" ? "all" : "unowned"), L(1);
2377
+ J(g === "unowned" ? "all" : "unowned"), L(1);
2392
2378
  }
2393
2379
  }
2394
2380
  )
2395
2381
  ] }),
2396
- (g == null ? void 0 : g.aging) && g.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
2397
- ["0-1d", "0:24", g.aging.d1],
2398
- ["1-3d", "24:72", g.aging.d3],
2399
- ["3-7d", "72:168", g.aging.d7],
2400
- ["7d+", "168:", g.aging.over]
2401
- ].map(([e, t, n]) => /* @__PURE__ */ c(
2382
+ (x == null ? void 0 : x.aging) && x.total > 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
2383
+ ["0-1d", "0:24", x.aging.d1],
2384
+ ["1-3d", "24:72", x.aging.d3],
2385
+ ["3-7d", "72:168", x.aging.d7],
2386
+ ["7d+", "168:", x.aging.over]
2387
+ ].map(([e, t, n]) => /* @__PURE__ */ d(
2402
2388
  "button",
2403
2389
  {
2404
2390
  type: "button",
2405
2391
  onClick: () => {
2406
- M((r) => ({
2407
- ...r,
2408
- aging_hours: r.aging_hours === t ? "" : t
2392
+ M((a) => ({
2393
+ ...a,
2394
+ aging_hours: a.aging_hours === t ? "" : t
2409
2395
  })), L(1);
2410
2396
  },
2411
2397
  className: C(
@@ -2421,13 +2407,13 @@ function ui({
2421
2407
  },
2422
2408
  e
2423
2409
  )) }),
2424
- de && /* @__PURE__ */ a(
2410
+ de && /* @__PURE__ */ r(
2425
2411
  "span",
2426
2412
  {
2427
2413
  "data-queue-burndown": !0,
2428
2414
  className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${de.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : de.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
2429
2415
  "data-tip": "Average net change per day over the last 14 days of snapshots",
2430
- children: de.dir === "down" ? /* @__PURE__ */ c(ke, { children: [
2416
+ children: de.dir === "down" ? /* @__PURE__ */ d(ke, { children: [
2431
2417
  "▼ ",
2432
2418
  Math.abs(de.pace).toFixed(1),
2433
2419
  "/day — clears in ~",
@@ -2435,24 +2421,24 @@ function ui({
2435
2421
  " day",
2436
2422
  de.days === 1 ? "" : "s",
2437
2423
  " at this pace"
2438
- ] }) : de.dir === "up" ? /* @__PURE__ */ c(ke, { children: [
2424
+ ] }) : de.dir === "up" ? /* @__PURE__ */ d(ke, { children: [
2439
2425
  "▲ Growing ",
2440
2426
  de.pace.toFixed(1),
2441
2427
  "/day"
2442
- ] }) : /* @__PURE__ */ a(ke, { children: "→ Holding steady" })
2428
+ ] }) : /* @__PURE__ */ r(ke, { children: "→ Holding steady" })
2443
2429
  }
2444
2430
  ),
2445
- da.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: da.map(([e, t]) => {
2431
+ cr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: cr.map(([e, t]) => {
2446
2432
  var n;
2447
- return /* @__PURE__ */ a(
2448
- ns,
2433
+ return /* @__PURE__ */ r(
2434
+ ss,
2449
2435
  {
2450
- label: Ne(e),
2436
+ label: Ce(e),
2451
2437
  count: t,
2452
- filteredCount: J ? J.by_state[e] ?? 0 : null,
2438
+ filteredCount: Y ? Y.by_state[e] ?? 0 : null,
2453
2439
  color: ((n = fe[e]) == null ? void 0 : n.color) ?? null,
2454
- active: ur.includes(e),
2455
- onClick: () => dr(e)
2440
+ active: da.includes(e),
2441
+ onClick: () => ca(e)
2456
2442
  },
2457
2443
  e
2458
2444
  );
@@ -2460,12 +2446,12 @@ function ui({
2460
2446
  ]
2461
2447
  }
2462
2448
  ),
2463
- R !== "workload" && /* @__PURE__ */ a(
2464
- Wo,
2449
+ A !== "workload" && /* @__PURE__ */ r(
2450
+ Xo,
2465
2451
  {
2466
2452
  defs: ol,
2467
2453
  values: w,
2468
- seededKeys: bt,
2454
+ seededKeys: pt,
2469
2455
  onApply: (e) => {
2470
2456
  M((t) => ({ ...t, ...e })), L(1);
2471
2457
  },
@@ -2475,13 +2461,13 @@ function ui({
2475
2461
  right: sl
2476
2462
  }
2477
2463
  ),
2478
- /* @__PURE__ */ c(
2464
+ /* @__PURE__ */ d(
2479
2465
  "div",
2480
2466
  {
2481
2467
  className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
2482
2468
  "data-queue-saved-views": !0,
2483
2469
  children: [
2484
- Array.isArray(w.owners) && w.owners.length > 0 && /* @__PURE__ */ c(
2470
+ Array.isArray(w.owners) && w.owners.length > 0 && /* @__PURE__ */ d(
2485
2471
  "span",
2486
2472
  {
2487
2473
  "data-queue-owner-filter": !0,
@@ -2492,12 +2478,12 @@ function ui({
2492
2478
  w.owners.map(
2493
2479
  (e) => {
2494
2480
  var t, n;
2495
- return ((n = (t = d == null ? void 0 : d.available_values.owners) == null ? void 0 : t.find(
2496
- (r) => String(r.id).toUpperCase() === String(e).toUpperCase()
2481
+ return ((n = (t = c == null ? void 0 : c.available_values.owners) == null ? void 0 : t.find(
2482
+ (a) => String(a.id).toUpperCase() === String(e).toUpperCase()
2497
2483
  )) == null ? void 0 : n.name) ?? "someone";
2498
2484
  }
2499
2485
  ).join(", "),
2500
- /* @__PURE__ */ a(
2486
+ /* @__PURE__ */ r(
2501
2487
  "button",
2502
2488
  {
2503
2489
  type: "button",
@@ -2516,104 +2502,104 @@ function ui({
2516
2502
  ]
2517
2503
  }
2518
2504
  ),
2519
- !((U == null ? void 0 : U.data) ?? []).some((e) => e.is_default) && /* @__PURE__ */ a(
2505
+ !((V == null ? void 0 : V.data) ?? []).some((e) => e.is_default) && /* @__PURE__ */ r(
2520
2506
  "button",
2521
2507
  {
2522
2508
  type: "button",
2523
- onClick: Mr,
2509
+ onClick: Ma,
2524
2510
  title: "Revert to the queue default (filters, columns and sort cleared)",
2525
2511
  className: C(
2526
2512
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
2527
- st == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2513
+ it == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2528
2514
  ),
2529
2515
  children: "Default"
2530
2516
  }
2531
2517
  ),
2532
- ((U == null ? void 0 : U.data) ?? []).map((e) => {
2518
+ ((V == null ? void 0 : V.data) ?? []).map((e) => {
2533
2519
  var t;
2534
- return /* @__PURE__ */ c(
2520
+ return /* @__PURE__ */ d(
2535
2521
  "span",
2536
2522
  {
2537
2523
  className: C(
2538
2524
  "group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
2539
- st === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2525
+ it === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2540
2526
  ),
2541
2527
  children: [
2542
- /* @__PURE__ */ a(
2528
+ /* @__PURE__ */ r(
2543
2529
  "button",
2544
2530
  {
2545
2531
  type: "button",
2546
- title: Me === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2547
- onClick: () => Br.mutate(Me === e.id ? null : e.id),
2532
+ title: Be === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2533
+ onClick: () => ja.mutate(Be === e.id ? null : e.id),
2548
2534
  className: C(
2549
2535
  "shrink-0",
2550
- Me === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2536
+ Be === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2551
2537
  ),
2552
- children: /* @__PURE__ */ a(
2553
- Rl,
2538
+ children: /* @__PURE__ */ r(
2539
+ Tl,
2554
2540
  {
2555
- className: C("h-3 w-3", Me === e.id && "fill-current"),
2556
- "aria-label": Me === e.id ? "Default view" : "Set as default"
2541
+ className: C("h-3 w-3", Be === e.id && "fill-current"),
2542
+ "aria-label": Be === e.id ? "Default view" : "Set as default"
2557
2543
  }
2558
2544
  )
2559
2545
  }
2560
2546
  ),
2561
- /* @__PURE__ */ c("button", { type: "button", onClick: () => Lt(e), children: [
2547
+ /* @__PURE__ */ d("button", { type: "button", onClick: () => Lt(e), children: [
2562
2548
  e.name,
2563
- e.is_default ? /* @__PURE__ */ a("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ a("span", { className: "ml-1 text-slate-400", children: "· shared" })
2549
+ e.is_default ? /* @__PURE__ */ r("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-400", children: "· shared" })
2564
2550
  ] }),
2565
- ga && /* @__PURE__ */ a(
2551
+ fr && /* @__PURE__ */ r(
2566
2552
  "button",
2567
2553
  {
2568
2554
  type: "button",
2569
- onClick: () => Qr.mutate({ viewId: e.id, on: !e.is_default }),
2555
+ onClick: () => Qa.mutate({ viewId: e.id, on: !e.is_default }),
2570
2556
  title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
2571
2557
  className: C(
2572
2558
  "shrink-0",
2573
2559
  e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2574
2560
  ),
2575
2561
  "aria-label": e.is_default ? "Unset queue default" : "Set queue default",
2576
- children: /* @__PURE__ */ a(El, { className: C("h-3 w-3", e.is_default && "fill-current") })
2562
+ children: /* @__PURE__ */ r(Al, { className: C("h-3 w-3", e.is_default && "fill-current") })
2577
2563
  }
2578
2564
  ),
2579
- (e.user === v || Kt) && st === e.id && /* @__PURE__ */ a(
2565
+ (e.user === v || Kt) && it === e.id && /* @__PURE__ */ r(
2580
2566
  "button",
2581
2567
  {
2582
2568
  type: "button",
2583
- onClick: () => Ce.mutate(e),
2584
- disabled: Ce.isPending,
2569
+ onClick: () => qe.mutate(e),
2570
+ disabled: qe.isPending,
2585
2571
  title: "Update this view with the current filters, scope and sort",
2586
2572
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2587
2573
  "aria-label": `Update view ${e.name}`,
2588
- "data-view-update-state": Ce.isPending ? "saving" : ya === e.id ? "saved" : "idle",
2589
- children: Ce.isPending && ((t = Ce.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(Ol, { className: "h-3 w-3 animate-spin" }) : ya === e.id ? /* @__PURE__ */ a(
2590
- Ll,
2574
+ "data-view-update-state": qe.isPending ? "saving" : xr === e.id ? "saved" : "idle",
2575
+ children: qe.isPending && ((t = qe.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(El, { className: "h-3 w-3 animate-spin" }) : xr === e.id ? /* @__PURE__ */ r(
2576
+ Ol,
2591
2577
  {
2592
2578
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
2593
2579
  strokeWidth: 3
2594
2580
  }
2595
- ) : /* @__PURE__ */ a(Dl, { className: "h-3 w-3" })
2581
+ ) : /* @__PURE__ */ r(Ll, { className: "h-3 w-3" })
2596
2582
  }
2597
2583
  ),
2598
- st === e.id && /* @__PURE__ */ a(
2584
+ it === e.id && /* @__PURE__ */ r(
2599
2585
  "button",
2600
2586
  {
2601
2587
  type: "button",
2602
- onClick: () => fr(e.id),
2588
+ onClick: () => ha(e.id),
2603
2589
  title: $t(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2604
2590
  className: C(
2605
2591
  "shrink-0",
2606
2592
  $t(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2607
2593
  ),
2608
2594
  "aria-label": `Subscribe to view ${e.name}`,
2609
- children: /* @__PURE__ */ a(Pl, { className: C("h-3 w-3", $t(e.id) && "fill-current") })
2595
+ children: /* @__PURE__ */ r(Dl, { className: C("h-3 w-3", $t(e.id) && "fill-current") })
2610
2596
  }
2611
2597
  ),
2612
- e.user === v && /* @__PURE__ */ a(
2598
+ e.user === v && /* @__PURE__ */ r(
2613
2599
  "button",
2614
2600
  {
2615
2601
  type: "button",
2616
- onClick: () => jr.mutate(e.id),
2602
+ onClick: () => Ba.mutate(e.id),
2617
2603
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
2618
2604
  "aria-label": `Delete view ${e.name}`,
2619
2605
  children: "×"
@@ -2624,8 +2610,8 @@ function ui({
2624
2610
  e.id
2625
2611
  );
2626
2612
  }),
2627
- /* @__PURE__ */ c(Ve, { open: Kr, onOpenChange: kn, children: [
2628
- /* @__PURE__ */ a(Ge, { asChild: !0, children: /* @__PURE__ */ a(
2613
+ /* @__PURE__ */ d(We, { open: Ka, onOpenChange: kn, children: [
2614
+ /* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ r(
2629
2615
  "button",
2630
2616
  {
2631
2617
  type: "button",
@@ -2634,16 +2620,16 @@ function ui({
2634
2620
  children: "☆ Save view"
2635
2621
  }
2636
2622
  ) }),
2637
- /* @__PURE__ */ c(We, { className: "w-[240px] p-3", align: "end", children: [
2623
+ /* @__PURE__ */ d(Je, { className: "w-[240px] p-3", align: "end", children: [
2638
2624
  (() => {
2639
- const e = U == null ? void 0 : U.data.find((t) => t.id === st);
2640
- return !e || e.user !== v && !Kt ? null : /* @__PURE__ */ c(
2625
+ const e = V == null ? void 0 : V.data.find((t) => t.id === it);
2626
+ return !e || e.user !== v && !Kt ? null : /* @__PURE__ */ d(
2641
2627
  "button",
2642
2628
  {
2643
2629
  type: "button",
2644
- disabled: Ce.isPending,
2630
+ disabled: qe.isPending,
2645
2631
  onClick: () => {
2646
- Ce.mutate(e), kn(!1);
2632
+ qe.mutate(e), kn(!1);
2647
2633
  },
2648
2634
  className: "mb-2 w-full rounded-md border border-nvr-cyan/40 bg-nvr-cyan/5 px-2 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 disabled:opacity-50 dark:text-nvr-cyan",
2649
2635
  children: [
@@ -2654,42 +2640,42 @@ function ui({
2654
2640
  }
2655
2641
  );
2656
2642
  })(),
2657
- /* @__PURE__ */ a(
2643
+ /* @__PURE__ */ r(
2658
2644
  "input",
2659
2645
  {
2660
2646
  value: vn,
2661
- onChange: (e) => ba(e.target.value),
2647
+ onChange: (e) => mr(e.target.value),
2662
2648
  placeholder: "View name",
2663
2649
  className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
2664
2650
  }
2665
2651
  ),
2666
- /* @__PURE__ */ c("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2667
- /* @__PURE__ */ a(
2668
- Tn,
2652
+ /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2653
+ /* @__PURE__ */ r(
2654
+ Rn,
2669
2655
  {
2670
- checked: pa || ct,
2671
- disabled: ct,
2672
- onCheckedChange: (e) => ha(e === !0)
2656
+ checked: br || dt,
2657
+ disabled: dt,
2658
+ onCheckedChange: (e) => pr(e === !0)
2673
2659
  }
2674
2660
  ),
2675
2661
  "Share with everyone"
2676
2662
  ] }),
2677
- ga && /* @__PURE__ */ c("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2678
- /* @__PURE__ */ a(
2679
- Tn,
2663
+ fr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2664
+ /* @__PURE__ */ r(
2665
+ Rn,
2680
2666
  {
2681
- checked: ct,
2682
- onCheckedChange: (e) => fa(e === !0)
2667
+ checked: dt,
2668
+ onCheckedChange: (e) => hr(e === !0)
2683
2669
  }
2684
2670
  ),
2685
2671
  "Set as queue default (everyone starts here)"
2686
2672
  ] }),
2687
- /* @__PURE__ */ a(
2673
+ /* @__PURE__ */ r(
2688
2674
  "button",
2689
2675
  {
2690
2676
  type: "button",
2691
- disabled: !vn.trim() || xa.isPending,
2692
- onClick: () => xa.mutate(),
2677
+ disabled: !vn.trim() || gr.isPending,
2678
+ onClick: () => gr.mutate(),
2693
2679
  className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
2694
2680
  children: "Save current view"
2695
2681
  }
@@ -2700,68 +2686,68 @@ function ui({
2700
2686
  }
2701
2687
  )
2702
2688
  ] }),
2703
- /* @__PURE__ */ a("div", { ref: Dt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: R === "table" ? /* @__PURE__ */ a(ke, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ c(
2689
+ /* @__PURE__ */ r("div", { ref: Dt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: A === "table" ? /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2704
2690
  "div",
2705
2691
  {
2706
- ref: ve.rootRef,
2692
+ ref: we.rootRef,
2707
2693
  className: C(
2708
2694
  "relative min-w-0 flex-1 transition-opacity duration-200",
2709
- Yn && "pointer-events-none opacity-60"
2695
+ Hn && "pointer-events-none opacity-60"
2710
2696
  ),
2711
- "aria-busy": Yn || void 0,
2697
+ "aria-busy": Hn || void 0,
2712
2698
  children: [
2713
- Jn != null && /* @__PURE__ */ c("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2699
+ Jn != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2714
2700
  "Still working — ",
2715
2701
  Jn,
2716
2702
  "s"
2717
2703
  ] }),
2718
- /* @__PURE__ */ a(
2719
- _o,
2704
+ /* @__PURE__ */ r(
2705
+ $o,
2720
2706
  {
2721
2707
  fillHeight: !0,
2722
- enterKey: ea.current,
2723
- density: yt,
2708
+ enterKey: Zn.current,
2709
+ density: kt,
2724
2710
  minBodyHeight: 360,
2725
2711
  columns: Qt,
2726
2712
  rows: S,
2727
2713
  rowKey: (e) => `${e.collection}:${e.item_id}`,
2728
- total: (d == null ? void 0 : d.total) ?? 0,
2729
- page: He,
2730
- limit: Pn,
2731
- isLoading: De,
2714
+ total: (c == null ? void 0 : c.total) ?? 0,
2715
+ page: ve,
2716
+ limit: zt,
2717
+ isLoading: Ke,
2732
2718
  onPageChange: L,
2733
2719
  onRowClick: (e) => Ot(e),
2734
- rowDragProps: (e) => Cr({ collection: e.collection, id: e.item_id }),
2720
+ rowDragProps: (e) => Ca({ collection: e.collection, id: e.item_id }),
2735
2721
  onRowContextMenu: (e, t) => {
2736
- t.preventDefault(), ot({ x: t.clientX, y: t.clientY, row: e });
2722
+ t.preventDefault(), st({ x: t.clientX, y: t.clientY, row: e });
2737
2723
  },
2738
2724
  rowTitle: (e) => {
2739
- const t = At.get(D(e));
2740
- return ve.titleFor(D(e)) ?? (t && !t.is_mine ? eo(t) : void 0);
2725
+ const t = Tt.get(D(e));
2726
+ return we.titleFor(D(e)) ?? (t && !t.is_mine ? no(t) : void 0);
2741
2727
  },
2742
- rowClassName: (e) => Rt === D(e) ? (
2728
+ rowClassName: (e) => At === D(e) ? (
2743
2729
  // Pinned sticky cells use bg-inherit — the highlight must be
2744
2730
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
2745
2731
  // scrolled content bleeds through the pinned columns. Same
2746
2732
  // pair DataTable uses for selected rows when pins are active.
2747
2733
  "bg-[#f2fdff] dark:bg-[#20303a]"
2748
- ) : e.at_risk ? so(e.at_risk_color ?? "red") : void 0,
2749
- emptyMessage: /* @__PURE__ */ a(
2750
- No,
2734
+ ) : e.at_risk ? mo(e.at_risk_color ?? "red") : void 0,
2735
+ emptyMessage: /* @__PURE__ */ r(
2736
+ qo,
2751
2737
  {
2752
- icon: Kl,
2753
- title: ((Ka = d == null ? void 0 : d.empty) == null ? void 0 : Ka.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Ma = d == null ? void 0 : d.empty) == null ? void 0 : Ma.reason) === "scope_mine" ? "Nothing waiting on you" : ((Qa = d == null ? void 0 : d.empty) == null ? void 0 : Qa.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2754
- detail: ((ja = d == null ? void 0 : d.empty) == null ? void 0 : ja.reason) === "filters" ? x !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((Ba = d == null ? void 0 : d.empty) == null ? void 0 : Ba.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2755
- action: ((Ia = d == null ? void 0 : d.empty) == null ? void 0 : Ia.reason) === "filters" ? /* @__PURE__ */ c("div", { className: "flex items-center justify-center gap-2", children: [
2756
- /* @__PURE__ */ a(
2738
+ icon: Pl,
2739
+ title: ((Pr = c == null ? void 0 : c.empty) == null ? void 0 : Pr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Kr = c == null ? void 0 : c.empty) == null ? void 0 : Kr.reason) === "scope_mine" ? "Nothing waiting on you" : ((Mr = c == null ? void 0 : c.empty) == null ? void 0 : Mr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2740
+ detail: ((Qr = c == null ? void 0 : c.empty) == null ? void 0 : Qr.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((Br = c == null ? void 0 : c.empty) == null ? void 0 : Br.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2741
+ action: ((jr = c == null ? void 0 : c.empty) == null ? void 0 : jr.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2742
+ /* @__PURE__ */ r(
2757
2743
  "button",
2758
2744
  {
2759
2745
  type: "button",
2760
2746
  onClick: () => {
2761
2747
  var t;
2762
2748
  const e = {};
2763
- for (const [n, r] of Object.entries(pe.current))
2764
- (t = Re[n.slice(6)]) != null && t.length && (e[n] = r);
2749
+ for (const [n, a] of Object.entries(pe.current))
2750
+ (t = Oe[n.slice(6)]) != null && t.length && (e[n] = a);
2765
2751
  M(e), L(1);
2766
2752
  },
2767
2753
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
@@ -2769,12 +2755,12 @@ function ui({
2769
2755
  children: "Clear filters"
2770
2756
  }
2771
2757
  ),
2772
- x !== "all" && /* @__PURE__ */ a(
2758
+ g !== "all" && /* @__PURE__ */ r(
2773
2759
  "button",
2774
2760
  {
2775
2761
  type: "button",
2776
2762
  onClick: () => {
2777
- Y("all"), L(1);
2763
+ J("all"), L(1);
2778
2764
  },
2779
2765
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2780
2766
  "data-queue-empty-all": !0,
@@ -2784,33 +2770,33 @@ function ui({
2784
2770
  ] }) : void 0
2785
2771
  }
2786
2772
  ),
2787
- sort: G,
2773
+ sort: I,
2788
2774
  onSortChange: (e) => {
2789
- Te(e), L(1);
2775
+ Ae(e), L(1);
2790
2776
  },
2791
2777
  filterDefs: Cn,
2792
2778
  filterValues: w,
2793
2779
  onFilterChange: (e, t) => {
2794
2780
  M((n) => ({ ...n, [e]: t })), L(1);
2795
2781
  },
2796
- rowGroups: Ur ?? void 0,
2782
+ rowGroups: Ia ?? void 0,
2797
2783
  collapsedGroups: be,
2798
- onToggleGroup: Lr,
2799
- selectedIds: Xt ? $e : void 0,
2800
- onSelectionChange: Xt ? Mt : void 0,
2784
+ onToggleGroup: La,
2785
+ selectedIds: Zt ? Fe : void 0,
2786
+ onSelectionChange: Zt ? Mt : void 0,
2801
2787
  hideFilterRow: !0,
2802
2788
  nowrapCells: !0,
2803
- columnPins: Fa,
2789
+ columnPins: qr,
2804
2790
  onColumnPinChange: (e, t) => {
2805
2791
  Gt((n) => {
2806
- const r = { ...n ?? Fa };
2807
- return t ? r[e] = t : delete r[e], r;
2792
+ const a = { ...n ?? qr };
2793
+ return t ? a[e] = t : delete a[e], a;
2808
2794
  });
2809
2795
  },
2810
2796
  columnFilterRow: !0,
2811
2797
  hScrollProxy: !0,
2812
- footer: /* @__PURE__ */ a(
2813
- Do,
2798
+ footer: /* @__PURE__ */ r(
2799
+ Qo,
2814
2800
  {
2815
2801
  collections: at,
2816
2802
  selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
@@ -2828,40 +2814,40 @@ function ui({
2828
2814
  )
2829
2815
  ]
2830
2816
  }
2831
- ) }) }) : R === "kanban" ? /* @__PURE__ */ a(
2832
- Go,
2817
+ ) }) }) : A === "kanban" ? /* @__PURE__ */ r(
2818
+ zo,
2833
2819
  {
2834
2820
  items: S,
2835
2821
  onCardClick: (e) => Ot(e),
2836
- onDrop: (e, t) => wr.mutate({ item: e, targetState: t }),
2837
- onClaim: (e) => _e.mutate(e),
2838
- onRelease: (e) => Pe.mutate(e),
2839
- swimlaneBy: Je,
2822
+ onDrop: (e, t) => wa.mutate({ item: e, targetState: t }),
2823
+ onClaim: (e) => Se.mutate(e),
2824
+ onRelease: (e) => Me.mutate(e),
2825
+ swimlaneBy: ze,
2840
2826
  stateLabels: fn,
2841
- laneLabel: Je === "collection" ? rt : void 0,
2827
+ laneLabel: ze === "collection" ? lt : void 0,
2842
2828
  claimsEnabled: oe,
2843
2829
  onDraggingChange: (e) => {
2844
- Ln.current = e;
2830
+ Dn.current = e;
2845
2831
  }
2846
2832
  }
2847
- ) : /* @__PURE__ */ a(Ho, { queueId: l }) }),
2848
- Xt && /* @__PURE__ */ c(
2849
- Uo,
2833
+ ) : /* @__PURE__ */ r(Zo, { queueId: l }) }),
2834
+ Zt && /* @__PURE__ */ d(
2835
+ Jo,
2850
2836
  {
2851
- count: $e.length,
2837
+ count: Fe.length,
2852
2838
  claimsEnabled: oe,
2853
- showClaim: Zt("claim"),
2854
- showRelease: Zt("release"),
2855
- showTransition: Zt("transition"),
2856
- states: ua((d == null ? void 0 : d.available_values.state) ?? []).map((e) => ({
2839
+ showClaim: en("claim"),
2840
+ showRelease: en("release"),
2841
+ showTransition: en("transition"),
2842
+ states: dr((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
2857
2843
  value: e,
2858
- label: Ne(e)
2844
+ label: Ce(e)
2859
2845
  })),
2860
- busy: va,
2846
+ busy: kr,
2861
2847
  onClaim: () => wn(
2862
2848
  "Claim",
2863
2849
  (e) => p.request(
2864
- Z(`/queues/${l}/claim`, {
2850
+ ne(`/queues/${l}/claim`, {
2865
2851
  source_collection: e.collection,
2866
2852
  item_id: e.item_id
2867
2853
  })
@@ -2870,38 +2856,38 @@ function ui({
2870
2856
  onRelease: () => wn(
2871
2857
  "Release",
2872
2858
  (e) => p.request(
2873
- Z(`/queues/${l}/release`, {
2859
+ ne(`/queues/${l}/release`, {
2874
2860
  source_collection: e.collection,
2875
2861
  item_id: e.item_id
2876
2862
  })
2877
2863
  )
2878
2864
  ),
2879
- onTransition: (e) => wn("Transition", (t) => zn(t, e)),
2865
+ onTransition: (e) => wn("Transition", (t) => Yn(t, e)),
2880
2866
  onClear: () => Mt([]),
2881
2867
  children: [
2882
- $e.length >= 2 && /* @__PURE__ */ a(
2868
+ Fe.length >= 2 && /* @__PURE__ */ r(
2883
2869
  "button",
2884
2870
  {
2885
2871
  type: "button",
2886
2872
  onClick: () => {
2887
- const e = no(
2888
- S.filter((t) => $e.includes(D(t)) && t.collection !== "tasks").map((t) => V.urlFor(yn(t)))
2873
+ const e = ao(
2874
+ S.filter((t) => Fe.includes(D(t)) && t.collection !== "tasks").map((t) => W.urlFor(yn(t)))
2889
2875
  );
2890
- e.blocked > 0 || e.capped > 0 ? A.warning(za(e)) : A.success(za(e));
2876
+ e.blocked > 0 || e.capped > 0 ? T.warning(Yr(e)) : T.success(Yr(e));
2891
2877
  },
2892
2878
  "data-bulk-open-tabs": !0,
2893
- title: `Open the selected records in new tabs (up to ${to})`,
2879
+ title: `Open the selected records in new tabs (up to ${ro})`,
2894
2880
  className: "h-8 rounded-md border border-white/20 px-3 text-[12.5px] font-medium hover:bg-white/10 dark:border-border dark:hover:bg-muted",
2895
2881
  children: "Open in tabs"
2896
2882
  }
2897
2883
  ),
2898
- /* @__PURE__ */ a(
2899
- ko,
2884
+ /* @__PURE__ */ r(
2885
+ No,
2900
2886
  {
2901
- targets: S.filter((e) => $e.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2887
+ targets: S.filter((e) => Fe.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2902
2888
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
2903
2889
  tone: "light",
2904
- disabled: va,
2890
+ disabled: kr,
2905
2891
  onDone: (e) => {
2906
2892
  e.failed === 0 && Mt([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
2907
2893
  }
@@ -2910,8 +2896,8 @@ function ui({
2910
2896
  ]
2911
2897
  }
2912
2898
  ),
2913
- X != null && X.length ? /* @__PURE__ */ a(
2914
- Lo,
2899
+ X != null && X.length ? /* @__PURE__ */ r(
2900
+ Mo,
2915
2901
  {
2916
2902
  collection: X[0].collection,
2917
2903
  itemId: X[0].itemId,
@@ -2920,13 +2906,13 @@ function ui({
2920
2906
  width: X[0].width,
2921
2907
  title: X[0].title,
2922
2908
  stack: X,
2923
- onPush: (e) => ut.push([...X, e]),
2924
- onPop: () => ut.back(),
2925
- onClose: () => ut.back(X.length)
2909
+ onPush: (e) => mt.push([...X, e]),
2910
+ onPop: () => mt.back(),
2911
+ onClose: () => mt.back(X.length)
2926
2912
  }
2927
2913
  ) : null,
2928
- P && Ha(
2929
- /* @__PURE__ */ c(
2914
+ P && Wr(
2915
+ /* @__PURE__ */ d(
2930
2916
  "div",
2931
2917
  {
2932
2918
  style: {
@@ -2943,11 +2929,11 @@ function ui({
2943
2929
  { label: "Open", run: () => Ot(P.row) },
2944
2930
  {
2945
2931
  label: "Open full record",
2946
- run: () => lt(P.row)
2932
+ run: () => ot(P.row)
2947
2933
  },
2948
- { label: "Peek", run: () => Se(P.row) },
2934
+ { label: "Peek", run: () => $e(P.row) },
2949
2935
  ...oe ? [
2950
- ((Ua = P.row.claimed_by) == null ? void 0 : Ua.id) === v ? { label: "Release claim", run: () => Pe.mutate(P.row) } : { label: "Claim", run: () => _e.mutate(P.row) }
2936
+ ((Ur = P.row.claimed_by) == null ? void 0 : Ur.id) === v ? { label: "Release claim", run: () => Me.mutate(P.row) } : { label: "Claim", run: () => Se.mutate(P.row) }
2951
2937
  ] : [],
2952
2938
  {
2953
2939
  label: "Copy ID",
@@ -2961,41 +2947,41 @@ function ui({
2961
2947
  run: () => {
2962
2948
  var e;
2963
2949
  return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
2964
- `${window.location.origin}${V.urlFor(yn(P.row))}`
2950
+ `${window.location.origin}${W.urlFor(yn(P.row))}`
2965
2951
  ));
2966
2952
  }
2967
2953
  },
2968
2954
  // Custom actions (#125): the record's registered actions, right here.
2969
- ...xr(P.row.collection).map((e) => ({
2955
+ ...ga(P.row.collection).map((e) => ({
2970
2956
  label: e.label,
2971
- run: () => yr(e, P.row)
2957
+ run: () => xa(e, P.row)
2972
2958
  }))
2973
- ].map((e) => /* @__PURE__ */ a(
2959
+ ].map((e) => /* @__PURE__ */ r(
2974
2960
  "button",
2975
2961
  {
2976
2962
  type: "button",
2977
2963
  onClick: () => {
2978
- e.run(), ot(null);
2964
+ e.run(), st(null);
2979
2965
  },
2980
2966
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
2981
2967
  children: e.label
2982
2968
  },
2983
2969
  e.label
2984
2970
  )),
2985
- P.row.collection !== "tasks" && /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
2986
- /* @__PURE__ */ a("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
2971
+ P.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
2972
+ /* @__PURE__ */ r("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
2987
2973
  an.slice(0, 8).map((e) => {
2988
2974
  const t = (P.row.labels ?? []).includes(e);
2989
- return /* @__PURE__ */ c(
2975
+ return /* @__PURE__ */ d(
2990
2976
  "button",
2991
2977
  {
2992
2978
  type: "button",
2993
2979
  onClick: () => {
2994
- Wn(P.row, e), ot(null);
2980
+ Gn(P.row, e), st(null);
2995
2981
  },
2996
2982
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
2997
2983
  children: [
2998
- /* @__PURE__ */ a(
2984
+ /* @__PURE__ */ r(
2999
2985
  "span",
3000
2986
  {
3001
2987
  className: t ? "h-1.5 w-1.5 rounded-full bg-violet-500" : "h-1.5 w-1.5 rounded-full border border-slate-300 dark:border-slate-600"
@@ -3007,7 +2993,7 @@ function ui({
3007
2993
  e
3008
2994
  );
3009
2995
  }),
3010
- /* @__PURE__ */ a(
2996
+ /* @__PURE__ */ r(
3011
2997
  "form",
3012
2998
  {
3013
2999
  onSubmit: (e) => {
@@ -3015,10 +3001,10 @@ function ui({
3015
3001
  const n = e.target.elements.namedItem(
3016
3002
  "newlabel"
3017
3003
  ).value.trim();
3018
- n && (Wn(P.row, n), ot(null));
3004
+ n && (Gn(P.row, n), st(null));
3019
3005
  },
3020
3006
  className: "px-3 py-1",
3021
- children: /* @__PURE__ */ a(
3007
+ children: /* @__PURE__ */ r(
3022
3008
  "input",
3023
3009
  {
3024
3010
  name: "newlabel",
@@ -3036,51 +3022,51 @@ function ui({
3036
3022
  ),
3037
3023
  document.body
3038
3024
  ),
3039
- Vn && Ha(
3040
- /* @__PURE__ */ a(
3041
- rs,
3025
+ Vn && Wr(
3026
+ /* @__PURE__ */ r(
3027
+ cs,
3042
3028
  {
3043
3029
  queueId: l,
3044
3030
  drill: Vn,
3045
- onClose: () => tn(null),
3031
+ onClose: () => nn(null),
3046
3032
  onOpenRecord: (e, t) => {
3047
- tn(null), V.open({ collection: e, itemId: t, layoutSlug: null });
3033
+ nn(null), W.open({ collection: e, itemId: t, layoutSlug: null });
3048
3034
  }
3049
3035
  }
3050
3036
  ),
3051
3037
  document.body
3052
3038
  ),
3053
- /* @__PURE__ */ a(
3054
- Vo,
3039
+ /* @__PURE__ */ r(
3040
+ Yo,
3055
3041
  {
3056
3042
  item: ge,
3057
3043
  stateLabels: fn,
3058
- collectionLabel: rt,
3044
+ collectionLabel: lt,
3059
3045
  claimsEnabled: oe,
3060
- columnFormats: Wr,
3046
+ columnFormats: Wa,
3061
3047
  width: u == null ? void 0 : u.sheet_width,
3062
3048
  itemLayout: u == null ? void 0 : u.item_layout,
3063
3049
  onOpenChange: (e) => {
3064
- e || (Se(null), xn(!1));
3050
+ e || ($e(null), xn(!1));
3065
3051
  },
3066
- onClaim: (e) => _e.mutate(e),
3067
- onRelease: (e) => Pe.mutate(e),
3068
- workNextActive: Dr,
3069
- onNext: () => ge && ma(ge),
3052
+ onClaim: (e) => Se.mutate(e),
3053
+ onRelease: (e) => Me.mutate(e),
3054
+ workNextActive: Da,
3055
+ onNext: () => ge && ur(ge),
3070
3056
  refetchItems: () => h.invalidateQueries({ queryKey: ["queue-items", l] })
3071
3057
  }
3072
3058
  )
3073
3059
  ] });
3074
3060
  }
3075
- function rs({
3061
+ function cs({
3076
3062
  queueId: l,
3077
3063
  drill: f,
3078
3064
  onClose: $,
3079
3065
  onOpenRecord: O
3080
3066
  }) {
3081
- const I = tr(), { data: h, isLoading: p } = H({
3067
+ const U = ea(), { data: h, isLoading: p } = H({
3082
3068
  queryKey: ["queue-agg-rows", l, f.row.collection, f.row.item_id, f.path],
3083
- queryFn: () => I.request(
3069
+ queryFn: () => U.request(
3084
3070
  E(`/queues/${l}/aggregate-rows`, {
3085
3071
  collection: f.row.collection,
3086
3072
  item_id: f.row.item_id,
@@ -3088,29 +3074,29 @@ function rs({
3088
3074
  })
3089
3075
  ).then((v) => v.data)
3090
3076
  });
3091
- return /* @__PURE__ */ a(
3077
+ return /* @__PURE__ */ r(
3092
3078
  "div",
3093
3079
  {
3094
3080
  className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
3095
3081
  onClick: $,
3096
- children: /* @__PURE__ */ c(
3082
+ children: /* @__PURE__ */ d(
3097
3083
  "div",
3098
3084
  {
3099
3085
  className: "max-h-[70vh] w-[480px] overflow-y-auto rounded-xl border border-slate-200 bg-white p-4 shadow-2xl dark:border-border dark:bg-card",
3100
3086
  onClick: (v) => v.stopPropagation(),
3101
3087
  children: [
3102
- /* @__PURE__ */ c("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
3103
- /* @__PURE__ */ c("div", { children: [
3104
- /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children: f.row.label }),
3105
- /* @__PURE__ */ c("p", { className: "text-[11.5px] text-muted-foreground", children: [
3106
- xt(f.path),
3088
+ /* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
3089
+ /* @__PURE__ */ d("div", { children: [
3090
+ /* @__PURE__ */ r("p", { className: "text-[13px] font-semibold", children: f.row.label }),
3091
+ /* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
3092
+ yt(f.path),
3107
3093
  " = ",
3108
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: f.value }),
3094
+ /* @__PURE__ */ r("span", { className: "tabular-nums", children: f.value }),
3109
3095
  " ",
3110
3096
  "— the rows behind this number"
3111
3097
  ] })
3112
3098
  ] }),
3113
- /* @__PURE__ */ a(
3099
+ /* @__PURE__ */ r(
3114
3100
  "button",
3115
3101
  {
3116
3102
  type: "button",
@@ -3120,8 +3106,8 @@ function rs({
3120
3106
  }
3121
3107
  )
3122
3108
  ] }),
3123
- p ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((h == null ? void 0 : h.rows) ?? []).length === 0 ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "No contributing rows resolved." }) : /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h == null ? void 0 : h.rows.map((v) => /* @__PURE__ */ c("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
3124
- /* @__PURE__ */ a(
3109
+ p ? /* @__PURE__ */ r("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((h == null ? void 0 : h.rows) ?? []).length === 0 ? /* @__PURE__ */ r("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "No contributing rows resolved." }) : /* @__PURE__ */ r("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h == null ? void 0 : h.rows.map((v) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
3110
+ /* @__PURE__ */ r(
3125
3111
  "button",
3126
3112
  {
3127
3113
  type: "button",
@@ -3130,7 +3116,7 @@ function rs({
3130
3116
  children: v.label
3131
3117
  }
3132
3118
  ),
3133
- /* @__PURE__ */ a("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children: v.leaf_value == null ? "—" : String(v.leaf_value) })
3119
+ /* @__PURE__ */ r("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children: v.leaf_value == null ? "—" : String(v.leaf_value) })
3134
3120
  ] }, String(v.id))) })
3135
3121
  ]
3136
3122
  }
@@ -3139,5 +3125,5 @@ function rs({
3139
3125
  );
3140
3126
  }
3141
3127
  export {
3142
- ui as QueueWorklist
3128
+ yi as QueueWorklist
3143
3129
  };