@linktr.ee/messaging-react 3.12.3-rc-1784036508 → 3.12.3-rc-1784083967
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--gGSoMXs.cjs → Card-BMJl2xlA.cjs} +2 -2
- package/dist/{Card--gGSoMXs.cjs.map → Card-BMJl2xlA.cjs.map} +1 -1
- package/dist/{Card-CKM_PULl.js → Card-CWlzDHJA.js} +2 -2
- package/dist/{Card-CKM_PULl.js.map → Card-CWlzDHJA.js.map} +1 -1
- package/dist/{index-FDgJhTIG.js → index-B2BrYTjw.js} +521 -523
- package/dist/index-B2BrYTjw.js.map +1 -0
- package/dist/index-DSxpS5J9.cjs +2 -0
- package/dist/index-DSxpS5J9.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +10 -0
- package/package.json +2 -2
- package/src/components/ChannelHeaderRedesign.tsx +4 -13
- package/src/components/ChannelView.stories.tsx +8 -7
- package/src/components/ChannelView.test.tsx +47 -8
- package/src/components/ChannelView.tsx +1 -0
- package/src/stream-custom-data.ts +11 -0
- package/dist/index-D5GopgL7.cjs +0 -2
- package/dist/index-D5GopgL7.cjs.map +0 -1
- package/dist/index-FDgJhTIG.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
|
|
|
4
4
|
import { StreamChat as Ys, LinkPreviewsManager as Yt } from "stream-chat";
|
|
5
5
|
import { Chat as qs, useChannelStateContext as oe, useChatContext as fe, DateSeparator as Ws, MessageStatus as Xs, useMessageContext as Ne, MessageErrorIcon as nt, MessageText as $e, areMessageUIPropsEqual as Ks, useMessageReminder as Zs, useComponentContext as rs, Attachment as Js, 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, 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 Xe, AIStates as Ke, useTypingContext as yn, useAIState as kn, Channel as Cn, WithComponents as Sn, Window as En, MessageList as In, ChannelList as Tn, InfiniteScroll as Mn } from "stream-chat-react";
|
|
6
6
|
import { StarIcon as Ie, DotsThreeIcon as An, SpinnerGapIcon as Fe, SignOutIcon as Rn, ProhibitInsetIcon as qt, FlagIcon as is, ArrowLeftIcon as at, CurrencyDollarIcon as Ln, CaretRightIcon as xe, SparkleIcon as we, FileIcon as ls, ImageIcon as Dn, SpeakerHighIcon as zn, VideoCameraIcon as os, FileMdIcon as Fn, FileTextIcon as Pn, FileZipIcon as On, FilePptIcon as $n, FileCsvIcon as Un, FileXlsIcon as Bn, FileDocIcon as jn, FilePdfIcon as Vn, CircleNotchIcon as Se, PlayIcon as rt, PauseIcon as Gn, LinkIcon as Hn, DownloadSimpleIcon as Ee, XIcon as Ge, CaretLeftIcon as Yn, GiftIcon as qn, ThumbsUpIcon as Wn, ThumbsDownIcon as Xn, ChecksIcon as Kn, PencilSimpleIcon as Zn, TrashSimpleIcon as Jn, ArrowUpIcon as Qn, ProhibitIcon as ea } from "@phosphor-icons/react";
|
|
7
|
-
import
|
|
7
|
+
import k from "classnames";
|
|
8
8
|
import { MessageActions as ta, DefaultDropdownActionButton as cs } from "stream-chat-react/experimental";
|
|
9
9
|
const ds = ct({
|
|
10
10
|
service: null,
|
|
@@ -16,7 +16,7 @@ const ds = ct({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), dt = () => Te(ds),
|
|
19
|
+
}), dt = () => Te(ds), ml = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -25,7 +25,7 @@ const ds = ct({
|
|
|
25
25
|
debug: i = !1,
|
|
26
26
|
client: o
|
|
27
27
|
}) => {
|
|
28
|
-
var
|
|
28
|
+
var y, T;
|
|
29
29
|
const l = J(
|
|
30
30
|
(M, ...P) => {
|
|
31
31
|
i && console.log(`🔥 [MessagingProvider] ${M}`, ...P);
|
|
@@ -38,11 +38,11 @@ const ds = ct({
|
|
|
38
38
|
serviceConfig: !!n,
|
|
39
39
|
capabilities: Object.keys(r)
|
|
40
40
|
});
|
|
41
|
-
const [d, m] = B(null), [f, h] = B(null), [g, c] = B(!1), [b, v] = B(!1), [x, p] = B(null), _ = G(!1), w = G(null),
|
|
42
|
-
|
|
41
|
+
const [d, m] = B(null), [f, h] = B(null), [g, c] = B(!1), [b, v] = B(!1), [x, p] = B(null), _ = G(!1), w = G(null), C = G(n);
|
|
42
|
+
C.current = n;
|
|
43
43
|
const D = G(i);
|
|
44
44
|
D.current = i;
|
|
45
|
-
const
|
|
45
|
+
const E = G({
|
|
46
46
|
userId: t == null ? void 0 : t.id,
|
|
47
47
|
apiKey: a,
|
|
48
48
|
serviceConfig: n,
|
|
@@ -52,22 +52,22 @@ const ds = ct({
|
|
|
52
52
|
renderCount: R.current,
|
|
53
53
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
54
54
|
propChanges: {
|
|
55
|
-
userChanged:
|
|
56
|
-
apiKeyChanged:
|
|
57
|
-
serviceConfigChanged:
|
|
58
|
-
capabilitiesChanged:
|
|
55
|
+
userChanged: E.current.userId !== (t == null ? void 0 : t.id),
|
|
56
|
+
apiKeyChanged: E.current.apiKey !== a,
|
|
57
|
+
serviceConfigChanged: E.current.serviceConfig !== n,
|
|
58
|
+
capabilitiesChanged: E.current.capabilities !== r
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
60
|
+
}), E.current = {
|
|
61
61
|
userId: t == null ? void 0 : t.id,
|
|
62
62
|
apiKey: a,
|
|
63
63
|
serviceConfig: n,
|
|
64
64
|
capabilities: r
|
|
65
65
|
};
|
|
66
66
|
const O = G(null);
|
|
67
|
-
!o && a && ((
|
|
67
|
+
!o && a && ((y = O.current) == null ? void 0 : y.apiKey) !== a && (O.current = { apiKey: a, client: new Ys(a) });
|
|
68
68
|
const F = o || (a ? ((T = O.current) == null ? void 0 : T.client) ?? null : null);
|
|
69
69
|
K(() => {
|
|
70
|
-
const M = R.current, P =
|
|
70
|
+
const M = R.current, P = C.current;
|
|
71
71
|
if (o) {
|
|
72
72
|
w.current = null, m(null), h(null), c(!1), p(null), v(!1);
|
|
73
73
|
return;
|
|
@@ -150,7 +150,7 @@ const ds = ct({
|
|
|
150
150
|
M && (L.current = null, (P = w.current) == null || P.disconnectUser().catch(console.error));
|
|
151
151
|
};
|
|
152
152
|
}, [F]);
|
|
153
|
-
const
|
|
153
|
+
const S = J(async () => {
|
|
154
154
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
155
155
|
hasService: !!d,
|
|
156
156
|
hasUser: !!t
|
|
@@ -174,7 +174,7 @@ const ds = ct({
|
|
|
174
174
|
v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
}, [d, t, l, o]),
|
|
177
|
+
}, [d, t, l, o]), I = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
178
178
|
hasService: !!d,
|
|
179
179
|
hasClient: !!f,
|
|
180
180
|
isConnected: g,
|
|
@@ -196,7 +196,7 @@ const ds = ct({
|
|
|
196
196
|
isLoading: o ? !1 : b,
|
|
197
197
|
error: o ? null : x,
|
|
198
198
|
capabilities: r,
|
|
199
|
-
refreshConnection:
|
|
199
|
+
refreshConnection: S,
|
|
200
200
|
debug: i
|
|
201
201
|
}), [
|
|
202
202
|
d,
|
|
@@ -206,15 +206,15 @@ const ds = ct({
|
|
|
206
206
|
b,
|
|
207
207
|
x,
|
|
208
208
|
r,
|
|
209
|
-
|
|
209
|
+
S,
|
|
210
210
|
i,
|
|
211
211
|
l
|
|
212
212
|
]);
|
|
213
213
|
return l("🔄 RENDER END", {
|
|
214
214
|
renderCount: R.current,
|
|
215
215
|
willRenderChat: !!F,
|
|
216
|
-
contextValueReady: !!
|
|
217
|
-
}), /* @__PURE__ */ s(ds.Provider, { value:
|
|
216
|
+
contextValueReady: !!I
|
|
217
|
+
}), /* @__PURE__ */ s(ds.Provider, { value: I, children: F ? /* @__PURE__ */ s(
|
|
218
218
|
qs,
|
|
219
219
|
{
|
|
220
220
|
client: F,
|
|
@@ -341,7 +341,7 @@ const ne = ({
|
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
"aria-hidden": "true",
|
|
344
|
-
className:
|
|
344
|
+
className: k(
|
|
345
345
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"
|
|
346
346
|
),
|
|
347
347
|
style: { fontSize: h, lineHeight: 1 },
|
|
@@ -351,7 +351,7 @@ const ne = ({
|
|
|
351
351
|
return /* @__PURE__ */ u(
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
|
-
className:
|
|
354
|
+
className: k(
|
|
355
355
|
"relative flex-shrink-0",
|
|
356
356
|
a
|
|
357
357
|
),
|
|
@@ -375,7 +375,7 @@ const ne = ({
|
|
|
375
375
|
"div",
|
|
376
376
|
{
|
|
377
377
|
"data-testid": "avatar-ring",
|
|
378
|
-
className:
|
|
378
|
+
className: k(
|
|
379
379
|
"h-full w-full",
|
|
380
380
|
"bg-transparent"
|
|
381
381
|
),
|
|
@@ -407,30 +407,30 @@ const ne = ({
|
|
|
407
407
|
onActionComplete: m,
|
|
408
408
|
logLabel: f = "useChannelModerationActions"
|
|
409
409
|
}) => {
|
|
410
|
-
var
|
|
411
|
-
const { service: h, debug: g } = dt(), c = (
|
|
410
|
+
var I;
|
|
411
|
+
const { service: h, debug: g } = dt(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, b = !!(a && n && h && c), [v, x] = B(!1), [p, _] = B(null), [w, C] = B(!1), [D, E] = B(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
|
|
412
412
|
return K(() => {
|
|
413
413
|
if (!b || !h || !c) {
|
|
414
414
|
x(!1), _(null);
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
let
|
|
417
|
+
let y = !1;
|
|
418
418
|
return (async () => {
|
|
419
419
|
try {
|
|
420
420
|
const T = await h.getBlockedUsers();
|
|
421
|
-
if (
|
|
421
|
+
if (y) return;
|
|
422
422
|
x(
|
|
423
423
|
T.some(
|
|
424
424
|
(M) => M.blocked_user_id === c
|
|
425
425
|
)
|
|
426
426
|
);
|
|
427
427
|
} catch (T) {
|
|
428
|
-
|
|
428
|
+
y || console.error(`[${f}] Failed to check blocked status:`, T);
|
|
429
429
|
} finally {
|
|
430
|
-
|
|
430
|
+
y || _({ participantId: c, service: h });
|
|
431
431
|
}
|
|
432
432
|
})(), () => {
|
|
433
|
-
|
|
433
|
+
y = !0;
|
|
434
434
|
};
|
|
435
435
|
}, [b, h, c, f]), {
|
|
436
436
|
isParticipantBlocked: v,
|
|
@@ -438,42 +438,42 @@ const ne = ({
|
|
|
438
438
|
isLeaving: w,
|
|
439
439
|
isUpdatingBlockStatus: D,
|
|
440
440
|
handleLeaveConversation: async () => {
|
|
441
|
-
var
|
|
441
|
+
var y;
|
|
442
442
|
if (!w) {
|
|
443
|
-
o == null || o(), g && console.log(`[${f}] Leave conversation`, e.cid),
|
|
443
|
+
o == null || o(), g && console.log(`[${f}] Leave conversation`, e.cid), C(!0);
|
|
444
444
|
try {
|
|
445
|
-
const T = ((
|
|
445
|
+
const T = ((y = e._client) == null ? void 0 : y.userID) ?? null;
|
|
446
446
|
await e.hide(T, !1), r && await r(e), m == null || m();
|
|
447
447
|
} catch (T) {
|
|
448
448
|
console.error(`[${f}] Failed to leave conversation`, T);
|
|
449
449
|
} finally {
|
|
450
|
-
|
|
450
|
+
C(!1);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
},
|
|
454
454
|
handleBlockUser: async () => {
|
|
455
|
-
var
|
|
455
|
+
var y, T, M;
|
|
456
456
|
if (!(D || !h)) {
|
|
457
|
-
l == null || l(), g && console.log(`[${f}] Block member`, (
|
|
457
|
+
l == null || l(), g && console.log(`[${f}] Block member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), E(!0);
|
|
458
458
|
try {
|
|
459
459
|
await h.blockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
|
|
460
460
|
} catch (P) {
|
|
461
461
|
console.error(`[${f}] Failed to block member`, P);
|
|
462
462
|
} finally {
|
|
463
|
-
|
|
463
|
+
E(!1);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
handleUnblockUser: async () => {
|
|
468
|
-
var
|
|
468
|
+
var y, T, M;
|
|
469
469
|
if (!(D || !h)) {
|
|
470
|
-
l == null || l(), g && console.log(`[${f}] Unblock member`, (
|
|
470
|
+
l == null || l(), g && console.log(`[${f}] Unblock member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), E(!0);
|
|
471
471
|
try {
|
|
472
472
|
await h.unBlockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
|
|
473
473
|
} catch (P) {
|
|
474
474
|
console.error(`[${f}] Failed to unblock member`, P);
|
|
475
475
|
} finally {
|
|
476
|
-
|
|
476
|
+
E(!1);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
},
|
|
@@ -490,7 +490,7 @@ const ne = ({
|
|
|
490
490
|
"button",
|
|
491
491
|
{
|
|
492
492
|
type: "button",
|
|
493
|
-
className:
|
|
493
|
+
className: k(
|
|
494
494
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
495
495
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
496
496
|
t
|
|
@@ -516,9 +516,9 @@ const ne = ({
|
|
|
516
516
|
isParticipantBlocked: p,
|
|
517
517
|
isCheckingBlockedStatus: _,
|
|
518
518
|
isLeaving: w,
|
|
519
|
-
isUpdatingBlockStatus:
|
|
519
|
+
isUpdatingBlockStatus: C,
|
|
520
520
|
handleLeaveConversation: D,
|
|
521
|
-
handleBlockUser:
|
|
521
|
+
handleBlockUser: E,
|
|
522
522
|
handleUnblockUser: R,
|
|
523
523
|
handleReportUser: O
|
|
524
524
|
} = ua({
|
|
@@ -536,13 +536,13 @@ const ne = ({
|
|
|
536
536
|
});
|
|
537
537
|
return K(() => {
|
|
538
538
|
if (!g) return;
|
|
539
|
-
const L = (
|
|
540
|
-
b.current && !b.current.contains(
|
|
541
|
-
},
|
|
542
|
-
|
|
539
|
+
const L = (I) => {
|
|
540
|
+
b.current && !b.current.contains(I.target) && c(!1);
|
|
541
|
+
}, S = (I) => {
|
|
542
|
+
I.key === "Escape" && c(!1);
|
|
543
543
|
};
|
|
544
|
-
return document.addEventListener("mousedown", L), document.addEventListener("keydown",
|
|
545
|
-
document.removeEventListener("mousedown", L), document.removeEventListener("keydown",
|
|
544
|
+
return document.addEventListener("mousedown", L), document.addEventListener("keydown", S), () => {
|
|
545
|
+
document.removeEventListener("mousedown", L), document.removeEventListener("keydown", S);
|
|
546
546
|
};
|
|
547
547
|
}, [g]), !t || !(n || a || r || !!f) ? null : /* @__PURE__ */ u("div", { ref: b, className: "relative", children: [
|
|
548
548
|
/* @__PURE__ */ u(
|
|
@@ -565,7 +565,7 @@ const ne = ({
|
|
|
565
565
|
{
|
|
566
566
|
id: v,
|
|
567
567
|
"aria-label": "Conversation options",
|
|
568
|
-
className:
|
|
568
|
+
className: k(
|
|
569
569
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
570
570
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
571
571
|
),
|
|
@@ -593,21 +593,21 @@ const ne = ({
|
|
|
593
593
|
ye,
|
|
594
594
|
{
|
|
595
595
|
onClick: R,
|
|
596
|
-
disabled:
|
|
597
|
-
"aria-busy":
|
|
596
|
+
disabled: C,
|
|
597
|
+
"aria-busy": C,
|
|
598
598
|
children: [
|
|
599
|
-
|
|
599
|
+
C ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
|
|
600
600
|
/* @__PURE__ */ s("span", { children: "Unblock" })
|
|
601
601
|
]
|
|
602
602
|
}
|
|
603
603
|
) : /* @__PURE__ */ u(
|
|
604
604
|
ye,
|
|
605
605
|
{
|
|
606
|
-
onClick:
|
|
607
|
-
disabled:
|
|
608
|
-
"aria-busy":
|
|
606
|
+
onClick: E,
|
|
607
|
+
disabled: C,
|
|
608
|
+
"aria-busy": C,
|
|
609
609
|
children: [
|
|
610
|
-
|
|
610
|
+
C ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
|
|
611
611
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
612
612
|
]
|
|
613
613
|
}
|
|
@@ -621,10 +621,7 @@ const ne = ({
|
|
|
621
621
|
}
|
|
622
622
|
)
|
|
623
623
|
] });
|
|
624
|
-
}, Ze = "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 = (
|
|
625
|
-
const t = e;
|
|
626
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(fa);
|
|
627
|
-
}, pa = ({
|
|
624
|
+
}, Ze = "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 = ({
|
|
628
625
|
className: e,
|
|
629
626
|
onBack: t,
|
|
630
627
|
showBackButton: n,
|
|
@@ -643,31 +640,31 @@ const ne = ({
|
|
|
643
640
|
showChannelInfo: v = !0,
|
|
644
641
|
onParticipantNameClick: x
|
|
645
642
|
}) => {
|
|
646
|
-
var F, L,
|
|
643
|
+
var F, L, S, I;
|
|
647
644
|
const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
|
|
648
645
|
() => {
|
|
649
|
-
var
|
|
646
|
+
var y;
|
|
650
647
|
return He(
|
|
651
|
-
(
|
|
648
|
+
(y = p.state) == null ? void 0 : y.members,
|
|
652
649
|
_ == null ? void 0 : _.userID,
|
|
653
650
|
p.type
|
|
654
651
|
);
|
|
655
652
|
},
|
|
656
653
|
[(F = p.state) == null ? void 0 : F.members, _ == null ? void 0 : _.userID, p.type]
|
|
657
|
-
),
|
|
654
|
+
), C = mt(w == null ? void 0 : w.user), D = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, E = ut(p), R = fa((S = p.data) == null ? void 0 : S.customer_tag) && (w == null ? void 0 : w.is_follower) === !0, O = async () => {
|
|
658
655
|
try {
|
|
659
|
-
|
|
660
|
-
} catch (
|
|
656
|
+
E ? await p.unpin() : await p.pin();
|
|
657
|
+
} catch (y) {
|
|
661
658
|
console.error(
|
|
662
659
|
"[ChannelHeaderRedesign] Failed to update pinned status:",
|
|
663
|
-
|
|
660
|
+
y
|
|
664
661
|
);
|
|
665
662
|
}
|
|
666
663
|
};
|
|
667
664
|
return /* @__PURE__ */ s(
|
|
668
665
|
"div",
|
|
669
666
|
{
|
|
670
|
-
className:
|
|
667
|
+
className: k(
|
|
671
668
|
"@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]",
|
|
672
669
|
e
|
|
673
670
|
),
|
|
@@ -675,7 +672,7 @@ const ne = ({
|
|
|
675
672
|
/* @__PURE__ */ s("div", { className: "flex items-start", children: n && /* @__PURE__ */ s(
|
|
676
673
|
"button",
|
|
677
674
|
{
|
|
678
|
-
className:
|
|
675
|
+
className: k(
|
|
679
676
|
Ze,
|
|
680
677
|
"messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
|
|
681
678
|
),
|
|
@@ -691,14 +688,14 @@ const ne = ({
|
|
|
691
688
|
{
|
|
692
689
|
type: "button",
|
|
693
690
|
onClick: x,
|
|
694
|
-
"aria-label": `View details for ${
|
|
691
|
+
"aria-label": `View details for ${C}`,
|
|
695
692
|
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",
|
|
696
693
|
children: [
|
|
697
694
|
/* @__PURE__ */ s(
|
|
698
695
|
ne,
|
|
699
696
|
{
|
|
700
|
-
id: ((
|
|
701
|
-
name:
|
|
697
|
+
id: ((I = w == null ? void 0 : w.user) == null ? void 0 : I.id) || p.id || "unknown",
|
|
698
|
+
name: C,
|
|
702
699
|
image: D,
|
|
703
700
|
dmAgentEnabled: r,
|
|
704
701
|
shape: "circle",
|
|
@@ -708,7 +705,7 @@ const ne = ({
|
|
|
708
705
|
),
|
|
709
706
|
/* @__PURE__ */ u("span", { className: "relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 pl-3 pr-2 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-filter duration-150 group-hover:brightness-95", children: [
|
|
710
707
|
/* @__PURE__ */ u("span", { className: "flex max-w-full items-center justify-center", children: [
|
|
711
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children:
|
|
708
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: C }),
|
|
712
709
|
/* @__PURE__ */ u("span", { className: "ml-2 flex gap-1", children: [
|
|
713
710
|
R && /* @__PURE__ */ s(
|
|
714
711
|
"span",
|
|
@@ -718,7 +715,7 @@ const ne = ({
|
|
|
718
715
|
children: /* @__PURE__ */ s(Ln, { className: "size-2.5", weight: "bold" })
|
|
719
716
|
}
|
|
720
717
|
),
|
|
721
|
-
a &&
|
|
718
|
+
a && E && /* @__PURE__ */ s(
|
|
722
719
|
"span",
|
|
723
720
|
{
|
|
724
721
|
"aria-label": "Starred conversation",
|
|
@@ -751,16 +748,16 @@ const ne = ({
|
|
|
751
748
|
className: Ze,
|
|
752
749
|
onClick: O,
|
|
753
750
|
type: "button",
|
|
754
|
-
"aria-pressed":
|
|
755
|
-
"aria-label":
|
|
751
|
+
"aria-pressed": E,
|
|
752
|
+
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
756
753
|
children: /* @__PURE__ */ s(
|
|
757
754
|
Ie,
|
|
758
755
|
{
|
|
759
|
-
className:
|
|
760
|
-
"text-[#FFD60A]":
|
|
761
|
-
"text-black/90": !
|
|
756
|
+
className: k("size-5", {
|
|
757
|
+
"text-[#FFD60A]": E,
|
|
758
|
+
"text-black/90": !E
|
|
762
759
|
}),
|
|
763
|
-
weight:
|
|
760
|
+
weight: E ? "fill" : "regular"
|
|
764
761
|
}
|
|
765
762
|
)
|
|
766
763
|
}
|
|
@@ -786,13 +783,13 @@ const ne = ({
|
|
|
786
783
|
] })
|
|
787
784
|
}
|
|
788
785
|
);
|
|
789
|
-
},
|
|
790
|
-
function
|
|
786
|
+
}, pa = (e) => /* @__PURE__ */ s(Ws, { ...e, position: "center" }), lt = "vote_up", ot = "vote_down";
|
|
787
|
+
function ba(e) {
|
|
791
788
|
return e != null && e.length ? e.some((t) => t.type === ot) ? "down" : e.some((t) => t.type === lt) ? "up" : null : null;
|
|
792
789
|
}
|
|
793
|
-
function
|
|
790
|
+
function va(e) {
|
|
794
791
|
const { channel: t } = oe(), { client: n } = fe("useMessageVote"), a = re(
|
|
795
|
-
() =>
|
|
792
|
+
() => ba(e.own_reactions),
|
|
796
793
|
[e.own_reactions]
|
|
797
794
|
), r = J(async () => {
|
|
798
795
|
if (n != null && n.userID)
|
|
@@ -817,7 +814,7 @@ function xa(e) {
|
|
|
817
814
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
818
815
|
return { selected: a, voteUp: r, voteDown: i };
|
|
819
816
|
}
|
|
820
|
-
function
|
|
817
|
+
function xa(e) {
|
|
821
818
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
822
819
|
}
|
|
823
820
|
function ms({
|
|
@@ -825,31 +822,31 @@ function ms({
|
|
|
825
822
|
viewerLanguage: t
|
|
826
823
|
}) {
|
|
827
824
|
var r;
|
|
828
|
-
const n = e == null ? void 0 : e.text, a =
|
|
825
|
+
const n = e == null ? void 0 : e.text, a = xa(t);
|
|
829
826
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
830
827
|
}
|
|
831
|
-
const
|
|
832
|
-
function
|
|
828
|
+
const wa = ["linktr.ee"], Kt = "messaging-attachment-v1_0";
|
|
829
|
+
function _a(e) {
|
|
833
830
|
try {
|
|
834
831
|
return new URL(e).hostname.toLowerCase();
|
|
835
832
|
} catch {
|
|
836
833
|
return null;
|
|
837
834
|
}
|
|
838
835
|
}
|
|
839
|
-
function
|
|
840
|
-
return
|
|
836
|
+
function Na(e) {
|
|
837
|
+
return wa.some(
|
|
841
838
|
(t) => e === t || e.endsWith(`.${t}`)
|
|
842
839
|
);
|
|
843
840
|
}
|
|
844
841
|
function he(e) {
|
|
845
842
|
const t = e == null ? void 0 : e.trim();
|
|
846
843
|
if (!t) return;
|
|
847
|
-
const n =
|
|
848
|
-
if (!n || !
|
|
844
|
+
const n = _a(t);
|
|
845
|
+
if (!n || !Na(n)) return t;
|
|
849
846
|
const a = new URL(t);
|
|
850
847
|
return a.searchParams.get("io") === "true" && a.searchParams.get("size") === Kt ? t : (a.searchParams.set("io", "true"), a.searchParams.set("size", Kt), a.toString());
|
|
851
848
|
}
|
|
852
|
-
const
|
|
849
|
+
const ya = [
|
|
853
850
|
[/pdf/, "pdf"],
|
|
854
851
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
855
852
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -863,17 +860,17 @@ function ce(e) {
|
|
|
863
860
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
864
861
|
}
|
|
865
862
|
function hs(e) {
|
|
866
|
-
const t =
|
|
863
|
+
const t = ya.find(
|
|
867
864
|
([n]) => n.test(e)
|
|
868
865
|
);
|
|
869
866
|
return t ? t[1] : "generic";
|
|
870
867
|
}
|
|
871
|
-
const
|
|
868
|
+
const ka = {
|
|
872
869
|
video: os,
|
|
873
870
|
audio: zn,
|
|
874
871
|
image: Dn,
|
|
875
872
|
document: ls
|
|
876
|
-
},
|
|
873
|
+
}, Ca = {
|
|
877
874
|
pdf: Vn,
|
|
878
875
|
doc: jn,
|
|
879
876
|
xls: Bn,
|
|
@@ -884,17 +881,17 @@ const Ca = {
|
|
|
884
881
|
markdown: Fn,
|
|
885
882
|
generic: ls
|
|
886
883
|
};
|
|
887
|
-
function
|
|
884
|
+
function Sa(e) {
|
|
888
885
|
const t = ce(e);
|
|
889
|
-
return t !== "document" ?
|
|
886
|
+
return t !== "document" ? ka[t] : Ca[hs(e)];
|
|
890
887
|
}
|
|
891
888
|
function _e(e, t) {
|
|
892
|
-
return V.createElement(
|
|
889
|
+
return V.createElement(Sa(e), t);
|
|
893
890
|
}
|
|
894
|
-
const
|
|
891
|
+
const Ea = (e) => {
|
|
895
892
|
var t, n;
|
|
896
893
|
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;
|
|
897
|
-
},
|
|
894
|
+
}, Ia = ({
|
|
898
895
|
source: e,
|
|
899
896
|
mimeType: t,
|
|
900
897
|
poster: n,
|
|
@@ -906,7 +903,7 @@ const Ia = (e) => {
|
|
|
906
903
|
muted: d = !1,
|
|
907
904
|
onContainerClick: m
|
|
908
905
|
}) => {
|
|
909
|
-
const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = B(a), [p, _] = B(0), [w,
|
|
906
|
+
const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = B(a), [p, _] = B(0), [w, C] = B(!1), [D, E] = B(!1), [R, O] = B(!1), [F, L] = B(!1), [S, I] = B(!0), [y, T] = B(null), M = J(() => {
|
|
910
907
|
O(!1), x(!0);
|
|
911
908
|
}, []), P = J((N) => {
|
|
912
909
|
const A = g.current;
|
|
@@ -914,13 +911,13 @@ const Ia = (e) => {
|
|
|
914
911
|
const H = A.getBoundingClientRect();
|
|
915
912
|
return Math.max(
|
|
916
913
|
0,
|
|
917
|
-
Math.min(1, (
|
|
914
|
+
Math.min(1, (Ea(N) - H.left) / H.width)
|
|
918
915
|
);
|
|
919
916
|
}, []), $ = J((N) => {
|
|
920
917
|
const A = h.current;
|
|
921
918
|
A && A.duration && (A.currentTime = N * A.duration);
|
|
922
919
|
}, []), j = (N) => {
|
|
923
|
-
N.stopPropagation(),
|
|
920
|
+
N.stopPropagation(), C(!0);
|
|
924
921
|
const A = P(N);
|
|
925
922
|
_(A), $(A);
|
|
926
923
|
};
|
|
@@ -946,13 +943,13 @@ const Ia = (e) => {
|
|
|
946
943
|
}, [v]), K(() => {
|
|
947
944
|
if (!w) return;
|
|
948
945
|
const N = (H) => _(P(H)), A = (H) => {
|
|
949
|
-
|
|
946
|
+
C(!1), $(P(H));
|
|
950
947
|
};
|
|
951
948
|
return window.addEventListener("mousemove", N), window.addEventListener("mouseup", A), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", A), () => {
|
|
952
949
|
window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", A), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", A);
|
|
953
950
|
};
|
|
954
951
|
}, [w, P, $]);
|
|
955
|
-
const Q =
|
|
952
|
+
const Q = y ? { aspectRatio: String(y) } : void 0, ee = y ? "" : " aspect-video", X = Math.round(p * 100);
|
|
956
953
|
return /* @__PURE__ */ u(
|
|
957
954
|
"div",
|
|
958
955
|
{
|
|
@@ -977,7 +974,7 @@ const Ia = (e) => {
|
|
|
977
974
|
}
|
|
978
975
|
},
|
|
979
976
|
children: [
|
|
980
|
-
n && (f === "audio" ||
|
|
977
|
+
n && (f === "audio" || S) && /* @__PURE__ */ s(
|
|
981
978
|
"img",
|
|
982
979
|
{
|
|
983
980
|
src: n,
|
|
@@ -985,7 +982,7 @@ const Ia = (e) => {
|
|
|
985
982
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
986
983
|
}
|
|
987
984
|
),
|
|
988
|
-
!n && (f === "audio" ||
|
|
985
|
+
!n && (f === "audio" || S) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: _e(t, {
|
|
989
986
|
className: "size-12 text-black/20",
|
|
990
987
|
weight: "regular"
|
|
991
988
|
}) }),
|
|
@@ -999,7 +996,7 @@ const Ia = (e) => {
|
|
|
999
996
|
style: { width: "100%", height: "100%" },
|
|
1000
997
|
onLoadStart: () => L(!0),
|
|
1001
998
|
onCanPlay: () => {
|
|
1002
|
-
L(!1),
|
|
999
|
+
L(!1), I(!1);
|
|
1003
1000
|
},
|
|
1004
1001
|
onWaiting: () => L(!0),
|
|
1005
1002
|
onPlay: () => O(!1),
|
|
@@ -1019,7 +1016,7 @@ const Ia = (e) => {
|
|
|
1019
1016
|
style: { width: "100%", height: "100%" },
|
|
1020
1017
|
onLoadStart: () => L(!0),
|
|
1021
1018
|
onCanPlay: () => {
|
|
1022
|
-
L(!1),
|
|
1019
|
+
L(!1), I(!1);
|
|
1023
1020
|
},
|
|
1024
1021
|
onWaiting: () => L(!0),
|
|
1025
1022
|
onPlay: () => O(!1),
|
|
@@ -1109,8 +1106,8 @@ const Ia = (e) => {
|
|
|
1109
1106
|
onMouseDown: j,
|
|
1110
1107
|
onTouchStart: j,
|
|
1111
1108
|
onClick: (N) => N.stopPropagation(),
|
|
1112
|
-
onMouseEnter: () =>
|
|
1113
|
-
onMouseLeave: () =>
|
|
1109
|
+
onMouseEnter: () => E(!0),
|
|
1110
|
+
onMouseLeave: () => E(!1),
|
|
1114
1111
|
onKeyDown: (N) => {
|
|
1115
1112
|
N.key === "ArrowRight" && $(Math.min(1, p + 0.05)), N.key === "ArrowLeft" && $(Math.max(0, p - 0.05));
|
|
1116
1113
|
},
|
|
@@ -1142,7 +1139,7 @@ const Ia = (e) => {
|
|
|
1142
1139
|
]
|
|
1143
1140
|
}
|
|
1144
1141
|
);
|
|
1145
|
-
}, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20",
|
|
1142
|
+
}, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ta = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", fs = ({
|
|
1146
1143
|
mimeType: e,
|
|
1147
1144
|
sourceUrl: t,
|
|
1148
1145
|
thumbnailUrl: n,
|
|
@@ -1153,7 +1150,7 @@ const Ia = (e) => {
|
|
|
1153
1150
|
}) => {
|
|
1154
1151
|
const l = ce(e), [d, m] = B(!1), f = he(t), h = he(n);
|
|
1155
1152
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
|
|
1156
|
-
|
|
1153
|
+
Ia,
|
|
1157
1154
|
{
|
|
1158
1155
|
source: t,
|
|
1159
1156
|
mimeType: e,
|
|
@@ -1204,7 +1201,7 @@ const Ia = (e) => {
|
|
|
1204
1201
|
weight: "regular"
|
|
1205
1202
|
})
|
|
1206
1203
|
}
|
|
1207
|
-
) : n ? /* @__PURE__ */ s("div", { className: `relative ${
|
|
1204
|
+
) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ta(r)}`, children: /* @__PURE__ */ s(
|
|
1208
1205
|
"img",
|
|
1209
1206
|
{
|
|
1210
1207
|
src: h ?? n,
|
|
@@ -1242,7 +1239,7 @@ const Ia = (e) => {
|
|
|
1242
1239
|
{
|
|
1243
1240
|
ref: f,
|
|
1244
1241
|
"data-testid": h,
|
|
1245
|
-
className:
|
|
1242
|
+
className: k(
|
|
1246
1243
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1247
1244
|
g ? "bg-[#1e2330]" : "bg-white"
|
|
1248
1245
|
),
|
|
@@ -1254,7 +1251,7 @@ const Ia = (e) => {
|
|
|
1254
1251
|
c.trim() !== "" && /* @__PURE__ */ s(
|
|
1255
1252
|
"p",
|
|
1256
1253
|
{
|
|
1257
|
-
className:
|
|
1254
|
+
className: k("mb-0.5 truncate text-base font-medium", {
|
|
1258
1255
|
"text-black": !g,
|
|
1259
1256
|
"text-white/30": g && b,
|
|
1260
1257
|
"text-white": g && !b
|
|
@@ -1264,7 +1261,7 @@ const Ia = (e) => {
|
|
|
1264
1261
|
),
|
|
1265
1262
|
/* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1266
1263
|
_e(r, {
|
|
1267
|
-
className:
|
|
1264
|
+
className: k(
|
|
1268
1265
|
"size-5 shrink-0",
|
|
1269
1266
|
g ? "text-white/55" : "text-black/55"
|
|
1270
1267
|
),
|
|
@@ -1273,7 +1270,7 @@ const Ia = (e) => {
|
|
|
1273
1270
|
i != null && i !== "" && /* @__PURE__ */ s(
|
|
1274
1271
|
"span",
|
|
1275
1272
|
{
|
|
1276
|
-
className:
|
|
1273
|
+
className: k(
|
|
1277
1274
|
"text-xs font-medium",
|
|
1278
1275
|
g ? "text-white/55" : "text-black/55"
|
|
1279
1276
|
),
|
|
@@ -1294,19 +1291,19 @@ function ps(e) {
|
|
|
1294
1291
|
function ht(e) {
|
|
1295
1292
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#1e2330]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1296
1293
|
}
|
|
1297
|
-
function
|
|
1294
|
+
function Ma(e) {
|
|
1298
1295
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1299
1296
|
}
|
|
1300
|
-
function
|
|
1297
|
+
function Aa(e) {
|
|
1301
1298
|
return e ? "text-white" : "text-black";
|
|
1302
1299
|
}
|
|
1303
|
-
function
|
|
1300
|
+
function Ra(e) {
|
|
1304
1301
|
return e ? "text-white/55" : "text-black/55";
|
|
1305
1302
|
}
|
|
1306
|
-
function
|
|
1303
|
+
function La(e) {
|
|
1307
1304
|
return e ? "text-white/40" : "text-black/40";
|
|
1308
1305
|
}
|
|
1309
|
-
function
|
|
1306
|
+
function Da(e) {
|
|
1310
1307
|
return e ? "text-white/20" : "text-black/20";
|
|
1311
1308
|
}
|
|
1312
1309
|
const ft = ({ attachment: e, isMyMessage: t }) => {
|
|
@@ -1321,14 +1318,14 @@ const ft = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1321
1318
|
) : /* @__PURE__ */ s(
|
|
1322
1319
|
"div",
|
|
1323
1320
|
{
|
|
1324
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1325
|
-
children: /* @__PURE__ */ s(Hn, { className: `size-12 ${
|
|
1321
|
+
className: `aspect-video w-full rounded-[20px] ${Ma(t)} flex items-center justify-center`,
|
|
1322
|
+
children: /* @__PURE__ */ s(Hn, { className: `size-12 ${Da(t)}` })
|
|
1326
1323
|
}
|
|
1327
1324
|
) }),
|
|
1328
1325
|
/* @__PURE__ */ u("div", { className: "px-3 pb-3", children: [
|
|
1329
|
-
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1330
|
-
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${
|
|
1331
|
-
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1326
|
+
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Aa(t)}`, children: n }),
|
|
1327
|
+
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Ra(t)}`, children: a }),
|
|
1328
|
+
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${La(t)}`, children: d })
|
|
1332
1329
|
] })
|
|
1333
1330
|
] });
|
|
1334
1331
|
return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
|
|
@@ -1340,7 +1337,7 @@ function gt(e) {
|
|
|
1340
1337
|
var t;
|
|
1341
1338
|
return (t = e.attachments) == null ? void 0 : t.find(bs);
|
|
1342
1339
|
}
|
|
1343
|
-
async function
|
|
1340
|
+
async function za(e, t) {
|
|
1344
1341
|
let n;
|
|
1345
1342
|
try {
|
|
1346
1343
|
n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1352,7 +1349,7 @@ async function Fa(e, t) {
|
|
|
1352
1349
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1353
1350
|
o.href = i, o.download = n, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1354
1351
|
}
|
|
1355
|
-
const
|
|
1352
|
+
const Fa = ({
|
|
1356
1353
|
url: e,
|
|
1357
1354
|
filename: t
|
|
1358
1355
|
}) => {
|
|
@@ -1364,7 +1361,7 @@ const Pa = ({
|
|
|
1364
1361
|
onClick: (i) => {
|
|
1365
1362
|
i.stopPropagation();
|
|
1366
1363
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1367
|
-
a(!0),
|
|
1364
|
+
a(!0), za(e, t).then(() => {
|
|
1368
1365
|
o == null || o.close();
|
|
1369
1366
|
}).catch(() => {
|
|
1370
1367
|
o && (o.location.href = e);
|
|
@@ -1454,10 +1451,10 @@ const vs = ({
|
|
|
1454
1451
|
containedImage: i === "image" || i === "document"
|
|
1455
1452
|
}
|
|
1456
1453
|
),
|
|
1457
|
-
action: /* @__PURE__ */ s(
|
|
1454
|
+
action: /* @__PURE__ */ s(Fa, { url: e, filename: n })
|
|
1458
1455
|
}
|
|
1459
1456
|
);
|
|
1460
|
-
},
|
|
1457
|
+
}, Pa = ({
|
|
1461
1458
|
message: e,
|
|
1462
1459
|
isMyMessage: t = !1
|
|
1463
1460
|
}) => {
|
|
@@ -1489,7 +1486,7 @@ const vs = ({
|
|
|
1489
1486
|
}
|
|
1490
1487
|
)
|
|
1491
1488
|
] });
|
|
1492
|
-
},
|
|
1489
|
+
}, Oa = ({
|
|
1493
1490
|
message: e
|
|
1494
1491
|
}) => {
|
|
1495
1492
|
const t = gt(e);
|
|
@@ -1497,7 +1494,7 @@ const vs = ({
|
|
|
1497
1494
|
return /* @__PURE__ */ s("div", { className: ht(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !0 }) });
|
|
1498
1495
|
const n = pt(e);
|
|
1499
1496
|
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
|
|
1500
|
-
},
|
|
1497
|
+
}, $a = ({
|
|
1501
1498
|
message: e
|
|
1502
1499
|
}) => {
|
|
1503
1500
|
const t = gt(e);
|
|
@@ -1505,19 +1502,19 @@ const vs = ({
|
|
|
1505
1502
|
return /* @__PURE__ */ s("div", { className: ht(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !1 }) });
|
|
1506
1503
|
const n = pt(e);
|
|
1507
1504
|
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(xs, { ...n }) }) : null;
|
|
1508
|
-
},
|
|
1509
|
-
Creator:
|
|
1510
|
-
Visitor:
|
|
1511
|
-
}),
|
|
1505
|
+
}, hl = Object.assign(Pa, {
|
|
1506
|
+
Creator: Oa,
|
|
1507
|
+
Visitor: $a
|
|
1508
|
+
}), Ua = {
|
|
1512
1509
|
dark: "bg-[#1e2330]",
|
|
1513
1510
|
light: "bg-[#f2f1ef]"
|
|
1514
|
-
},
|
|
1511
|
+
}, Ba = {
|
|
1515
1512
|
dark: "text-white",
|
|
1516
1513
|
light: "text-[#000000]"
|
|
1517
|
-
},
|
|
1514
|
+
}, ja = {
|
|
1518
1515
|
dark: "border-white/[0.08]",
|
|
1519
1516
|
light: "border-black/[0.08]"
|
|
1520
|
-
},
|
|
1517
|
+
}, Va = (e) => e === "dark" ? "sender" : "receiver", Ga = {
|
|
1521
1518
|
sender: {
|
|
1522
1519
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1523
1520
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1539,13 +1536,13 @@ const vs = ({
|
|
|
1539
1536
|
children: i,
|
|
1540
1537
|
"data-testid": o
|
|
1541
1538
|
}) => {
|
|
1542
|
-
const l = t != null && t !== "", d =
|
|
1539
|
+
const l = t != null && t !== "", d = Ga[Va(e)][a];
|
|
1543
1540
|
return /* @__PURE__ */ u(
|
|
1544
1541
|
"div",
|
|
1545
1542
|
{
|
|
1546
1543
|
"data-testid": o,
|
|
1547
1544
|
"data-group-position": a,
|
|
1548
|
-
className:
|
|
1545
|
+
className: k(
|
|
1549
1546
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
1550
1547
|
// and keeps the document / image / audio bubbles visually
|
|
1551
1548
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -1554,10 +1551,10 @@ const vs = ({
|
|
|
1554
1551
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1555
1552
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1556
1553
|
d,
|
|
1554
|
+
Ua[e],
|
|
1557
1555
|
Ba[e],
|
|
1558
|
-
ja[e],
|
|
1559
1556
|
n && "border",
|
|
1560
|
-
n &&
|
|
1557
|
+
n && ja[e],
|
|
1561
1558
|
r
|
|
1562
1559
|
),
|
|
1563
1560
|
children: [
|
|
@@ -1565,7 +1562,7 @@ const vs = ({
|
|
|
1565
1562
|
l ? /* @__PURE__ */ s(
|
|
1566
1563
|
"p",
|
|
1567
1564
|
{
|
|
1568
|
-
className:
|
|
1565
|
+
className: k(
|
|
1569
1566
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
1570
1567
|
// the same font family + size as `.str-chat__message-text`
|
|
1571
1568
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -1594,22 +1591,22 @@ const vs = ({
|
|
|
1594
1591
|
a.stopPropagation(), e();
|
|
1595
1592
|
},
|
|
1596
1593
|
"aria-label": n,
|
|
1597
|
-
className:
|
|
1594
|
+
className: k(
|
|
1598
1595
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
1599
1596
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
1600
1597
|
),
|
|
1601
1598
|
children: /* @__PURE__ */ s(Ge, { className: "size-3", weight: "bold" })
|
|
1602
1599
|
}
|
|
1603
|
-
), Re = (e) => e === "received" ? "light" : "dark",
|
|
1600
|
+
), Re = (e) => e === "received" ? "light" : "dark", Ha = ({
|
|
1604
1601
|
firstOfGroup: e,
|
|
1605
1602
|
endOfGroup: t,
|
|
1606
1603
|
groupedByUser: n
|
|
1607
|
-
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1604
|
+
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ya = ({
|
|
1608
1605
|
src: e,
|
|
1609
1606
|
mimeType: t,
|
|
1610
1607
|
filename: n,
|
|
1611
1608
|
items: a
|
|
1612
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [],
|
|
1609
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], qa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1613
1610
|
/* @__PURE__ */ s(
|
|
1614
1611
|
"audio",
|
|
1615
1612
|
{
|
|
@@ -1632,7 +1629,7 @@ const vs = ({
|
|
|
1632
1629
|
preload: l,
|
|
1633
1630
|
onDismiss: d
|
|
1634
1631
|
}) => {
|
|
1635
|
-
const m = Re(e), f = e === "composer" && !!d, h =
|
|
1632
|
+
const m = Re(e), f = e === "composer" && !!d, h = Ya({ src: t, mimeType: n, filename: a, items: r });
|
|
1636
1633
|
if (h.length === 0)
|
|
1637
1634
|
return null;
|
|
1638
1635
|
const g = l ?? (h.length > 1 ? "none" : "metadata");
|
|
@@ -1644,7 +1641,7 @@ const vs = ({
|
|
|
1644
1641
|
groupPosition: o,
|
|
1645
1642
|
"data-testid": "audio-attachment",
|
|
1646
1643
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, b) => /* @__PURE__ */ s(
|
|
1647
|
-
|
|
1644
|
+
qa,
|
|
1648
1645
|
{
|
|
1649
1646
|
item: c,
|
|
1650
1647
|
preload: g,
|
|
@@ -1658,15 +1655,15 @@ const vs = ({
|
|
|
1658
1655
|
)) })
|
|
1659
1656
|
}
|
|
1660
1657
|
);
|
|
1661
|
-
},
|
|
1662
|
-
Composer:
|
|
1663
|
-
Sent:
|
|
1664
|
-
Received:
|
|
1658
|
+
}, Wa = (e) => /* @__PURE__ */ s(bt, { ...e, state: "composer" }), Xa = (e) => /* @__PURE__ */ s(bt, { ...e, state: "sent" }), Ka = (e) => /* @__PURE__ */ s(bt, { ...e, state: "received" }), Za = {
|
|
1659
|
+
Composer: Wa,
|
|
1660
|
+
Sent: Xa,
|
|
1661
|
+
Received: Ka
|
|
1665
1662
|
};
|
|
1666
|
-
function
|
|
1663
|
+
function Ja(e) {
|
|
1667
1664
|
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`;
|
|
1668
1665
|
}
|
|
1669
|
-
const
|
|
1666
|
+
const Qa = {
|
|
1670
1667
|
pdf: "PDF",
|
|
1671
1668
|
doc: "DOC",
|
|
1672
1669
|
xls: "XLS",
|
|
@@ -1676,7 +1673,7 @@ const er = {
|
|
|
1676
1673
|
text: "TXT",
|
|
1677
1674
|
markdown: "MD"
|
|
1678
1675
|
};
|
|
1679
|
-
function
|
|
1676
|
+
function er(e, t) {
|
|
1680
1677
|
if (t) {
|
|
1681
1678
|
const r = t.lastIndexOf(".");
|
|
1682
1679
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1686,7 +1683,7 @@ function tr(e, t) {
|
|
|
1686
1683
|
}
|
|
1687
1684
|
if (!e) return;
|
|
1688
1685
|
if (ce(e) === "document") {
|
|
1689
|
-
const r = hs(e), i =
|
|
1686
|
+
const r = hs(e), i = Qa[r];
|
|
1690
1687
|
if (i) return i;
|
|
1691
1688
|
if (e === "application/octet-stream") return;
|
|
1692
1689
|
}
|
|
@@ -1694,8 +1691,8 @@ function tr(e, t) {
|
|
|
1694
1691
|
if (!(!a || a === "*"))
|
|
1695
1692
|
return a.toUpperCase();
|
|
1696
1693
|
}
|
|
1697
|
-
function
|
|
1698
|
-
const a =
|
|
1694
|
+
function tr(e, t, n) {
|
|
1695
|
+
const a = er(e, t), r = typeof n == "number" && n > 0 ? Ja(n) : void 0;
|
|
1699
1696
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1700
1697
|
}
|
|
1701
1698
|
function ie(e) {
|
|
@@ -1706,13 +1703,13 @@ function ie(e) {
|
|
|
1706
1703
|
return "download";
|
|
1707
1704
|
}
|
|
1708
1705
|
}
|
|
1709
|
-
const
|
|
1706
|
+
const sr = {
|
|
1710
1707
|
dark: "text-white/55",
|
|
1711
1708
|
light: "text-black/65"
|
|
1712
|
-
},
|
|
1709
|
+
}, nr = {
|
|
1713
1710
|
dark: "bg-white/10",
|
|
1714
1711
|
light: "bg-black/5"
|
|
1715
|
-
},
|
|
1712
|
+
}, ar = {
|
|
1716
1713
|
dark: "text-white/85",
|
|
1717
1714
|
light: "text-black/85"
|
|
1718
1715
|
}, ws = ({
|
|
@@ -1725,16 +1722,16 @@ const nr = {
|
|
|
1725
1722
|
activateLabel: o,
|
|
1726
1723
|
trailingAction: l
|
|
1727
1724
|
}) => {
|
|
1728
|
-
const d = n ?? t ?? "File", m =
|
|
1725
|
+
const d = n ?? t ?? "File", m = tr(a, t, r), f = /* @__PURE__ */ s(
|
|
1729
1726
|
"div",
|
|
1730
1727
|
{
|
|
1731
|
-
className:
|
|
1728
|
+
className: k(
|
|
1732
1729
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1733
|
-
|
|
1730
|
+
nr[e]
|
|
1734
1731
|
),
|
|
1735
1732
|
"aria-hidden": !0,
|
|
1736
1733
|
children: _e(a, {
|
|
1737
|
-
className:
|
|
1734
|
+
className: k("size-6", ar[e]),
|
|
1738
1735
|
weight: "regular"
|
|
1739
1736
|
})
|
|
1740
1737
|
}
|
|
@@ -1743,9 +1740,9 @@ const nr = {
|
|
|
1743
1740
|
m ? /* @__PURE__ */ s(
|
|
1744
1741
|
"p",
|
|
1745
1742
|
{
|
|
1746
|
-
className:
|
|
1743
|
+
className: k(
|
|
1747
1744
|
"truncate text-xs leading-4",
|
|
1748
|
-
|
|
1745
|
+
sr[e]
|
|
1749
1746
|
),
|
|
1750
1747
|
children: m
|
|
1751
1748
|
}
|
|
@@ -1756,7 +1753,7 @@ const nr = {
|
|
|
1756
1753
|
type: "button",
|
|
1757
1754
|
onClick: i,
|
|
1758
1755
|
"aria-label": o,
|
|
1759
|
-
className:
|
|
1756
|
+
className: k(
|
|
1760
1757
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
1761
1758
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
1762
1759
|
),
|
|
@@ -1788,14 +1785,14 @@ async function _s(e, t) {
|
|
|
1788
1785
|
}
|
|
1789
1786
|
}
|
|
1790
1787
|
}
|
|
1791
|
-
const
|
|
1788
|
+
const rr = ({
|
|
1792
1789
|
src: e,
|
|
1793
1790
|
filename: t,
|
|
1794
1791
|
fileSize: n,
|
|
1795
1792
|
mimeType: a,
|
|
1796
1793
|
title: r,
|
|
1797
1794
|
items: i
|
|
1798
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [],
|
|
1795
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], ir = ({
|
|
1799
1796
|
variant: e,
|
|
1800
1797
|
item: t,
|
|
1801
1798
|
index: n,
|
|
@@ -1829,7 +1826,7 @@ const ir = ({
|
|
|
1829
1826
|
onClick: m,
|
|
1830
1827
|
onDismiss: f
|
|
1831
1828
|
}) => {
|
|
1832
|
-
const h = Re(e), g = e === "composer" && !!f, c =
|
|
1829
|
+
const h = Re(e), g = e === "composer" && !!f, c = rr({
|
|
1833
1830
|
src: t,
|
|
1834
1831
|
filename: n,
|
|
1835
1832
|
fileSize: a,
|
|
@@ -1848,7 +1845,7 @@ const ir = ({
|
|
|
1848
1845
|
const v = /* @__PURE__ */ s(
|
|
1849
1846
|
"span",
|
|
1850
1847
|
{
|
|
1851
|
-
className:
|
|
1848
|
+
className: k(
|
|
1852
1849
|
"flex size-8 items-center justify-center rounded-full",
|
|
1853
1850
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1854
1851
|
),
|
|
@@ -1864,7 +1861,7 @@ const ir = ({
|
|
|
1864
1861
|
groupPosition: d,
|
|
1865
1862
|
"data-testid": "file-attachment",
|
|
1866
1863
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((x, p) => /* @__PURE__ */ s(
|
|
1867
|
-
|
|
1864
|
+
ir,
|
|
1868
1865
|
{
|
|
1869
1866
|
variant: h,
|
|
1870
1867
|
item: x,
|
|
@@ -1876,10 +1873,10 @@ const ir = ({
|
|
|
1876
1873
|
)) })
|
|
1877
1874
|
}
|
|
1878
1875
|
);
|
|
1879
|
-
},
|
|
1880
|
-
Composer:
|
|
1881
|
-
Sent:
|
|
1882
|
-
Received:
|
|
1876
|
+
}, lr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "composer" }), or = (e) => /* @__PURE__ */ s(vt, { ...e, state: "sent" }), cr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "received" }), dr = {
|
|
1877
|
+
Composer: lr,
|
|
1878
|
+
Sent: or,
|
|
1879
|
+
Received: cr
|
|
1883
1880
|
}, xt = ({
|
|
1884
1881
|
onPrev: e,
|
|
1885
1882
|
onNext: t,
|
|
@@ -1923,7 +1920,7 @@ const ir = ({
|
|
|
1923
1920
|
}));
|
|
1924
1921
|
},
|
|
1925
1922
|
[l, e, t, o]
|
|
1926
|
-
), f = r ?? n !== "pill", g = { className:
|
|
1923
|
+
), f = r ?? n !== "pill", g = { className: k(
|
|
1927
1924
|
n === "pill" ? "size-4" : "size-5",
|
|
1928
1925
|
"shrink-0"
|
|
1929
1926
|
), weight: "bold" };
|
|
@@ -1934,7 +1931,7 @@ const ir = ({
|
|
|
1934
1931
|
onClick: m,
|
|
1935
1932
|
disabled: l,
|
|
1936
1933
|
"aria-label": a,
|
|
1937
|
-
className:
|
|
1934
|
+
className: k(
|
|
1938
1935
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
1939
1936
|
{
|
|
1940
1937
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -1974,7 +1971,7 @@ const ir = ({
|
|
|
1974
1971
|
onClick: m,
|
|
1975
1972
|
disabled: l,
|
|
1976
1973
|
"aria-label": f ? a : void 0,
|
|
1977
|
-
className:
|
|
1974
|
+
className: k(
|
|
1978
1975
|
"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
|
|
1979
1976
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
1980
1977
|
),
|
|
@@ -2162,7 +2159,7 @@ const ir = ({
|
|
|
2162
2159
|
]
|
|
2163
2160
|
}
|
|
2164
2161
|
) : null;
|
|
2165
|
-
},
|
|
2162
|
+
}, ur = "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", ks = ({
|
|
2166
2163
|
tiles: e,
|
|
2167
2164
|
onTileActivate: t,
|
|
2168
2165
|
maxVisible: n = 4,
|
|
@@ -2171,14 +2168,14 @@ const ir = ({
|
|
|
2171
2168
|
const r = e.length;
|
|
2172
2169
|
if (r === 0) return null;
|
|
2173
2170
|
const i = e.slice(0, Math.min(r, n)), o = r - i.length, l = (d, m, f) => {
|
|
2174
|
-
const h =
|
|
2171
|
+
const h = k(ur, "h-full w-full");
|
|
2175
2172
|
return t ? /* @__PURE__ */ u(
|
|
2176
2173
|
"button",
|
|
2177
2174
|
{
|
|
2178
2175
|
type: "button",
|
|
2179
2176
|
onClick: () => t(m),
|
|
2180
2177
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
2181
|
-
className:
|
|
2178
|
+
className: k(h, "cursor-zoom-in"),
|
|
2182
2179
|
children: [
|
|
2183
2180
|
d.content,
|
|
2184
2181
|
f
|
|
@@ -2190,10 +2187,10 @@ const ir = ({
|
|
|
2190
2187
|
f
|
|
2191
2188
|
] }, m);
|
|
2192
2189
|
};
|
|
2193
|
-
return i.length === 1 ? /* @__PURE__ */ s("div", { className:
|
|
2190
|
+
return i.length === 1 ? /* @__PURE__ */ s("div", { className: k("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ s(
|
|
2194
2191
|
"div",
|
|
2195
2192
|
{
|
|
2196
|
-
className:
|
|
2193
|
+
className: k(
|
|
2197
2194
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
2198
2195
|
a
|
|
2199
2196
|
),
|
|
@@ -2202,7 +2199,7 @@ const ir = ({
|
|
|
2202
2199
|
) : i.length === 3 ? /* @__PURE__ */ u(
|
|
2203
2200
|
"div",
|
|
2204
2201
|
{
|
|
2205
|
-
className:
|
|
2202
|
+
className: k(
|
|
2206
2203
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
2207
2204
|
a
|
|
2208
2205
|
),
|
|
@@ -2215,7 +2212,7 @@ const ir = ({
|
|
|
2215
2212
|
) : /* @__PURE__ */ s(
|
|
2216
2213
|
"div",
|
|
2217
2214
|
{
|
|
2218
|
-
className:
|
|
2215
|
+
className: k(
|
|
2219
2216
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
2220
2217
|
a
|
|
2221
2218
|
),
|
|
@@ -2240,7 +2237,7 @@ const ir = ({
|
|
|
2240
2237
|
[e]
|
|
2241
2238
|
), o = J(() => n(!1), []);
|
|
2242
2239
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
2243
|
-
},
|
|
2240
|
+
}, mr = (e, t, n, a) => ({
|
|
2244
2241
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
2245
2242
|
content: /* @__PURE__ */ s(
|
|
2246
2243
|
"img",
|
|
@@ -2255,7 +2252,7 @@ const ir = ({
|
|
|
2255
2252
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2256
2253
|
}
|
|
2257
2254
|
)
|
|
2258
|
-
}),
|
|
2255
|
+
}), hr = ({
|
|
2259
2256
|
src: e,
|
|
2260
2257
|
alt: t,
|
|
2261
2258
|
items: n
|
|
@@ -2263,7 +2260,7 @@ const ir = ({
|
|
|
2263
2260
|
src: n.src,
|
|
2264
2261
|
alt: n.alt,
|
|
2265
2262
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2266
|
-
})),
|
|
2263
|
+
})), fr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2267
2264
|
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Le(
|
|
2268
2265
|
r
|
|
2269
2266
|
);
|
|
@@ -2310,13 +2307,13 @@ const ir = ({
|
|
|
2310
2307
|
loading: l = "lazy",
|
|
2311
2308
|
onClick: d
|
|
2312
2309
|
}) => {
|
|
2313
|
-
const m =
|
|
2310
|
+
const m = hr({ src: t, alt: n, items: r }), f = Re(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: b } = Le(
|
|
2314
2311
|
d
|
|
2315
2312
|
);
|
|
2316
2313
|
if (m.length === 0)
|
|
2317
2314
|
return null;
|
|
2318
2315
|
const v = m.map(
|
|
2319
|
-
(x, p) =>
|
|
2316
|
+
(x, p) => mr(x, p, m.length, l)
|
|
2320
2317
|
);
|
|
2321
2318
|
return /* @__PURE__ */ u(
|
|
2322
2319
|
Me,
|
|
@@ -2339,11 +2336,11 @@ const ir = ({
|
|
|
2339
2336
|
]
|
|
2340
2337
|
}
|
|
2341
2338
|
);
|
|
2342
|
-
},
|
|
2343
|
-
Composer:
|
|
2344
|
-
Sent:
|
|
2345
|
-
Received:
|
|
2346
|
-
},
|
|
2339
|
+
}, gr = (e) => /* @__PURE__ */ s(fr, { ...e }), pr = (e) => /* @__PURE__ */ s(Ss, { ...e, state: "sent" }), br = (e) => /* @__PURE__ */ s(Ss, { ...e, state: "received" }), vr = {
|
|
2340
|
+
Composer: gr,
|
|
2341
|
+
Sent: pr,
|
|
2342
|
+
Received: br
|
|
2343
|
+
}, xr = ({
|
|
2347
2344
|
open: e,
|
|
2348
2345
|
items: t,
|
|
2349
2346
|
initialIndex: n = 0,
|
|
@@ -2357,7 +2354,7 @@ const ir = ({
|
|
|
2357
2354
|
() => (l == null ? void 0 : l.filename) ?? (l ? ie(l.src) : "document"),
|
|
2358
2355
|
[l]
|
|
2359
2356
|
), m = re(
|
|
2360
|
-
() => l ?
|
|
2357
|
+
() => l ? wr(l.src) : void 0,
|
|
2361
2358
|
[l]
|
|
2362
2359
|
);
|
|
2363
2360
|
return !l || !m ? null : /* @__PURE__ */ u(
|
|
@@ -2391,16 +2388,16 @@ const ir = ({
|
|
|
2391
2388
|
]
|
|
2392
2389
|
}
|
|
2393
2390
|
);
|
|
2394
|
-
},
|
|
2391
|
+
}, wr = (e) => {
|
|
2395
2392
|
const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2396
2393
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
|
|
2397
|
-
},
|
|
2394
|
+
}, _r = ({
|
|
2398
2395
|
src: e,
|
|
2399
2396
|
filename: t,
|
|
2400
2397
|
fileSize: n,
|
|
2401
2398
|
title: a,
|
|
2402
2399
|
items: r
|
|
2403
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [],
|
|
2400
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], Nr = ({
|
|
2404
2401
|
variant: e,
|
|
2405
2402
|
item: t,
|
|
2406
2403
|
index: n,
|
|
@@ -2433,7 +2430,7 @@ const ir = ({
|
|
|
2433
2430
|
onClick: d,
|
|
2434
2431
|
onDismiss: m
|
|
2435
2432
|
}) => {
|
|
2436
|
-
const f = Re(e), h =
|
|
2433
|
+
const f = Re(e), h = _r({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
|
|
2437
2434
|
d
|
|
2438
2435
|
), x = e === "composer" && !!m;
|
|
2439
2436
|
if (h.length === 0)
|
|
@@ -2451,18 +2448,18 @@ const ir = ({
|
|
|
2451
2448
|
"data-testid": "pdf-attachment",
|
|
2452
2449
|
children: [
|
|
2453
2450
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((_, w) => {
|
|
2454
|
-
const
|
|
2451
|
+
const C = _.filename ?? ie(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2455
2452
|
Ns,
|
|
2456
2453
|
{
|
|
2457
2454
|
url: _.src,
|
|
2458
|
-
filename:
|
|
2455
|
+
filename: C,
|
|
2459
2456
|
variant: "inline",
|
|
2460
|
-
label: `Download ${
|
|
2457
|
+
label: `Download ${C}`,
|
|
2461
2458
|
tone: f
|
|
2462
2459
|
}
|
|
2463
2460
|
);
|
|
2464
2461
|
return /* @__PURE__ */ s(
|
|
2465
|
-
|
|
2462
|
+
Nr,
|
|
2466
2463
|
{
|
|
2467
2464
|
variant: f,
|
|
2468
2465
|
item: _,
|
|
@@ -2474,7 +2471,7 @@ const ir = ({
|
|
|
2474
2471
|
);
|
|
2475
2472
|
}) }),
|
|
2476
2473
|
/* @__PURE__ */ s(
|
|
2477
|
-
|
|
2474
|
+
xr,
|
|
2478
2475
|
{
|
|
2479
2476
|
open: g,
|
|
2480
2477
|
items: p,
|
|
@@ -2485,10 +2482,10 @@ const ir = ({
|
|
|
2485
2482
|
]
|
|
2486
2483
|
}
|
|
2487
2484
|
);
|
|
2488
|
-
},
|
|
2489
|
-
Composer:
|
|
2490
|
-
Sent:
|
|
2491
|
-
Received:
|
|
2485
|
+
}, yr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "composer" }), kr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "sent" }), Cr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "received" }), Sr = {
|
|
2486
|
+
Composer: yr,
|
|
2487
|
+
Sent: kr,
|
|
2488
|
+
Received: Cr
|
|
2492
2489
|
}, Es = ({
|
|
2493
2490
|
open: e,
|
|
2494
2491
|
items: t,
|
|
@@ -2539,7 +2536,7 @@ const ir = ({
|
|
|
2539
2536
|
]
|
|
2540
2537
|
}
|
|
2541
2538
|
) : null;
|
|
2542
|
-
},
|
|
2539
|
+
}, Er = () => /* @__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(rt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Is = ({
|
|
2543
2540
|
item: e,
|
|
2544
2541
|
index: t
|
|
2545
2542
|
}) => /* @__PURE__ */ u("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2561,11 +2558,11 @@ const ir = ({
|
|
|
2561
2558
|
"aria-hidden": !0
|
|
2562
2559
|
}
|
|
2563
2560
|
) }),
|
|
2564
|
-
/* @__PURE__ */ s(
|
|
2565
|
-
] }),
|
|
2561
|
+
/* @__PURE__ */ s(Er, {})
|
|
2562
|
+
] }), Ir = (e, t, n) => ({
|
|
2566
2563
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2567
2564
|
content: /* @__PURE__ */ s(Is, { item: e, index: t })
|
|
2568
|
-
}),
|
|
2565
|
+
}), Tr = ({
|
|
2569
2566
|
src: e,
|
|
2570
2567
|
poster: t,
|
|
2571
2568
|
mimeType: n,
|
|
@@ -2577,7 +2574,7 @@ const ir = ({
|
|
|
2577
2574
|
mimeType: n.mimeType,
|
|
2578
2575
|
preload: n.preload,
|
|
2579
2576
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2580
|
-
})),
|
|
2577
|
+
})), Mr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
2581
2578
|
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: f } = Le(
|
|
2582
2579
|
i
|
|
2583
2580
|
);
|
|
@@ -2618,13 +2615,13 @@ const ir = ({
|
|
|
2618
2615
|
preload: d,
|
|
2619
2616
|
onClick: m
|
|
2620
2617
|
}) => {
|
|
2621
|
-
const f =
|
|
2618
|
+
const f = Tr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Re(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
|
|
2622
2619
|
m
|
|
2623
2620
|
);
|
|
2624
2621
|
if (f.length === 0)
|
|
2625
2622
|
return null;
|
|
2626
2623
|
const x = f.map(
|
|
2627
|
-
(p, _) =>
|
|
2624
|
+
(p, _) => Ir(p, _, f.length)
|
|
2628
2625
|
);
|
|
2629
2626
|
return /* @__PURE__ */ u(
|
|
2630
2627
|
Me,
|
|
@@ -2654,31 +2651,31 @@ const ir = ({
|
|
|
2654
2651
|
]
|
|
2655
2652
|
}
|
|
2656
2653
|
);
|
|
2657
|
-
},
|
|
2658
|
-
Composer:
|
|
2659
|
-
Sent:
|
|
2660
|
-
Received:
|
|
2654
|
+
}, Ar = (e) => /* @__PURE__ */ s(Mr, { ...e }), Rr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "sent" }), Lr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "received" }), Dr = {
|
|
2655
|
+
Composer: Ar,
|
|
2656
|
+
Sent: Rr,
|
|
2657
|
+
Received: Lr
|
|
2661
2658
|
}, ke = {
|
|
2662
|
-
Image:
|
|
2663
|
-
Video:
|
|
2664
|
-
Audio:
|
|
2665
|
-
Pdf:
|
|
2666
|
-
File:
|
|
2667
|
-
},
|
|
2659
|
+
Image: vr,
|
|
2660
|
+
Video: Dr,
|
|
2661
|
+
Audio: Za,
|
|
2662
|
+
Pdf: Sr,
|
|
2663
|
+
File: dr
|
|
2664
|
+
}, zr = {
|
|
2668
2665
|
isUnlocking: () => !1
|
|
2669
|
-
},
|
|
2670
|
-
LockedAttachment:
|
|
2671
|
-
}, As = ct({}),
|
|
2672
|
-
function
|
|
2673
|
-
return Te(As)[e] ??
|
|
2666
|
+
}, Fr = {
|
|
2667
|
+
LockedAttachment: zr
|
|
2668
|
+
}, As = ct({}), fl = As.Provider;
|
|
2669
|
+
function Pr(e) {
|
|
2670
|
+
return Te(As)[e] ?? Fr[e];
|
|
2674
2671
|
}
|
|
2675
|
-
const
|
|
2672
|
+
const Or = V.lazy(() => import("./Card-qS17qnN0.js")), $r = V.lazy(() => import("./Card-CWlzDHJA.js")), Ur = () => /* @__PURE__ */ s(
|
|
2676
2673
|
"div",
|
|
2677
2674
|
{
|
|
2678
2675
|
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)]",
|
|
2679
2676
|
"aria-hidden": !0
|
|
2680
2677
|
}
|
|
2681
|
-
), Pe = (e) => /* @__PURE__ */ s(Gs, { fallback: /* @__PURE__ */ s(
|
|
2678
|
+
), Pe = (e) => /* @__PURE__ */ s(Gs, { fallback: /* @__PURE__ */ s(Ur, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Or, { ...e }) : /* @__PURE__ */ s($r, { ...e }) }), Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2682
2679
|
"svg",
|
|
2683
2680
|
{
|
|
2684
2681
|
width: e,
|
|
@@ -2695,10 +2692,10 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2695
2692
|
}
|
|
2696
2693
|
)
|
|
2697
2694
|
}
|
|
2698
|
-
),
|
|
2695
|
+
), jr = (e) => {
|
|
2699
2696
|
var t;
|
|
2700
2697
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2701
|
-
},
|
|
2698
|
+
}, Vr = (e) => {
|
|
2702
2699
|
var t;
|
|
2703
2700
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2704
2701
|
}, Ue = (e) => {
|
|
@@ -2707,13 +2704,13 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2707
2704
|
}, yt = (e) => {
|
|
2708
2705
|
var t;
|
|
2709
2706
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2710
|
-
},
|
|
2707
|
+
}, Gr = (e) => {
|
|
2711
2708
|
var t;
|
|
2712
2709
|
return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
|
|
2713
|
-
},
|
|
2710
|
+
}, Hr = (e) => {
|
|
2714
2711
|
var t;
|
|
2715
2712
|
return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
|
|
2716
|
-
}, Rs = (e) =>
|
|
2713
|
+
}, Rs = (e) => jr(e) || Vr(e), Yr = (e) => {
|
|
2717
2714
|
var t;
|
|
2718
2715
|
return Rs(e) && !((t = e.text) != null && t.trim());
|
|
2719
2716
|
}, Qe = ({
|
|
@@ -2739,7 +2736,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2739
2736
|
"message-chatbot-indicator",
|
|
2740
2737
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2741
2738
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2742
|
-
].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(
|
|
2739
|
+
].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(Br, { size: o ? 12 : 15 }) });
|
|
2743
2740
|
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ u(se, { children: [
|
|
2744
2741
|
m,
|
|
2745
2742
|
f
|
|
@@ -2747,7 +2744,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2747
2744
|
f,
|
|
2748
2745
|
m
|
|
2749
2746
|
] }) });
|
|
2750
|
-
},
|
|
2747
|
+
}, qr = ({
|
|
2751
2748
|
selected: e,
|
|
2752
2749
|
onVoteUp: t,
|
|
2753
2750
|
onVoteDown: n
|
|
@@ -2756,7 +2753,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2756
2753
|
"button",
|
|
2757
2754
|
{
|
|
2758
2755
|
type: "button",
|
|
2759
|
-
className:
|
|
2756
|
+
className: k("message-vote-button focus-ring", {
|
|
2760
2757
|
"message-vote-button--selected": e === "up"
|
|
2761
2758
|
}),
|
|
2762
2759
|
onClick: t,
|
|
@@ -2770,7 +2767,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2770
2767
|
"button",
|
|
2771
2768
|
{
|
|
2772
2769
|
type: "button",
|
|
2773
|
-
className:
|
|
2770
|
+
className: k("message-vote-button focus-ring", {
|
|
2774
2771
|
"message-vote-button--selected": e === "down"
|
|
2775
2772
|
}),
|
|
2776
2773
|
onClick: n,
|
|
@@ -2793,33 +2790,33 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
|
|
|
2793
2790
|
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2794
2791
|
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2795
2792
|
] });
|
|
2796
|
-
},
|
|
2793
|
+
}, Wr = () => null, Xr = () => /* @__PURE__ */ s(
|
|
2797
2794
|
Xs,
|
|
2798
2795
|
{
|
|
2799
2796
|
MessageSentStatus: et,
|
|
2800
2797
|
MessageDeliveredStatus: et,
|
|
2801
2798
|
MessageReadStatus: et,
|
|
2802
|
-
MessageSendingStatus:
|
|
2799
|
+
MessageSendingStatus: Wr
|
|
2803
2800
|
}
|
|
2804
|
-
),
|
|
2801
|
+
), Kr = /^([a-z][a-z0-9+.-]*):/i, Zr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2805
2802
|
function kt(e) {
|
|
2806
2803
|
if (typeof e != "string") return;
|
|
2807
2804
|
const t = e.trim();
|
|
2808
2805
|
if (t === "") return;
|
|
2809
|
-
const n =
|
|
2806
|
+
const n = Kr.exec(t);
|
|
2810
2807
|
if (n) {
|
|
2811
2808
|
const a = n[1].toLowerCase();
|
|
2812
|
-
return
|
|
2809
|
+
return Zr.has(a) ? t : void 0;
|
|
2813
2810
|
}
|
|
2814
2811
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2815
2812
|
}
|
|
2816
|
-
const
|
|
2813
|
+
const Jr = {
|
|
2817
2814
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2818
2815
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2819
|
-
},
|
|
2820
|
-
const n =
|
|
2816
|
+
}, Qr = ({ variant: e, cta: t }) => {
|
|
2817
|
+
const n = k(
|
|
2821
2818
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2822
|
-
|
|
2819
|
+
Jr[e]
|
|
2823
2820
|
), a = kt(t.href);
|
|
2824
2821
|
return a ? /* @__PURE__ */ s(
|
|
2825
2822
|
"a",
|
|
@@ -2846,10 +2843,10 @@ const Qr = {
|
|
|
2846
2843
|
children: t.label
|
|
2847
2844
|
}
|
|
2848
2845
|
);
|
|
2849
|
-
},
|
|
2846
|
+
}, ei = {
|
|
2850
2847
|
dark: "text-white",
|
|
2851
2848
|
light: "text-black/90"
|
|
2852
|
-
},
|
|
2849
|
+
}, ti = "text-white/30", si = {
|
|
2853
2850
|
dark: "text-white/55",
|
|
2854
2851
|
light: "text-black/55"
|
|
2855
2852
|
}, Ct = ({
|
|
@@ -2864,12 +2861,12 @@ const Qr = {
|
|
|
2864
2861
|
}) => {
|
|
2865
2862
|
const d = e === "dark", m = t ?? (d ? n : void 0) ?? "", f = m.trim() !== "", h = a != null && a.trim() !== "", g = typeof r == "string" ? r.trim() : "", c = g !== "", b = o != null;
|
|
2866
2863
|
if (!f && !h && !c && !b) return null;
|
|
2867
|
-
const x =
|
|
2864
|
+
const x = k(
|
|
2868
2865
|
"truncate text-base font-medium leading-6",
|
|
2869
|
-
d && !t ?
|
|
2870
|
-
), p =
|
|
2866
|
+
d && !t ? ti : ei[e]
|
|
2867
|
+
), p = k(
|
|
2871
2868
|
"truncate text-xs leading-4",
|
|
2872
|
-
|
|
2869
|
+
si[e]
|
|
2873
2870
|
);
|
|
2874
2871
|
return /* @__PURE__ */ u("div", { className: "px-4 py-3", children: [
|
|
2875
2872
|
/* @__PURE__ */ u("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2877,7 +2874,7 @@ const Qr = {
|
|
|
2877
2874
|
/* @__PURE__ */ u("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2878
2875
|
f && /* @__PURE__ */ u("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2879
2876
|
i ? /* @__PURE__ */ s("span", { className: "shrink-0", children: i }) : null,
|
|
2880
|
-
/* @__PURE__ */ s("p", { className:
|
|
2877
|
+
/* @__PURE__ */ s("p", { className: k("min-w-0", x), children: m })
|
|
2881
2878
|
] }),
|
|
2882
2879
|
h && /* @__PURE__ */ s("p", { className: p, children: a })
|
|
2883
2880
|
] }),
|
|
@@ -2885,9 +2882,9 @@ const Qr = {
|
|
|
2885
2882
|
] }),
|
|
2886
2883
|
l && /* @__PURE__ */ s("div", { className: "shrink-0", children: l })
|
|
2887
2884
|
] }),
|
|
2888
|
-
o && /* @__PURE__ */ s(
|
|
2885
|
+
o && /* @__PURE__ */ s(Qr, { variant: e, cta: o })
|
|
2889
2886
|
] });
|
|
2890
|
-
},
|
|
2887
|
+
}, ni = k(
|
|
2891
2888
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2892
2889
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2893
2890
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2905,8 +2902,8 @@ const Qr = {
|
|
|
2905
2902
|
bgClassName: l,
|
|
2906
2903
|
"data-testid": d
|
|
2907
2904
|
}) => {
|
|
2908
|
-
const m = n != null || a != null, f =
|
|
2909
|
-
|
|
2905
|
+
const m = n != null || a != null, f = k(
|
|
2906
|
+
ni,
|
|
2910
2907
|
l ?? (e === "dark" ? "bg-[#1e2330]" : "bg-white"),
|
|
2911
2908
|
// `focus-ring` is a design-system utility from the component-library
|
|
2912
2909
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2936,7 +2933,7 @@ const Qr = {
|
|
|
2936
2933
|
onClick: a,
|
|
2937
2934
|
"aria-label": r,
|
|
2938
2935
|
"data-testid": d,
|
|
2939
|
-
className:
|
|
2936
|
+
className: k(f, "text-left"),
|
|
2940
2937
|
children: [
|
|
2941
2938
|
t,
|
|
2942
2939
|
h
|
|
@@ -2954,10 +2951,10 @@ const Qr = {
|
|
|
2954
2951
|
]
|
|
2955
2952
|
}
|
|
2956
2953
|
);
|
|
2957
|
-
},
|
|
2954
|
+
}, ai = {
|
|
2958
2955
|
dark: "bg-white/10",
|
|
2959
2956
|
light: "bg-black/5"
|
|
2960
|
-
},
|
|
2957
|
+
}, ri = {
|
|
2961
2958
|
dark: "size-16 text-white/25",
|
|
2962
2959
|
light: "size-16 text-black/25"
|
|
2963
2960
|
}, Ye = (e, t) => !!t && !!e && ce(e) === "audio", St = (e, t) => {
|
|
@@ -2986,7 +2983,7 @@ const Qr = {
|
|
|
2986
2983
|
) }) : /* @__PURE__ */ u(
|
|
2987
2984
|
"div",
|
|
2988
2985
|
{
|
|
2989
|
-
className:
|
|
2986
|
+
className: k(
|
|
2990
2987
|
"relative h-[180px] w-full overflow-hidden",
|
|
2991
2988
|
d && "bg-black"
|
|
2992
2989
|
),
|
|
@@ -3013,12 +3010,12 @@ const Qr = {
|
|
|
3013
3010
|
) : /* @__PURE__ */ s(
|
|
3014
3011
|
"div",
|
|
3015
3012
|
{
|
|
3016
|
-
className:
|
|
3013
|
+
className: k(
|
|
3017
3014
|
"flex h-full w-full items-center justify-center",
|
|
3018
|
-
|
|
3015
|
+
ai[e]
|
|
3019
3016
|
),
|
|
3020
3017
|
children: _e(r, {
|
|
3021
|
-
className:
|
|
3018
|
+
className: ri[e],
|
|
3022
3019
|
weight: "regular"
|
|
3023
3020
|
})
|
|
3024
3021
|
}
|
|
@@ -3028,7 +3025,7 @@ const Qr = {
|
|
|
3028
3025
|
]
|
|
3029
3026
|
}
|
|
3030
3027
|
);
|
|
3031
|
-
},
|
|
3028
|
+
}, ii = ({
|
|
3032
3029
|
title: e,
|
|
3033
3030
|
placeholderTitle: t,
|
|
3034
3031
|
description: n,
|
|
@@ -3105,7 +3102,7 @@ const Qr = {
|
|
|
3105
3102
|
]
|
|
3106
3103
|
}
|
|
3107
3104
|
);
|
|
3108
|
-
},
|
|
3105
|
+
}, li = ({
|
|
3109
3106
|
title: e,
|
|
3110
3107
|
description: t,
|
|
3111
3108
|
url: n,
|
|
@@ -3158,7 +3155,7 @@ const Qr = {
|
|
|
3158
3155
|
]
|
|
3159
3156
|
}
|
|
3160
3157
|
);
|
|
3161
|
-
},
|
|
3158
|
+
}, oi = ({
|
|
3162
3159
|
title: e,
|
|
3163
3160
|
placeholderTitle: t,
|
|
3164
3161
|
description: n,
|
|
@@ -3206,9 +3203,9 @@ const Qr = {
|
|
|
3206
3203
|
}
|
|
3207
3204
|
);
|
|
3208
3205
|
}, Jt = {
|
|
3209
|
-
Composer:
|
|
3210
|
-
Sent:
|
|
3211
|
-
Received:
|
|
3206
|
+
Composer: ii,
|
|
3207
|
+
Sent: oi,
|
|
3208
|
+
Received: li
|
|
3212
3209
|
};
|
|
3213
3210
|
function z(e) {
|
|
3214
3211
|
const t = e == null ? void 0 : e.trim();
|
|
@@ -3217,7 +3214,7 @@ function z(e) {
|
|
|
3217
3214
|
function Qt(e) {
|
|
3218
3215
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3219
3216
|
}
|
|
3220
|
-
function
|
|
3217
|
+
function ci(e, t) {
|
|
3221
3218
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3222
3219
|
return !1;
|
|
3223
3220
|
const n = Qt(e), a = Qt(t);
|
|
@@ -3242,7 +3239,7 @@ function es(e) {
|
|
|
3242
3239
|
mimeType: r
|
|
3243
3240
|
};
|
|
3244
3241
|
}
|
|
3245
|
-
function
|
|
3242
|
+
function di(e) {
|
|
3246
3243
|
var t;
|
|
3247
3244
|
return Ls(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;
|
|
3248
3245
|
}
|
|
@@ -3272,21 +3269,21 @@ function Ds(e) {
|
|
|
3272
3269
|
a(r);
|
|
3273
3270
|
continue;
|
|
3274
3271
|
}
|
|
3275
|
-
const i =
|
|
3272
|
+
const i = di(r);
|
|
3276
3273
|
i && n(i, r);
|
|
3277
3274
|
}
|
|
3278
3275
|
return t;
|
|
3279
3276
|
}
|
|
3280
|
-
function
|
|
3277
|
+
function ui(e) {
|
|
3281
3278
|
return e.filter((t) => t.type === "media").length;
|
|
3282
3279
|
}
|
|
3283
|
-
function
|
|
3280
|
+
function mi(e, t, n) {
|
|
3284
3281
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3285
3282
|
}
|
|
3286
3283
|
function ts(e) {
|
|
3287
3284
|
return z(e.image_url) ?? z(e.asset_url) ?? "";
|
|
3288
3285
|
}
|
|
3289
|
-
function
|
|
3286
|
+
function hi(e) {
|
|
3290
3287
|
switch (e) {
|
|
3291
3288
|
case "image":
|
|
3292
3289
|
return ke.Image;
|
|
@@ -3300,7 +3297,7 @@ function fi(e) {
|
|
|
3300
3297
|
return ke.File;
|
|
3301
3298
|
}
|
|
3302
3299
|
}
|
|
3303
|
-
function
|
|
3300
|
+
function fi(e, t) {
|
|
3304
3301
|
if (t.length > 1)
|
|
3305
3302
|
switch (e) {
|
|
3306
3303
|
case "image":
|
|
@@ -3387,18 +3384,18 @@ function gi(e, t) {
|
|
|
3387
3384
|
};
|
|
3388
3385
|
}
|
|
3389
3386
|
}
|
|
3390
|
-
function
|
|
3387
|
+
function gi({
|
|
3391
3388
|
groupPosition: e,
|
|
3392
3389
|
isMyMessage: t,
|
|
3393
3390
|
segment: n
|
|
3394
3391
|
}) {
|
|
3395
|
-
const a =
|
|
3396
|
-
...
|
|
3392
|
+
const a = hi(n.kind), r = {
|
|
3393
|
+
...fi(n.kind, n.attachments),
|
|
3397
3394
|
groupPosition: e
|
|
3398
3395
|
};
|
|
3399
3396
|
return t ? /* @__PURE__ */ s(a.Sent, { ...r }) : /* @__PURE__ */ s(a.Received, { ...r });
|
|
3400
3397
|
}
|
|
3401
|
-
const
|
|
3398
|
+
const pi = ({
|
|
3402
3399
|
groupPosition: e,
|
|
3403
3400
|
isMyMessage: t,
|
|
3404
3401
|
message: n,
|
|
@@ -3407,7 +3404,7 @@ const bi = ({
|
|
|
3407
3404
|
var b;
|
|
3408
3405
|
const r = Ds(n.attachments);
|
|
3409
3406
|
if (r.length === 0) return null;
|
|
3410
|
-
const i =
|
|
3407
|
+
const i = ui(r), o = (b = n.text) == null ? void 0 : b.trim(), l = r.find((v) => v.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? es(l.attachments[0] ?? {}).url : void 0, m = o && ci(o, d) ? void 0 : o;
|
|
3411
3408
|
let f = 0;
|
|
3412
3409
|
const h = [], g = (v, x) => {
|
|
3413
3410
|
const p = t ? Jt.Sent : Jt.Received;
|
|
@@ -3415,14 +3412,14 @@ const bi = ({
|
|
|
3415
3412
|
/* @__PURE__ */ s(p, { ...es(v) }, x)
|
|
3416
3413
|
);
|
|
3417
3414
|
}, c = (v, x) => {
|
|
3418
|
-
const p =
|
|
3415
|
+
const p = mi(
|
|
3419
3416
|
f,
|
|
3420
3417
|
i,
|
|
3421
3418
|
e
|
|
3422
3419
|
);
|
|
3423
3420
|
f += 1, h.push(
|
|
3424
3421
|
/* @__PURE__ */ s(
|
|
3425
|
-
|
|
3422
|
+
gi,
|
|
3426
3423
|
{
|
|
3427
3424
|
groupPosition: p,
|
|
3428
3425
|
isMyMessage: t,
|
|
@@ -3469,7 +3466,7 @@ const bi = ({
|
|
|
3469
3466
|
/* @__PURE__ */ s(nt, {})
|
|
3470
3467
|
] }) : null
|
|
3471
3468
|
] });
|
|
3472
|
-
},
|
|
3469
|
+
}, bi = (e) => {
|
|
3473
3470
|
var Dt, zt, Ft, Pt, Ot, $t, Ut, Bt, jt, Vt;
|
|
3474
3471
|
const {
|
|
3475
3472
|
additionalMessageInputProps: t,
|
|
@@ -3488,8 +3485,8 @@ const bi = ({
|
|
|
3488
3485
|
renderText: b,
|
|
3489
3486
|
threadList: v,
|
|
3490
3487
|
viewerLanguage: x
|
|
3491
|
-
} = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick:
|
|
3492
|
-
Attachment:
|
|
3488
|
+
} = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: C, onFetchSource: D, onDownloadClick: E } = Pr("LockedAttachment"), [R, O] = B(!1), F = Zs(c.id), { selected: L, voteUp: S, voteDown: I } = va(c), {
|
|
3489
|
+
Attachment: y = Js,
|
|
3493
3490
|
EditMessageModal: T = Qs,
|
|
3494
3491
|
MessageActions: M,
|
|
3495
3492
|
MessageBlocked: P = en,
|
|
@@ -3517,7 +3514,7 @@ const bi = ({
|
|
|
3517
3514
|
}, [c, x]), de = W.length > 0, De = W.reduce(
|
|
3518
3515
|
(me, be) => me + be.attachments.length,
|
|
3519
3516
|
0
|
|
3520
|
-
) === ((U == null ? void 0 : U.length) ?? 0), ze =
|
|
3517
|
+
) === ((U == null ? void 0 : U.length) ?? 0), ze = Ha({
|
|
3521
3518
|
endOfGroup: r,
|
|
3522
3519
|
firstOfGroup: i,
|
|
3523
3520
|
groupedByUser: o
|
|
@@ -3531,7 +3528,7 @@ const bi = ({
|
|
|
3531
3528
|
const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = mn(c);
|
|
3532
3529
|
let ge;
|
|
3533
3530
|
le ? ge = () => m(c) : Tt && (ge = () => O(!0));
|
|
3534
|
-
const te = g(), Us =
|
|
3531
|
+
const te = g(), Us = k(
|
|
3535
3532
|
"str-chat__message str-chat__message-simple",
|
|
3536
3533
|
`str-chat__message--${c.type}`,
|
|
3537
3534
|
`str-chat__message--${c.status}`,
|
|
@@ -3548,7 +3545,7 @@ const bi = ({
|
|
|
3548
3545
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3549
3546
|
"str-chat__virtual-message__wrapper--group": o
|
|
3550
3547
|
}
|
|
3551
|
-
), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt =
|
|
3548
|
+
), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = Yr(c), pe = Ue(c), Bs = yt(c), We = !!(U != null && U.length && !c.quoted_message), At = pe && te && We, js = de && De && !c.quoted_message && !qe && !Y && !pe, Rt = {
|
|
3552
3549
|
contentType: "text",
|
|
3553
3550
|
amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
|
|
3554
3551
|
paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
|
|
@@ -3602,7 +3599,7 @@ const bi = ({
|
|
|
3602
3599
|
/* @__PURE__ */ s(
|
|
3603
3600
|
"div",
|
|
3604
3601
|
{
|
|
3605
|
-
className:
|
|
3602
|
+
className: k("str-chat__message-inner", {
|
|
3606
3603
|
"str-chat__simple-message--error-failed": le || Tt
|
|
3607
3604
|
}),
|
|
3608
3605
|
"data-testid": "message-inner",
|
|
@@ -3616,7 +3613,7 @@ const bi = ({
|
|
|
3616
3613
|
marginInlineEnd: 0,
|
|
3617
3614
|
marginInlineStart: 0
|
|
3618
3615
|
},
|
|
3619
|
-
children: Mt ? /* @__PURE__ */ s(Qe, { message: c, standalone: !0 }) :
|
|
3616
|
+
children: Mt ? /* @__PURE__ */ s(Qe, { message: c, standalone: !0 }) : Gr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3620
3617
|
te && M && /* @__PURE__ */ s(M, {}),
|
|
3621
3618
|
te ? /* @__PURE__ */ s(
|
|
3622
3619
|
Pe,
|
|
@@ -3630,11 +3627,11 @@ const bi = ({
|
|
|
3630
3627
|
...Rt,
|
|
3631
3628
|
isMine: !1,
|
|
3632
3629
|
isUnlocking: w(c.id),
|
|
3633
|
-
onUnlockClick: () =>
|
|
3630
|
+
onUnlockClick: () => C == null ? void 0 : C(c, _)
|
|
3634
3631
|
}
|
|
3635
3632
|
),
|
|
3636
3633
|
!te && M && /* @__PURE__ */ s(M, {})
|
|
3637
|
-
] }) }) :
|
|
3634
|
+
] }) }) : Hr(c) ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3638
3635
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3639
3636
|
te && M && /* @__PURE__ */ s(M, {}),
|
|
3640
3637
|
te ? /* @__PURE__ */ s(
|
|
@@ -3642,7 +3639,7 @@ const bi = ({
|
|
|
3642
3639
|
{
|
|
3643
3640
|
...Lt,
|
|
3644
3641
|
isMine: !0,
|
|
3645
|
-
onPreviewClick: () =>
|
|
3642
|
+
onPreviewClick: () => C ? C(c, _) : void 0
|
|
3646
3643
|
}
|
|
3647
3644
|
) : /* @__PURE__ */ s(
|
|
3648
3645
|
Pe,
|
|
@@ -3650,8 +3647,8 @@ const bi = ({
|
|
|
3650
3647
|
...Lt,
|
|
3651
3648
|
isMine: !1,
|
|
3652
3649
|
isUnlocking: w(c.id),
|
|
3653
|
-
onUnlockClick: () =>
|
|
3654
|
-
onDownloadClick: () =>
|
|
3650
|
+
onUnlockClick: () => C ? C(c, _) : void 0,
|
|
3651
|
+
onDownloadClick: () => E ? E(c, _) : void 0
|
|
3655
3652
|
}
|
|
3656
3653
|
),
|
|
3657
3654
|
!te && M && /* @__PURE__ */ s(M, {})
|
|
@@ -3664,7 +3661,7 @@ const bi = ({
|
|
|
3664
3661
|
}
|
|
3665
3662
|
) })
|
|
3666
3663
|
] }) : js ? /* @__PURE__ */ s(
|
|
3667
|
-
|
|
3664
|
+
pi,
|
|
3668
3665
|
{
|
|
3669
3666
|
groupPosition: ze,
|
|
3670
3667
|
isMyMessage: te,
|
|
@@ -3689,7 +3686,7 @@ const bi = ({
|
|
|
3689
3686
|
),
|
|
3690
3687
|
qe && /* @__PURE__ */ s(fn, { poll: qe }),
|
|
3691
3688
|
U != null && U.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3692
|
-
|
|
3689
|
+
y,
|
|
3693
3690
|
{
|
|
3694
3691
|
actionHandler: l,
|
|
3695
3692
|
attachments: U
|
|
@@ -3722,15 +3719,15 @@ const bi = ({
|
|
|
3722
3719
|
}
|
|
3723
3720
|
),
|
|
3724
3721
|
n && pe && /* @__PURE__ */ s(
|
|
3725
|
-
|
|
3722
|
+
qr,
|
|
3726
3723
|
{
|
|
3727
3724
|
selected: L,
|
|
3728
|
-
onVoteUp:
|
|
3729
|
-
onVoteDown:
|
|
3725
|
+
onVoteUp: S,
|
|
3726
|
+
onVoteDown: I
|
|
3730
3727
|
}
|
|
3731
3728
|
)
|
|
3732
3729
|
] }),
|
|
3733
|
-
/* @__PURE__ */ s(
|
|
3730
|
+
/* @__PURE__ */ s(Xr, {}),
|
|
3734
3731
|
ae && /* @__PURE__ */ s(
|
|
3735
3732
|
ee,
|
|
3736
3733
|
{
|
|
@@ -3744,13 +3741,13 @@ const bi = ({
|
|
|
3744
3741
|
c.id
|
|
3745
3742
|
)
|
|
3746
3743
|
] });
|
|
3747
|
-
},
|
|
3748
|
-
|
|
3744
|
+
}, vi = V.memo(
|
|
3745
|
+
bi,
|
|
3749
3746
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ks(e, t)
|
|
3750
|
-
),
|
|
3747
|
+
), xi = (e) => {
|
|
3751
3748
|
const t = Ne("CustomMessage");
|
|
3752
|
-
return /* @__PURE__ */ s(
|
|
3753
|
-
},
|
|
3749
|
+
return /* @__PURE__ */ s(vi, { ...t, ...e });
|
|
3750
|
+
}, wi = () => {
|
|
3754
3751
|
var n;
|
|
3755
3752
|
const { handleDelete: e, message: t } = Ne("CustomMessageActions");
|
|
3756
3753
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
@@ -3763,7 +3760,7 @@ const bi = ({
|
|
|
3763
3760
|
children: /* @__PURE__ */ s(Jn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3764
3761
|
}
|
|
3765
3762
|
);
|
|
3766
|
-
},
|
|
3763
|
+
}, _i = () => {
|
|
3767
3764
|
const { handleFlag: e } = Ne("CustomMessageActions");
|
|
3768
3765
|
return /* @__PURE__ */ s(
|
|
3769
3766
|
cs,
|
|
@@ -3775,19 +3772,19 @@ const bi = ({
|
|
|
3775
3772
|
children: /* @__PURE__ */ s(is, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3776
3773
|
}
|
|
3777
3774
|
);
|
|
3778
|
-
},
|
|
3775
|
+
}, Ni = () => {
|
|
3779
3776
|
var t;
|
|
3780
3777
|
const { message: e } = Ne("CustomMessageActions");
|
|
3781
3778
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3782
3779
|
ta,
|
|
3783
3780
|
{
|
|
3784
3781
|
messageActionSet: [
|
|
3785
|
-
{ Component:
|
|
3786
|
-
{ Component:
|
|
3782
|
+
{ Component: wi, placement: "quick", type: "delete" },
|
|
3783
|
+
{ Component: _i, placement: "quick", type: "flag" }
|
|
3787
3784
|
]
|
|
3788
3785
|
}
|
|
3789
3786
|
);
|
|
3790
|
-
},
|
|
3787
|
+
}, yi = ({
|
|
3791
3788
|
link: e,
|
|
3792
3789
|
onDismiss: t
|
|
3793
3790
|
}) => {
|
|
@@ -3827,14 +3824,14 @@ const bi = ({
|
|
|
3827
3824
|
]
|
|
3828
3825
|
}
|
|
3829
3826
|
);
|
|
3830
|
-
},
|
|
3827
|
+
}, ki = (e) => ({
|
|
3831
3828
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3832
3829
|
(t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
|
|
3833
3830
|
)
|
|
3834
|
-
}),
|
|
3831
|
+
}), Ci = () => {
|
|
3835
3832
|
const { linkPreviewsManager: e } = gn(), { linkPreviews: t } = pn(
|
|
3836
3833
|
e.state,
|
|
3837
|
-
|
|
3834
|
+
ki
|
|
3838
3835
|
), n = (r) => {
|
|
3839
3836
|
e.dismissPreview(r);
|
|
3840
3837
|
};
|
|
@@ -3847,9 +3844,9 @@ const bi = ({
|
|
|
3847
3844
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3848
3845
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3849
3846
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3850
|
-
/* @__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(
|
|
3847
|
+
/* @__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(yi, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3851
3848
|
) : null;
|
|
3852
|
-
}, It = V.createContext(!1),
|
|
3849
|
+
}, It = V.createContext(!1), gl = () => Te(It), Si = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3853
3850
|
"button",
|
|
3854
3851
|
{
|
|
3855
3852
|
...n,
|
|
@@ -3859,9 +3856,9 @@ const bi = ({
|
|
|
3859
3856
|
onClick: e,
|
|
3860
3857
|
children: /* @__PURE__ */ s(Qn, { weight: "bold", className: "size-4" })
|
|
3861
3858
|
}
|
|
3862
|
-
),
|
|
3859
|
+
), Ei = () => {
|
|
3863
3860
|
const e = Te(It), { handleSubmit: t } = vn(), n = xn(), a = e || !n, {
|
|
3864
|
-
SendButton: r =
|
|
3861
|
+
SendButton: r = Si,
|
|
3865
3862
|
AttachmentPreviewList: i = wn
|
|
3866
3863
|
} = rs("CustomMessageInput");
|
|
3867
3864
|
return (
|
|
@@ -3880,7 +3877,7 @@ const bi = ({
|
|
|
3880
3877
|
"data-dd-privacy": "mask",
|
|
3881
3878
|
children: [
|
|
3882
3879
|
/* @__PURE__ */ s(_n, {}),
|
|
3883
|
-
/* @__PURE__ */ s(
|
|
3880
|
+
/* @__PURE__ */ s(Ci, {}),
|
|
3884
3881
|
/* @__PURE__ */ s(i, {}),
|
|
3885
3882
|
/* @__PURE__ */ u("div", { className: "flex shrink-0", children: [
|
|
3886
3883
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
@@ -3911,7 +3908,7 @@ const bi = ({
|
|
|
3911
3908
|
}
|
|
3912
3909
|
)
|
|
3913
3910
|
);
|
|
3914
|
-
},
|
|
3911
|
+
}, Ii = ({
|
|
3915
3912
|
renderActions: e,
|
|
3916
3913
|
renderFooter: t,
|
|
3917
3914
|
disabled: n = !1,
|
|
@@ -3932,23 +3929,23 @@ const bi = ({
|
|
|
3932
3929
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3933
3930
|
children: [
|
|
3934
3931
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3935
|
-
/* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(bn, { Input: r ??
|
|
3932
|
+
/* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(bn, { Input: r ?? Ei }) })
|
|
3936
3933
|
]
|
|
3937
3934
|
}
|
|
3938
3935
|
),
|
|
3939
3936
|
t == null ? void 0 : t()
|
|
3940
3937
|
] });
|
|
3941
|
-
},
|
|
3938
|
+
}, Ti = [
|
|
3942
3939
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3943
3940
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3944
|
-
],
|
|
3941
|
+
], Mi = {
|
|
3945
3942
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3946
3943
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3947
|
-
},
|
|
3944
|
+
}, Ai = [
|
|
3948
3945
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3949
|
-
],
|
|
3946
|
+
], Ri = {
|
|
3950
3947
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3951
|
-
}, tt = "age safety guidelines.",
|
|
3948
|
+
}, tt = "age safety guidelines.", Li = "https://linktr.ee/s/about/contact", ss = (e) => Ti.includes(e), Di = (e) => Ai.includes(e), zi = (e) => {
|
|
3952
3949
|
var a;
|
|
3953
3950
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3954
3951
|
if (ss(t))
|
|
@@ -3956,7 +3953,7 @@ const bi = ({
|
|
|
3956
3953
|
kind: "dm-agent",
|
|
3957
3954
|
type: t
|
|
3958
3955
|
};
|
|
3959
|
-
if (
|
|
3956
|
+
if (Di(t))
|
|
3960
3957
|
return {
|
|
3961
3958
|
kind: "age-safety",
|
|
3962
3959
|
type: t
|
|
@@ -3967,7 +3964,7 @@ const bi = ({
|
|
|
3967
3964
|
kind: "dm-agent",
|
|
3968
3965
|
type: n
|
|
3969
3966
|
};
|
|
3970
|
-
},
|
|
3967
|
+
}, Fi = (e) => {
|
|
3971
3968
|
const t = e.indexOf(tt);
|
|
3972
3969
|
if (t === -1)
|
|
3973
3970
|
return e;
|
|
@@ -3977,7 +3974,7 @@ const bi = ({
|
|
|
3977
3974
|
/* @__PURE__ */ s(
|
|
3978
3975
|
"a",
|
|
3979
3976
|
{
|
|
3980
|
-
href:
|
|
3977
|
+
href: Li,
|
|
3981
3978
|
target: "_blank",
|
|
3982
3979
|
rel: "noopener noreferrer",
|
|
3983
3980
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -3986,13 +3983,13 @@ const bi = ({
|
|
|
3986
3983
|
),
|
|
3987
3984
|
e.slice(n)
|
|
3988
3985
|
] });
|
|
3989
|
-
},
|
|
3986
|
+
}, Pi = (e) => {
|
|
3990
3987
|
var a, r;
|
|
3991
|
-
const t = e.message.hide_date === !0, n =
|
|
3988
|
+
const t = e.message.hide_date === !0, n = zi(
|
|
3992
3989
|
e.message
|
|
3993
3990
|
);
|
|
3994
3991
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
3995
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3992
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Mi[n.type];
|
|
3996
3993
|
return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3997
3994
|
/* @__PURE__ */ u(
|
|
3998
3995
|
"div",
|
|
@@ -4018,7 +4015,7 @@ const bi = ({
|
|
|
4018
4015
|
] });
|
|
4019
4016
|
}
|
|
4020
4017
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
4021
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
4018
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ri[n.type];
|
|
4022
4019
|
return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
4023
4020
|
/* @__PURE__ */ u(
|
|
4024
4021
|
"div",
|
|
@@ -4037,7 +4034,7 @@ const bi = ({
|
|
|
4037
4034
|
"data-testid": "age-safety-system-message-icon"
|
|
4038
4035
|
}
|
|
4039
4036
|
),
|
|
4040
|
-
/* @__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:
|
|
4037
|
+
/* @__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: Fi(i) }) })
|
|
4041
4038
|
]
|
|
4042
4039
|
}
|
|
4043
4040
|
),
|
|
@@ -4062,15 +4059,15 @@ const bi = ({
|
|
|
4062
4059
|
begin: `${120 * t}ms`,
|
|
4063
4060
|
repeatCount: "indefinite"
|
|
4064
4061
|
}
|
|
4065
|
-
) }),
|
|
4062
|
+
) }), Oi = /* @__PURE__ */ new Set([
|
|
4066
4063
|
Ke.Thinking,
|
|
4067
4064
|
Ke.Generating,
|
|
4068
4065
|
Ke.ExternalSources
|
|
4069
|
-
]),
|
|
4066
|
+
]), $i = ({ threadList: e }) => {
|
|
4070
4067
|
var b, v;
|
|
4071
4068
|
const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = yn(), { aiState: o } = kn(t), l = Te(zs);
|
|
4072
|
-
if (!e && l &&
|
|
4073
|
-
const x =
|
|
4069
|
+
if (!e && l && Oi.has(o)) {
|
|
4070
|
+
const x = Ui(t, (b = r.user) == null ? void 0 : b.id);
|
|
4074
4071
|
return /* @__PURE__ */ s(
|
|
4075
4072
|
ns,
|
|
4076
4073
|
{
|
|
@@ -4150,7 +4147,7 @@ const bi = ({
|
|
|
4150
4147
|
] })
|
|
4151
4148
|
}
|
|
4152
4149
|
);
|
|
4153
|
-
function
|
|
4150
|
+
function Ui(e, t) {
|
|
4154
4151
|
var a;
|
|
4155
4152
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4156
4153
|
for (const r of Object.values(n)) {
|
|
@@ -4159,10 +4156,10 @@ function Bi(e, t) {
|
|
|
4159
4156
|
return i;
|
|
4160
4157
|
}
|
|
4161
4158
|
}
|
|
4162
|
-
const
|
|
4159
|
+
const Bi = () => null, ji = ({ className: e, message: t }) => /* @__PURE__ */ u(
|
|
4163
4160
|
"div",
|
|
4164
4161
|
{
|
|
4165
|
-
className:
|
|
4162
|
+
className: k("flex items-center justify-center h-full", e),
|
|
4166
4163
|
children: [
|
|
4167
4164
|
/* @__PURE__ */ u("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
4168
4165
|
/* @__PURE__ */ s("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ s(
|
|
@@ -4203,11 +4200,11 @@ const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ u(
|
|
|
4203
4200
|
]
|
|
4204
4201
|
}
|
|
4205
4202
|
), Ve = V.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ u("div", { className: "flex items-center", children: [
|
|
4206
|
-
/* @__PURE__ */ s(
|
|
4203
|
+
/* @__PURE__ */ s(ji, { className: "w-6 h-6" }),
|
|
4207
4204
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4208
4205
|
] }) }));
|
|
4209
4206
|
Ve.displayName = "LoadingState";
|
|
4210
|
-
const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Oe = "Replies instantly with AI assistant",
|
|
4207
|
+
const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Oe = "Replies instantly with AI assistant", Vi = ({
|
|
4211
4208
|
onBack: e,
|
|
4212
4209
|
showBackButton: t,
|
|
4213
4210
|
showStarButton: n = !1,
|
|
@@ -4226,7 +4223,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4226
4223
|
onParticipantNameClick: v,
|
|
4227
4224
|
renderHeaderTitleBadges: x
|
|
4228
4225
|
}) => {
|
|
4229
|
-
var
|
|
4226
|
+
var I, y, T, M, P, $;
|
|
4230
4227
|
const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
|
|
4231
4228
|
() => {
|
|
4232
4229
|
var j;
|
|
@@ -4236,16 +4233,16 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4236
4233
|
p.type
|
|
4237
4234
|
);
|
|
4238
4235
|
},
|
|
4239
|
-
[(
|
|
4240
|
-
),
|
|
4236
|
+
[(I = p.state) == null ? void 0 : I.members, _ == null ? void 0 : _.userID, p.type]
|
|
4237
|
+
), C = mt(w == null ? void 0 : w.user), D = (y = w == null ? void 0 : w.user) == null ? void 0 : y.image, E = ut(p), R = x == null ? void 0 : x({
|
|
4241
4238
|
channel: p,
|
|
4242
4239
|
participant: w
|
|
4243
4240
|
}), O = "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", F = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", L = /* @__PURE__ */ u(se, { children: [
|
|
4244
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children:
|
|
4241
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: C }),
|
|
4245
4242
|
R && /* @__PURE__ */ s("span", { className: "shrink-0", children: R })
|
|
4246
|
-
] }),
|
|
4243
|
+
] }), S = async () => {
|
|
4247
4244
|
try {
|
|
4248
|
-
|
|
4245
|
+
E ? await p.unpin() : await p.pin();
|
|
4249
4246
|
} catch (j) {
|
|
4250
4247
|
console.error(
|
|
4251
4248
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -4258,7 +4255,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4258
4255
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ s(
|
|
4259
4256
|
"button",
|
|
4260
4257
|
{
|
|
4261
|
-
className:
|
|
4258
|
+
className: k(
|
|
4262
4259
|
ve,
|
|
4263
4260
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
4264
4261
|
),
|
|
@@ -4279,8 +4276,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4279
4276
|
{
|
|
4280
4277
|
type: "button",
|
|
4281
4278
|
onClick: v,
|
|
4282
|
-
"aria-label": `View details for ${
|
|
4283
|
-
className:
|
|
4279
|
+
"aria-label": `View details for ${C}`,
|
|
4280
|
+
className: k(
|
|
4284
4281
|
O,
|
|
4285
4282
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4286
4283
|
),
|
|
@@ -4289,9 +4286,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4289
4286
|
ne,
|
|
4290
4287
|
{
|
|
4291
4288
|
id: ((T = w == null ? void 0 : w.user) == null ? void 0 : T.id) || p.id || "unknown",
|
|
4292
|
-
name:
|
|
4289
|
+
name: C,
|
|
4293
4290
|
image: D,
|
|
4294
|
-
starred: n &&
|
|
4291
|
+
starred: n && E,
|
|
4295
4292
|
dmAgentEnabled: a,
|
|
4296
4293
|
size: 48
|
|
4297
4294
|
}
|
|
@@ -4311,9 +4308,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4311
4308
|
ne,
|
|
4312
4309
|
{
|
|
4313
4310
|
id: ((M = w == null ? void 0 : w.user) == null ? void 0 : M.id) || p.id || "unknown",
|
|
4314
|
-
name:
|
|
4311
|
+
name: C,
|
|
4315
4312
|
image: D,
|
|
4316
|
-
starred: n &&
|
|
4313
|
+
starred: n && E,
|
|
4317
4314
|
dmAgentEnabled: a,
|
|
4318
4315
|
size: 48
|
|
4319
4316
|
}
|
|
@@ -4340,17 +4337,17 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4340
4337
|
"button",
|
|
4341
4338
|
{
|
|
4342
4339
|
className: ve,
|
|
4343
|
-
onClick:
|
|
4340
|
+
onClick: S,
|
|
4344
4341
|
type: "button",
|
|
4345
|
-
"aria-label":
|
|
4342
|
+
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
4346
4343
|
children: /* @__PURE__ */ s(
|
|
4347
4344
|
Ie,
|
|
4348
4345
|
{
|
|
4349
|
-
className:
|
|
4350
|
-
"text-yellow-600":
|
|
4351
|
-
"text-black/90": !
|
|
4346
|
+
className: k("size-5", {
|
|
4347
|
+
"text-yellow-600": E,
|
|
4348
|
+
"text-black/90": !E
|
|
4352
4349
|
}),
|
|
4353
|
-
weight:
|
|
4350
|
+
weight: E ? "duotone" : "regular"
|
|
4354
4351
|
}
|
|
4355
4352
|
)
|
|
4356
4353
|
}
|
|
@@ -4369,7 +4366,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4369
4366
|
onBlockParticipantClick: f,
|
|
4370
4367
|
onReportParticipantClick: h,
|
|
4371
4368
|
customChannelActions: g,
|
|
4372
|
-
triggerClassName:
|
|
4369
|
+
triggerClassName: k(ve, "bg-[#F1F0EE]")
|
|
4373
4370
|
}
|
|
4374
4371
|
))
|
|
4375
4372
|
] })
|
|
@@ -4379,7 +4376,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4379
4376
|
t && e && /* @__PURE__ */ s(
|
|
4380
4377
|
"button",
|
|
4381
4378
|
{
|
|
4382
|
-
className:
|
|
4379
|
+
className: k(
|
|
4383
4380
|
ve,
|
|
4384
4381
|
"messaging-channel-view-back-button-desktop"
|
|
4385
4382
|
),
|
|
@@ -4394,8 +4391,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4394
4391
|
{
|
|
4395
4392
|
type: "button",
|
|
4396
4393
|
onClick: v,
|
|
4397
|
-
"aria-label": `View details for ${
|
|
4398
|
-
className:
|
|
4394
|
+
"aria-label": `View details for ${C}`,
|
|
4395
|
+
className: k(
|
|
4399
4396
|
F,
|
|
4400
4397
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4401
4398
|
),
|
|
@@ -4404,9 +4401,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4404
4401
|
ne,
|
|
4405
4402
|
{
|
|
4406
4403
|
id: ((P = w == null ? void 0 : w.user) == null ? void 0 : P.id) || p.id || "unknown",
|
|
4407
|
-
name:
|
|
4404
|
+
name: C,
|
|
4408
4405
|
image: D,
|
|
4409
|
-
starred: n &&
|
|
4406
|
+
starred: n && E,
|
|
4410
4407
|
dmAgentEnabled: a,
|
|
4411
4408
|
size: 48
|
|
4412
4409
|
}
|
|
@@ -4428,9 +4425,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4428
4425
|
ne,
|
|
4429
4426
|
{
|
|
4430
4427
|
id: (($ = w == null ? void 0 : w.user) == null ? void 0 : $.id) || p.id || "unknown",
|
|
4431
|
-
name:
|
|
4428
|
+
name: C,
|
|
4432
4429
|
image: D,
|
|
4433
|
-
starred: n &&
|
|
4430
|
+
starred: n && E,
|
|
4434
4431
|
dmAgentEnabled: a,
|
|
4435
4432
|
size: 48
|
|
4436
4433
|
}
|
|
@@ -4458,17 +4455,17 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4458
4455
|
"button",
|
|
4459
4456
|
{
|
|
4460
4457
|
className: ve,
|
|
4461
|
-
onClick:
|
|
4458
|
+
onClick: S,
|
|
4462
4459
|
type: "button",
|
|
4463
|
-
"aria-label":
|
|
4460
|
+
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
4464
4461
|
children: /* @__PURE__ */ s(
|
|
4465
4462
|
Ie,
|
|
4466
4463
|
{
|
|
4467
|
-
className:
|
|
4468
|
-
"text-yellow-600":
|
|
4469
|
-
"text-black/90": !
|
|
4464
|
+
className: k("size-6", {
|
|
4465
|
+
"text-yellow-600": E,
|
|
4466
|
+
"text-black/90": !E
|
|
4470
4467
|
}),
|
|
4471
|
-
weight:
|
|
4468
|
+
weight: E ? "duotone" : "regular"
|
|
4472
4469
|
}
|
|
4473
4470
|
)
|
|
4474
4471
|
}
|
|
@@ -4493,7 +4490,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4493
4490
|
] })
|
|
4494
4491
|
] })
|
|
4495
4492
|
] });
|
|
4496
|
-
},
|
|
4493
|
+
}, Gi = ({
|
|
4497
4494
|
onBack: e,
|
|
4498
4495
|
showBackButton: t,
|
|
4499
4496
|
renderMessageInputActions: n,
|
|
@@ -4514,36 +4511,36 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4514
4511
|
renderChannelBanner: p,
|
|
4515
4512
|
renderHeaderTitleBadges: _,
|
|
4516
4513
|
customChannelActions: w,
|
|
4517
|
-
renderChannelActions:
|
|
4514
|
+
renderChannelActions: C,
|
|
4518
4515
|
renderMessage: D,
|
|
4519
|
-
dmAgentEnabled:
|
|
4516
|
+
dmAgentEnabled: E = !1,
|
|
4520
4517
|
viewerLanguage: R,
|
|
4521
4518
|
showChannelInfo: O = !0,
|
|
4522
4519
|
onParticipantNameClick: F,
|
|
4523
4520
|
composerInput: L
|
|
4524
4521
|
}) => {
|
|
4525
4522
|
var N, A, H, q;
|
|
4526
|
-
const { channel:
|
|
4523
|
+
const { channel: S } = oe(), { client: I } = fe(), y = V.useMemo(
|
|
4527
4524
|
() => {
|
|
4528
4525
|
var Y;
|
|
4529
4526
|
return He(
|
|
4530
|
-
(Y =
|
|
4531
|
-
|
|
4532
|
-
|
|
4527
|
+
(Y = S.state) == null ? void 0 : Y.members,
|
|
4528
|
+
I == null ? void 0 : I.userID,
|
|
4529
|
+
S.type
|
|
4533
4530
|
);
|
|
4534
4531
|
},
|
|
4535
|
-
[(N =
|
|
4532
|
+
[(N = S.state) == null ? void 0 : N.members, I == null ? void 0 : I.userID, S.type]
|
|
4536
4533
|
), T = V.useMemo(() => {
|
|
4537
4534
|
var W;
|
|
4538
|
-
const Y =
|
|
4539
|
-
return Y ? Object.values(((W =
|
|
4535
|
+
const Y = I == null ? void 0 : I.userID;
|
|
4536
|
+
return Y ? Object.values(((W = S.state) == null ? void 0 : W.members) || {}).find((Z) => {
|
|
4540
4537
|
var de;
|
|
4541
4538
|
return ((de = Z.user) == null ? void 0 : de.id) === Y;
|
|
4542
4539
|
}) : void 0;
|
|
4543
|
-
}, [
|
|
4540
|
+
}, [I == null ? void 0 : I.userID, (A = S.state) == null ? void 0 : A.members]), M = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), P = ((q = y == null ? void 0 : y.user) == null ? void 0 : q.is_account) ?? (y == null ? void 0 : y.is_account), $ = E && M === !1 && P === !0, j = S.state.messages.some(
|
|
4544
4541
|
(Y) => Y.type !== "deleted"
|
|
4545
4542
|
), Q = p ? /* @__PURE__ */ s(V.Fragment, { children: p() }, "lt-channel-banner") : null, ee = F ? /* @__PURE__ */ s(
|
|
4546
|
-
|
|
4543
|
+
ga,
|
|
4547
4544
|
{
|
|
4548
4545
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
4549
4546
|
onBack: e,
|
|
@@ -4560,13 +4557,13 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4560
4557
|
onBlockParticipantClick: m,
|
|
4561
4558
|
onReportParticipantClick: f,
|
|
4562
4559
|
customChannelActions: w,
|
|
4563
|
-
renderChannelActions:
|
|
4560
|
+
renderChannelActions: C,
|
|
4564
4561
|
onParticipantNameClick: F
|
|
4565
4562
|
}
|
|
4566
4563
|
) : null, X = J(
|
|
4567
4564
|
(Y) => {
|
|
4568
4565
|
const { message: U } = Ne("ChannelView"), W = /* @__PURE__ */ s(
|
|
4569
|
-
|
|
4566
|
+
xi,
|
|
4570
4567
|
{
|
|
4571
4568
|
...Y,
|
|
4572
4569
|
chatbotVotingEnabled: x,
|
|
@@ -4582,13 +4579,14 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4582
4579
|
{
|
|
4583
4580
|
overrides: {
|
|
4584
4581
|
Message: X,
|
|
4585
|
-
MessageActions:
|
|
4582
|
+
MessageActions: Ni,
|
|
4583
|
+
UnreadMessagesNotification: () => null,
|
|
4586
4584
|
UnreadMessagesSeparator: () => null
|
|
4587
4585
|
},
|
|
4588
4586
|
children: /* @__PURE__ */ u(En, { children: [
|
|
4589
4587
|
!F && /* @__PURE__ */ u(se, { children: [
|
|
4590
4588
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4591
|
-
|
|
4589
|
+
Vi,
|
|
4592
4590
|
{
|
|
4593
4591
|
onBack: e,
|
|
4594
4592
|
showBackButton: t,
|
|
@@ -4604,7 +4602,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4604
4602
|
onBlockParticipantClick: m,
|
|
4605
4603
|
onReportParticipantClick: f,
|
|
4606
4604
|
customChannelActions: w,
|
|
4607
|
-
renderChannelActions:
|
|
4605
|
+
renderChannelActions: C,
|
|
4608
4606
|
renderHeaderTitleBadges: _
|
|
4609
4607
|
}
|
|
4610
4608
|
) }, "lt-channel-header"),
|
|
@@ -4634,14 +4632,14 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4634
4632
|
},
|
|
4635
4633
|
"lt-channel-message-list"
|
|
4636
4634
|
),
|
|
4637
|
-
r ? /* @__PURE__ */ s(V.Fragment, { children: r(
|
|
4635
|
+
r ? /* @__PURE__ */ s(V.Fragment, { children: r(S) }, "lt-channel-conversation-footer") : null,
|
|
4638
4636
|
/* @__PURE__ */ s(
|
|
4639
|
-
|
|
4637
|
+
Ii,
|
|
4640
4638
|
{
|
|
4641
4639
|
...n && {
|
|
4642
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4640
|
+
renderActions: () => n == null ? void 0 : n(S)
|
|
4643
4641
|
},
|
|
4644
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4642
|
+
renderFooter: () => a == null ? void 0 : a(S),
|
|
4645
4643
|
disabled: c,
|
|
4646
4644
|
disabledReason: b,
|
|
4647
4645
|
composerInput: L
|
|
@@ -4662,7 +4660,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4662
4660
|
onLeaveConversation: o,
|
|
4663
4661
|
onBlockParticipant: l,
|
|
4664
4662
|
className: d,
|
|
4665
|
-
CustomChannelEmptyState: m =
|
|
4663
|
+
CustomChannelEmptyState: m = Bi,
|
|
4666
4664
|
showDeleteConversation: f = !0,
|
|
4667
4665
|
onDeleteConversationClick: h,
|
|
4668
4666
|
onBlockParticipantClick: g,
|
|
@@ -4673,16 +4671,16 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4673
4671
|
composerDisabledReason: p,
|
|
4674
4672
|
dmAgentEnabled: _,
|
|
4675
4673
|
messageMetadata: w,
|
|
4676
|
-
onMessageSent:
|
|
4674
|
+
onMessageSent: C,
|
|
4677
4675
|
showStarButton: D = !1,
|
|
4678
|
-
chatbotVotingEnabled:
|
|
4676
|
+
chatbotVotingEnabled: E = !1,
|
|
4679
4677
|
renderChannelBanner: R,
|
|
4680
4678
|
renderHeaderTitleBadges: O,
|
|
4681
4679
|
customChannelActions: F,
|
|
4682
4680
|
renderChannelActions: L,
|
|
4683
|
-
renderMessage:
|
|
4684
|
-
onMessageLinkClick:
|
|
4685
|
-
sendButton:
|
|
4681
|
+
renderMessage: S,
|
|
4682
|
+
onMessageLinkClick: I,
|
|
4683
|
+
sendButton: y,
|
|
4686
4684
|
attachmentPreviewList: T,
|
|
4687
4685
|
viewerLanguage: M,
|
|
4688
4686
|
showChannelInfo: P = !0,
|
|
@@ -4705,26 +4703,26 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4705
4703
|
...A,
|
|
4706
4704
|
...q && { skip_push: !0 }
|
|
4707
4705
|
}, W = await e.sendMessage(Y, U);
|
|
4708
|
-
return
|
|
4706
|
+
return C == null || C(W), W;
|
|
4709
4707
|
},
|
|
4710
|
-
[e, _, w,
|
|
4708
|
+
[e, _, w, C]
|
|
4711
4709
|
), ee = G(null);
|
|
4712
4710
|
return K(() => {
|
|
4713
|
-
if (!
|
|
4711
|
+
if (!I) return;
|
|
4714
4712
|
const X = ee.current;
|
|
4715
4713
|
if (!X) return;
|
|
4716
4714
|
const N = (A) => {
|
|
4717
4715
|
const H = A.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4718
4716
|
if (!Y) return;
|
|
4719
4717
|
const U = q == null ? void 0 : q.closest("[data-message-id]"), W = U == null ? void 0 : U.getAttribute("data-message-id"), Z = W ? e.state.messages.find((de) => de.id === W) : void 0;
|
|
4720
|
-
|
|
4718
|
+
I(Y, Z);
|
|
4721
4719
|
};
|
|
4722
4720
|
return X.addEventListener("click", N), () => X.removeEventListener("click", N);
|
|
4723
|
-
}, [
|
|
4721
|
+
}, [I, e]), /* @__PURE__ */ s(
|
|
4724
4722
|
"div",
|
|
4725
4723
|
{
|
|
4726
4724
|
ref: ee,
|
|
4727
|
-
className:
|
|
4725
|
+
className: k(
|
|
4728
4726
|
"messaging-channel-view h-full flex flex-col",
|
|
4729
4727
|
d
|
|
4730
4728
|
),
|
|
@@ -4732,16 +4730,16 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4732
4730
|
Cn,
|
|
4733
4731
|
{
|
|
4734
4732
|
channel: e,
|
|
4735
|
-
MessageSystem:
|
|
4733
|
+
MessageSystem: Pi,
|
|
4736
4734
|
EmptyStateIndicator: m,
|
|
4737
4735
|
LoadingIndicator: Ve,
|
|
4738
|
-
DateSeparator:
|
|
4739
|
-
TypingIndicator:
|
|
4736
|
+
DateSeparator: pa,
|
|
4737
|
+
TypingIndicator: $i,
|
|
4740
4738
|
doSendMessageRequest: Q,
|
|
4741
|
-
...
|
|
4739
|
+
...y ? { SendButton: y } : {},
|
|
4742
4740
|
...T ? { AttachmentPreviewList: T } : {},
|
|
4743
4741
|
children: /* @__PURE__ */ s(
|
|
4744
|
-
|
|
4742
|
+
Gi,
|
|
4745
4743
|
{
|
|
4746
4744
|
onBack: t,
|
|
4747
4745
|
showBackButton: n,
|
|
@@ -4761,12 +4759,12 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4761
4759
|
composerDisabledReason: p,
|
|
4762
4760
|
showStarButton: D,
|
|
4763
4761
|
dmAgentEnabled: _,
|
|
4764
|
-
chatbotVotingEnabled:
|
|
4762
|
+
chatbotVotingEnabled: E,
|
|
4765
4763
|
renderChannelBanner: R,
|
|
4766
4764
|
renderHeaderTitleBadges: O,
|
|
4767
4765
|
customChannelActions: F,
|
|
4768
4766
|
renderChannelActions: L,
|
|
4769
|
-
renderMessage:
|
|
4767
|
+
renderMessage: S,
|
|
4770
4768
|
viewerLanguage: M,
|
|
4771
4769
|
showChannelInfo: P,
|
|
4772
4770
|
onParticipantNameClick: $,
|
|
@@ -4795,7 +4793,7 @@ const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4795
4793
|
)
|
|
4796
4794
|
] }) }));
|
|
4797
4795
|
Ce.displayName = "ErrorState";
|
|
4798
|
-
const
|
|
4796
|
+
const pl = ({
|
|
4799
4797
|
capabilities: e = {},
|
|
4800
4798
|
renderMessageInputActions: t,
|
|
4801
4799
|
renderConversationFooter: n,
|
|
@@ -4816,18 +4814,18 @@ const bl = ({
|
|
|
4816
4814
|
renderChannelActions: p,
|
|
4817
4815
|
onParticipantNameClick: _,
|
|
4818
4816
|
renderMessage: w,
|
|
4819
|
-
onMessageLinkClick:
|
|
4817
|
+
onMessageLinkClick: C,
|
|
4820
4818
|
showChannelInfo: D,
|
|
4821
|
-
composerInput:
|
|
4819
|
+
composerInput: E
|
|
4822
4820
|
}) => {
|
|
4823
4821
|
const {
|
|
4824
4822
|
client: R,
|
|
4825
4823
|
isConnected: O,
|
|
4826
4824
|
isLoading: F,
|
|
4827
4825
|
error: L,
|
|
4828
|
-
refreshConnection:
|
|
4829
|
-
service:
|
|
4830
|
-
debug:
|
|
4826
|
+
refreshConnection: S,
|
|
4827
|
+
service: I,
|
|
4828
|
+
debug: y
|
|
4831
4829
|
} = sa(), [T, M] = B(null), [P, $] = B(null), [j, Q] = B(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
|
|
4832
4830
|
X.current = o;
|
|
4833
4831
|
const N = G(a);
|
|
@@ -4848,7 +4846,7 @@ const bl = ({
|
|
|
4848
4846
|
(async () => {
|
|
4849
4847
|
var De, ze;
|
|
4850
4848
|
try {
|
|
4851
|
-
|
|
4849
|
+
y && console.log(
|
|
4852
4850
|
"[MessagingShell] Loading initial conversation with:",
|
|
4853
4851
|
i
|
|
4854
4852
|
);
|
|
@@ -4861,27 +4859,27 @@ const bl = ({
|
|
|
4861
4859
|
{ limit: 1 }
|
|
4862
4860
|
);
|
|
4863
4861
|
if (ae.length > 0) {
|
|
4864
|
-
M(ae[0]), $(null), (De = N.current) == null || De.call(N, ae[0]),
|
|
4862
|
+
M(ae[0]), $(null), (De = N.current) == null || De.call(N, ae[0]), y && console.log(
|
|
4865
4863
|
"[MessagingShell] Initial conversation loaded:",
|
|
4866
4864
|
ae[0].id
|
|
4867
4865
|
);
|
|
4868
4866
|
return;
|
|
4869
4867
|
}
|
|
4870
4868
|
const ue = X.current;
|
|
4871
|
-
if (!ue || !
|
|
4872
|
-
Z(), $("No conversation found with this account"),
|
|
4869
|
+
if (!ue || !I) {
|
|
4870
|
+
Z(), $("No conversation found with this account"), y && console.log(
|
|
4873
4871
|
"[MessagingShell] No conversation found for:",
|
|
4874
4872
|
i
|
|
4875
4873
|
);
|
|
4876
4874
|
return;
|
|
4877
4875
|
}
|
|
4878
4876
|
try {
|
|
4879
|
-
const le = await
|
|
4877
|
+
const le = await I.startChannelWithParticipant({
|
|
4880
4878
|
id: ue.id,
|
|
4881
4879
|
name: ue.name,
|
|
4882
4880
|
phone: ue.phone
|
|
4883
4881
|
});
|
|
4884
|
-
M(le), $(null), (ze = N.current) == null || ze.call(N, le),
|
|
4882
|
+
M(le), $(null), (ze = N.current) == null || ze.call(N, le), y && console.log(
|
|
4885
4883
|
"[MessagingShell] Channel created and loaded:",
|
|
4886
4884
|
le.id
|
|
4887
4885
|
);
|
|
@@ -4898,18 +4896,18 @@ const bl = ({
|
|
|
4898
4896
|
), Z(), H.current || $("Failed to load conversation");
|
|
4899
4897
|
}
|
|
4900
4898
|
})();
|
|
4901
|
-
}, [i, R, O,
|
|
4899
|
+
}, [i, R, O, I, y]);
|
|
4902
4900
|
const q = G(r);
|
|
4903
4901
|
q.current = r;
|
|
4904
4902
|
const Y = J(() => {
|
|
4905
4903
|
var U;
|
|
4906
4904
|
M(null), Q(!0), (U = q.current) == null || U.call(q);
|
|
4907
4905
|
}, []);
|
|
4908
|
-
return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack:
|
|
4906
|
+
return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: S }) : !O || !R ? /* @__PURE__ */ s(
|
|
4909
4907
|
Ce,
|
|
4910
4908
|
{
|
|
4911
4909
|
message: "Not connected to messaging service",
|
|
4912
|
-
onBack:
|
|
4910
|
+
onBack: S
|
|
4913
4911
|
}
|
|
4914
4912
|
) : P ? /* @__PURE__ */ s(Ce, { message: P }) : j && !T ? /* @__PURE__ */ s(Ce, { message: "Conversation ended" }) : T ? /* @__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(
|
|
4915
4913
|
Fs,
|
|
@@ -4933,14 +4931,14 @@ const bl = ({
|
|
|
4933
4931
|
renderChannelActions: p,
|
|
4934
4932
|
onParticipantNameClick: _,
|
|
4935
4933
|
renderMessage: w,
|
|
4936
|
-
onMessageLinkClick:
|
|
4934
|
+
onMessageLinkClick: C,
|
|
4937
4935
|
showChannelInfo: D,
|
|
4938
|
-
composerInput:
|
|
4936
|
+
composerInput: E
|
|
4939
4937
|
},
|
|
4940
4938
|
T.id
|
|
4941
4939
|
) }) }) : /* @__PURE__ */ s(Ve, {});
|
|
4942
4940
|
};
|
|
4943
|
-
function
|
|
4941
|
+
function Hi(e) {
|
|
4944
4942
|
const t = e.state.pending_messages;
|
|
4945
4943
|
if (t != null && t.length)
|
|
4946
4944
|
for (const n of t)
|
|
@@ -4954,18 +4952,18 @@ const Ps = V.createContext({
|
|
|
4954
4952
|
renderMessagePreview: void 0,
|
|
4955
4953
|
channelPreview: void 0,
|
|
4956
4954
|
viewerLanguage: void 0
|
|
4957
|
-
}),
|
|
4955
|
+
}), Yi = Ps.Provider, qi = () => V.useContext(Ps), Wi = (e, t) => {
|
|
4958
4956
|
const n = new Date(
|
|
4959
4957
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4960
4958
|
), r = new Date(
|
|
4961
4959
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4962
4960
|
).getTime() - n.getTime();
|
|
4963
4961
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4964
|
-
},
|
|
4962
|
+
}, Xi = (e) => {
|
|
4965
4963
|
const t = /* @__PURE__ */ new Date();
|
|
4966
4964
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4967
4965
|
return "Just now";
|
|
4968
|
-
const a =
|
|
4966
|
+
const a = Wi(e, t);
|
|
4969
4967
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4970
4968
|
hour: "numeric",
|
|
4971
4969
|
minute: "2-digit",
|
|
@@ -4985,7 +4983,7 @@ const Ps = V.createContext({
|
|
|
4985
4983
|
channelPreview: o,
|
|
4986
4984
|
renderMessagePreview: l,
|
|
4987
4985
|
viewerLanguage: d
|
|
4988
|
-
} =
|
|
4986
|
+
} = qi(), { client: m } = fe(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = ut(t);
|
|
4989
4987
|
if (o)
|
|
4990
4988
|
return /* @__PURE__ */ s(
|
|
4991
4989
|
o,
|
|
@@ -4999,46 +4997,46 @@ const Ps = V.createContext({
|
|
|
4999
4997
|
);
|
|
5000
4998
|
const g = () => {
|
|
5001
4999
|
t && r(t);
|
|
5002
|
-
}, c = (
|
|
5003
|
-
const
|
|
5004
|
-
!
|
|
5000
|
+
}, c = (S) => {
|
|
5001
|
+
const I = S.key === "Enter" || S.key === " ", y = S.repeat;
|
|
5002
|
+
!I || y || (S.preventDefault(), g());
|
|
5005
5003
|
}, b = He(
|
|
5006
5004
|
(O = t == null ? void 0 : t.state) == null ? void 0 : O.members,
|
|
5007
5005
|
m == null ? void 0 : m.userID,
|
|
5008
5006
|
t == null ? void 0 : t.type
|
|
5009
5007
|
), v = mt(b == null ? void 0 : b.user), x = (F = b == null ? void 0 : b.user) == null ? void 0 : F.image, p = (() => {
|
|
5010
|
-
var
|
|
5011
|
-
const
|
|
5012
|
-
if (
|
|
5013
|
-
for (let
|
|
5014
|
-
if (
|
|
5008
|
+
var I;
|
|
5009
|
+
const S = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
|
|
5010
|
+
if (S != null && S.length) {
|
|
5011
|
+
for (let y = S.length - 1; y >= 0; y--)
|
|
5012
|
+
if (S[y].type !== "system") return S[y];
|
|
5015
5013
|
}
|
|
5016
5014
|
})(), w = (() => {
|
|
5017
5015
|
var M;
|
|
5018
|
-
const
|
|
5016
|
+
const S = ms({
|
|
5019
5017
|
message: p,
|
|
5020
5018
|
viewerLanguage: d
|
|
5021
|
-
}), { custom_type:
|
|
5022
|
-
if (
|
|
5023
|
-
return
|
|
5024
|
-
if (
|
|
5025
|
-
return
|
|
5026
|
-
if (
|
|
5027
|
-
if (
|
|
5019
|
+
}), { custom_type: I, attachment_content_type: y } = (p == null ? void 0 : p.metadata) || {};
|
|
5020
|
+
if (I === "MESSAGE_TIP")
|
|
5021
|
+
return S || "Sent a tip";
|
|
5022
|
+
if (I === "MESSAGE_PAID")
|
|
5023
|
+
return S || "Sent a message";
|
|
5024
|
+
if (I === "MESSAGE_ATTACHMENT") {
|
|
5025
|
+
if (y === "text")
|
|
5028
5026
|
return "🔒 Sent a locked message";
|
|
5029
|
-
if (
|
|
5027
|
+
if (y === "media")
|
|
5030
5028
|
return "🔒 Sent a locked attachment";
|
|
5031
5029
|
}
|
|
5032
|
-
if (
|
|
5030
|
+
if (S) return S;
|
|
5033
5031
|
const T = (M = p == null ? void 0 : p.attachments) == null ? void 0 : M[0];
|
|
5034
5032
|
return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
5035
|
-
})(),
|
|
5033
|
+
})(), C = p != null && p.created_at ? Xi(new Date(p.created_at)) : "", D = p ? Ue(p) : !1, E = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
|
|
5036
5034
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
5037
5035
|
channelId: t == null ? void 0 : t.id,
|
|
5038
5036
|
isSelected: f,
|
|
5039
5037
|
participantName: v,
|
|
5040
5038
|
unreadCount: R,
|
|
5041
|
-
hasTimestamp: !!
|
|
5039
|
+
hasTimestamp: !!C
|
|
5042
5040
|
}), /* @__PURE__ */ s(
|
|
5043
5041
|
"div",
|
|
5044
5042
|
{
|
|
@@ -5046,7 +5044,7 @@ const Ps = V.createContext({
|
|
|
5046
5044
|
tabIndex: 0,
|
|
5047
5045
|
onClick: g,
|
|
5048
5046
|
onKeyDown: c,
|
|
5049
|
-
className:
|
|
5047
|
+
className: k(
|
|
5050
5048
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
5051
5049
|
{
|
|
5052
5050
|
"bg-black/[0.04]": f,
|
|
@@ -5070,7 +5068,7 @@ const Ps = V.createContext({
|
|
|
5070
5068
|
/* @__PURE__ */ u(
|
|
5071
5069
|
"h3",
|
|
5072
5070
|
{
|
|
5073
|
-
className:
|
|
5071
|
+
className: k(
|
|
5074
5072
|
"text-sm font-medium truncate text-[#191918]"
|
|
5075
5073
|
),
|
|
5076
5074
|
children: [
|
|
@@ -5079,10 +5077,10 @@ const Ps = V.createContext({
|
|
|
5079
5077
|
]
|
|
5080
5078
|
}
|
|
5081
5079
|
),
|
|
5082
|
-
|
|
5080
|
+
C && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: C })
|
|
5083
5081
|
] }),
|
|
5084
5082
|
/* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
5085
|
-
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
5083
|
+
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: E }),
|
|
5086
5084
|
R > 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: R > 99 ? "99+" : R })
|
|
5087
5085
|
] })
|
|
5088
5086
|
] })
|
|
@@ -5092,14 +5090,14 @@ const Ps = V.createContext({
|
|
|
5092
5090
|
}
|
|
5093
5091
|
);
|
|
5094
5092
|
Os.displayName = "CustomChannelPreview";
|
|
5095
|
-
const
|
|
5093
|
+
const Ki = { last_message_at: -1 }, Zi = V.memo(
|
|
5096
5094
|
({
|
|
5097
5095
|
onChannelSelect: e,
|
|
5098
5096
|
selectedChannel: t,
|
|
5099
5097
|
filters: n,
|
|
5100
5098
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
5101
5099
|
channelRenderFilterFn: r,
|
|
5102
|
-
sort: i =
|
|
5100
|
+
sort: i = Ki,
|
|
5103
5101
|
className: o,
|
|
5104
5102
|
customEmptyStateIndicator: l,
|
|
5105
5103
|
channelListPaginator: d = Mn,
|
|
@@ -5115,11 +5113,11 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5115
5113
|
}) => {
|
|
5116
5114
|
const _ = V.useRef(0);
|
|
5117
5115
|
_.current++;
|
|
5118
|
-
const { debug: w = !1 } = dt(),
|
|
5119
|
-
(
|
|
5120
|
-
for (const R of
|
|
5121
|
-
|
|
5122
|
-
return r ? r(
|
|
5116
|
+
const { debug: w = !1 } = dt(), C = V.useCallback(
|
|
5117
|
+
(E) => {
|
|
5118
|
+
for (const R of E)
|
|
5119
|
+
Hi(R);
|
|
5120
|
+
return r ? r(E) : E;
|
|
5123
5121
|
},
|
|
5124
5122
|
[r]
|
|
5125
5123
|
);
|
|
@@ -5149,18 +5147,18 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5149
5147
|
return /* @__PURE__ */ s(
|
|
5150
5148
|
"div",
|
|
5151
5149
|
{
|
|
5152
|
-
className:
|
|
5150
|
+
className: k(
|
|
5153
5151
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
5154
5152
|
o
|
|
5155
5153
|
),
|
|
5156
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
5154
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Yi, { value: D, children: /* @__PURE__ */ s(
|
|
5157
5155
|
Tn,
|
|
5158
5156
|
{
|
|
5159
5157
|
filters: n,
|
|
5160
5158
|
sort: i,
|
|
5161
5159
|
options: { limit: 30 },
|
|
5162
5160
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
5163
|
-
channelRenderFilterFn:
|
|
5161
|
+
channelRenderFilterFn: C,
|
|
5164
5162
|
lockChannelOrder: g,
|
|
5165
5163
|
onMessageNewHandler: c,
|
|
5166
5164
|
onMessageNew: b,
|
|
@@ -5177,11 +5175,11 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5177
5175
|
);
|
|
5178
5176
|
}
|
|
5179
5177
|
);
|
|
5180
|
-
|
|
5181
|
-
const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`,
|
|
5178
|
+
Zi.displayName = "ChannelList";
|
|
5179
|
+
const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, Ji = {
|
|
5182
5180
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5183
5181
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
5184
|
-
},
|
|
5182
|
+
}, Qi = ({ variant: e }) => /* @__PURE__ */ s(
|
|
5185
5183
|
"span",
|
|
5186
5184
|
{
|
|
5187
5185
|
"aria-hidden": "true",
|
|
@@ -5191,12 +5189,12 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5191
5189
|
insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
|
|
5192
5190
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
5193
5191
|
transformOrigin: "center",
|
|
5194
|
-
backgroundColor:
|
|
5192
|
+
backgroundColor: Ji[e],
|
|
5195
5193
|
WebkitMask: as,
|
|
5196
5194
|
mask: as
|
|
5197
5195
|
}
|
|
5198
5196
|
}
|
|
5199
|
-
),
|
|
5197
|
+
), el = {
|
|
5200
5198
|
sent: {
|
|
5201
5199
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5202
5200
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -5215,23 +5213,23 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5215
5213
|
"div",
|
|
5216
5214
|
{
|
|
5217
5215
|
"data-dd-privacy": "mask",
|
|
5218
|
-
className:
|
|
5216
|
+
className: k(
|
|
5219
5217
|
"relative px-4 py-3",
|
|
5220
5218
|
"text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]",
|
|
5221
5219
|
r
|
|
5222
5220
|
),
|
|
5223
5221
|
style: {
|
|
5224
|
-
...
|
|
5222
|
+
...el[e],
|
|
5225
5223
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
5226
5224
|
isolation: "isolate"
|
|
5227
5225
|
},
|
|
5228
5226
|
children: [
|
|
5229
5227
|
a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
|
|
5230
5228
|
/* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
|
|
5231
|
-
n && /* @__PURE__ */ s(
|
|
5229
|
+
n && /* @__PURE__ */ s(Qi, { variant: e })
|
|
5232
5230
|
]
|
|
5233
5231
|
}
|
|
5234
|
-
),
|
|
5232
|
+
), tl = ({
|
|
5235
5233
|
text: e,
|
|
5236
5234
|
tail: t,
|
|
5237
5235
|
header: n,
|
|
@@ -5245,10 +5243,10 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5245
5243
|
header: n,
|
|
5246
5244
|
className: a
|
|
5247
5245
|
}
|
|
5248
|
-
),
|
|
5249
|
-
Sent:
|
|
5250
|
-
Received:
|
|
5251
|
-
},
|
|
5246
|
+
), sl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s($s, { variant: "sent", text: e, tail: t, className: n }), bl = {
|
|
5247
|
+
Sent: sl,
|
|
5248
|
+
Received: tl
|
|
5249
|
+
}, nl = ({
|
|
5252
5250
|
question: e,
|
|
5253
5251
|
onClick: t,
|
|
5254
5252
|
loading: n = !1,
|
|
@@ -5260,7 +5258,7 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5260
5258
|
onClick: t,
|
|
5261
5259
|
disabled: n,
|
|
5262
5260
|
style: { backgroundColor: "#E6E5E3" },
|
|
5263
|
-
className:
|
|
5261
|
+
className: k(
|
|
5264
5262
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
5265
5263
|
{
|
|
5266
5264
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -5270,7 +5268,7 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5270
5268
|
),
|
|
5271
5269
|
children: e
|
|
5272
5270
|
}
|
|
5273
|
-
),
|
|
5271
|
+
), vl = ({
|
|
5274
5272
|
faqs: e,
|
|
5275
5273
|
onFaqClick: t,
|
|
5276
5274
|
loadingFaqId: n,
|
|
@@ -5299,7 +5297,7 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5299
5297
|
children: [
|
|
5300
5298
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5301
5299
|
l.map((d) => /* @__PURE__ */ s(
|
|
5302
|
-
|
|
5300
|
+
nl,
|
|
5303
5301
|
{
|
|
5304
5302
|
question: d.question,
|
|
5305
5303
|
onClick: () => t(d.id),
|
|
@@ -5315,40 +5313,40 @@ const as = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5315
5313
|
export {
|
|
5316
5314
|
fs as A,
|
|
5317
5315
|
pt as B,
|
|
5318
|
-
|
|
5316
|
+
Bi as C,
|
|
5319
5317
|
mt as D,
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5318
|
+
gl as E,
|
|
5319
|
+
vl as F,
|
|
5320
|
+
Pr as G,
|
|
5321
|
+
va as H,
|
|
5324
5322
|
sa as I,
|
|
5325
5323
|
Jt as L,
|
|
5326
|
-
|
|
5324
|
+
hl as M,
|
|
5327
5325
|
ye as a,
|
|
5328
5326
|
ne as b,
|
|
5329
|
-
|
|
5327
|
+
Zi as c,
|
|
5330
5328
|
Fs as d,
|
|
5331
|
-
|
|
5332
|
-
|
|
5329
|
+
fl as e,
|
|
5330
|
+
nl as f,
|
|
5333
5331
|
ce as g,
|
|
5334
5332
|
Pe as h,
|
|
5335
5333
|
ke as i,
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5334
|
+
bl as j,
|
|
5335
|
+
qr as k,
|
|
5336
|
+
ml as l,
|
|
5337
|
+
pl as m,
|
|
5338
|
+
tr as n,
|
|
5341
5339
|
he as o,
|
|
5342
|
-
|
|
5343
|
-
|
|
5340
|
+
Ja as p,
|
|
5341
|
+
Xi as q,
|
|
5344
5342
|
_e as r,
|
|
5345
|
-
|
|
5343
|
+
er as s,
|
|
5346
5344
|
ms as t,
|
|
5347
5345
|
bs as u,
|
|
5348
5346
|
ia as v,
|
|
5349
|
-
|
|
5350
|
-
|
|
5347
|
+
Ha as w,
|
|
5348
|
+
xa as x,
|
|
5351
5349
|
He as y,
|
|
5352
5350
|
gt as z
|
|
5353
5351
|
};
|
|
5354
|
-
//# sourceMappingURL=index-
|
|
5352
|
+
//# sourceMappingURL=index-B2BrYTjw.js.map
|