@nivaro/react 0.3.116 → 0.3.118

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 (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,30 +1,30 @@
1
- import { jsx as a, jsxs as r, Fragment as y } from "react/jsx-runtime";
2
- import { useQueryClient as G, useQuery as q, useMutation as f } from "@tanstack/react-query";
3
- import { Loader2 as M, PlayCircle as J, Paperclip as V } from "lucide-react";
1
+ import { jsx as a, jsxs as r, Fragment as f } from "react/jsx-runtime";
2
+ import { useQueryClient as M, useQuery as q, useMutation as y } from "@tanstack/react-query";
3
+ import { Loader2 as J, PlayCircle as V, Paperclip as X } from "lucide-react";
4
4
  import { useState as b } from "react";
5
- import { useNivaroClient as X, useApiFetchConfig as Y, useItemNavigation as Z, useNavigation as I } from "../../context.js";
6
- import { get as T, post as C, patch as ee } from "../../lib/commands.js";
7
- import { useLiveFade as te } from "../../lib/live-screen.js";
8
- import { useBackgroundArm as ae } from "../../lib/live-views.js";
9
- import { useTopicPresence as re, signalSentence as $ } from "../../lib/presence-signals.js";
10
- import { replayHref as se } from "../../lib/replay-capture.js";
11
- import { foldShareHistory as ne, historyLine as le } from "../../lib/screen-share.js";
12
- import { TaskDoButton as ie } from "../ai/TaskDo.js";
13
- import { RelationCombobox as oe } from "../item-edit/RelationCombobox.js";
5
+ import { useNivaroClient as Y, useApiFetchConfig as Z, useItemNavigation as I, useNavigation as ee } from "../../context.js";
6
+ import { get as T, post as C, patch as te } from "../../lib/commands.js";
7
+ import { useLiveFade as ae } from "../../lib/live-screen.js";
8
+ import { useBackgroundArm as re } from "../../lib/live-views.js";
9
+ import { useTopicPresence as se, signalSentence as $ } from "../../lib/presence-signals.js";
10
+ import { replayHref as ne } from "../../lib/replay-capture.js";
11
+ import { foldShareHistory as le, historyLine as ie } from "../../lib/screen-share.js";
12
+ import { TaskDoButton as oe } from "../ai/TaskDo.js";
13
+ import { RelationCombobox as de } from "../item-edit/RelationCombobox.js";
14
14
  import { SimpleSelect as R } from "../ui/SimpleSelect.js";
15
- import { Sheet as de, SheetContent as ce, SheetTitle as F, SheetDescription as K, SheetHeader as me } from "../ui/sheet.js";
16
- import { ScreenSharePanel as pe } from "./ScreenShare.js";
17
- import { isSupportContextFile as k } from "./support-context.js";
18
- import { TicketSlowScreens as ue } from "./TicketSlowScreens.js";
19
- import { TicketTraffic as xe } from "./TicketTraffic.js";
15
+ import { Sheet as ce, SheetContent as ue, SheetTitle as F, SheetDescription as K, SheetHeader as pe } from "../ui/sheet.js";
16
+ import { ScreenSharePanel as me } from "./ScreenShare.js";
17
+ import { isSupportContextFile as v } from "./support-context.js";
18
+ import { TicketSlowScreens as xe } from "./TicketSlowScreens.js";
19
+ import { TicketTraffic as he } from "./TicketTraffic.js";
20
20
  import { STATUS_TONE as A } from "./types.js";
21
- const P = [
21
+ const L = [
22
22
  { value: "open", label: "Open" },
23
23
  { value: "in_progress", label: "In progress" },
24
24
  { value: "done", label: "Done" },
25
25
  { value: "cancelled", label: "Cancelled" }
26
26
  ];
27
- function v(s) {
27
+ function k(s) {
28
28
  return s ? new Date(s).toLocaleString(void 0, {
29
29
  month: "short",
30
30
  day: "numeric",
@@ -32,37 +32,38 @@ function v(s) {
32
32
  minute: "2-digit"
33
33
  }) : "";
34
34
  }
35
- function he({ status: s, label: c }) {
35
+ const P = "mt-1 h-9 w-full min-w-0 gap-2 rounded-md border-slate-200 bg-white px-3 text-[13px] font-normal text-slate-900 dark:border-border dark:bg-card dark:text-slate-100 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:truncate [&>span]:text-left [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0", ge = "mt-1 font-normal [&>div>button]:h-9 [&>div>button]:border-slate-200 [&>div>button]:bg-white [&>div>button]:text-[13px] [&>div>button]:text-slate-900 dark:[&>div>button]:border-border dark:[&>div>button]:bg-card dark:[&>div>button]:text-slate-100";
36
+ function fe({ status: s, label: c }) {
36
37
  var l;
37
38
  return /* @__PURE__ */ a(
38
39
  "span",
39
40
  {
40
41
  "data-ticket-status": s,
41
42
  className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${A[s] ?? A.open}`,
42
- children: c ?? ((l = P.find((i) => i.value === s)) == null ? void 0 : l.label) ?? s
43
+ children: c ?? ((l = L.find((i) => i.value === s)) == null ? void 0 : l.label) ?? s
43
44
  }
44
45
  );
45
46
  }
46
- function Le({
47
+ function Ue({
47
48
  ticketId: s,
48
49
  onOpenChange: c
49
50
  }) {
50
- const l = X(), i = G(), { apiBase: D } = Y(), { urlFor: L, open: Q } = Z(), m = I(), [p, N] = b(""), [w, U] = b(null), [j, E] = b(!1), o = re(
51
+ const l = Y(), i = M(), { apiBase: O } = Z(), { urlFor: D, open: U } = I(), u = ee(), [p, N] = b(""), [w, Q] = b(null), [j, E] = b(!1), o = se(
51
52
  s != null && Number.isSafeInteger(s) && s > 0 ? `ticket:${s}` : null
52
- ), u = s != null && Number.isSafeInteger(s) && s > 0, {
53
+ ), m = s != null && Number.isSafeInteger(s) && s > 0, {
53
54
  data: e,
54
55
  isLoading: H,
55
- isError: O,
56
- dataUpdatedAt: W
56
+ isError: W,
57
+ dataUpdatedAt: B
57
58
  } = q({
58
59
  queryKey: ["support-ticket", s],
59
60
  queryFn: () => l.request(T(`/support/tickets/${s}`)).then((t) => t.data),
60
- enabled: u,
61
+ enabled: m,
61
62
  retry: (t, n) => {
62
63
  const g = n == null ? void 0 : n.status;
63
64
  return g !== 404 && g !== 403 && g !== 400 && t < 2;
64
65
  }
65
- }), B = te(ae(W, String(s))), { data: z = [] } = q({
66
+ }), z = ae(re(B, String(s))), { data: G = [] } = q({
66
67
  queryKey: ["support-categories", "all-for", (e == null ? void 0 : e.collection) ?? null],
67
68
  queryFn: () => l.request(
68
69
  T("/support/categories", e != null && e.collection ? { collection: e.collection } : void 0)
@@ -70,54 +71,58 @@ function Le({
70
71
  enabled: !!(e != null && e.can.work)
71
72
  }), x = () => {
72
73
  i.invalidateQueries({ queryKey: ["support-ticket", s] }), i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), i.invalidateQueries({ queryKey: ["my-work"] });
73
- }, h = (t) => U(t.message || "That did not work"), S = f({
74
+ }, h = (t) => Q(t.message || "That did not work"), S = y({
74
75
  mutationFn: () => l.request(C(`/support/tickets/${s}/claim`)),
75
76
  onSuccess: x,
76
77
  onError: h
77
- }), d = f({
78
- mutationFn: (t) => l.request(ee(`/support/tickets/${s}`, t)),
78
+ }), d = y({
79
+ mutationFn: (t) => l.request(te(`/support/tickets/${s}`, t)),
79
80
  onSuccess: x,
80
81
  onError: h
81
- }), _ = f({
82
+ }), _ = y({
82
83
  mutationFn: () => l.request(C(`/support/tickets/${s}/comments`, { text: p.trim() })),
83
84
  onSuccess: () => {
84
85
  N(""), o.signalReplying(!1), x();
85
86
  },
86
87
  onError: h
87
88
  });
88
- return /* @__PURE__ */ a(de, { open: s != null, onOpenChange: c, children: /* @__PURE__ */ a(
89
- ce,
89
+ return /* @__PURE__ */ a(ce, { open: s != null, onOpenChange: c, children: /* @__PURE__ */ a(
90
+ ue,
90
91
  {
91
92
  side: "right",
92
- ref: B,
93
- className: `flex max-w-[96vw] flex-col gap-0 p-0 transition-[width] duration-300 ease-out dark:bg-card ${j ? "w-[min(1280px,96vw)] sm:max-w-[min(1280px,96vw)]" : "w-[560px] sm:max-w-[560px]"}`,
93
+ ref: z,
94
+ className: `flex max-w-[96vw] flex-col gap-0 p-0 outline-none focus:outline-none transition-[width] duration-300 ease-out dark:bg-card ${j ? "w-[min(1280px,96vw)] sm:max-w-[min(1280px,96vw)]" : "w-[560px] sm:max-w-[560px]"}`,
94
95
  "data-support-ticket": s ?? "",
95
- children: !u || O ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-1 px-6 text-center", children: [
96
+ onOpenAutoFocus: (t) => {
97
+ var n;
98
+ t.preventDefault(), (n = t.currentTarget) == null || n.focus({ preventScroll: !0 });
99
+ },
100
+ children: !m || W ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-1 px-6 text-center", children: [
96
101
  /* @__PURE__ */ a(F, { className: "text-[14px] font-semibold text-slate-800 dark:text-slate-100", children: "Request not found" }),
97
- /* @__PURE__ */ a(K, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: u ? `Request #${s} does not exist, or it is not one you can open.` : "This link does not point to a request." })
98
- ] }) : H || !e ? /* @__PURE__ */ a("div", { className: "flex flex-1 items-center justify-center text-slate-400", children: /* @__PURE__ */ a(M, { className: "h-5 w-5 animate-spin" }) }) : /* @__PURE__ */ r(y, { children: [
99
- /* @__PURE__ */ r(me, { className: "space-y-1.5 border-b border-slate-200 px-5 py-4 text-left dark:border-border", children: [
102
+ /* @__PURE__ */ a(K, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: m ? `Request #${s} does not exist, or it is not one you can open.` : "This link does not point to a request." })
103
+ ] }) : H || !e ? /* @__PURE__ */ a("div", { className: "flex flex-1 items-center justify-center text-slate-400", children: /* @__PURE__ */ a(J, { className: "h-5 w-5 animate-spin" }) }) : /* @__PURE__ */ r(f, { children: [
104
+ /* @__PURE__ */ r(pe, { className: "space-y-1.5 border-b border-slate-200 px-5 py-4 text-left dark:border-border", children: [
100
105
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 pr-6", children: [
101
106
  /* @__PURE__ */ r("span", { className: "font-mono text-[11.5px] text-slate-400", children: [
102
107
  "#",
103
108
  e.id
104
109
  ] }),
105
- /* @__PURE__ */ a(he, { status: e.status, label: e.status_label }),
106
- e.priority === "urgent" && /* @__PURE__ */ a("span", { className: "rounded bg-red-500/10 px-1.5 py-px text-[10px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" })
110
+ /* @__PURE__ */ a(fe, { status: e.status, label: e.status_label }),
111
+ e.priority === "urgent" && /* @__PURE__ */ a("span", { className: "rounded-full bg-red-500/10 px-2 py-0.5 text-[11px] font-medium text-red-600 dark:text-red-400", children: "Urgent" })
107
112
  ] }),
108
113
  /* @__PURE__ */ a(F, { className: "text-left text-[16px] font-semibold leading-snug text-slate-900 dark:text-slate-100", children: e.title }),
109
114
  /* @__PURE__ */ r(K, { className: "text-left text-[12px] text-slate-500 dark:text-muted-foreground", children: [
110
115
  e.requester_name ?? "Someone",
111
116
  " · ",
112
- v(e.created_at),
117
+ k(e.created_at),
113
118
  e.category_name ? ` · ${e.category_name}` : ""
114
119
  ] }),
115
120
  /* @__PURE__ */ a("div", { className: "text-left text-[12px]", children: e.collection && e.item ? /* @__PURE__ */ a(
116
121
  "a",
117
122
  {
118
- href: L({ collection: e.collection, itemId: e.item }),
123
+ href: D({ collection: e.collection, itemId: e.item }),
119
124
  onClick: (t) => {
120
- t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(), Q({ collection: e.collection, itemId: e.item }));
125
+ t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(), U({ collection: e.collection, itemId: e.item }));
121
126
  },
122
127
  "data-ticket-record": !0,
123
128
  className: "inline-flex items-center gap-1 rounded-md bg-slate-100 px-2 py-0.5 font-medium text-[#00789a] hover:bg-slate-200/70 dark:bg-white/[0.06] dark:text-nvr-cyan dark:hover:bg-white/10",
@@ -144,18 +149,18 @@ function Le({
144
149
  "div",
145
150
  {
146
151
  "data-ticket-controls": !0,
147
- className: "grid grid-cols-2 gap-x-3 gap-y-3.5 rounded-lg border border-slate-200/80 bg-slate-50/70 p-4 dark:border-border dark:bg-white/[0.03]",
152
+ className: "grid grid-cols-2 gap-x-3 gap-y-3.5 rounded-lg border border-slate-200/80 bg-slate-50/70 p-4 dark:border-border dark:bg-white/[0.04]",
148
153
  children: [
149
154
  /* @__PURE__ */ r("div", { className: "col-span-2 flex items-center gap-2", children: [
150
- /* @__PURE__ */ a("span", { className: "mr-auto text-[12.5px] text-slate-600 dark:text-slate-300", children: e.assignee_name ? /* @__PURE__ */ r(y, { children: [
155
+ /* @__PURE__ */ a("span", { className: "mr-auto text-[12.5px] text-slate-600 dark:text-slate-300", children: e.assignee_name ? /* @__PURE__ */ r(f, { children: [
151
156
  "Assigned to ",
152
157
  /* @__PURE__ */ a("b", { className: "font-medium", children: e.assignee_name })
153
- ] }) : /* @__PURE__ */ r(y, { children: [
158
+ ] }) : /* @__PURE__ */ r(f, { children: [
154
159
  "Not picked up yet",
155
160
  e.team_name ? ` · ${e.team_name}` : " · Administrators"
156
161
  ] }) }),
157
162
  /* @__PURE__ */ a(
158
- ie,
163
+ oe,
159
164
  {
160
165
  task: {
161
166
  id: e.id,
@@ -187,9 +192,9 @@ function Le({
187
192
  {
188
193
  value: e.status,
189
194
  onChange: (t) => d.mutate({ status: t }),
190
- options: P,
195
+ options: L,
191
196
  ariaLabel: "Status",
192
- className: "mt-1"
197
+ className: P
193
198
  }
194
199
  )
195
200
  ] }),
@@ -202,17 +207,17 @@ function Le({
202
207
  onChange: (t) => d.mutate({ category_id: t ? Number(t) : null }),
203
208
  options: [
204
209
  { value: "", label: "No type" },
205
- ...z.map((t) => ({ value: String(t.id), label: t.name }))
210
+ ...G.map((t) => ({ value: String(t.id), label: t.name }))
206
211
  ],
207
212
  ariaLabel: "Type",
208
- className: "mt-1"
213
+ className: P
209
214
  }
210
215
  )
211
216
  ] }),
212
217
  /* @__PURE__ */ r("div", { className: "col-span-2 text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
213
218
  "Assignee",
214
- /* @__PURE__ */ a("div", { className: "mt-1", children: /* @__PURE__ */ a(
215
- oe,
219
+ /* @__PURE__ */ a("div", { className: ge, children: /* @__PURE__ */ a(
220
+ de,
216
221
  {
217
222
  collection: "nivaro_users",
218
223
  value: e.assignee,
@@ -224,12 +229,12 @@ function Le({
224
229
  ]
225
230
  }
226
231
  ),
227
- (e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ a(pe, { ticketId: e.id, onWideChange: E }),
232
+ (e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ a(me, { ticketId: e.id, onWideChange: E }),
228
233
  /* @__PURE__ */ r("section", { children: [
229
234
  /* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Request" }),
230
235
  /* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-[13px] leading-relaxed text-slate-800 dark:text-slate-200", children: e.description || /* @__PURE__ */ a("span", { className: "text-slate-400", children: "No details given." }) }),
231
236
  e.replay && e.can.work && (() => {
232
- const t = se(e.replay), n = m.consoleUrl ? m.consoleUrl(t) : t;
237
+ const t = ne(e.replay), n = u.consoleUrl ? u.consoleUrl(t) : t;
233
238
  return n ? /* @__PURE__ */ r(
234
239
  "a",
235
240
  {
@@ -239,14 +244,14 @@ function Le({
239
244
  "data-ticket-replay": e.replay.recording_id,
240
245
  className: "mt-2 inline-flex items-center gap-1.5 rounded-md border border-nvr-cyan/50 bg-nvr-cyan/10 px-2 py-1 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 dark:text-nvr-cyan",
241
246
  children: [
242
- /* @__PURE__ */ a(J, { className: "h-3.5 w-3.5" }),
247
+ /* @__PURE__ */ a(V, { className: "h-3.5 w-3.5" }),
243
248
  "Replay their screen"
244
249
  ]
245
250
  }
246
251
  ) : null;
247
252
  })(),
248
253
  e.issue_id != null && e.can.work && (() => {
249
- const t = `/issues/${e.issue_id}`, n = m.consoleUrl ? m.consoleUrl(t) : t;
254
+ const t = `/issues/${e.issue_id}`, n = u.consoleUrl ? u.consoleUrl(t) : t;
250
255
  return n ? /* @__PURE__ */ r(
251
256
  "a",
252
257
  {
@@ -263,26 +268,26 @@ function Le({
263
268
  ) : null;
264
269
  })(),
265
270
  (() => {
266
- const t = e.files.filter((n) => e.can.work || !k(n));
271
+ const t = e.files.filter((n) => e.can.work || !v(n));
267
272
  return t.length === 0 ? null : /* @__PURE__ */ a("ul", { className: "mt-2 flex flex-wrap gap-1.5", children: t.map((n) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ r(
268
273
  "a",
269
274
  {
270
- href: `${D}/files/${n.id}`,
275
+ href: `${O}/files/${n.id}`,
271
276
  target: "_blank",
272
277
  rel: "noreferrer",
273
- "data-tip": k(n) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
278
+ "data-tip": v(n) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
274
279
  className: "inline-flex items-center gap-1 rounded bg-slate-100 px-2 py-0.5 text-[11.5px] text-slate-700 hover:underline dark:bg-white/10 dark:text-slate-200",
275
280
  children: [
276
- /* @__PURE__ */ a(V, { className: "h-3 w-3" }),
277
- k(n) ? "Technical details" : n.title || n.filename_download || "File"
281
+ /* @__PURE__ */ a(X, { className: "h-3 w-3" }),
282
+ v(n) ? "Technical details" : n.title || n.filename_download || "File"
278
283
  ]
279
284
  }
280
285
  ) }, n.id)) });
281
286
  })()
282
287
  ] }),
283
- e.can.work && /* @__PURE__ */ a(xe, { ticketId: e.id }),
288
+ e.can.work && /* @__PURE__ */ a(he, { ticketId: e.id }),
284
289
  /* @__PURE__ */ a(
285
- ue,
290
+ xe,
286
291
  {
287
292
  userId: e.created_by,
288
293
  name: e.requester_name,
@@ -298,7 +303,7 @@ function Le({
298
303
  children: [
299
304
  /* @__PURE__ */ r("div", { className: "mb-0.5 flex items-baseline justify-between gap-2 text-[11.5px]", children: [
300
305
  /* @__PURE__ */ a("b", { className: "font-medium text-slate-800 dark:text-slate-100", children: t.user_name ?? "Someone" }),
301
- /* @__PURE__ */ a("span", { className: "text-slate-400", children: v(t.created_at) })
306
+ /* @__PURE__ */ a("span", { className: "text-slate-400", children: k(t.created_at) })
302
307
  ] }),
303
308
  /* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-[12.5px] text-slate-700 dark:text-slate-200", children: t.text })
304
309
  ]
@@ -377,18 +382,20 @@ function Le({
377
382
  ] }),
378
383
  /* @__PURE__ */ r("section", { "data-ticket-history": !0, children: [
379
384
  /* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "History" }),
380
- e.history.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No history yet." }) : /* @__PURE__ */ a("ol", { className: "space-y-2 border-l border-slate-200 pl-3.5 dark:border-border", children: ne(e.history).map((t) => {
381
- const n = le(t, {
382
- isRequester: !e.can.work,
385
+ e.history.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No history yet." }) : /* @__PURE__ */ a("ol", { className: "space-y-2 border-l border-slate-200 pl-3.5 dark:border-border", children: le(e.history, { requester: e.created_by }).reverse().map((t) => {
386
+ const n = ie(t, {
387
+ isRequester: e.can.requester ?? !e.can.work,
383
388
  requesterName: e.requester_name
384
389
  });
385
390
  return /* @__PURE__ */ r("li", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
386
391
  /* @__PURE__ */ a("span", { className: "text-slate-800 dark:text-slate-100", children: n.text }),
387
392
  /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-slate-400", children: [
388
393
  " ",
389
- "· ",
390
- n.showAuthor ? `${t.user_name ?? "System"} · ` : "",
391
- v(t.at)
394
+ /* @__PURE__ */ r("span", { className: "whitespace-nowrap", children: [
395
+ "· ",
396
+ n.showAuthor ? `${t.user_name ?? "System"} · ` : "",
397
+ k(t.at)
398
+ ] })
392
399
  ] })
393
400
  ] }, t.id);
394
401
  }) })
@@ -399,6 +406,6 @@ function Le({
399
406
  ) });
400
407
  }
401
408
  export {
402
- he as StatusPill,
403
- Le as TicketDetailSheet
409
+ fe as StatusPill,
410
+ Ue as TicketDetailSheet
404
411
  };
@@ -2,22 +2,22 @@ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
2
  import { Gauge as a } from "lucide-react";
3
3
  import { useState as m } from "react";
4
4
  import { useItemEditAuth as p } from "../../context.js";
5
- import { SlowScreensCard as d, looksLikeSlowness as f } from "../profile/SlowScreensCard.js";
6
- function v({
5
+ import { SlowScreensCard as f, looksLikeSlowness as d } from "../profile/SlowScreensCard.js";
6
+ function b({
7
7
  userId: r,
8
- name: t,
8
+ name: e,
9
9
  text: i
10
10
  }) {
11
- const e = p(), n = f(i), [c, l] = m(n);
12
- if (!(e != null && e.isAdmin) || !r) return null;
13
- const o = (t == null ? void 0 : t.split(" ")[0]) ?? null;
14
- return c ? /* @__PURE__ */ s("div", { "data-ticket-slow-screens": n ? "auto" : "asked", children: /* @__PURE__ */ s(d, { userId: r, name: o, compact: !0 }) }) : /* @__PURE__ */ u(
11
+ const t = p(), n = d(i), [c, l] = m(n);
12
+ if (!(t != null && t.isAdmin) || !r) return null;
13
+ const o = (e == null ? void 0 : e.split(" ")[0]) ?? null;
14
+ return c ? /* @__PURE__ */ s("div", { "data-ticket-slow-screens": n ? "auto" : "asked", children: /* @__PURE__ */ s(f, { userId: r, name: o, compact: !0 }) }) : /* @__PURE__ */ u(
15
15
  "button",
16
16
  {
17
17
  type: "button",
18
18
  onClick: () => l(!0),
19
19
  "data-ticket-slow-screens-open": !0,
20
- className: "inline-flex items-center gap-1.5 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
20
+ className: "inline-flex items-center gap-1.5 text-[12px] font-medium text-[#00789a] underline-offset-2 hover:underline dark:text-nvr-cyan",
21
21
  children: [
22
22
  /* @__PURE__ */ s(a, { className: "h-3.5 w-3.5" }),
23
23
  "Show ",
@@ -28,5 +28,5 @@ function v({
28
28
  );
29
29
  }
30
30
  export {
31
- v as TicketSlowScreens
31
+ b as TicketSlowScreens
32
32
  };
@@ -0,0 +1,171 @@
1
+ const f = [
2
+ {
3
+ value: "fewest_open",
4
+ label: "Fewest open requests",
5
+ description: "Whoever has the least on their plate right now."
6
+ },
7
+ {
8
+ value: "least_recent",
9
+ label: "Least recently assigned",
10
+ description: "Fair turns: whoever has gone longest without a new request."
11
+ },
12
+ {
13
+ value: "fewest_today",
14
+ label: "Fewest assigned today",
15
+ description: "Evens out the day: counts requests given to each person since midnight."
16
+ },
17
+ {
18
+ value: "fewest_week",
19
+ label: "Fewest assigned this week",
20
+ description: "Evens out the week (from Monday)."
21
+ },
22
+ {
23
+ value: "fewest_urgent",
24
+ label: "Fewest urgent open requests",
25
+ description: "Keeps urgent work spread out."
26
+ },
27
+ {
28
+ value: "most_closed_type",
29
+ label: "Most experience with this kind",
30
+ description: "Whoever has closed the most requests of this type (or for this kind of record). Ties: fewest open."
31
+ },
32
+ {
33
+ value: "last_helped",
34
+ label: "Whoever last helped this person",
35
+ description: "Keeps the same requester with the same helper. Nobody has yet: fewest open."
36
+ },
37
+ {
38
+ value: "step_owner",
39
+ label: "The record’s step owner, if listed",
40
+ description: "Someone on the list who owns the record’s current step. None: fewest open."
41
+ },
42
+ {
43
+ value: "random",
44
+ label: "Random",
45
+ description: "Anyone on the list who can take it."
46
+ }
47
+ ], d = {
48
+ fewest_open: "whoever has the fewest open requests",
49
+ least_recent: "whoever was assigned least recently",
50
+ fewest_today: "whoever was given the fewest today",
51
+ fewest_week: "whoever was given the fewest this week",
52
+ fewest_urgent: "whoever has the fewest urgent requests",
53
+ most_closed_type: "whoever has closed the most of this kind",
54
+ last_helped: "whoever last helped this requester",
55
+ step_owner: "the record’s step owner if they are listed",
56
+ random: "at random"
57
+ }, h = {
58
+ general: "Get help",
59
+ record: "a record’s Request help",
60
+ error: "an error’s Get help",
61
+ report_problem: "Report a problem"
62
+ };
63
+ function r(e, t = "or") {
64
+ const s = e.filter(Boolean);
65
+ return s.length <= 1 ? s[0] ?? "" : s.length > 4 ? `${s.slice(0, 3).join(", ")} ${t} ${s.length - 3} more` : `${s.slice(0, -1).join(", ")} ${t} ${s.at(-1)}`;
66
+ }
67
+ const c = {
68
+ is: "is",
69
+ is_not: "is not",
70
+ in: "is",
71
+ not_in: "is not",
72
+ contains: "contains",
73
+ not_contains: "does not contain",
74
+ empty: "is empty",
75
+ not_empty: "is filled in",
76
+ gt: "is more than",
77
+ gte: "is at least",
78
+ lt: "is less than",
79
+ lte: "is at most"
80
+ };
81
+ function w(e, t) {
82
+ const s = (o, n) => `${o === "in" ? "is" : "is not"} ${r(n)}`;
83
+ switch (e.kind) {
84
+ case "type":
85
+ return `the type ${s(e.op, e.values.map(t.type))}`;
86
+ case "about":
87
+ return e.op === "general" ? "it is General Support (not about a record)" : e.collections.length ? `it is about ${r(e.collections.map(t.collection))}` : "it is about a record";
88
+ case "field": {
89
+ const o = t.field(e.collection, e.field), n = c[e.op];
90
+ if (e.op === "empty" || e.op === "not_empty") return `the record’s ${o} ${n}`;
91
+ const a = e.values.map((l) => t.value(e.collection, e.field, l));
92
+ return `the record’s ${o} ${n} ${r(a, (e.op === "not_in" || e.op === "is_not", "or"))}`;
93
+ }
94
+ case "step":
95
+ return `the record’s step ${s(e.op, e.states.map(t.step))}`;
96
+ case "requester":
97
+ return `${r(e.users.map(t.person))} ${e.op === "in" ? (e.users.length > 1, "raised it") : "did not raise it"}`;
98
+ case "requester_role":
99
+ return `the requester’s role ${s(e.op, e.roles.map(t.role))}`;
100
+ case "requester_team":
101
+ return `the requester ${e.op === "in" ? "is" : "is not"} in ${r(e.teams.map(t.team))}`;
102
+ case "priority":
103
+ return `the priority ${s(e.op, e.values)}`;
104
+ case "text": {
105
+ const o = e.words.map((n) => `“${n}”`);
106
+ return e.op === "any" ? `the title or description mentions ${r(o)}` : e.op === "all" ? `the title or description mentions ${r(o, "and")}` : `the title and description never mention ${r(o)}`;
107
+ }
108
+ case "source":
109
+ return `it was raised from ${e.op === "not_in" ? "anywhere but " : ""}${r(e.values.map((o) => h[o]))}`;
110
+ case "hours":
111
+ return e.op === "inside" ? "it comes in during business hours" : "it comes in outside business hours";
112
+ }
113
+ }
114
+ function m(e, t) {
115
+ switch (e.kind) {
116
+ case "person":
117
+ return `give it to ${t.person(e.user)}`;
118
+ case "team":
119
+ return `send it to ${t.team(e.team)}’s desk, unassigned`;
120
+ case "step_owner":
121
+ return e.pick === "first" ? "give it to the record’s step owner (the first one)" : "give it to the record’s step owner with the fewest open requests";
122
+ case "share": {
123
+ const s = r(
124
+ e.people.map((i) => t.person(i.id)),
125
+ "and"
126
+ ), o = [...new Set(e.people.map((i) => i.cap))], n = o.length === 1 && o[0] != null ? `, max ${o[0]} each` : e.people.some((i) => i.cap != null) ? ", some with a cap" : "", a = e.people.some((i) => i.when !== "always") ? ", some only at certain times" : "", l = e.give_to_cover ? "; someone out of office hands it to their cover" : "";
127
+ return `share it among ${s} — ${d[e.strategy]}${n}${a}${l}`;
128
+ }
129
+ }
130
+ }
131
+ function $(e, t) {
132
+ const s = e.conditions.length ? `When ${r(
133
+ e.conditions.map((n) => w(n, t)),
134
+ e.match === "all" ? "and" : "or"
135
+ )}, ` : "For every request, ", o = e.fallback.kind === "person" ? ` If nobody can take it, ${t.person(e.fallback.user)} does.` : e.action.kind === "team" ? "" : " If nobody can take it, it waits on the desk.";
136
+ return `${s}${m(e.action, t)}.${o}`;
137
+ }
138
+ const p = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
139
+ function u(e) {
140
+ const [t, s] = e.split(":").map(Number);
141
+ return !Number.isFinite(t) || !Number.isFinite(s) ? e : `${(t + 11) % 12 + 1}:${String(s).padStart(2, "0")} ${t < 12 ? "AM" : "PM"}`;
142
+ }
143
+ function v(e) {
144
+ const t = [...e.days].sort();
145
+ return `${t.length > 2 && t.every((o, n) => n === 0 || o === t[n - 1] + 1) ? `${p[t[0]]}–${p[t.at(-1)]}` : t.map((o) => p[o]).join(", ")}, ${u(e.start)} – ${u(e.end)} Eastern`;
146
+ }
147
+ function _(e) {
148
+ return {
149
+ id: `r${Date.now().toString(36)}${Math.floor(Math.random() * 1e3)}`,
150
+ name: `Rule ${e}`,
151
+ active: !0,
152
+ match: "all",
153
+ conditions: [],
154
+ action: { kind: "share", people: [], strategy: "fewest_open", give_to_cover: !0 },
155
+ fallback: { kind: "desk" },
156
+ on_type_change: !1,
157
+ note: null
158
+ };
159
+ }
160
+ export {
161
+ h as SOURCE_LABELS,
162
+ f as STRATEGY_OPTIONS,
163
+ d as STRATEGY_PHRASE,
164
+ m as actionWords,
165
+ _ as blankRule,
166
+ u as clock12,
167
+ w as conditionWords,
168
+ v as hoursWords,
169
+ r as listWords,
170
+ $ as ruleSentence
171
+ };