@arbidocs/blocks 0.5.156 → 0.5.157
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/{ConnectedCallDock-SD4DKTMX.cjs → ConnectedCallDock-TGI43VKB.cjs} +15 -15
- package/dist/{ConnectedCallDock-SD4DKTMX.cjs.map → ConnectedCallDock-TGI43VKB.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-2FLGH3JB.cjs → ConnectedCallRoom-FBTDSG3N.cjs} +14 -14
- package/dist/{ConnectedCallRoom-2FLGH3JB.cjs.map → ConnectedCallRoom-FBTDSG3N.cjs.map} +1 -1
- package/dist/{ConnectedMailInviteCard-VMFTQ5PW.cjs → ConnectedMailInviteCard-LV2VARX3.cjs} +5 -5
- package/dist/{ConnectedMailInviteCard-VMFTQ5PW.cjs.map → ConnectedMailInviteCard-LV2VARX3.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-G3AIBKSN.cjs → ConnectedNativeDocxComparison-7VD4ZIHO.cjs} +21 -21
- package/dist/{ConnectedNativeDocxComparison-G3AIBKSN.cjs.map → ConnectedNativeDocxComparison-7VD4ZIHO.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-J42JPUVR.cjs → ConnectedPresentation-FDYO2TSX.cjs} +18 -18
- package/dist/{ConnectedPresentation-J42JPUVR.cjs.map → ConnectedPresentation-FDYO2TSX.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-LB5B7OXR.cjs → ConnectedProductionSetDialog-4N7R7SFZ.cjs} +4 -4
- package/dist/{ConnectedProductionSetDialog-LB5B7OXR.cjs.map → ConnectedProductionSetDialog-4N7R7SFZ.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-BYS7HFNK.cjs → ConnectedSlidesTab-NM2UEE77.cjs} +16 -16
- package/dist/{ConnectedSlidesTab-BYS7HFNK.cjs.map → ConnectedSlidesTab-NM2UEE77.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-ISNLUTAT.cjs → ConnectedStreamedWordArtifact-ISLZLV4V.cjs} +21 -21
- package/dist/{ConnectedStreamedWordArtifact-ISNLUTAT.cjs.map → ConnectedStreamedWordArtifact-ISLZLV4V.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-7ZH575KX.cjs → DocumentReviewCard-5CVWGOZQ.cjs} +27 -27
- package/dist/{DocumentReviewCard-7ZH575KX.cjs.map → DocumentReviewCard-5CVWGOZQ.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-6RWJSZZV.cjs → FilesViewerDialog-PXUXYTPK.cjs} +51 -51
- package/dist/{FilesViewerDialog-6RWJSZZV.cjs.map → FilesViewerDialog-PXUXYTPK.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-NMERZJZZ.cjs → WorkspaceTableView-HR4KTFSX.cjs} +13 -13
- package/dist/{WorkspaceTableView-NMERZJZZ.cjs.map → WorkspaceTableView-HR4KTFSX.cjs.map} +1 -1
- package/dist/agents/index.cjs +289 -289
- package/dist/{ai-QFY4LYQZ.cjs → ai-HME7CNDE.cjs} +24 -24
- package/dist/ai-HME7CNDE.cjs.map +1 -0
- package/dist/auth/index.cjs +2 -2
- package/dist/calendar/index.cjs +106 -106
- package/dist/calls/index.cjs +61 -61
- package/dist/chat/index.cjs +23 -23
- package/dist/{chunk-B2L3XNZH.cjs → chunk-4ZC6YLVQ.cjs} +4 -4
- package/dist/{chunk-B2L3XNZH.cjs.map → chunk-4ZC6YLVQ.cjs.map} +1 -1
- package/dist/{chunk-EG3DPKXM.cjs → chunk-5NWTA4Y4.cjs} +5 -5
- package/dist/{chunk-EG3DPKXM.cjs.map → chunk-5NWTA4Y4.cjs.map} +1 -1
- package/dist/{chunk-OAIOOVFN.cjs → chunk-7SJXYEZI.cjs} +36 -36
- package/dist/chunk-7SJXYEZI.cjs.map +1 -0
- package/dist/{chunk-TD5V5BZ3.cjs → chunk-7WENPOCP.cjs} +5 -5
- package/dist/{chunk-TD5V5BZ3.cjs.map → chunk-7WENPOCP.cjs.map} +1 -1
- package/dist/{chunk-44M4FI2N.cjs → chunk-AVXJSCRN.cjs} +5 -5
- package/dist/{chunk-44M4FI2N.cjs.map → chunk-AVXJSCRN.cjs.map} +1 -1
- package/dist/{chunk-2XHJVYNY.cjs → chunk-BAZZTZW5.cjs} +6 -6
- package/dist/{chunk-2XHJVYNY.cjs.map → chunk-BAZZTZW5.cjs.map} +1 -1
- package/dist/{chunk-PTT5MZ7O.cjs → chunk-BCCMCR2U.cjs} +40 -40
- package/dist/{chunk-PTT5MZ7O.cjs.map → chunk-BCCMCR2U.cjs.map} +1 -1
- package/dist/{chunk-SLCH5JRI.cjs → chunk-C2VVBU7K.cjs} +3 -3
- package/dist/{chunk-SLCH5JRI.cjs.map → chunk-C2VVBU7K.cjs.map} +1 -1
- package/dist/{chunk-HJHDKS4V.cjs → chunk-C4JRUDAY.cjs} +10 -10
- package/dist/{chunk-HJHDKS4V.cjs.map → chunk-C4JRUDAY.cjs.map} +1 -1
- package/dist/{chunk-PD47L6KS.cjs → chunk-CZCSDIQY.cjs} +4 -4
- package/dist/{chunk-PD47L6KS.cjs.map → chunk-CZCSDIQY.cjs.map} +1 -1
- package/dist/{chunk-AHUEBRLX.cjs → chunk-FQXZZXS2.cjs} +4 -4
- package/dist/{chunk-AHUEBRLX.cjs.map → chunk-FQXZZXS2.cjs.map} +1 -1
- package/dist/{chunk-YHXJWYOF.cjs → chunk-FV6AKSI7.cjs} +4 -4
- package/dist/{chunk-YHXJWYOF.cjs.map → chunk-FV6AKSI7.cjs.map} +1 -1
- package/dist/{chunk-WOVNXJK5.cjs → chunk-GQIH6ALC.cjs} +772 -772
- package/dist/chunk-GQIH6ALC.cjs.map +1 -0
- package/dist/{chunk-Q7G2W5VQ.cjs → chunk-GTWCDGXH.cjs} +4 -4
- package/dist/{chunk-Q7G2W5VQ.cjs.map → chunk-GTWCDGXH.cjs.map} +1 -1
- package/dist/{chunk-UJHQ4DA4.cjs → chunk-HJDMKDAE.cjs} +6 -6
- package/dist/{chunk-UJHQ4DA4.cjs.map → chunk-HJDMKDAE.cjs.map} +1 -1
- package/dist/{chunk-GF6AYAMI.cjs → chunk-I3GFGJSX.cjs} +7 -7
- package/dist/{chunk-GF6AYAMI.cjs.map → chunk-I3GFGJSX.cjs.map} +1 -1
- package/dist/{chunk-V4B2GSC6.cjs → chunk-IDV6I7GX.cjs} +44 -44
- package/dist/{chunk-V4B2GSC6.cjs.map → chunk-IDV6I7GX.cjs.map} +1 -1
- package/dist/{chunk-YO7GDNEW.cjs → chunk-JB26AJ2L.cjs} +42 -42
- package/dist/{chunk-YO7GDNEW.cjs.map → chunk-JB26AJ2L.cjs.map} +1 -1
- package/dist/{chunk-6I5HHWCD.cjs → chunk-JUOGNUQR.cjs} +5 -5
- package/dist/{chunk-6I5HHWCD.cjs.map → chunk-JUOGNUQR.cjs.map} +1 -1
- package/dist/{chunk-M24FBUAP.cjs → chunk-JXKUWLFZ.cjs} +4 -4
- package/dist/{chunk-M24FBUAP.cjs.map → chunk-JXKUWLFZ.cjs.map} +1 -1
- package/dist/{chunk-D4SJT3NG.cjs → chunk-K4SFQPOF.cjs} +3 -3
- package/dist/{chunk-D4SJT3NG.cjs.map → chunk-K4SFQPOF.cjs.map} +1 -1
- package/dist/{chunk-DCD4OHDF.cjs → chunk-KIXB7V7A.cjs} +28 -28
- package/dist/{chunk-DCD4OHDF.cjs.map → chunk-KIXB7V7A.cjs.map} +1 -1
- package/dist/{chunk-6P4U63HO.cjs → chunk-KJ65QZJI.cjs} +12 -12
- package/dist/{chunk-6P4U63HO.cjs.map → chunk-KJ65QZJI.cjs.map} +1 -1
- package/dist/{chunk-4M3OIBIS.cjs → chunk-KL7R2IBY.cjs} +2 -2
- package/dist/{chunk-4M3OIBIS.cjs.map → chunk-KL7R2IBY.cjs.map} +1 -1
- package/dist/{chunk-7UPEFZCV.cjs → chunk-KZFE65SA.cjs} +12 -12
- package/dist/{chunk-7UPEFZCV.cjs.map → chunk-KZFE65SA.cjs.map} +1 -1
- package/dist/{chunk-CULUTYOD.cjs → chunk-L2Q2UHRY.cjs} +4 -4
- package/dist/{chunk-CULUTYOD.cjs.map → chunk-L2Q2UHRY.cjs.map} +1 -1
- package/dist/{chunk-73KNWWBW.cjs → chunk-LBYJUPMV.cjs} +27 -27
- package/dist/{chunk-73KNWWBW.cjs.map → chunk-LBYJUPMV.cjs.map} +1 -1
- package/dist/{chunk-U6JUIJTP.cjs → chunk-LFO3HNBX.cjs} +20 -20
- package/dist/{chunk-U6JUIJTP.cjs.map → chunk-LFO3HNBX.cjs.map} +1 -1
- package/dist/{chunk-GK3U3FWY.cjs → chunk-LZZSCW7D.cjs} +5 -5
- package/dist/{chunk-GK3U3FWY.cjs.map → chunk-LZZSCW7D.cjs.map} +1 -1
- package/dist/{chunk-CYWOL2LS.cjs → chunk-MSFWSDRS.cjs} +3 -3
- package/dist/{chunk-CYWOL2LS.cjs.map → chunk-MSFWSDRS.cjs.map} +1 -1
- package/dist/{chunk-3RAW2ZH5.cjs → chunk-N362DFM4.cjs} +3 -3
- package/dist/{chunk-3RAW2ZH5.cjs.map → chunk-N362DFM4.cjs.map} +1 -1
- package/dist/{chunk-2P7VH2SK.cjs → chunk-NGATAD62.cjs} +3 -3
- package/dist/{chunk-2P7VH2SK.cjs.map → chunk-NGATAD62.cjs.map} +1 -1
- package/dist/{chunk-NGM4HIPP.cjs → chunk-PA5CCOBU.cjs} +140 -140
- package/dist/chunk-PA5CCOBU.cjs.map +1 -0
- package/dist/{chunk-SGYURQ23.cjs → chunk-PDDC5JOE.cjs} +10 -10
- package/dist/{chunk-SGYURQ23.cjs.map → chunk-PDDC5JOE.cjs.map} +1 -1
- package/dist/{chunk-3GQQUR27.cjs → chunk-PFGRONAI.cjs} +4 -4
- package/dist/{chunk-3GQQUR27.cjs.map → chunk-PFGRONAI.cjs.map} +1 -1
- package/dist/{chunk-FNBUFKHE.cjs → chunk-Q6ASMKFN.cjs} +10 -10
- package/dist/{chunk-FNBUFKHE.cjs.map → chunk-Q6ASMKFN.cjs.map} +1 -1
- package/dist/{chunk-HLUZMXEZ.cjs → chunk-QA2MTHMN.cjs} +82 -82
- package/dist/{chunk-HLUZMXEZ.cjs.map → chunk-QA2MTHMN.cjs.map} +1 -1
- package/dist/{chunk-V27WLYTG.cjs → chunk-RI367OOL.cjs} +3 -3
- package/dist/{chunk-V27WLYTG.cjs.map → chunk-RI367OOL.cjs.map} +1 -1
- package/dist/{chunk-SH7W4WVI.cjs → chunk-RLRDQICM.cjs} +104 -103
- package/dist/chunk-RLRDQICM.cjs.map +1 -0
- package/dist/{chunk-K7GBHLLY.cjs → chunk-ST5EZE2O.cjs} +12 -12
- package/dist/{chunk-K7GBHLLY.cjs.map → chunk-ST5EZE2O.cjs.map} +1 -1
- package/dist/{chunk-4I4IYVC6.cjs → chunk-UYBTXYYW.cjs} +5 -5
- package/dist/{chunk-4I4IYVC6.cjs.map → chunk-UYBTXYYW.cjs.map} +1 -1
- package/dist/{chunk-G3MRW4WB.cjs → chunk-UYTFPMEA.cjs} +8 -8
- package/dist/{chunk-G3MRW4WB.cjs.map → chunk-UYTFPMEA.cjs.map} +1 -1
- package/dist/{chunk-UD3LPATQ.cjs → chunk-WKIESVWJ.cjs} +6 -6
- package/dist/{chunk-UD3LPATQ.cjs.map → chunk-WKIESVWJ.cjs.map} +1 -1
- package/dist/{chunk-HGD4B7GO.cjs → chunk-YPNGDJLX.cjs} +4 -4
- package/dist/{chunk-HGD4B7GO.cjs.map → chunk-YPNGDJLX.cjs.map} +1 -1
- package/dist/{chunk-BNHFDXJI.cjs → chunk-ZJ4P5QE5.cjs} +37 -37
- package/dist/{chunk-BNHFDXJI.cjs.map → chunk-ZJ4P5QE5.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +13 -13
- package/dist/connect/docx.cjs +24 -24
- package/dist/connect/index.cjs +1399 -1399
- package/dist/connect/viewer.cjs +39 -39
- package/dist/dashboards/index.cjs +17 -17
- package/dist/document-tools/index.cjs +21 -21
- package/dist/embed/index.cjs +44 -44
- package/dist/facts/index.cjs +65 -65
- package/dist/files/index.cjs +230 -230
- package/dist/home/index.cjs +24 -24
- package/dist/index.cjs +1934 -1934
- package/dist/pages/index.cjs +46 -46
- package/dist/settings/index.cjs +140 -140
- package/dist/shell/index.cjs +10 -10
- package/dist/site/index.cjs +5 -5
- package/dist/studio/index.cjs +27 -27
- package/dist/workflow-canvas/index.cjs +56 -56
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/trigger.d.ts +5 -1
- package/dist/workflow-canvas/trigger.js +1 -1
- package/dist/workflow-canvas/trigger.js.map +2 -2
- package/dist/workspaces/index.cjs +9 -9
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ai-QFY4LYQZ.cjs.map +0 -1
- package/dist/chunk-NGM4HIPP.cjs.map +0 -1
- package/dist/chunk-OAIOOVFN.cjs.map +0 -1
- package/dist/chunk-SH7W4WVI.cjs.map +0 -1
- package/dist/chunk-WOVNXJK5.cjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var chunk3GQQUR27_cjs = require('./chunk-3GQQUR27.cjs');
|
|
6
|
-
var chunkNGM4HIPP_cjs = require('./chunk-NGM4HIPP.cjs');
|
|
7
|
-
var chunkSH7W4WVI_cjs = require('./chunk-SH7W4WVI.cjs');
|
|
4
|
+
var chunk7SJXYEZI_cjs = require('./chunk-7SJXYEZI.cjs');
|
|
8
5
|
var chunkT26UYA6Q_cjs = require('./chunk-T26UYA6Q.cjs');
|
|
6
|
+
var chunkPFGRONAI_cjs = require('./chunk-PFGRONAI.cjs');
|
|
7
|
+
var chunkPA5CCOBU_cjs = require('./chunk-PA5CCOBU.cjs');
|
|
8
|
+
var chunkRLRDQICM_cjs = require('./chunk-RLRDQICM.cjs');
|
|
9
9
|
var chunkDWN5AUMH_cjs = require('./chunk-DWN5AUMH.cjs');
|
|
10
10
|
var chunkGB5MN5FC_cjs = require('./chunk-GB5MN5FC.cjs');
|
|
11
|
-
var chunkMOIZ2R5X_cjs = require('./chunk-MOIZ2R5X.cjs');
|
|
12
11
|
var chunkZW6FPIFC_cjs = require('./chunk-ZW6FPIFC.cjs');
|
|
13
12
|
var chunkZT5MIFLC_cjs = require('./chunk-ZT5MIFLC.cjs');
|
|
14
13
|
var chunkZBP4ZSAJ_cjs = require('./chunk-ZBP4ZSAJ.cjs');
|
|
15
14
|
var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
|
|
15
|
+
var chunkMOIZ2R5X_cjs = require('./chunk-MOIZ2R5X.cjs');
|
|
16
16
|
var react = require('@arbidocs/react');
|
|
17
17
|
var react$1 = require('react');
|
|
18
18
|
var lucideReact = require('lucide-react');
|
|
@@ -20,233 +20,589 @@ var ui = require('@arbidocs/react/ui');
|
|
|
20
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
21
21
|
var browser = require('@arbidocs/sdk/browser');
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
onStart,
|
|
30
|
-
isLive = false,
|
|
31
|
-
label = "Start call",
|
|
32
|
-
testId = "start-call-button"
|
|
33
|
-
}) {
|
|
34
|
-
const [isStarting, setIsStarting] = react$1.useState(false);
|
|
35
|
-
const inCall = react.useCallSession((s) => s.active !== null);
|
|
36
|
-
const text = inCall ? "Already in a call" : isLive ? "Join call" : label;
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
38
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
-
ui.Button,
|
|
40
|
-
{
|
|
41
|
-
type: "button",
|
|
42
|
-
variant: "ghost",
|
|
43
|
-
size: "icon",
|
|
44
|
-
"aria-label": isLive ? "Join call" : label,
|
|
45
|
-
"data-testid": testId,
|
|
46
|
-
"data-live": isLive || void 0,
|
|
47
|
-
disabled: isStarting || inCall,
|
|
48
|
-
onClick: () => {
|
|
49
|
-
setIsStarting(true);
|
|
50
|
-
void onStart().finally(() => setIsStarting(false));
|
|
51
|
-
},
|
|
52
|
-
className: ui.cn(
|
|
53
|
-
"text-muted-foreground hover:text-foreground",
|
|
54
|
-
isLive && "text-green-text hover:text-green-text"
|
|
55
|
-
),
|
|
56
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: ui.cn("size-5", isLive && "animate-pulse") })
|
|
57
|
-
}
|
|
58
|
-
) }),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
60
|
-
] });
|
|
61
|
-
}
|
|
62
|
-
var INVITE_LINK_HINT = "will get an invitation to create an ARBI account and join";
|
|
63
|
-
var NO_KEY_REASON = "Cannot receive encrypted calls yet";
|
|
64
|
-
var NO_EMAIL_REASON = "No e-mail address to send a link to";
|
|
65
|
-
function contactName(contact) {
|
|
66
|
-
return contact.card?.name?.trim() || [contact.card?.given_name, contact.card?.family_name].filter(Boolean).join(" ") || (contact.user ? ui.getUserDisplayName(contact.user) : "") || contactEmail(contact) || "Contact";
|
|
67
|
-
}
|
|
68
|
-
function contactEmail(contact) {
|
|
69
|
-
return contact.email ?? contact.user?.email ?? contact.card?.emails?.[0]?.email ?? null;
|
|
70
|
-
}
|
|
71
|
-
function callContactOf(contact) {
|
|
72
|
-
if (!contact.external_id || contact.status === "failed") return null;
|
|
73
|
-
if (contact.user && ui.isAgent(contact.user)) return null;
|
|
74
|
-
return {
|
|
75
|
-
contactExtId: contact.external_id,
|
|
76
|
-
user: contact.user ?? null,
|
|
77
|
-
name: contactName(contact),
|
|
78
|
-
email: contactEmail(contact)
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function userCandidate(user, section, status, contactExtId = null) {
|
|
82
|
-
const ringable = status !== "ring" || !!user.encryption_public_key;
|
|
83
|
-
return {
|
|
84
|
-
id: user.external_id,
|
|
85
|
-
name: ui.getUserDisplayName(user) || user.email,
|
|
86
|
-
email: user.email ?? null,
|
|
87
|
-
section,
|
|
88
|
-
status: ringable ? status : "unavailable",
|
|
89
|
-
reason: ringable ? void 0 : NO_KEY_REASON,
|
|
90
|
-
user,
|
|
91
|
-
contactExtId
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function buildCallCandidates(opts) {
|
|
95
|
-
const seen = /* @__PURE__ */ new Set();
|
|
96
|
-
const out = [];
|
|
97
|
-
const add = (c) => {
|
|
98
|
-
if (seen.has(c.id)) return;
|
|
99
|
-
seen.add(c.id);
|
|
100
|
-
out.push(c);
|
|
101
|
-
};
|
|
102
|
-
const people = (users) => users.filter((u) => !ui.isAgent(u) && u.external_id !== opts.me);
|
|
103
|
-
if (opts.scope !== "contacts") {
|
|
104
|
-
for (const u of people(opts.members)) add(userCandidate(u, "members", "ring"));
|
|
105
|
-
return out;
|
|
106
|
-
}
|
|
107
|
-
const contacts = (opts.contacts ?? []).filter((c) => !(c.user && ui.isAgent(c.user)));
|
|
108
|
-
const contactOf = new Map(
|
|
109
|
-
contacts.filter((c) => c.user).map((c) => [c.user.external_id, c.contactExtId])
|
|
110
|
-
);
|
|
111
|
-
for (const u of people(opts.members)) {
|
|
112
|
-
const contactId = contactOf.get(u.external_id) ?? opts.contactIdOf?.(u) ?? null;
|
|
113
|
-
add(userCandidate(u, "members", contactId ? "ring" : "add-contact", contactId));
|
|
114
|
-
}
|
|
115
|
-
for (const c of contacts) {
|
|
116
|
-
if (c.user) {
|
|
117
|
-
if (c.user.external_id === opts.me) continue;
|
|
118
|
-
add(userCandidate(c.user, "contacts", "ring", c.contactExtId));
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
const status = c.email ? "invite" : "unavailable";
|
|
122
|
-
add({
|
|
123
|
-
id: c.contactExtId,
|
|
124
|
-
name: c.name,
|
|
125
|
-
email: c.email,
|
|
126
|
-
section: "contacts",
|
|
127
|
-
status,
|
|
128
|
-
reason: c.email ? INVITE_LINK_HINT : NO_EMAIL_REASON,
|
|
129
|
-
user: null,
|
|
130
|
-
contactExtId: c.contactExtId
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return out;
|
|
134
|
-
}
|
|
135
|
-
function isPickable(c) {
|
|
136
|
-
return c.status === "ring" || c.status === "invite";
|
|
137
|
-
}
|
|
138
|
-
function matchesQuery(c, query) {
|
|
139
|
-
const q = query.trim().toLowerCase();
|
|
140
|
-
if (!q) return true;
|
|
141
|
-
return c.name.toLowerCase().includes(q) || (c.email ?? "").toLowerCase().includes(q);
|
|
142
|
-
}
|
|
143
|
-
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
144
|
-
var COPY = {
|
|
145
|
-
workspace: {
|
|
146
|
-
title: "Call thread members",
|
|
147
|
-
description: "Only members of this thread\u2019s workspace can join. Pick who to ring \u2014 or nobody, and share the call from the thread.",
|
|
148
|
-
action: "Start call"
|
|
149
|
-
},
|
|
150
|
-
chat: {
|
|
151
|
-
title: "Call the group",
|
|
152
|
-
description: "The people you pick are rung.",
|
|
153
|
-
action: "Start call"
|
|
154
|
-
},
|
|
155
|
-
contacts: {
|
|
156
|
-
title: "New call",
|
|
157
|
-
description: "Your contacts with an ARBI account are rung. Others get an invitation to create an account and join.",
|
|
158
|
-
action: "Start call"
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
function CandidateRow({
|
|
162
|
-
candidate,
|
|
163
|
-
checked,
|
|
164
|
-
onToggle,
|
|
165
|
-
onAddContact,
|
|
166
|
-
adding
|
|
23
|
+
function ChatCallCard({
|
|
24
|
+
callExtId,
|
|
25
|
+
senderName,
|
|
26
|
+
latest,
|
|
27
|
+
name,
|
|
28
|
+
time
|
|
167
29
|
}) {
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
|
|
30
|
+
const arbi = react.useArbi();
|
|
31
|
+
const { data: call } = react.useCall(latest ? callExtId : null);
|
|
32
|
+
const liveNow = react.useCallSession((s) => callExtId in s.liveCalls);
|
|
33
|
+
const inThisCall = react.useCallSession((s) => s.active?.callExtId === callExtId);
|
|
34
|
+
const inAnotherCall = react.useCallSession((s) => !!s.active && s.active.callExtId !== callExtId);
|
|
35
|
+
const [busy, setBusy] = react$1.useState(false);
|
|
36
|
+
const live = latest && chunkRLRDQICM_cjs.isCallLive(call, liveNow);
|
|
37
|
+
let summary;
|
|
38
|
+
if (live) summary = senderName ? `${senderName} started a call` : "Call in progress";
|
|
39
|
+
else if (latest && call?.started_at && call.ended_at) {
|
|
40
|
+
const seconds = (Date.parse(call.ended_at) - Date.parse(call.started_at)) / 1e3;
|
|
41
|
+
const joined = (call.last_participants ?? []).map(name);
|
|
42
|
+
summary = [
|
|
43
|
+
"Call",
|
|
44
|
+
chunkRLRDQICM_cjs.formatCallDuration(seconds),
|
|
45
|
+
joined.length ? `joined ${joined.join(", ")}` : null
|
|
46
|
+
].filter(Boolean).join(" \xB7 ");
|
|
47
|
+
} else summary = senderName ? `Call started by ${senderName}` : "Call";
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
49
|
+
"div",
|
|
172
50
|
{
|
|
173
|
-
className:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
),
|
|
177
|
-
"data-testid": `call-picker-row-${candidate.id}`,
|
|
178
|
-
"data-status": candidate.status,
|
|
179
|
-
"aria-disabled": !pickable || void 0,
|
|
51
|
+
className: "mx-auto my-2 flex w-fit max-w-full flex-wrap items-center justify-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-xs",
|
|
52
|
+
"data-testid": "chat-call-card",
|
|
53
|
+
"data-live": live || void 0,
|
|
180
54
|
children: [
|
|
181
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
disabled: !pickable,
|
|
186
|
-
onCheckedChange: onToggle,
|
|
187
|
-
"aria-label": `Invite ${candidate.name}`,
|
|
188
|
-
"data-testid": `call-picker-check-${candidate.id}`
|
|
189
|
-
}
|
|
190
|
-
),
|
|
191
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
192
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm", children: candidate.name }),
|
|
193
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block truncate text-xs text-muted-foreground", children: [
|
|
194
|
-
candidate.email,
|
|
195
|
-
hint && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-1 inline-flex items-center gap-1", children: [
|
|
196
|
-
candidate.status === "invite" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3", "aria-hidden": true }),
|
|
197
|
-
candidate.email ? `\xB7 ${hint}` : hint
|
|
198
|
-
] })
|
|
199
|
-
] })
|
|
200
|
-
] }),
|
|
201
|
-
candidate.status === "add-contact" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
55
|
+
live ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: "size-4 animate-pulse text-green-text", "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PhoneOff, { className: "size-4 text-muted-foreground", "aria-hidden": true }),
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "chat-call-card-summary", children: summary }),
|
|
57
|
+
time && /* @__PURE__ */ jsxRuntime.jsx("time", { className: "text-muted-foreground", children: time }),
|
|
58
|
+
live && /* @__PURE__ */ jsxRuntime.jsx(
|
|
202
59
|
ui.Button,
|
|
203
60
|
{
|
|
204
61
|
type: "button",
|
|
205
62
|
size: "sm",
|
|
206
|
-
|
|
207
|
-
disabled:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
63
|
+
className: "h-7 bg-green-600 text-white hover:bg-green-700",
|
|
64
|
+
disabled: busy || inThisCall || inAnotherCall,
|
|
65
|
+
title: inAnotherCall ? "You are already in a call" : void 0,
|
|
66
|
+
onClick: () => {
|
|
67
|
+
setBusy(true);
|
|
68
|
+
void react.openCall(arbi, { callExtId }).finally(() => setBusy(false));
|
|
69
|
+
},
|
|
70
|
+
"data-testid": "chat-call-card-join",
|
|
71
|
+
children: inThisCall ? "In call" : "Join"
|
|
214
72
|
}
|
|
215
73
|
)
|
|
216
74
|
]
|
|
217
75
|
}
|
|
218
76
|
);
|
|
219
|
-
if (candidate.status !== "unavailable" || !candidate.reason) return row;
|
|
220
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
221
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: row }),
|
|
222
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: candidate.reason }) })
|
|
223
|
-
] });
|
|
224
77
|
}
|
|
225
|
-
function
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
78
|
+
function useCallPersonName(identity, fallbackName) {
|
|
79
|
+
const arbi = react.useArbi();
|
|
80
|
+
const { byId } = react.usePeople();
|
|
81
|
+
const me = arbi.isLoggedIn && arbi.user.identity()?.externalId === identity;
|
|
82
|
+
const profile = me ? arbi.user.profile() : null;
|
|
83
|
+
return react$1.useMemo(() => {
|
|
84
|
+
if (profile)
|
|
85
|
+
return ui.getUserDisplayName({ given_name: profile.givenName, family_name: profile.familyName });
|
|
86
|
+
const user = byId(identity);
|
|
87
|
+
if (user) return ui.getUserDisplayName(user);
|
|
88
|
+
return (fallbackName || identity).trim().split(/\s+/).join(" ");
|
|
89
|
+
}, [profile, byId, identity, fallbackName]);
|
|
90
|
+
}
|
|
91
|
+
function CallConversationEmpty({ callExtId }) {
|
|
92
|
+
const { inCall, transcribing } = chunk7SJXYEZI_cjs.useMyCallStatus(callExtId);
|
|
93
|
+
const live = react.useCallSession((s) => !!s.liveCalls[callExtId]) || inCall;
|
|
94
|
+
if (!live) {
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
chunkZW6FPIFC_cjs.EmptyState,
|
|
97
|
+
{
|
|
98
|
+
icon: lucideReact.AudioLines,
|
|
99
|
+
title: "No transcript",
|
|
100
|
+
description: "This call was not transcribed. When a call here is transcribed, what people say appears in this conversation.",
|
|
101
|
+
className: "mx-auto my-8 max-w-xl",
|
|
102
|
+
testId: "call-conversation-empty"
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
chunkZW6FPIFC_cjs.EmptyState,
|
|
108
|
+
{
|
|
109
|
+
icon: transcribing ? lucideReact.Captions : lucideReact.CaptionsOff,
|
|
110
|
+
title: "Call in progress \u2014 the transcript will appear here",
|
|
111
|
+
description: transcribing ? "Transcription is on: what people say shows up here as they speak." : "Transcription is off. The host can turn it on with CC in the call.",
|
|
112
|
+
className: "mx-auto my-8 max-w-xl",
|
|
113
|
+
testId: "call-conversation-empty"
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function ProvisionalRow({ identity }) {
|
|
118
|
+
const name = useCallPersonName(identity);
|
|
119
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
120
|
+
chunkZBP4ZSAJ_cjs.ProvisionalTranscriptLine,
|
|
121
|
+
{
|
|
122
|
+
speakerId: identity,
|
|
123
|
+
speakerName: name,
|
|
124
|
+
speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity })
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function ProvisionalSpeakers({ ids }) {
|
|
129
|
+
if (!ids.length) return null;
|
|
130
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2", "data-testid": "transcript-provisional-rows", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsx(ProvisionalRow, { identity: id }, id)) });
|
|
131
|
+
}
|
|
132
|
+
var LINE_WAIT_MS = 1e4;
|
|
133
|
+
var MIN_SPEECH_MS = 800;
|
|
134
|
+
function useProvisionalSpeakers(callExtId, lines) {
|
|
135
|
+
const { inCall, transcribing } = chunk7SJXYEZI_cjs.useMyCallStatus(callExtId);
|
|
136
|
+
const speaking = chunk7SJXYEZI_cjs.useSpeakingIds();
|
|
137
|
+
const pending = react$1.useRef(/* @__PURE__ */ new Map());
|
|
138
|
+
const [, tick] = react$1.useState(0);
|
|
139
|
+
const active = inCall && transcribing;
|
|
140
|
+
const now = Date.now();
|
|
141
|
+
if (active) {
|
|
142
|
+
for (const id of speaking) {
|
|
143
|
+
const p = pending.current.get(id);
|
|
144
|
+
if (p) p.lastHeardAt = now;
|
|
145
|
+
else pending.current.set(id, { startedAt: now, lastHeardAt: now });
|
|
146
|
+
}
|
|
147
|
+
} else if (pending.current.size) {
|
|
148
|
+
pending.current.clear();
|
|
149
|
+
}
|
|
150
|
+
const latest = react$1.useMemo(() => {
|
|
151
|
+
const m = /* @__PURE__ */ new Map();
|
|
152
|
+
for (const l of lines) m.set(l.speakerId, Math.max(m.get(l.speakerId) ?? 0, l.at));
|
|
153
|
+
return m;
|
|
154
|
+
}, [lines]);
|
|
155
|
+
for (const [id, p] of [...pending.current]) {
|
|
156
|
+
const arrived = (latest.get(id) ?? 0) >= p.startedAt - 3e3;
|
|
157
|
+
const stale = !speaking.includes(id) && now - p.lastHeardAt > LINE_WAIT_MS;
|
|
158
|
+
if (arrived && !speaking.includes(id) || stale) pending.current.delete(id);
|
|
159
|
+
else if (arrived) p.startedAt = now;
|
|
160
|
+
}
|
|
161
|
+
const waiting = pending.current.size > 0;
|
|
162
|
+
react$1.useEffect(() => {
|
|
163
|
+
if (!waiting) return;
|
|
164
|
+
const id = setInterval(() => tick((n) => n + 1), 1e3);
|
|
165
|
+
return () => clearInterval(id);
|
|
166
|
+
}, [waiting]);
|
|
167
|
+
return [...pending.current].filter(([, p]) => p.lastHeardAt - p.startedAt >= MIN_SPEECH_MS).map(([id]) => id);
|
|
168
|
+
}
|
|
169
|
+
var { isTranscriptMessage, parseTranscriptContent } = browser.chats;
|
|
170
|
+
function ConnectedCallChatHistory({
|
|
171
|
+
chat,
|
|
172
|
+
messages,
|
|
173
|
+
items,
|
|
174
|
+
renderItem,
|
|
175
|
+
renderEntriesBefore,
|
|
176
|
+
entriesAfter,
|
|
177
|
+
loadOlder,
|
|
178
|
+
memberById,
|
|
179
|
+
senderName,
|
|
180
|
+
myExtId,
|
|
181
|
+
formatTime,
|
|
182
|
+
formatDay
|
|
183
|
+
}) {
|
|
184
|
+
const arbi = react.useArbi();
|
|
185
|
+
const [view, setView] = react$1.useState("all");
|
|
186
|
+
react$1.useEffect(() => setView("all"), [chat?.external_id]);
|
|
187
|
+
const recordingsCallExtId = chat?.call_ext_id ?? null;
|
|
188
|
+
const pendingRecording = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
189
|
+
react$1.useEffect(() => {
|
|
190
|
+
if (pendingRecording && recordingsCallExtId) setView("recordings");
|
|
191
|
+
}, [pendingRecording, recordingsCallExtId]);
|
|
192
|
+
const latestCallCards = react$1.useMemo(() => {
|
|
193
|
+
const latest = /* @__PURE__ */ new Map();
|
|
194
|
+
for (const m of messages)
|
|
195
|
+
if (m.kind === "call" && m.call_ext_id && !m.deleted) latest.set(m.call_ext_id, m.external_id);
|
|
196
|
+
return new Set(latest.values());
|
|
197
|
+
}, [messages]);
|
|
198
|
+
const hasRecTranscript = react$1.useMemo(
|
|
199
|
+
() => react.hasRecordingTranscript(messages, react.chatTranscriptRef),
|
|
200
|
+
[messages]
|
|
201
|
+
);
|
|
202
|
+
const recordingWindows = react.useRecordingWindows(recordingsCallExtId, hasRecTranscript);
|
|
203
|
+
const supersededTranscript = react$1.useMemo(
|
|
204
|
+
() => react.supersededTranscriptLines(messages, react.chatTranscriptRef, recordingWindows),
|
|
205
|
+
[messages, recordingWindows]
|
|
206
|
+
);
|
|
207
|
+
const transcriptMessages = react$1.useMemo(
|
|
208
|
+
() => react.sortTranscriptMessages(
|
|
209
|
+
messages.filter((m) => isTranscriptMessage(m) && !m.deleted && !supersededTranscript.has(m))
|
|
210
|
+
),
|
|
211
|
+
[messages, supersededTranscript]
|
|
212
|
+
);
|
|
213
|
+
const hasTranscript = transcriptMessages.length > 0;
|
|
214
|
+
const { data: meetingCall } = react.useCall(hasTranscript ? chat?.call_ext_id : null);
|
|
215
|
+
const isHost = !!meetingCall?.is_creator;
|
|
216
|
+
const [meetingTitle, setMeetingTitle] = react$1.useState(null);
|
|
217
|
+
react$1.useEffect(() => {
|
|
218
|
+
if (!chat || !isHost && !recordingsCallExtId) return;
|
|
219
|
+
let cancelled = false;
|
|
220
|
+
arbi.chats.title(chat).then((t) => !cancelled && setMeetingTitle(t)).catch(() => void 0);
|
|
221
|
+
return () => {
|
|
222
|
+
cancelled = true;
|
|
223
|
+
};
|
|
224
|
+
}, [arbi, isHost, chat, recordingsCallExtId]);
|
|
225
|
+
const transcriptSpeaker = (msg) => {
|
|
226
|
+
const parsed = msg.decryptFailed ? null : parseTranscriptContent(msg.content);
|
|
227
|
+
return { parsed, speakerId: parsed?.speaker_identity || msg.sender_ext_id || "" };
|
|
228
|
+
};
|
|
229
|
+
const transcriptExport = react$1.useMemo(
|
|
230
|
+
() => transcriptMessages.filter((m) => !m.decryptFailed).map((m) => {
|
|
231
|
+
const parsed = parseTranscriptContent(m.content);
|
|
232
|
+
const speakerId = parsed?.speaker_identity || m.sender_ext_id || "";
|
|
233
|
+
return {
|
|
234
|
+
speaker: parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : "") || "Former member",
|
|
235
|
+
at: parsed?.started_at ?? m.created_at,
|
|
236
|
+
text: parsed?.text ?? m.content ?? ""
|
|
237
|
+
};
|
|
238
|
+
}),
|
|
239
|
+
[transcriptMessages, memberById, senderName]
|
|
240
|
+
);
|
|
241
|
+
const transcriptLayout = react$1.useMemo(() => {
|
|
242
|
+
const shown = view === "transcript" ? transcriptMessages : messages;
|
|
243
|
+
const continued = chunkZBP4ZSAJ_cjs.transcriptRuns(
|
|
244
|
+
shown,
|
|
245
|
+
(m) => isTranscriptMessage(m) && !supersededTranscript.has(m) ? transcriptSpeaker(m).speakerId : null,
|
|
246
|
+
(m) => Date.parse(transcriptSpeaker(m).parsed?.started_at ?? m.created_at ?? "") || 0
|
|
247
|
+
);
|
|
248
|
+
return { continued };
|
|
249
|
+
}, [view, messages, transcriptMessages, supersededTranscript]);
|
|
250
|
+
const transcriptEntry = (msg) => {
|
|
251
|
+
const { parsed, speakerId } = transcriptSpeaker(msg);
|
|
252
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
253
|
+
chunkPFGRONAI_cjs.TranscriptEntry,
|
|
254
|
+
{
|
|
255
|
+
speakerId,
|
|
256
|
+
speakerName: speakerId === myExtId ? "Me" : parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : senderName(msg.sender_ext_id)),
|
|
257
|
+
text: parsed?.text ?? msg.content ?? "",
|
|
258
|
+
at: parsed?.started_at ?? msg.created_at,
|
|
259
|
+
continued: transcriptLayout.continued.has(msg)
|
|
260
|
+
},
|
|
261
|
+
msg.external_id
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
const chatLines = react$1.useMemo(
|
|
265
|
+
() => transcriptMessages.map((m) => {
|
|
266
|
+
const { parsed, speakerId } = transcriptSpeaker(m);
|
|
267
|
+
return { speakerId, at: Date.parse(parsed?.started_at ?? m.created_at ?? "") || 0 };
|
|
268
|
+
}),
|
|
269
|
+
[transcriptMessages]
|
|
270
|
+
);
|
|
271
|
+
const provisionalSpeakers = useProvisionalSpeakers(recordingsCallExtId, chatLines);
|
|
272
|
+
const chatItem = (item, i) => {
|
|
273
|
+
const { message: msg, isFirstOfDay } = item;
|
|
274
|
+
const deleted = !!msg.deleted;
|
|
275
|
+
if (deleted && isTranscriptMessage(msg)) return null;
|
|
276
|
+
const separator = isFirstOfDay && /* @__PURE__ */ jsxRuntime.jsx(react.DateSeparator, { children: formatDay(msg.created_at) });
|
|
277
|
+
if (isTranscriptMessage(msg)) {
|
|
278
|
+
if (view === "chat") return null;
|
|
279
|
+
const superseded = supersededTranscript.has(msg);
|
|
280
|
+
if (superseded && !isFirstOfDay) return null;
|
|
281
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
282
|
+
separator,
|
|
283
|
+
!superseded && transcriptEntry(msg)
|
|
284
|
+
] }, msg.external_id);
|
|
285
|
+
}
|
|
286
|
+
if (msg.kind === "recording" && msg.call_ext_id && !deleted) {
|
|
287
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
288
|
+
separator,
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
290
|
+
chunkPA5CCOBU_cjs.RecordingCard,
|
|
291
|
+
{
|
|
292
|
+
callExtId: msg.call_ext_id,
|
|
293
|
+
recordingExtId: msg.recording_ext_id ?? null,
|
|
294
|
+
title: meetingTitle,
|
|
295
|
+
time: formatTime(msg.created_at)
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
] }, msg.external_id);
|
|
299
|
+
}
|
|
300
|
+
if (msg.kind === "call" && msg.call_ext_id && !deleted) {
|
|
301
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
302
|
+
separator,
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
304
|
+
ChatCallCard,
|
|
305
|
+
{
|
|
306
|
+
callExtId: msg.call_ext_id,
|
|
307
|
+
senderName: msg.sender_ext_id ? senderName(msg.sender_ext_id) : null,
|
|
308
|
+
latest: latestCallCards.has(msg.external_id),
|
|
309
|
+
name: senderName,
|
|
310
|
+
time: formatTime(msg.created_at)
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
] }, msg.external_id);
|
|
314
|
+
}
|
|
315
|
+
return renderItem(item, i);
|
|
316
|
+
};
|
|
317
|
+
const filterOptions = [
|
|
318
|
+
{ value: "all", label: "All" },
|
|
319
|
+
{ value: "chat", label: "Chat", testId: "chat-filter" },
|
|
320
|
+
{
|
|
321
|
+
value: "transcript",
|
|
322
|
+
label: "Transcript",
|
|
323
|
+
count: transcriptMessages.length,
|
|
324
|
+
testId: "transcript-filter"
|
|
325
|
+
},
|
|
326
|
+
...recordingsCallExtId ? [{ value: "recordings", label: "Recordings", testId: "recordings-filter" }] : []
|
|
327
|
+
];
|
|
328
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
329
|
+
messages.length === 0 && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(CallConversationEmpty, { callExtId: recordingsCallExtId }),
|
|
330
|
+
(hasTranscript || recordingsCallExtId) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 flex justify-center py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
331
|
+
chunkZBP4ZSAJ_cjs.ConversationFilter,
|
|
332
|
+
{
|
|
333
|
+
value: view,
|
|
334
|
+
options: filterOptions,
|
|
335
|
+
onChange: setView
|
|
336
|
+
}
|
|
337
|
+
) }),
|
|
338
|
+
view === "recordings" && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkPA5CCOBU_cjs.RecordingsList, { callExtId: recordingsCallExtId, title: meetingTitle, className: "py-1" }),
|
|
339
|
+
loadOlder,
|
|
340
|
+
view === "transcript" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col py-1", "data-testid": "transcript-view", children: [
|
|
341
|
+
isHost && /* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
+
chunkPA5CCOBU_cjs.SaveTranscriptToThread,
|
|
343
|
+
{
|
|
344
|
+
title: meetingTitle,
|
|
345
|
+
lines: transcriptExport,
|
|
346
|
+
className: "mx-3 mb-2 self-start"
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
transcriptMessages.map((msg) => transcriptEntry(msg)),
|
|
350
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
351
|
+
] }),
|
|
352
|
+
(view === "all" || view === "chat") && items.map((item, i) => (
|
|
353
|
+
// A shared file's card sits among the messages, by time.
|
|
354
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
355
|
+
renderEntriesBefore(i),
|
|
356
|
+
chatItem(item, i)
|
|
357
|
+
] }, item.message.external_id)
|
|
358
|
+
)),
|
|
359
|
+
(view === "all" || view === "chat") && entriesAfter,
|
|
360
|
+
view === "all" && /* @__PURE__ */ jsxRuntime.jsx(ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
361
|
+
] });
|
|
362
|
+
}
|
|
363
|
+
function StartCallButton(props) {
|
|
364
|
+
const enabled = react.useCallsEnabled();
|
|
365
|
+
const canHost = react.useCanHostCalls();
|
|
366
|
+
return enabled && (canHost || props.isLive) ? /* @__PURE__ */ jsxRuntime.jsx(EnabledStartCallButton, { ...props }) : null;
|
|
367
|
+
}
|
|
368
|
+
function EnabledStartCallButton({
|
|
369
|
+
onStart,
|
|
370
|
+
isLive = false,
|
|
371
|
+
label = "Start call",
|
|
372
|
+
testId = "start-call-button"
|
|
373
|
+
}) {
|
|
374
|
+
const [isStarting, setIsStarting] = react$1.useState(false);
|
|
375
|
+
const inCall = react.useCallSession((s) => s.active !== null);
|
|
376
|
+
const text = inCall ? "Already in a call" : isLive ? "Join call" : label;
|
|
377
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
379
|
+
ui.Button,
|
|
380
|
+
{
|
|
381
|
+
type: "button",
|
|
382
|
+
variant: "ghost",
|
|
383
|
+
size: "icon",
|
|
384
|
+
"aria-label": isLive ? "Join call" : label,
|
|
385
|
+
"data-testid": testId,
|
|
386
|
+
"data-live": isLive || void 0,
|
|
387
|
+
disabled: isStarting || inCall,
|
|
388
|
+
onClick: () => {
|
|
389
|
+
setIsStarting(true);
|
|
390
|
+
void onStart().finally(() => setIsStarting(false));
|
|
391
|
+
},
|
|
392
|
+
className: ui.cn(
|
|
393
|
+
"text-muted-foreground hover:text-foreground",
|
|
394
|
+
isLive && "text-green-text hover:text-green-text"
|
|
395
|
+
),
|
|
396
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: ui.cn("size-5", isLive && "animate-pulse") })
|
|
397
|
+
}
|
|
398
|
+
) }),
|
|
399
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
400
|
+
] });
|
|
401
|
+
}
|
|
402
|
+
function DmCallButton({ peer }) {
|
|
403
|
+
const arbi = react.useArbi();
|
|
404
|
+
const name = react.userDisplayName(peer);
|
|
405
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
406
|
+
StartCallButton,
|
|
407
|
+
{
|
|
408
|
+
onStart: () => react.startDmCall(arbi, {
|
|
409
|
+
external_id: peer.external_id,
|
|
410
|
+
encryption_public_key: peer.encryption_public_key ?? null,
|
|
411
|
+
name
|
|
412
|
+
}),
|
|
413
|
+
label: `Call ${name}`,
|
|
414
|
+
testId: "dm-call-button"
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
var INVITE_LINK_HINT = "will get an invitation to create an ARBI account and join";
|
|
419
|
+
var NO_KEY_REASON = "Cannot receive encrypted calls yet";
|
|
420
|
+
var NO_EMAIL_REASON = "No e-mail address to send a link to";
|
|
421
|
+
function contactName(contact) {
|
|
422
|
+
return contact.card?.name?.trim() || [contact.card?.given_name, contact.card?.family_name].filter(Boolean).join(" ") || (contact.user ? ui.getUserDisplayName(contact.user) : "") || contactEmail(contact) || "Contact";
|
|
423
|
+
}
|
|
424
|
+
function contactEmail(contact) {
|
|
425
|
+
return contact.email ?? contact.user?.email ?? contact.card?.emails?.[0]?.email ?? null;
|
|
426
|
+
}
|
|
427
|
+
function callContactOf(contact) {
|
|
428
|
+
if (!contact.external_id || contact.status === "failed") return null;
|
|
429
|
+
if (contact.user && ui.isAgent(contact.user)) return null;
|
|
430
|
+
return {
|
|
431
|
+
contactExtId: contact.external_id,
|
|
432
|
+
user: contact.user ?? null,
|
|
433
|
+
name: contactName(contact),
|
|
434
|
+
email: contactEmail(contact)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function userCandidate(user, section, status, contactExtId = null) {
|
|
438
|
+
const ringable = status !== "ring" || !!user.encryption_public_key;
|
|
439
|
+
return {
|
|
440
|
+
id: user.external_id,
|
|
441
|
+
name: ui.getUserDisplayName(user) || user.email,
|
|
442
|
+
email: user.email ?? null,
|
|
443
|
+
section,
|
|
444
|
+
status: ringable ? status : "unavailable",
|
|
445
|
+
reason: ringable ? void 0 : NO_KEY_REASON,
|
|
446
|
+
user,
|
|
447
|
+
contactExtId
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
function buildCallCandidates(opts) {
|
|
451
|
+
const seen = /* @__PURE__ */ new Set();
|
|
452
|
+
const out = [];
|
|
453
|
+
const add = (c) => {
|
|
454
|
+
if (seen.has(c.id)) return;
|
|
455
|
+
seen.add(c.id);
|
|
456
|
+
out.push(c);
|
|
457
|
+
};
|
|
458
|
+
const people = (users) => users.filter((u) => !ui.isAgent(u) && u.external_id !== opts.me);
|
|
459
|
+
if (opts.scope !== "contacts") {
|
|
460
|
+
for (const u of people(opts.members)) add(userCandidate(u, "members", "ring"));
|
|
461
|
+
return out;
|
|
462
|
+
}
|
|
463
|
+
const contacts = (opts.contacts ?? []).filter((c) => !(c.user && ui.isAgent(c.user)));
|
|
464
|
+
const contactOf = new Map(
|
|
465
|
+
contacts.filter((c) => c.user).map((c) => [c.user.external_id, c.contactExtId])
|
|
466
|
+
);
|
|
467
|
+
for (const u of people(opts.members)) {
|
|
468
|
+
const contactId = contactOf.get(u.external_id) ?? opts.contactIdOf?.(u) ?? null;
|
|
469
|
+
add(userCandidate(u, "members", contactId ? "ring" : "add-contact", contactId));
|
|
470
|
+
}
|
|
471
|
+
for (const c of contacts) {
|
|
472
|
+
if (c.user) {
|
|
473
|
+
if (c.user.external_id === opts.me) continue;
|
|
474
|
+
add(userCandidate(c.user, "contacts", "ring", c.contactExtId));
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
const status = c.email ? "invite" : "unavailable";
|
|
478
|
+
add({
|
|
479
|
+
id: c.contactExtId,
|
|
480
|
+
name: c.name,
|
|
481
|
+
email: c.email,
|
|
482
|
+
section: "contacts",
|
|
483
|
+
status,
|
|
484
|
+
reason: c.email ? INVITE_LINK_HINT : NO_EMAIL_REASON,
|
|
485
|
+
user: null,
|
|
486
|
+
contactExtId: c.contactExtId
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
return out;
|
|
490
|
+
}
|
|
491
|
+
function isPickable(c) {
|
|
492
|
+
return c.status === "ring" || c.status === "invite";
|
|
493
|
+
}
|
|
494
|
+
function matchesQuery(c, query) {
|
|
495
|
+
const q = query.trim().toLowerCase();
|
|
496
|
+
if (!q) return true;
|
|
497
|
+
return c.name.toLowerCase().includes(q) || (c.email ?? "").toLowerCase().includes(q);
|
|
498
|
+
}
|
|
499
|
+
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
500
|
+
var COPY = {
|
|
501
|
+
workspace: {
|
|
502
|
+
title: "Call thread members",
|
|
503
|
+
description: "Only members of this thread\u2019s workspace can join. Pick who to ring \u2014 or nobody, and share the call from the thread.",
|
|
504
|
+
action: "Start call"
|
|
505
|
+
},
|
|
506
|
+
chat: {
|
|
507
|
+
title: "Call the group",
|
|
508
|
+
description: "The people you pick are rung.",
|
|
509
|
+
action: "Start call"
|
|
510
|
+
},
|
|
511
|
+
contacts: {
|
|
512
|
+
title: "New call",
|
|
513
|
+
description: "Your contacts with an ARBI account are rung. Others get an invitation to create an account and join.",
|
|
514
|
+
action: "Start call"
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
function CandidateRow({
|
|
518
|
+
candidate,
|
|
519
|
+
checked,
|
|
520
|
+
onToggle,
|
|
521
|
+
onAddContact,
|
|
522
|
+
adding
|
|
523
|
+
}) {
|
|
524
|
+
const pickable = isPickable(candidate);
|
|
525
|
+
const hint = candidate.status === "invite" ? candidate.reason : candidate.status === "add-contact" ? "Not in your contacts" : void 0;
|
|
526
|
+
const row = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
527
|
+
"li",
|
|
528
|
+
{
|
|
529
|
+
className: ui.cn(
|
|
530
|
+
"flex items-center gap-3 rounded-md px-2 py-1.5",
|
|
531
|
+
pickable ? "hover:bg-muted" : "opacity-60"
|
|
532
|
+
),
|
|
533
|
+
"data-testid": `call-picker-row-${candidate.id}`,
|
|
534
|
+
"data-status": candidate.status,
|
|
535
|
+
"aria-disabled": !pickable || void 0,
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
538
|
+
ui.Checkbox,
|
|
539
|
+
{
|
|
540
|
+
checked,
|
|
541
|
+
disabled: !pickable,
|
|
542
|
+
onCheckedChange: onToggle,
|
|
543
|
+
"aria-label": `Invite ${candidate.name}`,
|
|
544
|
+
"data-testid": `call-picker-check-${candidate.id}`
|
|
545
|
+
}
|
|
546
|
+
),
|
|
547
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
548
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm", children: candidate.name }),
|
|
549
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block truncate text-xs text-muted-foreground", children: [
|
|
550
|
+
candidate.email,
|
|
551
|
+
hint && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-1 inline-flex items-center gap-1", children: [
|
|
552
|
+
candidate.status === "invite" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3", "aria-hidden": true }),
|
|
553
|
+
candidate.email ? `\xB7 ${hint}` : hint
|
|
554
|
+
] })
|
|
555
|
+
] })
|
|
556
|
+
] }),
|
|
557
|
+
candidate.status === "add-contact" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
558
|
+
ui.Button,
|
|
559
|
+
{
|
|
560
|
+
type: "button",
|
|
561
|
+
size: "sm",
|
|
562
|
+
variant: "outline",
|
|
563
|
+
disabled: adding,
|
|
564
|
+
onClick: onAddContact,
|
|
565
|
+
"data-testid": `call-picker-add-${candidate.id}`,
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "mr-1 size-3.5" }),
|
|
568
|
+
"Add contact"
|
|
569
|
+
]
|
|
570
|
+
}
|
|
571
|
+
)
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
if (candidate.status !== "unavailable" || !candidate.reason) return row;
|
|
576
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
577
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: row }),
|
|
578
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: candidate.reason }) })
|
|
579
|
+
] });
|
|
580
|
+
}
|
|
581
|
+
function InviteLinks({ callExtId }) {
|
|
582
|
+
const { notify } = chunk46LX6EQT_cjs.useBlocksEnvironment();
|
|
583
|
+
const revokeLink = react.useRevokeCallInviteLink(callExtId);
|
|
584
|
+
const { data: invites = [] } = react.useCallInviteLinks(callExtId);
|
|
585
|
+
const live = invites.filter((i) => !i.revoked_at);
|
|
586
|
+
if (!live.length) return null;
|
|
587
|
+
const revoke = async (id) => {
|
|
588
|
+
try {
|
|
589
|
+
await revokeLink(id);
|
|
590
|
+
} catch (err) {
|
|
591
|
+
notify(err instanceof Error ? err.message : "Could not revoke the link", "error");
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-1", "data-testid": "call-picker-invite-links", children: [
|
|
595
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xs font-medium text-muted-foreground", children: "Invitations sent" }),
|
|
596
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1", children: live.map((invite) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
|
|
597
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3.5 text-muted-foreground", "aria-hidden": true }),
|
|
598
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: invite.email }),
|
|
599
|
+
invite.used_at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "joined" }),
|
|
600
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
601
|
+
ui.Button,
|
|
602
|
+
{
|
|
603
|
+
type: "button",
|
|
604
|
+
size: "sm",
|
|
605
|
+
variant: "ghost",
|
|
250
606
|
onClick: () => void revoke(invite.external_id),
|
|
251
607
|
"data-testid": `call-picker-revoke-${invite.external_id}`,
|
|
252
608
|
children: [
|
|
@@ -483,48 +839,6 @@ function CallPeoplePicker({
|
|
|
483
839
|
] })
|
|
484
840
|
] }) });
|
|
485
841
|
}
|
|
486
|
-
function ThreadCallButton({
|
|
487
|
-
conversationId
|
|
488
|
-
}) {
|
|
489
|
-
const arbi = react.useArbi();
|
|
490
|
-
const { data: conversations } = chunkDWN5AUMH_cjs.useConnectedConversations();
|
|
491
|
-
const { workspaceId: workspaceExtId } = chunkGB5MN5FC_cjs.useConnectedWorkspace();
|
|
492
|
-
const liveCallId = react.useCallSession((s) => react.threadLiveCallId(s, conversationId));
|
|
493
|
-
const isLive = liveCallId !== null;
|
|
494
|
-
const canHost = react.useCanHostCalls();
|
|
495
|
-
const [picking, setPicking] = react$1.useState(false);
|
|
496
|
-
const conversation = conversations.find((c) => c.external_id === conversationId);
|
|
497
|
-
if (!conversation?.is_shared) return null;
|
|
498
|
-
const title = conversation.title ?? null;
|
|
499
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
500
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
501
|
-
StartCallButton,
|
|
502
|
-
{
|
|
503
|
-
onStart: async () => {
|
|
504
|
-
if (liveCallId && !canHost) return react.openCall(arbi, { callExtId: liveCallId });
|
|
505
|
-
if (isLive) return react.startThreadCall(arbi, { threadExtId: conversationId, title, ring: [] });
|
|
506
|
-
setPicking(true);
|
|
507
|
-
return true;
|
|
508
|
-
},
|
|
509
|
-
isLive,
|
|
510
|
-
label: "Call thread members",
|
|
511
|
-
testId: "thread-call-button"
|
|
512
|
-
}
|
|
513
|
-
),
|
|
514
|
-
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
515
|
-
CallPeoplePicker,
|
|
516
|
-
{
|
|
517
|
-
open: true,
|
|
518
|
-
onOpenChange: setPicking,
|
|
519
|
-
scope: "workspace",
|
|
520
|
-
workspaceExtId,
|
|
521
|
-
onSubmit: async ({ ring }) => {
|
|
522
|
-
await react.startThreadCall(arbi, { threadExtId: conversationId, title, ring });
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
)
|
|
526
|
-
] });
|
|
527
|
-
}
|
|
528
842
|
function GroupCallButton({
|
|
529
843
|
chatExtId,
|
|
530
844
|
title,
|
|
@@ -536,538 +850,224 @@ function GroupCallButton({
|
|
|
536
850
|
const isLive = liveCallId !== null;
|
|
537
851
|
const canHost = react.useCanHostCalls();
|
|
538
852
|
const [picking, setPicking] = react$1.useState(false);
|
|
539
|
-
const others = members.filter((u) => u.external_id !== me && !ui.isAgent(u));
|
|
540
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
541
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
542
|
-
StartCallButton,
|
|
543
|
-
{
|
|
544
|
-
onStart: async () => {
|
|
545
|
-
if (liveCallId && !canHost) return react.openCall(arbi, { callExtId: liveCallId });
|
|
546
|
-
if (isLive) return react.startChatCall(arbi, { chatExtId, title, ring: [] });
|
|
547
|
-
setPicking(true);
|
|
548
|
-
return true;
|
|
549
|
-
},
|
|
550
|
-
isLive,
|
|
551
|
-
label: "Call the group",
|
|
552
|
-
testId: "group-call-button"
|
|
553
|
-
}
|
|
554
|
-
),
|
|
555
|
-
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
556
|
-
CallPeoplePicker,
|
|
557
|
-
{
|
|
558
|
-
open: true,
|
|
559
|
-
onOpenChange: setPicking,
|
|
560
|
-
scope: "chat",
|
|
561
|
-
members: others,
|
|
562
|
-
preselected: others.map((u) => u.external_id),
|
|
563
|
-
onSubmit: async ({ ring }) => {
|
|
564
|
-
await react.startChatCall(arbi, { chatExtId, title, ring });
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
)
|
|
568
|
-
] });
|
|
569
|
-
}
|
|
570
|
-
function DmCallButton({ peer }) {
|
|
571
|
-
const arbi = react.useArbi();
|
|
572
|
-
const name = react.userDisplayName(peer);
|
|
573
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
574
|
-
StartCallButton,
|
|
575
|
-
{
|
|
576
|
-
onStart: () => react.startDmCall(arbi, {
|
|
577
|
-
external_id: peer.external_id,
|
|
578
|
-
encryption_public_key: peer.encryption_public_key ?? null,
|
|
579
|
-
name
|
|
580
|
-
}),
|
|
581
|
-
label: `Call ${name}`,
|
|
582
|
-
testId: "dm-call-button"
|
|
583
|
-
}
|
|
584
|
-
);
|
|
585
|
-
}
|
|
586
|
-
function NewCallChip() {
|
|
587
|
-
return react.useCanHostCalls() ? /* @__PURE__ */ jsxRuntime.jsx(EnabledNewCallChip, {}) : null;
|
|
588
|
-
}
|
|
589
|
-
function EnabledNewCallChip() {
|
|
590
|
-
const arbi = react.useArbi();
|
|
591
|
-
const inCall = react.useCallSession((s) => s.active !== null);
|
|
592
|
-
const [open, setOpen] = react$1.useState(false);
|
|
593
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
594
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
595
|
-
chunkMOIZ2R5X_cjs.DmInviteChip,
|
|
596
|
-
{
|
|
597
|
-
testId: "dm-new-call-chip",
|
|
598
|
-
title: "New call",
|
|
599
|
-
description: inCall ? "You are already in a call" : "Call people from your contacts",
|
|
600
|
-
onClick: () => !inCall && setOpen(true)
|
|
601
|
-
}
|
|
602
|
-
),
|
|
603
|
-
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
604
|
-
CallPeoplePicker,
|
|
605
|
-
{
|
|
606
|
-
open: true,
|
|
607
|
-
onOpenChange: setOpen,
|
|
608
|
-
scope: "contacts",
|
|
609
|
-
onSubmit: async ({ ring, invites }) => {
|
|
610
|
-
await react.startContactsCall(arbi, {
|
|
611
|
-
title: chunkSH7W4WVI_cjs.contactsCallTitle([
|
|
612
|
-
...ring.map((u) => ui.getUserDisplayName(u)),
|
|
613
|
-
...invites.map((g) => g.name)
|
|
614
|
-
]),
|
|
615
|
-
ring,
|
|
616
|
-
invites
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
)
|
|
621
|
-
] });
|
|
622
|
-
}
|
|
623
|
-
function useMeetingThreadMessages(meetingCallExtId, messageHistory) {
|
|
624
|
-
const hasRecTranscript = react$1.useMemo(
|
|
625
|
-
() => !!meetingCallExtId && react.hasRecordingTranscript(messageHistory, react.threadTranscriptRef),
|
|
626
|
-
[meetingCallExtId, messageHistory]
|
|
627
|
-
);
|
|
628
|
-
const recordingWindows = react.useRecordingWindows(meetingCallExtId, hasRecTranscript);
|
|
629
|
-
return react$1.useMemo(
|
|
630
|
-
() => hasRecTranscript ? react.supersedeLiveTranscript(messageHistory, react.threadTranscriptRef, recordingWindows) : messageHistory,
|
|
631
|
-
[hasRecTranscript, messageHistory, recordingWindows]
|
|
632
|
-
);
|
|
633
|
-
}
|
|
634
|
-
function MeetingThreadTranscriptAction({
|
|
635
|
-
conversationExtId,
|
|
636
|
-
meetingCallExtId,
|
|
637
|
-
title,
|
|
638
|
-
messages
|
|
639
|
-
}) {
|
|
640
|
-
const { data: call } = react.useCall(meetingCallExtId);
|
|
641
|
-
const { data: workspaceUsers = [] } = react.useWorkspaceUsers();
|
|
642
|
-
const lines = react$1.useMemo(
|
|
643
|
-
() => react.threadTranscriptLines(messages, (id) => {
|
|
644
|
-
const user = workspaceUsers.find((wu) => wu.user.external_id === id)?.user;
|
|
645
|
-
return user ? ui.getUserDisplayName(user) : null;
|
|
646
|
-
}),
|
|
647
|
-
[messages, workspaceUsers]
|
|
648
|
-
);
|
|
649
|
-
if (!meetingCallExtId || !call?.is_creator) return null;
|
|
650
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
651
|
-
chunkNGM4HIPP_cjs.SaveTranscriptToThread,
|
|
652
|
-
{
|
|
653
|
-
title,
|
|
654
|
-
lines,
|
|
655
|
-
excludeConversationExtId: conversationExtId,
|
|
656
|
-
iconOnly: true
|
|
657
|
-
}
|
|
658
|
-
);
|
|
659
|
-
}
|
|
660
|
-
function MeetingThreadRecordingsAction({
|
|
661
|
-
meetingCallExtId,
|
|
662
|
-
title
|
|
663
|
-
}) {
|
|
664
|
-
const [open, setOpen] = react$1.useState(false);
|
|
665
|
-
const pending = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
666
|
-
react$1.useEffect(() => {
|
|
667
|
-
if (pending) setOpen(true);
|
|
668
|
-
}, [pending]);
|
|
669
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
670
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
671
|
-
chunkSH7W4WVI_cjs.HeaderAction,
|
|
672
|
-
{
|
|
673
|
-
label: "Recordings",
|
|
674
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Disc, { className: "size-3.5", "aria-hidden": true }),
|
|
675
|
-
iconOnly: true,
|
|
676
|
-
onClick: () => setOpen(true),
|
|
677
|
-
testId: "meeting-recordings"
|
|
678
|
-
}
|
|
679
|
-
),
|
|
680
|
-
open && /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: true, onOpenChange: (o) => !o && setOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "sm:max-w-2xl", "data-testid": "meeting-recordings-dialog", children: [
|
|
681
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
|
|
682
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Recordings" }),
|
|
683
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "Recordings of this meeting, encrypted under the workspace key. Playing or downloading one decrypts it in this browser." })
|
|
684
|
-
] }),
|
|
685
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
686
|
-
chunkNGM4HIPP_cjs.RecordingsList,
|
|
687
|
-
{
|
|
688
|
-
callExtId: meetingCallExtId,
|
|
689
|
-
title,
|
|
690
|
-
className: "max-h-[60vh] overflow-y-auto"
|
|
691
|
-
}
|
|
692
|
-
)
|
|
693
|
-
] }) })
|
|
694
|
-
] });
|
|
695
|
-
}
|
|
696
|
-
function ConnectedConversationCallActions() {
|
|
697
|
-
const conversationId = react.useArbiSessionState((state) => state.conversationId);
|
|
698
|
-
const { conversations } = react.useConversationItems();
|
|
699
|
-
const conversation = conversationId ? conversations.find((c) => c.external_id === conversationId) : void 0;
|
|
700
|
-
const meetingCallExtId = conversation?.meeting_call_ext_id ?? null;
|
|
701
|
-
const { messageHistory } = react.useConversationData();
|
|
702
|
-
const threadMessages = useMeetingThreadMessages(meetingCallExtId, messageHistory);
|
|
703
|
-
const meetingMessages = react$1.useMemo(
|
|
704
|
-
() => meetingCallExtId ? threadMessages.map((m) => ({
|
|
705
|
-
content: m.content,
|
|
706
|
-
created_at: m.created_at,
|
|
707
|
-
tools: m.tools ?? m.meta?.tools
|
|
708
|
-
})) : [],
|
|
709
|
-
[meetingCallExtId, threadMessages]
|
|
710
|
-
);
|
|
711
|
-
if (!conversationId) return null;
|
|
712
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
713
|
-
/* @__PURE__ */ jsxRuntime.jsx(ThreadCallButton, { conversationId }),
|
|
714
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkT26UYA6Q_cjs.ScheduleCallButton, { conversationId }),
|
|
715
|
-
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
716
|
-
MeetingThreadTranscriptAction,
|
|
853
|
+
const others = members.filter((u) => u.external_id !== me && !ui.isAgent(u));
|
|
854
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
855
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
856
|
+
StartCallButton,
|
|
717
857
|
{
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
858
|
+
onStart: async () => {
|
|
859
|
+
if (liveCallId && !canHost) return react.openCall(arbi, { callExtId: liveCallId });
|
|
860
|
+
if (isLive) return react.startChatCall(arbi, { chatExtId, title, ring: [] });
|
|
861
|
+
setPicking(true);
|
|
862
|
+
return true;
|
|
863
|
+
},
|
|
864
|
+
isLive,
|
|
865
|
+
label: "Call the group",
|
|
866
|
+
testId: "group-call-button"
|
|
722
867
|
}
|
|
723
868
|
),
|
|
724
|
-
|
|
725
|
-
|
|
869
|
+
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
870
|
+
CallPeoplePicker,
|
|
726
871
|
{
|
|
727
|
-
|
|
728
|
-
|
|
872
|
+
open: true,
|
|
873
|
+
onOpenChange: setPicking,
|
|
874
|
+
scope: "chat",
|
|
875
|
+
members: others,
|
|
876
|
+
preselected: others.map((u) => u.external_id),
|
|
877
|
+
onSubmit: async ({ ring }) => {
|
|
878
|
+
await react.startChatCall(arbi, { chatExtId, title, ring });
|
|
879
|
+
}
|
|
729
880
|
}
|
|
730
881
|
)
|
|
731
882
|
] });
|
|
732
883
|
}
|
|
733
|
-
function
|
|
734
|
-
|
|
735
|
-
senderName,
|
|
736
|
-
latest,
|
|
737
|
-
name,
|
|
738
|
-
time
|
|
739
|
-
}) {
|
|
740
|
-
const arbi = react.useArbi();
|
|
741
|
-
const { data: call } = react.useCall(latest ? callExtId : null);
|
|
742
|
-
const liveNow = react.useCallSession((s) => callExtId in s.liveCalls);
|
|
743
|
-
const inThisCall = react.useCallSession((s) => s.active?.callExtId === callExtId);
|
|
744
|
-
const inAnotherCall = react.useCallSession((s) => !!s.active && s.active.callExtId !== callExtId);
|
|
745
|
-
const [busy, setBusy] = react$1.useState(false);
|
|
746
|
-
const live = latest && chunkSH7W4WVI_cjs.isCallLive(call, liveNow);
|
|
747
|
-
let summary;
|
|
748
|
-
if (live) summary = senderName ? `${senderName} started a call` : "Call in progress";
|
|
749
|
-
else if (latest && call?.started_at && call.ended_at) {
|
|
750
|
-
const seconds = (Date.parse(call.ended_at) - Date.parse(call.started_at)) / 1e3;
|
|
751
|
-
const joined = (call.last_participants ?? []).map(name);
|
|
752
|
-
summary = [
|
|
753
|
-
"Call",
|
|
754
|
-
chunkSH7W4WVI_cjs.formatCallDuration(seconds),
|
|
755
|
-
joined.length ? `joined ${joined.join(", ")}` : null
|
|
756
|
-
].filter(Boolean).join(" \xB7 ");
|
|
757
|
-
} else summary = senderName ? `Call started by ${senderName}` : "Call";
|
|
758
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
759
|
-
"div",
|
|
760
|
-
{
|
|
761
|
-
className: "mx-auto my-2 flex w-fit max-w-full flex-wrap items-center justify-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-xs",
|
|
762
|
-
"data-testid": "chat-call-card",
|
|
763
|
-
"data-live": live || void 0,
|
|
764
|
-
children: [
|
|
765
|
-
live ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: "size-4 animate-pulse text-green-text", "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PhoneOff, { className: "size-4 text-muted-foreground", "aria-hidden": true }),
|
|
766
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "chat-call-card-summary", children: summary }),
|
|
767
|
-
time && /* @__PURE__ */ jsxRuntime.jsx("time", { className: "text-muted-foreground", children: time }),
|
|
768
|
-
live && /* @__PURE__ */ jsxRuntime.jsx(
|
|
769
|
-
ui.Button,
|
|
770
|
-
{
|
|
771
|
-
type: "button",
|
|
772
|
-
size: "sm",
|
|
773
|
-
className: "h-7 bg-green-600 text-white hover:bg-green-700",
|
|
774
|
-
disabled: busy || inThisCall || inAnotherCall,
|
|
775
|
-
title: inAnotherCall ? "You are already in a call" : void 0,
|
|
776
|
-
onClick: () => {
|
|
777
|
-
setBusy(true);
|
|
778
|
-
void react.openCall(arbi, { callExtId }).finally(() => setBusy(false));
|
|
779
|
-
},
|
|
780
|
-
"data-testid": "chat-call-card-join",
|
|
781
|
-
children: inThisCall ? "In call" : "Join"
|
|
782
|
-
}
|
|
783
|
-
)
|
|
784
|
-
]
|
|
785
|
-
}
|
|
786
|
-
);
|
|
884
|
+
function NewCallChip() {
|
|
885
|
+
return react.useCanHostCalls() ? /* @__PURE__ */ jsxRuntime.jsx(EnabledNewCallChip, {}) : null;
|
|
787
886
|
}
|
|
788
|
-
function
|
|
887
|
+
function EnabledNewCallChip() {
|
|
789
888
|
const arbi = react.useArbi();
|
|
790
|
-
const
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
return ui.getUserDisplayName({ given_name: profile.givenName, family_name: profile.familyName });
|
|
796
|
-
const user = byId(identity);
|
|
797
|
-
if (user) return ui.getUserDisplayName(user);
|
|
798
|
-
return (fallbackName || identity).trim().split(/\s+/).join(" ");
|
|
799
|
-
}, [profile, byId, identity, fallbackName]);
|
|
800
|
-
}
|
|
801
|
-
function CallConversationEmpty({ callExtId }) {
|
|
802
|
-
const { inCall, transcribing } = chunkOAIOOVFN_cjs.useMyCallStatus(callExtId);
|
|
803
|
-
const live = react.useCallSession((s) => !!s.liveCalls[callExtId]) || inCall;
|
|
804
|
-
if (!live) {
|
|
805
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
806
|
-
chunkZW6FPIFC_cjs.EmptyState,
|
|
889
|
+
const inCall = react.useCallSession((s) => s.active !== null);
|
|
890
|
+
const [open, setOpen] = react$1.useState(false);
|
|
891
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
892
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
893
|
+
chunkMOIZ2R5X_cjs.DmInviteChip,
|
|
807
894
|
{
|
|
808
|
-
|
|
809
|
-
title: "
|
|
810
|
-
description:
|
|
811
|
-
|
|
812
|
-
testId: "call-conversation-empty"
|
|
895
|
+
testId: "dm-new-call-chip",
|
|
896
|
+
title: "New call",
|
|
897
|
+
description: inCall ? "You are already in a call" : "Call people from your contacts",
|
|
898
|
+
onClick: () => !inCall && setOpen(true)
|
|
813
899
|
}
|
|
814
|
-
);
|
|
815
|
-
}
|
|
816
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
817
|
-
chunkZW6FPIFC_cjs.EmptyState,
|
|
818
|
-
{
|
|
819
|
-
icon: transcribing ? lucideReact.Captions : lucideReact.CaptionsOff,
|
|
820
|
-
title: "Call in progress \u2014 the transcript will appear here",
|
|
821
|
-
description: transcribing ? "Transcription is on: what people say shows up here as they speak." : "Transcription is off. The host can turn it on with CC in the call.",
|
|
822
|
-
className: "mx-auto my-8 max-w-xl",
|
|
823
|
-
testId: "call-conversation-empty"
|
|
824
|
-
}
|
|
825
|
-
);
|
|
826
|
-
}
|
|
827
|
-
function ProvisionalRow({ identity }) {
|
|
828
|
-
const name = useCallPersonName(identity);
|
|
829
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
830
|
-
chunkZBP4ZSAJ_cjs.ProvisionalTranscriptLine,
|
|
831
|
-
{
|
|
832
|
-
speakerId: identity,
|
|
833
|
-
speakerName: name,
|
|
834
|
-
speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkSH7W4WVI_cjs.CallUserPill, { identity })
|
|
835
|
-
}
|
|
836
|
-
);
|
|
837
|
-
}
|
|
838
|
-
function ProvisionalSpeakers({ ids }) {
|
|
839
|
-
if (!ids.length) return null;
|
|
840
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2", "data-testid": "transcript-provisional-rows", children: ids.map((id) => /* @__PURE__ */ jsxRuntime.jsx(ProvisionalRow, { identity: id }, id)) });
|
|
841
|
-
}
|
|
842
|
-
var LINE_WAIT_MS = 1e4;
|
|
843
|
-
var MIN_SPEECH_MS = 800;
|
|
844
|
-
function useProvisionalSpeakers(callExtId, lines) {
|
|
845
|
-
const { inCall, transcribing } = chunkOAIOOVFN_cjs.useMyCallStatus(callExtId);
|
|
846
|
-
const speaking = chunkOAIOOVFN_cjs.useSpeakingIds();
|
|
847
|
-
const pending = react$1.useRef(/* @__PURE__ */ new Map());
|
|
848
|
-
const [, tick] = react$1.useState(0);
|
|
849
|
-
const active = inCall && transcribing;
|
|
850
|
-
const now = Date.now();
|
|
851
|
-
if (active) {
|
|
852
|
-
for (const id of speaking) {
|
|
853
|
-
const p = pending.current.get(id);
|
|
854
|
-
if (p) p.lastHeardAt = now;
|
|
855
|
-
else pending.current.set(id, { startedAt: now, lastHeardAt: now });
|
|
856
|
-
}
|
|
857
|
-
} else if (pending.current.size) {
|
|
858
|
-
pending.current.clear();
|
|
859
|
-
}
|
|
860
|
-
const latest = react$1.useMemo(() => {
|
|
861
|
-
const m = /* @__PURE__ */ new Map();
|
|
862
|
-
for (const l of lines) m.set(l.speakerId, Math.max(m.get(l.speakerId) ?? 0, l.at));
|
|
863
|
-
return m;
|
|
864
|
-
}, [lines]);
|
|
865
|
-
for (const [id, p] of [...pending.current]) {
|
|
866
|
-
const arrived = (latest.get(id) ?? 0) >= p.startedAt - 3e3;
|
|
867
|
-
const stale = !speaking.includes(id) && now - p.lastHeardAt > LINE_WAIT_MS;
|
|
868
|
-
if (arrived && !speaking.includes(id) || stale) pending.current.delete(id);
|
|
869
|
-
else if (arrived) p.startedAt = now;
|
|
870
|
-
}
|
|
871
|
-
const waiting = pending.current.size > 0;
|
|
872
|
-
react$1.useEffect(() => {
|
|
873
|
-
if (!waiting) return;
|
|
874
|
-
const id = setInterval(() => tick((n) => n + 1), 1e3);
|
|
875
|
-
return () => clearInterval(id);
|
|
876
|
-
}, [waiting]);
|
|
877
|
-
return [...pending.current].filter(([, p]) => p.lastHeardAt - p.startedAt >= MIN_SPEECH_MS).map(([id]) => id);
|
|
878
|
-
}
|
|
879
|
-
var { isTranscriptMessage, parseTranscriptContent } = browser.chats;
|
|
880
|
-
function ConnectedCallChatHistory({
|
|
881
|
-
chat,
|
|
882
|
-
messages,
|
|
883
|
-
items,
|
|
884
|
-
renderItem,
|
|
885
|
-
renderEntriesBefore,
|
|
886
|
-
entriesAfter,
|
|
887
|
-
loadOlder,
|
|
888
|
-
memberById,
|
|
889
|
-
senderName,
|
|
890
|
-
myExtId,
|
|
891
|
-
formatTime,
|
|
892
|
-
formatDay
|
|
893
|
-
}) {
|
|
894
|
-
const arbi = react.useArbi();
|
|
895
|
-
const [view, setView] = react$1.useState("all");
|
|
896
|
-
react$1.useEffect(() => setView("all"), [chat?.external_id]);
|
|
897
|
-
const recordingsCallExtId = chat?.call_ext_id ?? null;
|
|
898
|
-
const pendingRecording = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
899
|
-
react$1.useEffect(() => {
|
|
900
|
-
if (pendingRecording && recordingsCallExtId) setView("recordings");
|
|
901
|
-
}, [pendingRecording, recordingsCallExtId]);
|
|
902
|
-
const latestCallCards = react$1.useMemo(() => {
|
|
903
|
-
const latest = /* @__PURE__ */ new Map();
|
|
904
|
-
for (const m of messages)
|
|
905
|
-
if (m.kind === "call" && m.call_ext_id && !m.deleted) latest.set(m.call_ext_id, m.external_id);
|
|
906
|
-
return new Set(latest.values());
|
|
907
|
-
}, [messages]);
|
|
908
|
-
const hasRecTranscript = react$1.useMemo(
|
|
909
|
-
() => react.hasRecordingTranscript(messages, react.chatTranscriptRef),
|
|
910
|
-
[messages]
|
|
911
|
-
);
|
|
912
|
-
const recordingWindows = react.useRecordingWindows(recordingsCallExtId, hasRecTranscript);
|
|
913
|
-
const supersededTranscript = react$1.useMemo(
|
|
914
|
-
() => react.supersededTranscriptLines(messages, react.chatTranscriptRef, recordingWindows),
|
|
915
|
-
[messages, recordingWindows]
|
|
916
|
-
);
|
|
917
|
-
const transcriptMessages = react$1.useMemo(
|
|
918
|
-
() => react.sortTranscriptMessages(
|
|
919
|
-
messages.filter((m) => isTranscriptMessage(m) && !m.deleted && !supersededTranscript.has(m))
|
|
920
900
|
),
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
at: parsed?.started_at ?? m.created_at,
|
|
946
|
-
text: parsed?.text ?? m.content ?? ""
|
|
947
|
-
};
|
|
948
|
-
}),
|
|
949
|
-
[transcriptMessages, memberById, senderName]
|
|
901
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
902
|
+
CallPeoplePicker,
|
|
903
|
+
{
|
|
904
|
+
open: true,
|
|
905
|
+
onOpenChange: setOpen,
|
|
906
|
+
scope: "contacts",
|
|
907
|
+
onSubmit: async ({ ring, invites }) => {
|
|
908
|
+
await react.startContactsCall(arbi, {
|
|
909
|
+
title: chunkRLRDQICM_cjs.contactsCallTitle([
|
|
910
|
+
...ring.map((u) => ui.getUserDisplayName(u)),
|
|
911
|
+
...invites.map((g) => g.name)
|
|
912
|
+
]),
|
|
913
|
+
ring,
|
|
914
|
+
invites
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
)
|
|
919
|
+
] });
|
|
920
|
+
}
|
|
921
|
+
function useMeetingThreadMessages(meetingCallExtId, messageHistory) {
|
|
922
|
+
const hasRecTranscript = react$1.useMemo(
|
|
923
|
+
() => !!meetingCallExtId && react.hasRecordingTranscript(messageHistory, react.threadTranscriptRef),
|
|
924
|
+
[meetingCallExtId, messageHistory]
|
|
950
925
|
);
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
926
|
+
const recordingWindows = react.useRecordingWindows(meetingCallExtId, hasRecTranscript);
|
|
927
|
+
return react$1.useMemo(
|
|
928
|
+
() => hasRecTranscript ? react.supersedeLiveTranscript(messageHistory, react.threadTranscriptRef, recordingWindows) : messageHistory,
|
|
929
|
+
[hasRecTranscript, messageHistory, recordingWindows]
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
function ThreadCallButton({
|
|
933
|
+
conversationId
|
|
934
|
+
}) {
|
|
935
|
+
const arbi = react.useArbi();
|
|
936
|
+
const { data: conversations } = chunkDWN5AUMH_cjs.useConnectedConversations();
|
|
937
|
+
const { workspaceId: workspaceExtId } = chunkGB5MN5FC_cjs.useConnectedWorkspace();
|
|
938
|
+
const liveCallId = react.useCallSession((s) => react.threadLiveCallId(s, conversationId));
|
|
939
|
+
const isLive = liveCallId !== null;
|
|
940
|
+
const canHost = react.useCanHostCalls();
|
|
941
|
+
const [picking, setPicking] = react$1.useState(false);
|
|
942
|
+
const conversation = conversations.find((c) => c.external_id === conversationId);
|
|
943
|
+
if (!conversation?.is_shared) return null;
|
|
944
|
+
const title = conversation.title ?? null;
|
|
945
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
946
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
947
|
+
StartCallButton,
|
|
964
948
|
{
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
949
|
+
onStart: async () => {
|
|
950
|
+
if (liveCallId && !canHost) return react.openCall(arbi, { callExtId: liveCallId });
|
|
951
|
+
if (isLive) return react.startThreadCall(arbi, { threadExtId: conversationId, title, ring: [] });
|
|
952
|
+
setPicking(true);
|
|
953
|
+
return true;
|
|
954
|
+
},
|
|
955
|
+
isLive,
|
|
956
|
+
label: "Call thread members",
|
|
957
|
+
testId: "thread-call-button"
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
961
|
+
CallPeoplePicker,
|
|
962
|
+
{
|
|
963
|
+
open: true,
|
|
964
|
+
onOpenChange: setPicking,
|
|
965
|
+
scope: "workspace",
|
|
966
|
+
workspaceExtId,
|
|
967
|
+
onSubmit: async ({ ring }) => {
|
|
968
|
+
await react.startThreadCall(arbi, { threadExtId: conversationId, title, ring });
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
)
|
|
972
|
+
] });
|
|
973
|
+
}
|
|
974
|
+
function MeetingThreadTranscriptAction({
|
|
975
|
+
conversationExtId,
|
|
976
|
+
meetingCallExtId,
|
|
977
|
+
title,
|
|
978
|
+
messages
|
|
979
|
+
}) {
|
|
980
|
+
const { data: call } = react.useCall(meetingCallExtId);
|
|
981
|
+
const { data: workspaceUsers = [] } = react.useWorkspaceUsers();
|
|
982
|
+
const lines = react$1.useMemo(
|
|
983
|
+
() => react.threadTranscriptLines(messages, (id) => {
|
|
984
|
+
const user = workspaceUsers.find((wu) => wu.user.external_id === id)?.user;
|
|
985
|
+
return user ? ui.getUserDisplayName(user) : null;
|
|
978
986
|
}),
|
|
979
|
-
[
|
|
987
|
+
[messages, workspaceUsers]
|
|
980
988
|
);
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
const deleted = !!msg.deleted;
|
|
985
|
-
if (deleted && isTranscriptMessage(msg)) return null;
|
|
986
|
-
const separator = isFirstOfDay && /* @__PURE__ */ jsxRuntime.jsx(react.DateSeparator, { children: formatDay(msg.created_at) });
|
|
987
|
-
if (isTranscriptMessage(msg)) {
|
|
988
|
-
if (view === "chat") return null;
|
|
989
|
-
const superseded = supersededTranscript.has(msg);
|
|
990
|
-
if (superseded && !isFirstOfDay) return null;
|
|
991
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
992
|
-
separator,
|
|
993
|
-
!superseded && transcriptEntry(msg)
|
|
994
|
-
] }, msg.external_id);
|
|
995
|
-
}
|
|
996
|
-
if (msg.kind === "recording" && msg.call_ext_id && !deleted) {
|
|
997
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
998
|
-
separator,
|
|
999
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1000
|
-
chunkNGM4HIPP_cjs.RecordingCard,
|
|
1001
|
-
{
|
|
1002
|
-
callExtId: msg.call_ext_id,
|
|
1003
|
-
recordingExtId: msg.recording_ext_id ?? null,
|
|
1004
|
-
title: meetingTitle,
|
|
1005
|
-
time: formatTime(msg.created_at)
|
|
1006
|
-
}
|
|
1007
|
-
)
|
|
1008
|
-
] }, msg.external_id);
|
|
1009
|
-
}
|
|
1010
|
-
if (msg.kind === "call" && msg.call_ext_id && !deleted) {
|
|
1011
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
|
|
1012
|
-
separator,
|
|
1013
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1014
|
-
ChatCallCard,
|
|
1015
|
-
{
|
|
1016
|
-
callExtId: msg.call_ext_id,
|
|
1017
|
-
senderName: msg.sender_ext_id ? senderName(msg.sender_ext_id) : null,
|
|
1018
|
-
latest: latestCallCards.has(msg.external_id),
|
|
1019
|
-
name: senderName,
|
|
1020
|
-
time: formatTime(msg.created_at)
|
|
1021
|
-
}
|
|
1022
|
-
)
|
|
1023
|
-
] }, msg.external_id);
|
|
1024
|
-
}
|
|
1025
|
-
return renderItem(item, i);
|
|
1026
|
-
};
|
|
1027
|
-
const filterOptions = [
|
|
1028
|
-
{ value: "all", label: "All" },
|
|
1029
|
-
{ value: "chat", label: "Chat", testId: "chat-filter" },
|
|
989
|
+
if (!meetingCallExtId || !call?.is_creator) return null;
|
|
990
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
991
|
+
chunkPA5CCOBU_cjs.SaveTranscriptToThread,
|
|
1030
992
|
{
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
993
|
+
title,
|
|
994
|
+
lines,
|
|
995
|
+
excludeConversationExtId: conversationExtId,
|
|
996
|
+
iconOnly: true
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
function MeetingThreadRecordingsAction({
|
|
1001
|
+
meetingCallExtId,
|
|
1002
|
+
title
|
|
1003
|
+
}) {
|
|
1004
|
+
const [open, setOpen] = react$1.useState(false);
|
|
1005
|
+
const pending = chunkZT5MIFLC_cjs.usePendingRecording();
|
|
1006
|
+
react$1.useEffect(() => {
|
|
1007
|
+
if (pending) setOpen(true);
|
|
1008
|
+
}, [pending]);
|
|
1038
1009
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
chunkZBP4ZSAJ_cjs.ConversationFilter,
|
|
1010
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1011
|
+
chunkRLRDQICM_cjs.HeaderAction,
|
|
1042
1012
|
{
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1013
|
+
label: "Recordings",
|
|
1014
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Disc, { className: "size-3.5", "aria-hidden": true }),
|
|
1015
|
+
iconOnly: true,
|
|
1016
|
+
onClick: () => setOpen(true),
|
|
1017
|
+
testId: "meeting-recordings"
|
|
1046
1018
|
}
|
|
1047
|
-
)
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1019
|
+
),
|
|
1020
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: true, onOpenChange: (o) => !o && setOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "sm:max-w-2xl", "data-testid": "meeting-recordings-dialog", children: [
|
|
1021
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
|
|
1022
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Recordings" }),
|
|
1023
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "Recordings of this meeting, encrypted under the workspace key. Playing or downloading one decrypts it in this browser." })
|
|
1024
|
+
] }),
|
|
1025
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1026
|
+
chunkPA5CCOBU_cjs.RecordingsList,
|
|
1053
1027
|
{
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
className: "
|
|
1028
|
+
callExtId: meetingCallExtId,
|
|
1029
|
+
title,
|
|
1030
|
+
className: "max-h-[60vh] overflow-y-auto"
|
|
1057
1031
|
}
|
|
1058
|
-
)
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1032
|
+
)
|
|
1033
|
+
] }) })
|
|
1034
|
+
] });
|
|
1035
|
+
}
|
|
1036
|
+
function ConnectedConversationCallActions() {
|
|
1037
|
+
const conversationId = react.useArbiSessionState((state) => state.conversationId);
|
|
1038
|
+
const { conversations } = react.useConversationItems();
|
|
1039
|
+
const conversation = conversationId ? conversations.find((c) => c.external_id === conversationId) : void 0;
|
|
1040
|
+
const meetingCallExtId = conversation?.meeting_call_ext_id ?? null;
|
|
1041
|
+
const { messageHistory } = react.useConversationData();
|
|
1042
|
+
const threadMessages = useMeetingThreadMessages(meetingCallExtId, messageHistory);
|
|
1043
|
+
const meetingMessages = react$1.useMemo(
|
|
1044
|
+
() => meetingCallExtId ? threadMessages.map((m) => ({
|
|
1045
|
+
content: m.content,
|
|
1046
|
+
created_at: m.created_at,
|
|
1047
|
+
tools: m.tools ?? m.meta?.tools
|
|
1048
|
+
})) : [],
|
|
1049
|
+
[meetingCallExtId, threadMessages]
|
|
1050
|
+
);
|
|
1051
|
+
if (!conversationId) return null;
|
|
1052
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1053
|
+
/* @__PURE__ */ jsxRuntime.jsx(ThreadCallButton, { conversationId }),
|
|
1054
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkT26UYA6Q_cjs.ScheduleCallButton, { conversationId }),
|
|
1055
|
+
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
|
+
MeetingThreadTranscriptAction,
|
|
1057
|
+
{
|
|
1058
|
+
conversationExtId: conversationId,
|
|
1059
|
+
meetingCallExtId,
|
|
1060
|
+
title: conversation?.title,
|
|
1061
|
+
messages: meetingMessages
|
|
1062
|
+
}
|
|
1063
|
+
),
|
|
1064
|
+
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1065
|
+
MeetingThreadRecordingsAction,
|
|
1066
|
+
{
|
|
1067
|
+
meetingCallExtId,
|
|
1068
|
+
title: conversation?.title
|
|
1069
|
+
}
|
|
1070
|
+
)
|
|
1071
1071
|
] });
|
|
1072
1072
|
}
|
|
1073
1073
|
|
|
@@ -1091,5 +1091,5 @@ exports.matchesQuery = matchesQuery;
|
|
|
1091
1091
|
exports.useCallPersonName = useCallPersonName;
|
|
1092
1092
|
exports.useMeetingThreadMessages = useMeetingThreadMessages;
|
|
1093
1093
|
exports.useProvisionalSpeakers = useProvisionalSpeakers;
|
|
1094
|
-
//# sourceMappingURL=chunk-
|
|
1095
|
-
//# sourceMappingURL=chunk-
|
|
1094
|
+
//# sourceMappingURL=chunk-GQIH6ALC.cjs.map
|
|
1095
|
+
//# sourceMappingURL=chunk-GQIH6ALC.cjs.map
|