@nivaro/react 0.3.57 → 0.3.59

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 (69) hide show
  1. package/dist/components/fields/RelationField.js +110 -80
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useRelationOptions.js +1 -0
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +37 -2
  6. package/dist/index.js +523 -520
  7. package/dist/shared/components/CollectionBrowserView.js +2693 -2619
  8. package/dist/shared/components/DataTable.js +538 -495
  9. package/dist/shared/components/ItemEditForm.js +4559 -4386
  10. package/dist/shared/components/PageRenderer.js +537 -508
  11. package/dist/shared/components/ProfileView.js +716 -715
  12. package/dist/shared/components/QueryTable.js +74 -74
  13. package/dist/shared/components/RecordReadView.js +367 -364
  14. package/dist/shared/components/ReportView.js +64 -39
  15. package/dist/shared/components/WidgetSlot.js +543 -520
  16. package/dist/shared/components/alerts/AlertManagerView.js +324 -317
  17. package/dist/shared/components/alerts/types.js +37 -14
  18. package/dist/shared/components/cbv/row-focus.js +19 -0
  19. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  20. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  21. package/dist/shared/components/integrations/console/tone.js +52 -30
  22. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  23. package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
  24. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  25. package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
  26. package/dist/shared/components/item-edit/InlineTableField.js +2487 -2442
  27. package/dist/shared/components/item-edit/M2MCombobox.js +321 -295
  28. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  29. package/dist/shared/components/item-edit/PlanGrid.js +973 -894
  30. package/dist/shared/components/item-edit/QuickCreateButton.js +335 -106
  31. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  32. package/dist/shared/components/item-edit/RelationCombobox.js +452 -335
  33. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +262 -141
  34. package/dist/shared/components/item-edit/SummaryPanel.js +385 -358
  35. package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
  36. package/dist/shared/components/item-edit/line-midair.js +82 -75
  37. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  38. package/dist/shared/components/item-edit/related-missing.js +45 -0
  39. package/dist/shared/components/item-edit/save-outcome.js +9 -7
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  41. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  42. package/dist/shared/components/panels/ItemLockBanner.js +213 -211
  43. package/dist/shared/components/panels/PipelinePanel.js +1140 -1053
  44. package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
  45. package/dist/shared/components/panels/RevisionsPanel.js +316 -299
  46. package/dist/shared/components/panels/TaskPanel.js +265 -249
  47. package/dist/shared/components/panels/landing-state.js +27 -0
  48. package/dist/shared/components/pipeline/PipelineEditorView.js +110 -92
  49. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  50. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  51. package/dist/shared/components/queue/QueueQuickFilters.js +52 -52
  52. package/dist/shared/components/queue/QueueWorklist.js +1050 -1026
  53. package/dist/shared/components/queue/group-sums.js +27 -0
  54. package/dist/shared/components/queue/live-state-aspect.js +9 -5
  55. package/dist/shared/components/widgets/ReviewListWidget.js +175 -154
  56. package/dist/shared/lib/back-closes.js +25 -0
  57. package/dist/shared/lib/display-prefs.js +60 -52
  58. package/dist/shared/lib/draft-store.js +71 -48
  59. package/dist/shared/lib/expression.js +53 -53
  60. package/dist/shared/lib/form-usage-beacon.js +7 -7
  61. package/dist/shared/lib/list-page-memory.js +63 -0
  62. package/dist/shared/lib/live.js +44 -44
  63. package/dist/shared/lib/money-input.js +45 -0
  64. package/dist/shared/lib/own-writes.js +76 -28
  65. package/dist/shared/lib/request-gate.js +110 -109
  66. package/dist/shared/lib/sanitize-html.js +10 -6
  67. package/dist/shared/lib/staged-row-labels.js +18 -0
  68. package/dist/shared/lib/validation-rules.js +34 -19
  69. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
- import { jsxs as x, jsx as v } from "react/jsx-runtime";
2
- import { QueryClientContext as Pe } from "@tanstack/react-query";
3
- import { Lock as ue, LockOpen as ve } from "lucide-react";
4
- import { useState as S, useEffect as w, useRef as T, useCallback as E, useContext as je } from "react";
1
+ import { jsxs as _, jsx as v } from "react/jsx-runtime";
2
+ import { QueryClientContext as je } from "@tanstack/react-query";
3
+ import { Lock as ue, LockOpen as ye } from "lucide-react";
4
+ import { useState as S, useEffect as x, useRef as C, useCallback as E, useContext as Be } from "react";
5
5
  import { toast as d } from "sonner";
6
- import { useNivaroClient as Be, useItemEditAuth as Qe } from "../../context.js";
7
- import { post as I, get as Ue, del as W } from "../../lib/commands.js";
8
- import { idleState as Ve } from "../../lib/idle.js";
9
- import { useOptionalRealtime as ye, updateTouches as We } from "../../lib/realtime.js";
10
- import { announceRecordTabs as Z, useRecordTabsSignal as He } from "../../lib/record-tabs.js";
6
+ import { useNivaroClient as Qe, useItemEditAuth as Ue } from "../../context.js";
7
+ import { post as D, get as Ve, del as H } from "../../lib/commands.js";
8
+ import { idleState as We } from "../../lib/idle.js";
9
+ import { useOptionalRealtime as ge, updateTouches as He } from "../../lib/realtime.js";
10
+ import { announceRecordTabs as Z, useRecordTabsSignal as Je } from "../../lib/record-tabs.js";
11
11
  import { noteTakeOverHold as ie } from "../item-edit/FieldAffordances.js";
12
- import { Button as O } from "../ui/button.js";
13
- import { Popover as ge, PopoverTrigger as we, PopoverContent as xe } from "../ui/popover.js";
14
- const ee = 1e4, _e = 1500, Je = 2e3, Ge = 5 * 6e4, Xe = 3e4, Ze = 6e4, et = 15e3, pe = 1500, tt = 6e4;
15
- function Le(e, t) {
12
+ import { Button as M } from "../ui/button.js";
13
+ import { Popover as we, PopoverTrigger as xe, PopoverContent as _e } from "../ui/popover.js";
14
+ const ee = 1e4, pe = 1500, Ge = 2e3, Xe = 5 * 6e4, Ze = 3e4, et = 6e4, tt = 15e3, Le = 1500, rt = 1e4;
15
+ function Ee(e, t) {
16
16
  return e ? `${t ?? "Someone else"} took over editing — your changes are still here, but can’t be saved until they release it` : "Someone else started editing while you were away — your changes are still here, but can’t be saved until they release it";
17
17
  }
18
- function rt() {
18
+ function nt() {
19
19
  const [e, t] = S(!0);
20
- return w(() => {
20
+ return x(() => {
21
21
  if (typeof window > "u" || typeof document > "u") return;
22
- let s = null, N = null, k = 0;
22
+ let s = null, R = null, k = 0;
23
23
  const q = () => typeof document.hasFocus == "function" ? document.hasFocus() : !0, g = () => {
24
- N && clearInterval(N), N = null;
25
- }, $ = (y) => y instanceof HTMLInputElement && y.type === "file", _ = (y) => {
26
- $(y.target) && (k = Date.now() + Ge);
24
+ R && clearInterval(R), R = null;
25
+ }, $ = (y) => y instanceof HTMLInputElement && y.type === "file", p = (y) => {
26
+ $(y.target) && (k = Date.now() + Xe);
27
27
  }, o = (y) => {
28
- !$(y.target) || !k || (k = 0, q() || C());
29
- }, C = () => {
28
+ !$(y.target) || !k || (k = 0, q() || T());
29
+ }, T = () => {
30
30
  s && clearTimeout(s);
31
31
  const y = k - Date.now();
32
32
  s = setTimeout(
@@ -35,36 +35,36 @@ function rt() {
35
35
  g(), t(!1);
36
36
  return;
37
37
  }
38
- g(), N = setInterval(() => {
38
+ g(), R = setInterval(() => {
39
39
  q() || (g(), t(!1));
40
- }, Je);
40
+ }, Ge);
41
41
  },
42
- y > 0 ? Math.max(y, _e) : _e
42
+ y > 0 ? Math.max(y, pe) : pe
43
43
  );
44
44
  }, c = () => {
45
45
  s && clearTimeout(s), s = null, k = 0, g(), t(!0);
46
46
  };
47
- return window.addEventListener("blur", C), window.addEventListener("focus", c), document.addEventListener("click", _, !0), document.addEventListener("change", o, !0), document.addEventListener("cancel", o, !0), () => {
48
- window.removeEventListener("blur", C), window.removeEventListener("focus", c), document.removeEventListener("click", _, !0), document.removeEventListener("change", o, !0), document.removeEventListener("cancel", o, !0), s && clearTimeout(s), g();
47
+ return window.addEventListener("blur", T), window.addEventListener("focus", c), document.addEventListener("click", p, !0), document.addEventListener("change", o, !0), document.addEventListener("cancel", o, !0), () => {
48
+ window.removeEventListener("blur", T), window.removeEventListener("focus", c), document.removeEventListener("click", p, !0), document.removeEventListener("change", o, !0), document.removeEventListener("cancel", o, !0), s && clearTimeout(s), g();
49
49
  };
50
50
  }, []), e;
51
51
  }
52
- function nt() {
52
+ function at() {
53
53
  const [e, t] = S(
54
54
  () => typeof document > "u" || document.visibilityState !== "hidden"
55
55
  );
56
- return w(() => {
56
+ return x(() => {
57
57
  const s = () => t(document.visibilityState !== "hidden");
58
58
  return document.addEventListener("visibilitychange", s), () => document.removeEventListener("visibilitychange", s);
59
59
  }, []), e;
60
60
  }
61
- function vt(e, t, s, N = {}) {
62
- const { lazy: k = !1, active: q = !0, dirty: g } = N, $ = T(g);
61
+ function yt(e, t, s, R = {}) {
62
+ const { lazy: k = !1, active: q = !0, dirty: g } = R, $ = C(g);
63
63
  $.current = g;
64
- const _ = E(() => k && $.current === !1, [k]), o = Be(), { isAdmin: C, userId: c } = Qe(), y = je(Pe), [D, R] = S(null), [Y, L] = S(!1), [j, le] = S(!1), [Ee, $e] = S([]), [Se, B] = S(null), [Ne, ce] = S(!1), [Re, de] = S(""), [Ce, te] = S(!1), [Te, fe] = S(!1), H = T(null), i = T(!1), A = T(!1), re = T(!1), ne = T(0), M = T(!1), Q = T(null), U = T(null), V = T(null), J = T(!1), F = `${e ?? ""}:${t ?? ""}`, z = E(() => {
65
- V.current = null, J.current = !1, ie(F, !1);
66
- }, [F]), f = E(() => {
67
- H.current && (clearInterval(H.current), H.current = null);
64
+ const p = E(() => k && $.current === !1, [k]), o = Qe(), { isAdmin: T, userId: c } = Ue(), y = Be(je), [Y, N] = S(null), [z, L] = S(!1), [B, le] = S(!1), [$e, Se] = S([]), [Re, Q] = S(null), [Ne, ce] = S(!1), [Ce, de] = S(""), [Te, te] = S(!1), [qe, fe] = S(!1), J = C(null), i = C(!1), A = C(!1), re = C(!1), ne = C(0), F = C(!1), U = C(null), V = C(null), W = C(null), G = C(!1), K = `${e ?? ""}:${t ?? ""}`, P = E(() => {
65
+ W.current = null, G.current = !1, ie(K, !1);
66
+ }, [K]), f = E(() => {
67
+ J.current && (clearInterval(J.current), J.current = null);
68
68
  }, []), ae = E(
69
69
  (a) => {
70
70
  var r, u;
@@ -74,18 +74,18 @@ function vt(e, t, s, N = {}) {
74
74
  [y, e, t, f]
75
75
  ), h = E(async () => {
76
76
  var a, n;
77
- if (!e || !t || M.current) return !1;
78
- Q.current = null, U.current = null;
77
+ if (!e || !t || F.current) return !1;
78
+ U.current = null, V.current = null;
79
79
  try {
80
80
  return await o.request(
81
- I(`/item-locks/${e}/${t}/lock`, { beat_ms: ee })
82
- ), i.current = !0, L(!0), te(!1), R(null), f(), H.current = setInterval(() => {
81
+ D(`/item-locks/${e}/${t}/lock`, { beat_ms: ee })
82
+ ), i.current = !0, L(!0), te(!1), N(null), f(), J.current = setInterval(() => {
83
83
  const m = Math.max(
84
84
  0,
85
- Math.floor((Date.now() - new Date(Ve().last_active).getTime()) / 1e3)
85
+ Math.floor((Date.now() - new Date(We().last_active).getTime()) / 1e3)
86
86
  );
87
87
  o.request(
88
- I(`/item-locks/${e}/${t}/heartbeat`, {
88
+ D(`/item-locks/${e}/${t}/heartbeat`, {
89
89
  idle_seconds: m,
90
90
  beat_ms: ee
91
91
  })
@@ -95,58 +95,58 @@ function vt(e, t, s, N = {}) {
95
95
  "Your edit lock was released after inactivity — it re-locks when you resume."
96
96
  );
97
97
  const r = () => {
98
- window.removeEventListener("pointerdown", r, !0), window.removeEventListener("keydown", r, !0), !_() && h();
98
+ window.removeEventListener("pointerdown", r, !0), window.removeEventListener("keydown", r, !0), !p() && h();
99
99
  };
100
100
  window.addEventListener("pointerdown", r, !0), window.addEventListener("keydown", r, !0);
101
101
  }).catch((l) => {
102
- var ke, he;
103
- const r = l, u = r.status ?? ((ke = r.response) == null ? void 0 : ke.status);
102
+ var he, be;
103
+ const r = l, u = r.status ?? ((he = r.response) == null ? void 0 : he.status);
104
104
  if (ae(l) || u !== 404 && u !== 409) return;
105
- const b = ((he = r.response) == null ? void 0 : he.data) ?? r.response;
105
+ const b = ((be = r.response) == null ? void 0 : be.data) ?? r.response;
106
106
  if (u === 404 && !(b != null && b.locked_by) && (b == null ? void 0 : b.taken_over) === !0) {
107
107
  f(), i.current = !1, L(!1);
108
- const be = b.taken_over_by_name ?? null;
109
- U.current = be ?? "Someone else", d.warning(
110
- `${be ?? "Someone else"} took over editing — your changes are still here; they save once you edit again`
108
+ const ve = b.taken_over_by_name ?? null;
109
+ V.current = ve ?? "Someone else", d.warning(
110
+ `${ve ?? "Someone else"} took over editing — your changes are still here; they save once you edit again`
111
111
  );
112
112
  return;
113
113
  }
114
114
  if (u === 404 && !(b != null && b.locked_by)) {
115
- if (_()) {
115
+ if (p()) {
116
116
  f(), i.current = !1, L(!1);
117
117
  return;
118
118
  }
119
119
  h();
120
120
  return;
121
121
  }
122
- f(), i.current = !1, L(!1), b != null && b.locked_by && (R({
122
+ f(), i.current = !1, L(!1), b != null && b.locked_by && (N({
123
123
  locked_by: b.locked_by,
124
124
  locked_by_name: b.locked_by_name ?? null
125
125
  }), d.warning(
126
- b.taken_over === !1 ? Le(!1) : `${b.locked_by_name ?? "Another user"} took over editing — your changes are no longer being saved`
126
+ b.taken_over === !1 ? Ee(!1) : `${b.locked_by_name ?? "Another user"} took over editing — your changes are no longer being saved`
127
127
  ));
128
128
  });
129
129
  }, ee), !0;
130
130
  } catch (m) {
131
131
  const l = m, r = l.status ?? ((a = l.response) == null ? void 0 : a.status), u = ((n = l.response) == null ? void 0 : n.data) ?? l.response;
132
- return Q.current = r ?? null, U.current = (u == null ? void 0 : u.taken_over) === !0 ? u.locked_by_name ?? "Someone else" : null, ae(m) ? !1 : r === 404 ? (M.current = !0, f(), i.current = !1, L(!1), !1) : (r === 409 && (u != null && u.locked_by) && (i.current = !1, L(!1), R({
132
+ return U.current = r ?? null, V.current = (u == null ? void 0 : u.taken_over) === !0 ? u.locked_by_name ?? "Someone else" : null, ae(m) ? !1 : r === 404 ? (F.current = !0, f(), i.current = !1, L(!1), !1) : (r === 409 && (u != null && u.locked_by) && (i.current = !1, L(!1), N({
133
133
  locked_by: u.locked_by,
134
134
  locked_by_name: u.locked_by_name ?? null,
135
135
  ...typeof u.may_take_over == "boolean" ? { may_take_over: u.may_take_over } : {}
136
136
  })), !1);
137
137
  }
138
- }, [o, e, t, f, ae, _]), p = E(async () => {
138
+ }, [o, e, t, f, ae, p]), w = E(async () => {
139
139
  if (!(!e || !t))
140
140
  try {
141
- const a = await o.request(Ue(`/item-locks/${e}/${t}/lock`)), n = a == null ? void 0 : a.data;
142
- $e(Array.isArray(n == null ? void 0 : n.queue) ? n.queue : []), B(typeof (n == null ? void 0 : n.my_position) == "number" ? n.my_position : null);
141
+ const a = await o.request(Ve(`/item-locks/${e}/${t}/lock`)), n = a == null ? void 0 : a.data;
142
+ Se(Array.isArray(n == null ? void 0 : n.queue) ? n.queue : []), Q(typeof (n == null ? void 0 : n.my_position) == "number" ? n.my_position : null);
143
143
  const m = (n == null ? void 0 : n.is_mine) === !0 || !!c && String((n == null ? void 0 : n.locked_by) ?? "").toLowerCase() === c.toLowerCase(), l = typeof (n == null ? void 0 : n.may_take_over) == "boolean" ? { may_take_over: n.may_take_over } : {};
144
144
  if (i.current) return;
145
145
  if (!(n != null && n.locked_by) || m) {
146
- R(null);
146
+ N(null);
147
147
  return;
148
148
  }
149
- R(
149
+ N(
150
150
  (r) => r && r.locked_by === String(n.locked_by) ? {
151
151
  ...r,
152
152
  note: n.note ?? r.note ?? null,
@@ -161,40 +161,40 @@ function vt(e, t, s, N = {}) {
161
161
  }
162
162
  ), te(!1);
163
163
  } catch (a) {
164
- (a == null ? void 0 : a.status) === 404 && (M.current = !0);
164
+ (a == null ? void 0 : a.status) === 404 && (F.current = !0);
165
165
  }
166
- }, [o, e, t, c]), K = (D == null ? void 0 : D.locked_by) ?? null;
167
- w(() => {
168
- K && p();
169
- }, [K, p]), w(() => {
170
- if (!K) return;
171
- const a = setInterval(() => void p(), Xe);
166
+ }, [o, e, t, c]), I = (Y == null ? void 0 : Y.locked_by) ?? null;
167
+ x(() => {
168
+ I && w();
169
+ }, [I, w]), x(() => {
170
+ if (!I) return;
171
+ const a = setInterval(() => void w(), Ze);
172
172
  return () => clearInterval(a);
173
- }, [K, p]), w(() => {
173
+ }, [I, w]), x(() => {
174
174
  if (!(!s || !e || !t))
175
- return A.current = !1, M.current = !1, k ? p() : h(), () => {
176
- f(), A.current = !1, i.current && (i.current = !1, o.request(W(`/item-locks/${e}/${t}/lock`)).then(() => Z(c, "lock-released", e, t)).catch(() => {
175
+ return A.current = !1, F.current = !1, k ? w() : h(), () => {
176
+ f(), A.current = !1, i.current && (i.current = !1, o.request(H(`/item-locks/${e}/${t}/lock`)).then(() => Z(c, "lock-released", e, t)).catch(() => {
177
177
  }));
178
178
  };
179
- }, [s, e, t, h, o, f, c, k, p]);
180
- const qe = E(async () => {
179
+ }, [s, e, t, h, o, f, c, k, w]);
180
+ const Ae = E(async () => {
181
181
  if (!(!s || i.current || re.current) && !(Date.now() < ne.current)) {
182
182
  re.current = !0;
183
183
  try {
184
184
  const a = await h();
185
- !a && Q.current === 409 && d.warning("Someone else is editing this record — your change can’t be saved yet"), !a && Q.current !== 409 && !M.current && (ne.current = Date.now() + et);
185
+ !a && U.current === 409 && d.warning("Someone else is editing this record — your change can’t be saved yet"), !a && U.current !== 409 && !F.current && (ne.current = Date.now() + tt);
186
186
  } finally {
187
187
  re.current = !1;
188
188
  }
189
189
  }
190
190
  }, [s, h]);
191
- w(() => {
191
+ x(() => {
192
192
  const a = () => {
193
193
  ne.current = 0;
194
194
  };
195
195
  return window.addEventListener("online", a), () => window.removeEventListener("online", a);
196
196
  }, []);
197
- const G = E(() => {
197
+ const X = E(() => {
198
198
  var a;
199
199
  if (!(!e || !t))
200
200
  try {
@@ -211,24 +211,27 @@ function vt(e, t, s, N = {}) {
211
211
  });
212
212
  } catch {
213
213
  }
214
- }, [o, e, t, c]), se = nt(), Ae = rt(), X = q && se && Ae;
215
- w(() => {
214
+ }, [o, e, t, c]), se = at(), Ie = nt(), O = q && se && Ie, me = C(O);
215
+ x(() => {
216
+ const a = me.current;
217
+ me.current = O, !(!s || !e || !t || a || !O) && (i.current || !I || w());
218
+ }, [s, O, e, t, I, w]), x(() => {
216
219
  if (!(!s || !e || !t)) {
217
- if (X) {
220
+ if (O) {
218
221
  if (A.current) {
219
- if (A.current = !1, _()) return;
222
+ if (A.current = !1, p()) return;
220
223
  h().then((a) => {
221
- !a && Q.current === 409 && d.warning(Le(U.current != null, U.current));
224
+ !a && U.current === 409 && d.warning(Ee(V.current != null, V.current));
222
225
  });
223
226
  }
224
227
  return;
225
228
  }
226
- i.current && (f(), i.current = !1, L(!1), A.current = !0, se ? o.request(W(`/item-locks/${e}/${t}/lock`)).then(() => Z(c, "lock-released", e, t)).catch(() => {
227
- }) : G());
229
+ i.current && (f(), i.current = !1, L(!1), A.current = !0, se ? o.request(H(`/item-locks/${e}/${t}/lock`)).then(() => Z(c, "lock-released", e, t)).catch(() => {
230
+ }) : X());
228
231
  }
229
232
  }, [
230
233
  s,
231
- X,
234
+ O,
232
235
  se,
233
236
  e,
234
237
  t,
@@ -236,28 +239,28 @@ function vt(e, t, s, N = {}) {
236
239
  o,
237
240
  f,
238
241
  c,
239
- G,
240
- _
241
- ]), w(() => {
242
- if (!s || !k || !e || !t || K || !X) return;
242
+ X,
243
+ p
244
+ ]), x(() => {
245
+ if (!s || !k || !e || !t || I || !O) return;
243
246
  const a = setInterval(() => {
244
- !i.current && !M.current && p();
245
- }, Ze);
247
+ !i.current && !F.current && w();
248
+ }, et);
246
249
  return () => clearInterval(a);
247
- }, [s, k, e, t, K, X, p]), w(() => {
250
+ }, [s, k, e, t, I, O, w]), x(() => {
248
251
  if (!s || !e || !t) return;
249
252
  const a = () => {
250
- i.current && (f(), i.current = !1, A.current = !0, G());
253
+ i.current && (f(), i.current = !1, A.current = !0, X());
251
254
  }, n = (m) => {
252
- m.persisted && A.current && (A.current = !1, _() || h());
255
+ m.persisted && A.current && (A.current = !1, p() || h());
253
256
  };
254
257
  return window.addEventListener("pagehide", a), window.addEventListener("pageshow", n), () => {
255
258
  window.removeEventListener("pagehide", a), window.removeEventListener("pageshow", n);
256
259
  };
257
- }, [s, e, t, f, h, G, _]), w(() => {
260
+ }, [s, e, t, f, h, X, p]), x(() => {
258
261
  if (!s || !k || !e || !t || g !== !1 || !i.current) return;
259
- const a = V.current, n = a != null && !J.current ? Math.max(pe, a + tt - Date.now()) : pe, m = setTimeout(() => {
260
- $.current !== !1 || !i.current || (f(), i.current = !1, L(!1), z(), o.request(W(`/item-locks/${e}/${t}/lock`)).then(() => Z(c, "lock-released", e, t)).catch(() => {
262
+ const a = W.current, n = a != null && !G.current ? Math.max(Le, a + rt - Date.now()) : Le, m = setTimeout(() => {
263
+ $.current !== !1 || !i.current || (f(), i.current = !1, L(!1), P(), o.request(H(`/item-locks/${e}/${t}/lock`)).then(() => Z(c, "lock-released", e, t)).catch(() => {
261
264
  }));
262
265
  }, n);
263
266
  return () => clearTimeout(m);
@@ -267,41 +270,41 @@ function vt(e, t, s, N = {}) {
267
270
  e,
268
271
  t,
269
272
  g,
270
- Y,
273
+ z,
271
274
  o,
272
275
  f,
273
276
  c,
274
- z
275
- ]), w(() => {
276
- g === !0 && V.current != null && (J.current = !0);
277
- }, [g]), w(() => {
278
- !Y && V.current != null && z();
279
- }, [Y, z]), w(() => () => ie(F, !1), [F]), He(c, "lock-released", e, t, () => {
277
+ P
278
+ ]), x(() => {
279
+ g === !0 && W.current != null && (G.current = !0);
280
+ }, [g]), x(() => {
281
+ !z && W.current != null && P();
282
+ }, [z, P]), x(() => () => ie(K, !1), [K]), Je(c, "lock-released", e, t, () => {
280
283
  s && i.current && h();
281
284
  });
282
- const oe = ye();
283
- w(() => {
285
+ const oe = ge();
286
+ x(() => {
284
287
  if (!(!s || !oe || !e || !t))
285
288
  return oe.subscribeCollections([e], (a) => {
286
289
  var n;
287
- i.current || M.current || !((n = a.changed_fields) != null && n.includes("$lock")) || !We(a, t) || p();
290
+ i.current || F.current || !((n = a.changed_fields) != null && n.includes("$lock")) || !He(a, t) || w();
288
291
  });
289
- }, [s, oe, e, t, p]);
290
- const P = ye(), [Ie, me] = S(!1), Oe = E(async () => {
292
+ }, [s, oe, e, t, w]);
293
+ const j = ge(), [Oe, ke] = S(!1), De = E(async () => {
291
294
  if (!(!e || !t)) {
292
- me(!0);
295
+ ke(!0);
293
296
  try {
294
- await o.request(I(`/item-locks/${e}/${t}/lock/request`, {})), d.success("Asked the current editor to release the lock");
297
+ await o.request(D(`/item-locks/${e}/${t}/lock/request`, {})), d.success("Asked the current editor to release the lock");
295
298
  } catch {
296
299
  d.error("Could not send the lock request");
297
300
  } finally {
298
- me(!1);
301
+ ke(!1);
299
302
  }
300
303
  }
301
304
  }, [o, e, t]);
302
- w(() => {
303
- if (!P || !e || !t) return;
304
- const a = P.on("lock:requested", (r) => {
305
+ x(() => {
306
+ if (!j || !e || !t) return;
307
+ const a = j.on("lock:requested", (r) => {
305
308
  if ((r == null ? void 0 : r.collection) !== e || String(r == null ? void 0 : r.item) !== String(t) || !i.current) return;
306
309
  const u = (r == null ? void 0 : r.from) ?? {};
307
310
  d(`${u.name ?? "Someone"} is asking you to release this record`, {
@@ -310,7 +313,7 @@ function vt(e, t, s, N = {}) {
310
313
  label: "Release",
311
314
  onClick: () => {
312
315
  f(), i.current = !1, L(!1), o.request(
313
- I(`/item-locks/${e}/${t}/lock/respond`, {
316
+ D(`/item-locks/${e}/${t}/lock/respond`, {
314
317
  to: u.id,
315
318
  action: "release"
316
319
  })
@@ -321,7 +324,7 @@ function vt(e, t, s, N = {}) {
321
324
  label: "Keep editing",
322
325
  onClick: () => {
323
326
  o.request(
324
- I(`/item-locks/${e}/${t}/lock/respond`, {
327
+ D(`/item-locks/${e}/${t}/lock/respond`, {
325
328
  to: u.id,
326
329
  action: "decline"
327
330
  })
@@ -330,127 +333,127 @@ function vt(e, t, s, N = {}) {
330
333
  }
331
334
  }
332
335
  });
333
- }), n = P.on("lock:response", (r) => {
336
+ }), n = j.on("lock:response", (r) => {
334
337
  var u, b;
335
338
  (r == null ? void 0 : r.collection) !== e || String(r == null ? void 0 : r.item) !== String(t) || i.current || ((r == null ? void 0 : r.action) === "release" ? (d.success(`${((u = r == null ? void 0 : r.from) == null ? void 0 : u.name) ?? "The editor"} released the lock — it's yours`), h()) : d.warning(
336
339
  `${((b = r == null ? void 0 : r.from) == null ? void 0 : b.name) ?? "The editor"} is keeping the lock${r != null && r.note ? `: "${r.note}"` : ""}`
337
340
  ));
338
- }), m = P.on("lock:available", (r) => {
339
- (r == null ? void 0 : r.collection) !== e || String(r == null ? void 0 : r.item) !== String(t) || i.current || (d.success("Your turn — the edit lock is yours"), B(null), h());
340
- }), l = P.on("lock:queued", (r) => {
341
- (r == null ? void 0 : r.collection) !== e || String(r == null ? void 0 : r.item) !== String(t) || (i.current && d(`${(r == null ? void 0 : r.user_name) ?? "Someone"} is waiting to edit this record`, { duration: 8e3 }), p());
341
+ }), m = j.on("lock:available", (r) => {
342
+ (r == null ? void 0 : r.collection) !== e || String(r == null ? void 0 : r.item) !== String(t) || i.current || (d.success("Your turn — the edit lock is yours"), Q(null), h());
343
+ }), l = j.on("lock:queued", (r) => {
344
+ (r == null ? void 0 : r.collection) !== e || String(r == null ? void 0 : r.item) !== String(t) || (i.current && d(`${(r == null ? void 0 : r.user_name) ?? "Someone"} is waiting to edit this record`, { duration: 8e3 }), w());
342
345
  });
343
346
  return () => {
344
347
  a(), n(), m(), l();
345
348
  };
346
- }, [P, e, t, o, h, f, p]);
347
- const De = E(async () => {
349
+ }, [j, e, t, o, h, f, w]);
350
+ const Me = E(async () => {
348
351
  if (!(!e || !t)) {
349
352
  ce(!0);
350
353
  try {
351
354
  const a = await o.request(
352
- I(`/item-locks/${e}/${t}/lock/queue`, {})
355
+ D(`/item-locks/${e}/${t}/lock/queue`, {})
353
356
  ), n = a == null ? void 0 : a.data;
354
357
  if (n != null && n.free) {
355
- B(null), R(null), d.success("Nobody is editing this record now — go ahead");
358
+ Q(null), N(null), d.success("Nobody is editing this record now — go ahead");
356
359
  return;
357
360
  }
358
361
  const m = n == null ? void 0 : n.position;
359
- B(typeof m == "number" ? m : 1), d.success("You are in line — the lock comes to you automatically when it frees up"), p();
362
+ Q(typeof m == "number" ? m : 1), d.success("You are in line — the lock comes to you automatically when it frees up"), w();
360
363
  } catch {
361
364
  d.error("Could not join the queue");
362
365
  } finally {
363
366
  ce(!1);
364
367
  }
365
368
  }
366
- }, [o, e, t, p]), Me = E(async () => {
369
+ }, [o, e, t, w]), Ye = E(async () => {
367
370
  if (!(!e || !t))
368
371
  try {
369
- await o.request(W(`/item-locks/${e}/${t}/lock/queue`)), B(null), p();
372
+ await o.request(H(`/item-locks/${e}/${t}/lock/queue`)), Q(null), w();
370
373
  } catch {
371
374
  }
372
- }, [o, e, t, p]), Ye = E(
375
+ }, [o, e, t, w]), Fe = E(
373
376
  async (a) => {
374
377
  if (!(!e || !t || !i.current)) {
375
378
  de(a);
376
379
  try {
377
- await o.request(I(`/item-locks/${e}/${t}/lock/note`, { note: a }));
380
+ await o.request(D(`/item-locks/${e}/${t}/lock/note`, { note: a }));
378
381
  } catch {
379
382
  }
380
383
  }
381
384
  },
382
385
  [o, e, t]
383
- ), Fe = E(async () => {
386
+ ), ze = E(async () => {
384
387
  if (!(!e || !t || !i.current)) {
385
388
  fe(!0), f(), i.current = !1, L(!1);
386
389
  try {
387
- await o.request(W(`/item-locks/${e}/${t}/lock`)), te(!0), de(""), d.success("Lock released — anyone can edit this record now");
390
+ await o.request(H(`/item-locks/${e}/${t}/lock`)), te(!0), de(""), d.success("Lock released — anyone can edit this record now");
388
391
  } catch {
389
392
  d.error("Failed to release the lock"), h();
390
393
  } finally {
391
394
  fe(!1);
392
395
  }
393
396
  }
394
- }, [o, e, t, f, h]), ze = E(async () => {
397
+ }, [o, e, t, f, h]), Ke = E(async () => {
395
398
  if (i.current) return !0;
396
399
  const a = await h();
397
400
  return a && d.success("You hold the edit lock again"), a;
398
- }, [h]), Ke = E(async () => {
401
+ }, [h]), Pe = E(async () => {
399
402
  var a;
400
403
  if (!(!e || !t)) {
401
404
  le(!0);
402
405
  try {
403
406
  await o.request(
404
- I(`/item-locks/${e}/${t}/lock/force`, { beat_ms: ee })
405
- ), d.success("You now hold the edit lock"), V.current = Date.now(), J.current = !1, ie(F, !0), await h() || z();
407
+ D(`/item-locks/${e}/${t}/lock/force`, { beat_ms: ee })
408
+ ), d.success("You now hold the edit lock"), W.current = Date.now(), G.current = !1, ie(K, !0), await h() || P();
406
409
  } catch (n) {
407
410
  const m = ((a = n == null ? void 0 : n.response) == null ? void 0 : a.error) ?? "Failed to take over the lock";
408
- d.error(m), (n == null ? void 0 : n.status) === 403 && R((l) => l && { ...l, may_take_over: !1 });
411
+ d.error(m), (n == null ? void 0 : n.status) === 403 && N((l) => l && { ...l, may_take_over: !1 });
409
412
  } finally {
410
413
  le(!1);
411
414
  }
412
415
  }
413
- }, [o, e, t, h, F, z]);
416
+ }, [o, e, t, h, K, P]);
414
417
  return {
415
- lockHolder: D,
416
- acquired: Y,
417
- isReadOnly: !!D,
418
- takeOver: Ke,
419
- takingOver: j,
420
- isAdmin: C,
421
- requestLock: Oe,
422
- requesting: Ie,
423
- queue: Ee,
424
- myPosition: Se,
425
- joinQueue: De,
426
- leaveQueue: Me,
418
+ lockHolder: Y,
419
+ acquired: z,
420
+ isReadOnly: !!Y,
421
+ takeOver: Pe,
422
+ takingOver: B,
423
+ isAdmin: T,
424
+ requestLock: De,
425
+ requesting: Oe,
426
+ queue: $e,
427
+ myPosition: Re,
428
+ joinQueue: Me,
429
+ leaveQueue: Ye,
427
430
  joining: Ne,
428
- myNote: Re,
429
- saveNote: Ye,
430
- release: Fe,
431
- releasing: Te,
432
- released: Ce,
433
- relock: ze,
434
- claim: qe
431
+ myNote: Ce,
432
+ saveNote: Fe,
433
+ release: ze,
434
+ releasing: qe,
435
+ released: Te,
436
+ relock: Ke,
437
+ claim: Ae
435
438
  };
436
439
  }
437
- function yt({
440
+ function gt({
438
441
  note: e,
439
442
  onSave: t,
440
443
  waiting: s,
441
- onRelease: N,
444
+ onRelease: R,
442
445
  releasing: k,
443
446
  released: q,
444
447
  onRelock: g
445
448
  }) {
446
- var C;
447
- const [$, _] = S(e);
448
- w(() => _(e), [e]);
449
+ var T;
450
+ const [$, p] = S(e);
451
+ x(() => p(e), [e]);
449
452
  const o = () => {
450
453
  $.trim() !== e && t($.trim());
451
454
  };
452
- return q ? /* @__PURE__ */ x(ge, { children: [
453
- /* @__PURE__ */ v(we, { asChild: !0, children: /* @__PURE__ */ v(
455
+ return q ? /* @__PURE__ */ _(we, { children: [
456
+ /* @__PURE__ */ v(xe, { asChild: !0, children: /* @__PURE__ */ v(
454
457
  "button",
455
458
  {
456
459
  type: "button",
@@ -458,14 +461,14 @@ function yt({
458
461
  title: "Lock released — anyone can edit this record",
459
462
  "data-lock-released": !0,
460
463
  className: "relative inline-flex h-8 w-8 items-center justify-center text-slate-400 transition-colors hover:bg-accent hover:text-accent-foreground dark:text-slate-500",
461
- children: /* @__PURE__ */ v(ve, { className: "h-4 w-4", strokeWidth: 2 })
464
+ children: /* @__PURE__ */ v(ye, { className: "h-4 w-4", strokeWidth: 2 })
462
465
  }
463
466
  ) }),
464
- /* @__PURE__ */ x(xe, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
467
+ /* @__PURE__ */ _(_e, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
465
468
  /* @__PURE__ */ v("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "You released the edit lock" }),
466
469
  /* @__PURE__ */ v("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: "Anyone can edit this record now. Your next edit locks it again — or lock it now." }),
467
- /* @__PURE__ */ x(
468
- O,
470
+ /* @__PURE__ */ _(
471
+ M,
469
472
  {
470
473
  type: "button",
471
474
  size: "sm",
@@ -479,8 +482,8 @@ function yt({
479
482
  }
480
483
  )
481
484
  ] })
482
- ] }) : /* @__PURE__ */ x(ge, { children: [
483
- /* @__PURE__ */ v(we, { asChild: !0, children: /* @__PURE__ */ x(
485
+ ] }) : /* @__PURE__ */ _(we, { children: [
486
+ /* @__PURE__ */ v(xe, { asChild: !0, children: /* @__PURE__ */ _(
484
487
  "button",
485
488
  {
486
489
  type: "button",
@@ -494,14 +497,14 @@ function yt({
494
497
  ]
495
498
  }
496
499
  ) }),
497
- /* @__PURE__ */ x(xe, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
500
+ /* @__PURE__ */ _(_e, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
498
501
  /* @__PURE__ */ v("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "You hold the edit lock" }),
499
502
  /* @__PURE__ */ v("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: "Others see this record read-only. A note tells them what you’re doing." }),
500
503
  /* @__PURE__ */ v(
501
504
  "input",
502
505
  {
503
506
  value: $,
504
- onChange: (c) => _(c.target.value.slice(0, 300)),
507
+ onChange: (c) => p(c.target.value.slice(0, 300)),
505
508
  onBlur: o,
506
509
  onKeyDown: (c) => {
507
510
  c.key === "Enter" && (c.preventDefault(), o());
@@ -511,65 +514,66 @@ function yt({
511
514
  className: "mt-2 h-7 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-card"
512
515
  }
513
516
  ),
514
- s.length > 0 && /* @__PURE__ */ x("div", { className: "mt-2 rounded-md bg-amber-50 px-2 py-1.5 text-[11px] text-amber-800 dark:bg-amber-500/10 dark:text-amber-200", children: [
515
- /* @__PURE__ */ x("span", { className: "font-semibold", children: [
517
+ s.length > 0 && /* @__PURE__ */ _("div", { className: "mt-2 rounded-md bg-amber-50 px-2 py-1.5 text-[11px] text-amber-800 dark:bg-amber-500/10 dark:text-amber-200", children: [
518
+ /* @__PURE__ */ _("span", { className: "font-semibold", children: [
516
519
  s.length,
517
520
  " waiting for the lock:"
518
521
  ] }),
519
522
  " ",
520
523
  s.map((c) => c.name ?? "someone").join(", ")
521
524
  ] }),
522
- N && /* @__PURE__ */ x(
523
- O,
525
+ R && /* @__PURE__ */ _(
526
+ M,
524
527
  {
525
528
  type: "button",
526
529
  variant: "outline",
527
530
  size: "sm",
528
531
  className: "mt-2 h-7 w-full text-[12px]",
529
- onClick: N,
532
+ onClick: R,
530
533
  disabled: k,
531
534
  "data-lock-release": !0,
532
535
  children: [
533
- /* @__PURE__ */ v(ve, { className: "mr-1.5 h-3.5 w-3.5" }),
534
- k ? "Releasing…" : s.length > 0 ? `Release lock to ${((C = s[0]) == null ? void 0 : C.name) ?? "the next person"}` : "Release lock"
536
+ /* @__PURE__ */ v(ye, { className: "mr-1.5 h-3.5 w-3.5" }),
537
+ k ? "Releasing…" : s.length > 0 ? `Release lock to ${((T = s[0]) == null ? void 0 : T.name) ?? "the next person"}` : "Release lock"
535
538
  ]
536
539
  }
537
540
  )
538
541
  ] })
539
542
  ] });
540
543
  }
541
- function gt({
544
+ function wt({
542
545
  lockHolder: e,
543
546
  onTakeOver: t,
544
547
  takingOver: s,
545
- isAdmin: N,
548
+ isAdmin: R,
546
549
  onRequestLock: k,
547
550
  requesting: q,
548
551
  queue: g,
549
552
  myPosition: $,
550
- onJoinQueue: _,
553
+ onJoinQueue: p,
551
554
  onLeaveQueue: o,
552
- joining: C,
555
+ joining: T,
553
556
  noun: c = "this item",
554
557
  readOnlyText: y = "fields are read-only"
555
558
  }) {
556
- const [D, R] = S(!1), Y = (e == null ? void 0 : e.locked_by) ?? null;
557
- if (w(() => R(!1), [Y]), !e) return null;
558
- const L = e.locked_by_name || "Another user", j = (g == null ? void 0 : g.length) ?? 0;
559
- return /* @__PURE__ */ x(
559
+ const [Y, N] = S(!1), z = (e == null ? void 0 : e.locked_by) ?? null;
560
+ if (x(() => N(!1), [z]), !e) return null;
561
+ const L = e.locked_by_name || "Another user", B = (g == null ? void 0 : g.length) ?? 0;
562
+ return /* @__PURE__ */ _(
560
563
  "div",
561
564
  {
562
565
  className: "mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100",
563
566
  "data-lock-banner": !0,
564
567
  children: [
565
568
  /* @__PURE__ */ v(ue, { className: "h-4 w-4 shrink-0 text-amber-500" }),
566
- /* @__PURE__ */ x("span", { className: "min-w-0 flex-1", children: [
569
+ /* @__PURE__ */ _("span", { className: "min-w-0 flex-1", children: [
567
570
  /* @__PURE__ */ v("span", { className: "font-medium", children: L }),
568
571
  " is editing ",
569
572
  c,
570
573
  " — ",
571
574
  y,
572
- e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */ x(
575
+ " until the lock is released.",
576
+ e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */ _(
573
577
  "span",
574
578
  {
575
579
  className: "ml-1.5 rounded bg-amber-100 px-1 py-px text-[10px] font-semibold text-amber-700 dark:bg-amber-500/20 dark:text-amber-200",
@@ -582,22 +586,20 @@ function gt({
582
586
  ]
583
587
  }
584
588
  ),
585
- " ",
586
- "until the lock is released.",
587
- e.note && /* @__PURE__ */ x("span", { className: "mt-0.5 block text-[12.5px] text-amber-800/90 dark:text-amber-200/90", children: [
589
+ e.note && /* @__PURE__ */ _("span", { className: "mt-0.5 block text-[12.5px] text-amber-800/90 dark:text-amber-200/90", children: [
588
590
  "“",
589
591
  e.note,
590
592
  "”"
591
593
  ] }),
592
- j > 0 && $ == null && /* @__PURE__ */ x("span", { className: "mt-0.5 block text-[11.5px] text-amber-700/80 dark:text-amber-300/80", children: [
593
- j,
594
+ B > 0 && $ == null && /* @__PURE__ */ _("span", { className: "mt-0.5 block text-[11.5px] text-amber-700/80 dark:text-amber-300/80", children: [
595
+ B,
594
596
  " ",
595
- j === 1 ? "person is" : "people are",
597
+ B === 1 ? "person is" : "people are",
596
598
  " already waiting."
597
599
  ] })
598
600
  ] }),
599
- _ && ($ != null ? /* @__PURE__ */ x(
600
- O,
601
+ p && ($ != null ? /* @__PURE__ */ _(
602
+ M,
601
603
  {
602
604
  size: "sm",
603
605
  variant: "outline",
@@ -611,19 +613,19 @@ function gt({
611
613
  ]
612
614
  }
613
615
  ) : /* @__PURE__ */ v(
614
- O,
616
+ M,
615
617
  {
616
618
  size: "sm",
617
619
  variant: "outline",
618
620
  className: "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15",
619
- onClick: _,
620
- disabled: C,
621
+ onClick: p,
622
+ disabled: T,
621
623
  "data-lock-queue-join": !0,
622
- children: C ? "Joining…" : "Ask to be next"
624
+ children: T ? "Joining…" : "Ask to be next"
623
625
  }
624
626
  )),
625
627
  k && /* @__PURE__ */ v(
626
- O,
628
+ M,
627
629
  {
628
630
  size: "sm",
629
631
  variant: "outline",
@@ -636,34 +638,34 @@ function gt({
636
638
  // Admins always; other roles only when the server says they may (the
637
639
  // takeover-role allowlist, #256) — unknown = offered, and a 403 then
638
640
  // hides it. A Take over that can only fail was a dead end.
639
- (N || e.may_take_over !== !1) && (D ? /* @__PURE__ */ x(
641
+ (R || e.may_take_over !== !1) && (Y ? /* @__PURE__ */ _(
640
642
  "span",
641
643
  {
642
644
  className: "flex basis-full flex-wrap items-center justify-end gap-2 text-[12px] text-amber-800 dark:text-amber-200",
643
645
  "data-lock-takeover-confirm": !0,
644
646
  children: [
645
- /* @__PURE__ */ x("span", { className: "min-w-0 flex-1 text-right", children: [
647
+ /* @__PURE__ */ _("span", { className: "min-w-0 flex-1 text-right", children: [
646
648
  L,
647
649
  " may have unsaved changes — they can’t save them once you take over."
648
650
  ] }),
649
651
  /* @__PURE__ */ v(
650
- O,
652
+ M,
651
653
  {
652
654
  size: "sm",
653
655
  variant: "outline",
654
656
  className: "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15",
655
- onClick: () => R(!1),
657
+ onClick: () => N(!1),
656
658
  disabled: s,
657
659
  children: "Cancel"
658
660
  }
659
661
  ),
660
662
  /* @__PURE__ */ v(
661
- O,
663
+ M,
662
664
  {
663
665
  size: "sm",
664
666
  className: "h-7 shrink-0 bg-amber-600 text-[12px] text-white hover:bg-amber-700",
665
667
  onClick: () => {
666
- R(!1), t();
668
+ N(!1), t();
667
669
  },
668
670
  disabled: s,
669
671
  "data-lock-takeover-go": !0,
@@ -673,12 +675,12 @@ function gt({
673
675
  ]
674
676
  }
675
677
  ) : /* @__PURE__ */ v(
676
- O,
678
+ M,
677
679
  {
678
680
  size: "sm",
679
681
  variant: "outline",
680
- className: N ? "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15" : "h-7 shrink-0 border-amber-200 bg-white/60 text-[12px] text-amber-700/80 hover:bg-amber-100 dark:border-amber-500/30 dark:bg-transparent dark:text-amber-200/80 dark:hover:bg-amber-500/15",
681
- onClick: () => R(!0),
682
+ className: R ? "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15" : "h-7 shrink-0 border-amber-200 bg-white/60 text-[12px] text-amber-700/80 hover:bg-amber-100 dark:border-amber-500/30 dark:bg-transparent dark:text-amber-200/80 dark:hover:bg-amber-500/15",
683
+ onClick: () => N(!0),
682
684
  disabled: s,
683
685
  children: s ? "Taking over…" : "Take over"
684
686
  }
@@ -688,9 +690,9 @@ function gt({
688
690
  );
689
691
  }
690
692
  export {
691
- gt as ItemLockBanner,
692
- yt as LockHolderButton,
693
- tt as TAKEOVER_HOLD_MS,
694
- Le as takenAwayText,
695
- vt as useItemLock
693
+ wt as ItemLockBanner,
694
+ gt as LockHolderButton,
695
+ rt as TAKEOVER_HOLD_MS,
696
+ Ee as takenAwayText,
697
+ yt as useItemLock
696
698
  };