@linktr.ee/messaging-react 3.6.2-rc-1783314663 → 3.6.2-rc-1783332217
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/{Card-ILtY9lfF.js → Card-0wf8lj5n.js} +2 -2
- package/dist/{Card-ILtY9lfF.js.map → Card-0wf8lj5n.js.map} +1 -1
- package/dist/{Card-CLfoYI1R.cjs → Card-4UyBK3XO.cjs} +2 -2
- package/dist/{Card-CLfoYI1R.cjs.map → Card-4UyBK3XO.cjs.map} +1 -1
- package/dist/{Card-UN0QRlxk.cjs → Card-6b4Ws9rn.cjs} +2 -2
- package/dist/{Card-UN0QRlxk.cjs.map → Card-6b4Ws9rn.cjs.map} +1 -1
- package/dist/{Card-CSkWY9mH.cjs → Card-DsQhJjj0.cjs} +2 -2
- package/dist/{Card-CSkWY9mH.cjs.map → Card-DsQhJjj0.cjs.map} +1 -1
- package/dist/{Card-Byosl29s.js → Card-RZ6C_IkE.js} +3 -3
- package/dist/{Card-Byosl29s.js.map → Card-RZ6C_IkE.js.map} +1 -1
- package/dist/{Card-CqEKHw9S.js → Card-iGNcxybY.js} +2 -2
- package/dist/{Card-CqEKHw9S.js.map → Card-iGNcxybY.js.map} +1 -1
- package/dist/{LockedThumbnail-BKI_6JUF.js → LockedThumbnail-Do9udNMm.js} +2 -2
- package/dist/{LockedThumbnail-BKI_6JUF.js.map → LockedThumbnail-Do9udNMm.js.map} +1 -1
- package/dist/{LockedThumbnail-DZ6C2xsr.cjs → LockedThumbnail-N0pNOO3D.cjs} +2 -2
- package/dist/{LockedThumbnail-DZ6C2xsr.cjs.map → LockedThumbnail-N0pNOO3D.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/index-B3ZJaqJY.cjs +2 -0
- package/dist/index-B3ZJaqJY.cjs.map +1 -0
- package/dist/{index-DPwo1avm.js → index-wFe1UO9t.js} +788 -780
- package/dist/index-wFe1UO9t.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +11 -18
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +107 -0
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +86 -0
- package/src/components/CustomMessage/index.tsx +2 -2
- package/src/styles.css +25 -16
- package/dist/index-DPwo1avm.js.map +0 -1
- package/dist/index-Q0FmgUJF.cjs +0 -2
- package/dist/index-Q0FmgUJF.cjs.map +0 -1
- package/src/components/CustomMessage/MessageDeliveryStatus.test.tsx +0 -60
- package/src/components/CustomMessage/MessageDeliveryStatus.tsx +0 -43
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as s, jsxs as m, Fragment as
|
|
2
|
-
import U, { createContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ee, DotsThreeIcon as
|
|
1
|
+
import { jsx as s, jsxs as m, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
+
import U, { createContext as rt, useContext as Ie, useCallback as J, useState as B, useRef as G, useEffect as K, useId as Gs, useMemo as se, Suspense as it } from "react";
|
|
3
|
+
import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Ys, LinkPreviewsManager as Yt } from "stream-chat";
|
|
5
|
+
import { Chat as qs, useChannelStateContext as le, useChatContext as oe, DateSeparator as Ws, MessageStatus as Xs, useMessageContext as _e, areMessageUIPropsEqual as Ks, useMessageReminder as Js, useComponentContext as is, Attachment as Zs, EditMessageModal as Qs, MessageBlocked as en, MessageBouncePrompt as tn, MessageDeleted as sn, MessageIsThreadReplyInChannelButtonIndicator as nn, MessageRepliesCountButton as an, ReminderNotification as rn, StreamedMessageText as ln, messageHasAttachments as on, messageHasReactions as cn, isDateSeparatorMessage as dn, isMessageBlocked as un, isMessageBounced as mn, MessageBounceModal as hn, MessageText as qt, MessageErrorIcon as Wt, Poll as fn, useMessageComposer as gn, useStateStore as pn, MessageInput as bn, useMessageInputContext as vn, useMessageComposerHasSendableData as xn, AttachmentPreviewList as wn, QuotedMessagePreview as _n, TextareaComposer as Nn, MessageTimestamp as Ye, AIStates as qe, useTypingContext as yn, useAIState as kn, Channel as Cn, WithComponents as Sn, Window as En, MessageList as In, ChannelList as Tn, InfiniteScroll as An } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, DotsThreeIcon as Mn, SpinnerGapIcon as ze, SignOutIcon as Rn, ProhibitInsetIcon as Xt, FlagIcon as ls, ArrowLeftIcon as et, CurrencyDollarIcon as Dn, CaretRightIcon as ve, SparkleIcon as xe, FileIcon as os, ImageIcon as Ln, SpeakerHighIcon as zn, VideoCameraIcon as cs, FileMdIcon as Pn, FileTextIcon as Fn, FileZipIcon as On, FilePptIcon as $n, FileCsvIcon as jn, FileXlsIcon as Bn, FileDocIcon as Un, FilePdfIcon as Vn, CircleNotchIcon as Ce, PlayIcon as tt, PauseIcon as Gn, LinkIcon as Hn, DownloadSimpleIcon as Se, XIcon as Be, CaretLeftIcon as Yn, GiftIcon as qn, ThumbsUpIcon as Wn, ThumbsDownIcon as Xn, ChecksIcon as Kn, PencilSimpleIcon as Jn, TrashSimpleIcon as Zn, ArrowUpIcon as Qn, ProhibitIcon as ea } from "@phosphor-icons/react";
|
|
7
7
|
import k from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as ta, DefaultDropdownActionButton as ds } from "stream-chat-react/experimental";
|
|
9
|
+
const us = rt({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const ds = at({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), lt = () => Ie(us), dl = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -24,7 +24,7 @@ const ds = at({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var A,
|
|
27
|
+
var A, E;
|
|
28
28
|
const l = J(
|
|
29
29
|
(C, ...I) => {
|
|
30
30
|
i && console.log(`🔥 [MessagingProvider] ${C}`, ...I);
|
|
@@ -39,8 +39,8 @@ const ds = at({
|
|
|
39
39
|
});
|
|
40
40
|
const [o, d] = B(null), [u, p] = B(null), [h, g] = B(!1), [c, v] = B(!1), [w, b] = B(null), f = G(!1), x = G(null), N = G(n);
|
|
41
41
|
N.current = n;
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const S = G(i);
|
|
43
|
+
S.current = i;
|
|
44
44
|
const T = G({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
@@ -62,12 +62,12 @@ const ds = at({
|
|
|
62
62
|
serviceConfig: n,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((A =
|
|
67
|
-
const
|
|
65
|
+
const L = G(null);
|
|
66
|
+
a && ((A = L.current) == null ? void 0 : A.apiKey) !== a && (L.current = { apiKey: a, client: new Ys(a) });
|
|
67
|
+
const D = a ? ((E = L.current) == null ? void 0 : E.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
69
|
const C = M.current, I = N.current;
|
|
70
|
-
if (!a || !
|
|
70
|
+
if (!a || !D || !I) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: C,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,17 +78,17 @@ const ds = at({
|
|
|
78
78
|
renderCount: C,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const $ = new
|
|
81
|
+
const $ = new Hs({
|
|
82
82
|
...I,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: S.current,
|
|
85
|
+
client: D
|
|
86
86
|
});
|
|
87
87
|
x.current = $, d($), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: C,
|
|
89
89
|
serviceInstance: !!$
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
91
|
+
}, [a, D]);
|
|
92
92
|
const O = G(null);
|
|
93
93
|
K(() => {
|
|
94
94
|
var I, $;
|
|
@@ -137,12 +137,12 @@ const ds = at({
|
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
139
|
}, [o, t, l, h]), K(() => {
|
|
140
|
-
const C =
|
|
140
|
+
const C = D;
|
|
141
141
|
return () => {
|
|
142
142
|
var I;
|
|
143
143
|
C && (O.current = null, (I = x.current) == null || I.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
145
|
+
}, [D]);
|
|
146
146
|
const z = J(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
@@ -194,19 +194,19 @@ const ds = at({
|
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
196
|
renderCount: M.current,
|
|
197
|
-
willRenderChat: !!
|
|
197
|
+
willRenderChat: !!D,
|
|
198
198
|
contextValueReady: !!y
|
|
199
|
-
}), /* @__PURE__ */ s(
|
|
200
|
-
|
|
199
|
+
}), /* @__PURE__ */ s(us.Provider, { value: y, children: D ? /* @__PURE__ */ s(
|
|
200
|
+
qs,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: D,
|
|
203
203
|
customClasses: {
|
|
204
204
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
205
|
},
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, sa = () => lt(), ot = (e) => {
|
|
210
210
|
var a, r;
|
|
211
211
|
const [t, n] = B(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -228,14 +228,14 @@ const ds = at({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
231
|
+
}, na = "linktree-official", aa = "linktree-official-sender";
|
|
232
232
|
function Ue(e, t, n) {
|
|
233
233
|
const a = Object.values(e || {});
|
|
234
|
-
if (n ===
|
|
234
|
+
if (n === na) {
|
|
235
235
|
const r = a.find(
|
|
236
236
|
(i) => {
|
|
237
237
|
var l;
|
|
238
|
-
return ((l = i.user) == null ? void 0 : l.id) ===
|
|
238
|
+
return ((l = i.user) == null ? void 0 : l.id) === aa;
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
if (r) return r;
|
|
@@ -247,18 +247,18 @@ function Ue(e, t, n) {
|
|
|
247
247
|
}
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
function
|
|
252
|
-
return
|
|
250
|
+
const ra = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
251
|
+
function ia(e) {
|
|
252
|
+
return ra.test(e.trim());
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Kt(e, t) {
|
|
255
255
|
const n = e == null ? void 0 : e.trim();
|
|
256
|
-
return !n || t && n === t ? !1 : !
|
|
256
|
+
return !n || t && n === t ? !1 : !ia(n);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
function ct(e) {
|
|
259
|
+
return Kt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Kt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
260
260
|
}
|
|
261
|
-
const
|
|
261
|
+
const Jt = [
|
|
262
262
|
{ emoji: "🍎", bgColor: "#FFD1DD" },
|
|
263
263
|
// Apple
|
|
264
264
|
{ emoji: "🍌", bgColor: "#FFF1C9" },
|
|
@@ -286,7 +286,7 @@ const Kt = [
|
|
|
286
286
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
287
287
|
// Melon
|
|
288
288
|
];
|
|
289
|
-
function
|
|
289
|
+
function la(e) {
|
|
290
290
|
let t = 0;
|
|
291
291
|
for (let n = 0; n < e.length; n++) {
|
|
292
292
|
const a = e.charCodeAt(n);
|
|
@@ -294,16 +294,16 @@ function ra(e) {
|
|
|
294
294
|
}
|
|
295
295
|
return Math.abs(t);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
297
|
+
function ms(e) {
|
|
298
|
+
return Jt[la(e) % Jt.length];
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
return
|
|
300
|
+
function oa(e) {
|
|
301
|
+
return ms(e).emoji;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return
|
|
303
|
+
function ca(e) {
|
|
304
|
+
return ms(e).bgColor;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const ne = ({
|
|
307
307
|
id: e,
|
|
308
308
|
image: t,
|
|
309
309
|
size: n = 40,
|
|
@@ -312,7 +312,7 @@ const se = ({
|
|
|
312
312
|
shape: i = "squircle",
|
|
313
313
|
dmAgentEnabled: l = !1
|
|
314
314
|
}) => {
|
|
315
|
-
const o =
|
|
315
|
+
const o = oa(e), d = ca(e), u = 0.45, h = n < 32 ? Math.round(n * u) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
316
316
|
"img",
|
|
317
317
|
{
|
|
318
318
|
src: t,
|
|
@@ -376,7 +376,7 @@ const se = ({
|
|
|
376
376
|
]
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
|
-
},
|
|
379
|
+
}, da = "https://linktr.ee/s/about/trust-center/report", ua = ({
|
|
380
380
|
channel: e,
|
|
381
381
|
participant: t,
|
|
382
382
|
showBlockParticipant: n = !0,
|
|
@@ -390,53 +390,53 @@ const se = ({
|
|
|
390
390
|
logLabel: p = "useChannelModerationActions"
|
|
391
391
|
}) => {
|
|
392
392
|
var A;
|
|
393
|
-
const { service: h, debug: g } =
|
|
393
|
+
const { service: h, debug: g } = lt(), c = (A = t == null ? void 0 : t.user) == null ? void 0 : A.id, v = !!(a && n && h && c), [w, b] = B(!1), [f, x] = B(null), [N, S] = B(!1), [T, M] = B(!1), L = v && ((f == null ? void 0 : f.participantId) !== c || (f == null ? void 0 : f.service) !== h);
|
|
394
394
|
return K(() => {
|
|
395
395
|
if (!v || !h || !c) {
|
|
396
396
|
b(!1), x(null);
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
|
-
let
|
|
399
|
+
let E = !1;
|
|
400
400
|
return (async () => {
|
|
401
401
|
try {
|
|
402
402
|
const C = await h.getBlockedUsers();
|
|
403
|
-
if (
|
|
403
|
+
if (E) return;
|
|
404
404
|
b(
|
|
405
405
|
C.some(
|
|
406
406
|
(I) => I.blocked_user_id === c
|
|
407
407
|
)
|
|
408
408
|
);
|
|
409
409
|
} catch (C) {
|
|
410
|
-
|
|
410
|
+
E || console.error(`[${p}] Failed to check blocked status:`, C);
|
|
411
411
|
} finally {
|
|
412
|
-
|
|
412
|
+
E || x({ participantId: c, service: h });
|
|
413
413
|
}
|
|
414
414
|
})(), () => {
|
|
415
|
-
|
|
415
|
+
E = !0;
|
|
416
416
|
};
|
|
417
417
|
}, [v, h, c, p]), {
|
|
418
418
|
isParticipantBlocked: w,
|
|
419
|
-
isCheckingBlockedStatus:
|
|
419
|
+
isCheckingBlockedStatus: L,
|
|
420
420
|
isLeaving: N,
|
|
421
421
|
isUpdatingBlockStatus: T,
|
|
422
422
|
handleLeaveConversation: async () => {
|
|
423
|
-
var
|
|
423
|
+
var E;
|
|
424
424
|
if (!N) {
|
|
425
|
-
l == null || l(), g && console.log(`[${p}] Leave conversation`, e.cid),
|
|
425
|
+
l == null || l(), g && console.log(`[${p}] Leave conversation`, e.cid), S(!0);
|
|
426
426
|
try {
|
|
427
|
-
const C = ((
|
|
427
|
+
const C = ((E = e._client) == null ? void 0 : E.userID) ?? null;
|
|
428
428
|
await e.hide(C, !1), r && await r(e), u == null || u();
|
|
429
429
|
} catch (C) {
|
|
430
430
|
console.error(`[${p}] Failed to leave conversation`, C);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
S(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
handleBlockUser: async () => {
|
|
437
|
-
var
|
|
437
|
+
var E, C, I;
|
|
438
438
|
if (!(T || !h)) {
|
|
439
|
-
o == null || o(), g && console.log(`[${p}] Block member`, (
|
|
439
|
+
o == null || o(), g && console.log(`[${p}] Block member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), M(!0);
|
|
440
440
|
try {
|
|
441
441
|
await h.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), u == null || u();
|
|
442
442
|
} catch ($) {
|
|
@@ -447,9 +447,9 @@ const se = ({
|
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
handleUnblockUser: async () => {
|
|
450
|
-
var
|
|
450
|
+
var E, C, I;
|
|
451
451
|
if (!(T || !h)) {
|
|
452
|
-
o == null || o(), g && console.log(`[${p}] Unblock member`, (
|
|
452
|
+
o == null || o(), g && console.log(`[${p}] Unblock member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), M(!0);
|
|
453
453
|
try {
|
|
454
454
|
await h.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), u == null || u();
|
|
455
455
|
} catch ($) {
|
|
@@ -460,10 +460,10 @@ const se = ({
|
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
handleReportUser: () => {
|
|
463
|
-
d == null || d(), u == null || u(), window.open(
|
|
463
|
+
d == null || d(), u == null || u(), window.open(da, "_blank", "noopener,noreferrer");
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
|
-
},
|
|
466
|
+
}, Ne = ({
|
|
467
467
|
variant: e = "default",
|
|
468
468
|
className: t,
|
|
469
469
|
children: n,
|
|
@@ -480,7 +480,7 @@ const se = ({
|
|
|
480
480
|
...a,
|
|
481
481
|
children: n
|
|
482
482
|
}
|
|
483
|
-
),
|
|
483
|
+
), st = ({
|
|
484
484
|
channel: e,
|
|
485
485
|
participant: t,
|
|
486
486
|
showDeleteConversation: n = !0,
|
|
@@ -494,16 +494,16 @@ const se = ({
|
|
|
494
494
|
customChannelActions: p,
|
|
495
495
|
triggerClassName: h
|
|
496
496
|
}) => {
|
|
497
|
-
const [g, c] = B(!1), v = G(null), w =
|
|
497
|
+
const [g, c] = B(!1), v = G(null), w = Gs(), b = J(() => c(!1), []), {
|
|
498
498
|
isParticipantBlocked: f,
|
|
499
499
|
isCheckingBlockedStatus: x,
|
|
500
500
|
isLeaving: N,
|
|
501
|
-
isUpdatingBlockStatus:
|
|
501
|
+
isUpdatingBlockStatus: S,
|
|
502
502
|
handleLeaveConversation: T,
|
|
503
503
|
handleBlockUser: M,
|
|
504
|
-
handleUnblockUser:
|
|
505
|
-
handleReportUser:
|
|
506
|
-
} =
|
|
504
|
+
handleUnblockUser: L,
|
|
505
|
+
handleReportUser: D
|
|
506
|
+
} = ua({
|
|
507
507
|
channel: e,
|
|
508
508
|
participant: t,
|
|
509
509
|
showBlockParticipant: a,
|
|
@@ -537,7 +537,7 @@ const se = ({
|
|
|
537
537
|
"aria-controls": g ? w : void 0,
|
|
538
538
|
onClick: () => c((z) => !z),
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */ s(
|
|
540
|
+
/* @__PURE__ */ s(Mn, { className: "size-5 text-black/90" }),
|
|
541
541
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
542
542
|
]
|
|
543
543
|
}
|
|
@@ -553,13 +553,13 @@ const se = ({
|
|
|
553
553
|
),
|
|
554
554
|
children: /* @__PURE__ */ m("ul", { className: "flex flex-col gap-1", children: [
|
|
555
555
|
n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
556
|
-
|
|
556
|
+
Ne,
|
|
557
557
|
{
|
|
558
558
|
onClick: T,
|
|
559
559
|
disabled: N,
|
|
560
560
|
"aria-busy": N,
|
|
561
561
|
children: [
|
|
562
|
-
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
562
|
+
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Rn, { className: "h-5 w-5" }),
|
|
563
563
|
/* @__PURE__ */ s("span", { children: "Delete Conversation" })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
@@ -567,35 +567,35 @@ const se = ({
|
|
|
567
567
|
a && /* @__PURE__ */ s("li", { children: x ? (
|
|
568
568
|
// Block status not yet resolved — show a disabled placeholder
|
|
569
569
|
// so a premature click can't act on a stale block state.
|
|
570
|
-
/* @__PURE__ */ m(
|
|
570
|
+
/* @__PURE__ */ m(Ne, { disabled: !0, "aria-busy": !0, children: [
|
|
571
571
|
/* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }),
|
|
572
572
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
573
573
|
] })
|
|
574
574
|
) : f ? /* @__PURE__ */ m(
|
|
575
|
-
|
|
575
|
+
Ne,
|
|
576
576
|
{
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
"aria-busy":
|
|
577
|
+
onClick: L,
|
|
578
|
+
disabled: S,
|
|
579
|
+
"aria-busy": S,
|
|
580
580
|
children: [
|
|
581
|
-
|
|
581
|
+
S ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
|
|
582
582
|
/* @__PURE__ */ s("span", { children: "Unblock" })
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) : /* @__PURE__ */ m(
|
|
586
|
-
|
|
586
|
+
Ne,
|
|
587
587
|
{
|
|
588
588
|
onClick: M,
|
|
589
|
-
disabled:
|
|
590
|
-
"aria-busy":
|
|
589
|
+
disabled: S,
|
|
590
|
+
"aria-busy": S,
|
|
591
591
|
children: [
|
|
592
|
-
|
|
592
|
+
S ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
|
|
593
593
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
) }),
|
|
597
|
-
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
598
|
-
/* @__PURE__ */ s(
|
|
597
|
+
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(Ne, { variant: "danger", onClick: D, children: [
|
|
598
|
+
/* @__PURE__ */ s(ls, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ s("span", { children: "Report" })
|
|
600
600
|
] }) }),
|
|
601
601
|
p
|
|
@@ -603,10 +603,10 @@ const se = ({
|
|
|
603
603
|
}
|
|
604
604
|
)
|
|
605
605
|
] });
|
|
606
|
-
}, We = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring",
|
|
606
|
+
}, We = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", ma = "CUSTOMER_PAID", ha = "Replies instantly with AI assistant", fa = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ma, ga = (e) => {
|
|
607
607
|
const t = e;
|
|
608
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(
|
|
609
|
-
},
|
|
608
|
+
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(fa);
|
|
609
|
+
}, pa = ({
|
|
610
610
|
onBack: e,
|
|
611
611
|
showBackButton: t,
|
|
612
612
|
showStarButton: n = !1,
|
|
@@ -624,8 +624,8 @@ const se = ({
|
|
|
624
624
|
showChannelInfo: v = !0,
|
|
625
625
|
onParticipantNameClick: w
|
|
626
626
|
}) => {
|
|
627
|
-
var
|
|
628
|
-
const { channel: b } =
|
|
627
|
+
var D, O, z;
|
|
628
|
+
const { channel: b } = le(), { client: f } = oe(), x = U.useMemo(
|
|
629
629
|
() => {
|
|
630
630
|
var y;
|
|
631
631
|
return Ue(
|
|
@@ -634,8 +634,8 @@ const se = ({
|
|
|
634
634
|
b.type
|
|
635
635
|
);
|
|
636
636
|
},
|
|
637
|
-
[(
|
|
638
|
-
), N =
|
|
637
|
+
[(D = b.state) == null ? void 0 : D.members, f == null ? void 0 : f.userID, b.type]
|
|
638
|
+
), N = ct(x == null ? void 0 : x.user), S = (O = x == null ? void 0 : x.user) == null ? void 0 : O.image, T = ot(b), M = ga(x), L = async () => {
|
|
639
639
|
try {
|
|
640
640
|
T ? await b.unpin() : await b.pin();
|
|
641
641
|
} catch (y) {
|
|
@@ -657,7 +657,7 @@ const se = ({
|
|
|
657
657
|
}),
|
|
658
658
|
type: "button",
|
|
659
659
|
"aria-label": "Back to conversations",
|
|
660
|
-
children: /* @__PURE__ */ s(
|
|
660
|
+
children: /* @__PURE__ */ s(et, { className: "size-5 text-black/90" })
|
|
661
661
|
}
|
|
662
662
|
) }),
|
|
663
663
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: /* @__PURE__ */ m(
|
|
@@ -669,11 +669,11 @@ const se = ({
|
|
|
669
669
|
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ s(
|
|
672
|
-
|
|
672
|
+
ne,
|
|
673
673
|
{
|
|
674
674
|
id: ((z = x == null ? void 0 : x.user) == null ? void 0 : z.id) || b.id || "unknown",
|
|
675
675
|
name: N,
|
|
676
|
-
image:
|
|
676
|
+
image: S,
|
|
677
677
|
dmAgentEnabled: a,
|
|
678
678
|
shape: "circle",
|
|
679
679
|
size: 48,
|
|
@@ -689,7 +689,7 @@ const se = ({
|
|
|
689
689
|
{
|
|
690
690
|
"aria-label": "Paid customer",
|
|
691
691
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
692
|
-
children: /* @__PURE__ */ s(
|
|
692
|
+
children: /* @__PURE__ */ s(Dn, { className: "size-2.5", weight: "bold" })
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
695
|
n && T && /* @__PURE__ */ s(
|
|
@@ -712,7 +712,7 @@ const se = ({
|
|
|
712
712
|
] }),
|
|
713
713
|
a && /* @__PURE__ */ m("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
714
714
|
/* @__PURE__ */ s(xe, { className: "size-3 shrink-0 text-black/55" }),
|
|
715
|
-
/* @__PURE__ */ s("span", { children:
|
|
715
|
+
/* @__PURE__ */ s("span", { children: ha })
|
|
716
716
|
] })
|
|
717
717
|
] })
|
|
718
718
|
]
|
|
@@ -723,7 +723,7 @@ const se = ({
|
|
|
723
723
|
"button",
|
|
724
724
|
{
|
|
725
725
|
className: We,
|
|
726
|
-
onClick:
|
|
726
|
+
onClick: L,
|
|
727
727
|
type: "button",
|
|
728
728
|
"aria-pressed": T,
|
|
729
729
|
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
@@ -740,7 +740,7 @@ const se = ({
|
|
|
740
740
|
}
|
|
741
741
|
),
|
|
742
742
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
743
|
-
|
|
743
|
+
st,
|
|
744
744
|
{
|
|
745
745
|
channel: b,
|
|
746
746
|
participant: x,
|
|
@@ -758,20 +758,20 @@ const se = ({
|
|
|
758
758
|
))
|
|
759
759
|
] })
|
|
760
760
|
] }) });
|
|
761
|
-
},
|
|
762
|
-
function
|
|
763
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
761
|
+
}, ba = (e) => /* @__PURE__ */ s(Ws, { ...e, position: "center" }), nt = "vote_up", at = "vote_down";
|
|
762
|
+
function va(e) {
|
|
763
|
+
return e != null && e.length ? e.some((t) => t.type === at) ? "down" : e.some((t) => t.type === nt) ? "up" : null : null;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
const { channel: t } =
|
|
767
|
-
() =>
|
|
765
|
+
function xa(e) {
|
|
766
|
+
const { channel: t } = le(), { client: n } = oe("useMessageVote"), a = se(
|
|
767
|
+
() => va(e.own_reactions),
|
|
768
768
|
[e.own_reactions]
|
|
769
769
|
), r = J(async () => {
|
|
770
770
|
if (n != null && n.userID)
|
|
771
771
|
try {
|
|
772
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
772
|
+
a === "up" ? await t.deleteReaction(e.id, nt) : await t.sendReaction(
|
|
773
773
|
e.id,
|
|
774
|
-
{ type:
|
|
774
|
+
{ type: nt },
|
|
775
775
|
{ enforce_unique: !0, skip_push: !0 }
|
|
776
776
|
);
|
|
777
777
|
} catch {
|
|
@@ -779,9 +779,9 @@ function ba(e) {
|
|
|
779
779
|
}, [t, n == null ? void 0 : n.userID, e.id, a]), i = J(async () => {
|
|
780
780
|
if (n != null && n.userID)
|
|
781
781
|
try {
|
|
782
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
782
|
+
a === "down" ? await t.deleteReaction(e.id, at) : await t.sendReaction(
|
|
783
783
|
e.id,
|
|
784
|
-
{ type:
|
|
784
|
+
{ type: at },
|
|
785
785
|
{ enforce_unique: !0, skip_push: !0 }
|
|
786
786
|
);
|
|
787
787
|
} catch {
|
|
@@ -789,24 +789,24 @@ function ba(e) {
|
|
|
789
789
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
790
790
|
return { selected: a, voteUp: r, voteDown: i };
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function wa(e) {
|
|
793
793
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function hs({
|
|
796
796
|
message: e,
|
|
797
797
|
viewerLanguage: t
|
|
798
798
|
}) {
|
|
799
799
|
var r;
|
|
800
|
-
const n = e == null ? void 0 : e.text, a =
|
|
800
|
+
const n = e == null ? void 0 : e.text, a = wa(t);
|
|
801
801
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
802
802
|
}
|
|
803
|
-
const
|
|
803
|
+
const _a = U.lazy(() => import("./Card-iGNcxybY.js")), Na = U.lazy(() => import("./Card-0wf8lj5n.js")), ya = U.lazy(() => import("./Card-RZ6C_IkE.js")), dt = () => /* @__PURE__ */ s(
|
|
804
804
|
"div",
|
|
805
805
|
{
|
|
806
806
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
807
807
|
"aria-hidden": !0
|
|
808
808
|
}
|
|
809
|
-
),
|
|
809
|
+
), ka = (e) => /* @__PURE__ */ s(it, { fallback: /* @__PURE__ */ s(dt, {}), children: /* @__PURE__ */ s(_a, { ...e }) }), fs = (e) => /* @__PURE__ */ s(it, { fallback: /* @__PURE__ */ s(dt, {}), children: /* @__PURE__ */ s(Na, { ...e }) }), gs = (e) => /* @__PURE__ */ s(it, { fallback: /* @__PURE__ */ s(dt, {}), children: /* @__PURE__ */ s(ya, { ...e }) }), Ca = fs, Sa = gs, Zt = { Composer: ka, Sent: fs, Received: gs, Creator: Ca, Visitor: Sa }, Ea = [
|
|
810
810
|
[/pdf/, "pdf"],
|
|
811
811
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
812
812
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -816,42 +816,42 @@ const xa = U.lazy(() => import("./Card-CqEKHw9S.js")), wa = U.lazy(() => import(
|
|
|
816
816
|
[/plain|rtf/, "text"],
|
|
817
817
|
[/markdown/, "markdown"]
|
|
818
818
|
];
|
|
819
|
-
function
|
|
819
|
+
function ce(e) {
|
|
820
820
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
const t =
|
|
822
|
+
function ps(e) {
|
|
823
|
+
const t = Ea.find(
|
|
824
824
|
([n]) => n.test(e)
|
|
825
825
|
);
|
|
826
826
|
return t ? t[1] : "generic";
|
|
827
827
|
}
|
|
828
|
-
const
|
|
829
|
-
video:
|
|
830
|
-
audio:
|
|
831
|
-
image:
|
|
832
|
-
document:
|
|
833
|
-
},
|
|
834
|
-
pdf:
|
|
835
|
-
doc:
|
|
836
|
-
xls:
|
|
837
|
-
csv:
|
|
838
|
-
ppt:
|
|
839
|
-
zip:
|
|
840
|
-
text:
|
|
841
|
-
markdown:
|
|
842
|
-
generic:
|
|
828
|
+
const Ia = {
|
|
829
|
+
video: cs,
|
|
830
|
+
audio: zn,
|
|
831
|
+
image: Ln,
|
|
832
|
+
document: os
|
|
833
|
+
}, Ta = {
|
|
834
|
+
pdf: Vn,
|
|
835
|
+
doc: Un,
|
|
836
|
+
xls: Bn,
|
|
837
|
+
csv: jn,
|
|
838
|
+
ppt: $n,
|
|
839
|
+
zip: On,
|
|
840
|
+
text: Fn,
|
|
841
|
+
markdown: Pn,
|
|
842
|
+
generic: os
|
|
843
843
|
};
|
|
844
|
-
function
|
|
845
|
-
const t =
|
|
846
|
-
return t !== "document" ?
|
|
844
|
+
function Aa(e) {
|
|
845
|
+
const t = ce(e);
|
|
846
|
+
return t !== "document" ? Ia[t] : Ta[ps(e)];
|
|
847
847
|
}
|
|
848
848
|
function we(e, t) {
|
|
849
|
-
return U.createElement(
|
|
849
|
+
return U.createElement(Aa(e), t);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
851
|
+
const Ma = (e) => {
|
|
852
852
|
var t, n;
|
|
853
853
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
|
|
854
|
-
},
|
|
854
|
+
}, Ra = ({
|
|
855
855
|
source: e,
|
|
856
856
|
mimeType: t,
|
|
857
857
|
poster: n,
|
|
@@ -863,21 +863,21 @@ const Ta = (e) => {
|
|
|
863
863
|
muted: d = !1,
|
|
864
864
|
onContainerClick: u
|
|
865
865
|
}) => {
|
|
866
|
-
const p =
|
|
867
|
-
|
|
866
|
+
const p = ce(t), h = G(null), g = G(null), c = G(null), v = G(r), [w, b] = B(a), [f, x] = B(0), [N, S] = B(!1), [T, M] = B(!1), [L, D] = B(!1), [O, z] = B(!1), [y, A] = B(!0), [E, C] = B(null), I = J(() => {
|
|
867
|
+
D(!1), b(!0);
|
|
868
868
|
}, []), $ = J((_) => {
|
|
869
869
|
const R = g.current;
|
|
870
870
|
if (!R) return 0;
|
|
871
871
|
const H = R.getBoundingClientRect();
|
|
872
872
|
return Math.max(
|
|
873
873
|
0,
|
|
874
|
-
Math.min(1, (
|
|
874
|
+
Math.min(1, (Ma(_) - H.left) / H.width)
|
|
875
875
|
);
|
|
876
876
|
}, []), F = J((_) => {
|
|
877
877
|
const R = h.current;
|
|
878
878
|
R && R.duration && (R.currentTime = _ * R.duration);
|
|
879
879
|
}, []), V = (_) => {
|
|
880
|
-
_.stopPropagation(),
|
|
880
|
+
_.stopPropagation(), S(!0);
|
|
881
881
|
const R = $(_);
|
|
882
882
|
x(R), F(R);
|
|
883
883
|
};
|
|
@@ -898,31 +898,31 @@ const Ta = (e) => {
|
|
|
898
898
|
}, [w, N]), K(() => {
|
|
899
899
|
const _ = h.current;
|
|
900
900
|
_ && (w ? _.play().catch((R) => {
|
|
901
|
-
b(!1),
|
|
901
|
+
b(!1), D(!0);
|
|
902
902
|
}) : _.pause());
|
|
903
903
|
}, [w]), K(() => {
|
|
904
904
|
if (!N) return;
|
|
905
905
|
const _ = (H) => x($(H)), R = (H) => {
|
|
906
|
-
|
|
906
|
+
S(!1), F($(H));
|
|
907
907
|
};
|
|
908
908
|
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", R), window.addEventListener("touchmove", _, { passive: !0 }), window.addEventListener("touchend", R), () => {
|
|
909
909
|
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", R), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", R);
|
|
910
910
|
};
|
|
911
911
|
}, [N, $, F]);
|
|
912
|
-
const Q =
|
|
912
|
+
const Q = E ? { aspectRatio: String(E) } : void 0, te = E ? "" : " aspect-video", X = Math.round(f * 100);
|
|
913
913
|
return /* @__PURE__ */ m(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
role: "button",
|
|
917
917
|
tabIndex: 0,
|
|
918
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
918
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${te}`,
|
|
919
919
|
style: Q,
|
|
920
920
|
onClick: (_) => {
|
|
921
921
|
if (u) {
|
|
922
922
|
u(_);
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
L || l && b((R) => !R);
|
|
926
926
|
},
|
|
927
927
|
onKeyDown: (_) => {
|
|
928
928
|
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
@@ -930,7 +930,7 @@ const Ta = (e) => {
|
|
|
930
930
|
u(_);
|
|
931
931
|
return;
|
|
932
932
|
}
|
|
933
|
-
|
|
933
|
+
L || l && b((R) => !R);
|
|
934
934
|
}
|
|
935
935
|
},
|
|
936
936
|
children: [
|
|
@@ -959,7 +959,7 @@ const Ta = (e) => {
|
|
|
959
959
|
z(!1), A(!1);
|
|
960
960
|
},
|
|
961
961
|
onWaiting: () => z(!0),
|
|
962
|
-
onPlay: () =>
|
|
962
|
+
onPlay: () => D(!1),
|
|
963
963
|
onEnded: () => {
|
|
964
964
|
i || (b(!1), x(0));
|
|
965
965
|
},
|
|
@@ -979,7 +979,7 @@ const Ta = (e) => {
|
|
|
979
979
|
z(!1), A(!1);
|
|
980
980
|
},
|
|
981
981
|
onWaiting: () => z(!0),
|
|
982
|
-
onPlay: () =>
|
|
982
|
+
onPlay: () => D(!1),
|
|
983
983
|
onLoadedMetadata: () => {
|
|
984
984
|
const _ = h.current;
|
|
985
985
|
_ instanceof HTMLVideoElement && _.videoWidth && _.videoHeight && C(_.videoWidth / _.videoHeight);
|
|
@@ -990,14 +990,14 @@ const Ta = (e) => {
|
|
|
990
990
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
991
991
|
}
|
|
992
992
|
) }),
|
|
993
|
-
O && !
|
|
994
|
-
|
|
993
|
+
O && !L && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
994
|
+
Ce,
|
|
995
995
|
{
|
|
996
996
|
className: "size-8 animate-spin text-white/80",
|
|
997
997
|
weight: "bold"
|
|
998
998
|
}
|
|
999
999
|
) }),
|
|
1000
|
-
|
|
1000
|
+
L && !l && /* @__PURE__ */ s(
|
|
1001
1001
|
"div",
|
|
1002
1002
|
{
|
|
1003
1003
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1010,7 +1010,7 @@ const Ta = (e) => {
|
|
|
1010
1010
|
onKeyDown: (_) => {
|
|
1011
1011
|
_.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), I());
|
|
1012
1012
|
},
|
|
1013
|
-
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(
|
|
1013
|
+
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(tt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1014
1014
|
}
|
|
1015
1015
|
),
|
|
1016
1016
|
o && !l && /* @__PURE__ */ s("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ s(
|
|
@@ -1049,7 +1049,7 @@ const Ta = (e) => {
|
|
|
1049
1049
|
},
|
|
1050
1050
|
className: "shrink-0 text-white",
|
|
1051
1051
|
"aria-label": w ? "Pause" : "Play",
|
|
1052
|
-
children: w ? /* @__PURE__ */ s(
|
|
1052
|
+
children: w ? /* @__PURE__ */ s(Gn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(tt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1053
1053
|
}
|
|
1054
1054
|
),
|
|
1055
1055
|
/* @__PURE__ */ m(
|
|
@@ -1099,7 +1099,7 @@ const Ta = (e) => {
|
|
|
1099
1099
|
]
|
|
1100
1100
|
}
|
|
1101
1101
|
);
|
|
1102
|
-
},
|
|
1102
|
+
}, Qt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Da = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", bs = ({
|
|
1103
1103
|
mimeType: e,
|
|
1104
1104
|
sourceUrl: t,
|
|
1105
1105
|
thumbnailUrl: n,
|
|
@@ -1108,9 +1108,9 @@ const Ta = (e) => {
|
|
|
1108
1108
|
mediaPlayerProps: i,
|
|
1109
1109
|
containedImage: l = !1
|
|
1110
1110
|
}) => {
|
|
1111
|
-
const o =
|
|
1111
|
+
const o = ce(e), [d, u] = B(!1);
|
|
1112
1112
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ s(
|
|
1113
|
-
|
|
1113
|
+
Ra,
|
|
1114
1114
|
{
|
|
1115
1115
|
source: t,
|
|
1116
1116
|
mimeType: e,
|
|
@@ -1157,11 +1157,11 @@ const Ta = (e) => {
|
|
|
1157
1157
|
{
|
|
1158
1158
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1159
1159
|
children: we(e, {
|
|
1160
|
-
className:
|
|
1160
|
+
className: Qt(r),
|
|
1161
1161
|
weight: "regular"
|
|
1162
1162
|
})
|
|
1163
1163
|
}
|
|
1164
|
-
) : n ? /* @__PURE__ */ s("div", { className: `relative ${
|
|
1164
|
+
) : n ? /* @__PURE__ */ s("div", { className: `relative ${Da(r)}`, children: /* @__PURE__ */ s(
|
|
1165
1165
|
"img",
|
|
1166
1166
|
{
|
|
1167
1167
|
src: n,
|
|
@@ -1174,12 +1174,12 @@ const Ta = (e) => {
|
|
|
1174
1174
|
{
|
|
1175
1175
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1176
1176
|
children: we(e, {
|
|
1177
|
-
className:
|
|
1177
|
+
className: Qt(r),
|
|
1178
1178
|
weight: "regular"
|
|
1179
1179
|
})
|
|
1180
1180
|
}
|
|
1181
1181
|
);
|
|
1182
|
-
},
|
|
1182
|
+
}, vs = ({
|
|
1183
1183
|
variant: e,
|
|
1184
1184
|
thumbnail: t,
|
|
1185
1185
|
title: n,
|
|
@@ -1245,28 +1245,28 @@ const Ta = (e) => {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
);
|
|
1247
1247
|
};
|
|
1248
|
-
function
|
|
1248
|
+
function xs(e) {
|
|
1249
1249
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1250
1250
|
}
|
|
1251
|
-
function
|
|
1251
|
+
function ut(e) {
|
|
1252
1252
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function La(e) {
|
|
1255
1255
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function za(e) {
|
|
1258
1258
|
return e ? "text-white" : "text-black";
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function Pa(e) {
|
|
1261
1261
|
return e ? "text-white/55" : "text-black/55";
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function Fa(e) {
|
|
1264
1264
|
return e ? "text-white/40" : "text-black/40";
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Oa(e) {
|
|
1267
1267
|
return e ? "text-white/20" : "text-black/20";
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const mt = ({ attachment: e, isMyMessage: t }) => {
|
|
1270
1270
|
const { title: n, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ m(U.Fragment, { children: [
|
|
1271
1271
|
/* @__PURE__ */ s("div", { className: "p-2", children: r ? /* @__PURE__ */ s(
|
|
1272
1272
|
"img",
|
|
@@ -1278,26 +1278,26 @@ const ut = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1278
1278
|
) : /* @__PURE__ */ s(
|
|
1279
1279
|
"div",
|
|
1280
1280
|
{
|
|
1281
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1282
|
-
children: /* @__PURE__ */ s(
|
|
1281
|
+
className: `aspect-video w-full rounded-[20px] ${La(t)} flex items-center justify-center`,
|
|
1282
|
+
children: /* @__PURE__ */ s(Hn, { className: `size-12 ${Oa(t)}` })
|
|
1283
1283
|
}
|
|
1284
1284
|
) }),
|
|
1285
1285
|
/* @__PURE__ */ m("div", { className: "px-3 pb-3", children: [
|
|
1286
|
-
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1287
|
-
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${
|
|
1288
|
-
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1286
|
+
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${za(t)}`, children: n }),
|
|
1287
|
+
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Pa(t)}`, children: a }),
|
|
1288
|
+
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Fa(t)}`, children: d })
|
|
1289
1289
|
] })
|
|
1290
1290
|
] });
|
|
1291
1291
|
return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ s("div", { className: "block", children: u });
|
|
1292
1292
|
};
|
|
1293
|
-
function
|
|
1293
|
+
function ws(e) {
|
|
1294
1294
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function ht(e) {
|
|
1297
1297
|
var t;
|
|
1298
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1298
|
+
return (t = e.attachments) == null ? void 0 : t.find(ws);
|
|
1299
1299
|
}
|
|
1300
|
-
async function
|
|
1300
|
+
async function $a(e, t) {
|
|
1301
1301
|
let n;
|
|
1302
1302
|
try {
|
|
1303
1303
|
n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1309,7 +1309,7 @@ async function Fa(e, t) {
|
|
|
1309
1309
|
const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
1310
1310
|
l.href = i, l.download = n, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1312
|
+
const ja = ({
|
|
1313
1313
|
url: e,
|
|
1314
1314
|
filename: t
|
|
1315
1315
|
}) => {
|
|
@@ -1321,7 +1321,7 @@ const Oa = ({
|
|
|
1321
1321
|
onClick: (i) => {
|
|
1322
1322
|
i.stopPropagation();
|
|
1323
1323
|
const l = window.open("", "_blank", "noopener,noreferrer");
|
|
1324
|
-
a(!0),
|
|
1324
|
+
a(!0), $a(e, t).then(() => {
|
|
1325
1325
|
l == null || l.close();
|
|
1326
1326
|
}).catch(() => {
|
|
1327
1327
|
l && (l.location.href = e);
|
|
@@ -1329,14 +1329,14 @@ const Oa = ({
|
|
|
1329
1329
|
},
|
|
1330
1330
|
disabled: n,
|
|
1331
1331
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1332
|
-
children: n ? /* @__PURE__ */ s(
|
|
1333
|
-
/* @__PURE__ */ s(
|
|
1332
|
+
children: n ? /* @__PURE__ */ s(Ce, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(U.Fragment, { children: [
|
|
1333
|
+
/* @__PURE__ */ s(Se, { className: "size-4 text-white", weight: "bold" }),
|
|
1334
1334
|
"Download"
|
|
1335
1335
|
] })
|
|
1336
1336
|
}
|
|
1337
1337
|
);
|
|
1338
1338
|
};
|
|
1339
|
-
function
|
|
1339
|
+
function ft(e) {
|
|
1340
1340
|
var h, g, c, v;
|
|
1341
1341
|
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1342
1342
|
(w) => w.type === "video" && w.asset_url
|
|
@@ -1357,16 +1357,16 @@ function ht(e) {
|
|
|
1357
1357
|
thumbnailUrl: p
|
|
1358
1358
|
};
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1360
|
+
const _s = ({
|
|
1361
1361
|
resolvedUrl: e,
|
|
1362
1362
|
resolvedType: t,
|
|
1363
1363
|
title: n,
|
|
1364
1364
|
fileSize: a,
|
|
1365
1365
|
thumbnailUrl: r
|
|
1366
1366
|
}) => {
|
|
1367
|
-
const i = a !== void 0 ?
|
|
1367
|
+
const i = a !== void 0 ? xs(a) : void 0;
|
|
1368
1368
|
return /* @__PURE__ */ s(
|
|
1369
|
-
|
|
1369
|
+
vs,
|
|
1370
1370
|
{
|
|
1371
1371
|
variant: "dark",
|
|
1372
1372
|
title: n,
|
|
@@ -1374,7 +1374,7 @@ const ws = ({
|
|
|
1374
1374
|
mimeType: t,
|
|
1375
1375
|
detail: i,
|
|
1376
1376
|
thumbnail: /* @__PURE__ */ s(
|
|
1377
|
-
|
|
1377
|
+
bs,
|
|
1378
1378
|
{
|
|
1379
1379
|
mimeType: t,
|
|
1380
1380
|
sourceUrl: e,
|
|
@@ -1385,23 +1385,23 @@ const ws = ({
|
|
|
1385
1385
|
)
|
|
1386
1386
|
}
|
|
1387
1387
|
);
|
|
1388
|
-
},
|
|
1388
|
+
}, Ns = ({
|
|
1389
1389
|
resolvedUrl: e,
|
|
1390
1390
|
resolvedType: t,
|
|
1391
1391
|
title: n,
|
|
1392
1392
|
fileSize: a,
|
|
1393
1393
|
thumbnailUrl: r
|
|
1394
1394
|
}) => {
|
|
1395
|
-
const i =
|
|
1395
|
+
const i = ce(t), l = a !== void 0 ? xs(a) : void 0;
|
|
1396
1396
|
return /* @__PURE__ */ s(
|
|
1397
|
-
|
|
1397
|
+
vs,
|
|
1398
1398
|
{
|
|
1399
1399
|
variant: "light",
|
|
1400
1400
|
title: n,
|
|
1401
1401
|
mimeType: t,
|
|
1402
1402
|
detail: l,
|
|
1403
1403
|
thumbnail: /* @__PURE__ */ s(
|
|
1404
|
-
|
|
1404
|
+
bs,
|
|
1405
1405
|
{
|
|
1406
1406
|
mimeType: t,
|
|
1407
1407
|
sourceUrl: e,
|
|
@@ -1411,17 +1411,17 @@ const ws = ({
|
|
|
1411
1411
|
containedImage: i === "image" || i === "document"
|
|
1412
1412
|
}
|
|
1413
1413
|
),
|
|
1414
|
-
action: /* @__PURE__ */ s(
|
|
1414
|
+
action: /* @__PURE__ */ s(ja, { url: e, filename: n })
|
|
1415
1415
|
}
|
|
1416
1416
|
);
|
|
1417
|
-
},
|
|
1417
|
+
}, Ba = ({
|
|
1418
1418
|
message: e,
|
|
1419
1419
|
isMyMessage: t = !1
|
|
1420
1420
|
}) => {
|
|
1421
|
-
const n =
|
|
1421
|
+
const n = ht(e), a = ft(e);
|
|
1422
1422
|
return !n && !a ? null : /* @__PURE__ */ m("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1423
1423
|
!t && e.user && /* @__PURE__ */ s(
|
|
1424
|
-
|
|
1424
|
+
ne,
|
|
1425
1425
|
{
|
|
1426
1426
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1427
1427
|
id: e.user.id,
|
|
@@ -1439,41 +1439,41 @@ const ws = ({
|
|
|
1439
1439
|
{
|
|
1440
1440
|
className: "str-chat__message-bubble",
|
|
1441
1441
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1442
|
-
children: n ? /* @__PURE__ */ s("div", { className:
|
|
1442
|
+
children: n ? /* @__PURE__ */ s("div", { className: ut(t), children: /* @__PURE__ */ s(mt, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(_s, { ...a }) : /* @__PURE__ */ s(Ns, { ...a })
|
|
1443
1443
|
}
|
|
1444
1444
|
) })
|
|
1445
1445
|
}
|
|
1446
1446
|
)
|
|
1447
1447
|
] });
|
|
1448
|
-
},
|
|
1448
|
+
}, Ua = ({
|
|
1449
1449
|
message: e
|
|
1450
1450
|
}) => {
|
|
1451
|
-
const t =
|
|
1451
|
+
const t = ht(e);
|
|
1452
1452
|
if (t)
|
|
1453
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1454
|
-
const n =
|
|
1455
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1456
|
-
},
|
|
1453
|
+
return /* @__PURE__ */ s("div", { className: ut(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(mt, { attachment: t, isMyMessage: !0 }) });
|
|
1454
|
+
const n = ft(e);
|
|
1455
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(_s, { ...n }) }) : null;
|
|
1456
|
+
}, Va = ({
|
|
1457
1457
|
message: e
|
|
1458
1458
|
}) => {
|
|
1459
|
-
const t =
|
|
1459
|
+
const t = ht(e);
|
|
1460
1460
|
if (t)
|
|
1461
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1462
|
-
const n =
|
|
1463
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1464
|
-
},
|
|
1465
|
-
Creator:
|
|
1466
|
-
Visitor:
|
|
1467
|
-
}),
|
|
1461
|
+
return /* @__PURE__ */ s("div", { className: ut(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(mt, { attachment: t, isMyMessage: !1 }) });
|
|
1462
|
+
const n = ft(e);
|
|
1463
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(Ns, { ...n }) }) : null;
|
|
1464
|
+
}, ul = Object.assign(Ba, {
|
|
1465
|
+
Creator: Ua,
|
|
1466
|
+
Visitor: Va
|
|
1467
|
+
}), Ga = {
|
|
1468
1468
|
dark: "bg-[#121110]",
|
|
1469
1469
|
light: "bg-[#e9eaed]"
|
|
1470
|
-
},
|
|
1470
|
+
}, Ha = {
|
|
1471
1471
|
dark: "text-white",
|
|
1472
1472
|
light: "text-[#080707]"
|
|
1473
|
-
},
|
|
1473
|
+
}, Ya = {
|
|
1474
1474
|
dark: "border-white/[0.08]",
|
|
1475
1475
|
light: "border-black/[0.08]"
|
|
1476
|
-
},
|
|
1476
|
+
}, qa = (e) => e === "dark" ? "sender" : "receiver", Wa = {
|
|
1477
1477
|
sender: {
|
|
1478
1478
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1479
1479
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1495,7 +1495,7 @@ const ws = ({
|
|
|
1495
1495
|
children: i,
|
|
1496
1496
|
"data-testid": l
|
|
1497
1497
|
}) => {
|
|
1498
|
-
const o = t != null && t !== "", d =
|
|
1498
|
+
const o = t != null && t !== "", d = Wa[qa(e)][a];
|
|
1499
1499
|
return /* @__PURE__ */ m(
|
|
1500
1500
|
"div",
|
|
1501
1501
|
{
|
|
@@ -1510,10 +1510,10 @@ const ws = ({
|
|
|
1510
1510
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1511
1511
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1512
1512
|
d,
|
|
1513
|
-
|
|
1514
|
-
|
|
1513
|
+
Ga[e],
|
|
1514
|
+
Ha[e],
|
|
1515
1515
|
n && "border",
|
|
1516
|
-
n &&
|
|
1516
|
+
n && Ya[e],
|
|
1517
1517
|
r
|
|
1518
1518
|
),
|
|
1519
1519
|
children: [
|
|
@@ -1556,16 +1556,16 @@ const ws = ({
|
|
|
1556
1556
|
),
|
|
1557
1557
|
children: /* @__PURE__ */ s(Be, { className: "size-3", weight: "bold" })
|
|
1558
1558
|
}
|
|
1559
|
-
), Me = (e) => e === "received" ? "light" : "dark",
|
|
1559
|
+
), Me = (e) => e === "received" ? "light" : "dark", Xa = ({
|
|
1560
1560
|
firstOfGroup: e,
|
|
1561
1561
|
endOfGroup: t,
|
|
1562
1562
|
groupedByUser: n
|
|
1563
|
-
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1563
|
+
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ka = ({
|
|
1564
1564
|
src: e,
|
|
1565
1565
|
mimeType: t,
|
|
1566
1566
|
filename: n,
|
|
1567
1567
|
items: a
|
|
1568
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [],
|
|
1568
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Ja = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1569
1569
|
/* @__PURE__ */ s(
|
|
1570
1570
|
"audio",
|
|
1571
1571
|
{
|
|
@@ -1577,7 +1577,7 @@ const ws = ({
|
|
|
1577
1577
|
}
|
|
1578
1578
|
),
|
|
1579
1579
|
n ?? null
|
|
1580
|
-
] }),
|
|
1580
|
+
] }), gt = ({
|
|
1581
1581
|
state: e,
|
|
1582
1582
|
src: t,
|
|
1583
1583
|
mimeType: n,
|
|
@@ -1588,7 +1588,7 @@ const ws = ({
|
|
|
1588
1588
|
preload: o,
|
|
1589
1589
|
onDismiss: d
|
|
1590
1590
|
}) => {
|
|
1591
|
-
const u = Me(e), p = e === "composer" && !!d, h =
|
|
1591
|
+
const u = Me(e), p = e === "composer" && !!d, h = Ka({ src: t, mimeType: n, filename: a, items: r });
|
|
1592
1592
|
if (h.length === 0)
|
|
1593
1593
|
return null;
|
|
1594
1594
|
const g = o ?? (h.length > 1 ? "none" : "metadata");
|
|
@@ -1600,7 +1600,7 @@ const ws = ({
|
|
|
1600
1600
|
groupPosition: l,
|
|
1601
1601
|
"data-testid": "audio-attachment",
|
|
1602
1602
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, v) => /* @__PURE__ */ s(
|
|
1603
|
-
|
|
1603
|
+
Ja,
|
|
1604
1604
|
{
|
|
1605
1605
|
item: c,
|
|
1606
1606
|
preload: g,
|
|
@@ -1614,15 +1614,15 @@ const ws = ({
|
|
|
1614
1614
|
)) })
|
|
1615
1615
|
}
|
|
1616
1616
|
);
|
|
1617
|
-
},
|
|
1618
|
-
Composer:
|
|
1619
|
-
Sent:
|
|
1620
|
-
Received:
|
|
1617
|
+
}, Za = (e) => /* @__PURE__ */ s(gt, { ...e, state: "composer" }), Qa = (e) => /* @__PURE__ */ s(gt, { ...e, state: "sent" }), er = (e) => /* @__PURE__ */ s(gt, { ...e, state: "received" }), tr = {
|
|
1618
|
+
Composer: Za,
|
|
1619
|
+
Sent: Qa,
|
|
1620
|
+
Received: er
|
|
1621
1621
|
};
|
|
1622
|
-
function
|
|
1622
|
+
function sr(e) {
|
|
1623
1623
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1625
|
+
const nr = {
|
|
1626
1626
|
pdf: "PDF",
|
|
1627
1627
|
doc: "DOC",
|
|
1628
1628
|
xls: "XLS",
|
|
@@ -1632,7 +1632,7 @@ const tr = {
|
|
|
1632
1632
|
text: "TXT",
|
|
1633
1633
|
markdown: "MD"
|
|
1634
1634
|
};
|
|
1635
|
-
function
|
|
1635
|
+
function ar(e, t) {
|
|
1636
1636
|
if (t) {
|
|
1637
1637
|
const r = t.lastIndexOf(".");
|
|
1638
1638
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1641,8 +1641,8 @@ function sr(e, t) {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
if (!e) return;
|
|
1644
|
-
if (
|
|
1645
|
-
const r =
|
|
1644
|
+
if (ce(e) === "document") {
|
|
1645
|
+
const r = ps(e), i = nr[r];
|
|
1646
1646
|
if (i) return i;
|
|
1647
1647
|
if (e === "application/octet-stream") return;
|
|
1648
1648
|
}
|
|
@@ -1650,8 +1650,8 @@ function sr(e, t) {
|
|
|
1650
1650
|
if (!(!a || a === "*"))
|
|
1651
1651
|
return a.toUpperCase();
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1654
|
-
const a =
|
|
1653
|
+
function rr(e, t, n) {
|
|
1654
|
+
const a = ar(e, t), r = typeof n == "number" && n > 0 ? sr(n) : void 0;
|
|
1655
1655
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1656
1656
|
}
|
|
1657
1657
|
function re(e) {
|
|
@@ -1662,16 +1662,16 @@ function re(e) {
|
|
|
1662
1662
|
return "download";
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
|
-
const
|
|
1665
|
+
const ir = {
|
|
1666
1666
|
dark: "text-white/55",
|
|
1667
1667
|
light: "text-black/65"
|
|
1668
|
-
},
|
|
1668
|
+
}, lr = {
|
|
1669
1669
|
dark: "bg-white/10",
|
|
1670
1670
|
light: "bg-black/5"
|
|
1671
|
-
},
|
|
1671
|
+
}, or = {
|
|
1672
1672
|
dark: "text-white/85",
|
|
1673
1673
|
light: "text-black/85"
|
|
1674
|
-
},
|
|
1674
|
+
}, ys = ({
|
|
1675
1675
|
variant: e,
|
|
1676
1676
|
filename: t,
|
|
1677
1677
|
title: n,
|
|
@@ -1681,16 +1681,16 @@ const ar = {
|
|
|
1681
1681
|
activateLabel: l,
|
|
1682
1682
|
trailingAction: o
|
|
1683
1683
|
}) => {
|
|
1684
|
-
const d = n ?? t ?? "File", u =
|
|
1684
|
+
const d = n ?? t ?? "File", u = rr(a, t, r), p = /* @__PURE__ */ s(
|
|
1685
1685
|
"div",
|
|
1686
1686
|
{
|
|
1687
1687
|
className: k(
|
|
1688
1688
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1689
|
-
|
|
1689
|
+
lr[e]
|
|
1690
1690
|
),
|
|
1691
1691
|
"aria-hidden": !0,
|
|
1692
1692
|
children: we(a, {
|
|
1693
|
-
className: k("size-6",
|
|
1693
|
+
className: k("size-6", or[e]),
|
|
1694
1694
|
weight: "regular"
|
|
1695
1695
|
})
|
|
1696
1696
|
}
|
|
@@ -1701,7 +1701,7 @@ const ar = {
|
|
|
1701
1701
|
{
|
|
1702
1702
|
className: k(
|
|
1703
1703
|
"truncate text-xs leading-4",
|
|
1704
|
-
|
|
1704
|
+
ir[e]
|
|
1705
1705
|
),
|
|
1706
1706
|
children: u
|
|
1707
1707
|
}
|
|
@@ -1721,7 +1721,7 @@ const ar = {
|
|
|
1721
1721
|
h
|
|
1722
1722
|
]
|
|
1723
1723
|
}
|
|
1724
|
-
) : /* @__PURE__ */ m(
|
|
1724
|
+
) : /* @__PURE__ */ m(ee, { children: [
|
|
1725
1725
|
p,
|
|
1726
1726
|
h
|
|
1727
1727
|
] });
|
|
@@ -1730,7 +1730,7 @@ const ar = {
|
|
|
1730
1730
|
o ? /* @__PURE__ */ s("div", { className: "shrink-0", children: o }) : null
|
|
1731
1731
|
] });
|
|
1732
1732
|
};
|
|
1733
|
-
async function
|
|
1733
|
+
async function ks(e, t) {
|
|
1734
1734
|
const n = t ?? re(e);
|
|
1735
1735
|
try {
|
|
1736
1736
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -1744,14 +1744,14 @@ async function ys(e, t) {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
|
-
const
|
|
1747
|
+
const cr = ({
|
|
1748
1748
|
src: e,
|
|
1749
1749
|
filename: t,
|
|
1750
1750
|
fileSize: n,
|
|
1751
1751
|
mimeType: a,
|
|
1752
1752
|
title: r,
|
|
1753
1753
|
items: i
|
|
1754
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [],
|
|
1754
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], dr = ({
|
|
1755
1755
|
variant: e,
|
|
1756
1756
|
item: t,
|
|
1757
1757
|
index: n,
|
|
@@ -1760,7 +1760,7 @@ const lr = ({
|
|
|
1760
1760
|
}) => {
|
|
1761
1761
|
const i = t.filename ?? re(t.src);
|
|
1762
1762
|
return /* @__PURE__ */ s(
|
|
1763
|
-
|
|
1763
|
+
ys,
|
|
1764
1764
|
{
|
|
1765
1765
|
variant: e,
|
|
1766
1766
|
filename: i,
|
|
@@ -1772,7 +1772,7 @@ const lr = ({
|
|
|
1772
1772
|
trailingAction: r
|
|
1773
1773
|
}
|
|
1774
1774
|
);
|
|
1775
|
-
},
|
|
1775
|
+
}, pt = ({
|
|
1776
1776
|
state: e,
|
|
1777
1777
|
src: t,
|
|
1778
1778
|
filename: n,
|
|
@@ -1785,7 +1785,7 @@ const lr = ({
|
|
|
1785
1785
|
onClick: u,
|
|
1786
1786
|
onDismiss: p
|
|
1787
1787
|
}) => {
|
|
1788
|
-
const h = Me(e), g = e === "composer" && !!p, c =
|
|
1788
|
+
const h = Me(e), g = e === "composer" && !!p, c = cr({
|
|
1789
1789
|
src: t,
|
|
1790
1790
|
filename: n,
|
|
1791
1791
|
fileSize: a,
|
|
@@ -1797,7 +1797,7 @@ const lr = ({
|
|
|
1797
1797
|
const f = c[b];
|
|
1798
1798
|
if (!f) return;
|
|
1799
1799
|
const x = f.filename ?? re(f.src);
|
|
1800
|
-
|
|
1800
|
+
ks(f.src, x);
|
|
1801
1801
|
};
|
|
1802
1802
|
if (c.length === 0)
|
|
1803
1803
|
return null;
|
|
@@ -1809,7 +1809,7 @@ const lr = ({
|
|
|
1809
1809
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1810
1810
|
),
|
|
1811
1811
|
"aria-hidden": !0,
|
|
1812
|
-
children: /* @__PURE__ */ s(
|
|
1812
|
+
children: /* @__PURE__ */ s(Se, { className: "size-5", weight: "bold" })
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
return /* @__PURE__ */ s(
|
|
@@ -1820,7 +1820,7 @@ const lr = ({
|
|
|
1820
1820
|
groupPosition: d,
|
|
1821
1821
|
"data-testid": "file-attachment",
|
|
1822
1822
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((b, f) => /* @__PURE__ */ s(
|
|
1823
|
-
|
|
1823
|
+
dr,
|
|
1824
1824
|
{
|
|
1825
1825
|
variant: h,
|
|
1826
1826
|
item: b,
|
|
@@ -1832,16 +1832,16 @@ const lr = ({
|
|
|
1832
1832
|
)) })
|
|
1833
1833
|
}
|
|
1834
1834
|
);
|
|
1835
|
-
},
|
|
1836
|
-
Composer:
|
|
1837
|
-
Sent:
|
|
1838
|
-
Received:
|
|
1839
|
-
},
|
|
1835
|
+
}, ur = (e) => /* @__PURE__ */ s(pt, { ...e, state: "composer" }), mr = (e) => /* @__PURE__ */ s(pt, { ...e, state: "sent" }), hr = (e) => /* @__PURE__ */ s(pt, { ...e, state: "received" }), fr = {
|
|
1836
|
+
Composer: ur,
|
|
1837
|
+
Sent: mr,
|
|
1838
|
+
Received: hr
|
|
1839
|
+
}, bt = ({
|
|
1840
1840
|
onPrev: e,
|
|
1841
1841
|
onNext: t,
|
|
1842
1842
|
prevLabel: n = "Previous",
|
|
1843
1843
|
nextLabel: a = "Next"
|
|
1844
|
-
}) => /* @__PURE__ */ m(
|
|
1844
|
+
}) => /* @__PURE__ */ m(ee, { children: [
|
|
1845
1845
|
/* @__PURE__ */ s(
|
|
1846
1846
|
"button",
|
|
1847
1847
|
{
|
|
@@ -1849,7 +1849,7 @@ const lr = ({
|
|
|
1849
1849
|
onClick: e,
|
|
1850
1850
|
"aria-label": n,
|
|
1851
1851
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1852
|
-
children: /* @__PURE__ */ s(
|
|
1852
|
+
children: /* @__PURE__ */ s(Yn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1853
1853
|
}
|
|
1854
1854
|
),
|
|
1855
1855
|
/* @__PURE__ */ s(
|
|
@@ -1862,7 +1862,7 @@ const lr = ({
|
|
|
1862
1862
|
children: /* @__PURE__ */ s(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1863
1863
|
}
|
|
1864
1864
|
)
|
|
1865
|
-
] }),
|
|
1865
|
+
] }), Cs = ({
|
|
1866
1866
|
url: e,
|
|
1867
1867
|
filename: t,
|
|
1868
1868
|
variant: n = "pill",
|
|
@@ -1873,7 +1873,7 @@ const lr = ({
|
|
|
1873
1873
|
}) => {
|
|
1874
1874
|
const [o, d] = B(!1), u = J(
|
|
1875
1875
|
(c) => {
|
|
1876
|
-
c.stopPropagation(), !o && (d(!0),
|
|
1876
|
+
c.stopPropagation(), !o && (d(!0), ks(e, t).catch(() => {
|
|
1877
1877
|
}).finally(() => {
|
|
1878
1878
|
d(!1), l == null || l();
|
|
1879
1879
|
}));
|
|
@@ -1898,14 +1898,14 @@ const lr = ({
|
|
|
1898
1898
|
}[i]
|
|
1899
1899
|
),
|
|
1900
1900
|
children: o ? /* @__PURE__ */ s(
|
|
1901
|
-
|
|
1901
|
+
Ce,
|
|
1902
1902
|
{
|
|
1903
1903
|
className: "size-4 animate-spin",
|
|
1904
1904
|
weight: "bold",
|
|
1905
1905
|
"aria-hidden": !0
|
|
1906
1906
|
}
|
|
1907
1907
|
) : /* @__PURE__ */ s(
|
|
1908
|
-
|
|
1908
|
+
Se,
|
|
1909
1909
|
{
|
|
1910
1910
|
className: "size-5 shrink-0",
|
|
1911
1911
|
weight: "bold",
|
|
@@ -1921,7 +1921,7 @@ const lr = ({
|
|
|
1921
1921
|
disabled: o,
|
|
1922
1922
|
"aria-label": a,
|
|
1923
1923
|
className: "mes-media-viewer__action",
|
|
1924
|
-
children: o ? /* @__PURE__ */ s(
|
|
1924
|
+
children: o ? /* @__PURE__ */ s(Ce, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Se, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1925
1925
|
}
|
|
1926
1926
|
) : /* @__PURE__ */ m(
|
|
1927
1927
|
"button",
|
|
@@ -1936,18 +1936,18 @@ const lr = ({
|
|
|
1936
1936
|
),
|
|
1937
1937
|
children: [
|
|
1938
1938
|
o ? /* @__PURE__ */ s(
|
|
1939
|
-
|
|
1939
|
+
Ce,
|
|
1940
1940
|
{
|
|
1941
1941
|
className: "size-4 animate-spin",
|
|
1942
1942
|
weight: "bold",
|
|
1943
1943
|
"aria-hidden": !0
|
|
1944
1944
|
}
|
|
1945
|
-
) : /* @__PURE__ */ s(
|
|
1945
|
+
) : /* @__PURE__ */ s(Se, { ...g, "aria-hidden": !0 }),
|
|
1946
1946
|
p ? null : a
|
|
1947
1947
|
]
|
|
1948
1948
|
}
|
|
1949
1949
|
);
|
|
1950
|
-
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n),
|
|
1950
|
+
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n), vt = ({
|
|
1951
1951
|
length: e,
|
|
1952
1952
|
initialIndex: t,
|
|
1953
1953
|
open: n
|
|
@@ -1972,7 +1972,7 @@ const lr = ({
|
|
|
1972
1972
|
};
|
|
1973
1973
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
1974
1974
|
}, [n, e, l, o]), { index: r, prev: l, next: o };
|
|
1975
|
-
},
|
|
1975
|
+
}, xt = ({
|
|
1976
1976
|
open: e,
|
|
1977
1977
|
onClose: t,
|
|
1978
1978
|
ariaLabel: n,
|
|
@@ -2062,29 +2062,29 @@ const lr = ({
|
|
|
2062
2062
|
]
|
|
2063
2063
|
}
|
|
2064
2064
|
);
|
|
2065
|
-
},
|
|
2065
|
+
}, Ss = ({
|
|
2066
2066
|
open: e,
|
|
2067
2067
|
items: t,
|
|
2068
2068
|
initialIndex: n = 0,
|
|
2069
2069
|
onClose: a
|
|
2070
2070
|
}) => {
|
|
2071
|
-
const { index: r, prev: i, next: l } =
|
|
2071
|
+
const { index: r, prev: i, next: l } = vt({
|
|
2072
2072
|
length: t.length,
|
|
2073
2073
|
initialIndex: n,
|
|
2074
2074
|
open: e
|
|
2075
|
-
}), o = t[r], d =
|
|
2075
|
+
}), o = t[r], d = se(
|
|
2076
2076
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "image"),
|
|
2077
2077
|
[o]
|
|
2078
2078
|
);
|
|
2079
2079
|
return o ? /* @__PURE__ */ m(
|
|
2080
|
-
|
|
2080
|
+
xt,
|
|
2081
2081
|
{
|
|
2082
2082
|
open: e,
|
|
2083
2083
|
onClose: a,
|
|
2084
2084
|
ariaLabel: d,
|
|
2085
2085
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
2086
2086
|
actions: /* @__PURE__ */ s(
|
|
2087
|
-
|
|
2087
|
+
Cs,
|
|
2088
2088
|
{
|
|
2089
2089
|
url: o.src,
|
|
2090
2090
|
filename: d,
|
|
@@ -2107,7 +2107,7 @@ const lr = ({
|
|
|
2107
2107
|
`${r}:${o.src}`
|
|
2108
2108
|
),
|
|
2109
2109
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2110
|
-
|
|
2110
|
+
bt,
|
|
2111
2111
|
{
|
|
2112
2112
|
onPrev: i,
|
|
2113
2113
|
onNext: l,
|
|
@@ -2118,7 +2118,7 @@ const lr = ({
|
|
|
2118
2118
|
]
|
|
2119
2119
|
}
|
|
2120
2120
|
) : null;
|
|
2121
|
-
},
|
|
2121
|
+
}, gr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", Es = ({
|
|
2122
2122
|
tiles: e,
|
|
2123
2123
|
onTileActivate: t,
|
|
2124
2124
|
maxVisible: n = 4,
|
|
@@ -2127,7 +2127,7 @@ const lr = ({
|
|
|
2127
2127
|
const r = e.length;
|
|
2128
2128
|
if (r === 0) return null;
|
|
2129
2129
|
const i = e.slice(0, Math.min(r, n)), l = r - i.length, o = (d, u, p) => {
|
|
2130
|
-
const h = k(
|
|
2130
|
+
const h = k(gr, "h-full w-full");
|
|
2131
2131
|
return t ? /* @__PURE__ */ m(
|
|
2132
2132
|
"button",
|
|
2133
2133
|
{
|
|
@@ -2196,7 +2196,7 @@ const lr = ({
|
|
|
2196
2196
|
[e]
|
|
2197
2197
|
), l = J(() => n(!1), []);
|
|
2198
2198
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
2199
|
-
},
|
|
2199
|
+
}, pr = (e, t, n, a) => ({
|
|
2200
2200
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
2201
2201
|
content: /* @__PURE__ */ s(
|
|
2202
2202
|
"img",
|
|
@@ -2211,15 +2211,15 @@ const lr = ({
|
|
|
2211
2211
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2212
2212
|
}
|
|
2213
2213
|
)
|
|
2214
|
-
}),
|
|
2214
|
+
}), br = ({
|
|
2215
2215
|
src: e,
|
|
2216
2216
|
alt: t,
|
|
2217
2217
|
items: n
|
|
2218
|
-
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [],
|
|
2218
|
+
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Is = (e, t) => e.map((n, a) => ({
|
|
2219
2219
|
src: n.src,
|
|
2220
2220
|
alt: n.alt,
|
|
2221
2221
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2222
|
-
})),
|
|
2222
|
+
})), vr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2223
2223
|
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: u } = Re(
|
|
2224
2224
|
r
|
|
2225
2225
|
);
|
|
@@ -2246,16 +2246,16 @@ const lr = ({
|
|
|
2246
2246
|
),
|
|
2247
2247
|
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
|
|
2248
2248
|
/* @__PURE__ */ s(
|
|
2249
|
-
|
|
2249
|
+
Ss,
|
|
2250
2250
|
{
|
|
2251
2251
|
open: l,
|
|
2252
|
-
items:
|
|
2252
|
+
items: Is([{ src: e, alt: t }], n),
|
|
2253
2253
|
initialIndex: o,
|
|
2254
2254
|
onClose: u
|
|
2255
2255
|
}
|
|
2256
2256
|
)
|
|
2257
2257
|
] });
|
|
2258
|
-
},
|
|
2258
|
+
}, Ts = ({
|
|
2259
2259
|
state: e,
|
|
2260
2260
|
src: t,
|
|
2261
2261
|
alt: n,
|
|
@@ -2266,13 +2266,13 @@ const lr = ({
|
|
|
2266
2266
|
loading: o = "lazy",
|
|
2267
2267
|
onClick: d
|
|
2268
2268
|
}) => {
|
|
2269
|
-
const u =
|
|
2269
|
+
const u = br({ src: t, alt: n, items: r }), p = Me(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: v } = Re(
|
|
2270
2270
|
d
|
|
2271
2271
|
);
|
|
2272
2272
|
if (u.length === 0)
|
|
2273
2273
|
return null;
|
|
2274
2274
|
const w = u.map(
|
|
2275
|
-
(b, f) =>
|
|
2275
|
+
(b, f) => pr(b, f, u.length, o)
|
|
2276
2276
|
);
|
|
2277
2277
|
return /* @__PURE__ */ m(
|
|
2278
2278
|
Te,
|
|
@@ -2284,10 +2284,10 @@ const lr = ({
|
|
|
2284
2284
|
children: [
|
|
2285
2285
|
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Es, { tiles: w, onTileActivate: c }) }),
|
|
2286
2286
|
/* @__PURE__ */ s(
|
|
2287
|
-
|
|
2287
|
+
Ss,
|
|
2288
2288
|
{
|
|
2289
2289
|
open: h,
|
|
2290
|
-
items:
|
|
2290
|
+
items: Is(u, a),
|
|
2291
2291
|
initialIndex: g,
|
|
2292
2292
|
onClose: v
|
|
2293
2293
|
}
|
|
@@ -2295,29 +2295,29 @@ const lr = ({
|
|
|
2295
2295
|
]
|
|
2296
2296
|
}
|
|
2297
2297
|
);
|
|
2298
|
-
},
|
|
2299
|
-
Composer:
|
|
2300
|
-
Sent:
|
|
2301
|
-
Received:
|
|
2302
|
-
},
|
|
2298
|
+
}, xr = (e) => /* @__PURE__ */ s(vr, { ...e }), wr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "sent" }), _r = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "received" }), Nr = {
|
|
2299
|
+
Composer: xr,
|
|
2300
|
+
Sent: wr,
|
|
2301
|
+
Received: _r
|
|
2302
|
+
}, yr = ({
|
|
2303
2303
|
open: e,
|
|
2304
2304
|
items: t,
|
|
2305
2305
|
initialIndex: n = 0,
|
|
2306
2306
|
onClose: a
|
|
2307
2307
|
}) => {
|
|
2308
|
-
const { index: r, prev: i, next: l } =
|
|
2308
|
+
const { index: r, prev: i, next: l } = vt({
|
|
2309
2309
|
length: t.length,
|
|
2310
2310
|
initialIndex: n,
|
|
2311
2311
|
open: e
|
|
2312
|
-
}), o = t[r], d =
|
|
2312
|
+
}), o = t[r], d = se(
|
|
2313
2313
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "document"),
|
|
2314
2314
|
[o]
|
|
2315
|
-
), u =
|
|
2316
|
-
() => o ?
|
|
2315
|
+
), u = se(
|
|
2316
|
+
() => o ? kr(o.src) : void 0,
|
|
2317
2317
|
[o]
|
|
2318
2318
|
);
|
|
2319
2319
|
return !o || !u ? null : /* @__PURE__ */ m(
|
|
2320
|
-
|
|
2320
|
+
xt,
|
|
2321
2321
|
{
|
|
2322
2322
|
open: e,
|
|
2323
2323
|
onClose: a,
|
|
@@ -2336,7 +2336,7 @@ const lr = ({
|
|
|
2336
2336
|
`${r}:${o.src}`
|
|
2337
2337
|
),
|
|
2338
2338
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2339
|
-
|
|
2339
|
+
bt,
|
|
2340
2340
|
{
|
|
2341
2341
|
onPrev: i,
|
|
2342
2342
|
onNext: l,
|
|
@@ -2347,16 +2347,16 @@ const lr = ({
|
|
|
2347
2347
|
]
|
|
2348
2348
|
}
|
|
2349
2349
|
);
|
|
2350
|
-
},
|
|
2350
|
+
}, kr = (e) => {
|
|
2351
2351
|
const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2352
2352
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
|
|
2353
|
-
},
|
|
2353
|
+
}, Cr = ({
|
|
2354
2354
|
src: e,
|
|
2355
2355
|
filename: t,
|
|
2356
2356
|
fileSize: n,
|
|
2357
2357
|
title: a,
|
|
2358
2358
|
items: r
|
|
2359
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [],
|
|
2359
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], Sr = ({
|
|
2360
2360
|
variant: e,
|
|
2361
2361
|
item: t,
|
|
2362
2362
|
index: n,
|
|
@@ -2365,7 +2365,7 @@ const lr = ({
|
|
|
2365
2365
|
}) => {
|
|
2366
2366
|
const i = t.filename ?? re(t.src);
|
|
2367
2367
|
return /* @__PURE__ */ s(
|
|
2368
|
-
|
|
2368
|
+
ys,
|
|
2369
2369
|
{
|
|
2370
2370
|
variant: e,
|
|
2371
2371
|
filename: i,
|
|
@@ -2377,7 +2377,7 @@ const lr = ({
|
|
|
2377
2377
|
trailingAction: r
|
|
2378
2378
|
}
|
|
2379
2379
|
);
|
|
2380
|
-
},
|
|
2380
|
+
}, wt = ({
|
|
2381
2381
|
state: e,
|
|
2382
2382
|
src: t,
|
|
2383
2383
|
filename: n,
|
|
@@ -2389,7 +2389,7 @@ const lr = ({
|
|
|
2389
2389
|
onClick: d,
|
|
2390
2390
|
onDismiss: u
|
|
2391
2391
|
}) => {
|
|
2392
|
-
const p = Me(e), h =
|
|
2392
|
+
const p = Me(e), h = Cr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2393
2393
|
d
|
|
2394
2394
|
), b = e === "composer" && !!u;
|
|
2395
2395
|
if (h.length === 0)
|
|
@@ -2407,18 +2407,18 @@ const lr = ({
|
|
|
2407
2407
|
"data-testid": "pdf-attachment",
|
|
2408
2408
|
children: [
|
|
2409
2409
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((x, N) => {
|
|
2410
|
-
const
|
|
2411
|
-
|
|
2410
|
+
const S = x.filename ?? re(x.src), T = b && N === 0 ? /* @__PURE__ */ s(Ae, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2411
|
+
Cs,
|
|
2412
2412
|
{
|
|
2413
2413
|
url: x.src,
|
|
2414
|
-
filename:
|
|
2414
|
+
filename: S,
|
|
2415
2415
|
variant: "inline",
|
|
2416
|
-
label: `Download ${
|
|
2416
|
+
label: `Download ${S}`,
|
|
2417
2417
|
tone: p
|
|
2418
2418
|
}
|
|
2419
2419
|
);
|
|
2420
2420
|
return /* @__PURE__ */ s(
|
|
2421
|
-
|
|
2421
|
+
Sr,
|
|
2422
2422
|
{
|
|
2423
2423
|
variant: p,
|
|
2424
2424
|
item: x,
|
|
@@ -2430,7 +2430,7 @@ const lr = ({
|
|
|
2430
2430
|
);
|
|
2431
2431
|
}) }),
|
|
2432
2432
|
/* @__PURE__ */ s(
|
|
2433
|
-
|
|
2433
|
+
yr,
|
|
2434
2434
|
{
|
|
2435
2435
|
open: g,
|
|
2436
2436
|
items: f,
|
|
@@ -2441,26 +2441,26 @@ const lr = ({
|
|
|
2441
2441
|
]
|
|
2442
2442
|
}
|
|
2443
2443
|
);
|
|
2444
|
-
},
|
|
2445
|
-
Composer:
|
|
2446
|
-
Sent:
|
|
2447
|
-
Received:
|
|
2448
|
-
},
|
|
2444
|
+
}, Er = (e) => /* @__PURE__ */ s(wt, { ...e, state: "composer" }), Ir = (e) => /* @__PURE__ */ s(wt, { ...e, state: "sent" }), Tr = (e) => /* @__PURE__ */ s(wt, { ...e, state: "received" }), Ar = {
|
|
2445
|
+
Composer: Er,
|
|
2446
|
+
Sent: Ir,
|
|
2447
|
+
Received: Tr
|
|
2448
|
+
}, As = ({
|
|
2449
2449
|
open: e,
|
|
2450
2450
|
items: t,
|
|
2451
2451
|
initialIndex: n = 0,
|
|
2452
2452
|
onClose: a
|
|
2453
2453
|
}) => {
|
|
2454
|
-
const { index: r, prev: i, next: l } =
|
|
2454
|
+
const { index: r, prev: i, next: l } = vt({
|
|
2455
2455
|
length: t.length,
|
|
2456
2456
|
initialIndex: n,
|
|
2457
2457
|
open: e
|
|
2458
|
-
}), o = t[r], d =
|
|
2458
|
+
}), o = t[r], d = se(
|
|
2459
2459
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "video"),
|
|
2460
2460
|
[o]
|
|
2461
2461
|
);
|
|
2462
2462
|
return o ? /* @__PURE__ */ m(
|
|
2463
|
-
|
|
2463
|
+
xt,
|
|
2464
2464
|
{
|
|
2465
2465
|
open: e,
|
|
2466
2466
|
onClose: a,
|
|
@@ -2484,7 +2484,7 @@ const lr = ({
|
|
|
2484
2484
|
`${r}:${o.src}`
|
|
2485
2485
|
),
|
|
2486
2486
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2487
|
-
|
|
2487
|
+
bt,
|
|
2488
2488
|
{
|
|
2489
2489
|
onPrev: i,
|
|
2490
2490
|
onNext: l,
|
|
@@ -2495,7 +2495,7 @@ const lr = ({
|
|
|
2495
2495
|
]
|
|
2496
2496
|
}
|
|
2497
2497
|
) : null;
|
|
2498
|
-
},
|
|
2498
|
+
}, Mr = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(tt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Ms = ({
|
|
2499
2499
|
item: e,
|
|
2500
2500
|
index: t
|
|
2501
2501
|
}) => /* @__PURE__ */ m("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2510,30 +2510,30 @@ const lr = ({
|
|
|
2510
2510
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2511
2511
|
}
|
|
2512
2512
|
) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
2513
|
-
|
|
2513
|
+
cs,
|
|
2514
2514
|
{
|
|
2515
2515
|
className: "size-16 rounded-md text-white/30",
|
|
2516
2516
|
weight: "regular",
|
|
2517
2517
|
"aria-hidden": !0
|
|
2518
2518
|
}
|
|
2519
2519
|
) }),
|
|
2520
|
-
/* @__PURE__ */ s(
|
|
2521
|
-
] }),
|
|
2520
|
+
/* @__PURE__ */ s(Mr, {})
|
|
2521
|
+
] }), Rr = (e, t, n) => ({
|
|
2522
2522
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2523
|
-
content: /* @__PURE__ */ s(
|
|
2524
|
-
}),
|
|
2523
|
+
content: /* @__PURE__ */ s(Ms, { item: e, index: t })
|
|
2524
|
+
}), Dr = ({
|
|
2525
2525
|
src: e,
|
|
2526
2526
|
poster: t,
|
|
2527
2527
|
mimeType: n,
|
|
2528
2528
|
preload: a,
|
|
2529
2529
|
items: r
|
|
2530
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [],
|
|
2530
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Rs = (e, t) => e.map((n, a) => ({
|
|
2531
2531
|
src: n.src,
|
|
2532
2532
|
poster: n.poster,
|
|
2533
2533
|
mimeType: n.mimeType,
|
|
2534
2534
|
preload: n.preload,
|
|
2535
2535
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2536
|
-
})),
|
|
2536
|
+
})), Lr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
2537
2537
|
const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer: p } = Re(
|
|
2538
2538
|
i
|
|
2539
2539
|
);
|
|
@@ -2545,15 +2545,15 @@ const lr = ({
|
|
|
2545
2545
|
onClick: () => u(0),
|
|
2546
2546
|
"aria-label": "Play video",
|
|
2547
2547
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2548
|
-
children: /* @__PURE__ */ s(
|
|
2548
|
+
children: /* @__PURE__ */ s(Ms, { item: { src: e, poster: t, mimeType: n }, index: 0 })
|
|
2549
2549
|
}
|
|
2550
2550
|
),
|
|
2551
2551
|
l ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: l }) }) : null,
|
|
2552
2552
|
/* @__PURE__ */ s(
|
|
2553
|
-
|
|
2553
|
+
As,
|
|
2554
2554
|
{
|
|
2555
2555
|
open: o,
|
|
2556
|
-
items:
|
|
2556
|
+
items: Rs(
|
|
2557
2557
|
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2558
2558
|
a
|
|
2559
2559
|
),
|
|
@@ -2562,7 +2562,7 @@ const lr = ({
|
|
|
2562
2562
|
}
|
|
2563
2563
|
)
|
|
2564
2564
|
] });
|
|
2565
|
-
},
|
|
2565
|
+
}, Ds = ({
|
|
2566
2566
|
state: e,
|
|
2567
2567
|
src: t,
|
|
2568
2568
|
poster: n,
|
|
@@ -2574,13 +2574,13 @@ const lr = ({
|
|
|
2574
2574
|
preload: d,
|
|
2575
2575
|
onClick: u
|
|
2576
2576
|
}) => {
|
|
2577
|
-
const p =
|
|
2577
|
+
const p = Dr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Me(e), { viewerOpen: g, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2578
2578
|
u
|
|
2579
2579
|
);
|
|
2580
2580
|
if (p.length === 0)
|
|
2581
2581
|
return null;
|
|
2582
2582
|
const b = p.map(
|
|
2583
|
-
(f, x) =>
|
|
2583
|
+
(f, x) => Rr(f, x, p.length)
|
|
2584
2584
|
);
|
|
2585
2585
|
return /* @__PURE__ */ m(
|
|
2586
2586
|
Te,
|
|
@@ -2599,10 +2599,10 @@ const lr = ({
|
|
|
2599
2599
|
}
|
|
2600
2600
|
) }),
|
|
2601
2601
|
/* @__PURE__ */ s(
|
|
2602
|
-
|
|
2602
|
+
As,
|
|
2603
2603
|
{
|
|
2604
2604
|
open: g,
|
|
2605
|
-
items:
|
|
2605
|
+
items: Rs(p, r),
|
|
2606
2606
|
initialIndex: c,
|
|
2607
2607
|
onClose: w
|
|
2608
2608
|
}
|
|
@@ -2610,38 +2610,25 @@ const lr = ({
|
|
|
2610
2610
|
]
|
|
2611
2611
|
}
|
|
2612
2612
|
);
|
|
2613
|
-
},
|
|
2614
|
-
Composer:
|
|
2615
|
-
Sent:
|
|
2616
|
-
Received:
|
|
2617
|
-
},
|
|
2618
|
-
Image:
|
|
2619
|
-
Video:
|
|
2620
|
-
Audio:
|
|
2621
|
-
Pdf:
|
|
2622
|
-
File:
|
|
2623
|
-
},
|
|
2613
|
+
}, zr = (e) => /* @__PURE__ */ s(Lr, { ...e }), Pr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "received" }), Or = {
|
|
2614
|
+
Composer: zr,
|
|
2615
|
+
Sent: Pr,
|
|
2616
|
+
Received: Fr
|
|
2617
|
+
}, ye = {
|
|
2618
|
+
Image: Nr,
|
|
2619
|
+
Video: Or,
|
|
2620
|
+
Audio: tr,
|
|
2621
|
+
Pdf: Ar,
|
|
2622
|
+
File: fr
|
|
2623
|
+
}, $r = {
|
|
2624
2624
|
isUnlocking: () => !1
|
|
2625
|
-
},
|
|
2626
|
-
LockedAttachment:
|
|
2627
|
-
}, Ls =
|
|
2628
|
-
function
|
|
2629
|
-
return
|
|
2625
|
+
}, jr = {
|
|
2626
|
+
LockedAttachment: $r
|
|
2627
|
+
}, Ls = rt({}), ml = Ls.Provider;
|
|
2628
|
+
function Br(e) {
|
|
2629
|
+
return Ie(Ls)[e] ?? jr[e];
|
|
2630
2630
|
}
|
|
2631
|
-
const
|
|
2632
|
-
message: e,
|
|
2633
|
-
endOfGroup: t
|
|
2634
|
-
}) => !t || e.type === "error" || e.status !== "received" ? null : /* @__PURE__ */ m(
|
|
2635
|
-
"div",
|
|
2636
|
-
{
|
|
2637
|
-
className: "str-chat__message-delivery-status",
|
|
2638
|
-
"data-testid": "message-delivery-status",
|
|
2639
|
-
children: [
|
|
2640
|
-
/* @__PURE__ */ s(Hn, { size: 14, weight: "bold", "aria-hidden": "true" }),
|
|
2641
|
-
/* @__PURE__ */ s("span", { children: "Delivered" })
|
|
2642
|
-
]
|
|
2643
|
-
}
|
|
2644
|
-
), Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2631
|
+
const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2645
2632
|
"svg",
|
|
2646
2633
|
{
|
|
2647
2634
|
width: e,
|
|
@@ -2658,21 +2645,21 @@ const jr = ({
|
|
|
2658
2645
|
}
|
|
2659
2646
|
)
|
|
2660
2647
|
}
|
|
2661
|
-
),
|
|
2648
|
+
), Vr = (e) => {
|
|
2662
2649
|
var t;
|
|
2663
2650
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2664
|
-
},
|
|
2651
|
+
}, Gr = (e) => {
|
|
2665
2652
|
var t;
|
|
2666
2653
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2667
2654
|
}, Fe = (e) => {
|
|
2668
2655
|
var t;
|
|
2669
2656
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2670
|
-
},
|
|
2657
|
+
}, Hr = (e) => {
|
|
2671
2658
|
var t;
|
|
2672
2659
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2673
|
-
},
|
|
2660
|
+
}, zs = (e) => Vr(e) || Gr(e), Yr = (e) => {
|
|
2674
2661
|
var t;
|
|
2675
|
-
return
|
|
2662
|
+
return zs(e) && !((t = e.text) != null && t.trim());
|
|
2676
2663
|
}, Ke = ({
|
|
2677
2664
|
message: e,
|
|
2678
2665
|
standalone: t = !1,
|
|
@@ -2680,7 +2667,7 @@ const jr = ({
|
|
|
2680
2667
|
hasAttachment: a = !1
|
|
2681
2668
|
}) => {
|
|
2682
2669
|
var h;
|
|
2683
|
-
const r =
|
|
2670
|
+
const r = zs(e), i = Fe(e);
|
|
2684
2671
|
if (!r && !i)
|
|
2685
2672
|
return null;
|
|
2686
2673
|
if (r) {
|
|
@@ -2688,7 +2675,7 @@ const jr = ({
|
|
|
2688
2675
|
if (!g) return null;
|
|
2689
2676
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${g} tip` : `Delivered with ${g} tip`;
|
|
2690
2677
|
return /* @__PURE__ */ m("div", { className: c, children: [
|
|
2691
|
-
/* @__PURE__ */ s(
|
|
2678
|
+
/* @__PURE__ */ s(qn, { size: t ? 14 : 12 }),
|
|
2692
2679
|
/* @__PURE__ */ s("span", { children: v })
|
|
2693
2680
|
] });
|
|
2694
2681
|
}
|
|
@@ -2696,15 +2683,15 @@ const jr = ({
|
|
|
2696
2683
|
"message-chatbot-indicator",
|
|
2697
2684
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2698
2685
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2699
|
-
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(
|
|
2700
|
-
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ m(
|
|
2686
|
+
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(Ur, { size: l ? 12 : 15 }) });
|
|
2687
|
+
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ m(ee, { children: [
|
|
2701
2688
|
u,
|
|
2702
2689
|
p
|
|
2703
|
-
] }) : /* @__PURE__ */ m(
|
|
2690
|
+
] }) : /* @__PURE__ */ m(ee, { children: [
|
|
2704
2691
|
p,
|
|
2705
2692
|
u
|
|
2706
2693
|
] }) });
|
|
2707
|
-
},
|
|
2694
|
+
}, qr = ({
|
|
2708
2695
|
selected: e,
|
|
2709
2696
|
onVoteUp: t,
|
|
2710
2697
|
onVoteDown: n
|
|
@@ -2720,7 +2707,7 @@ const jr = ({
|
|
|
2720
2707
|
"aria-label": "Good response",
|
|
2721
2708
|
"aria-pressed": e === "up",
|
|
2722
2709
|
"data-tooltip": "Good response",
|
|
2723
|
-
children: /* @__PURE__ */ s(
|
|
2710
|
+
children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2724
2711
|
}
|
|
2725
2712
|
),
|
|
2726
2713
|
/* @__PURE__ */ s(
|
|
@@ -2734,29 +2721,50 @@ const jr = ({
|
|
|
2734
2721
|
"aria-label": "Bad response",
|
|
2735
2722
|
"aria-pressed": e === "down",
|
|
2736
2723
|
"data-tooltip": "Bad response",
|
|
2737
|
-
children: /* @__PURE__ */ s(
|
|
2724
|
+
children: /* @__PURE__ */ s(Xn, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2738
2725
|
}
|
|
2739
2726
|
)
|
|
2740
|
-
] }),
|
|
2741
|
-
|
|
2727
|
+
] }), Je = () => {
|
|
2728
|
+
var i;
|
|
2729
|
+
const { message: e } = _e("SentMessageDeliveryStatus"), { messages: t } = le("SentMessageDeliveryStatus"), { client: n } = oe("SentMessageDeliveryStatus"), a = (i = n.user) == null ? void 0 : i.id, r = se(() => {
|
|
2730
|
+
var l;
|
|
2731
|
+
if (!(!a || !t)) {
|
|
2732
|
+
for (let o = t.length - 1; o >= 0; o -= 1)
|
|
2733
|
+
if (((l = t[o].user) == null ? void 0 : l.id) === a) return t[o].id;
|
|
2734
|
+
}
|
|
2735
|
+
}, [t, a]);
|
|
2736
|
+
return e.id !== r ? null : /* @__PURE__ */ m(ee, { children: [
|
|
2737
|
+
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2738
|
+
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2739
|
+
] });
|
|
2740
|
+
}, Wr = () => null, Xr = () => /* @__PURE__ */ s(
|
|
2741
|
+
Xs,
|
|
2742
|
+
{
|
|
2743
|
+
MessageSentStatus: Je,
|
|
2744
|
+
MessageDeliveredStatus: Je,
|
|
2745
|
+
MessageReadStatus: Je,
|
|
2746
|
+
MessageSendingStatus: Wr
|
|
2747
|
+
}
|
|
2748
|
+
), Kr = /^([a-z][a-z0-9+.-]*):/i, Jr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2749
|
+
function _t(e) {
|
|
2742
2750
|
if (typeof e != "string") return;
|
|
2743
2751
|
const t = e.trim();
|
|
2744
2752
|
if (t === "") return;
|
|
2745
|
-
const n =
|
|
2753
|
+
const n = Kr.exec(t);
|
|
2746
2754
|
if (n) {
|
|
2747
2755
|
const a = n[1].toLowerCase();
|
|
2748
|
-
return
|
|
2756
|
+
return Jr.has(a) ? t : void 0;
|
|
2749
2757
|
}
|
|
2750
2758
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2751
2759
|
}
|
|
2752
|
-
const
|
|
2760
|
+
const Zr = {
|
|
2753
2761
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2754
2762
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2755
|
-
},
|
|
2763
|
+
}, Qr = ({ variant: e, cta: t }) => {
|
|
2756
2764
|
const n = k(
|
|
2757
2765
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2758
|
-
|
|
2759
|
-
), a =
|
|
2766
|
+
Zr[e]
|
|
2767
|
+
), a = _t(t.href);
|
|
2760
2768
|
return a ? /* @__PURE__ */ s(
|
|
2761
2769
|
"a",
|
|
2762
2770
|
{
|
|
@@ -2782,13 +2790,13 @@ const Xr = {
|
|
|
2782
2790
|
children: t.label
|
|
2783
2791
|
}
|
|
2784
2792
|
);
|
|
2785
|
-
},
|
|
2793
|
+
}, ei = {
|
|
2786
2794
|
dark: "text-white",
|
|
2787
2795
|
light: "text-black/90"
|
|
2788
|
-
},
|
|
2796
|
+
}, ti = "text-white/30", si = {
|
|
2789
2797
|
dark: "text-white/55",
|
|
2790
2798
|
light: "text-black/55"
|
|
2791
|
-
},
|
|
2799
|
+
}, Nt = ({
|
|
2792
2800
|
variant: e,
|
|
2793
2801
|
title: t,
|
|
2794
2802
|
placeholderTitle: n,
|
|
@@ -2802,10 +2810,10 @@ const Xr = {
|
|
|
2802
2810
|
if (!p && !h && !c && !v) return null;
|
|
2803
2811
|
const b = k(
|
|
2804
2812
|
"truncate text-base font-medium leading-6",
|
|
2805
|
-
d && !t ?
|
|
2813
|
+
d && !t ? ti : ei[e]
|
|
2806
2814
|
), f = k(
|
|
2807
2815
|
"truncate text-xs leading-4",
|
|
2808
|
-
|
|
2816
|
+
si[e]
|
|
2809
2817
|
);
|
|
2810
2818
|
return /* @__PURE__ */ m("div", { className: "px-4 py-3", children: [
|
|
2811
2819
|
/* @__PURE__ */ m("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2821,9 +2829,9 @@ const Xr = {
|
|
|
2821
2829
|
] }),
|
|
2822
2830
|
o && /* @__PURE__ */ s("div", { className: "shrink-0", children: o })
|
|
2823
2831
|
] }),
|
|
2824
|
-
l && /* @__PURE__ */ s(
|
|
2832
|
+
l && /* @__PURE__ */ s(Qr, { variant: e, cta: l })
|
|
2825
2833
|
] });
|
|
2826
|
-
},
|
|
2834
|
+
}, ni = k(
|
|
2827
2835
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2828
2836
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2829
2837
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2842,7 +2850,7 @@ const Xr = {
|
|
|
2842
2850
|
"data-testid": d
|
|
2843
2851
|
}) => {
|
|
2844
2852
|
const u = n != null || a != null, p = k(
|
|
2845
|
-
|
|
2853
|
+
ni,
|
|
2846
2854
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2847
2855
|
// `focus-ring` is a design-system utility from the component-library
|
|
2848
2856
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2890,17 +2898,17 @@ const Xr = {
|
|
|
2890
2898
|
]
|
|
2891
2899
|
}
|
|
2892
2900
|
);
|
|
2893
|
-
},
|
|
2901
|
+
}, ai = {
|
|
2894
2902
|
dark: "bg-white/10",
|
|
2895
2903
|
light: "bg-black/5"
|
|
2896
|
-
},
|
|
2904
|
+
}, ri = {
|
|
2897
2905
|
dark: "size-16 text-white/25",
|
|
2898
2906
|
light: "size-16 text-black/25"
|
|
2899
|
-
}, Ve = (e, t) => !!t && !!e &&
|
|
2907
|
+
}, Ve = (e, t) => !!t && !!e && ce(e) === "audio", yt = (e, t) => {
|
|
2900
2908
|
if (!t || !e) return !1;
|
|
2901
|
-
const n =
|
|
2909
|
+
const n = ce(e);
|
|
2902
2910
|
return n === "video" || n === "audio";
|
|
2903
|
-
},
|
|
2911
|
+
}, kt = "bg-[#F2F3F4]", $e = ({
|
|
2904
2912
|
variant: e,
|
|
2905
2913
|
thumbnailUrl: t,
|
|
2906
2914
|
sourceUrl: n,
|
|
@@ -2909,7 +2917,7 @@ const Xr = {
|
|
|
2909
2917
|
topLeft: i,
|
|
2910
2918
|
topRight: l
|
|
2911
2919
|
}) => {
|
|
2912
|
-
const o =
|
|
2920
|
+
const o = ce(r), d = !!n && o === "video";
|
|
2913
2921
|
return Ve(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
|
|
2914
2922
|
"audio",
|
|
2915
2923
|
{
|
|
@@ -2951,10 +2959,10 @@ const Xr = {
|
|
|
2951
2959
|
{
|
|
2952
2960
|
className: k(
|
|
2953
2961
|
"flex h-full w-full items-center justify-center",
|
|
2954
|
-
|
|
2962
|
+
ai[e]
|
|
2955
2963
|
),
|
|
2956
2964
|
children: we(r, {
|
|
2957
|
-
className:
|
|
2965
|
+
className: ri[e],
|
|
2958
2966
|
weight: "regular"
|
|
2959
2967
|
})
|
|
2960
2968
|
}
|
|
@@ -2964,7 +2972,7 @@ const Xr = {
|
|
|
2964
2972
|
]
|
|
2965
2973
|
}
|
|
2966
2974
|
);
|
|
2967
|
-
},
|
|
2975
|
+
}, ii = ({
|
|
2968
2976
|
title: e,
|
|
2969
2977
|
placeholderTitle: t,
|
|
2970
2978
|
description: n,
|
|
@@ -2994,10 +3002,10 @@ const Xr = {
|
|
|
2994
3002
|
onClick: h,
|
|
2995
3003
|
"aria-label": "Edit attachment",
|
|
2996
3004
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
2997
|
-
children: /* @__PURE__ */ s(
|
|
3005
|
+
children: /* @__PURE__ */ s(Jn, { className: "size-5", weight: "regular" })
|
|
2998
3006
|
}
|
|
2999
3007
|
) : void 0;
|
|
3000
|
-
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName:
|
|
3008
|
+
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName: kt, children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3001
3009
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3002
3010
|
$e,
|
|
3003
3011
|
{
|
|
@@ -3026,7 +3034,7 @@ const Xr = {
|
|
|
3026
3034
|
}
|
|
3027
3035
|
),
|
|
3028
3036
|
/* @__PURE__ */ s(
|
|
3029
|
-
|
|
3037
|
+
Nt,
|
|
3030
3038
|
{
|
|
3031
3039
|
variant: "dark",
|
|
3032
3040
|
title: e,
|
|
@@ -3041,7 +3049,7 @@ const Xr = {
|
|
|
3041
3049
|
]
|
|
3042
3050
|
}
|
|
3043
3051
|
);
|
|
3044
|
-
},
|
|
3052
|
+
}, li = ({
|
|
3045
3053
|
title: e,
|
|
3046
3054
|
description: t,
|
|
3047
3055
|
url: n,
|
|
@@ -3053,7 +3061,7 @@ const Xr = {
|
|
|
3053
3061
|
cta: d,
|
|
3054
3062
|
onClick: u
|
|
3055
3063
|
}) => {
|
|
3056
|
-
const p =
|
|
3064
|
+
const p = yt(a, i), h = _t(n), g = d == null && h != null && !p ? h : void 0, c = d == null && !p ? u : void 0, v = Ve(a, i) ? kt : void 0, w = d && u ? {
|
|
3057
3065
|
...d,
|
|
3058
3066
|
onClick: () => {
|
|
3059
3067
|
var b;
|
|
@@ -3081,7 +3089,7 @@ const Xr = {
|
|
|
3081
3089
|
}
|
|
3082
3090
|
),
|
|
3083
3091
|
/* @__PURE__ */ s(
|
|
3084
|
-
|
|
3092
|
+
Nt,
|
|
3085
3093
|
{
|
|
3086
3094
|
variant: "light",
|
|
3087
3095
|
title: e,
|
|
@@ -3094,7 +3102,7 @@ const Xr = {
|
|
|
3094
3102
|
]
|
|
3095
3103
|
}
|
|
3096
3104
|
);
|
|
3097
|
-
},
|
|
3105
|
+
}, oi = ({
|
|
3098
3106
|
title: e,
|
|
3099
3107
|
placeholderTitle: t,
|
|
3100
3108
|
description: n,
|
|
@@ -3107,14 +3115,14 @@ const Xr = {
|
|
|
3107
3115
|
cta: u,
|
|
3108
3116
|
onClick: p
|
|
3109
3117
|
}) => {
|
|
3110
|
-
const h =
|
|
3118
|
+
const h = yt(r, l), g = _t(a), c = u == null && g != null && !h ? g : void 0, v = u == null && !h && c != null ? p : void 0;
|
|
3111
3119
|
return /* @__PURE__ */ m(
|
|
3112
3120
|
Oe,
|
|
3113
3121
|
{
|
|
3114
3122
|
variant: "dark",
|
|
3115
3123
|
href: c,
|
|
3116
3124
|
onClick: v,
|
|
3117
|
-
bgClassName: Ve(r, l) ?
|
|
3125
|
+
bgClassName: Ve(r, l) ? kt : void 0,
|
|
3118
3126
|
children: [
|
|
3119
3127
|
o === "featured" && /* @__PURE__ */ s(
|
|
3120
3128
|
$e,
|
|
@@ -3127,7 +3135,7 @@ const Xr = {
|
|
|
3127
3135
|
}
|
|
3128
3136
|
),
|
|
3129
3137
|
/* @__PURE__ */ s(
|
|
3130
|
-
|
|
3138
|
+
Nt,
|
|
3131
3139
|
{
|
|
3132
3140
|
variant: "dark",
|
|
3133
3141
|
title: e,
|
|
@@ -3141,22 +3149,22 @@ const Xr = {
|
|
|
3141
3149
|
]
|
|
3142
3150
|
}
|
|
3143
3151
|
);
|
|
3144
|
-
},
|
|
3145
|
-
Composer:
|
|
3146
|
-
Sent:
|
|
3147
|
-
Received:
|
|
3148
|
-
},
|
|
3152
|
+
}, es = {
|
|
3153
|
+
Composer: ii,
|
|
3154
|
+
Sent: oi,
|
|
3155
|
+
Received: li
|
|
3156
|
+
}, ci = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#121110] px-4 py-2 text-white", di = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#e9eaed] px-4 py-2 text-[#080707]";
|
|
3149
3157
|
function P(e) {
|
|
3150
3158
|
const t = e == null ? void 0 : e.trim();
|
|
3151
3159
|
return t || void 0;
|
|
3152
3160
|
}
|
|
3153
|
-
function
|
|
3161
|
+
function ts(e) {
|
|
3154
3162
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3155
3163
|
}
|
|
3156
|
-
function
|
|
3164
|
+
function ui(e, t) {
|
|
3157
3165
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3158
3166
|
return !1;
|
|
3159
|
-
const n =
|
|
3167
|
+
const n = ts(e), a = ts(t);
|
|
3160
3168
|
if (n === a)
|
|
3161
3169
|
return !0;
|
|
3162
3170
|
if (!n.includes(a))
|
|
@@ -3164,7 +3172,7 @@ function oi(e, t) {
|
|
|
3164
3172
|
const r = n.split(a).join("");
|
|
3165
3173
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3166
3174
|
}
|
|
3167
|
-
function
|
|
3175
|
+
function ss(e) {
|
|
3168
3176
|
const t = P(e.og_scrape_url) ?? P(e.title_link), n = P(e.image_url) ?? P(e.thumb_url), a = P(e.asset_url), r = P(e.mime_type);
|
|
3169
3177
|
return {
|
|
3170
3178
|
title: P(e.title),
|
|
@@ -3174,19 +3182,19 @@ function ts(e) {
|
|
|
3174
3182
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3175
3183
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3176
3184
|
sourceUrl: a,
|
|
3177
|
-
layout: n ||
|
|
3185
|
+
layout: n || yt(r, a) ? "featured" : "classic",
|
|
3178
3186
|
mimeType: r
|
|
3179
3187
|
};
|
|
3180
3188
|
}
|
|
3181
|
-
function
|
|
3189
|
+
function mi(e) {
|
|
3182
3190
|
var t;
|
|
3183
|
-
return
|
|
3191
|
+
return Ps(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3184
3192
|
}
|
|
3185
|
-
function
|
|
3193
|
+
function Ps(e) {
|
|
3186
3194
|
const t = P(e.og_scrape_url);
|
|
3187
3195
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3188
3196
|
}
|
|
3189
|
-
function
|
|
3197
|
+
function Fs(e) {
|
|
3190
3198
|
if (!(e != null && e.length)) return [];
|
|
3191
3199
|
const t = [], n = (r, i) => {
|
|
3192
3200
|
const l = t[t.length - 1];
|
|
@@ -3204,51 +3212,51 @@ function Ps(e) {
|
|
|
3204
3212
|
t.push({ type: "link", attachments: [r] });
|
|
3205
3213
|
};
|
|
3206
3214
|
for (const r of e) {
|
|
3207
|
-
if (
|
|
3215
|
+
if (Ps(r)) {
|
|
3208
3216
|
a(r);
|
|
3209
3217
|
continue;
|
|
3210
3218
|
}
|
|
3211
|
-
const i =
|
|
3219
|
+
const i = mi(r);
|
|
3212
3220
|
i && n(i, r);
|
|
3213
3221
|
}
|
|
3214
3222
|
return t;
|
|
3215
3223
|
}
|
|
3216
|
-
function
|
|
3224
|
+
function hi(e) {
|
|
3217
3225
|
let t = 0;
|
|
3218
3226
|
for (const n of e)
|
|
3219
3227
|
t += n.type === "link" ? n.attachments.length : 1;
|
|
3220
3228
|
return t;
|
|
3221
3229
|
}
|
|
3222
|
-
function
|
|
3230
|
+
function fi(e) {
|
|
3223
3231
|
return e.filter((t) => t.type === "media").length;
|
|
3224
3232
|
}
|
|
3225
|
-
function
|
|
3233
|
+
function gi(e, t, n) {
|
|
3226
3234
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3227
3235
|
}
|
|
3228
|
-
function
|
|
3236
|
+
function ns(e) {
|
|
3229
3237
|
return P(e.image_url) ?? P(e.asset_url) ?? "";
|
|
3230
3238
|
}
|
|
3231
|
-
function
|
|
3239
|
+
function pi(e) {
|
|
3232
3240
|
switch (e) {
|
|
3233
3241
|
case "image":
|
|
3234
|
-
return
|
|
3242
|
+
return ye.Image;
|
|
3235
3243
|
case "video":
|
|
3236
|
-
return
|
|
3244
|
+
return ye.Video;
|
|
3237
3245
|
case "audio":
|
|
3238
|
-
return
|
|
3246
|
+
return ye.Audio;
|
|
3239
3247
|
case "pdf":
|
|
3240
|
-
return
|
|
3248
|
+
return ye.Pdf;
|
|
3241
3249
|
default:
|
|
3242
|
-
return
|
|
3250
|
+
return ye.File;
|
|
3243
3251
|
}
|
|
3244
3252
|
}
|
|
3245
|
-
function
|
|
3253
|
+
function bi(e, t) {
|
|
3246
3254
|
if (t.length > 1)
|
|
3247
3255
|
switch (e) {
|
|
3248
3256
|
case "image":
|
|
3249
3257
|
return {
|
|
3250
3258
|
items: t.map((a) => ({
|
|
3251
|
-
src:
|
|
3259
|
+
src: ns(a),
|
|
3252
3260
|
alt: P(a.title)
|
|
3253
3261
|
}))
|
|
3254
3262
|
};
|
|
@@ -3299,7 +3307,7 @@ function fi(e, t) {
|
|
|
3299
3307
|
switch (e) {
|
|
3300
3308
|
case "image":
|
|
3301
3309
|
return {
|
|
3302
|
-
src:
|
|
3310
|
+
src: ns(n),
|
|
3303
3311
|
alt: P(n.title)
|
|
3304
3312
|
};
|
|
3305
3313
|
case "video":
|
|
@@ -3329,48 +3337,48 @@ function fi(e, t) {
|
|
|
3329
3337
|
};
|
|
3330
3338
|
}
|
|
3331
3339
|
}
|
|
3332
|
-
function
|
|
3340
|
+
function vi({
|
|
3333
3341
|
groupPosition: e,
|
|
3334
3342
|
isMyMessage: t,
|
|
3335
3343
|
segment: n,
|
|
3336
3344
|
text: a
|
|
3337
3345
|
}) {
|
|
3338
|
-
const r =
|
|
3339
|
-
...
|
|
3346
|
+
const r = pi(n.kind), i = {
|
|
3347
|
+
...bi(n.kind, n.attachments),
|
|
3340
3348
|
groupPosition: e,
|
|
3341
3349
|
...a ? { text: a } : {}
|
|
3342
3350
|
};
|
|
3343
3351
|
return t ? /* @__PURE__ */ s(r.Sent, { ...i }) : /* @__PURE__ */ s(r.Received, { ...i });
|
|
3344
3352
|
}
|
|
3345
|
-
const
|
|
3353
|
+
const xi = ({
|
|
3346
3354
|
groupPosition: e,
|
|
3347
3355
|
isMyMessage: t,
|
|
3348
3356
|
message: n
|
|
3349
3357
|
}) => {
|
|
3350
3358
|
var w;
|
|
3351
|
-
const a =
|
|
3359
|
+
const a = Fs(n.attachments);
|
|
3352
3360
|
if (a.length === 0) return null;
|
|
3353
|
-
const r =
|
|
3361
|
+
const r = hi(a), i = fi(a), l = (w = n.text) == null ? void 0 : w.trim(), o = a.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? ss(o.attachments[0] ?? {}).url : void 0, u = l && ui(l, d) ? void 0 : l;
|
|
3354
3362
|
let p = 0, h = 0;
|
|
3355
3363
|
const g = [], c = (b, f) => {
|
|
3356
3364
|
const x = p === r - 1;
|
|
3357
3365
|
p += 1;
|
|
3358
|
-
const N = t ?
|
|
3366
|
+
const N = t ? es.Sent : es.Received;
|
|
3359
3367
|
g.push(
|
|
3360
3368
|
/* @__PURE__ */ m(U.Fragment, { children: [
|
|
3361
|
-
/* @__PURE__ */ s(N, { ...
|
|
3362
|
-
x && u ? /* @__PURE__ */ s("div", { className: t ?
|
|
3369
|
+
/* @__PURE__ */ s(N, { ...ss(b) }),
|
|
3370
|
+
x && u ? /* @__PURE__ */ s("div", { className: t ? ci : di, children: u }) : null
|
|
3363
3371
|
] }, f)
|
|
3364
3372
|
);
|
|
3365
3373
|
}, v = (b, f) => {
|
|
3366
|
-
const x = p === r - 1, N =
|
|
3374
|
+
const x = p === r - 1, N = gi(
|
|
3367
3375
|
h,
|
|
3368
3376
|
i,
|
|
3369
3377
|
e
|
|
3370
3378
|
);
|
|
3371
3379
|
p += 1, h += 1, g.push(
|
|
3372
3380
|
/* @__PURE__ */ s(
|
|
3373
|
-
|
|
3381
|
+
vi,
|
|
3374
3382
|
{
|
|
3375
3383
|
groupPosition: N,
|
|
3376
3384
|
isMyMessage: t,
|
|
@@ -3389,9 +3397,9 @@ const pi = ({
|
|
|
3389
3397
|
return;
|
|
3390
3398
|
}
|
|
3391
3399
|
v(b, `media-${f}`);
|
|
3392
|
-
}), /* @__PURE__ */ s(
|
|
3393
|
-
},
|
|
3394
|
-
var
|
|
3400
|
+
}), /* @__PURE__ */ s(ee, { children: g });
|
|
3401
|
+
}, wi = (e) => {
|
|
3402
|
+
var At, Mt, Rt, Dt, Lt, zt, Pt, Ft, Ot, $t, jt, Bt, Ut, Vt;
|
|
3395
3403
|
const {
|
|
3396
3404
|
additionalMessageInputProps: t,
|
|
3397
3405
|
chatbotVotingEnabled: n,
|
|
@@ -3409,52 +3417,52 @@ const pi = ({
|
|
|
3409
3417
|
renderText: v,
|
|
3410
3418
|
threadList: w,
|
|
3411
3419
|
viewerLanguage: b
|
|
3412
|
-
} = e, { client: f } =
|
|
3413
|
-
Attachment:
|
|
3414
|
-
EditMessageModal: C =
|
|
3420
|
+
} = e, { client: f } = oe("CustomMessage"), { channel: x } = le("CustomMessage"), { isUnlocking: N, onUnlockClick: S, onFetchSource: T, onDownloadClick: M } = Br("LockedAttachment"), [L, D] = B(!1), O = Js(c.id), { selected: z, voteUp: y, voteDown: A } = xa(c), {
|
|
3421
|
+
Attachment: E = Zs,
|
|
3422
|
+
EditMessageModal: C = Qs,
|
|
3415
3423
|
MessageActions: I,
|
|
3416
|
-
MessageBlocked: $ =
|
|
3417
|
-
MessageBouncePrompt: F =
|
|
3418
|
-
MessageDeleted: V =
|
|
3419
|
-
MessageIsThreadReplyInChannelButtonIndicator: Q =
|
|
3420
|
-
MessageRepliesCountButton:
|
|
3421
|
-
ReminderNotification: X =
|
|
3422
|
-
StreamedMessageText: _ =
|
|
3424
|
+
MessageBlocked: $ = en,
|
|
3425
|
+
MessageBouncePrompt: F = tn,
|
|
3426
|
+
MessageDeleted: V = sn,
|
|
3427
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = nn,
|
|
3428
|
+
MessageRepliesCountButton: te = an,
|
|
3429
|
+
ReminderNotification: X = rn,
|
|
3430
|
+
StreamedMessageText: _ = ln,
|
|
3423
3431
|
PinIndicator: R
|
|
3424
|
-
} =
|
|
3432
|
+
} = is("CustomMessage"), H = on(c), q = cn(c), Y = se(
|
|
3425
3433
|
() => h == null ? void 0 : h(c),
|
|
3426
3434
|
[h, c]
|
|
3427
|
-
), j =
|
|
3428
|
-
const
|
|
3435
|
+
), j = se(() => {
|
|
3436
|
+
const me = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...me] : me;
|
|
3429
3437
|
if (!Fe(c)) return pe;
|
|
3430
|
-
const
|
|
3431
|
-
return
|
|
3432
|
-
}, [c]), W =
|
|
3433
|
-
() =>
|
|
3438
|
+
const Gt = pe.filter((Ht) => !("type" in Ht) || !ws(Ht));
|
|
3439
|
+
return Gt.length === pe.length ? pe : Gt;
|
|
3440
|
+
}, [c]), W = se(
|
|
3441
|
+
() => Fs(j),
|
|
3434
3442
|
[j]
|
|
3435
|
-
), Z =
|
|
3436
|
-
const
|
|
3437
|
-
return
|
|
3438
|
-
}, [c, b]),
|
|
3439
|
-
(
|
|
3443
|
+
), Z = se(() => {
|
|
3444
|
+
const me = hs({ message: c, viewerLanguage: b });
|
|
3445
|
+
return me === c.text ? c : { ...c, text: me };
|
|
3446
|
+
}, [c, b]), de = W.length > 0, De = W.reduce(
|
|
3447
|
+
(me, pe) => me + pe.attachments.length,
|
|
3440
3448
|
0
|
|
3441
|
-
) === ((j == null ? void 0 : j.length) ?? 0),
|
|
3449
|
+
) === ((j == null ? void 0 : j.length) ?? 0), Le = Xa(
|
|
3442
3450
|
{
|
|
3443
3451
|
endOfGroup: r,
|
|
3444
3452
|
firstOfGroup: i,
|
|
3445
3453
|
groupedByUser: l
|
|
3446
3454
|
}
|
|
3447
3455
|
);
|
|
3448
|
-
if (
|
|
3456
|
+
if (dn(c))
|
|
3449
3457
|
return null;
|
|
3450
3458
|
if (c.deleted_at || c.type === "deleted")
|
|
3451
3459
|
return /* @__PURE__ */ s(V, { message: c });
|
|
3452
|
-
if (
|
|
3460
|
+
if (un(c))
|
|
3453
3461
|
return /* @__PURE__ */ s($, {});
|
|
3454
|
-
const
|
|
3462
|
+
const ae = !w && !!c.reply_count, ue = !w && c.show_in_channel && c.parent_id, ie = c.status === "failed" && ((At = c.error) == null ? void 0 : At.status) !== 403, St = mn(c);
|
|
3455
3463
|
let he;
|
|
3456
|
-
ie ? he = () => u(c) :
|
|
3457
|
-
const fe = g(),
|
|
3464
|
+
ie ? he = () => u(c) : St && (he = () => D(!0));
|
|
3465
|
+
const fe = g(), Us = k(
|
|
3458
3466
|
"str-chat__message str-chat__message-simple",
|
|
3459
3467
|
`str-chat__message--${c.type}`,
|
|
3460
3468
|
`str-chat__message--${c.status}`,
|
|
@@ -3465,39 +3473,39 @@ const pi = ({
|
|
|
3465
3473
|
"str-chat__message--highlighted": p,
|
|
3466
3474
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3467
3475
|
"str-chat__message--with-reactions": q,
|
|
3468
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3469
|
-
"str-chat__message-with-thread-link":
|
|
3476
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Mt = c == null ? void 0 : c.error) == null ? void 0 : Mt.status) !== 403,
|
|
3477
|
+
"str-chat__message-with-thread-link": ae || ue,
|
|
3470
3478
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3471
3479
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3472
3480
|
"str-chat__virtual-message__wrapper--group": l
|
|
3473
3481
|
}
|
|
3474
|
-
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Et =
|
|
3475
|
-
return /* @__PURE__ */ m(
|
|
3482
|
+
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Et = Yr(c), ge = Fe(c), It = Hr(c), He = !!(j != null && j.length && !c.quoted_message), Tt = ge && fe && He, Vs = de && De && !c.quoted_message && !Ge && !Y && !ge;
|
|
3483
|
+
return /* @__PURE__ */ m(ee, { children: [
|
|
3476
3484
|
a && /* @__PURE__ */ s(
|
|
3477
3485
|
C,
|
|
3478
3486
|
{
|
|
3479
3487
|
additionalMessageInputProps: t
|
|
3480
3488
|
}
|
|
3481
3489
|
),
|
|
3482
|
-
|
|
3483
|
-
|
|
3490
|
+
L && /* @__PURE__ */ s(
|
|
3491
|
+
hn,
|
|
3484
3492
|
{
|
|
3485
3493
|
MessageBouncePrompt: F,
|
|
3486
|
-
onClose: () =>
|
|
3487
|
-
open:
|
|
3494
|
+
onClose: () => D(!1),
|
|
3495
|
+
open: L
|
|
3488
3496
|
}
|
|
3489
3497
|
),
|
|
3490
3498
|
/* @__PURE__ */ m(
|
|
3491
3499
|
"div",
|
|
3492
3500
|
{
|
|
3493
|
-
className:
|
|
3501
|
+
className: Us,
|
|
3494
3502
|
"data-message-id": c.id,
|
|
3495
3503
|
"data-dd-privacy": "mask",
|
|
3496
3504
|
children: [
|
|
3497
3505
|
R && /* @__PURE__ */ s(R, {}),
|
|
3498
3506
|
!!O && /* @__PURE__ */ s(X, { reminder: O }),
|
|
3499
3507
|
c.user && /* @__PURE__ */ s(
|
|
3500
|
-
|
|
3508
|
+
ne,
|
|
3501
3509
|
{
|
|
3502
3510
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3503
3511
|
id: c.user.id,
|
|
@@ -3512,7 +3520,7 @@ const pi = ({
|
|
|
3512
3520
|
"div",
|
|
3513
3521
|
{
|
|
3514
3522
|
className: k("str-chat__message-inner", {
|
|
3515
|
-
"str-chat__simple-message--error-failed": ie ||
|
|
3523
|
+
"str-chat__simple-message--error-failed": ie || St
|
|
3516
3524
|
}),
|
|
3517
3525
|
"data-testid": "message-inner",
|
|
3518
3526
|
onClick: he,
|
|
@@ -3525,34 +3533,34 @@ const pi = ({
|
|
|
3525
3533
|
marginInlineEnd: 0,
|
|
3526
3534
|
marginInlineStart: 0
|
|
3527
3535
|
},
|
|
3528
|
-
children:
|
|
3536
|
+
children: It ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3529
3537
|
fe ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3530
3538
|
I && /* @__PURE__ */ s(I, {}),
|
|
3531
3539
|
/* @__PURE__ */ s(
|
|
3532
|
-
|
|
3540
|
+
Zt.Sent,
|
|
3533
3541
|
{
|
|
3534
|
-
title: (
|
|
3535
|
-
mimeType: (
|
|
3542
|
+
title: (Rt = c.metadata) == null ? void 0 : Rt.attachment_title,
|
|
3543
|
+
mimeType: (Dt = c.metadata) == null ? void 0 : Dt.attachment_mime_type,
|
|
3536
3544
|
thumbnailUrl: (Lt = c.metadata) == null ? void 0 : Lt.attachment_thumbnail,
|
|
3537
|
-
amountText: (
|
|
3538
|
-
detail: (
|
|
3539
|
-
paymentStatus: (
|
|
3540
|
-
onPreviewClick: () =>
|
|
3545
|
+
amountText: (zt = c.metadata) == null ? void 0 : zt.amount_text,
|
|
3546
|
+
detail: (Pt = c.metadata) == null ? void 0 : Pt.attachment_detail,
|
|
3547
|
+
paymentStatus: (Ft = c.metadata) == null ? void 0 : Ft.payment_status,
|
|
3548
|
+
onPreviewClick: () => S == null ? void 0 : S(c, x),
|
|
3541
3549
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x))
|
|
3542
3550
|
}
|
|
3543
3551
|
)
|
|
3544
3552
|
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3545
3553
|
/* @__PURE__ */ s(
|
|
3546
|
-
|
|
3554
|
+
Zt.Received,
|
|
3547
3555
|
{
|
|
3548
|
-
title: (
|
|
3549
|
-
mimeType: (
|
|
3550
|
-
thumbnailUrl: (
|
|
3551
|
-
amountText: (
|
|
3552
|
-
detail: (
|
|
3553
|
-
paymentStatus: (
|
|
3556
|
+
title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
|
|
3557
|
+
mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
|
|
3558
|
+
thumbnailUrl: (jt = c.metadata) == null ? void 0 : jt.attachment_thumbnail,
|
|
3559
|
+
amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
|
|
3560
|
+
detail: (Ut = c.metadata) == null ? void 0 : Ut.attachment_detail,
|
|
3561
|
+
paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
|
|
3554
3562
|
isUnlocking: N(c.id),
|
|
3555
|
-
onUnlockClick: () =>
|
|
3563
|
+
onUnlockClick: () => S == null ? void 0 : S(c, x),
|
|
3556
3564
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x)),
|
|
3557
3565
|
onDownloadClick: () => M == null ? void 0 : M(c, x)
|
|
3558
3566
|
}
|
|
@@ -3560,7 +3568,7 @@ const pi = ({
|
|
|
3560
3568
|
I && /* @__PURE__ */ s(I, {})
|
|
3561
3569
|
] }),
|
|
3562
3570
|
c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
|
|
3563
|
-
|
|
3571
|
+
qt,
|
|
3564
3572
|
{
|
|
3565
3573
|
message: Z,
|
|
3566
3574
|
renderText: v
|
|
@@ -3569,7 +3577,7 @@ const pi = ({
|
|
|
3569
3577
|
] }) : Et ? (
|
|
3570
3578
|
/* Tip-only messages render as a standalone bubble */
|
|
3571
3579
|
/* @__PURE__ */ s(Ke, { message: c, standalone: !0 })
|
|
3572
|
-
) :
|
|
3580
|
+
) : Vs ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m(
|
|
3573
3581
|
"div",
|
|
3574
3582
|
{
|
|
3575
3583
|
className: "str-chat__message-bubble",
|
|
@@ -3581,9 +3589,9 @@ const pi = ({
|
|
|
3581
3589
|
},
|
|
3582
3590
|
children: [
|
|
3583
3591
|
/* @__PURE__ */ s(
|
|
3584
|
-
|
|
3592
|
+
xi,
|
|
3585
3593
|
{
|
|
3586
|
-
groupPosition:
|
|
3594
|
+
groupPosition: Le,
|
|
3587
3595
|
isMyMessage: fe,
|
|
3588
3596
|
message: {
|
|
3589
3597
|
attachments: j,
|
|
@@ -3591,11 +3599,11 @@ const pi = ({
|
|
|
3591
3599
|
}
|
|
3592
3600
|
}
|
|
3593
3601
|
),
|
|
3594
|
-
/* @__PURE__ */ s(
|
|
3602
|
+
/* @__PURE__ */ s(Wt, {})
|
|
3595
3603
|
]
|
|
3596
3604
|
}
|
|
3597
3605
|
) }) : /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m("div", { className: "str-chat__message-bubble", children: [
|
|
3598
|
-
ge && !
|
|
3606
|
+
ge && !Tt && /* @__PURE__ */ s(
|
|
3599
3607
|
Ke,
|
|
3600
3608
|
{
|
|
3601
3609
|
message: c,
|
|
@@ -3603,9 +3611,9 @@ const pi = ({
|
|
|
3603
3611
|
isMyMessage: fe
|
|
3604
3612
|
}
|
|
3605
3613
|
),
|
|
3606
|
-
Ge && /* @__PURE__ */ s(
|
|
3614
|
+
Ge && /* @__PURE__ */ s(fn, { poll: Ge }),
|
|
3607
3615
|
j != null && j.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3608
|
-
|
|
3616
|
+
E,
|
|
3609
3617
|
{
|
|
3610
3618
|
actionHandler: o,
|
|
3611
3619
|
attachments: j
|
|
@@ -3618,18 +3626,18 @@ const pi = ({
|
|
|
3618
3626
|
renderText: v
|
|
3619
3627
|
}
|
|
3620
3628
|
) : /* @__PURE__ */ s(
|
|
3621
|
-
|
|
3629
|
+
qt,
|
|
3622
3630
|
{
|
|
3623
3631
|
message: Z,
|
|
3624
3632
|
renderText: v
|
|
3625
3633
|
}
|
|
3626
3634
|
),
|
|
3627
|
-
/* @__PURE__ */ s(
|
|
3635
|
+
/* @__PURE__ */ s(Wt, {})
|
|
3628
3636
|
] }) })
|
|
3629
3637
|
}
|
|
3630
3638
|
),
|
|
3631
|
-
!
|
|
3632
|
-
(!ge ||
|
|
3639
|
+
!It && !Et && /* @__PURE__ */ m("div", { className: "str-chat__message-footer", children: [
|
|
3640
|
+
(!ge || Tt) && /* @__PURE__ */ s(
|
|
3633
3641
|
Ke,
|
|
3634
3642
|
{
|
|
3635
3643
|
message: c,
|
|
@@ -3638,7 +3646,7 @@ const pi = ({
|
|
|
3638
3646
|
}
|
|
3639
3647
|
),
|
|
3640
3648
|
n && ge && /* @__PURE__ */ s(
|
|
3641
|
-
|
|
3649
|
+
qr,
|
|
3642
3650
|
{
|
|
3643
3651
|
selected: z,
|
|
3644
3652
|
onVoteUp: y,
|
|
@@ -3646,64 +3654,64 @@ const pi = ({
|
|
|
3646
3654
|
}
|
|
3647
3655
|
)
|
|
3648
3656
|
] }),
|
|
3649
|
-
/* @__PURE__ */ s(
|
|
3650
|
-
|
|
3651
|
-
|
|
3657
|
+
/* @__PURE__ */ s(Xr, {}),
|
|
3658
|
+
ae && /* @__PURE__ */ s(
|
|
3659
|
+
te,
|
|
3652
3660
|
{
|
|
3653
3661
|
onClick: d,
|
|
3654
3662
|
reply_count: c.reply_count
|
|
3655
3663
|
}
|
|
3656
3664
|
),
|
|
3657
|
-
|
|
3665
|
+
ue && /* @__PURE__ */ s(Q, {})
|
|
3658
3666
|
]
|
|
3659
3667
|
},
|
|
3660
3668
|
c.id
|
|
3661
3669
|
)
|
|
3662
3670
|
] });
|
|
3663
|
-
},
|
|
3664
|
-
|
|
3665
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
3666
|
-
),
|
|
3667
|
-
const t =
|
|
3668
|
-
return /* @__PURE__ */ s(
|
|
3669
|
-
},
|
|
3671
|
+
}, _i = U.memo(
|
|
3672
|
+
wi,
|
|
3673
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ks(e, t)
|
|
3674
|
+
), Ni = (e) => {
|
|
3675
|
+
const t = _e("CustomMessage");
|
|
3676
|
+
return /* @__PURE__ */ s(_i, { ...t, ...e });
|
|
3677
|
+
}, yi = () => {
|
|
3670
3678
|
var n;
|
|
3671
|
-
const { handleDelete: e, message: t } =
|
|
3679
|
+
const { handleDelete: e, message: t } = _e("CustomMessageActions");
|
|
3672
3680
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
3673
|
-
|
|
3681
|
+
ds,
|
|
3674
3682
|
{
|
|
3675
3683
|
onClick: e,
|
|
3676
3684
|
"aria-label": "Delete",
|
|
3677
3685
|
title: "Delete",
|
|
3678
3686
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3679
|
-
children: /* @__PURE__ */ s(
|
|
3687
|
+
children: /* @__PURE__ */ s(Zn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3680
3688
|
}
|
|
3681
3689
|
);
|
|
3682
|
-
},
|
|
3683
|
-
const { handleFlag: e } =
|
|
3690
|
+
}, ki = () => {
|
|
3691
|
+
const { handleFlag: e } = _e("CustomMessageActions");
|
|
3684
3692
|
return /* @__PURE__ */ s(
|
|
3685
|
-
|
|
3693
|
+
ds,
|
|
3686
3694
|
{
|
|
3687
3695
|
onClick: e,
|
|
3688
3696
|
"aria-label": "Report",
|
|
3689
3697
|
title: "Report",
|
|
3690
3698
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3691
|
-
children: /* @__PURE__ */ s(
|
|
3699
|
+
children: /* @__PURE__ */ s(ls, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3692
3700
|
}
|
|
3693
3701
|
);
|
|
3694
|
-
},
|
|
3702
|
+
}, Ci = () => {
|
|
3695
3703
|
var t;
|
|
3696
|
-
const { message: e } =
|
|
3704
|
+
const { message: e } = _e("CustomMessageActions");
|
|
3697
3705
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3698
|
-
|
|
3706
|
+
ta,
|
|
3699
3707
|
{
|
|
3700
3708
|
messageActionSet: [
|
|
3701
|
-
{ Component:
|
|
3702
|
-
{ Component:
|
|
3709
|
+
{ Component: yi, placement: "quick", type: "delete" },
|
|
3710
|
+
{ Component: ki, placement: "quick", type: "flag" }
|
|
3703
3711
|
]
|
|
3704
3712
|
}
|
|
3705
3713
|
);
|
|
3706
|
-
},
|
|
3714
|
+
}, Si = ({
|
|
3707
3715
|
link: e,
|
|
3708
3716
|
onDismiss: t
|
|
3709
3717
|
}) => {
|
|
@@ -3743,14 +3751,14 @@ const pi = ({
|
|
|
3743
3751
|
]
|
|
3744
3752
|
}
|
|
3745
3753
|
);
|
|
3746
|
-
},
|
|
3754
|
+
}, Ei = (e) => ({
|
|
3747
3755
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3748
|
-
(t) =>
|
|
3756
|
+
(t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
|
|
3749
3757
|
)
|
|
3750
|
-
}),
|
|
3751
|
-
const { linkPreviewsManager: e } =
|
|
3758
|
+
}), Ii = () => {
|
|
3759
|
+
const { linkPreviewsManager: e } = gn(), { linkPreviews: t } = pn(
|
|
3752
3760
|
e.state,
|
|
3753
|
-
|
|
3761
|
+
Ei
|
|
3754
3762
|
), n = (r) => {
|
|
3755
3763
|
e.dismissPreview(r);
|
|
3756
3764
|
};
|
|
@@ -3763,9 +3771,9 @@ const pi = ({
|
|
|
3763
3771
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3764
3772
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3765
3773
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3766
|
-
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(
|
|
3774
|
+
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(Si, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3767
3775
|
) : null;
|
|
3768
|
-
},
|
|
3776
|
+
}, Ct = U.createContext(!1), hl = () => Ie(Ct), Ti = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3769
3777
|
"button",
|
|
3770
3778
|
{
|
|
3771
3779
|
...n,
|
|
@@ -3773,13 +3781,13 @@ const pi = ({
|
|
|
3773
3781
|
"aria-label": "Send",
|
|
3774
3782
|
disabled: t,
|
|
3775
3783
|
onClick: e,
|
|
3776
|
-
children: /* @__PURE__ */ s(
|
|
3784
|
+
children: /* @__PURE__ */ s(Qn, { weight: "bold", className: "size-4" })
|
|
3777
3785
|
}
|
|
3778
|
-
),
|
|
3779
|
-
const e =
|
|
3780
|
-
SendButton: r =
|
|
3781
|
-
AttachmentPreviewList: i =
|
|
3782
|
-
} =
|
|
3786
|
+
), Ai = () => {
|
|
3787
|
+
const e = Ie(Ct), { handleSubmit: t } = vn(), n = xn(), a = e || !n, {
|
|
3788
|
+
SendButton: r = Ti,
|
|
3789
|
+
AttachmentPreviewList: i = wn
|
|
3790
|
+
} = is("CustomMessageInput");
|
|
3783
3791
|
return (
|
|
3784
3792
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3785
3793
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3795,12 +3803,12 @@ const pi = ({
|
|
|
3795
3803
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
3796
3804
|
"data-dd-privacy": "mask",
|
|
3797
3805
|
children: [
|
|
3798
|
-
/* @__PURE__ */ s(
|
|
3799
|
-
/* @__PURE__ */ s(
|
|
3806
|
+
/* @__PURE__ */ s(_n, {}),
|
|
3807
|
+
/* @__PURE__ */ s(Ii, {}),
|
|
3800
3808
|
/* @__PURE__ */ s(i, {}),
|
|
3801
3809
|
/* @__PURE__ */ m("div", { className: "flex shrink-0", children: [
|
|
3802
3810
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
3803
|
-
|
|
3811
|
+
Nn,
|
|
3804
3812
|
{
|
|
3805
3813
|
"aria-disabled": e || void 0,
|
|
3806
3814
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3826,7 +3834,7 @@ const pi = ({
|
|
|
3826
3834
|
}
|
|
3827
3835
|
)
|
|
3828
3836
|
);
|
|
3829
|
-
},
|
|
3837
|
+
}, Mi = ({
|
|
3830
3838
|
renderActions: e,
|
|
3831
3839
|
renderFooter: t,
|
|
3832
3840
|
disabled: n = !1,
|
|
@@ -3834,8 +3842,8 @@ const pi = ({
|
|
|
3834
3842
|
composerInput: r
|
|
3835
3843
|
}) => {
|
|
3836
3844
|
var o;
|
|
3837
|
-
const { channel: i } =
|
|
3838
|
-
return n ? /* @__PURE__ */ m(
|
|
3845
|
+
const { channel: i } = le(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
3846
|
+
return n ? /* @__PURE__ */ m(ee, { children: [
|
|
3839
3847
|
/* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
3840
3848
|
t == null ? void 0 : t()
|
|
3841
3849
|
] }) : /* @__PURE__ */ m("div", { className: "flex min-h-0 flex-col gap-4 p-4", children: [
|
|
@@ -3847,67 +3855,67 @@ const pi = ({
|
|
|
3847
3855
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3848
3856
|
children: [
|
|
3849
3857
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3850
|
-
/* @__PURE__ */ s(
|
|
3858
|
+
/* @__PURE__ */ s(Ct.Provider, { value: l, children: /* @__PURE__ */ s(bn, { Input: r ?? Ai }) })
|
|
3851
3859
|
]
|
|
3852
3860
|
}
|
|
3853
3861
|
),
|
|
3854
3862
|
t == null ? void 0 : t()
|
|
3855
3863
|
] });
|
|
3856
|
-
},
|
|
3864
|
+
}, Ri = [
|
|
3857
3865
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3858
3866
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3859
|
-
],
|
|
3867
|
+
], Di = {
|
|
3860
3868
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3861
3869
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3862
|
-
},
|
|
3870
|
+
}, Li = [
|
|
3863
3871
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3864
|
-
],
|
|
3872
|
+
], zi = {
|
|
3865
3873
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3866
|
-
},
|
|
3874
|
+
}, Ze = "age safety guidelines.", Pi = "https://linktr.ee/s/about/contact", as = (e) => Ri.includes(e), Fi = (e) => Li.includes(e), Oi = (e) => {
|
|
3867
3875
|
var a;
|
|
3868
3876
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3869
|
-
if (
|
|
3877
|
+
if (as(t))
|
|
3870
3878
|
return {
|
|
3871
3879
|
kind: "dm-agent",
|
|
3872
3880
|
type: t
|
|
3873
3881
|
};
|
|
3874
|
-
if (
|
|
3882
|
+
if (Fi(t))
|
|
3875
3883
|
return {
|
|
3876
3884
|
kind: "age-safety",
|
|
3877
3885
|
type: t
|
|
3878
3886
|
};
|
|
3879
3887
|
const n = e.dm_agent_system_type;
|
|
3880
|
-
if (
|
|
3888
|
+
if (as(n))
|
|
3881
3889
|
return {
|
|
3882
3890
|
kind: "dm-agent",
|
|
3883
3891
|
type: n
|
|
3884
3892
|
};
|
|
3885
|
-
},
|
|
3886
|
-
const t = e.indexOf(
|
|
3893
|
+
}, $i = (e) => {
|
|
3894
|
+
const t = e.indexOf(Ze);
|
|
3887
3895
|
if (t === -1)
|
|
3888
3896
|
return e;
|
|
3889
|
-
const n = t +
|
|
3890
|
-
return /* @__PURE__ */ m(
|
|
3897
|
+
const n = t + Ze.length;
|
|
3898
|
+
return /* @__PURE__ */ m(ee, { children: [
|
|
3891
3899
|
e.slice(0, t),
|
|
3892
3900
|
/* @__PURE__ */ s(
|
|
3893
3901
|
"a",
|
|
3894
3902
|
{
|
|
3895
|
-
href:
|
|
3903
|
+
href: Pi,
|
|
3896
3904
|
target: "_blank",
|
|
3897
3905
|
rel: "noopener noreferrer",
|
|
3898
3906
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
3899
|
-
children:
|
|
3907
|
+
children: Ze
|
|
3900
3908
|
}
|
|
3901
3909
|
),
|
|
3902
3910
|
e.slice(n)
|
|
3903
3911
|
] });
|
|
3904
|
-
},
|
|
3912
|
+
}, ji = (e) => {
|
|
3905
3913
|
var a, r;
|
|
3906
|
-
const t = e.message.hide_date === !0, n =
|
|
3914
|
+
const t = e.message.hide_date === !0, n = Oi(
|
|
3907
3915
|
e.message
|
|
3908
3916
|
);
|
|
3909
3917
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
3910
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3918
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Di[n.type];
|
|
3911
3919
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3912
3920
|
/* @__PURE__ */ m(
|
|
3913
3921
|
"div",
|
|
@@ -3933,7 +3941,7 @@ const pi = ({
|
|
|
3933
3941
|
] });
|
|
3934
3942
|
}
|
|
3935
3943
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
3936
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
3944
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || zi[n.type];
|
|
3937
3945
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3938
3946
|
/* @__PURE__ */ m(
|
|
3939
3947
|
"div",
|
|
@@ -3943,7 +3951,7 @@ const pi = ({
|
|
|
3943
3951
|
"data-age-safety-system-type": n.type,
|
|
3944
3952
|
children: [
|
|
3945
3953
|
/* @__PURE__ */ s(
|
|
3946
|
-
|
|
3954
|
+
ea,
|
|
3947
3955
|
{
|
|
3948
3956
|
size: 24,
|
|
3949
3957
|
weight: "duotone",
|
|
@@ -3952,7 +3960,7 @@ const pi = ({
|
|
|
3952
3960
|
"data-testid": "age-safety-system-message-icon"
|
|
3953
3961
|
}
|
|
3954
3962
|
),
|
|
3955
|
-
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
3963
|
+
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: $i(i) }) })
|
|
3956
3964
|
]
|
|
3957
3965
|
}
|
|
3958
3966
|
),
|
|
@@ -3967,7 +3975,7 @@ const pi = ({
|
|
|
3967
3975
|
] }),
|
|
3968
3976
|
!t && /* @__PURE__ */ s(Ye, { message: e.message })
|
|
3969
3977
|
] });
|
|
3970
|
-
},
|
|
3978
|
+
}, Os = rt(!1), Qe = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
|
|
3971
3979
|
"animateTransform",
|
|
3972
3980
|
{
|
|
3973
3981
|
attributeName: "transform",
|
|
@@ -3977,17 +3985,17 @@ const pi = ({
|
|
|
3977
3985
|
begin: `${120 * t}ms`,
|
|
3978
3986
|
repeatCount: "indefinite"
|
|
3979
3987
|
}
|
|
3980
|
-
) }),
|
|
3988
|
+
) }), Bi = /* @__PURE__ */ new Set([
|
|
3981
3989
|
qe.Thinking,
|
|
3982
3990
|
qe.Generating,
|
|
3983
3991
|
qe.ExternalSources
|
|
3984
|
-
]),
|
|
3992
|
+
]), Ui = ({ threadList: e }) => {
|
|
3985
3993
|
var v, w;
|
|
3986
|
-
const { channel: t, channelConfig: n, thread: a } =
|
|
3987
|
-
if (!e && o &&
|
|
3988
|
-
const b =
|
|
3994
|
+
const { channel: t, channelConfig: n, thread: a } = le(), { client: r } = oe(), { typing: i = {} } = yn(), { aiState: l } = kn(t), o = Ie(Os);
|
|
3995
|
+
if (!e && o && Bi.has(l)) {
|
|
3996
|
+
const b = Vi(t, (v = r.user) == null ? void 0 : v.id);
|
|
3989
3997
|
return /* @__PURE__ */ s(
|
|
3990
|
-
|
|
3998
|
+
rs,
|
|
3991
3999
|
{
|
|
3992
4000
|
avatarId: (b == null ? void 0 : b.id) ?? "ai-agent",
|
|
3993
4001
|
avatarName: (b == null ? void 0 : b.name) ?? (b == null ? void 0 : b.id) ?? "Agent",
|
|
@@ -4013,7 +4021,7 @@ const pi = ({
|
|
|
4013
4021
|
return null;
|
|
4014
4022
|
const g = (w = h[0]) == null ? void 0 : w.user, c = g != null && g.id && t.state.members[g.id] ? t.state.members[g.id].user : void 0;
|
|
4015
4023
|
return /* @__PURE__ */ s(
|
|
4016
|
-
|
|
4024
|
+
rs,
|
|
4017
4025
|
{
|
|
4018
4026
|
avatarId: (g == null ? void 0 : g.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
4019
4027
|
avatarName: (g == null ? void 0 : g.name) ?? (c == null ? void 0 : c.name) ?? (g == null ? void 0 : g.id) ?? "Typing user",
|
|
@@ -4021,7 +4029,7 @@ const pi = ({
|
|
|
4021
4029
|
testId: "typing-indicator"
|
|
4022
4030
|
}
|
|
4023
4031
|
);
|
|
4024
|
-
},
|
|
4032
|
+
}, rs = ({
|
|
4025
4033
|
avatarId: e,
|
|
4026
4034
|
avatarName: t,
|
|
4027
4035
|
avatarImage: n,
|
|
@@ -4036,7 +4044,7 @@ const pi = ({
|
|
|
4036
4044
|
},
|
|
4037
4045
|
children: /* @__PURE__ */ m("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
4038
4046
|
/* @__PURE__ */ s(
|
|
4039
|
-
|
|
4047
|
+
ne,
|
|
4040
4048
|
{
|
|
4041
4049
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4042
4050
|
id: e,
|
|
@@ -4056,16 +4064,16 @@ const pi = ({
|
|
|
4056
4064
|
height: "13",
|
|
4057
4065
|
overflow: "visible",
|
|
4058
4066
|
children: [
|
|
4059
|
-
/* @__PURE__ */ s(
|
|
4060
|
-
/* @__PURE__ */ s(
|
|
4061
|
-
/* @__PURE__ */ s(
|
|
4067
|
+
/* @__PURE__ */ s(Qe, { cx: "4", index: 0 }),
|
|
4068
|
+
/* @__PURE__ */ s(Qe, { cx: "16", index: 1 }),
|
|
4069
|
+
/* @__PURE__ */ s(Qe, { cx: "28", index: 2 })
|
|
4062
4070
|
]
|
|
4063
4071
|
}
|
|
4064
4072
|
) }) }) }) }) })
|
|
4065
4073
|
] })
|
|
4066
4074
|
}
|
|
4067
4075
|
);
|
|
4068
|
-
function
|
|
4076
|
+
function Vi(e, t) {
|
|
4069
4077
|
var a;
|
|
4070
4078
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4071
4079
|
for (const r of Object.values(n)) {
|
|
@@ -4074,7 +4082,7 @@ function ji(e, t) {
|
|
|
4074
4082
|
return i;
|
|
4075
4083
|
}
|
|
4076
4084
|
}
|
|
4077
|
-
const
|
|
4085
|
+
const Gi = () => null, Hi = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
4078
4086
|
"div",
|
|
4079
4087
|
{
|
|
4080
4088
|
className: k("flex items-center justify-center h-full", e),
|
|
@@ -4118,11 +4126,11 @@ const Bi = () => null, Ui = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
|
4118
4126
|
]
|
|
4119
4127
|
}
|
|
4120
4128
|
), je = U.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
4121
|
-
/* @__PURE__ */ s(
|
|
4129
|
+
/* @__PURE__ */ s(Hi, { className: "w-6 h-6" }),
|
|
4122
4130
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4123
4131
|
] }) }));
|
|
4124
4132
|
je.displayName = "LoadingState";
|
|
4125
|
-
const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant",
|
|
4133
|
+
const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant", Yi = ({
|
|
4126
4134
|
onBack: e,
|
|
4127
4135
|
showBackButton: t,
|
|
4128
4136
|
showStarButton: n = !1,
|
|
@@ -4141,8 +4149,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4141
4149
|
onParticipantNameClick: w,
|
|
4142
4150
|
renderHeaderTitleBadges: b
|
|
4143
4151
|
}) => {
|
|
4144
|
-
var A,
|
|
4145
|
-
const { channel: f } =
|
|
4152
|
+
var A, E, C, I, $, F;
|
|
4153
|
+
const { channel: f } = le(), { client: x } = oe(), N = U.useMemo(
|
|
4146
4154
|
() => {
|
|
4147
4155
|
var V;
|
|
4148
4156
|
return Ue(
|
|
@@ -4152,12 +4160,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4152
4160
|
);
|
|
4153
4161
|
},
|
|
4154
4162
|
[(A = f.state) == null ? void 0 : A.members, x == null ? void 0 : x.userID, f.type]
|
|
4155
|
-
),
|
|
4163
|
+
), S = ct(N == null ? void 0 : N.user), T = (E = N == null ? void 0 : N.user) == null ? void 0 : E.image, M = ot(f), L = b == null ? void 0 : b({
|
|
4156
4164
|
channel: f,
|
|
4157
4165
|
participant: N
|
|
4158
|
-
}),
|
|
4159
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children:
|
|
4160
|
-
|
|
4166
|
+
}), D = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", O = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ m(ee, { children: [
|
|
4167
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: S }),
|
|
4168
|
+
L && /* @__PURE__ */ s("span", { className: "shrink-0", children: L })
|
|
4161
4169
|
] }), y = async () => {
|
|
4162
4170
|
try {
|
|
4163
4171
|
M ? await f.unpin() : await f.pin();
|
|
@@ -4181,7 +4189,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4181
4189
|
}),
|
|
4182
4190
|
type: "button",
|
|
4183
4191
|
"aria-label": "Back to conversations",
|
|
4184
|
-
children: /* @__PURE__ */ s(
|
|
4192
|
+
children: /* @__PURE__ */ s(et, { className: "size-5 text-black/90" })
|
|
4185
4193
|
}
|
|
4186
4194
|
) }),
|
|
4187
4195
|
/* @__PURE__ */ s(
|
|
@@ -4194,17 +4202,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4194
4202
|
{
|
|
4195
4203
|
type: "button",
|
|
4196
4204
|
onClick: w,
|
|
4197
|
-
"aria-label": `View details for ${
|
|
4205
|
+
"aria-label": `View details for ${S}`,
|
|
4198
4206
|
className: k(
|
|
4199
|
-
|
|
4207
|
+
D,
|
|
4200
4208
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4201
4209
|
),
|
|
4202
4210
|
children: [
|
|
4203
4211
|
/* @__PURE__ */ s(
|
|
4204
|
-
|
|
4212
|
+
ne,
|
|
4205
4213
|
{
|
|
4206
4214
|
id: ((C = N == null ? void 0 : N.user) == null ? void 0 : C.id) || f.id || "unknown",
|
|
4207
|
-
name:
|
|
4215
|
+
name: S,
|
|
4208
4216
|
image: T,
|
|
4209
4217
|
starred: n && M,
|
|
4210
4218
|
dmAgentEnabled: a,
|
|
@@ -4221,12 +4229,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4221
4229
|
] })
|
|
4222
4230
|
]
|
|
4223
4231
|
}
|
|
4224
|
-
) : /* @__PURE__ */ m("div", { className:
|
|
4232
|
+
) : /* @__PURE__ */ m("div", { className: D, children: [
|
|
4225
4233
|
/* @__PURE__ */ s(
|
|
4226
|
-
|
|
4234
|
+
ne,
|
|
4227
4235
|
{
|
|
4228
4236
|
id: ((I = N == null ? void 0 : N.user) == null ? void 0 : I.id) || f.id || "unknown",
|
|
4229
|
-
name:
|
|
4237
|
+
name: S,
|
|
4230
4238
|
image: T,
|
|
4231
4239
|
starred: n && M,
|
|
4232
4240
|
dmAgentEnabled: a,
|
|
@@ -4271,7 +4279,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4271
4279
|
}
|
|
4272
4280
|
),
|
|
4273
4281
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4274
|
-
|
|
4282
|
+
st,
|
|
4275
4283
|
{
|
|
4276
4284
|
channel: f,
|
|
4277
4285
|
participant: N,
|
|
@@ -4301,7 +4309,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4301
4309
|
type: "button",
|
|
4302
4310
|
onClick: e,
|
|
4303
4311
|
"aria-label": "Back to conversations",
|
|
4304
|
-
children: /* @__PURE__ */ s(
|
|
4312
|
+
children: /* @__PURE__ */ s(et, { className: "size-5 text-black/90" })
|
|
4305
4313
|
}
|
|
4306
4314
|
),
|
|
4307
4315
|
w ? /* @__PURE__ */ m(
|
|
@@ -4309,17 +4317,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4309
4317
|
{
|
|
4310
4318
|
type: "button",
|
|
4311
4319
|
onClick: w,
|
|
4312
|
-
"aria-label": `View details for ${
|
|
4320
|
+
"aria-label": `View details for ${S}`,
|
|
4313
4321
|
className: k(
|
|
4314
4322
|
O,
|
|
4315
4323
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4316
4324
|
),
|
|
4317
4325
|
children: [
|
|
4318
4326
|
/* @__PURE__ */ s(
|
|
4319
|
-
|
|
4327
|
+
ne,
|
|
4320
4328
|
{
|
|
4321
4329
|
id: (($ = N == null ? void 0 : N.user) == null ? void 0 : $.id) || f.id || "unknown",
|
|
4322
|
-
name:
|
|
4330
|
+
name: S,
|
|
4323
4331
|
image: T,
|
|
4324
4332
|
starred: n && M,
|
|
4325
4333
|
dmAgentEnabled: a,
|
|
@@ -4340,10 +4348,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4340
4348
|
}
|
|
4341
4349
|
) : /* @__PURE__ */ m("div", { className: O, children: [
|
|
4342
4350
|
/* @__PURE__ */ s(
|
|
4343
|
-
|
|
4351
|
+
ne,
|
|
4344
4352
|
{
|
|
4345
4353
|
id: ((F = N == null ? void 0 : N.user) == null ? void 0 : F.id) || f.id || "unknown",
|
|
4346
|
-
name:
|
|
4354
|
+
name: S,
|
|
4347
4355
|
image: T,
|
|
4348
4356
|
starred: n && M,
|
|
4349
4357
|
dmAgentEnabled: a,
|
|
@@ -4389,7 +4397,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4389
4397
|
}
|
|
4390
4398
|
),
|
|
4391
4399
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4392
|
-
|
|
4400
|
+
st,
|
|
4393
4401
|
{
|
|
4394
4402
|
channel: f,
|
|
4395
4403
|
participant: N,
|
|
@@ -4408,7 +4416,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4408
4416
|
] })
|
|
4409
4417
|
] })
|
|
4410
4418
|
] });
|
|
4411
|
-
},
|
|
4419
|
+
}, qi = ({
|
|
4412
4420
|
onBack: e,
|
|
4413
4421
|
showBackButton: t,
|
|
4414
4422
|
renderMessageInputActions: n,
|
|
@@ -4429,16 +4437,16 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4429
4437
|
renderChannelBanner: f,
|
|
4430
4438
|
renderHeaderTitleBadges: x,
|
|
4431
4439
|
customChannelActions: N,
|
|
4432
|
-
renderChannelActions:
|
|
4440
|
+
renderChannelActions: S,
|
|
4433
4441
|
renderMessage: T,
|
|
4434
4442
|
dmAgentEnabled: M = !1,
|
|
4435
|
-
viewerLanguage:
|
|
4436
|
-
showChannelInfo:
|
|
4443
|
+
viewerLanguage: L,
|
|
4444
|
+
showChannelInfo: D = !0,
|
|
4437
4445
|
onParticipantNameClick: O,
|
|
4438
4446
|
composerInput: z
|
|
4439
4447
|
}) => {
|
|
4440
4448
|
var _, R, H, q;
|
|
4441
|
-
const { channel: y } =
|
|
4449
|
+
const { channel: y } = le(), { client: A } = oe(), E = U.useMemo(
|
|
4442
4450
|
() => {
|
|
4443
4451
|
var Y;
|
|
4444
4452
|
return Ue(
|
|
@@ -4452,17 +4460,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4452
4460
|
var W;
|
|
4453
4461
|
const Y = A == null ? void 0 : A.userID;
|
|
4454
4462
|
return Y ? Object.values(((W = y.state) == null ? void 0 : W.members) || {}).find((Z) => {
|
|
4455
|
-
var
|
|
4456
|
-
return ((
|
|
4463
|
+
var de;
|
|
4464
|
+
return ((de = Z.user) == null ? void 0 : de.id) === Y;
|
|
4457
4465
|
}) : void 0;
|
|
4458
|
-
}, [A == null ? void 0 : A.userID, (R = y.state) == null ? void 0 : R.members]), I = ((H = C == null ? void 0 : C.user) == null ? void 0 : H.is_account) ?? (C == null ? void 0 : C.is_account), $ = ((q =
|
|
4466
|
+
}, [A == null ? void 0 : A.userID, (R = y.state) == null ? void 0 : R.members]), I = ((H = C == null ? void 0 : C.user) == null ? void 0 : H.is_account) ?? (C == null ? void 0 : C.is_account), $ = ((q = E == null ? void 0 : E.user) == null ? void 0 : q.is_account) ?? (E == null ? void 0 : E.is_account), F = M && I === !1 && $ === !0, V = y.state.messages.some(
|
|
4459
4467
|
(Y) => Y.type !== "deleted"
|
|
4460
|
-
), Q = f ? /* @__PURE__ */ s(U.Fragment, { children: f() }, "lt-channel-banner") : null,
|
|
4461
|
-
|
|
4468
|
+
), Q = f ? /* @__PURE__ */ s(U.Fragment, { children: f() }, "lt-channel-banner") : null, te = O ? /* @__PURE__ */ s(
|
|
4469
|
+
pa,
|
|
4462
4470
|
{
|
|
4463
4471
|
onBack: e,
|
|
4464
4472
|
showBackButton: t,
|
|
4465
|
-
showChannelInfo:
|
|
4473
|
+
showChannelInfo: D,
|
|
4466
4474
|
showStarButton: w,
|
|
4467
4475
|
dmAgentEnabled: F,
|
|
4468
4476
|
onLeaveConversation: i,
|
|
@@ -4474,38 +4482,38 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4474
4482
|
onBlockParticipantClick: u,
|
|
4475
4483
|
onReportParticipantClick: p,
|
|
4476
4484
|
customChannelActions: N,
|
|
4477
|
-
renderChannelActions:
|
|
4485
|
+
renderChannelActions: S,
|
|
4478
4486
|
onParticipantNameClick: O
|
|
4479
4487
|
}
|
|
4480
4488
|
) : null, X = J(
|
|
4481
4489
|
(Y) => {
|
|
4482
|
-
const { message: j } =
|
|
4483
|
-
|
|
4490
|
+
const { message: j } = _e("ChannelView"), W = /* @__PURE__ */ s(
|
|
4491
|
+
Ni,
|
|
4484
4492
|
{
|
|
4485
4493
|
...Y,
|
|
4486
4494
|
chatbotVotingEnabled: b,
|
|
4487
|
-
viewerLanguage:
|
|
4495
|
+
viewerLanguage: L
|
|
4488
4496
|
}
|
|
4489
4497
|
);
|
|
4490
4498
|
return !T || !j ? W : T(W, j);
|
|
4491
4499
|
},
|
|
4492
|
-
[b, T,
|
|
4500
|
+
[b, T, L]
|
|
4493
4501
|
);
|
|
4494
|
-
return /* @__PURE__ */ s(
|
|
4495
|
-
|
|
4502
|
+
return /* @__PURE__ */ s(ee, { children: /* @__PURE__ */ s(
|
|
4503
|
+
Sn,
|
|
4496
4504
|
{
|
|
4497
4505
|
overrides: {
|
|
4498
4506
|
Message: X,
|
|
4499
|
-
MessageActions:
|
|
4507
|
+
MessageActions: Ci
|
|
4500
4508
|
},
|
|
4501
|
-
children: /* @__PURE__ */ m(
|
|
4502
|
-
!O && /* @__PURE__ */ m(
|
|
4509
|
+
children: /* @__PURE__ */ m(En, { children: [
|
|
4510
|
+
!O && /* @__PURE__ */ m(ee, { children: [
|
|
4503
4511
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4504
|
-
|
|
4512
|
+
Yi,
|
|
4505
4513
|
{
|
|
4506
4514
|
onBack: e,
|
|
4507
4515
|
showBackButton: t,
|
|
4508
|
-
showChannelInfo:
|
|
4516
|
+
showChannelInfo: D,
|
|
4509
4517
|
showStarButton: w,
|
|
4510
4518
|
dmAgentEnabled: F,
|
|
4511
4519
|
onLeaveConversation: i,
|
|
@@ -4517,14 +4525,14 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4517
4525
|
onBlockParticipantClick: u,
|
|
4518
4526
|
onReportParticipantClick: p,
|
|
4519
4527
|
customChannelActions: N,
|
|
4520
|
-
renderChannelActions:
|
|
4528
|
+
renderChannelActions: S,
|
|
4521
4529
|
renderHeaderTitleBadges: x
|
|
4522
4530
|
}
|
|
4523
4531
|
) }, "lt-channel-header"),
|
|
4524
4532
|
Q
|
|
4525
4533
|
] }),
|
|
4526
4534
|
O && !V && /* @__PURE__ */ m("div", { className: "px-4 @lg:px-6", children: [
|
|
4527
|
-
|
|
4535
|
+
te,
|
|
4528
4536
|
Q
|
|
4529
4537
|
] }),
|
|
4530
4538
|
/* @__PURE__ */ s(
|
|
@@ -4532,10 +4540,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4532
4540
|
{
|
|
4533
4541
|
className: "flex-1 overflow-hidden relative",
|
|
4534
4542
|
children: /* @__PURE__ */ s(
|
|
4535
|
-
|
|
4543
|
+
In,
|
|
4536
4544
|
{
|
|
4537
4545
|
head: O && V ? /* @__PURE__ */ m("div", { className: "sticky top-0 z-10", children: [
|
|
4538
|
-
|
|
4546
|
+
te,
|
|
4539
4547
|
Q
|
|
4540
4548
|
] }) : void 0,
|
|
4541
4549
|
hideDeletedMessages: !0,
|
|
@@ -4547,7 +4555,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4547
4555
|
),
|
|
4548
4556
|
r ? /* @__PURE__ */ s(U.Fragment, { children: r(y) }, "lt-channel-conversation-footer") : null,
|
|
4549
4557
|
/* @__PURE__ */ s(
|
|
4550
|
-
|
|
4558
|
+
Mi,
|
|
4551
4559
|
{
|
|
4552
4560
|
...n && {
|
|
4553
4561
|
renderActions: () => n == null ? void 0 : n(y)
|
|
@@ -4562,7 +4570,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4562
4570
|
] })
|
|
4563
4571
|
}
|
|
4564
4572
|
) });
|
|
4565
|
-
},
|
|
4573
|
+
}, $s = U.memo(
|
|
4566
4574
|
({
|
|
4567
4575
|
channel: e,
|
|
4568
4576
|
onBack: t,
|
|
@@ -4573,7 +4581,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4573
4581
|
onLeaveConversation: l,
|
|
4574
4582
|
onBlockParticipant: o,
|
|
4575
4583
|
className: d,
|
|
4576
|
-
CustomChannelEmptyState: u =
|
|
4584
|
+
CustomChannelEmptyState: u = Gi,
|
|
4577
4585
|
showDeleteConversation: p = !0,
|
|
4578
4586
|
onDeleteConversationClick: h,
|
|
4579
4587
|
onBlockParticipantClick: g,
|
|
@@ -4584,16 +4592,16 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4584
4592
|
composerDisabledReason: f,
|
|
4585
4593
|
dmAgentEnabled: x,
|
|
4586
4594
|
messageMetadata: N,
|
|
4587
|
-
onMessageSent:
|
|
4595
|
+
onMessageSent: S,
|
|
4588
4596
|
showStarButton: T = !1,
|
|
4589
4597
|
chatbotVotingEnabled: M = !1,
|
|
4590
|
-
renderChannelBanner:
|
|
4591
|
-
renderHeaderTitleBadges:
|
|
4598
|
+
renderChannelBanner: L,
|
|
4599
|
+
renderHeaderTitleBadges: D,
|
|
4592
4600
|
customChannelActions: O,
|
|
4593
4601
|
renderChannelActions: z,
|
|
4594
4602
|
renderMessage: y,
|
|
4595
4603
|
onMessageLinkClick: A,
|
|
4596
|
-
sendButton:
|
|
4604
|
+
sendButton: E,
|
|
4597
4605
|
attachmentPreviewList: C,
|
|
4598
4606
|
viewerLanguage: I,
|
|
4599
4607
|
showChannelInfo: $ = !0,
|
|
@@ -4616,43 +4624,43 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4616
4624
|
...R,
|
|
4617
4625
|
...q && { skip_push: !0 }
|
|
4618
4626
|
}, W = await e.sendMessage(Y, j);
|
|
4619
|
-
return
|
|
4627
|
+
return S == null || S(W), W;
|
|
4620
4628
|
},
|
|
4621
|
-
[e, x, N,
|
|
4622
|
-
),
|
|
4629
|
+
[e, x, N, S]
|
|
4630
|
+
), te = G(null);
|
|
4623
4631
|
return K(() => {
|
|
4624
4632
|
if (!A) return;
|
|
4625
|
-
const X =
|
|
4633
|
+
const X = te.current;
|
|
4626
4634
|
if (!X) return;
|
|
4627
4635
|
const _ = (R) => {
|
|
4628
4636
|
const H = R.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4629
4637
|
if (!Y) return;
|
|
4630
|
-
const j = q == null ? void 0 : q.closest("[data-message-id]"), W = j == null ? void 0 : j.getAttribute("data-message-id"), Z = W ? e.state.messages.find((
|
|
4638
|
+
const j = q == null ? void 0 : q.closest("[data-message-id]"), W = j == null ? void 0 : j.getAttribute("data-message-id"), Z = W ? e.state.messages.find((de) => de.id === W) : void 0;
|
|
4631
4639
|
A(Y, Z);
|
|
4632
4640
|
};
|
|
4633
4641
|
return X.addEventListener("click", _), () => X.removeEventListener("click", _);
|
|
4634
4642
|
}, [A, e]), /* @__PURE__ */ s(
|
|
4635
4643
|
"div",
|
|
4636
4644
|
{
|
|
4637
|
-
ref:
|
|
4645
|
+
ref: te,
|
|
4638
4646
|
className: k(
|
|
4639
4647
|
"messaging-channel-view h-full flex flex-col",
|
|
4640
4648
|
d
|
|
4641
4649
|
),
|
|
4642
|
-
children: /* @__PURE__ */ s(
|
|
4643
|
-
|
|
4650
|
+
children: /* @__PURE__ */ s(Os.Provider, { value: x ?? !1, children: /* @__PURE__ */ s(
|
|
4651
|
+
Cn,
|
|
4644
4652
|
{
|
|
4645
4653
|
channel: e,
|
|
4646
|
-
MessageSystem:
|
|
4654
|
+
MessageSystem: ji,
|
|
4647
4655
|
EmptyStateIndicator: u,
|
|
4648
4656
|
LoadingIndicator: je,
|
|
4649
|
-
DateSeparator:
|
|
4650
|
-
TypingIndicator:
|
|
4657
|
+
DateSeparator: ba,
|
|
4658
|
+
TypingIndicator: Ui,
|
|
4651
4659
|
doSendMessageRequest: Q,
|
|
4652
|
-
...
|
|
4660
|
+
...E ? { SendButton: E } : {},
|
|
4653
4661
|
...C ? { AttachmentPreviewList: C } : {},
|
|
4654
4662
|
children: /* @__PURE__ */ s(
|
|
4655
|
-
|
|
4663
|
+
qi,
|
|
4656
4664
|
{
|
|
4657
4665
|
onBack: t,
|
|
4658
4666
|
showBackButton: n,
|
|
@@ -4673,8 +4681,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4673
4681
|
showStarButton: T,
|
|
4674
4682
|
dmAgentEnabled: x,
|
|
4675
4683
|
chatbotVotingEnabled: M,
|
|
4676
|
-
renderChannelBanner:
|
|
4677
|
-
renderHeaderTitleBadges:
|
|
4684
|
+
renderChannelBanner: L,
|
|
4685
|
+
renderHeaderTitleBadges: D,
|
|
4678
4686
|
customChannelActions: O,
|
|
4679
4687
|
renderChannelActions: z,
|
|
4680
4688
|
renderMessage: y,
|
|
@@ -4690,8 +4698,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4690
4698
|
);
|
|
4691
4699
|
}
|
|
4692
4700
|
);
|
|
4693
|
-
|
|
4694
|
-
const
|
|
4701
|
+
$s.displayName = "ChannelView";
|
|
4702
|
+
const ke = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ m("div", { className: "text-center max-w-sm", children: [
|
|
4695
4703
|
/* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
4696
4704
|
/* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4697
4705
|
/* @__PURE__ */ s("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4705,8 +4713,8 @@ const ye = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4705
4713
|
}
|
|
4706
4714
|
)
|
|
4707
4715
|
] }) }));
|
|
4708
|
-
|
|
4709
|
-
const
|
|
4716
|
+
ke.displayName = "ErrorState";
|
|
4717
|
+
const fl = ({
|
|
4710
4718
|
capabilities: e = {},
|
|
4711
4719
|
renderMessageInputActions: t,
|
|
4712
4720
|
renderConversationFooter: n,
|
|
@@ -4727,19 +4735,19 @@ const ul = ({
|
|
|
4727
4735
|
renderChannelActions: f,
|
|
4728
4736
|
onParticipantNameClick: x,
|
|
4729
4737
|
renderMessage: N,
|
|
4730
|
-
onMessageLinkClick:
|
|
4738
|
+
onMessageLinkClick: S,
|
|
4731
4739
|
showChannelInfo: T,
|
|
4732
4740
|
composerInput: M
|
|
4733
4741
|
}) => {
|
|
4734
4742
|
const {
|
|
4735
|
-
client:
|
|
4736
|
-
isConnected:
|
|
4743
|
+
client: L,
|
|
4744
|
+
isConnected: D,
|
|
4737
4745
|
isLoading: O,
|
|
4738
4746
|
error: z,
|
|
4739
4747
|
refreshConnection: y,
|
|
4740
4748
|
service: A,
|
|
4741
|
-
debug:
|
|
4742
|
-
} =
|
|
4749
|
+
debug: E
|
|
4750
|
+
} = sa(), [C, I] = B(null), [$, F] = B(null), [V, Q] = B(!1), { showDeleteConversation: te = !0 } = e, X = G(l);
|
|
4743
4751
|
X.current = l;
|
|
4744
4752
|
const _ = G(a);
|
|
4745
4753
|
_.current = a;
|
|
@@ -4747,8 +4755,8 @@ const ul = ({
|
|
|
4747
4755
|
K(() => {
|
|
4748
4756
|
H.current = C;
|
|
4749
4757
|
}, [C]), K(() => {
|
|
4750
|
-
if (!
|
|
4751
|
-
const j =
|
|
4758
|
+
if (!L || !D) return;
|
|
4759
|
+
const j = L.userID;
|
|
4752
4760
|
if (!j) return;
|
|
4753
4761
|
const W = `${j}::${i}`;
|
|
4754
4762
|
if (R.current === W) return;
|
|
@@ -4757,13 +4765,13 @@ const ul = ({
|
|
|
4757
4765
|
R.current === W && (R.current = null);
|
|
4758
4766
|
};
|
|
4759
4767
|
(async () => {
|
|
4760
|
-
var
|
|
4768
|
+
var De, Le;
|
|
4761
4769
|
try {
|
|
4762
|
-
|
|
4770
|
+
E && console.log(
|
|
4763
4771
|
"[MessagingShell] Loading initial conversation with:",
|
|
4764
4772
|
i
|
|
4765
4773
|
);
|
|
4766
|
-
const
|
|
4774
|
+
const ae = await L.queryChannels(
|
|
4767
4775
|
{
|
|
4768
4776
|
type: "messaging",
|
|
4769
4777
|
members: { $eq: [j, i] }
|
|
@@ -4771,16 +4779,16 @@ const ul = ({
|
|
|
4771
4779
|
{},
|
|
4772
4780
|
{ limit: 1 }
|
|
4773
4781
|
);
|
|
4774
|
-
if (
|
|
4775
|
-
I(
|
|
4782
|
+
if (ae.length > 0) {
|
|
4783
|
+
I(ae[0]), F(null), (De = _.current) == null || De.call(_, ae[0]), E && console.log(
|
|
4776
4784
|
"[MessagingShell] Initial conversation loaded:",
|
|
4777
|
-
|
|
4785
|
+
ae[0].id
|
|
4778
4786
|
);
|
|
4779
4787
|
return;
|
|
4780
4788
|
}
|
|
4781
|
-
const
|
|
4782
|
-
if (!
|
|
4783
|
-
Z(), F("No conversation found with this account"),
|
|
4789
|
+
const ue = X.current;
|
|
4790
|
+
if (!ue || !A) {
|
|
4791
|
+
Z(), F("No conversation found with this account"), E && console.log(
|
|
4784
4792
|
"[MessagingShell] No conversation found for:",
|
|
4785
4793
|
i
|
|
4786
4794
|
);
|
|
@@ -4788,11 +4796,11 @@ const ul = ({
|
|
|
4788
4796
|
}
|
|
4789
4797
|
try {
|
|
4790
4798
|
const ie = await A.startChannelWithParticipant({
|
|
4791
|
-
id:
|
|
4792
|
-
name:
|
|
4793
|
-
phone:
|
|
4799
|
+
id: ue.id,
|
|
4800
|
+
name: ue.name,
|
|
4801
|
+
phone: ue.phone
|
|
4794
4802
|
});
|
|
4795
|
-
I(ie), F(null), (
|
|
4803
|
+
I(ie), F(null), (Le = _.current) == null || Le.call(_, ie), E && console.log(
|
|
4796
4804
|
"[MessagingShell] Channel created and loaded:",
|
|
4797
4805
|
ie.id
|
|
4798
4806
|
);
|
|
@@ -4802,28 +4810,28 @@ const ul = ({
|
|
|
4802
4810
|
ie
|
|
4803
4811
|
), Z(), F("Failed to create conversation");
|
|
4804
4812
|
}
|
|
4805
|
-
} catch (
|
|
4813
|
+
} catch (ae) {
|
|
4806
4814
|
console.error(
|
|
4807
4815
|
"[MessagingShell] Failed to load initial conversation:",
|
|
4808
|
-
|
|
4816
|
+
ae
|
|
4809
4817
|
), Z(), H.current || F("Failed to load conversation");
|
|
4810
4818
|
}
|
|
4811
4819
|
})();
|
|
4812
|
-
}, [i,
|
|
4820
|
+
}, [i, L, D, A, E]);
|
|
4813
4821
|
const q = G(r);
|
|
4814
4822
|
q.current = r;
|
|
4815
4823
|
const Y = J(() => {
|
|
4816
4824
|
var j;
|
|
4817
4825
|
I(null), Q(!0), (j = q.current) == null || j.call(q);
|
|
4818
4826
|
}, []);
|
|
4819
|
-
return O ? /* @__PURE__ */ s(je, {}) : z ? /* @__PURE__ */ s(
|
|
4820
|
-
|
|
4827
|
+
return O ? /* @__PURE__ */ s(je, {}) : z ? /* @__PURE__ */ s(ke, { message: z, onBack: y }) : !D || !L ? /* @__PURE__ */ s(
|
|
4828
|
+
ke,
|
|
4821
4829
|
{
|
|
4822
4830
|
message: "Not connected to messaging service",
|
|
4823
4831
|
onBack: y
|
|
4824
4832
|
}
|
|
4825
|
-
) : $ ? /* @__PURE__ */ s(
|
|
4826
|
-
|
|
4833
|
+
) : $ ? /* @__PURE__ */ s(ke, { message: $ }) : V && !C ? /* @__PURE__ */ s(ke, { message: "Conversation ended" }) : C ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
|
|
4834
|
+
$s,
|
|
4827
4835
|
{
|
|
4828
4836
|
channel: C,
|
|
4829
4837
|
renderMessageInputActions: t,
|
|
@@ -4832,7 +4840,7 @@ const ul = ({
|
|
|
4832
4840
|
onLeaveConversation: Y,
|
|
4833
4841
|
onBlockParticipant: Y,
|
|
4834
4842
|
CustomChannelEmptyState: o,
|
|
4835
|
-
showDeleteConversation:
|
|
4843
|
+
showDeleteConversation: te,
|
|
4836
4844
|
onBlockParticipantClick: d,
|
|
4837
4845
|
onReportParticipantClick: u,
|
|
4838
4846
|
dmAgentEnabled: p,
|
|
@@ -4844,20 +4852,20 @@ const ul = ({
|
|
|
4844
4852
|
renderChannelActions: f,
|
|
4845
4853
|
onParticipantNameClick: x,
|
|
4846
4854
|
renderMessage: N,
|
|
4847
|
-
onMessageLinkClick:
|
|
4855
|
+
onMessageLinkClick: S,
|
|
4848
4856
|
showChannelInfo: T,
|
|
4849
4857
|
composerInput: M
|
|
4850
4858
|
},
|
|
4851
4859
|
C.id
|
|
4852
4860
|
) }) }) : /* @__PURE__ */ s(je, {});
|
|
4853
4861
|
};
|
|
4854
|
-
function
|
|
4862
|
+
function Wi(e) {
|
|
4855
4863
|
const t = e.state.pending_messages;
|
|
4856
4864
|
if (t != null && t.length)
|
|
4857
4865
|
for (const n of t)
|
|
4858
4866
|
e.state.addMessageSorted(n.message);
|
|
4859
4867
|
}
|
|
4860
|
-
const
|
|
4868
|
+
const js = U.createContext({
|
|
4861
4869
|
selectedChannel: void 0,
|
|
4862
4870
|
onChannelSelect: () => {
|
|
4863
4871
|
},
|
|
@@ -4865,18 +4873,18 @@ const $s = U.createContext({
|
|
|
4865
4873
|
renderMessagePreview: void 0,
|
|
4866
4874
|
channelPreview: void 0,
|
|
4867
4875
|
viewerLanguage: void 0
|
|
4868
|
-
}),
|
|
4876
|
+
}), Xi = js.Provider, Ki = () => U.useContext(js), Ji = (e, t) => {
|
|
4869
4877
|
const n = new Date(
|
|
4870
4878
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4871
4879
|
), r = new Date(
|
|
4872
4880
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4873
4881
|
).getTime() - n.getTime();
|
|
4874
4882
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4875
|
-
},
|
|
4883
|
+
}, Zi = (e) => {
|
|
4876
4884
|
const t = /* @__PURE__ */ new Date();
|
|
4877
4885
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4878
4886
|
return "Just now";
|
|
4879
|
-
const a =
|
|
4887
|
+
const a = Ji(e, t);
|
|
4880
4888
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4881
4889
|
hour: "numeric",
|
|
4882
4890
|
minute: "2-digit",
|
|
@@ -4886,9 +4894,9 @@ const $s = U.createContext({
|
|
|
4886
4894
|
day: "numeric",
|
|
4887
4895
|
year: "2-digit"
|
|
4888
4896
|
});
|
|
4889
|
-
},
|
|
4897
|
+
}, Bs = U.memo(
|
|
4890
4898
|
(e) => {
|
|
4891
|
-
var
|
|
4899
|
+
var D, O, z;
|
|
4892
4900
|
const { channel: t, unread: n } = e, {
|
|
4893
4901
|
selectedChannel: a,
|
|
4894
4902
|
onChannelSelect: r,
|
|
@@ -4896,7 +4904,7 @@ const $s = U.createContext({
|
|
|
4896
4904
|
channelPreview: l,
|
|
4897
4905
|
renderMessagePreview: o,
|
|
4898
4906
|
viewerLanguage: d
|
|
4899
|
-
} =
|
|
4907
|
+
} = Ki(), { client: u } = oe(), p = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = ot(t);
|
|
4900
4908
|
if (l)
|
|
4901
4909
|
return /* @__PURE__ */ s(
|
|
4902
4910
|
l,
|
|
@@ -4911,22 +4919,22 @@ const $s = U.createContext({
|
|
|
4911
4919
|
const g = () => {
|
|
4912
4920
|
t && r(t);
|
|
4913
4921
|
}, c = (y) => {
|
|
4914
|
-
const A = y.key === "Enter" || y.key === " ",
|
|
4915
|
-
!A ||
|
|
4922
|
+
const A = y.key === "Enter" || y.key === " ", E = y.repeat;
|
|
4923
|
+
!A || E || (y.preventDefault(), g());
|
|
4916
4924
|
}, v = Ue(
|
|
4917
|
-
(
|
|
4925
|
+
(D = t == null ? void 0 : t.state) == null ? void 0 : D.members,
|
|
4918
4926
|
u == null ? void 0 : u.userID,
|
|
4919
4927
|
t == null ? void 0 : t.type
|
|
4920
|
-
), w =
|
|
4928
|
+
), w = ct(v == null ? void 0 : v.user), b = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, f = (() => {
|
|
4921
4929
|
var A;
|
|
4922
4930
|
const y = (A = t == null ? void 0 : t.state) == null ? void 0 : A.messages;
|
|
4923
4931
|
if (y != null && y.length) {
|
|
4924
|
-
for (let
|
|
4925
|
-
if (y[
|
|
4932
|
+
for (let E = y.length - 1; E >= 0; E--)
|
|
4933
|
+
if (y[E].type !== "system") return y[E];
|
|
4926
4934
|
}
|
|
4927
4935
|
})(), N = (() => {
|
|
4928
4936
|
var $, F, V, Q;
|
|
4929
|
-
const y =
|
|
4937
|
+
const y = hs({
|
|
4930
4938
|
message: f,
|
|
4931
4939
|
viewerLanguage: d
|
|
4932
4940
|
});
|
|
@@ -4937,13 +4945,13 @@ const $s = U.createContext({
|
|
|
4937
4945
|
if (y) return y;
|
|
4938
4946
|
const I = (Q = f == null ? void 0 : f.attachments) == null ? void 0 : Q[0];
|
|
4939
4947
|
return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4940
|
-
})(),
|
|
4948
|
+
})(), S = f != null && f.created_at ? Zi(new Date(f.created_at)) : "", T = f ? Fe(f) : !1, M = o ? o(f, N) : `${T ? "✨ " : ""}${N}`, L = n ?? 0;
|
|
4941
4949
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4942
4950
|
channelId: t == null ? void 0 : t.id,
|
|
4943
4951
|
isSelected: p,
|
|
4944
4952
|
participantName: w,
|
|
4945
|
-
unreadCount:
|
|
4946
|
-
hasTimestamp: !!
|
|
4953
|
+
unreadCount: L,
|
|
4954
|
+
hasTimestamp: !!S
|
|
4947
4955
|
}), /* @__PURE__ */ s(
|
|
4948
4956
|
"div",
|
|
4949
4957
|
{
|
|
@@ -4961,7 +4969,7 @@ const $s = U.createContext({
|
|
|
4961
4969
|
"data-dd-privacy": "mask",
|
|
4962
4970
|
children: /* @__PURE__ */ m("div", { className: "flex items-start gap-4", children: [
|
|
4963
4971
|
/* @__PURE__ */ s(
|
|
4964
|
-
|
|
4972
|
+
ne,
|
|
4965
4973
|
{
|
|
4966
4974
|
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || t.id || "unknown",
|
|
4967
4975
|
name: w,
|
|
@@ -4984,11 +4992,11 @@ const $s = U.createContext({
|
|
|
4984
4992
|
]
|
|
4985
4993
|
}
|
|
4986
4994
|
),
|
|
4987
|
-
|
|
4995
|
+
S && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: S })
|
|
4988
4996
|
] }),
|
|
4989
4997
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4990
4998
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
4991
|
-
|
|
4999
|
+
L > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: L > 99 ? "99+" : L })
|
|
4992
5000
|
] })
|
|
4993
5001
|
] })
|
|
4994
5002
|
] })
|
|
@@ -4996,28 +5004,28 @@ const $s = U.createContext({
|
|
|
4996
5004
|
);
|
|
4997
5005
|
}
|
|
4998
5006
|
);
|
|
4999
|
-
|
|
5000
|
-
const
|
|
5007
|
+
Bs.displayName = "CustomChannelPreview";
|
|
5008
|
+
const Qi = { last_message_at: -1 }, el = U.memo(
|
|
5001
5009
|
({
|
|
5002
5010
|
onChannelSelect: e,
|
|
5003
5011
|
selectedChannel: t,
|
|
5004
5012
|
filters: n,
|
|
5005
5013
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
5006
5014
|
channelRenderFilterFn: r,
|
|
5007
|
-
sort: i =
|
|
5015
|
+
sort: i = Qi,
|
|
5008
5016
|
className: l,
|
|
5009
5017
|
customEmptyStateIndicator: o,
|
|
5010
|
-
channelListPaginator: d =
|
|
5018
|
+
channelListPaginator: d = An,
|
|
5011
5019
|
channelPreview: u,
|
|
5012
5020
|
renderMessagePreview: p,
|
|
5013
5021
|
viewerLanguage: h
|
|
5014
5022
|
}) => {
|
|
5015
5023
|
const g = U.useRef(0);
|
|
5016
5024
|
g.current++;
|
|
5017
|
-
const { debug: c = !1 } =
|
|
5025
|
+
const { debug: c = !1 } = lt(), v = U.useCallback(
|
|
5018
5026
|
(b) => {
|
|
5019
5027
|
for (const f of b)
|
|
5020
|
-
|
|
5028
|
+
Wi(f);
|
|
5021
5029
|
return r ? r(b) : b;
|
|
5022
5030
|
},
|
|
5023
5031
|
[r]
|
|
@@ -5052,8 +5060,8 @@ const Ki = { last_message_at: -1 }, Ji = U.memo(
|
|
|
5052
5060
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
5053
5061
|
l
|
|
5054
5062
|
),
|
|
5055
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
5056
|
-
|
|
5063
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Xi, { value: w, children: /* @__PURE__ */ s(
|
|
5064
|
+
Tn,
|
|
5057
5065
|
{
|
|
5058
5066
|
filters: n,
|
|
5059
5067
|
sort: i,
|
|
@@ -5061,7 +5069,7 @@ const Ki = { last_message_at: -1 }, Ji = U.memo(
|
|
|
5061
5069
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
5062
5070
|
channelRenderFilterFn: v,
|
|
5063
5071
|
Paginator: d,
|
|
5064
|
-
Preview:
|
|
5072
|
+
Preview: Bs,
|
|
5065
5073
|
EmptyStateIndicator: o
|
|
5066
5074
|
},
|
|
5067
5075
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -5070,8 +5078,8 @@ const Ki = { last_message_at: -1 }, Ji = U.memo(
|
|
|
5070
5078
|
);
|
|
5071
5079
|
}
|
|
5072
5080
|
);
|
|
5073
|
-
|
|
5074
|
-
const
|
|
5081
|
+
el.displayName = "ChannelList";
|
|
5082
|
+
const tl = ({
|
|
5075
5083
|
question: e,
|
|
5076
5084
|
onClick: t,
|
|
5077
5085
|
loading: n = !1,
|
|
@@ -5093,7 +5101,7 @@ const Zi = ({
|
|
|
5093
5101
|
),
|
|
5094
5102
|
children: e
|
|
5095
5103
|
}
|
|
5096
|
-
),
|
|
5104
|
+
), gl = ({
|
|
5097
5105
|
faqs: e,
|
|
5098
5106
|
onFaqClick: t,
|
|
5099
5107
|
loadingFaqId: n,
|
|
@@ -5105,7 +5113,7 @@ const Zi = ({
|
|
|
5105
5113
|
const o = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
|
|
5106
5114
|
return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ m("div", { className: "flex gap-3 items-end", children: [
|
|
5107
5115
|
(i || l) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
|
|
5108
|
-
|
|
5116
|
+
ne,
|
|
5109
5117
|
{
|
|
5110
5118
|
id: l || "account",
|
|
5111
5119
|
name: l || "Account",
|
|
@@ -5122,7 +5130,7 @@ const Zi = ({
|
|
|
5122
5130
|
children: [
|
|
5123
5131
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5124
5132
|
o.map((d) => /* @__PURE__ */ s(
|
|
5125
|
-
|
|
5133
|
+
tl,
|
|
5126
5134
|
{
|
|
5127
5135
|
question: d.question,
|
|
5128
5136
|
onClick: () => t(d.id),
|
|
@@ -5136,40 +5144,40 @@ const Zi = ({
|
|
|
5136
5144
|
] }) });
|
|
5137
5145
|
};
|
|
5138
5146
|
export {
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5147
|
+
bs as A,
|
|
5148
|
+
hl as B,
|
|
5149
|
+
Gi as C,
|
|
5150
|
+
Br as D,
|
|
5151
|
+
xa as E,
|
|
5152
|
+
gl as F,
|
|
5153
|
+
sa as G,
|
|
5154
|
+
es as L,
|
|
5155
|
+
ul as M,
|
|
5156
|
+
Ne as a,
|
|
5157
|
+
ne as b,
|
|
5158
|
+
el as c,
|
|
5159
|
+
$s as d,
|
|
5160
|
+
ml as e,
|
|
5161
|
+
tl as f,
|
|
5162
|
+
ce as g,
|
|
5163
|
+
Zt as h,
|
|
5164
|
+
ye as i,
|
|
5165
|
+
qr as j,
|
|
5166
|
+
dl as k,
|
|
5167
|
+
fl as l,
|
|
5168
|
+
rr as m,
|
|
5169
|
+
sr as n,
|
|
5170
|
+
Zi as o,
|
|
5171
|
+
ar as p,
|
|
5172
|
+
hs as q,
|
|
5165
5173
|
we as r,
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5174
|
+
ws as s,
|
|
5175
|
+
ia as t,
|
|
5176
|
+
Xa as u,
|
|
5177
|
+
wa as v,
|
|
5170
5178
|
Ue as w,
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5179
|
+
ht as x,
|
|
5180
|
+
ft as y,
|
|
5181
|
+
ct as z
|
|
5174
5182
|
};
|
|
5175
|
-
//# sourceMappingURL=index-
|
|
5183
|
+
//# sourceMappingURL=index-wFe1UO9t.js.map
|