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