@nivaro/react 0.3.127 → 0.3.129

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 (50) hide show
  1. package/dist/components/slots/CommentsSlot.js +124 -95
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +29 -3
  5. package/dist/index.js +150 -147
  6. package/dist/shared/components/CollectionBrowserView.js +3259 -3211
  7. package/dist/shared/components/DataTable.js +406 -401
  8. package/dist/shared/components/ItemEditForm.js +4485 -4409
  9. package/dist/shared/components/MatrixEditor.js +548 -490
  10. package/dist/shared/components/MyWorkView.js +284 -274
  11. package/dist/shared/components/NotificationBell.js +264 -218
  12. package/dist/shared/components/RecordGridEditor.js +582 -472
  13. package/dist/shared/components/ai/AiMarkdown.js +215 -196
  14. package/dist/shared/components/chat/chat-core.js +331 -346
  15. package/dist/shared/components/chat/chat-typing.js +25 -0
  16. package/dist/shared/components/command-center/CommandCenterView.js +1 -1
  17. package/dist/shared/components/command-center/PeekPanel.js +8 -1
  18. package/dist/shared/components/command-center/api.js +17 -9
  19. package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
  20. package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
  21. package/dist/shared/components/item-edit/GroupSection.js +1 -1
  22. package/dist/shared/components/item-edit/HeaderTools.js +216 -210
  23. package/dist/shared/components/item-edit/InlineTableField.js +432 -429
  24. package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
  25. package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
  26. package/dist/shared/components/item-edit/RowComments.js +33 -30
  27. package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
  28. package/dist/shared/components/item-edit/live-related.js +29 -16
  29. package/dist/shared/components/item-edit/record-opened-live.js +86 -0
  30. package/dist/shared/components/panels/CommentPanel.js +345 -327
  31. package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
  32. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  33. package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
  34. package/dist/shared/components/queue/QueueItemSheet.js +171 -130
  35. package/dist/shared/components/record-grid-guard.js +85 -0
  36. package/dist/shared/components/support/TicketDetailSheet.js +213 -174
  37. package/dist/shared/components/trackers/MirroredText.js +40 -0
  38. package/dist/shared/components/trackers/SourceTracker.js +168 -0
  39. package/dist/shared/components/trackers/TrackerChip.js +71 -0
  40. package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
  41. package/dist/shared/components/trackers/TrackerPickers.js +245 -0
  42. package/dist/shared/components/trackers/tracker-model.js +126 -0
  43. package/dist/shared/components/trackers/use-tracker-link.js +159 -0
  44. package/dist/shared/lib/at-risk-fields.js +14 -0
  45. package/dist/shared/lib/live-queries.js +9 -8
  46. package/dist/shared/lib/live-screen.js +77 -76
  47. package/dist/shared/lib/presence-hooks.js +190 -127
  48. package/dist/shared/lib/user-sync.js +78 -65
  49. package/dist/shared/lib/waiting-count.js +40 -29
  50. package/package.json +1 -1
@@ -1,12 +1,13 @@
1
- import { jsxs as u, jsx as a, Fragment as c } from "react/jsx-runtime";
2
- import { useQuery as h } from "@tanstack/react-query";
3
- import { Eye as g, EyeOff as x } from "lucide-react";
4
- import { useNivaroClient as y } from "../../context.js";
5
- import { get as b } from "../../lib/commands.js";
6
- import { formatRelative as v, formatDateTime as d, cn as w } from "../../lib/utils.js";
7
- import { UserChip as $ } from "../item-edit/UserChip.js";
8
- const _ = "pipeline-owner-opened";
9
- function N(e, r = v) {
1
+ import { jsxs as u, jsx as p, Fragment as h } from "react/jsx-runtime";
2
+ import { useQuery as g } from "@tanstack/react-query";
3
+ import { Eye as x, EyeOff as y } from "lucide-react";
4
+ import { useNivaroClient as b } from "../../context.js";
5
+ import { get as v } from "../../lib/commands.js";
6
+ import { formatRelative as w, formatDateTime as d, cn as $ } from "../../lib/utils.js";
7
+ import { useRefreshOnRecordOpened as _ } from "../item-edit/record-opened-live.js";
8
+ import { UserChip as O } from "../item-edit/UserChip.js";
9
+ const f = "pipeline-owner-opened";
10
+ function N(e, r = w) {
10
11
  var s, n, t;
11
12
  if (e.status === "not_opened")
12
13
  return {
@@ -24,34 +25,34 @@ function N(e, r = v) {
24
25
  tail: ` opened this ${r(e.opened_at)}${i}`
25
26
  };
26
27
  }
27
- function A({
28
+ function C({
28
29
  collection: e,
29
30
  item: r,
30
31
  stateId: i,
31
32
  className: l
32
33
  }) {
33
- const s = y(), { data: n } = h({
34
- queryKey: [_, e, r, i],
34
+ const s = b(), { data: n } = g({
35
+ queryKey: [f, e, r, i],
35
36
  queryFn: () => s.request(
36
- b(`/pipelines/instance/${e}/${r}/owner-opened`)
37
- ).then((f) => f.data ?? null),
37
+ v(`/pipelines/instance/${e}/${r}/owner-opened`)
38
+ ).then((c) => c.data ?? null),
38
39
  staleTime: 6e4,
39
40
  retry: !1
40
41
  });
41
- if (!n || n.status !== "opened" && n.status !== "not_opened") return null;
42
+ if (_(e, r, [f, e, r]), !n || n.status !== "opened" && n.status !== "not_opened") return null;
42
43
  const t = N(n);
43
44
  if (!t) return null;
44
- const o = n.status === "opened", m = o ? g : x, p = o ? d(n.opened_at) : d(n.entered_at);
45
+ const o = n.status === "opened", m = o ? x : y, a = o ? d(n.opened_at) : d(n.entered_at);
45
46
  return /* @__PURE__ */ u(
46
47
  "p",
47
48
  {
48
49
  "data-owner-opened": n.status,
49
- className: w(
50
+ className: $(
50
51
  "flex items-start gap-1.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400",
51
52
  l
52
53
  ),
53
54
  children: [
54
- /* @__PURE__ */ a(
55
+ /* @__PURE__ */ p(
55
56
  m,
56
57
  {
57
58
  "aria-hidden": !0,
@@ -62,11 +63,11 @@ function A({
62
63
  "span",
63
64
  {
64
65
  className: "min-w-0 text-left",
65
- "data-tip": o ? `Opened ${p}` : `In this step since ${p}`,
66
+ "data-tip": o ? `Opened ${a}` : `In this step since ${a}`,
66
67
  children: [
67
68
  t.lead,
68
- o && n.by ? /* @__PURE__ */ u(c, { children: [
69
- /* @__PURE__ */ a($, { userId: n.by.id, children: /* @__PURE__ */ a(
69
+ o && n.by ? /* @__PURE__ */ u(h, { children: [
70
+ /* @__PURE__ */ p(O, { userId: n.by.id, children: /* @__PURE__ */ p(
70
71
  "button",
71
72
  {
72
73
  type: "button",
@@ -86,7 +87,7 @@ function A({
86
87
  );
87
88
  }
88
89
  export {
89
- _ as OWNER_OPENED_HEAD,
90
- A as OwnerOpenedLine,
90
+ f as OWNER_OPENED_HEAD,
91
+ C as OwnerOpenedLine,
91
92
  N as ownerOpenedWords
92
93
  };
@@ -73,7 +73,7 @@ function ve({
73
73
  enabled: !!((R = d == null ? void 0 : d.findings) != null && R.length),
74
74
  staleTime: 6e4
75
75
  }), L = () => {
76
- i.invalidateQueries({ queryKey: ["record-integrity", t, r] }), i.invalidateQueries({ queryKey: ["item", t, r] }), i.invalidateQueries({ queryKey: [t, r] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
76
+ i.invalidateQueries({ queryKey: ["record-integrity", t, r] }), i.invalidateQueries({ queryKey: ["item", t, r] }), i.invalidateQueries({ queryKey: ["rrv-record", t, r] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
77
77
  };
78
78
  if (!(d != null && d.enabled) || d.findings.length === 0) return null;
79
79
  const v = d.findings.length;
@@ -49,7 +49,7 @@ function F({ s, onApplied: m }) {
49
49
  onSuccess: (e) => {
50
50
  $.success(
51
51
  `${e.team.action === "create" ? "Created" : "Linked"} ${e.team.name} on ${e.cells.length} cell${e.cells.length === 1 ? "" : "s"}`
52
- ), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["owner-groups"] }), e.team.id != null && m(e.team.id);
52
+ ), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["pipeline-all-owner-groups"] }), e.team.id != null && m(e.team.id);
53
53
  },
54
54
  onError: (e) => w(e, "Could not apply")
55
55
  }), q = [...new Set(s.cells.map((e) => e.template_name ?? "Template"))], k = s.members.filter((e) => e.redacted || e.status && e.status !== "active");
@@ -1,127 +1,167 @@
1
- import { jsxs as n, jsx as r, Fragment as ae } from "react/jsx-runtime";
2
- import { useQueryClient as ne, useQuery as H, useMutation as B } from "@tanstack/react-query";
3
- import { ExternalLink as oe, ArrowRight as O } from "lucide-react";
4
- import { useState as _, useEffect as se } from "react";
5
- import { toast as C } from "sonner";
6
- import { useNivaroClient as ie, useItemNavigation as de } from "../../context.js";
7
- import { get as V, post as U } from "../../lib/commands.js";
8
- import { formatMultiValue as le } from "../../lib/format-value.js";
9
- import { useLiveRecord as ce, batchTouches as S, LIVE_ASPECTS as I } from "../../lib/live.js";
10
- import { userErrorMessage as me } from "../../lib/safe-error.js";
11
- import { cn as W, formatRelative as ue, humanHours as pe } from "../../lib/utils.js";
12
- import { transitionRequirementsFromError as be } from "../panels/PipelinePanel.js";
13
- import { TransitionRequirementsDialog as xe } from "../panels/TransitionRequirementsDialog.js";
14
- import { Badge as he } from "../ui/badge.js";
15
- import { Sheet as fe, SheetContent as ge, SheetHeader as ye, SheetTitle as ve } from "../ui/sheet.js";
16
- import { OwnerAvatars as ke } from "./OwnerAvatars.js";
17
- import { pathHeader as Ne } from "./path-label.js";
18
- import { useTransitionNote as we, needsTransitionNote as qe } from "./transition-note.js";
19
- function _e(t) {
20
- return (t ?? []).filter((b) => b.in_row_menu !== !1);
1
+ import { jsxs as n, jsx as r, Fragment as ie } from "react/jsx-runtime";
2
+ import { useQueryClient as le, useQuery as W, useMutation as U } from "@tanstack/react-query";
3
+ import { ExternalLink as de, ArrowRight as z } from "lucide-react";
4
+ import { useState as K, useEffect as ce } from "react";
5
+ import { toast as k } from "sonner";
6
+ import { useNivaroClient as me, useItemNavigation as ue } from "../../context.js";
7
+ import { get as G, post as J } from "../../lib/commands.js";
8
+ import { formatMultiValue as pe } from "../../lib/format-value.js";
9
+ import { useLiveRecord as be, batchTouches as M, LIVE_ASPECTS as I } from "../../lib/live.js";
10
+ import { usePresence as xe } from "../../lib/presence-hooks.js";
11
+ import { userErrorMessage as he } from "../../lib/safe-error.js";
12
+ import { cn as X, formatRelative as fe, humanHours as ge } from "../../lib/utils.js";
13
+ import { lockedMoveOffer as ye, transitionRequirementsFromError as ve } from "../panels/PipelinePanel.js";
14
+ import { TransitionRequirementsDialog as ke } from "../panels/TransitionRequirementsDialog.js";
15
+ import { Badge as Ne } from "../ui/badge.js";
16
+ import { Sheet as we, SheetContent as _e, SheetHeader as qe, SheetTitle as Ce } from "../ui/sheet.js";
17
+ import { OwnerAvatars as Se } from "./OwnerAvatars.js";
18
+ import { pathHeader as Te } from "./path-label.js";
19
+ import { useTransitionNote as Ke, needsTransitionNote as Me } from "./transition-note.js";
20
+ function Ie(t) {
21
+ return (t ?? []).filter((c) => c.in_row_menu !== !1);
21
22
  }
22
- function Ce(t) {
23
- return pe(t);
23
+ function Pe(t) {
24
+ return ge(t);
24
25
  }
25
- const Se = Ne;
26
- function p({ label: t, children: b }) {
26
+ const Ae = Te;
27
+ function h({ label: t, children: c }) {
27
28
  return /* @__PURE__ */ n("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
28
29
  /* @__PURE__ */ r("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: t }),
29
- /* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: b })
30
+ /* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: c })
30
31
  ] });
31
32
  }
32
- function We({
33
+ function $e(t, c, N) {
34
+ return {
35
+ transition_id: t,
36
+ ...c ? { comment: c } : {},
37
+ ...N ? { lock_ack: !0 } : {}
38
+ };
39
+ }
40
+ function et({
33
41
  item: t,
34
- onOpenChange: b,
35
- onClaim: z,
36
- onRelease: G,
37
- workNextActive: J,
38
- onNext: K,
39
- refetchItems: T,
40
- stateLabels: g,
41
- collectionLabel: M,
42
- claimsEnabled: X = !0,
43
- columnFormats: h,
44
- fieldLabel: y,
45
- width: Y,
46
- itemLayout: P,
47
- onOpenRecord: A
42
+ onOpenChange: c,
43
+ onClaim: N,
44
+ onRelease: Y,
45
+ workNextActive: Z,
46
+ onNext: P,
47
+ refetchItems: A,
48
+ stateLabels: w,
49
+ collectionLabel: $,
50
+ claimsEnabled: L = !0,
51
+ columnFormats: g,
52
+ fieldLabel: _,
53
+ width: ee,
54
+ itemLayout: E,
55
+ onOpenRecord: Q
48
56
  }) {
49
- var $;
50
- const x = ne(), f = ie(), { open: Z, urlFor: L } = de(), [v, E] = _(""), [l, k] = _(null), [N, c] = _(null), Q = we(), o = t == null ? void 0 : t.collection, s = t == null ? void 0 : t.item_id;
51
- se(() => c(null), [o, s]);
52
- const { data: m } = H({
57
+ var H;
58
+ const f = le(), y = me(), { open: te, urlFor: re } = ue(), [q, R] = K(""), [m, C] = K(null), [S, p] = K(null), j = Ke(), o = t == null ? void 0 : t.collection, s = t == null ? void 0 : t.item_id;
59
+ ce(() => p(null), [o, s]);
60
+ const { data: l } = W({
53
61
  queryKey: ["queue-sheet-instance", o, s],
54
- queryFn: () => f.request(V(`/pipelines/instance/${o}/${s}`)).then((e) => e.data),
62
+ queryFn: () => y.request(G(`/pipelines/instance/${o}/${s}`)).then((e) => e.data),
55
63
  enabled: !!o && !!s
56
- }), { data: u } = H({
64
+ }), { data: b } = W({
57
65
  queryKey: ["queue-sheet-comments", o, s],
58
- queryFn: () => f.request(V("/comments", { collection: o, item: s })).then((e) => ({ data: (e.data ?? []).filter((a) => !a.deleted) })).catch(() => ({ data: [] })),
66
+ queryFn: () => y.request(G("/comments", { collection: o, item: s })).then((e) => ({ data: (e.data ?? []).filter((a) => !a.deleted) })).catch(() => ({ data: [] })),
59
67
  enabled: !!o && !!s
60
- }), i = B({
61
- mutationFn: ({ transitionId: e, comment: a }) => f.request(
62
- U(`/pipelines/instance/${o}/${s}/transition`, {
63
- transition_id: e,
64
- ...a ? { comment: a } : {}
65
- })
68
+ }), { viewers: x } = xe(o, s), i = U({
69
+ mutationFn: ({
70
+ transitionId: e,
71
+ comment: a,
72
+ lockAck: v
73
+ }) => y.request(
74
+ J(
75
+ `/pipelines/instance/${o}/${s}/transition`,
76
+ $e(e, a, v)
77
+ )
66
78
  ),
67
79
  onSuccess: () => {
68
- k(null), c(null), x.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), T(), C.success("Transitioned");
80
+ C(null), p(null), f.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), A(), k.success("Transitioned");
69
81
  },
70
- onError: (e, { transitionId: a, comment: re }) => {
71
- c(null);
72
- const D = be(e);
73
- if (D) {
74
- k((q) => ({
75
- payload: D,
82
+ onError: (e, { transitionId: a, comment: v }) => {
83
+ p(null);
84
+ const O = ye(e);
85
+ if (O) {
86
+ const u = ((l == null ? void 0 : l.available_transitions) ?? []).find((se) => se.id === a), oe = (u == null ? void 0 : u.label) || "Move";
87
+ k.warning(O.message, {
88
+ id: `nvr-locked-move:${o}:${String(s)}`,
89
+ duration: 2e4,
90
+ action: {
91
+ label: `${oe} anyway`,
92
+ onClick: () => i.mutate({ transitionId: a, comment: v, lockAck: !0 })
93
+ },
94
+ cancel: { label: "Wait", onClick: () => {
95
+ } }
96
+ });
97
+ return;
98
+ }
99
+ const V = ve(e);
100
+ if (V) {
101
+ C((u) => ({
102
+ payload: V,
76
103
  transitionId: a,
77
- comment: re,
78
- revision: ((q == null ? void 0 : q.revision) ?? 0) + 1
104
+ comment: v,
105
+ revision: ((u == null ? void 0 : u.revision) ?? 0) + 1
79
106
  }));
80
107
  return;
81
108
  }
82
- C.error(me(e, "Transition failed"));
109
+ k.error(he(e, "Transition failed"));
83
110
  }
84
- }), R = B({
85
- mutationFn: (e) => f.request(U("/comments", { collection: o, item: s, text: e })),
111
+ }), F = U({
112
+ mutationFn: (e) => y.request(J("/comments", { collection: o, item: s, text: e })),
86
113
  onSuccess: () => {
87
- E(""), x.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
114
+ R(""), f.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
88
115
  },
89
- onError: () => C.error("Failed to post comment")
116
+ onError: () => k.error("Failed to post comment")
90
117
  });
91
- ce(o, s, (e) => {
92
- S(e, I.state) ? (x.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), e.own || T()) : S(e, I.owners) && x.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), S(e, I.comments) && x.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
118
+ be(o, s, (e) => {
119
+ M(e, I.state) ? (f.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), e.own || A()) : M(e, I.owners) && f.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), M(e, I.comments) && f.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
93
120
  });
94
- const w = _e(m == null ? void 0 : m.available_transitions), d = N && w.some((e) => e.id === N.id) ? N : null, j = new Map(((m == null ? void 0 : m.states) ?? []).map((e) => [e.id, e])), F = (e) => {
95
- const a = j.get(e.to_state);
121
+ const T = Ie(l == null ? void 0 : l.available_transitions), d = S && T.some((e) => e.id === S.id) ? S : null, B = new Map(((l == null ? void 0 : l.states) ?? []).map((e) => [e.id, e])), D = (e) => {
122
+ const a = B.get(e.to_state);
96
123
  return e.label || (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || "Move";
97
- }, ee = (e) => {
98
- const a = j.get(e.to_state);
124
+ }, ae = (e) => {
125
+ const a = B.get(e.to_state);
99
126
  return (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || e.label || "the next step";
100
- }, te = async (e) => {
127
+ }, ne = async (e) => {
101
128
  if (!i.isPending) {
102
- if (qe(e)) {
103
- c(null);
104
- const a = await Q.ask(F(e));
129
+ if (Me(e)) {
130
+ p(null);
131
+ const a = await j.ask(D(e));
105
132
  if (!a) return;
106
133
  i.mutate({ transitionId: e.id, comment: a });
107
134
  return;
108
135
  }
109
- c(e);
136
+ p(e);
110
137
  }
111
138
  };
112
- return /* @__PURE__ */ n(fe, { open: !!t, onOpenChange: b, children: [
139
+ return /* @__PURE__ */ n(we, { open: !!t, onOpenChange: c, children: [
113
140
  /* @__PURE__ */ r(
114
- ge,
141
+ _e,
115
142
  {
116
143
  side: "right",
117
144
  className: "flex max-w-full flex-col gap-0 p-0",
118
- style: { width: Y ?? 480, maxWidth: "96vw" },
119
- children: t && /* @__PURE__ */ n(ae, { children: [
120
- /* @__PURE__ */ r(ye, { className: "shrink-0 border-b border-slate-200 px-5 py-4 dark:border-border", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3 pr-6", children: [
145
+ style: { width: ee ?? 480, maxWidth: "96vw" },
146
+ children: t && /* @__PURE__ */ n(ie, { children: [
147
+ /* @__PURE__ */ r(qe, { className: "shrink-0 border-b border-slate-200 px-5 py-4 dark:border-border", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3 pr-6", children: [
121
148
  /* @__PURE__ */ n("div", { className: "min-w-0", children: [
122
- /* @__PURE__ */ r(ve, { className: "truncate text-[15px] font-semibold", children: t.label }),
149
+ /* @__PURE__ */ r(Ce, { className: "truncate text-[15px] font-semibold", children: t.label }),
123
150
  /* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center gap-2", children: [
124
- /* @__PURE__ */ r(he, { variant: "outline", children: M ? M(t.collection) : t.collection }),
151
+ /* @__PURE__ */ r(Ne, { variant: "outline", children: $ ? $(t.collection) : t.collection }),
152
+ x.length > 0 && /* @__PURE__ */ n(
153
+ "span",
154
+ {
155
+ "data-queue-sheet-viewers": x.length,
156
+ "data-tip": `Also viewing: ${x.map((e) => e.name).join(", ")}`,
157
+ className: "relative inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan",
158
+ children: [
159
+ /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "h-1.5 w-1.5 rounded-full bg-nvr-cyan" }),
160
+ x.length === 1 ? x[0].name : `${x.length} others`,
161
+ /* @__PURE__ */ r("span", { className: "sr-only", children: " also viewing" })
162
+ ]
163
+ }
164
+ ),
125
165
  t.state && /* @__PURE__ */ r(
126
166
  "span",
127
167
  {
@@ -130,7 +170,7 @@ function We({
130
170
  backgroundColor: t.state_color ? `${t.state_color}1a` : void 0,
131
171
  color: t.state_color ?? void 0
132
172
  },
133
- children: (g == null ? void 0 : g[t.state]) ?? t.state
173
+ children: (w == null ? void 0 : w[t.state]) ?? t.state
134
174
  }
135
175
  )
136
176
  ] })
@@ -138,60 +178,60 @@ function We({
138
178
  /* @__PURE__ */ n(
139
179
  "a",
140
180
  {
141
- href: L({
181
+ href: re({
142
182
  collection: t.collection,
143
183
  itemId: t.item_id,
144
- layoutSlug: P ?? null
184
+ layoutSlug: E ?? null
145
185
  }),
146
186
  onClick: (e) => {
147
- e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0 || (e.preventDefault(), A ? A(t) : Z({
187
+ e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0 || (e.preventDefault(), Q ? Q(t) : te({
148
188
  collection: t.collection,
149
189
  itemId: t.item_id,
150
- layoutSlug: P ?? null
190
+ layoutSlug: E ?? null
151
191
  }));
152
192
  },
153
193
  className: "flex shrink-0 items-center gap-1 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
154
194
  children: [
155
195
  "Open ",
156
- /* @__PURE__ */ r(oe, { className: "h-3 w-3" })
196
+ /* @__PURE__ */ r(de, { className: "h-3 w-3" })
157
197
  ]
158
198
  }
159
199
  )
160
200
  ] }) }),
161
201
  /* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
162
202
  /* @__PURE__ */ n("div", { className: "mb-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
163
- /* @__PURE__ */ r(p, { label: "Owners", children: /* @__PURE__ */ r(ke, { owners: t.owners, max: 6 }) }),
164
- /* @__PURE__ */ r(p, { label: "Claimed by", children: (($ = t.claimed_by) == null ? void 0 : $.name) ?? "—" }),
165
- /* @__PURE__ */ r(p, { label: "SLA", children: t.sla_status ? /* @__PURE__ */ r(
203
+ /* @__PURE__ */ r(h, { label: "Owners", children: /* @__PURE__ */ r(Se, { owners: t.owners, max: 6 }) }),
204
+ /* @__PURE__ */ r(h, { label: "Claimed by", children: ((H = t.claimed_by) == null ? void 0 : H.name) ?? "—" }),
205
+ /* @__PURE__ */ r(h, { label: "SLA", children: t.sla_status ? /* @__PURE__ */ r(
166
206
  "span",
167
207
  {
168
- className: W(
208
+ className: X(
169
209
  "rounded px-1.5 py-0.5 text-[11px] font-medium",
170
210
  t.sla_status === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : t.sla_status === "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"
171
211
  ),
172
212
  children: t.sla_status
173
213
  }
174
214
  ) : "—" }),
175
- /* @__PURE__ */ r(p, { label: "Aging", children: Ce(t.aging_hours) }),
176
- t.at_risk && /* @__PURE__ */ r(p, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
177
- Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(p, { label: (y == null ? void 0 : y(e)) || Se(e), children: a == null || a === "" ? "—" : h != null && h[e] ? le(String(a), h[e]) : String(a) }, e))
215
+ /* @__PURE__ */ r(h, { label: "Aging", children: Pe(t.aging_hours) }),
216
+ t.at_risk && /* @__PURE__ */ r(h, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
217
+ Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(h, { label: (_ == null ? void 0 : _(e)) || Ae(e), children: a == null || a === "" ? "—" : g != null && g[e] ? pe(String(a), g[e]) : String(a) }, e))
178
218
  ] }),
179
- w.length > 0 && /* @__PURE__ */ n("div", { className: "mb-4", children: [
219
+ T.length > 0 && /* @__PURE__ */ n("div", { className: "mb-4", children: [
180
220
  /* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Transitions" }),
181
- /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: w.map((e) => /* @__PURE__ */ n(
221
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: T.map((e) => /* @__PURE__ */ n(
182
222
  "button",
183
223
  {
184
224
  type: "button",
185
225
  disabled: i.isPending,
186
226
  "aria-pressed": (d == null ? void 0 : d.id) === e.id,
187
- onClick: () => void te(e),
188
- className: W(
227
+ onClick: () => void ne(e),
228
+ className: X(
189
229
  "flex items-center gap-1 rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] font-medium text-slate-700 hover:border-nvr-cyan hover:text-nvr-navy disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
190
230
  (d == null ? void 0 : d.id) === e.id && "border-nvr-cyan"
191
231
  ),
192
232
  children: [
193
- F(e),
194
- /* @__PURE__ */ r(O, { className: "h-3 w-3 text-slate-400" })
233
+ D(e),
234
+ /* @__PURE__ */ r(z, { className: "h-3 w-3 text-slate-400" })
195
235
  ]
196
236
  },
197
237
  e.id
@@ -209,7 +249,7 @@ function We({
209
249
  /* @__PURE__ */ r("span", { className: "font-semibold", children: t.label }),
210
250
  " to",
211
251
  " ",
212
- /* @__PURE__ */ r("span", { className: "font-semibold", children: ee(d) }),
252
+ /* @__PURE__ */ r("span", { className: "font-semibold", children: ae(d) }),
213
253
  "?"
214
254
  ] }),
215
255
  /* @__PURE__ */ n("div", { className: "mt-2 flex gap-2", children: [
@@ -228,7 +268,7 @@ function We({
228
268
  {
229
269
  type: "button",
230
270
  disabled: i.isPending,
231
- onClick: () => c(null),
271
+ onClick: () => p(null),
232
272
  className: "h-7 rounded-md border border-slate-200 bg-white px-3 text-[12px] text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-300",
233
273
  children: "Keep"
234
274
  }
@@ -238,11 +278,11 @@ function We({
238
278
  }
239
279
  )
240
280
  ] }),
241
- (X || t.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
281
+ (L || t.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
242
282
  "button",
243
283
  {
244
284
  type: "button",
245
- onClick: () => t.claimed_by ? G(t) : z(t),
285
+ onClick: () => t.claimed_by ? Y(t) : N(t),
246
286
  className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:bg-nvr-cyan/90",
247
287
  children: t.claimed_by ? "Release claim" : "Claim this item"
248
288
  }
@@ -250,21 +290,21 @@ function We({
250
290
  /* @__PURE__ */ n("div", { children: [
251
291
  /* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Comments" }),
252
292
  /* @__PURE__ */ n("div", { className: "space-y-2.5", children: [
253
- ((u == null ? void 0 : u.data) ?? []).map((e) => /* @__PURE__ */ n("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
293
+ ((b == null ? void 0 : b.data) ?? []).map((e) => /* @__PURE__ */ n("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
254
294
  /* @__PURE__ */ n("p", { className: "text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
255
295
  [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email || "—",
256
- /* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: ue(e.created_at) })
296
+ /* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: fe(e.created_at) })
257
297
  ] }),
258
298
  /* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children: e.text })
259
299
  ] }, e.id)),
260
- ((u == null ? void 0 : u.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
300
+ ((b == null ? void 0 : b.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
261
301
  ] }),
262
302
  /* @__PURE__ */ n("div", { className: "mt-2.5", children: [
263
303
  /* @__PURE__ */ r(
264
304
  "textarea",
265
305
  {
266
- value: v,
267
- onChange: (e) => E(e.target.value),
306
+ value: q,
307
+ onChange: (e) => R(e.target.value),
268
308
  placeholder: "Add a comment…",
269
309
  rows: 2,
270
310
  className: "w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
@@ -274,8 +314,8 @@ function We({
274
314
  "button",
275
315
  {
276
316
  type: "button",
277
- disabled: !v.trim() || R.isPending,
278
- onClick: () => R.mutate(v.trim()),
317
+ disabled: !q.trim() || F.isPending,
318
+ onClick: () => F.mutate(q.trim()),
279
319
  className: "mt-1 rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:text-slate-800 disabled:opacity-50 dark:border-border dark:text-slate-300",
280
320
  children: "Post"
281
321
  }
@@ -283,40 +323,41 @@ function We({
283
323
  ] })
284
324
  ] })
285
325
  ] }),
286
- J && K && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ n(
326
+ Z && P && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ n(
287
327
  "button",
288
328
  {
289
329
  type: "button",
290
- onClick: K,
330
+ onClick: P,
291
331
  className: "flex w-full items-center justify-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-2 text-[13px] font-semibold text-white hover:bg-nvr-cyan/90",
292
332
  children: [
293
333
  "Next ",
294
- /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5" })
334
+ /* @__PURE__ */ r(z, { className: "h-3.5 w-3.5" })
295
335
  ]
296
336
  }
297
337
  ) })
298
338
  ] })
299
339
  }
300
340
  ),
301
- l && /* @__PURE__ */ r(
302
- xe,
341
+ m && /* @__PURE__ */ r(
342
+ ke,
303
343
  {
304
- payload: l.payload,
305
- transitionId: l.transitionId,
306
- isRetry: l.revision > 1,
344
+ payload: m.payload,
345
+ transitionId: m.transitionId,
346
+ isRetry: m.revision > 1,
307
347
  onSubmitted: () => i.mutate({
308
- transitionId: l.transitionId,
309
- comment: l.comment
348
+ transitionId: m.transitionId,
349
+ comment: m.comment
310
350
  }),
311
351
  executing: i.isPending,
312
- onClose: () => k(null)
352
+ onClose: () => C(null)
313
353
  },
314
- l.revision
354
+ m.revision
315
355
  ),
316
- Q.dialog
356
+ j.dialog
317
357
  ] });
318
358
  }
319
359
  export {
320
- We as QueueItemSheet,
321
- _e as peekTransitions
360
+ et as QueueItemSheet,
361
+ Ie as peekTransitions,
362
+ $e as sheetTransitionBody
322
363
  };