@linktr.ee/messaging-react 3.12.3-rc-1784034329 → 3.12.3-rc-1784036508
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-Dd-lw8HD.cjs → Card--gGSoMXs.cjs} +2 -2
- package/dist/{Card-Dd-lw8HD.cjs.map → Card--gGSoMXs.cjs.map} +1 -1
- package/dist/{Card-dFpcKsyN.js → Card-CKM_PULl.js} +2 -2
- package/dist/{Card-dFpcKsyN.js.map → Card-CKM_PULl.js.map} +1 -1
- package/dist/index-D5GopgL7.cjs +2 -0
- package/dist/index-D5GopgL7.cjs.map +1 -0
- package/dist/{index-BvuCjzqJ.js → index-FDgJhTIG.js} +275 -276
- package/dist/index-FDgJhTIG.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/utils/cdnImageUrl.test.ts +20 -0
- package/src/utils/cdnImageUrl.ts +10 -3
- package/dist/index-BvuCjzqJ.js.map +0 -1
- package/dist/index-C1eZGd_f.cjs +0 -2
- package/dist/index-C1eZGd_f.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as s, jsxs as u, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import V, { createContext as ct, useContext as Te, useCallback as J, useState as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ie, DotsThreeIcon as
|
|
2
|
+
import V, { createContext as ct, useContext as Te, useCallback as J, useState as B, useRef as G, useEffect as K, useId as Vs, useMemo as re, Suspense as Gs } from "react";
|
|
3
|
+
import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Ys, LinkPreviewsManager as Yt } from "stream-chat";
|
|
5
|
+
import { Chat as qs, useChannelStateContext as 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
|
+
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
7
|
import y from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as ta, DefaultDropdownActionButton as cs } from "stream-chat-react/experimental";
|
|
9
|
+
const ds = ct({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const cs = ct({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), dt = () => Te(
|
|
19
|
+
}), dt = () => Te(ds), hl = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -38,7 +38,7 @@ const cs = ct({
|
|
|
38
38
|
serviceConfig: !!n,
|
|
39
39
|
capabilities: Object.keys(r)
|
|
40
40
|
});
|
|
41
|
-
const [d, m] =
|
|
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), k = G(n);
|
|
42
42
|
k.current = n;
|
|
43
43
|
const D = G(i);
|
|
44
44
|
D.current = i;
|
|
@@ -64,7 +64,7 @@ const cs = ct({
|
|
|
64
64
|
capabilities: r
|
|
65
65
|
};
|
|
66
66
|
const O = G(null);
|
|
67
|
-
!o && a && ((I = O.current) == null ? void 0 : I.apiKey) !== a && (O.current = { apiKey: a, client: new
|
|
67
|
+
!o && a && ((I = O.current) == null ? void 0 : I.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
70
|
const M = R.current, P = k.current;
|
|
@@ -83,7 +83,7 @@ const cs = ct({
|
|
|
83
83
|
renderCount: M,
|
|
84
84
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
85
85
|
});
|
|
86
|
-
const $ = new
|
|
86
|
+
const $ = new Hs({
|
|
87
87
|
...P,
|
|
88
88
|
apiKey: a,
|
|
89
89
|
debug: D.current,
|
|
@@ -214,8 +214,8 @@ const cs = ct({
|
|
|
214
214
|
renderCount: R.current,
|
|
215
215
|
willRenderChat: !!F,
|
|
216
216
|
contextValueReady: !!E
|
|
217
|
-
}), /* @__PURE__ */ s(
|
|
218
|
-
|
|
217
|
+
}), /* @__PURE__ */ s(ds.Provider, { value: E, children: F ? /* @__PURE__ */ s(
|
|
218
|
+
qs,
|
|
219
219
|
{
|
|
220
220
|
client: F,
|
|
221
221
|
customClasses: {
|
|
@@ -224,9 +224,9 @@ const cs = ct({
|
|
|
224
224
|
children: e
|
|
225
225
|
}
|
|
226
226
|
) : e });
|
|
227
|
-
},
|
|
227
|
+
}, sa = () => dt(), ut = (e) => {
|
|
228
228
|
var a, r;
|
|
229
|
-
const [t, n] =
|
|
229
|
+
const [t, n] = B(
|
|
230
230
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
231
231
|
);
|
|
232
232
|
return K(() => {
|
|
@@ -246,14 +246,14 @@ const cs = ct({
|
|
|
246
246
|
e.off("member.updated", i);
|
|
247
247
|
};
|
|
248
248
|
}, [e]), t;
|
|
249
|
-
},
|
|
249
|
+
}, na = "linktree-official", aa = "linktree-official-sender";
|
|
250
250
|
function He(e, t, n) {
|
|
251
251
|
const a = Object.values(e || {});
|
|
252
|
-
if (n ===
|
|
252
|
+
if (n === na) {
|
|
253
253
|
const r = a.find(
|
|
254
254
|
(i) => {
|
|
255
255
|
var o;
|
|
256
|
-
return ((o = i.user) == null ? void 0 : o.id) ===
|
|
256
|
+
return ((o = i.user) == null ? void 0 : o.id) === aa;
|
|
257
257
|
}
|
|
258
258
|
);
|
|
259
259
|
if (r) return r;
|
|
@@ -265,13 +265,13 @@ function He(e, t, n) {
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
const
|
|
269
|
-
function
|
|
270
|
-
return
|
|
268
|
+
const ra = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
269
|
+
function ia(e) {
|
|
270
|
+
return ra.test(e.trim());
|
|
271
271
|
}
|
|
272
272
|
function Wt(e, t) {
|
|
273
273
|
const n = e == null ? void 0 : e.trim();
|
|
274
|
-
return !n || t && n === t ? !1 : !
|
|
274
|
+
return !n || t && n === t ? !1 : !ia(n);
|
|
275
275
|
}
|
|
276
276
|
function mt(e) {
|
|
277
277
|
return Wt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Wt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
@@ -304,7 +304,7 @@ const Xt = [
|
|
|
304
304
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
305
305
|
// Melon
|
|
306
306
|
];
|
|
307
|
-
function
|
|
307
|
+
function la(e) {
|
|
308
308
|
let t = 0;
|
|
309
309
|
for (let n = 0; n < e.length; n++) {
|
|
310
310
|
const a = e.charCodeAt(n);
|
|
@@ -312,14 +312,14 @@ function ia(e) {
|
|
|
312
312
|
}
|
|
313
313
|
return Math.abs(t);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return Xt[
|
|
317
|
-
}
|
|
318
|
-
function la(e) {
|
|
319
|
-
return ds(e).emoji;
|
|
315
|
+
function us(e) {
|
|
316
|
+
return Xt[la(e) % Xt.length];
|
|
320
317
|
}
|
|
321
318
|
function oa(e) {
|
|
322
|
-
return
|
|
319
|
+
return us(e).emoji;
|
|
320
|
+
}
|
|
321
|
+
function ca(e) {
|
|
322
|
+
return us(e).bgColor;
|
|
323
323
|
}
|
|
324
324
|
const ne = ({
|
|
325
325
|
id: e,
|
|
@@ -330,7 +330,7 @@ const ne = ({
|
|
|
330
330
|
shape: i = "squircle",
|
|
331
331
|
dmAgentEnabled: o = !1
|
|
332
332
|
}) => {
|
|
333
|
-
const l =
|
|
333
|
+
const l = oa(e), d = ca(e), m = 0.45, h = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
334
334
|
"img",
|
|
335
335
|
{
|
|
336
336
|
src: t,
|
|
@@ -394,7 +394,7 @@ const ne = ({
|
|
|
394
394
|
]
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
|
-
},
|
|
397
|
+
}, da = "https://linktr.ee/s/about/trust-center/report", ua = ({
|
|
398
398
|
channel: e,
|
|
399
399
|
participant: t,
|
|
400
400
|
showBlockParticipant: n = !0,
|
|
@@ -408,7 +408,7 @@ const ne = ({
|
|
|
408
408
|
logLabel: f = "useChannelModerationActions"
|
|
409
409
|
}) => {
|
|
410
410
|
var E;
|
|
411
|
-
const { service: h, debug: g } = dt(), c = (E = t == null ? void 0 : t.user) == null ? void 0 : E.id, b = !!(a && n && h && c), [v, x] =
|
|
411
|
+
const { service: h, debug: g } = dt(), c = (E = t == null ? void 0 : t.user) == null ? void 0 : E.id, b = !!(a && n && h && c), [v, x] = B(!1), [p, _] = B(null), [w, k] = B(!1), [D, S] = 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);
|
|
@@ -478,7 +478,7 @@ const ne = ({
|
|
|
478
478
|
}
|
|
479
479
|
},
|
|
480
480
|
handleReportUser: () => {
|
|
481
|
-
d == null || d(), m == null || m(), window.open(
|
|
481
|
+
d == null || d(), m == null || m(), window.open(da, "_blank", "noopener,noreferrer");
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
484
|
}, ye = ({
|
|
@@ -512,7 +512,7 @@ const ne = ({
|
|
|
512
512
|
customChannelActions: f,
|
|
513
513
|
triggerClassName: h
|
|
514
514
|
}) => {
|
|
515
|
-
const [g, c] =
|
|
515
|
+
const [g, c] = B(!1), b = G(null), v = Vs(), x = J(() => c(!1), []), {
|
|
516
516
|
isParticipantBlocked: p,
|
|
517
517
|
isCheckingBlockedStatus: _,
|
|
518
518
|
isLeaving: w,
|
|
@@ -521,7 +521,7 @@ const ne = ({
|
|
|
521
521
|
handleBlockUser: S,
|
|
522
522
|
handleUnblockUser: R,
|
|
523
523
|
handleReportUser: O
|
|
524
|
-
} =
|
|
524
|
+
} = ua({
|
|
525
525
|
channel: e,
|
|
526
526
|
participant: t,
|
|
527
527
|
showBlockParticipant: a,
|
|
@@ -555,7 +555,7 @@ const ne = ({
|
|
|
555
555
|
"aria-controls": g ? v : void 0,
|
|
556
556
|
onClick: () => c((L) => !L),
|
|
557
557
|
children: [
|
|
558
|
-
/* @__PURE__ */ s(
|
|
558
|
+
/* @__PURE__ */ s(An, { className: "size-5 text-black/90" }),
|
|
559
559
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
560
560
|
]
|
|
561
561
|
}
|
|
@@ -577,7 +577,7 @@ const ne = ({
|
|
|
577
577
|
disabled: w,
|
|
578
578
|
"aria-busy": w,
|
|
579
579
|
children: [
|
|
580
|
-
w ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
580
|
+
w ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Rn, { className: "h-5 w-5" }),
|
|
581
581
|
/* @__PURE__ */ s("span", { children: "Delete Conversation" })
|
|
582
582
|
]
|
|
583
583
|
}
|
|
@@ -613,7 +613,7 @@ const ne = ({
|
|
|
613
613
|
}
|
|
614
614
|
) }),
|
|
615
615
|
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ u(ye, { variant: "danger", onClick: O, children: [
|
|
616
|
-
/* @__PURE__ */ s(
|
|
616
|
+
/* @__PURE__ */ s(is, { className: "h-5 w-5" }),
|
|
617
617
|
/* @__PURE__ */ s("span", { children: "Report" })
|
|
618
618
|
] }) }),
|
|
619
619
|
f
|
|
@@ -621,10 +621,10 @@ 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",
|
|
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 = (e) => {
|
|
625
625
|
const t = e;
|
|
626
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(
|
|
627
|
-
},
|
|
626
|
+
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(fa);
|
|
627
|
+
}, pa = ({
|
|
628
628
|
className: e,
|
|
629
629
|
onBack: t,
|
|
630
630
|
showBackButton: n,
|
|
@@ -654,7 +654,7 @@ const ne = ({
|
|
|
654
654
|
);
|
|
655
655
|
},
|
|
656
656
|
[(F = p.state) == null ? void 0 : F.members, _ == null ? void 0 : _.userID, p.type]
|
|
657
|
-
), k = mt(w == null ? void 0 : w.user), D = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, S = ut(p), R =
|
|
657
|
+
), k = mt(w == null ? void 0 : w.user), D = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, S = ut(p), R = ga(w), O = async () => {
|
|
658
658
|
try {
|
|
659
659
|
S ? await p.unpin() : await p.pin();
|
|
660
660
|
} catch (E) {
|
|
@@ -715,7 +715,7 @@ const ne = ({
|
|
|
715
715
|
{
|
|
716
716
|
"aria-label": "Paid customer",
|
|
717
717
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
718
|
-
children: /* @__PURE__ */ s(
|
|
718
|
+
children: /* @__PURE__ */ s(Ln, { className: "size-2.5", weight: "bold" })
|
|
719
719
|
}
|
|
720
720
|
),
|
|
721
721
|
a && S && /* @__PURE__ */ s(
|
|
@@ -738,7 +738,7 @@ const ne = ({
|
|
|
738
738
|
] }),
|
|
739
739
|
r && /* @__PURE__ */ u("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
740
740
|
/* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
|
|
741
|
-
/* @__PURE__ */ s("span", { children:
|
|
741
|
+
/* @__PURE__ */ s("span", { children: ha })
|
|
742
742
|
] })
|
|
743
743
|
] })
|
|
744
744
|
]
|
|
@@ -786,13 +786,13 @@ const ne = ({
|
|
|
786
786
|
] })
|
|
787
787
|
}
|
|
788
788
|
);
|
|
789
|
-
},
|
|
790
|
-
function
|
|
789
|
+
}, ba = (e) => /* @__PURE__ */ s(Ws, { ...e, position: "center" }), lt = "vote_up", ot = "vote_down";
|
|
790
|
+
function va(e) {
|
|
791
791
|
return e != null && e.length ? e.some((t) => t.type === ot) ? "down" : e.some((t) => t.type === lt) ? "up" : null : null;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function xa(e) {
|
|
794
794
|
const { channel: t } = oe(), { client: n } = fe("useMessageVote"), a = re(
|
|
795
|
-
() =>
|
|
795
|
+
() => va(e.own_reactions),
|
|
796
796
|
[e.own_reactions]
|
|
797
797
|
), r = J(async () => {
|
|
798
798
|
if (n != null && n.userID)
|
|
@@ -817,18 +817,18 @@ function va(e) {
|
|
|
817
817
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
818
818
|
return { selected: a, voteUp: r, voteDown: i };
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function wa(e) {
|
|
821
821
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function ms({
|
|
824
824
|
message: e,
|
|
825
825
|
viewerLanguage: t
|
|
826
826
|
}) {
|
|
827
827
|
var r;
|
|
828
|
-
const n = e == null ? void 0 : e.text, a =
|
|
828
|
+
const n = e == null ? void 0 : e.text, a = wa(t);
|
|
829
829
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
830
830
|
}
|
|
831
|
-
const
|
|
831
|
+
const _a = ["linktr.ee"], Kt = "messaging-attachment-v1_0";
|
|
832
832
|
function Na(e) {
|
|
833
833
|
try {
|
|
834
834
|
return new URL(e).hostname.toLowerCase();
|
|
@@ -837,7 +837,7 @@ function Na(e) {
|
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
function ya(e) {
|
|
840
|
-
return
|
|
840
|
+
return _a.some(
|
|
841
841
|
(t) => e === t || e.endsWith(`.${t}`)
|
|
842
842
|
);
|
|
843
843
|
}
|
|
@@ -845,10 +845,9 @@ function he(e) {
|
|
|
845
845
|
const t = e == null ? void 0 : e.trim();
|
|
846
846
|
if (!t) return;
|
|
847
847
|
const n = Na(t);
|
|
848
|
-
if (!n || !ya(n)
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
return `${t}${a}io=true&size=${_a}`;
|
|
848
|
+
if (!n || !ya(n)) return t;
|
|
849
|
+
const a = new URL(t);
|
|
850
|
+
return a.searchParams.get("io") === "true" && a.searchParams.get("size") === Kt ? t : (a.searchParams.set("io", "true"), a.searchParams.set("size", Kt), a.toString());
|
|
852
851
|
}
|
|
853
852
|
const ka = [
|
|
854
853
|
[/pdf/, "pdf"],
|
|
@@ -863,31 +862,31 @@ const ka = [
|
|
|
863
862
|
function ce(e) {
|
|
864
863
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
865
864
|
}
|
|
866
|
-
function
|
|
865
|
+
function hs(e) {
|
|
867
866
|
const t = ka.find(
|
|
868
867
|
([n]) => n.test(e)
|
|
869
868
|
);
|
|
870
869
|
return t ? t[1] : "generic";
|
|
871
870
|
}
|
|
872
871
|
const Ca = {
|
|
873
|
-
video:
|
|
874
|
-
audio:
|
|
875
|
-
image:
|
|
876
|
-
document:
|
|
872
|
+
video: os,
|
|
873
|
+
audio: zn,
|
|
874
|
+
image: Dn,
|
|
875
|
+
document: ls
|
|
877
876
|
}, Sa = {
|
|
878
|
-
pdf:
|
|
879
|
-
doc:
|
|
877
|
+
pdf: Vn,
|
|
878
|
+
doc: jn,
|
|
880
879
|
xls: Bn,
|
|
881
|
-
csv:
|
|
882
|
-
ppt:
|
|
883
|
-
zip:
|
|
884
|
-
text:
|
|
885
|
-
markdown:
|
|
886
|
-
generic:
|
|
880
|
+
csv: Un,
|
|
881
|
+
ppt: $n,
|
|
882
|
+
zip: On,
|
|
883
|
+
text: Pn,
|
|
884
|
+
markdown: Fn,
|
|
885
|
+
generic: ls
|
|
887
886
|
};
|
|
888
887
|
function Ea(e) {
|
|
889
888
|
const t = ce(e);
|
|
890
|
-
return t !== "document" ? Ca[t] : Sa[
|
|
889
|
+
return t !== "document" ? Ca[t] : Sa[hs(e)];
|
|
891
890
|
}
|
|
892
891
|
function _e(e, t) {
|
|
893
892
|
return V.createElement(Ea(e), t);
|
|
@@ -907,7 +906,7 @@ const Ia = (e) => {
|
|
|
907
906
|
muted: d = !1,
|
|
908
907
|
onContainerClick: m
|
|
909
908
|
}) => {
|
|
910
|
-
const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] =
|
|
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, k] = B(!1), [D, S] = B(!1), [R, O] = B(!1), [F, L] = B(!1), [C, E] = B(!0), [I, T] = B(null), M = J(() => {
|
|
911
910
|
O(!1), x(!0);
|
|
912
911
|
}, []), P = J((N) => {
|
|
913
912
|
const A = g.current;
|
|
@@ -1093,7 +1092,7 @@ const Ia = (e) => {
|
|
|
1093
1092
|
},
|
|
1094
1093
|
className: "shrink-0 text-white",
|
|
1095
1094
|
"aria-label": v ? "Pause" : "Play",
|
|
1096
|
-
children: v ? /* @__PURE__ */ s(
|
|
1095
|
+
children: v ? /* @__PURE__ */ s(Gn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(rt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1097
1096
|
}
|
|
1098
1097
|
),
|
|
1099
1098
|
/* @__PURE__ */ u(
|
|
@@ -1143,7 +1142,7 @@ const Ia = (e) => {
|
|
|
1143
1142
|
]
|
|
1144
1143
|
}
|
|
1145
1144
|
);
|
|
1146
|
-
},
|
|
1145
|
+
}, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ma = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", fs = ({
|
|
1147
1146
|
mimeType: e,
|
|
1148
1147
|
sourceUrl: t,
|
|
1149
1148
|
thumbnailUrl: n,
|
|
@@ -1152,7 +1151,7 @@ const Ia = (e) => {
|
|
|
1152
1151
|
mediaPlayerProps: i,
|
|
1153
1152
|
containedImage: o = !1
|
|
1154
1153
|
}) => {
|
|
1155
|
-
const l = ce(e), [d, m] =
|
|
1154
|
+
const l = ce(e), [d, m] = B(!1), f = he(t), h = he(n);
|
|
1156
1155
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
|
|
1157
1156
|
Ta,
|
|
1158
1157
|
{
|
|
@@ -1201,7 +1200,7 @@ const Ia = (e) => {
|
|
|
1201
1200
|
{
|
|
1202
1201
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1203
1202
|
children: _e(e, {
|
|
1204
|
-
className:
|
|
1203
|
+
className: Zt(r),
|
|
1205
1204
|
weight: "regular"
|
|
1206
1205
|
})
|
|
1207
1206
|
}
|
|
@@ -1218,12 +1217,12 @@ const Ia = (e) => {
|
|
|
1218
1217
|
{
|
|
1219
1218
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1220
1219
|
children: _e(e, {
|
|
1221
|
-
className:
|
|
1220
|
+
className: Zt(r),
|
|
1222
1221
|
weight: "regular"
|
|
1223
1222
|
})
|
|
1224
1223
|
}
|
|
1225
1224
|
);
|
|
1226
|
-
},
|
|
1225
|
+
}, gs = ({
|
|
1227
1226
|
variant: e,
|
|
1228
1227
|
thumbnail: t,
|
|
1229
1228
|
title: n,
|
|
@@ -1289,7 +1288,7 @@ const Ia = (e) => {
|
|
|
1289
1288
|
}
|
|
1290
1289
|
);
|
|
1291
1290
|
};
|
|
1292
|
-
function
|
|
1291
|
+
function ps(e) {
|
|
1293
1292
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1294
1293
|
}
|
|
1295
1294
|
function ht(e) {
|
|
@@ -1323,7 +1322,7 @@ const ft = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1323
1322
|
"div",
|
|
1324
1323
|
{
|
|
1325
1324
|
className: `aspect-video w-full rounded-[20px] ${Aa(t)} flex items-center justify-center`,
|
|
1326
|
-
children: /* @__PURE__ */ s(
|
|
1325
|
+
children: /* @__PURE__ */ s(Hn, { className: `size-12 ${za(t)}` })
|
|
1327
1326
|
}
|
|
1328
1327
|
) }),
|
|
1329
1328
|
/* @__PURE__ */ u("div", { className: "px-3 pb-3", children: [
|
|
@@ -1334,12 +1333,12 @@ const ft = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1334
1333
|
] });
|
|
1335
1334
|
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 });
|
|
1336
1335
|
};
|
|
1337
|
-
function
|
|
1336
|
+
function bs(e) {
|
|
1338
1337
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1339
1338
|
}
|
|
1340
1339
|
function gt(e) {
|
|
1341
1340
|
var t;
|
|
1342
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1341
|
+
return (t = e.attachments) == null ? void 0 : t.find(bs);
|
|
1343
1342
|
}
|
|
1344
1343
|
async function Fa(e, t) {
|
|
1345
1344
|
let n;
|
|
@@ -1357,7 +1356,7 @@ const Pa = ({
|
|
|
1357
1356
|
url: e,
|
|
1358
1357
|
filename: t
|
|
1359
1358
|
}) => {
|
|
1360
|
-
const [n, a] =
|
|
1359
|
+
const [n, a] = B(!1);
|
|
1361
1360
|
return /* @__PURE__ */ s(
|
|
1362
1361
|
"button",
|
|
1363
1362
|
{
|
|
@@ -1401,16 +1400,16 @@ function pt(e) {
|
|
|
1401
1400
|
thumbnailUrl: f
|
|
1402
1401
|
};
|
|
1403
1402
|
}
|
|
1404
|
-
const
|
|
1403
|
+
const vs = ({
|
|
1405
1404
|
resolvedUrl: e,
|
|
1406
1405
|
resolvedType: t,
|
|
1407
1406
|
title: n,
|
|
1408
1407
|
fileSize: a,
|
|
1409
1408
|
thumbnailUrl: r
|
|
1410
1409
|
}) => {
|
|
1411
|
-
const i = a !== void 0 ?
|
|
1410
|
+
const i = a !== void 0 ? ps(a) : void 0;
|
|
1412
1411
|
return /* @__PURE__ */ s(
|
|
1413
|
-
|
|
1412
|
+
gs,
|
|
1414
1413
|
{
|
|
1415
1414
|
variant: "dark",
|
|
1416
1415
|
title: n,
|
|
@@ -1418,7 +1417,7 @@ const bs = ({
|
|
|
1418
1417
|
mimeType: t,
|
|
1419
1418
|
detail: i,
|
|
1420
1419
|
thumbnail: /* @__PURE__ */ s(
|
|
1421
|
-
|
|
1420
|
+
fs,
|
|
1422
1421
|
{
|
|
1423
1422
|
mimeType: t,
|
|
1424
1423
|
sourceUrl: e,
|
|
@@ -1429,23 +1428,23 @@ const bs = ({
|
|
|
1429
1428
|
)
|
|
1430
1429
|
}
|
|
1431
1430
|
);
|
|
1432
|
-
},
|
|
1431
|
+
}, xs = ({
|
|
1433
1432
|
resolvedUrl: e,
|
|
1434
1433
|
resolvedType: t,
|
|
1435
1434
|
title: n,
|
|
1436
1435
|
fileSize: a,
|
|
1437
1436
|
thumbnailUrl: r
|
|
1438
1437
|
}) => {
|
|
1439
|
-
const i = ce(t), o = a !== void 0 ?
|
|
1438
|
+
const i = ce(t), o = a !== void 0 ? ps(a) : void 0;
|
|
1440
1439
|
return /* @__PURE__ */ s(
|
|
1441
|
-
|
|
1440
|
+
gs,
|
|
1442
1441
|
{
|
|
1443
1442
|
variant: "light",
|
|
1444
1443
|
title: n,
|
|
1445
1444
|
mimeType: t,
|
|
1446
1445
|
detail: o,
|
|
1447
1446
|
thumbnail: /* @__PURE__ */ s(
|
|
1448
|
-
|
|
1447
|
+
fs,
|
|
1449
1448
|
{
|
|
1450
1449
|
mimeType: t,
|
|
1451
1450
|
sourceUrl: e,
|
|
@@ -1484,7 +1483,7 @@ const bs = ({
|
|
|
1484
1483
|
className: "str-chat__message-bubble",
|
|
1485
1484
|
"data-attachment-bubble": "true",
|
|
1486
1485
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1487
|
-
children: n ? /* @__PURE__ */ s("div", { className: ht(t), children: /* @__PURE__ */ s(ft, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(
|
|
1486
|
+
children: n ? /* @__PURE__ */ s("div", { className: ht(t), children: /* @__PURE__ */ s(ft, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(vs, { ...a }) : /* @__PURE__ */ s(xs, { ...a })
|
|
1488
1487
|
}
|
|
1489
1488
|
) })
|
|
1490
1489
|
}
|
|
@@ -1497,19 +1496,19 @@ const bs = ({
|
|
|
1497
1496
|
if (t)
|
|
1498
1497
|
return /* @__PURE__ */ s("div", { className: ht(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !0 }) });
|
|
1499
1498
|
const n = pt(e);
|
|
1500
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1501
|
-
},
|
|
1499
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
|
|
1500
|
+
}, Ua = ({
|
|
1502
1501
|
message: e
|
|
1503
1502
|
}) => {
|
|
1504
1503
|
const t = gt(e);
|
|
1505
1504
|
if (t)
|
|
1506
1505
|
return /* @__PURE__ */ s("div", { className: ht(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !1 }) });
|
|
1507
1506
|
const n = pt(e);
|
|
1508
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1507
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(xs, { ...n }) }) : null;
|
|
1509
1508
|
}, fl = Object.assign(Oa, {
|
|
1510
1509
|
Creator: $a,
|
|
1511
|
-
Visitor:
|
|
1512
|
-
}),
|
|
1510
|
+
Visitor: Ua
|
|
1511
|
+
}), Ba = {
|
|
1513
1512
|
dark: "bg-[#1e2330]",
|
|
1514
1513
|
light: "bg-[#f2f1ef]"
|
|
1515
1514
|
}, ja = {
|
|
@@ -1555,7 +1554,7 @@ const bs = ({
|
|
|
1555
1554
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1556
1555
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1557
1556
|
d,
|
|
1558
|
-
|
|
1557
|
+
Ba[e],
|
|
1559
1558
|
ja[e],
|
|
1560
1559
|
n && "border",
|
|
1561
1560
|
n && Va[e],
|
|
@@ -1687,7 +1686,7 @@ function tr(e, t) {
|
|
|
1687
1686
|
}
|
|
1688
1687
|
if (!e) return;
|
|
1689
1688
|
if (ce(e) === "document") {
|
|
1690
|
-
const r =
|
|
1689
|
+
const r = hs(e), i = er[r];
|
|
1691
1690
|
if (i) return i;
|
|
1692
1691
|
if (e === "application/octet-stream") return;
|
|
1693
1692
|
}
|
|
@@ -1716,7 +1715,7 @@ const nr = {
|
|
|
1716
1715
|
}, rr = {
|
|
1717
1716
|
dark: "text-white/85",
|
|
1718
1717
|
light: "text-black/85"
|
|
1719
|
-
},
|
|
1718
|
+
}, ws = ({
|
|
1720
1719
|
variant: e,
|
|
1721
1720
|
filename: t,
|
|
1722
1721
|
title: n,
|
|
@@ -1775,7 +1774,7 @@ const nr = {
|
|
|
1775
1774
|
l ? /* @__PURE__ */ s("div", { className: "shrink-0", children: l }) : null
|
|
1776
1775
|
] });
|
|
1777
1776
|
};
|
|
1778
|
-
async function
|
|
1777
|
+
async function _s(e, t) {
|
|
1779
1778
|
const n = t ?? ie(e);
|
|
1780
1779
|
try {
|
|
1781
1780
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -1805,7 +1804,7 @@ const ir = ({
|
|
|
1805
1804
|
}) => {
|
|
1806
1805
|
const i = t.filename ?? ie(t.src);
|
|
1807
1806
|
return /* @__PURE__ */ s(
|
|
1808
|
-
|
|
1807
|
+
ws,
|
|
1809
1808
|
{
|
|
1810
1809
|
variant: e,
|
|
1811
1810
|
filename: i,
|
|
@@ -1842,7 +1841,7 @@ const ir = ({
|
|
|
1842
1841
|
const p = c[x];
|
|
1843
1842
|
if (!p) return;
|
|
1844
1843
|
const _ = p.filename ?? ie(p.src);
|
|
1845
|
-
|
|
1844
|
+
_s(p.src, _);
|
|
1846
1845
|
};
|
|
1847
1846
|
if (c.length === 0)
|
|
1848
1847
|
return null;
|
|
@@ -1894,7 +1893,7 @@ const ir = ({
|
|
|
1894
1893
|
onClick: e,
|
|
1895
1894
|
"aria-label": n,
|
|
1896
1895
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1897
|
-
children: /* @__PURE__ */ s(
|
|
1896
|
+
children: /* @__PURE__ */ s(Yn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1898
1897
|
}
|
|
1899
1898
|
),
|
|
1900
1899
|
/* @__PURE__ */ s(
|
|
@@ -1907,7 +1906,7 @@ const ir = ({
|
|
|
1907
1906
|
children: /* @__PURE__ */ s(xe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1908
1907
|
}
|
|
1909
1908
|
)
|
|
1910
|
-
] }),
|
|
1909
|
+
] }), Ns = ({
|
|
1911
1910
|
url: e,
|
|
1912
1911
|
filename: t,
|
|
1913
1912
|
variant: n = "pill",
|
|
@@ -1916,9 +1915,9 @@ const ir = ({
|
|
|
1916
1915
|
tone: i = "dark",
|
|
1917
1916
|
onTriggered: o
|
|
1918
1917
|
}) => {
|
|
1919
|
-
const [l, d] =
|
|
1918
|
+
const [l, d] = B(!1), m = J(
|
|
1920
1919
|
(c) => {
|
|
1921
|
-
c.stopPropagation(), !l && (d(!0),
|
|
1920
|
+
c.stopPropagation(), !l && (d(!0), _s(e, t).catch(() => {
|
|
1922
1921
|
}).finally(() => {
|
|
1923
1922
|
d(!1), o == null || o();
|
|
1924
1923
|
}));
|
|
@@ -1997,7 +1996,7 @@ const ir = ({
|
|
|
1997
1996
|
initialIndex: t,
|
|
1998
1997
|
open: n
|
|
1999
1998
|
}) => {
|
|
2000
|
-
const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
1999
|
+
const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
|
|
2001
2000
|
K(() => {
|
|
2002
2001
|
n && i(Je(t, 0, Math.max(e - 1, 0)));
|
|
2003
2002
|
}, [n, t, e]), K(() => {
|
|
@@ -2107,7 +2106,7 @@ const ir = ({
|
|
|
2107
2106
|
]
|
|
2108
2107
|
}
|
|
2109
2108
|
);
|
|
2110
|
-
},
|
|
2109
|
+
}, ys = ({
|
|
2111
2110
|
open: e,
|
|
2112
2111
|
items: t,
|
|
2113
2112
|
initialIndex: n = 0,
|
|
@@ -2129,7 +2128,7 @@ const ir = ({
|
|
|
2129
2128
|
ariaLabel: d,
|
|
2130
2129
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
2131
2130
|
actions: /* @__PURE__ */ s(
|
|
2132
|
-
|
|
2131
|
+
Ns,
|
|
2133
2132
|
{
|
|
2134
2133
|
url: l.src,
|
|
2135
2134
|
filename: d,
|
|
@@ -2163,7 +2162,7 @@ const ir = ({
|
|
|
2163
2162
|
]
|
|
2164
2163
|
}
|
|
2165
2164
|
) : null;
|
|
2166
|
-
}, mr = "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",
|
|
2165
|
+
}, mr = "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 = ({
|
|
2167
2166
|
tiles: e,
|
|
2168
2167
|
onTileActivate: t,
|
|
2169
2168
|
maxVisible: n = 4,
|
|
@@ -2234,7 +2233,7 @@ const ir = ({
|
|
|
2234
2233
|
}
|
|
2235
2234
|
);
|
|
2236
2235
|
}, Le = (e) => {
|
|
2237
|
-
const [t, n] =
|
|
2236
|
+
const [t, n] = B(!1), [a, r] = B(0), i = J(
|
|
2238
2237
|
(l) => {
|
|
2239
2238
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), n(!0));
|
|
2240
2239
|
},
|
|
@@ -2260,7 +2259,7 @@ const ir = ({
|
|
|
2260
2259
|
src: e,
|
|
2261
2260
|
alt: t,
|
|
2262
2261
|
items: n
|
|
2263
|
-
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [],
|
|
2262
|
+
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Cs = (e, t) => e.map((n, a) => ({
|
|
2264
2263
|
src: n.src,
|
|
2265
2264
|
alt: n.alt,
|
|
2266
2265
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
@@ -2291,16 +2290,16 @@ const ir = ({
|
|
|
2291
2290
|
),
|
|
2292
2291
|
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
|
|
2293
2292
|
/* @__PURE__ */ s(
|
|
2294
|
-
|
|
2293
|
+
ys,
|
|
2295
2294
|
{
|
|
2296
2295
|
open: o,
|
|
2297
|
-
items:
|
|
2296
|
+
items: Cs([{ src: e, alt: t }], n),
|
|
2298
2297
|
initialIndex: l,
|
|
2299
2298
|
onClose: m
|
|
2300
2299
|
}
|
|
2301
2300
|
)
|
|
2302
2301
|
] });
|
|
2303
|
-
},
|
|
2302
|
+
}, Ss = ({
|
|
2304
2303
|
state: e,
|
|
2305
2304
|
src: t,
|
|
2306
2305
|
alt: n,
|
|
@@ -2327,12 +2326,12 @@ const ir = ({
|
|
|
2327
2326
|
groupPosition: o,
|
|
2328
2327
|
"data-testid": "image-attachment",
|
|
2329
2328
|
children: [
|
|
2330
|
-
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
|
|
2329
|
+
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(ks, { tiles: v, onTileActivate: c }) }),
|
|
2331
2330
|
/* @__PURE__ */ s(
|
|
2332
|
-
|
|
2331
|
+
ys,
|
|
2333
2332
|
{
|
|
2334
2333
|
open: h,
|
|
2335
|
-
items:
|
|
2334
|
+
items: Cs(m, a),
|
|
2336
2335
|
initialIndex: g,
|
|
2337
2336
|
onClose: b
|
|
2338
2337
|
}
|
|
@@ -2340,7 +2339,7 @@ const ir = ({
|
|
|
2340
2339
|
]
|
|
2341
2340
|
}
|
|
2342
2341
|
);
|
|
2343
|
-
}, pr = (e) => /* @__PURE__ */ s(gr, { ...e }), br = (e) => /* @__PURE__ */ s(
|
|
2342
|
+
}, pr = (e) => /* @__PURE__ */ s(gr, { ...e }), br = (e) => /* @__PURE__ */ s(Ss, { ...e, state: "sent" }), vr = (e) => /* @__PURE__ */ s(Ss, { ...e, state: "received" }), xr = {
|
|
2344
2343
|
Composer: pr,
|
|
2345
2344
|
Sent: br,
|
|
2346
2345
|
Received: vr
|
|
@@ -2410,7 +2409,7 @@ const ir = ({
|
|
|
2410
2409
|
}) => {
|
|
2411
2410
|
const i = t.filename ?? ie(t.src);
|
|
2412
2411
|
return /* @__PURE__ */ s(
|
|
2413
|
-
|
|
2412
|
+
ws,
|
|
2414
2413
|
{
|
|
2415
2414
|
variant: e,
|
|
2416
2415
|
filename: i,
|
|
@@ -2453,7 +2452,7 @@ const ir = ({
|
|
|
2453
2452
|
children: [
|
|
2454
2453
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((_, w) => {
|
|
2455
2454
|
const k = _.filename ?? ie(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2456
|
-
|
|
2455
|
+
Ns,
|
|
2457
2456
|
{
|
|
2458
2457
|
url: _.src,
|
|
2459
2458
|
filename: k,
|
|
@@ -2490,7 +2489,7 @@ const ir = ({
|
|
|
2490
2489
|
Composer: kr,
|
|
2491
2490
|
Sent: Cr,
|
|
2492
2491
|
Received: Sr
|
|
2493
|
-
},
|
|
2492
|
+
}, Es = ({
|
|
2494
2493
|
open: e,
|
|
2495
2494
|
items: t,
|
|
2496
2495
|
initialIndex: n = 0,
|
|
@@ -2540,7 +2539,7 @@ const ir = ({
|
|
|
2540
2539
|
]
|
|
2541
2540
|
}
|
|
2542
2541
|
) : null;
|
|
2543
|
-
}, Ir = () => /* @__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 }) }) }),
|
|
2542
|
+
}, Ir = () => /* @__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 = ({
|
|
2544
2543
|
item: e,
|
|
2545
2544
|
index: t
|
|
2546
2545
|
}) => /* @__PURE__ */ u("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2555,7 +2554,7 @@ const ir = ({
|
|
|
2555
2554
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2556
2555
|
}
|
|
2557
2556
|
) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
2558
|
-
|
|
2557
|
+
os,
|
|
2559
2558
|
{
|
|
2560
2559
|
className: "size-16 rounded-md text-white/30",
|
|
2561
2560
|
weight: "regular",
|
|
@@ -2565,14 +2564,14 @@ const ir = ({
|
|
|
2565
2564
|
/* @__PURE__ */ s(Ir, {})
|
|
2566
2565
|
] }), Tr = (e, t, n) => ({
|
|
2567
2566
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2568
|
-
content: /* @__PURE__ */ s(
|
|
2567
|
+
content: /* @__PURE__ */ s(Is, { item: e, index: t })
|
|
2569
2568
|
}), Mr = ({
|
|
2570
2569
|
src: e,
|
|
2571
2570
|
poster: t,
|
|
2572
2571
|
mimeType: n,
|
|
2573
2572
|
preload: a,
|
|
2574
2573
|
items: r
|
|
2575
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [],
|
|
2574
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Ts = (e, t) => e.map((n, a) => ({
|
|
2576
2575
|
src: n.src,
|
|
2577
2576
|
poster: n.poster,
|
|
2578
2577
|
mimeType: n.mimeType,
|
|
@@ -2590,15 +2589,15 @@ const ir = ({
|
|
|
2590
2589
|
onClick: () => m(0),
|
|
2591
2590
|
"aria-label": "Play video",
|
|
2592
2591
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2593
|
-
children: /* @__PURE__ */ s(
|
|
2592
|
+
children: /* @__PURE__ */ s(Is, { item: { src: e, poster: t, mimeType: n }, index: 0 })
|
|
2594
2593
|
}
|
|
2595
2594
|
),
|
|
2596
2595
|
o ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: o }) }) : null,
|
|
2597
2596
|
/* @__PURE__ */ s(
|
|
2598
|
-
|
|
2597
|
+
Es,
|
|
2599
2598
|
{
|
|
2600
2599
|
open: l,
|
|
2601
|
-
items:
|
|
2600
|
+
items: Ts(
|
|
2602
2601
|
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2603
2602
|
a
|
|
2604
2603
|
),
|
|
@@ -2607,7 +2606,7 @@ const ir = ({
|
|
|
2607
2606
|
}
|
|
2608
2607
|
)
|
|
2609
2608
|
] });
|
|
2610
|
-
},
|
|
2609
|
+
}, Ms = ({
|
|
2611
2610
|
state: e,
|
|
2612
2611
|
src: t,
|
|
2613
2612
|
poster: n,
|
|
@@ -2636,7 +2635,7 @@ const ir = ({
|
|
|
2636
2635
|
"data-testid": "video-attachment",
|
|
2637
2636
|
children: [
|
|
2638
2637
|
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
|
|
2639
|
-
|
|
2638
|
+
ks,
|
|
2640
2639
|
{
|
|
2641
2640
|
tiles: x,
|
|
2642
2641
|
onTileActivate: b,
|
|
@@ -2644,10 +2643,10 @@ const ir = ({
|
|
|
2644
2643
|
}
|
|
2645
2644
|
) }),
|
|
2646
2645
|
/* @__PURE__ */ s(
|
|
2647
|
-
|
|
2646
|
+
Es,
|
|
2648
2647
|
{
|
|
2649
2648
|
open: g,
|
|
2650
|
-
items:
|
|
2649
|
+
items: Ts(f, r),
|
|
2651
2650
|
initialIndex: c,
|
|
2652
2651
|
onClose: v
|
|
2653
2652
|
}
|
|
@@ -2655,7 +2654,7 @@ const ir = ({
|
|
|
2655
2654
|
]
|
|
2656
2655
|
}
|
|
2657
2656
|
);
|
|
2658
|
-
}, Rr = (e) => /* @__PURE__ */ s(Ar, { ...e }), Lr = (e) => /* @__PURE__ */ s(
|
|
2657
|
+
}, Rr = (e) => /* @__PURE__ */ s(Ar, { ...e }), Lr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "sent" }), Dr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "received" }), zr = {
|
|
2659
2658
|
Composer: Rr,
|
|
2660
2659
|
Sent: Lr,
|
|
2661
2660
|
Received: Dr
|
|
@@ -2669,17 +2668,17 @@ const ir = ({
|
|
|
2669
2668
|
isUnlocking: () => !1
|
|
2670
2669
|
}, Pr = {
|
|
2671
2670
|
LockedAttachment: Fr
|
|
2672
|
-
},
|
|
2671
|
+
}, As = ct({}), gl = As.Provider;
|
|
2673
2672
|
function Or(e) {
|
|
2674
|
-
return Te(
|
|
2673
|
+
return Te(As)[e] ?? Pr[e];
|
|
2675
2674
|
}
|
|
2676
|
-
const $r = V.lazy(() => import("./Card-qS17qnN0.js")),
|
|
2675
|
+
const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import("./Card-CKM_PULl.js")), Br = () => /* @__PURE__ */ s(
|
|
2677
2676
|
"div",
|
|
2678
2677
|
{
|
|
2679
2678
|
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)]",
|
|
2680
2679
|
"aria-hidden": !0
|
|
2681
2680
|
}
|
|
2682
|
-
), Pe = (e) => /* @__PURE__ */ s(
|
|
2681
|
+
), Pe = (e) => /* @__PURE__ */ s(Gs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s($r, { ...e }) : /* @__PURE__ */ s(Ur, { ...e }) }), jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2683
2682
|
"svg",
|
|
2684
2683
|
{
|
|
2685
2684
|
width: e,
|
|
@@ -2702,7 +2701,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2702
2701
|
}, Gr = (e) => {
|
|
2703
2702
|
var t;
|
|
2704
2703
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2705
|
-
},
|
|
2704
|
+
}, Ue = (e) => {
|
|
2706
2705
|
var t;
|
|
2707
2706
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2708
2707
|
}, yt = (e) => {
|
|
@@ -2714,9 +2713,9 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2714
2713
|
}, Yr = (e) => {
|
|
2715
2714
|
var t;
|
|
2716
2715
|
return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
|
|
2717
|
-
},
|
|
2716
|
+
}, Rs = (e) => Vr(e) || Gr(e), qr = (e) => {
|
|
2718
2717
|
var t;
|
|
2719
|
-
return
|
|
2718
|
+
return Rs(e) && !((t = e.text) != null && t.trim());
|
|
2720
2719
|
}, Qe = ({
|
|
2721
2720
|
message: e,
|
|
2722
2721
|
standalone: t = !1,
|
|
@@ -2724,7 +2723,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2724
2723
|
hasAttachment: a = !1
|
|
2725
2724
|
}) => {
|
|
2726
2725
|
var h;
|
|
2727
|
-
const r =
|
|
2726
|
+
const r = Rs(e), i = Ue(e);
|
|
2728
2727
|
if (!r && !i)
|
|
2729
2728
|
return null;
|
|
2730
2729
|
if (r) {
|
|
@@ -2732,7 +2731,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2732
2731
|
if (!g) return null;
|
|
2733
2732
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${g} tip` : `Delivered with ${g} tip`;
|
|
2734
2733
|
return /* @__PURE__ */ u("div", { className: c, children: [
|
|
2735
|
-
/* @__PURE__ */ s(
|
|
2734
|
+
/* @__PURE__ */ s(qn, { size: t ? 14 : 12 }),
|
|
2736
2735
|
/* @__PURE__ */ s("span", { children: b })
|
|
2737
2736
|
] });
|
|
2738
2737
|
}
|
|
@@ -2764,7 +2763,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2764
2763
|
"aria-label": "Good response",
|
|
2765
2764
|
"aria-pressed": e === "up",
|
|
2766
2765
|
"data-tooltip": "Good response",
|
|
2767
|
-
children: /* @__PURE__ */ s(
|
|
2766
|
+
children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2768
2767
|
}
|
|
2769
2768
|
),
|
|
2770
2769
|
/* @__PURE__ */ s(
|
|
@@ -2778,7 +2777,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2778
2777
|
"aria-label": "Bad response",
|
|
2779
2778
|
"aria-pressed": e === "down",
|
|
2780
2779
|
"data-tooltip": "Bad response",
|
|
2781
|
-
children: /* @__PURE__ */ s(
|
|
2780
|
+
children: /* @__PURE__ */ s(Xn, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2782
2781
|
}
|
|
2783
2782
|
)
|
|
2784
2783
|
] }), et = () => {
|
|
@@ -2791,11 +2790,11 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
|
|
|
2791
2790
|
}
|
|
2792
2791
|
})();
|
|
2793
2792
|
return e.id !== n ? null : /* @__PURE__ */ u(se, { children: [
|
|
2794
|
-
/* @__PURE__ */ s(
|
|
2793
|
+
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2795
2794
|
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2796
2795
|
] });
|
|
2797
2796
|
}, Xr = () => null, Kr = () => /* @__PURE__ */ s(
|
|
2798
|
-
|
|
2797
|
+
Xs,
|
|
2799
2798
|
{
|
|
2800
2799
|
MessageSentStatus: et,
|
|
2801
2800
|
MessageDeliveredStatus: et,
|
|
@@ -2895,7 +2894,7 @@ const Qr = {
|
|
|
2895
2894
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2896
2895
|
"border border-black/[0.08]",
|
|
2897
2896
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2898
|
-
),
|
|
2897
|
+
), Be = ({
|
|
2899
2898
|
variant: e,
|
|
2900
2899
|
children: t,
|
|
2901
2900
|
href: n,
|
|
@@ -3059,10 +3058,10 @@ const Qr = {
|
|
|
3059
3058
|
onClick: h,
|
|
3060
3059
|
"aria-label": "Edit attachment",
|
|
3061
3060
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3062
|
-
children: /* @__PURE__ */ s(
|
|
3061
|
+
children: /* @__PURE__ */ s(Zn, { className: "size-5", weight: "regular" })
|
|
3063
3062
|
}
|
|
3064
3063
|
) : void 0;
|
|
3065
|
-
return c ? /* @__PURE__ */ s(
|
|
3064
|
+
return c ? /* @__PURE__ */ s(Be, { variant: "dark", bgClassName: Et, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3066
3065
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3067
3066
|
je,
|
|
3068
3067
|
{
|
|
@@ -3074,7 +3073,7 @@ const Qr = {
|
|
|
3074
3073
|
) }),
|
|
3075
3074
|
b && /* @__PURE__ */ s("div", { className: "shrink-0", children: b })
|
|
3076
3075
|
] }) }) : /* @__PURE__ */ u(
|
|
3077
|
-
|
|
3076
|
+
Be,
|
|
3078
3077
|
{
|
|
3079
3078
|
variant: "dark",
|
|
3080
3079
|
topRight: g ? b : void 0,
|
|
@@ -3126,7 +3125,7 @@ const Qr = {
|
|
|
3126
3125
|
}
|
|
3127
3126
|
} : d;
|
|
3128
3127
|
return /* @__PURE__ */ u(
|
|
3129
|
-
|
|
3128
|
+
Be,
|
|
3130
3129
|
{
|
|
3131
3130
|
variant: "light",
|
|
3132
3131
|
href: g,
|
|
@@ -3174,7 +3173,7 @@ const Qr = {
|
|
|
3174
3173
|
}) => {
|
|
3175
3174
|
const h = St(r, o), g = kt(a), c = m == null && g != null && !h ? g : void 0, b = m == null && !h && c != null ? f : void 0;
|
|
3176
3175
|
return /* @__PURE__ */ u(
|
|
3177
|
-
|
|
3176
|
+
Be,
|
|
3178
3177
|
{
|
|
3179
3178
|
variant: "dark",
|
|
3180
3179
|
href: c,
|
|
@@ -3206,7 +3205,7 @@ const Qr = {
|
|
|
3206
3205
|
]
|
|
3207
3206
|
}
|
|
3208
3207
|
);
|
|
3209
|
-
},
|
|
3208
|
+
}, Jt = {
|
|
3210
3209
|
Composer: li,
|
|
3211
3210
|
Sent: ci,
|
|
3212
3211
|
Received: oi
|
|
@@ -3215,13 +3214,13 @@ function z(e) {
|
|
|
3215
3214
|
const t = e == null ? void 0 : e.trim();
|
|
3216
3215
|
return t || void 0;
|
|
3217
3216
|
}
|
|
3218
|
-
function
|
|
3217
|
+
function Qt(e) {
|
|
3219
3218
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3220
3219
|
}
|
|
3221
3220
|
function di(e, t) {
|
|
3222
3221
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3223
3222
|
return !1;
|
|
3224
|
-
const n =
|
|
3223
|
+
const n = Qt(e), a = Qt(t);
|
|
3225
3224
|
if (n === a)
|
|
3226
3225
|
return !0;
|
|
3227
3226
|
if (!n.includes(a))
|
|
@@ -3229,7 +3228,7 @@ function di(e, t) {
|
|
|
3229
3228
|
const r = n.split(a).join("");
|
|
3230
3229
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3231
3230
|
}
|
|
3232
|
-
function
|
|
3231
|
+
function es(e) {
|
|
3233
3232
|
const t = z(e.og_scrape_url) ?? z(e.title_link), n = z(e.image_url) ?? z(e.thumb_url), a = z(e.asset_url), r = z(e.mime_type);
|
|
3234
3233
|
return {
|
|
3235
3234
|
title: z(e.title),
|
|
@@ -3245,13 +3244,13 @@ function Qt(e) {
|
|
|
3245
3244
|
}
|
|
3246
3245
|
function ui(e) {
|
|
3247
3246
|
var t;
|
|
3248
|
-
return
|
|
3247
|
+
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;
|
|
3249
3248
|
}
|
|
3250
|
-
function
|
|
3249
|
+
function Ls(e) {
|
|
3251
3250
|
const t = z(e.og_scrape_url);
|
|
3252
3251
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3253
3252
|
}
|
|
3254
|
-
function
|
|
3253
|
+
function Ds(e) {
|
|
3255
3254
|
if (!(e != null && e.length)) return [];
|
|
3256
3255
|
const t = [], n = (r, i) => {
|
|
3257
3256
|
const o = t[t.length - 1];
|
|
@@ -3269,7 +3268,7 @@ function Ls(e) {
|
|
|
3269
3268
|
t.push({ type: "link", attachments: [r] });
|
|
3270
3269
|
};
|
|
3271
3270
|
for (const r of e) {
|
|
3272
|
-
if (
|
|
3271
|
+
if (Ls(r)) {
|
|
3273
3272
|
a(r);
|
|
3274
3273
|
continue;
|
|
3275
3274
|
}
|
|
@@ -3284,7 +3283,7 @@ function mi(e) {
|
|
|
3284
3283
|
function hi(e, t, n) {
|
|
3285
3284
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3286
3285
|
}
|
|
3287
|
-
function
|
|
3286
|
+
function ts(e) {
|
|
3288
3287
|
return z(e.image_url) ?? z(e.asset_url) ?? "";
|
|
3289
3288
|
}
|
|
3290
3289
|
function fi(e) {
|
|
@@ -3307,7 +3306,7 @@ function gi(e, t) {
|
|
|
3307
3306
|
case "image":
|
|
3308
3307
|
return {
|
|
3309
3308
|
items: t.map((a) => ({
|
|
3310
|
-
src:
|
|
3309
|
+
src: ts(a),
|
|
3311
3310
|
alt: z(a.title)
|
|
3312
3311
|
}))
|
|
3313
3312
|
};
|
|
@@ -3358,7 +3357,7 @@ function gi(e, t) {
|
|
|
3358
3357
|
switch (e) {
|
|
3359
3358
|
case "image":
|
|
3360
3359
|
return {
|
|
3361
|
-
src:
|
|
3360
|
+
src: ts(n),
|
|
3362
3361
|
alt: z(n.title)
|
|
3363
3362
|
};
|
|
3364
3363
|
case "video":
|
|
@@ -3406,14 +3405,14 @@ const bi = ({
|
|
|
3406
3405
|
renderText: a
|
|
3407
3406
|
}) => {
|
|
3408
3407
|
var b;
|
|
3409
|
-
const r =
|
|
3408
|
+
const r = Ds(n.attachments);
|
|
3410
3409
|
if (r.length === 0) return null;
|
|
3411
|
-
const i = mi(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" ?
|
|
3410
|
+
const i = mi(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 && di(o, d) ? void 0 : o;
|
|
3412
3411
|
let f = 0;
|
|
3413
3412
|
const h = [], g = (v, x) => {
|
|
3414
|
-
const p = t ?
|
|
3413
|
+
const p = t ? Jt.Sent : Jt.Received;
|
|
3415
3414
|
h.push(
|
|
3416
|
-
/* @__PURE__ */ s(p, { ...
|
|
3415
|
+
/* @__PURE__ */ s(p, { ...es(v) }, x)
|
|
3417
3416
|
);
|
|
3418
3417
|
}, c = (v, x) => {
|
|
3419
3418
|
const p = hi(
|
|
@@ -3471,7 +3470,7 @@ const bi = ({
|
|
|
3471
3470
|
] }) : null
|
|
3472
3471
|
] });
|
|
3473
3472
|
}, vi = (e) => {
|
|
3474
|
-
var Dt, zt, Ft, Pt, Ot, $t,
|
|
3473
|
+
var Dt, zt, Ft, Pt, Ot, $t, Ut, Bt, jt, Vt;
|
|
3475
3474
|
const {
|
|
3476
3475
|
additionalMessageInputProps: t,
|
|
3477
3476
|
chatbotVotingEnabled: n,
|
|
@@ -3489,50 +3488,50 @@ const bi = ({
|
|
|
3489
3488
|
renderText: b,
|
|
3490
3489
|
threadList: v,
|
|
3491
3490
|
viewerLanguage: x
|
|
3492
|
-
} = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: k, onFetchSource: D, onDownloadClick: S } = Or("LockedAttachment"), [R, O] =
|
|
3493
|
-
Attachment: I =
|
|
3494
|
-
EditMessageModal: T =
|
|
3491
|
+
} = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: k, onFetchSource: D, onDownloadClick: S } = Or("LockedAttachment"), [R, O] = B(!1), F = Zs(c.id), { selected: L, voteUp: C, voteDown: E } = xa(c), {
|
|
3492
|
+
Attachment: I = Js,
|
|
3493
|
+
EditMessageModal: T = Qs,
|
|
3495
3494
|
MessageActions: M,
|
|
3496
|
-
MessageBlocked: P =
|
|
3497
|
-
MessageBouncePrompt: $ =
|
|
3498
|
-
MessageDeleted: j =
|
|
3499
|
-
MessageIsThreadReplyInChannelButtonIndicator: Q =
|
|
3500
|
-
MessageRepliesCountButton: ee =
|
|
3501
|
-
ReminderNotification: X =
|
|
3502
|
-
StreamedMessageText: N =
|
|
3495
|
+
MessageBlocked: P = en,
|
|
3496
|
+
MessageBouncePrompt: $ = tn,
|
|
3497
|
+
MessageDeleted: j = sn,
|
|
3498
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = nn,
|
|
3499
|
+
MessageRepliesCountButton: ee = an,
|
|
3500
|
+
ReminderNotification: X = rn,
|
|
3501
|
+
StreamedMessageText: N = ln,
|
|
3503
3502
|
PinIndicator: A
|
|
3504
|
-
} =
|
|
3503
|
+
} = rs("CustomMessage"), H = on(c), q = cn(c), Y = re(
|
|
3505
3504
|
() => h == null ? void 0 : h(c),
|
|
3506
3505
|
[h, c]
|
|
3507
|
-
),
|
|
3506
|
+
), U = re(() => {
|
|
3508
3507
|
const me = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...me] : me;
|
|
3509
|
-
if (!
|
|
3510
|
-
const Gt = be.filter((Ht) => !("type" in Ht) || !
|
|
3508
|
+
if (!Ue(c)) return be;
|
|
3509
|
+
const Gt = be.filter((Ht) => !("type" in Ht) || !bs(Ht));
|
|
3511
3510
|
return Gt.length === be.length ? be : Gt;
|
|
3512
3511
|
}, [c]), W = re(
|
|
3513
|
-
() =>
|
|
3514
|
-
[
|
|
3512
|
+
() => Ds(U),
|
|
3513
|
+
[U]
|
|
3515
3514
|
), Z = re(() => {
|
|
3516
|
-
const me =
|
|
3515
|
+
const me = ms({ message: c, viewerLanguage: x });
|
|
3517
3516
|
return me === c.text ? c : { ...c, text: me };
|
|
3518
3517
|
}, [c, x]), de = W.length > 0, De = W.reduce(
|
|
3519
3518
|
(me, be) => me + be.attachments.length,
|
|
3520
3519
|
0
|
|
3521
|
-
) === ((
|
|
3520
|
+
) === ((U == null ? void 0 : U.length) ?? 0), ze = Ya({
|
|
3522
3521
|
endOfGroup: r,
|
|
3523
3522
|
firstOfGroup: i,
|
|
3524
3523
|
groupedByUser: o
|
|
3525
3524
|
});
|
|
3526
|
-
if (
|
|
3525
|
+
if (dn(c))
|
|
3527
3526
|
return null;
|
|
3528
3527
|
if (c.deleted_at || c.type === "deleted")
|
|
3529
3528
|
return /* @__PURE__ */ s(j, { message: c });
|
|
3530
|
-
if (
|
|
3529
|
+
if (un(c))
|
|
3531
3530
|
return /* @__PURE__ */ s(P, {});
|
|
3532
|
-
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 =
|
|
3531
|
+
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);
|
|
3533
3532
|
let ge;
|
|
3534
3533
|
le ? ge = () => m(c) : Tt && (ge = () => O(!0));
|
|
3535
|
-
const te = g(),
|
|
3534
|
+
const te = g(), Us = y(
|
|
3536
3535
|
"str-chat__message str-chat__message-simple",
|
|
3537
3536
|
`str-chat__message--${c.type}`,
|
|
3538
3537
|
`str-chat__message--${c.status}`,
|
|
@@ -3549,7 +3548,7 @@ const bi = ({
|
|
|
3549
3548
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3550
3549
|
"str-chat__virtual-message__wrapper--group": o
|
|
3551
3550
|
}
|
|
3552
|
-
), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(c), pe =
|
|
3551
|
+
), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(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 = {
|
|
3553
3552
|
contentType: "text",
|
|
3554
3553
|
amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
|
|
3555
3554
|
paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
|
|
@@ -3558,8 +3557,8 @@ const bi = ({
|
|
|
3558
3557
|
contentType: "media",
|
|
3559
3558
|
title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
|
|
3560
3559
|
mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
|
|
3561
|
-
thumbnailUrl: (
|
|
3562
|
-
amountText: (
|
|
3560
|
+
thumbnailUrl: (Ut = c.metadata) == null ? void 0 : Ut.attachment_thumbnail,
|
|
3561
|
+
amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
|
|
3563
3562
|
detail: (jt = c.metadata) == null ? void 0 : jt.attachment_detail,
|
|
3564
3563
|
paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
|
|
3565
3564
|
onFetchSource: D ? () => D(c, _) : void 0
|
|
@@ -3572,7 +3571,7 @@ const bi = ({
|
|
|
3572
3571
|
}
|
|
3573
3572
|
),
|
|
3574
3573
|
R && /* @__PURE__ */ s(
|
|
3575
|
-
|
|
3574
|
+
hn,
|
|
3576
3575
|
{
|
|
3577
3576
|
MessageBouncePrompt: $,
|
|
3578
3577
|
onClose: () => O(!1),
|
|
@@ -3582,7 +3581,7 @@ const bi = ({
|
|
|
3582
3581
|
/* @__PURE__ */ u(
|
|
3583
3582
|
"div",
|
|
3584
3583
|
{
|
|
3585
|
-
className:
|
|
3584
|
+
className: Us,
|
|
3586
3585
|
"data-message-id": c.id,
|
|
3587
3586
|
"data-dd-privacy": "mask",
|
|
3588
3587
|
children: [
|
|
@@ -3664,14 +3663,14 @@ const bi = ({
|
|
|
3664
3663
|
renderText: b
|
|
3665
3664
|
}
|
|
3666
3665
|
) })
|
|
3667
|
-
] }) :
|
|
3666
|
+
] }) : js ? /* @__PURE__ */ s(
|
|
3668
3667
|
bi,
|
|
3669
3668
|
{
|
|
3670
3669
|
groupPosition: ze,
|
|
3671
3670
|
isMyMessage: te,
|
|
3672
3671
|
message: {
|
|
3673
3672
|
...Z,
|
|
3674
|
-
attachments:
|
|
3673
|
+
attachments: U,
|
|
3675
3674
|
// MessageText prefers message.i18n[userLanguage_text] from
|
|
3676
3675
|
// Stream's TranslationContext over message.text. Drop i18n so
|
|
3677
3676
|
// the caption uses displayMessage.text from viewerLanguage.
|
|
@@ -3688,12 +3687,12 @@ const bi = ({
|
|
|
3688
3687
|
isMyMessage: te
|
|
3689
3688
|
}
|
|
3690
3689
|
),
|
|
3691
|
-
qe && /* @__PURE__ */ s(
|
|
3692
|
-
|
|
3690
|
+
qe && /* @__PURE__ */ s(fn, { poll: qe }),
|
|
3691
|
+
U != null && U.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3693
3692
|
I,
|
|
3694
3693
|
{
|
|
3695
3694
|
actionHandler: l,
|
|
3696
|
-
attachments:
|
|
3695
|
+
attachments: U
|
|
3697
3696
|
}
|
|
3698
3697
|
) : null,
|
|
3699
3698
|
Y ? /* @__PURE__ */ s(
|
|
@@ -3747,7 +3746,7 @@ const bi = ({
|
|
|
3747
3746
|
] });
|
|
3748
3747
|
}, xi = V.memo(
|
|
3749
3748
|
vi,
|
|
3750
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
3749
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ks(e, t)
|
|
3751
3750
|
), wi = (e) => {
|
|
3752
3751
|
const t = Ne("CustomMessage");
|
|
3753
3752
|
return /* @__PURE__ */ s(xi, { ...t, ...e });
|
|
@@ -3755,32 +3754,32 @@ const bi = ({
|
|
|
3755
3754
|
var n;
|
|
3756
3755
|
const { handleDelete: e, message: t } = Ne("CustomMessageActions");
|
|
3757
3756
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
3758
|
-
|
|
3757
|
+
cs,
|
|
3759
3758
|
{
|
|
3760
3759
|
onClick: e,
|
|
3761
3760
|
"aria-label": "Delete",
|
|
3762
3761
|
title: "Delete",
|
|
3763
3762
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3764
|
-
children: /* @__PURE__ */ s(
|
|
3763
|
+
children: /* @__PURE__ */ s(Jn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3765
3764
|
}
|
|
3766
3765
|
);
|
|
3767
3766
|
}, Ni = () => {
|
|
3768
3767
|
const { handleFlag: e } = Ne("CustomMessageActions");
|
|
3769
3768
|
return /* @__PURE__ */ s(
|
|
3770
|
-
|
|
3769
|
+
cs,
|
|
3771
3770
|
{
|
|
3772
3771
|
onClick: e,
|
|
3773
3772
|
"aria-label": "Report",
|
|
3774
3773
|
title: "Report",
|
|
3775
3774
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3776
|
-
children: /* @__PURE__ */ s(
|
|
3775
|
+
children: /* @__PURE__ */ s(is, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3777
3776
|
}
|
|
3778
3777
|
);
|
|
3779
3778
|
}, yi = () => {
|
|
3780
3779
|
var t;
|
|
3781
3780
|
const { message: e } = Ne("CustomMessageActions");
|
|
3782
3781
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3783
|
-
|
|
3782
|
+
ta,
|
|
3784
3783
|
{
|
|
3785
3784
|
messageActionSet: [
|
|
3786
3785
|
{ Component: _i, placement: "quick", type: "delete" },
|
|
@@ -3833,7 +3832,7 @@ const bi = ({
|
|
|
3833
3832
|
(t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
|
|
3834
3833
|
)
|
|
3835
3834
|
}), Si = () => {
|
|
3836
|
-
const { linkPreviewsManager: e } =
|
|
3835
|
+
const { linkPreviewsManager: e } = gn(), { linkPreviews: t } = pn(
|
|
3837
3836
|
e.state,
|
|
3838
3837
|
Ci
|
|
3839
3838
|
), n = (r) => {
|
|
@@ -3858,13 +3857,13 @@ const bi = ({
|
|
|
3858
3857
|
"aria-label": "Send",
|
|
3859
3858
|
disabled: t,
|
|
3860
3859
|
onClick: e,
|
|
3861
|
-
children: /* @__PURE__ */ s(
|
|
3860
|
+
children: /* @__PURE__ */ s(Qn, { weight: "bold", className: "size-4" })
|
|
3862
3861
|
}
|
|
3863
3862
|
), Ii = () => {
|
|
3864
|
-
const e = Te(It), { handleSubmit: t } =
|
|
3863
|
+
const e = Te(It), { handleSubmit: t } = vn(), n = xn(), a = e || !n, {
|
|
3865
3864
|
SendButton: r = Ei,
|
|
3866
|
-
AttachmentPreviewList: i =
|
|
3867
|
-
} =
|
|
3865
|
+
AttachmentPreviewList: i = wn
|
|
3866
|
+
} = rs("CustomMessageInput");
|
|
3868
3867
|
return (
|
|
3869
3868
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3870
3869
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3880,12 +3879,12 @@ const bi = ({
|
|
|
3880
3879
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
3881
3880
|
"data-dd-privacy": "mask",
|
|
3882
3881
|
children: [
|
|
3883
|
-
/* @__PURE__ */ s(
|
|
3882
|
+
/* @__PURE__ */ s(_n, {}),
|
|
3884
3883
|
/* @__PURE__ */ s(Si, {}),
|
|
3885
3884
|
/* @__PURE__ */ s(i, {}),
|
|
3886
3885
|
/* @__PURE__ */ u("div", { className: "flex shrink-0", children: [
|
|
3887
3886
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
3888
|
-
|
|
3887
|
+
Nn,
|
|
3889
3888
|
{
|
|
3890
3889
|
"aria-disabled": e || void 0,
|
|
3891
3890
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3933,7 +3932,7 @@ const bi = ({
|
|
|
3933
3932
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3934
3933
|
children: [
|
|
3935
3934
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3936
|
-
/* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(
|
|
3935
|
+
/* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(bn, { Input: r ?? Ii }) })
|
|
3937
3936
|
]
|
|
3938
3937
|
}
|
|
3939
3938
|
),
|
|
@@ -3949,10 +3948,10 @@ const bi = ({
|
|
|
3949
3948
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3950
3949
|
], Li = {
|
|
3951
3950
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3952
|
-
}, tt = "age safety guidelines.", Di = "https://linktr.ee/s/about/contact",
|
|
3951
|
+
}, tt = "age safety guidelines.", Di = "https://linktr.ee/s/about/contact", ss = (e) => Mi.includes(e), zi = (e) => Ri.includes(e), Fi = (e) => {
|
|
3953
3952
|
var a;
|
|
3954
3953
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3955
|
-
if (
|
|
3954
|
+
if (ss(t))
|
|
3956
3955
|
return {
|
|
3957
3956
|
kind: "dm-agent",
|
|
3958
3957
|
type: t
|
|
@@ -3963,7 +3962,7 @@ const bi = ({
|
|
|
3963
3962
|
type: t
|
|
3964
3963
|
};
|
|
3965
3964
|
const n = e.dm_agent_system_type;
|
|
3966
|
-
if (
|
|
3965
|
+
if (ss(n))
|
|
3967
3966
|
return {
|
|
3968
3967
|
kind: "dm-agent",
|
|
3969
3968
|
type: n
|
|
@@ -4029,7 +4028,7 @@ const bi = ({
|
|
|
4029
4028
|
"data-age-safety-system-type": n.type,
|
|
4030
4029
|
children: [
|
|
4031
4030
|
/* @__PURE__ */ s(
|
|
4032
|
-
|
|
4031
|
+
ea,
|
|
4033
4032
|
{
|
|
4034
4033
|
size: 24,
|
|
4035
4034
|
weight: "duotone",
|
|
@@ -4053,7 +4052,7 @@ const bi = ({
|
|
|
4053
4052
|
] }),
|
|
4054
4053
|
!t && /* @__PURE__ */ s(Xe, { message: e.message })
|
|
4055
4054
|
] });
|
|
4056
|
-
},
|
|
4055
|
+
}, zs = ct(!1), st = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
|
|
4057
4056
|
"animateTransform",
|
|
4058
4057
|
{
|
|
4059
4058
|
attributeName: "transform",
|
|
@@ -4067,13 +4066,13 @@ const bi = ({
|
|
|
4067
4066
|
Ke.Thinking,
|
|
4068
4067
|
Ke.Generating,
|
|
4069
4068
|
Ke.ExternalSources
|
|
4070
|
-
]),
|
|
4069
|
+
]), Ui = ({ threadList: e }) => {
|
|
4071
4070
|
var b, v;
|
|
4072
|
-
const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } =
|
|
4071
|
+
const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = yn(), { aiState: o } = kn(t), l = Te(zs);
|
|
4073
4072
|
if (!e && l && $i.has(o)) {
|
|
4074
|
-
const x =
|
|
4073
|
+
const x = Bi(t, (b = r.user) == null ? void 0 : b.id);
|
|
4075
4074
|
return /* @__PURE__ */ s(
|
|
4076
|
-
|
|
4075
|
+
ns,
|
|
4077
4076
|
{
|
|
4078
4077
|
avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
|
|
4079
4078
|
avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
|
|
@@ -4099,7 +4098,7 @@ const bi = ({
|
|
|
4099
4098
|
return null;
|
|
4100
4099
|
const g = (v = h[0]) == null ? void 0 : v.user, c = g != null && g.id && t.state.members[g.id] ? t.state.members[g.id].user : void 0;
|
|
4101
4100
|
return /* @__PURE__ */ s(
|
|
4102
|
-
|
|
4101
|
+
ns,
|
|
4103
4102
|
{
|
|
4104
4103
|
avatarId: (g == null ? void 0 : g.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
4105
4104
|
avatarName: (g == null ? void 0 : g.name) ?? (c == null ? void 0 : c.name) ?? (g == null ? void 0 : g.id) ?? "Typing user",
|
|
@@ -4107,7 +4106,7 @@ const bi = ({
|
|
|
4107
4106
|
testId: "typing-indicator"
|
|
4108
4107
|
}
|
|
4109
4108
|
);
|
|
4110
|
-
},
|
|
4109
|
+
}, ns = ({
|
|
4111
4110
|
avatarId: e,
|
|
4112
4111
|
avatarName: t,
|
|
4113
4112
|
avatarImage: n,
|
|
@@ -4151,7 +4150,7 @@ const bi = ({
|
|
|
4151
4150
|
] })
|
|
4152
4151
|
}
|
|
4153
4152
|
);
|
|
4154
|
-
function
|
|
4153
|
+
function Bi(e, t) {
|
|
4155
4154
|
var a;
|
|
4156
4155
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4157
4156
|
for (const r of Object.values(n)) {
|
|
@@ -4544,7 +4543,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4544
4543
|
}, [E == null ? void 0 : E.userID, (A = C.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 = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), $ = S && M === !1 && P === !0, j = C.state.messages.some(
|
|
4545
4544
|
(Y) => Y.type !== "deleted"
|
|
4546
4545
|
), Q = p ? /* @__PURE__ */ s(V.Fragment, { children: p() }, "lt-channel-banner") : null, ee = F ? /* @__PURE__ */ s(
|
|
4547
|
-
|
|
4546
|
+
pa,
|
|
4548
4547
|
{
|
|
4549
4548
|
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%)]",
|
|
4550
4549
|
onBack: e,
|
|
@@ -4566,7 +4565,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4566
4565
|
}
|
|
4567
4566
|
) : null, X = J(
|
|
4568
4567
|
(Y) => {
|
|
4569
|
-
const { message:
|
|
4568
|
+
const { message: U } = Ne("ChannelView"), W = /* @__PURE__ */ s(
|
|
4570
4569
|
wi,
|
|
4571
4570
|
{
|
|
4572
4571
|
...Y,
|
|
@@ -4574,19 +4573,19 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4574
4573
|
viewerLanguage: R
|
|
4575
4574
|
}
|
|
4576
4575
|
);
|
|
4577
|
-
return !D || !
|
|
4576
|
+
return !D || !U ? W : D(W, U);
|
|
4578
4577
|
},
|
|
4579
4578
|
[x, D, R]
|
|
4580
4579
|
);
|
|
4581
4580
|
return /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(
|
|
4582
|
-
|
|
4581
|
+
Sn,
|
|
4583
4582
|
{
|
|
4584
4583
|
overrides: {
|
|
4585
4584
|
Message: X,
|
|
4586
4585
|
MessageActions: yi,
|
|
4587
4586
|
UnreadMessagesSeparator: () => null
|
|
4588
4587
|
},
|
|
4589
|
-
children: /* @__PURE__ */ u(
|
|
4588
|
+
children: /* @__PURE__ */ u(En, { children: [
|
|
4590
4589
|
!F && /* @__PURE__ */ u(se, { children: [
|
|
4591
4590
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4592
4591
|
Gi,
|
|
@@ -4621,7 +4620,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4621
4620
|
Q
|
|
4622
4621
|
] }) }),
|
|
4623
4622
|
/* @__PURE__ */ s(
|
|
4624
|
-
|
|
4623
|
+
In,
|
|
4625
4624
|
{
|
|
4626
4625
|
head: F && j ? /* @__PURE__ */ u("div", { className: "sticky top-0 z-10", children: [
|
|
4627
4626
|
ee,
|
|
@@ -4652,7 +4651,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4652
4651
|
] })
|
|
4653
4652
|
}
|
|
4654
4653
|
) });
|
|
4655
|
-
},
|
|
4654
|
+
}, Fs = V.memo(
|
|
4656
4655
|
({
|
|
4657
4656
|
channel: e,
|
|
4658
4657
|
onBack: t,
|
|
@@ -4702,10 +4701,10 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4702
4701
|
...w
|
|
4703
4702
|
}
|
|
4704
4703
|
}
|
|
4705
|
-
},
|
|
4704
|
+
}, U = {
|
|
4706
4705
|
...A,
|
|
4707
4706
|
...q && { skip_push: !0 }
|
|
4708
|
-
}, W = await e.sendMessage(Y,
|
|
4707
|
+
}, W = await e.sendMessage(Y, U);
|
|
4709
4708
|
return k == null || k(W), W;
|
|
4710
4709
|
},
|
|
4711
4710
|
[e, _, w, k]
|
|
@@ -4717,7 +4716,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4717
4716
|
const N = (A) => {
|
|
4718
4717
|
const H = A.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4719
4718
|
if (!Y) return;
|
|
4720
|
-
const
|
|
4719
|
+
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;
|
|
4721
4720
|
E(Y, Z);
|
|
4722
4721
|
};
|
|
4723
4722
|
return X.addEventListener("click", N), () => X.removeEventListener("click", N);
|
|
@@ -4729,15 +4728,15 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4729
4728
|
"messaging-channel-view h-full flex flex-col",
|
|
4730
4729
|
d
|
|
4731
4730
|
),
|
|
4732
|
-
children: /* @__PURE__ */ s(
|
|
4733
|
-
|
|
4731
|
+
children: /* @__PURE__ */ s(zs.Provider, { value: _ ?? !1, children: /* @__PURE__ */ s(
|
|
4732
|
+
Cn,
|
|
4734
4733
|
{
|
|
4735
4734
|
channel: e,
|
|
4736
4735
|
MessageSystem: Oi,
|
|
4737
4736
|
EmptyStateIndicator: m,
|
|
4738
4737
|
LoadingIndicator: Ve,
|
|
4739
|
-
DateSeparator:
|
|
4740
|
-
TypingIndicator:
|
|
4738
|
+
DateSeparator: ba,
|
|
4739
|
+
TypingIndicator: Ui,
|
|
4741
4740
|
doSendMessageRequest: Q,
|
|
4742
4741
|
...I ? { SendButton: I } : {},
|
|
4743
4742
|
...T ? { AttachmentPreviewList: T } : {},
|
|
@@ -4780,7 +4779,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4780
4779
|
);
|
|
4781
4780
|
}
|
|
4782
4781
|
);
|
|
4783
|
-
|
|
4782
|
+
Fs.displayName = "ChannelView";
|
|
4784
4783
|
const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
|
|
4785
4784
|
/* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
4786
4785
|
/* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
@@ -4829,7 +4828,7 @@ const bl = ({
|
|
|
4829
4828
|
refreshConnection: C,
|
|
4830
4829
|
service: E,
|
|
4831
4830
|
debug: I
|
|
4832
|
-
} =
|
|
4831
|
+
} = sa(), [T, M] = B(null), [P, $] = B(null), [j, Q] = B(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
|
|
4833
4832
|
X.current = o;
|
|
4834
4833
|
const N = G(a);
|
|
4835
4834
|
N.current = a;
|
|
@@ -4838,9 +4837,9 @@ const bl = ({
|
|
|
4838
4837
|
H.current = T;
|
|
4839
4838
|
}, [T]), K(() => {
|
|
4840
4839
|
if (!R || !O) return;
|
|
4841
|
-
const
|
|
4842
|
-
if (!
|
|
4843
|
-
const W = `${
|
|
4840
|
+
const U = R.userID;
|
|
4841
|
+
if (!U) return;
|
|
4842
|
+
const W = `${U}::${i}`;
|
|
4844
4843
|
if (A.current === W) return;
|
|
4845
4844
|
A.current = W;
|
|
4846
4845
|
const Z = () => {
|
|
@@ -4856,7 +4855,7 @@ const bl = ({
|
|
|
4856
4855
|
const ae = await R.queryChannels(
|
|
4857
4856
|
{
|
|
4858
4857
|
type: "messaging",
|
|
4859
|
-
members: { $eq: [
|
|
4858
|
+
members: { $eq: [U, i] }
|
|
4860
4859
|
},
|
|
4861
4860
|
{},
|
|
4862
4861
|
{ limit: 1 }
|
|
@@ -4903,8 +4902,8 @@ const bl = ({
|
|
|
4903
4902
|
const q = G(r);
|
|
4904
4903
|
q.current = r;
|
|
4905
4904
|
const Y = J(() => {
|
|
4906
|
-
var
|
|
4907
|
-
M(null), Q(!0), (
|
|
4905
|
+
var U;
|
|
4906
|
+
M(null), Q(!0), (U = q.current) == null || U.call(q);
|
|
4908
4907
|
}, []);
|
|
4909
4908
|
return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: C }) : !O || !R ? /* @__PURE__ */ s(
|
|
4910
4909
|
Ce,
|
|
@@ -4913,7 +4912,7 @@ const bl = ({
|
|
|
4913
4912
|
onBack: C
|
|
4914
4913
|
}
|
|
4915
4914
|
) : 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(
|
|
4916
|
-
|
|
4915
|
+
Fs,
|
|
4917
4916
|
{
|
|
4918
4917
|
channel: T,
|
|
4919
4918
|
renderMessageInputActions: t,
|
|
@@ -4947,7 +4946,7 @@ function Yi(e) {
|
|
|
4947
4946
|
for (const n of t)
|
|
4948
4947
|
e.state.addMessageSorted(n.message);
|
|
4949
4948
|
}
|
|
4950
|
-
const
|
|
4949
|
+
const Ps = V.createContext({
|
|
4951
4950
|
selectedChannel: void 0,
|
|
4952
4951
|
onChannelSelect: () => {
|
|
4953
4952
|
},
|
|
@@ -4955,7 +4954,7 @@ const Fs = V.createContext({
|
|
|
4955
4954
|
renderMessagePreview: void 0,
|
|
4956
4955
|
channelPreview: void 0,
|
|
4957
4956
|
viewerLanguage: void 0
|
|
4958
|
-
}), qi =
|
|
4957
|
+
}), qi = Ps.Provider, Wi = () => V.useContext(Ps), Xi = (e, t) => {
|
|
4959
4958
|
const n = new Date(
|
|
4960
4959
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4961
4960
|
), r = new Date(
|
|
@@ -4976,7 +4975,7 @@ const Fs = V.createContext({
|
|
|
4976
4975
|
day: "numeric",
|
|
4977
4976
|
year: "2-digit"
|
|
4978
4977
|
});
|
|
4979
|
-
},
|
|
4978
|
+
}, Os = V.memo(
|
|
4980
4979
|
(e) => {
|
|
4981
4980
|
var O, F, L;
|
|
4982
4981
|
const { channel: t, unread: n } = e, {
|
|
@@ -5016,7 +5015,7 @@ const Fs = V.createContext({
|
|
|
5016
5015
|
}
|
|
5017
5016
|
})(), w = (() => {
|
|
5018
5017
|
var M;
|
|
5019
|
-
const C =
|
|
5018
|
+
const C = ms({
|
|
5020
5019
|
message: p,
|
|
5021
5020
|
viewerLanguage: d
|
|
5022
5021
|
}), { custom_type: E, attachment_content_type: I } = (p == null ? void 0 : p.metadata) || {};
|
|
@@ -5033,7 +5032,7 @@ const Fs = V.createContext({
|
|
|
5033
5032
|
if (C) return C;
|
|
5034
5033
|
const T = (M = p == null ? void 0 : p.attachments) == null ? void 0 : M[0];
|
|
5035
5034
|
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";
|
|
5036
|
-
})(), k = p != null && p.created_at ? Ki(new Date(p.created_at)) : "", D = p ?
|
|
5035
|
+
})(), k = p != null && p.created_at ? Ki(new Date(p.created_at)) : "", D = p ? Ue(p) : !1, S = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
|
|
5037
5036
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
5038
5037
|
channelId: t == null ? void 0 : t.id,
|
|
5039
5038
|
isSelected: f,
|
|
@@ -5092,7 +5091,7 @@ const Fs = V.createContext({
|
|
|
5092
5091
|
);
|
|
5093
5092
|
}
|
|
5094
5093
|
);
|
|
5095
|
-
|
|
5094
|
+
Os.displayName = "CustomChannelPreview";
|
|
5096
5095
|
const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
5097
5096
|
({
|
|
5098
5097
|
onChannelSelect: e,
|
|
@@ -5103,7 +5102,7 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5103
5102
|
sort: i = Zi,
|
|
5104
5103
|
className: o,
|
|
5105
5104
|
customEmptyStateIndicator: l,
|
|
5106
|
-
channelListPaginator: d =
|
|
5105
|
+
channelListPaginator: d = Mn,
|
|
5107
5106
|
channelPreview: m,
|
|
5108
5107
|
renderMessagePreview: f,
|
|
5109
5108
|
viewerLanguage: h,
|
|
@@ -5155,7 +5154,7 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5155
5154
|
o
|
|
5156
5155
|
),
|
|
5157
5156
|
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(qi, { value: D, children: /* @__PURE__ */ s(
|
|
5158
|
-
|
|
5157
|
+
Tn,
|
|
5159
5158
|
{
|
|
5160
5159
|
filters: n,
|
|
5161
5160
|
sort: i,
|
|
@@ -5169,7 +5168,7 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5169
5168
|
onAddedToChannel: x,
|
|
5170
5169
|
onChannelUpdated: p,
|
|
5171
5170
|
Paginator: d,
|
|
5172
|
-
Preview:
|
|
5171
|
+
Preview: Os,
|
|
5173
5172
|
EmptyStateIndicator: l
|
|
5174
5173
|
},
|
|
5175
5174
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -5179,7 +5178,7 @@ const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
|
5179
5178
|
}
|
|
5180
5179
|
);
|
|
5181
5180
|
Ji.displayName = "ChannelList";
|
|
5182
|
-
const
|
|
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%`, Qi = {
|
|
5183
5182
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5184
5183
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
5185
5184
|
}, el = ({ variant: e }) => /* @__PURE__ */ s(
|
|
@@ -5193,8 +5192,8 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5193
5192
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
5194
5193
|
transformOrigin: "center",
|
|
5195
5194
|
backgroundColor: Qi[e],
|
|
5196
|
-
WebkitMask:
|
|
5197
|
-
mask:
|
|
5195
|
+
WebkitMask: as,
|
|
5196
|
+
mask: as
|
|
5198
5197
|
}
|
|
5199
5198
|
}
|
|
5200
5199
|
), tl = {
|
|
@@ -5206,7 +5205,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5206
5205
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
5207
5206
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
5208
5207
|
}
|
|
5209
|
-
},
|
|
5208
|
+
}, $s = ({
|
|
5210
5209
|
variant: e,
|
|
5211
5210
|
text: t,
|
|
5212
5211
|
tail: n = !0,
|
|
@@ -5238,7 +5237,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5238
5237
|
header: n,
|
|
5239
5238
|
className: a
|
|
5240
5239
|
}) => /* @__PURE__ */ s(
|
|
5241
|
-
|
|
5240
|
+
$s,
|
|
5242
5241
|
{
|
|
5243
5242
|
variant: "received",
|
|
5244
5243
|
text: e,
|
|
@@ -5246,7 +5245,7 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5246
5245
|
header: n,
|
|
5247
5246
|
className: a
|
|
5248
5247
|
}
|
|
5249
|
-
), nl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(
|
|
5248
|
+
), nl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s($s, { variant: "sent", text: e, tail: t, className: n }), vl = {
|
|
5250
5249
|
Sent: nl,
|
|
5251
5250
|
Received: sl
|
|
5252
5251
|
}, al = ({
|
|
@@ -5314,21 +5313,21 @@ const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5314
5313
|
] }) });
|
|
5315
5314
|
};
|
|
5316
5315
|
export {
|
|
5317
|
-
|
|
5316
|
+
fs as A,
|
|
5318
5317
|
pt as B,
|
|
5319
5318
|
ji as C,
|
|
5320
5319
|
mt as D,
|
|
5321
5320
|
pl as E,
|
|
5322
5321
|
xl as F,
|
|
5323
5322
|
Or as G,
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5323
|
+
xa as H,
|
|
5324
|
+
sa as I,
|
|
5325
|
+
Jt as L,
|
|
5327
5326
|
fl as M,
|
|
5328
5327
|
ye as a,
|
|
5329
5328
|
ne as b,
|
|
5330
5329
|
Ji as c,
|
|
5331
|
-
|
|
5330
|
+
Fs as d,
|
|
5332
5331
|
gl as e,
|
|
5333
5332
|
al as f,
|
|
5334
5333
|
ce as g,
|
|
@@ -5344,12 +5343,12 @@ export {
|
|
|
5344
5343
|
Ki as q,
|
|
5345
5344
|
_e as r,
|
|
5346
5345
|
tr as s,
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5346
|
+
ms as t,
|
|
5347
|
+
bs as u,
|
|
5348
|
+
ia as v,
|
|
5350
5349
|
Ya as w,
|
|
5351
|
-
|
|
5350
|
+
wa as x,
|
|
5352
5351
|
He as y,
|
|
5353
5352
|
gt as z
|
|
5354
5353
|
};
|
|
5355
|
-
//# sourceMappingURL=index-
|
|
5354
|
+
//# sourceMappingURL=index-FDgJhTIG.js.map
|