@nice2dev/ui-communication 1.1.5 → 1.1.7
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.
- package/dist/__tests__/controllable-parity.test.d.ts +1 -0
- package/dist/collaboration/collaborative-form.d.ts +1 -1
- package/dist/components/NiceStorageSettings.d.ts +1 -1
- package/dist/components/NiceWhiteboard.d.ts +5 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +858 -854
- package/dist/types/communicationTypes.d.ts +6 -2
- package/package.json +3 -4
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as l, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
-
import { NiceIcon as S, NiceAppShell as bt } from "@nice2dev/ui";
|
|
3
|
-
import Qe, { useRef as ce, useState as
|
|
2
|
+
import { NiceIcon as S, useNiceTranslation as Rt, NiceEmpty as At, NiceAppShell as bt, useControllableState as Dt } from "@nice2dev/ui";
|
|
3
|
+
import Qe, { useRef as ce, useState as N, useCallback as T, useEffect as re, useMemo as se, useReducer as Et, useLayoutEffect as Nt } from "react";
|
|
4
4
|
class vt {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.listeners = /* @__PURE__ */ new Map();
|
|
@@ -20,7 +20,7 @@ class vt {
|
|
|
20
20
|
this.listeners.clear();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
class
|
|
23
|
+
class $t extends vt {
|
|
24
24
|
constructor(e = {}) {
|
|
25
25
|
super(), this.type = "webrtc", this.signalingWs = null, this.localStream = null, this.screenStream = null, this.peers = /* @__PURE__ */ new Map(), this.userId = "", this.connected = !1, this.config = {
|
|
26
26
|
iceServers: [
|
|
@@ -216,15 +216,15 @@ class Dt extends vt {
|
|
|
216
216
|
for (const c of o) {
|
|
217
217
|
if (!c.track)
|
|
218
218
|
continue;
|
|
219
|
-
const
|
|
220
|
-
|
|
219
|
+
const p = c.getParameters();
|
|
220
|
+
p.encodings || (p.encodings = [{}]), c.track.kind === "audio" && this.config.maxBitrate.audio ? p.encodings[0].maxBitrate = this.config.maxBitrate.audio : c.track.kind === "video" && this.config.maxBitrate.video && (p.encodings[0].maxBitrate = this.config.maxBitrate.video), await c.setParameters(p);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
const n = await t.createOffer();
|
|
224
224
|
return await t.setLocalDescription(n), this.sendSignal({ type: "offer", to: e, from: this.userId, sdp: n.sdp }), t;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
class
|
|
227
|
+
class Mt extends vt {
|
|
228
228
|
constructor() {
|
|
229
229
|
super(...arguments), this.type = "mock", this.connected = !1, this.localStream = null;
|
|
230
230
|
}
|
|
@@ -242,8 +242,8 @@ class Et extends vt {
|
|
|
242
242
|
t.createOscillator().connect(n);
|
|
243
243
|
const s = n.stream, o = document.createElement("canvas");
|
|
244
244
|
o.width = 640, o.height = 480;
|
|
245
|
-
const c = o.captureStream(15),
|
|
246
|
-
return this.localStream = new MediaStream(
|
|
245
|
+
const c = o.captureStream(15), p = [...s.getTracks(), ...c.getTracks()];
|
|
246
|
+
return this.localStream = new MediaStream(p), this.localStream;
|
|
247
247
|
}
|
|
248
248
|
releaseLocalStream() {
|
|
249
249
|
var e;
|
|
@@ -293,17 +293,17 @@ class Et extends vt {
|
|
|
293
293
|
this.emit("screen:stopped", { participantId: "local" });
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Ot(i, e) {
|
|
297
297
|
switch (i) {
|
|
298
298
|
case "mock":
|
|
299
|
-
return new
|
|
299
|
+
return new Mt();
|
|
300
300
|
case "webrtc":
|
|
301
301
|
case "sfu":
|
|
302
302
|
default:
|
|
303
|
-
return new
|
|
303
|
+
return new $t(e);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function Lt(i) {
|
|
307
307
|
const {
|
|
308
308
|
currentUser: e,
|
|
309
309
|
transport: t = "webrtc",
|
|
@@ -312,10 +312,10 @@ function Nt(i) {
|
|
|
312
312
|
autoConnect: s = !1,
|
|
313
313
|
onCallEnded: o,
|
|
314
314
|
onIncomingCall: c,
|
|
315
|
-
onStreamAdded:
|
|
315
|
+
onStreamAdded: p,
|
|
316
316
|
onStreamRemoved: f,
|
|
317
317
|
onError: m
|
|
318
|
-
} = i, u = ce(null), [y, h] =
|
|
318
|
+
} = i, u = ce(null), [y, h] = N({
|
|
319
319
|
isConnected: !1,
|
|
320
320
|
activeCall: null,
|
|
321
321
|
incomingCall: null,
|
|
@@ -326,10 +326,10 @@ function Nt(i) {
|
|
|
326
326
|
screenStream: null,
|
|
327
327
|
isHandRaised: !1,
|
|
328
328
|
connectionError: null
|
|
329
|
-
}), x =
|
|
329
|
+
}), x = T(() => {
|
|
330
330
|
if (u.current)
|
|
331
331
|
return u.current;
|
|
332
|
-
const I =
|
|
332
|
+
const I = Ot(t, n);
|
|
333
333
|
return I.on(
|
|
334
334
|
"transport:connected",
|
|
335
335
|
() => h((C) => ({ ...C, isConnected: !0, connectionError: null }))
|
|
@@ -337,13 +337,13 @@ function Nt(i) {
|
|
|
337
337
|
const { error: L } = C;
|
|
338
338
|
h((G) => ({ ...G, connectionError: L.message })), m == null || m(L);
|
|
339
339
|
}), I.on("call:incoming", (C) => {
|
|
340
|
-
const { callId: L, callType: G, callerId: E } = C,
|
|
340
|
+
const { callId: L, callType: G, callerId: E } = C, z = {
|
|
341
341
|
callId: L,
|
|
342
342
|
callType: G,
|
|
343
343
|
caller: { id: E, name: E, presence: { status: "online" } },
|
|
344
344
|
startedAt: /* @__PURE__ */ new Date()
|
|
345
345
|
};
|
|
346
|
-
h((j) => ({ ...j, incomingCall:
|
|
346
|
+
h((j) => ({ ...j, incomingCall: z })), c == null || c(z);
|
|
347
347
|
}), I.on("call:ended", (C) => {
|
|
348
348
|
const { callId: L } = C;
|
|
349
349
|
h((G) => {
|
|
@@ -356,7 +356,7 @@ function Nt(i) {
|
|
|
356
356
|
}), o == null || o(L);
|
|
357
357
|
}), I.on("stream:added", (C) => {
|
|
358
358
|
const { participantId: L, stream: G } = C;
|
|
359
|
-
|
|
359
|
+
p == null || p(L, G);
|
|
360
360
|
}), I.on("stream:removed", (C) => {
|
|
361
361
|
const { participantId: L } = C;
|
|
362
362
|
f == null || f(L);
|
|
@@ -366,7 +366,7 @@ function Nt(i) {
|
|
|
366
366
|
n,
|
|
367
367
|
o,
|
|
368
368
|
c,
|
|
369
|
-
|
|
369
|
+
p,
|
|
370
370
|
f,
|
|
371
371
|
m
|
|
372
372
|
]);
|
|
@@ -377,21 +377,21 @@ function Nt(i) {
|
|
|
377
377
|
var C;
|
|
378
378
|
(C = u.current) == null || C.disconnect(), u.current = null;
|
|
379
379
|
}), [s, a, e.id, x, m]);
|
|
380
|
-
const
|
|
380
|
+
const P = T(
|
|
381
381
|
async (I) => {
|
|
382
382
|
await x().connect(I, e.id);
|
|
383
383
|
},
|
|
384
384
|
[x, e.id]
|
|
385
|
-
),
|
|
385
|
+
), d = T(() => {
|
|
386
386
|
var I;
|
|
387
387
|
(I = u.current) == null || I.disconnect(), u.current = null, h((C) => ({ ...C, isConnected: !1 }));
|
|
388
|
-
}, []),
|
|
388
|
+
}, []), D = T(
|
|
389
389
|
async (I, C = "video") => {
|
|
390
|
-
const L = u.current ?? x(), G = C === "video" ? { audio: !0, video: { width: 1280, height: 720 } } : { audio: !0, video: !1 }, E = await L.getLocalStream(G),
|
|
391
|
-
return h((j) => ({ ...j, activeCall:
|
|
390
|
+
const L = u.current ?? x(), G = C === "video" ? { audio: !0, video: { width: 1280, height: 720 } } : { audio: !0, video: !1 }, E = await L.getLocalStream(G), z = await L.startCall(I, C);
|
|
391
|
+
return h((j) => ({ ...j, activeCall: z, localStream: E })), z;
|
|
392
392
|
},
|
|
393
393
|
[x]
|
|
394
|
-
),
|
|
394
|
+
), A = T(async () => {
|
|
395
395
|
const I = u.current, { incomingCall: C } = y;
|
|
396
396
|
if (!I || !C)
|
|
397
397
|
return;
|
|
@@ -407,12 +407,12 @@ function Nt(i) {
|
|
|
407
407
|
isTranscribing: !1,
|
|
408
408
|
layout: "spotlight"
|
|
409
409
|
};
|
|
410
|
-
h((
|
|
411
|
-
}, [y]), O =
|
|
410
|
+
h((z) => ({ ...z, activeCall: E, incomingCall: null, localStream: G }));
|
|
411
|
+
}, [y]), O = T(() => {
|
|
412
412
|
var C;
|
|
413
413
|
const { incomingCall: I } = y;
|
|
414
414
|
I && ((C = u.current) == null || C.declineCall(I.callId), h((L) => ({ ...L, incomingCall: null })));
|
|
415
|
-
}, [y]), U =
|
|
415
|
+
}, [y]), U = T(() => {
|
|
416
416
|
var C, L;
|
|
417
417
|
const { activeCall: I } = y;
|
|
418
418
|
I && ((C = u.current) == null || C.endCall(I.id), (L = u.current) == null || L.releaseLocalStream(), h((G) => ({
|
|
@@ -422,32 +422,32 @@ function Nt(i) {
|
|
|
422
422
|
isScreenSharing: !1,
|
|
423
423
|
screenStream: null
|
|
424
424
|
})));
|
|
425
|
-
}, [y]), W =
|
|
425
|
+
}, [y]), W = T(() => {
|
|
426
426
|
var C;
|
|
427
427
|
const I = !y.isMicMuted;
|
|
428
428
|
(C = u.current) == null || C.muteAudio(I), h((L) => ({ ...L, isMicMuted: I }));
|
|
429
|
-
}, [y.isMicMuted]), H =
|
|
429
|
+
}, [y.isMicMuted]), H = T(() => {
|
|
430
430
|
var C;
|
|
431
431
|
const I = !y.isCameraMuted;
|
|
432
432
|
(C = u.current) == null || C.muteVideo(I), h((L) => ({ ...L, isCameraMuted: I }));
|
|
433
|
-
}, [y.isCameraMuted]), q =
|
|
433
|
+
}, [y.isCameraMuted]), q = T(async () => {
|
|
434
434
|
const I = u.current;
|
|
435
435
|
if (!I)
|
|
436
436
|
return;
|
|
437
437
|
const C = await I.startScreenShare();
|
|
438
438
|
h((L) => ({ ...L, isScreenSharing: !0, screenStream: C }));
|
|
439
|
-
}, []), _ =
|
|
439
|
+
}, []), _ = T(() => {
|
|
440
440
|
var I;
|
|
441
441
|
(I = u.current) == null || I.stopScreenShare(), h((C) => ({ ...C, isScreenSharing: !1, screenStream: null }));
|
|
442
|
-
}, []), V =
|
|
442
|
+
}, []), V = T(() => {
|
|
443
443
|
h((I) => ({ ...I, isHandRaised: !I.isHandRaised }));
|
|
444
444
|
}, []);
|
|
445
445
|
return {
|
|
446
446
|
state: y,
|
|
447
|
-
connect:
|
|
448
|
-
disconnect:
|
|
449
|
-
startCall:
|
|
450
|
-
acceptCall:
|
|
447
|
+
connect: P,
|
|
448
|
+
disconnect: d,
|
|
449
|
+
startCall: D,
|
|
450
|
+
acceptCall: A,
|
|
451
451
|
declineCall: O,
|
|
452
452
|
endCall: U,
|
|
453
453
|
toggleMic: W,
|
|
@@ -458,7 +458,7 @@ function Nt(i) {
|
|
|
458
458
|
transport: u
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function ti(i, e, t, n = "text") {
|
|
462
462
|
return {
|
|
463
463
|
id: `optimistic-${crypto.randomUUID()}`,
|
|
464
464
|
conversationId: i,
|
|
@@ -482,13 +482,13 @@ function it(i, e, t) {
|
|
|
482
482
|
function xt(i) {
|
|
483
483
|
return i.reduce((e, t) => e + t.unreadCount, 0);
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function ni(i) {
|
|
486
486
|
return i.reduce((e, t) => e + t.mentionCount, 0);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function ii(i, e) {
|
|
489
489
|
return i ? "workspace" : e ? "messenger" : "bubble";
|
|
490
490
|
}
|
|
491
|
-
const
|
|
491
|
+
const Wt = {
|
|
492
492
|
online: "Online",
|
|
493
493
|
away: "Away",
|
|
494
494
|
busy: "Busy",
|
|
@@ -496,7 +496,7 @@ const Mt = {
|
|
|
496
496
|
offline: "Offline",
|
|
497
497
|
invisible: "Invisible",
|
|
498
498
|
unknown: "Unknown"
|
|
499
|
-
},
|
|
499
|
+
}, _t = {
|
|
500
500
|
online: "var(--nice-success, #22c55e)",
|
|
501
501
|
away: "var(--nice-warning, #f59e0b)",
|
|
502
502
|
busy: "var(--nice-danger, #ef4444)",
|
|
@@ -504,7 +504,7 @@ const Mt = {
|
|
|
504
504
|
offline: "var(--nice-text-muted, #9ca3af)",
|
|
505
505
|
invisible: "var(--nice-text-muted, #9ca3af)",
|
|
506
506
|
unknown: "var(--nice-border, #d1d5db)"
|
|
507
|
-
},
|
|
507
|
+
}, Ft = {
|
|
508
508
|
xs: 6,
|
|
509
509
|
sm: 8,
|
|
510
510
|
md: 10,
|
|
@@ -520,7 +520,7 @@ function we({
|
|
|
520
520
|
id: o,
|
|
521
521
|
"data-testid": c
|
|
522
522
|
}) {
|
|
523
|
-
const
|
|
523
|
+
const p = Ft[e], f = _t[i], m = Wt[i], u = /* @__PURE__ */ r(
|
|
524
524
|
"span",
|
|
525
525
|
{
|
|
526
526
|
className: `nice-presence-dot nice-presence-dot--${i} nice-presence-dot--${e}`,
|
|
@@ -529,8 +529,8 @@ function we({
|
|
|
529
529
|
role: "img",
|
|
530
530
|
style: {
|
|
531
531
|
display: "inline-block",
|
|
532
|
-
width:
|
|
533
|
-
height:
|
|
532
|
+
width: p,
|
|
533
|
+
height: p,
|
|
534
534
|
borderRadius: "50%",
|
|
535
535
|
backgroundColor: f,
|
|
536
536
|
flexShrink: 0,
|
|
@@ -548,7 +548,7 @@ function we({
|
|
|
548
548
|
style: { display: "inline-flex", alignItems: "center", gap: 6, ...s },
|
|
549
549
|
children: [
|
|
550
550
|
u,
|
|
551
|
-
/* @__PURE__ */ r("span", { className: "nice-presence-label", style: { fontSize:
|
|
551
|
+
/* @__PURE__ */ r("span", { className: "nice-presence-label", style: { fontSize: p + 4, color: f }, children: m })
|
|
552
552
|
]
|
|
553
553
|
}
|
|
554
554
|
) : /* @__PURE__ */ r(
|
|
@@ -571,7 +571,7 @@ function wt({
|
|
|
571
571
|
onEndCall: s,
|
|
572
572
|
onMuteAudio: o,
|
|
573
573
|
onMuteVideo: c,
|
|
574
|
-
onStartScreenShare:
|
|
574
|
+
onStartScreenShare: p,
|
|
575
575
|
onStopScreenShare: f,
|
|
576
576
|
onRaiseHand: m,
|
|
577
577
|
className: u,
|
|
@@ -580,11 +580,11 @@ function wt({
|
|
|
580
580
|
"data-testid": x
|
|
581
581
|
}) {
|
|
582
582
|
var w, Z;
|
|
583
|
-
const
|
|
583
|
+
const P = ce(null), d = ce(null), [D, A] = N(!1), [O, U] = N(i.type === "audio"), [W, H] = N(!1), [q, _] = N(0), [V, I] = N(!1), C = i.participants.find((Q) => Q.user.id !== e.id);
|
|
584
584
|
re(() => {
|
|
585
|
-
|
|
585
|
+
P.current && t && (P.current.srcObject = t);
|
|
586
586
|
}, [t]), re(() => {
|
|
587
|
-
|
|
587
|
+
d.current && (C != null && C.stream) && (d.current.srcObject = C.stream);
|
|
588
588
|
}, [C == null ? void 0 : C.stream]), re(() => {
|
|
589
589
|
if (i.status !== "active")
|
|
590
590
|
return;
|
|
@@ -595,13 +595,13 @@ function wt({
|
|
|
595
595
|
const te = Math.floor(Q / 3600), X = Math.floor(Q % 3600 / 60), pe = Q % 60;
|
|
596
596
|
return te > 0 ? `${te}:${String(X).padStart(2, "0")}:${String(pe).padStart(2, "0")}` : `${String(X).padStart(2, "0")}:${String(pe).padStart(2, "0")}`;
|
|
597
597
|
}, G = () => {
|
|
598
|
-
const Q = !
|
|
599
|
-
|
|
598
|
+
const Q = !D;
|
|
599
|
+
A(Q), o == null || o(Q);
|
|
600
600
|
}, E = () => {
|
|
601
601
|
const Q = !O;
|
|
602
602
|
U(Q), c == null || c(Q);
|
|
603
|
-
},
|
|
604
|
-
W ? (H(!1), f == null || f()) : (H(!0), await (
|
|
603
|
+
}, z = async () => {
|
|
604
|
+
W ? (H(!1), f == null || f()) : (H(!0), await (p == null ? void 0 : p()));
|
|
605
605
|
}, j = () => {
|
|
606
606
|
s == null || s(i.id);
|
|
607
607
|
}, K = {
|
|
@@ -627,7 +627,7 @@ function wt({
|
|
|
627
627
|
i.type === "video" && (C != null && C.stream) && !C.isCameraOff ? /* @__PURE__ */ r(
|
|
628
628
|
"video",
|
|
629
629
|
{
|
|
630
|
-
ref:
|
|
630
|
+
ref: d,
|
|
631
631
|
autoPlay: !0,
|
|
632
632
|
playsInline: !0,
|
|
633
633
|
style: {
|
|
@@ -768,7 +768,7 @@ function wt({
|
|
|
768
768
|
children: /* @__PURE__ */ r(
|
|
769
769
|
"video",
|
|
770
770
|
{
|
|
771
|
-
ref:
|
|
771
|
+
ref: P,
|
|
772
772
|
autoPlay: !0,
|
|
773
773
|
muted: !0,
|
|
774
774
|
playsInline: !0,
|
|
@@ -798,10 +798,10 @@ function wt({
|
|
|
798
798
|
Pe,
|
|
799
799
|
{
|
|
800
800
|
icon: "mic",
|
|
801
|
-
label:
|
|
801
|
+
label: D ? "Unmute" : "Mute",
|
|
802
802
|
onClick: G,
|
|
803
|
-
active: !
|
|
804
|
-
style: { background:
|
|
803
|
+
active: !D,
|
|
804
|
+
style: { background: D ? "var(--nice-danger, #ef4444)" : void 0 }
|
|
805
805
|
}
|
|
806
806
|
),
|
|
807
807
|
i.type === "video" && /* @__PURE__ */ r(
|
|
@@ -820,7 +820,7 @@ function wt({
|
|
|
820
820
|
icon: "monitor",
|
|
821
821
|
label: W ? "Stop sharing" : "Share screen",
|
|
822
822
|
onClick: () => {
|
|
823
|
-
|
|
823
|
+
z();
|
|
824
824
|
},
|
|
825
825
|
active: W,
|
|
826
826
|
style: { background: W ? "var(--nice-success, #22c55e)" : void 0 }
|
|
@@ -914,7 +914,7 @@ function Pe({
|
|
|
914
914
|
)
|
|
915
915
|
] });
|
|
916
916
|
}
|
|
917
|
-
const
|
|
917
|
+
const jt = ["👍", "❤️", "😂", "😮", "😢", "🎉"];
|
|
918
918
|
function Ke({
|
|
919
919
|
message: i,
|
|
920
920
|
author: e,
|
|
@@ -924,12 +924,12 @@ function Ke({
|
|
|
924
924
|
onReact: s,
|
|
925
925
|
onReply: o,
|
|
926
926
|
onEdit: c,
|
|
927
|
-
onDelete:
|
|
927
|
+
onDelete: p,
|
|
928
928
|
onPin: f,
|
|
929
929
|
onOpenThread: m
|
|
930
930
|
}) {
|
|
931
|
-
var
|
|
932
|
-
const [u, y] =
|
|
931
|
+
var D, A, O, U;
|
|
932
|
+
const [u, y] = N(!1), [h, x] = N(!1), P = i.isDeleted, d = i.timestamp.toLocaleTimeString([], {
|
|
933
933
|
hour: "2-digit",
|
|
934
934
|
minute: "2-digit"
|
|
935
935
|
});
|
|
@@ -968,7 +968,7 @@ function Ke({
|
|
|
968
968
|
fontWeight: 600,
|
|
969
969
|
flexShrink: 0
|
|
970
970
|
},
|
|
971
|
-
children: !(e != null && e.avatarUrl) && (((
|
|
971
|
+
children: !(e != null && e.avatarUrl) && (((A = (D = e == null ? void 0 : e.name) == null ? void 0 : D[0]) == null ? void 0 : A.toUpperCase()) ?? "?")
|
|
972
972
|
}
|
|
973
973
|
),
|
|
974
974
|
/* @__PURE__ */ r(
|
|
@@ -1033,7 +1033,7 @@ function Ke({
|
|
|
1033
1033
|
lineHeight: 1.5,
|
|
1034
1034
|
wordBreak: "break-word"
|
|
1035
1035
|
},
|
|
1036
|
-
children:
|
|
1036
|
+
children: P ? /* @__PURE__ */ r("span", { style: { fontStyle: "italic", opacity: 0.6 }, children: "This message was deleted" }) : i.contentType === "image" && ((U = i.attachments) != null && U[0]) ? /* @__PURE__ */ r(
|
|
1037
1037
|
"img",
|
|
1038
1038
|
{
|
|
1039
1039
|
src: i.attachments[0].url,
|
|
@@ -1043,7 +1043,7 @@ function Ke({
|
|
|
1043
1043
|
) : /* @__PURE__ */ r("span", { children: i.content })
|
|
1044
1044
|
}
|
|
1045
1045
|
),
|
|
1046
|
-
!
|
|
1046
|
+
!P && i.attachments && i.attachments.length > 0 && i.contentType !== "image" && /* @__PURE__ */ r("div", { className: "nice-chat-attachments", style: { marginTop: 4 }, children: i.attachments.map((W) => /* @__PURE__ */ l(
|
|
1047
1047
|
"a",
|
|
1048
1048
|
{
|
|
1049
1049
|
href: W.url,
|
|
@@ -1071,7 +1071,7 @@ function Ke({
|
|
|
1071
1071
|
W.id
|
|
1072
1072
|
)) }),
|
|
1073
1073
|
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: 4, marginTop: 2 }, children: [
|
|
1074
|
-
/* @__PURE__ */ r("span", { style: { fontSize: 11, color: "var(--nice-text-muted, #9ca3af)" }, children:
|
|
1074
|
+
/* @__PURE__ */ r("span", { style: { fontSize: 11, color: "var(--nice-text-muted, #9ca3af)" }, children: d }),
|
|
1075
1075
|
i.editedAt && /* @__PURE__ */ r("span", { style: { fontSize: 11, color: "var(--nice-text-muted, #9ca3af)" }, children: "(edited)" }),
|
|
1076
1076
|
t && /* @__PURE__ */ r(
|
|
1077
1077
|
"span",
|
|
@@ -1147,7 +1147,7 @@ function Ke({
|
|
|
1147
1147
|
]
|
|
1148
1148
|
}
|
|
1149
1149
|
),
|
|
1150
|
-
u && !
|
|
1150
|
+
u && !P && /* @__PURE__ */ l(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
1153
|
className: "nice-chat-actions",
|
|
@@ -1197,7 +1197,7 @@ function Ke({
|
|
|
1197
1197
|
padding: "6px 8px",
|
|
1198
1198
|
zIndex: 20
|
|
1199
1199
|
},
|
|
1200
|
-
children:
|
|
1200
|
+
children: jt.map((W) => /* @__PURE__ */ r(
|
|
1201
1201
|
"button",
|
|
1202
1202
|
{
|
|
1203
1203
|
onClick: () => {
|
|
@@ -1267,12 +1267,12 @@ function Ke({
|
|
|
1267
1267
|
children: /* @__PURE__ */ r(S, { name: "map-pin", size: 16 })
|
|
1268
1268
|
}
|
|
1269
1269
|
),
|
|
1270
|
-
t &&
|
|
1270
|
+
t && p && /* @__PURE__ */ r(
|
|
1271
1271
|
"button",
|
|
1272
1272
|
{
|
|
1273
1273
|
title: "Delete",
|
|
1274
1274
|
"aria-label": "Delete",
|
|
1275
|
-
onClick: () =>
|
|
1275
|
+
onClick: () => p(i),
|
|
1276
1276
|
style: {
|
|
1277
1277
|
background: "none",
|
|
1278
1278
|
border: "none",
|
|
@@ -1301,7 +1301,7 @@ function rt({
|
|
|
1301
1301
|
onAttach: s,
|
|
1302
1302
|
disabled: o
|
|
1303
1303
|
}) {
|
|
1304
|
-
const [c,
|
|
1304
|
+
const [c, p] = N(""), f = ce(null);
|
|
1305
1305
|
re(() => {
|
|
1306
1306
|
t && f.current && f.current.focus();
|
|
1307
1307
|
}, [t]);
|
|
@@ -1309,9 +1309,9 @@ function rt({
|
|
|
1309
1309
|
h.key === "Enter" && !h.shiftKey && (h.preventDefault(), u());
|
|
1310
1310
|
}, u = () => {
|
|
1311
1311
|
const h = c.trim();
|
|
1312
|
-
h && (a(h),
|
|
1312
|
+
h && (a(h), p(""), f.current && (f.current.style.height = "auto"));
|
|
1313
1313
|
}, y = (h) => {
|
|
1314
|
-
|
|
1314
|
+
p(h.target.value), h.target.style.height = "auto", h.target.style.height = `${Math.min(h.target.scrollHeight, 120)}px`;
|
|
1315
1315
|
};
|
|
1316
1316
|
return /* @__PURE__ */ l(
|
|
1317
1317
|
"div",
|
|
@@ -1463,17 +1463,17 @@ function He({
|
|
|
1463
1463
|
hasMore: s = !1,
|
|
1464
1464
|
showHeader: o = !0,
|
|
1465
1465
|
showUserAvatars: c = !0,
|
|
1466
|
-
enableReactions:
|
|
1466
|
+
enableReactions: p = !0,
|
|
1467
1467
|
enableThreads: f = !0,
|
|
1468
1468
|
enableAttachments: m = !0,
|
|
1469
1469
|
placeholder: u,
|
|
1470
1470
|
maxMessageLength: y,
|
|
1471
1471
|
onSendMessage: h,
|
|
1472
1472
|
onEditMessage: x,
|
|
1473
|
-
onDeleteMessage:
|
|
1474
|
-
onReactToMessage:
|
|
1475
|
-
onPinMessage:
|
|
1476
|
-
onLoadMoreMessages:
|
|
1473
|
+
onDeleteMessage: P,
|
|
1474
|
+
onReactToMessage: d,
|
|
1475
|
+
onPinMessage: D,
|
|
1476
|
+
onLoadMoreMessages: A,
|
|
1477
1477
|
onStartCall: O,
|
|
1478
1478
|
className: U,
|
|
1479
1479
|
style: W,
|
|
@@ -1481,7 +1481,7 @@ function He({
|
|
|
1481
1481
|
"data-testid": q
|
|
1482
1482
|
}) {
|
|
1483
1483
|
var Y, g;
|
|
1484
|
-
const _ = ce(null), V = ce(null), [I, C] =
|
|
1484
|
+
const _ = ce(null), V = ce(null), [I, C] = N(null), [L, G] = N(null), E = Qe.useMemo(() => {
|
|
1485
1485
|
const w = /* @__PURE__ */ new Map();
|
|
1486
1486
|
return t.forEach((Z) => w.set(Z.id, Z)), w;
|
|
1487
1487
|
}, [t]);
|
|
@@ -1489,10 +1489,10 @@ function He({
|
|
|
1489
1489
|
var w;
|
|
1490
1490
|
(w = _.current) == null || w.scrollIntoView({ behavior: "smooth" });
|
|
1491
1491
|
}, [e]);
|
|
1492
|
-
const
|
|
1492
|
+
const z = T(() => {
|
|
1493
1493
|
const w = V.current;
|
|
1494
|
-
!w || !s || a || w.scrollTop === 0 && e.length > 0 && (
|
|
1495
|
-
}, [s, a, e, i.id,
|
|
1494
|
+
!w || !s || a || w.scrollTop === 0 && e.length > 0 && (A == null || A(i.id, e[0].id));
|
|
1495
|
+
}, [s, a, e, i.id, A]), j = T(
|
|
1496
1496
|
(w) => {
|
|
1497
1497
|
h == null || h(i.id, w, "text"), C(null);
|
|
1498
1498
|
},
|
|
@@ -1603,7 +1603,7 @@ function He({
|
|
|
1603
1603
|
{
|
|
1604
1604
|
ref: V,
|
|
1605
1605
|
className: "nice-chat-messages",
|
|
1606
|
-
onScroll:
|
|
1606
|
+
onScroll: z,
|
|
1607
1607
|
style: {
|
|
1608
1608
|
flex: 1,
|
|
1609
1609
|
overflowY: "auto",
|
|
@@ -1615,7 +1615,7 @@ function He({
|
|
|
1615
1615
|
s && /* @__PURE__ */ r(
|
|
1616
1616
|
"button",
|
|
1617
1617
|
{
|
|
1618
|
-
onClick: () => e.length > 0 && (
|
|
1618
|
+
onClick: () => e.length > 0 && (A == null ? void 0 : A(i.id, e[0].id)),
|
|
1619
1619
|
disabled: a,
|
|
1620
1620
|
style: {
|
|
1621
1621
|
display: "block",
|
|
@@ -1640,12 +1640,12 @@ function He({
|
|
|
1640
1640
|
author: E.get(w.authorId),
|
|
1641
1641
|
isMine: w.authorId === n.id,
|
|
1642
1642
|
showAvatar: te,
|
|
1643
|
-
enableReactions:
|
|
1644
|
-
onReact: (X, pe) =>
|
|
1643
|
+
enableReactions: p,
|
|
1644
|
+
onReact: (X, pe) => d == null ? void 0 : d(X, pe),
|
|
1645
1645
|
onReply: (X) => C(X),
|
|
1646
1646
|
onEdit: x ? (X) => x(X.id, X.content) : void 0,
|
|
1647
|
-
onDelete:
|
|
1648
|
-
onPin:
|
|
1647
|
+
onDelete: P ? (X) => P(X.id) : void 0,
|
|
1648
|
+
onPin: D ? (X) => D(X.id) : void 0,
|
|
1649
1649
|
onOpenThread: f ? (X) => G(X) : void 0
|
|
1650
1650
|
},
|
|
1651
1651
|
w.id
|
|
@@ -1712,8 +1712,8 @@ function He({
|
|
|
1712
1712
|
author: E.get(L.authorId),
|
|
1713
1713
|
isMine: L.authorId === n.id,
|
|
1714
1714
|
showAvatar: !0,
|
|
1715
|
-
enableReactions:
|
|
1716
|
-
onReact: (w, Z) =>
|
|
1715
|
+
enableReactions: p,
|
|
1716
|
+
onReact: (w, Z) => d == null ? void 0 : d(w, Z),
|
|
1717
1717
|
onReply: () => {
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
@@ -1725,8 +1725,8 @@ function He({
|
|
|
1725
1725
|
author: E.get(w.authorId),
|
|
1726
1726
|
isMine: w.authorId === n.id,
|
|
1727
1727
|
showAvatar: !0,
|
|
1728
|
-
enableReactions:
|
|
1729
|
-
onReact: (Z, Q) =>
|
|
1728
|
+
enableReactions: p,
|
|
1729
|
+
onReact: (Z, Q) => d == null ? void 0 : d(Z, Q),
|
|
1730
1730
|
onReply: () => {
|
|
1731
1731
|
}
|
|
1732
1732
|
},
|
|
@@ -1759,9 +1759,9 @@ function He({
|
|
|
1759
1759
|
}
|
|
1760
1760
|
);
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1762
|
+
function Bt({ conversation: i, partner: e, isActive: t, lastMessage: n, onClick: a }) {
|
|
1763
1763
|
var m;
|
|
1764
|
-
const s = (e == null ? void 0 : e.displayName) ?? (e == null ? void 0 : e.name) ?? i.name ?? "Group", o = ((m = s[0]) == null ? void 0 : m.toUpperCase()) ?? "?", c = (e == null ? void 0 : e.avatarUrl) ?? i.avatarUrl,
|
|
1764
|
+
const s = (e == null ? void 0 : e.displayName) ?? (e == null ? void 0 : e.name) ?? i.name ?? "Group", o = ((m = s[0]) == null ? void 0 : m.toUpperCase()) ?? "?", c = (e == null ? void 0 : e.avatarUrl) ?? i.avatarUrl, p = n ? n.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "", f = n ? n.isDeleted ? "Message deleted" : n.content.slice(0, 50) : "";
|
|
1765
1765
|
return /* @__PURE__ */ l(
|
|
1766
1766
|
"button",
|
|
1767
1767
|
{
|
|
@@ -1850,7 +1850,7 @@ function _t({ conversation: i, partner: e, isActive: t, lastMessage: n, onClick:
|
|
|
1850
1850
|
flexShrink: 0,
|
|
1851
1851
|
marginLeft: 4
|
|
1852
1852
|
},
|
|
1853
|
-
children:
|
|
1853
|
+
children: p
|
|
1854
1854
|
}
|
|
1855
1855
|
)
|
|
1856
1856
|
] }),
|
|
@@ -1931,7 +1931,7 @@ function _t({ conversation: i, partner: e, isActive: t, lastMessage: n, onClick:
|
|
|
1931
1931
|
}
|
|
1932
1932
|
);
|
|
1933
1933
|
}
|
|
1934
|
-
function
|
|
1934
|
+
function Ut({
|
|
1935
1935
|
conversations: i,
|
|
1936
1936
|
messages: e,
|
|
1937
1937
|
users: t,
|
|
@@ -1940,23 +1940,23 @@ function Ft({
|
|
|
1940
1940
|
teams: s,
|
|
1941
1941
|
enableGroupConversations: o = !0,
|
|
1942
1942
|
showPresence: c = !0,
|
|
1943
|
-
enableSearch:
|
|
1943
|
+
enableSearch: p = !0,
|
|
1944
1944
|
onSendMessage: f,
|
|
1945
1945
|
onEditMessage: m,
|
|
1946
1946
|
onDeleteMessage: u,
|
|
1947
1947
|
onReactToMessage: y,
|
|
1948
1948
|
onPinMessage: h,
|
|
1949
1949
|
onLoadMoreMessages: x,
|
|
1950
|
-
onMarkAsRead:
|
|
1951
|
-
onStartCall:
|
|
1952
|
-
onCreateConversation:
|
|
1953
|
-
className:
|
|
1950
|
+
onMarkAsRead: P,
|
|
1951
|
+
onStartCall: d,
|
|
1952
|
+
onCreateConversation: D,
|
|
1953
|
+
className: A,
|
|
1954
1954
|
style: O,
|
|
1955
1955
|
id: U,
|
|
1956
1956
|
"data-testid": W
|
|
1957
1957
|
}) {
|
|
1958
1958
|
var Y;
|
|
1959
|
-
const [H, q] =
|
|
1959
|
+
const [H, q] = N(a ?? null), [_, V] = N(""), [I, C] = N("all");
|
|
1960
1960
|
se(() => {
|
|
1961
1961
|
const g = /* @__PURE__ */ new Map();
|
|
1962
1962
|
return t.forEach((w) => g.set(w.id, w)), g;
|
|
@@ -1984,18 +1984,18 @@ function Ft({
|
|
|
1984
1984
|
), E = se(
|
|
1985
1985
|
() => H ? e[H] ?? [] : [],
|
|
1986
1986
|
[e, H]
|
|
1987
|
-
),
|
|
1987
|
+
), z = T(
|
|
1988
1988
|
(g) => {
|
|
1989
|
-
q(g),
|
|
1989
|
+
q(g), P == null || P(g);
|
|
1990
1990
|
},
|
|
1991
|
-
[
|
|
1991
|
+
[P]
|
|
1992
1992
|
), j = se(() => xt(i), [i]), K = s ?? [];
|
|
1993
1993
|
return /* @__PURE__ */ l(
|
|
1994
1994
|
"div",
|
|
1995
1995
|
{
|
|
1996
1996
|
id: U,
|
|
1997
1997
|
"data-testid": W,
|
|
1998
|
-
className: `nice-messenger${
|
|
1998
|
+
className: `nice-messenger${A ? ` ${A}` : ""}`,
|
|
1999
1999
|
style: {
|
|
2000
2000
|
display: "flex",
|
|
2001
2001
|
height: "100%",
|
|
@@ -2045,10 +2045,10 @@ function Ft({
|
|
|
2045
2045
|
}
|
|
2046
2046
|
)
|
|
2047
2047
|
] }),
|
|
2048
|
-
o &&
|
|
2048
|
+
o && D && /* @__PURE__ */ r(
|
|
2049
2049
|
"button",
|
|
2050
2050
|
{
|
|
2051
|
-
onClick: () =>
|
|
2051
|
+
onClick: () => D([], "group"),
|
|
2052
2052
|
title: "New conversation",
|
|
2053
2053
|
"aria-label": "New conversation",
|
|
2054
2054
|
style: {
|
|
@@ -2065,7 +2065,7 @@ function Ft({
|
|
|
2065
2065
|
}
|
|
2066
2066
|
)
|
|
2067
2067
|
] }),
|
|
2068
|
-
|
|
2068
|
+
p && /* @__PURE__ */ r(
|
|
2069
2069
|
"input",
|
|
2070
2070
|
{
|
|
2071
2071
|
type: "search",
|
|
@@ -2214,13 +2214,13 @@ function Ft({
|
|
|
2214
2214
|
children: "No conversations"
|
|
2215
2215
|
}
|
|
2216
2216
|
) : L.map((g) => /* @__PURE__ */ r(
|
|
2217
|
-
|
|
2217
|
+
Bt,
|
|
2218
2218
|
{
|
|
2219
2219
|
conversation: g,
|
|
2220
2220
|
partner: it(g, n.id, t),
|
|
2221
2221
|
isActive: g.id === H,
|
|
2222
2222
|
lastMessage: g.lastMessage,
|
|
2223
|
-
onClick: () =>
|
|
2223
|
+
onClick: () => z(g.id)
|
|
2224
2224
|
},
|
|
2225
2225
|
g.id
|
|
2226
2226
|
))
|
|
@@ -2321,7 +2321,7 @@ function Ft({
|
|
|
2321
2321
|
onReactToMessage: y,
|
|
2322
2322
|
onPinMessage: h,
|
|
2323
2323
|
onLoadMoreMessages: x,
|
|
2324
|
-
onStartCall:
|
|
2324
|
+
onStartCall: d,
|
|
2325
2325
|
style: { height: "100%" }
|
|
2326
2326
|
}
|
|
2327
2327
|
) : /* @__PURE__ */ l(
|
|
@@ -2348,7 +2348,7 @@ function Ft({
|
|
|
2348
2348
|
}
|
|
2349
2349
|
);
|
|
2350
2350
|
}
|
|
2351
|
-
const
|
|
2351
|
+
const Ht = ["👍", "❤️", "😂", "🎉", "😮", "😢"];
|
|
2352
2352
|
function Ye({
|
|
2353
2353
|
message: i,
|
|
2354
2354
|
author: e,
|
|
@@ -2359,12 +2359,12 @@ function Ye({
|
|
|
2359
2359
|
onOpenThread: o,
|
|
2360
2360
|
onReply: c
|
|
2361
2361
|
}) {
|
|
2362
|
-
var x,
|
|
2363
|
-
const [
|
|
2362
|
+
var x, P, d;
|
|
2363
|
+
const [p, f] = N(!1), [m, u] = N(!1), y = i.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }), h = i.timestamp.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
2364
2364
|
return /* @__PURE__ */ l(
|
|
2365
2365
|
"div",
|
|
2366
2366
|
{
|
|
2367
|
-
className: `nice-channel-msg${
|
|
2367
|
+
className: `nice-channel-msg${p ? " nice-channel-msg--hovered" : ""}${t ? " nice-channel-msg--mine" : ""}`,
|
|
2368
2368
|
onMouseEnter: () => f(!0),
|
|
2369
2369
|
onMouseLeave: () => {
|
|
2370
2370
|
f(!1), u(!1);
|
|
@@ -2374,7 +2374,7 @@ function Ye({
|
|
|
2374
2374
|
gap: 10,
|
|
2375
2375
|
padding: "4px 16px",
|
|
2376
2376
|
position: "relative",
|
|
2377
|
-
background:
|
|
2377
|
+
background: p ? "rgba(99,102,241,0.04)" : "transparent"
|
|
2378
2378
|
},
|
|
2379
2379
|
children: [
|
|
2380
2380
|
/* @__PURE__ */ r("div", { style: { width: 36, flexShrink: 0 }, children: /* @__PURE__ */ r(
|
|
@@ -2392,7 +2392,7 @@ function Ye({
|
|
|
2392
2392
|
fontWeight: 700,
|
|
2393
2393
|
fontSize: 14
|
|
2394
2394
|
},
|
|
2395
|
-
children: !(e != null && e.avatarUrl) && (((
|
|
2395
|
+
children: !(e != null && e.avatarUrl) && (((P = (x = e == null ? void 0 : e.name) == null ? void 0 : x[0]) == null ? void 0 : P.toUpperCase()) ?? "?")
|
|
2396
2396
|
}
|
|
2397
2397
|
) }),
|
|
2398
2398
|
/* @__PURE__ */ l("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
@@ -2437,7 +2437,7 @@ function Ye({
|
|
|
2437
2437
|
color: "var(--nice-text, #1f2937)",
|
|
2438
2438
|
wordBreak: "break-word"
|
|
2439
2439
|
},
|
|
2440
|
-
children: i.contentType === "image" && ((
|
|
2440
|
+
children: i.contentType === "image" && ((d = i.attachments) != null && d[0]) ? /* @__PURE__ */ r(
|
|
2441
2441
|
"img",
|
|
2442
2442
|
{
|
|
2443
2443
|
src: i.attachments[0].url,
|
|
@@ -2453,10 +2453,10 @@ function Ye({
|
|
|
2453
2453
|
) : i.content
|
|
2454
2454
|
}
|
|
2455
2455
|
),
|
|
2456
|
-
!i.isDeleted && i.attachments && i.attachments.length > 0 && i.contentType !== "image" && /* @__PURE__ */ r("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginTop: 4 }, children: i.attachments.map((
|
|
2456
|
+
!i.isDeleted && i.attachments && i.attachments.length > 0 && i.contentType !== "image" && /* @__PURE__ */ r("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginTop: 4 }, children: i.attachments.map((D) => /* @__PURE__ */ l(
|
|
2457
2457
|
"a",
|
|
2458
2458
|
{
|
|
2459
|
-
href:
|
|
2459
|
+
href: D.url,
|
|
2460
2460
|
target: "_blank",
|
|
2461
2461
|
rel: "noreferrer",
|
|
2462
2462
|
style: {
|
|
@@ -2473,18 +2473,18 @@ function Ye({
|
|
|
2473
2473
|
children: [
|
|
2474
2474
|
/* @__PURE__ */ r(S, { name: "paperclip", size: 14 }),
|
|
2475
2475
|
" ",
|
|
2476
|
-
|
|
2476
|
+
D.name
|
|
2477
2477
|
]
|
|
2478
2478
|
},
|
|
2479
|
-
|
|
2479
|
+
D.id
|
|
2480
2480
|
)) }),
|
|
2481
|
-
i.reactions && i.reactions.length > 0 && /* @__PURE__ */ r("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: i.reactions.map((
|
|
2481
|
+
i.reactions && i.reactions.length > 0 && /* @__PURE__ */ r("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: i.reactions.map((D) => /* @__PURE__ */ l(
|
|
2482
2482
|
"button",
|
|
2483
2483
|
{
|
|
2484
|
-
onClick: () => s(i.id,
|
|
2484
|
+
onClick: () => s(i.id, D.emoji),
|
|
2485
2485
|
style: {
|
|
2486
|
-
background:
|
|
2487
|
-
border:
|
|
2486
|
+
background: D.mine ? "var(--nice-accent-bg, #ede9fe)" : "var(--nice-bg-secondary, #f3f4f6)",
|
|
2487
|
+
border: D.mine ? "1px solid var(--nice-info, #6366f1)" : "1px solid transparent",
|
|
2488
2488
|
borderRadius: 12,
|
|
2489
2489
|
padding: "2px 7px",
|
|
2490
2490
|
fontSize: 12,
|
|
@@ -2494,12 +2494,12 @@ function Ye({
|
|
|
2494
2494
|
gap: 3
|
|
2495
2495
|
},
|
|
2496
2496
|
children: [
|
|
2497
|
-
|
|
2497
|
+
D.emoji,
|
|
2498
2498
|
" ",
|
|
2499
|
-
|
|
2499
|
+
D.count
|
|
2500
2500
|
]
|
|
2501
2501
|
},
|
|
2502
|
-
|
|
2502
|
+
D.emoji
|
|
2503
2503
|
)) }),
|
|
2504
2504
|
a && (i.threadCount ?? 0) > 0 && /* @__PURE__ */ l(
|
|
2505
2505
|
"button",
|
|
@@ -2529,7 +2529,7 @@ function Ye({
|
|
|
2529
2529
|
}
|
|
2530
2530
|
)
|
|
2531
2531
|
] }),
|
|
2532
|
-
|
|
2532
|
+
p && !i.isDeleted && /* @__PURE__ */ l(
|
|
2533
2533
|
"div",
|
|
2534
2534
|
{
|
|
2535
2535
|
style: {
|
|
@@ -2549,7 +2549,7 @@ function Ye({
|
|
|
2549
2549
|
/* @__PURE__ */ r(
|
|
2550
2550
|
"button",
|
|
2551
2551
|
{
|
|
2552
|
-
onClick: () => u((
|
|
2552
|
+
onClick: () => u((D) => !D),
|
|
2553
2553
|
title: "React",
|
|
2554
2554
|
"aria-label": "React",
|
|
2555
2555
|
style: {
|
|
@@ -2578,11 +2578,11 @@ function Ye({
|
|
|
2578
2578
|
padding: "6px 8px",
|
|
2579
2579
|
zIndex: 20
|
|
2580
2580
|
},
|
|
2581
|
-
children:
|
|
2581
|
+
children: Ht.map((D) => /* @__PURE__ */ r(
|
|
2582
2582
|
"button",
|
|
2583
2583
|
{
|
|
2584
2584
|
onClick: () => {
|
|
2585
|
-
s(i.id,
|
|
2585
|
+
s(i.id, D), u(!1);
|
|
2586
2586
|
},
|
|
2587
2587
|
style: {
|
|
2588
2588
|
background: "none",
|
|
@@ -2590,9 +2590,9 @@ function Ye({
|
|
|
2590
2590
|
cursor: "pointer",
|
|
2591
2591
|
fontSize: 18
|
|
2592
2592
|
},
|
|
2593
|
-
children:
|
|
2593
|
+
children: D
|
|
2594
2594
|
},
|
|
2595
|
-
|
|
2595
|
+
D
|
|
2596
2596
|
))
|
|
2597
2597
|
}
|
|
2598
2598
|
)
|
|
@@ -2638,7 +2638,7 @@ function Ye({
|
|
|
2638
2638
|
}
|
|
2639
2639
|
);
|
|
2640
2640
|
}
|
|
2641
|
-
function
|
|
2641
|
+
function Kt({
|
|
2642
2642
|
channel: i,
|
|
2643
2643
|
messages: e,
|
|
2644
2644
|
users: t,
|
|
@@ -2647,22 +2647,22 @@ function Bt({
|
|
|
2647
2647
|
isLoading: s = !1,
|
|
2648
2648
|
hasMore: o = !1,
|
|
2649
2649
|
enableThreads: c = !0,
|
|
2650
|
-
enableReactions:
|
|
2650
|
+
enableReactions: p = !0,
|
|
2651
2651
|
enableAttachments: f = !0,
|
|
2652
2652
|
onSendMessage: m,
|
|
2653
2653
|
onEditMessage: u,
|
|
2654
2654
|
onDeleteMessage: y,
|
|
2655
2655
|
onReactToMessage: h,
|
|
2656
2656
|
onPinMessage: x,
|
|
2657
|
-
onLoadMoreMessages:
|
|
2658
|
-
onStartCall:
|
|
2659
|
-
className:
|
|
2660
|
-
style:
|
|
2657
|
+
onLoadMoreMessages: P,
|
|
2658
|
+
onStartCall: d,
|
|
2659
|
+
className: D,
|
|
2660
|
+
style: A,
|
|
2661
2661
|
id: O,
|
|
2662
2662
|
"data-testid": U
|
|
2663
2663
|
}) {
|
|
2664
2664
|
var Y;
|
|
2665
|
-
const W = ce(null), H = ce(null), [q, _] =
|
|
2665
|
+
const W = ce(null), H = ce(null), [q, _] = N(""), [V, I] = N(null), [C, L] = N(null), G = Qe.useMemo(() => {
|
|
2666
2666
|
const g = /* @__PURE__ */ new Map();
|
|
2667
2667
|
return t.forEach((w) => g.set(w.id, w)), g;
|
|
2668
2668
|
}, [t]);
|
|
@@ -2670,27 +2670,27 @@ function Bt({
|
|
|
2670
2670
|
var g;
|
|
2671
2671
|
(g = W.current) == null || g.scrollIntoView({ behavior: "smooth" });
|
|
2672
2672
|
}, [e]);
|
|
2673
|
-
const E =
|
|
2673
|
+
const E = T(() => {
|
|
2674
2674
|
const g = H.current;
|
|
2675
|
-
!g || !o || s || g.scrollTop === 0 && e.length > 0 && (
|
|
2676
|
-
}, [o, s, e, i.id,
|
|
2675
|
+
!g || !o || s || g.scrollTop === 0 && e.length > 0 && (P == null || P(i.id, e[0].id));
|
|
2676
|
+
}, [o, s, e, i.id, P]), z = T(() => {
|
|
2677
2677
|
const g = q.trim();
|
|
2678
2678
|
g && (m == null || m(i.id, g, "text"), _(""), I(null));
|
|
2679
2679
|
}, [q, i.id, m]), j = (g) => {
|
|
2680
|
-
g.key === "Enter" && !g.shiftKey && (g.preventDefault(),
|
|
2680
|
+
g.key === "Enter" && !g.shiftKey && (g.preventDefault(), z());
|
|
2681
2681
|
}, K = t.filter((g) => g.presence.status === "online").length;
|
|
2682
2682
|
return /* @__PURE__ */ l(
|
|
2683
2683
|
"div",
|
|
2684
2684
|
{
|
|
2685
2685
|
id: O,
|
|
2686
2686
|
"data-testid": U,
|
|
2687
|
-
className: `nice-channel-view${
|
|
2687
|
+
className: `nice-channel-view${D ? ` ${D}` : ""}`,
|
|
2688
2688
|
style: {
|
|
2689
2689
|
display: "flex",
|
|
2690
2690
|
height: "100%",
|
|
2691
2691
|
background: "var(--nice-bg, #fff)",
|
|
2692
2692
|
overflow: "hidden",
|
|
2693
|
-
...
|
|
2693
|
+
...A
|
|
2694
2694
|
},
|
|
2695
2695
|
children: [
|
|
2696
2696
|
/* @__PURE__ */ l("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
@@ -2749,11 +2749,11 @@ function Bt({
|
|
|
2749
2749
|
K,
|
|
2750
2750
|
" online"
|
|
2751
2751
|
] }),
|
|
2752
|
-
|
|
2752
|
+
d && /* @__PURE__ */ l(fe, { children: [
|
|
2753
2753
|
/* @__PURE__ */ r(
|
|
2754
2754
|
"button",
|
|
2755
2755
|
{
|
|
2756
|
-
onClick: () =>
|
|
2756
|
+
onClick: () => d(
|
|
2757
2757
|
t.map((g) => g.id),
|
|
2758
2758
|
"audio"
|
|
2759
2759
|
),
|
|
@@ -2774,7 +2774,7 @@ function Bt({
|
|
|
2774
2774
|
/* @__PURE__ */ r(
|
|
2775
2775
|
"button",
|
|
2776
2776
|
{
|
|
2777
|
-
onClick: () =>
|
|
2777
|
+
onClick: () => d(
|
|
2778
2778
|
t.map((g) => g.id),
|
|
2779
2779
|
"video"
|
|
2780
2780
|
),
|
|
@@ -2807,7 +2807,7 @@ function Bt({
|
|
|
2807
2807
|
o && /* @__PURE__ */ r(
|
|
2808
2808
|
"button",
|
|
2809
2809
|
{
|
|
2810
|
-
onClick: () => e.length > 0 && (
|
|
2810
|
+
onClick: () => e.length > 0 && (P == null ? void 0 : P(i.id, e[0].id)),
|
|
2811
2811
|
disabled: s,
|
|
2812
2812
|
style: {
|
|
2813
2813
|
display: "block",
|
|
@@ -2829,7 +2829,7 @@ function Bt({
|
|
|
2829
2829
|
message: g,
|
|
2830
2830
|
author: G.get(g.authorId),
|
|
2831
2831
|
isMine: g.authorId === n.id,
|
|
2832
|
-
enableReactions:
|
|
2832
|
+
enableReactions: p,
|
|
2833
2833
|
enableThreads: c,
|
|
2834
2834
|
onReact: (w, Z) => h == null ? void 0 : h(w, Z),
|
|
2835
2835
|
onOpenThread: (w) => L(w),
|
|
@@ -2934,7 +2934,7 @@ function Bt({
|
|
|
2934
2934
|
/* @__PURE__ */ r(
|
|
2935
2935
|
"button",
|
|
2936
2936
|
{
|
|
2937
|
-
onClick:
|
|
2937
|
+
onClick: z,
|
|
2938
2938
|
disabled: !q.trim(),
|
|
2939
2939
|
title: "Send",
|
|
2940
2940
|
"aria-label": "Send",
|
|
@@ -3012,7 +3012,7 @@ function Bt({
|
|
|
3012
3012
|
message: C,
|
|
3013
3013
|
author: G.get(C.authorId),
|
|
3014
3014
|
isMine: C.authorId === n.id,
|
|
3015
|
-
enableReactions:
|
|
3015
|
+
enableReactions: p,
|
|
3016
3016
|
enableThreads: !1,
|
|
3017
3017
|
onReact: (g, w) => h == null ? void 0 : h(g, w),
|
|
3018
3018
|
onOpenThread: () => {
|
|
@@ -3043,7 +3043,7 @@ function Bt({
|
|
|
3043
3043
|
message: g,
|
|
3044
3044
|
author: G.get(g.authorId),
|
|
3045
3045
|
isMine: g.authorId === n.id,
|
|
3046
|
-
enableReactions:
|
|
3046
|
+
enableReactions: p,
|
|
3047
3047
|
enableThreads: !1,
|
|
3048
3048
|
onReact: (w, Z) => h == null ? void 0 : h(w, Z),
|
|
3049
3049
|
onOpenThread: () => {
|
|
@@ -3115,11 +3115,11 @@ function Ge({
|
|
|
3115
3115
|
onPin: n,
|
|
3116
3116
|
size: a = "medium"
|
|
3117
3117
|
}) {
|
|
3118
|
-
var
|
|
3118
|
+
var P;
|
|
3119
3119
|
const s = ce(null), {
|
|
3120
3120
|
user: o,
|
|
3121
3121
|
isMuted: c,
|
|
3122
|
-
isCameraOff:
|
|
3122
|
+
isCameraOff: p,
|
|
3123
3123
|
isScreenSharing: f,
|
|
3124
3124
|
isSpeaking: m,
|
|
3125
3125
|
isHandRaised: u,
|
|
@@ -3129,8 +3129,8 @@ function Ge({
|
|
|
3129
3129
|
return re(() => {
|
|
3130
3130
|
if (!s.current)
|
|
3131
3131
|
return;
|
|
3132
|
-
const
|
|
3133
|
-
|
|
3132
|
+
const d = f ? h : y;
|
|
3133
|
+
d && (s.current.srcObject = d);
|
|
3134
3134
|
}, [y, h, f]), /* @__PURE__ */ l(
|
|
3135
3135
|
"div",
|
|
3136
3136
|
{
|
|
@@ -3147,7 +3147,7 @@ function Ge({
|
|
|
3147
3147
|
aspectRatio: "16/9"
|
|
3148
3148
|
},
|
|
3149
3149
|
children: [
|
|
3150
|
-
!
|
|
3150
|
+
!p && !!y ? /* @__PURE__ */ r(
|
|
3151
3151
|
"video",
|
|
3152
3152
|
{
|
|
3153
3153
|
ref: s,
|
|
@@ -3177,7 +3177,7 @@ function Ge({
|
|
|
3177
3177
|
fontWeight: 700,
|
|
3178
3178
|
fontSize: a === "large" ? 28 : a === "small" ? 12 : 18
|
|
3179
3179
|
},
|
|
3180
|
-
children: !o.avatarUrl && ((
|
|
3180
|
+
children: !o.avatarUrl && ((P = o.name[0]) == null ? void 0 : P.toUpperCase())
|
|
3181
3181
|
}
|
|
3182
3182
|
),
|
|
3183
3183
|
a !== "small" && /* @__PURE__ */ r("span", { style: { color: "var(--nice-bg, #fff)", fontSize: 12 }, children: o.displayName ?? o.name })
|
|
@@ -3255,17 +3255,17 @@ function Ge({
|
|
|
3255
3255
|
gap: 2,
|
|
3256
3256
|
alignItems: "flex-end"
|
|
3257
3257
|
},
|
|
3258
|
-
children: [1, 2, 3].map((
|
|
3258
|
+
children: [1, 2, 3].map((d) => /* @__PURE__ */ r(
|
|
3259
3259
|
"div",
|
|
3260
3260
|
{
|
|
3261
3261
|
style: {
|
|
3262
3262
|
flex: 1,
|
|
3263
|
-
background: i.connectionQuality === "excellent" || i.connectionQuality === "good" &&
|
|
3264
|
-
height: `${
|
|
3263
|
+
background: i.connectionQuality === "excellent" || i.connectionQuality === "good" && d <= 2 || i.connectionQuality === "fair" && d <= 1 ? "var(--nice-success, #22c55e)" : "var(--nice-overlay-light-30, rgba(255, 255, 255, 0.3))",
|
|
3264
|
+
height: `${d * 30}%`,
|
|
3265
3265
|
borderRadius: 1
|
|
3266
3266
|
}
|
|
3267
3267
|
},
|
|
3268
|
-
|
|
3268
|
+
d
|
|
3269
3269
|
))
|
|
3270
3270
|
}
|
|
3271
3271
|
)
|
|
@@ -3282,31 +3282,31 @@ function St({
|
|
|
3282
3282
|
enableTranscription: s = !1,
|
|
3283
3283
|
enableRaiseHand: o = !0,
|
|
3284
3284
|
maxGridCols: c = 4,
|
|
3285
|
-
onEndCall:
|
|
3285
|
+
onEndCall: p,
|
|
3286
3286
|
onMuteAudio: f,
|
|
3287
3287
|
onMuteVideo: m,
|
|
3288
3288
|
onStartScreenShare: u,
|
|
3289
3289
|
onStopScreenShare: y,
|
|
3290
3290
|
onRaiseHand: h,
|
|
3291
3291
|
className: x,
|
|
3292
|
-
style:
|
|
3293
|
-
id:
|
|
3294
|
-
"data-testid":
|
|
3292
|
+
style: P,
|
|
3293
|
+
id: d,
|
|
3294
|
+
"data-testid": D
|
|
3295
3295
|
}) {
|
|
3296
|
-
const [
|
|
3296
|
+
const [A, O] = N(!1), [U, W] = N(!1), [H, q] = N(!1), [_, V] = N(!1), [I, C] = N(i.pinnedParticipantId ?? null), [L, G] = N(
|
|
3297
3297
|
i.layout === "sidebar" ? "grid" : i.layout ?? "grid"
|
|
3298
|
-
), [E,
|
|
3298
|
+
), [E, z] = N(0), [j, K] = N(!1);
|
|
3299
3299
|
re(() => {
|
|
3300
3300
|
if (i.status !== "active")
|
|
3301
3301
|
return;
|
|
3302
|
-
const B = setInterval(() =>
|
|
3302
|
+
const B = setInterval(() => z((ee) => ee + 1), 1e3);
|
|
3303
3303
|
return () => clearInterval(B);
|
|
3304
3304
|
}, [i.status]);
|
|
3305
3305
|
const Y = (B) => {
|
|
3306
3306
|
const ee = Math.floor(B / 3600), oe = Math.floor(B % 3600 / 60), de = B % 60;
|
|
3307
3307
|
return ee > 0 ? `${ee}:${String(oe).padStart(2, "0")}:${String(de).padStart(2, "0")}` : `${String(oe).padStart(2, "0")}:${String(de).padStart(2, "0")}`;
|
|
3308
3308
|
}, g = () => {
|
|
3309
|
-
const B = !
|
|
3309
|
+
const B = !A;
|
|
3310
3310
|
O(B), f == null || f(B);
|
|
3311
3311
|
}, w = () => {
|
|
3312
3312
|
const B = !U;
|
|
@@ -3319,7 +3319,7 @@ function St({
|
|
|
3319
3319
|
}, te = [
|
|
3320
3320
|
{
|
|
3321
3321
|
user: e,
|
|
3322
|
-
isMuted:
|
|
3322
|
+
isMuted: A,
|
|
3323
3323
|
isCameraOff: U,
|
|
3324
3324
|
isScreenSharing: H,
|
|
3325
3325
|
isSpeaking: !1,
|
|
@@ -3335,8 +3335,8 @@ function St({
|
|
|
3335
3335
|
return /* @__PURE__ */ l(
|
|
3336
3336
|
"div",
|
|
3337
3337
|
{
|
|
3338
|
-
id:
|
|
3339
|
-
"data-testid":
|
|
3338
|
+
id: d,
|
|
3339
|
+
"data-testid": D,
|
|
3340
3340
|
className: `nice-video-conference${x ? ` ${x}` : ""}`,
|
|
3341
3341
|
style: {
|
|
3342
3342
|
position: "relative",
|
|
@@ -3346,7 +3346,7 @@ function St({
|
|
|
3346
3346
|
display: "flex",
|
|
3347
3347
|
flexDirection: "column",
|
|
3348
3348
|
overflow: "hidden",
|
|
3349
|
-
...
|
|
3349
|
+
...P
|
|
3350
3350
|
},
|
|
3351
3351
|
children: [
|
|
3352
3352
|
/* @__PURE__ */ l(
|
|
@@ -3608,9 +3608,9 @@ function St({
|
|
|
3608
3608
|
Ie,
|
|
3609
3609
|
{
|
|
3610
3610
|
icon: "mic",
|
|
3611
|
-
label:
|
|
3611
|
+
label: A ? "Unmute" : "Mute",
|
|
3612
3612
|
onClick: g,
|
|
3613
|
-
danger:
|
|
3613
|
+
danger: A
|
|
3614
3614
|
}
|
|
3615
3615
|
),
|
|
3616
3616
|
/* @__PURE__ */ r(
|
|
@@ -3655,7 +3655,7 @@ function St({
|
|
|
3655
3655
|
active: i.isTranscribing
|
|
3656
3656
|
}
|
|
3657
3657
|
),
|
|
3658
|
-
/* @__PURE__ */ r(Ie, { icon: "phone", label: "Leave", onClick: () =>
|
|
3658
|
+
/* @__PURE__ */ r(Ie, { icon: "phone", label: "Leave", onClick: () => p == null ? void 0 : p(i.id), end: !0 })
|
|
3659
3659
|
]
|
|
3660
3660
|
}
|
|
3661
3661
|
)
|
|
@@ -3718,7 +3718,7 @@ function Je(i) {
|
|
|
3718
3718
|
};
|
|
3719
3719
|
return i.unit === "forever" ? e.forever : e[i.unit] * i.value;
|
|
3720
3720
|
}
|
|
3721
|
-
function
|
|
3721
|
+
function Ne(i, e = /* @__PURE__ */ new Date()) {
|
|
3722
3722
|
if (i.unit !== "forever")
|
|
3723
3723
|
return new Date(e.getTime() + Je(i));
|
|
3724
3724
|
}
|
|
@@ -3749,16 +3749,16 @@ class at {
|
|
|
3749
3749
|
return new Promise((n, a) => {
|
|
3750
3750
|
const c = t.transaction(this.storeName, "readonly").objectStore(this.storeName).get(e);
|
|
3751
3751
|
c.onsuccess = () => {
|
|
3752
|
-
const
|
|
3753
|
-
if (!
|
|
3752
|
+
const p = c.result;
|
|
3753
|
+
if (!p) {
|
|
3754
3754
|
n(void 0);
|
|
3755
3755
|
return;
|
|
3756
3756
|
}
|
|
3757
|
-
if (
|
|
3757
|
+
if (p.expiresAt && new Date(p.expiresAt) < /* @__PURE__ */ new Date()) {
|
|
3758
3758
|
this.delete(e), n(void 0);
|
|
3759
3759
|
return;
|
|
3760
3760
|
}
|
|
3761
|
-
n(
|
|
3761
|
+
n(p.data);
|
|
3762
3762
|
}, c.onerror = () => a(c.error);
|
|
3763
3763
|
});
|
|
3764
3764
|
}
|
|
@@ -3773,22 +3773,22 @@ class at {
|
|
|
3773
3773
|
const t = await this.openDb();
|
|
3774
3774
|
return new Promise((n, a) => {
|
|
3775
3775
|
const c = t.transaction(this.storeName, "readonly").objectStore(this.storeName).getAllKeys();
|
|
3776
|
-
c.onsuccess = () => n((c.result ?? []).filter((
|
|
3776
|
+
c.onsuccess = () => n((c.result ?? []).filter((p) => p.startsWith(e))), c.onerror = () => a(c.error);
|
|
3777
3777
|
});
|
|
3778
3778
|
}
|
|
3779
3779
|
async clear(e) {
|
|
3780
3780
|
if (!e) {
|
|
3781
3781
|
const n = await this.openDb();
|
|
3782
3782
|
return new Promise((a, s) => {
|
|
3783
|
-
const
|
|
3784
|
-
|
|
3783
|
+
const p = n.transaction(this.storeName, "readwrite").objectStore(this.storeName).clear();
|
|
3784
|
+
p.onsuccess = () => a(), p.onerror = () => s(p.error);
|
|
3785
3785
|
});
|
|
3786
3786
|
}
|
|
3787
3787
|
const t = await this.list(e);
|
|
3788
3788
|
await Promise.all(t.map((n) => this.delete(n)));
|
|
3789
3789
|
}
|
|
3790
3790
|
}
|
|
3791
|
-
class
|
|
3791
|
+
class Yt {
|
|
3792
3792
|
constructor(e = "nice_comm__") {
|
|
3793
3793
|
this.prefix = e;
|
|
3794
3794
|
}
|
|
@@ -3825,14 +3825,14 @@ class Ut {
|
|
|
3825
3825
|
(await this.list(e ?? "")).forEach((n) => localStorage.removeItem(this.prefix + n));
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
|
-
class
|
|
3828
|
+
class Gt {
|
|
3829
3829
|
constructor(e, t) {
|
|
3830
3830
|
this.config = e, this.encryption = t, this.adapter = this.buildAdapter();
|
|
3831
3831
|
}
|
|
3832
3832
|
buildAdapter() {
|
|
3833
3833
|
switch (this.config.provider) {
|
|
3834
3834
|
case "localstorage":
|
|
3835
|
-
return new
|
|
3835
|
+
return new Yt();
|
|
3836
3836
|
case "custom":
|
|
3837
3837
|
return this.config.customAdapter ?? new at();
|
|
3838
3838
|
default:
|
|
@@ -3867,7 +3867,7 @@ class Ht {
|
|
|
3867
3867
|
}
|
|
3868
3868
|
// ── Messages ──────────────────────────────────────────────────────────────
|
|
3869
3869
|
async saveMessages(e, t) {
|
|
3870
|
-
const n = this.getRuleFor("messages"), a = n ?
|
|
3870
|
+
const n = this.getRuleFor("messages"), a = n ? Ne(n.activePeriod) : void 0, s = await this.encode(t);
|
|
3871
3871
|
await this.adapter.save(`msg:${e}`, s, a);
|
|
3872
3872
|
}
|
|
3873
3873
|
async loadMessages(e) {
|
|
@@ -3883,7 +3883,7 @@ class Ht {
|
|
|
3883
3883
|
}
|
|
3884
3884
|
// ── Whiteboard snapshots ──────────────────────────────────────────────────
|
|
3885
3885
|
async saveWhiteboardSnapshot(e, t) {
|
|
3886
|
-
const n = this.getRuleFor("whiteboard-snapshots"), a = n ?
|
|
3886
|
+
const n = this.getRuleFor("whiteboard-snapshots"), a = n ? Ne(n.activePeriod) : void 0, s = await this.encode(t);
|
|
3887
3887
|
await this.adapter.save(`wb:${e}`, s, a);
|
|
3888
3888
|
}
|
|
3889
3889
|
async loadWhiteboardSnapshot(e) {
|
|
@@ -3892,7 +3892,7 @@ class Ht {
|
|
|
3892
3892
|
}
|
|
3893
3893
|
// ── Recordings ────────────────────────────────────────────────────────────
|
|
3894
3894
|
async saveRecordingMeta(e) {
|
|
3895
|
-
const t = this.getRuleFor("recordings"), n = t ?
|
|
3895
|
+
const t = this.getRuleFor("recordings"), n = t ? Ne(t.activePeriod) : void 0, a = await this.encode(e);
|
|
3896
3896
|
await this.adapter.save(`rec:${e.id}`, a, n);
|
|
3897
3897
|
}
|
|
3898
3898
|
async loadRecordingMeta(e) {
|
|
@@ -3908,7 +3908,7 @@ class Ht {
|
|
|
3908
3908
|
}
|
|
3909
3909
|
// ── Documents (arbitrary JSON docs) ──────────────────────────────────────
|
|
3910
3910
|
async saveDocument(e, t) {
|
|
3911
|
-
const n = this.getRuleFor("documents"), a = n ?
|
|
3911
|
+
const n = this.getRuleFor("documents"), a = n ? Ne(n.activePeriod) : void 0, s = await this.encode(t);
|
|
3912
3912
|
await this.adapter.save(`doc:${e}`, s, a);
|
|
3913
3913
|
}
|
|
3914
3914
|
async loadDocument(e) {
|
|
@@ -3932,12 +3932,12 @@ class Ht {
|
|
|
3932
3932
|
const c = this.getRuleFor(o);
|
|
3933
3933
|
if (!c)
|
|
3934
3934
|
continue;
|
|
3935
|
-
const
|
|
3936
|
-
for (const f of
|
|
3935
|
+
const p = await this.adapter.list(s);
|
|
3936
|
+
for (const f of p) {
|
|
3937
3937
|
const m = await this.adapter.load(f);
|
|
3938
3938
|
if (m) {
|
|
3939
3939
|
if (Je(c.activePeriod), c.archivePeriod) {
|
|
3940
|
-
const u = `archive:${f}`, y =
|
|
3940
|
+
const u = `archive:${f}`, y = Ne(c.archivePeriod, n);
|
|
3941
3941
|
await this.adapter.save(u, m, y), e++;
|
|
3942
3942
|
}
|
|
3943
3943
|
if (c.deleteAfterArchive && c.archivePeriod) {
|
|
@@ -4016,10 +4016,10 @@ const kt = [
|
|
|
4016
4016
|
legalHoldEnabled: !0
|
|
4017
4017
|
}
|
|
4018
4018
|
], Fe = /* @__PURE__ */ new Map();
|
|
4019
|
-
function
|
|
4020
|
-
return Fe.has(i) || Fe.set(i, new
|
|
4019
|
+
function qt(i, e, t) {
|
|
4020
|
+
return Fe.has(i) || Fe.set(i, new Gt(e, t)), Fe.get(i);
|
|
4021
4021
|
}
|
|
4022
|
-
function
|
|
4022
|
+
function ri(i) {
|
|
4023
4023
|
Fe.delete(i);
|
|
4024
4024
|
}
|
|
4025
4025
|
const st = [
|
|
@@ -4034,7 +4034,7 @@ const st = [
|
|
|
4034
4034
|
"var(--nice-warning-dark, #795548)",
|
|
4035
4035
|
"var(--nice-text-secondary, #607d8b)"
|
|
4036
4036
|
];
|
|
4037
|
-
function
|
|
4037
|
+
function Vt(i) {
|
|
4038
4038
|
let e = 0;
|
|
4039
4039
|
for (let t = 0; t < i.length; t++)
|
|
4040
4040
|
e = e * 31 + i.charCodeAt(t) >>> 0;
|
|
@@ -4082,7 +4082,7 @@ function ot(i, e, t) {
|
|
|
4082
4082
|
}
|
|
4083
4083
|
return { objects: n, layers: a };
|
|
4084
4084
|
}
|
|
4085
|
-
function
|
|
4085
|
+
function Xt(i, e) {
|
|
4086
4086
|
switch (e.type) {
|
|
4087
4087
|
case "LOAD_SESSION":
|
|
4088
4088
|
return {
|
|
@@ -4100,7 +4100,7 @@ function Gt(i, e) {
|
|
|
4100
4100
|
objects: a,
|
|
4101
4101
|
layers: s,
|
|
4102
4102
|
updatedAt: t.timestamp
|
|
4103
|
-
},
|
|
4103
|
+
}, p = n && [
|
|
4104
4104
|
"object:add",
|
|
4105
4105
|
"object:update",
|
|
4106
4106
|
"object:delete",
|
|
@@ -4112,7 +4112,7 @@ function Gt(i, e) {
|
|
|
4112
4112
|
return {
|
|
4113
4113
|
...i,
|
|
4114
4114
|
session: o,
|
|
4115
|
-
undoStack:
|
|
4115
|
+
undoStack: p,
|
|
4116
4116
|
redoStack: n ? [] : i.redoStack,
|
|
4117
4117
|
// clear redo on new local op
|
|
4118
4118
|
isDirty: !0
|
|
@@ -4184,7 +4184,7 @@ function Gt(i, e) {
|
|
|
4184
4184
|
return i;
|
|
4185
4185
|
}
|
|
4186
4186
|
}
|
|
4187
|
-
function
|
|
4187
|
+
function Jt(i) {
|
|
4188
4188
|
const {
|
|
4189
4189
|
session: e,
|
|
4190
4190
|
currentUser: t,
|
|
@@ -4193,7 +4193,7 @@ function qt(i) {
|
|
|
4193
4193
|
readonly: s = !1,
|
|
4194
4194
|
storageConfig: o,
|
|
4195
4195
|
autoSaveMs: c = 3e4
|
|
4196
|
-
} = i, [
|
|
4196
|
+
} = i, [p, f] = Et(Xt, {
|
|
4197
4197
|
session: e,
|
|
4198
4198
|
activeTool: s ? "select" : "pen",
|
|
4199
4199
|
selectedObjectIds: [],
|
|
@@ -4204,140 +4204,140 @@ function qt(i) {
|
|
|
4204
4204
|
isDirty: !1
|
|
4205
4205
|
}), m = ce(0), u = ce(null), y = ce(null);
|
|
4206
4206
|
re(() => {
|
|
4207
|
-
o && (y.current =
|
|
4208
|
-
|
|
4207
|
+
o && (y.current = qt(`wb_${e.id}`, o), y.current.loadWhiteboardSnapshot(e.id).then((z) => {
|
|
4208
|
+
z && f({ type: "LOAD_SESSION", session: z });
|
|
4209
4209
|
}));
|
|
4210
4210
|
}, [e.id, o]), re(() => {
|
|
4211
|
-
if (!c || !y.current || !
|
|
4211
|
+
if (!c || !y.current || !p.isDirty)
|
|
4212
4212
|
return;
|
|
4213
|
-
const
|
|
4213
|
+
const z = setTimeout(() => {
|
|
4214
4214
|
var j;
|
|
4215
|
-
(j = y.current) == null || j.saveWhiteboardSnapshot(
|
|
4215
|
+
(j = y.current) == null || j.saveWhiteboardSnapshot(p.session.id, p.session).then(() => {
|
|
4216
4216
|
f({ type: "MARK_SAVED" });
|
|
4217
4217
|
});
|
|
4218
4218
|
}, c);
|
|
4219
|
-
return () => clearTimeout(
|
|
4220
|
-
}, [
|
|
4219
|
+
return () => clearTimeout(z);
|
|
4220
|
+
}, [p.isDirty, p.session, c]);
|
|
4221
4221
|
const h = ce(/* @__PURE__ */ new Set());
|
|
4222
4222
|
re(() => {
|
|
4223
|
-
for (const
|
|
4224
|
-
if (!h.current.has(
|
|
4225
|
-
if (h.current.add(
|
|
4226
|
-
const { x: j, y: K } =
|
|
4227
|
-
f({ type: "UPDATE_CURSOR", userId:
|
|
4228
|
-
} else
|
|
4223
|
+
for (const z of a)
|
|
4224
|
+
if (!h.current.has(z.id) && z.userId !== t.id)
|
|
4225
|
+
if (h.current.add(z.id), z.type === "cursor:move") {
|
|
4226
|
+
const { x: j, y: K } = z.payload;
|
|
4227
|
+
f({ type: "UPDATE_CURSOR", userId: z.userId, x: j, y: K });
|
|
4228
|
+
} else z.type === "viewport:sync" || f({ type: "APPLY_OP", op: z, local: !1 });
|
|
4229
4229
|
}, [a, t.id]);
|
|
4230
|
-
function x(
|
|
4230
|
+
function x(z, j) {
|
|
4231
4231
|
return {
|
|
4232
4232
|
id: `${t.id}_${++m.current}_${Date.now()}`,
|
|
4233
|
-
sessionId:
|
|
4234
|
-
type:
|
|
4233
|
+
sessionId: p.session.id,
|
|
4234
|
+
type: z,
|
|
4235
4235
|
userId: t.id,
|
|
4236
4236
|
timestamp: /* @__PURE__ */ new Date(),
|
|
4237
4237
|
payload: j
|
|
4238
4238
|
};
|
|
4239
4239
|
}
|
|
4240
|
-
const
|
|
4241
|
-
(
|
|
4242
|
-
s || f({ type: "SET_TOOL", tool:
|
|
4240
|
+
const P = T(
|
|
4241
|
+
(z) => {
|
|
4242
|
+
s || f({ type: "SET_TOOL", tool: z });
|
|
4243
4243
|
},
|
|
4244
4244
|
[s]
|
|
4245
|
-
),
|
|
4246
|
-
(
|
|
4245
|
+
), d = T(
|
|
4246
|
+
(z) => {
|
|
4247
4247
|
if (s)
|
|
4248
4248
|
return;
|
|
4249
|
-
const j = x("object:add",
|
|
4249
|
+
const j = x("object:add", z);
|
|
4250
4250
|
f({ type: "APPLY_OP", op: j, local: !0 }), n == null || n(j);
|
|
4251
4251
|
},
|
|
4252
|
-
[s, n,
|
|
4253
|
-
),
|
|
4254
|
-
(
|
|
4252
|
+
[s, n, p.session.id]
|
|
4253
|
+
), D = T(
|
|
4254
|
+
(z) => {
|
|
4255
4255
|
if (s)
|
|
4256
4256
|
return;
|
|
4257
|
-
const j = x("object:update",
|
|
4257
|
+
const j = x("object:update", z);
|
|
4258
4258
|
f({ type: "APPLY_OP", op: j, local: !0 }), n == null || n(j);
|
|
4259
4259
|
},
|
|
4260
|
-
[s, n,
|
|
4261
|
-
),
|
|
4262
|
-
(
|
|
4260
|
+
[s, n, p.session.id]
|
|
4261
|
+
), A = T(
|
|
4262
|
+
(z) => {
|
|
4263
4263
|
if (!s) {
|
|
4264
|
-
for (const j of
|
|
4264
|
+
for (const j of z) {
|
|
4265
4265
|
const K = x("object:delete", { id: j });
|
|
4266
4266
|
f({ type: "APPLY_OP", op: K, local: !0 }), n == null || n(K);
|
|
4267
4267
|
}
|
|
4268
4268
|
f({ type: "SET_SELECTION", ids: [] });
|
|
4269
4269
|
}
|
|
4270
4270
|
},
|
|
4271
|
-
[s, n,
|
|
4272
|
-
), O =
|
|
4273
|
-
(
|
|
4271
|
+
[s, n, p.session.id]
|
|
4272
|
+
), O = T(
|
|
4273
|
+
(z) => {
|
|
4274
4274
|
if (!s)
|
|
4275
|
-
for (const { id: j, x: K, y: Y } of
|
|
4275
|
+
for (const { id: j, x: K, y: Y } of z) {
|
|
4276
4276
|
const g = x("object:move", { id: j, x: K, y: Y });
|
|
4277
4277
|
f({ type: "APPLY_OP", op: g, local: !0 }), n == null || n(g);
|
|
4278
4278
|
}
|
|
4279
4279
|
},
|
|
4280
|
-
[s, n,
|
|
4281
|
-
), U =
|
|
4282
|
-
f({ type: "SET_SELECTION", ids:
|
|
4283
|
-
}, []), W =
|
|
4280
|
+
[s, n, p.session.id]
|
|
4281
|
+
), U = T((z) => {
|
|
4282
|
+
f({ type: "SET_SELECTION", ids: z });
|
|
4283
|
+
}, []), W = T(() => {
|
|
4284
4284
|
s || f({ type: "UNDO" });
|
|
4285
|
-
}, [s]), H =
|
|
4285
|
+
}, [s]), H = T(() => {
|
|
4286
4286
|
s || f({ type: "REDO" });
|
|
4287
|
-
}, [s]), q =
|
|
4288
|
-
(
|
|
4289
|
-
f({ type: "SET_VIEWPORT", viewport:
|
|
4290
|
-
const j = x("viewport:sync",
|
|
4287
|
+
}, [s]), q = T(
|
|
4288
|
+
(z) => {
|
|
4289
|
+
f({ type: "SET_VIEWPORT", viewport: z });
|
|
4290
|
+
const j = x("viewport:sync", z);
|
|
4291
4291
|
n == null || n(j);
|
|
4292
4292
|
},
|
|
4293
|
-
[n,
|
|
4294
|
-
), _ =
|
|
4295
|
-
(
|
|
4293
|
+
[n, p.session.id]
|
|
4294
|
+
), _ = T(
|
|
4295
|
+
(z, j) => {
|
|
4296
4296
|
if (u.current)
|
|
4297
4297
|
return;
|
|
4298
4298
|
u.current = setTimeout(() => {
|
|
4299
4299
|
u.current = null;
|
|
4300
4300
|
}, 50);
|
|
4301
|
-
const K = x("cursor:move", { x:
|
|
4301
|
+
const K = x("cursor:move", { x: z, y: j });
|
|
4302
4302
|
n == null || n(K);
|
|
4303
4303
|
},
|
|
4304
|
-
[n,
|
|
4305
|
-
), V =
|
|
4306
|
-
(
|
|
4304
|
+
[n, p.session.id]
|
|
4305
|
+
), V = T(
|
|
4306
|
+
(z) => {
|
|
4307
4307
|
if (s)
|
|
4308
4308
|
return;
|
|
4309
4309
|
const j = {
|
|
4310
4310
|
id: `layer_${Date.now()}`,
|
|
4311
|
-
name:
|
|
4311
|
+
name: z,
|
|
4312
4312
|
visible: !0,
|
|
4313
4313
|
locked: !1,
|
|
4314
4314
|
objectIds: []
|
|
4315
4315
|
}, K = x("layer:add", j);
|
|
4316
4316
|
f({ type: "APPLY_OP", op: K, local: !0 }), n == null || n(K);
|
|
4317
4317
|
},
|
|
4318
|
-
[s, n,
|
|
4319
|
-
), I =
|
|
4320
|
-
(
|
|
4318
|
+
[s, n, p.session.id]
|
|
4319
|
+
), I = T(
|
|
4320
|
+
(z) => {
|
|
4321
4321
|
if (s)
|
|
4322
4322
|
return;
|
|
4323
|
-
const j = x("layer:update",
|
|
4323
|
+
const j = x("layer:update", z);
|
|
4324
4324
|
f({ type: "APPLY_OP", op: j, local: !0 }), n == null || n(j);
|
|
4325
4325
|
},
|
|
4326
|
-
[s, n,
|
|
4327
|
-
), C =
|
|
4328
|
-
(
|
|
4326
|
+
[s, n, p.session.id]
|
|
4327
|
+
), C = T(
|
|
4328
|
+
(z) => {
|
|
4329
4329
|
if (s)
|
|
4330
4330
|
return;
|
|
4331
|
-
const j = x("layer:delete", { id:
|
|
4331
|
+
const j = x("layer:delete", { id: z });
|
|
4332
4332
|
f({ type: "APPLY_OP", op: j, local: !0 }), n == null || n(j);
|
|
4333
4333
|
},
|
|
4334
|
-
[s, n,
|
|
4335
|
-
), L =
|
|
4334
|
+
[s, n, p.session.id]
|
|
4335
|
+
), L = T((z) => {
|
|
4336
4336
|
const j = {
|
|
4337
|
-
user:
|
|
4337
|
+
user: z,
|
|
4338
4338
|
cursorX: 0,
|
|
4339
4339
|
cursorY: 0,
|
|
4340
|
-
color:
|
|
4340
|
+
color: Vt(z.id),
|
|
4341
4341
|
selectedObjectIds: [],
|
|
4342
4342
|
activeTool: "pen",
|
|
4343
4343
|
lastSeenAt: /* @__PURE__ */ new Date()
|
|
@@ -4347,31 +4347,31 @@ function qt(i) {
|
|
|
4347
4347
|
op: x("cursor:move", j),
|
|
4348
4348
|
local: !1
|
|
4349
4349
|
});
|
|
4350
|
-
}, []), G =
|
|
4351
|
-
f({ type: "REMOVE_COLLABORATOR", userId:
|
|
4352
|
-
}, []), E =
|
|
4353
|
-
y.current && (await y.current.saveWhiteboardSnapshot(
|
|
4354
|
-
}, [
|
|
4350
|
+
}, []), G = T((z) => {
|
|
4351
|
+
f({ type: "REMOVE_COLLABORATOR", userId: z });
|
|
4352
|
+
}, []), E = T(async () => {
|
|
4353
|
+
y.current && (await y.current.saveWhiteboardSnapshot(p.session.id, p.session), f({ type: "MARK_SAVED" }));
|
|
4354
|
+
}, [p.session]);
|
|
4355
4355
|
return {
|
|
4356
4356
|
// State
|
|
4357
|
-
session:
|
|
4358
|
-
activeTool:
|
|
4359
|
-
selectedObjectIds:
|
|
4360
|
-
isDrawing:
|
|
4361
|
-
isPanning:
|
|
4362
|
-
isDirty:
|
|
4363
|
-
lastSavedAt:
|
|
4364
|
-
canUndo:
|
|
4365
|
-
canRedo:
|
|
4366
|
-
collaborators: Object.values(
|
|
4367
|
-
objects: Object.values(
|
|
4368
|
-
layers:
|
|
4369
|
-
viewport:
|
|
4357
|
+
session: p.session,
|
|
4358
|
+
activeTool: p.activeTool,
|
|
4359
|
+
selectedObjectIds: p.selectedObjectIds,
|
|
4360
|
+
isDrawing: p.isDrawing,
|
|
4361
|
+
isPanning: p.isPanning,
|
|
4362
|
+
isDirty: p.isDirty,
|
|
4363
|
+
lastSavedAt: p.lastSavedAt,
|
|
4364
|
+
canUndo: p.undoStack.length > 0,
|
|
4365
|
+
canRedo: p.redoStack.length > 0,
|
|
4366
|
+
collaborators: Object.values(p.session.collaborators),
|
|
4367
|
+
objects: Object.values(p.session.objects),
|
|
4368
|
+
layers: p.session.layers,
|
|
4369
|
+
viewport: p.session.viewport,
|
|
4370
4370
|
// Actions
|
|
4371
|
-
setTool:
|
|
4372
|
-
addObject:
|
|
4373
|
-
updateObject:
|
|
4374
|
-
deleteObjects:
|
|
4371
|
+
setTool: P,
|
|
4372
|
+
addObject: d,
|
|
4373
|
+
updateObject: D,
|
|
4374
|
+
deleteObjects: A,
|
|
4375
4375
|
moveObjects: O,
|
|
4376
4376
|
setSelection: U,
|
|
4377
4377
|
undo: W,
|
|
@@ -4386,7 +4386,7 @@ function qt(i) {
|
|
|
4386
4386
|
saveNow: E
|
|
4387
4387
|
};
|
|
4388
4388
|
}
|
|
4389
|
-
const
|
|
4389
|
+
const Qt = [
|
|
4390
4390
|
{ id: "select", label: "Select", icon: "cursor", group: "select" },
|
|
4391
4391
|
{ id: "laser", label: "Laser", icon: "circle", group: "select" },
|
|
4392
4392
|
{ id: "pen", label: "Pen", icon: "pen", group: "draw" },
|
|
@@ -4408,13 +4408,13 @@ function We() {
|
|
|
4408
4408
|
function qe(i, e, t) {
|
|
4409
4409
|
return { sx: i * t.scale + t.x, sy: e * t.scale + t.y };
|
|
4410
4410
|
}
|
|
4411
|
-
function
|
|
4411
|
+
function Zt(i, e, t) {
|
|
4412
4412
|
return { wx: (i - t.x) / t.scale, wy: (e - t.y) / t.scale };
|
|
4413
4413
|
}
|
|
4414
|
-
function
|
|
4414
|
+
function en(i, e) {
|
|
4415
4415
|
return Math.hypot(e.x - i.x, e.y - i.y);
|
|
4416
4416
|
}
|
|
4417
|
-
function
|
|
4417
|
+
function tn(i, e) {
|
|
4418
4418
|
if (!(e.points.length < 2)) {
|
|
4419
4419
|
i.save(), i.globalAlpha = e.opacity, i.strokeStyle = e.color, i.lineWidth = e.strokeWidth, i.lineCap = "round", i.lineJoin = "round", e.tool === "highlighter" && (i.globalCompositeOperation = "multiply"), i.beginPath(), i.moveTo(e.points[0].x, e.points[0].y);
|
|
4420
4420
|
for (let t = 1; t < e.points.length; t++) {
|
|
@@ -4427,7 +4427,7 @@ function Qt(i, e) {
|
|
|
4427
4427
|
i.stroke(), i.restore();
|
|
4428
4428
|
}
|
|
4429
4429
|
}
|
|
4430
|
-
function
|
|
4430
|
+
function nn(i, e) {
|
|
4431
4431
|
switch (i.save(), i.globalAlpha = e.opacity, i.strokeStyle = e.strokeColor, i.lineWidth = e.strokeWidth, e.fillColor && (i.fillStyle = e.fillColor), i.translate(e.x + e.width / 2, e.y + e.height / 2), i.rotate(e.rotation * Math.PI / 180), i.beginPath(), e.shape) {
|
|
4432
4432
|
case "rect":
|
|
4433
4433
|
i.rect(-e.width / 2, -e.height / 2, e.width, e.height);
|
|
@@ -4448,7 +4448,7 @@ function Zt(i, e) {
|
|
|
4448
4448
|
}
|
|
4449
4449
|
e.fillColor && i.fill(), i.stroke(), i.restore();
|
|
4450
4450
|
}
|
|
4451
|
-
function
|
|
4451
|
+
function rn(i, e) {
|
|
4452
4452
|
if (i.save(), i.translate(e.x + e.width / 2, e.y + e.height / 2), i.rotate(e.rotation * Math.PI / 180), i.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, i.fillStyle = e.color, i.textAlign = e.textAlign, i.textBaseline = "middle", e.backgroundColor) {
|
|
4453
4453
|
const t = i.measureText(e.text), n = 4;
|
|
4454
4454
|
i.fillStyle = e.backgroundColor, i.fillRect(
|
|
@@ -4460,17 +4460,17 @@ function en(i, e) {
|
|
|
4460
4460
|
}
|
|
4461
4461
|
i.fillText(e.text, 0, 0), i.restore();
|
|
4462
4462
|
}
|
|
4463
|
-
function
|
|
4463
|
+
function an(i, e) {
|
|
4464
4464
|
i.save(), i.translate(e.x, e.y), i.rotate(e.rotation * Math.PI / 180), i.shadowColor = "var(--nice-overlay-15, rgba(0, 0, 0, 0.15))", i.shadowBlur = 8, i.shadowOffsetY = 3, i.fillStyle = e.backgroundColor, i.fillRect(0, 0, e.width, e.height), i.shadowColor = "transparent", i.fillStyle = e.textColor, i.font = `${e.fontSize}px sans-serif`, i.textAlign = "left", i.textBaseline = "top";
|
|
4465
4465
|
const t = 10, n = e.width - t * 2, a = e.fontSize * 1.4, s = e.text.split(" ");
|
|
4466
4466
|
let o = "", c = t;
|
|
4467
|
-
for (const
|
|
4468
|
-
const f = o ? `${o} ${
|
|
4469
|
-
i.measureText(f).width > n && o ? (i.fillText(o, t, c), o =
|
|
4467
|
+
for (const p of s) {
|
|
4468
|
+
const f = o ? `${o} ${p}` : p;
|
|
4469
|
+
i.measureText(f).width > n && o ? (i.fillText(o, t, c), o = p, c += a) : o = f;
|
|
4470
4470
|
}
|
|
4471
4471
|
o && i.fillText(o, t, c), i.restore();
|
|
4472
4472
|
}
|
|
4473
|
-
function
|
|
4473
|
+
function sn(i, e) {
|
|
4474
4474
|
if (!(e.points.length < 2)) {
|
|
4475
4475
|
if (i.save(), i.strokeStyle = e.strokeColor, i.lineWidth = e.strokeWidth, i.lineCap = "round", i.beginPath(), i.moveTo(e.points[0].x, e.points[0].y), e.curved && e.points.length > 2) {
|
|
4476
4476
|
for (let t = 1; t < e.points.length - 1; t++) {
|
|
@@ -4497,24 +4497,24 @@ function nn(i, e) {
|
|
|
4497
4497
|
i.restore();
|
|
4498
4498
|
}
|
|
4499
4499
|
}
|
|
4500
|
-
function
|
|
4500
|
+
function on(i, e) {
|
|
4501
4501
|
i.save(), i.strokeStyle = e.borderColor ?? "var(--nice-text-muted, #aaa)", i.lineWidth = 2, i.setLineDash([8, 4]), e.backgroundColor && (i.fillStyle = e.backgroundColor, i.fillRect(e.x, e.y, e.width, e.height)), i.strokeRect(e.x, e.y, e.width, e.height), i.setLineDash([]), i.fillStyle = "var(--nice-text-secondary, #555)", i.font = "bold 13px sans-serif", i.fillText(e.name, e.x + 8, e.y - 6), i.restore();
|
|
4502
4502
|
}
|
|
4503
|
-
function
|
|
4503
|
+
function ln(i, e) {
|
|
4504
4504
|
if (e.visible)
|
|
4505
4505
|
switch (e.type) {
|
|
4506
4506
|
case "stroke":
|
|
4507
|
-
return
|
|
4507
|
+
return tn(i, e);
|
|
4508
4508
|
case "shape":
|
|
4509
|
-
return
|
|
4509
|
+
return nn(i, e);
|
|
4510
4510
|
case "text":
|
|
4511
|
-
return
|
|
4511
|
+
return rn(i, e);
|
|
4512
4512
|
case "sticky":
|
|
4513
|
-
return
|
|
4513
|
+
return an(i, e);
|
|
4514
4514
|
case "connector":
|
|
4515
|
-
return
|
|
4515
|
+
return sn(i, e);
|
|
4516
4516
|
case "frame":
|
|
4517
|
-
return
|
|
4517
|
+
return on(i, e);
|
|
4518
4518
|
case "image": {
|
|
4519
4519
|
const t = e, n = new Image();
|
|
4520
4520
|
n.src = t.dataUrl ?? t.url, i.save(), i.translate(t.x + t.width / 2, t.y + t.height / 2), i.rotate(t.rotation * Math.PI / 180), i.drawImage(n, -t.width / 2, -t.height / 2, t.width, t.height), i.restore();
|
|
@@ -4522,7 +4522,11 @@ function an(i, e) {
|
|
|
4522
4522
|
}
|
|
4523
4523
|
}
|
|
4524
4524
|
}
|
|
4525
|
-
function Ct({
|
|
4525
|
+
function Ct(i) {
|
|
4526
|
+
const { t: e } = Rt();
|
|
4527
|
+
return i.session ? /* @__PURE__ */ r(cn, { ...i, session: i.session }) : /* @__PURE__ */ r("div", { className: i.className, style: i.style, "data-testid": i["data-testid"], children: /* @__PURE__ */ r(At, { title: e("whiteboard.noSession", "No whiteboard session") }) });
|
|
4528
|
+
}
|
|
4529
|
+
function cn({
|
|
4526
4530
|
session: i,
|
|
4527
4531
|
currentUser: e,
|
|
4528
4532
|
onOperation: t,
|
|
@@ -4531,16 +4535,16 @@ function Ct({
|
|
|
4531
4535
|
enableLayers: s = !0,
|
|
4532
4536
|
enableExport: o = !0,
|
|
4533
4537
|
enableLaserPointer: c = !0,
|
|
4534
|
-
enableVectorEditor:
|
|
4538
|
+
enableVectorEditor: p = !1,
|
|
4535
4539
|
enableDiagramEditor: f = !1,
|
|
4536
4540
|
onExport: m,
|
|
4537
4541
|
onSessionUpdate: u,
|
|
4538
4542
|
storageConfig: y,
|
|
4539
4543
|
className: h,
|
|
4540
4544
|
style: x,
|
|
4541
|
-
"data-testid":
|
|
4545
|
+
"data-testid": P
|
|
4542
4546
|
}) {
|
|
4543
|
-
const
|
|
4547
|
+
const d = Jt({
|
|
4544
4548
|
session: i,
|
|
4545
4549
|
currentUser: e,
|
|
4546
4550
|
onOperation: t,
|
|
@@ -4548,9 +4552,9 @@ function Ct({
|
|
|
4548
4552
|
readonly: a,
|
|
4549
4553
|
storageConfig: y,
|
|
4550
4554
|
autoSaveMs: 3e4
|
|
4551
|
-
}),
|
|
4555
|
+
}), D = ce(null);
|
|
4552
4556
|
ce(null);
|
|
4553
|
-
const
|
|
4557
|
+
const A = ce(0), [O, U] = N(!1), [W, H] = N("var(--nice-bg, #1a1a1a)"), [q, _] = N(3), [V, I] = N(void 0), [C, L] = N(18), [G, E] = N("var(--nice-warning-bg, #fef08a)"), [z, j] = N(null), [K, Y] = N(
|
|
4554
4558
|
null
|
|
4555
4559
|
), g = ce({
|
|
4556
4560
|
active: !1,
|
|
@@ -4561,63 +4565,63 @@ function Ct({
|
|
|
4561
4565
|
spaceDown: !1,
|
|
4562
4566
|
panStart: null,
|
|
4563
4567
|
laserPoints: []
|
|
4564
|
-
}), w =
|
|
4568
|
+
}), w = T(
|
|
4565
4569
|
(b, v, M, F) => {
|
|
4566
|
-
if (!
|
|
4570
|
+
if (!d.session.gridEnabled)
|
|
4567
4571
|
return;
|
|
4568
|
-
const
|
|
4572
|
+
const $ = d.session.gridSize * v.scale, J = (v.x % $ + $) % $, k = (v.y % $ + $) % $;
|
|
4569
4573
|
b.strokeStyle = "rgba(180,180,200,0.35)", b.lineWidth = 1, b.beginPath();
|
|
4570
|
-
for (let R = J; R < M; R +=
|
|
4574
|
+
for (let R = J; R < M; R += $)
|
|
4571
4575
|
b.moveTo(R, 0), b.lineTo(R, F);
|
|
4572
|
-
for (let R = k; R < F; R +=
|
|
4576
|
+
for (let R = k; R < F; R += $)
|
|
4573
4577
|
b.moveTo(0, R), b.lineTo(M, R);
|
|
4574
4578
|
b.stroke();
|
|
4575
4579
|
},
|
|
4576
|
-
[
|
|
4577
|
-
), Z =
|
|
4580
|
+
[d.session.gridEnabled, d.session.gridSize]
|
|
4581
|
+
), Z = T(
|
|
4578
4582
|
(b, v) => {
|
|
4579
|
-
for (const M of
|
|
4583
|
+
for (const M of d.collaborators) {
|
|
4580
4584
|
if (M.user.id === e.id)
|
|
4581
4585
|
continue;
|
|
4582
|
-
const { sx: F, sy:
|
|
4583
|
-
b.save(), b.fillStyle = M.color, b.beginPath(), b.moveTo(F,
|
|
4586
|
+
const { sx: F, sy: $ } = qe(M.cursorX, M.cursorY, v);
|
|
4587
|
+
b.save(), b.fillStyle = M.color, b.beginPath(), b.moveTo(F, $), b.lineTo(F + 14, $ + 5), b.lineTo(F + 5, $ + 14), b.closePath(), b.fill(), b.fillStyle = M.color, b.font = "bold 11px sans-serif", b.fillText(M.user.name, F + 16, $ + 14), b.restore();
|
|
4584
4588
|
}
|
|
4585
4589
|
},
|
|
4586
|
-
[
|
|
4587
|
-
), Q =
|
|
4590
|
+
[d.collaborators, e.id]
|
|
4591
|
+
), Q = T(
|
|
4588
4592
|
(b, v) => {
|
|
4589
|
-
if (
|
|
4590
|
-
for (const M of
|
|
4591
|
-
const F =
|
|
4593
|
+
if (d.selectedObjectIds.length !== 0)
|
|
4594
|
+
for (const M of d.selectedObjectIds) {
|
|
4595
|
+
const F = d.session.objects[M];
|
|
4592
4596
|
if (!F)
|
|
4593
4597
|
continue;
|
|
4594
|
-
const { sx:
|
|
4595
|
-
b.strokeStyle = "var(--nice-primary, #4f8df9)", b.lineWidth = 1.5, b.setLineDash([4, 2]), b.strokeRect(
|
|
4598
|
+
const { sx: $, sy: J } = qe(F.x, F.y, v), k = F.width * v.scale, R = F.height * v.scale;
|
|
4599
|
+
b.strokeStyle = "var(--nice-primary, #4f8df9)", b.lineWidth = 1.5, b.setLineDash([4, 2]), b.strokeRect($ - 2, J - 2, k + 4, R + 4), b.setLineDash([]);
|
|
4596
4600
|
const ie = [
|
|
4597
|
-
[
|
|
4598
|
-
[
|
|
4599
|
-
[
|
|
4600
|
-
[
|
|
4601
|
+
[$ - 2, J - 2],
|
|
4602
|
+
[$ + k + 2, J - 2],
|
|
4603
|
+
[$ - 2, J + R + 2],
|
|
4604
|
+
[$ + k + 2, J + R + 2]
|
|
4601
4605
|
];
|
|
4602
4606
|
b.fillStyle = "var(--nice-bg, #fff)", b.strokeStyle = "var(--nice-primary, #4f8df9)", b.lineWidth = 1.5;
|
|
4603
4607
|
for (const [ne, le] of ie)
|
|
4604
4608
|
b.fillRect(ne - 4, le - 4, 8, 8), b.strokeRect(ne - 4, le - 4, 8, 8);
|
|
4605
4609
|
}
|
|
4606
4610
|
},
|
|
4607
|
-
[
|
|
4608
|
-
), te =
|
|
4609
|
-
const b =
|
|
4611
|
+
[d.selectedObjectIds, d.session.objects]
|
|
4612
|
+
), te = T(() => {
|
|
4613
|
+
const b = D.current;
|
|
4610
4614
|
if (!b)
|
|
4611
4615
|
return;
|
|
4612
4616
|
const v = b.getContext("2d");
|
|
4613
4617
|
if (!v)
|
|
4614
4618
|
return;
|
|
4615
|
-
const { width: M, height: F } = b,
|
|
4616
|
-
v.clearRect(0, 0, M, F), v.fillStyle =
|
|
4617
|
-
const J = Object.values(
|
|
4618
|
-
v.translate(
|
|
4619
|
+
const { width: M, height: F } = b, $ = d.viewport;
|
|
4620
|
+
v.clearRect(0, 0, M, F), v.fillStyle = d.session.backgroundColor, v.fillRect(0, 0, M, F), w(v, $, M, F), v.save();
|
|
4621
|
+
const J = Object.values(d.session.objects).filter((k) => k.visible).sort((k, R) => k.zIndex - R.zIndex);
|
|
4622
|
+
v.translate($.x, $.y), v.scale($.scale, $.scale);
|
|
4619
4623
|
for (const k of J)
|
|
4620
|
-
|
|
4624
|
+
ln(v, k);
|
|
4621
4625
|
if (g.current.active && g.current.currentPoints.length > 1) {
|
|
4622
4626
|
const k = g.current.currentPoints;
|
|
4623
4627
|
v.strokeStyle = W, v.lineWidth = q, v.lineCap = "round", v.lineJoin = "round", v.beginPath(), v.moveTo(k[0].x, k[0].y);
|
|
@@ -4625,31 +4629,31 @@ function Ct({
|
|
|
4625
4629
|
v.lineTo(k[R].x, k[R].y);
|
|
4626
4630
|
v.stroke();
|
|
4627
4631
|
}
|
|
4628
|
-
if (g.current.laserPoints.length > 1 &&
|
|
4632
|
+
if (g.current.laserPoints.length > 1 && d.activeTool === "laser") {
|
|
4629
4633
|
const k = g.current.laserPoints;
|
|
4630
4634
|
v.strokeStyle = "#ff2c2c", v.lineWidth = 3, v.globalAlpha = 0.7, v.beginPath(), v.moveTo(k[0].x, k[0].y);
|
|
4631
4635
|
for (let R = 1; R < k.length; R++)
|
|
4632
4636
|
v.lineTo(k[R].x, k[R].y);
|
|
4633
4637
|
v.stroke(), v.globalAlpha = 1;
|
|
4634
4638
|
}
|
|
4635
|
-
v.restore(), Q(v,
|
|
4639
|
+
v.restore(), Q(v, $), Z(v, $);
|
|
4636
4640
|
}, [
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4641
|
+
d.session,
|
|
4642
|
+
d.viewport,
|
|
4643
|
+
d.activeTool,
|
|
4640
4644
|
w,
|
|
4641
4645
|
Z,
|
|
4642
4646
|
Q,
|
|
4643
4647
|
W,
|
|
4644
4648
|
q
|
|
4645
4649
|
]);
|
|
4646
|
-
|
|
4650
|
+
Nt(() => {
|
|
4647
4651
|
function b() {
|
|
4648
|
-
te(),
|
|
4652
|
+
te(), A.current = requestAnimationFrame(b);
|
|
4649
4653
|
}
|
|
4650
|
-
return
|
|
4654
|
+
return A.current = requestAnimationFrame(b), () => cancelAnimationFrame(A.current);
|
|
4651
4655
|
}, [te]), re(() => {
|
|
4652
|
-
const b =
|
|
4656
|
+
const b = D.current;
|
|
4653
4657
|
if (!b)
|
|
4654
4658
|
return;
|
|
4655
4659
|
const v = new ResizeObserver(() => {
|
|
@@ -4660,7 +4664,7 @@ function Ct({
|
|
|
4660
4664
|
function b(v) {
|
|
4661
4665
|
if (v.target.tagName === "INPUT" || v.target.tagName === "TEXTAREA" || (v.code === "Space" && (g.current.spaceDown = v.type === "keydown", v.preventDefault()), v.type !== "keydown"))
|
|
4662
4666
|
return;
|
|
4663
|
-
(v.ctrlKey || v.metaKey) && (v.key === "z" && (v.preventDefault(),
|
|
4667
|
+
(v.ctrlKey || v.metaKey) && (v.key === "z" && (v.preventDefault(), d.undo()), v.key === "y" && (v.preventDefault(), d.redo()), v.key === "s" && (v.preventDefault(), d.saveNow()), v.key === "a" && (v.preventDefault(), d.setSelection(Object.keys(d.session.objects)))), (v.key === "Delete" || v.key === "Backspace") && d.selectedObjectIds.length > 0 && d.deleteObjects(d.selectedObjectIds);
|
|
4664
4668
|
const M = {
|
|
4665
4669
|
v: "select",
|
|
4666
4670
|
p: "pen",
|
|
@@ -4674,19 +4678,19 @@ function Ct({
|
|
|
4674
4678
|
a: "arrow",
|
|
4675
4679
|
l: "laser"
|
|
4676
4680
|
};
|
|
4677
|
-
!v.ctrlKey && !v.metaKey && M[v.key] &&
|
|
4681
|
+
!v.ctrlKey && !v.metaKey && M[v.key] && d.setTool(M[v.key]);
|
|
4678
4682
|
}
|
|
4679
4683
|
return window.addEventListener("keydown", b), window.addEventListener("keyup", b), () => {
|
|
4680
4684
|
window.removeEventListener("keydown", b), window.removeEventListener("keyup", b);
|
|
4681
4685
|
};
|
|
4682
|
-
}, [
|
|
4683
|
-
const X =
|
|
4686
|
+
}, [d]);
|
|
4687
|
+
const X = T(
|
|
4684
4688
|
(b) => {
|
|
4685
|
-
const v =
|
|
4686
|
-
return { x:
|
|
4689
|
+
const v = D.current.getBoundingClientRect(), M = b.clientX - v.left, F = b.clientY - v.top, { wx: $, wy: J } = Zt(M, F, d.viewport);
|
|
4690
|
+
return { x: $, y: J, pressure: b.pressure ?? 0.5 };
|
|
4687
4691
|
},
|
|
4688
|
-
[
|
|
4689
|
-
), pe =
|
|
4692
|
+
[d.viewport]
|
|
4693
|
+
), pe = T(
|
|
4690
4694
|
(b) => {
|
|
4691
4695
|
if (a)
|
|
4692
4696
|
return;
|
|
@@ -4696,57 +4700,57 @@ function Ct({
|
|
|
4696
4700
|
g.current.panStart = {
|
|
4697
4701
|
x: b.clientX,
|
|
4698
4702
|
y: b.clientY,
|
|
4699
|
-
vpX:
|
|
4700
|
-
vpY:
|
|
4703
|
+
vpX: d.viewport.x,
|
|
4704
|
+
vpY: d.viewport.y
|
|
4701
4705
|
};
|
|
4702
4706
|
return;
|
|
4703
4707
|
}
|
|
4704
|
-
const M =
|
|
4708
|
+
const M = d.activeTool;
|
|
4705
4709
|
if (g.current.active = !0, g.current.startX = v.x, g.current.startY = v.y, g.current.currentId = We(), M === "pen" || M === "highlighter")
|
|
4706
4710
|
g.current.currentPoints = [v];
|
|
4707
4711
|
else if (M === "laser")
|
|
4708
4712
|
g.current.laserPoints = [v];
|
|
4709
4713
|
else if (M === "select") {
|
|
4710
|
-
const F = Object.values(
|
|
4711
|
-
(
|
|
4712
|
-
).sort((
|
|
4713
|
-
F ? b.shiftKey ?
|
|
4714
|
+
const F = Object.values(d.session.objects).filter(
|
|
4715
|
+
($) => $.visible && $.x <= v.x && $.y <= v.y && $.x + $.width >= v.x && $.y + $.height >= v.y
|
|
4716
|
+
).sort(($, J) => J.zIndex - $.zIndex)[0];
|
|
4717
|
+
F ? b.shiftKey ? d.setSelection([...d.selectedObjectIds, F.id]) : d.setSelection([F.id]) : d.setSelection([]);
|
|
4714
4718
|
}
|
|
4715
4719
|
},
|
|
4716
|
-
[a, X,
|
|
4717
|
-
), ue =
|
|
4720
|
+
[a, X, d]
|
|
4721
|
+
), ue = T(
|
|
4718
4722
|
(b) => {
|
|
4719
4723
|
const v = X(b);
|
|
4720
|
-
if (
|
|
4721
|
-
const { x: F, y:
|
|
4722
|
-
|
|
4723
|
-
...
|
|
4724
|
+
if (d.broadcastCursor(v.x, v.y), g.current.panStart) {
|
|
4725
|
+
const { x: F, y: $, vpX: J, vpY: k } = g.current.panStart;
|
|
4726
|
+
d.setViewport({
|
|
4727
|
+
...d.viewport,
|
|
4724
4728
|
x: J + (b.clientX - F),
|
|
4725
|
-
y: k + (b.clientY -
|
|
4729
|
+
y: k + (b.clientY - $)
|
|
4726
4730
|
});
|
|
4727
4731
|
return;
|
|
4728
4732
|
}
|
|
4729
4733
|
if (!g.current.active)
|
|
4730
4734
|
return;
|
|
4731
|
-
const M =
|
|
4735
|
+
const M = d.activeTool;
|
|
4732
4736
|
if (M === "pen" || M === "highlighter") {
|
|
4733
4737
|
const F = g.current.currentPoints;
|
|
4734
|
-
(F.length === 0 ||
|
|
4738
|
+
(F.length === 0 || en(F[F.length - 1], v) > 2) && (g.current.currentPoints = [...F, v]);
|
|
4735
4739
|
} else if (M === "laser") {
|
|
4736
4740
|
const F = g.current.laserPoints;
|
|
4737
4741
|
g.current.laserPoints = [...F.slice(-40), v];
|
|
4738
|
-
} else if (M === "select" &&
|
|
4739
|
-
const F = v.x - g.current.startX,
|
|
4740
|
-
g.current.startX = v.x, g.current.startY = v.y,
|
|
4741
|
-
|
|
4742
|
-
const k =
|
|
4743
|
-
return { id: J, x: k.x + F, y: k.y +
|
|
4742
|
+
} else if (M === "select" && d.selectedObjectIds.length > 0) {
|
|
4743
|
+
const F = v.x - g.current.startX, $ = v.y - g.current.startY;
|
|
4744
|
+
g.current.startX = v.x, g.current.startY = v.y, d.moveObjects(
|
|
4745
|
+
d.selectedObjectIds.map((J) => {
|
|
4746
|
+
const k = d.session.objects[J];
|
|
4747
|
+
return { id: J, x: k.x + F, y: k.y + $ };
|
|
4744
4748
|
})
|
|
4745
4749
|
);
|
|
4746
4750
|
}
|
|
4747
4751
|
},
|
|
4748
|
-
[X,
|
|
4749
|
-
), be =
|
|
4752
|
+
[X, d]
|
|
4753
|
+
), be = T(
|
|
4750
4754
|
(b) => {
|
|
4751
4755
|
if (g.current.panStart) {
|
|
4752
4756
|
g.current.panStart = null;
|
|
@@ -4754,7 +4758,7 @@ function Ct({
|
|
|
4754
4758
|
}
|
|
4755
4759
|
if (!g.current.active)
|
|
4756
4760
|
return;
|
|
4757
|
-
const v = X(b), M =
|
|
4761
|
+
const v = X(b), M = d.activeTool, F = g.current.startX, $ = g.current.startY, J = g.current.currentId, k = /* @__PURE__ */ new Date();
|
|
4758
4762
|
switch (g.current.active = !1, M) {
|
|
4759
4763
|
case "pen":
|
|
4760
4764
|
case "highlighter": {
|
|
@@ -4769,7 +4773,7 @@ function Ct({
|
|
|
4769
4773
|
width: Math.max(...R.map((ne) => ne.x)) - Math.min(...R.map((ne) => ne.x)),
|
|
4770
4774
|
height: Math.max(...R.map((ne) => ne.y)) - Math.min(...R.map((ne) => ne.y)),
|
|
4771
4775
|
rotation: 0,
|
|
4772
|
-
zIndex: Object.keys(
|
|
4776
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
4773
4777
|
locked: !1,
|
|
4774
4778
|
visible: !0,
|
|
4775
4779
|
createdBy: e.id,
|
|
@@ -4780,13 +4784,13 @@ function Ct({
|
|
|
4780
4784
|
opacity: M === "highlighter" ? 0.4 : 1,
|
|
4781
4785
|
tool: M
|
|
4782
4786
|
};
|
|
4783
|
-
|
|
4787
|
+
d.addObject(ie), g.current.currentPoints = [];
|
|
4784
4788
|
break;
|
|
4785
4789
|
}
|
|
4786
4790
|
case "rect":
|
|
4787
4791
|
case "ellipse":
|
|
4788
4792
|
case "triangle": {
|
|
4789
|
-
const R = Math.min(F, v.x), ie = Math.min(
|
|
4793
|
+
const R = Math.min(F, v.x), ie = Math.min($, v.y), ne = Math.abs(v.x - F), le = Math.abs(v.y - $);
|
|
4790
4794
|
if (ne < 5 || le < 5)
|
|
4791
4795
|
break;
|
|
4792
4796
|
const me = { rect: "rect", ellipse: "ellipse", triangle: "triangle" }, ke = {
|
|
@@ -4797,7 +4801,7 @@ function Ct({
|
|
|
4797
4801
|
width: ne,
|
|
4798
4802
|
height: le,
|
|
4799
4803
|
rotation: 0,
|
|
4800
|
-
zIndex: Object.keys(
|
|
4804
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
4801
4805
|
locked: !1,
|
|
4802
4806
|
visible: !0,
|
|
4803
4807
|
createdBy: e.id,
|
|
@@ -4808,7 +4812,7 @@ function Ct({
|
|
|
4808
4812
|
strokeWidth: q,
|
|
4809
4813
|
opacity: 1
|
|
4810
4814
|
};
|
|
4811
|
-
|
|
4815
|
+
d.addObject(ke);
|
|
4812
4816
|
break;
|
|
4813
4817
|
}
|
|
4814
4818
|
case "arrow":
|
|
@@ -4817,17 +4821,17 @@ function Ct({
|
|
|
4817
4821
|
id: J,
|
|
4818
4822
|
type: "connector",
|
|
4819
4823
|
x: Math.min(F, v.x),
|
|
4820
|
-
y: Math.min(
|
|
4824
|
+
y: Math.min($, v.y),
|
|
4821
4825
|
width: Math.abs(v.x - F),
|
|
4822
|
-
height: Math.abs(v.y -
|
|
4826
|
+
height: Math.abs(v.y - $),
|
|
4823
4827
|
rotation: 0,
|
|
4824
|
-
zIndex: Object.keys(
|
|
4828
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
4825
4829
|
locked: !1,
|
|
4826
4830
|
visible: !0,
|
|
4827
4831
|
createdBy: e.id,
|
|
4828
4832
|
createdAt: k,
|
|
4829
4833
|
points: [
|
|
4830
|
-
{ x: F, y:
|
|
4834
|
+
{ x: F, y: $ },
|
|
4831
4835
|
{ x: v.x, y: v.y }
|
|
4832
4836
|
],
|
|
4833
4837
|
strokeColor: W,
|
|
@@ -4836,7 +4840,7 @@ function Ct({
|
|
|
4836
4840
|
arrowEnd: M === "arrow" ? "arrow" : "none",
|
|
4837
4841
|
curved: !1
|
|
4838
4842
|
};
|
|
4839
|
-
|
|
4843
|
+
d.addObject(R);
|
|
4840
4844
|
break;
|
|
4841
4845
|
}
|
|
4842
4846
|
case "text": {
|
|
@@ -4848,7 +4852,7 @@ function Ct({
|
|
|
4848
4852
|
width: 200,
|
|
4849
4853
|
height: C + 10,
|
|
4850
4854
|
rotation: 0,
|
|
4851
|
-
zIndex: Object.keys(
|
|
4855
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
4852
4856
|
locked: !1,
|
|
4853
4857
|
visible: !0,
|
|
4854
4858
|
createdBy: e.id,
|
|
@@ -4861,7 +4865,7 @@ function Ct({
|
|
|
4861
4865
|
textAlign: "left",
|
|
4862
4866
|
color: W
|
|
4863
4867
|
};
|
|
4864
|
-
|
|
4868
|
+
d.addObject(R), j(J);
|
|
4865
4869
|
break;
|
|
4866
4870
|
}
|
|
4867
4871
|
case "sticky": {
|
|
@@ -4873,7 +4877,7 @@ function Ct({
|
|
|
4873
4877
|
width: 180,
|
|
4874
4878
|
height: 150,
|
|
4875
4879
|
rotation: 0,
|
|
4876
|
-
zIndex: Object.keys(
|
|
4880
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
4877
4881
|
locked: !1,
|
|
4878
4882
|
visible: !0,
|
|
4879
4883
|
createdBy: e.id,
|
|
@@ -4884,11 +4888,11 @@ function Ct({
|
|
|
4884
4888
|
fontSize: 14,
|
|
4885
4889
|
authorId: e.id
|
|
4886
4890
|
};
|
|
4887
|
-
|
|
4891
|
+
d.addObject(R), j(J);
|
|
4888
4892
|
break;
|
|
4889
4893
|
}
|
|
4890
4894
|
case "frame": {
|
|
4891
|
-
const R = Math.min(F, v.x), ie = Math.min(
|
|
4895
|
+
const R = Math.min(F, v.x), ie = Math.min($, v.y), ne = Math.abs(v.x - F), le = Math.abs(v.y - $);
|
|
4892
4896
|
if (ne < 20 || le < 20)
|
|
4893
4897
|
break;
|
|
4894
4898
|
const me = {
|
|
@@ -4904,11 +4908,11 @@ function Ct({
|
|
|
4904
4908
|
visible: !0,
|
|
4905
4909
|
createdBy: e.id,
|
|
4906
4910
|
createdAt: k,
|
|
4907
|
-
name: `Frame ${Object.keys(
|
|
4911
|
+
name: `Frame ${Object.keys(d.session.objects).length + 1}`,
|
|
4908
4912
|
childIds: [],
|
|
4909
4913
|
borderColor: "#8888"
|
|
4910
4914
|
};
|
|
4911
|
-
|
|
4915
|
+
d.addObject(me);
|
|
4912
4916
|
break;
|
|
4913
4917
|
}
|
|
4914
4918
|
case "image": {
|
|
@@ -4931,7 +4935,7 @@ function Ct({
|
|
|
4931
4935
|
width: ve.width * Le,
|
|
4932
4936
|
height: ve.height * Le,
|
|
4933
4937
|
rotation: 0,
|
|
4934
|
-
zIndex: Object.keys(
|
|
4938
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
4935
4939
|
locked: !1,
|
|
4936
4940
|
visible: !0,
|
|
4937
4941
|
createdBy: e.id,
|
|
@@ -4941,7 +4945,7 @@ function Ct({
|
|
|
4941
4945
|
originalWidth: ve.width,
|
|
4942
4946
|
originalHeight: ve.height
|
|
4943
4947
|
};
|
|
4944
|
-
|
|
4948
|
+
d.addObject(Ce);
|
|
4945
4949
|
}, ve.src = ke;
|
|
4946
4950
|
}, ne.readAsDataURL(ie);
|
|
4947
4951
|
}, R.click();
|
|
@@ -4949,47 +4953,47 @@ function Ct({
|
|
|
4949
4953
|
}
|
|
4950
4954
|
}
|
|
4951
4955
|
},
|
|
4952
|
-
[X,
|
|
4953
|
-
), he =
|
|
4956
|
+
[X, d, e.id, W, q, V, C, G]
|
|
4957
|
+
), he = T(
|
|
4954
4958
|
(b) => {
|
|
4955
4959
|
if (b.preventDefault(), !b.ctrlKey && !b.metaKey) {
|
|
4956
|
-
|
|
4957
|
-
...
|
|
4958
|
-
x:
|
|
4959
|
-
y:
|
|
4960
|
+
d.setViewport({
|
|
4961
|
+
...d.viewport,
|
|
4962
|
+
x: d.viewport.x - b.deltaX,
|
|
4963
|
+
y: d.viewport.y - b.deltaY
|
|
4960
4964
|
});
|
|
4961
4965
|
return;
|
|
4962
4966
|
}
|
|
4963
|
-
const v =
|
|
4964
|
-
|
|
4967
|
+
const v = D.current.getBoundingClientRect(), M = b.clientX - v.left, F = b.clientY - v.top, J = -b.deltaY > 0 ? 1.1 : 0.9, k = Math.min(8, Math.max(0.1, d.viewport.scale * J));
|
|
4968
|
+
d.setViewport({
|
|
4965
4969
|
scale: k,
|
|
4966
|
-
x: M - (M -
|
|
4967
|
-
y: F - (F -
|
|
4970
|
+
x: M - (M - d.viewport.x) * (k / d.viewport.scale),
|
|
4971
|
+
y: F - (F - d.viewport.y) * (k / d.viewport.scale)
|
|
4968
4972
|
});
|
|
4969
4973
|
},
|
|
4970
|
-
[
|
|
4971
|
-
), B =
|
|
4974
|
+
[d]
|
|
4975
|
+
), B = T(
|
|
4972
4976
|
(b) => {
|
|
4973
4977
|
if (b === "json") {
|
|
4974
|
-
const
|
|
4975
|
-
m == null || m("json",
|
|
4978
|
+
const $ = JSON.stringify(d.session, null, 2);
|
|
4979
|
+
m == null || m("json", $);
|
|
4976
4980
|
const J = document.createElement("a");
|
|
4977
|
-
J.href = URL.createObjectURL(new Blob([
|
|
4981
|
+
J.href = URL.createObjectURL(new Blob([$], { type: "application/json" })), J.download = `${d.session.title}.json`, J.click();
|
|
4978
4982
|
return;
|
|
4979
4983
|
}
|
|
4980
|
-
const v =
|
|
4984
|
+
const v = D.current;
|
|
4981
4985
|
if (!v)
|
|
4982
4986
|
return;
|
|
4983
4987
|
const M = v.toDataURL("image/png");
|
|
4984
4988
|
m == null || m("png", M);
|
|
4985
4989
|
const F = document.createElement("a");
|
|
4986
|
-
F.href = M, F.download = `${
|
|
4990
|
+
F.href = M, F.download = `${d.session.title}.png`, F.click();
|
|
4987
4991
|
},
|
|
4988
|
-
[
|
|
4992
|
+
[d.session, m]
|
|
4989
4993
|
);
|
|
4990
4994
|
re(() => {
|
|
4991
|
-
u == null || u(
|
|
4992
|
-
}, [
|
|
4995
|
+
u == null || u(d.session);
|
|
4996
|
+
}, [d.session, u]), re(() => {
|
|
4993
4997
|
function b(v) {
|
|
4994
4998
|
if (v.clipboardData) {
|
|
4995
4999
|
for (const M of Array.from(v.clipboardData.items))
|
|
@@ -4997,8 +5001,8 @@ function Ct({
|
|
|
4997
5001
|
const F = M.getAsFile();
|
|
4998
5002
|
if (!F)
|
|
4999
5003
|
continue;
|
|
5000
|
-
const
|
|
5001
|
-
|
|
5004
|
+
const $ = new FileReader();
|
|
5005
|
+
$.onload = (J) => {
|
|
5002
5006
|
var ie;
|
|
5003
5007
|
const k = (ie = J.target) == null ? void 0 : ie.result, R = new Image();
|
|
5004
5008
|
R.onload = () => {
|
|
@@ -5010,7 +5014,7 @@ function Ct({
|
|
|
5010
5014
|
width: R.width * le,
|
|
5011
5015
|
height: R.height * le,
|
|
5012
5016
|
rotation: 0,
|
|
5013
|
-
zIndex: Object.keys(
|
|
5017
|
+
zIndex: Object.keys(d.session.objects).length,
|
|
5014
5018
|
locked: !1,
|
|
5015
5019
|
visible: !0,
|
|
5016
5020
|
createdBy: e.id,
|
|
@@ -5020,16 +5024,16 @@ function Ct({
|
|
|
5020
5024
|
originalWidth: R.width,
|
|
5021
5025
|
originalHeight: R.height
|
|
5022
5026
|
};
|
|
5023
|
-
|
|
5027
|
+
d.addObject(me);
|
|
5024
5028
|
}, R.src = k;
|
|
5025
|
-
},
|
|
5029
|
+
}, $.readAsDataURL(F);
|
|
5026
5030
|
break;
|
|
5027
5031
|
}
|
|
5028
5032
|
}
|
|
5029
5033
|
}
|
|
5030
5034
|
return window.addEventListener("paste", b), () => window.removeEventListener("paste", b);
|
|
5031
|
-
}, [
|
|
5032
|
-
const ee =
|
|
5035
|
+
}, [d, e.id]);
|
|
5036
|
+
const ee = z ? d.session.objects[z] : null, oe = se(() => ee ? qe(ee.x, ee.y, d.viewport) : null, [ee, d.viewport]), de = [
|
|
5033
5037
|
"var(--nice-warning-bg, #fef08a)",
|
|
5034
5038
|
"var(--nice-primary-bg, #bfdbfe)",
|
|
5035
5039
|
"#bbf7d0",
|
|
@@ -5039,7 +5043,7 @@ function Ct({
|
|
|
5039
5043
|
], ge = se(() => {
|
|
5040
5044
|
var v;
|
|
5041
5045
|
const b = {};
|
|
5042
|
-
for (const M of
|
|
5046
|
+
for (const M of Qt)
|
|
5043
5047
|
(b[v = M.group] ?? (b[v] = [])).push(M);
|
|
5044
5048
|
return Object.values(b);
|
|
5045
5049
|
}, []);
|
|
@@ -5047,7 +5051,7 @@ function Ct({
|
|
|
5047
5051
|
"div",
|
|
5048
5052
|
{
|
|
5049
5053
|
className: h,
|
|
5050
|
-
"data-testid":
|
|
5054
|
+
"data-testid": P,
|
|
5051
5055
|
style: {
|
|
5052
5056
|
position: "relative",
|
|
5053
5057
|
display: "flex",
|
|
@@ -5089,17 +5093,17 @@ function Ct({
|
|
|
5089
5093
|
b.map((M) => /* @__PURE__ */ r(
|
|
5090
5094
|
"button",
|
|
5091
5095
|
{
|
|
5092
|
-
onClick: () =>
|
|
5096
|
+
onClick: () => d.setTool(M.id),
|
|
5093
5097
|
title: `${M.label}`,
|
|
5094
5098
|
style: {
|
|
5095
5099
|
padding: "4px 7px",
|
|
5096
|
-
border: `1.5px solid ${
|
|
5100
|
+
border: `1.5px solid ${d.activeTool === M.id ? "var(--nice-info, #6366f1)" : "transparent"}`,
|
|
5097
5101
|
borderRadius: 6,
|
|
5098
|
-
background:
|
|
5102
|
+
background: d.activeTool === M.id ? "var(--nice-primary-bg, #eef2ff)" : "transparent",
|
|
5099
5103
|
cursor: "pointer",
|
|
5100
5104
|
fontSize: 15,
|
|
5101
5105
|
minWidth: 30,
|
|
5102
|
-
color:
|
|
5106
|
+
color: d.activeTool === M.id ? "var(--nice-accent, #4f46e5)" : "var(--nice-text, #374151)",
|
|
5103
5107
|
display: "inline-flex",
|
|
5104
5108
|
alignItems: "center",
|
|
5105
5109
|
justifyContent: "center"
|
|
@@ -5209,7 +5213,7 @@ function Ct({
|
|
|
5209
5213
|
}
|
|
5210
5214
|
)
|
|
5211
5215
|
] }),
|
|
5212
|
-
|
|
5216
|
+
d.activeTool === "sticky" && /* @__PURE__ */ l(fe, { children: [
|
|
5213
5217
|
/* @__PURE__ */ r("span", { style: { fontSize: 11, color: "var(--nice-text-secondary, #6b7280)" }, children: "Note:" }),
|
|
5214
5218
|
de.map((b) => /* @__PURE__ */ r(
|
|
5215
5219
|
"button",
|
|
@@ -5231,22 +5235,22 @@ function Ct({
|
|
|
5231
5235
|
/* @__PURE__ */ r(
|
|
5232
5236
|
"button",
|
|
5233
5237
|
{
|
|
5234
|
-
onClick:
|
|
5235
|
-
disabled: !
|
|
5238
|
+
onClick: d.undo,
|
|
5239
|
+
disabled: !d.canUndo,
|
|
5236
5240
|
title: "Undo (Ctrl+Z)",
|
|
5237
5241
|
"aria-label": "Undo",
|
|
5238
|
-
style: ye(!
|
|
5242
|
+
style: ye(!d.canUndo),
|
|
5239
5243
|
children: /* @__PURE__ */ r(S, { name: "reply", size: 13 })
|
|
5240
5244
|
}
|
|
5241
5245
|
),
|
|
5242
5246
|
/* @__PURE__ */ r(
|
|
5243
5247
|
"button",
|
|
5244
5248
|
{
|
|
5245
|
-
onClick:
|
|
5246
|
-
disabled: !
|
|
5249
|
+
onClick: d.redo,
|
|
5250
|
+
disabled: !d.canRedo,
|
|
5247
5251
|
title: "Redo (Ctrl+Y)",
|
|
5248
5252
|
"aria-label": "Redo",
|
|
5249
|
-
style: ye(!
|
|
5253
|
+
style: ye(!d.canRedo),
|
|
5250
5254
|
children: /* @__PURE__ */ r(S, { name: "forward", size: 13 })
|
|
5251
5255
|
}
|
|
5252
5256
|
),
|
|
@@ -5261,7 +5265,7 @@ function Ct({
|
|
|
5261
5265
|
textAlign: "center"
|
|
5262
5266
|
},
|
|
5263
5267
|
children: [
|
|
5264
|
-
Math.round(
|
|
5268
|
+
Math.round(d.viewport.scale * 100),
|
|
5265
5269
|
"%"
|
|
5266
5270
|
]
|
|
5267
5271
|
}
|
|
@@ -5269,7 +5273,7 @@ function Ct({
|
|
|
5269
5273
|
/* @__PURE__ */ r(
|
|
5270
5274
|
"button",
|
|
5271
5275
|
{
|
|
5272
|
-
onClick: () =>
|
|
5276
|
+
onClick: () => d.setViewport({ x: 0, y: 0, scale: 1 }),
|
|
5273
5277
|
style: ye(),
|
|
5274
5278
|
title: "Reset zoom",
|
|
5275
5279
|
"aria-label": "Reset zoom",
|
|
@@ -5292,21 +5296,21 @@ function Ct({
|
|
|
5292
5296
|
onClick: () => {
|
|
5293
5297
|
const b = {
|
|
5294
5298
|
id: We(),
|
|
5295
|
-
sessionId:
|
|
5299
|
+
sessionId: d.session.id,
|
|
5296
5300
|
type: "object:update",
|
|
5297
5301
|
userId: e.id,
|
|
5298
5302
|
timestamp: /* @__PURE__ */ new Date(),
|
|
5299
|
-
payload: { ...
|
|
5303
|
+
payload: { ...d.session, gridEnabled: !d.session.gridEnabled }
|
|
5300
5304
|
};
|
|
5301
5305
|
t == null || t(b);
|
|
5302
5306
|
},
|
|
5303
|
-
style: ye(!1,
|
|
5307
|
+
style: ye(!1, d.session.gridEnabled),
|
|
5304
5308
|
title: "Toggle grid",
|
|
5305
5309
|
"aria-label": "Toggle grid",
|
|
5306
5310
|
children: /* @__PURE__ */ r(S, { name: "hash", size: 13 })
|
|
5307
5311
|
}
|
|
5308
5312
|
),
|
|
5309
|
-
|
|
5313
|
+
p && /* @__PURE__ */ r(
|
|
5310
5314
|
"button",
|
|
5311
5315
|
{
|
|
5312
5316
|
onClick: () => Y((b) => b === "vector" ? null : "vector"),
|
|
@@ -5329,13 +5333,13 @@ function Ct({
|
|
|
5329
5333
|
/* @__PURE__ */ r(
|
|
5330
5334
|
"button",
|
|
5331
5335
|
{
|
|
5332
|
-
onClick: () => void
|
|
5336
|
+
onClick: () => void d.saveNow(),
|
|
5333
5337
|
style: ye(),
|
|
5334
5338
|
title: "Save (Ctrl+S)",
|
|
5335
5339
|
"aria-label": "Save",
|
|
5336
5340
|
children: /* @__PURE__ */ l("span", { style: { display: "inline-flex", alignItems: "center" }, children: [
|
|
5337
5341
|
/* @__PURE__ */ r(S, { name: "save", size: 13 }),
|
|
5338
|
-
|
|
5342
|
+
d.isDirty && "*"
|
|
5339
5343
|
] })
|
|
5340
5344
|
}
|
|
5341
5345
|
),
|
|
@@ -5374,11 +5378,11 @@ function Ct({
|
|
|
5374
5378
|
/* @__PURE__ */ r(
|
|
5375
5379
|
"canvas",
|
|
5376
5380
|
{
|
|
5377
|
-
ref:
|
|
5381
|
+
ref: D,
|
|
5378
5382
|
style: {
|
|
5379
5383
|
flex: 1,
|
|
5380
5384
|
display: "block",
|
|
5381
|
-
cursor:
|
|
5385
|
+
cursor: pn(d.activeTool, g.current.spaceDown)
|
|
5382
5386
|
},
|
|
5383
5387
|
onPointerDown: pe,
|
|
5384
5388
|
onPointerMove: ue,
|
|
@@ -5388,13 +5392,13 @@ function Ct({
|
|
|
5388
5392
|
}
|
|
5389
5393
|
),
|
|
5390
5394
|
s && O && /* @__PURE__ */ r(
|
|
5391
|
-
|
|
5395
|
+
dn,
|
|
5392
5396
|
{
|
|
5393
|
-
layers:
|
|
5394
|
-
objects:
|
|
5395
|
-
onAdd: () =>
|
|
5396
|
-
onUpdate: (b) =>
|
|
5397
|
-
onDelete: (b) =>
|
|
5397
|
+
layers: d.layers,
|
|
5398
|
+
objects: d.session.objects,
|
|
5399
|
+
onAdd: () => d.addLayer(`Layer ${d.layers.length + 1}`),
|
|
5400
|
+
onUpdate: (b) => d.updateLayer(b),
|
|
5401
|
+
onDelete: (b) => d.deleteLayer(b)
|
|
5398
5402
|
}
|
|
5399
5403
|
),
|
|
5400
5404
|
K && /* @__PURE__ */ l(
|
|
@@ -5447,7 +5451,7 @@ function Ct({
|
|
|
5447
5451
|
}
|
|
5448
5452
|
)
|
|
5449
5453
|
] }),
|
|
5450
|
-
|
|
5454
|
+
d.collaborators.length > 1 && /* @__PURE__ */ l(
|
|
5451
5455
|
"div",
|
|
5452
5456
|
{
|
|
5453
5457
|
style: {
|
|
@@ -5463,7 +5467,7 @@ function Ct({
|
|
|
5463
5467
|
},
|
|
5464
5468
|
children: [
|
|
5465
5469
|
/* @__PURE__ */ r("span", { children: "Collaborators:" }),
|
|
5466
|
-
|
|
5470
|
+
d.collaborators.map((b) => /* @__PURE__ */ l("span", { style: { display: "flex", alignItems: "center", gap: 3 }, children: [
|
|
5467
5471
|
/* @__PURE__ */ r(
|
|
5468
5472
|
"span",
|
|
5469
5473
|
{
|
|
@@ -5478,7 +5482,7 @@ function Ct({
|
|
|
5478
5482
|
),
|
|
5479
5483
|
b.user.name
|
|
5480
5484
|
] }, b.user.id)),
|
|
5481
|
-
|
|
5485
|
+
d.isDirty && /* @__PURE__ */ l(
|
|
5482
5486
|
"span",
|
|
5483
5487
|
{
|
|
5484
5488
|
style: {
|
|
@@ -5494,7 +5498,7 @@ function Ct({
|
|
|
5494
5498
|
]
|
|
5495
5499
|
}
|
|
5496
5500
|
),
|
|
5497
|
-
|
|
5501
|
+
d.lastSavedAt && !d.isDirty && /* @__PURE__ */ l(
|
|
5498
5502
|
"span",
|
|
5499
5503
|
{
|
|
5500
5504
|
style: {
|
|
@@ -5507,7 +5511,7 @@ function Ct({
|
|
|
5507
5511
|
children: [
|
|
5508
5512
|
/* @__PURE__ */ r(S, { name: "check", size: 10 }),
|
|
5509
5513
|
" Saved ",
|
|
5510
|
-
|
|
5514
|
+
d.lastSavedAt.toLocaleTimeString()
|
|
5511
5515
|
]
|
|
5512
5516
|
}
|
|
5513
5517
|
)
|
|
@@ -5526,15 +5530,15 @@ function Ct({
|
|
|
5526
5530
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
5527
5531
|
updatedBy: e.id
|
|
5528
5532
|
};
|
|
5529
|
-
|
|
5533
|
+
d.updateObject(v), j(null);
|
|
5530
5534
|
},
|
|
5531
5535
|
style: {
|
|
5532
5536
|
position: "absolute",
|
|
5533
5537
|
left: oe.sx,
|
|
5534
5538
|
top: oe.sy,
|
|
5535
|
-
minWidth: ee.width *
|
|
5536
|
-
minHeight: ee.height *
|
|
5537
|
-
fontSize: (ee.fontSize ?? 14) *
|
|
5539
|
+
minWidth: ee.width * d.viewport.scale,
|
|
5540
|
+
minHeight: ee.height * d.viewport.scale,
|
|
5541
|
+
fontSize: (ee.fontSize ?? 14) * d.viewport.scale,
|
|
5538
5542
|
fontFamily: "sans-serif",
|
|
5539
5543
|
background: ee.type === "sticky" ? ee.backgroundColor : "var(--nice-overlay-light-95, rgba(255, 255, 255, 0.95))",
|
|
5540
5544
|
border: "2px solid var(--nice-info, #6366f1)",
|
|
@@ -5550,7 +5554,7 @@ function Ct({
|
|
|
5550
5554
|
}
|
|
5551
5555
|
);
|
|
5552
5556
|
}
|
|
5553
|
-
function
|
|
5557
|
+
function dn({ layers: i, objects: e, onAdd: t, onUpdate: n, onDelete: a }) {
|
|
5554
5558
|
return /* @__PURE__ */ l(
|
|
5555
5559
|
"div",
|
|
5556
5560
|
{
|
|
@@ -5704,7 +5708,7 @@ function ye(i = !1, e = !1) {
|
|
|
5704
5708
|
fontWeight: e ? 600 : 400
|
|
5705
5709
|
};
|
|
5706
5710
|
}
|
|
5707
|
-
function
|
|
5711
|
+
function pn(i, e) {
|
|
5708
5712
|
if (e)
|
|
5709
5713
|
return "grab";
|
|
5710
5714
|
switch (i) {
|
|
@@ -5797,13 +5801,13 @@ function ze({
|
|
|
5797
5801
|
}
|
|
5798
5802
|
);
|
|
5799
5803
|
}
|
|
5800
|
-
function
|
|
5804
|
+
function fn({
|
|
5801
5805
|
team: i,
|
|
5802
5806
|
activeChannelId: e,
|
|
5803
5807
|
onSelectChannel: t
|
|
5804
5808
|
}) {
|
|
5805
5809
|
var o;
|
|
5806
|
-
const [n, a] =
|
|
5810
|
+
const [n, a] = N(!1), s = i.channels.reduce((c, p) => c + p.unreadCount, 0);
|
|
5807
5811
|
return /* @__PURE__ */ l("div", { className: "nice-workspace-team", children: [
|
|
5808
5812
|
/* @__PURE__ */ l(
|
|
5809
5813
|
"button",
|
|
@@ -5957,7 +5961,7 @@ function ln({
|
|
|
5957
5961
|
))
|
|
5958
5962
|
] });
|
|
5959
5963
|
}
|
|
5960
|
-
function
|
|
5964
|
+
function un({
|
|
5961
5965
|
conversation: i,
|
|
5962
5966
|
partner: e,
|
|
5963
5967
|
isActive: t,
|
|
@@ -6032,7 +6036,7 @@ function cn({
|
|
|
6032
6036
|
}
|
|
6033
6037
|
);
|
|
6034
6038
|
}
|
|
6035
|
-
function
|
|
6039
|
+
function hn({
|
|
6036
6040
|
currentUser: i,
|
|
6037
6041
|
users: e,
|
|
6038
6042
|
teams: t,
|
|
@@ -6041,17 +6045,17 @@ function dn({
|
|
|
6041
6045
|
activeCall: s,
|
|
6042
6046
|
incomingCall: o,
|
|
6043
6047
|
meetings: c,
|
|
6044
|
-
transport:
|
|
6048
|
+
transport: p,
|
|
6045
6049
|
rtcConfig: f,
|
|
6046
6050
|
enableCalls: m = !0,
|
|
6047
6051
|
enableMeetings: u = !0,
|
|
6048
6052
|
enableScreenSharing: y = !0,
|
|
6049
6053
|
enableWhiteboard: h = !1,
|
|
6050
6054
|
storageConfig: x,
|
|
6051
|
-
onSendMessage:
|
|
6052
|
-
onEditMessage:
|
|
6053
|
-
onDeleteMessage:
|
|
6054
|
-
onReactToMessage:
|
|
6055
|
+
onSendMessage: P,
|
|
6056
|
+
onEditMessage: d,
|
|
6057
|
+
onDeleteMessage: D,
|
|
6058
|
+
onReactToMessage: A,
|
|
6055
6059
|
onPinMessage: O,
|
|
6056
6060
|
onLoadMoreMessages: U,
|
|
6057
6061
|
onMarkAsRead: W,
|
|
@@ -6064,12 +6068,12 @@ function dn({
|
|
|
6064
6068
|
onStartScreenShare: L,
|
|
6065
6069
|
onStopScreenShare: G,
|
|
6066
6070
|
className: E,
|
|
6067
|
-
style:
|
|
6071
|
+
style: z,
|
|
6068
6072
|
id: j,
|
|
6069
6073
|
"data-testid": K
|
|
6070
6074
|
}) {
|
|
6071
|
-
var
|
|
6072
|
-
const [Y, g] =
|
|
6075
|
+
var $, J;
|
|
6076
|
+
const [Y, g] = N("teams"), [w, Z] = N(null), [Q, te] = N(""), [X, pe] = N(
|
|
6073
6077
|
null
|
|
6074
6078
|
), ue = () => {
|
|
6075
6079
|
X || pe({
|
|
@@ -6131,7 +6135,7 @@ function dn({
|
|
|
6131
6135
|
id: j,
|
|
6132
6136
|
"data-testid": K,
|
|
6133
6137
|
className: `nice-teams-workspace${E ? ` ${E}` : ""}`,
|
|
6134
|
-
style: { position: "relative", height: "100%", ...
|
|
6138
|
+
style: { position: "relative", height: "100%", ...z },
|
|
6135
6139
|
children: [
|
|
6136
6140
|
/* @__PURE__ */ r(
|
|
6137
6141
|
bt,
|
|
@@ -6173,7 +6177,7 @@ function dn({
|
|
|
6173
6177
|
marginBottom: 8,
|
|
6174
6178
|
flexShrink: 0
|
|
6175
6179
|
},
|
|
6176
|
-
children: !i.avatarUrl && ((
|
|
6180
|
+
children: !i.avatarUrl && (($ = i.name[0]) == null ? void 0 : $.toUpperCase())
|
|
6177
6181
|
}
|
|
6178
6182
|
),
|
|
6179
6183
|
/* @__PURE__ */ r(
|
|
@@ -6296,7 +6300,7 @@ function dn({
|
|
|
6296
6300
|
] }),
|
|
6297
6301
|
/* @__PURE__ */ l("div", { style: { flex: 1, overflowY: "auto" }, children: [
|
|
6298
6302
|
Y === "teams" && /* @__PURE__ */ r(fe, { children: t.map((k) => /* @__PURE__ */ r(
|
|
6299
|
-
|
|
6303
|
+
fn,
|
|
6300
6304
|
{
|
|
6301
6305
|
team: k,
|
|
6302
6306
|
activeChannelId: w == null ? void 0 : w.channelId,
|
|
@@ -6325,7 +6329,7 @@ function dn({
|
|
|
6325
6329
|
k.participantIds.find((ie) => ie !== i.id) ?? ""
|
|
6326
6330
|
);
|
|
6327
6331
|
return /* @__PURE__ */ r(
|
|
6328
|
-
|
|
6332
|
+
un,
|
|
6329
6333
|
{
|
|
6330
6334
|
conversation: k,
|
|
6331
6335
|
partner: R,
|
|
@@ -6588,17 +6592,17 @@ function dn({
|
|
|
6588
6592
|
},
|
|
6589
6593
|
children: [
|
|
6590
6594
|
(w == null ? void 0 : w.type) === "channel" && ee ? /* @__PURE__ */ r(
|
|
6591
|
-
|
|
6595
|
+
Kt,
|
|
6592
6596
|
{
|
|
6593
6597
|
channel: ee,
|
|
6594
6598
|
messages: ge,
|
|
6595
6599
|
users: (oe == null ? void 0 : oe.members) ?? e,
|
|
6596
6600
|
currentUser: i,
|
|
6597
6601
|
team: oe,
|
|
6598
|
-
onSendMessage:
|
|
6599
|
-
onEditMessage:
|
|
6600
|
-
onDeleteMessage:
|
|
6601
|
-
onReactToMessage:
|
|
6602
|
+
onSendMessage: P,
|
|
6603
|
+
onEditMessage: d,
|
|
6604
|
+
onDeleteMessage: D,
|
|
6605
|
+
onReactToMessage: A,
|
|
6602
6606
|
onPinMessage: O,
|
|
6603
6607
|
onLoadMoreMessages: U,
|
|
6604
6608
|
onStartCall: m ? H : void 0,
|
|
@@ -6611,10 +6615,10 @@ function dn({
|
|
|
6611
6615
|
messages: ge,
|
|
6612
6616
|
users: e,
|
|
6613
6617
|
currentUser: i,
|
|
6614
|
-
onSendMessage:
|
|
6615
|
-
onEditMessage:
|
|
6616
|
-
onDeleteMessage:
|
|
6617
|
-
onReactToMessage:
|
|
6618
|
+
onSendMessage: P,
|
|
6619
|
+
onEditMessage: d,
|
|
6620
|
+
onDeleteMessage: D,
|
|
6621
|
+
onReactToMessage: A,
|
|
6618
6622
|
onPinMessage: O,
|
|
6619
6623
|
onLoadMoreMessages: U,
|
|
6620
6624
|
onStartCall: m ? H : void 0,
|
|
@@ -6795,33 +6799,33 @@ function dn({
|
|
|
6795
6799
|
}
|
|
6796
6800
|
);
|
|
6797
6801
|
}
|
|
6798
|
-
const
|
|
6802
|
+
const gn = {
|
|
6799
6803
|
"bottom-right": { bottom: 24, right: 24 },
|
|
6800
6804
|
"bottom-left": { bottom: 24, left: 24 },
|
|
6801
6805
|
"top-right": { top: 24, right: 24 },
|
|
6802
6806
|
"top-left": { top: 24, left: 24 }
|
|
6803
6807
|
};
|
|
6804
|
-
function
|
|
6808
|
+
function mn({
|
|
6805
6809
|
props: i,
|
|
6806
6810
|
onExpand: e
|
|
6807
6811
|
}) {
|
|
6808
|
-
const [t, n] =
|
|
6812
|
+
const [t, n] = N(!1), {
|
|
6809
6813
|
bubblePosition: a = "bottom-right",
|
|
6810
6814
|
bubbleLabel: s,
|
|
6811
6815
|
currentUser: o,
|
|
6812
6816
|
users: c,
|
|
6813
|
-
conversations:
|
|
6817
|
+
conversations: p = [],
|
|
6814
6818
|
messages: f = {},
|
|
6815
6819
|
onSendMessage: m,
|
|
6816
6820
|
onReactToMessage: u,
|
|
6817
6821
|
onPinMessage: y,
|
|
6818
6822
|
onDeleteMessage: h,
|
|
6819
6823
|
onEditMessage: x,
|
|
6820
|
-
onLoadMoreMessages:
|
|
6821
|
-
onStartCall:
|
|
6822
|
-
} = i,
|
|
6823
|
-
return /* @__PURE__ */ l("div", { style: { position: "fixed", zIndex: 9999, ...
|
|
6824
|
-
t &&
|
|
6824
|
+
onLoadMoreMessages: P,
|
|
6825
|
+
onStartCall: d
|
|
6826
|
+
} = i, D = gn[a], A = p[0] ?? null, O = A ? f[A.id] ?? [] : [];
|
|
6827
|
+
return /* @__PURE__ */ l("div", { style: { position: "fixed", zIndex: 9999, ...D }, children: [
|
|
6828
|
+
t && A && /* @__PURE__ */ l(
|
|
6825
6829
|
"div",
|
|
6826
6830
|
{
|
|
6827
6831
|
style: {
|
|
@@ -6898,7 +6902,7 @@ function fn({
|
|
|
6898
6902
|
/* @__PURE__ */ r(
|
|
6899
6903
|
He,
|
|
6900
6904
|
{
|
|
6901
|
-
conversation:
|
|
6905
|
+
conversation: A,
|
|
6902
6906
|
messages: O,
|
|
6903
6907
|
users: c,
|
|
6904
6908
|
currentUser: o,
|
|
@@ -6908,8 +6912,8 @@ function fn({
|
|
|
6908
6912
|
onDeleteMessage: h,
|
|
6909
6913
|
onReactToMessage: u,
|
|
6910
6914
|
onPinMessage: y,
|
|
6911
|
-
onLoadMoreMessages:
|
|
6912
|
-
onStartCall:
|
|
6915
|
+
onLoadMoreMessages: P,
|
|
6916
|
+
onStartCall: d,
|
|
6913
6917
|
style: { flex: 1 }
|
|
6914
6918
|
}
|
|
6915
6919
|
)
|
|
@@ -6941,7 +6945,7 @@ function fn({
|
|
|
6941
6945
|
)
|
|
6942
6946
|
] });
|
|
6943
6947
|
}
|
|
6944
|
-
function
|
|
6948
|
+
function yn({
|
|
6945
6949
|
call: i,
|
|
6946
6950
|
onAccept: e,
|
|
6947
6951
|
onDecline: t
|
|
@@ -7027,7 +7031,7 @@ function un({
|
|
|
7027
7031
|
}
|
|
7028
7032
|
);
|
|
7029
7033
|
}
|
|
7030
|
-
function
|
|
7034
|
+
function ai(i) {
|
|
7031
7035
|
const {
|
|
7032
7036
|
mode: e,
|
|
7033
7037
|
currentUser: t,
|
|
@@ -7036,17 +7040,17 @@ function ti(i) {
|
|
|
7036
7040
|
messages: s = {},
|
|
7037
7041
|
teams: o = [],
|
|
7038
7042
|
meetings: c,
|
|
7039
|
-
activeCall:
|
|
7043
|
+
activeCall: p,
|
|
7040
7044
|
incomingCall: f,
|
|
7041
7045
|
transport: m = "webrtc",
|
|
7042
7046
|
rtcConfig: u,
|
|
7043
7047
|
onSendMessage: y,
|
|
7044
7048
|
onEditMessage: h,
|
|
7045
7049
|
onDeleteMessage: x,
|
|
7046
|
-
onReactToMessage:
|
|
7047
|
-
onPinMessage:
|
|
7048
|
-
onLoadMoreMessages:
|
|
7049
|
-
onMarkAsRead:
|
|
7050
|
+
onReactToMessage: P,
|
|
7051
|
+
onPinMessage: d,
|
|
7052
|
+
onLoadMoreMessages: D,
|
|
7053
|
+
onMarkAsRead: A,
|
|
7050
7054
|
onStartCall: O,
|
|
7051
7055
|
onAcceptCall: U,
|
|
7052
7056
|
onDeclineCall: W,
|
|
@@ -7059,14 +7063,14 @@ function ti(i) {
|
|
|
7059
7063
|
onModeChange: L,
|
|
7060
7064
|
enableScreenSharing: G = !0,
|
|
7061
7065
|
enableMeetings: E = !0,
|
|
7062
|
-
enableWhiteboard:
|
|
7066
|
+
enableWhiteboard: z = !1,
|
|
7063
7067
|
storageConfig: j,
|
|
7064
7068
|
encryptionConfig: K,
|
|
7065
7069
|
className: Y,
|
|
7066
7070
|
style: g,
|
|
7067
7071
|
id: w,
|
|
7068
7072
|
"data-testid": Z
|
|
7069
|
-
} = i, [Q, te] =
|
|
7073
|
+
} = i, [Q, te] = N(e), [X, pe] = N(null), ue = se(
|
|
7070
7074
|
() => ({
|
|
7071
7075
|
id: `wb-${t.id}-${Date.now()}`,
|
|
7072
7076
|
title: "Whiteboard",
|
|
@@ -7086,12 +7090,12 @@ function ti(i) {
|
|
|
7086
7090
|
permissions: "edit"
|
|
7087
7091
|
}),
|
|
7088
7092
|
[t.id]
|
|
7089
|
-
), [be, he] =
|
|
7093
|
+
), [be, he] = N(p ?? null), [B, ee] = N(f ?? null), oe = p ?? be, de = f ?? B;
|
|
7090
7094
|
re(() => {
|
|
7091
7095
|
te(e);
|
|
7092
7096
|
}, [e]), re(() => {
|
|
7093
|
-
|
|
7094
|
-
}, [
|
|
7097
|
+
p !== void 0 && he(p);
|
|
7098
|
+
}, [p]), re(() => {
|
|
7095
7099
|
f !== void 0 && ee(f);
|
|
7096
7100
|
}, [f]);
|
|
7097
7101
|
const {
|
|
@@ -7100,11 +7104,11 @@ function ti(i) {
|
|
|
7100
7104
|
acceptCall: v,
|
|
7101
7105
|
declineCall: M,
|
|
7102
7106
|
endCall: F,
|
|
7103
|
-
toggleMic:
|
|
7107
|
+
toggleMic: $,
|
|
7104
7108
|
toggleCamera: J,
|
|
7105
7109
|
startScreenShare: k,
|
|
7106
7110
|
stopScreenShare: R
|
|
7107
|
-
} =
|
|
7111
|
+
} = Lt({
|
|
7108
7112
|
currentUser: t,
|
|
7109
7113
|
transport: m,
|
|
7110
7114
|
rtcConfig: u,
|
|
@@ -7114,12 +7118,12 @@ function ti(i) {
|
|
|
7114
7118
|
onIncomingCall: (ae) => {
|
|
7115
7119
|
ee(ae);
|
|
7116
7120
|
}
|
|
7117
|
-
}), ie =
|
|
7121
|
+
}), ie = T(
|
|
7118
7122
|
(ae) => {
|
|
7119
7123
|
te(ae), L == null || L(ae);
|
|
7120
7124
|
},
|
|
7121
7125
|
[L]
|
|
7122
|
-
), ne =
|
|
7126
|
+
), ne = T(
|
|
7123
7127
|
async (ae, nt) => {
|
|
7124
7128
|
if (O) {
|
|
7125
7129
|
await O(ae, nt);
|
|
@@ -7129,40 +7133,40 @@ function ti(i) {
|
|
|
7129
7133
|
he(Pt), te(ae.length > 2 ? "conference" : "call");
|
|
7130
7134
|
},
|
|
7131
7135
|
[O, b]
|
|
7132
|
-
), le =
|
|
7136
|
+
), le = T(async () => {
|
|
7133
7137
|
var ae;
|
|
7134
7138
|
U && de ? await U(de.callId) : await v(), ee(null), te(
|
|
7135
7139
|
(ae = ge.activeCall) != null && ae.participants && ge.activeCall.participants.length > 2 ? "conference" : "call"
|
|
7136
7140
|
);
|
|
7137
|
-
}, [U, de, v, ge.activeCall]), me =
|
|
7141
|
+
}, [U, de, v, ge.activeCall]), me = T(() => {
|
|
7138
7142
|
W && de ? W(de.callId) : M(), ee(null);
|
|
7139
|
-
}, [W, de, M]), ke =
|
|
7143
|
+
}, [W, de, M]), ke = T(
|
|
7140
7144
|
(ae) => {
|
|
7141
7145
|
H ? H(ae) : F(), he(null), te(e);
|
|
7142
7146
|
},
|
|
7143
7147
|
[H, F, e]
|
|
7144
|
-
), ve =
|
|
7148
|
+
), ve = T(
|
|
7145
7149
|
(ae) => {
|
|
7146
|
-
|
|
7150
|
+
$(), q == null || q(ae);
|
|
7147
7151
|
},
|
|
7148
|
-
[
|
|
7149
|
-
), Oe =
|
|
7152
|
+
[$, q]
|
|
7153
|
+
), Oe = T(
|
|
7150
7154
|
(ae) => {
|
|
7151
7155
|
J(), _ == null || _(ae);
|
|
7152
7156
|
},
|
|
7153
7157
|
[J, _]
|
|
7154
|
-
), tt =
|
|
7158
|
+
), tt = T(async () => {
|
|
7155
7159
|
await k(), await (V == null ? void 0 : V());
|
|
7156
|
-
}, [k, V]), Le =
|
|
7160
|
+
}, [k, V]), Le = T(() => {
|
|
7157
7161
|
R(), I == null || I();
|
|
7158
7162
|
}, [R, I]), Ce = {
|
|
7159
7163
|
onSendMessage: y,
|
|
7160
7164
|
onEditMessage: h,
|
|
7161
7165
|
onDeleteMessage: x,
|
|
7162
|
-
onReactToMessage:
|
|
7163
|
-
onPinMessage:
|
|
7164
|
-
onLoadMoreMessages:
|
|
7165
|
-
onMarkAsRead:
|
|
7166
|
+
onReactToMessage: P,
|
|
7167
|
+
onPinMessage: d,
|
|
7168
|
+
onLoadMoreMessages: D,
|
|
7169
|
+
onMarkAsRead: A,
|
|
7166
7170
|
onStartCall: ne,
|
|
7167
7171
|
onEndCall: ke,
|
|
7168
7172
|
onMuteAudio: ve,
|
|
@@ -7185,14 +7189,14 @@ function ti(i) {
|
|
|
7185
7189
|
style: Tt,
|
|
7186
7190
|
children: [
|
|
7187
7191
|
de && xe !== "workspace" && /* @__PURE__ */ r(
|
|
7188
|
-
|
|
7192
|
+
yn,
|
|
7189
7193
|
{
|
|
7190
7194
|
call: de,
|
|
7191
7195
|
onAccept: le,
|
|
7192
7196
|
onDecline: me
|
|
7193
7197
|
}
|
|
7194
7198
|
),
|
|
7195
|
-
xe === "bubble" && /* @__PURE__ */ r(
|
|
7199
|
+
xe === "bubble" && /* @__PURE__ */ r(mn, { props: i, onExpand: ie }),
|
|
7196
7200
|
xe === "chat" && a.length > 0 && /* @__PURE__ */ r(
|
|
7197
7201
|
He,
|
|
7198
7202
|
{
|
|
@@ -7205,7 +7209,7 @@ function ti(i) {
|
|
|
7205
7209
|
}
|
|
7206
7210
|
),
|
|
7207
7211
|
xe === "messenger" && /* @__PURE__ */ r(
|
|
7208
|
-
|
|
7212
|
+
Ut,
|
|
7209
7213
|
{
|
|
7210
7214
|
conversations: a,
|
|
7211
7215
|
messages: s,
|
|
@@ -7219,7 +7223,7 @@ function ti(i) {
|
|
|
7219
7223
|
}
|
|
7220
7224
|
),
|
|
7221
7225
|
xe === "workspace" && /* @__PURE__ */ r(
|
|
7222
|
-
|
|
7226
|
+
hn,
|
|
7223
7227
|
{
|
|
7224
7228
|
currentUser: t,
|
|
7225
7229
|
users: n,
|
|
@@ -7262,7 +7266,7 @@ function ti(i) {
|
|
|
7262
7266
|
style: { height: "100%" }
|
|
7263
7267
|
}
|
|
7264
7268
|
),
|
|
7265
|
-
xe === "whiteboard" &&
|
|
7269
|
+
xe === "whiteboard" && z && /* @__PURE__ */ r(
|
|
7266
7270
|
Ct,
|
|
7267
7271
|
{
|
|
7268
7272
|
session: X ?? ue,
|
|
@@ -7276,7 +7280,7 @@ function ti(i) {
|
|
|
7276
7280
|
}
|
|
7277
7281
|
);
|
|
7278
7282
|
}
|
|
7279
|
-
const
|
|
7283
|
+
const bn = {
|
|
7280
7284
|
messages: "Messages",
|
|
7281
7285
|
attachments: "Attachments",
|
|
7282
7286
|
"whiteboard-snapshots": "Whiteboard snapshots",
|
|
@@ -7291,7 +7295,7 @@ const hn = {
|
|
|
7291
7295
|
"AES-GCM-256": "AES-GCM 256-bit (recommended)",
|
|
7292
7296
|
"ChaCha20-Poly1305": "ChaCha20-Poly1305",
|
|
7293
7297
|
"E2E-ECDH-P384": "End-to-End ECDH P-384"
|
|
7294
|
-
},
|
|
7298
|
+
}, vn = {
|
|
7295
7299
|
messages: "Messages",
|
|
7296
7300
|
attachments: "Attachments",
|
|
7297
7301
|
whiteboard: "Whiteboard",
|
|
@@ -7300,7 +7304,7 @@ const hn = {
|
|
|
7300
7304
|
calls: "Calls (metadata)",
|
|
7301
7305
|
presence: "Presence data",
|
|
7302
7306
|
all: "Everything"
|
|
7303
|
-
},
|
|
7307
|
+
}, xn = ["days", "weeks", "months", "years", "forever"];
|
|
7304
7308
|
function ct(i) {
|
|
7305
7309
|
if (i === 0)
|
|
7306
7310
|
return "0 B";
|
|
@@ -7343,12 +7347,12 @@ function dt({
|
|
|
7343
7347
|
borderRadius: 5,
|
|
7344
7348
|
fontSize: 12
|
|
7345
7349
|
},
|
|
7346
|
-
children:
|
|
7350
|
+
children: xn.map((n) => /* @__PURE__ */ r("option", { value: n, children: n }, n))
|
|
7347
7351
|
}
|
|
7348
7352
|
)
|
|
7349
7353
|
] });
|
|
7350
7354
|
}
|
|
7351
|
-
function
|
|
7355
|
+
function wn({
|
|
7352
7356
|
config: i,
|
|
7353
7357
|
onChange: e
|
|
7354
7358
|
}) {
|
|
@@ -7413,7 +7417,7 @@ function yn({
|
|
|
7413
7417
|
{
|
|
7414
7418
|
style: { borderBottom: "1px solid var(--nice-bg-secondary, #f3f4f6)" },
|
|
7415
7419
|
children: [
|
|
7416
|
-
/* @__PURE__ */ r("td", { style: { ...Ae, fontWeight: 500, color: "var(--nice-text, #374151)" }, children:
|
|
7420
|
+
/* @__PURE__ */ r("td", { style: { ...Ae, fontWeight: 500, color: "var(--nice-text, #374151)" }, children: bn[a.dataType] }),
|
|
7417
7421
|
/* @__PURE__ */ r("td", { style: Ae, children: /* @__PURE__ */ r(
|
|
7418
7422
|
dt,
|
|
7419
7423
|
{
|
|
@@ -7517,7 +7521,7 @@ function yn({
|
|
|
7517
7521
|
] })
|
|
7518
7522
|
] });
|
|
7519
7523
|
}
|
|
7520
|
-
function
|
|
7524
|
+
function Sn({
|
|
7521
7525
|
config: i,
|
|
7522
7526
|
onChange: e
|
|
7523
7527
|
}) {
|
|
@@ -7668,7 +7672,7 @@ function bn({
|
|
|
7668
7672
|
/* @__PURE__ */ r("strong", { style: { fontSize: 12, color: "var(--nice-text, #374151)" }, children: "Per-scope overrides" }),
|
|
7669
7673
|
/* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: t.map((n) => {
|
|
7670
7674
|
var c;
|
|
7671
|
-
const a = (c = i.scopeOverrides) == null ? void 0 : c.find((
|
|
7675
|
+
const a = (c = i.scopeOverrides) == null ? void 0 : c.find((p) => p.scope === n), s = (a == null ? void 0 : a.enabled) ?? !1, o = (a == null ? void 0 : a.algorithm) ?? i.defaultAlgorithm;
|
|
7672
7676
|
return /* @__PURE__ */ l(
|
|
7673
7677
|
"div",
|
|
7674
7678
|
{
|
|
@@ -7686,30 +7690,30 @@ function bn({
|
|
|
7686
7690
|
{
|
|
7687
7691
|
type: "checkbox",
|
|
7688
7692
|
checked: s,
|
|
7689
|
-
onChange: (
|
|
7693
|
+
onChange: (p) => {
|
|
7690
7694
|
const f = [
|
|
7691
7695
|
...(i.scopeOverrides ?? []).filter((m) => m.scope !== n),
|
|
7692
|
-
{ scope: n, algorithm: o, enabled:
|
|
7696
|
+
{ scope: n, algorithm: o, enabled: p.target.checked }
|
|
7693
7697
|
];
|
|
7694
7698
|
e({ ...i, scopeOverrides: f });
|
|
7695
7699
|
}
|
|
7696
7700
|
}
|
|
7697
7701
|
),
|
|
7698
|
-
/* @__PURE__ */ r("span", { style: { minWidth: 120, fontSize: 12, color: "var(--nice-text, #374151)" }, children:
|
|
7702
|
+
/* @__PURE__ */ r("span", { style: { minWidth: 120, fontSize: 12, color: "var(--nice-text, #374151)" }, children: vn[n] }),
|
|
7699
7703
|
/* @__PURE__ */ r(
|
|
7700
7704
|
"select",
|
|
7701
7705
|
{
|
|
7702
7706
|
value: o,
|
|
7703
7707
|
disabled: !s,
|
|
7704
|
-
onChange: (
|
|
7708
|
+
onChange: (p) => {
|
|
7705
7709
|
const f = [
|
|
7706
7710
|
...(i.scopeOverrides ?? []).filter((m) => m.scope !== n),
|
|
7707
|
-
{ scope: n, algorithm:
|
|
7711
|
+
{ scope: n, algorithm: p.target.value, enabled: s }
|
|
7708
7712
|
];
|
|
7709
7713
|
e({ ...i, scopeOverrides: f });
|
|
7710
7714
|
},
|
|
7711
7715
|
style: { ...Te, flex: 1, opacity: s ? 1 : 0.4 },
|
|
7712
|
-
children: Object.entries(lt).map(([
|
|
7716
|
+
children: Object.entries(lt).map(([p, f]) => /* @__PURE__ */ r("option", { value: p, children: f }, p))
|
|
7713
7717
|
}
|
|
7714
7718
|
)
|
|
7715
7719
|
]
|
|
@@ -7720,32 +7724,39 @@ function bn({
|
|
|
7720
7724
|
] })
|
|
7721
7725
|
] });
|
|
7722
7726
|
}
|
|
7723
|
-
function
|
|
7727
|
+
function si({
|
|
7724
7728
|
storageConfig: i,
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7729
|
+
defaultStorageConfig: e,
|
|
7730
|
+
encryptionConfig: t,
|
|
7731
|
+
onStorageConfigChange: n,
|
|
7732
|
+
onEncryptionConfigChange: a,
|
|
7733
|
+
currentUsageBytes: s = 0,
|
|
7734
|
+
showEncryption: o = !0,
|
|
7735
|
+
showRetention: c = !0,
|
|
7736
|
+
showQuota: p = !0,
|
|
7737
|
+
className: f,
|
|
7738
|
+
style: m,
|
|
7739
|
+
"data-testid": u
|
|
7735
7740
|
}) {
|
|
7736
|
-
const [
|
|
7741
|
+
const [y, h] = N("retention"), [x, P] = Dt({
|
|
7742
|
+
value: i,
|
|
7743
|
+
defaultValue: e,
|
|
7744
|
+
fallbackValue: { provider: "indexeddb", retentionRules: [] },
|
|
7745
|
+
onChange: n,
|
|
7746
|
+
componentName: "NiceStorageSettings"
|
|
7747
|
+
}), d = t ?? {
|
|
7737
7748
|
enabled: !1,
|
|
7738
7749
|
defaultAlgorithm: "AES-GCM-256",
|
|
7739
7750
|
showIndicator: !0
|
|
7740
|
-
},
|
|
7741
|
-
...
|
|
7742
|
-
retentionRules:
|
|
7751
|
+
}, D = {
|
|
7752
|
+
...x,
|
|
7753
|
+
retentionRules: x.retentionRules.length > 0 ? x.retentionRules : kt
|
|
7743
7754
|
};
|
|
7744
7755
|
return /* @__PURE__ */ l(
|
|
7745
7756
|
"div",
|
|
7746
7757
|
{
|
|
7747
|
-
className:
|
|
7748
|
-
"data-testid":
|
|
7758
|
+
className: f,
|
|
7759
|
+
"data-testid": u,
|
|
7749
7760
|
style: {
|
|
7750
7761
|
display: "flex",
|
|
7751
7762
|
flexDirection: "column",
|
|
@@ -7756,7 +7767,7 @@ function ni({
|
|
|
7756
7767
|
border: "1px solid var(--nice-border, #e5e7eb)",
|
|
7757
7768
|
fontFamily: "system-ui, sans-serif",
|
|
7758
7769
|
maxWidth: 800,
|
|
7759
|
-
...
|
|
7770
|
+
...m
|
|
7760
7771
|
},
|
|
7761
7772
|
children: [
|
|
7762
7773
|
/* @__PURE__ */ l("div", { children: [
|
|
@@ -7769,7 +7780,7 @@ function ni({
|
|
|
7769
7780
|
}
|
|
7770
7781
|
)
|
|
7771
7782
|
] }),
|
|
7772
|
-
|
|
7783
|
+
p && x.quota && x.quota > 0 && /* @__PURE__ */ l("div", { children: [
|
|
7773
7784
|
/* @__PURE__ */ l(
|
|
7774
7785
|
"div",
|
|
7775
7786
|
{
|
|
@@ -7783,9 +7794,9 @@ function ni({
|
|
|
7783
7794
|
children: [
|
|
7784
7795
|
/* @__PURE__ */ r("span", { children: "Storage used" }),
|
|
7785
7796
|
/* @__PURE__ */ l("span", { children: [
|
|
7786
|
-
ct(
|
|
7797
|
+
ct(s),
|
|
7787
7798
|
" / ",
|
|
7788
|
-
ct(
|
|
7799
|
+
ct(x.quota)
|
|
7789
7800
|
] })
|
|
7790
7801
|
]
|
|
7791
7802
|
}
|
|
@@ -7794,38 +7805,38 @@ function ni({
|
|
|
7794
7805
|
"div",
|
|
7795
7806
|
{
|
|
7796
7807
|
style: {
|
|
7797
|
-
width: `${Math.min(100,
|
|
7808
|
+
width: `${Math.min(100, s / x.quota * 100)}%`,
|
|
7798
7809
|
height: "100%",
|
|
7799
|
-
background:
|
|
7810
|
+
background: s / x.quota > 0.9 ? "var(--nice-danger, #ef4444)" : "var(--nice-info, #6366f1)",
|
|
7800
7811
|
borderRadius: 3,
|
|
7801
7812
|
transition: "width 0.3s"
|
|
7802
7813
|
}
|
|
7803
7814
|
}
|
|
7804
7815
|
) })
|
|
7805
7816
|
] }),
|
|
7806
|
-
|
|
7817
|
+
c && o && /* @__PURE__ */ r(
|
|
7807
7818
|
"div",
|
|
7808
7819
|
{
|
|
7809
7820
|
style: { display: "flex", gap: 0, borderBottom: "1px solid var(--nice-border, #e5e7eb)" },
|
|
7810
|
-
children: ["retention", "encryption"].map((
|
|
7821
|
+
children: ["retention", "encryption"].map((A) => /* @__PURE__ */ r(
|
|
7811
7822
|
"button",
|
|
7812
7823
|
{
|
|
7813
|
-
onClick: () =>
|
|
7824
|
+
onClick: () => h(A),
|
|
7814
7825
|
style: {
|
|
7815
7826
|
padding: "8px 18px",
|
|
7816
7827
|
border: "none",
|
|
7817
|
-
borderBottom: `2px solid ${
|
|
7828
|
+
borderBottom: `2px solid ${y === A ? "var(--nice-info, #6366f1)" : "transparent"}`,
|
|
7818
7829
|
background: "none",
|
|
7819
7830
|
cursor: "pointer",
|
|
7820
7831
|
fontSize: 13,
|
|
7821
|
-
fontWeight:
|
|
7822
|
-
color:
|
|
7832
|
+
fontWeight: y === A ? 600 : 400,
|
|
7833
|
+
color: y === A ? "var(--nice-accent, #4f46e5)" : "var(--nice-text-secondary, #6b7280)",
|
|
7823
7834
|
marginBottom: -1,
|
|
7824
7835
|
display: "inline-flex",
|
|
7825
7836
|
alignItems: "center",
|
|
7826
7837
|
gap: 6
|
|
7827
7838
|
},
|
|
7828
|
-
children:
|
|
7839
|
+
children: A === "retention" ? /* @__PURE__ */ l(fe, { children: [
|
|
7829
7840
|
/* @__PURE__ */ r(S, { name: "archive", size: 13 }),
|
|
7830
7841
|
" Retention"
|
|
7831
7842
|
] }) : /* @__PURE__ */ l(fe, { children: [
|
|
@@ -7833,24 +7844,17 @@ function ni({
|
|
|
7833
7844
|
" Encryption"
|
|
7834
7845
|
] })
|
|
7835
7846
|
},
|
|
7836
|
-
|
|
7847
|
+
A
|
|
7837
7848
|
))
|
|
7838
7849
|
}
|
|
7839
7850
|
),
|
|
7840
7851
|
/* @__PURE__ */ l("div", { children: [
|
|
7841
|
-
(
|
|
7842
|
-
|
|
7852
|
+
(y === "retention" || !o) && c && /* @__PURE__ */ r(wn, { config: D, onChange: P }),
|
|
7853
|
+
(y === "encryption" || !c) && o && /* @__PURE__ */ r(
|
|
7854
|
+
Sn,
|
|
7843
7855
|
{
|
|
7844
|
-
config:
|
|
7845
|
-
onChange:
|
|
7846
|
-
})
|
|
7847
|
-
}
|
|
7848
|
-
),
|
|
7849
|
-
(u === "encryption" || !o) && s && /* @__PURE__ */ r(
|
|
7850
|
-
bn,
|
|
7851
|
-
{
|
|
7852
|
-
config: h,
|
|
7853
|
-
onChange: n ?? (() => {
|
|
7856
|
+
config: d,
|
|
7857
|
+
onChange: a ?? (() => {
|
|
7854
7858
|
})
|
|
7855
7859
|
}
|
|
7856
7860
|
)
|
|
@@ -7889,13 +7893,13 @@ function Ue(i) {
|
|
|
7889
7893
|
const e = Math.floor(i / 1e3), t = Math.floor(e / 60), n = Math.floor(t / 60);
|
|
7890
7894
|
return n > 0 ? `${n}:${String(t % 60).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}` : `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
|
|
7891
7895
|
}
|
|
7892
|
-
function
|
|
7896
|
+
function kn(i) {
|
|
7893
7897
|
if (i === 0)
|
|
7894
7898
|
return "0 B";
|
|
7895
7899
|
const e = 1024, t = ["B", "KB", "MB", "GB"], n = Math.floor(Math.log(i) / Math.log(e));
|
|
7896
7900
|
return `${(i / Math.pow(e, n)).toFixed(1)} ${t[n]}`;
|
|
7897
7901
|
}
|
|
7898
|
-
function
|
|
7902
|
+
function Cn(i) {
|
|
7899
7903
|
return new Intl.DateTimeFormat(void 0, {
|
|
7900
7904
|
month: "short",
|
|
7901
7905
|
day: "numeric",
|
|
@@ -7903,7 +7907,7 @@ function xn(i) {
|
|
|
7903
7907
|
minute: "2-digit"
|
|
7904
7908
|
}).format(new Date(i));
|
|
7905
7909
|
}
|
|
7906
|
-
const
|
|
7910
|
+
const In = {
|
|
7907
7911
|
idle: {
|
|
7908
7912
|
label: "Idle",
|
|
7909
7913
|
icon: null,
|
|
@@ -7941,7 +7945,7 @@ const wn = {
|
|
|
7941
7945
|
fg: "var(--nice-danger-dark, #dc2626)"
|
|
7942
7946
|
}
|
|
7943
7947
|
};
|
|
7944
|
-
function
|
|
7948
|
+
function zn({
|
|
7945
7949
|
segments: i,
|
|
7946
7950
|
onClose: e,
|
|
7947
7951
|
currentTimeMs: t = 0
|
|
@@ -7985,7 +7989,7 @@ function Sn({
|
|
|
7985
7989
|
},
|
|
7986
7990
|
children: [
|
|
7987
7991
|
/* @__PURE__ */ r("strong", { style: { fontSize: 14, color: "var(--nice-text, #111827)" }, children: "Transcript" }),
|
|
7988
|
-
/* @__PURE__ */ r("button", { onClick: e, style:
|
|
7992
|
+
/* @__PURE__ */ r("button", { onClick: e, style: Pn, "aria-label": "Close", children: /* @__PURE__ */ r(S, { name: "close", size: 16 }) })
|
|
7989
7993
|
]
|
|
7990
7994
|
}
|
|
7991
7995
|
),
|
|
@@ -8066,21 +8070,21 @@ function Sn({
|
|
|
8066
8070
|
);
|
|
8067
8071
|
}
|
|
8068
8072
|
function It({ startedAt: i }) {
|
|
8069
|
-
const [e, t] =
|
|
8073
|
+
const [e, t] = N(0);
|
|
8070
8074
|
return re(() => {
|
|
8071
8075
|
const n = new Date(i).getTime(), a = setInterval(() => t(Date.now() - n), 500);
|
|
8072
8076
|
return () => clearInterval(a);
|
|
8073
8077
|
}, [i]), /* @__PURE__ */ r(fe, { children: Ue(e) });
|
|
8074
8078
|
}
|
|
8075
|
-
function
|
|
8079
|
+
function Tn({
|
|
8076
8080
|
rec: i,
|
|
8077
8081
|
onDelete: e,
|
|
8078
8082
|
onDownload: t
|
|
8079
8083
|
}) {
|
|
8080
|
-
const [n, a] =
|
|
8084
|
+
const [n, a] = N(!1), [s, o] = N(0), c = ce(null), p = In[i.state], f = i.state === "recording" || i.state === "paused";
|
|
8081
8085
|
return /* @__PURE__ */ l(fe, { children: [
|
|
8082
8086
|
n && i.transcript && /* @__PURE__ */ r(
|
|
8083
|
-
|
|
8087
|
+
zn,
|
|
8084
8088
|
{
|
|
8085
8089
|
segments: i.transcript,
|
|
8086
8090
|
currentTimeMs: s,
|
|
@@ -8132,9 +8136,9 @@ function kn({
|
|
|
8132
8136
|
gap: 8
|
|
8133
8137
|
},
|
|
8134
8138
|
children: [
|
|
8135
|
-
/* @__PURE__ */ r("span", { children:
|
|
8139
|
+
/* @__PURE__ */ r("span", { children: Cn(i.startedAt) }),
|
|
8136
8140
|
/* @__PURE__ */ r("span", { children: f ? /* @__PURE__ */ r(It, { startedAt: i.startedAt }) : i.durationMs != null ? Ue(i.durationMs) : "—" }),
|
|
8137
|
-
i.size != null && /* @__PURE__ */ r("span", { children:
|
|
8141
|
+
i.size != null && /* @__PURE__ */ r("span", { children: kn(i.size) }),
|
|
8138
8142
|
/* @__PURE__ */ l("span", { children: [
|
|
8139
8143
|
i.participants.length,
|
|
8140
8144
|
" participants"
|
|
@@ -8150,8 +8154,8 @@ function kn({
|
|
|
8150
8154
|
fontSize: 11,
|
|
8151
8155
|
padding: "2px 8px",
|
|
8152
8156
|
borderRadius: 20,
|
|
8153
|
-
background:
|
|
8154
|
-
color:
|
|
8157
|
+
background: p.bg,
|
|
8158
|
+
color: p.fg,
|
|
8155
8159
|
fontWeight: 500,
|
|
8156
8160
|
whiteSpace: "nowrap",
|
|
8157
8161
|
display: "inline-flex",
|
|
@@ -8159,8 +8163,8 @@ function kn({
|
|
|
8159
8163
|
gap: 3
|
|
8160
8164
|
},
|
|
8161
8165
|
children: [
|
|
8162
|
-
|
|
8163
|
-
|
|
8166
|
+
p.icon && /* @__PURE__ */ r(S, { name: p.icon, size: 11 }),
|
|
8167
|
+
p.label
|
|
8164
8168
|
]
|
|
8165
8169
|
}
|
|
8166
8170
|
),
|
|
@@ -8213,7 +8217,7 @@ function kn({
|
|
|
8213
8217
|
)
|
|
8214
8218
|
] });
|
|
8215
8219
|
}
|
|
8216
|
-
function
|
|
8220
|
+
function oi({
|
|
8217
8221
|
recordings: i,
|
|
8218
8222
|
onRecordingStart: e,
|
|
8219
8223
|
onRecordingStop: t,
|
|
@@ -8222,24 +8226,24 @@ function ii({
|
|
|
8222
8226
|
onRecordingDelete: s,
|
|
8223
8227
|
onRecordingDownload: o,
|
|
8224
8228
|
activeRecordingId: c,
|
|
8225
|
-
sessionType:
|
|
8229
|
+
sessionType: p = "meeting",
|
|
8226
8230
|
className: f,
|
|
8227
8231
|
style: m,
|
|
8228
8232
|
"data-testid": u
|
|
8229
8233
|
}) {
|
|
8230
|
-
const [y, h] =
|
|
8234
|
+
const [y, h] = N(i ?? []), [x, P] = N(""), [d, D] = N("all");
|
|
8231
8235
|
re(() => {
|
|
8232
8236
|
i && h(i);
|
|
8233
8237
|
}, [i]);
|
|
8234
|
-
const
|
|
8235
|
-
const V =
|
|
8238
|
+
const A = y.find((_) => _.id === c), O = (A == null ? void 0 : A.state) === "recording", U = (A == null ? void 0 : A.state) === "paused", W = y.filter((_) => {
|
|
8239
|
+
const V = d === "all" || _.sessionType === d, I = !x || (_.title ?? "").toLowerCase().includes(x.toLowerCase()) || _.id.includes(x);
|
|
8236
8240
|
return V && I;
|
|
8237
|
-
}), H =
|
|
8241
|
+
}), H = T(
|
|
8238
8242
|
(_) => {
|
|
8239
8243
|
h((V) => V.filter((I) => I.id !== _)), s == null || s(_);
|
|
8240
8244
|
},
|
|
8241
8245
|
[s]
|
|
8242
|
-
), q =
|
|
8246
|
+
), q = T(
|
|
8243
8247
|
(_) => {
|
|
8244
8248
|
if (o) {
|
|
8245
8249
|
o(_.id);
|
|
@@ -8306,7 +8310,7 @@ function ii({
|
|
|
8306
8310
|
/* @__PURE__ */ l(
|
|
8307
8311
|
"select",
|
|
8308
8312
|
{
|
|
8309
|
-
value:
|
|
8313
|
+
value: p,
|
|
8310
8314
|
disabled: O || U,
|
|
8311
8315
|
onChange: () => {
|
|
8312
8316
|
},
|
|
@@ -8378,11 +8382,11 @@ function ii({
|
|
|
8378
8382
|
]
|
|
8379
8383
|
}
|
|
8380
8384
|
),
|
|
8381
|
-
|
|
8385
|
+
A && /* @__PURE__ */ r(
|
|
8382
8386
|
"span",
|
|
8383
8387
|
{
|
|
8384
8388
|
style: { fontSize: 12, color: "var(--nice-text-muted, #9ca3af)", marginLeft: 4 },
|
|
8385
|
-
children: /* @__PURE__ */ r(It, { startedAt:
|
|
8389
|
+
children: /* @__PURE__ */ r(It, { startedAt: A.startedAt })
|
|
8386
8390
|
}
|
|
8387
8391
|
)
|
|
8388
8392
|
] })
|
|
@@ -8405,7 +8409,7 @@ function ii({
|
|
|
8405
8409
|
{
|
|
8406
8410
|
type: "search",
|
|
8407
8411
|
value: x,
|
|
8408
|
-
onChange: (_) =>
|
|
8412
|
+
onChange: (_) => P(_.target.value),
|
|
8409
8413
|
placeholder: "Search recordings…",
|
|
8410
8414
|
style: {
|
|
8411
8415
|
flex: 1,
|
|
@@ -8419,8 +8423,8 @@ function ii({
|
|
|
8419
8423
|
/* @__PURE__ */ l(
|
|
8420
8424
|
"select",
|
|
8421
8425
|
{
|
|
8422
|
-
value:
|
|
8423
|
-
onChange: (_) =>
|
|
8426
|
+
value: d,
|
|
8427
|
+
onChange: (_) => D(_.target.value),
|
|
8424
8428
|
style: pt,
|
|
8425
8429
|
children: [
|
|
8426
8430
|
/* @__PURE__ */ r("option", { value: "all", children: "All types" }),
|
|
@@ -8453,7 +8457,7 @@ function ii({
|
|
|
8453
8457
|
]
|
|
8454
8458
|
}
|
|
8455
8459
|
) : W.map((_) => /* @__PURE__ */ r(
|
|
8456
|
-
|
|
8460
|
+
Tn,
|
|
8457
8461
|
{
|
|
8458
8462
|
rec: _,
|
|
8459
8463
|
onDelete: H,
|
|
@@ -8490,7 +8494,7 @@ const Ve = {
|
|
|
8490
8494
|
fontSize: 12,
|
|
8491
8495
|
color: "var(--nice-text, #374151)",
|
|
8492
8496
|
background: "var(--nice-bg, #fff)"
|
|
8493
|
-
},
|
|
8497
|
+
}, Pn = {
|
|
8494
8498
|
border: "none",
|
|
8495
8499
|
background: "none",
|
|
8496
8500
|
cursor: "pointer",
|
|
@@ -8557,7 +8561,7 @@ function ft({
|
|
|
8557
8561
|
}
|
|
8558
8562
|
);
|
|
8559
8563
|
}
|
|
8560
|
-
function
|
|
8564
|
+
function Rn({ participant: i, containerRect: e }) {
|
|
8561
8565
|
if (!i.cursorX || !i.cursorY || !e)
|
|
8562
8566
|
return null;
|
|
8563
8567
|
const t = i.cursorX, n = i.cursorY;
|
|
@@ -8602,7 +8606,7 @@ function In({ participant: i, containerRect: e }) {
|
|
|
8602
8606
|
}
|
|
8603
8607
|
);
|
|
8604
8608
|
}
|
|
8605
|
-
function
|
|
8609
|
+
function An({ count: i }) {
|
|
8606
8610
|
return i === 0 ? null : /* @__PURE__ */ l(
|
|
8607
8611
|
"div",
|
|
8608
8612
|
{
|
|
@@ -8635,7 +8639,7 @@ function zn({ count: i }) {
|
|
|
8635
8639
|
}
|
|
8636
8640
|
);
|
|
8637
8641
|
}
|
|
8638
|
-
function
|
|
8642
|
+
function Dn() {
|
|
8639
8643
|
return /* @__PURE__ */ r(
|
|
8640
8644
|
"div",
|
|
8641
8645
|
{
|
|
@@ -8673,7 +8677,7 @@ function Tn() {
|
|
|
8673
8677
|
}
|
|
8674
8678
|
);
|
|
8675
8679
|
}
|
|
8676
|
-
function
|
|
8680
|
+
function En({ pending: i }) {
|
|
8677
8681
|
return i === 0 ? /* @__PURE__ */ l(
|
|
8678
8682
|
"span",
|
|
8679
8683
|
{
|
|
@@ -8708,7 +8712,7 @@ function Pn({ pending: i }) {
|
|
|
8708
8712
|
}
|
|
8709
8713
|
);
|
|
8710
8714
|
}
|
|
8711
|
-
function
|
|
8715
|
+
function Nn({
|
|
8712
8716
|
participant: i,
|
|
8713
8717
|
isFollowing: e,
|
|
8714
8718
|
onClick: t
|
|
@@ -8737,7 +8741,7 @@ function Rn({
|
|
|
8737
8741
|
}
|
|
8738
8742
|
);
|
|
8739
8743
|
}
|
|
8740
|
-
function
|
|
8744
|
+
function li({
|
|
8741
8745
|
editorType: i,
|
|
8742
8746
|
sessionId: e,
|
|
8743
8747
|
currentUser: t,
|
|
@@ -8746,34 +8750,34 @@ function ri({
|
|
|
8746
8750
|
onParticipantJoin: s,
|
|
8747
8751
|
onParticipantLeave: o,
|
|
8748
8752
|
onCursorMove: c,
|
|
8749
|
-
isReadOnly:
|
|
8753
|
+
isReadOnly: p = !1,
|
|
8750
8754
|
showParticipants: f = !0,
|
|
8751
8755
|
showCursors: m = !0,
|
|
8752
8756
|
pendingOperations: u = 0,
|
|
8753
8757
|
conflictCount: y = 0,
|
|
8754
8758
|
className: h,
|
|
8755
8759
|
style: x,
|
|
8756
|
-
children:
|
|
8757
|
-
"data-testid":
|
|
8760
|
+
children: P,
|
|
8761
|
+
"data-testid": d
|
|
8758
8762
|
}) {
|
|
8759
|
-
const
|
|
8763
|
+
const D = ce(null), [A, O] = N(null), [U, W] = N(null), [H, q] = N(!1);
|
|
8760
8764
|
re(() => {
|
|
8761
|
-
const E =
|
|
8765
|
+
const E = D.current;
|
|
8762
8766
|
if (!E)
|
|
8763
8767
|
return;
|
|
8764
|
-
const
|
|
8765
|
-
return
|
|
8768
|
+
const z = new ResizeObserver(() => O(E.getBoundingClientRect()));
|
|
8769
|
+
return z.observe(E), O(E.getBoundingClientRect()), () => z.disconnect();
|
|
8766
8770
|
}, []);
|
|
8767
|
-
const _ =
|
|
8771
|
+
const _ = T(
|
|
8768
8772
|
(E) => {
|
|
8769
|
-
if (!
|
|
8773
|
+
if (!D.current || !c)
|
|
8770
8774
|
return;
|
|
8771
|
-
const
|
|
8772
|
-
c(E.clientX -
|
|
8775
|
+
const z = D.current.getBoundingClientRect();
|
|
8776
|
+
c(E.clientX - z.left, E.clientY - z.top);
|
|
8773
8777
|
},
|
|
8774
8778
|
[c]
|
|
8775
|
-
), V =
|
|
8776
|
-
W((
|
|
8779
|
+
), V = T((E) => {
|
|
8780
|
+
W((z) => z === E ? null : E);
|
|
8777
8781
|
}, []), I = {
|
|
8778
8782
|
vector: { icon: "pen", label: "Vector" },
|
|
8779
8783
|
pixel: { icon: "image", label: "Pixel" },
|
|
@@ -8812,9 +8816,9 @@ function ri({
|
|
|
8812
8816
|
}
|
|
8813
8817
|
),
|
|
8814
8818
|
/* @__PURE__ */ r("span", { style: { flex: 1 } }),
|
|
8815
|
-
/* @__PURE__ */ r(
|
|
8819
|
+
/* @__PURE__ */ r(En, { pending: u }),
|
|
8816
8820
|
f && n.length > 0 && /* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: -4 }, children: [
|
|
8817
|
-
n.slice(0, 5).map((E,
|
|
8821
|
+
n.slice(0, 5).map((E, z) => /* @__PURE__ */ r("div", { style: { marginLeft: z > 0 ? -8 : 0, zIndex: 10 - z }, children: /* @__PURE__ */ r(
|
|
8818
8822
|
ft,
|
|
8819
8823
|
{
|
|
8820
8824
|
participant: E,
|
|
@@ -8872,11 +8876,11 @@ function ri({
|
|
|
8872
8876
|
), L = /* @__PURE__ */ l(
|
|
8873
8877
|
"div",
|
|
8874
8878
|
{
|
|
8875
|
-
ref:
|
|
8879
|
+
ref: D,
|
|
8876
8880
|
onMouseMove: _,
|
|
8877
8881
|
style: { width: "100%", height: "100%", position: "relative", overflow: "hidden" },
|
|
8878
8882
|
children: [
|
|
8879
|
-
|
|
8883
|
+
P ?? /* @__PURE__ */ l(
|
|
8880
8884
|
"div",
|
|
8881
8885
|
{
|
|
8882
8886
|
id: `collab-editor-${i}-${e}`,
|
|
@@ -8913,9 +8917,9 @@ function ri({
|
|
|
8913
8917
|
]
|
|
8914
8918
|
}
|
|
8915
8919
|
),
|
|
8916
|
-
m && n.filter((E) => E.user.id !== t.id && E.cursorX != null && E.cursorY != null).map((E) => /* @__PURE__ */ r(
|
|
8917
|
-
/* @__PURE__ */ r(
|
|
8918
|
-
|
|
8920
|
+
m && n.filter((E) => E.user.id !== t.id && E.cursorX != null && E.cursorY != null).map((E) => /* @__PURE__ */ r(Rn, { participant: E, containerRect: A }, E.user.id)),
|
|
8921
|
+
/* @__PURE__ */ r(An, { count: y }),
|
|
8922
|
+
p && /* @__PURE__ */ r(Dn, {})
|
|
8919
8923
|
]
|
|
8920
8924
|
}
|
|
8921
8925
|
), G = H && n.length > 0 ? /* @__PURE__ */ l(
|
|
@@ -9003,7 +9007,7 @@ function ri({
|
|
|
9003
9007
|
] })
|
|
9004
9008
|
] }),
|
|
9005
9009
|
E.user.id !== t.id && /* @__PURE__ */ r(
|
|
9006
|
-
|
|
9010
|
+
Nn,
|
|
9007
9011
|
{
|
|
9008
9012
|
participant: E,
|
|
9009
9013
|
isFollowing: U === E.user.id,
|
|
@@ -9022,7 +9026,7 @@ function ri({
|
|
|
9022
9026
|
{
|
|
9023
9027
|
flush: !0,
|
|
9024
9028
|
className: h,
|
|
9025
|
-
"data-testid":
|
|
9029
|
+
"data-testid": d,
|
|
9026
9030
|
style: {
|
|
9027
9031
|
background: "var(--nice-bg, #fff)",
|
|
9028
9032
|
fontFamily: "system-ui, sans-serif",
|
|
@@ -9046,13 +9050,13 @@ function et(i) {
|
|
|
9046
9050
|
t[n] = e.charCodeAt(n);
|
|
9047
9051
|
return t;
|
|
9048
9052
|
}
|
|
9049
|
-
function
|
|
9053
|
+
function $n(i) {
|
|
9050
9054
|
return new TextEncoder().encode(i);
|
|
9051
9055
|
}
|
|
9052
|
-
function
|
|
9056
|
+
function Mn(i) {
|
|
9053
9057
|
return new TextDecoder().decode(i);
|
|
9054
9058
|
}
|
|
9055
|
-
async function
|
|
9059
|
+
async function On(i) {
|
|
9056
9060
|
return crypto.subtle.generateKey(
|
|
9057
9061
|
{ name: "AES-GCM", length: i },
|
|
9058
9062
|
!0,
|
|
@@ -9060,10 +9064,10 @@ async function En(i) {
|
|
|
9060
9064
|
["encrypt", "decrypt"]
|
|
9061
9065
|
);
|
|
9062
9066
|
}
|
|
9063
|
-
async function
|
|
9067
|
+
async function Ln() {
|
|
9064
9068
|
return crypto.subtle.generateKey({ name: "ECDH", namedCurve: "P-384" }, !0, ["deriveKey"]);
|
|
9065
9069
|
}
|
|
9066
|
-
async function
|
|
9070
|
+
async function Wn(i, e) {
|
|
9067
9071
|
return crypto.subtle.deriveKey(
|
|
9068
9072
|
{ name: "ECDH", public: e },
|
|
9069
9073
|
i,
|
|
@@ -9072,17 +9076,17 @@ async function Nn(i, e) {
|
|
|
9072
9076
|
["encrypt", "decrypt"]
|
|
9073
9077
|
);
|
|
9074
9078
|
}
|
|
9075
|
-
async function
|
|
9076
|
-
const t = crypto.getRandomValues(new Uint8Array(12)), n =
|
|
9079
|
+
async function _n(i, e) {
|
|
9080
|
+
const t = crypto.getRandomValues(new Uint8Array(12)), n = $n(e), a = await crypto.subtle.encrypt(
|
|
9077
9081
|
{ name: "AES-GCM", iv: t },
|
|
9078
9082
|
i,
|
|
9079
9083
|
n
|
|
9080
9084
|
), s = new Uint8Array(a), o = new Uint8Array(12 + s.length);
|
|
9081
9085
|
return o.set(t, 0), o.set(s, 12), Ze(o);
|
|
9082
9086
|
}
|
|
9083
|
-
async function
|
|
9087
|
+
async function Fn(i, e) {
|
|
9084
9088
|
const t = et(e), n = t.slice(0, 12), a = t.slice(12), s = await crypto.subtle.decrypt({ name: "AES-GCM", iv: n }, i, a);
|
|
9085
|
-
return
|
|
9089
|
+
return Mn(new Uint8Array(s));
|
|
9086
9090
|
}
|
|
9087
9091
|
async function ut(i, e) {
|
|
9088
9092
|
const t = et(i);
|
|
@@ -9094,15 +9098,15 @@ async function ut(i, e) {
|
|
|
9094
9098
|
["encrypt", "decrypt"]
|
|
9095
9099
|
);
|
|
9096
9100
|
}
|
|
9097
|
-
async function
|
|
9101
|
+
async function jn(i) {
|
|
9098
9102
|
const e = await crypto.subtle.exportKey("raw", i);
|
|
9099
9103
|
return Ze(new Uint8Array(e));
|
|
9100
9104
|
}
|
|
9101
|
-
async function
|
|
9105
|
+
async function Bn(i) {
|
|
9102
9106
|
const e = await crypto.subtle.exportKey("spki", i);
|
|
9103
9107
|
return Ze(new Uint8Array(e));
|
|
9104
9108
|
}
|
|
9105
|
-
async function
|
|
9109
|
+
async function Un(i) {
|
|
9106
9110
|
const e = et(i);
|
|
9107
9111
|
return crypto.subtle.importKey(
|
|
9108
9112
|
"spki",
|
|
@@ -9112,7 +9116,7 @@ async function _n(i) {
|
|
|
9112
9116
|
[]
|
|
9113
9117
|
);
|
|
9114
9118
|
}
|
|
9115
|
-
class
|
|
9119
|
+
class Hn {
|
|
9116
9120
|
constructor(e) {
|
|
9117
9121
|
this.keys = {}, this.ready = !1, this.config = e;
|
|
9118
9122
|
}
|
|
@@ -9126,10 +9130,10 @@ class Fn {
|
|
|
9126
9130
|
if (this.config.keyMaterial)
|
|
9127
9131
|
e === "AES-GCM-128" ? this.keys.aes128 = await ut(this.config.keyMaterial, 128) : this.keys.aes256 = await ut(this.config.keyMaterial, 256);
|
|
9128
9132
|
else if (e === "AES-GCM-256" || e === "AES-GCM-128") {
|
|
9129
|
-
const t = e === "AES-GCM-256" ? 256 : 128, n = await
|
|
9133
|
+
const t = e === "AES-GCM-256" ? 256 : 128, n = await On(t);
|
|
9130
9134
|
t === 128 ? this.keys.aes128 = n : this.keys.aes256 = n;
|
|
9131
9135
|
} else if (e === "E2E-ECDH-P384") {
|
|
9132
|
-
const t = await
|
|
9136
|
+
const t = await Ln();
|
|
9133
9137
|
this.keys.ecdhPrivate = t.privateKey, this.keys.ecdhPublic = t.publicKey, this.keys.ecdhSessionKeys = /* @__PURE__ */ new Map();
|
|
9134
9138
|
}
|
|
9135
9139
|
this.ready = !0;
|
|
@@ -9137,14 +9141,14 @@ class Fn {
|
|
|
9137
9141
|
// ── Key exchange (E2E) ────────────────────────────────────────────────────
|
|
9138
9142
|
/** Export local ECDH public key — broadcast this to peers */
|
|
9139
9143
|
async getPublicKeyForPeer() {
|
|
9140
|
-
return this.keys.ecdhPublic ?
|
|
9144
|
+
return this.keys.ecdhPublic ? Bn(this.keys.ecdhPublic) : null;
|
|
9141
9145
|
}
|
|
9142
9146
|
/** Register a peer's ECDH public key to derive a shared session key */
|
|
9143
9147
|
async registerPeerPublicKey(e, t) {
|
|
9144
9148
|
var s;
|
|
9145
9149
|
if (!this.keys.ecdhPrivate)
|
|
9146
9150
|
return;
|
|
9147
|
-
const n = await
|
|
9151
|
+
const n = await Un(t), a = await Wn(this.keys.ecdhPrivate, n);
|
|
9148
9152
|
(s = this.keys.ecdhSessionKeys) == null || s.set(e, a);
|
|
9149
9153
|
}
|
|
9150
9154
|
// ── Encrypt / Decrypt ─────────────────────────────────────────────────────
|
|
@@ -9180,7 +9184,7 @@ class Fn {
|
|
|
9180
9184
|
if (a === "none")
|
|
9181
9185
|
return e;
|
|
9182
9186
|
const s = this.getKey(a, n);
|
|
9183
|
-
return s ?
|
|
9187
|
+
return s ? _n(s, e) : (console.warn(`EncryptionService: no key found for algorithm "${a}" — returning plaintext`), e);
|
|
9184
9188
|
}
|
|
9185
9189
|
async decrypt(e, t, n) {
|
|
9186
9190
|
if (!this.config.enabled)
|
|
@@ -9191,13 +9195,13 @@ class Fn {
|
|
|
9191
9195
|
if (a === "none")
|
|
9192
9196
|
return e;
|
|
9193
9197
|
const s = this.getKey(a, n);
|
|
9194
|
-
return s ?
|
|
9198
|
+
return s ? Fn(s, e) : (console.warn(`EncryptionService: no key found for algorithm "${a}" — returning as-is`), e);
|
|
9195
9199
|
}
|
|
9196
9200
|
// ── Utilities ─────────────────────────────────────────────────────────────
|
|
9197
9201
|
/** Export the symmetric key for backup / persistence */
|
|
9198
9202
|
async exportSymmetricKey(e) {
|
|
9199
9203
|
const t = e ?? this.config.defaultAlgorithm, n = this.getKey(t);
|
|
9200
|
-
return n ?
|
|
9204
|
+
return n ? jn(n) : null;
|
|
9201
9205
|
}
|
|
9202
9206
|
isEnabled() {
|
|
9203
9207
|
return this.config.enabled;
|
|
@@ -9210,19 +9214,19 @@ class Fn {
|
|
|
9210
9214
|
}
|
|
9211
9215
|
}
|
|
9212
9216
|
const je = /* @__PURE__ */ new Map();
|
|
9213
|
-
function
|
|
9214
|
-
return je.has(i) || je.set(i, new
|
|
9217
|
+
function ci(i, e) {
|
|
9218
|
+
return je.has(i) || je.set(i, new Hn(e)), je.get(i);
|
|
9215
9219
|
}
|
|
9216
|
-
function
|
|
9220
|
+
function di(i) {
|
|
9217
9221
|
je.delete(i);
|
|
9218
9222
|
}
|
|
9219
|
-
class
|
|
9223
|
+
class Kn {
|
|
9220
9224
|
constructor(e = {}) {
|
|
9221
9225
|
this.recorder = null, this.chunks = [], this.session = null, this.recognition = null, this.segmentCounter = 0, this.callbacks = e;
|
|
9222
9226
|
}
|
|
9223
9227
|
// ── Start ──────────────────────────────────────────────────────────────────
|
|
9224
9228
|
start(e, t) {
|
|
9225
|
-
var c,
|
|
9229
|
+
var c, p, f;
|
|
9226
9230
|
if (((c = this.recorder) == null ? void 0 : c.state) === "recording")
|
|
9227
9231
|
throw new Error("Recording already in progress");
|
|
9228
9232
|
const n = t.mimeType ?? this.chooseMimeType(), a = new MediaRecorder(e, { mimeType: n });
|
|
@@ -9245,7 +9249,7 @@ class jn {
|
|
|
9245
9249
|
}, a.onerror = (m) => {
|
|
9246
9250
|
var u, y, h, x;
|
|
9247
9251
|
(y = (u = this.callbacks).onError) == null || y.call(u, new Error(String(m))), this.session && (this.session.state = "failed"), (x = (h = this.callbacks).onStateChange) == null || x.call(h, "failed");
|
|
9248
|
-
}, a.start(t.timesliceMs ?? 1e3), this.recorder = a, t.transcribe && this.startTranscription(t.speakerId ?? "unknown", t.speakerName ?? "Participant"), (f = (
|
|
9252
|
+
}, a.start(t.timesliceMs ?? 1e3), this.recorder = a, t.transcribe && this.startTranscription(t.speakerId ?? "unknown", t.speakerName ?? "Participant"), (f = (p = this.callbacks).onStateChange) == null || f.call(p, "recording"), this.session;
|
|
9249
9253
|
}
|
|
9250
9254
|
// ── Pause / Resume ────────────────────────────────────────────────────────
|
|
9251
9255
|
pause() {
|
|
@@ -9271,12 +9275,12 @@ class jn {
|
|
|
9271
9275
|
const o = Date.now();
|
|
9272
9276
|
s.onresult = (c) => {
|
|
9273
9277
|
var f, m;
|
|
9274
|
-
const
|
|
9275
|
-
for (let u = c.resultIndex; u <
|
|
9276
|
-
const y =
|
|
9278
|
+
const p = c.results;
|
|
9279
|
+
for (let u = c.resultIndex; u < p.length; u++) {
|
|
9280
|
+
const y = p[u];
|
|
9277
9281
|
if (!y.isFinal)
|
|
9278
9282
|
continue;
|
|
9279
|
-
const h = y[0], x = Date.now(),
|
|
9283
|
+
const h = y[0], x = Date.now(), P = {
|
|
9280
9284
|
id: `seg_${++this.segmentCounter}`,
|
|
9281
9285
|
speakerId: e,
|
|
9282
9286
|
speakerName: t,
|
|
@@ -9285,7 +9289,7 @@ class jn {
|
|
|
9285
9289
|
endMs: x - o,
|
|
9286
9290
|
confidence: h.confidence ?? 0.9
|
|
9287
9291
|
};
|
|
9288
|
-
this.session && (this.session.transcript = [...this.session.transcript ?? [],
|
|
9292
|
+
this.session && (this.session.transcript = [...this.session.transcript ?? [], P]), (m = (f = this.callbacks).onTranscriptSegment) == null || m.call(f, P);
|
|
9289
9293
|
}
|
|
9290
9294
|
}, s.onerror = () => {
|
|
9291
9295
|
};
|
|
@@ -9334,13 +9338,13 @@ class jn {
|
|
|
9334
9338
|
}
|
|
9335
9339
|
}
|
|
9336
9340
|
const Be = /* @__PURE__ */ new Map();
|
|
9337
|
-
function
|
|
9338
|
-
return Be.has(i) || Be.set(i, new
|
|
9341
|
+
function pi(i, e) {
|
|
9342
|
+
return Be.has(i) || Be.set(i, new Kn(e)), Be.get(i);
|
|
9339
9343
|
}
|
|
9340
|
-
function
|
|
9344
|
+
function fi(i) {
|
|
9341
9345
|
Be.delete(i);
|
|
9342
9346
|
}
|
|
9343
|
-
class
|
|
9347
|
+
class Yn {
|
|
9344
9348
|
constructor(e) {
|
|
9345
9349
|
this.events = [], this.eventListeners = /* @__PURE__ */ new Map(), this.config = {
|
|
9346
9350
|
serverUrl: e.serverUrl,
|
|
@@ -9405,17 +9409,17 @@ class Bn {
|
|
|
9405
9409
|
/^#/,
|
|
9406
9410
|
/unsubscribe/i
|
|
9407
9411
|
], a = /<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi;
|
|
9408
|
-
return e.replace(a, (s, o, c,
|
|
9412
|
+
return e.replace(a, (s, o, c, p) => {
|
|
9409
9413
|
if (n.some((y) => y.test(c)))
|
|
9410
9414
|
return s;
|
|
9411
|
-
const m = this.extractLinkName(o +
|
|
9415
|
+
const m = this.extractLinkName(o + p) ?? c, u = this.wrapLink({
|
|
9412
9416
|
url: c,
|
|
9413
9417
|
messageId: t.messageId,
|
|
9414
9418
|
recipientId: t.recipientId,
|
|
9415
9419
|
campaignId: t.campaignId,
|
|
9416
9420
|
linkName: m
|
|
9417
9421
|
});
|
|
9418
|
-
return `<a ${o}href="${this.escapeHtml(u)}"${
|
|
9422
|
+
return `<a ${o}href="${this.escapeHtml(u)}"${p}>`;
|
|
9419
9423
|
});
|
|
9420
9424
|
}
|
|
9421
9425
|
/* ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -9461,7 +9465,7 @@ class Bn {
|
|
|
9461
9465
|
getStats(e) {
|
|
9462
9466
|
let t = this.events;
|
|
9463
9467
|
e && (t = this.events.filter((y) => !(e.campaignId && y.campaignId !== e.campaignId || e.messageId && y.messageId !== e.messageId || e.startDate && y.timestamp < e.startDate || e.endDate && y.timestamp > e.endDate)));
|
|
9464
|
-
const n = new Set(t.map((y) => y.recipientHash)), a = t.filter((y) => y.type === "open"), s = t.filter((y) => y.type === "click"), o = t.filter((y) => y.type === "bounce"), c = t.filter((y) => y.type === "unsubscribe"),
|
|
9468
|
+
const n = new Set(t.map((y) => y.recipientHash)), a = t.filter((y) => y.type === "open"), s = t.filter((y) => y.type === "click"), o = t.filter((y) => y.type === "bounce"), c = t.filter((y) => y.type === "unsubscribe"), p = t.filter((y) => y.type === "complaint"), f = new Set(a.map((y) => y.recipientHash)).size, m = new Set(s.map((y) => y.recipientHash)).size, u = n.size;
|
|
9465
9469
|
return {
|
|
9466
9470
|
sent: u + o.length,
|
|
9467
9471
|
delivered: u,
|
|
@@ -9471,7 +9475,7 @@ class Bn {
|
|
|
9471
9475
|
uniqueClicks: m,
|
|
9472
9476
|
bounces: o.length,
|
|
9473
9477
|
unsubscribes: c.length,
|
|
9474
|
-
complaints:
|
|
9478
|
+
complaints: p.length,
|
|
9475
9479
|
openRate: u > 0 ? f / u : 0,
|
|
9476
9480
|
clickRate: u > 0 ? m / u : 0,
|
|
9477
9481
|
clickToOpenRate: f > 0 ? m / f : 0,
|
|
@@ -9488,8 +9492,8 @@ class Bn {
|
|
|
9488
9492
|
for (const o of t) {
|
|
9489
9493
|
const c = o.url;
|
|
9490
9494
|
n.has(c) || n.set(c, { url: c, linkName: void 0, total: 0, unique: /* @__PURE__ */ new Set() });
|
|
9491
|
-
const
|
|
9492
|
-
|
|
9495
|
+
const p = n.get(c);
|
|
9496
|
+
p.total++, p.unique.add(o.recipientHash);
|
|
9493
9497
|
}
|
|
9494
9498
|
const a = t.length, s = [];
|
|
9495
9499
|
for (const [, o] of n)
|
|
@@ -9628,14 +9632,14 @@ class Bn {
|
|
|
9628
9632
|
}
|
|
9629
9633
|
let Se = null;
|
|
9630
9634
|
function ht(i) {
|
|
9631
|
-
if (!Se && i && (Se = new
|
|
9635
|
+
if (!Se && i && (Se = new Yn(i)), !Se)
|
|
9632
9636
|
throw new Error("EmailTrackingService not initialized. Call with config first.");
|
|
9633
9637
|
return Se;
|
|
9634
9638
|
}
|
|
9635
|
-
function
|
|
9639
|
+
function ui() {
|
|
9636
9640
|
Se == null || Se.clearEvents(), Se = null;
|
|
9637
9641
|
}
|
|
9638
|
-
function
|
|
9642
|
+
function hi(i) {
|
|
9639
9643
|
const { config: e, campaignId: t, autoRefreshInterval: n } = i, a = se(() => {
|
|
9640
9644
|
if (e)
|
|
9641
9645
|
return ht(e);
|
|
@@ -9644,8 +9648,8 @@ function di(i) {
|
|
|
9644
9648
|
} catch {
|
|
9645
9649
|
return null;
|
|
9646
9650
|
}
|
|
9647
|
-
}, [e]), [s, o] =
|
|
9648
|
-
a && (o(a.getStats({ campaignId: t })),
|
|
9651
|
+
}, [e]), [s, o] = N(null), [c, p] = N([]), f = T(() => {
|
|
9652
|
+
a && (o(a.getStats({ campaignId: t })), p(a.getLinkStats({ campaignId: t })));
|
|
9649
9653
|
}, [a, t]);
|
|
9650
9654
|
re(() => {
|
|
9651
9655
|
if (f(), n && a) {
|
|
@@ -9658,13 +9662,13 @@ function di(i) {
|
|
|
9658
9662
|
f();
|
|
9659
9663
|
});
|
|
9660
9664
|
}, [a, f]);
|
|
9661
|
-
const m =
|
|
9665
|
+
const m = T(
|
|
9662
9666
|
(h, x) => a ? a.generateTrackingPixel({ messageId: h, recipientId: x, campaignId: t }) : "",
|
|
9663
9667
|
[a, t]
|
|
9664
|
-
), u =
|
|
9665
|
-
(h, x,
|
|
9668
|
+
), u = T(
|
|
9669
|
+
(h, x, P) => a ? a.wrapLinksForTracking(h, { messageId: x, recipientId: P, campaignId: t }) : h,
|
|
9666
9670
|
[a, t]
|
|
9667
|
-
), y =
|
|
9671
|
+
), y = T(
|
|
9668
9672
|
(h) => {
|
|
9669
9673
|
a == null || a.recordEvent(h);
|
|
9670
9674
|
},
|
|
@@ -9679,7 +9683,7 @@ function di(i) {
|
|
|
9679
9683
|
refreshStats: f
|
|
9680
9684
|
};
|
|
9681
9685
|
}
|
|
9682
|
-
class
|
|
9686
|
+
class Gn {
|
|
9683
9687
|
constructor(e) {
|
|
9684
9688
|
this.templates = /* @__PURE__ */ new Map(), this.campaigns = /* @__PURE__ */ new Map(), this.abortControllers = /* @__PURE__ */ new Map(), this.config = {
|
|
9685
9689
|
sendEmail: e.sendEmail,
|
|
@@ -9873,9 +9877,9 @@ class Un {
|
|
|
9873
9877
|
}
|
|
9874
9878
|
const c = this.extractFields(
|
|
9875
9879
|
n.subject + n.htmlBody + (n.textBody ?? "")
|
|
9876
|
-
),
|
|
9880
|
+
), p = n.fields.map((f) => f.name);
|
|
9877
9881
|
for (const f of c)
|
|
9878
|
-
|
|
9882
|
+
p.includes(f) || s.push({
|
|
9879
9883
|
type: "unused_field",
|
|
9880
9884
|
field: f,
|
|
9881
9885
|
message: `Field "${f}" used in template but not defined`
|
|
@@ -9922,7 +9926,7 @@ class Un {
|
|
|
9922
9926
|
const s = new AbortController();
|
|
9923
9927
|
this.abortControllers.set(e, s);
|
|
9924
9928
|
const o = t.recipients.filter((y) => y.status === "pending"), c = o.length;
|
|
9925
|
-
let
|
|
9929
|
+
let p = 0, f = 0;
|
|
9926
9930
|
const m = Date.now(), u = 60 * 1e3 / (t.rateLimit ?? this.config.rateLimit);
|
|
9927
9931
|
try {
|
|
9928
9932
|
for (let y = 0; y < o.length; y++) {
|
|
@@ -9943,27 +9947,27 @@ class Un {
|
|
|
9943
9947
|
html: O.html,
|
|
9944
9948
|
text: O.text
|
|
9945
9949
|
});
|
|
9946
|
-
U.success ? (h.status = "sent",
|
|
9950
|
+
U.success ? (h.status = "sent", p++) : (h.status = "failed", h.error = U.error, f++);
|
|
9947
9951
|
} catch (O) {
|
|
9948
9952
|
h.status = "failed", h.error = O instanceof Error ? O.message : "Unknown error", f++;
|
|
9949
9953
|
}
|
|
9950
|
-
const x =
|
|
9954
|
+
const x = p + f, P = Date.now() - m, d = x > 0 ? P / x : u, D = c - x, A = Math.round(D * d / 1e3);
|
|
9951
9955
|
yield {
|
|
9952
9956
|
campaignId: e,
|
|
9953
9957
|
total: c,
|
|
9954
|
-
sent:
|
|
9958
|
+
sent: p,
|
|
9955
9959
|
failed: f,
|
|
9956
9960
|
pending: c - x,
|
|
9957
9961
|
current: h.email,
|
|
9958
9962
|
percentage: Math.round(x / c * 100),
|
|
9959
|
-
estimatedTimeRemaining:
|
|
9963
|
+
estimatedTimeRemaining: A,
|
|
9960
9964
|
isComplete: !1
|
|
9961
9965
|
}, y < o.length - 1 && await this.delay(u);
|
|
9962
9966
|
}
|
|
9963
9967
|
t.status = "completed", t.completedAt = /* @__PURE__ */ new Date(), this.campaigns.set(e, t), yield {
|
|
9964
9968
|
campaignId: e,
|
|
9965
9969
|
total: c,
|
|
9966
|
-
sent:
|
|
9970
|
+
sent: p,
|
|
9967
9971
|
failed: f,
|
|
9968
9972
|
pending: 0,
|
|
9969
9973
|
percentage: 100,
|
|
@@ -10018,11 +10022,11 @@ class Un {
|
|
|
10018
10022
|
processTemplate(e, t, n) {
|
|
10019
10023
|
const a = new Map(n.map((s) => [s.name, s]));
|
|
10020
10024
|
return e = this.processConditionals(e, t), e = this.processLoops(e, t), e = e.replace(/\{\{([^}#/]+)\}\}/g, (s, o) => {
|
|
10021
|
-
const [c, ...
|
|
10025
|
+
const [c, ...p] = o.trim().split("|").map((u) => u.trim());
|
|
10022
10026
|
let f = this.getNestedValue(t, c);
|
|
10023
10027
|
const m = a.get(c);
|
|
10024
10028
|
f == null && (f = (m == null ? void 0 : m.defaultValue) ?? ""), m && f !== "" && (f = this.formatValue(f, m));
|
|
10025
|
-
for (const u of
|
|
10029
|
+
for (const u of p)
|
|
10026
10030
|
f = this.applyFormatter(f, u);
|
|
10027
10031
|
return String(f);
|
|
10028
10032
|
}), e;
|
|
@@ -10030,17 +10034,17 @@ class Un {
|
|
|
10030
10034
|
processConditionals(e, t) {
|
|
10031
10035
|
const n = /\{\{#if\s+([^}]+)\}\}([\s\S]*?)(?:\{\{else\}\}([\s\S]*?))?\{\{\/if\}\}/g;
|
|
10032
10036
|
return e.replace(n, (a, s, o, c = "") => {
|
|
10033
|
-
const
|
|
10034
|
-
return this.isTruthy(
|
|
10037
|
+
const p = this.getNestedValue(t, s.trim());
|
|
10038
|
+
return this.isTruthy(p) ? o : c;
|
|
10035
10039
|
});
|
|
10036
10040
|
}
|
|
10037
10041
|
processLoops(e, t) {
|
|
10038
10042
|
const n = /\{\{#each\s+([^}]+)\}\}([\s\S]*?)\{\{\/each\}\}/g;
|
|
10039
10043
|
return e.replace(n, (a, s, o) => {
|
|
10040
10044
|
const c = this.getNestedValue(t, s.trim());
|
|
10041
|
-
return Array.isArray(c) ? c.map((
|
|
10045
|
+
return Array.isArray(c) ? c.map((p, f) => {
|
|
10042
10046
|
let m = o;
|
|
10043
|
-
return typeof
|
|
10047
|
+
return typeof p != "object" && (m = m.replace(/\{\{this\}\}/g, String(p))), m = m.replace(/\{\{this\.([^}]+)\}\}/g, (u, y) => String(this.getNestedValue(p, y) ?? "")), m = m.replace(/\{\{@index\}\}/g, String(f)), m = m.replace(/\{\{@first\}\}/g, String(f === 0)), m = m.replace(/\{\{@last\}\}/g, String(f === c.length - 1)), m;
|
|
10044
10048
|
}).join("") : "";
|
|
10045
10049
|
});
|
|
10046
10050
|
}
|
|
@@ -10149,16 +10153,16 @@ class Un {
|
|
|
10149
10153
|
return new Promise((t) => setTimeout(t, e));
|
|
10150
10154
|
}
|
|
10151
10155
|
}
|
|
10152
|
-
let
|
|
10156
|
+
let $e = null;
|
|
10153
10157
|
function gt(i) {
|
|
10154
|
-
if (
|
|
10158
|
+
if (!$e && i && ($e = new Gn(i)), !$e)
|
|
10155
10159
|
throw new Error("MailMergeService not initialized. Call with config first.");
|
|
10156
|
-
return
|
|
10160
|
+
return $e;
|
|
10157
10161
|
}
|
|
10158
|
-
function
|
|
10159
|
-
|
|
10162
|
+
function gi() {
|
|
10163
|
+
$e = null;
|
|
10160
10164
|
}
|
|
10161
|
-
function
|
|
10165
|
+
function mi(i = {}) {
|
|
10162
10166
|
const { config: e } = i, t = se(() => {
|
|
10163
10167
|
if (e)
|
|
10164
10168
|
return gt(e);
|
|
@@ -10167,54 +10171,54 @@ function fi(i = {}) {
|
|
|
10167
10171
|
} catch {
|
|
10168
10172
|
return null;
|
|
10169
10173
|
}
|
|
10170
|
-
}, [e]), [n, a] =
|
|
10171
|
-
t && (
|
|
10172
|
-
}, [t]), y =
|
|
10173
|
-
(
|
|
10174
|
+
}, [e]), [n, a] = N(null), [s, o] = N(!1), [c, p] = N([]), [f, m] = N([]), u = T(() => {
|
|
10175
|
+
t && (p(t.listTemplates()), m(t.listCampaigns()));
|
|
10176
|
+
}, [t]), y = T(
|
|
10177
|
+
(A) => {
|
|
10174
10178
|
if (!t)
|
|
10175
10179
|
throw new Error("Service not initialized");
|
|
10176
|
-
const O = t.createTemplate(
|
|
10180
|
+
const O = t.createTemplate(A);
|
|
10177
10181
|
return u(), O;
|
|
10178
10182
|
},
|
|
10179
10183
|
[t, u]
|
|
10180
|
-
), h =
|
|
10181
|
-
(
|
|
10184
|
+
), h = T(
|
|
10185
|
+
(A) => {
|
|
10182
10186
|
if (!t)
|
|
10183
10187
|
throw new Error("Service not initialized");
|
|
10184
|
-
const O = t.createCampaign(
|
|
10188
|
+
const O = t.createCampaign(A);
|
|
10185
10189
|
return u(), O;
|
|
10186
10190
|
},
|
|
10187
10191
|
[t, u]
|
|
10188
|
-
), x =
|
|
10189
|
-
(
|
|
10192
|
+
), x = T(
|
|
10193
|
+
(A, O) => {
|
|
10190
10194
|
if (!t)
|
|
10191
10195
|
throw new Error("Service not initialized");
|
|
10192
|
-
return t.previewMerge(
|
|
10196
|
+
return t.previewMerge(A, O);
|
|
10193
10197
|
},
|
|
10194
10198
|
[t]
|
|
10195
|
-
),
|
|
10196
|
-
(
|
|
10199
|
+
), P = T(
|
|
10200
|
+
(A) => {
|
|
10197
10201
|
if (!t)
|
|
10198
10202
|
throw new Error("Service not initialized");
|
|
10199
|
-
return t.validateCampaign(
|
|
10203
|
+
return t.validateCampaign(A);
|
|
10200
10204
|
},
|
|
10201
10205
|
[t]
|
|
10202
|
-
),
|
|
10203
|
-
async function* (
|
|
10206
|
+
), d = T(
|
|
10207
|
+
async function* (A) {
|
|
10204
10208
|
if (!t)
|
|
10205
10209
|
throw new Error("Service not initialized");
|
|
10206
10210
|
o(!0);
|
|
10207
10211
|
try {
|
|
10208
|
-
for await (const O of t.sendCampaign(
|
|
10212
|
+
for await (const O of t.sendCampaign(A))
|
|
10209
10213
|
a(O), yield O;
|
|
10210
10214
|
} finally {
|
|
10211
10215
|
o(!1), u();
|
|
10212
10216
|
}
|
|
10213
10217
|
},
|
|
10214
10218
|
[t, u]
|
|
10215
|
-
),
|
|
10216
|
-
(
|
|
10217
|
-
t == null || t.pauseCampaign(
|
|
10219
|
+
), D = T(
|
|
10220
|
+
(A) => {
|
|
10221
|
+
t == null || t.pauseCampaign(A), o(!1), u();
|
|
10218
10222
|
},
|
|
10219
10223
|
[t, u]
|
|
10220
10224
|
);
|
|
@@ -10222,16 +10226,16 @@ function fi(i = {}) {
|
|
|
10222
10226
|
createTemplate: y,
|
|
10223
10227
|
createCampaign: h,
|
|
10224
10228
|
preview: x,
|
|
10225
|
-
validate:
|
|
10226
|
-
send:
|
|
10227
|
-
pause:
|
|
10229
|
+
validate: P,
|
|
10230
|
+
send: d,
|
|
10231
|
+
pause: D,
|
|
10228
10232
|
progress: n,
|
|
10229
10233
|
isSending: s,
|
|
10230
10234
|
templates: c,
|
|
10231
10235
|
campaigns: f
|
|
10232
10236
|
};
|
|
10233
10237
|
}
|
|
10234
|
-
class
|
|
10238
|
+
class qn {
|
|
10235
10239
|
constructor(e) {
|
|
10236
10240
|
this.abortController = null, this.mapping = {
|
|
10237
10241
|
users: /* @__PURE__ */ new Map(),
|
|
@@ -10251,9 +10255,9 @@ class Hn {
|
|
|
10251
10255
|
const m = JSON.parse(c);
|
|
10252
10256
|
o.push(...m.map((u) => ({ ...u, is_private: !0 })));
|
|
10253
10257
|
}
|
|
10254
|
-
const
|
|
10255
|
-
if (
|
|
10256
|
-
const m = JSON.parse(
|
|
10258
|
+
const p = t.get("dms.json");
|
|
10259
|
+
if (p) {
|
|
10260
|
+
const m = JSON.parse(p);
|
|
10257
10261
|
o.push(...m.map((u) => ({ ...u, is_im: !0 })));
|
|
10258
10262
|
}
|
|
10259
10263
|
const f = /* @__PURE__ */ new Map();
|
|
@@ -10262,10 +10266,10 @@ class Hn {
|
|
|
10262
10266
|
for (const [h, x] of t)
|
|
10263
10267
|
if (h.startsWith(y + "/") && h.endsWith(".json"))
|
|
10264
10268
|
try {
|
|
10265
|
-
const
|
|
10266
|
-
u.push(...
|
|
10267
|
-
} catch (
|
|
10268
|
-
console.warn(`Failed to parse messages from ${h}:`,
|
|
10269
|
+
const P = JSON.parse(x);
|
|
10270
|
+
u.push(...P);
|
|
10271
|
+
} catch (P) {
|
|
10272
|
+
console.warn(`Failed to parse messages from ${h}:`, P);
|
|
10269
10273
|
}
|
|
10270
10274
|
u.length > 0 && f.set(m.id, u);
|
|
10271
10275
|
}
|
|
@@ -10291,13 +10295,13 @@ class Hn {
|
|
|
10291
10295
|
previewImport(e, t = {}) {
|
|
10292
10296
|
const n = e.users.filter((u) => t.importUsers !== !1 && !u.deleted), a = n.map((u) => this.mapUser(u)), s = e.channels.filter((u) => !(t.skipArchived && u.is_archived || t.skipDirectMessages && (u.is_im || u.is_mpim) || t.channelFilter && !t.channelFilter.includes(u.id) && !t.channelFilter.includes(u.name))), o = s.map((u) => this.mapChannel(u, /* @__PURE__ */ new Map()));
|
|
10293
10297
|
let c = 0;
|
|
10294
|
-
const
|
|
10298
|
+
const p = /* @__PURE__ */ new Map();
|
|
10295
10299
|
for (const [u, y] of e.messages) {
|
|
10296
|
-
const h = e.channels.find((
|
|
10297
|
-
if (!h || !s.some((
|
|
10300
|
+
const h = e.channels.find((d) => d.id === u);
|
|
10301
|
+
if (!h || !s.some((d) => d.id === u))
|
|
10298
10302
|
continue;
|
|
10299
|
-
const
|
|
10300
|
-
|
|
10303
|
+
const P = this.filterMessages(y, t);
|
|
10304
|
+
p.set(h.name, P.length), c += P.length;
|
|
10301
10305
|
}
|
|
10302
10306
|
let f = 0, m = 0;
|
|
10303
10307
|
for (const u of e.messages.values())
|
|
@@ -10316,7 +10320,7 @@ class Hn {
|
|
|
10316
10320
|
},
|
|
10317
10321
|
messages: {
|
|
10318
10322
|
total: c,
|
|
10319
|
-
perChannel:
|
|
10323
|
+
perChannel: p
|
|
10320
10324
|
},
|
|
10321
10325
|
files: {
|
|
10322
10326
|
total: f,
|
|
@@ -10398,8 +10402,8 @@ class Hn {
|
|
|
10398
10402
|
if (!this.mapping.channels.has(y))
|
|
10399
10403
|
continue;
|
|
10400
10404
|
const x = this.filterMessages(h, t);
|
|
10401
|
-
for (const
|
|
10402
|
-
f.push({ channelId: y, message:
|
|
10405
|
+
for (const P of x)
|
|
10406
|
+
f.push({ channelId: y, message: P });
|
|
10403
10407
|
}
|
|
10404
10408
|
f.sort((y, h) => parseFloat(y.message.ts) - parseFloat(h.message.ts));
|
|
10405
10409
|
const m = /* @__PURE__ */ new Map();
|
|
@@ -10407,17 +10411,17 @@ class Hn {
|
|
|
10407
10411
|
for (const { channelId: y, message: h } of f) {
|
|
10408
10412
|
if (this.abortController.signal.aborted)
|
|
10409
10413
|
break;
|
|
10410
|
-
const x = this.mapMessage(h, y, this.mapping, m),
|
|
10411
|
-
|
|
10414
|
+
const x = this.mapMessage(h, y, this.mapping, m), P = await this.config.createMessage(x);
|
|
10415
|
+
P.success && P.id ? ((!h.thread_ts || h.thread_ts === h.ts) && m.set(h.ts, P.id), a.messagesImported++, x.isThreadReply && a.threadsImported++, a.reactionsImported += x.reactions.length) : n.push({
|
|
10412
10416
|
phase: "messages",
|
|
10413
10417
|
itemId: h.ts,
|
|
10414
10418
|
itemType: "message",
|
|
10415
|
-
message:
|
|
10419
|
+
message: P.error ?? "Failed to create message"
|
|
10416
10420
|
}), u++, yield {
|
|
10417
10421
|
phase: "messages",
|
|
10418
10422
|
total: f.length,
|
|
10419
10423
|
processed: u,
|
|
10420
|
-
failed: n.filter((
|
|
10424
|
+
failed: n.filter((d) => d.phase === "messages").length,
|
|
10421
10425
|
current: `${u}/${f.length}`,
|
|
10422
10426
|
percentage: Math.round(u / f.length * 100),
|
|
10423
10427
|
isComplete: !1,
|
|
@@ -10465,7 +10469,7 @@ class Hn {
|
|
|
10465
10469
|
}, await this.delay(c);
|
|
10466
10470
|
}
|
|
10467
10471
|
}
|
|
10468
|
-
const
|
|
10472
|
+
const p = /* @__PURE__ */ new Date();
|
|
10469
10473
|
return yield {
|
|
10470
10474
|
phase: "complete",
|
|
10471
10475
|
total: 0,
|
|
@@ -10480,8 +10484,8 @@ class Hn {
|
|
|
10480
10484
|
mapping: this.mapping,
|
|
10481
10485
|
errors: n,
|
|
10482
10486
|
startedAt: s,
|
|
10483
|
-
completedAt:
|
|
10484
|
-
duration:
|
|
10487
|
+
completedAt: p,
|
|
10488
|
+
duration: p.getTime() - s.getTime()
|
|
10485
10489
|
};
|
|
10486
10490
|
} finally {
|
|
10487
10491
|
this.abortController = null;
|
|
@@ -10529,7 +10533,7 @@ class Hn {
|
|
|
10529
10533
|
};
|
|
10530
10534
|
}
|
|
10531
10535
|
mapMessage(e, t, n, a) {
|
|
10532
|
-
const s = n.channels.get(t) ?? t, o = e.user ? n.users.get(e.user) : void 0, { text: c, html:
|
|
10536
|
+
const s = n.channels.get(t) ?? t, o = e.user ? n.users.get(e.user) : void 0, { text: c, html: p } = this.convertSlackMessage(e.text, n.users), f = e.thread_ts !== void 0 && e.thread_ts !== e.ts, m = e.thread_ts ? a.get(e.thread_ts) : void 0, u = [];
|
|
10533
10537
|
if (e.files)
|
|
10534
10538
|
for (const h of e.files)
|
|
10535
10539
|
u.push({
|
|
@@ -10550,7 +10554,7 @@ class Hn {
|
|
|
10550
10554
|
channelId: s,
|
|
10551
10555
|
senderId: o,
|
|
10552
10556
|
content: c,
|
|
10553
|
-
htmlContent:
|
|
10557
|
+
htmlContent: p,
|
|
10554
10558
|
threadId: m,
|
|
10555
10559
|
isThreadReply: f,
|
|
10556
10560
|
attachments: u,
|
|
@@ -10565,7 +10569,7 @@ class Hn {
|
|
|
10565
10569
|
convertSlackMessage(e, t) {
|
|
10566
10570
|
let n = e, a = this.escapeHtml(e);
|
|
10567
10571
|
const s = /<@([A-Z0-9]+)(?:\|([^>]+))?>/g;
|
|
10568
|
-
return n = n.replace(s, (o, c,
|
|
10572
|
+
return n = n.replace(s, (o, c, p) => p ? `@${p}` : "@user"), a = a.replace(/<@([A-Z0-9]+)(?:\|([^&]+))?>/g, (o, c, p) => `<span class="mention" data-user-id="${t.get(c) ?? c}">@${p ?? "user"}</span>`), n = n.replace(/<#([A-Z0-9]+)\|([^>]+)>/g, "#$2"), a = a.replace(
|
|
10569
10573
|
/<#([A-Z0-9]+)\|([^&]+)>/g,
|
|
10570
10574
|
'<span class="channel-mention">#$2</span>'
|
|
10571
10575
|
), n = n.replace(/<(https?:\/\/[^|>]+)\|([^>]+)>/g, "$2 ($1)"), n = n.replace(/<(https?:\/\/[^>]+)>/g, "$1"), a = a.replace(/<(https?:\/\/[^|&]+)\|([^&]+)>/g, '<a href="$1">$2</a>'), a = a.replace(/<(https?:\/\/[^&]+)>/g, '<a href="$1">$1</a>'), n = this.convertEmoji(n), a = this.convertEmoji(a), a = a.replace(/\*([^*]+)\*/g, "<strong>$1</strong>"), a = a.replace(/\b_([^_]+)_\b/g, "<em>$1</em>"), a = a.replace(/~([^~]+)~/g, "<del>$1</del>"), a = a.replace(/`([^`]+)`/g, "<code>$1</code>"), a = a.replace(/```([^`]+)```/g, "<pre>$1</pre>"), a = a.replace(/\n/g, "<br>"), { text: n, html: a };
|
|
@@ -10624,14 +10628,14 @@ class Hn {
|
|
|
10624
10628
|
}
|
|
10625
10629
|
let Me = null;
|
|
10626
10630
|
function mt(i) {
|
|
10627
|
-
if (!Me && i && (Me = new
|
|
10631
|
+
if (!Me && i && (Me = new qn(i)), !Me)
|
|
10628
10632
|
throw new Error("SlackImportService not initialized. Call with config first.");
|
|
10629
10633
|
return Me;
|
|
10630
10634
|
}
|
|
10631
|
-
function
|
|
10635
|
+
function yi() {
|
|
10632
10636
|
Me = null;
|
|
10633
10637
|
}
|
|
10634
|
-
function
|
|
10638
|
+
function bi(i = {}) {
|
|
10635
10639
|
const { config: e } = i, t = se(() => {
|
|
10636
10640
|
if (e)
|
|
10637
10641
|
return mt(e);
|
|
@@ -10640,41 +10644,41 @@ function hi(i = {}) {
|
|
|
10640
10644
|
} catch {
|
|
10641
10645
|
return null;
|
|
10642
10646
|
}
|
|
10643
|
-
}, [e]), [n, a] =
|
|
10647
|
+
}, [e]), [n, a] = N(null), [s, o] = N(!1), [c, p] = N(null), f = T(
|
|
10644
10648
|
(h) => {
|
|
10645
10649
|
if (!t)
|
|
10646
10650
|
throw new Error("Service not initialized");
|
|
10647
10651
|
return t.parseSlackExportFromJson(h);
|
|
10648
10652
|
},
|
|
10649
10653
|
[t]
|
|
10650
|
-
), m =
|
|
10654
|
+
), m = T(
|
|
10651
10655
|
(h, x) => {
|
|
10652
10656
|
if (!t)
|
|
10653
10657
|
throw new Error("Service not initialized");
|
|
10654
10658
|
return t.previewImport(h, x);
|
|
10655
10659
|
},
|
|
10656
10660
|
[t]
|
|
10657
|
-
), u =
|
|
10661
|
+
), u = T(
|
|
10658
10662
|
async function* (h, x) {
|
|
10659
|
-
var
|
|
10663
|
+
var P, d;
|
|
10660
10664
|
if (!t)
|
|
10661
10665
|
throw new Error("Service not initialized");
|
|
10662
|
-
o(!0),
|
|
10666
|
+
o(!0), p(null);
|
|
10663
10667
|
try {
|
|
10664
10668
|
for await (const U of t.import(h, x))
|
|
10665
10669
|
a(U), yield U;
|
|
10666
|
-
const
|
|
10667
|
-
let
|
|
10668
|
-
for await (const U of
|
|
10669
|
-
|
|
10670
|
-
const O = (
|
|
10671
|
-
return O &&
|
|
10670
|
+
const D = t.import(h, x);
|
|
10671
|
+
let A;
|
|
10672
|
+
for await (const U of D)
|
|
10673
|
+
A = U;
|
|
10674
|
+
const O = (d = (P = D.next) == null ? void 0 : P.call(D)) == null ? void 0 : d.value;
|
|
10675
|
+
return O && p(O), O;
|
|
10672
10676
|
} finally {
|
|
10673
10677
|
o(!1);
|
|
10674
10678
|
}
|
|
10675
10679
|
},
|
|
10676
10680
|
[t]
|
|
10677
|
-
), y =
|
|
10681
|
+
), y = T(() => {
|
|
10678
10682
|
t == null || t.cancel(), o(!1);
|
|
10679
10683
|
}, [t]);
|
|
10680
10684
|
return {
|
|
@@ -10687,7 +10691,7 @@ function hi(i = {}) {
|
|
|
10687
10691
|
result: c
|
|
10688
10692
|
};
|
|
10689
10693
|
}
|
|
10690
|
-
const
|
|
10694
|
+
const Vn = {
|
|
10691
10695
|
toggleMute: "*6",
|
|
10692
10696
|
raiseHand: "*9",
|
|
10693
10697
|
leave: "#",
|
|
@@ -10695,7 +10699,7 @@ const Kn = {
|
|
|
10695
10699
|
hostMuteAll: "*1",
|
|
10696
10700
|
hostUnmuteAll: "*2",
|
|
10697
10701
|
hostEndMeeting: "*#"
|
|
10698
|
-
},
|
|
10702
|
+
}, Xn = {
|
|
10699
10703
|
welcome: "Welcome to the conference. ",
|
|
10700
10704
|
enterPin: "Please enter your meeting PIN followed by the pound key.",
|
|
10701
10705
|
invalidPin: "Invalid PIN. Please try again.",
|
|
@@ -10731,7 +10735,7 @@ class zt {
|
|
|
10731
10735
|
maxParticipants: 100,
|
|
10732
10736
|
recordingMode: "none",
|
|
10733
10737
|
...e
|
|
10734
|
-
}, this.dtmfCommands =
|
|
10738
|
+
}, this.dtmfCommands = Vn, this.ivrText = { ...Xn, ...e.ivrText };
|
|
10735
10739
|
}
|
|
10736
10740
|
/* ────────────────────────────────────────────────────────────────────────────
|
|
10737
10741
|
Event Handlers
|
|
@@ -11027,16 +11031,16 @@ a=fmtp:101 0-16
|
|
|
11027
11031
|
}
|
|
11028
11032
|
}
|
|
11029
11033
|
let Xe = null;
|
|
11030
|
-
function
|
|
11034
|
+
function Jn(i) {
|
|
11031
11035
|
return Xe || (Xe = new zt(i)), Xe;
|
|
11032
11036
|
}
|
|
11033
|
-
function
|
|
11037
|
+
function vi(i) {
|
|
11034
11038
|
return new zt(i);
|
|
11035
11039
|
}
|
|
11036
|
-
function
|
|
11037
|
-
const e = se(() =>
|
|
11040
|
+
function xi(i) {
|
|
11041
|
+
const e = se(() => Jn(i), []), [t, n] = N(
|
|
11038
11042
|
"disconnected"
|
|
11039
|
-
), [a, s] =
|
|
11043
|
+
), [a, s] = N([]);
|
|
11040
11044
|
re(() => {
|
|
11041
11045
|
const x = () => {
|
|
11042
11046
|
s(e.getParticipants());
|
|
@@ -11045,19 +11049,19 @@ function mi(i) {
|
|
|
11045
11049
|
e.off("onStatusChanged"), e.off("onParticipantJoined"), e.off("onParticipantLeft"), e.off("onParticipantStateChanged");
|
|
11046
11050
|
};
|
|
11047
11051
|
}, [e]);
|
|
11048
|
-
const o =
|
|
11049
|
-
(x,
|
|
11052
|
+
const o = T(
|
|
11053
|
+
(x, P) => e.generateDialInInfo(x, P),
|
|
11050
11054
|
[e]
|
|
11051
|
-
), c =
|
|
11055
|
+
), c = T((x) => e.getDialInInfo(x), [e]), p = T((x) => e.muteParticipant(x), [e]), f = T((x) => e.unmuteParticipant(x), [e]), m = T(
|
|
11052
11056
|
(x) => e.disconnectParticipant(x),
|
|
11053
11057
|
[e]
|
|
11054
|
-
), u =
|
|
11058
|
+
), u = T(() => e.muteAll(), [e]), y = T(() => e.endMeeting(), [e]), h = T(() => e.connect(), [e]);
|
|
11055
11059
|
return {
|
|
11056
11060
|
status: t,
|
|
11057
11061
|
participants: a,
|
|
11058
11062
|
generateDialIn: o,
|
|
11059
11063
|
getDialIn: c,
|
|
11060
|
-
mute:
|
|
11064
|
+
mute: p,
|
|
11061
11065
|
unmute: f,
|
|
11062
11066
|
disconnect: m,
|
|
11063
11067
|
muteAll: u,
|
|
@@ -11066,56 +11070,56 @@ function mi(i) {
|
|
|
11066
11070
|
};
|
|
11067
11071
|
}
|
|
11068
11072
|
export {
|
|
11069
|
-
|
|
11070
|
-
|
|
11073
|
+
Vn as DEFAULT_DTMF_COMMANDS,
|
|
11074
|
+
Xn as DEFAULT_IVR_TEXT,
|
|
11071
11075
|
kt as DEFAULT_RETENTION_RULES,
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
+
Yn as EmailTrackingService,
|
|
11077
|
+
Hn as EncryptionService,
|
|
11078
|
+
Gn as MailMergeService,
|
|
11079
|
+
Mt as MockTransport,
|
|
11076
11080
|
wt as NiceCallScreen,
|
|
11077
|
-
|
|
11081
|
+
Kt as NiceChannelView,
|
|
11078
11082
|
He as NiceChatWindow,
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
+
li as NiceCollaborativeEditor,
|
|
11084
|
+
ai as NiceCommunication,
|
|
11085
|
+
ai as NiceCommunicationDefault,
|
|
11086
|
+
Ut as NiceMessenger,
|
|
11083
11087
|
we as NicePresenceIndicator,
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11088
|
+
oi as NiceRecordingPanel,
|
|
11089
|
+
si as NiceStorageSettings,
|
|
11090
|
+
hn as NiceTeamsWorkspace,
|
|
11087
11091
|
St as NiceVideoConference,
|
|
11088
11092
|
Ct as NiceWhiteboard,
|
|
11089
11093
|
zt as PstnGatewayService,
|
|
11090
11094
|
yt as REGION_CODES,
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11095
|
+
Kn as RecordingService,
|
|
11096
|
+
qn as SlackImportService,
|
|
11097
|
+
Gt as StorageService,
|
|
11098
|
+
$t as WebRTCTransport,
|
|
11099
|
+
ti as buildOptimisticMessage,
|
|
11100
|
+
vi as createPstnGateway,
|
|
11101
|
+
Ot as createTransport,
|
|
11102
|
+
ui as disposeEmailTrackingService,
|
|
11103
|
+
di as disposeEncryptionService,
|
|
11104
|
+
gi as disposeMailMergeService,
|
|
11105
|
+
fi as disposeRecordingService,
|
|
11106
|
+
yi as disposeSlackImportService,
|
|
11107
|
+
ri as disposeStorageService,
|
|
11104
11108
|
it as findConversationPartner,
|
|
11105
|
-
|
|
11109
|
+
ii as getDefaultMode,
|
|
11106
11110
|
ht as getEmailTrackingService,
|
|
11107
|
-
|
|
11111
|
+
ci as getEncryptionService,
|
|
11108
11112
|
gt as getMailMergeService,
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11113
|
+
ni as getMentionCount,
|
|
11114
|
+
Jn as getPstnGateway,
|
|
11115
|
+
pi as getRecordingService,
|
|
11112
11116
|
mt as getSlackImportService,
|
|
11113
|
-
|
|
11117
|
+
qt as getStorageService,
|
|
11114
11118
|
xt as getUnreadCount,
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11119
|
+
Lt as useCommunication,
|
|
11120
|
+
hi as useEmailTracking,
|
|
11121
|
+
mi as useMailMerge,
|
|
11122
|
+
xi as usePstnGateway,
|
|
11123
|
+
bi as useSlackImport,
|
|
11124
|
+
Jt as useWhiteboard
|
|
11121
11125
|
};
|