@nivaro/react 0.3.117 → 0.3.119

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 (138) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -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 +3757 -3695
  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 +4451 -4385
  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/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +88 -85
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +245 -141
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -1,307 +1,368 @@
1
- import { jsxs as d, Fragment as U, jsx as t } from "react/jsx-runtime";
2
- import { useQueryClient as W } from "@tanstack/react-query";
3
- import { Loader2 as L, Download as z, Upload as B, FileSpreadsheet as q, X as K, AlertTriangle as P, CircleAlert as Q, Plus as M, Minus as V } from "lucide-react";
4
- import { useRef as G, useState as u, useEffect as I } from "react";
5
- import { createPortal as X } from "react-dom";
6
- import { toast as J } from "sonner";
7
- import { useApiFetchConfig as Y } from "../../context.js";
8
- import { toastError as F } from "../../lib/error-toast.js";
9
- import { ErrorNotice as Z } from "../ErrorNotice.js";
10
- import { Button as $ } from "../ui/button.js";
11
- import { OwnerRecordTrial as ee } from "./OwnerRecordTrial.js";
12
- function te(e) {
13
- const r = e;
14
- if (!(!r || !["UNREADABLE", "NO_FILE", "FILE_TOO_LARGE"].includes(String(r.code))))
15
- return {
16
- title: r.message || "This file could not be read",
17
- hint: "Upload the file you got from Download as Excel — its Owners sheet is what is read.",
18
- code: r.code,
19
- status: r.status
20
- };
1
+ import { jsxs as s, Fragment as W, jsx as r } from "react/jsx-runtime";
2
+ import { useQueryClient as K } from "@tanstack/react-query";
3
+ import { Loader2 as D, Download as M, Upload as Q, FileSpreadsheet as I, X as V, CircleAlert as U, ChevronDown as j, AlertTriangle as H, Plus as G, Minus as X } from "lucide-react";
4
+ import { useRef as J, useState as f, useEffect as Y } from "react";
5
+ import { createPortal as Z } from "react-dom";
6
+ import { toast as ee } from "sonner";
7
+ import { useApiFetchConfig as te } from "../../context.js";
8
+ import { toastError as z } from "../../lib/error-toast.js";
9
+ import { ErrorNotice as re } from "../ErrorNotice.js";
10
+ import { Button as T } from "../ui/button.js";
11
+ import { OwnerRecordTrial as ae } from "./OwnerRecordTrial.js";
12
+ function se(t) {
13
+ var a, e;
14
+ const d = (e = (a = /\.([a-z0-9]+)$/i.exec(t)) == null ? void 0 : a[1]) == null ? void 0 : e.toLowerCase();
15
+ return {
16
+ title: d && !["xlsx", "xlsm", "xls"].includes(d) ? `This ${d.toUpperCase()} file is not the owner matrix` : "This file is not the owner matrix",
17
+ hint: "Upload the .xlsx file you got from Download as Excel, after editing it. Its Owners sheet is what is read."
18
+ };
19
+ }
20
+ function de(t, d) {
21
+ var o, i;
22
+ const a = t;
23
+ if (!a || !["UNREADABLE", "NO_FILE", "FILE_TOO_LARGE"].includes(String(a.code))) return;
24
+ const e = (i = (o = /\.([a-z0-9]+)$/i.exec(d ?? "")) == null ? void 0 : o[1]) == null ? void 0 : i.toLowerCase();
25
+ return e && !["xlsx", "xlsm", "xls"].includes(e) ? {
26
+ title: `This ${e.toUpperCase()} file has no owner matrix in it`,
27
+ hint: "Upload the .xlsx file you got from Download as Excel, after editing it.",
28
+ code: a.code,
29
+ status: a.status
30
+ } : {
31
+ title: a.message || "This file could not be read",
32
+ hint: "Upload the file you got from Download as Excel — its Owners sheet is what is read.",
33
+ code: a.code,
34
+ status: a.status
35
+ };
21
36
  }
22
- const h = (e, r, a = `${r}s`) => `${e} ${e === 1 ? r : a}`;
23
- function Ne({
24
- templateId: e,
25
- collections: r
37
+ const p = (t, d, a = `${d}s`) => `${t} ${t === 1 ? d : a}`;
38
+ function _e({
39
+ templateId: t,
40
+ collections: d
26
41
  }) {
27
- const a = Y(), n = W(), l = G(null), [g, y] = u(!1), [i, v] = u(null), [f, b] = u(null), [k, w] = u(!1), [R, N] = u(!1), [_, m] = u(null), [C, T] = u(!1), O = `${a.apiBase}/pipelines/${encodeURIComponent(e)}/owner-matrix/sheet`;
28
- async function A(s, o) {
29
- const x = new FormData();
30
- x.append("file", o, o.name);
31
- const p = await fetch(`${O}${s}`, {
42
+ const a = te(), e = K(), o = J(null), [i, h] = f(!1), [c, O] = f(null), [y, v] = f(null), [b, _] = f(!1), [A, k] = f(!1), [S, x] = f(null), [E, g] = f(!1), $ = `${a.apiBase}/pipelines/${encodeURIComponent(t)}/owner-matrix/sheet`;
43
+ async function C(n, l) {
44
+ const w = new FormData();
45
+ w.append("file", l, l.name);
46
+ const N = await fetch(`${$}${n}`, {
32
47
  method: "POST",
33
48
  headers: a.authHeaders,
34
49
  credentials: a.credentials,
35
- body: x
36
- }), c = await p.json().catch(() => ({}));
37
- if (!p.ok)
38
- throw Object.assign(new Error((c == null ? void 0 : c.error) || p.statusText), {
39
- status: p.status,
40
- code: c == null ? void 0 : c.code,
41
- data: c == null ? void 0 : c.data
50
+ body: w
51
+ }), u = await N.json().catch(() => ({}));
52
+ if (!N.ok)
53
+ throw Object.assign(new Error((u == null ? void 0 : u.error) || N.statusText), {
54
+ status: N.status,
55
+ code: u == null ? void 0 : u.code,
56
+ data: u == null ? void 0 : u.data
42
57
  });
43
- return c.data;
58
+ return u.data;
44
59
  }
45
- async function j() {
46
- var s;
47
- y(!0);
60
+ async function m() {
61
+ var n;
62
+ h(!0);
48
63
  try {
49
- const o = await fetch(O, {
64
+ const l = await fetch($, {
50
65
  headers: a.authHeaders,
51
66
  credentials: a.credentials
52
67
  });
53
- if (!o.ok) throw Object.assign(new Error(o.statusText), { status: o.status });
54
- const x = ((s = /filename="([^"]+)"/.exec(o.headers.get("content-disposition") ?? "")) == null ? void 0 : s[1]) ?? "owner matrix.xlsx", p = URL.createObjectURL(await o.blob()), c = document.createElement("a");
55
- c.href = p, c.download = x, c.click(), URL.revokeObjectURL(p);
56
- } catch (o) {
57
- F(o, "Could not download the owner matrix");
68
+ if (!l.ok) throw Object.assign(new Error(l.statusText), { status: l.status });
69
+ const w = ((n = /filename="([^"]+)"/.exec(l.headers.get("content-disposition") ?? "")) == null ? void 0 : n[1]) ?? "owner matrix.xlsx", N = URL.createObjectURL(await l.blob()), u = document.createElement("a");
70
+ u.href = N, u.download = w, u.click(), URL.revokeObjectURL(N);
71
+ } catch (l) {
72
+ z(l, "Could not download the owner matrix");
58
73
  } finally {
59
- y(!1);
74
+ h(!1);
60
75
  }
61
76
  }
62
- async function S(s) {
63
- v(s), b(null), m(null), T(!1), w(!0);
77
+ async function R(n) {
78
+ O(n), v(null), x(null), g(!1), _(!0);
64
79
  try {
65
- b(await A("/preview", s));
66
- } catch (o) {
67
- m(o);
80
+ v(await C("/preview", n));
81
+ } catch (l) {
82
+ x(l);
68
83
  } finally {
69
- w(!1);
84
+ _(!1);
70
85
  }
71
86
  }
72
- function D() {
73
- v(null), b(null), m(null), T(!1);
87
+ function P() {
88
+ O(null), v(null), x(null), g(!1);
74
89
  }
75
- async function H() {
76
- if (!(!i || !f)) {
77
- N(!0);
90
+ async function q() {
91
+ if (!(!c || !y)) {
92
+ k(!0);
78
93
  try {
79
- await A(`/apply?hash=${f.plan_hash}`, i);
80
- const s = f.counts;
81
- J.success("Owner matrix updated", {
94
+ await C(`/apply?hash=${y.plan_hash}`, c);
95
+ const n = y.counts;
96
+ ee.success("Owner matrix updated", {
82
97
  description: [
83
- s.groups_added && `${h(s.groups_added, "group")} added`,
84
- s.groups_removed && `${h(s.groups_removed, "group")} removed`,
85
- s.groups_changed && `${h(s.groups_changed, "group")} changed`
98
+ n.groups_added && `${p(n.groups_added, "group")} added`,
99
+ n.groups_removed && `${p(n.groups_removed, "group")} removed`,
100
+ n.groups_changed && `${p(n.groups_changed, "group")} changed`
86
101
  ].filter(Boolean).join(", ")
87
- }), n.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", e] }), n.invalidateQueries({ queryKey: ["owner-matrix-versions", e] }), n.invalidateQueries({ queryKey: ["owner-preview", e] }), D();
88
- } catch (s) {
89
- const o = s;
90
- o.code === "OWNER_SHEET_STALE" || o.code === "OWNER_SHEET_PROBLEMS" ? (o.data && b(o.data), T(o.code === "OWNER_SHEET_STALE"), o.code === "OWNER_SHEET_STALE" && !o.data && i && S(i)) : F(s, "Could not apply the spreadsheet");
102
+ }), e.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", t] }), e.invalidateQueries({ queryKey: ["owner-matrix-versions", t] }), e.invalidateQueries({ queryKey: ["owner-preview", t] }), P();
103
+ } catch (n) {
104
+ const l = n;
105
+ l.code === "OWNER_SHEET_STALE" || l.code === "OWNER_SHEET_PROBLEMS" ? (l.data && v(l.data), g(l.code === "OWNER_SHEET_STALE"), l.code === "OWNER_SHEET_STALE" && !l.data && c && R(c)) : z(n, "Could not apply the spreadsheet");
91
106
  } finally {
92
- N(!1);
107
+ k(!1);
93
108
  }
94
109
  }
95
110
  }
96
- return /* @__PURE__ */ d(U, { children: [
97
- /* @__PURE__ */ d(
98
- $,
111
+ return /* @__PURE__ */ s(W, { children: [
112
+ /* @__PURE__ */ s(
113
+ T,
99
114
  {
100
115
  size: "sm",
101
116
  variant: "outline",
102
117
  className: "h-7 shrink-0 gap-1.5 text-[12px]",
103
- onClick: j,
104
- disabled: g,
118
+ onClick: m,
119
+ disabled: i,
105
120
  "data-owner-sheet-download": !0,
106
121
  children: [
107
- g ? /* @__PURE__ */ t(L, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(z, { className: "h-3.5 w-3.5" }),
122
+ i ? /* @__PURE__ */ r(D, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(M, { className: "h-3.5 w-3.5" }),
108
123
  "Download as Excel"
109
124
  ]
110
125
  }
111
126
  ),
112
- /* @__PURE__ */ d(
113
- $,
127
+ /* @__PURE__ */ s(
128
+ T,
114
129
  {
115
130
  size: "sm",
116
131
  variant: "outline",
117
132
  className: "h-7 shrink-0 gap-1.5 text-[12px]",
118
133
  onClick: () => {
119
- var s;
120
- return (s = l.current) == null ? void 0 : s.click();
134
+ var n;
135
+ return (n = o.current) == null ? void 0 : n.click();
121
136
  },
122
137
  "data-owner-sheet-upload": !0,
123
138
  children: [
124
- /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" }),
139
+ /* @__PURE__ */ r(Q, { className: "h-3.5 w-3.5" }),
125
140
  "Upload"
126
141
  ]
127
142
  }
128
143
  ),
129
- /* @__PURE__ */ t(
144
+ /* @__PURE__ */ r(
130
145
  "input",
131
146
  {
132
- ref: l,
147
+ ref: o,
133
148
  type: "file",
134
149
  accept: ".xlsx,.xlsm,.xls,.csv",
135
150
  className: "hidden",
136
- onChange: (s) => {
137
- var x;
138
- const o = (x = s.target.files) == null ? void 0 : x[0];
139
- s.target.value = "", o && S(o);
151
+ onChange: (n) => {
152
+ var w;
153
+ const l = (w = n.target.files) == null ? void 0 : w[0];
154
+ n.target.value = "", l && R(l);
140
155
  }
141
156
  }
142
157
  ),
143
- i && /* @__PURE__ */ t(
144
- re,
158
+ c && /* @__PURE__ */ r(
159
+ oe,
145
160
  {
146
- templateId: e,
147
- collections: r,
148
- fileName: i.name,
149
- preview: f,
150
- loading: k,
151
- error: _,
152
- stale: C,
153
- applying: R,
154
- onRetry: () => i && void S(i),
161
+ templateId: t,
162
+ collections: d,
163
+ fileName: c.name,
164
+ preview: y,
165
+ loading: b,
166
+ error: S,
167
+ stale: E,
168
+ applying: A,
169
+ onRetry: () => c && void R(c),
155
170
  onPickAnother: () => {
156
- var s;
157
- return (s = l.current) == null ? void 0 : s.click();
171
+ var n;
172
+ return (n = o.current) == null ? void 0 : n.click();
158
173
  },
159
- onApply: H,
160
- onClose: D
174
+ onApply: q,
175
+ onClose: P
161
176
  }
162
177
  )
163
178
  ] });
164
179
  }
165
- function re({
166
- templateId: e,
167
- collections: r,
180
+ function oe({
181
+ templateId: t,
182
+ collections: d,
168
183
  fileName: a,
169
- preview: n,
170
- loading: l,
171
- error: g,
172
- stale: y,
173
- applying: i,
174
- onRetry: v,
175
- onPickAnother: f,
176
- onApply: b,
177
- onClose: k
184
+ preview: e,
185
+ loading: o,
186
+ error: i,
187
+ stale: h,
188
+ applying: c,
189
+ onRetry: O,
190
+ onPickAnother: y,
191
+ onApply: v,
192
+ onClose: b
178
193
  }) {
179
- const [w, R] = u(!1);
180
- I(() => {
181
- const m = (C) => {
182
- C.key === "Escape" && !i && k();
194
+ const [_, A] = f(!1);
195
+ Y(() => {
196
+ const m = (R) => {
197
+ R.key === "Escape" && !c && b();
183
198
  };
184
199
  return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
185
- }, [k, i]);
186
- const N = !!n && n.errors > 0, _ = !!n && !N && !n.nothing_to_do && !l;
187
- return X(
188
- /* @__PURE__ */ d("div", { className: "fixed inset-0 z-[120]", "data-owner-sheet-drawer": !0, children: [
189
- /* @__PURE__ */ t(
200
+ }, [b, c]);
201
+ const k = !!e && e.errors > 0, S = !!e && !k && !e.nothing_to_do && !o, x = !o && !!e && e.rows === 0 && e.errors > 0 && e.problems.every((m) => m.row == null), E = i != null ? de(i, a) : x ? se(a) : void 0, g = !o && (i != null || x), $ = !o && !g && !!e && e.nothing_to_do && !k, C = new Set(
202
+ ((e == null ? void 0 : e.problems) ?? []).filter((m) => m.severity === "error" && m.row != null).map((m) => m.row)
203
+ );
204
+ return Z(
205
+ /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[120]", "data-owner-sheet-drawer": !0, children: [
206
+ /* @__PURE__ */ r(
190
207
  "button",
191
208
  {
192
209
  type: "button",
193
210
  "aria-label": "Close",
194
211
  className: "absolute inset-0 bg-black/30",
195
- onClick: () => !i && k()
212
+ onClick: () => !c && b()
196
213
  }
197
214
  ),
198
- /* @__PURE__ */ d(
215
+ /* @__PURE__ */ s(
199
216
  "div",
200
217
  {
201
218
  role: "dialog",
202
219
  "aria-label": "Review the uploaded owner matrix",
203
220
  className: "absolute inset-y-0 right-0 flex w-full max-w-[760px] flex-col border-l border-slate-200 bg-white shadow-2xl dark:border-border dark:bg-card",
204
221
  children: [
205
- /* @__PURE__ */ d("div", { className: "flex shrink-0 items-center gap-2 border-b border-slate-200 px-4 py-3 dark:border-border", children: [
206
- /* @__PURE__ */ t(q, { className: "h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400" }),
207
- /* @__PURE__ */ d("div", { className: "min-w-0", children: [
208
- /* @__PURE__ */ t("h2", { className: "text-[14px] font-semibold text-slate-900 dark:text-foreground", children: "Review the upload" }),
209
- /* @__PURE__ */ d("p", { className: "truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
222
+ /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-slate-200 px-4 py-3 dark:border-border", children: [
223
+ /* @__PURE__ */ r(I, { className: "h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400" }),
224
+ /* @__PURE__ */ s("div", { className: "min-w-0", children: [
225
+ /* @__PURE__ */ r("h2", { className: "text-[14px] font-semibold text-slate-900 dark:text-foreground", children: "Review the upload" }),
226
+ /* @__PURE__ */ s("p", { className: "truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
210
227
  a,
211
- n ? ` · ${h(n.rows, "row")}` : ""
228
+ e && !x ? ` · ${p(e.rows, "row")}` : ""
212
229
  ] })
213
230
  ] }),
214
- /* @__PURE__ */ t(
231
+ /* @__PURE__ */ r(
215
232
  "button",
216
233
  {
217
234
  type: "button",
218
235
  "aria-label": "Close",
219
- onClick: k,
220
- disabled: i,
236
+ onClick: b,
237
+ disabled: c,
221
238
  className: "ml-auto rounded p-1 text-slate-400 hover:bg-muted hover:text-slate-700 dark:hover:text-slate-200",
222
- children: /* @__PURE__ */ t(K, { className: "h-4 w-4" })
239
+ children: /* @__PURE__ */ r(V, { className: "h-4 w-4" })
223
240
  }
224
241
  )
225
242
  ] }),
226
- /* @__PURE__ */ d("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto overscroll-contain px-4 py-4", children: [
227
- l && /* @__PURE__ */ d("div", { className: "flex items-center gap-2 py-10 text-[13px] text-slate-500 dark:text-muted-foreground", children: [
228
- /* @__PURE__ */ t(L, { className: "h-4 w-4 animate-spin" }),
243
+ /* @__PURE__ */ s("div", { className: "min-h-0 flex-1 space-y-5 overflow-y-auto overscroll-contain px-4 py-4", children: [
244
+ o && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 py-10 text-[13px] text-slate-500 dark:text-muted-foreground", children: [
245
+ /* @__PURE__ */ r(D, { className: "h-4 w-4 animate-spin" }),
229
246
  "Reading ",
230
247
  a,
231
248
  " and comparing it with the owner matrix…"
232
249
  ] }),
233
- !l && g != null && /* @__PURE__ */ t(
234
- Z,
250
+ !o && (i != null || x) && (E ? /* @__PURE__ */ s(
251
+ "div",
235
252
  {
236
- error: g,
237
- description: te(g),
253
+ role: "alert",
254
+ "data-owner-sheet-read-failure": !0,
255
+ className: "flex items-start gap-2.5 rounded-md border border-rose-200 bg-rose-50 px-3 py-2.5 dark:border-rose-900/60 dark:bg-rose-950/30",
256
+ children: [
257
+ /* @__PURE__ */ r(U, { className: "mt-0.5 h-4 w-4 shrink-0 text-rose-600 dark:text-rose-400" }),
258
+ /* @__PURE__ */ s("div", { className: "min-w-0 space-y-0.5", children: [
259
+ /* @__PURE__ */ r("p", { className: "text-[13px] font-semibold text-rose-900 dark:text-rose-100", children: E.title }),
260
+ E.hint && /* @__PURE__ */ r("p", { className: "text-[12.5px] text-rose-800 dark:text-rose-200/90", children: E.hint })
261
+ ] })
262
+ ]
263
+ }
264
+ ) : /* @__PURE__ */ r(
265
+ re,
266
+ {
267
+ error: i,
238
268
  fallback: "Could not read the spreadsheet",
239
- onRetry: v
269
+ onRetry: O
240
270
  }
241
- ),
242
- !l && n && /* @__PURE__ */ d(U, { children: [
243
- y && /* @__PURE__ */ d("div", { className: "flex items-start gap-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-200", children: [
244
- /* @__PURE__ */ t(P, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
245
- /* @__PURE__ */ t("span", { children: "Someone changed the owner matrix after you uploaded. Nothing was applied — these are the changes against the matrix as it is now." })
271
+ )),
272
+ !o && x && e && /* @__PURE__ */ s("details", { className: "group text-[12px]", "data-owner-sheet-wrong-file-details": !0, children: [
273
+ /* @__PURE__ */ s("summary", { className: "inline-flex cursor-pointer list-none items-center gap-1 rounded text-slate-600 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-muted-foreground dark:hover:text-foreground [&::-webkit-details-marker]:hidden", children: [
274
+ /* @__PURE__ */ r(j, { className: "h-3.5 w-3.5 -rotate-90 transition-transform group-open:rotate-0" }),
275
+ "What the file is missing"
276
+ ] }),
277
+ /* @__PURE__ */ r("div", { className: "mt-2", children: /* @__PURE__ */ r(B, { preview: e }) })
278
+ ] }),
279
+ !o && e && !x && /* @__PURE__ */ s(W, { children: [
280
+ h && /* @__PURE__ */ s("div", { className: "flex items-start gap-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-[12.5px] text-amber-900 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-200", children: [
281
+ /* @__PURE__ */ r(H, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
282
+ /* @__PURE__ */ r("span", { children: "Someone changed the owner matrix after you uploaded. Nothing was applied — these are the changes against the matrix as it is now." })
246
283
  ] }),
247
- !n.nothing_to_do && /* @__PURE__ */ t(ae, { preview: n }),
248
- n.problems.length > 0 && /* @__PURE__ */ t(de, { preview: n }),
249
- n.nothing_to_do && n.errors === 0 && /* @__PURE__ */ t("p", { className: "rounded-md border border-dashed border-slate-200 px-3 py-6 text-center text-[13px] text-slate-500 dark:border-border dark:text-muted-foreground", children: "This file matches the owner matrix — there is nothing to change." }),
250
- n.steps.map((m) => /* @__PURE__ */ t(oe, { step: m }, m.state_id)),
251
- _ && r.length > 0 && /* @__PURE__ */ d("div", { className: "rounded-md border border-slate-200 dark:border-border", children: [
252
- /* @__PURE__ */ d(
284
+ !e.nothing_to_do && /* @__PURE__ */ r(ne, { preview: e, blockedRows: C }),
285
+ e.problems.length > 0 && /* @__PURE__ */ r(B, { preview: e }),
286
+ e.nothing_to_do && e.errors === 0 && /* @__PURE__ */ r("p", { className: "rounded-md border border-dashed border-slate-200 px-3 py-6 text-center text-[13px] text-slate-500 dark:border-border dark:text-muted-foreground", children: "This file matches the owner matrix — there is nothing to change." }),
287
+ e.steps.map((m) => /* @__PURE__ */ r(ce, { step: m, blockedRows: C }, m.state_id)),
288
+ S && d.length > 0 && /* @__PURE__ */ s("div", { className: "rounded-md border border-slate-200 dark:border-border", children: [
289
+ /* @__PURE__ */ s(
253
290
  "button",
254
291
  {
255
292
  type: "button",
256
- onClick: () => R((m) => !m),
257
- "aria-expanded": w,
258
- className: "flex w-full items-center justify-between px-3 py-2 text-left text-[12.5px] font-medium text-slate-700 hover:bg-muted dark:text-foreground",
293
+ onClick: () => A((m) => !m),
294
+ "aria-expanded": _,
295
+ "data-owner-sheet-trial": !0,
296
+ className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan",
259
297
  children: [
260
- "Try a record with these changes",
261
- /* @__PURE__ */ t("span", { className: "text-[11.5px] font-normal text-slate-400", children: w ? "Hide" : "Who would own each step" })
298
+ /* @__PURE__ */ r(
299
+ j,
300
+ {
301
+ className: `h-3.5 w-3.5 shrink-0 text-slate-500 transition-transform dark:text-muted-foreground ${_ ? "" : "-rotate-90"}`
302
+ }
303
+ ),
304
+ /* @__PURE__ */ r("span", { className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: "Try a record with these changes" }),
305
+ /* @__PURE__ */ r("span", { className: "ml-auto text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Who would own each step" })
262
306
  ]
263
307
  }
264
308
  ),
265
- w && (n.draft_groups.length > 2e3 ? /* @__PURE__ */ t("p", { className: "border-t border-slate-200 px-3 py-2 text-[12px] text-slate-500 dark:border-border dark:text-muted-foreground", children: "Too many groups change at once to try a record here." }) : /* @__PURE__ */ t("div", { className: "border-t border-slate-200 p-3 dark:border-border", children: /* @__PURE__ */ t(
266
- ee,
309
+ _ && (e.draft_groups.length > 2e3 ? /* @__PURE__ */ r("p", { className: "border-t border-slate-200 px-3 py-2 text-[12px] text-slate-500 dark:border-border dark:text-muted-foreground", children: "Too many groups change at once to try a record here." }) : /* @__PURE__ */ r("div", { className: "border-t border-slate-200 p-3 dark:border-border", children: /* @__PURE__ */ r(
310
+ ae,
267
311
  {
268
- templateId: e,
269
- collections: r,
270
- draft: n.draft_groups
312
+ templateId: t,
313
+ collections: d,
314
+ draft: e.draft_groups
271
315
  }
272
316
  ) }))
273
317
  ] })
274
318
  ] })
275
319
  ] }),
276
- /* @__PURE__ */ d("div", { className: "flex shrink-0 flex-wrap items-center gap-2 border-t border-slate-200 bg-slate-50 px-4 py-3 dark:border-border dark:bg-muted/30", children: [
277
- /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
278
- N ? `Fix ${h((n == null ? void 0 : n.errors) ?? 0, "problem")} in the file, then upload it again.` : "Nothing changes until you press Apply.",
279
- !N && /* @__PURE__ */ d("span", { className: "hidden sm:inline", children: [
280
- " ",
281
- "The matrix is saved as a version first, so it can be restored."
282
- ] })
283
- ] }),
284
- /* @__PURE__ */ t(
285
- $,
320
+ /* @__PURE__ */ s("div", { className: "flex shrink-0 flex-wrap items-center gap-2 border-t border-slate-200 bg-slate-50 px-4 py-3 dark:border-border dark:bg-muted/30", children: [
321
+ /* @__PURE__ */ s(
322
+ "p",
323
+ {
324
+ className: "min-w-0 flex-1 text-[12px] text-slate-500 dark:text-muted-foreground",
325
+ "data-owner-sheet-footer": !0,
326
+ children: [
327
+ o ? "Reading the file…" : g ? "Nothing was changed. Upload the workbook from Download as Excel." : $ ? "Nothing to apply — the owner matrix already matches this file." : k ? `Fix ${p((e == null ? void 0 : e.errors) ?? 0, "problem")} in the file, then upload it again.` : "Nothing changes until you press Apply.",
328
+ !o && !g && !$ && !k && /* @__PURE__ */ s("span", { className: "hidden sm:inline", children: [
329
+ " ",
330
+ "The matrix is saved as a version first, so it can be restored."
331
+ ] })
332
+ ]
333
+ }
334
+ ),
335
+ /* @__PURE__ */ r(
336
+ T,
286
337
  {
287
338
  size: "sm",
288
339
  variant: "outline",
289
340
  className: "h-8 text-[12.5px]",
290
- onClick: f,
291
- disabled: i,
341
+ onClick: y,
342
+ disabled: c,
292
343
  children: "Upload another file"
293
344
  }
294
345
  ),
295
- /* @__PURE__ */ d(
296
- $,
346
+ g || $ ? /* @__PURE__ */ r(
347
+ T,
297
348
  {
298
349
  size: "sm",
299
- className: "h-8 gap-1.5 bg-nvr-cyan text-[12.5px] text-white hover:bg-nvr-cyan/90",
350
+ variant: "outline",
351
+ className: "h-8 text-[12.5px]",
300
352
  onClick: b,
301
- disabled: !_ || i,
353
+ "data-owner-sheet-close": !0,
354
+ children: "Close"
355
+ }
356
+ ) : /* @__PURE__ */ s(
357
+ T,
358
+ {
359
+ size: "sm",
360
+ className: "h-8 gap-1.5 bg-nvr-cyan text-[12.5px] text-white hover:bg-nvr-cyan/90 disabled:bg-slate-200 disabled:text-slate-500 disabled:opacity-100 dark:disabled:border dark:disabled:border-border dark:disabled:!bg-transparent dark:disabled:!text-slate-500",
361
+ onClick: v,
362
+ disabled: !S || c,
302
363
  "data-owner-sheet-apply": !0,
303
364
  children: [
304
- i && /* @__PURE__ */ t(L, { className: "h-3.5 w-3.5 animate-spin" }),
365
+ c && /* @__PURE__ */ r(D, { className: "h-3.5 w-3.5 animate-spin" }),
305
366
  "Apply changes"
306
367
  ]
307
368
  }
@@ -314,86 +375,110 @@ function re({
314
375
  document.body
315
376
  );
316
377
  }
317
- function ae({ preview: e }) {
318
- const r = e.counts, a = [
378
+ const F = (t, d) => t.row != null && d.has(t.row);
379
+ function ne({
380
+ preview: t,
381
+ blockedRows: d
382
+ }) {
383
+ const a = { ...t.counts };
384
+ let e = 0;
385
+ for (const h of t.steps)
386
+ for (const c of h.changes)
387
+ F(c, d) && (e++, c.kind === "added" ? a.groups_added-- : c.kind === "removed" ? a.groups_removed-- : a.groups_changed--, a.people_added -= c.people_added.length, a.people_removed -= c.people_removed.length);
388
+ for (const h of Object.keys(a)) a[h] = Math.max(0, a[h]);
389
+ const o = [
319
390
  {
320
- n: r.groups_added,
321
- label: r.groups_added === 1 ? "group added" : "groups added",
391
+ n: a.groups_added,
392
+ label: a.groups_added === 1 ? "group added" : "groups added",
322
393
  tone: "add"
323
394
  },
324
395
  {
325
- n: r.groups_removed,
326
- label: r.groups_removed === 1 ? "group removed" : "groups removed",
396
+ n: a.groups_removed,
397
+ label: a.groups_removed === 1 ? "group removed" : "groups removed",
327
398
  tone: "remove"
328
399
  },
329
400
  {
330
- n: r.groups_changed,
331
- label: r.groups_changed === 1 ? "group changed" : "groups changed",
401
+ n: a.groups_changed,
402
+ label: a.groups_changed === 1 ? "group changed" : "groups changed",
332
403
  tone: "change"
333
404
  },
334
405
  {
335
- n: r.people_added,
336
- label: r.people_added === 1 ? "person added" : "people added",
406
+ n: a.people_added,
407
+ label: a.people_added === 1 ? "person added" : "people added",
337
408
  tone: "add"
338
409
  },
339
410
  {
340
- n: r.people_removed,
341
- label: r.people_removed === 1 ? "person removed" : "people removed",
411
+ n: a.people_removed,
412
+ label: a.people_removed === 1 ? "person removed" : "people removed",
342
413
  tone: "remove"
343
414
  }
344
- ], n = {
415
+ ], i = {
345
416
  add: "text-emerald-700 dark:text-emerald-400",
346
417
  remove: "text-rose-700 dark:text-rose-400",
347
418
  change: "text-amber-700 dark:text-amber-400",
348
419
  plain: "text-slate-700 dark:text-foreground"
349
420
  };
350
- return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: a.map((l) => /* @__PURE__ */ d("div", { className: "min-w-[104px] flex-1 bg-white px-3 py-2 dark:bg-card", children: [
351
- /* @__PURE__ */ t(
352
- "div",
421
+ return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
422
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: o.map((h) => /* @__PURE__ */ s("div", { className: "min-w-[104px] flex-1 bg-white px-3 py-2 dark:bg-card", children: [
423
+ /* @__PURE__ */ r(
424
+ "div",
425
+ {
426
+ className: `text-[17px] font-semibold tabular-nums ${h.n ? i[h.tone] : "text-slate-300 dark:text-slate-600"}`,
427
+ children: h.n
428
+ }
429
+ ),
430
+ /* @__PURE__ */ r("div", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: h.label })
431
+ ] }, h.label)) }),
432
+ e > 0 && /* @__PURE__ */ s(
433
+ "p",
353
434
  {
354
- className: `text-[17px] font-semibold tabular-nums ${l.n ? n[l.tone] : "text-slate-300 dark:text-slate-600"}`,
355
- children: l.n
435
+ className: "text-[11.5px] text-slate-500 dark:text-muted-foreground",
436
+ "data-owner-sheet-waiting": !0,
437
+ children: [
438
+ "Not counted: ",
439
+ p(e, "group change"),
440
+ " waiting on a fix in the file."
441
+ ]
356
442
  }
357
- ),
358
- /* @__PURE__ */ t("div", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: l.label })
359
- ] }, l.label)) });
443
+ )
444
+ ] });
360
445
  }
361
- function de({ preview: e }) {
362
- return /* @__PURE__ */ d("section", { "aria-label": "Problems", children: [
363
- /* @__PURE__ */ d("h3", { className: "mb-1.5 text-[12.5px] font-semibold text-slate-800 dark:text-foreground", children: [
364
- e.errors > 0 ? `${h(e.errors, "problem")} to fix` : `${h(e.warnings, "thing")} to check`,
365
- e.errors > 0 && e.warnings > 0 && /* @__PURE__ */ d("span", { className: "font-normal text-slate-500 dark:text-muted-foreground", children: [
446
+ function B({ preview: t }) {
447
+ return /* @__PURE__ */ s("section", { "aria-label": "Problems", children: [
448
+ /* @__PURE__ */ s("h3", { className: "mb-1.5 text-[12.5px] font-semibold text-slate-800 dark:text-foreground", children: [
449
+ t.errors > 0 ? `${p(t.errors, "problem")} to fix` : `${p(t.warnings, "thing")} to check`,
450
+ t.errors > 0 && t.warnings > 0 && /* @__PURE__ */ s("span", { className: "font-normal text-slate-500 dark:text-muted-foreground", children: [
366
451
  " ",
367
452
  "· ",
368
- h(e.warnings, "warning")
453
+ p(t.warnings, "warning")
369
454
  ] })
370
455
  ] }),
371
- /* @__PURE__ */ d("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border dark:border-border", children: [
372
- e.problems.map((r, a) => /* @__PURE__ */ d(
456
+ /* @__PURE__ */ s("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border dark:border-border", children: [
457
+ t.problems.map((d, a) => /* @__PURE__ */ s(
373
458
  "li",
374
459
  {
375
460
  className: "flex items-start gap-2 px-3 py-1.5 text-[12.5px]",
376
- "data-severity": r.severity,
461
+ "data-severity": d.severity,
377
462
  children: [
378
- r.severity === "error" ? /* @__PURE__ */ t(Q, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-rose-600 dark:text-rose-400" }) : /* @__PURE__ */ t(P, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400" }),
379
- /* @__PURE__ */ t("span", { className: "w-[60px] shrink-0 whitespace-nowrap text-slate-500 tabular-nums dark:text-muted-foreground", children: r.row != null ? `Row ${r.row}` : "File" }),
380
- /* @__PURE__ */ d("span", { className: "min-w-0 text-slate-700 dark:text-foreground", children: [
381
- r.column && !r.message.toLowerCase().includes(r.column.toLowerCase()) && /* @__PURE__ */ t("span", { className: "mr-1.5 font-medium text-slate-500 dark:text-muted-foreground", children: r.column }),
382
- r.message
383
- ] })
463
+ d.severity === "error" ? /* @__PURE__ */ r(U, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-rose-600 dark:text-rose-400" }) : /* @__PURE__ */ r(H, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400" }),
464
+ /* @__PURE__ */ s("span", { className: "w-[96px] shrink-0 leading-snug text-slate-500 tabular-nums dark:text-muted-foreground", children: [
465
+ /* @__PURE__ */ r("span", { className: "block whitespace-nowrap", children: d.row != null ? `Row ${d.row}` : "File" }),
466
+ d.column && /* @__PURE__ */ r("span", { className: "block truncate text-[11px]", "data-tip": d.column, children: d.column })
467
+ ] }),
468
+ /* @__PURE__ */ r("span", { className: "min-w-0 leading-snug text-slate-700 dark:text-foreground", children: d.message })
384
469
  ]
385
470
  },
386
471
  a
387
472
  )),
388
- e.problems_hidden > 0 && /* @__PURE__ */ d("li", { className: "px-3 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
473
+ t.problems_hidden > 0 && /* @__PURE__ */ s("li", { className: "px-3 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
389
474
  "…and ",
390
- e.problems_hidden,
475
+ t.problems_hidden,
391
476
  " more"
392
477
  ] })
393
478
  ] })
394
479
  ] });
395
480
  }
396
- const ne = {
481
+ const le = {
397
482
  added: {
398
483
  label: "Added",
399
484
  cls: "bg-emerald-50 text-emerald-700 ring-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:ring-emerald-800/60"
@@ -406,90 +491,117 @@ const ne = {
406
491
  label: "Changed",
407
492
  cls: "bg-amber-50 text-amber-800 ring-amber-200 dark:bg-amber-950/40 dark:text-amber-300 dark:ring-amber-800/60"
408
493
  }
409
- }, se = { step: "Step", name: "Name", default: "Default", priority: "Priority" };
410
- function oe({ step: e }) {
411
- return /* @__PURE__ */ d("section", { "aria-label": e.state_label, children: [
412
- /* @__PURE__ */ d("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
413
- /* @__PURE__ */ t("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: e.state_label }),
414
- /* @__PURE__ */ d("span", { className: "text-[11.5px] text-slate-500 tabular-nums dark:text-muted-foreground", children: [
415
- h(e.changes.length, "group"),
416
- e.people_added > 0 && ` · +${e.people_added}`,
417
- e.people_removed > 0 && ` · −${e.people_removed}`
418
- ] })
494
+ }, ie = { step: "Step", name: "Name", default: "Default", priority: "Priority" };
495
+ function ce({
496
+ step: t,
497
+ blockedRows: d
498
+ }) {
499
+ let a = t.people_added, e = t.people_removed, o = 0;
500
+ for (const i of t.changes)
501
+ F(i, d) && (o++, a -= i.people_added.length, e -= i.people_removed.length);
502
+ return /* @__PURE__ */ s("section", { "aria-label": t.state_label, children: [
503
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
504
+ /* @__PURE__ */ r("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: t.state_label }),
505
+ /* @__PURE__ */ r("span", { className: "text-[11.5px] text-slate-500 tabular-nums dark:text-muted-foreground", children: [
506
+ t.changes.length > o ? p(t.changes.length - o, "group") : "",
507
+ a > 0 ? `+${a}` : "",
508
+ e > 0 ? `−${e}` : "",
509
+ o > 0 ? `${o} waiting on a fix` : ""
510
+ ].filter(Boolean).join(" · ") })
419
511
  ] }),
420
- /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border dark:border-border", children: e.changes.map((r) => /* @__PURE__ */ t(le, { change: r }, `${r.group_id ?? ""}:${r.row ?? ""}`)) })
512
+ /* @__PURE__ */ r("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border dark:border-border", children: t.changes.map((i) => /* @__PURE__ */ r(
513
+ me,
514
+ {
515
+ change: i,
516
+ blocked: F(i, d)
517
+ },
518
+ `${i.group_id ?? ""}:${i.row ?? ""}`
519
+ )) })
421
520
  ] });
422
521
  }
423
- function le({ change: e }) {
424
- const r = ne[e.kind];
425
- return /* @__PURE__ */ d("li", { className: "space-y-1.5 px-3 py-2", "data-change-kind": e.kind, children: [
426
- /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
427
- /* @__PURE__ */ t(
428
- "span",
429
- {
430
- className: `rounded px-1.5 py-px text-[10.5px] font-semibold uppercase tracking-wide ring-1 ring-inset ${r.cls}`,
431
- children: r.label
432
- }
433
- ),
434
- /* @__PURE__ */ t("span", { className: "min-w-0 text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: e.label }),
435
- e.row != null && /* @__PURE__ */ d("span", { className: "ml-auto text-[11px] text-slate-400 tabular-nums", children: [
436
- "row ",
437
- e.row
438
- ] })
439
- ] }),
440
- e.fields.length > 0 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-x-4 gap-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: e.fields.map((a) => /* @__PURE__ */ d("span", { children: [
441
- se[a.field],
442
- ":",
443
- " ",
444
- /* @__PURE__ */ t("span", { className: "line-through decoration-slate-400", children: a.before || "—" }),
445
- " →",
446
- " ",
447
- /* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-foreground", children: a.after || "—" })
448
- ] }, a.field)) }),
449
- e.kind === "changed" && e.filters_after.length + e.filters_before.length > 0 && /* @__PURE__ */ t(ie, { before: e.filters_before, after: e.filters_after }),
450
- e.kind === "added" && e.filters_after.length > 0 && e.filters_after.join(" · ") !== e.label && /* @__PURE__ */ t("div", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: e.filters_after.join(" · ") }),
451
- (e.people_added.length > 0 || e.people_removed.length > 0 || e.teams_added.length > 0 || e.teams_removed.length > 0) && /* @__PURE__ */ d("div", { className: "flex flex-wrap gap-1", children: [
452
- e.people_added.map((a) => /* @__PURE__ */ t(E, { add: !0, title: a.email ?? void 0, children: a.name }, `+${a.id}`)),
453
- e.teams_added.map((a) => /* @__PURE__ */ d(E, { add: !0, children: [
454
- "Team ",
455
- a.name
456
- ] }, `+t${a.id}`)),
457
- e.people_removed.map((a) => /* @__PURE__ */ t(E, { title: a.email ?? void 0, children: a.name }, `-${a.id}`)),
458
- e.teams_removed.map((a) => /* @__PURE__ */ d(E, { children: [
459
- "Team ",
460
- a.name
461
- ] }, `-t${a.id}`))
462
- ] })
463
- ] });
522
+ function me({ change: t, blocked: d = !1 }) {
523
+ const a = le[t.kind];
524
+ return /* @__PURE__ */ s(
525
+ "li",
526
+ {
527
+ className: `space-y-1.5 px-3 py-2 ${d ? "bg-slate-50 opacity-70 dark:bg-muted/30" : ""}`,
528
+ "data-change-kind": t.kind,
529
+ "data-change-blocked": d || void 0,
530
+ children: [
531
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
532
+ d ? /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 rounded px-1.5 py-px text-[10.5px] font-semibold uppercase tracking-wide text-rose-700 ring-1 ring-inset ring-rose-200 dark:text-rose-300 dark:ring-rose-800/60", children: [
533
+ /* @__PURE__ */ r(U, { className: "h-3 w-3" }),
534
+ "Fix row ",
535
+ t.row,
536
+ " first"
537
+ ] }) : /* @__PURE__ */ r(
538
+ "span",
539
+ {
540
+ className: `rounded px-1.5 py-px text-[10.5px] font-semibold uppercase tracking-wide ring-1 ring-inset ${a.cls}`,
541
+ children: a.label
542
+ }
543
+ ),
544
+ /* @__PURE__ */ r("span", { className: "min-w-0 text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: t.label }),
545
+ t.row != null && /* @__PURE__ */ s("span", { className: "ml-auto text-[11px] text-slate-400 tabular-nums", children: [
546
+ "row ",
547
+ t.row
548
+ ] })
549
+ ] }),
550
+ t.fields.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-x-4 gap-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: t.fields.map((e) => /* @__PURE__ */ s("span", { children: [
551
+ ie[e.field],
552
+ ":",
553
+ " ",
554
+ /* @__PURE__ */ r("span", { className: "line-through decoration-slate-400", children: e.before || "—" }),
555
+ " →",
556
+ " ",
557
+ /* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-foreground", children: e.after || "—" })
558
+ ] }, e.field)) }),
559
+ t.kind === "changed" && t.filters_after.length + t.filters_before.length > 0 && /* @__PURE__ */ r(he, { before: t.filters_before, after: t.filters_after }),
560
+ t.kind === "added" && t.filters_after.length > t.label.split(" · ").length && /* @__PURE__ */ r("div", { className: "text-[12px] text-slate-600 dark:text-muted-foreground", children: t.filters_after.join(" · ") }),
561
+ (t.people_added.length > 0 || t.people_removed.length > 0 || t.teams_added.length > 0 || t.teams_removed.length > 0) && /* @__PURE__ */ s("div", { className: "flex flex-wrap gap-1", children: [
562
+ t.people_added.map((e) => /* @__PURE__ */ r(L, { add: !0, title: e.email ?? void 0, children: e.name }, `+${e.id}`)),
563
+ t.teams_added.map((e) => /* @__PURE__ */ s(L, { add: !0, children: [
564
+ "Team ",
565
+ e.name
566
+ ] }, `+t${e.id}`)),
567
+ t.people_removed.map((e) => /* @__PURE__ */ r(L, { title: e.email ?? void 0, children: e.name }, `-${e.id}`)),
568
+ t.teams_removed.map((e) => /* @__PURE__ */ s(L, { children: [
569
+ "Team ",
570
+ e.name
571
+ ] }, `-t${e.id}`))
572
+ ] })
573
+ ]
574
+ }
575
+ );
464
576
  }
465
- function ie({ before: e, after: r }) {
466
- const a = e.filter((l) => !r.includes(l)), n = r.filter((l) => !e.includes(l));
467
- return /* @__PURE__ */ d("div", { className: "flex flex-wrap items-baseline gap-x-1.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
468
- /* @__PURE__ */ t("span", { children: "Values:" }),
469
- a.length > 0 && /* @__PURE__ */ t("span", { className: "line-through decoration-slate-400", children: a.join(" · ") }),
470
- a.length > 0 && n.length > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, children: "→" }),
471
- n.length > 0 && /* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-foreground", children: n.join(" · ") }),
472
- r.length === 0 && /* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-foreground", children: "any record" })
577
+ function he({ before: t, after: d }) {
578
+ const a = t.filter((o) => !d.includes(o)), e = d.filter((o) => !t.includes(o));
579
+ return /* @__PURE__ */ s("div", { className: "flex flex-wrap items-baseline gap-x-1.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
580
+ /* @__PURE__ */ r("span", { children: "Values:" }),
581
+ a.length > 0 && /* @__PURE__ */ r("span", { className: "line-through decoration-slate-400", children: a.join(" · ") }),
582
+ a.length > 0 && e.length > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "→" }),
583
+ e.length > 0 && /* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-foreground", children: e.join(" · ") }),
584
+ d.length === 0 && /* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-foreground", children: "any record" })
473
585
  ] });
474
586
  }
475
- function E({
476
- add: e = !1,
477
- title: r,
587
+ function L({
588
+ add: t = !1,
589
+ title: d,
478
590
  children: a
479
591
  }) {
480
- return /* @__PURE__ */ d(
592
+ return /* @__PURE__ */ s(
481
593
  "span",
482
594
  {
483
- "data-tip": r,
484
- className: `inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11.5px] ring-1 ring-inset ${e ? "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:ring-emerald-800/60" : "bg-rose-50 text-rose-800 ring-rose-200 dark:bg-rose-950/40 dark:text-rose-300 dark:ring-rose-800/60"}`,
595
+ "data-tip": d,
596
+ className: `inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11.5px] ring-1 ring-inset ${t ? "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-950/40 dark:text-emerald-300 dark:ring-emerald-800/60" : "bg-rose-50 text-rose-800 ring-rose-200 dark:bg-rose-950/40 dark:text-rose-300 dark:ring-rose-800/60"}`,
485
597
  children: [
486
- e ? /* @__PURE__ */ t(M, { className: "h-3 w-3" }) : /* @__PURE__ */ t(V, { className: "h-3 w-3" }),
598
+ t ? /* @__PURE__ */ r(G, { className: "h-3 w-3" }) : /* @__PURE__ */ r(X, { className: "h-3 w-3" }),
487
599
  a
488
600
  ]
489
601
  }
490
602
  );
491
603
  }
492
604
  export {
493
- Ne as OwnerMatrixSheetActions,
494
- re as OwnerSheetDrawer
605
+ _e as OwnerMatrixSheetActions,
606
+ oe as OwnerSheetDrawer
495
607
  };