@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,166 +1,188 @@
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
- import { useState as b } from "react";
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
- import { SimpleSelect as R } from "../ui/SimpleSelect.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
- import { STATUS_TONE as A } from "./types.js";
21
- const L = [
1
+ import { jsx as r, jsxs as n, Fragment as b } from "react/jsx-runtime";
2
+ import { useQueryClient as X, useQuery as $, useMutation as k } from "@tanstack/react-query";
3
+ import { Loader2 as Y, PlayCircle as Z, Paperclip as I } from "lucide-react";
4
+ import { useState as v, useEffect as ee } from "react";
5
+ import { useNivaroClient as te, useApiFetchConfig as re, useItemNavigation as ae, useNavigation as ne } from "../../context.js";
6
+ import { get as R, post as F, patch as se } from "../../lib/commands.js";
7
+ import { useLiveFade as le } from "../../lib/live-screen.js";
8
+ import { useBackgroundArm as ie } from "../../lib/live-views.js";
9
+ import { useTopicPresence as oe, signalSentence as A } from "../../lib/presence-signals.js";
10
+ import { replayHref as de } from "../../lib/replay-capture.js";
11
+ import { foldShareHistory as ce, historyLine as ue } from "../../lib/screen-share.js";
12
+ import { TaskDoButton as me } from "../ai/TaskDo.js";
13
+ import { RelationCombobox as pe } from "../item-edit/RelationCombobox.js";
14
+ import { MirroredAuthor as xe, MirroredBody as he, GitlabSharedNotice as ge } from "../trackers/MirroredText.js";
15
+ import { TicketTrackerSection as fe } from "../trackers/SourceTracker.js";
16
+ import { TrackerChip as ye } from "../trackers/TrackerChip.js";
17
+ import { useSourceTracker as be } from "../trackers/use-tracker-link.js";
18
+ import { SimpleSelect as K } from "../ui/SimpleSelect.js";
19
+ import { Sheet as ke, SheetContent as ve, SheetTitle as P, SheetDescription as D, SheetHeader as Ne } from "../ui/sheet.js";
20
+ import { ScreenSharePanel as we } from "./ScreenShare.js";
21
+ import { isSupportContextFile as N } from "./support-context.js";
22
+ import { TicketSlowScreens as Se } from "./TicketSlowScreens.js";
23
+ import { TicketTraffic as _e } from "./TicketTraffic.js";
24
+ import { STATUS_TONE as L } from "./types.js";
25
+ const U = [
22
26
  { value: "open", label: "Open" },
23
27
  { value: "in_progress", label: "In progress" },
24
28
  { value: "done", label: "Done" },
25
29
  { value: "cancelled", label: "Cancelled" }
26
30
  ];
27
- function k(s) {
28
- return s ? new Date(s).toLocaleString(void 0, {
31
+ function w(a) {
32
+ return a ? new Date(a).toLocaleString(void 0, {
29
33
  month: "short",
30
34
  day: "numeric",
31
35
  hour: "numeric",
32
36
  minute: "2-digit"
33
37
  }) : "";
34
38
  }
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 }) {
39
+ const O = "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", qe = "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";
40
+ function Te({ status: a, label: o }) {
37
41
  var l;
38
- return /* @__PURE__ */ a(
42
+ return /* @__PURE__ */ r(
39
43
  "span",
40
44
  {
41
- "data-ticket-status": s,
42
- className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${A[s] ?? A.open}`,
43
- children: c ?? ((l = L.find((i) => i.value === s)) == null ? void 0 : l.label) ?? s
45
+ "data-ticket-status": a,
46
+ className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${L[a] ?? L.open}`,
47
+ children: o ?? ((l = U.find((i) => i.value === a)) == null ? void 0 : l.label) ?? a
44
48
  }
45
49
  );
46
50
  }
47
- function Ue({
48
- ticketId: s,
49
- onOpenChange: c
51
+ function Ce(a, o) {
52
+ return o == null ? "" : a[String(o)] ?? "";
53
+ }
54
+ function $e(a, o, l) {
55
+ if (o == null) return a;
56
+ const i = String(o);
57
+ if (!l) {
58
+ if (!(i in a)) return a;
59
+ const m = { ...a };
60
+ return delete m[i], m;
61
+ }
62
+ return { ...a, [i]: l };
63
+ }
64
+ function et({
65
+ ticketId: a,
66
+ onOpenChange: o
50
67
  }) {
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(
52
- s != null && Number.isSafeInteger(s) && s > 0 ? `ticket:${s}` : null
53
- ), m = s != null && Number.isSafeInteger(s) && s > 0, {
68
+ const l = te(), i = X(), { apiBase: m } = re(), { urlFor: Q, open: j } = ae(), p = ne(), [E, B] = v({}), x = Ce(E, a), S = (t, s = a) => B((u) => $e(u, s, t)), [_, q] = v(null);
69
+ ee(() => q(null), [a]);
70
+ const [H, W] = v(!1), d = oe(
71
+ a != null && Number.isSafeInteger(a) && a > 0 ? `ticket:${a}` : null
72
+ ), h = a != null && Number.isSafeInteger(a) && a > 0, {
54
73
  data: e,
55
- isLoading: H,
56
- isError: W,
57
- dataUpdatedAt: B
58
- } = q({
59
- queryKey: ["support-ticket", s],
60
- queryFn: () => l.request(T(`/support/tickets/${s}`)).then((t) => t.data),
61
- enabled: m,
62
- retry: (t, n) => {
63
- const g = n == null ? void 0 : n.status;
64
- return g !== 404 && g !== 403 && g !== 400 && t < 2;
74
+ isLoading: M,
75
+ isError: G,
76
+ dataUpdatedAt: z
77
+ } = $({
78
+ queryKey: ["support-ticket", a],
79
+ queryFn: () => l.request(R(`/support/tickets/${a}`)).then((t) => t.data),
80
+ enabled: h,
81
+ retry: (t, s) => {
82
+ const u = s == null ? void 0 : s.status;
83
+ return u !== 404 && u !== 403 && u !== 400 && t < 2;
65
84
  }
66
- }), z = ae(re(B, String(s))), { data: G = [] } = q({
85
+ }), g = be(e ? { kind: "ticket", id: String(e.id) } : null, {
86
+ mayCreate: !!(e != null && e.can.work)
87
+ }), J = le(ie(z, String(a))), { data: V = [] } = $({
67
88
  queryKey: ["support-categories", "all-for", (e == null ? void 0 : e.collection) ?? null],
68
89
  queryFn: () => l.request(
69
- T("/support/categories", e != null && e.collection ? { collection: e.collection } : void 0)
90
+ R("/support/categories", e != null && e.collection ? { collection: e.collection } : void 0)
70
91
  ).then((t) => t.data ?? []),
71
92
  enabled: !!(e != null && e.can.work)
72
- }), x = () => {
73
- i.invalidateQueries({ queryKey: ["support-ticket", s] }), i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), i.invalidateQueries({ queryKey: ["my-work"] });
74
- }, h = (t) => Q(t.message || "That did not work"), S = y({
75
- mutationFn: () => l.request(C(`/support/tickets/${s}/claim`)),
76
- onSuccess: x,
77
- onError: h
78
- }), d = y({
79
- mutationFn: (t) => l.request(te(`/support/tickets/${s}`, t)),
80
- onSuccess: x,
81
- onError: h
82
- }), _ = y({
83
- mutationFn: () => l.request(C(`/support/tickets/${s}/comments`, { text: p.trim() })),
84
- onSuccess: () => {
85
- N(""), o.signalReplying(!1), x();
93
+ }), f = () => {
94
+ i.invalidateQueries({ queryKey: ["support-ticket", a] }), i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), i.invalidateQueries({ queryKey: ["my-work"] });
95
+ }, y = (t) => q(t.message || "That did not work"), T = k({
96
+ mutationFn: () => l.request(F(`/support/tickets/${a}/claim`)),
97
+ onSuccess: f,
98
+ onError: y
99
+ }), c = k({
100
+ mutationFn: (t) => l.request(se(`/support/tickets/${a}`, t)),
101
+ onSuccess: f,
102
+ onError: y
103
+ }), C = k({
104
+ mutationFn: (t) => l.request(F(`/support/tickets/${t.id}/comments`, { text: t.text })),
105
+ onSuccess: (t, s) => {
106
+ S("", s.id), d.signalReplying(!1), f();
86
107
  },
87
- onError: h
108
+ onError: y
88
109
  });
89
- return /* @__PURE__ */ a(ce, { open: s != null, onOpenChange: c, children: /* @__PURE__ */ a(
90
- ue,
110
+ return /* @__PURE__ */ r(ke, { open: a != null, onOpenChange: o, children: /* @__PURE__ */ r(
111
+ ve,
91
112
  {
92
113
  side: "right",
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]"}`,
95
- "data-support-ticket": s ?? "",
114
+ ref: J,
115
+ 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 ${H ? "w-[min(1280px,96vw)] sm:max-w-[min(1280px,96vw)]" : "w-[560px] sm:max-w-[560px]"}`,
116
+ "data-support-ticket": a ?? "",
96
117
  onOpenAutoFocus: (t) => {
97
- var n;
98
- t.preventDefault(), (n = t.currentTarget) == null || n.focus({ preventScroll: !0 });
118
+ var s;
119
+ t.preventDefault(), (s = t.currentTarget) == null || s.focus({ preventScroll: !0 });
99
120
  },
100
- children: !m || W ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-1 px-6 text-center", children: [
101
- /* @__PURE__ */ a(F, { className: "text-[14px] font-semibold text-slate-800 dark:text-slate-100", children: "Request not found" }),
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: [
105
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 pr-6", children: [
106
- /* @__PURE__ */ r("span", { className: "font-mono text-[11.5px] text-slate-400", children: [
121
+ children: !h || G ? /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col items-center justify-center gap-1 px-6 text-center", children: [
122
+ /* @__PURE__ */ r(P, { className: "text-[14px] font-semibold text-slate-800 dark:text-slate-100", children: "Request not found" }),
123
+ /* @__PURE__ */ r(D, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: h ? `Request #${a} does not exist, or it is not one you can open.` : "This link does not point to a request." })
124
+ ] }) : M || !e ? /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center text-slate-400", children: /* @__PURE__ */ r(Y, { className: "h-5 w-5 animate-spin" }) }) : /* @__PURE__ */ n(b, { children: [
125
+ /* @__PURE__ */ n(Ne, { className: "space-y-1.5 border-b border-slate-200 px-5 py-4 text-left dark:border-border", children: [
126
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2 pr-6", children: [
127
+ /* @__PURE__ */ n("span", { className: "font-mono text-[11.5px] text-slate-400", children: [
107
128
  "#",
108
129
  e.id
109
130
  ] }),
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" })
131
+ /* @__PURE__ */ r(Te, { status: e.status, label: e.status_label }),
132
+ e.priority === "urgent" && /* @__PURE__ */ r("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" }),
133
+ g.shown.map((t) => /* @__PURE__ */ r(ye, { tracker: t }, `${t.web_url}:${t.iid}`))
112
134
  ] }),
113
- /* @__PURE__ */ a(F, { className: "text-left text-[16px] font-semibold leading-snug text-slate-900 dark:text-slate-100", children: e.title }),
114
- /* @__PURE__ */ r(K, { className: "text-left text-[12px] text-slate-500 dark:text-muted-foreground", children: [
135
+ /* @__PURE__ */ r(P, { className: "text-left text-[16px] font-semibold leading-snug text-slate-900 dark:text-slate-100", children: e.title }),
136
+ /* @__PURE__ */ n(D, { className: "text-left text-[12px] text-slate-500 dark:text-muted-foreground", children: [
115
137
  e.requester_name ?? "Someone",
116
138
  " · ",
117
- k(e.created_at),
139
+ w(e.created_at),
118
140
  e.category_name ? ` · ${e.category_name}` : ""
119
141
  ] }),
120
- /* @__PURE__ */ a("div", { className: "text-left text-[12px]", children: e.collection && e.item ? /* @__PURE__ */ a(
142
+ /* @__PURE__ */ r("div", { className: "text-left text-[12px]", children: e.collection && e.item ? /* @__PURE__ */ r(
121
143
  "a",
122
144
  {
123
- href: D({ collection: e.collection, itemId: e.item }),
145
+ href: Q({ collection: e.collection, itemId: e.item }),
124
146
  onClick: (t) => {
125
- t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(), U({ collection: e.collection, itemId: e.item }));
147
+ t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(), j({ collection: e.collection, itemId: e.item }));
126
148
  },
127
149
  "data-ticket-record": !0,
128
150
  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",
129
151
  children: e.record_label ?? e.item
130
152
  }
131
- ) : /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: "General Support" }) }),
132
- o.viewers.length > 0 && /* @__PURE__ */ r(
153
+ ) : /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-muted-foreground", children: "General Support" }) }),
154
+ d.viewers.length > 0 && /* @__PURE__ */ n(
133
155
  "p",
134
156
  {
135
157
  className: "mt-1 flex items-center gap-1.5 text-[11.5px] text-sky-700 dark:text-sky-300",
136
158
  "data-ticket-viewing": !0,
137
159
  children: [
138
- /* @__PURE__ */ a("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-sky-400" }),
139
- $(
140
- o.viewers.map((t) => t.name),
160
+ /* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-sky-400" }),
161
+ A(
162
+ d.viewers.map((t) => t.name),
141
163
  "looking at this"
142
164
  )
143
165
  ]
144
166
  }
145
167
  )
146
168
  ] }),
147
- /* @__PURE__ */ r("div", { "data-sheet-body": !0, className: "flex-1 space-y-6 overflow-y-auto px-5 py-5", children: [
148
- e.can.work && /* @__PURE__ */ r(
169
+ /* @__PURE__ */ n("div", { "data-sheet-body": !0, className: "flex-1 space-y-6 overflow-y-auto px-5 py-5", children: [
170
+ e.can.work && /* @__PURE__ */ n(
149
171
  "div",
150
172
  {
151
173
  "data-ticket-controls": !0,
152
174
  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]",
153
175
  children: [
154
- /* @__PURE__ */ r("div", { className: "col-span-2 flex items-center gap-2", 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: [
176
+ /* @__PURE__ */ n("div", { className: "col-span-2 flex items-center gap-2", children: [
177
+ /* @__PURE__ */ r("span", { className: "mr-auto text-[12.5px] text-slate-600 dark:text-slate-300", children: e.assignee_name ? /* @__PURE__ */ n(b, { children: [
156
178
  "Assigned to ",
157
- /* @__PURE__ */ a("b", { className: "font-medium", children: e.assignee_name })
158
- ] }) : /* @__PURE__ */ r(f, { children: [
179
+ /* @__PURE__ */ r("b", { className: "font-medium", children: e.assignee_name })
180
+ ] }) : /* @__PURE__ */ n(b, { children: [
159
181
  "Not picked up yet",
160
182
  e.team_name ? ` · ${e.team_name}` : " · Administrators"
161
183
  ] }) }),
162
- /* @__PURE__ */ a(
163
- oe,
184
+ /* @__PURE__ */ r(
185
+ me,
164
186
  {
165
187
  task: {
166
188
  id: e.id,
@@ -170,58 +192,58 @@ function Ue({
170
192
  category_id: e.category_id,
171
193
  title: e.title
172
194
  },
173
- onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket", s] })
195
+ onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket", a] })
174
196
  }
175
197
  ),
176
- (e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ a(
198
+ (e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ r(
177
199
  "button",
178
200
  {
179
201
  type: "button",
180
202
  "data-ticket-claim": !0,
181
- disabled: S.isPending,
182
- onClick: () => S.mutate(),
203
+ disabled: T.isPending,
204
+ onClick: () => T.mutate(),
183
205
  className: "h-7 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 disabled:opacity-50 dark:text-nvr-cyan",
184
206
  children: e.assignee ? "Take it over" : "Pick it up"
185
207
  }
186
208
  )
187
209
  ] }),
188
- /* @__PURE__ */ r("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
210
+ /* @__PURE__ */ n("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
189
211
  "Status",
190
- /* @__PURE__ */ a(
191
- R,
212
+ /* @__PURE__ */ r(
213
+ K,
192
214
  {
193
215
  value: e.status,
194
- onChange: (t) => d.mutate({ status: t }),
195
- options: L,
216
+ onChange: (t) => c.mutate({ status: t }),
217
+ options: U,
196
218
  ariaLabel: "Status",
197
- className: P
219
+ className: O
198
220
  }
199
221
  )
200
222
  ] }),
201
- /* @__PURE__ */ r("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
223
+ /* @__PURE__ */ n("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
202
224
  "Type",
203
- /* @__PURE__ */ a(
204
- R,
225
+ /* @__PURE__ */ r(
226
+ K,
205
227
  {
206
228
  value: e.category_id != null ? String(e.category_id) : "",
207
- onChange: (t) => d.mutate({ category_id: t ? Number(t) : null }),
229
+ onChange: (t) => c.mutate({ category_id: t ? Number(t) : null }),
208
230
  options: [
209
231
  { value: "", label: "No type" },
210
- ...G.map((t) => ({ value: String(t.id), label: t.name }))
232
+ ...V.map((t) => ({ value: String(t.id), label: t.name }))
211
233
  ],
212
234
  ariaLabel: "Type",
213
- className: P
235
+ className: O
214
236
  }
215
237
  )
216
238
  ] }),
217
- /* @__PURE__ */ r("div", { className: "col-span-2 text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
239
+ /* @__PURE__ */ n("div", { className: "col-span-2 text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
218
240
  "Assignee",
219
- /* @__PURE__ */ a("div", { className: ge, children: /* @__PURE__ */ a(
220
- de,
241
+ /* @__PURE__ */ r("div", { className: qe, children: /* @__PURE__ */ r(
242
+ pe,
221
243
  {
222
244
  collection: "nivaro_users",
223
245
  value: e.assignee,
224
- onChange: (t) => d.mutate({ assignee: t ? String(t) : null }),
246
+ onChange: (t) => c.mutate({ assignee: t ? String(t) : null }),
225
247
  placeholder: "Nobody yet"
226
248
  }
227
249
  ) })
@@ -229,33 +251,33 @@ function Ue({
229
251
  ]
230
252
  }
231
253
  ),
232
- (e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ a(me, { ticketId: e.id, onWideChange: E }),
233
- /* @__PURE__ */ r("section", { children: [
234
- /* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Request" }),
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." }) }),
254
+ (e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ r(we, { ticketId: e.id, onWideChange: W }),
255
+ /* @__PURE__ */ n("section", { children: [
256
+ /* @__PURE__ */ r("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Request" }),
257
+ /* @__PURE__ */ r("p", { className: "whitespace-pre-wrap text-[13px] leading-relaxed text-slate-800 dark:text-slate-200", children: e.description || /* @__PURE__ */ r("span", { className: "text-slate-400", children: "No details given." }) }),
236
258
  e.replay && e.can.work && (() => {
237
- const t = ne(e.replay), n = u.consoleUrl ? u.consoleUrl(t) : t;
238
- return n ? /* @__PURE__ */ r(
259
+ const t = de(e.replay), s = p.consoleUrl ? p.consoleUrl(t) : t;
260
+ return s ? /* @__PURE__ */ n(
239
261
  "a",
240
262
  {
241
- href: n,
263
+ href: s,
242
264
  target: "_blank",
243
265
  rel: "noreferrer",
244
266
  "data-ticket-replay": e.replay.recording_id,
245
267
  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",
246
268
  children: [
247
- /* @__PURE__ */ a(V, { className: "h-3.5 w-3.5" }),
269
+ /* @__PURE__ */ r(Z, { className: "h-3.5 w-3.5" }),
248
270
  "Replay their screen"
249
271
  ]
250
272
  }
251
273
  ) : null;
252
274
  })(),
253
275
  e.issue_id != null && e.can.work && (() => {
254
- const t = `/issues/${e.issue_id}`, n = u.consoleUrl ? u.consoleUrl(t) : t;
255
- return n ? /* @__PURE__ */ r(
276
+ const t = `/issues/${e.issue_id}`, s = p.consoleUrl ? p.consoleUrl(t) : t;
277
+ return s ? /* @__PURE__ */ n(
256
278
  "a",
257
279
  {
258
- href: n,
280
+ href: s,
259
281
  target: "_blank",
260
282
  rel: "noreferrer",
261
283
  "data-ticket-issue": e.issue_id,
@@ -268,108 +290,123 @@ function Ue({
268
290
  ) : null;
269
291
  })(),
270
292
  (() => {
271
- const t = e.files.filter((n) => e.can.work || !v(n));
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(
293
+ const t = e.files.filter((s) => e.can.work || !N(s));
294
+ return t.length === 0 ? null : /* @__PURE__ */ r("ul", { className: "mt-2 flex flex-wrap gap-1.5", children: t.map((s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ n(
273
295
  "a",
274
296
  {
275
- href: `${O}/files/${n.id}`,
297
+ href: `${m}/files/${s.id}`,
276
298
  target: "_blank",
277
299
  rel: "noreferrer",
278
- "data-tip": v(n) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
300
+ "data-tip": N(s) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
279
301
  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",
280
302
  children: [
281
- /* @__PURE__ */ a(X, { className: "h-3 w-3" }),
282
- v(n) ? "Technical details" : n.title || n.filename_download || "File"
303
+ /* @__PURE__ */ r(I, { className: "h-3 w-3" }),
304
+ N(s) ? "Technical details" : s.title || s.filename_download || "File"
283
305
  ]
284
306
  }
285
- ) }, n.id)) });
307
+ ) }, s.id)) });
286
308
  })()
287
309
  ] }),
288
- e.can.work && /* @__PURE__ */ a(he, { ticketId: e.id }),
289
- /* @__PURE__ */ a(
290
- xe,
310
+ e.can.work && /* @__PURE__ */ r(fe, { tracker: g, ticket: e }),
311
+ e.can.work && /* @__PURE__ */ r(_e, { ticketId: e.id }),
312
+ /* @__PURE__ */ r(
313
+ Se,
291
314
  {
292
315
  userId: e.created_by,
293
316
  name: e.requester_name,
294
317
  text: `${e.title} ${e.description ?? ""}`
295
318
  }
296
319
  ),
297
- /* @__PURE__ */ r("section", { "data-ticket-thread": !0, children: [
298
- /* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Conversation" }),
299
- e.thread.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No replies yet." }) : /* @__PURE__ */ a("ul", { className: "space-y-2.5", children: e.thread.map((t) => /* @__PURE__ */ r(
320
+ /* @__PURE__ */ n("section", { "data-ticket-thread": !0, children: [
321
+ /* @__PURE__ */ r("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Conversation" }),
322
+ e.thread.length === 0 ? /* @__PURE__ */ r("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No replies yet." }) : /* @__PURE__ */ r("ul", { className: "space-y-2.5", children: e.thread.map((t) => /* @__PURE__ */ n(
300
323
  "li",
301
324
  {
302
- className: t.from_requester ? "rounded-lg bg-slate-50 px-3 py-2 dark:bg-white/5" : "rounded-lg border border-nvr-cyan/30 bg-nvr-cyan/5 px-3 py-2",
325
+ "data-ticket-reply-gitlab": t.tracker ? "" : void 0,
326
+ className: t.from_requester || t.tracker ? "rounded-lg bg-slate-50 px-3 py-2 dark:bg-white/5" : "rounded-lg border border-nvr-cyan/30 bg-nvr-cyan/5 px-3 py-2",
303
327
  children: [
304
- /* @__PURE__ */ r("div", { className: "mb-0.5 flex items-baseline justify-between gap-2 text-[11.5px]", children: [
305
- /* @__PURE__ */ a("b", { className: "font-medium text-slate-800 dark:text-slate-100", children: t.user_name ?? "Someone" }),
306
- /* @__PURE__ */ a("span", { className: "text-slate-400", children: k(t.created_at) })
328
+ /* @__PURE__ */ n("div", { className: "mb-0.5 flex items-baseline justify-between gap-2 text-[11.5px]", children: [
329
+ t.tracker ? /* @__PURE__ */ r(
330
+ xe,
331
+ {
332
+ from: t.tracker,
333
+ className: "font-medium text-slate-800 dark:text-slate-100"
334
+ }
335
+ ) : /* @__PURE__ */ r("b", { className: "font-medium text-slate-800 dark:text-slate-100", children: t.user_name ?? "Someone" }),
336
+ /* @__PURE__ */ r("span", { className: "shrink-0 text-slate-500 dark:text-slate-400", children: w(t.created_at) })
307
337
  ] }),
308
- /* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-[12.5px] text-slate-700 dark:text-slate-200", children: t.text })
338
+ t.tracker ? /* @__PURE__ */ r(
339
+ he,
340
+ {
341
+ text: t.text,
342
+ className: "text-[12.5px] text-slate-700 dark:text-slate-200"
343
+ }
344
+ ) : /* @__PURE__ */ r("p", { className: "whitespace-pre-wrap text-[12.5px] text-slate-700 dark:text-slate-200", children: t.text })
309
345
  ]
310
346
  },
311
347
  t.id
312
348
  )) }),
313
- e.can.reply && /* @__PURE__ */ r(
349
+ e.can.reply && /* @__PURE__ */ n(
314
350
  "form",
315
351
  {
316
352
  className: "mt-3",
317
353
  onSubmit: (t) => {
318
- t.preventDefault(), p.trim() && _.mutate();
354
+ t.preventDefault(), x.trim() && C.mutate({ id: a, text: x.trim() });
319
355
  },
320
356
  children: [
321
- /* @__PURE__ */ a(
357
+ g.shown.length > 0 && /* @__PURE__ */ r(ge, { className: "mb-1.5" }),
358
+ /* @__PURE__ */ r(
322
359
  "textarea",
323
360
  {
324
361
  "data-ticket-reply": !0,
325
- value: p,
362
+ value: x,
326
363
  onChange: (t) => {
327
- N(t.target.value), o.signalReplying(!!t.target.value.trim());
364
+ S(t.target.value), d.signalReplying(!!t.target.value.trim());
328
365
  },
329
366
  rows: 3,
330
367
  placeholder: "Write a reply",
331
368
  className: "min-h-[76px] w-full resize-y rounded-md border border-slate-200 bg-white px-3 py-2 text-[12.5px] text-slate-900 outline-none placeholder:text-slate-400 focus:border-nvr-cyan focus:ring-2 focus:ring-nvr-cyan/20 dark:border-border dark:bg-background dark:text-slate-100"
332
369
  }
333
370
  ),
334
- o.replying.length > 0 && /* @__PURE__ */ r(
371
+ d.replying.length > 0 && /* @__PURE__ */ n(
335
372
  "p",
336
373
  {
337
374
  className: "mt-1 flex items-center gap-1.5 text-[11.5px] italic text-slate-400",
338
375
  "data-ticket-replying": !0,
339
376
  children: [
340
- /* @__PURE__ */ a("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
341
- $(o.replying, "replying"),
377
+ /* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
378
+ A(d.replying, "replying"),
342
379
  "…"
343
380
  ]
344
381
  }
345
382
  ),
346
- /* @__PURE__ */ r("div", { className: "mt-2 flex items-center justify-end gap-2", children: [
347
- e.can.cancel && !e.can.work && /* @__PURE__ */ a(
383
+ /* @__PURE__ */ n("div", { className: "mt-2 flex items-center justify-end gap-2", children: [
384
+ e.can.cancel && !e.can.work && /* @__PURE__ */ r(
348
385
  "button",
349
386
  {
350
387
  type: "button",
351
388
  "data-ticket-cancel": !0,
352
- onClick: () => d.mutate({ status: "cancelled" }),
389
+ onClick: () => c.mutate({ status: "cancelled" }),
353
390
  className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
354
391
  children: "Withdraw request"
355
392
  }
356
393
  ),
357
- e.can.reopen && /* @__PURE__ */ a(
394
+ e.can.reopen && /* @__PURE__ */ r(
358
395
  "button",
359
396
  {
360
397
  type: "button",
361
398
  "data-ticket-reopen": !0,
362
- onClick: () => d.mutate({ status: "open" }),
399
+ onClick: () => c.mutate({ status: "open" }),
363
400
  className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
364
401
  children: "Reopen"
365
402
  }
366
403
  ),
367
- /* @__PURE__ */ a(
404
+ /* @__PURE__ */ r(
368
405
  "button",
369
406
  {
370
407
  type: "submit",
371
408
  "data-ticket-send": !0,
372
- disabled: !p.trim() || _.isPending,
409
+ disabled: !x.trim() || C.isPending,
373
410
  className: "h-8 rounded-md bg-nvr-cyan px-3.5 text-[12.5px] font-medium text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",
374
411
  children: "Reply"
375
412
  }
@@ -378,23 +415,23 @@ function Ue({
378
415
  ]
379
416
  }
380
417
  ),
381
- w && /* @__PURE__ */ a("p", { className: "mt-1 text-[12px] text-red-600 dark:text-red-400", role: "alert", children: w })
418
+ _ && /* @__PURE__ */ r("p", { className: "mt-1 text-[12px] text-red-600 dark:text-red-400", role: "alert", children: _ })
382
419
  ] }),
383
- /* @__PURE__ */ r("section", { "data-ticket-history": !0, children: [
384
- /* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "History" }),
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, {
420
+ /* @__PURE__ */ n("section", { "data-ticket-history": !0, children: [
421
+ /* @__PURE__ */ r("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "History" }),
422
+ e.history.length === 0 ? /* @__PURE__ */ r("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No history yet." }) : /* @__PURE__ */ r("ol", { className: "space-y-2 border-l border-slate-200 pl-3.5 dark:border-border", children: ce(e.history, { requester: e.created_by }).reverse().map((t) => {
423
+ const s = ue(t, {
387
424
  isRequester: e.can.requester ?? !e.can.work,
388
425
  requesterName: e.requester_name
389
426
  });
390
- return /* @__PURE__ */ r("li", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
391
- /* @__PURE__ */ a("span", { className: "text-slate-800 dark:text-slate-100", children: n.text }),
392
- /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-slate-400", children: [
427
+ return /* @__PURE__ */ n("li", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
428
+ /* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-slate-100", children: s.text }),
429
+ /* @__PURE__ */ n("span", { className: "text-slate-500 dark:text-slate-400", children: [
393
430
  " ",
394
- /* @__PURE__ */ r("span", { className: "whitespace-nowrap", children: [
431
+ /* @__PURE__ */ n("span", { className: "whitespace-nowrap", children: [
395
432
  "· ",
396
- n.showAuthor ? `${t.user_name ?? "System"} · ` : "",
397
- k(t.at)
433
+ s.showAuthor ? `${t.user_name ?? "System"} · ` : "",
434
+ w(t.at)
398
435
  ] })
399
436
  ] })
400
437
  ] }, t.id);
@@ -406,6 +443,8 @@ function Ue({
406
443
  ) });
407
444
  }
408
445
  export {
409
- fe as StatusPill,
410
- Ue as TicketDetailSheet
446
+ Te as StatusPill,
447
+ et as TicketDetailSheet,
448
+ Ce as draftFor,
449
+ $e as withTicketDraft
411
450
  };