@nice2dev/ui-communication 1.1.10 → 1.2.0
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/README.md +0 -6
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +332 -321
- package/dist/types/communicationTypes.d.ts +0 -35
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o, Fragment as he } from "react/jsx-runtime";
|
|
2
|
-
import { NiceIcon as S, useNiceTranslation as Ke, NiceEmpty as
|
|
3
|
-
import
|
|
4
|
-
class
|
|
2
|
+
import { createId as nt, NiceIcon as S, useNiceTranslation as Ke, NiceEmpty as Mt, resolveCssColor as de, NiceAppShell as kt, useControllableState as Ot } from "@nice2dev/ui";
|
|
3
|
+
import it, { useRef as le, useState as N, useCallback as R, useEffect as re, useMemo as oe, useReducer as Lt, useLayoutEffect as Wt } from "react";
|
|
4
|
+
class Ct {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.listeners = /* @__PURE__ */ new Map();
|
|
7
7
|
}
|
|
@@ -20,7 +20,7 @@ class kt {
|
|
|
20
20
|
this.listeners.clear();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
class
|
|
23
|
+
class _t extends Ct {
|
|
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: [
|
|
@@ -65,7 +65,7 @@ class Wt extends kt {
|
|
|
65
65
|
this.localStream && (this.localStream.getTracks().forEach((e) => e.stop()), this.localStream = null), this.screenStream && (this.screenStream.getTracks().forEach((e) => e.stop()), this.screenStream = null);
|
|
66
66
|
}
|
|
67
67
|
async startCall(e, t) {
|
|
68
|
-
const i =
|
|
68
|
+
const i = nt();
|
|
69
69
|
return this.sendSignal({
|
|
70
70
|
type: "call:request",
|
|
71
71
|
callId: i,
|
|
@@ -224,7 +224,7 @@ class Wt extends kt {
|
|
|
224
224
|
return await t.setLocalDescription(i), this.sendSignal({ type: "offer", to: e, from: this.userId, sdp: i.sdp }), t;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
class
|
|
227
|
+
class Ft extends Ct {
|
|
228
228
|
constructor() {
|
|
229
229
|
super(...arguments), this.type = "mock", this.connected = !1, this.localStream = null;
|
|
230
230
|
}
|
|
@@ -251,7 +251,7 @@ class _t extends kt {
|
|
|
251
251
|
}
|
|
252
252
|
async startCall(e, t) {
|
|
253
253
|
const i = {
|
|
254
|
-
id:
|
|
254
|
+
id: nt(),
|
|
255
255
|
type: t,
|
|
256
256
|
participants: [],
|
|
257
257
|
status: "connecting",
|
|
@@ -293,17 +293,17 @@ class _t extends kt {
|
|
|
293
293
|
this.emit("screen:stopped", { participantId: "local" });
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function jt(n, e) {
|
|
297
297
|
switch (n) {
|
|
298
298
|
case "mock":
|
|
299
|
-
return new
|
|
299
|
+
return new Ft();
|
|
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 Bt(n) {
|
|
307
307
|
const {
|
|
308
308
|
currentUser: e,
|
|
309
309
|
transport: t = "webrtc",
|
|
@@ -329,7 +329,7 @@ function jt(n) {
|
|
|
329
329
|
}), x = R(() => {
|
|
330
330
|
if (p.current)
|
|
331
331
|
return p.current;
|
|
332
|
-
const I =
|
|
332
|
+
const I = jt(t, i);
|
|
333
333
|
return I.on(
|
|
334
334
|
"transport:connected",
|
|
335
335
|
() => h((k) => ({ ...k, isConnected: !0, connectionError: null }))
|
|
@@ -458,9 +458,9 @@ function jt(n) {
|
|
|
458
458
|
transport: p
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function si(n, e, t, i = "text") {
|
|
462
462
|
return {
|
|
463
|
-
id: `optimistic-${
|
|
463
|
+
id: `optimistic-${nt()}`,
|
|
464
464
|
conversationId: n,
|
|
465
465
|
authorId: e,
|
|
466
466
|
content: t,
|
|
@@ -473,22 +473,22 @@ function ai(n, e, t, i = "text") {
|
|
|
473
473
|
isPinned: !1
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function lt(n, e, t) {
|
|
477
477
|
if (n.type !== "dm")
|
|
478
478
|
return;
|
|
479
479
|
const i = n.participantIds.find((a) => a !== e);
|
|
480
480
|
return t.find((a) => a.id === i);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function It(n) {
|
|
483
483
|
return n.reduce((e, t) => e + t.unreadCount, 0);
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function oi(n) {
|
|
486
486
|
return n.reduce((e, t) => e + t.mentionCount, 0);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function li(n, e) {
|
|
489
489
|
return n ? "workspace" : e ? "messenger" : "bubble";
|
|
490
490
|
}
|
|
491
|
-
const
|
|
491
|
+
const Ut = {
|
|
492
492
|
online: "Online",
|
|
493
493
|
away: "Away",
|
|
494
494
|
busy: "Busy",
|
|
@@ -496,7 +496,7 @@ const Bt = {
|
|
|
496
496
|
offline: "Offline",
|
|
497
497
|
invisible: "Invisible",
|
|
498
498
|
unknown: "Unknown"
|
|
499
|
-
},
|
|
499
|
+
}, Ht = {
|
|
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 Bt = {
|
|
|
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
|
+
}, Kt = {
|
|
508
508
|
xs: 6,
|
|
509
509
|
sm: 8,
|
|
510
510
|
md: 10,
|
|
@@ -520,7 +520,7 @@ function we({
|
|
|
520
520
|
id: l,
|
|
521
521
|
"data-testid": c
|
|
522
522
|
}) {
|
|
523
|
-
const u =
|
|
523
|
+
const u = Kt[e], d = Ht[n], g = Ut[n], p = /* @__PURE__ */ r(
|
|
524
524
|
"span",
|
|
525
525
|
{
|
|
526
526
|
className: `nice-presence-dot nice-presence-dot--${n} nice-presence-dot--${e}`,
|
|
@@ -573,7 +573,7 @@ function we({
|
|
|
573
573
|
}
|
|
574
574
|
);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function zt({
|
|
577
577
|
session: n,
|
|
578
578
|
currentUser: e,
|
|
579
579
|
localStream: t,
|
|
@@ -731,7 +731,7 @@ function It({
|
|
|
731
731
|
alignItems: "center",
|
|
732
732
|
gap: 4,
|
|
733
733
|
fontSize: 12,
|
|
734
|
-
color: "var(--nice-
|
|
734
|
+
color: "var(--nice-color-white, #fff)"
|
|
735
735
|
},
|
|
736
736
|
children: [
|
|
737
737
|
/* @__PURE__ */ r(S, { name: "mic", size: 12 }),
|
|
@@ -753,7 +753,7 @@ function It({
|
|
|
753
753
|
border: "none",
|
|
754
754
|
borderRadius: 6,
|
|
755
755
|
padding: "5px 8px",
|
|
756
|
-
color: "var(--nice-
|
|
756
|
+
color: "var(--nice-color-white, #fff)",
|
|
757
757
|
cursor: "pointer",
|
|
758
758
|
fontSize: 16
|
|
759
759
|
},
|
|
@@ -902,7 +902,7 @@ function Pe({
|
|
|
902
902
|
borderRadius: "50%",
|
|
903
903
|
border: "none",
|
|
904
904
|
background: i ? "var(--nice-overlay-light-15, rgba(255, 255, 255, 0.15))" : "var(--nice-overlay-light-8, rgba(255, 255, 255, 0.08))",
|
|
905
|
-
color: "var(--nice-
|
|
905
|
+
color: "var(--nice-color-white, #fff)",
|
|
906
906
|
fontSize: 18,
|
|
907
907
|
cursor: "pointer",
|
|
908
908
|
display: "flex",
|
|
@@ -928,7 +928,7 @@ function Pe({
|
|
|
928
928
|
)
|
|
929
929
|
] });
|
|
930
930
|
}
|
|
931
|
-
const
|
|
931
|
+
const Yt = ["👍", "❤️", "😂", "😮", "😢", "🎉"];
|
|
932
932
|
function Ve({
|
|
933
933
|
message: n,
|
|
934
934
|
author: e,
|
|
@@ -1042,7 +1042,7 @@ function Ve({
|
|
|
1042
1042
|
padding: "8px 12px",
|
|
1043
1043
|
borderRadius: t ? "18px 18px 4px 18px" : "18px 18px 18px 4px",
|
|
1044
1044
|
background: t ? "var(--nice-info, #6366f1)" : "var(--nice-bg-secondary, #f3f4f6)",
|
|
1045
|
-
color: t ? "var(--nice-
|
|
1045
|
+
color: t ? "var(--nice-color-white, #fff)" : "var(--nice-text, #111827)",
|
|
1046
1046
|
fontSize: 14,
|
|
1047
1047
|
lineHeight: 1.5,
|
|
1048
1048
|
wordBreak: "break-word"
|
|
@@ -1211,7 +1211,7 @@ function Ve({
|
|
|
1211
1211
|
padding: "6px 8px",
|
|
1212
1212
|
zIndex: 20
|
|
1213
1213
|
},
|
|
1214
|
-
children:
|
|
1214
|
+
children: Yt.map((M) => /* @__PURE__ */ r(
|
|
1215
1215
|
"button",
|
|
1216
1216
|
{
|
|
1217
1217
|
onClick: () => {
|
|
@@ -1306,7 +1306,7 @@ function Ve({
|
|
|
1306
1306
|
}
|
|
1307
1307
|
);
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function ct({
|
|
1310
1310
|
placeholder: n = "Type a message…",
|
|
1311
1311
|
maxLength: e,
|
|
1312
1312
|
replyTo: t,
|
|
@@ -1441,7 +1441,7 @@ function lt({
|
|
|
1441
1441
|
alignItems: "center",
|
|
1442
1442
|
justifyContent: "center",
|
|
1443
1443
|
flexShrink: 0,
|
|
1444
|
-
color: "var(--nice-
|
|
1444
|
+
color: "var(--nice-color-white, #fff)",
|
|
1445
1445
|
transition: "background 0.15s"
|
|
1446
1446
|
},
|
|
1447
1447
|
children: /* @__PURE__ */ r(S, { name: "send", size: 16 })
|
|
@@ -1495,7 +1495,7 @@ function Ye({
|
|
|
1495
1495
|
"data-testid": G
|
|
1496
1496
|
}) {
|
|
1497
1497
|
var q, w;
|
|
1498
|
-
const Z = le(null), W = le(null), [I, k] = N(null), [_, K] = N(null), E =
|
|
1498
|
+
const Z = le(null), W = le(null), [I, k] = N(null), [_, K] = N(null), E = it.useMemo(() => {
|
|
1499
1499
|
const v = /* @__PURE__ */ new Map();
|
|
1500
1500
|
return t.forEach((V) => v.set(V.id, V)), v;
|
|
1501
1501
|
}, [t]);
|
|
@@ -1748,7 +1748,7 @@ function Ye({
|
|
|
1748
1748
|
))
|
|
1749
1749
|
] }),
|
|
1750
1750
|
/* @__PURE__ */ r(
|
|
1751
|
-
|
|
1751
|
+
ct,
|
|
1752
1752
|
{
|
|
1753
1753
|
placeholder: "Reply in thread…",
|
|
1754
1754
|
onSend: (v) => h == null ? void 0 : h(n.id, v, "text")
|
|
@@ -1758,7 +1758,7 @@ function Ye({
|
|
|
1758
1758
|
}
|
|
1759
1759
|
),
|
|
1760
1760
|
/* @__PURE__ */ r(
|
|
1761
|
-
|
|
1761
|
+
ct,
|
|
1762
1762
|
{
|
|
1763
1763
|
placeholder: p,
|
|
1764
1764
|
maxLength: m,
|
|
@@ -1773,7 +1773,7 @@ function Ye({
|
|
|
1773
1773
|
}
|
|
1774
1774
|
);
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function Gt({ conversation: n, partner: e, isActive: t, lastMessage: i, onClick: a }) {
|
|
1777
1777
|
var g;
|
|
1778
1778
|
const s = (e == null ? void 0 : e.displayName) ?? (e == null ? void 0 : e.name) ?? n.name ?? "Group", l = ((g = s[0]) == null ? void 0 : g.toUpperCase()) ?? "?", c = (e == null ? void 0 : e.avatarUrl) ?? n.avatarUrl, u = i ? i.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "", d = i ? i.isDeleted ? "Message deleted" : i.content.slice(0, 50) : "";
|
|
1779
1779
|
return /* @__PURE__ */ o(
|
|
@@ -1806,7 +1806,7 @@ function Yt({ conversation: n, partner: e, isActive: t, lastMessage: i, onClick:
|
|
|
1806
1806
|
display: "flex",
|
|
1807
1807
|
alignItems: "center",
|
|
1808
1808
|
justifyContent: "center",
|
|
1809
|
-
color: "var(--nice-
|
|
1809
|
+
color: "var(--nice-color-white, #fff)",
|
|
1810
1810
|
fontWeight: 700,
|
|
1811
1811
|
fontSize: 16
|
|
1812
1812
|
},
|
|
@@ -1945,7 +1945,7 @@ function Yt({ conversation: n, partner: e, isActive: t, lastMessage: i, onClick:
|
|
|
1945
1945
|
}
|
|
1946
1946
|
);
|
|
1947
1947
|
}
|
|
1948
|
-
function
|
|
1948
|
+
function qt({
|
|
1949
1949
|
conversations: n,
|
|
1950
1950
|
messages: e,
|
|
1951
1951
|
users: t,
|
|
@@ -1981,7 +1981,7 @@ function Gt({
|
|
|
1981
1981
|
const V = Z.toLowerCase();
|
|
1982
1982
|
v = v.filter((Q) => {
|
|
1983
1983
|
var X, ae;
|
|
1984
|
-
const ee =
|
|
1984
|
+
const ee = lt(Q, i.id, t);
|
|
1985
1985
|
return (ee == null ? void 0 : ee.name.toLowerCase().includes(V)) || ((X = Q.name) == null ? void 0 : X.toLowerCase().includes(V)) || ((ae = Q.lastMessage) == null ? void 0 : ae.content.toLowerCase().includes(V));
|
|
1986
1986
|
});
|
|
1987
1987
|
}
|
|
@@ -2003,7 +2003,7 @@ function Gt({
|
|
|
2003
2003
|
G(v), T == null || T(v);
|
|
2004
2004
|
},
|
|
2005
2005
|
[T]
|
|
2006
|
-
), B = oe(() =>
|
|
2006
|
+
), B = oe(() => It(n), [n]), U = s ?? [], q = t.filter((v) => v.id !== i.id && v.presence.status === "online").slice(0, 6);
|
|
2007
2007
|
return /* @__PURE__ */ o(
|
|
2008
2008
|
"div",
|
|
2009
2009
|
{
|
|
@@ -2109,7 +2109,7 @@ function Gt({
|
|
|
2109
2109
|
border: "none",
|
|
2110
2110
|
borderRadius: 6,
|
|
2111
2111
|
background: I === v ? "var(--nice-info, #6366f1)" : "transparent",
|
|
2112
|
-
color: I === v ? "var(--nice-
|
|
2112
|
+
color: I === v ? "var(--nice-color-white, #fff)" : "var(--nice-text-secondary, #6b7280)",
|
|
2113
2113
|
cursor: "pointer",
|
|
2114
2114
|
fontSize: 12,
|
|
2115
2115
|
textTransform: "capitalize",
|
|
@@ -2228,10 +2228,10 @@ function Gt({
|
|
|
2228
2228
|
children: "No conversations"
|
|
2229
2229
|
}
|
|
2230
2230
|
) : _.map((v) => /* @__PURE__ */ r(
|
|
2231
|
-
|
|
2231
|
+
Gt,
|
|
2232
2232
|
{
|
|
2233
2233
|
conversation: v,
|
|
2234
|
-
partner:
|
|
2234
|
+
partner: lt(v, i.id, t),
|
|
2235
2235
|
isActive: v.id === H,
|
|
2236
2236
|
lastMessage: v.lastMessage,
|
|
2237
2237
|
onClick: () => P(v.id)
|
|
@@ -2362,7 +2362,7 @@ function Gt({
|
|
|
2362
2362
|
}
|
|
2363
2363
|
);
|
|
2364
2364
|
}
|
|
2365
|
-
const
|
|
2365
|
+
const Vt = ["👍", "❤️", "😂", "🎉", "😮", "😢"];
|
|
2366
2366
|
function Xe({
|
|
2367
2367
|
message: n,
|
|
2368
2368
|
author: e,
|
|
@@ -2592,7 +2592,7 @@ function Xe({
|
|
|
2592
2592
|
padding: "6px 8px",
|
|
2593
2593
|
zIndex: 20
|
|
2594
2594
|
},
|
|
2595
|
-
children:
|
|
2595
|
+
children: Vt.map((z) => /* @__PURE__ */ r(
|
|
2596
2596
|
"button",
|
|
2597
2597
|
{
|
|
2598
2598
|
onClick: () => {
|
|
@@ -2652,7 +2652,7 @@ function Xe({
|
|
|
2652
2652
|
}
|
|
2653
2653
|
);
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function Xt({
|
|
2656
2656
|
channel: n,
|
|
2657
2657
|
messages: e,
|
|
2658
2658
|
users: t,
|
|
@@ -2676,7 +2676,7 @@ function Vt({
|
|
|
2676
2676
|
"data-testid": Y
|
|
2677
2677
|
}) {
|
|
2678
2678
|
var q;
|
|
2679
|
-
const M = le(null), H = le(null), [G, Z] = N(""), [W, I] = N(null), [k, _] = N(null), K =
|
|
2679
|
+
const M = le(null), H = le(null), [G, Z] = N(""), [W, I] = N(null), [k, _] = N(null), K = it.useMemo(() => {
|
|
2680
2680
|
const w = /* @__PURE__ */ new Map();
|
|
2681
2681
|
return t.forEach((v) => w.set(v.id, v)), w;
|
|
2682
2682
|
}, [t]);
|
|
@@ -2731,7 +2731,7 @@ function Vt({
|
|
|
2731
2731
|
),
|
|
2732
2732
|
/* @__PURE__ */ o("div", { children: [
|
|
2733
2733
|
/* @__PURE__ */ r("div", { style: { fontWeight: 700, fontSize: 16 }, children: n.name }),
|
|
2734
|
-
n.description && /* @__PURE__ */
|
|
2734
|
+
(n.topic || n.description) && /* @__PURE__ */ o(
|
|
2735
2735
|
"div",
|
|
2736
2736
|
{
|
|
2737
2737
|
style: {
|
|
@@ -2739,7 +2739,18 @@ function Vt({
|
|
|
2739
2739
|
color: "var(--nice-text-secondary, #6b7280)",
|
|
2740
2740
|
marginTop: 1
|
|
2741
2741
|
},
|
|
2742
|
-
children:
|
|
2742
|
+
children: [
|
|
2743
|
+
n.topic && /* @__PURE__ */ r(
|
|
2744
|
+
"span",
|
|
2745
|
+
{
|
|
2746
|
+
className: "nice-channel-view__topic",
|
|
2747
|
+
style: { fontWeight: 600, color: "var(--nice-text-primary, #111827)" },
|
|
2748
|
+
children: n.topic
|
|
2749
|
+
}
|
|
2750
|
+
),
|
|
2751
|
+
n.topic && n.description && " · ",
|
|
2752
|
+
n.description
|
|
2753
|
+
]
|
|
2743
2754
|
}
|
|
2744
2755
|
)
|
|
2745
2756
|
] })
|
|
@@ -2963,7 +2974,7 @@ function Vt({
|
|
|
2963
2974
|
alignItems: "center",
|
|
2964
2975
|
justifyContent: "center",
|
|
2965
2976
|
flexShrink: 0,
|
|
2966
|
-
color: "var(--nice-
|
|
2977
|
+
color: "var(--nice-color-white, #fff)",
|
|
2967
2978
|
transition: "background 0.15s"
|
|
2968
2979
|
},
|
|
2969
2980
|
children: /* @__PURE__ */ r(S, { name: "send", size: 15 })
|
|
@@ -3214,7 +3225,7 @@ function Je({
|
|
|
3214
3225
|
justifyContent: "space-between"
|
|
3215
3226
|
},
|
|
3216
3227
|
children: [
|
|
3217
|
-
/* @__PURE__ */ o("span", { style: { color: "var(--nice-
|
|
3228
|
+
/* @__PURE__ */ o("span", { style: { color: "var(--nice-color-white, #fff)", fontSize: 11, fontWeight: 500 }, children: [
|
|
3218
3229
|
c.displayName ?? c.name,
|
|
3219
3230
|
e && " (You)"
|
|
3220
3231
|
] }),
|
|
@@ -3290,7 +3301,7 @@ function Je({
|
|
|
3290
3301
|
}
|
|
3291
3302
|
);
|
|
3292
3303
|
}
|
|
3293
|
-
function
|
|
3304
|
+
function Tt({
|
|
3294
3305
|
session: n,
|
|
3295
3306
|
currentUser: e,
|
|
3296
3307
|
localStream: t,
|
|
@@ -3427,7 +3438,7 @@ function zt({
|
|
|
3427
3438
|
border: "none",
|
|
3428
3439
|
borderRadius: 6,
|
|
3429
3440
|
padding: "4px 10px",
|
|
3430
|
-
color: "var(--nice-
|
|
3441
|
+
color: "var(--nice-color-white, #fff)",
|
|
3431
3442
|
cursor: "pointer",
|
|
3432
3443
|
fontSize: 12
|
|
3433
3444
|
},
|
|
@@ -3452,7 +3463,7 @@ function zt({
|
|
|
3452
3463
|
border: "none",
|
|
3453
3464
|
borderRadius: 6,
|
|
3454
3465
|
padding: "4px 10px",
|
|
3455
|
-
color: "var(--nice-
|
|
3466
|
+
color: "var(--nice-color-white, #fff)",
|
|
3456
3467
|
cursor: "pointer",
|
|
3457
3468
|
fontSize: 12
|
|
3458
3469
|
},
|
|
@@ -3707,7 +3718,7 @@ function Ie({
|
|
|
3707
3718
|
borderRadius: "50%",
|
|
3708
3719
|
border: "none",
|
|
3709
3720
|
background: s ? "var(--nice-danger, #ef4444)" : a ? "var(--nice-danger-dark, #450a0a)" : i ? "var(--nice-info, #6366f1)" : "var(--nice-overlay-light-12, rgba(255, 255, 255, 0.12))",
|
|
3710
|
-
color: "var(--nice-
|
|
3721
|
+
color: "var(--nice-color-white, #fff)",
|
|
3711
3722
|
fontSize: 18,
|
|
3712
3723
|
cursor: "pointer",
|
|
3713
3724
|
display: "flex",
|
|
@@ -3746,7 +3757,7 @@ function $e(n, e = /* @__PURE__ */ new Date()) {
|
|
|
3746
3757
|
if (n.unit !== "forever")
|
|
3747
3758
|
return new Date(e.getTime() + tt(n));
|
|
3748
3759
|
}
|
|
3749
|
-
class
|
|
3760
|
+
class dt {
|
|
3750
3761
|
constructor(e = "nice2dev-communication") {
|
|
3751
3762
|
this.storeName = "nice_comm_store", this.db = null, this.dbName = e;
|
|
3752
3763
|
}
|
|
@@ -3812,7 +3823,7 @@ class ct {
|
|
|
3812
3823
|
await Promise.all(t.map((i) => this.delete(i)));
|
|
3813
3824
|
}
|
|
3814
3825
|
}
|
|
3815
|
-
class
|
|
3826
|
+
class Jt {
|
|
3816
3827
|
constructor(e = "nice_comm__") {
|
|
3817
3828
|
this.prefix = e;
|
|
3818
3829
|
}
|
|
@@ -3849,18 +3860,18 @@ class Xt {
|
|
|
3849
3860
|
(await this.list(e ?? "")).forEach((i) => localStorage.removeItem(this.prefix + i));
|
|
3850
3861
|
}
|
|
3851
3862
|
}
|
|
3852
|
-
class
|
|
3863
|
+
class Qt {
|
|
3853
3864
|
constructor(e, t) {
|
|
3854
3865
|
this.config = e, this.encryption = t, this.adapter = this.buildAdapter();
|
|
3855
3866
|
}
|
|
3856
3867
|
buildAdapter() {
|
|
3857
3868
|
switch (this.config.provider) {
|
|
3858
3869
|
case "localstorage":
|
|
3859
|
-
return new
|
|
3870
|
+
return new Jt();
|
|
3860
3871
|
case "custom":
|
|
3861
|
-
return this.config.customAdapter ?? new
|
|
3872
|
+
return this.config.customAdapter ?? new dt();
|
|
3862
3873
|
default:
|
|
3863
|
-
return new
|
|
3874
|
+
return new dt();
|
|
3864
3875
|
}
|
|
3865
3876
|
}
|
|
3866
3877
|
getRuleFor(e) {
|
|
@@ -3985,7 +3996,7 @@ class Jt {
|
|
|
3985
3996
|
return this.config;
|
|
3986
3997
|
}
|
|
3987
3998
|
}
|
|
3988
|
-
const
|
|
3999
|
+
const Pt = [
|
|
3989
4000
|
{
|
|
3990
4001
|
dataType: "messages",
|
|
3991
4002
|
activePeriod: { value: 1, unit: "years" },
|
|
@@ -4040,13 +4051,13 @@ const Tt = [
|
|
|
4040
4051
|
legalHoldEnabled: !0
|
|
4041
4052
|
}
|
|
4042
4053
|
], je = /* @__PURE__ */ new Map();
|
|
4043
|
-
function
|
|
4044
|
-
return je.has(n) || je.set(n, new
|
|
4054
|
+
function Zt(n, e, t) {
|
|
4055
|
+
return je.has(n) || je.set(n, new Qt(e, t)), je.get(n);
|
|
4045
4056
|
}
|
|
4046
|
-
function
|
|
4057
|
+
function ci(n) {
|
|
4047
4058
|
je.delete(n);
|
|
4048
4059
|
}
|
|
4049
|
-
const
|
|
4060
|
+
const pt = [
|
|
4050
4061
|
"var(--nice-color-accent-pink, #e91e63)",
|
|
4051
4062
|
"var(--nice-accent, #9c27b0)",
|
|
4052
4063
|
"var(--nice-accent, #3f51b5)",
|
|
@@ -4058,13 +4069,13 @@ const dt = [
|
|
|
4058
4069
|
"var(--nice-warning-dark, #795548)",
|
|
4059
4070
|
"var(--nice-text-secondary, #607d8b)"
|
|
4060
4071
|
];
|
|
4061
|
-
function
|
|
4072
|
+
function en(n) {
|
|
4062
4073
|
let e = 0;
|
|
4063
4074
|
for (let t = 0; t < n.length; t++)
|
|
4064
4075
|
e = e * 31 + n.charCodeAt(t) >>> 0;
|
|
4065
|
-
return
|
|
4076
|
+
return pt[e % pt.length];
|
|
4066
4077
|
}
|
|
4067
|
-
function
|
|
4078
|
+
function ft(n, e, t) {
|
|
4068
4079
|
const i = { ...n }, a = [...e];
|
|
4069
4080
|
switch (t.type) {
|
|
4070
4081
|
case "object:add":
|
|
@@ -4106,7 +4117,7 @@ function pt(n, e, t) {
|
|
|
4106
4117
|
}
|
|
4107
4118
|
return { objects: i, layers: a };
|
|
4108
4119
|
}
|
|
4109
|
-
function
|
|
4120
|
+
function tn(n, e) {
|
|
4110
4121
|
switch (e.type) {
|
|
4111
4122
|
case "LOAD_SESSION":
|
|
4112
4123
|
return {
|
|
@@ -4119,7 +4130,7 @@ function en(n, e) {
|
|
|
4119
4130
|
case "SET_TOOL":
|
|
4120
4131
|
return { ...n, activeTool: e.tool };
|
|
4121
4132
|
case "APPLY_OP": {
|
|
4122
|
-
const { op: t, local: i } = e, { objects: a, layers: s } =
|
|
4133
|
+
const { op: t, local: i } = e, { objects: a, layers: s } = ft(n.session.objects, n.session.layers, t), l = {
|
|
4123
4134
|
...n.session,
|
|
4124
4135
|
objects: a,
|
|
4125
4136
|
layers: s,
|
|
@@ -4165,7 +4176,7 @@ function en(n, e) {
|
|
|
4165
4176
|
const t = n.redoStack[0];
|
|
4166
4177
|
let { objects: i, layers: a } = { objects: n.session.objects, layers: n.session.layers };
|
|
4167
4178
|
for (const s of t)
|
|
4168
|
-
({ objects: i, layers: a } =
|
|
4179
|
+
({ objects: i, layers: a } = ft(i, a, s));
|
|
4169
4180
|
return {
|
|
4170
4181
|
...n,
|
|
4171
4182
|
session: { ...n.session, objects: i, layers: a },
|
|
@@ -4208,7 +4219,7 @@ function en(n, e) {
|
|
|
4208
4219
|
return n;
|
|
4209
4220
|
}
|
|
4210
4221
|
}
|
|
4211
|
-
function
|
|
4222
|
+
function nn(n) {
|
|
4212
4223
|
const {
|
|
4213
4224
|
session: e,
|
|
4214
4225
|
currentUser: t,
|
|
@@ -4217,7 +4228,7 @@ function tn(n) {
|
|
|
4217
4228
|
readonly: s = !1,
|
|
4218
4229
|
storageConfig: l,
|
|
4219
4230
|
autoSaveMs: c = 3e4
|
|
4220
|
-
} = n, [u, d] =
|
|
4231
|
+
} = n, [u, d] = Lt(tn, {
|
|
4221
4232
|
session: e,
|
|
4222
4233
|
activeTool: s ? "select" : "pen",
|
|
4223
4234
|
selectedObjectIds: [],
|
|
@@ -4228,7 +4239,7 @@ function tn(n) {
|
|
|
4228
4239
|
isDirty: !1
|
|
4229
4240
|
}), g = le(0), p = le(null), m = le(null);
|
|
4230
4241
|
re(() => {
|
|
4231
|
-
l && (m.current =
|
|
4242
|
+
l && (m.current = Zt(`wb_${e.id}`, l), m.current.loadWhiteboardSnapshot(e.id).then((P) => {
|
|
4232
4243
|
P && d({ type: "LOAD_SESSION", session: P });
|
|
4233
4244
|
}));
|
|
4234
4245
|
}, [e.id, l]), re(() => {
|
|
@@ -4361,7 +4372,7 @@ function tn(n) {
|
|
|
4361
4372
|
user: P,
|
|
4362
4373
|
cursorX: 0,
|
|
4363
4374
|
cursorY: 0,
|
|
4364
|
-
color:
|
|
4375
|
+
color: en(P.id),
|
|
4365
4376
|
selectedObjectIds: [],
|
|
4366
4377
|
activeTool: "pen",
|
|
4367
4378
|
lastSeenAt: /* @__PURE__ */ new Date()
|
|
@@ -4410,7 +4421,7 @@ function tn(n) {
|
|
|
4410
4421
|
saveNow: E
|
|
4411
4422
|
};
|
|
4412
4423
|
}
|
|
4413
|
-
const
|
|
4424
|
+
const rn = [
|
|
4414
4425
|
{ id: "select", label: "Select", icon: "cursor", group: "select" },
|
|
4415
4426
|
{ id: "laser", label: "Laser", icon: "circle", group: "select" },
|
|
4416
4427
|
{ id: "pen", label: "Pen", icon: "pen", group: "draw" },
|
|
@@ -4432,13 +4443,13 @@ function _e() {
|
|
|
4432
4443
|
function Qe(n, e, t) {
|
|
4433
4444
|
return { sx: n * t.scale + t.x, sy: e * t.scale + t.y };
|
|
4434
4445
|
}
|
|
4435
|
-
function
|
|
4446
|
+
function an(n, e, t) {
|
|
4436
4447
|
return { wx: (n - t.x) / t.scale, wy: (e - t.y) / t.scale };
|
|
4437
4448
|
}
|
|
4438
|
-
function
|
|
4449
|
+
function sn(n, e) {
|
|
4439
4450
|
return Math.hypot(e.x - n.x, e.y - n.y);
|
|
4440
4451
|
}
|
|
4441
|
-
function
|
|
4452
|
+
function on(n, e) {
|
|
4442
4453
|
if (!(e.points.length < 2)) {
|
|
4443
4454
|
n.save(), n.globalAlpha = e.opacity, n.strokeStyle = de(e.color, n.canvas), n.lineWidth = e.strokeWidth, n.lineCap = "round", n.lineJoin = "round", e.tool === "highlighter" && (n.globalCompositeOperation = "multiply"), n.beginPath(), n.moveTo(e.points[0].x, e.points[0].y);
|
|
4444
4455
|
for (let t = 1; t < e.points.length; t++) {
|
|
@@ -4451,7 +4462,7 @@ function sn(n, e) {
|
|
|
4451
4462
|
n.stroke(), n.restore();
|
|
4452
4463
|
}
|
|
4453
4464
|
}
|
|
4454
|
-
function
|
|
4465
|
+
function ln(n, e) {
|
|
4455
4466
|
switch (n.save(), n.globalAlpha = e.opacity, n.strokeStyle = de(e.strokeColor, n.canvas), n.lineWidth = e.strokeWidth, e.fillColor && (n.fillStyle = de(e.fillColor, n.canvas)), n.translate(e.x + e.width / 2, e.y + e.height / 2), n.rotate(e.rotation * Math.PI / 180), n.beginPath(), e.shape) {
|
|
4456
4467
|
case "rect":
|
|
4457
4468
|
n.rect(-e.width / 2, -e.height / 2, e.width, e.height);
|
|
@@ -4472,7 +4483,7 @@ function on(n, e) {
|
|
|
4472
4483
|
}
|
|
4473
4484
|
e.fillColor && n.fill(), n.stroke(), n.restore();
|
|
4474
4485
|
}
|
|
4475
|
-
function
|
|
4486
|
+
function cn(n, e) {
|
|
4476
4487
|
if (n.save(), n.translate(e.x + e.width / 2, e.y + e.height / 2), n.rotate(e.rotation * Math.PI / 180), n.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.fillStyle = de(e.color, n.canvas), n.textAlign = e.textAlign, n.textBaseline = "middle", e.backgroundColor) {
|
|
4477
4488
|
const t = n.measureText(e.text), i = 4;
|
|
4478
4489
|
n.fillStyle = de(e.backgroundColor, n.canvas), n.fillRect(
|
|
@@ -4484,7 +4495,7 @@ function ln(n, e) {
|
|
|
4484
4495
|
}
|
|
4485
4496
|
n.fillText(e.text, 0, 0), n.restore();
|
|
4486
4497
|
}
|
|
4487
|
-
function
|
|
4498
|
+
function dn(n, e) {
|
|
4488
4499
|
n.save(), n.translate(e.x, e.y), n.rotate(e.rotation * Math.PI / 180), n.shadowColor = de("var(--nice-overlay-15, rgba(0, 0, 0, 0.15))", n.canvas), n.shadowBlur = 8, n.shadowOffsetY = 3, n.fillStyle = de(e.backgroundColor, n.canvas), n.fillRect(0, 0, e.width, e.height), n.shadowColor = "transparent", n.fillStyle = de(e.textColor, n.canvas), n.font = `${e.fontSize}px sans-serif`, n.textAlign = "left", n.textBaseline = "top";
|
|
4489
4500
|
const t = 10, i = e.width - t * 2, a = e.fontSize * 1.4, s = e.text.split(" ");
|
|
4490
4501
|
let l = "", c = t;
|
|
@@ -4494,7 +4505,7 @@ function cn(n, e) {
|
|
|
4494
4505
|
}
|
|
4495
4506
|
l && n.fillText(l, t, c), n.restore();
|
|
4496
4507
|
}
|
|
4497
|
-
function
|
|
4508
|
+
function pn(n, e) {
|
|
4498
4509
|
if (!(e.points.length < 2)) {
|
|
4499
4510
|
if (n.save(), n.strokeStyle = de(e.strokeColor, n.canvas), n.lineWidth = e.strokeWidth, n.lineCap = "round", n.beginPath(), n.moveTo(e.points[0].x, e.points[0].y), e.curved && e.points.length > 2) {
|
|
4500
4511
|
for (let t = 1; t < e.points.length - 1; t++) {
|
|
@@ -4521,24 +4532,24 @@ function dn(n, e) {
|
|
|
4521
4532
|
n.restore();
|
|
4522
4533
|
}
|
|
4523
4534
|
}
|
|
4524
|
-
function
|
|
4535
|
+
function fn(n, e) {
|
|
4525
4536
|
n.save(), n.strokeStyle = de(e.borderColor ?? "var(--nice-text-muted, #aaa)", n.canvas), n.lineWidth = 2, n.setLineDash([8, 4]), e.backgroundColor && (n.fillStyle = de(e.backgroundColor, n.canvas), n.fillRect(e.x, e.y, e.width, e.height)), n.strokeRect(e.x, e.y, e.width, e.height), n.setLineDash([]), n.fillStyle = de("var(--nice-text-secondary, #555)", n.canvas), n.font = "bold 13px sans-serif", n.fillText(e.name, e.x + 8, e.y - 6), n.restore();
|
|
4526
4537
|
}
|
|
4527
|
-
function
|
|
4538
|
+
function un(n, e) {
|
|
4528
4539
|
if (e.visible)
|
|
4529
4540
|
switch (e.type) {
|
|
4530
4541
|
case "stroke":
|
|
4531
|
-
return sn(n, e);
|
|
4532
|
-
case "shape":
|
|
4533
4542
|
return on(n, e);
|
|
4534
|
-
case "
|
|
4543
|
+
case "shape":
|
|
4535
4544
|
return ln(n, e);
|
|
4536
|
-
case "
|
|
4545
|
+
case "text":
|
|
4537
4546
|
return cn(n, e);
|
|
4538
|
-
case "
|
|
4547
|
+
case "sticky":
|
|
4539
4548
|
return dn(n, e);
|
|
4540
|
-
case "
|
|
4549
|
+
case "connector":
|
|
4541
4550
|
return pn(n, e);
|
|
4551
|
+
case "frame":
|
|
4552
|
+
return fn(n, e);
|
|
4542
4553
|
case "image": {
|
|
4543
4554
|
const t = e, i = new Image();
|
|
4544
4555
|
i.src = t.dataUrl ?? t.url, n.save(), n.translate(t.x + t.width / 2, t.y + t.height / 2), n.rotate(t.rotation * Math.PI / 180), n.drawImage(i, -t.width / 2, -t.height / 2, t.width, t.height), n.restore();
|
|
@@ -4546,11 +4557,11 @@ function fn(n, e) {
|
|
|
4546
4557
|
}
|
|
4547
4558
|
}
|
|
4548
4559
|
}
|
|
4549
|
-
function
|
|
4560
|
+
function Rt(n) {
|
|
4550
4561
|
const { t: e } = Ke();
|
|
4551
|
-
return n.session ? /* @__PURE__ */ r(
|
|
4562
|
+
return n.session ? /* @__PURE__ */ r(hn, { ...n, session: n.session }) : /* @__PURE__ */ r("div", { className: n.className, style: n.style, "data-testid": n["data-testid"], children: /* @__PURE__ */ r(Mt, { title: e("whiteboard.noSession", "No whiteboard session") }) });
|
|
4552
4563
|
}
|
|
4553
|
-
function
|
|
4564
|
+
function hn({
|
|
4554
4565
|
session: n,
|
|
4555
4566
|
currentUser: e,
|
|
4556
4567
|
onOperation: t,
|
|
@@ -4568,7 +4579,7 @@ function un({
|
|
|
4568
4579
|
style: x,
|
|
4569
4580
|
"data-testid": T
|
|
4570
4581
|
}) {
|
|
4571
|
-
const f =
|
|
4582
|
+
const f = nn({
|
|
4572
4583
|
session: n,
|
|
4573
4584
|
currentUser: e,
|
|
4574
4585
|
onOperation: t,
|
|
@@ -4645,7 +4656,7 @@ function un({
|
|
|
4645
4656
|
const J = Object.values(f.session.objects).filter((C) => C.visible).sort((C, A) => C.zIndex - A.zIndex);
|
|
4646
4657
|
b.translate(O.x, O.y), b.scale(O.scale, O.scale);
|
|
4647
4658
|
for (const C of J)
|
|
4648
|
-
|
|
4659
|
+
un(b, C);
|
|
4649
4660
|
if (w.current.active && w.current.currentPoints.length > 1) {
|
|
4650
4661
|
const C = w.current.currentPoints;
|
|
4651
4662
|
b.strokeStyle = de(M, y), b.lineWidth = G, b.lineCap = "round", b.lineJoin = "round", b.beginPath(), b.moveTo(C[0].x, C[0].y);
|
|
@@ -4671,7 +4682,7 @@ function un({
|
|
|
4671
4682
|
M,
|
|
4672
4683
|
G
|
|
4673
4684
|
]);
|
|
4674
|
-
|
|
4685
|
+
Wt(() => {
|
|
4675
4686
|
function y() {
|
|
4676
4687
|
ee(), $.current = requestAnimationFrame(y);
|
|
4677
4688
|
}
|
|
@@ -4710,7 +4721,7 @@ function un({
|
|
|
4710
4721
|
}, [f]);
|
|
4711
4722
|
const X = R(
|
|
4712
4723
|
(y) => {
|
|
4713
|
-
const b = z.current.getBoundingClientRect(), L = y.clientX - b.left, j = y.clientY - b.top, { wx: O, wy: J } =
|
|
4724
|
+
const b = z.current.getBoundingClientRect(), L = y.clientX - b.left, j = y.clientY - b.top, { wx: O, wy: J } = an(L, j, f.viewport);
|
|
4714
4725
|
return { x: O, y: J, pressure: y.pressure ?? 0.5 };
|
|
4715
4726
|
},
|
|
4716
4727
|
[f.viewport]
|
|
@@ -4759,7 +4770,7 @@ function un({
|
|
|
4759
4770
|
const L = f.activeTool;
|
|
4760
4771
|
if (L === "pen" || L === "highlighter") {
|
|
4761
4772
|
const j = w.current.currentPoints;
|
|
4762
|
-
(j.length === 0 ||
|
|
4773
|
+
(j.length === 0 || sn(j[j.length - 1], b) > 2) && (w.current.currentPoints = [...j, b]);
|
|
4763
4774
|
} else if (L === "laser") {
|
|
4764
4775
|
const j = w.current.laserPoints;
|
|
4765
4776
|
w.current.laserPoints = [...j.slice(-40), b];
|
|
@@ -5067,7 +5078,7 @@ function un({
|
|
|
5067
5078
|
], ue = oe(() => {
|
|
5068
5079
|
var b;
|
|
5069
5080
|
const y = {};
|
|
5070
|
-
for (const L of
|
|
5081
|
+
for (const L of rn)
|
|
5071
5082
|
(y[b = L.group] ?? (y[b] = [])).push(L);
|
|
5072
5083
|
return Object.values(y);
|
|
5073
5084
|
}, []);
|
|
@@ -5102,7 +5113,7 @@ function un({
|
|
|
5102
5113
|
flexWrap: "wrap"
|
|
5103
5114
|
},
|
|
5104
5115
|
children: [
|
|
5105
|
-
ue.map((y, b) => /* @__PURE__ */ o(
|
|
5116
|
+
ue.map((y, b) => /* @__PURE__ */ o(it.Fragment, { children: [
|
|
5106
5117
|
b > 0 && /* @__PURE__ */ r(
|
|
5107
5118
|
"div",
|
|
5108
5119
|
{
|
|
@@ -5406,7 +5417,7 @@ function un({
|
|
|
5406
5417
|
style: {
|
|
5407
5418
|
flex: 1,
|
|
5408
5419
|
display: "block",
|
|
5409
|
-
cursor:
|
|
5420
|
+
cursor: mn(f.activeTool, w.current.spaceDown)
|
|
5410
5421
|
},
|
|
5411
5422
|
onPointerDown: ae,
|
|
5412
5423
|
onPointerMove: me,
|
|
@@ -5416,7 +5427,7 @@ function un({
|
|
|
5416
5427
|
}
|
|
5417
5428
|
),
|
|
5418
5429
|
s && D && /* @__PURE__ */ r(
|
|
5419
|
-
|
|
5430
|
+
gn,
|
|
5420
5431
|
{
|
|
5421
5432
|
layers: f.layers,
|
|
5422
5433
|
objects: f.session.objects,
|
|
@@ -5578,7 +5589,7 @@ function un({
|
|
|
5578
5589
|
}
|
|
5579
5590
|
);
|
|
5580
5591
|
}
|
|
5581
|
-
function
|
|
5592
|
+
function gn({ layers: n, objects: e, onAdd: t, onUpdate: i, onDelete: a }) {
|
|
5582
5593
|
return /* @__PURE__ */ o(
|
|
5583
5594
|
"div",
|
|
5584
5595
|
{
|
|
@@ -5732,7 +5743,7 @@ function ve(n = !1, e = !1) {
|
|
|
5732
5743
|
fontWeight: e ? 600 : 400
|
|
5733
5744
|
};
|
|
5734
5745
|
}
|
|
5735
|
-
function
|
|
5746
|
+
function mn(n, e) {
|
|
5736
5747
|
if (e)
|
|
5737
5748
|
return "grab";
|
|
5738
5749
|
switch (n) {
|
|
@@ -5780,7 +5791,7 @@ function ze({
|
|
|
5780
5791
|
borderRadius: 10,
|
|
5781
5792
|
border: "none",
|
|
5782
5793
|
background: t ? "var(--nice-overlay-light-20, rgba(255, 255, 255, 0.2))" : "transparent",
|
|
5783
|
-
color: "var(--nice-
|
|
5794
|
+
color: "var(--nice-color-white, #fff)",
|
|
5784
5795
|
cursor: "pointer",
|
|
5785
5796
|
display: "flex",
|
|
5786
5797
|
alignItems: "center",
|
|
@@ -5825,7 +5836,7 @@ function ze({
|
|
|
5825
5836
|
}
|
|
5826
5837
|
);
|
|
5827
5838
|
}
|
|
5828
|
-
function
|
|
5839
|
+
function yn({
|
|
5829
5840
|
team: n,
|
|
5830
5841
|
activeChannelId: e,
|
|
5831
5842
|
onSelectChannel: t
|
|
@@ -5985,7 +5996,7 @@ function mn({
|
|
|
5985
5996
|
))
|
|
5986
5997
|
] });
|
|
5987
5998
|
}
|
|
5988
|
-
function
|
|
5999
|
+
function vn({
|
|
5989
6000
|
conversation: n,
|
|
5990
6001
|
partner: e,
|
|
5991
6002
|
isActive: t,
|
|
@@ -6060,7 +6071,7 @@ function yn({
|
|
|
6060
6071
|
}
|
|
6061
6072
|
);
|
|
6062
6073
|
}
|
|
6063
|
-
function
|
|
6074
|
+
function bn({
|
|
6064
6075
|
currentUser: n,
|
|
6065
6076
|
users: e,
|
|
6066
6077
|
teams: t,
|
|
@@ -6122,7 +6133,7 @@ function vn({
|
|
|
6122
6133
|
}, ge = oe(() => {
|
|
6123
6134
|
const C = /* @__PURE__ */ new Map();
|
|
6124
6135
|
return e.forEach((A) => C.set(A.id, A)), C;
|
|
6125
|
-
}, [e]), Ce = oe(() =>
|
|
6136
|
+
}, [e]), Ce = oe(() => It(i), [i]), F = oe(
|
|
6126
6137
|
() => i.reduce((C, A) => C + A.mentionCount, 0),
|
|
6127
6138
|
[i]
|
|
6128
6139
|
), te = oe(() => {
|
|
@@ -6163,7 +6174,7 @@ function vn({
|
|
|
6163
6174
|
style: { position: "relative", height: "100%", ...P },
|
|
6164
6175
|
children: [
|
|
6165
6176
|
/* @__PURE__ */ r(
|
|
6166
|
-
|
|
6177
|
+
kt,
|
|
6167
6178
|
{
|
|
6168
6179
|
flush: !0,
|
|
6169
6180
|
height: "100%",
|
|
@@ -6325,7 +6336,7 @@ function vn({
|
|
|
6325
6336
|
] }),
|
|
6326
6337
|
/* @__PURE__ */ o("div", { style: { flex: 1, overflowY: "auto" }, children: [
|
|
6327
6338
|
q === "teams" && /* @__PURE__ */ r(he, { children: t.map((C) => /* @__PURE__ */ r(
|
|
6328
|
-
|
|
6339
|
+
yn,
|
|
6329
6340
|
{
|
|
6330
6341
|
team: C,
|
|
6331
6342
|
activeChannelId: v == null ? void 0 : v.channelId,
|
|
@@ -6354,7 +6365,7 @@ function vn({
|
|
|
6354
6365
|
C.participantIds.find((ie) => ie !== n.id) ?? ""
|
|
6355
6366
|
);
|
|
6356
6367
|
return /* @__PURE__ */ r(
|
|
6357
|
-
|
|
6368
|
+
vn,
|
|
6358
6369
|
{
|
|
6359
6370
|
conversation: C,
|
|
6360
6371
|
partner: A,
|
|
@@ -6617,7 +6628,7 @@ function vn({
|
|
|
6617
6628
|
},
|
|
6618
6629
|
children: [
|
|
6619
6630
|
(v == null ? void 0 : v.type) === "channel" && te ? /* @__PURE__ */ r(
|
|
6620
|
-
|
|
6631
|
+
Xt,
|
|
6621
6632
|
{
|
|
6622
6633
|
channel: te,
|
|
6623
6634
|
messages: ue,
|
|
@@ -6650,7 +6661,7 @@ function vn({
|
|
|
6650
6661
|
style: { height: "100%" }
|
|
6651
6662
|
}
|
|
6652
6663
|
) : q === "whiteboard" && X ? /* @__PURE__ */ r(
|
|
6653
|
-
|
|
6664
|
+
Rt,
|
|
6654
6665
|
{
|
|
6655
6666
|
session: X,
|
|
6656
6667
|
currentUser: n,
|
|
@@ -6683,7 +6694,7 @@ function vn({
|
|
|
6683
6694
|
}
|
|
6684
6695
|
),
|
|
6685
6696
|
b && s && /* @__PURE__ */ r("div", { style: { position: "absolute", inset: 0, zIndex: 50 }, children: s.participants.length > 2 ? /* @__PURE__ */ r(
|
|
6686
|
-
|
|
6697
|
+
Tt,
|
|
6687
6698
|
{
|
|
6688
6699
|
session: s,
|
|
6689
6700
|
currentUser: n,
|
|
@@ -6695,7 +6706,7 @@ function vn({
|
|
|
6695
6706
|
onStopScreenShare: K
|
|
6696
6707
|
}
|
|
6697
6708
|
) : /* @__PURE__ */ r(
|
|
6698
|
-
|
|
6709
|
+
zt,
|
|
6699
6710
|
{
|
|
6700
6711
|
session: s,
|
|
6701
6712
|
currentUser: n,
|
|
@@ -6827,13 +6838,13 @@ function vn({
|
|
|
6827
6838
|
}
|
|
6828
6839
|
);
|
|
6829
6840
|
}
|
|
6830
|
-
const
|
|
6841
|
+
const xn = {
|
|
6831
6842
|
"bottom-right": { bottom: 24, right: 24 },
|
|
6832
6843
|
"bottom-left": { bottom: 24, left: 24 },
|
|
6833
6844
|
"top-right": { top: 24, right: 24 },
|
|
6834
6845
|
"top-left": { top: 24, left: 24 }
|
|
6835
6846
|
};
|
|
6836
|
-
function
|
|
6847
|
+
function wn({
|
|
6837
6848
|
props: n,
|
|
6838
6849
|
onExpand: e
|
|
6839
6850
|
}) {
|
|
@@ -6852,7 +6863,7 @@ function xn({
|
|
|
6852
6863
|
onEditMessage: T,
|
|
6853
6864
|
onLoadMoreMessages: f,
|
|
6854
6865
|
onStartCall: z
|
|
6855
|
-
} = n, $ =
|
|
6866
|
+
} = n, $ = xn[a], D = u.find((M) => M.id === g) ?? u[0] ?? null, Y = D ? d[D.id] ?? [] : [];
|
|
6856
6867
|
return /* @__PURE__ */ o("div", { style: { position: "fixed", zIndex: 9999, ...$ }, children: [
|
|
6857
6868
|
t && D && /* @__PURE__ */ o(
|
|
6858
6869
|
"div",
|
|
@@ -6899,7 +6910,7 @@ function xn({
|
|
|
6899
6910
|
border: "none",
|
|
6900
6911
|
borderRadius: 6,
|
|
6901
6912
|
padding: "3px 7px",
|
|
6902
|
-
color: "var(--nice-
|
|
6913
|
+
color: "var(--nice-color-white, #fff)",
|
|
6903
6914
|
cursor: "pointer",
|
|
6904
6915
|
display: "inline-flex",
|
|
6905
6916
|
alignItems: "center"
|
|
@@ -6974,7 +6985,7 @@ function xn({
|
|
|
6974
6985
|
)
|
|
6975
6986
|
] });
|
|
6976
6987
|
}
|
|
6977
|
-
function
|
|
6988
|
+
function Sn({
|
|
6978
6989
|
call: n,
|
|
6979
6990
|
onAccept: e,
|
|
6980
6991
|
onDecline: t
|
|
@@ -7063,7 +7074,7 @@ function wn({
|
|
|
7063
7074
|
}
|
|
7064
7075
|
);
|
|
7065
7076
|
}
|
|
7066
|
-
function
|
|
7077
|
+
function di(n) {
|
|
7067
7078
|
const {
|
|
7068
7079
|
mode: e,
|
|
7069
7080
|
currentUser: t,
|
|
@@ -7143,7 +7154,7 @@ function ci(n) {
|
|
|
7143
7154
|
toggleCamera: C,
|
|
7144
7155
|
startScreenShare: A,
|
|
7145
7156
|
stopScreenShare: ie
|
|
7146
|
-
} =
|
|
7157
|
+
} = Bt({
|
|
7147
7158
|
currentUser: t,
|
|
7148
7159
|
transport: p,
|
|
7149
7160
|
rtcConfig: m,
|
|
@@ -7159,13 +7170,13 @@ function ci(n) {
|
|
|
7159
7170
|
},
|
|
7160
7171
|
[K]
|
|
7161
7172
|
), ce = R(
|
|
7162
|
-
async (se,
|
|
7173
|
+
async (se, ot) => {
|
|
7163
7174
|
if (Y) {
|
|
7164
|
-
await Y(se,
|
|
7175
|
+
await Y(se, ot);
|
|
7165
7176
|
return;
|
|
7166
7177
|
}
|
|
7167
|
-
const
|
|
7168
|
-
F(
|
|
7178
|
+
const $t = await b(se, ot);
|
|
7179
|
+
F($t), X(se.length > 2 ? "conference" : "call");
|
|
7169
7180
|
},
|
|
7170
7181
|
[Y, b]
|
|
7171
7182
|
), ye = R(async () => {
|
|
@@ -7185,7 +7196,7 @@ function ci(n) {
|
|
|
7185
7196
|
J(), Z == null || Z(se);
|
|
7186
7197
|
},
|
|
7187
7198
|
[J, Z]
|
|
7188
|
-
),
|
|
7199
|
+
), st = R(
|
|
7189
7200
|
(se) => {
|
|
7190
7201
|
C(), W == null || W(se);
|
|
7191
7202
|
},
|
|
@@ -7205,11 +7216,11 @@ function ci(n) {
|
|
|
7205
7216
|
onStartCall: ce,
|
|
7206
7217
|
onEndCall: be,
|
|
7207
7218
|
onMuteAudio: Le,
|
|
7208
|
-
onMuteVideo:
|
|
7219
|
+
onMuteVideo: st,
|
|
7209
7220
|
onStartScreenShare: We,
|
|
7210
7221
|
onStopScreenShare: Ge,
|
|
7211
7222
|
onRaiseHand: _
|
|
7212
|
-
}, qe = a.find((se) => se.id === l) ?? a[0], xe = fe ? fe.participants.length > 2 ? "conference" : "call" : ee,
|
|
7223
|
+
}, qe = a.find((se) => se.id === l) ?? a[0], xe = fe ? fe.participants.length > 2 ? "conference" : "call" : ee, Nt = {
|
|
7213
7224
|
width: "100%",
|
|
7214
7225
|
height: "100%",
|
|
7215
7226
|
position: "relative",
|
|
@@ -7221,17 +7232,17 @@ function ci(n) {
|
|
|
7221
7232
|
id: V,
|
|
7222
7233
|
"data-testid": Q,
|
|
7223
7234
|
className: `nice-communication nice-communication--${xe}${w ? ` ${w}` : ""}`,
|
|
7224
|
-
style:
|
|
7235
|
+
style: Nt,
|
|
7225
7236
|
children: [
|
|
7226
7237
|
ue && xe !== "workspace" && /* @__PURE__ */ r(
|
|
7227
|
-
|
|
7238
|
+
Sn,
|
|
7228
7239
|
{
|
|
7229
7240
|
call: ue,
|
|
7230
7241
|
onAccept: ye,
|
|
7231
7242
|
onDecline: Se
|
|
7232
7243
|
}
|
|
7233
7244
|
),
|
|
7234
|
-
xe === "bubble" && /* @__PURE__ */ r(
|
|
7245
|
+
xe === "bubble" && /* @__PURE__ */ r(wn, { props: n, onExpand: ne }),
|
|
7235
7246
|
xe === "chat" && qe && /* @__PURE__ */ r(
|
|
7236
7247
|
Ye,
|
|
7237
7248
|
{
|
|
@@ -7244,7 +7255,7 @@ function ci(n) {
|
|
|
7244
7255
|
}
|
|
7245
7256
|
),
|
|
7246
7257
|
xe === "messenger" && /* @__PURE__ */ r(
|
|
7247
|
-
|
|
7258
|
+
qt,
|
|
7248
7259
|
{
|
|
7249
7260
|
conversations: a,
|
|
7250
7261
|
messages: s,
|
|
@@ -7259,7 +7270,7 @@ function ci(n) {
|
|
|
7259
7270
|
}
|
|
7260
7271
|
),
|
|
7261
7272
|
xe === "workspace" && /* @__PURE__ */ r(
|
|
7262
|
-
|
|
7273
|
+
bn,
|
|
7263
7274
|
{
|
|
7264
7275
|
currentUser: t,
|
|
7265
7276
|
users: i,
|
|
@@ -7281,7 +7292,7 @@ function ci(n) {
|
|
|
7281
7292
|
}
|
|
7282
7293
|
),
|
|
7283
7294
|
xe === "call" && fe && /* @__PURE__ */ r(
|
|
7284
|
-
|
|
7295
|
+
zt,
|
|
7285
7296
|
{
|
|
7286
7297
|
session: fe,
|
|
7287
7298
|
currentUser: t,
|
|
@@ -7292,7 +7303,7 @@ function ci(n) {
|
|
|
7292
7303
|
}
|
|
7293
7304
|
),
|
|
7294
7305
|
xe === "conference" && fe && /* @__PURE__ */ r(
|
|
7295
|
-
|
|
7306
|
+
Tt,
|
|
7296
7307
|
{
|
|
7297
7308
|
session: fe,
|
|
7298
7309
|
currentUser: t,
|
|
@@ -7303,7 +7314,7 @@ function ci(n) {
|
|
|
7303
7314
|
}
|
|
7304
7315
|
),
|
|
7305
7316
|
xe === "whiteboard" && B && /* @__PURE__ */ r(
|
|
7306
|
-
|
|
7317
|
+
Rt,
|
|
7307
7318
|
{
|
|
7308
7319
|
session: ae ?? ge,
|
|
7309
7320
|
currentUser: t,
|
|
@@ -7316,7 +7327,7 @@ function ci(n) {
|
|
|
7316
7327
|
}
|
|
7317
7328
|
);
|
|
7318
7329
|
}
|
|
7319
|
-
const
|
|
7330
|
+
const kn = {
|
|
7320
7331
|
messages: "Messages",
|
|
7321
7332
|
attachments: "Attachments",
|
|
7322
7333
|
"whiteboard-snapshots": "Whiteboard snapshots",
|
|
@@ -7325,13 +7336,13 @@ const Sn = {
|
|
|
7325
7336
|
documents: "Documents",
|
|
7326
7337
|
"call-logs": "Call logs",
|
|
7327
7338
|
"audit-logs": "Audit logs"
|
|
7328
|
-
},
|
|
7339
|
+
}, ut = {
|
|
7329
7340
|
none: "No encryption",
|
|
7330
7341
|
"AES-GCM-128": "AES-GCM 128-bit",
|
|
7331
7342
|
"AES-GCM-256": "AES-GCM 256-bit (recommended)",
|
|
7332
7343
|
"ChaCha20-Poly1305": "ChaCha20-Poly1305",
|
|
7333
7344
|
"E2E-ECDH-P384": "End-to-End ECDH P-384"
|
|
7334
|
-
},
|
|
7345
|
+
}, Cn = {
|
|
7335
7346
|
messages: "Messages",
|
|
7336
7347
|
attachments: "Attachments",
|
|
7337
7348
|
whiteboard: "Whiteboard",
|
|
@@ -7340,14 +7351,14 @@ const Sn = {
|
|
|
7340
7351
|
calls: "Calls (metadata)",
|
|
7341
7352
|
presence: "Presence data",
|
|
7342
7353
|
all: "Everything"
|
|
7343
|
-
},
|
|
7344
|
-
function
|
|
7354
|
+
}, In = ["days", "weeks", "months", "years", "forever"];
|
|
7355
|
+
function ht(n) {
|
|
7345
7356
|
if (n === 0)
|
|
7346
7357
|
return "0 B";
|
|
7347
7358
|
const e = 1024, t = ["B", "KB", "MB", "GB"], i = Math.floor(Math.log(n) / Math.log(e));
|
|
7348
7359
|
return `${(n / Math.pow(e, i)).toFixed(1)} ${t[i]}`;
|
|
7349
7360
|
}
|
|
7350
|
-
function
|
|
7361
|
+
function gt({
|
|
7351
7362
|
value: n,
|
|
7352
7363
|
onChange: e,
|
|
7353
7364
|
disabled: t = !1
|
|
@@ -7383,16 +7394,16 @@ function ht({
|
|
|
7383
7394
|
borderRadius: 5,
|
|
7384
7395
|
fontSize: 12
|
|
7385
7396
|
},
|
|
7386
|
-
children:
|
|
7397
|
+
children: In.map((i) => /* @__PURE__ */ r("option", { value: i, children: i }, i))
|
|
7387
7398
|
}
|
|
7388
7399
|
)
|
|
7389
7400
|
] });
|
|
7390
7401
|
}
|
|
7391
|
-
function
|
|
7402
|
+
function zn({
|
|
7392
7403
|
config: n,
|
|
7393
7404
|
onChange: e
|
|
7394
7405
|
}) {
|
|
7395
|
-
const t = n.retentionRules.length > 0 ? n.retentionRules :
|
|
7406
|
+
const t = n.retentionRules.length > 0 ? n.retentionRules : Pt;
|
|
7396
7407
|
function i(a, s) {
|
|
7397
7408
|
const l = t.map((c) => c.dataType === a ? { ...c, ...s } : c);
|
|
7398
7409
|
e({ ...n, retentionRules: l });
|
|
@@ -7453,9 +7464,9 @@ function In({
|
|
|
7453
7464
|
{
|
|
7454
7465
|
style: { borderBottom: "1px solid var(--nice-bg-secondary, #f3f4f6)" },
|
|
7455
7466
|
children: [
|
|
7456
|
-
/* @__PURE__ */ r("td", { style: { ...Ae, fontWeight: 500, color: "var(--nice-text, #374151)" }, children:
|
|
7467
|
+
/* @__PURE__ */ r("td", { style: { ...Ae, fontWeight: 500, color: "var(--nice-text, #374151)" }, children: kn[a.dataType] }),
|
|
7457
7468
|
/* @__PURE__ */ r("td", { style: Ae, children: /* @__PURE__ */ r(
|
|
7458
|
-
|
|
7469
|
+
gt,
|
|
7459
7470
|
{
|
|
7460
7471
|
value: a.activePeriod,
|
|
7461
7472
|
onChange: (s) => i(a.dataType, { activePeriod: s })
|
|
@@ -7463,7 +7474,7 @@ function In({
|
|
|
7463
7474
|
) }),
|
|
7464
7475
|
/* @__PURE__ */ r("td", { style: Ae, children: a.archivePeriod ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
7465
7476
|
/* @__PURE__ */ r(
|
|
7466
|
-
|
|
7477
|
+
gt,
|
|
7467
7478
|
{
|
|
7468
7479
|
value: a.archivePeriod,
|
|
7469
7480
|
onChange: (s) => i(a.dataType, { archivePeriod: s })
|
|
@@ -7557,7 +7568,7 @@ function In({
|
|
|
7557
7568
|
] })
|
|
7558
7569
|
] });
|
|
7559
7570
|
}
|
|
7560
|
-
function
|
|
7571
|
+
function Tn({
|
|
7561
7572
|
config: n,
|
|
7562
7573
|
onChange: e
|
|
7563
7574
|
}) {
|
|
@@ -7640,7 +7651,7 @@ function zn({
|
|
|
7640
7651
|
value: n.defaultAlgorithm,
|
|
7641
7652
|
onChange: (i) => e({ ...n, defaultAlgorithm: i.target.value }),
|
|
7642
7653
|
style: Te,
|
|
7643
|
-
children: Object.entries(
|
|
7654
|
+
children: Object.entries(ut).map(([i, a]) => /* @__PURE__ */ r("option", { value: i, children: a }, i))
|
|
7644
7655
|
}
|
|
7645
7656
|
)
|
|
7646
7657
|
] }),
|
|
@@ -7735,7 +7746,7 @@ function zn({
|
|
|
7735
7746
|
}
|
|
7736
7747
|
}
|
|
7737
7748
|
),
|
|
7738
|
-
/* @__PURE__ */ r("span", { style: { minWidth: 120, fontSize: 12, color: "var(--nice-text, #374151)" }, children:
|
|
7749
|
+
/* @__PURE__ */ r("span", { style: { minWidth: 120, fontSize: 12, color: "var(--nice-text, #374151)" }, children: Cn[i] }),
|
|
7739
7750
|
/* @__PURE__ */ r(
|
|
7740
7751
|
"select",
|
|
7741
7752
|
{
|
|
@@ -7749,7 +7760,7 @@ function zn({
|
|
|
7749
7760
|
e({ ...n, scopeOverrides: d });
|
|
7750
7761
|
},
|
|
7751
7762
|
style: { ...Te, flex: 1, opacity: s ? 1 : 0.4 },
|
|
7752
|
-
children: Object.entries(
|
|
7763
|
+
children: Object.entries(ut).map(([u, d]) => /* @__PURE__ */ r("option", { value: u, children: d }, u))
|
|
7753
7764
|
}
|
|
7754
7765
|
)
|
|
7755
7766
|
]
|
|
@@ -7760,7 +7771,7 @@ function zn({
|
|
|
7760
7771
|
] })
|
|
7761
7772
|
] });
|
|
7762
7773
|
}
|
|
7763
|
-
function
|
|
7774
|
+
function pi({
|
|
7764
7775
|
storageConfig: n,
|
|
7765
7776
|
defaultStorageConfig: e,
|
|
7766
7777
|
encryptionConfig: t,
|
|
@@ -7774,7 +7785,7 @@ function di({
|
|
|
7774
7785
|
style: g,
|
|
7775
7786
|
"data-testid": p
|
|
7776
7787
|
}) {
|
|
7777
|
-
const [m, h] = N("retention"), [x, T] =
|
|
7788
|
+
const [m, h] = N("retention"), [x, T] = Ot({
|
|
7778
7789
|
value: n,
|
|
7779
7790
|
defaultValue: e,
|
|
7780
7791
|
fallbackValue: { provider: "indexeddb", retentionRules: [] },
|
|
@@ -7786,7 +7797,7 @@ function di({
|
|
|
7786
7797
|
showIndicator: !0
|
|
7787
7798
|
}, z = {
|
|
7788
7799
|
...x,
|
|
7789
|
-
retentionRules: x.retentionRules.length > 0 ? x.retentionRules :
|
|
7800
|
+
retentionRules: x.retentionRules.length > 0 ? x.retentionRules : Pt
|
|
7790
7801
|
};
|
|
7791
7802
|
return /* @__PURE__ */ o(
|
|
7792
7803
|
"div",
|
|
@@ -7830,9 +7841,9 @@ function di({
|
|
|
7830
7841
|
children: [
|
|
7831
7842
|
/* @__PURE__ */ r("span", { children: "Storage used" }),
|
|
7832
7843
|
/* @__PURE__ */ o("span", { children: [
|
|
7833
|
-
|
|
7844
|
+
ht(s),
|
|
7834
7845
|
" / ",
|
|
7835
|
-
|
|
7846
|
+
ht(x.quota)
|
|
7836
7847
|
] })
|
|
7837
7848
|
]
|
|
7838
7849
|
}
|
|
@@ -7885,9 +7896,9 @@ function di({
|
|
|
7885
7896
|
}
|
|
7886
7897
|
),
|
|
7887
7898
|
/* @__PURE__ */ o("div", { children: [
|
|
7888
|
-
(m === "retention" || !l) && c && /* @__PURE__ */ r(
|
|
7899
|
+
(m === "retention" || !l) && c && /* @__PURE__ */ r(zn, { config: z, onChange: T }),
|
|
7889
7900
|
(m === "encryption" || !c) && l && /* @__PURE__ */ r(
|
|
7890
|
-
|
|
7901
|
+
Tn,
|
|
7891
7902
|
{
|
|
7892
7903
|
config: f,
|
|
7893
7904
|
onChange: a ?? (() => {
|
|
@@ -7929,13 +7940,13 @@ function He(n) {
|
|
|
7929
7940
|
const e = Math.floor(n / 1e3), t = Math.floor(e / 60), i = Math.floor(t / 60);
|
|
7930
7941
|
return i > 0 ? `${i}:${String(t % 60).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}` : `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
|
|
7931
7942
|
}
|
|
7932
|
-
function
|
|
7943
|
+
function Pn(n) {
|
|
7933
7944
|
if (n === 0)
|
|
7934
7945
|
return "0 B";
|
|
7935
7946
|
const e = 1024, t = ["B", "KB", "MB", "GB"], i = Math.floor(Math.log(n) / Math.log(e));
|
|
7936
7947
|
return `${(n / Math.pow(e, i)).toFixed(1)} ${t[i]}`;
|
|
7937
7948
|
}
|
|
7938
|
-
function
|
|
7949
|
+
function Rn(n, e) {
|
|
7939
7950
|
return new Intl.DateTimeFormat(e, {
|
|
7940
7951
|
month: "short",
|
|
7941
7952
|
day: "numeric",
|
|
@@ -7943,7 +7954,7 @@ function Pn(n, e) {
|
|
|
7943
7954
|
minute: "2-digit"
|
|
7944
7955
|
}).format(new Date(n));
|
|
7945
7956
|
}
|
|
7946
|
-
const
|
|
7957
|
+
const An = (n, e) => n(`recording.state.${e}`, At[e].label), At = {
|
|
7947
7958
|
idle: {
|
|
7948
7959
|
label: "Idle",
|
|
7949
7960
|
icon: null,
|
|
@@ -7981,7 +7992,7 @@ const Rn = (n, e) => n(`recording.state.${e}`, Rt[e].label), Rt = {
|
|
|
7981
7992
|
fg: "var(--nice-danger-dark, #dc2626)"
|
|
7982
7993
|
}
|
|
7983
7994
|
};
|
|
7984
|
-
function
|
|
7995
|
+
function Dn({
|
|
7985
7996
|
segments: n,
|
|
7986
7997
|
onClose: e,
|
|
7987
7998
|
currentTimeMs: t = 0
|
|
@@ -8030,7 +8041,7 @@ function An({
|
|
|
8030
8041
|
"button",
|
|
8031
8042
|
{
|
|
8032
8043
|
onClick: e,
|
|
8033
|
-
style:
|
|
8044
|
+
style: Nn,
|
|
8034
8045
|
"aria-label": i("recording.close", "Close"),
|
|
8035
8046
|
children: /* @__PURE__ */ r(S, { name: "close", size: 16 })
|
|
8036
8047
|
}
|
|
@@ -8114,22 +8125,22 @@ function An({
|
|
|
8114
8125
|
}
|
|
8115
8126
|
);
|
|
8116
8127
|
}
|
|
8117
|
-
function
|
|
8128
|
+
function Dt({ startedAt: n }) {
|
|
8118
8129
|
const [e, t] = N(0);
|
|
8119
8130
|
return re(() => {
|
|
8120
8131
|
const i = new Date(n).getTime(), a = setInterval(() => t(Date.now() - i), 500);
|
|
8121
8132
|
return () => clearInterval(a);
|
|
8122
8133
|
}, [n]), /* @__PURE__ */ r(he, { children: He(e) });
|
|
8123
8134
|
}
|
|
8124
|
-
function
|
|
8135
|
+
function En({
|
|
8125
8136
|
rec: n,
|
|
8126
8137
|
onDelete: e,
|
|
8127
8138
|
onDownload: t
|
|
8128
8139
|
}) {
|
|
8129
|
-
const { t: i, lang: a } = Ke(), [s, l] = N(!1), [c, u] = N(0), d = le(null), g =
|
|
8140
|
+
const { t: i, lang: a } = Ke(), [s, l] = N(!1), [c, u] = N(0), d = le(null), g = At[n.state], p = An(i, n.state), m = n.state === "recording" || n.state === "paused";
|
|
8130
8141
|
return /* @__PURE__ */ o(he, { children: [
|
|
8131
8142
|
s && n.transcript && /* @__PURE__ */ r(
|
|
8132
|
-
|
|
8143
|
+
Dn,
|
|
8133
8144
|
{
|
|
8134
8145
|
segments: n.transcript,
|
|
8135
8146
|
currentTimeMs: c,
|
|
@@ -8181,9 +8192,9 @@ function Dn({
|
|
|
8181
8192
|
gap: 8
|
|
8182
8193
|
},
|
|
8183
8194
|
children: [
|
|
8184
|
-
/* @__PURE__ */ r("span", { children:
|
|
8185
|
-
/* @__PURE__ */ r("span", { children: m ? /* @__PURE__ */ r(
|
|
8186
|
-
n.size != null && /* @__PURE__ */ r("span", { children:
|
|
8195
|
+
/* @__PURE__ */ r("span", { children: Rn(n.startedAt, a) }),
|
|
8196
|
+
/* @__PURE__ */ r("span", { children: m ? /* @__PURE__ */ r(Dt, { startedAt: n.startedAt }) : n.durationMs != null ? He(n.durationMs) : "—" }),
|
|
8197
|
+
n.size != null && /* @__PURE__ */ r("span", { children: Pn(n.size) }),
|
|
8187
8198
|
/* @__PURE__ */ o("span", { children: [
|
|
8188
8199
|
n.participants.length,
|
|
8189
8200
|
" participants"
|
|
@@ -8262,7 +8273,7 @@ function Dn({
|
|
|
8262
8273
|
)
|
|
8263
8274
|
] });
|
|
8264
8275
|
}
|
|
8265
|
-
function
|
|
8276
|
+
function fi({
|
|
8266
8277
|
recordings: n,
|
|
8267
8278
|
onRecordingStart: e,
|
|
8268
8279
|
onRecordingStop: t,
|
|
@@ -8359,7 +8370,7 @@ function pi({
|
|
|
8359
8370
|
disabled: Y || M,
|
|
8360
8371
|
onChange: () => {
|
|
8361
8372
|
},
|
|
8362
|
-
style: { ...
|
|
8373
|
+
style: { ...mt, flex: 0 },
|
|
8363
8374
|
children: [
|
|
8364
8375
|
/* @__PURE__ */ r("option", { value: "call", children: m("recording.type.call", "Call") }),
|
|
8365
8376
|
/* @__PURE__ */ r("option", { value: "meeting", children: m("recording.type.meeting", "Meeting") }),
|
|
@@ -8438,7 +8449,7 @@ function pi({
|
|
|
8438
8449
|
"span",
|
|
8439
8450
|
{
|
|
8440
8451
|
style: { fontSize: 12, color: "var(--nice-text-muted, #9ca3af)", marginLeft: 4 },
|
|
8441
|
-
children: /* @__PURE__ */ r(
|
|
8452
|
+
children: /* @__PURE__ */ r(Dt, { startedAt: D.startedAt })
|
|
8442
8453
|
}
|
|
8443
8454
|
)
|
|
8444
8455
|
] })
|
|
@@ -8477,7 +8488,7 @@ function pi({
|
|
|
8477
8488
|
{
|
|
8478
8489
|
value: z,
|
|
8479
8490
|
onChange: (W) => $(W.target.value),
|
|
8480
|
-
style:
|
|
8491
|
+
style: mt,
|
|
8481
8492
|
children: [
|
|
8482
8493
|
/* @__PURE__ */ r("option", { value: "all", children: m("recording.filter.all", "All types") }),
|
|
8483
8494
|
/* @__PURE__ */ r("option", { value: "call", children: m("recording.filter.calls", "Calls") }),
|
|
@@ -8509,7 +8520,7 @@ function pi({
|
|
|
8509
8520
|
]
|
|
8510
8521
|
}
|
|
8511
8522
|
) : H.map((W) => /* @__PURE__ */ r(
|
|
8512
|
-
|
|
8523
|
+
En,
|
|
8513
8524
|
{
|
|
8514
8525
|
rec: W,
|
|
8515
8526
|
onDelete: G,
|
|
@@ -8539,14 +8550,14 @@ const Ze = {
|
|
|
8539
8550
|
display: "inline-flex",
|
|
8540
8551
|
alignItems: "center",
|
|
8541
8552
|
gap: 4
|
|
8542
|
-
},
|
|
8553
|
+
}, mt = {
|
|
8543
8554
|
padding: "4px 6px",
|
|
8544
8555
|
border: "1px solid var(--nice-border, #e5e7eb)",
|
|
8545
8556
|
borderRadius: 6,
|
|
8546
8557
|
fontSize: 12,
|
|
8547
8558
|
color: "var(--nice-text, #374151)",
|
|
8548
8559
|
background: "var(--nice-bg, #fff)"
|
|
8549
|
-
},
|
|
8560
|
+
}, Nn = {
|
|
8550
8561
|
border: "none",
|
|
8551
8562
|
background: "none",
|
|
8552
8563
|
cursor: "pointer",
|
|
@@ -8555,7 +8566,7 @@ const Ze = {
|
|
|
8555
8566
|
lineHeight: 1,
|
|
8556
8567
|
padding: 4
|
|
8557
8568
|
};
|
|
8558
|
-
function
|
|
8569
|
+
function yt({
|
|
8559
8570
|
participant: n,
|
|
8560
8571
|
isFollowing: e,
|
|
8561
8572
|
onClick: t
|
|
@@ -8574,7 +8585,7 @@ function mt({
|
|
|
8574
8585
|
height: 30,
|
|
8575
8586
|
borderRadius: "50%",
|
|
8576
8587
|
background: n.color,
|
|
8577
|
-
color: "var(--nice-
|
|
8588
|
+
color: "var(--nice-color-white, #fff)",
|
|
8578
8589
|
fontSize: 11,
|
|
8579
8590
|
fontWeight: 600,
|
|
8580
8591
|
border: `2px solid ${e ? "var(--nice-bg, #fff)" : n.color}`,
|
|
@@ -8613,7 +8624,7 @@ function mt({
|
|
|
8613
8624
|
}
|
|
8614
8625
|
);
|
|
8615
8626
|
}
|
|
8616
|
-
function
|
|
8627
|
+
function $n({ participant: n, containerRect: e }) {
|
|
8617
8628
|
if (!n.cursorX || !n.cursorY || !e)
|
|
8618
8629
|
return null;
|
|
8619
8630
|
const t = n.cursorX, i = n.cursorY;
|
|
@@ -8643,7 +8654,7 @@ function Nn({ participant: n, containerRect: e }) {
|
|
|
8643
8654
|
{
|
|
8644
8655
|
style: {
|
|
8645
8656
|
background: n.color,
|
|
8646
|
-
color: "var(--nice-
|
|
8657
|
+
color: "var(--nice-color-white, #fff)",
|
|
8647
8658
|
fontSize: 10,
|
|
8648
8659
|
padding: "1px 5px",
|
|
8649
8660
|
borderRadius: 3,
|
|
@@ -8658,7 +8669,7 @@ function Nn({ participant: n, containerRect: e }) {
|
|
|
8658
8669
|
}
|
|
8659
8670
|
);
|
|
8660
8671
|
}
|
|
8661
|
-
function
|
|
8672
|
+
function Mn({ count: n }) {
|
|
8662
8673
|
return n === 0 ? null : /* @__PURE__ */ o(
|
|
8663
8674
|
"div",
|
|
8664
8675
|
{
|
|
@@ -8691,7 +8702,7 @@ function $n({ count: n }) {
|
|
|
8691
8702
|
}
|
|
8692
8703
|
);
|
|
8693
8704
|
}
|
|
8694
|
-
function
|
|
8705
|
+
function On() {
|
|
8695
8706
|
return /* @__PURE__ */ r(
|
|
8696
8707
|
"div",
|
|
8697
8708
|
{
|
|
@@ -8712,7 +8723,7 @@ function Mn() {
|
|
|
8712
8723
|
{
|
|
8713
8724
|
style: {
|
|
8714
8725
|
background: "var(--nice-overlay-60, rgba(0, 0, 0, 0.6))",
|
|
8715
|
-
color: "var(--nice-
|
|
8726
|
+
color: "var(--nice-color-white, #fff)",
|
|
8716
8727
|
fontSize: 12,
|
|
8717
8728
|
padding: "4px 14px",
|
|
8718
8729
|
borderRadius: 20,
|
|
@@ -8729,7 +8740,7 @@ function Mn() {
|
|
|
8729
8740
|
}
|
|
8730
8741
|
);
|
|
8731
8742
|
}
|
|
8732
|
-
function
|
|
8743
|
+
function Ln({ pending: n }) {
|
|
8733
8744
|
return n === 0 ? /* @__PURE__ */ o(
|
|
8734
8745
|
"span",
|
|
8735
8746
|
{
|
|
@@ -8764,7 +8775,7 @@ function On({ pending: n }) {
|
|
|
8764
8775
|
}
|
|
8765
8776
|
);
|
|
8766
8777
|
}
|
|
8767
|
-
function
|
|
8778
|
+
function Wn({
|
|
8768
8779
|
participant: n,
|
|
8769
8780
|
isFollowing: e,
|
|
8770
8781
|
onClick: t
|
|
@@ -8779,7 +8790,7 @@ function Ln({
|
|
|
8779
8790
|
border: `1px solid ${e ? n.color : "var(--nice-border, #e5e7eb)"}`,
|
|
8780
8791
|
borderRadius: 20,
|
|
8781
8792
|
background: e ? n.color : "var(--nice-bg, #fff)",
|
|
8782
|
-
color: e ? "var(--nice-
|
|
8793
|
+
color: e ? "var(--nice-color-white, #fff)" : "var(--nice-text-secondary, #6b7280)",
|
|
8783
8794
|
cursor: "pointer",
|
|
8784
8795
|
display: "flex",
|
|
8785
8796
|
alignItems: "center",
|
|
@@ -8793,7 +8804,7 @@ function Ln({
|
|
|
8793
8804
|
}
|
|
8794
8805
|
);
|
|
8795
8806
|
}
|
|
8796
|
-
function
|
|
8807
|
+
function ui({
|
|
8797
8808
|
editorType: n,
|
|
8798
8809
|
sessionId: e,
|
|
8799
8810
|
currentUser: t,
|
|
@@ -8868,10 +8879,10 @@ function fi({
|
|
|
8868
8879
|
}
|
|
8869
8880
|
),
|
|
8870
8881
|
/* @__PURE__ */ r("span", { style: { flex: 1 } }),
|
|
8871
|
-
/* @__PURE__ */ r(
|
|
8882
|
+
/* @__PURE__ */ r(Ln, { pending: p }),
|
|
8872
8883
|
d && i.length > 0 && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: -4 }, children: [
|
|
8873
8884
|
i.slice(0, 5).map((E, P) => /* @__PURE__ */ r("div", { style: { marginLeft: P > 0 ? -8 : 0, zIndex: 10 - P }, children: /* @__PURE__ */ r(
|
|
8874
|
-
|
|
8885
|
+
yt,
|
|
8875
8886
|
{
|
|
8876
8887
|
participant: E,
|
|
8877
8888
|
isFollowing: Y === E.user.id,
|
|
@@ -8969,9 +8980,9 @@ function fi({
|
|
|
8969
8980
|
]
|
|
8970
8981
|
}
|
|
8971
8982
|
),
|
|
8972
|
-
g && i.filter((E) => E.user.id !== t.id && E.cursorX != null && E.cursorY != null).map((E) => /* @__PURE__ */ r(
|
|
8973
|
-
/* @__PURE__ */ r(
|
|
8974
|
-
u && /* @__PURE__ */ r(
|
|
8983
|
+
g && i.filter((E) => E.user.id !== t.id && E.cursorX != null && E.cursorY != null).map((E) => /* @__PURE__ */ r($n, { participant: E, containerRect: $ }, E.user.id)),
|
|
8984
|
+
/* @__PURE__ */ r(Mn, { count: m }),
|
|
8985
|
+
u && /* @__PURE__ */ r(On, {})
|
|
8975
8986
|
]
|
|
8976
8987
|
}
|
|
8977
8988
|
), K = H && i.length > 0 ? /* @__PURE__ */ o(
|
|
@@ -9033,7 +9044,7 @@ function fi({
|
|
|
9033
9044
|
children: [
|
|
9034
9045
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
9035
9046
|
/* @__PURE__ */ r(
|
|
9036
|
-
|
|
9047
|
+
yt,
|
|
9037
9048
|
{
|
|
9038
9049
|
participant: E,
|
|
9039
9050
|
isFollowing: Y === E.user.id,
|
|
@@ -9059,7 +9070,7 @@ function fi({
|
|
|
9059
9070
|
] })
|
|
9060
9071
|
] }),
|
|
9061
9072
|
E.user.id !== t.id && /* @__PURE__ */ r(
|
|
9062
|
-
|
|
9073
|
+
Wn,
|
|
9063
9074
|
{
|
|
9064
9075
|
participant: E,
|
|
9065
9076
|
isFollowing: Y === E.user.id,
|
|
@@ -9074,7 +9085,7 @@ function fi({
|
|
|
9074
9085
|
}
|
|
9075
9086
|
) : void 0;
|
|
9076
9087
|
return /* @__PURE__ */ r(
|
|
9077
|
-
|
|
9088
|
+
kt,
|
|
9078
9089
|
{
|
|
9079
9090
|
flush: !0,
|
|
9080
9091
|
className: h,
|
|
@@ -9090,25 +9101,25 @@ function fi({
|
|
|
9090
9101
|
}
|
|
9091
9102
|
);
|
|
9092
9103
|
}
|
|
9093
|
-
function
|
|
9104
|
+
function rt(n) {
|
|
9094
9105
|
let e = "";
|
|
9095
9106
|
for (let t = 0; t < n.length; t++)
|
|
9096
9107
|
e += String.fromCharCode(n[t]);
|
|
9097
9108
|
return btoa(e);
|
|
9098
9109
|
}
|
|
9099
|
-
function
|
|
9110
|
+
function at(n) {
|
|
9100
9111
|
const e = atob(n), t = new Uint8Array(e.length);
|
|
9101
9112
|
for (let i = 0; i < e.length; i++)
|
|
9102
9113
|
t[i] = e.charCodeAt(i);
|
|
9103
9114
|
return t;
|
|
9104
9115
|
}
|
|
9105
|
-
function
|
|
9116
|
+
function _n(n) {
|
|
9106
9117
|
return new TextEncoder().encode(n);
|
|
9107
9118
|
}
|
|
9108
|
-
function
|
|
9119
|
+
function Fn(n) {
|
|
9109
9120
|
return new TextDecoder().decode(n);
|
|
9110
9121
|
}
|
|
9111
|
-
async function
|
|
9122
|
+
async function jn(n) {
|
|
9112
9123
|
return crypto.subtle.generateKey(
|
|
9113
9124
|
{ name: "AES-GCM", length: n },
|
|
9114
9125
|
!0,
|
|
@@ -9116,10 +9127,10 @@ async function Fn(n) {
|
|
|
9116
9127
|
["encrypt", "decrypt"]
|
|
9117
9128
|
);
|
|
9118
9129
|
}
|
|
9119
|
-
async function
|
|
9130
|
+
async function Bn() {
|
|
9120
9131
|
return crypto.subtle.generateKey({ name: "ECDH", namedCurve: "P-384" }, !0, ["deriveKey"]);
|
|
9121
9132
|
}
|
|
9122
|
-
async function
|
|
9133
|
+
async function Un(n, e) {
|
|
9123
9134
|
return crypto.subtle.deriveKey(
|
|
9124
9135
|
{ name: "ECDH", public: e },
|
|
9125
9136
|
n,
|
|
@@ -9128,20 +9139,20 @@ async function Bn(n, e) {
|
|
|
9128
9139
|
["encrypt", "decrypt"]
|
|
9129
9140
|
);
|
|
9130
9141
|
}
|
|
9131
|
-
async function
|
|
9132
|
-
const t = crypto.getRandomValues(new Uint8Array(12)), i =
|
|
9142
|
+
async function Hn(n, e) {
|
|
9143
|
+
const t = crypto.getRandomValues(new Uint8Array(12)), i = _n(e), a = await crypto.subtle.encrypt(
|
|
9133
9144
|
{ name: "AES-GCM", iv: t },
|
|
9134
9145
|
n,
|
|
9135
9146
|
i
|
|
9136
9147
|
), s = new Uint8Array(a), l = new Uint8Array(12 + s.length);
|
|
9137
|
-
return l.set(t, 0), l.set(s, 12),
|
|
9148
|
+
return l.set(t, 0), l.set(s, 12), rt(l);
|
|
9138
9149
|
}
|
|
9139
|
-
async function
|
|
9140
|
-
const t =
|
|
9141
|
-
return
|
|
9150
|
+
async function Kn(n, e) {
|
|
9151
|
+
const t = at(e), i = t.slice(0, 12), a = t.slice(12), s = await crypto.subtle.decrypt({ name: "AES-GCM", iv: i }, n, a);
|
|
9152
|
+
return Fn(new Uint8Array(s));
|
|
9142
9153
|
}
|
|
9143
|
-
async function
|
|
9144
|
-
const t =
|
|
9154
|
+
async function vt(n, e) {
|
|
9155
|
+
const t = at(n);
|
|
9145
9156
|
return crypto.subtle.importKey(
|
|
9146
9157
|
"raw",
|
|
9147
9158
|
t,
|
|
@@ -9150,16 +9161,16 @@ async function yt(n, e) {
|
|
|
9150
9161
|
["encrypt", "decrypt"]
|
|
9151
9162
|
);
|
|
9152
9163
|
}
|
|
9153
|
-
async function
|
|
9164
|
+
async function Yn(n) {
|
|
9154
9165
|
const e = await crypto.subtle.exportKey("raw", n);
|
|
9155
|
-
return
|
|
9166
|
+
return rt(new Uint8Array(e));
|
|
9156
9167
|
}
|
|
9157
|
-
async function
|
|
9168
|
+
async function Gn(n) {
|
|
9158
9169
|
const e = await crypto.subtle.exportKey("spki", n);
|
|
9159
|
-
return
|
|
9170
|
+
return rt(new Uint8Array(e));
|
|
9160
9171
|
}
|
|
9161
|
-
async function
|
|
9162
|
-
const e =
|
|
9172
|
+
async function qn(n) {
|
|
9173
|
+
const e = at(n);
|
|
9163
9174
|
return crypto.subtle.importKey(
|
|
9164
9175
|
"spki",
|
|
9165
9176
|
e,
|
|
@@ -9168,7 +9179,7 @@ async function Gn(n) {
|
|
|
9168
9179
|
[]
|
|
9169
9180
|
);
|
|
9170
9181
|
}
|
|
9171
|
-
class
|
|
9182
|
+
class Vn {
|
|
9172
9183
|
constructor(e) {
|
|
9173
9184
|
this.keys = {}, this.ready = !1, this.config = e;
|
|
9174
9185
|
}
|
|
@@ -9180,12 +9191,12 @@ class qn {
|
|
|
9180
9191
|
}
|
|
9181
9192
|
const e = this.config.defaultAlgorithm;
|
|
9182
9193
|
if (this.config.keyMaterial)
|
|
9183
|
-
e === "AES-GCM-128" ? this.keys.aes128 = await
|
|
9194
|
+
e === "AES-GCM-128" ? this.keys.aes128 = await vt(this.config.keyMaterial, 128) : this.keys.aes256 = await vt(this.config.keyMaterial, 256);
|
|
9184
9195
|
else if (e === "AES-GCM-256" || e === "AES-GCM-128") {
|
|
9185
|
-
const t = e === "AES-GCM-256" ? 256 : 128, i = await
|
|
9196
|
+
const t = e === "AES-GCM-256" ? 256 : 128, i = await jn(t);
|
|
9186
9197
|
t === 128 ? this.keys.aes128 = i : this.keys.aes256 = i;
|
|
9187
9198
|
} else if (e === "E2E-ECDH-P384") {
|
|
9188
|
-
const t = await
|
|
9199
|
+
const t = await Bn();
|
|
9189
9200
|
this.keys.ecdhPrivate = t.privateKey, this.keys.ecdhPublic = t.publicKey, this.keys.ecdhSessionKeys = /* @__PURE__ */ new Map();
|
|
9190
9201
|
}
|
|
9191
9202
|
this.ready = !0;
|
|
@@ -9193,14 +9204,14 @@ class qn {
|
|
|
9193
9204
|
// ── Key exchange (E2E) ────────────────────────────────────────────────────
|
|
9194
9205
|
/** Export local ECDH public key — broadcast this to peers */
|
|
9195
9206
|
async getPublicKeyForPeer() {
|
|
9196
|
-
return this.keys.ecdhPublic ?
|
|
9207
|
+
return this.keys.ecdhPublic ? Gn(this.keys.ecdhPublic) : null;
|
|
9197
9208
|
}
|
|
9198
9209
|
/** Register a peer's ECDH public key to derive a shared session key */
|
|
9199
9210
|
async registerPeerPublicKey(e, t) {
|
|
9200
9211
|
var s;
|
|
9201
9212
|
if (!this.keys.ecdhPrivate)
|
|
9202
9213
|
return;
|
|
9203
|
-
const i = await
|
|
9214
|
+
const i = await qn(t), a = await Un(this.keys.ecdhPrivate, i);
|
|
9204
9215
|
(s = this.keys.ecdhSessionKeys) == null || s.set(e, a);
|
|
9205
9216
|
}
|
|
9206
9217
|
// ── Encrypt / Decrypt ─────────────────────────────────────────────────────
|
|
@@ -9236,7 +9247,7 @@ class qn {
|
|
|
9236
9247
|
if (a === "none")
|
|
9237
9248
|
return e;
|
|
9238
9249
|
const s = this.getKey(a, i);
|
|
9239
|
-
return s ?
|
|
9250
|
+
return s ? Hn(s, e) : (console.warn(`EncryptionService: no key found for algorithm "${a}" — returning plaintext`), e);
|
|
9240
9251
|
}
|
|
9241
9252
|
async decrypt(e, t, i) {
|
|
9242
9253
|
if (!this.config.enabled)
|
|
@@ -9247,13 +9258,13 @@ class qn {
|
|
|
9247
9258
|
if (a === "none")
|
|
9248
9259
|
return e;
|
|
9249
9260
|
const s = this.getKey(a, i);
|
|
9250
|
-
return s ?
|
|
9261
|
+
return s ? Kn(s, e) : (console.warn(`EncryptionService: no key found for algorithm "${a}" — returning as-is`), e);
|
|
9251
9262
|
}
|
|
9252
9263
|
// ── Utilities ─────────────────────────────────────────────────────────────
|
|
9253
9264
|
/** Export the symmetric key for backup / persistence */
|
|
9254
9265
|
async exportSymmetricKey(e) {
|
|
9255
9266
|
const t = e ?? this.config.defaultAlgorithm, i = this.getKey(t);
|
|
9256
|
-
return i ?
|
|
9267
|
+
return i ? Yn(i) : null;
|
|
9257
9268
|
}
|
|
9258
9269
|
isEnabled() {
|
|
9259
9270
|
return this.config.enabled;
|
|
@@ -9266,13 +9277,13 @@ class qn {
|
|
|
9266
9277
|
}
|
|
9267
9278
|
}
|
|
9268
9279
|
const Be = /* @__PURE__ */ new Map();
|
|
9269
|
-
function
|
|
9270
|
-
return Be.has(n) || Be.set(n, new
|
|
9280
|
+
function hi(n, e) {
|
|
9281
|
+
return Be.has(n) || Be.set(n, new Vn(e)), Be.get(n);
|
|
9271
9282
|
}
|
|
9272
|
-
function
|
|
9283
|
+
function gi(n) {
|
|
9273
9284
|
Be.delete(n);
|
|
9274
9285
|
}
|
|
9275
|
-
class
|
|
9286
|
+
class Xn {
|
|
9276
9287
|
constructor(e = {}) {
|
|
9277
9288
|
this.recorder = null, this.chunks = [], this.session = null, this.recognition = null, this.segmentCounter = 0, this.callbacks = e;
|
|
9278
9289
|
}
|
|
@@ -9390,13 +9401,13 @@ class Vn {
|
|
|
9390
9401
|
}
|
|
9391
9402
|
}
|
|
9392
9403
|
const Ue = /* @__PURE__ */ new Map();
|
|
9393
|
-
function
|
|
9394
|
-
return Ue.has(n) || Ue.set(n, new
|
|
9404
|
+
function mi(n, e) {
|
|
9405
|
+
return Ue.has(n) || Ue.set(n, new Xn(e)), Ue.get(n);
|
|
9395
9406
|
}
|
|
9396
|
-
function
|
|
9407
|
+
function yi(n) {
|
|
9397
9408
|
Ue.delete(n);
|
|
9398
9409
|
}
|
|
9399
|
-
class
|
|
9410
|
+
class Jn {
|
|
9400
9411
|
constructor(e) {
|
|
9401
9412
|
this.events = [], this.eventListeners = /* @__PURE__ */ new Map(), this.config = {
|
|
9402
9413
|
serverUrl: e.serverUrl,
|
|
@@ -9683,20 +9694,20 @@ class Xn {
|
|
|
9683
9694
|
}
|
|
9684
9695
|
}
|
|
9685
9696
|
let ke = null;
|
|
9686
|
-
function
|
|
9687
|
-
if (!ke && n && (ke = new
|
|
9697
|
+
function bt(n) {
|
|
9698
|
+
if (!ke && n && (ke = new Jn(n)), !ke)
|
|
9688
9699
|
throw new Error("EmailTrackingService not initialized. Call with config first.");
|
|
9689
9700
|
return ke;
|
|
9690
9701
|
}
|
|
9691
|
-
function
|
|
9702
|
+
function vi() {
|
|
9692
9703
|
ke == null || ke.clearEvents(), ke = null;
|
|
9693
9704
|
}
|
|
9694
|
-
function
|
|
9705
|
+
function bi(n) {
|
|
9695
9706
|
const { config: e, campaignId: t, autoRefreshInterval: i } = n, a = oe(() => {
|
|
9696
9707
|
if (e)
|
|
9697
|
-
return
|
|
9708
|
+
return bt(e);
|
|
9698
9709
|
try {
|
|
9699
|
-
return
|
|
9710
|
+
return bt();
|
|
9700
9711
|
} catch {
|
|
9701
9712
|
return null;
|
|
9702
9713
|
}
|
|
@@ -9735,7 +9746,7 @@ function vi(n) {
|
|
|
9735
9746
|
refreshStats: d
|
|
9736
9747
|
};
|
|
9737
9748
|
}
|
|
9738
|
-
class
|
|
9749
|
+
class Qn {
|
|
9739
9750
|
constructor(e) {
|
|
9740
9751
|
this.templates = /* @__PURE__ */ new Map(), this.campaigns = /* @__PURE__ */ new Map(), this.abortControllers = /* @__PURE__ */ new Map(), this.config = {
|
|
9741
9752
|
sendEmail: e.sendEmail,
|
|
@@ -10206,20 +10217,20 @@ class Jn {
|
|
|
10206
10217
|
}
|
|
10207
10218
|
}
|
|
10208
10219
|
let Me = null;
|
|
10209
|
-
function
|
|
10210
|
-
if (!Me && n && (Me = new
|
|
10220
|
+
function xt(n) {
|
|
10221
|
+
if (!Me && n && (Me = new Qn(n)), !Me)
|
|
10211
10222
|
throw new Error("MailMergeService not initialized. Call with config first.");
|
|
10212
10223
|
return Me;
|
|
10213
10224
|
}
|
|
10214
|
-
function
|
|
10225
|
+
function xi() {
|
|
10215
10226
|
Me = null;
|
|
10216
10227
|
}
|
|
10217
|
-
function
|
|
10228
|
+
function wi(n = {}) {
|
|
10218
10229
|
const { config: e } = n, t = oe(() => {
|
|
10219
10230
|
if (e)
|
|
10220
|
-
return
|
|
10231
|
+
return xt(e);
|
|
10221
10232
|
try {
|
|
10222
|
-
return
|
|
10233
|
+
return xt();
|
|
10223
10234
|
} catch {
|
|
10224
10235
|
return null;
|
|
10225
10236
|
}
|
|
@@ -10287,7 +10298,7 @@ function xi(n = {}) {
|
|
|
10287
10298
|
campaigns: d
|
|
10288
10299
|
};
|
|
10289
10300
|
}
|
|
10290
|
-
class
|
|
10301
|
+
class Zn {
|
|
10291
10302
|
constructor(e) {
|
|
10292
10303
|
this.abortController = null, this.mapping = {
|
|
10293
10304
|
users: /* @__PURE__ */ new Map(),
|
|
@@ -10679,20 +10690,20 @@ class Qn {
|
|
|
10679
10690
|
}
|
|
10680
10691
|
}
|
|
10681
10692
|
let Oe = null;
|
|
10682
|
-
function
|
|
10683
|
-
if (!Oe && n && (Oe = new
|
|
10693
|
+
function wt(n) {
|
|
10694
|
+
if (!Oe && n && (Oe = new Zn(n)), !Oe)
|
|
10684
10695
|
throw new Error("SlackImportService not initialized. Call with config first.");
|
|
10685
10696
|
return Oe;
|
|
10686
10697
|
}
|
|
10687
|
-
function
|
|
10698
|
+
function Si() {
|
|
10688
10699
|
Oe = null;
|
|
10689
10700
|
}
|
|
10690
|
-
function
|
|
10701
|
+
function ki(n = {}) {
|
|
10691
10702
|
const { config: e } = n, t = oe(() => {
|
|
10692
10703
|
if (e)
|
|
10693
|
-
return
|
|
10704
|
+
return wt(e);
|
|
10694
10705
|
try {
|
|
10695
|
-
return
|
|
10706
|
+
return wt();
|
|
10696
10707
|
} catch {
|
|
10697
10708
|
return null;
|
|
10698
10709
|
}
|
|
@@ -10743,7 +10754,7 @@ function Si(n = {}) {
|
|
|
10743
10754
|
result: c
|
|
10744
10755
|
};
|
|
10745
10756
|
}
|
|
10746
|
-
const
|
|
10757
|
+
const ei = {
|
|
10747
10758
|
toggleMute: "*6",
|
|
10748
10759
|
raiseHand: "*9",
|
|
10749
10760
|
leave: "#",
|
|
@@ -10751,7 +10762,7 @@ const Zn = {
|
|
|
10751
10762
|
hostMuteAll: "*1",
|
|
10752
10763
|
hostUnmuteAll: "*2",
|
|
10753
10764
|
hostEndMeeting: "*#"
|
|
10754
|
-
},
|
|
10765
|
+
}, ti = {
|
|
10755
10766
|
welcome: "Welcome to the conference. ",
|
|
10756
10767
|
enterPin: "Please enter your meeting PIN followed by the pound key.",
|
|
10757
10768
|
invalidPin: "Invalid PIN. Please try again.",
|
|
@@ -10760,7 +10771,7 @@ const Zn = {
|
|
|
10760
10771
|
unmuted: "You are now unmuted.",
|
|
10761
10772
|
onHold: "Please hold. The meeting host will be with you shortly.",
|
|
10762
10773
|
goodbye: "Goodbye."
|
|
10763
|
-
},
|
|
10774
|
+
}, St = {
|
|
10764
10775
|
US: "+1",
|
|
10765
10776
|
CA: "+1",
|
|
10766
10777
|
UK: "+44",
|
|
@@ -10775,7 +10786,7 @@ const Zn = {
|
|
|
10775
10786
|
BR: "+55",
|
|
10776
10787
|
MX: "+52"
|
|
10777
10788
|
};
|
|
10778
|
-
class
|
|
10789
|
+
class Et {
|
|
10779
10790
|
constructor(e = {}) {
|
|
10780
10791
|
this.eventHandlers = {}, this.participants = /* @__PURE__ */ new Map(), this.meetingDialIns = /* @__PURE__ */ new Map(), this.connectionStatus = "disconnected", this.config = {
|
|
10781
10792
|
provider: "twilio",
|
|
@@ -10787,7 +10798,7 @@ class Dt {
|
|
|
10787
10798
|
maxParticipants: 100,
|
|
10788
10799
|
recordingMode: "none",
|
|
10789
10800
|
...e
|
|
10790
|
-
}, this.dtmfCommands =
|
|
10801
|
+
}, this.dtmfCommands = ei, this.ivrText = { ...ti, ...e.ivrText };
|
|
10791
10802
|
}
|
|
10792
10803
|
/* ────────────────────────────────────────────────────────────────────────────
|
|
10793
10804
|
Event Handlers
|
|
@@ -10846,11 +10857,11 @@ class Dt {
|
|
|
10846
10857
|
}));
|
|
10847
10858
|
}
|
|
10848
10859
|
generatePhoneNumber(e) {
|
|
10849
|
-
const t =
|
|
10860
|
+
const t = St[e], i = Math.floor(1e9 + Math.random() * 9e9).toString();
|
|
10850
10861
|
return `${t}${i}`;
|
|
10851
10862
|
}
|
|
10852
10863
|
formatPhoneNumber(e) {
|
|
10853
|
-
const t =
|
|
10864
|
+
const t = St[e], i = this.generatePhoneNumber(e).slice(t.length);
|
|
10854
10865
|
return e === "US" || e === "CA" ? `${t} (${i.slice(0, 3)}) ${i.slice(3, 6)}-${i.slice(6)}` : `${t} ${i}`;
|
|
10855
10866
|
}
|
|
10856
10867
|
generateAccessPin(e = 6) {
|
|
@@ -11083,14 +11094,14 @@ a=fmtp:101 0-16
|
|
|
11083
11094
|
}
|
|
11084
11095
|
}
|
|
11085
11096
|
let et = null;
|
|
11086
|
-
function
|
|
11087
|
-
return et || (et = new
|
|
11088
|
-
}
|
|
11089
|
-
function ki(n) {
|
|
11090
|
-
return new Dt(n);
|
|
11097
|
+
function ni(n) {
|
|
11098
|
+
return et || (et = new Et(n)), et;
|
|
11091
11099
|
}
|
|
11092
11100
|
function Ci(n) {
|
|
11093
|
-
|
|
11101
|
+
return new Et(n);
|
|
11102
|
+
}
|
|
11103
|
+
function Ii(n) {
|
|
11104
|
+
const e = oe(() => ni(n), []), [t, i] = N(
|
|
11094
11105
|
"disconnected"
|
|
11095
11106
|
), [a, s] = N([]);
|
|
11096
11107
|
re(() => {
|
|
@@ -11122,56 +11133,56 @@ function Ci(n) {
|
|
|
11122
11133
|
};
|
|
11123
11134
|
}
|
|
11124
11135
|
export {
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11136
|
+
ei as DEFAULT_DTMF_COMMANDS,
|
|
11137
|
+
ti as DEFAULT_IVR_TEXT,
|
|
11138
|
+
Pt as DEFAULT_RETENTION_RULES,
|
|
11139
|
+
Jn as EmailTrackingService,
|
|
11140
|
+
Vn as EncryptionService,
|
|
11141
|
+
Qn as MailMergeService,
|
|
11142
|
+
Ft as MockTransport,
|
|
11143
|
+
zt as NiceCallScreen,
|
|
11144
|
+
Xt as NiceChannelView,
|
|
11134
11145
|
Ye as NiceChatWindow,
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11146
|
+
ui as NiceCollaborativeEditor,
|
|
11147
|
+
di as NiceCommunication,
|
|
11148
|
+
di as NiceCommunicationDefault,
|
|
11149
|
+
qt as NiceMessenger,
|
|
11139
11150
|
we as NicePresenceIndicator,
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11151
|
+
fi as NiceRecordingPanel,
|
|
11152
|
+
pi as NiceStorageSettings,
|
|
11153
|
+
bn as NiceTeamsWorkspace,
|
|
11154
|
+
Tt as NiceVideoConference,
|
|
11155
|
+
Rt as NiceWhiteboard,
|
|
11156
|
+
Et as PstnGatewayService,
|
|
11157
|
+
St as REGION_CODES,
|
|
11158
|
+
Xn as RecordingService,
|
|
11159
|
+
Zn as SlackImportService,
|
|
11160
|
+
Qt as StorageService,
|
|
11161
|
+
_t as WebRTCTransport,
|
|
11162
|
+
si as buildOptimisticMessage,
|
|
11163
|
+
Ci as createPstnGateway,
|
|
11164
|
+
jt as createTransport,
|
|
11165
|
+
vi as disposeEmailTrackingService,
|
|
11166
|
+
gi as disposeEncryptionService,
|
|
11167
|
+
xi as disposeMailMergeService,
|
|
11168
|
+
yi as disposeRecordingService,
|
|
11169
|
+
Si as disposeSlackImportService,
|
|
11170
|
+
ci as disposeStorageService,
|
|
11171
|
+
lt as findConversationPartner,
|
|
11172
|
+
li as getDefaultMode,
|
|
11173
|
+
bt as getEmailTrackingService,
|
|
11174
|
+
hi as getEncryptionService,
|
|
11175
|
+
xt as getMailMergeService,
|
|
11176
|
+
oi as getMentionCount,
|
|
11177
|
+
ni as getPstnGateway,
|
|
11178
|
+
mi as getRecordingService,
|
|
11179
|
+
wt as getSlackImportService,
|
|
11180
|
+
Zt as getStorageService,
|
|
11181
|
+
It as getUnreadCount,
|
|
11182
|
+
Bt as useCommunication,
|
|
11183
|
+
bi as useEmailTracking,
|
|
11184
|
+
wi as useMailMerge,
|
|
11185
|
+
Ii as usePstnGateway,
|
|
11186
|
+
ki as useSlackImport,
|
|
11187
|
+
nn as useWhiteboard
|
|
11177
11188
|
};
|