@nivaro/react 0.3.27 → 0.3.28
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.
|
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
|
|
|
9
9
|
import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
|
|
10
10
|
import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
|
|
11
11
|
import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
|
|
12
|
-
const Ue = "nivaro-react@0.3.
|
|
12
|
+
const Ue = "nivaro-react@0.3.28", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
13
13
|
function Be(n) {
|
|
14
14
|
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
15
15
|
const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
|
@@ -1,274 +1,283 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as x, jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { QueryClientContext as Se } from "@tanstack/react-query";
|
|
3
3
|
import { Lock as Z, LockOpen as ie } from "lucide-react";
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
import { idleState as
|
|
9
|
-
import { useOptionalRealtime as
|
|
10
|
-
import { announceRecordTabs as X, useRecordTabsSignal as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { Popover as
|
|
13
|
-
const
|
|
4
|
+
import { useContext as qe, useState as L, useRef as A, useCallback as p, useEffect as N } from "react";
|
|
5
|
+
import { toast as l } from "sonner";
|
|
6
|
+
import { useNivaroClient as Ie, useItemEditAuth as Te } from "../../context.js";
|
|
7
|
+
import { post as I, get as Ae, del as K } from "../../lib/commands.js";
|
|
8
|
+
import { idleState as Oe } from "../../lib/idle.js";
|
|
9
|
+
import { useOptionalRealtime as ue, updateTouches as De } from "../../lib/realtime.js";
|
|
10
|
+
import { announceRecordTabs as X, useRecordTabsSignal as Me } from "../../lib/record-tabs.js";
|
|
11
|
+
import { Button as M } from "../ui/button.js";
|
|
12
|
+
import { Popover as le, PopoverTrigger as ce, PopoverContent as de } from "../ui/popover.js";
|
|
13
|
+
const Q = 1e4, fe = 1500, Ye = 2e3, Fe = 5 * 6e4, Pe = 3e4, Be = 6e4, je = 15e3;
|
|
14
14
|
function ze() {
|
|
15
|
-
const [e, r] =
|
|
15
|
+
const [e, r] = L(!0);
|
|
16
16
|
return N(() => {
|
|
17
17
|
if (typeof window > "u" || typeof document > "u") return;
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
let o = null, E = null, y = 0;
|
|
19
|
+
const S = () => typeof document.hasFocus == "function" ? document.hasFocus() : !0, a = () => {
|
|
20
|
+
E && clearInterval(E), E = null;
|
|
21
|
+
}, $ = (_) => _ instanceof HTMLInputElement && _.type === "file", f = (_) => {
|
|
22
|
+
$(_.target) && (y = Date.now() + Fe);
|
|
23
|
+
}, b = (_) => {
|
|
24
|
+
!$(_.target) || !y || (y = 0, S() || w());
|
|
25
|
+
}, w = () => {
|
|
26
|
+
o && clearTimeout(o);
|
|
27
|
+
const _ = y - Date.now();
|
|
28
|
+
o = setTimeout(
|
|
29
|
+
() => {
|
|
30
|
+
if (o = null, !S()) {
|
|
31
|
+
a(), r(!1);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
a(), E = setInterval(() => {
|
|
35
|
+
S() || (a(), r(!1));
|
|
36
|
+
}, Ye);
|
|
37
|
+
},
|
|
38
|
+
_ > 0 ? Math.max(_, fe) : fe
|
|
39
|
+
);
|
|
40
|
+
}, m = () => {
|
|
41
|
+
o && clearTimeout(o), o = null, y = 0, a(), r(!0);
|
|
33
42
|
};
|
|
34
|
-
return window.addEventListener("blur",
|
|
35
|
-
window.removeEventListener("blur",
|
|
43
|
+
return window.addEventListener("blur", w), window.addEventListener("focus", m), document.addEventListener("click", f, !0), document.addEventListener("change", b, !0), document.addEventListener("cancel", b, !0), () => {
|
|
44
|
+
window.removeEventListener("blur", w), window.removeEventListener("focus", m), document.removeEventListener("click", f, !0), document.removeEventListener("change", b, !0), document.removeEventListener("cancel", b, !0), o && clearTimeout(o), a();
|
|
36
45
|
};
|
|
37
46
|
}, []), e;
|
|
38
47
|
}
|
|
39
|
-
function
|
|
40
|
-
const [e, r] =
|
|
48
|
+
function Ke() {
|
|
49
|
+
const [e, r] = L(
|
|
41
50
|
() => typeof document > "u" || document.visibilityState !== "hidden"
|
|
42
51
|
);
|
|
43
52
|
return N(() => {
|
|
44
|
-
const
|
|
45
|
-
return document.addEventListener("visibilitychange",
|
|
53
|
+
const o = () => r(document.visibilityState !== "hidden");
|
|
54
|
+
return document.addEventListener("visibilitychange", o), () => document.removeEventListener("visibilitychange", o);
|
|
46
55
|
}, []), e;
|
|
47
56
|
}
|
|
48
|
-
function
|
|
49
|
-
const { lazy:
|
|
57
|
+
function nt(e, r, o, E = {}) {
|
|
58
|
+
const { lazy: y = !1, active: S = !0 } = E, a = Ie(), { isAdmin: $, userId: f } = Te(), b = qe(Se), [w, m] = L(null), [_, R] = L(!1), [Y, ee] = L(!1), [me, ke] = L([]), [he, F] = L(null), [be, te] = L(!1), [ve, re] = L(""), [ye, U] = L(!1), [ge, ne] = L(!1), B = A(null), i = A(!1), q = A(!1), H = A(!1), V = A(0), T = A(!1), P = A(null), v = p(() => {
|
|
50
59
|
B.current && (clearInterval(B.current), B.current = null);
|
|
51
|
-
}, []),
|
|
60
|
+
}, []), W = p(
|
|
52
61
|
(s) => {
|
|
53
62
|
var t, c;
|
|
54
|
-
const n = s,
|
|
55
|
-
return
|
|
63
|
+
const n = s, k = n.status ?? ((t = n.response) == null ? void 0 : t.status), u = ((c = n.response) == null ? void 0 : c.data) ?? n.response;
|
|
64
|
+
return k !== 403 || (u == null ? void 0 : u.code) !== "EDIT_LOCKED" ? !1 : (v(), i.current = !1, R(!1), l.warning(u.error || "You can no longer edit this record — your edit lock was let go"), b == null || b.invalidateQueries({ queryKey: ["pipeline-instance-lock", e, r] }), b == null || b.invalidateQueries({ queryKey: ["pipeline-instance", e, r] }), !0);
|
|
56
65
|
},
|
|
57
|
-
[
|
|
58
|
-
), d =
|
|
66
|
+
[b, e, r, v]
|
|
67
|
+
), d = p(async () => {
|
|
59
68
|
var s, n;
|
|
60
69
|
if (!e || !r || T.current) return !1;
|
|
61
|
-
|
|
70
|
+
P.current = null;
|
|
62
71
|
try {
|
|
63
|
-
return await
|
|
64
|
-
|
|
65
|
-
), i.current = !0,
|
|
66
|
-
const
|
|
72
|
+
return await a.request(
|
|
73
|
+
I(`/item-locks/${e}/${r}/lock`, { beat_ms: Q })
|
|
74
|
+
), i.current = !0, R(!0), U(!1), m(null), v(), B.current = setInterval(() => {
|
|
75
|
+
const k = Math.max(
|
|
67
76
|
0,
|
|
68
|
-
Math.floor((Date.now() - new Date(
|
|
77
|
+
Math.floor((Date.now() - new Date(Oe().last_active).getTime()) / 1e3)
|
|
69
78
|
);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
idle_seconds:
|
|
73
|
-
beat_ms:
|
|
79
|
+
a.request(
|
|
80
|
+
I(`/item-locks/${e}/${r}/heartbeat`, {
|
|
81
|
+
idle_seconds: k,
|
|
82
|
+
beat_ms: Q
|
|
74
83
|
})
|
|
75
|
-
).then((
|
|
76
|
-
if (!(
|
|
77
|
-
|
|
84
|
+
).then((u) => {
|
|
85
|
+
if (!(u != null && u.idle_released)) return;
|
|
86
|
+
v(), i.current = !1, R(!1), l.info(
|
|
78
87
|
"Your edit lock was released after inactivity — it re-locks when you resume."
|
|
79
88
|
);
|
|
80
89
|
const t = () => {
|
|
81
90
|
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", t, !0), d();
|
|
82
91
|
};
|
|
83
92
|
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", t, !0);
|
|
84
|
-
}).catch((
|
|
93
|
+
}).catch((u) => {
|
|
85
94
|
var ae, oe;
|
|
86
|
-
const t =
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
if (c === 404 && !(
|
|
95
|
+
const t = u, c = t.status ?? ((ae = t.response) == null ? void 0 : ae.status);
|
|
96
|
+
if (W(u) || c !== 404 && c !== 409) return;
|
|
97
|
+
const C = ((oe = t.response) == null ? void 0 : oe.data) ?? t.response;
|
|
98
|
+
if (c === 404 && !(C != null && C.locked_by)) {
|
|
90
99
|
d();
|
|
91
100
|
return;
|
|
92
101
|
}
|
|
93
|
-
|
|
94
|
-
locked_by:
|
|
95
|
-
locked_by_name:
|
|
96
|
-
}),
|
|
97
|
-
`${
|
|
102
|
+
v(), i.current = !1, R(!1), C != null && C.locked_by && (m({
|
|
103
|
+
locked_by: C.locked_by,
|
|
104
|
+
locked_by_name: C.locked_by_name ?? null
|
|
105
|
+
}), l.warning(
|
|
106
|
+
`${C.locked_by_name ?? "Another user"} took over editing — your changes are no longer being saved`
|
|
98
107
|
));
|
|
99
108
|
});
|
|
100
|
-
},
|
|
101
|
-
} catch (
|
|
102
|
-
const
|
|
103
|
-
return
|
|
109
|
+
}, Q), !0;
|
|
110
|
+
} catch (k) {
|
|
111
|
+
const u = k, t = u.status ?? ((s = u.response) == null ? void 0 : s.status), c = ((n = u.response) == null ? void 0 : n.data) ?? u.response;
|
|
112
|
+
return P.current = t ?? null, W(k) ? !1 : t === 404 ? (T.current = !0, v(), i.current = !1, R(!1), !1) : (t === 409 && (c != null && c.locked_by) && (i.current = !1, R(!1), m({
|
|
104
113
|
locked_by: c.locked_by,
|
|
105
114
|
locked_by_name: c.locked_by_name ?? null,
|
|
106
115
|
...typeof c.may_take_over == "boolean" ? { may_take_over: c.may_take_over } : {}
|
|
107
116
|
})), !1);
|
|
108
117
|
}
|
|
109
|
-
}, [
|
|
118
|
+
}, [a, e, r, v, W]), g = p(async () => {
|
|
110
119
|
if (!(!e || !r))
|
|
111
120
|
try {
|
|
112
|
-
const s = await
|
|
113
|
-
|
|
114
|
-
const
|
|
121
|
+
const s = await a.request(Ae(`/item-locks/${e}/${r}/lock`)), n = s == null ? void 0 : s.data;
|
|
122
|
+
ke(Array.isArray(n == null ? void 0 : n.queue) ? n.queue : []), F(typeof (n == null ? void 0 : n.my_position) == "number" ? n.my_position : null);
|
|
123
|
+
const k = (n == null ? void 0 : n.is_mine) === !0 || !!f && String((n == null ? void 0 : n.locked_by) ?? "").toLowerCase() === f.toLowerCase(), u = typeof (n == null ? void 0 : n.may_take_over) == "boolean" ? { may_take_over: n.may_take_over } : {};
|
|
115
124
|
if (i.current) return;
|
|
116
|
-
if (!(n != null && n.locked_by) ||
|
|
117
|
-
|
|
125
|
+
if (!(n != null && n.locked_by) || k) {
|
|
126
|
+
m(null);
|
|
118
127
|
return;
|
|
119
128
|
}
|
|
120
|
-
|
|
129
|
+
m(
|
|
121
130
|
(t) => t && t.locked_by === String(n.locked_by) ? {
|
|
122
131
|
...t,
|
|
123
132
|
note: n.note ?? t.note ?? null,
|
|
124
133
|
idle_minutes: n.locked_by_idle_minutes ?? t.idle_minutes ?? null,
|
|
125
|
-
...
|
|
134
|
+
...u
|
|
126
135
|
} : {
|
|
127
136
|
locked_by: String(n.locked_by),
|
|
128
137
|
locked_by_name: n.locked_by_name ?? null,
|
|
129
138
|
note: n.note ?? null,
|
|
130
139
|
idle_minutes: n.locked_by_idle_minutes ?? null,
|
|
131
|
-
...
|
|
140
|
+
...u
|
|
132
141
|
}
|
|
133
142
|
), U(!1);
|
|
134
143
|
} catch (s) {
|
|
135
144
|
(s == null ? void 0 : s.status) === 404 && (T.current = !0);
|
|
136
145
|
}
|
|
137
|
-
}, [
|
|
146
|
+
}, [a, e, r, f]), O = (w == null ? void 0 : w.locked_by) ?? null;
|
|
138
147
|
N(() => {
|
|
139
|
-
|
|
140
|
-
}, [
|
|
141
|
-
if (!
|
|
142
|
-
const s = setInterval(() => void
|
|
148
|
+
O && g();
|
|
149
|
+
}, [O, g]), N(() => {
|
|
150
|
+
if (!O) return;
|
|
151
|
+
const s = setInterval(() => void g(), Pe);
|
|
143
152
|
return () => clearInterval(s);
|
|
144
|
-
}, [
|
|
145
|
-
if (!(!
|
|
146
|
-
return
|
|
147
|
-
|
|
153
|
+
}, [O, g]), N(() => {
|
|
154
|
+
if (!(!o || !e || !r))
|
|
155
|
+
return q.current = !1, T.current = !1, y ? g() : d(), () => {
|
|
156
|
+
v(), q.current = !1, i.current && (i.current = !1, a.request(K(`/item-locks/${e}/${r}/lock`)).then(() => X(f, "lock-released", e, r)).catch(() => {
|
|
148
157
|
}));
|
|
149
158
|
};
|
|
150
|
-
}, [
|
|
151
|
-
const
|
|
152
|
-
if (!(!
|
|
153
|
-
|
|
159
|
+
}, [o, e, r, d, a, v, f, y, g]);
|
|
160
|
+
const we = p(async () => {
|
|
161
|
+
if (!(!o || i.current || H.current) && !(Date.now() < V.current)) {
|
|
162
|
+
H.current = !0;
|
|
154
163
|
try {
|
|
155
164
|
const s = await d();
|
|
156
|
-
!s &&
|
|
165
|
+
!s && P.current === 409 && l.warning("Someone else is editing this record — your change can’t be saved yet"), !s && P.current !== 409 && !T.current && (V.current = Date.now() + je);
|
|
157
166
|
} finally {
|
|
158
|
-
|
|
167
|
+
H.current = !1;
|
|
159
168
|
}
|
|
160
169
|
}
|
|
161
|
-
}, [
|
|
170
|
+
}, [o, d]);
|
|
162
171
|
N(() => {
|
|
163
172
|
const s = () => {
|
|
164
|
-
|
|
173
|
+
V.current = 0;
|
|
165
174
|
};
|
|
166
175
|
return window.addEventListener("online", s), () => window.removeEventListener("online", s);
|
|
167
176
|
}, []);
|
|
168
|
-
const j =
|
|
177
|
+
const j = p(() => {
|
|
169
178
|
var s;
|
|
170
179
|
if (!(!e || !r))
|
|
171
180
|
try {
|
|
172
|
-
const n = (s =
|
|
181
|
+
const n = (s = a.getToken) == null ? void 0 : s.call(a), k = a.url ?? "";
|
|
173
182
|
fetch(
|
|
174
|
-
`${
|
|
183
|
+
`${k}/api/item-locks/${encodeURIComponent(e)}/${encodeURIComponent(r)}/lock/release`,
|
|
175
184
|
{
|
|
176
185
|
method: "POST",
|
|
177
186
|
keepalive: !0,
|
|
178
187
|
credentials: n ? "omit" : "include",
|
|
179
188
|
headers: n ? { Authorization: `Bearer ${n}` } : {}
|
|
180
189
|
}
|
|
181
|
-
).then(() => X(
|
|
190
|
+
).then(() => X(f, "lock-released", e, r)).catch(() => {
|
|
182
191
|
});
|
|
183
192
|
} catch {
|
|
184
193
|
}
|
|
185
|
-
}, [
|
|
194
|
+
}, [a, e, r, f]), J = Ke(), xe = ze(), z = S && J && xe;
|
|
186
195
|
N(() => {
|
|
187
|
-
if (!(!
|
|
196
|
+
if (!(!o || !e || !r)) {
|
|
188
197
|
if (z) {
|
|
189
|
-
|
|
190
|
-
!s &&
|
|
198
|
+
q.current && (q.current = !1, d().then((s) => {
|
|
199
|
+
!s && P.current === 409 && l.warning(
|
|
191
200
|
"Someone else started editing while you were away — your changes are still here, but can’t be saved until they release it"
|
|
192
201
|
);
|
|
193
202
|
}));
|
|
194
203
|
return;
|
|
195
204
|
}
|
|
196
|
-
i.current && (
|
|
205
|
+
i.current && (v(), i.current = !1, R(!1), q.current = !0, J ? a.request(K(`/item-locks/${e}/${r}/lock`)).then(() => X(f, "lock-released", e, r)).catch(() => {
|
|
197
206
|
}) : j());
|
|
198
207
|
}
|
|
199
208
|
}, [
|
|
200
|
-
|
|
209
|
+
o,
|
|
201
210
|
z,
|
|
202
211
|
J,
|
|
203
212
|
e,
|
|
204
213
|
r,
|
|
205
214
|
d,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
215
|
+
a,
|
|
216
|
+
v,
|
|
217
|
+
f,
|
|
209
218
|
j
|
|
210
219
|
]), N(() => {
|
|
211
|
-
if (!
|
|
220
|
+
if (!o || !y || !e || !r || O || !z) return;
|
|
212
221
|
const s = setInterval(() => {
|
|
213
|
-
!i.current && !T.current &&
|
|
222
|
+
!i.current && !T.current && g();
|
|
214
223
|
}, Be);
|
|
215
224
|
return () => clearInterval(s);
|
|
216
|
-
}, [
|
|
217
|
-
if (!
|
|
225
|
+
}, [o, y, e, r, O, z, g]), N(() => {
|
|
226
|
+
if (!o || !e || !r) return;
|
|
218
227
|
const s = () => {
|
|
219
|
-
i.current && (
|
|
220
|
-
}, n = (
|
|
221
|
-
|
|
228
|
+
i.current && (v(), i.current = !1, q.current = !0, j());
|
|
229
|
+
}, n = (k) => {
|
|
230
|
+
k.persisted && q.current && (q.current = !1, d());
|
|
222
231
|
};
|
|
223
232
|
return window.addEventListener("pagehide", s), window.addEventListener("pageshow", n), () => {
|
|
224
233
|
window.removeEventListener("pagehide", s), window.removeEventListener("pageshow", n);
|
|
225
234
|
};
|
|
226
|
-
}, [
|
|
227
|
-
|
|
235
|
+
}, [o, e, r, v, d, j]), Me(f, "lock-released", e, r, () => {
|
|
236
|
+
o && i.current && d();
|
|
228
237
|
});
|
|
229
|
-
const G =
|
|
238
|
+
const G = ue();
|
|
230
239
|
N(() => {
|
|
231
|
-
if (!(!
|
|
240
|
+
if (!(!o || !G || !e || !r))
|
|
232
241
|
return G.subscribeCollections([e], (s) => {
|
|
233
242
|
var n;
|
|
234
|
-
i.current || T.current || !((n = s.changed_fields) != null && n.includes("$lock")) || !
|
|
243
|
+
i.current || T.current || !((n = s.changed_fields) != null && n.includes("$lock")) || !De(s, r) || g();
|
|
235
244
|
});
|
|
236
|
-
}, [
|
|
237
|
-
const
|
|
245
|
+
}, [o, G, e, r, g]);
|
|
246
|
+
const D = ue(), [_e, se] = L(!1), pe = p(async () => {
|
|
238
247
|
if (!(!e || !r)) {
|
|
239
248
|
se(!0);
|
|
240
249
|
try {
|
|
241
|
-
await
|
|
250
|
+
await a.request(I(`/item-locks/${e}/${r}/lock/request`, {})), l.success("Asked the current editor to release the lock");
|
|
242
251
|
} catch {
|
|
243
|
-
|
|
252
|
+
l.error("Could not send the lock request");
|
|
244
253
|
} finally {
|
|
245
254
|
se(!1);
|
|
246
255
|
}
|
|
247
256
|
}
|
|
248
|
-
}, [
|
|
257
|
+
}, [a, e, r]);
|
|
249
258
|
N(() => {
|
|
250
|
-
if (!
|
|
251
|
-
const s =
|
|
259
|
+
if (!D || !e || !r) return;
|
|
260
|
+
const s = D.on("lock:requested", (t) => {
|
|
252
261
|
if ((t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || !i.current) return;
|
|
253
262
|
const c = (t == null ? void 0 : t.from) ?? {};
|
|
254
|
-
|
|
263
|
+
l(`${c.name ?? "Someone"} is asking you to release this record`, {
|
|
255
264
|
duration: 3e4,
|
|
256
265
|
action: {
|
|
257
266
|
label: "Release",
|
|
258
267
|
onClick: () => {
|
|
259
|
-
|
|
260
|
-
|
|
268
|
+
v(), i.current = !1, R(!1), a.request(
|
|
269
|
+
I(`/item-locks/${e}/${r}/lock/respond`, {
|
|
261
270
|
to: c.id,
|
|
262
271
|
action: "release"
|
|
263
272
|
})
|
|
264
|
-
).then(() =>
|
|
273
|
+
).then(() => l.success("Lock released")).catch(() => l.error("Failed to release the lock"));
|
|
265
274
|
}
|
|
266
275
|
},
|
|
267
276
|
cancel: {
|
|
268
277
|
label: "Keep editing",
|
|
269
278
|
onClick: () => {
|
|
270
|
-
|
|
271
|
-
|
|
279
|
+
a.request(
|
|
280
|
+
I(`/item-locks/${e}/${r}/lock/respond`, {
|
|
272
281
|
to: c.id,
|
|
273
282
|
action: "decline"
|
|
274
283
|
})
|
|
@@ -277,127 +286,127 @@ function rt(e, r, a, _ = {}) {
|
|
|
277
286
|
}
|
|
278
287
|
}
|
|
279
288
|
});
|
|
280
|
-
}), n =
|
|
281
|
-
var c,
|
|
282
|
-
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || i.current || ((t == null ? void 0 : t.action) === "release" ? (
|
|
283
|
-
`${((
|
|
289
|
+
}), n = D.on("lock:response", (t) => {
|
|
290
|
+
var c, C;
|
|
291
|
+
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || i.current || ((t == null ? void 0 : t.action) === "release" ? (l.success(`${((c = t == null ? void 0 : t.from) == null ? void 0 : c.name) ?? "The editor"} released the lock — it's yours`), d()) : l.warning(
|
|
292
|
+
`${((C = t == null ? void 0 : t.from) == null ? void 0 : C.name) ?? "The editor"} is keeping the lock${t != null && t.note ? `: "${t.note}"` : ""}`
|
|
284
293
|
));
|
|
285
|
-
}),
|
|
286
|
-
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || i.current || (
|
|
287
|
-
}),
|
|
288
|
-
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || (i.current &&
|
|
294
|
+
}), k = D.on("lock:available", (t) => {
|
|
295
|
+
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || i.current || (l.success("Your turn — the edit lock is yours"), F(null), d());
|
|
296
|
+
}), u = D.on("lock:queued", (t) => {
|
|
297
|
+
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || (i.current && l(`${(t == null ? void 0 : t.user_name) ?? "Someone"} is waiting to edit this record`, { duration: 8e3 }), g());
|
|
289
298
|
});
|
|
290
299
|
return () => {
|
|
291
|
-
s(), n(),
|
|
300
|
+
s(), n(), k(), u();
|
|
292
301
|
};
|
|
293
|
-
}, [
|
|
294
|
-
const
|
|
302
|
+
}, [D, e, r, a, d, v, g]);
|
|
303
|
+
const Le = p(async () => {
|
|
295
304
|
if (!(!e || !r)) {
|
|
296
305
|
te(!0);
|
|
297
306
|
try {
|
|
298
|
-
const s = await
|
|
299
|
-
|
|
307
|
+
const s = await a.request(
|
|
308
|
+
I(`/item-locks/${e}/${r}/lock/queue`, {})
|
|
300
309
|
), n = s == null ? void 0 : s.data;
|
|
301
310
|
if (n != null && n.free) {
|
|
302
|
-
F(null),
|
|
311
|
+
F(null), m(null), l.success("Nobody is editing this record now — go ahead");
|
|
303
312
|
return;
|
|
304
313
|
}
|
|
305
|
-
const
|
|
306
|
-
F(typeof
|
|
314
|
+
const k = n == null ? void 0 : n.position;
|
|
315
|
+
F(typeof k == "number" ? k : 1), l.success("You are in line — the lock comes to you automatically when it frees up"), g();
|
|
307
316
|
} catch {
|
|
308
|
-
|
|
317
|
+
l.error("Could not join the queue");
|
|
309
318
|
} finally {
|
|
310
319
|
te(!1);
|
|
311
320
|
}
|
|
312
321
|
}
|
|
313
|
-
}, [
|
|
322
|
+
}, [a, e, r, g]), Ee = p(async () => {
|
|
314
323
|
if (!(!e || !r))
|
|
315
324
|
try {
|
|
316
|
-
await
|
|
325
|
+
await a.request(K(`/item-locks/${e}/${r}/lock/queue`)), F(null), g();
|
|
317
326
|
} catch {
|
|
318
327
|
}
|
|
319
|
-
}, [
|
|
328
|
+
}, [a, e, r, g]), $e = p(
|
|
320
329
|
async (s) => {
|
|
321
330
|
if (!(!e || !r || !i.current)) {
|
|
322
331
|
re(s);
|
|
323
332
|
try {
|
|
324
|
-
await
|
|
333
|
+
await a.request(I(`/item-locks/${e}/${r}/lock/note`, { note: s }));
|
|
325
334
|
} catch {
|
|
326
335
|
}
|
|
327
336
|
}
|
|
328
337
|
},
|
|
329
|
-
[
|
|
330
|
-
),
|
|
338
|
+
[a, e, r]
|
|
339
|
+
), Ce = p(async () => {
|
|
331
340
|
if (!(!e || !r || !i.current)) {
|
|
332
|
-
ne(!0),
|
|
341
|
+
ne(!0), v(), i.current = !1, R(!1);
|
|
333
342
|
try {
|
|
334
|
-
await
|
|
343
|
+
await a.request(K(`/item-locks/${e}/${r}/lock`)), U(!0), re(""), l.success("Lock released — anyone can edit this record now");
|
|
335
344
|
} catch {
|
|
336
|
-
|
|
345
|
+
l.error("Failed to release the lock"), d();
|
|
337
346
|
} finally {
|
|
338
347
|
ne(!1);
|
|
339
348
|
}
|
|
340
349
|
}
|
|
341
|
-
}, [
|
|
350
|
+
}, [a, e, r, v, d]), Ne = p(async () => {
|
|
342
351
|
if (i.current) return !0;
|
|
343
352
|
const s = await d();
|
|
344
|
-
return s &&
|
|
345
|
-
}, [d]), Re =
|
|
353
|
+
return s && l.success("You hold the edit lock again"), s;
|
|
354
|
+
}, [d]), Re = p(async () => {
|
|
346
355
|
var s;
|
|
347
356
|
if (!(!e || !r)) {
|
|
348
357
|
ee(!0);
|
|
349
358
|
try {
|
|
350
|
-
await
|
|
351
|
-
|
|
352
|
-
),
|
|
359
|
+
await a.request(
|
|
360
|
+
I(`/item-locks/${e}/${r}/lock/force`, { beat_ms: Q })
|
|
361
|
+
), l.success("You now hold the edit lock"), await d();
|
|
353
362
|
} catch (n) {
|
|
354
|
-
const
|
|
355
|
-
|
|
363
|
+
const k = ((s = n == null ? void 0 : n.response) == null ? void 0 : s.error) ?? "Failed to take over the lock";
|
|
364
|
+
l.error(k), (n == null ? void 0 : n.status) === 403 && m((u) => u && { ...u, may_take_over: !1 });
|
|
356
365
|
} finally {
|
|
357
366
|
ee(!1);
|
|
358
367
|
}
|
|
359
368
|
}
|
|
360
|
-
}, [
|
|
369
|
+
}, [a, e, r, d]);
|
|
361
370
|
return {
|
|
362
|
-
lockHolder:
|
|
363
|
-
acquired:
|
|
364
|
-
isReadOnly: !!
|
|
371
|
+
lockHolder: w,
|
|
372
|
+
acquired: _,
|
|
373
|
+
isReadOnly: !!w,
|
|
365
374
|
takeOver: Re,
|
|
366
|
-
takingOver:
|
|
367
|
-
isAdmin:
|
|
368
|
-
requestLock:
|
|
369
|
-
requesting:
|
|
370
|
-
queue:
|
|
375
|
+
takingOver: Y,
|
|
376
|
+
isAdmin: $,
|
|
377
|
+
requestLock: pe,
|
|
378
|
+
requesting: _e,
|
|
379
|
+
queue: me,
|
|
371
380
|
myPosition: he,
|
|
372
|
-
joinQueue:
|
|
373
|
-
leaveQueue:
|
|
374
|
-
joining:
|
|
375
|
-
myNote:
|
|
381
|
+
joinQueue: Le,
|
|
382
|
+
leaveQueue: Ee,
|
|
383
|
+
joining: be,
|
|
384
|
+
myNote: ve,
|
|
376
385
|
saveNote: $e,
|
|
377
|
-
release:
|
|
378
|
-
releasing:
|
|
386
|
+
release: Ce,
|
|
387
|
+
releasing: ge,
|
|
379
388
|
released: ye,
|
|
380
389
|
relock: Ne,
|
|
381
|
-
claim:
|
|
390
|
+
claim: we
|
|
382
391
|
};
|
|
383
392
|
}
|
|
384
|
-
function
|
|
393
|
+
function st({
|
|
385
394
|
note: e,
|
|
386
395
|
onSave: r,
|
|
387
|
-
waiting:
|
|
388
|
-
onRelease:
|
|
389
|
-
releasing:
|
|
390
|
-
released:
|
|
391
|
-
onRelock:
|
|
396
|
+
waiting: o,
|
|
397
|
+
onRelease: E,
|
|
398
|
+
releasing: y,
|
|
399
|
+
released: S,
|
|
400
|
+
onRelock: a
|
|
392
401
|
}) {
|
|
393
|
-
var
|
|
394
|
-
const [
|
|
395
|
-
N(() =>
|
|
396
|
-
const
|
|
397
|
-
|
|
402
|
+
var w;
|
|
403
|
+
const [$, f] = L(e);
|
|
404
|
+
N(() => f(e), [e]);
|
|
405
|
+
const b = () => {
|
|
406
|
+
$.trim() !== e && r($.trim());
|
|
398
407
|
};
|
|
399
|
-
return
|
|
400
|
-
/* @__PURE__ */
|
|
408
|
+
return S ? /* @__PURE__ */ x(le, { children: [
|
|
409
|
+
/* @__PURE__ */ h(ce, { asChild: !0, children: /* @__PURE__ */ h(
|
|
401
410
|
"button",
|
|
402
411
|
{
|
|
403
412
|
type: "button",
|
|
@@ -405,117 +414,117 @@ function nt({
|
|
|
405
414
|
title: "Lock released — anyone can edit this record",
|
|
406
415
|
"data-lock-released": !0,
|
|
407
416
|
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",
|
|
408
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ h(ie, { className: "h-4 w-4", strokeWidth: 2 })
|
|
409
418
|
}
|
|
410
419
|
) }),
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
|
|
420
|
+
/* @__PURE__ */ x(de, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
|
|
421
|
+
/* @__PURE__ */ h("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "You released the edit lock" }),
|
|
422
|
+
/* @__PURE__ */ h("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." }),
|
|
423
|
+
/* @__PURE__ */ x(
|
|
424
|
+
M,
|
|
416
425
|
{
|
|
417
426
|
type: "button",
|
|
418
427
|
size: "sm",
|
|
419
428
|
className: "mt-2 h-7 w-full text-[12px]",
|
|
420
|
-
onClick:
|
|
429
|
+
onClick: a,
|
|
421
430
|
"data-lock-relock": !0,
|
|
422
431
|
children: [
|
|
423
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ h(Z, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
424
433
|
" Lock again"
|
|
425
434
|
]
|
|
426
435
|
}
|
|
427
436
|
)
|
|
428
437
|
] })
|
|
429
|
-
] }) : /* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
438
|
+
] }) : /* @__PURE__ */ x(le, { children: [
|
|
439
|
+
/* @__PURE__ */ h(ce, { asChild: !0, children: /* @__PURE__ */ x(
|
|
431
440
|
"button",
|
|
432
441
|
{
|
|
433
442
|
type: "button",
|
|
434
443
|
"aria-label": "You hold the edit lock — add a note for others",
|
|
435
|
-
title:
|
|
444
|
+
title: o.length > 0 ? `You hold the edit lock · ${o.length} waiting` : "You hold the edit lock",
|
|
436
445
|
"data-lock-holder": !0,
|
|
437
446
|
className: "relative inline-flex h-8 w-8 items-center justify-center text-[#0e7490] transition-colors hover:bg-accent hover:text-accent-foreground dark:text-nvr-cyan",
|
|
438
447
|
children: [
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
448
|
+
/* @__PURE__ */ h(Z, { className: "h-4 w-4", strokeWidth: 2 }),
|
|
449
|
+
o.length > 0 && /* @__PURE__ */ h("span", { className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-amber-500 ring-2 ring-background" })
|
|
441
450
|
]
|
|
442
451
|
}
|
|
443
452
|
) }),
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ x(de, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
|
|
454
|
+
/* @__PURE__ */ h("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "You hold the edit lock" }),
|
|
455
|
+
/* @__PURE__ */ h("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." }),
|
|
456
|
+
/* @__PURE__ */ h(
|
|
448
457
|
"input",
|
|
449
458
|
{
|
|
450
|
-
value:
|
|
451
|
-
onChange: (
|
|
452
|
-
onBlur:
|
|
453
|
-
onKeyDown: (
|
|
454
|
-
|
|
459
|
+
value: $,
|
|
460
|
+
onChange: (m) => f(m.target.value.slice(0, 300)),
|
|
461
|
+
onBlur: b,
|
|
462
|
+
onKeyDown: (m) => {
|
|
463
|
+
m.key === "Enter" && (m.preventDefault(), b());
|
|
455
464
|
},
|
|
456
465
|
placeholder: "“editing lines, ~15 min”",
|
|
457
466
|
"aria-label": "Lock note",
|
|
458
467
|
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"
|
|
459
468
|
}
|
|
460
469
|
),
|
|
461
|
-
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
|
|
470
|
+
o.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: [
|
|
471
|
+
/* @__PURE__ */ x("span", { className: "font-semibold", children: [
|
|
472
|
+
o.length,
|
|
464
473
|
" waiting for the lock:"
|
|
465
474
|
] }),
|
|
466
475
|
" ",
|
|
467
|
-
|
|
476
|
+
o.map((m) => m.name ?? "someone").join(", ")
|
|
468
477
|
] }),
|
|
469
|
-
|
|
470
|
-
|
|
478
|
+
E && /* @__PURE__ */ x(
|
|
479
|
+
M,
|
|
471
480
|
{
|
|
472
481
|
type: "button",
|
|
473
482
|
variant: "outline",
|
|
474
483
|
size: "sm",
|
|
475
484
|
className: "mt-2 h-7 w-full text-[12px]",
|
|
476
|
-
onClick:
|
|
477
|
-
disabled:
|
|
485
|
+
onClick: E,
|
|
486
|
+
disabled: y,
|
|
478
487
|
"data-lock-release": !0,
|
|
479
488
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
|
|
489
|
+
/* @__PURE__ */ h(ie, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
490
|
+
y ? "Releasing…" : o.length > 0 ? `Release lock to ${((w = o[0]) == null ? void 0 : w.name) ?? "the next person"}` : "Release lock"
|
|
482
491
|
]
|
|
483
492
|
}
|
|
484
493
|
)
|
|
485
494
|
] })
|
|
486
495
|
] });
|
|
487
496
|
}
|
|
488
|
-
function
|
|
497
|
+
function at({
|
|
489
498
|
lockHolder: e,
|
|
490
499
|
onTakeOver: r,
|
|
491
|
-
takingOver:
|
|
492
|
-
isAdmin:
|
|
493
|
-
onRequestLock:
|
|
494
|
-
requesting:
|
|
495
|
-
queue:
|
|
496
|
-
myPosition:
|
|
497
|
-
onJoinQueue:
|
|
498
|
-
onLeaveQueue:
|
|
499
|
-
joining:
|
|
500
|
-
noun:
|
|
501
|
-
readOnlyText:
|
|
500
|
+
takingOver: o,
|
|
501
|
+
isAdmin: E,
|
|
502
|
+
onRequestLock: y,
|
|
503
|
+
requesting: S,
|
|
504
|
+
queue: a,
|
|
505
|
+
myPosition: $,
|
|
506
|
+
onJoinQueue: f,
|
|
507
|
+
onLeaveQueue: b,
|
|
508
|
+
joining: w,
|
|
509
|
+
noun: m = "this item",
|
|
510
|
+
readOnlyText: _ = "fields are read-only"
|
|
502
511
|
}) {
|
|
503
512
|
if (!e) return null;
|
|
504
|
-
const
|
|
505
|
-
return /* @__PURE__ */
|
|
513
|
+
const R = e.locked_by_name || "Another user", Y = (a == null ? void 0 : a.length) ?? 0;
|
|
514
|
+
return /* @__PURE__ */ x(
|
|
506
515
|
"div",
|
|
507
516
|
{
|
|
508
517
|
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",
|
|
509
518
|
"data-lock-banner": !0,
|
|
510
519
|
children: [
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ h(Z, { className: "h-4 w-4 shrink-0 text-amber-500" }),
|
|
521
|
+
/* @__PURE__ */ x("span", { className: "min-w-0 flex-1", children: [
|
|
522
|
+
/* @__PURE__ */ h("span", { className: "font-medium", children: R }),
|
|
514
523
|
" is editing ",
|
|
515
|
-
|
|
524
|
+
m,
|
|
516
525
|
" — ",
|
|
517
|
-
|
|
518
|
-
e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */
|
|
526
|
+
_,
|
|
527
|
+
e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */ x(
|
|
519
528
|
"span",
|
|
520
529
|
{
|
|
521
530
|
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",
|
|
@@ -530,67 +539,67 @@ function st({
|
|
|
530
539
|
),
|
|
531
540
|
" ",
|
|
532
541
|
"until the lock is released.",
|
|
533
|
-
e.note && /* @__PURE__ */
|
|
542
|
+
e.note && /* @__PURE__ */ x("span", { className: "mt-0.5 block text-[12.5px] text-amber-800/90 dark:text-amber-200/90", children: [
|
|
534
543
|
"“",
|
|
535
544
|
e.note,
|
|
536
545
|
"”"
|
|
537
546
|
] }),
|
|
538
|
-
|
|
539
|
-
|
|
547
|
+
Y > 0 && $ == null && /* @__PURE__ */ x("span", { className: "mt-0.5 block text-[11.5px] text-amber-700/80 dark:text-amber-300/80", children: [
|
|
548
|
+
Y,
|
|
540
549
|
" ",
|
|
541
|
-
|
|
550
|
+
Y === 1 ? "person is" : "people are",
|
|
542
551
|
" already waiting."
|
|
543
552
|
] })
|
|
544
553
|
] }),
|
|
545
|
-
|
|
546
|
-
|
|
554
|
+
f && ($ != null ? /* @__PURE__ */ x(
|
|
555
|
+
M,
|
|
547
556
|
{
|
|
548
557
|
size: "sm",
|
|
549
558
|
variant: "outline",
|
|
550
559
|
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",
|
|
551
|
-
onClick:
|
|
560
|
+
onClick: b,
|
|
552
561
|
"data-lock-queue-leave": !0,
|
|
553
562
|
children: [
|
|
554
563
|
"You’re #",
|
|
555
|
-
|
|
564
|
+
$,
|
|
556
565
|
" in line · Leave"
|
|
557
566
|
]
|
|
558
567
|
}
|
|
559
|
-
) : /* @__PURE__ */
|
|
560
|
-
|
|
568
|
+
) : /* @__PURE__ */ h(
|
|
569
|
+
M,
|
|
561
570
|
{
|
|
562
571
|
size: "sm",
|
|
563
572
|
variant: "outline",
|
|
564
573
|
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",
|
|
565
|
-
onClick:
|
|
566
|
-
disabled:
|
|
574
|
+
onClick: f,
|
|
575
|
+
disabled: w,
|
|
567
576
|
"data-lock-queue-join": !0,
|
|
568
|
-
children:
|
|
577
|
+
children: w ? "Joining…" : "Ask to be next"
|
|
569
578
|
}
|
|
570
579
|
)),
|
|
571
|
-
|
|
572
|
-
|
|
580
|
+
y && /* @__PURE__ */ h(
|
|
581
|
+
M,
|
|
573
582
|
{
|
|
574
583
|
size: "sm",
|
|
575
584
|
variant: "outline",
|
|
576
585
|
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",
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
children:
|
|
586
|
+
onClick: y,
|
|
587
|
+
disabled: S,
|
|
588
|
+
children: S ? "Asking…" : "Ask them to wrap up"
|
|
580
589
|
}
|
|
581
590
|
),
|
|
582
591
|
// Admins always; other roles only when the server says they may (the
|
|
583
592
|
// takeover-role allowlist, #256) — unknown = offered, and a 403 then
|
|
584
593
|
// hides it. A Take over that can only fail was a dead end.
|
|
585
|
-
(
|
|
586
|
-
|
|
594
|
+
(E || e.may_take_over !== !1) && /* @__PURE__ */ h(
|
|
595
|
+
M,
|
|
587
596
|
{
|
|
588
597
|
size: "sm",
|
|
589
598
|
variant: "outline",
|
|
590
|
-
className:
|
|
599
|
+
className: E ? "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",
|
|
591
600
|
onClick: r,
|
|
592
|
-
disabled:
|
|
593
|
-
children:
|
|
601
|
+
disabled: o,
|
|
602
|
+
children: o ? "Taking over…" : "Take over"
|
|
594
603
|
}
|
|
595
604
|
)
|
|
596
605
|
]
|
|
@@ -598,7 +607,7 @@ function st({
|
|
|
598
607
|
);
|
|
599
608
|
}
|
|
600
609
|
export {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
610
|
+
at as ItemLockBanner,
|
|
611
|
+
st as LockHolderButton,
|
|
612
|
+
nt as useItemLock
|
|
604
613
|
};
|