@nivaro/react 0.3.64 → 0.3.66

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 (74) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +62 -8
  4. package/dist/shared/components/CollectionBrowserView.js +3127 -3204
  5. package/dist/shared/components/ConformanceView.js +235 -221
  6. package/dist/shared/components/DataTable.js +478 -459
  7. package/dist/shared/components/ItemEditForm.js +4842 -4500
  8. package/dist/shared/components/MyWorkView.js +124 -113
  9. package/dist/shared/components/PageRenderer.js +146 -138
  10. package/dist/shared/components/ProfileView.js +483 -472
  11. package/dist/shared/components/RecordDrilldownSheet.js +73 -65
  12. package/dist/shared/components/ReportView.js +1100 -1094
  13. package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
  14. package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
  15. package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
  16. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
  17. package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
  18. package/dist/shared/components/bulk/bulk-field-options.js +29 -23
  19. package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
  20. package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
  21. package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
  22. package/dist/shared/components/integrations/SendCurrentData.js +126 -0
  23. package/dist/shared/components/item-edit/CatalogPickerField.js +1535 -1440
  24. package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
  25. package/dist/shared/components/item-edit/FieldRow.js +413 -403
  26. package/dist/shared/components/item-edit/GroupSection.js +555 -538
  27. package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
  28. package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
  29. package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
  31. package/dist/shared/components/item-edit/PlanGrid.js +783 -724
  32. package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
  33. package/dist/shared/components/item-edit/RecordInsights.js +113 -111
  34. package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
  35. package/dist/shared/components/item-edit/RelationCombobox.js +398 -364
  36. package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
  37. package/dist/shared/components/item-edit/UserChip.js +264 -229
  38. package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -0
  39. package/dist/shared/components/item-edit/collision-format.js +37 -0
  40. package/dist/shared/components/item-edit/field-a11y.js +25 -0
  41. package/dist/shared/components/item-edit/header-path-preview.js +52 -0
  42. package/dist/shared/components/item-edit/line-merge.js +84 -0
  43. package/dist/shared/components/item-edit/line-midair.js +94 -87
  44. package/dist/shared/components/item-edit/move-guard.js +17 -0
  45. package/dist/shared/components/item-edit/picker-search.js +27 -16
  46. package/dist/shared/components/item-edit/rail-width.js +8 -0
  47. package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
  48. package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
  49. package/dist/shared/components/panels/CommentPanel.js +142 -136
  50. package/dist/shared/components/panels/ItemLockBanner.js +246 -240
  51. package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
  52. package/dist/shared/components/panels/RevisionsPanel.js +106 -102
  53. package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
  54. package/dist/shared/components/panels/SlaClock.js +90 -68
  55. package/dist/shared/components/queue/QueueItemSheet.js +94 -87
  56. package/dist/shared/components/queue/QueueWorklist.js +1522 -1347
  57. package/dist/shared/components/queue/worklist-csv.js +75 -0
  58. package/dist/shared/components/queue/worklist-helpers.js +20 -0
  59. package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
  60. package/dist/shared/lib/bulk-copy.js +17 -0
  61. package/dist/shared/lib/cbv-export.js +122 -0
  62. package/dist/shared/lib/delete-offer.js +13 -0
  63. package/dist/shared/lib/error-hints.js +1 -0
  64. package/dist/shared/lib/leave-guard.js +41 -26
  65. package/dist/shared/lib/list-link.js +72 -56
  66. package/dist/shared/lib/live-queries.js +32 -30
  67. package/dist/shared/lib/moved-notice.js +25 -0
  68. package/dist/shared/lib/notification-target.js +56 -54
  69. package/dist/shared/lib/obligation-banner.js +11 -8
  70. package/dist/shared/lib/obligation-reason-text.js +6 -6
  71. package/dist/shared/lib/quick-filter-cascade.js +29 -19
  72. package/dist/shared/lib/sort-cycle.js +6 -0
  73. package/dist/shared/lib/summary-mode.js +59 -41
  74. package/package.json +1 -1
@@ -1,175 +1,426 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { useState as g } from "react";
3
- import { createPortal as v } from "react-dom";
4
- import { htmlToText as w } from "../../lib/sanitize-html.js";
5
- import { titleCase as N } from "../../lib/utils.js";
6
- import { lineConflictKey as b } from "./line-midair.js";
7
- function C({
8
- collision: a,
9
- fieldLabel: i,
10
- onCancel: c,
11
- onResolve: m,
12
- title: u = "Someone else changed this record",
13
- intro: f = "These fields were saved by someone else while you were editing. Pick which value wins for each — everything else you changed saves normally.",
14
- cancelLabel: p = "Cancel save"
1
+ import { jsx as d, jsxs as a, Fragment as z } from "react/jsx-runtime";
2
+ import { useState as P } from "react";
3
+ import { createPortal as H } from "react-dom";
4
+ import { htmlToText as A } from "../../lib/sanitize-html.js";
5
+ import { titleCase as J } from "../../lib/utils.js";
6
+ import { collisionNumberText as K, differingTails as W } from "./collision-format.js";
7
+ import { classifyLineConflicts as q, mergeReady as G, mergedLinePreview as Q, previewFields as R, mergeTheirsKeys as U } from "./line-merge.js";
8
+ import { lineConflictKey as I } from "./line-midair.js";
9
+ function X({
10
+ collision: n,
11
+ fieldLabel: c,
12
+ onCancel: p,
13
+ onResolve: l,
14
+ title: w = "Someone else changed this record",
15
+ intro: M = "These fields were saved by someone else while you were editing. Pick which value wins for each — everything else you changed saves normally.",
16
+ cancelLabel: v = "Cancel save",
17
+ formatValue: S = K,
18
+ topSlot: b,
19
+ replaceBody: T,
20
+ merge: u,
21
+ applyLabel: N = "Apply & save"
15
22
  }) {
16
- const [t, o] = g(
17
- () => new Set(a.conflicts.map((e) => e.field))
18
- ), [n, y] = g(null), x = (e) => {
19
- if (e == null || e === "") return "—";
20
- if (typeof e == "object") return JSON.stringify(e).slice(0, 120);
21
- const l = String(e), s = /<[a-z][^>]*>/i.test(l) ? w(l) : l;
22
- return s.trim() ? s.slice(0, 200) : "—";
23
- }, k = /* @__PURE__ */ r(
23
+ const [y, $] = P("pick"), o = !!u && b === void 0 && T === void 0, s = o ? /* @__PURE__ */ d(B, { mode: y, onMode: $ }) : b, t = o && y === "merge" && u ? /* @__PURE__ */ d(
24
+ E,
25
+ {
26
+ sources: [{ ...n, ...u }],
27
+ label: c,
28
+ formatValue: S,
29
+ hideField: (r, i) => {
30
+ var x;
31
+ return !!((x = u.hideField) != null && x.call(u, i));
32
+ },
33
+ cancelLabel: v,
34
+ onCancel: p,
35
+ onResolve: l
36
+ }
37
+ ) : T, [m, h] = P(
38
+ () => new Set(n.conflicts.map((r) => r.field))
39
+ ), [g, C] = P(null), _ = (r, i) => {
40
+ if (i == null || i === "") return "—";
41
+ const x = S(r, i);
42
+ if (x != null) return x;
43
+ if (typeof i == "object") return JSON.stringify(i).slice(0, 120);
44
+ const f = String(i), k = /<[a-z][^>]*>/i.test(f) ? A(f) : f;
45
+ return k.trim() ? k.slice(0, 200) : "—";
46
+ }, D = (r, i, x) => {
47
+ const f = _(r, i), k = _(r, x);
48
+ if (f === "—" || k === "—") return { t: f, m: k };
49
+ const j = W(f, k);
50
+ return { t: j.a, m: j.b };
51
+ }, e = /* @__PURE__ */ d(
24
52
  "span",
25
53
  {
26
54
  hidden: !0,
27
- ref: (e) => {
28
- e && !n && y(e.closest('[role="dialog"]') ?? document.body);
55
+ ref: (r) => {
56
+ r && !g && C(r.closest('[role="dialog"]') ?? document.body);
29
57
  }
30
58
  }
31
59
  );
32
- return n ? v(
33
- /* @__PURE__ */ d(
60
+ return g ? H(
61
+ /* @__PURE__ */ a(
34
62
  "div",
35
63
  {
36
64
  role: "dialog",
37
65
  "aria-modal": "true",
38
66
  "aria-labelledby": "nvr-midair-title",
39
67
  className: "pointer-events-auto fixed inset-0 z-[130] flex items-center justify-center",
40
- onKeyDown: (e) => {
41
- e.key === "Escape" && (e.stopPropagation(), c());
68
+ onKeyDown: (r) => {
69
+ r.key === "Escape" && (r.stopPropagation(), p());
42
70
  },
43
71
  children: [
44
- /* @__PURE__ */ r(
72
+ /* @__PURE__ */ d(
45
73
  "button",
46
74
  {
47
75
  type: "button",
48
76
  "aria-label": "Close",
49
77
  tabIndex: -1,
50
78
  className: "absolute inset-0 cursor-default bg-black/40",
51
- onClick: c
79
+ onClick: p
52
80
  }
53
81
  ),
54
- /* @__PURE__ */ d("div", { className: "relative w-[560px] max-w-[94vw] rounded-lg border border-slate-200 bg-white p-5 shadow-xl dark:border-border dark:bg-card", children: [
55
- /* @__PURE__ */ r(
82
+ /* @__PURE__ */ a("div", { className: "relative w-[560px] max-w-[94vw] rounded-lg border border-slate-200 bg-white p-5 shadow-xl dark:border-border dark:bg-card", children: [
83
+ /* @__PURE__ */ d(
56
84
  "p",
57
85
  {
58
86
  id: "nvr-midair-title",
59
87
  className: "text-[14px] font-semibold text-slate-900 dark:text-foreground",
60
- children: u
88
+ children: w
61
89
  }
62
90
  ),
63
- /* @__PURE__ */ r("p", { className: "mt-1 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: f }),
64
- /* @__PURE__ */ r("div", { className: "mt-3 max-h-[320px] space-y-2 overflow-y-auto", children: a.conflicts.map((e) => {
65
- const l = t.has(e.field);
66
- return /* @__PURE__ */ d(
67
- "div",
68
- {
69
- className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
70
- children: [
71
- /* @__PURE__ */ r("p", { className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: i(e.field) }),
72
- /* @__PURE__ */ d("div", { className: "mt-1.5 grid grid-cols-2 gap-2", children: [
91
+ /* @__PURE__ */ d("p", { className: "mt-1 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: M }),
92
+ s,
93
+ t ?? /* @__PURE__ */ a(z, { children: [
94
+ /* @__PURE__ */ d("div", { className: "mt-3 max-h-[320px] space-y-2 overflow-y-auto", children: n.conflicts.map((r, i) => {
95
+ const x = m.has(r.field), f = D(r.field, r.current_value, n.mine[r.field]), k = `nvr-midair-field-${i}`;
96
+ return /* @__PURE__ */ a(
97
+ "div",
98
+ {
99
+ className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
100
+ children: [
73
101
  /* @__PURE__ */ d(
74
- "button",
102
+ "p",
75
103
  {
76
- type: "button",
77
- onClick: () => o((s) => /* @__PURE__ */ new Set([...s, e.field])),
78
- className: l ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
79
- children: [
80
- /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Theirs (current)" }),
81
- /* @__PURE__ */ r("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: x(e.current_value) })
82
- ]
104
+ id: k,
105
+ className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground",
106
+ children: c(r.field)
83
107
  }
84
108
  ),
85
- /* @__PURE__ */ d(
86
- "button",
109
+ /* @__PURE__ */ a(
110
+ "fieldset",
87
111
  {
88
- type: "button",
89
- onClick: () => o((s) => {
90
- const h = new Set(s);
91
- return h.delete(e.field), h;
92
- }),
93
- className: l ? "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border" : "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10",
112
+ "aria-labelledby": k,
113
+ className: "m-0 mt-1.5 grid min-w-0 grid-cols-2 gap-2 border-0 p-0",
94
114
  children: [
95
- /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Mine (overwrite)" }),
96
- /* @__PURE__ */ r("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: x(a.mine[e.field]) })
115
+ /* @__PURE__ */ a(
116
+ "button",
117
+ {
118
+ type: "button",
119
+ "aria-pressed": x,
120
+ onClick: () => h((j) => /* @__PURE__ */ new Set([...j, r.field])),
121
+ className: x ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
122
+ children: [
123
+ /* @__PURE__ */ d("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Theirs (current)" }),
124
+ /* @__PURE__ */ d("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: f.t })
125
+ ]
126
+ }
127
+ ),
128
+ /* @__PURE__ */ a(
129
+ "button",
130
+ {
131
+ type: "button",
132
+ "aria-pressed": !x,
133
+ onClick: () => h((j) => {
134
+ const O = new Set(j);
135
+ return O.delete(r.field), O;
136
+ }),
137
+ className: x ? "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border" : "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10",
138
+ children: [
139
+ /* @__PURE__ */ d("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Mine (overwrite)" }),
140
+ /* @__PURE__ */ d("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: f.m })
141
+ ]
142
+ }
143
+ )
97
144
  ]
98
145
  }
99
146
  )
100
- ] })
101
- ]
102
- },
103
- e.field
104
- );
105
- }) }),
106
- /* @__PURE__ */ d("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
107
- /* @__PURE__ */ r(
108
- "button",
109
- {
110
- type: "button",
111
- onClick: c,
112
- className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
113
- children: p
114
- }
115
- ),
116
- /* @__PURE__ */ r(
117
- "button",
118
- {
119
- type: "button",
120
- onClick: () => m(t),
121
- className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white",
122
- children: "Apply & save"
123
- }
124
- )
147
+ ]
148
+ },
149
+ r.field
150
+ );
151
+ }) }),
152
+ /* @__PURE__ */ a("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
153
+ /* @__PURE__ */ d(
154
+ "button",
155
+ {
156
+ type: "button",
157
+ onClick: p,
158
+ className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
159
+ children: v
160
+ }
161
+ ),
162
+ /* @__PURE__ */ d(
163
+ "button",
164
+ {
165
+ type: "button",
166
+ onClick: () => l(m),
167
+ className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white",
168
+ children: N
169
+ }
170
+ )
171
+ ] })
125
172
  ] })
126
173
  ] })
127
174
  ]
128
175
  }
129
176
  ),
130
- n
131
- ) : k;
177
+ g
178
+ ) : e;
132
179
  }
133
- function _({
134
- lines: a,
135
- fieldLabel: i,
136
- onCancel: c,
137
- onResolve: m,
138
- intro: u = "These values were saved by someone else after you changed them. Pick which value wins for each — the rest of your changes are saved.",
139
- cancelLabel: f = "Decide later"
180
+ function de({
181
+ lines: n,
182
+ fieldLabel: c,
183
+ onCancel: p,
184
+ onResolve: l,
185
+ intro: w = "These values were saved by someone else after you changed them. Pick which value wins for each — the rest of your changes are saved.",
186
+ cancelLabel: M = "Decide later",
187
+ formatValue: v = K,
188
+ hideField: S,
189
+ applyLabel: b,
190
+ mergeLabel: T
140
191
  }) {
141
- const p = (t) => (i == null ? void 0 : i(t)) || N(t.replace(/_/g, " "));
142
- return /* @__PURE__ */ r(
143
- C,
192
+ const [u, N] = P("pick"), y = (o) => (c == null ? void 0 : c(o)) || J(o.replace(/_/g, " ")), $ = (o) => {
193
+ for (const s of n)
194
+ for (const t of s.conflicts) if (I(s, t.field) === o) return t.field;
195
+ return o;
196
+ };
197
+ return /* @__PURE__ */ d(
198
+ X,
144
199
  {
145
- title: a.length === 1 ? `Someone else changed ${a[0].label}` : `Someone else changed ${a.length} lines`,
146
- intro: u,
147
- cancelLabel: f,
200
+ title: n.length === 1 ? `Someone else changed ${n[0].label}` : `Someone else changed ${n.length} lines`,
201
+ intro: w,
202
+ cancelLabel: M,
148
203
  collision: {
149
- conflicts: a.flatMap(
150
- (t) => t.conflicts.map((o) => ({
151
- field: b(t, o.field),
152
- current_value: o.current_value
204
+ conflicts: n.flatMap(
205
+ (o) => o.conflicts.map((s) => ({
206
+ field: I(o, s.field),
207
+ current_value: s.current_value
153
208
  }))
154
209
  ),
155
210
  mine: Object.fromEntries(
156
- a.flatMap(
157
- (t) => t.conflicts.map((o) => [b(t, o.field), t.mine[o.field]])
211
+ n.flatMap(
212
+ (o) => o.conflicts.map((s) => [I(o, s.field), o.mine[s.field]])
158
213
  )
159
214
  )
160
215
  },
161
- fieldLabel: (t) => {
162
- for (const o of a)
163
- for (const n of o.conflicts)
164
- if (b(o, n.field) === t) return `${o.label} · ${p(n.field)}`;
165
- return t;
216
+ formatValue: (o, s) => v($(o), s),
217
+ fieldLabel: (o) => {
218
+ for (const s of n)
219
+ for (const t of s.conflicts)
220
+ if (I(s, t.field) === o) return `${s.label} · ${y(t.field)}`;
221
+ return o;
166
222
  },
167
- onCancel: c,
168
- onResolve: m
223
+ onCancel: p,
224
+ onResolve: l,
225
+ applyLabel: b,
226
+ topSlot: /* @__PURE__ */ d(B, { mode: u, onMode: N }),
227
+ replaceBody: u === "merge" ? /* @__PURE__ */ d(
228
+ E,
229
+ {
230
+ sources: n,
231
+ saveLabel: T,
232
+ label: y,
233
+ formatValue: v,
234
+ hideField: S,
235
+ cancelLabel: M,
236
+ onCancel: p,
237
+ onResolve: l
238
+ }
239
+ ) : void 0
240
+ }
241
+ );
242
+ }
243
+ function B({
244
+ mode: n,
245
+ onMode: c
246
+ }) {
247
+ const p = (l, w) => /* @__PURE__ */ d(
248
+ "button",
249
+ {
250
+ type: "button",
251
+ "aria-pressed": n === l,
252
+ "data-resolve-mode": l,
253
+ onClick: () => c(l),
254
+ className: n === l ? "h-7 rounded-md bg-white px-3 text-[12px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "h-7 rounded-md px-3 text-[12px] text-slate-500 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
255
+ children: w
169
256
  }
170
257
  );
258
+ return /* @__PURE__ */ a("fieldset", { className: "m-0 mt-3 inline-flex min-w-0 gap-1 rounded-lg border-0 bg-slate-100 p-1 dark:bg-muted", children: [
259
+ /* @__PURE__ */ d("legend", { className: "sr-only", children: "How to settle it" }),
260
+ p("pick", "Theirs or mine"),
261
+ p("merge", "Merge")
262
+ ] });
263
+ }
264
+ function E({
265
+ sources: n,
266
+ label: c,
267
+ formatValue: p,
268
+ hideField: l,
269
+ cancelLabel: w,
270
+ onCancel: M,
271
+ onResolve: v,
272
+ saveLabel: S = "Save merged"
273
+ }) {
274
+ const [b, T] = P(() => /* @__PURE__ */ new Map()), u = n.map((t) => ({ line: t, fields: q(t) })), N = u.flatMap((t) => t.fields), y = N.filter((t) => t.kind === "conflict" && !b.has(t.key)).length, $ = G(N, b), o = (t, m) => {
275
+ if (m == null || m === "") return "—";
276
+ const h = p(t, m);
277
+ if (h != null) return h;
278
+ if (typeof m == "object") return "—";
279
+ const g = String(m), C = /<[a-z][^>]*>/i.test(g) ? A(g) : g;
280
+ return C.trim() ? C.slice(0, 120) : "—";
281
+ }, s = (t, m) => T((h) => new Map(h).set(t, m));
282
+ return /* @__PURE__ */ a(z, { children: [
283
+ /* @__PURE__ */ d("div", { className: "mt-3 max-h-[360px] space-y-3 overflow-y-auto", "data-merge-view": "", children: u.map(({ line: t, fields: m }) => {
284
+ const h = new Set(t.conflicts.map((e) => e.field)), g = new Set((t.derived ?? []).map((e) => e.field)), C = Object.keys(t.edit ?? {}).filter(
285
+ (e) => {
286
+ var r, i;
287
+ return !h.has(e) && !g.has(e) && e !== "id" && !e.startsWith("_") && !(((r = t.edit) == null ? void 0 : r[e]) !== null && typeof ((i = t.edit) == null ? void 0 : i[e]) == "object") && !(l != null && l(t, e));
288
+ }
289
+ ), _ = Q(t, b), D = R(t, (e) => !!(l != null && l(t, e)));
290
+ return /* @__PURE__ */ a(
291
+ "div",
292
+ {
293
+ className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
294
+ children: [
295
+ t.label && /* @__PURE__ */ d("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-foreground", children: t.label }),
296
+ /* @__PURE__ */ a("ul", { className: "mt-1 space-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
297
+ C.map((e) => {
298
+ var r;
299
+ return /* @__PURE__ */ a("li", { children: [
300
+ c(e),
301
+ ": yours (",
302
+ o(e, (r = t.edit) == null ? void 0 : r[e]),
303
+ ") — only you changed it"
304
+ ] }, `m:${e}`);
305
+ }),
306
+ m.filter((e) => e.kind === "same").map((e) => /* @__PURE__ */ a("li", { children: [
307
+ c(e.field),
308
+ ": you both set ",
309
+ o(e.field, e.theirs)
310
+ ] }, `s:${e.key}`)),
311
+ m.filter((e) => e.kind === "derived").map((e) => /* @__PURE__ */ a("li", { children: [
312
+ c(e.field),
313
+ ": worked out again from the merged values"
314
+ ] }, `d:${e.key}`)),
315
+ /* @__PURE__ */ d("li", { children: "Anything else they changed stays as they saved it." })
316
+ ] }),
317
+ m.filter((e) => e.kind === "conflict").map((e) => {
318
+ const r = b.get(e.key), i = `nvr-merge-${t.rowId ?? "record"}-${e.field}`;
319
+ return /* @__PURE__ */ a("div", { className: "mt-2", children: [
320
+ /* @__PURE__ */ a(
321
+ "p",
322
+ {
323
+ id: i,
324
+ className: "text-[12px] font-medium text-amber-700 dark:text-amber-300",
325
+ children: [
326
+ c(e.field),
327
+ " — you both changed it. Pick one:"
328
+ ]
329
+ }
330
+ ),
331
+ /* @__PURE__ */ a(
332
+ "fieldset",
333
+ {
334
+ "aria-labelledby": i,
335
+ className: "m-0 mt-1 grid min-w-0 grid-cols-2 gap-2 border-0 p-0",
336
+ children: [
337
+ /* @__PURE__ */ a(
338
+ "button",
339
+ {
340
+ type: "button",
341
+ "aria-pressed": r === "theirs",
342
+ "data-merge-pick": "theirs",
343
+ onClick: () => s(e.key, "theirs"),
344
+ className: r === "theirs" ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
345
+ children: [
346
+ /* @__PURE__ */ d("span", { className: "block text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Theirs" }),
347
+ /* @__PURE__ */ d("span", { className: "mt-0.5 block text-[12px] text-slate-700 dark:text-foreground", children: o(e.field, e.theirs) })
348
+ ]
349
+ }
350
+ ),
351
+ /* @__PURE__ */ a(
352
+ "button",
353
+ {
354
+ type: "button",
355
+ "aria-pressed": r === "mine",
356
+ "data-merge-pick": "mine",
357
+ onClick: () => s(e.key, "mine"),
358
+ className: r === "mine" ? "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
359
+ children: [
360
+ /* @__PURE__ */ d("span", { className: "block text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Mine" }),
361
+ /* @__PURE__ */ d("span", { className: "mt-0.5 block text-[12px] text-slate-700 dark:text-foreground", children: o(e.field, e.mine) })
362
+ ]
363
+ }
364
+ )
365
+ ]
366
+ }
367
+ )
368
+ ] }, e.key);
369
+ }),
370
+ D.length > 0 && /* @__PURE__ */ a(
371
+ "div",
372
+ {
373
+ className: "mt-2 rounded-md bg-slate-50 px-2.5 py-1.5 dark:bg-muted/40",
374
+ "data-merge-preview": "",
375
+ children: [
376
+ /* @__PURE__ */ d("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "After the merge" }),
377
+ /* @__PURE__ */ d("p", { className: "mt-0.5 text-[12px] text-slate-700 dark:text-foreground", children: D.map((e) => `${c(e)} ${o(e, _[e])}`).join(" · ") })
378
+ ]
379
+ }
380
+ )
381
+ ]
382
+ },
383
+ `${t.key ?? "record"}:${t.rowId ?? ""}`
384
+ );
385
+ }) }),
386
+ /* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center justify-end gap-2", children: [
387
+ !$ && /* @__PURE__ */ a(
388
+ "p",
389
+ {
390
+ className: "mr-auto text-[12px] text-slate-500 dark:text-muted-foreground",
391
+ role: "status",
392
+ children: [
393
+ "Pick a value for ",
394
+ y,
395
+ " ",
396
+ y === 1 ? "field" : "fields",
397
+ " to save."
398
+ ]
399
+ }
400
+ ),
401
+ /* @__PURE__ */ d(
402
+ "button",
403
+ {
404
+ type: "button",
405
+ onClick: M,
406
+ className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
407
+ children: w
408
+ }
409
+ ),
410
+ /* @__PURE__ */ d(
411
+ "button",
412
+ {
413
+ type: "button",
414
+ disabled: !$,
415
+ onClick: () => v(U(N, b)),
416
+ className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white disabled:cursor-not-allowed disabled:opacity-50",
417
+ children: S
418
+ }
419
+ )
420
+ ] })
421
+ ] });
171
422
  }
172
423
  export {
173
- _ as LineCollisionDialog,
174
- C as MidairCollisionDialog
424
+ de as LineCollisionDialog,
425
+ X as MidairCollisionDialog
175
426
  };