@nivaro/react 0.3.11 → 0.3.13

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.
@@ -1,16 +1,26 @@
1
- import { jsx as i, jsxs as c } from "react/jsx-runtime";
2
- import { useQueryClient as oe } from "@tanstack/react-query";
3
- import { EyeOff as ie, ArrowLeft as de, Trash2 as ce, Copy as ue, FileUp as me, Bot as le, UploadCloud as be } from "lucide-react";
4
- import { useState as p, useRef as g, useEffect as v } from "react";
1
+ import { jsx as i, jsxs as d } from "react/jsx-runtime";
2
+ import { useQueryClient as de } from "@tanstack/react-query";
3
+ import { EyeOff as ce, ArrowLeft as ue, Trash2 as me, Copy as le, FileUp as be, Bot as fe, UploadCloud as pe } from "lucide-react";
4
+ import { useState as y, useRef as g, useEffect as k } from "react";
5
5
  import { toast as Q } from "sonner";
6
- import { useNivaroClient as he, useItemEditAuth as fe } from "../../context.js";
7
- import { get as j, post as pe } from "../../lib/commands.js";
8
- import { useLiveRecord as ge, useLiveEvent as X, useLiveRecordEvent as Z, LIVE_ASPECTS as b, batchTouches as ve } from "../../lib/live.js";
9
- import { useOptionalRealtime as xe } from "../../lib/realtime.js";
10
- import { useRecordTabsSignal as we, useRecordTabs as ye } from "../../lib/record-tabs.js";
11
- import { userErrorMessage as ke } from "../../lib/safe-error.js";
12
- import { formatRelative as Ne } from "../../lib/utils.js";
13
- const Te = 8e3, Se = [
6
+ import { useNivaroClient as he, useRecordSurface as ge, useItemEditAuth as ve } from "../../context.js";
7
+ import { get as j, post as xe } from "../../lib/commands.js";
8
+ import { useLiveRecord as ye, useLiveEvent as I, useLiveRecordEvent as ee, LIVE_ASPECTS as f, batchTouches as ke } from "../../lib/live.js";
9
+ import { useOptionalRealtime as we } from "../../lib/realtime.js";
10
+ import { useRecordTabsSignal as Ne, useRecordTabs as Te } from "../../lib/record-tabs.js";
11
+ import { userErrorMessage as Se } from "../../lib/safe-error.js";
12
+ import { formatRelative as Re } from "../../lib/utils.js";
13
+ function _e(e, r, l) {
14
+ var p;
15
+ if (l.active)
16
+ return { text: e ? `${e} moved this to ${r}` : `This record moved to ${r}` };
17
+ const v = ((p = l.label) == null ? void 0 : p.trim()) || "A record in your tabs";
18
+ return {
19
+ text: e ? `${e} moved ${v} to ${r}` : `${v} moved to ${r}`,
20
+ open: l.open
21
+ };
22
+ }
23
+ const $e = 8e3, Ee = [
14
24
  "item",
15
25
  "rrv-record",
16
26
  "revisions",
@@ -29,26 +39,26 @@ const Te = 8e3, Se = [
29
39
  "record-integrations",
30
40
  "record-integrity"
31
41
  ];
32
- function Re(e, t, x) {
33
- const S = new Set(Se), w = String(x);
42
+ function De(e, r, l) {
43
+ const v = new Set(Ee), p = String(l);
34
44
  e.removeQueries({
35
- predicate: (m) => S.has(m.queryKey[0]) && m.queryKey[1] === t && String(m.queryKey[2]) === w
45
+ predicate: (m) => v.has(m.queryKey[0]) && m.queryKey[1] === r && String(m.queryKey[2]) === p
36
46
  });
37
47
  }
38
- function _e({ onBack: e }) {
39
- return /* @__PURE__ */ i("div", { className: "p-6", children: /* @__PURE__ */ c(
48
+ function Ae({ onBack: e }) {
49
+ return /* @__PURE__ */ i("div", { className: "p-6", children: /* @__PURE__ */ d(
40
50
  "div",
41
51
  {
42
52
  "data-record-gone": "access",
43
53
  role: "alert",
44
54
  className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
45
55
  children: [
46
- /* @__PURE__ */ i(ie, { className: "h-4 w-4 shrink-0 text-amber-500" }),
47
- /* @__PURE__ */ c("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
56
+ /* @__PURE__ */ i(ce, { className: "h-4 w-4 shrink-0 text-amber-500" }),
57
+ /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
48
58
  /* @__PURE__ */ i("span", { className: "font-semibold", children: "You no longer have access to this record." }),
49
59
  " A role, scope or filter change hid it while you had it open."
50
60
  ] }),
51
- /* @__PURE__ */ c(
61
+ /* @__PURE__ */ d(
52
62
  "button",
53
63
  {
54
64
  type: "button",
@@ -56,7 +66,7 @@ function _e({ onBack: e }) {
56
66
  "data-record-gone-back": !0,
57
67
  className: "inline-flex h-7 shrink-0 items-center gap-1 rounded-md border border-amber-300 bg-white px-2.5 text-[11.5px] font-medium text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-300 dark:hover:bg-amber-500/10",
58
68
  children: [
59
- /* @__PURE__ */ i(de, { className: "h-3.5 w-3.5" }),
69
+ /* @__PURE__ */ i(ue, { className: "h-3.5 w-3.5" }),
60
70
  "Back"
61
71
  ]
62
72
  }
@@ -65,228 +75,232 @@ function _e({ onBack: e }) {
65
75
  }
66
76
  ) });
67
77
  }
68
- const Ee = (e) => {
69
- var t;
70
- return (e == null ? void 0 : e.status) ?? ((t = e == null ? void 0 : e.response) == null ? void 0 : t.status);
78
+ const Le = (e) => {
79
+ var r;
80
+ return (e == null ? void 0 : e.status) ?? ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status);
71
81
  };
72
- function Be({
82
+ function He({
73
83
  collection: e,
74
- itemId: t,
75
- dirty: x = !1,
76
- loadDenied: S = !1,
77
- onGoneChange: w
84
+ itemId: r,
85
+ dirty: l = !1,
86
+ loadDenied: v = !1,
87
+ onGoneChange: p
78
88
  }) {
79
- const m = xe(), R = he(), y = oe(), [$, K] = p(!1), [L, I] = p([]), [o, ee] = p(null), [re, A] = p({}), [U, B] = p(!1), [F, P] = p(!1), k = g(null), N = g(null), _ = g(Date.now()), M = g(null), E = g(w);
80
- E.current = w;
81
- const h = g(null), T = (s) => {
82
- var r;
83
- h.current = s, ee(s), (r = E.current) == null || r.call(E, s), (s == null ? void 0 : s.kind) === "access" && setTimeout(() => Re(y, e, t), 0);
89
+ const m = we(), R = he(), w = de(), [D, K] = y(!1), [A, re] = y([]), [o, te] = y(null), [se, L] = y({}), [U, B] = y(!1), [F, P] = y(!1), N = g(null), T = g(null), _ = g(Date.now()), C = g(null), $ = g(p);
90
+ $.current = p;
91
+ const h = g(null), Y = ge(), H = g(Y);
92
+ H.current = Y;
93
+ const S = (s) => {
94
+ var t;
95
+ h.current = s, te(s), (t = $.current) == null || t.call($, s), (s == null ? void 0 : s.kind) === "access" && setTimeout(() => De(w, e, r), 0);
84
96
  };
85
- v(() => {
86
- _.current = Date.now(), M.current = null, A({}), h.current && T(null);
87
- }, [e, t]);
88
- const u = (s) => {
89
- for (const r of s) y.invalidateQueries({ queryKey: r });
90
- }, q = async (s) => {
91
- let r = null;
97
+ k(() => {
98
+ _.current = Date.now(), C.current = null, L({}), h.current && S(null);
99
+ }, [e, r]);
100
+ const c = (s) => {
101
+ for (const t of s) w.invalidateQueries({ queryKey: t });
102
+ }, M = async (s) => {
103
+ let t = null;
92
104
  try {
93
- r = (await R.request(
94
- j("/trash/record", { collection: e, item: t })
105
+ t = (await R.request(
106
+ j("/trash/record", { collection: e, item: r })
95
107
  )).data;
96
108
  } catch {
97
- r = null;
109
+ t = null;
98
110
  }
99
- const n = !!(r != null && r.deleted_at) && new Date(r.deleted_at).getTime() >= _.current - 6e4;
100
- T(n || s === "deleted" && !r ? {
111
+ const n = !!(t != null && t.deleted_at) && new Date(t.deleted_at).getTime() >= _.current - 6e4;
112
+ S(n || s === "deleted" && !t ? {
101
113
  kind: "deleted",
102
- by: (r == null ? void 0 : r.deleted_by_name) ?? null,
103
- at: (r == null ? void 0 : r.deleted_at) ?? (/* @__PURE__ */ new Date()).toISOString(),
104
- trashId: (r == null ? void 0 : r.trash_id) ?? null,
105
- canRestore: !!(r != null && r.can_restore)
114
+ by: (t == null ? void 0 : t.deleted_by_name) ?? null,
115
+ at: (t == null ? void 0 : t.deleted_at) ?? (/* @__PURE__ */ new Date()).toISOString(),
116
+ trashId: (t == null ? void 0 : t.trash_id) ?? null,
117
+ canRestore: !!(t != null && t.can_restore)
106
118
  } : { kind: "access" });
107
- }, te = async () => {
119
+ }, ae = async () => {
108
120
  var s;
109
121
  try {
110
- const r = (await R.request(
111
- j(`/pipelines/instance/${e}/${t}`)
112
- )).data, n = (s = r == null ? void 0 : r.history) == null ? void 0 : s[0];
113
- if (!n || n.id === M.current || n.timestamp && new Date(n.timestamp).getTime() < _.current - 5e3) return;
114
- M.current = n.id;
115
- const d = [n.first_name, n.last_name].filter(Boolean).join(" ") || n.user_email || null, f = n.to_state_label ?? "a new state";
116
- Q.info(d ? `${d} moved this to ${f}` : `This record moved to ${f}`);
122
+ const t = (await R.request(
123
+ j(`/pipelines/instance/${e}/${r}`)
124
+ )).data, n = (s = t == null ? void 0 : t.history) == null ? void 0 : s[0];
125
+ if (!n || n.id === C.current || n.timestamp && new Date(n.timestamp).getTime() < _.current - 5e3 || (C.current = n.id, typeof document < "u" && document.visibilityState === "hidden")) return;
126
+ const u = [n.first_name, n.last_name].filter(Boolean).join(" ") || n.user_email || null, x = n.to_state_label ?? "a new state", a = _e(u, x, H.current);
127
+ Q.info(
128
+ a.text,
129
+ a.open ? { action: { label: "Open", onClick: a.open } } : {}
130
+ );
117
131
  } catch {
118
132
  }
119
- }, se = (s) => {
133
+ }, ne = (s) => {
120
134
  var n;
121
135
  if (s.deleted) {
122
- q("deleted");
136
+ M("deleted");
123
137
  return;
124
138
  }
125
139
  if (h.current) return;
126
- s.events.some((d) => d.source === "import" && !d.own) && (P(!0), k.current && clearTimeout(k.current), k.current = setTimeout(() => P(!1), Te));
127
- const r = (d) => ve(s, d);
128
- if (r(b.state) && (u([
129
- ["pipeline-instance", e, t],
130
- ["pipeline-all-owners", e, t],
131
- ["pipeline-instance-owners", e, t],
132
- ["pipeline-owners-resolved", e, t],
133
- ["approval-brief", e, t]
134
- ]), (n = s.changedFields) != null && n.includes(b.state) && te()), r(b.addendums) && u([["addendums", e, t]]), r(b.comments) ? u([
135
- ["comments", e, t],
136
- ["comments-related", e, t]
137
- ]) : (r(b.state) || r(b.integrations) || r(b.addendums) || !s.aspectsOnly) && u([["comments-related", e, t]]), r(b.tasks) && u([["tasks", e, t]]), r(b.integrations) && u([
138
- ["erp-submissions", e, t],
139
- ["record-integrations", e, t]
140
+ s.events.some((u) => u.source === "import" && !u.own) && (P(!0), N.current && clearTimeout(N.current), N.current = setTimeout(() => P(!1), $e));
141
+ const t = (u) => ke(s, u);
142
+ if (t(f.state) && (c([
143
+ ["pipeline-instance", e, r],
144
+ ["pipeline-all-owners", e, r],
145
+ ["pipeline-instance-owners", e, r],
146
+ ["pipeline-owners-resolved", e, r],
147
+ ["approval-brief", e, r]
148
+ ]), (n = s.changedFields) != null && n.includes(f.state) && ae()), t(f.addendums) && c([["addendums", e, r]]), t(f.comments) ? c([
149
+ ["comments", e, r],
150
+ ["comments-related", e, r]
151
+ ]) : (t(f.state) || t(f.integrations) || t(f.addendums) || !s.aspectsOnly) && c([["comments-related", e, r]]), t(f.tasks) && c([["tasks", e, r]]), t(f.integrations) && c([
152
+ ["erp-submissions", e, r],
153
+ ["record-integrations", e, r]
140
154
  ]), !s.aspectsOnly) {
141
- if (s.ids.length > 0 && s.ids.every((d) => d === "*")) {
142
- u([
143
- ["item", e, t],
144
- ["pipeline-instance", e, t]
155
+ if (s.ids.length > 0 && s.ids.every((u) => u === "*")) {
156
+ c([
157
+ ["item", e, r],
158
+ ["pipeline-instance", e, r]
145
159
  ]);
146
160
  return;
147
161
  }
148
- Y();
162
+ V();
149
163
  }
150
- }, Y = () => {
151
- u([
152
- ["item", e, t],
164
+ }, V = () => {
165
+ c([
166
+ ["item", e, r],
153
167
  // Summary mode reads its own copy (#1869) — it diffs + highlights.
154
- ["rrv-record", e, t],
155
- ["field-touch", e, t],
156
- ["revisions", e, t],
168
+ ["rrv-record", e, r],
169
+ ["field-touch", e, r],
170
+ ["revisions", e, r],
157
171
  // Who made the write — the field ghosts (#2) attribute from it.
158
- ["last-touch", e, t]
159
- ]), K(!0), N.current && clearTimeout(N.current), N.current = setTimeout(() => K(!1), 4e3);
172
+ ["last-touch", e, r]
173
+ ]), K(!0), T.current && clearTimeout(T.current), T.current = setTimeout(() => K(!1), 4e3);
160
174
  };
161
- ge(e, t, se);
162
- const { userId: H } = fe();
163
- we(H, "saved", e, t, () => {
164
- h.current || (Y(), u([
165
- ["pipeline-instance", e, t],
166
- ["comments", e, t],
167
- ["tasks", e, t],
175
+ ye(e, r, ne);
176
+ const { userId: z } = ve();
177
+ Ne(z, "saved", e, r, () => {
178
+ h.current || (V(), c([
179
+ ["pipeline-instance", e, r],
180
+ ["comments", e, r],
181
+ ["tasks", e, r],
168
182
  // Lines and links saved with it (the keys are per relation, not per record).
169
183
  ["o2m-rows"],
170
184
  ["m2m-items"]
171
185
  ]));
172
- }), v(
186
+ }), k(
173
187
  () => () => {
174
- N.current && clearTimeout(N.current), k.current && clearTimeout(k.current);
188
+ T.current && clearTimeout(T.current), N.current && clearTimeout(N.current);
175
189
  },
176
190
  []
177
- ), X(
191
+ ), I(
178
192
  "owners:changed",
179
193
  () => {
180
- h.current || u([
181
- ["pipeline-instance-owners", e, t],
182
- ["pipeline-owners-resolved", e, t],
183
- ["pipeline-all-owners", e, t],
184
- ["approval-brief", e, t]
194
+ h.current || c([
195
+ ["pipeline-instance-owners", e, r],
196
+ ["pipeline-owners-resolved", e, r],
197
+ ["pipeline-all-owners", e, r],
198
+ ["approval-brief", e, r]
185
199
  ]);
186
200
  },
187
201
  { debounceMs: 400 }
188
- ), Z(
202
+ ), ee(
189
203
  "record:integrity",
190
204
  e,
191
- t,
192
- () => u([["record-integrity", e, t]])
205
+ r,
206
+ () => c([["record-integrity", e, r]])
193
207
  );
194
- const V = g(/* @__PURE__ */ new Map());
195
- Z("record:automation", e, t, (s) => {
196
- const r = String((s == null ? void 0 : s.flow_id) ?? "");
197
- if (!r) return;
198
- const n = V.current, d = n.get(r);
199
- d && clearTimeout(d), n.delete(r);
200
- const f = () => A((a) => {
201
- const { [r]: l, ...O } = a;
202
- return O;
208
+ const G = g(/* @__PURE__ */ new Map());
209
+ ee("record:automation", e, r, (s) => {
210
+ const t = String((s == null ? void 0 : s.flow_id) ?? "");
211
+ if (!t) return;
212
+ const n = G.current, u = n.get(t);
213
+ u && clearTimeout(u), n.delete(t);
214
+ const x = () => L((a) => {
215
+ const { [t]: b, ...q } = a;
216
+ return q;
203
217
  });
204
218
  if ((s == null ? void 0 : s.state) === "end") {
205
- f();
219
+ x();
206
220
  return;
207
221
  }
208
- A((a) => ({ ...a, [r]: String((s == null ? void 0 : s.flow_name) || "An automation") })), n.set(r, setTimeout(f, 5 * 6e4));
209
- }), v(() => {
210
- const s = V.current;
222
+ L((a) => ({ ...a, [t]: String((s == null ? void 0 : s.flow_name) || "An automation") })), n.set(t, setTimeout(x, 5 * 6e4));
223
+ }), k(() => {
224
+ const s = G.current;
211
225
  return () => {
212
- for (const r of s.values()) clearTimeout(r);
226
+ for (const t of s.values()) clearTimeout(t);
213
227
  s.clear();
214
228
  };
215
- }, []), X(
229
+ }, []), I(
216
230
  "access:changed",
217
231
  () => {
218
232
  setTimeout(
219
233
  () => {
220
234
  var s;
221
- ((s = h.current) == null ? void 0 : s.kind) !== "deleted" && R.request(j(`/items/${e}/${t}`, { fields: "id" })).then(() => {
222
- var r;
223
- ((r = h.current) == null ? void 0 : r.kind) === "access" && (T(null), u([["item", e, t]]));
224
- }).catch((r) => {
225
- const n = Ee(r);
226
- (n === 403 || n === 404) && q("access");
235
+ ((s = h.current) == null ? void 0 : s.kind) !== "deleted" && R.request(j(`/items/${e}/${r}`, { fields: "id" })).then(() => {
236
+ var t;
237
+ ((t = h.current) == null ? void 0 : t.kind) === "access" && (S(null), c([["item", e, r]]));
238
+ }).catch((t) => {
239
+ const n = Le(t);
240
+ (n === 403 || n === 404) && M("access");
227
241
  });
228
242
  },
229
243
  Math.floor(Math.random() * 1500)
230
244
  );
231
245
  },
232
246
  { debounceMs: 300 }
233
- ), v(() => {
234
- S && !h.current && q("access");
235
- }, [S]);
236
- const D = ye(e, t, x, H), [ae, z] = p(!1);
237
- v(() => {
238
- D.otherDirty || z(!1);
239
- }, [D.otherDirty]), v(() => {
247
+ ), k(() => {
248
+ v && !h.current && M("access");
249
+ }, [v]);
250
+ const E = Te(e, r, l, z), [oe, J] = y(!1);
251
+ k(() => {
252
+ E.otherDirty || J(!1);
253
+ }, [E.otherDirty]), k(() => {
240
254
  if (!m) return;
241
255
  const s = (a) => {
242
- const l = a.detail;
243
- l != null && l.name && m.emit("record:uploading", {
256
+ const b = a.detail;
257
+ b != null && b.name && m.emit("record:uploading", {
244
258
  collection: e,
245
- item: String(t),
246
- name: l.name,
247
- state: l.state
259
+ item: String(r),
260
+ name: b.name,
261
+ state: b.state
248
262
  });
249
263
  };
250
264
  window.addEventListener("nvr:upload-state", s);
251
- const r = (a) => {
252
- if ((a == null ? void 0 : a.collection) !== e || String(a == null ? void 0 : a.item) !== String(t)) return;
253
- const l = String(a.user_name ?? a.user ?? "Someone");
254
- I((O) => {
255
- const J = O.filter((W) => !(W.user === l && W.name === a.name));
256
- return a.state === "start" ? [...J, { user: l, name: String(a.name) }] : J;
265
+ const t = (a) => {
266
+ if ((a == null ? void 0 : a.collection) !== e || String(a == null ? void 0 : a.item) !== String(r)) return;
267
+ const b = String(a.user_name ?? a.user ?? "Someone");
268
+ re((q) => {
269
+ const X = q.filter((Z) => !(Z.user === b && Z.name === a.name));
270
+ return a.state === "start" ? [...X, { user: b, name: String(a.name) }] : X;
257
271
  });
258
- }, n = m.on("record:uploading", r), d = m.on("record:comment", (a) => {
259
- (a == null ? void 0 : a.collection) !== e || String(a == null ? void 0 : a.item) !== String(t) || (y.invalidateQueries({ queryKey: ["comments", e, t] }), y.invalidateQueries({ queryKey: ["comments-related", e, t] }));
260
- }), f = (a) => r(a.detail);
261
- return window.addEventListener("nvr:record-uploading", f), () => {
262
- window.removeEventListener("nvr:upload-state", s), window.removeEventListener("nvr:record-uploading", f), n(), d();
272
+ }, n = m.on("record:uploading", t), u = m.on("record:comment", (a) => {
273
+ (a == null ? void 0 : a.collection) !== e || String(a == null ? void 0 : a.item) !== String(r) || (w.invalidateQueries({ queryKey: ["comments", e, r] }), w.invalidateQueries({ queryKey: ["comments-related", e, r] }));
274
+ }), x = (a) => t(a.detail);
275
+ return window.addEventListener("nvr:record-uploading", x), () => {
276
+ window.removeEventListener("nvr:upload-state", s), window.removeEventListener("nvr:record-uploading", x), n(), u();
263
277
  };
264
- }, [m, e, t, y]);
265
- const ne = async () => {
278
+ }, [m, e, r, w]);
279
+ const ie = async () => {
266
280
  if (o != null && o.trashId) {
267
281
  B(!0);
268
282
  try {
269
- await R.request(pe(`/trash/${o.trashId}/restore`, {})), T(null), _.current = Date.now(), u([["item", e, t]]), Q.success("Record restored");
283
+ await R.request(xe(`/trash/${o.trashId}/restore`, {})), S(null), _.current = Date.now(), c([["item", e, r]]), Q.success("Record restored");
270
284
  } catch (s) {
271
- Q.error(ke(s, "Restore failed"));
285
+ Q.error(Se(s, "Restore failed"));
272
286
  } finally {
273
287
  B(!1);
274
288
  }
275
289
  }
276
- }, C = Object.values(re), G = D.otherDirty && !ae && !x && !o;
277
- return !o && C.length === 0 && !G && !F && (!m || !$ && L.length === 0) ? null : /* @__PURE__ */ c("div", { className: "space-y-2", children: [
278
- (o == null ? void 0 : o.kind) === "deleted" && /* @__PURE__ */ c(
290
+ }, O = Object.values(se), W = E.otherDirty && !oe && !l && !o;
291
+ return !o && O.length === 0 && !W && !F && (!m || !D && A.length === 0) ? null : /* @__PURE__ */ d("div", { className: "space-y-2", children: [
292
+ (o == null ? void 0 : o.kind) === "deleted" && /* @__PURE__ */ d(
279
293
  "div",
280
294
  {
281
295
  "data-record-gone": "deleted",
282
296
  role: "alert",
283
297
  className: "flex items-center gap-3 rounded-lg border border-rose-300 bg-rose-50 px-3.5 py-2.5 dark:border-rose-500/40 dark:bg-rose-500/10",
284
298
  children: [
285
- /* @__PURE__ */ i(ce, { className: "h-4 w-4 shrink-0 text-rose-500" }),
286
- /* @__PURE__ */ c("p", { className: "min-w-0 flex-1 text-[12px] text-rose-800 dark:text-rose-300", children: [
299
+ /* @__PURE__ */ i(me, { className: "h-4 w-4 shrink-0 text-rose-500" }),
300
+ /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-[12px] text-rose-800 dark:text-rose-300", children: [
287
301
  /* @__PURE__ */ i("span", { className: "font-semibold", children: "This record was deleted" }),
288
302
  o.by ? ` by ${o.by}` : "",
289
- o.at ? ` ${Ne(o.at)}` : "",
303
+ o.at ? ` ${Re(o.at)}` : "",
290
304
  ". Saving is turned off",
291
305
  o.canRestore ? " — restore it to keep working." : "."
292
306
  ] }),
@@ -294,7 +308,7 @@ function Be({
294
308
  "button",
295
309
  {
296
310
  type: "button",
297
- onClick: () => void ne(),
311
+ onClick: () => void ie(),
298
312
  disabled: U,
299
313
  className: "h-7 shrink-0 rounded-md border border-rose-300 bg-white px-2.5 text-[11.5px] font-medium text-rose-700 hover:bg-rose-100 disabled:opacity-50 dark:border-rose-500/40 dark:bg-transparent dark:text-rose-300 dark:hover:bg-rose-500/10",
300
314
  children: U ? "Restoring…" : "Restore"
@@ -303,20 +317,20 @@ function Be({
303
317
  ]
304
318
  }
305
319
  ),
306
- (o == null ? void 0 : o.kind) === "access" && !w && /* @__PURE__ */ i(_e, { onBack: () => window.history.back() }),
307
- G && /* @__PURE__ */ c(
320
+ (o == null ? void 0 : o.kind) === "access" && !p && /* @__PURE__ */ i(Ae, { onBack: () => window.history.back() }),
321
+ W && /* @__PURE__ */ d(
308
322
  "div",
309
323
  {
310
324
  "data-record-other-tab": !0,
311
325
  className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
312
326
  children: [
313
- /* @__PURE__ */ i(ue, { className: "h-4 w-4 shrink-0 text-amber-500" }),
327
+ /* @__PURE__ */ i(le, { className: "h-4 w-4 shrink-0 text-amber-500" }),
314
328
  /* @__PURE__ */ i("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: "This record is open with unsaved changes in another tab — editing it here too may overwrite them." }),
315
329
  /* @__PURE__ */ i(
316
330
  "button",
317
331
  {
318
332
  type: "button",
319
- onClick: D.focusOther,
333
+ onClick: E.focusOther,
320
334
  className: "h-7 shrink-0 rounded-md border border-amber-300 bg-white px-2.5 text-[11.5px] font-medium text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-300 dark:hover:bg-amber-500/10",
321
335
  children: "Switch to that tab"
322
336
  }
@@ -325,7 +339,7 @@ function Be({
325
339
  "button",
326
340
  {
327
341
  type: "button",
328
- onClick: () => z(!0),
342
+ onClick: () => J(!0),
329
343
  className: "h-7 shrink-0 rounded-md px-2 text-[11.5px] text-amber-700 hover:bg-amber-100 dark:text-amber-300 dark:hover:bg-amber-500/10",
330
344
  children: "Dismiss"
331
345
  }
@@ -333,51 +347,51 @@ function Be({
333
347
  ]
334
348
  }
335
349
  ),
336
- F && !o && /* @__PURE__ */ c(
350
+ F && !o && /* @__PURE__ */ d(
337
351
  "div",
338
352
  {
339
353
  "data-record-importing": !0,
340
354
  role: "status",
341
355
  className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
342
356
  children: [
343
- /* @__PURE__ */ i(me, { className: "h-4 w-4 shrink-0 animate-pulse text-amber-500" }),
344
- /* @__PURE__ */ c("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
357
+ /* @__PURE__ */ i(be, { className: "h-4 w-4 shrink-0 animate-pulse text-amber-500" }),
358
+ /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
345
359
  /* @__PURE__ */ i("span", { className: "font-semibold", children: "An import is updating this record" }),
346
360
  " — the changed fields refresh here as it goes.",
347
- x ? " Your unsaved edits may be out of date; check them before saving." : ""
361
+ l ? " Your unsaved edits may be out of date; check them before saving." : ""
348
362
  ] })
349
363
  ]
350
364
  }
351
365
  ),
352
- C.length > 0 && !o && /* @__PURE__ */ c(
366
+ O.length > 0 && !o && /* @__PURE__ */ d(
353
367
  "div",
354
368
  {
355
369
  "data-record-automation": !0,
356
370
  role: "status",
357
371
  className: "flex items-center gap-3 rounded-lg border border-nvr-cyan/40 bg-nvr-cyan/10 px-3.5 py-2.5",
358
372
  children: [
359
- /* @__PURE__ */ i(le, { className: "h-4 w-4 shrink-0 animate-pulse text-nvr-cyan" }),
360
- /* @__PURE__ */ c("p", { className: "min-w-0 flex-1 text-[12px] text-[#0e7490] dark:text-[#67e8f9]", children: [
373
+ /* @__PURE__ */ i(fe, { className: "h-4 w-4 shrink-0 animate-pulse text-nvr-cyan" }),
374
+ /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-[12px] text-[#0e7490] dark:text-[#67e8f9]", children: [
361
375
  /* @__PURE__ */ i("span", { className: "font-semibold", children: "Automation is updating this record" }),
362
376
  " —",
363
377
  " ",
364
- C.join(", "),
378
+ O.join(", "),
365
379
  ". Its changes appear here when it finishes."
366
380
  ] })
367
381
  ]
368
382
  }
369
383
  ),
370
- m && ($ || L.length > 0) && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
371
- $ && /* @__PURE__ */ c("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-0.5 text-[11px] font-medium text-[#0e7490] dark:text-[#67e8f9]", children: [
384
+ m && (D || A.length > 0) && /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
385
+ D && /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-0.5 text-[11px] font-medium text-[#0e7490] dark:text-[#67e8f9]", children: [
372
386
  /* @__PURE__ */ i("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
373
387
  "Updated just now by someone else"
374
388
  ] }),
375
- L.map((s) => /* @__PURE__ */ c(
389
+ A.map((s) => /* @__PURE__ */ d(
376
390
  "span",
377
391
  {
378
392
  className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-white px-2.5 py-0.5 text-[11px] text-slate-600 dark:border-border dark:bg-card dark:text-slate-300",
379
393
  children: [
380
- /* @__PURE__ */ i(be, { className: "h-3 w-3 animate-pulse text-nvr-cyan" }),
394
+ /* @__PURE__ */ i(pe, { className: "h-3 w-3 animate-pulse text-nvr-cyan" }),
381
395
  s.user,
382
396
  " is uploading “",
383
397
  s.name.length > 32 ? `${s.name.slice(0, 32)}…` : s.name,
@@ -390,8 +404,9 @@ function Be({
390
404
  ] });
391
405
  }
392
406
  export {
393
- Se as RECORD_QUERY_HEADS,
394
- _e as RecordAccessLostPanel,
395
- Be as RecordLiveSync,
396
- Re as purgeRecordQueries
407
+ Ee as RECORD_QUERY_HEADS,
408
+ Ae as RecordAccessLostPanel,
409
+ He as RecordLiveSync,
410
+ _e as moveNotice,
411
+ De as purgeRecordQueries
397
412
  };