@linktr.ee/messaging-react 4.4.1 → 4.4.2-rc-1787626990
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +847 -844
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/MessageBubble/components/_shared/bubbleTail.tsx +2 -2
- package/src/components/RichCard/RichCard.stories.tsx +13 -1
- package/src/components/RichCard/RichCard.test.tsx +20 -0
- package/src/components/RichCard/RichCardBody.tsx +23 -14
package/dist/index.js
CHANGED
|
@@ -2,30 +2,30 @@ import { a as e, i as t, n, o as r, r as i, s as a } from "./AttachmentCard-BqwW
|
|
|
2
2
|
import o, { Suspense as s, createContext as c, useCallback as l, useContext as u, useEffect as d, useId as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
3
3
|
import { StreamChatService as g } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { LinkPreviewsManager as _, StreamChat as v } from "stream-chat";
|
|
5
|
-
import { AIStates as y, Attachment as b, AttachmentPreviewList as x, Channel as S, ChannelList as C, Chat as w, DateSeparator as T, EditMessageModal as E, InfiniteScroll as D, MessageBlocked as O, MessageBounceModal as k, MessageBouncePrompt as A, MessageDeleted as j, MessageErrorIcon as M, MessageInput as N, MessageIsThreadReplyInChannelButtonIndicator as P, MessageList as F, MessageRepliesCountButton as I, MessageStatus as L, MessageText as R, MessageTimestamp as z, Poll as ee, QuotedMessagePreview as te, ReminderNotification as ne, StreamedMessageText as re, TextareaComposer as ie, Window as B, WithComponents as ae, areMessageUIPropsEqual as oe, isDateSeparatorMessage as se, isMessageBlocked as ce, isMessageBounced as le, messageHasAttachments as ue, messageHasReactions as de, useAIState as fe, useActiveAudioPlayer as pe, useChannelStateContext as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { MESSAGE_CUSTOM_TYPE as
|
|
8
|
-
import
|
|
9
|
-
import { ArrowLeftIcon as
|
|
10
|
-
import { DefaultDropdownActionButton as
|
|
5
|
+
import { AIStates as y, Attachment as b, AttachmentPreviewList as x, Channel as S, ChannelList as C, Chat as w, DateSeparator as T, EditMessageModal as E, InfiniteScroll as D, MessageBlocked as O, MessageBounceModal as k, MessageBouncePrompt as A, MessageDeleted as j, MessageErrorIcon as M, MessageInput as N, MessageIsThreadReplyInChannelButtonIndicator as P, MessageList as F, MessageRepliesCountButton as I, MessageStatus as L, MessageText as R, MessageTimestamp as z, Poll as ee, QuotedMessagePreview as te, ReminderNotification as ne, StreamedMessageText as re, TextareaComposer as ie, Window as B, WithComponents as ae, areMessageUIPropsEqual as oe, isDateSeparatorMessage as se, isMessageBlocked as ce, isMessageBounced as le, messageHasAttachments as ue, messageHasReactions as de, useAIState as fe, useActiveAudioPlayer as pe, useChannelStateContext as me, useChatContext as he, useComponentContext as ge, useMessageComposer as _e, useMessageComposerHasSendableData as ve, useMessageContext as V, useMessageInputContext as ye, useMessageReminder as be, useStateStore as xe, useTypingContext as Se } from "stream-chat-react";
|
|
6
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
|
+
import { MESSAGE_CUSTOM_TYPE as G, OFFICIAL_SENDER_USER_ID as K, isAgeSafetySystemType as Ce, isDmAgentSystemType as q, isOfficialChannel as we, resolveRichCardImagePresentation as Te, selectEnabledFaqs as Ee } from "@linktr.ee/messaging-taxonomy";
|
|
8
|
+
import J from "classnames";
|
|
9
|
+
import { ArrowLeftIcon as De, ArrowUpIcon as Oe, CaretLeftIcon as ke, CaretRightIcon as Ae, ChecksIcon as je, CircleNotchIcon as Me, CurrencyDollarIcon as Y, DotsThreeIcon as X, DownloadSimpleIcon as Ne, FlagIcon as Pe, GiftIcon as Fe, MegaphoneIcon as Ie, PencilSimpleIcon as Le, PlayIcon as Re, ProhibitIcon as ze, ProhibitInsetIcon as Be, SignOutIcon as Ve, SparkleIcon as He, SpinnerGapIcon as Ue, StarIcon as We, TrashSimpleIcon as Ge, VideoCameraIcon as Ke, WarningCircleIcon as qe, XIcon as Je } from "@phosphor-icons/react";
|
|
10
|
+
import { DefaultDropdownActionButton as Ye, MessageActions as Xe } from "stream-chat-react/experimental";
|
|
11
11
|
//#region src/logging/index.tsx
|
|
12
|
-
var
|
|
12
|
+
var Ze = {
|
|
13
13
|
debug: (e, ...t) => console.log(e, ...t),
|
|
14
14
|
info: (e, ...t) => console.log(e, ...t),
|
|
15
15
|
warn: (e, ...t) => console.warn(e, ...t),
|
|
16
16
|
error: (e, ...t) => console.error(e, ...t)
|
|
17
|
-
},
|
|
18
|
-
debug: e?.debug ??
|
|
19
|
-
info: e?.info ??
|
|
20
|
-
warn: e?.warn ??
|
|
21
|
-
error: e?.error ??
|
|
22
|
-
}),
|
|
23
|
-
let n = p(() =>
|
|
24
|
-
return /* @__PURE__ */
|
|
17
|
+
}, Qe = (e) => ({
|
|
18
|
+
debug: e?.debug ?? Ze.debug,
|
|
19
|
+
info: e?.info ?? Ze.info,
|
|
20
|
+
warn: e?.warn ?? Ze.warn,
|
|
21
|
+
error: e?.error ?? Ze.error
|
|
22
|
+
}), $e = c(Ze), et = ({ logger: e, children: t }) => {
|
|
23
|
+
let n = p(() => Qe(e), [e]);
|
|
24
|
+
return /* @__PURE__ */ U($e.Provider, {
|
|
25
25
|
value: n,
|
|
26
26
|
children: t
|
|
27
27
|
});
|
|
28
|
-
},
|
|
28
|
+
}, tt = () => u($e), nt = c({
|
|
29
29
|
service: null,
|
|
30
30
|
client: null,
|
|
31
31
|
isConnected: !1,
|
|
@@ -34,7 +34,7 @@ var Xe = {
|
|
|
34
34
|
capabilities: {},
|
|
35
35
|
refreshConnection: async () => {},
|
|
36
36
|
debug: !1
|
|
37
|
-
}),
|
|
37
|
+
}), rt = () => u(nt), it = ({ children: e, user: t, serviceConfig: n, apiKey: r, capabilities: i = {}, debug: a = !1, client: s, logger: c }) => {
|
|
38
38
|
let u = l((e, ...t) => {
|
|
39
39
|
a && console.log(`🔥 [MessagingProvider] ${e}`, ...t);
|
|
40
40
|
}, [a]);
|
|
@@ -102,7 +102,7 @@ var Xe = {
|
|
|
102
102
|
apiKey: r,
|
|
103
103
|
debug: A.current,
|
|
104
104
|
client: F,
|
|
105
|
-
...t.logger || !j.current ? {} : { logger:
|
|
105
|
+
...t.logger || !j.current ? {} : { logger: Qe(j.current) }
|
|
106
106
|
});
|
|
107
107
|
O.current = n, p(n), u("✅ SERVICE SET", {
|
|
108
108
|
renderCount: e,
|
|
@@ -237,18 +237,18 @@ var Xe = {
|
|
|
237
237
|
renderCount: N.current,
|
|
238
238
|
willRenderChat: !!F,
|
|
239
239
|
contextValueReady: !!R
|
|
240
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ U(et, {
|
|
241
241
|
logger: c,
|
|
242
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ U(nt.Provider, {
|
|
243
243
|
value: R,
|
|
244
|
-
children: F ? /* @__PURE__ */
|
|
244
|
+
children: F ? /* @__PURE__ */ U(w, {
|
|
245
245
|
client: F,
|
|
246
246
|
customClasses: { channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]" },
|
|
247
247
|
children: e
|
|
248
248
|
}) : e
|
|
249
249
|
})
|
|
250
250
|
});
|
|
251
|
-
},
|
|
251
|
+
}, at = () => rt(), ot = (e) => {
|
|
252
252
|
let [t, n] = h(!!e?.state?.membership?.pinned_at);
|
|
253
253
|
return d(() => {
|
|
254
254
|
if (!e) {
|
|
@@ -266,30 +266,30 @@ var Xe = {
|
|
|
266
266
|
};
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/utils/resolveConversationParticipant.ts
|
|
269
|
-
function
|
|
269
|
+
function st(e, t, n) {
|
|
270
270
|
let r = Object.values(e || {});
|
|
271
271
|
if (we(n)) {
|
|
272
|
-
let e = r.find((e) => e.user?.id ===
|
|
272
|
+
let e = r.find((e) => e.user?.id === K);
|
|
273
273
|
if (e) return e;
|
|
274
274
|
}
|
|
275
275
|
return r.find((e) => e.user?.id && e.user.id !== t);
|
|
276
276
|
}
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/utils/resolveParticipantDisplayName.ts
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var ct = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
280
|
+
function lt(e) {
|
|
281
|
+
return ct.test(e.trim());
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ut(e, t) {
|
|
284
284
|
let n = e?.trim();
|
|
285
|
-
return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !
|
|
285
|
+
return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !lt(n);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
287
|
+
function dt(e) {
|
|
288
|
+
return ut(e?.name, e?.id) ? e.name.trim() : ut(e?.username, e?.id) ? e.username.trim() : "Unknown member";
|
|
289
289
|
}
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/components/Avatar/getAvatarEmoji.ts
|
|
292
|
-
var
|
|
292
|
+
var ft = [
|
|
293
293
|
{
|
|
294
294
|
emoji: "🍎",
|
|
295
295
|
bgColor: "#FFD1DD"
|
|
@@ -343,7 +343,7 @@ var dt = [
|
|
|
343
343
|
bgColor: "#D9F7E1"
|
|
344
344
|
}
|
|
345
345
|
];
|
|
346
|
-
function
|
|
346
|
+
function pt(e) {
|
|
347
347
|
let t = 0;
|
|
348
348
|
for (let n = 0; n < e.length; n++) {
|
|
349
349
|
let r = e.charCodeAt(n);
|
|
@@ -351,28 +351,28 @@ function ft(e) {
|
|
|
351
351
|
}
|
|
352
352
|
return Math.abs(t);
|
|
353
353
|
}
|
|
354
|
-
function pt(e) {
|
|
355
|
-
return dt[ft(e) % dt.length];
|
|
356
|
-
}
|
|
357
354
|
function mt(e) {
|
|
358
|
-
return pt(e).
|
|
355
|
+
return ft[pt(e) % ft.length];
|
|
359
356
|
}
|
|
360
357
|
function ht(e) {
|
|
361
|
-
return
|
|
358
|
+
return mt(e).emoji;
|
|
359
|
+
}
|
|
360
|
+
function gt(e) {
|
|
361
|
+
return mt(e).bgColor;
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Avatar/index.tsx
|
|
365
|
-
var
|
|
366
|
-
let s =
|
|
365
|
+
var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape: a = "squircle", dmAgentEnabled: o = !1 }) => {
|
|
366
|
+
let s = ht(e), c = gt(e), l = n < 32 ? Math.round(n * .45) : n < 56 ? 14 : n < 120 ? 18 : 36, u = n >= 40 ? 2 : 1, d = a === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ U("div", {
|
|
367
367
|
className: "h-full w-full overflow-hidden",
|
|
368
368
|
style: d,
|
|
369
|
-
children: t ? /* @__PURE__ */
|
|
369
|
+
children: t ? /* @__PURE__ */ U("img", {
|
|
370
370
|
src: t,
|
|
371
371
|
alt: "",
|
|
372
372
|
className: "h-full w-full object-cover"
|
|
373
|
-
}) : /* @__PURE__ */
|
|
373
|
+
}) : /* @__PURE__ */ U("div", {
|
|
374
374
|
"aria-hidden": "true",
|
|
375
|
-
className:
|
|
375
|
+
className: J("avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"),
|
|
376
376
|
style: {
|
|
377
377
|
fontSize: l,
|
|
378
378
|
lineHeight: 1
|
|
@@ -380,8 +380,8 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
380
380
|
children: s
|
|
381
381
|
})
|
|
382
382
|
});
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
className:
|
|
383
|
+
return /* @__PURE__ */ W("div", {
|
|
384
|
+
className: J("relative flex-shrink-0", r),
|
|
385
385
|
style: {
|
|
386
386
|
"--str-chat__avatar-size": `${n}px`,
|
|
387
387
|
width: `${n}px`,
|
|
@@ -389,16 +389,16 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
389
389
|
backgroundColor: t ? void 0 : c,
|
|
390
390
|
...d
|
|
391
391
|
},
|
|
392
|
-
children: [i && /* @__PURE__ */
|
|
392
|
+
children: [i && /* @__PURE__ */ U("div", {
|
|
393
393
|
"aria-hidden": "true",
|
|
394
394
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
395
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ U(We, {
|
|
396
396
|
className: "size-3 text-yellow-600",
|
|
397
397
|
weight: "duotone"
|
|
398
398
|
})
|
|
399
|
-
}), /* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ U("div", {
|
|
400
400
|
"data-testid": "avatar-ring",
|
|
401
|
-
className:
|
|
401
|
+
className: J("h-full w-full", "bg-transparent"),
|
|
402
402
|
style: {
|
|
403
403
|
...d,
|
|
404
404
|
...o && {
|
|
@@ -411,8 +411,8 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
411
411
|
children: f
|
|
412
412
|
})]
|
|
413
413
|
});
|
|
414
|
-
},
|
|
415
|
-
let { service: f, debug: p } =
|
|
414
|
+
}, vt = "https://linktr.ee/s/about/trust-center/report", yt = ({ channel: e, participant: t, showBlockParticipant: n = !0, enabled: r = !0, onLeaveConversation: i, onBlockParticipant: a, onDeleteConversationClick: o, onBlockParticipantClick: s, onReportParticipantClick: c, onActionComplete: l, logLabel: u = "useChannelModerationActions" }) => {
|
|
415
|
+
let { service: f, debug: p } = rt(), m = t?.user?.id, g = !!(r && n && f && m), [_, v] = h(!1), [y, b] = h(null), [x, S] = h(!1), [C, w] = h(!1), T = g && (y?.participantId !== m || y?.service !== f);
|
|
416
416
|
return d(() => {
|
|
417
417
|
if (!g || !f || !m) {
|
|
418
418
|
v(!1), b(null);
|
|
@@ -483,16 +483,16 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
483
483
|
}
|
|
484
484
|
},
|
|
485
485
|
handleReportUser: () => {
|
|
486
|
-
c?.(), l?.(), window.open(
|
|
486
|
+
c?.(), l?.(), window.open(vt, "_blank", "noopener,noreferrer");
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
|
-
},
|
|
489
|
+
}, bt = ({ variant: e = "default", className: t, children: n, ...r }) => /* @__PURE__ */ U("button", {
|
|
490
490
|
type: "button",
|
|
491
|
-
className:
|
|
491
|
+
className: J("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", e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand", t),
|
|
492
492
|
...r,
|
|
493
493
|
children: n
|
|
494
|
-
}),
|
|
495
|
-
let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } =
|
|
494
|
+
}), xt = ({ channel: e, participant: t, showDeleteConversation: n = !0, showBlockParticipant: r = !0, showReportParticipant: i = !0, onLeaveConversation: a, onBlockParticipant: o, onDeleteConversationClick: s, onBlockParticipantClick: c, onReportParticipantClick: u, customChannelActions: p, triggerClassName: g }) => {
|
|
495
|
+
let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } = yt({
|
|
496
496
|
channel: e,
|
|
497
497
|
participant: t,
|
|
498
498
|
showBlockParticipant: r,
|
|
@@ -515,106 +515,106 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
515
515
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
516
516
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
517
517
|
};
|
|
518
|
-
}, [_]), !t || !(n || r || i || p) ? null : /* @__PURE__ */
|
|
518
|
+
}, [_]), !t || !(n || r || i || p) ? null : /* @__PURE__ */ W("div", {
|
|
519
519
|
ref: y,
|
|
520
520
|
className: "relative",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ W("button", {
|
|
522
522
|
className: g,
|
|
523
523
|
type: "button",
|
|
524
524
|
"aria-haspopup": "true",
|
|
525
525
|
"aria-expanded": _,
|
|
526
526
|
"aria-controls": _ ? b : void 0,
|
|
527
527
|
onClick: () => v((e) => !e),
|
|
528
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ U(X, { className: "size-5 text-black/90" }), /* @__PURE__ */ U("span", {
|
|
529
529
|
className: "sr-only",
|
|
530
530
|
children: "More options"
|
|
531
531
|
})]
|
|
532
|
-
}), _ && /* @__PURE__ */
|
|
532
|
+
}), _ && /* @__PURE__ */ U("div", {
|
|
533
533
|
id: b,
|
|
534
534
|
"aria-label": "Conversation options",
|
|
535
|
-
className:
|
|
536
|
-
children: /* @__PURE__ */
|
|
535
|
+
className: J("absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden", "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"),
|
|
536
|
+
children: /* @__PURE__ */ W("ul", {
|
|
537
537
|
className: "flex flex-col gap-1",
|
|
538
538
|
children: [
|
|
539
|
-
n && /* @__PURE__ */
|
|
539
|
+
n && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W(bt, {
|
|
540
540
|
onClick: T,
|
|
541
541
|
disabled: C,
|
|
542
542
|
"aria-busy": C,
|
|
543
|
-
children: [C ? /* @__PURE__ */
|
|
543
|
+
children: [C ? /* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ U(Ve, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Delete Conversation" })]
|
|
544
544
|
}) }),
|
|
545
|
-
r && /* @__PURE__ */
|
|
545
|
+
r && /* @__PURE__ */ U("li", { children: S ? /* @__PURE__ */ W(bt, {
|
|
546
546
|
disabled: !0,
|
|
547
547
|
"aria-busy": !0,
|
|
548
|
-
children: [/* @__PURE__ */
|
|
549
|
-
}) : x ? /* @__PURE__ */
|
|
548
|
+
children: [/* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }), /* @__PURE__ */ U("span", { children: "Block" })]
|
|
549
|
+
}) : x ? /* @__PURE__ */ W(bt, {
|
|
550
550
|
onClick: D,
|
|
551
551
|
disabled: w,
|
|
552
552
|
"aria-busy": w,
|
|
553
|
-
children: [w ? /* @__PURE__ */
|
|
554
|
-
}) : /* @__PURE__ */
|
|
553
|
+
children: [w ? /* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ U(Be, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Unblock" })]
|
|
554
|
+
}) : /* @__PURE__ */ W(bt, {
|
|
555
555
|
onClick: E,
|
|
556
556
|
disabled: w,
|
|
557
557
|
"aria-busy": w,
|
|
558
|
-
children: [w ? /* @__PURE__ */
|
|
558
|
+
children: [w ? /* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ U(Be, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Block" })]
|
|
559
559
|
}) }),
|
|
560
|
-
i && /* @__PURE__ */
|
|
560
|
+
i && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W(bt, {
|
|
561
561
|
variant: "danger",
|
|
562
562
|
onClick: O,
|
|
563
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ U(Pe, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Report" })]
|
|
564
564
|
}) }),
|
|
565
565
|
p
|
|
566
566
|
]
|
|
567
567
|
})
|
|
568
568
|
})]
|
|
569
569
|
});
|
|
570
|
-
},
|
|
571
|
-
let { channel: _ } =
|
|
570
|
+
}, St = "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", Ct = "CUSTOMER_PAID", wt = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Ct, Tt = ({ className: e, onBack: t, showBackButton: n, showStarButton: r = !1, onLeaveConversation: i, onBlockParticipant: a, showDeleteConversation: s = !0, showBlockParticipant: c = !0, showReportParticipant: l = !0, onDeleteConversationClick: u, onBlockParticipantClick: d, onReportParticipantClick: f, customChannelActions: p, renderChannelActions: m, showChannelInfo: h = !0, onParticipantNameClick: g }) => {
|
|
571
|
+
let { channel: _ } = me(), { client: v } = he(), y = o.useMemo(() => st(_.state?.members, v?.userID, _.type), [
|
|
572
572
|
_.state?.members,
|
|
573
573
|
v?.userID,
|
|
574
574
|
_.type
|
|
575
|
-
]), b =
|
|
575
|
+
]), b = dt(y?.user), x = y?.user?.image, S = ot(_), C = wt(_.data?.customer_tag) && y?.is_follower === !0, w = r && S, T = C || w || !!g, E = async () => {
|
|
576
576
|
try {
|
|
577
577
|
S ? await _.unpin() : await _.pin();
|
|
578
578
|
} catch (e) {
|
|
579
579
|
console.error("[ChannelHeaderRedesign] Failed to update pinned status:", e);
|
|
580
580
|
}
|
|
581
|
-
}, D = /* @__PURE__ */
|
|
581
|
+
}, D = /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(_t, {
|
|
582
582
|
id: y?.user?.id || _.id || "unknown",
|
|
583
583
|
name: b,
|
|
584
584
|
image: x,
|
|
585
585
|
shape: "circle",
|
|
586
586
|
size: 48,
|
|
587
587
|
className: "-mb-2"
|
|
588
|
-
}), /* @__PURE__ */
|
|
589
|
-
className:
|
|
590
|
-
children: /* @__PURE__ */
|
|
588
|
+
}), /* @__PURE__ */ U("span", {
|
|
589
|
+
className: J("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 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", T ? "pl-3 pr-2" : "px-3"),
|
|
590
|
+
children: /* @__PURE__ */ W("span", {
|
|
591
591
|
className: "flex max-w-full items-center justify-center",
|
|
592
|
-
children: [/* @__PURE__ */
|
|
592
|
+
children: [/* @__PURE__ */ U("span", {
|
|
593
593
|
className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90",
|
|
594
594
|
children: b
|
|
595
|
-
}), T && /* @__PURE__ */
|
|
595
|
+
}), T && /* @__PURE__ */ W("span", {
|
|
596
596
|
className: "ml-2 flex gap-1",
|
|
597
597
|
children: [
|
|
598
|
-
C && /* @__PURE__ */
|
|
598
|
+
C && /* @__PURE__ */ U("span", {
|
|
599
599
|
"aria-label": "Paid customer",
|
|
600
600
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
601
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ U(Y, {
|
|
602
602
|
className: "size-2.5",
|
|
603
603
|
weight: "bold"
|
|
604
604
|
})
|
|
605
605
|
}),
|
|
606
|
-
w && /* @__PURE__ */
|
|
606
|
+
w && /* @__PURE__ */ U("span", {
|
|
607
607
|
className: "messaging-header-star-badge flex overflow-hidden",
|
|
608
|
-
children: /* @__PURE__ */
|
|
608
|
+
children: /* @__PURE__ */ U("span", {
|
|
609
609
|
"aria-label": "Starred conversation",
|
|
610
610
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
611
|
-
children: /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */ U(We, {
|
|
612
612
|
className: "size-2.5",
|
|
613
613
|
weight: "fill"
|
|
614
614
|
})
|
|
615
615
|
})
|
|
616
616
|
}),
|
|
617
|
-
g && /* @__PURE__ */
|
|
617
|
+
g && /* @__PURE__ */ U(Ae, {
|
|
618
618
|
"aria-hidden": "true",
|
|
619
619
|
className: "size-4 shrink-0 text-black/65",
|
|
620
620
|
weight: "bold"
|
|
@@ -623,51 +623,51 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
623
623
|
})]
|
|
624
624
|
})
|
|
625
625
|
})] });
|
|
626
|
-
return /* @__PURE__ */
|
|
627
|
-
className:
|
|
628
|
-
children: /* @__PURE__ */
|
|
626
|
+
return /* @__PURE__ */ U("div", {
|
|
627
|
+
className: J("@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]", e),
|
|
628
|
+
children: /* @__PURE__ */ W("div", {
|
|
629
629
|
className: "grid min-h-[100px] grid-cols-[minmax(40px,1fr)_auto_minmax(40px,1fr)] items-start pb-2 pt-5 @lg:min-h-[104px] @lg:pt-6",
|
|
630
630
|
children: [
|
|
631
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ U("div", {
|
|
632
632
|
className: "flex items-start",
|
|
633
|
-
children: n && /* @__PURE__ */
|
|
634
|
-
className:
|
|
633
|
+
children: n && /* @__PURE__ */ U("button", {
|
|
634
|
+
className: J(St, "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"),
|
|
635
635
|
onClick: t || (() => {}),
|
|
636
636
|
type: "button",
|
|
637
637
|
"aria-label": "Back to conversations",
|
|
638
|
-
children: /* @__PURE__ */
|
|
638
|
+
children: /* @__PURE__ */ U(De, { className: "size-5 text-black/90" })
|
|
639
639
|
})
|
|
640
640
|
}),
|
|
641
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ U("div", {
|
|
642
642
|
className: "flex min-w-0 justify-center",
|
|
643
643
|
"data-dd-privacy": "mask",
|
|
644
|
-
children: g ? /* @__PURE__ */
|
|
644
|
+
children: g ? /* @__PURE__ */ U("button", {
|
|
645
645
|
type: "button",
|
|
646
646
|
onClick: g,
|
|
647
647
|
"aria-label": `View details for ${b}`,
|
|
648
648
|
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",
|
|
649
649
|
children: D
|
|
650
|
-
}) : /* @__PURE__ */
|
|
650
|
+
}) : /* @__PURE__ */ U("div", {
|
|
651
651
|
className: "flex min-w-0 max-w-full flex-col items-center px-2",
|
|
652
652
|
children: D
|
|
653
653
|
})
|
|
654
654
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ W("div", {
|
|
656
656
|
className: "flex items-start justify-end gap-2",
|
|
657
|
-
children: [r && /* @__PURE__ */
|
|
658
|
-
className:
|
|
657
|
+
children: [r && /* @__PURE__ */ U("button", {
|
|
658
|
+
className: St,
|
|
659
659
|
onClick: E,
|
|
660
660
|
type: "button",
|
|
661
661
|
"aria-pressed": S,
|
|
662
662
|
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
663
|
-
children: /* @__PURE__ */
|
|
664
|
-
className:
|
|
663
|
+
children: /* @__PURE__ */ U(We, {
|
|
664
|
+
className: J("size-5", {
|
|
665
665
|
"text-[#FFD60A]": S,
|
|
666
666
|
"text-black/90": !S
|
|
667
667
|
}),
|
|
668
668
|
weight: S ? "fill" : "regular"
|
|
669
669
|
})
|
|
670
|
-
}), h && (m === void 0 ? /* @__PURE__ */
|
|
670
|
+
}), h && (m === void 0 ? /* @__PURE__ */ U(xt, {
|
|
671
671
|
channel: _,
|
|
672
672
|
participant: y,
|
|
673
673
|
showDeleteConversation: s,
|
|
@@ -679,85 +679,85 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
679
679
|
onBlockParticipantClick: d,
|
|
680
680
|
onReportParticipantClick: f,
|
|
681
681
|
customChannelActions: p,
|
|
682
|
-
triggerClassName:
|
|
682
|
+
triggerClassName: St
|
|
683
683
|
}) : m)]
|
|
684
684
|
})
|
|
685
685
|
]
|
|
686
686
|
})
|
|
687
687
|
});
|
|
688
|
-
},
|
|
688
|
+
}, Et = (e) => /* @__PURE__ */ U(T, {
|
|
689
689
|
...e,
|
|
690
690
|
position: "center"
|
|
691
691
|
});
|
|
692
692
|
//#endregion
|
|
693
693
|
//#region src/utils/getMessageDisplayText.ts
|
|
694
|
-
function
|
|
694
|
+
function Dt(e) {
|
|
695
695
|
return e?.trim().toLowerCase().split(/[-_]/)[0] || void 0;
|
|
696
696
|
}
|
|
697
|
-
function
|
|
698
|
-
let n = e?.text, r =
|
|
697
|
+
function Ot({ message: e, viewerLanguage: t }) {
|
|
698
|
+
let n = e?.text, r = Dt(t);
|
|
699
699
|
return r ? e?.i18n?.[`${r}_text`] ?? n : n;
|
|
700
700
|
}
|
|
701
701
|
//#endregion
|
|
702
702
|
//#region src/components/MediaMessage/index.tsx
|
|
703
|
-
function
|
|
703
|
+
function kt(e) {
|
|
704
704
|
return e.type === "link" || !!e.og_scrape_url?.trim() && !e.asset_url;
|
|
705
705
|
}
|
|
706
706
|
//#endregion
|
|
707
707
|
//#region src/components/CustomMessage/context.tsx
|
|
708
|
-
var
|
|
709
|
-
function
|
|
710
|
-
return u(
|
|
708
|
+
var At = { LockedAttachment: { isUnlocking: () => !1 } }, jt = c({}), Mt = jt.Provider;
|
|
709
|
+
function Nt(e) {
|
|
710
|
+
return u(jt)[e] ?? At[e];
|
|
711
711
|
}
|
|
712
712
|
//#endregion
|
|
713
713
|
//#region src/components/CustomMessage/LockedAttachment/index.tsx
|
|
714
|
-
var
|
|
714
|
+
var Pt = o.lazy(() => import("./Card-C7uLQbYz.js")), Ft = o.lazy(() => import("./Card-f51K6V7Y.js")), It = () => /* @__PURE__ */ U("div", {
|
|
715
715
|
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)]",
|
|
716
716
|
"aria-hidden": !0
|
|
717
|
-
}),
|
|
718
|
-
fallback: /* @__PURE__ */
|
|
719
|
-
children: e.contentType === "text" ? /* @__PURE__ */
|
|
720
|
-
}),
|
|
717
|
+
}), Lt = (e) => /* @__PURE__ */ U(s, {
|
|
718
|
+
fallback: /* @__PURE__ */ U(It, {}),
|
|
719
|
+
children: e.contentType === "text" ? /* @__PURE__ */ U(Pt, { ...e }) : /* @__PURE__ */ U(Ft, { ...e })
|
|
720
|
+
}), Rt = ({ size: e = 15 }) => /* @__PURE__ */ U("svg", {
|
|
721
721
|
width: e,
|
|
722
722
|
height: e,
|
|
723
723
|
viewBox: "0 0 15 15",
|
|
724
724
|
fill: "none",
|
|
725
725
|
"aria-hidden": "true",
|
|
726
|
-
children: /* @__PURE__ */
|
|
726
|
+
children: /* @__PURE__ */ U("path", {
|
|
727
727
|
d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
|
|
728
728
|
fill: "currentColor",
|
|
729
729
|
fillOpacity: .55
|
|
730
730
|
})
|
|
731
|
-
}),
|
|
732
|
-
let r =
|
|
731
|
+
}), zt = (e) => e.metadata?.custom_type === G.PAID, Bt = (e) => e.metadata?.custom_type === G.CHATBOT, Vt = (e) => e.metadata?.custom_type === G.ATTACHMENT, Ht = (e) => Vt(e) && e.metadata?.attachment_content_type === "text", Ut = (e) => Vt(e) && e.metadata?.attachment_content_type !== "text", Wt = (e) => zt(e) && !!e.metadata?.amount_text, Gt = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
|
|
732
|
+
let r = zt(e), i = Bt(e);
|
|
733
733
|
if (!r && !i) return null;
|
|
734
734
|
if (r) {
|
|
735
735
|
let t = e.metadata?.amount_text;
|
|
736
|
-
return t ? /* @__PURE__ */
|
|
736
|
+
return t ? /* @__PURE__ */ W("div", {
|
|
737
737
|
className: "message-tag--paid inline-flex items-center gap-1 text-[12px] font-medium leading-[2] text-[#016630]",
|
|
738
|
-
children: [/* @__PURE__ */
|
|
738
|
+
children: [/* @__PURE__ */ U(Fe, { size: 12 }), /* @__PURE__ */ W("span", { children: [
|
|
739
739
|
"Delivered with ",
|
|
740
740
|
t,
|
|
741
741
|
" message"
|
|
742
742
|
] })]
|
|
743
743
|
}) : null;
|
|
744
744
|
}
|
|
745
|
-
let a = t && n, o = a ? "Sent with AI" : "Sent by AI Assistant", s = a ? "justify-end gap-2 text-black/30" : t ? "w-full justify-start gap-1.5 mt-3 px-4 text-white/55" : "w-full justify-start gap-1.5 mt-3 px-4 text-black/30", c = /* @__PURE__ */
|
|
745
|
+
let a = t && n, o = a ? "Sent with AI" : "Sent by AI Assistant", s = a ? "justify-end gap-2 text-black/30" : t ? "w-full justify-start gap-1.5 mt-3 px-4 text-white/55" : "w-full justify-start gap-1.5 mt-3 px-4 text-black/30", c = /* @__PURE__ */ U("span", {
|
|
746
746
|
className: "text-left",
|
|
747
747
|
children: o
|
|
748
|
-
}), l = /* @__PURE__ */
|
|
748
|
+
}), l = /* @__PURE__ */ U("span", {
|
|
749
749
|
className: "inline-flex items-center leading-none",
|
|
750
|
-
children: /* @__PURE__ */
|
|
750
|
+
children: /* @__PURE__ */ U(Rt, { size: a ? 12 : 15 })
|
|
751
751
|
});
|
|
752
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ U("div", {
|
|
753
753
|
className: `inline-flex items-center text-[10px] font-normal leading-4 tracking-[0.2px] ${s}`,
|
|
754
754
|
"data-testid": "message-chatbot-indicator",
|
|
755
|
-
children: t && !a ? /* @__PURE__ */
|
|
755
|
+
children: t && !a ? /* @__PURE__ */ W(H, { children: [c, l] }) : /* @__PURE__ */ W(H, { children: [l, c] })
|
|
756
756
|
});
|
|
757
|
-
},
|
|
757
|
+
}, Kt = "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%", qt = {
|
|
758
758
|
me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
759
759
|
other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
760
|
-
},
|
|
760
|
+
}, Jt = ({ side: e }) => /* @__PURE__ */ U("span", {
|
|
761
761
|
"aria-hidden": "true",
|
|
762
762
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
763
763
|
style: {
|
|
@@ -765,18 +765,18 @@ var Nt = o.lazy(() => import("./Card-C7uLQbYz.js")), Pt = o.lazy(() => import(".
|
|
|
765
765
|
insetInlineStart: e === "other" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
766
766
|
transform: e === "other" ? "scaleX(-1)" : void 0,
|
|
767
767
|
transformOrigin: "center",
|
|
768
|
-
backgroundColor:
|
|
769
|
-
WebkitMask:
|
|
770
|
-
mask:
|
|
768
|
+
backgroundColor: qt[e],
|
|
769
|
+
WebkitMask: Kt,
|
|
770
|
+
mask: Kt
|
|
771
771
|
}
|
|
772
|
-
}),
|
|
772
|
+
}), Yt = c(void 0), Xt = (e) => {
|
|
773
773
|
let t = e.metadata?.outbound_id;
|
|
774
774
|
return typeof t == "string" ? t : void 0;
|
|
775
|
-
},
|
|
775
|
+
}, Zt = (e, t) => {
|
|
776
776
|
if (!t || !e?.length) return;
|
|
777
777
|
let n = /* @__PURE__ */ new Set(), r;
|
|
778
778
|
for (let i of e) {
|
|
779
|
-
let e =
|
|
779
|
+
let e = Xt(i);
|
|
780
780
|
if (!e || n.has(e)) continue;
|
|
781
781
|
n.add(e);
|
|
782
782
|
let a = t(e);
|
|
@@ -786,93 +786,93 @@ var Nt = o.lazy(() => import("./Card-C7uLQbYz.js")), Pt = o.lazy(() => import(".
|
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
return r;
|
|
789
|
-
},
|
|
789
|
+
}, Qt = (e, t) => {
|
|
790
790
|
if (e === t) return !0;
|
|
791
791
|
if (!e || !t) return !1;
|
|
792
792
|
let n = Object.keys(e), r = Object.keys(t);
|
|
793
793
|
return n.length === r.length && n.every((n) => e[n].id === t[n]?.id && e[n].name === t[n]?.name);
|
|
794
|
-
},
|
|
795
|
-
let n =
|
|
796
|
-
return
|
|
797
|
-
},
|
|
794
|
+
}, $t = (e, t) => {
|
|
795
|
+
let n = Zt(e, t), [r, i] = h(n);
|
|
796
|
+
return Qt(r, n) ? r : (i(n), n);
|
|
797
|
+
}, en = (e) => e.metadata?.custom_type === G.TIP, tn = ({ message: e }) => {
|
|
798
798
|
let t = e.metadata?.amount_text;
|
|
799
|
-
return t ? /* @__PURE__ */
|
|
799
|
+
return t ? /* @__PURE__ */ W("div", {
|
|
800
800
|
className: "message-tip-pill inline-flex items-end gap-0.5 max-w-[520px] rounded-[1.5rem] bg-[#43e660] px-4 py-3 text-white",
|
|
801
|
-
children: [/* @__PURE__ */
|
|
801
|
+
children: [/* @__PURE__ */ U("span", {
|
|
802
802
|
className: "flex h-5 items-center text-[20px] leading-none",
|
|
803
803
|
"aria-hidden": "true",
|
|
804
804
|
children: "🎁"
|
|
805
|
-
}), /* @__PURE__ */
|
|
805
|
+
}), /* @__PURE__ */ W("span", {
|
|
806
806
|
className: "text-[14px] font-bold leading-[1.43] tracking-[0.28px] text-[rgba(4,4,3,0.9)]",
|
|
807
807
|
children: [t, " tip!"]
|
|
808
808
|
})]
|
|
809
809
|
}) : null;
|
|
810
|
-
},
|
|
811
|
-
let { message: e } =
|
|
810
|
+
}, nn = () => {
|
|
811
|
+
let { message: e } = V("SentMessageDeliveryStatus"), { messages: t } = me("SentMessageDeliveryStatus"), n = (() => {
|
|
812
812
|
if (t) for (let e = t.length - 1; e >= 0; --e) {
|
|
813
813
|
let n = t[e];
|
|
814
814
|
if (n.type !== "system" && n.type !== "ephemeral" && n.type !== "deleted") return n.id;
|
|
815
815
|
}
|
|
816
816
|
})();
|
|
817
817
|
return e.id === n;
|
|
818
|
-
},
|
|
818
|
+
}, rn = () => nn() ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(je, {
|
|
819
819
|
weight: "bold",
|
|
820
820
|
"aria-hidden": "true"
|
|
821
|
-
}), /* @__PURE__ */
|
|
821
|
+
}), /* @__PURE__ */ U("span", {
|
|
822
822
|
"data-testid": "sent-message-delivery-status",
|
|
823
823
|
children: "Delivered"
|
|
824
|
-
})] }) : null,
|
|
824
|
+
})] }) : null, an = () => nn() ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(Me, {
|
|
825
825
|
className: "sent-message-status__spinner animate-spin",
|
|
826
826
|
weight: "bold",
|
|
827
827
|
"aria-hidden": "true"
|
|
828
|
-
}), /* @__PURE__ */
|
|
828
|
+
}), /* @__PURE__ */ U("span", {
|
|
829
829
|
"data-testid": "sent-message-sending-status",
|
|
830
830
|
children: "Sending"
|
|
831
|
-
})] }) : null,
|
|
832
|
-
let n = e.name || "Broadcast", r = /* @__PURE__ */
|
|
831
|
+
})] }) : null, on = ({ outbound: e, onOutboundClick: t }) => {
|
|
832
|
+
let n = e.name || "Broadcast", r = /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("span", {
|
|
833
833
|
className: "sent-message-outbound-badge",
|
|
834
834
|
"aria-hidden": "true",
|
|
835
|
-
children: /* @__PURE__ */
|
|
836
|
-
}), /* @__PURE__ */
|
|
837
|
-
className:
|
|
835
|
+
children: /* @__PURE__ */ U(Ie, { weight: "fill" })
|
|
836
|
+
}), /* @__PURE__ */ U("span", {
|
|
837
|
+
className: J("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
|
|
838
838
|
"data-testid": "sent-message-outbound-status",
|
|
839
839
|
children: n
|
|
840
840
|
})] });
|
|
841
|
-
return t ? /* @__PURE__ */
|
|
841
|
+
return t ? /* @__PURE__ */ U("button", {
|
|
842
842
|
type: "button",
|
|
843
843
|
className: "inline-flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-inherit [font:inherit]",
|
|
844
844
|
"aria-label": `View broadcast ${n}`,
|
|
845
845
|
onClick: () => t(e),
|
|
846
846
|
children: r
|
|
847
847
|
}) : r;
|
|
848
|
-
},
|
|
848
|
+
}, sn = () => /* @__PURE__ */ W("span", {
|
|
849
849
|
className: "str-chat__message-status sent-message-status--failed",
|
|
850
|
-
children: [/* @__PURE__ */
|
|
850
|
+
children: [/* @__PURE__ */ U(qe, {
|
|
851
851
|
weight: "bold",
|
|
852
852
|
"aria-hidden": "true"
|
|
853
|
-
}), /* @__PURE__ */
|
|
853
|
+
}), /* @__PURE__ */ U("span", {
|
|
854
854
|
"data-testid": "sent-message-failed-status",
|
|
855
855
|
children: "Failed to send"
|
|
856
856
|
})]
|
|
857
|
-
}),
|
|
858
|
-
let { isMyMessage: n, message: r, threadList: i } =
|
|
857
|
+
}), cn = ({ onOutboundClick: e, resolvedOutbound: t }) => {
|
|
858
|
+
let { isMyMessage: n, message: r, threadList: i } = V("SentMessageDeliveryStatus"), a = n(), o = nn();
|
|
859
859
|
if (i) return null;
|
|
860
|
-
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */
|
|
860
|
+
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ U(sn, {});
|
|
861
861
|
if (!a) return null;
|
|
862
|
-
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */
|
|
862
|
+
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ U(on, {
|
|
863
863
|
outbound: t,
|
|
864
864
|
onOutboundClick: e
|
|
865
|
-
}) : null, l =
|
|
866
|
-
MessageSentStatus:
|
|
867
|
-
MessageDeliveredStatus:
|
|
868
|
-
MessageReadStatus:
|
|
869
|
-
MessageSendingStatus:
|
|
865
|
+
}) : null, l = Wt(r) ? null : /* @__PURE__ */ U(L, {
|
|
866
|
+
MessageSentStatus: rn,
|
|
867
|
+
MessageDeliveredStatus: rn,
|
|
868
|
+
MessageReadStatus: rn,
|
|
869
|
+
MessageSendingStatus: en(r) ? rn : an
|
|
870
870
|
});
|
|
871
|
-
return c ? /* @__PURE__ */
|
|
871
|
+
return c ? /* @__PURE__ */ W("span", {
|
|
872
872
|
className: "sent-message-status-row",
|
|
873
873
|
children: [
|
|
874
874
|
l,
|
|
875
|
-
l && o && /* @__PURE__ */
|
|
875
|
+
l && o && /* @__PURE__ */ U("span", {
|
|
876
876
|
className: "sent-message-outbound-separator",
|
|
877
877
|
"aria-hidden": "true",
|
|
878
878
|
children: "•"
|
|
@@ -880,27 +880,27 @@ var Nt = o.lazy(() => import("./Card-C7uLQbYz.js")), Pt = o.lazy(() => import(".
|
|
|
880
880
|
c
|
|
881
881
|
]
|
|
882
882
|
}) : l;
|
|
883
|
-
},
|
|
883
|
+
}, ln = /^([a-z][a-z0-9+.-]*):/i, un = /* @__PURE__ */ new Set([
|
|
884
884
|
"http",
|
|
885
885
|
"https",
|
|
886
886
|
"mailto",
|
|
887
887
|
"tel",
|
|
888
888
|
"sms"
|
|
889
889
|
]);
|
|
890
|
-
function
|
|
890
|
+
function dn(e) {
|
|
891
891
|
if (typeof e != "string") return;
|
|
892
892
|
let t = e.trim();
|
|
893
893
|
if (t === "") return;
|
|
894
|
-
let n =
|
|
894
|
+
let n = ln.exec(t);
|
|
895
895
|
if (n) {
|
|
896
896
|
let e = n[1].toLowerCase();
|
|
897
|
-
return
|
|
897
|
+
return un.has(e) ? t : void 0;
|
|
898
898
|
}
|
|
899
899
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
900
900
|
}
|
|
901
901
|
//#endregion
|
|
902
902
|
//#region src/components/LinkAttachment/components/_shared/CardCta.tsx
|
|
903
|
-
var
|
|
903
|
+
var fn = {
|
|
904
904
|
dark: {
|
|
905
905
|
primary: "bg-white text-[#121110] hover:bg-white/90",
|
|
906
906
|
secondary: "bg-white/15 text-white hover:bg-white/25"
|
|
@@ -909,12 +909,12 @@ var dn = {
|
|
|
909
909
|
primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
|
|
910
910
|
secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
|
|
911
911
|
}
|
|
912
|
-
},
|
|
913
|
-
let i = t.variant ?? "primary", a =
|
|
912
|
+
}, pn = ({ variant: e, cta: t, fullWidth: n = !0, standalone: r = !1 }) => {
|
|
913
|
+
let i = t.variant ?? "primary", a = J("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2", fn[e][i]), o = n ? t.label : /* @__PURE__ */ U("span", {
|
|
914
914
|
className: "min-w-0 truncate",
|
|
915
915
|
children: t.label
|
|
916
|
-
}), s =
|
|
917
|
-
return s ? /* @__PURE__ */
|
|
916
|
+
}), s = dn(t.href);
|
|
917
|
+
return s ? /* @__PURE__ */ U("a", {
|
|
918
918
|
href: s,
|
|
919
919
|
target: "_blank",
|
|
920
920
|
rel: "noopener noreferrer",
|
|
@@ -923,7 +923,7 @@ var dn = {
|
|
|
923
923
|
},
|
|
924
924
|
className: `${a} no-underline`,
|
|
925
925
|
children: o
|
|
926
|
-
}) : /* @__PURE__ */
|
|
926
|
+
}) : /* @__PURE__ */ U("button", {
|
|
927
927
|
type: "button",
|
|
928
928
|
onClick: (e) => {
|
|
929
929
|
e.stopPropagation(), t.onClick?.();
|
|
@@ -931,30 +931,30 @@ var dn = {
|
|
|
931
931
|
className: a,
|
|
932
932
|
children: o
|
|
933
933
|
});
|
|
934
|
-
},
|
|
934
|
+
}, mn = {
|
|
935
935
|
dark: "text-white",
|
|
936
936
|
light: "text-black/90"
|
|
937
|
-
},
|
|
937
|
+
}, hn = "text-white/30", gn = {
|
|
938
938
|
dark: "text-white/55",
|
|
939
939
|
light: "text-black/55"
|
|
940
|
-
},
|
|
940
|
+
}, _n = {
|
|
941
941
|
dark: "bg-white/25",
|
|
942
942
|
light: "bg-black/15"
|
|
943
|
-
},
|
|
943
|
+
}, vn = ({ variant: e, ctaSurface: t, chinTextColor: n, title: r, placeholderTitle: i, description: a, descriptionLines: o = 1, url: s, appIcon: c, cta: l, trailingAction: u, isLoading: d = !1 }) => {
|
|
944
944
|
let f = e === "dark", p = r ?? (f ? i : void 0) ?? "", m = p.trim() !== "", h = a != null && a.trim() !== "", g = typeof s == "string" ? s.trim() : "", _ = g !== "", v = l != null;
|
|
945
945
|
if (!d && !m && !h && !_ && !v) return null;
|
|
946
|
-
let y =
|
|
946
|
+
let y = J("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ? hn : mn[e])), b = J("truncate text-[12px] leading-4 tracking-[0.24px]", n == null && gn[e]), x = J("text-[12px] leading-4 tracking-[0.24px]", o <= 1 && "truncate", n == null && gn[e]);
|
|
947
947
|
if (d) {
|
|
948
|
-
let t =
|
|
949
|
-
return /* @__PURE__ */
|
|
948
|
+
let t = J("animate-pulse rounded", _n[e]);
|
|
949
|
+
return /* @__PURE__ */ U("div", {
|
|
950
950
|
className: "shrink-0 px-4 py-3",
|
|
951
|
-
children: /* @__PURE__ */
|
|
951
|
+
children: /* @__PURE__ */ W("div", {
|
|
952
952
|
className: "flex min-w-0 flex-col gap-[2px]",
|
|
953
|
-
children: [/* @__PURE__ */
|
|
954
|
-
className:
|
|
953
|
+
children: [/* @__PURE__ */ U("div", {
|
|
954
|
+
className: J("h-5 w-3/4", t),
|
|
955
955
|
"aria-hidden": !0
|
|
956
|
-
}), /* @__PURE__ */
|
|
957
|
-
className:
|
|
956
|
+
}), /* @__PURE__ */ U("div", {
|
|
957
|
+
className: J("h-4 w-1/2", t),
|
|
958
958
|
"aria-hidden": !0
|
|
959
959
|
})]
|
|
960
960
|
})
|
|
@@ -967,55 +967,55 @@ var dn = {
|
|
|
967
967
|
WebkitLineClamp: o,
|
|
968
968
|
overflow: "hidden"
|
|
969
969
|
} : S;
|
|
970
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ W("div", {
|
|
971
971
|
className: "shrink-0 px-4 py-3",
|
|
972
|
-
children: [/* @__PURE__ */
|
|
972
|
+
children: [/* @__PURE__ */ W("div", {
|
|
973
973
|
className: "flex items-end gap-3",
|
|
974
|
-
children: [/* @__PURE__ */
|
|
974
|
+
children: [/* @__PURE__ */ W("div", {
|
|
975
975
|
className: "flex min-w-0 flex-1 flex-col gap-[2px]",
|
|
976
976
|
children: [
|
|
977
|
-
m && /* @__PURE__ */
|
|
977
|
+
m && /* @__PURE__ */ W("div", {
|
|
978
978
|
className: "flex min-w-0 items-center gap-2",
|
|
979
|
-
children: [c ? /* @__PURE__ */
|
|
979
|
+
children: [c ? /* @__PURE__ */ U("span", {
|
|
980
980
|
className: "shrink-0",
|
|
981
981
|
children: c
|
|
982
|
-
}) : null, /* @__PURE__ */
|
|
983
|
-
className:
|
|
982
|
+
}) : null, /* @__PURE__ */ U("p", {
|
|
983
|
+
className: J("min-w-0", y),
|
|
984
984
|
style: S,
|
|
985
985
|
children: p
|
|
986
986
|
})]
|
|
987
987
|
}),
|
|
988
|
-
h && /* @__PURE__ */
|
|
988
|
+
h && /* @__PURE__ */ U("p", {
|
|
989
989
|
className: x,
|
|
990
990
|
style: C,
|
|
991
991
|
children: a
|
|
992
992
|
}),
|
|
993
|
-
!v && _ && /* @__PURE__ */
|
|
993
|
+
!v && _ && /* @__PURE__ */ U("p", {
|
|
994
994
|
className: b,
|
|
995
995
|
style: S,
|
|
996
996
|
"data-testid": "link-attachment-url",
|
|
997
997
|
children: g
|
|
998
998
|
})
|
|
999
999
|
]
|
|
1000
|
-
}), u && /* @__PURE__ */
|
|
1000
|
+
}), u && /* @__PURE__ */ U("div", {
|
|
1001
1001
|
className: "shrink-0",
|
|
1002
1002
|
children: u
|
|
1003
1003
|
})]
|
|
1004
|
-
}), l && /* @__PURE__ */
|
|
1004
|
+
}), l && /* @__PURE__ */ U(pn, {
|
|
1005
1005
|
variant: t ?? e,
|
|
1006
1006
|
cta: l
|
|
1007
1007
|
})]
|
|
1008
1008
|
});
|
|
1009
|
-
},
|
|
1010
|
-
let f =
|
|
1009
|
+
}, yn = "Loading link preview", bn = J("relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden", "rounded-[20px]"), xn = "flex h-[250px] flex-col", Sn = ({ variant: e, children: t, href: n, onClick: r, ariaLabel: i, rootRef: a, topRight: o, bgClassName: s, accentHex: c, fixedHeight: l = !1, busy: u = !1, "data-testid": d }) => {
|
|
1010
|
+
let f = J("messaging-link-card", bn, l ? xn : "block", s ?? (e === "dark" ? "bg-[#1e2330]" : "bg-[#f1f0ee]"), n != null || r != null ? "cursor-pointer no-underline focus-ring" : null), p = u ? {
|
|
1011
1011
|
role: "status",
|
|
1012
1012
|
"aria-busy": !0,
|
|
1013
|
-
"aria-label":
|
|
1014
|
-
} : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */
|
|
1013
|
+
"aria-label": yn
|
|
1014
|
+
} : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */ U("div", {
|
|
1015
1015
|
className: "pointer-events-auto absolute right-3 top-3 z-10",
|
|
1016
1016
|
children: o
|
|
1017
1017
|
}) : null;
|
|
1018
|
-
return n ? /* @__PURE__ */
|
|
1018
|
+
return n ? /* @__PURE__ */ W("a", {
|
|
1019
1019
|
ref: a,
|
|
1020
1020
|
href: n,
|
|
1021
1021
|
target: "_blank",
|
|
@@ -1027,18 +1027,18 @@ var dn = {
|
|
|
1027
1027
|
style: m,
|
|
1028
1028
|
...p,
|
|
1029
1029
|
children: [t, h]
|
|
1030
|
-
}) : r ? /* @__PURE__ */
|
|
1030
|
+
}) : r ? /* @__PURE__ */ W("button", {
|
|
1031
1031
|
ref: a,
|
|
1032
1032
|
type: "button",
|
|
1033
1033
|
onClick: r,
|
|
1034
1034
|
"aria-label": i,
|
|
1035
1035
|
"data-testid": d,
|
|
1036
1036
|
"data-variant": e,
|
|
1037
|
-
className:
|
|
1037
|
+
className: J(f, "text-left"),
|
|
1038
1038
|
style: m,
|
|
1039
1039
|
...p,
|
|
1040
1040
|
children: [t, h]
|
|
1041
|
-
}) : /* @__PURE__ */
|
|
1041
|
+
}) : /* @__PURE__ */ W("div", {
|
|
1042
1042
|
ref: a,
|
|
1043
1043
|
"data-testid": d,
|
|
1044
1044
|
"data-variant": e,
|
|
@@ -1047,49 +1047,49 @@ var dn = {
|
|
|
1047
1047
|
...p,
|
|
1048
1048
|
children: [t, h]
|
|
1049
1049
|
});
|
|
1050
|
-
},
|
|
1050
|
+
}, Cn = {
|
|
1051
1051
|
dark: "bg-white/10",
|
|
1052
1052
|
light: "bg-black/5"
|
|
1053
|
-
},
|
|
1053
|
+
}, wn = {
|
|
1054
1054
|
dark: "size-16 text-white/25",
|
|
1055
1055
|
light: "size-16 text-black/25"
|
|
1056
|
-
},
|
|
1056
|
+
}, Tn = (e, n) => !!n && !!e && t(e) === "audio", En = (e, n) => {
|
|
1057
1057
|
if (!n || !e) return !1;
|
|
1058
1058
|
let r = t(e);
|
|
1059
1059
|
return r === "video" || r === "audio";
|
|
1060
|
-
},
|
|
1060
|
+
}, Dn = "bg-[#F2F3F4]", On = ({ variant: r, thumbnailUrl: i, sourceUrl: o, title: s, mimeType: c = "image/*", topLeft: l, topRight: u, isLoading: d = !1, onImageError: f }) => {
|
|
1061
1061
|
let p = t(c), m = !!o && p === "video", h = a(i);
|
|
1062
|
-
return !d &&
|
|
1062
|
+
return !d && Tn(c, o) ? /* @__PURE__ */ U("div", {
|
|
1063
1063
|
className: "p-3",
|
|
1064
|
-
children: /* @__PURE__ */
|
|
1064
|
+
children: /* @__PURE__ */ U("audio", {
|
|
1065
1065
|
...e,
|
|
1066
1066
|
src: o,
|
|
1067
1067
|
controls: !0,
|
|
1068
1068
|
preload: "metadata",
|
|
1069
1069
|
className: "block w-full",
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ U("track", { kind: "captions" })
|
|
1071
1071
|
})
|
|
1072
|
-
}) : /* @__PURE__ */
|
|
1073
|
-
className:
|
|
1072
|
+
}) : /* @__PURE__ */ W("div", {
|
|
1073
|
+
className: J("relative min-h-0 w-full flex-1 overflow-hidden", m && "bg-black"),
|
|
1074
1074
|
children: [
|
|
1075
|
-
d ? /* @__PURE__ */
|
|
1076
|
-
className:
|
|
1075
|
+
d ? /* @__PURE__ */ U("div", {
|
|
1076
|
+
className: J("h-full w-full animate-pulse", Cn[r]),
|
|
1077
1077
|
"aria-hidden": !0
|
|
1078
|
-
}) : m ? /* @__PURE__ */
|
|
1078
|
+
}) : m ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("video", {
|
|
1079
1079
|
src: o,
|
|
1080
1080
|
poster: h,
|
|
1081
1081
|
controls: !0,
|
|
1082
1082
|
playsInline: !0,
|
|
1083
1083
|
preload: "metadata",
|
|
1084
1084
|
className: "absolute inset-0 h-full w-full object-contain",
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1086
|
-
}), h && f ? /* @__PURE__ */
|
|
1085
|
+
children: /* @__PURE__ */ U("track", { kind: "captions" })
|
|
1086
|
+
}), h && f ? /* @__PURE__ */ U("img", {
|
|
1087
1087
|
src: h,
|
|
1088
1088
|
alt: "",
|
|
1089
1089
|
"aria-hidden": !0,
|
|
1090
1090
|
onError: f,
|
|
1091
1091
|
className: "hidden"
|
|
1092
|
-
}) : null] }) : i ? /* @__PURE__ */
|
|
1092
|
+
}) : null] }) : i ? /* @__PURE__ */ U("img", {
|
|
1093
1093
|
src: h ?? i,
|
|
1094
1094
|
alt: s ?? "",
|
|
1095
1095
|
draggable: !1,
|
|
@@ -1097,42 +1097,42 @@ var dn = {
|
|
|
1097
1097
|
decoding: "async",
|
|
1098
1098
|
onError: f,
|
|
1099
1099
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
1100
|
-
}) : /* @__PURE__ */
|
|
1101
|
-
className:
|
|
1100
|
+
}) : /* @__PURE__ */ U("div", {
|
|
1101
|
+
className: J("flex h-full w-full items-center justify-center", Cn[r]),
|
|
1102
1102
|
children: n(c, {
|
|
1103
|
-
className:
|
|
1103
|
+
className: wn[r],
|
|
1104
1104
|
weight: "regular"
|
|
1105
1105
|
})
|
|
1106
1106
|
}),
|
|
1107
|
-
l ? /* @__PURE__ */
|
|
1107
|
+
l ? /* @__PURE__ */ U("div", {
|
|
1108
1108
|
className: "pointer-events-auto absolute left-3 top-3 z-10",
|
|
1109
1109
|
children: l
|
|
1110
1110
|
}) : null,
|
|
1111
|
-
u ? /* @__PURE__ */
|
|
1111
|
+
u ? /* @__PURE__ */ U("div", {
|
|
1112
1112
|
className: "pointer-events-auto absolute right-3 top-3 z-10",
|
|
1113
1113
|
children: u
|
|
1114
1114
|
}) : null
|
|
1115
1115
|
]
|
|
1116
1116
|
});
|
|
1117
|
-
},
|
|
1118
|
-
function
|
|
1117
|
+
}, kn = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1118
|
+
function An(e) {
|
|
1119
1119
|
let t = e.trim();
|
|
1120
1120
|
return t.startsWith("#") ? t : `#${t}`;
|
|
1121
1121
|
}
|
|
1122
1122
|
//#endregion
|
|
1123
1123
|
//#region src/components/LinkAttachment/components/_shared/useChinPalette.ts
|
|
1124
|
-
var
|
|
1125
|
-
dark:
|
|
1126
|
-
light:
|
|
1124
|
+
var jn = "#FFFFFF", Mn = "#040403", Nn = {
|
|
1125
|
+
dark: jn,
|
|
1126
|
+
light: Mn
|
|
1127
1127
|
};
|
|
1128
|
-
function
|
|
1128
|
+
function Pn({ variant: e, accentColor: t, status: n = "ready", layout: r = "featured", thumbnailUrl: i, mimeType: a, sourceUrl: s }) {
|
|
1129
1129
|
let [c, l] = o.useState(!1);
|
|
1130
1130
|
o.useEffect(() => {
|
|
1131
1131
|
l(!1);
|
|
1132
1132
|
}, [i]);
|
|
1133
1133
|
let u = o.useCallback(() => {
|
|
1134
1134
|
l(!0);
|
|
1135
|
-
}, []), d =
|
|
1135
|
+
}, []), d = Tn(a, s), f = r === "featured" && i && !d && !c && n === "ready" && t != null && kn.test(t.trim()) ? An(t) : void 0, p = d ? Mn : Nn[e];
|
|
1136
1136
|
return {
|
|
1137
1137
|
thumbnailUrl: c ? void 0 : i,
|
|
1138
1138
|
accentHex: f,
|
|
@@ -1144,8 +1144,8 @@ function Nn({ variant: e, accentColor: t, status: n = "ready", layout: r = "feat
|
|
|
1144
1144
|
}
|
|
1145
1145
|
//#endregion
|
|
1146
1146
|
//#region src/components/LinkAttachment/components/Composer/Card.tsx
|
|
1147
|
-
var
|
|
1148
|
-
let g = c === "classic", _ =
|
|
1147
|
+
var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white focus-ring", In = "relative before:absolute before:-inset-[10px] before:content-['']", Ln = ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onDismiss: p, onEditClick: m, dismissLabel: h = "Dismiss attachment" }) => {
|
|
1148
|
+
let g = c === "classic", _ = Tn(a, s), v = Pn({
|
|
1149
1149
|
variant: "dark",
|
|
1150
1150
|
accentColor: d,
|
|
1151
1151
|
status: f,
|
|
@@ -1153,50 +1153,50 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1153
1153
|
thumbnailUrl: o,
|
|
1154
1154
|
mimeType: a,
|
|
1155
1155
|
sourceUrl: s
|
|
1156
|
-
}), y = p ? /* @__PURE__ */
|
|
1156
|
+
}), y = p ? /* @__PURE__ */ U("button", {
|
|
1157
1157
|
type: "button",
|
|
1158
1158
|
onClick: p,
|
|
1159
1159
|
"aria-label": h,
|
|
1160
|
-
className:
|
|
1161
|
-
children: /* @__PURE__ */
|
|
1160
|
+
className: J(Fn, !_ && In),
|
|
1161
|
+
children: /* @__PURE__ */ U(Je, {
|
|
1162
1162
|
className: "size-3",
|
|
1163
1163
|
weight: "bold"
|
|
1164
1164
|
})
|
|
1165
|
-
}) : void 0, b = m ? /* @__PURE__ */
|
|
1165
|
+
}) : void 0, b = m ? /* @__PURE__ */ U("button", {
|
|
1166
1166
|
type: "button",
|
|
1167
1167
|
onClick: m,
|
|
1168
1168
|
"aria-label": "Edit attachment",
|
|
1169
1169
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ U(Le, {
|
|
1171
1171
|
className: "size-5",
|
|
1172
1172
|
weight: "regular"
|
|
1173
1173
|
})
|
|
1174
1174
|
}) : void 0;
|
|
1175
|
-
return _ && !v.isLoading ? /* @__PURE__ */
|
|
1175
|
+
return _ && !v.isLoading ? /* @__PURE__ */ U(Sn, {
|
|
1176
1176
|
variant: "dark",
|
|
1177
|
-
bgClassName:
|
|
1178
|
-
children: /* @__PURE__ */
|
|
1177
|
+
bgClassName: Dn,
|
|
1178
|
+
children: /* @__PURE__ */ W("div", {
|
|
1179
1179
|
className: "flex items-center gap-2 pr-3",
|
|
1180
|
-
children: [/* @__PURE__ */
|
|
1180
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1181
1181
|
className: "min-w-0 flex-1",
|
|
1182
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ U(On, {
|
|
1183
1183
|
variant: "dark",
|
|
1184
1184
|
sourceUrl: s,
|
|
1185
1185
|
title: e,
|
|
1186
1186
|
mimeType: a
|
|
1187
1187
|
})
|
|
1188
|
-
}), y && /* @__PURE__ */
|
|
1188
|
+
}), y && /* @__PURE__ */ U("div", {
|
|
1189
1189
|
className: "shrink-0",
|
|
1190
1190
|
children: y
|
|
1191
1191
|
})]
|
|
1192
1192
|
})
|
|
1193
|
-
}) : /* @__PURE__ */
|
|
1193
|
+
}) : /* @__PURE__ */ W(Sn, {
|
|
1194
1194
|
variant: "dark",
|
|
1195
1195
|
fixedHeight: !g,
|
|
1196
1196
|
accentHex: v.accentHex,
|
|
1197
1197
|
busy: v.isLoading,
|
|
1198
1198
|
topRight: g ? y : void 0,
|
|
1199
|
-
children: [!g && /* @__PURE__ */
|
|
1199
|
+
children: [!g && /* @__PURE__ */ U(On, {
|
|
1200
1200
|
variant: "dark",
|
|
1201
1201
|
thumbnailUrl: v.thumbnailUrl,
|
|
1202
1202
|
sourceUrl: s,
|
|
@@ -1205,7 +1205,7 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1205
1205
|
topRight: y,
|
|
1206
1206
|
isLoading: v.isLoading,
|
|
1207
1207
|
onImageError: v.onImageError
|
|
1208
|
-
}), /* @__PURE__ */
|
|
1208
|
+
}), /* @__PURE__ */ U(vn, {
|
|
1209
1209
|
chinTextColor: v.chinTextColor,
|
|
1210
1210
|
variant: "dark",
|
|
1211
1211
|
ctaSurface: v.surface,
|
|
@@ -1220,19 +1220,19 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1220
1220
|
isLoading: v.isLoading
|
|
1221
1221
|
})]
|
|
1222
1222
|
});
|
|
1223
|
-
},
|
|
1223
|
+
}, Rn = ({ accentHex: e, side: t, visible: n, children: r }) => n ? /* @__PURE__ */ W("div", {
|
|
1224
1224
|
className: "relative isolate w-fit",
|
|
1225
|
-
children: [r, /* @__PURE__ */
|
|
1225
|
+
children: [r, /* @__PURE__ */ U("span", {
|
|
1226
1226
|
"aria-hidden": !0,
|
|
1227
1227
|
"data-testid": "link-card-tail",
|
|
1228
1228
|
"data-variant": t === "sender" ? "dark" : "light",
|
|
1229
1229
|
style: e ? { "--accent": e } : void 0,
|
|
1230
|
-
className:
|
|
1230
|
+
className: J("messaging-link-card-tail", t === "receiver" && "messaging-link-card-tail--received")
|
|
1231
1231
|
})]
|
|
1232
|
-
}) : /* @__PURE__ */
|
|
1233
|
-
Composer:
|
|
1232
|
+
}) : /* @__PURE__ */ U(H, { children: r }), zn = {
|
|
1233
|
+
Composer: Ln,
|
|
1234
1234
|
Sent: ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onClick: p, groupPosition: m = "single" }) => {
|
|
1235
|
-
let h =
|
|
1235
|
+
let h = En(a, s), g = dn(i), _ = u == null && g != null && !h ? g : void 0, v = u == null && !h && _ != null ? p : void 0, y = f !== "loading" && Tn(a, s), b = Pn({
|
|
1236
1236
|
variant: "dark",
|
|
1237
1237
|
accentColor: d,
|
|
1238
1238
|
status: f,
|
|
@@ -1241,19 +1241,19 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1241
1241
|
mimeType: a,
|
|
1242
1242
|
sourceUrl: s
|
|
1243
1243
|
});
|
|
1244
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ U(Rn, {
|
|
1245
1245
|
accentHex: b.accentHex,
|
|
1246
1246
|
side: "sender",
|
|
1247
1247
|
visible: !y && (m === "single" || m === "end"),
|
|
1248
|
-
children: /* @__PURE__ */
|
|
1248
|
+
children: /* @__PURE__ */ W(Sn, {
|
|
1249
1249
|
variant: "dark",
|
|
1250
1250
|
href: _,
|
|
1251
1251
|
onClick: v,
|
|
1252
1252
|
fixedHeight: c === "featured" && !y,
|
|
1253
1253
|
accentHex: b.accentHex,
|
|
1254
1254
|
busy: b.isLoading,
|
|
1255
|
-
bgClassName: y ?
|
|
1256
|
-
children: [c === "featured" && /* @__PURE__ */
|
|
1255
|
+
bgClassName: y ? Dn : void 0,
|
|
1256
|
+
children: [c === "featured" && /* @__PURE__ */ U(On, {
|
|
1257
1257
|
variant: "dark",
|
|
1258
1258
|
thumbnailUrl: b.thumbnailUrl,
|
|
1259
1259
|
sourceUrl: s,
|
|
@@ -1261,7 +1261,7 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1261
1261
|
mimeType: a,
|
|
1262
1262
|
isLoading: b.isLoading,
|
|
1263
1263
|
onImageError: b.onImageError
|
|
1264
|
-
}), /* @__PURE__ */
|
|
1264
|
+
}), /* @__PURE__ */ U(vn, {
|
|
1265
1265
|
chinTextColor: b.chinTextColor,
|
|
1266
1266
|
variant: "dark",
|
|
1267
1267
|
ctaSurface: b.surface,
|
|
@@ -1278,12 +1278,12 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1278
1278
|
});
|
|
1279
1279
|
},
|
|
1280
1280
|
Received: ({ title: e, description: t, descriptionLines: n, url: r, mimeType: i, thumbnailUrl: a, sourceUrl: o, layout: s = "featured", appIcon: c, cta: l, accentColor: u, status: d = "ready", onClick: f, groupPosition: p = "single" }) => {
|
|
1281
|
-
let m =
|
|
1281
|
+
let m = En(i, o), h = dn(r), g = l == null && h != null && !m ? h : void 0, _ = l == null && !m ? f : void 0, v = d !== "loading" && Tn(i, o) ? Dn : void 0, y = l && f ? {
|
|
1282
1282
|
...l,
|
|
1283
1283
|
onClick: () => {
|
|
1284
1284
|
f(), l.onClick?.();
|
|
1285
1285
|
}
|
|
1286
|
-
} : l, b =
|
|
1286
|
+
} : l, b = Pn({
|
|
1287
1287
|
variant: "light",
|
|
1288
1288
|
accentColor: u,
|
|
1289
1289
|
status: d,
|
|
@@ -1292,11 +1292,11 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1292
1292
|
mimeType: i,
|
|
1293
1293
|
sourceUrl: o
|
|
1294
1294
|
});
|
|
1295
|
-
return /* @__PURE__ */
|
|
1295
|
+
return /* @__PURE__ */ U(Rn, {
|
|
1296
1296
|
accentHex: b.accentHex,
|
|
1297
1297
|
side: "receiver",
|
|
1298
1298
|
visible: v == null && (p === "single" || p === "end"),
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1299
|
+
children: /* @__PURE__ */ W(Sn, {
|
|
1300
1300
|
variant: "light",
|
|
1301
1301
|
href: g,
|
|
1302
1302
|
onClick: _,
|
|
@@ -1306,7 +1306,7 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1306
1306
|
busy: b.isLoading,
|
|
1307
1307
|
bgClassName: v,
|
|
1308
1308
|
"data-testid": "link-attachment",
|
|
1309
|
-
children: [s === "featured" && /* @__PURE__ */
|
|
1309
|
+
children: [s === "featured" && /* @__PURE__ */ U(On, {
|
|
1310
1310
|
variant: "light",
|
|
1311
1311
|
thumbnailUrl: b.thumbnailUrl,
|
|
1312
1312
|
sourceUrl: o,
|
|
@@ -1314,7 +1314,7 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1314
1314
|
mimeType: i,
|
|
1315
1315
|
isLoading: b.isLoading,
|
|
1316
1316
|
onImageError: b.onImageError
|
|
1317
|
-
}), /* @__PURE__ */
|
|
1317
|
+
}), /* @__PURE__ */ U(vn, {
|
|
1318
1318
|
chinTextColor: b.chinTextColor,
|
|
1319
1319
|
variant: "light",
|
|
1320
1320
|
ctaSurface: b.surface,
|
|
@@ -1329,16 +1329,16 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1329
1329
|
})
|
|
1330
1330
|
});
|
|
1331
1331
|
}
|
|
1332
|
-
},
|
|
1332
|
+
}, Bn = {
|
|
1333
1333
|
dark: "bg-[#1e2330]",
|
|
1334
1334
|
light: "bg-[#f2f1ef]"
|
|
1335
|
-
},
|
|
1335
|
+
}, Vn = {
|
|
1336
1336
|
dark: "text-white",
|
|
1337
1337
|
light: "text-[#000000]"
|
|
1338
|
-
},
|
|
1338
|
+
}, Hn = {
|
|
1339
1339
|
dark: "border-white/[0.08]",
|
|
1340
1340
|
light: "border-black/[0.08]"
|
|
1341
|
-
},
|
|
1341
|
+
}, Un = (e) => e === "dark" ? "sender" : "receiver", Wn = {
|
|
1342
1342
|
sender: {
|
|
1343
1343
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1344
1344
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1351,47 +1351,47 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1351
1351
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
1352
1352
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
1353
1353
|
}
|
|
1354
|
-
},
|
|
1355
|
-
let u = t != null && t !== "", d = o ?? Un
|
|
1356
|
-
return /* @__PURE__ */
|
|
1354
|
+
}, Gn = ({ variant: e, text: t, bordered: n = !0, groupPosition: r = "single", widthClassName: i = "w-[280px]", paddingClassName: a = "px-2 py-2", radiusClassName: o, className: s, children: c, "data-testid": l }) => {
|
|
1355
|
+
let u = t != null && t !== "", d = o ?? Wn[Un(e)][r];
|
|
1356
|
+
return /* @__PURE__ */ W("div", {
|
|
1357
1357
|
"data-testid": l,
|
|
1358
1358
|
"data-group-position": r,
|
|
1359
|
-
className:
|
|
1360
|
-
children: [c, u ? /* @__PURE__ */
|
|
1361
|
-
className:
|
|
1359
|
+
className: J("relative", i, "overflow-hidden", a, u && "pb-0", d, Bn[e], Vn[e], n && "border", n && Hn[e], s),
|
|
1360
|
+
children: [c, u ? /* @__PURE__ */ U("p", {
|
|
1361
|
+
className: J("whitespace-pre-wrap break-words leading-snug hyphens-manual", "pb-2 pt-2", "px-2"),
|
|
1362
1362
|
children: t
|
|
1363
1363
|
}) : null]
|
|
1364
1364
|
});
|
|
1365
|
-
},
|
|
1365
|
+
}, Kn = ({ onClick: e, variant: t = "overlay", ariaLabel: n = "Dismiss attachment" }) => /* @__PURE__ */ U("button", {
|
|
1366
1366
|
type: "button",
|
|
1367
1367
|
onClick: (t) => {
|
|
1368
1368
|
t.stopPropagation(), e();
|
|
1369
1369
|
},
|
|
1370
1370
|
"aria-label": n,
|
|
1371
|
-
className:
|
|
1372
|
-
children: /* @__PURE__ */
|
|
1371
|
+
className: J("flex size-6 items-center justify-center rounded-full text-white", t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"),
|
|
1372
|
+
children: /* @__PURE__ */ U(Je, {
|
|
1373
1373
|
className: "size-3",
|
|
1374
1374
|
weight: "bold"
|
|
1375
1375
|
})
|
|
1376
|
-
}),
|
|
1376
|
+
}), qn = (e) => e === "received" ? "light" : "dark", Jn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Yn = ({ src: e, mimeType: t, filename: n, items: r }) => r && r.length > 0 ? r : e ? [{
|
|
1377
1377
|
src: e,
|
|
1378
1378
|
mimeType: t,
|
|
1379
1379
|
filename: n
|
|
1380
|
-
}] : [],
|
|
1380
|
+
}] : [], Xn = ({ item: t, preload: n, trailingAction: r }) => /* @__PURE__ */ W("div", {
|
|
1381
1381
|
className: "flex items-center gap-2",
|
|
1382
|
-
children: [/* @__PURE__ */
|
|
1382
|
+
children: [/* @__PURE__ */ U("audio", {
|
|
1383
1383
|
...e,
|
|
1384
1384
|
src: t.src,
|
|
1385
1385
|
controls: !0,
|
|
1386
1386
|
preload: t.preload ?? n,
|
|
1387
1387
|
className: "block min-w-0 flex-1",
|
|
1388
|
-
children: t.mimeType ? /* @__PURE__ */
|
|
1388
|
+
children: t.mimeType ? /* @__PURE__ */ U("source", {
|
|
1389
1389
|
src: t.src,
|
|
1390
1390
|
type: t.mimeType
|
|
1391
1391
|
}) : null
|
|
1392
1392
|
}), r ?? null]
|
|
1393
|
-
}),
|
|
1394
|
-
let l =
|
|
1393
|
+
}), Zn = ({ state: e, src: t, mimeType: n, filename: r, items: i, text: a, groupPosition: o, preload: s, onDismiss: c }) => {
|
|
1394
|
+
let l = qn(e), u = e === "composer" && !!c, d = Yn({
|
|
1395
1395
|
src: t,
|
|
1396
1396
|
mimeType: n,
|
|
1397
1397
|
filename: r,
|
|
@@ -1399,43 +1399,43 @@ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1399
1399
|
});
|
|
1400
1400
|
if (d.length === 0) return null;
|
|
1401
1401
|
let f = s ?? (d.length > 1 ? "none" : "metadata");
|
|
1402
|
-
return /* @__PURE__ */
|
|
1402
|
+
return /* @__PURE__ */ U(Gn, {
|
|
1403
1403
|
variant: l,
|
|
1404
1404
|
text: a,
|
|
1405
1405
|
groupPosition: o,
|
|
1406
1406
|
"data-testid": "audio-attachment",
|
|
1407
|
-
children: /* @__PURE__ */
|
|
1407
|
+
children: /* @__PURE__ */ U("div", {
|
|
1408
1408
|
className: "flex flex-col gap-2",
|
|
1409
|
-
children: d.map((e, t) => /* @__PURE__ */
|
|
1409
|
+
children: d.map((e, t) => /* @__PURE__ */ U(Xn, {
|
|
1410
1410
|
item: e,
|
|
1411
1411
|
preload: f,
|
|
1412
|
-
trailingAction: u && t === 0 ? /* @__PURE__ */
|
|
1412
|
+
trailingAction: u && t === 0 ? /* @__PURE__ */ U(Kn, {
|
|
1413
1413
|
onClick: c,
|
|
1414
1414
|
variant: "inline"
|
|
1415
1415
|
}) : void 0
|
|
1416
1416
|
}, `${e.src}-${t}`))
|
|
1417
1417
|
})
|
|
1418
1418
|
});
|
|
1419
|
-
},
|
|
1420
|
-
Composer: (e) => /* @__PURE__ */
|
|
1419
|
+
}, Qn = {
|
|
1420
|
+
Composer: (e) => /* @__PURE__ */ U(Zn, {
|
|
1421
1421
|
...e,
|
|
1422
1422
|
state: "composer"
|
|
1423
1423
|
}),
|
|
1424
|
-
Sent: (e) => /* @__PURE__ */
|
|
1424
|
+
Sent: (e) => /* @__PURE__ */ U(Zn, {
|
|
1425
1425
|
...e,
|
|
1426
1426
|
state: "sent"
|
|
1427
1427
|
}),
|
|
1428
|
-
Received: (e) => /* @__PURE__ */
|
|
1428
|
+
Received: (e) => /* @__PURE__ */ U(Zn, {
|
|
1429
1429
|
...e,
|
|
1430
1430
|
state: "received"
|
|
1431
1431
|
})
|
|
1432
1432
|
};
|
|
1433
1433
|
//#endregion
|
|
1434
1434
|
//#region src/components/MessageAttachment/_shared/fileMeta.ts
|
|
1435
|
-
function
|
|
1435
|
+
function $n(e) {
|
|
1436
1436
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(2)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
|
|
1437
1437
|
}
|
|
1438
|
-
var
|
|
1438
|
+
var er = {
|
|
1439
1439
|
pdf: "PDF",
|
|
1440
1440
|
doc: "DOC",
|
|
1441
1441
|
xls: "XLS",
|
|
@@ -1445,7 +1445,7 @@ var $n = {
|
|
|
1445
1445
|
text: "TXT",
|
|
1446
1446
|
markdown: "MD"
|
|
1447
1447
|
};
|
|
1448
|
-
function
|
|
1448
|
+
function tr(e, n) {
|
|
1449
1449
|
if (n) {
|
|
1450
1450
|
let e = n.lastIndexOf(".");
|
|
1451
1451
|
if (e > 0 && e < n.length - 1) {
|
|
@@ -1455,17 +1455,17 @@ function er(e, n) {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
if (!e) return;
|
|
1457
1457
|
if (t(e) === "document") {
|
|
1458
|
-
let t =
|
|
1458
|
+
let t = er[i(e)];
|
|
1459
1459
|
if (t) return t;
|
|
1460
1460
|
if (e === "application/octet-stream") return;
|
|
1461
1461
|
}
|
|
1462
1462
|
let r = e.split("/")[1];
|
|
1463
1463
|
if (!(!r || r === "*")) return r.toUpperCase();
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1466
|
-
return [
|
|
1465
|
+
function nr(e, t, n) {
|
|
1466
|
+
return [tr(e, t), typeof n == "number" && n > 0 ? $n(n) : void 0].filter(Boolean).join(" · ") || void 0;
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function Z(e) {
|
|
1469
1469
|
try {
|
|
1470
1470
|
let t = new URL(e).pathname.split("/").pop();
|
|
1471
1471
|
return t && t.length > 0 ? decodeURIComponent(t) : "download";
|
|
@@ -1475,42 +1475,42 @@ function Q(e) {
|
|
|
1475
1475
|
}
|
|
1476
1476
|
//#endregion
|
|
1477
1477
|
//#region src/components/MessageAttachment/_shared/CompactDocumentRow.tsx
|
|
1478
|
-
var
|
|
1478
|
+
var rr = {
|
|
1479
1479
|
dark: "text-white/55",
|
|
1480
1480
|
light: "text-black/65"
|
|
1481
|
-
},
|
|
1481
|
+
}, ir = {
|
|
1482
1482
|
dark: "bg-white/10",
|
|
1483
1483
|
light: "bg-black/5"
|
|
1484
|
-
},
|
|
1484
|
+
}, ar = {
|
|
1485
1485
|
dark: "text-white/85",
|
|
1486
1486
|
light: "text-black/85"
|
|
1487
|
-
},
|
|
1488
|
-
let l = r ?? t ?? "File", u =
|
|
1489
|
-
className:
|
|
1487
|
+
}, or = ({ variant: e, filename: t, title: r, mimeType: i = "application/octet-stream", fileSize: a, onActivate: o, activateLabel: s, trailingAction: c }) => {
|
|
1488
|
+
let l = r ?? t ?? "File", u = nr(i, t, a), d = /* @__PURE__ */ U("div", {
|
|
1489
|
+
className: J("flex size-10 shrink-0 items-center justify-center rounded-sm", ir[e]),
|
|
1490
1490
|
"aria-hidden": !0,
|
|
1491
1491
|
children: n(i, {
|
|
1492
|
-
className:
|
|
1492
|
+
className: J("size-6", ar[e]),
|
|
1493
1493
|
weight: "regular"
|
|
1494
1494
|
})
|
|
1495
|
-
}), f = /* @__PURE__ */
|
|
1495
|
+
}), f = /* @__PURE__ */ W("div", {
|
|
1496
1496
|
className: "flex min-w-0 flex-1 flex-col text-left",
|
|
1497
|
-
children: [/* @__PURE__ */
|
|
1497
|
+
children: [/* @__PURE__ */ U("p", {
|
|
1498
1498
|
className: "truncate font-medium leading-snug",
|
|
1499
1499
|
children: l
|
|
1500
|
-
}), u ? /* @__PURE__ */
|
|
1501
|
-
className:
|
|
1500
|
+
}), u ? /* @__PURE__ */ U("p", {
|
|
1501
|
+
className: J("truncate text-xs leading-4", rr[e]),
|
|
1502
1502
|
children: u
|
|
1503
1503
|
}) : null]
|
|
1504
|
-
}), p = o ? /* @__PURE__ */
|
|
1504
|
+
}), p = o ? /* @__PURE__ */ W("button", {
|
|
1505
1505
|
type: "button",
|
|
1506
1506
|
onClick: o,
|
|
1507
1507
|
"aria-label": s,
|
|
1508
|
-
className:
|
|
1508
|
+
className: J("flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors", e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"),
|
|
1509
1509
|
children: [d, f]
|
|
1510
|
-
}) : /* @__PURE__ */
|
|
1511
|
-
return /* @__PURE__ */
|
|
1510
|
+
}) : /* @__PURE__ */ W(H, { children: [d, f] });
|
|
1511
|
+
return /* @__PURE__ */ W("div", {
|
|
1512
1512
|
className: "flex items-center gap-3 px-3 py-2",
|
|
1513
|
-
children: [p, c ? /* @__PURE__ */
|
|
1513
|
+
children: [p, c ? /* @__PURE__ */ U("div", {
|
|
1514
1514
|
className: "shrink-0",
|
|
1515
1515
|
children: c
|
|
1516
1516
|
}) : null]
|
|
@@ -1518,8 +1518,8 @@ var nr = {
|
|
|
1518
1518
|
};
|
|
1519
1519
|
//#endregion
|
|
1520
1520
|
//#region src/components/MessageAttachment/_shared/triggerDownload.ts
|
|
1521
|
-
async function
|
|
1522
|
-
let n = t ??
|
|
1521
|
+
async function sr(e, t) {
|
|
1522
|
+
let n = t ?? Z(e);
|
|
1523
1523
|
try {
|
|
1524
1524
|
let t = await fetch(e, { mode: "cors" });
|
|
1525
1525
|
if (!t.ok) throw Error(`HTTP ${t.status}`);
|
|
@@ -1534,15 +1534,15 @@ async function or(e, t) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
//#endregion
|
|
1536
1536
|
//#region src/components/MessageAttachment/File/index.tsx
|
|
1537
|
-
var
|
|
1537
|
+
var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
|
|
1538
1538
|
src: e,
|
|
1539
1539
|
filename: t,
|
|
1540
1540
|
fileSize: n,
|
|
1541
1541
|
mimeType: r,
|
|
1542
1542
|
title: i
|
|
1543
|
-
}] : [],
|
|
1544
|
-
let a = t.filename ??
|
|
1545
|
-
return /* @__PURE__ */
|
|
1543
|
+
}] : [], lr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
1544
|
+
let a = t.filename ?? Z(t.src);
|
|
1545
|
+
return /* @__PURE__ */ U(or, {
|
|
1546
1546
|
variant: e,
|
|
1547
1547
|
filename: a,
|
|
1548
1548
|
title: t.title,
|
|
@@ -1552,8 +1552,8 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1552
1552
|
activateLabel: `Download ${a}`,
|
|
1553
1553
|
trailingAction: i
|
|
1554
1554
|
});
|
|
1555
|
-
},
|
|
1556
|
-
let d =
|
|
1555
|
+
}, ur = ({ state: e, src: t, filename: n, fileSize: r, mimeType: i, title: a, items: o, text: s, groupPosition: c, onClick: l, onDismiss: u }) => {
|
|
1556
|
+
let d = qn(e), f = e === "composer" && !!u, p = cr({
|
|
1557
1557
|
src: t,
|
|
1558
1558
|
filename: n,
|
|
1559
1559
|
fileSize: r,
|
|
@@ -1564,73 +1564,73 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1564
1564
|
if (l?.(e) === !1) return;
|
|
1565
1565
|
let t = p[e];
|
|
1566
1566
|
if (!t) return;
|
|
1567
|
-
let n = t.filename ??
|
|
1568
|
-
|
|
1567
|
+
let n = t.filename ?? Z(t.src);
|
|
1568
|
+
sr(t.src, n);
|
|
1569
1569
|
};
|
|
1570
1570
|
if (p.length === 0) return null;
|
|
1571
|
-
let h = /* @__PURE__ */
|
|
1572
|
-
className:
|
|
1571
|
+
let h = /* @__PURE__ */ U("span", {
|
|
1572
|
+
className: J("flex size-8 items-center justify-center rounded-full", d === "dark" ? "text-white/70" : "text-black/70"),
|
|
1573
1573
|
"aria-hidden": !0,
|
|
1574
|
-
children: /* @__PURE__ */
|
|
1574
|
+
children: /* @__PURE__ */ U(Ne, {
|
|
1575
1575
|
className: "size-5",
|
|
1576
1576
|
weight: "bold"
|
|
1577
1577
|
})
|
|
1578
1578
|
});
|
|
1579
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ U(Gn, {
|
|
1580
1580
|
variant: d,
|
|
1581
1581
|
text: s,
|
|
1582
1582
|
groupPosition: c,
|
|
1583
1583
|
"data-testid": "file-attachment",
|
|
1584
|
-
children: /* @__PURE__ */
|
|
1584
|
+
children: /* @__PURE__ */ U("div", {
|
|
1585
1585
|
className: "flex flex-col gap-2",
|
|
1586
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
1586
|
+
children: p.map((e, t) => /* @__PURE__ */ U(lr, {
|
|
1587
1587
|
variant: d,
|
|
1588
1588
|
item: e,
|
|
1589
1589
|
index: t,
|
|
1590
1590
|
onActivate: m,
|
|
1591
|
-
trailingAction: f && t === 0 ? /* @__PURE__ */
|
|
1591
|
+
trailingAction: f && t === 0 ? /* @__PURE__ */ U(Kn, {
|
|
1592
1592
|
onClick: u,
|
|
1593
1593
|
variant: "inline"
|
|
1594
1594
|
}) : h
|
|
1595
1595
|
}, `${e.src}-${t}`))
|
|
1596
1596
|
})
|
|
1597
1597
|
});
|
|
1598
|
-
},
|
|
1599
|
-
Composer: (e) => /* @__PURE__ */
|
|
1598
|
+
}, dr = {
|
|
1599
|
+
Composer: (e) => /* @__PURE__ */ U(ur, {
|
|
1600
1600
|
...e,
|
|
1601
1601
|
state: "composer"
|
|
1602
1602
|
}),
|
|
1603
|
-
Sent: (e) => /* @__PURE__ */
|
|
1603
|
+
Sent: (e) => /* @__PURE__ */ U(ur, {
|
|
1604
1604
|
...e,
|
|
1605
1605
|
state: "sent"
|
|
1606
1606
|
}),
|
|
1607
|
-
Received: (e) => /* @__PURE__ */
|
|
1607
|
+
Received: (e) => /* @__PURE__ */ U(ur, {
|
|
1608
1608
|
...e,
|
|
1609
1609
|
state: "received"
|
|
1610
1610
|
})
|
|
1611
|
-
},
|
|
1611
|
+
}, fr = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", pr = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", mr = ({ onPrev: e, onNext: t, prevLabel: n = "Previous", nextLabel: r = "Next" }) => /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("button", {
|
|
1612
1612
|
type: "button",
|
|
1613
1613
|
onClick: e,
|
|
1614
1614
|
"aria-label": n,
|
|
1615
|
-
className: `${
|
|
1616
|
-
children: /* @__PURE__ */
|
|
1615
|
+
className: `${pr} left-4`,
|
|
1616
|
+
children: /* @__PURE__ */ U(ke, {
|
|
1617
1617
|
size: 20,
|
|
1618
1618
|
weight: "bold",
|
|
1619
1619
|
"aria-hidden": !0
|
|
1620
1620
|
})
|
|
1621
|
-
}), /* @__PURE__ */
|
|
1621
|
+
}), /* @__PURE__ */ U("button", {
|
|
1622
1622
|
type: "button",
|
|
1623
1623
|
onClick: t,
|
|
1624
1624
|
"aria-label": r,
|
|
1625
|
-
className: `${
|
|
1626
|
-
children: /* @__PURE__ */
|
|
1625
|
+
className: `${pr} right-4`,
|
|
1626
|
+
children: /* @__PURE__ */ U(Ae, {
|
|
1627
1627
|
size: 20,
|
|
1628
1628
|
weight: "bold",
|
|
1629
1629
|
"aria-hidden": !0
|
|
1630
1630
|
})
|
|
1631
|
-
})] }),
|
|
1631
|
+
})] }), hr = ({ url: e, filename: t, variant: n = "pill", label: r = "Download", iconOnly: i, tone: a = "dark", onTriggered: o }) => {
|
|
1632
1632
|
let [s, c] = h(!1), u = l((n) => {
|
|
1633
|
-
n.stopPropagation(), !s && (c(!0),
|
|
1633
|
+
n.stopPropagation(), !s && (c(!0), sr(e, t).catch(() => {}).finally(() => {
|
|
1634
1634
|
c(!1), o?.();
|
|
1635
1635
|
}));
|
|
1636
1636
|
}, [
|
|
@@ -1639,63 +1639,63 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1639
1639
|
t,
|
|
1640
1640
|
o
|
|
1641
1641
|
]), d = i ?? n !== "pill", f = {
|
|
1642
|
-
className:
|
|
1642
|
+
className: J(n === "pill" ? "size-4" : "size-5", "shrink-0"),
|
|
1643
1643
|
weight: "bold"
|
|
1644
1644
|
};
|
|
1645
|
-
return n === "inline" ? /* @__PURE__ */
|
|
1645
|
+
return n === "inline" ? /* @__PURE__ */ U("button", {
|
|
1646
1646
|
type: "button",
|
|
1647
1647
|
onClick: u,
|
|
1648
1648
|
disabled: s,
|
|
1649
1649
|
"aria-label": r,
|
|
1650
|
-
className:
|
|
1650
|
+
className: J("flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70", {
|
|
1651
1651
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
1652
1652
|
light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
|
|
1653
1653
|
}[a]),
|
|
1654
|
-
children: s ? /* @__PURE__ */
|
|
1654
|
+
children: s ? /* @__PURE__ */ U(Me, {
|
|
1655
1655
|
className: "size-4 animate-spin",
|
|
1656
1656
|
weight: "bold",
|
|
1657
1657
|
"aria-hidden": !0
|
|
1658
|
-
}) : /* @__PURE__ */
|
|
1658
|
+
}) : /* @__PURE__ */ U(Ne, {
|
|
1659
1659
|
className: "size-5 shrink-0",
|
|
1660
1660
|
weight: "bold",
|
|
1661
1661
|
"aria-hidden": !0
|
|
1662
1662
|
})
|
|
1663
|
-
}) : n === "viewer" ? /* @__PURE__ */
|
|
1663
|
+
}) : n === "viewer" ? /* @__PURE__ */ U("button", {
|
|
1664
1664
|
type: "button",
|
|
1665
1665
|
onClick: u,
|
|
1666
1666
|
disabled: s,
|
|
1667
1667
|
"aria-label": r,
|
|
1668
|
-
className:
|
|
1669
|
-
children:
|
|
1668
|
+
className: fr,
|
|
1669
|
+
children: U(s ? Me : Ne, {
|
|
1670
1670
|
size: 20,
|
|
1671
1671
|
weight: "bold",
|
|
1672
1672
|
"aria-hidden": !0
|
|
1673
1673
|
})
|
|
1674
|
-
}) : /* @__PURE__ */
|
|
1674
|
+
}) : /* @__PURE__ */ W("button", {
|
|
1675
1675
|
type: "button",
|
|
1676
1676
|
onClick: u,
|
|
1677
1677
|
disabled: s,
|
|
1678
1678
|
"aria-label": d ? r : void 0,
|
|
1679
|
-
className:
|
|
1680
|
-
children: [s ? /* @__PURE__ */
|
|
1679
|
+
className: J("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", a === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"),
|
|
1680
|
+
children: [s ? /* @__PURE__ */ U(Me, {
|
|
1681
1681
|
className: "size-4 animate-spin",
|
|
1682
1682
|
weight: "bold",
|
|
1683
1683
|
"aria-hidden": !0
|
|
1684
|
-
}) : /* @__PURE__ */
|
|
1684
|
+
}) : /* @__PURE__ */ U(Ne, {
|
|
1685
1685
|
...f,
|
|
1686
1686
|
"aria-hidden": !0
|
|
1687
1687
|
}), d ? null : r]
|
|
1688
1688
|
});
|
|
1689
|
-
},
|
|
1690
|
-
let r =
|
|
1689
|
+
}, gr = (e, t, n) => Math.min(Math.max(e, t), n), _r = ({ length: e, initialIndex: t, open: n }) => {
|
|
1690
|
+
let r = gr(t, 0, Math.max(e - 1, 0)), [i, a] = h(r);
|
|
1691
1691
|
d(() => {
|
|
1692
|
-
n && a(
|
|
1692
|
+
n && a(gr(t, 0, Math.max(e - 1, 0)));
|
|
1693
1693
|
}, [
|
|
1694
1694
|
n,
|
|
1695
1695
|
t,
|
|
1696
1696
|
e
|
|
1697
1697
|
]), d(() => {
|
|
1698
|
-
a((t) =>
|
|
1698
|
+
a((t) => gr(t, 0, Math.max(e - 1, 0)));
|
|
1699
1699
|
}, [e]);
|
|
1700
1700
|
let o = l(() => {
|
|
1701
1701
|
e <= 1 || a((t) => t <= 0 ? e - 1 : t - 1);
|
|
@@ -1720,7 +1720,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1720
1720
|
prev: o,
|
|
1721
1721
|
next: s
|
|
1722
1722
|
};
|
|
1723
|
-
},
|
|
1723
|
+
}, vr = ({ open: e, onClose: t, ariaLabel: n, counter: r, actions: i, children: a, "data-testid": o }) => {
|
|
1724
1724
|
let s = m(null), c = m(null);
|
|
1725
1725
|
return d(() => {
|
|
1726
1726
|
let t = s.current;
|
|
@@ -1756,7 +1756,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1756
1756
|
else t.removeAttribute("open");
|
|
1757
1757
|
}
|
|
1758
1758
|
}
|
|
1759
|
-
}, [e]), /* @__PURE__ */
|
|
1759
|
+
}, [e]), /* @__PURE__ */ W("dialog", {
|
|
1760
1760
|
ref: s,
|
|
1761
1761
|
className: "mes-media-viewer",
|
|
1762
1762
|
"aria-label": n ?? "Attachment viewer",
|
|
@@ -1767,63 +1767,63 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1767
1767
|
onClick: (e) => {
|
|
1768
1768
|
e.target === s.current && t();
|
|
1769
1769
|
},
|
|
1770
|
-
children: [/* @__PURE__ */
|
|
1770
|
+
children: [/* @__PURE__ */ W("div", {
|
|
1771
1771
|
className: "pointer-events-none absolute inset-x-3 top-3 z-[1] flex items-center justify-between gap-3",
|
|
1772
|
-
children: [r ? /* @__PURE__ */
|
|
1772
|
+
children: [r ? /* @__PURE__ */ U("span", {
|
|
1773
1773
|
className: "pointer-events-auto inline-flex items-center rounded-full bg-white/[0.12] px-3 py-1.5 text-[13px] font-medium leading-none tabular-nums text-white",
|
|
1774
1774
|
children: r
|
|
1775
|
-
}) : null, /* @__PURE__ */
|
|
1775
|
+
}) : null, /* @__PURE__ */ W("div", {
|
|
1776
1776
|
className: "pointer-events-auto ml-auto inline-flex items-center gap-2",
|
|
1777
|
-
children: [i, /* @__PURE__ */
|
|
1777
|
+
children: [i, /* @__PURE__ */ U("button", {
|
|
1778
1778
|
ref: c,
|
|
1779
1779
|
type: "button",
|
|
1780
1780
|
onClick: t,
|
|
1781
1781
|
"aria-label": "Close viewer",
|
|
1782
|
-
className:
|
|
1783
|
-
children: /* @__PURE__ */
|
|
1782
|
+
className: fr,
|
|
1783
|
+
children: /* @__PURE__ */ U(Je, {
|
|
1784
1784
|
size: 20,
|
|
1785
1785
|
weight: "bold",
|
|
1786
1786
|
"aria-hidden": !0
|
|
1787
1787
|
})
|
|
1788
1788
|
})]
|
|
1789
1789
|
})]
|
|
1790
|
-
}), /* @__PURE__ */
|
|
1790
|
+
}), /* @__PURE__ */ U("div", {
|
|
1791
1791
|
className: "box-border flex h-full w-full items-center justify-center px-6 py-16",
|
|
1792
1792
|
children: a
|
|
1793
1793
|
})]
|
|
1794
1794
|
});
|
|
1795
|
-
},
|
|
1796
|
-
let { index: i, prev: a, next: o } =
|
|
1795
|
+
}, yr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
1796
|
+
let { index: i, prev: a, next: o } = _r({
|
|
1797
1797
|
length: t.length,
|
|
1798
1798
|
initialIndex: n,
|
|
1799
1799
|
open: e
|
|
1800
|
-
}), s = t[i], c = p(() => s?.filename ?? (s ?
|
|
1801
|
-
return s ? /* @__PURE__ */
|
|
1800
|
+
}), s = t[i], c = p(() => s?.filename ?? (s ? Z(s.src) : "image"), [s]);
|
|
1801
|
+
return s ? /* @__PURE__ */ W(vr, {
|
|
1802
1802
|
open: e,
|
|
1803
1803
|
onClose: r,
|
|
1804
1804
|
ariaLabel: c,
|
|
1805
1805
|
counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
|
|
1806
|
-
actions: /* @__PURE__ */
|
|
1806
|
+
actions: /* @__PURE__ */ U(hr, {
|
|
1807
1807
|
url: s.src,
|
|
1808
1808
|
filename: c,
|
|
1809
1809
|
variant: "viewer",
|
|
1810
1810
|
label: `Download ${c}`
|
|
1811
1811
|
}),
|
|
1812
1812
|
"data-testid": "image-viewer",
|
|
1813
|
-
children: [e ? /* @__PURE__ */
|
|
1813
|
+
children: [e ? /* @__PURE__ */ U("img", {
|
|
1814
1814
|
src: s.src,
|
|
1815
1815
|
alt: s.alt ?? c,
|
|
1816
1816
|
draggable: !1,
|
|
1817
1817
|
decoding: "async",
|
|
1818
1818
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] select-none object-contain"
|
|
1819
|
-
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */
|
|
1819
|
+
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ U(mr, {
|
|
1820
1820
|
onPrev: a,
|
|
1821
1821
|
onNext: o,
|
|
1822
1822
|
prevLabel: "Previous image",
|
|
1823
1823
|
nextLabel: "Next image"
|
|
1824
1824
|
}) : null]
|
|
1825
1825
|
}) : null;
|
|
1826
|
-
},
|
|
1826
|
+
}, br = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", xr = {
|
|
1827
1827
|
1: ["rounded-[18px]"],
|
|
1828
1828
|
2: ["rounded-l-[18px]", "rounded-r-[18px]"],
|
|
1829
1829
|
3: [
|
|
@@ -1837,55 +1837,55 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1837
1837
|
"rounded-bl-[18px]",
|
|
1838
1838
|
"rounded-br-[18px]"
|
|
1839
1839
|
]
|
|
1840
|
-
},
|
|
1840
|
+
}, Sr = "--mes-single-width-cap", Cr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", wr = 436, Tr = ({ tiles: e, onTileActivate: t, maxVisible: n = 4, singleAspectRatio: r, className: i }) => {
|
|
1841
1841
|
let a = e.length;
|
|
1842
1842
|
if (a === 0) return null;
|
|
1843
|
-
let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */
|
|
1843
|
+
let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */ W("div", {
|
|
1844
1844
|
"aria-hidden": !0,
|
|
1845
1845
|
className: "absolute inset-0 flex items-center justify-center bg-[#040403]/50 text-2xl font-bold leading-[28px] tracking-[-0.24px] text-white",
|
|
1846
1846
|
children: ["+", s]
|
|
1847
1847
|
}) : null, l = (e, n, r) => {
|
|
1848
|
-
let i =
|
|
1849
|
-
return t ? /* @__PURE__ */
|
|
1848
|
+
let i = J(br, "h-full w-full", xr[o.length]?.[n]);
|
|
1849
|
+
return t ? /* @__PURE__ */ W("button", {
|
|
1850
1850
|
type: "button",
|
|
1851
1851
|
onClick: () => t(n),
|
|
1852
1852
|
"aria-label": e.ariaLabel ?? `Open media ${n + 1}`,
|
|
1853
|
-
className:
|
|
1853
|
+
className: J(i, e.cursorClassName ?? "cursor-zoom-in"),
|
|
1854
1854
|
children: [e.content, r]
|
|
1855
|
-
}, n) : /* @__PURE__ */
|
|
1855
|
+
}, n) : /* @__PURE__ */ W("div", {
|
|
1856
1856
|
className: i,
|
|
1857
1857
|
children: [e.content, r]
|
|
1858
1858
|
}, n);
|
|
1859
1859
|
}, u;
|
|
1860
1860
|
return r && (u = {
|
|
1861
1861
|
aspectRatio: r,
|
|
1862
|
-
width: `min(var(${
|
|
1862
|
+
width: `min(var(${Sr}), ${Math.round(wr * r * 100) / 100}px)`,
|
|
1863
1863
|
maxWidth: "100%"
|
|
1864
|
-
}), o.length === 1 ? /* @__PURE__ */
|
|
1865
|
-
className:
|
|
1864
|
+
}), o.length === 1 ? /* @__PURE__ */ U("div", {
|
|
1865
|
+
className: J(r ? Cr : "aspect-square w-full", i),
|
|
1866
1866
|
style: u,
|
|
1867
1867
|
children: l(o[0], 0, c)
|
|
1868
|
-
}) : o.length === 2 ? /* @__PURE__ */
|
|
1869
|
-
className:
|
|
1868
|
+
}) : o.length === 2 ? /* @__PURE__ */ U("div", {
|
|
1869
|
+
className: J("grid aspect-[16/9] w-full grid-cols-2 gap-0.5", i),
|
|
1870
1870
|
children: o.map((e, t) => l(e, t, t === o.length - 1 ? c : null))
|
|
1871
|
-
}) : o.length === 3 ? /* @__PURE__ */
|
|
1872
|
-
className:
|
|
1871
|
+
}) : o.length === 3 ? /* @__PURE__ */ W("div", {
|
|
1872
|
+
className: J("grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
|
|
1873
1873
|
children: [
|
|
1874
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ U("div", {
|
|
1875
1875
|
className: "row-span-2",
|
|
1876
1876
|
children: l(o[0], 0)
|
|
1877
1877
|
}),
|
|
1878
1878
|
l(o[1], 1),
|
|
1879
1879
|
l(o[2], 2, c)
|
|
1880
1880
|
]
|
|
1881
|
-
}) : /* @__PURE__ */
|
|
1882
|
-
className:
|
|
1881
|
+
}) : /* @__PURE__ */ U("div", {
|
|
1882
|
+
className: J("grid aspect-[379/286] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
|
|
1883
1883
|
children: o.map((e, t) => {
|
|
1884
1884
|
let n = s > 0 && t === o.length - 1;
|
|
1885
1885
|
return l(e, t, n ? c : null);
|
|
1886
1886
|
})
|
|
1887
1887
|
});
|
|
1888
|
-
},
|
|
1888
|
+
}, Er = ({ src: e, suppliedRatio: t, fallbackRatio: n }) => {
|
|
1889
1889
|
let [r, i] = o.useState(), a = o.useCallback((t) => {
|
|
1890
1890
|
if (!t || t.naturalWidth <= 0 || t.naturalHeight <= 0 || e === void 0) return;
|
|
1891
1891
|
let n = t.naturalWidth / t.naturalHeight;
|
|
@@ -1899,7 +1899,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1899
1899
|
imgRef: a,
|
|
1900
1900
|
onLoad: s
|
|
1901
1901
|
};
|
|
1902
|
-
},
|
|
1902
|
+
}, Dr = (e) => {
|
|
1903
1903
|
let [t, n] = h(!1), [r, i] = h(0);
|
|
1904
1904
|
return {
|
|
1905
1905
|
viewerOpen: t,
|
|
@@ -1909,9 +1909,9 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1909
1909
|
}, [e]),
|
|
1910
1910
|
closeViewer: l(() => n(!1), [])
|
|
1911
1911
|
};
|
|
1912
|
-
},
|
|
1912
|
+
}, Or = ({ item: e, index: t, totalCount: n, fallbackLoading: r, imgRef: i, onLoad: o }) => ({
|
|
1913
1913
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
1914
|
-
content: /* @__PURE__ */
|
|
1914
|
+
content: /* @__PURE__ */ U("img", {
|
|
1915
1915
|
ref: i,
|
|
1916
1916
|
src: a(e.src) ?? e.src,
|
|
1917
1917
|
alt: e.alt ?? "",
|
|
@@ -1923,24 +1923,24 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1923
1923
|
onLoad: o,
|
|
1924
1924
|
className: "absolute inset-0 size-full object-cover"
|
|
1925
1925
|
})
|
|
1926
|
-
}),
|
|
1926
|
+
}), kr = ({ src: e, alt: t, items: n }) => n && n.length > 0 ? n : e ? [{
|
|
1927
1927
|
src: e,
|
|
1928
1928
|
alt: t
|
|
1929
|
-
}] : [],
|
|
1929
|
+
}] : [], Ar = (e, t) => e.map((n, r) => ({
|
|
1930
1930
|
src: n.src,
|
|
1931
1931
|
alt: n.alt,
|
|
1932
1932
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
1933
|
-
})),
|
|
1934
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
1935
|
-
return /* @__PURE__ */
|
|
1933
|
+
})), jr = ({ src: e, alt: t, filename: n, loading: r = "lazy", onClick: i, onDismiss: o }) => {
|
|
1934
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Dr(i);
|
|
1935
|
+
return /* @__PURE__ */ W("div", {
|
|
1936
1936
|
className: "relative w-fit",
|
|
1937
1937
|
children: [
|
|
1938
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ U("button", {
|
|
1939
1939
|
type: "button",
|
|
1940
1940
|
onClick: () => l(0),
|
|
1941
1941
|
"aria-label": "Open image",
|
|
1942
1942
|
className: "block size-[280px] cursor-zoom-in overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
1943
|
-
children: /* @__PURE__ */
|
|
1943
|
+
children: /* @__PURE__ */ U("img", {
|
|
1944
1944
|
src: a(e) ?? e,
|
|
1945
1945
|
alt: t ?? "",
|
|
1946
1946
|
draggable: !1,
|
|
@@ -1949,13 +1949,13 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1949
1949
|
className: "size-full object-cover"
|
|
1950
1950
|
})
|
|
1951
1951
|
}),
|
|
1952
|
-
o ? /* @__PURE__ */
|
|
1952
|
+
o ? /* @__PURE__ */ U("div", {
|
|
1953
1953
|
className: "absolute right-2 top-2 z-10",
|
|
1954
|
-
children: /* @__PURE__ */
|
|
1954
|
+
children: /* @__PURE__ */ U(Kn, { onClick: o })
|
|
1955
1955
|
}) : null,
|
|
1956
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ U(yr, {
|
|
1957
1957
|
open: s,
|
|
1958
|
-
items:
|
|
1958
|
+
items: Ar([{
|
|
1959
1959
|
src: e,
|
|
1960
1960
|
alt: t
|
|
1961
1961
|
}], n),
|
|
@@ -1964,18 +1964,18 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1964
1964
|
})
|
|
1965
1965
|
]
|
|
1966
1966
|
});
|
|
1967
|
-
},
|
|
1968
|
-
let l =
|
|
1967
|
+
}, Mr = 326 / 246, Nr = ({ state: e, src: t, alt: n, filename: r, items: i, text: a, groupPosition: o, loading: s = "lazy", onClick: c }) => {
|
|
1968
|
+
let l = kr({
|
|
1969
1969
|
src: t,
|
|
1970
1970
|
alt: n,
|
|
1971
1971
|
items: i
|
|
1972
|
-
}), u =
|
|
1972
|
+
}), u = qn(e), { viewerOpen: d, viewerIndex: f, handleActivate: p, closeViewer: m } = Dr(c), h = l.length === 1, g = h ? l[0] : void 0, _ = Er({
|
|
1973
1973
|
src: g?.src,
|
|
1974
1974
|
suppliedRatio: g?.width && g?.height ? g.width / g.height : void 0,
|
|
1975
|
-
fallbackRatio:
|
|
1975
|
+
fallbackRatio: Mr
|
|
1976
1976
|
});
|
|
1977
1977
|
if (l.length === 0) return null;
|
|
1978
|
-
let v = l.map((e, t) =>
|
|
1978
|
+
let v = l.map((e, t) => Or({
|
|
1979
1979
|
item: e,
|
|
1980
1980
|
index: t,
|
|
1981
1981
|
totalCount: l.length,
|
|
@@ -1983,7 +1983,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1983
1983
|
imgRef: h ? _.imgRef : void 0,
|
|
1984
1984
|
onLoad: h ? _.onLoad : void 0
|
|
1985
1985
|
}));
|
|
1986
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ W(Gn, {
|
|
1987
1987
|
variant: u,
|
|
1988
1988
|
text: a,
|
|
1989
1989
|
groupPosition: o,
|
|
@@ -1992,65 +1992,65 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1992
1992
|
paddingClassName: "p-0.5",
|
|
1993
1993
|
radiusClassName: "rounded-[20px]",
|
|
1994
1994
|
"data-testid": "image-attachment",
|
|
1995
|
-
children: [/* @__PURE__ */
|
|
1995
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1996
1996
|
className: "relative",
|
|
1997
|
-
children: /* @__PURE__ */
|
|
1997
|
+
children: /* @__PURE__ */ U(Tr, {
|
|
1998
1998
|
tiles: v,
|
|
1999
1999
|
onTileActivate: p,
|
|
2000
2000
|
singleAspectRatio: h ? _.ratio : void 0
|
|
2001
2001
|
})
|
|
2002
|
-
}), /* @__PURE__ */
|
|
2002
|
+
}), /* @__PURE__ */ U(yr, {
|
|
2003
2003
|
open: d,
|
|
2004
|
-
items:
|
|
2004
|
+
items: Ar(l, r),
|
|
2005
2005
|
initialIndex: f,
|
|
2006
2006
|
onClose: m
|
|
2007
2007
|
})]
|
|
2008
2008
|
});
|
|
2009
|
-
},
|
|
2010
|
-
Composer: (e) => /* @__PURE__ */
|
|
2011
|
-
Sent: (e) => /* @__PURE__ */
|
|
2009
|
+
}, Pr = {
|
|
2010
|
+
Composer: (e) => /* @__PURE__ */ U(jr, { ...e }),
|
|
2011
|
+
Sent: (e) => /* @__PURE__ */ U(Nr, {
|
|
2012
2012
|
...e,
|
|
2013
2013
|
state: "sent"
|
|
2014
2014
|
}),
|
|
2015
|
-
Received: (e) => /* @__PURE__ */
|
|
2015
|
+
Received: (e) => /* @__PURE__ */ U(Nr, {
|
|
2016
2016
|
...e,
|
|
2017
2017
|
state: "received"
|
|
2018
2018
|
})
|
|
2019
|
-
},
|
|
2020
|
-
let { index: i, prev: a, next: o } =
|
|
2019
|
+
}, Fr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
2020
|
+
let { index: i, prev: a, next: o } = _r({
|
|
2021
2021
|
length: t.length,
|
|
2022
2022
|
initialIndex: n,
|
|
2023
2023
|
open: e
|
|
2024
|
-
}), s = t[i], c = p(() => s?.filename ?? (s ?
|
|
2025
|
-
return !s || !l ? null : /* @__PURE__ */
|
|
2024
|
+
}), s = t[i], c = p(() => s?.filename ?? (s ? Z(s.src) : "document"), [s]), l = p(() => s ? Ir(s.src) : void 0, [s]);
|
|
2025
|
+
return !s || !l ? null : /* @__PURE__ */ W(vr, {
|
|
2026
2026
|
open: e,
|
|
2027
2027
|
onClose: r,
|
|
2028
2028
|
ariaLabel: c,
|
|
2029
2029
|
counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
|
|
2030
2030
|
"data-testid": "pdf-viewer",
|
|
2031
|
-
children: [/* @__PURE__ */
|
|
2031
|
+
children: [/* @__PURE__ */ U("iframe", {
|
|
2032
2032
|
src: l,
|
|
2033
2033
|
title: c,
|
|
2034
2034
|
className: "block h-[calc(100dvh-128px)] w-[min(96vw,1400px)] border-0 bg-white",
|
|
2035
2035
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
2036
|
-
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */
|
|
2036
|
+
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ U(mr, {
|
|
2037
2037
|
onPrev: a,
|
|
2038
2038
|
onNext: o,
|
|
2039
2039
|
prevLabel: "Previous document",
|
|
2040
2040
|
nextLabel: "Next document"
|
|
2041
2041
|
}) : null]
|
|
2042
2042
|
});
|
|
2043
|
-
},
|
|
2043
|
+
}, Ir = (e) => {
|
|
2044
2044
|
let t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1), i = new URLSearchParams(r);
|
|
2045
2045
|
return i.has("toolbar") || i.set("toolbar", "0"), i.has("navpanes") || i.set("navpanes", "0"), `${n}#${i.toString()}`;
|
|
2046
|
-
},
|
|
2046
|
+
}, Lr = ({ src: e, filename: t, fileSize: n, title: r, items: i }) => i && i.length > 0 ? i : e ? [{
|
|
2047
2047
|
src: e,
|
|
2048
2048
|
filename: t,
|
|
2049
2049
|
fileSize: n,
|
|
2050
2050
|
title: r
|
|
2051
|
-
}] : [],
|
|
2052
|
-
let a = t.filename ??
|
|
2053
|
-
return /* @__PURE__ */
|
|
2051
|
+
}] : [], Rr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
2052
|
+
let a = t.filename ?? Z(t.src);
|
|
2053
|
+
return /* @__PURE__ */ U(or, {
|
|
2054
2054
|
variant: e,
|
|
2055
2055
|
filename: a,
|
|
2056
2056
|
title: t.title,
|
|
@@ -2060,38 +2060,38 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2060
2060
|
activateLabel: `Open ${a}`,
|
|
2061
2061
|
trailingAction: i
|
|
2062
2062
|
});
|
|
2063
|
-
},
|
|
2064
|
-
let u =
|
|
2063
|
+
}, zr = ({ state: e, src: t, filename: n, fileSize: r, title: i, items: a, text: o, groupPosition: s, onClick: c, onDismiss: l }) => {
|
|
2064
|
+
let u = qn(e), d = Lr({
|
|
2065
2065
|
src: t,
|
|
2066
2066
|
filename: n,
|
|
2067
2067
|
fileSize: r,
|
|
2068
2068
|
title: i,
|
|
2069
2069
|
items: a
|
|
2070
|
-
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } =
|
|
2070
|
+
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Dr(c), g = e === "composer" && !!l;
|
|
2071
2071
|
if (d.length === 0) return null;
|
|
2072
2072
|
let _ = d.map((e) => ({
|
|
2073
2073
|
src: e.src,
|
|
2074
|
-
filename: e.filename ??
|
|
2074
|
+
filename: e.filename ?? Z(e.src)
|
|
2075
2075
|
}));
|
|
2076
|
-
return /* @__PURE__ */
|
|
2076
|
+
return /* @__PURE__ */ W(Gn, {
|
|
2077
2077
|
variant: u,
|
|
2078
2078
|
text: o,
|
|
2079
2079
|
groupPosition: s,
|
|
2080
2080
|
"data-testid": "pdf-attachment",
|
|
2081
|
-
children: [/* @__PURE__ */
|
|
2081
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2082
2082
|
className: "flex flex-col gap-2",
|
|
2083
2083
|
children: d.map((t, n) => {
|
|
2084
|
-
let r = t.filename ??
|
|
2084
|
+
let r = t.filename ?? Z(t.src), i = g && n === 0 ? /* @__PURE__ */ U(Kn, {
|
|
2085
2085
|
onClick: l,
|
|
2086
2086
|
variant: "inline"
|
|
2087
|
-
}) : e === "composer" ? void 0 : /* @__PURE__ */
|
|
2087
|
+
}) : e === "composer" ? void 0 : /* @__PURE__ */ U(hr, {
|
|
2088
2088
|
url: t.src,
|
|
2089
2089
|
filename: r,
|
|
2090
2090
|
variant: "inline",
|
|
2091
2091
|
label: `Download ${r}`,
|
|
2092
2092
|
tone: u
|
|
2093
2093
|
});
|
|
2094
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ U(Rr, {
|
|
2095
2095
|
variant: u,
|
|
2096
2096
|
item: t,
|
|
2097
2097
|
index: n,
|
|
@@ -2099,28 +2099,28 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2099
2099
|
trailingAction: i
|
|
2100
2100
|
}, `${t.src}-${n}`);
|
|
2101
2101
|
})
|
|
2102
|
-
}), /* @__PURE__ */
|
|
2102
|
+
}), /* @__PURE__ */ U(Fr, {
|
|
2103
2103
|
open: f,
|
|
2104
2104
|
items: _,
|
|
2105
2105
|
initialIndex: p,
|
|
2106
2106
|
onClose: h
|
|
2107
2107
|
})]
|
|
2108
2108
|
});
|
|
2109
|
-
},
|
|
2110
|
-
Composer: (e) => /* @__PURE__ */
|
|
2109
|
+
}, Br = {
|
|
2110
|
+
Composer: (e) => /* @__PURE__ */ U(zr, {
|
|
2111
2111
|
...e,
|
|
2112
2112
|
state: "composer"
|
|
2113
2113
|
}),
|
|
2114
|
-
Sent: (e) => /* @__PURE__ */
|
|
2114
|
+
Sent: (e) => /* @__PURE__ */ U(zr, {
|
|
2115
2115
|
...e,
|
|
2116
2116
|
state: "sent"
|
|
2117
2117
|
}),
|
|
2118
|
-
Received: (e) => /* @__PURE__ */
|
|
2118
|
+
Received: (e) => /* @__PURE__ */ U(zr, {
|
|
2119
2119
|
...e,
|
|
2120
2120
|
state: "received"
|
|
2121
2121
|
})
|
|
2122
|
-
},
|
|
2123
|
-
let { index: a, prev: o, next: s } =
|
|
2122
|
+
}, Vr = 150, Hr = ({ open: e, items: t, initialIndex: n = 0, onClose: i }) => {
|
|
2123
|
+
let { index: a, prev: o, next: s } = _r({
|
|
2124
2124
|
length: t.length,
|
|
2125
2125
|
initialIndex: n,
|
|
2126
2126
|
open: e
|
|
@@ -2132,17 +2132,17 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2132
2132
|
e && !u && f(!0), d(() => {
|
|
2133
2133
|
if (e || !u) return;
|
|
2134
2134
|
c.current?.pause();
|
|
2135
|
-
let t = window.setTimeout(() => f(!1),
|
|
2135
|
+
let t = window.setTimeout(() => f(!1), Vr);
|
|
2136
2136
|
return () => window.clearTimeout(t);
|
|
2137
2137
|
}, [e, u]);
|
|
2138
|
-
let g = t[a], _ = p(() => g?.filename ?? (g ?
|
|
2139
|
-
return g ? /* @__PURE__ */
|
|
2138
|
+
let g = t[a], _ = p(() => g?.filename ?? (g ? Z(g.src) : "video"), [g]);
|
|
2139
|
+
return g ? /* @__PURE__ */ W(vr, {
|
|
2140
2140
|
open: e,
|
|
2141
2141
|
onClose: i,
|
|
2142
2142
|
ariaLabel: _,
|
|
2143
2143
|
counter: t.length > 1 ? `${a + 1} / ${t.length}` : void 0,
|
|
2144
2144
|
"data-testid": "video-viewer",
|
|
2145
|
-
children: [u ? /* @__PURE__ */
|
|
2145
|
+
children: [u ? /* @__PURE__ */ U("video", {
|
|
2146
2146
|
ref: c,
|
|
2147
2147
|
src: g.src,
|
|
2148
2148
|
poster: g.poster,
|
|
@@ -2152,30 +2152,30 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2152
2152
|
playsInline: !0,
|
|
2153
2153
|
preload: g.preload ?? "metadata",
|
|
2154
2154
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] bg-black",
|
|
2155
|
-
children: g.mimeType ? /* @__PURE__ */
|
|
2155
|
+
children: g.mimeType ? /* @__PURE__ */ U("source", {
|
|
2156
2156
|
src: g.src,
|
|
2157
2157
|
type: g.mimeType
|
|
2158
2158
|
}) : null
|
|
2159
|
-
}, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */
|
|
2159
|
+
}, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */ U(mr, {
|
|
2160
2160
|
onPrev: o,
|
|
2161
2161
|
onNext: s,
|
|
2162
2162
|
prevLabel: "Previous video",
|
|
2163
2163
|
nextLabel: "Next video"
|
|
2164
2164
|
}) : null]
|
|
2165
2165
|
}) : null;
|
|
2166
|
-
},
|
|
2166
|
+
}, Ur = 1, Wr = 4 / 5, Gr = 16 / 9, Kr = () => /* @__PURE__ */ U("div", {
|
|
2167
2167
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
2168
|
-
children: /* @__PURE__ */
|
|
2168
|
+
children: /* @__PURE__ */ U("span", {
|
|
2169
2169
|
className: "flex size-12 items-center justify-center rounded-full bg-black/25 text-white backdrop-blur-[20px]",
|
|
2170
|
-
children: /* @__PURE__ */
|
|
2170
|
+
children: /* @__PURE__ */ U(Re, {
|
|
2171
2171
|
className: "size-6",
|
|
2172
2172
|
weight: "fill",
|
|
2173
2173
|
"aria-hidden": !0
|
|
2174
2174
|
})
|
|
2175
2175
|
})
|
|
2176
|
-
}),
|
|
2176
|
+
}), qr = ({ item: e, index: t, showPlayBadge: n = !0, imgRef: r, onLoad: i }) => /* @__PURE__ */ W("div", {
|
|
2177
2177
|
className: "absolute inset-0 size-full bg-[#0d0d0d]",
|
|
2178
|
-
children: [e.poster ? /* @__PURE__ */
|
|
2178
|
+
children: [e.poster ? /* @__PURE__ */ U("img", {
|
|
2179
2179
|
ref: r,
|
|
2180
2180
|
src: e.poster,
|
|
2181
2181
|
alt: `Video ${t + 1} thumbnail`,
|
|
@@ -2184,25 +2184,25 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2184
2184
|
decoding: "async",
|
|
2185
2185
|
onLoad: i,
|
|
2186
2186
|
className: "absolute inset-0 size-full object-cover"
|
|
2187
|
-
}) : /* @__PURE__ */
|
|
2187
|
+
}) : /* @__PURE__ */ U("div", {
|
|
2188
2188
|
className: "absolute inset-0 flex items-center justify-center",
|
|
2189
|
-
children: /* @__PURE__ */
|
|
2189
|
+
children: /* @__PURE__ */ U(Ke, {
|
|
2190
2190
|
className: "size-16 text-white/30",
|
|
2191
2191
|
weight: "regular",
|
|
2192
2192
|
"aria-hidden": !0
|
|
2193
2193
|
})
|
|
2194
|
-
}), n ? /* @__PURE__ */
|
|
2195
|
-
}),
|
|
2194
|
+
}), n ? /* @__PURE__ */ U(Kr, {}) : null]
|
|
2195
|
+
}), Jr = ({ item: e, index: t, totalCount: n, isOverflowTile: r, imgRef: i, onLoad: a }) => ({
|
|
2196
2196
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2197
2197
|
cursorClassName: "cursor-pointer",
|
|
2198
|
-
content: /* @__PURE__ */
|
|
2198
|
+
content: /* @__PURE__ */ U(qr, {
|
|
2199
2199
|
item: e,
|
|
2200
2200
|
index: t,
|
|
2201
2201
|
showPlayBadge: !r,
|
|
2202
2202
|
imgRef: i,
|
|
2203
2203
|
onLoad: a
|
|
2204
2204
|
})
|
|
2205
|
-
}),
|
|
2205
|
+
}), Yr = ({ src: e, poster: t, mimeType: n, preload: r, naturalAspectRatio: i, items: a }) => a && a.length > 0 ? r ? a.map((e) => ({
|
|
2206
2206
|
...e,
|
|
2207
2207
|
preload: e.preload ?? r
|
|
2208
2208
|
})) : a : e ? [{
|
|
@@ -2211,23 +2211,23 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2211
2211
|
mimeType: n,
|
|
2212
2212
|
preload: r,
|
|
2213
2213
|
naturalAspectRatio: i
|
|
2214
|
-
}] : [],
|
|
2214
|
+
}] : [], Xr = (e, t) => e.map((n, r) => ({
|
|
2215
2215
|
src: n.src,
|
|
2216
2216
|
poster: n.poster,
|
|
2217
2217
|
mimeType: n.mimeType,
|
|
2218
2218
|
preload: n.preload,
|
|
2219
2219
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
2220
|
-
})),
|
|
2221
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
2222
|
-
return /* @__PURE__ */
|
|
2220
|
+
})), Zr = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
|
|
2221
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Dr(a);
|
|
2222
|
+
return /* @__PURE__ */ W("div", {
|
|
2223
2223
|
className: "relative w-fit",
|
|
2224
2224
|
children: [
|
|
2225
|
-
/* @__PURE__ */
|
|
2225
|
+
/* @__PURE__ */ U("button", {
|
|
2226
2226
|
type: "button",
|
|
2227
2227
|
onClick: () => l(0),
|
|
2228
2228
|
"aria-label": "Play video",
|
|
2229
2229
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2230
|
-
children: /* @__PURE__ */
|
|
2230
|
+
children: /* @__PURE__ */ U(qr, {
|
|
2231
2231
|
item: {
|
|
2232
2232
|
src: e,
|
|
2233
2233
|
poster: t,
|
|
@@ -2236,13 +2236,13 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2236
2236
|
index: 0
|
|
2237
2237
|
})
|
|
2238
2238
|
}),
|
|
2239
|
-
o ? /* @__PURE__ */
|
|
2239
|
+
o ? /* @__PURE__ */ U("div", {
|
|
2240
2240
|
className: "absolute right-2 top-2 z-10",
|
|
2241
|
-
children: /* @__PURE__ */
|
|
2241
|
+
children: /* @__PURE__ */ U(Kn, { onClick: o })
|
|
2242
2242
|
}) : null,
|
|
2243
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ U(Hr, {
|
|
2244
2244
|
open: s,
|
|
2245
|
-
items:
|
|
2245
|
+
items: Xr([{
|
|
2246
2246
|
src: e,
|
|
2247
2247
|
poster: t,
|
|
2248
2248
|
mimeType: n,
|
|
@@ -2253,29 +2253,29 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2253
2253
|
})
|
|
2254
2254
|
]
|
|
2255
2255
|
});
|
|
2256
|
-
},
|
|
2257
|
-
let d =
|
|
2256
|
+
}, Qr = ({ state: e, src: t, poster: n, mimeType: r, filename: i, items: a, text: o, groupPosition: s, preload: c, naturalAspectRatio: l, onClick: u }) => {
|
|
2257
|
+
let d = Yr({
|
|
2258
2258
|
src: t,
|
|
2259
2259
|
poster: n,
|
|
2260
2260
|
mimeType: r,
|
|
2261
2261
|
preload: c,
|
|
2262
2262
|
naturalAspectRatio: l,
|
|
2263
2263
|
items: a
|
|
2264
|
-
}), f =
|
|
2264
|
+
}), f = qn(e), { viewerOpen: p, viewerIndex: m, handleActivate: h, closeViewer: g } = Dr(u), _ = d.length === 1, v = _ ? d[0] : void 0, y = Er({
|
|
2265
2265
|
src: v?.poster,
|
|
2266
2266
|
suppliedRatio: v?.naturalAspectRatio,
|
|
2267
|
-
fallbackRatio:
|
|
2267
|
+
fallbackRatio: Ur
|
|
2268
2268
|
});
|
|
2269
2269
|
if (d.length === 0) return null;
|
|
2270
|
-
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) =>
|
|
2270
|
+
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) => Jr({
|
|
2271
2271
|
item: e,
|
|
2272
2272
|
index: t,
|
|
2273
2273
|
totalCount: d.length,
|
|
2274
2274
|
isOverflowTile: t === b,
|
|
2275
2275
|
imgRef: _ ? y.imgRef : void 0,
|
|
2276
2276
|
onLoad: _ ? y.onLoad : void 0
|
|
2277
|
-
})), S = Math.min(Math.max(y.ratio,
|
|
2278
|
-
return /* @__PURE__ */
|
|
2277
|
+
})), S = Math.min(Math.max(y.ratio, Wr), Gr);
|
|
2278
|
+
return /* @__PURE__ */ W(Gn, {
|
|
2279
2279
|
variant: f,
|
|
2280
2280
|
text: o,
|
|
2281
2281
|
groupPosition: s,
|
|
@@ -2284,36 +2284,36 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2284
2284
|
paddingClassName: "p-0.5",
|
|
2285
2285
|
radiusClassName: s && s !== "single" ? void 0 : "rounded-[20px]",
|
|
2286
2286
|
"data-testid": "video-attachment",
|
|
2287
|
-
children: [/* @__PURE__ */
|
|
2287
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2288
2288
|
className: "relative",
|
|
2289
|
-
children: /* @__PURE__ */
|
|
2289
|
+
children: /* @__PURE__ */ U(Tr, {
|
|
2290
2290
|
tiles: x,
|
|
2291
2291
|
onTileActivate: h,
|
|
2292
2292
|
singleAspectRatio: _ ? S : void 0
|
|
2293
2293
|
})
|
|
2294
|
-
}), /* @__PURE__ */
|
|
2294
|
+
}), /* @__PURE__ */ U(Hr, {
|
|
2295
2295
|
open: p,
|
|
2296
|
-
items:
|
|
2296
|
+
items: Xr(d, i),
|
|
2297
2297
|
initialIndex: m,
|
|
2298
2298
|
onClose: g
|
|
2299
2299
|
})]
|
|
2300
2300
|
});
|
|
2301
|
-
},
|
|
2302
|
-
Image:
|
|
2301
|
+
}, Q = {
|
|
2302
|
+
Image: Pr,
|
|
2303
2303
|
Video: {
|
|
2304
|
-
Composer: (e) => /* @__PURE__ */
|
|
2305
|
-
Sent: (e) => /* @__PURE__ */
|
|
2304
|
+
Composer: (e) => /* @__PURE__ */ U(Zr, { ...e }),
|
|
2305
|
+
Sent: (e) => /* @__PURE__ */ U(Qr, {
|
|
2306
2306
|
...e,
|
|
2307
2307
|
state: "sent"
|
|
2308
2308
|
}),
|
|
2309
|
-
Received: (e) => /* @__PURE__ */
|
|
2309
|
+
Received: (e) => /* @__PURE__ */ U(Qr, {
|
|
2310
2310
|
...e,
|
|
2311
2311
|
state: "received"
|
|
2312
2312
|
})
|
|
2313
2313
|
},
|
|
2314
|
-
Audio:
|
|
2315
|
-
Pdf:
|
|
2316
|
-
File:
|
|
2314
|
+
Audio: Qn,
|
|
2315
|
+
Pdf: Br,
|
|
2316
|
+
File: dr
|
|
2317
2317
|
};
|
|
2318
2318
|
//#endregion
|
|
2319
2319
|
//#region src/components/CustomMessage/StreamAttachmentMessage.tsx
|
|
@@ -2343,14 +2343,14 @@ function ni(e) {
|
|
|
2343
2343
|
url: t,
|
|
2344
2344
|
thumbnailUrl: a(n),
|
|
2345
2345
|
sourceUrl: r,
|
|
2346
|
-
layout: n ||
|
|
2346
|
+
layout: n || En(i, r) ? "featured" : "classic",
|
|
2347
2347
|
mimeType: i,
|
|
2348
2348
|
accentColor: $(e.accent_color),
|
|
2349
2349
|
status: "ready"
|
|
2350
2350
|
};
|
|
2351
2351
|
}
|
|
2352
2352
|
function ri(e) {
|
|
2353
|
-
return
|
|
2353
|
+
return kt(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" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2354
2354
|
}
|
|
2355
2355
|
function ii(e) {
|
|
2356
2356
|
if (!e?.length) return [];
|
|
@@ -2377,7 +2377,7 @@ function ii(e) {
|
|
|
2377
2377
|
});
|
|
2378
2378
|
};
|
|
2379
2379
|
for (let t of e) {
|
|
2380
|
-
if (
|
|
2380
|
+
if (kt(t)) {
|
|
2381
2381
|
r(t);
|
|
2382
2382
|
continue;
|
|
2383
2383
|
}
|
|
@@ -2397,11 +2397,11 @@ function si(e) {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
function ci(e) {
|
|
2399
2399
|
switch (e) {
|
|
2400
|
-
case "image": return
|
|
2401
|
-
case "video": return
|
|
2402
|
-
case "audio": return
|
|
2403
|
-
case "pdf": return
|
|
2404
|
-
default: return
|
|
2400
|
+
case "image": return Q.Image;
|
|
2401
|
+
case "video": return Q.Video;
|
|
2402
|
+
case "audio": return Q.Audio;
|
|
2403
|
+
case "pdf": return Q.Pdf;
|
|
2404
|
+
default: return Q.File;
|
|
2405
2405
|
}
|
|
2406
2406
|
}
|
|
2407
2407
|
function li(e, t) {
|
|
@@ -2444,20 +2444,20 @@ function di({ groupPosition: e, isMyMessage: t, segment: n }) {
|
|
|
2444
2444
|
...ui(n.kind, n.attachments),
|
|
2445
2445
|
groupPosition: e
|
|
2446
2446
|
};
|
|
2447
|
-
return
|
|
2447
|
+
return U(t ? r.Sent : r.Received, { ...i });
|
|
2448
2448
|
}
|
|
2449
2449
|
var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
2450
2450
|
let i = ii(n.attachments);
|
|
2451
2451
|
if (i.length === 0) return null;
|
|
2452
2452
|
let a = ai(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? ni(s.attachments[0] ?? {}).url : void 0, l = o && ti(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
|
|
2453
|
-
let i = t ?
|
|
2454
|
-
d.push(/* @__PURE__ */
|
|
2453
|
+
let i = t ? zn.Sent : zn.Received;
|
|
2454
|
+
d.push(/* @__PURE__ */ U(i, {
|
|
2455
2455
|
...ni(e),
|
|
2456
2456
|
groupPosition: r ? f : "middle"
|
|
2457
2457
|
}, n));
|
|
2458
2458
|
}, h = (n, r) => {
|
|
2459
2459
|
let i = oi(u, a, e);
|
|
2460
|
-
u += 1, d.push(/* @__PURE__ */
|
|
2460
|
+
u += 1, d.push(/* @__PURE__ */ U(di, {
|
|
2461
2461
|
groupPosition: i,
|
|
2462
2462
|
isMyMessage: t,
|
|
2463
2463
|
segment: n
|
|
@@ -2472,9 +2472,9 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2472
2472
|
return;
|
|
2473
2473
|
}
|
|
2474
2474
|
h(e, `media-${t}`);
|
|
2475
|
-
}), /* @__PURE__ */
|
|
2475
|
+
}), /* @__PURE__ */ W("div", {
|
|
2476
2476
|
className: "str-chat__message-bubble-wrapper",
|
|
2477
|
-
children: [/* @__PURE__ */
|
|
2477
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2478
2478
|
className: "str-chat__message-bubble",
|
|
2479
2479
|
"data-attachment-bubble": "true",
|
|
2480
2480
|
style: {
|
|
@@ -2483,27 +2483,27 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2483
2483
|
overflow: "visible",
|
|
2484
2484
|
padding: 0
|
|
2485
2485
|
},
|
|
2486
|
-
children: [d, !l && /* @__PURE__ */
|
|
2487
|
-
}), l ? /* @__PURE__ */
|
|
2488
|
-
className:
|
|
2486
|
+
children: [d, !l && /* @__PURE__ */ U(M, {})]
|
|
2487
|
+
}), l ? /* @__PURE__ */ W("div", {
|
|
2488
|
+
className: J("str-chat__message-bubble", { "relative isolate": p }),
|
|
2489
2489
|
children: [
|
|
2490
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ U(R, {
|
|
2491
2491
|
message: n,
|
|
2492
2492
|
renderText: r
|
|
2493
2493
|
}),
|
|
2494
|
-
/* @__PURE__ */
|
|
2495
|
-
p && /* @__PURE__ */
|
|
2494
|
+
/* @__PURE__ */ U(M, {}),
|
|
2495
|
+
p && /* @__PURE__ */ U(Jt, { side: t ? "me" : "other" })
|
|
2496
2496
|
]
|
|
2497
2497
|
}) : null]
|
|
2498
2498
|
});
|
|
2499
2499
|
}, pi = o.memo((e) => {
|
|
2500
|
-
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: x } = e, { client: S } =
|
|
2500
|
+
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: x } = e, { client: S } = he("CustomMessage"), { channel: C } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: D, onDownloadClick: N } = Nt("LockedAttachment"), [F, L] = h(!1), z = be(m.id), { Attachment: te = b, EditMessageModal: ie = E, MessageActions: B, MessageBlocked: ae = O, MessageBouncePrompt: oe = A, MessageDeleted: fe = j, MessageIsThreadReplyInChannelButtonIndicator: pe = P, MessageRepliesCountButton: _e = I, ReminderNotification: ve = ne, StreamedMessageText: V = re, PinIndicator: ye } = ge("CustomMessage"), xe = ue(m), Se = de(m), G = p(() => d?.(m), [d, m]), K = p(() => {
|
|
2501
2501
|
let e = m.attachments ?? [], t = m.shared_location ? [m.shared_location, ...e] : e;
|
|
2502
|
-
if (!
|
|
2503
|
-
let n = t.filter((e) => !("type" in e) || !
|
|
2502
|
+
if (!Bt(m)) return t;
|
|
2503
|
+
let n = t.filter((e) => !("type" in e) || !kt(e));
|
|
2504
2504
|
return n.length === t.length ? t : n;
|
|
2505
|
-
}, [m]),
|
|
2506
|
-
let e =
|
|
2505
|
+
}, [m]), Ce = p(() => ii(K), [K]), q = p(() => {
|
|
2506
|
+
let e = Ot({
|
|
2507
2507
|
message: m,
|
|
2508
2508
|
viewerLanguage: v
|
|
2509
2509
|
});
|
|
@@ -2511,31 +2511,31 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2511
2511
|
...m,
|
|
2512
2512
|
text: e
|
|
2513
2513
|
};
|
|
2514
|
-
}, [m, v]), we =
|
|
2514
|
+
}, [m, v]), we = Ce.length > 0, Te = Ce.reduce((e, t) => e + t.attachments.length, 0) === (K?.length ?? 0), Ee = a?.[0] ?? "", De = Ee === "top" ? "first" : Ee === "middle" ? "middle" : Ee === "bottom" ? "end" : "single", Oe = Ee === "single" || Ee === "bottom";
|
|
2515
2515
|
if (se(m)) return null;
|
|
2516
|
-
if (m.deleted_at || m.type === "deleted") return /* @__PURE__ */
|
|
2517
|
-
if (ce(m)) return /* @__PURE__ */
|
|
2518
|
-
let
|
|
2519
|
-
|
|
2520
|
-
let
|
|
2521
|
-
"str-chat__message--has-attachment":
|
|
2516
|
+
if (m.deleted_at || m.type === "deleted") return /* @__PURE__ */ U(fe, { message: m });
|
|
2517
|
+
if (ce(m)) return /* @__PURE__ */ U(ae, {});
|
|
2518
|
+
let ke = !_ && !!m.reply_count, Ae = !_ && m.show_in_channel && m.parent_id, je = m.status === "failed" && m.error?.status !== 403, Me = le(m), Y;
|
|
2519
|
+
je ? Y = () => l(m) : Me && (Y = () => L(!0));
|
|
2520
|
+
let X = f(), Ne = J("str-chat__message str-chat__message-simple", `str-chat__message--${m.type}`, `str-chat__message--${m.status}`, X ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other", m.text ? "str-chat__message--has-text" : "has-no-text", {
|
|
2521
|
+
"str-chat__message--has-attachment": xe,
|
|
2522
2522
|
"str-chat__message--highlighted": u,
|
|
2523
2523
|
"str-chat__message--pinned pinned-message": m.pinned,
|
|
2524
|
-
"str-chat__message--with-reactions":
|
|
2524
|
+
"str-chat__message--with-reactions": Se,
|
|
2525
2525
|
"str-chat__message-send-can-be-retried": m?.status === "failed" && m?.error?.status !== 403,
|
|
2526
|
-
"str-chat__message-with-thread-link":
|
|
2526
|
+
"str-chat__message-with-thread-link": ke || Ae,
|
|
2527
2527
|
"str-chat__virtual-message__wrapper--end": r,
|
|
2528
2528
|
"str-chat__virtual-message__wrapper--first": i,
|
|
2529
2529
|
"str-chat__virtual-message__wrapper--group": o
|
|
2530
|
-
}),
|
|
2530
|
+
}), Pe = m.poll_id && S.polls.fromState(m.poll_id), Fe = en(m), Ie = Bt(m), Le = Vt(m), Re = !!(K?.length && !m.quoted_message), ze = Ie && X && Re, Be = we && Te && !m.quoted_message && !Pe && !G && !Ie, Ve = {
|
|
2531
2531
|
contentType: "text",
|
|
2532
2532
|
amountText: m.metadata?.amount_text,
|
|
2533
2533
|
paymentStatus: m.metadata?.payment_status,
|
|
2534
|
-
renderedText: m.text && /* @__PURE__ */
|
|
2535
|
-
message:
|
|
2534
|
+
renderedText: m.text && /* @__PURE__ */ U(R, {
|
|
2535
|
+
message: q,
|
|
2536
2536
|
renderText: g
|
|
2537
2537
|
})
|
|
2538
|
-
},
|
|
2538
|
+
}, He = {
|
|
2539
2539
|
contentType: "media",
|
|
2540
2540
|
title: m.metadata?.attachment_title,
|
|
2541
2541
|
mimeType: m.metadata?.attachment_mime_type,
|
|
@@ -2544,178 +2544,178 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2544
2544
|
detail: m.metadata?.attachment_detail,
|
|
2545
2545
|
paymentStatus: m.metadata?.payment_status,
|
|
2546
2546
|
onFetchSource: D ? () => D(m, C) : void 0
|
|
2547
|
-
},
|
|
2548
|
-
className:
|
|
2549
|
-
children: [/* @__PURE__ */
|
|
2550
|
-
message:
|
|
2547
|
+
}, Ue = /* @__PURE__ */ W("div", {
|
|
2548
|
+
className: J("str-chat__message-bubble", { "relative isolate": Oe }),
|
|
2549
|
+
children: [/* @__PURE__ */ U(R, {
|
|
2550
|
+
message: q,
|
|
2551
2551
|
renderText: g
|
|
2552
|
-
}),
|
|
2552
|
+
}), Oe && /* @__PURE__ */ U(Jt, { side: X ? "me" : "other" })]
|
|
2553
2553
|
});
|
|
2554
|
-
return /* @__PURE__ */
|
|
2555
|
-
n && /* @__PURE__ */
|
|
2556
|
-
F && /* @__PURE__ */
|
|
2554
|
+
return /* @__PURE__ */ W(H, { children: [
|
|
2555
|
+
n && /* @__PURE__ */ U(ie, { additionalMessageInputProps: t }),
|
|
2556
|
+
F && /* @__PURE__ */ U(k, {
|
|
2557
2557
|
MessageBouncePrompt: oe,
|
|
2558
2558
|
onClose: () => L(!1),
|
|
2559
2559
|
open: F
|
|
2560
2560
|
}),
|
|
2561
|
-
/* @__PURE__ */
|
|
2562
|
-
className:
|
|
2561
|
+
/* @__PURE__ */ W("div", {
|
|
2562
|
+
className: Ne,
|
|
2563
2563
|
"data-message-id": m.id,
|
|
2564
2564
|
"data-dd-privacy": "mask",
|
|
2565
2565
|
children: [
|
|
2566
|
-
|
|
2567
|
-
!!z && /* @__PURE__ */
|
|
2568
|
-
m.user && /* @__PURE__ */
|
|
2566
|
+
ye && /* @__PURE__ */ U(ye, {}),
|
|
2567
|
+
!!z && /* @__PURE__ */ U(ve, { reminder: z }),
|
|
2568
|
+
m.user && /* @__PURE__ */ U(_t, {
|
|
2569
2569
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2570
2570
|
id: m.user.id,
|
|
2571
2571
|
image: m.user.image,
|
|
2572
2572
|
name: m.user.name || m.user.id,
|
|
2573
2573
|
size: 24,
|
|
2574
2574
|
shape: "circle",
|
|
2575
|
-
dmAgentEnabled:
|
|
2575
|
+
dmAgentEnabled: Ie
|
|
2576
2576
|
}),
|
|
2577
|
-
/* @__PURE__ */
|
|
2578
|
-
className:
|
|
2577
|
+
/* @__PURE__ */ U("div", {
|
|
2578
|
+
className: J("str-chat__message-inner", { "str-chat__simple-message--error-failed": je || Me }),
|
|
2579
2579
|
"data-testid": "message-inner",
|
|
2580
|
-
onClick:
|
|
2581
|
-
onKeyDown:
|
|
2582
|
-
role:
|
|
2583
|
-
tabIndex:
|
|
2580
|
+
onClick: Y,
|
|
2581
|
+
onKeyDown: Y,
|
|
2582
|
+
role: Y ? "button" : void 0,
|
|
2583
|
+
tabIndex: Y ? 0 : void 0,
|
|
2584
2584
|
style: {
|
|
2585
2585
|
marginInlineEnd: 0,
|
|
2586
2586
|
marginInlineStart: 0
|
|
2587
2587
|
},
|
|
2588
|
-
children:
|
|
2588
|
+
children: Fe ? /* @__PURE__ */ W("div", {
|
|
2589
2589
|
className: "str-chat__message-bubble-wrapper message-tip-wrapper",
|
|
2590
|
-
children: [/* @__PURE__ */
|
|
2591
|
-
}) :
|
|
2590
|
+
children: [/* @__PURE__ */ U(tn, { message: m }), m.text?.trim() && Ue]
|
|
2591
|
+
}) : Ht(m) ? /* @__PURE__ */ U("div", {
|
|
2592
2592
|
className: "str-chat__message-bubble-wrapper",
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2593
|
+
children: /* @__PURE__ */ W("div", {
|
|
2594
2594
|
className: "flex items-center gap-2",
|
|
2595
2595
|
children: [
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
...
|
|
2596
|
+
X && B && /* @__PURE__ */ U(B, {}),
|
|
2597
|
+
X ? /* @__PURE__ */ U(Lt, {
|
|
2598
|
+
...Ve,
|
|
2599
2599
|
isMine: !0
|
|
2600
|
-
}) : /* @__PURE__ */
|
|
2601
|
-
...
|
|
2600
|
+
}) : /* @__PURE__ */ U(Lt, {
|
|
2601
|
+
...Ve,
|
|
2602
2602
|
isMine: !1,
|
|
2603
2603
|
isUnlocking: w(m.id),
|
|
2604
2604
|
onUnlockClick: () => T?.(m, C)
|
|
2605
2605
|
}),
|
|
2606
|
-
!
|
|
2606
|
+
!X && B && /* @__PURE__ */ U(B, {})
|
|
2607
2607
|
]
|
|
2608
2608
|
})
|
|
2609
|
-
}) :
|
|
2609
|
+
}) : Ut(m) ? /* @__PURE__ */ W("div", {
|
|
2610
2610
|
className: "str-chat__message-bubble-wrapper message-locked-attachment-wrapper",
|
|
2611
|
-
children: [/* @__PURE__ */
|
|
2611
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2612
2612
|
className: "flex items-center gap-2",
|
|
2613
2613
|
children: [
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
...
|
|
2614
|
+
X && B && /* @__PURE__ */ U(B, {}),
|
|
2615
|
+
X ? /* @__PURE__ */ U(Lt, {
|
|
2616
|
+
...He,
|
|
2617
2617
|
isMine: !0,
|
|
2618
2618
|
onPreviewClick: () => T ? T(m, C) : void 0
|
|
2619
|
-
}) : /* @__PURE__ */
|
|
2620
|
-
...
|
|
2619
|
+
}) : /* @__PURE__ */ U(Lt, {
|
|
2620
|
+
...He,
|
|
2621
2621
|
isMine: !1,
|
|
2622
2622
|
isUnlocking: w(m.id),
|
|
2623
2623
|
onUnlockClick: () => T ? T(m, C) : void 0,
|
|
2624
2624
|
onDownloadClick: () => N ? N(m, C) : void 0
|
|
2625
2625
|
}),
|
|
2626
|
-
!
|
|
2626
|
+
!X && B && /* @__PURE__ */ U(B, {})
|
|
2627
2627
|
]
|
|
2628
|
-
}), m.text &&
|
|
2629
|
-
}) :
|
|
2630
|
-
groupPosition:
|
|
2631
|
-
isMyMessage:
|
|
2628
|
+
}), m.text && Ue]
|
|
2629
|
+
}) : Be ? /* @__PURE__ */ U(fi, {
|
|
2630
|
+
groupPosition: De,
|
|
2631
|
+
isMyMessage: X,
|
|
2632
2632
|
message: {
|
|
2633
|
-
...
|
|
2634
|
-
attachments:
|
|
2633
|
+
...q,
|
|
2634
|
+
attachments: K,
|
|
2635
2635
|
i18n: void 0
|
|
2636
2636
|
},
|
|
2637
2637
|
renderText: g
|
|
2638
|
-
}) : /* @__PURE__ */
|
|
2638
|
+
}) : /* @__PURE__ */ U("div", {
|
|
2639
2639
|
className: "str-chat__message-bubble-wrapper",
|
|
2640
|
-
children: /* @__PURE__ */
|
|
2641
|
-
className:
|
|
2640
|
+
children: /* @__PURE__ */ W("div", {
|
|
2641
|
+
className: J("str-chat__message-bubble", { "relative isolate": Oe }),
|
|
2642
2642
|
children: [
|
|
2643
|
-
|
|
2643
|
+
Ie && !ze && /* @__PURE__ */ U(Gt, {
|
|
2644
2644
|
message: m,
|
|
2645
|
-
hasAttachment:
|
|
2646
|
-
isMyMessage:
|
|
2645
|
+
hasAttachment: Re,
|
|
2646
|
+
isMyMessage: X
|
|
2647
2647
|
}),
|
|
2648
|
-
|
|
2649
|
-
|
|
2648
|
+
Pe && /* @__PURE__ */ U(ee, { poll: Pe }),
|
|
2649
|
+
K?.length && !m.quoted_message ? /* @__PURE__ */ U(te, {
|
|
2650
2650
|
actionHandler: s,
|
|
2651
|
-
attachments:
|
|
2651
|
+
attachments: K
|
|
2652
2652
|
}) : null,
|
|
2653
|
-
|
|
2654
|
-
message:
|
|
2653
|
+
U(G ? V : R, {
|
|
2654
|
+
message: q,
|
|
2655
2655
|
renderText: g
|
|
2656
2656
|
}),
|
|
2657
|
-
/* @__PURE__ */
|
|
2658
|
-
|
|
2657
|
+
/* @__PURE__ */ U(M, {}),
|
|
2658
|
+
Oe && /* @__PURE__ */ U(Jt, { side: X ? "me" : "other" })
|
|
2659
2659
|
]
|
|
2660
2660
|
})
|
|
2661
2661
|
})
|
|
2662
2662
|
}),
|
|
2663
|
-
!
|
|
2663
|
+
!Le && !Fe && /* @__PURE__ */ U("div", {
|
|
2664
2664
|
className: "str-chat__message-footer",
|
|
2665
|
-
children: (!
|
|
2665
|
+
children: (!Ie || ze) && /* @__PURE__ */ U(Gt, {
|
|
2666
2666
|
message: m,
|
|
2667
|
-
hasAttachment:
|
|
2668
|
-
isMyMessage:
|
|
2667
|
+
hasAttachment: Re,
|
|
2668
|
+
isMyMessage: X
|
|
2669
2669
|
})
|
|
2670
2670
|
}),
|
|
2671
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ U(cn, {
|
|
2672
2672
|
onOutboundClick: y,
|
|
2673
2673
|
resolvedOutbound: x
|
|
2674
2674
|
}),
|
|
2675
|
-
|
|
2675
|
+
ke && /* @__PURE__ */ U(_e, {
|
|
2676
2676
|
onClick: c,
|
|
2677
2677
|
reply_count: m.reply_count
|
|
2678
2678
|
}),
|
|
2679
|
-
|
|
2679
|
+
Ae && /* @__PURE__ */ U(pe, {})
|
|
2680
2680
|
]
|
|
2681
2681
|
}, m.id)
|
|
2682
2682
|
] });
|
|
2683
2683
|
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)), mi = (e) => {
|
|
2684
|
-
let t =
|
|
2685
|
-
return /* @__PURE__ */
|
|
2684
|
+
let t = V("CustomMessage"), n = u(Yt), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
|
|
2685
|
+
return /* @__PURE__ */ U(pi, {
|
|
2686
2686
|
...t,
|
|
2687
2687
|
...e,
|
|
2688
2688
|
resolvedOutbound: i
|
|
2689
2689
|
});
|
|
2690
2690
|
}, hi = () => {
|
|
2691
|
-
let { handleDelete: e, message: t } =
|
|
2692
|
-
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */
|
|
2691
|
+
let { handleDelete: e, message: t } = V("CustomMessageActions");
|
|
2692
|
+
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ U(Ye, {
|
|
2693
2693
|
onClick: e,
|
|
2694
2694
|
"aria-label": "Delete",
|
|
2695
2695
|
title: "Delete",
|
|
2696
2696
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2697
|
-
children: /* @__PURE__ */
|
|
2697
|
+
children: /* @__PURE__ */ U(Ge, {
|
|
2698
2698
|
size: 16,
|
|
2699
2699
|
weight: "light",
|
|
2700
2700
|
"aria-hidden": !0
|
|
2701
2701
|
})
|
|
2702
2702
|
});
|
|
2703
2703
|
}, gi = () => {
|
|
2704
|
-
let { handleFlag: e } =
|
|
2705
|
-
return /* @__PURE__ */
|
|
2704
|
+
let { handleFlag: e } = V("CustomMessageActions");
|
|
2705
|
+
return /* @__PURE__ */ U(Ye, {
|
|
2706
2706
|
onClick: e,
|
|
2707
2707
|
"aria-label": "Report",
|
|
2708
2708
|
title: "Report",
|
|
2709
2709
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2710
|
-
children: /* @__PURE__ */
|
|
2710
|
+
children: /* @__PURE__ */ U(Pe, {
|
|
2711
2711
|
size: 16,
|
|
2712
2712
|
weight: "light",
|
|
2713
2713
|
"aria-hidden": !0
|
|
2714
2714
|
})
|
|
2715
2715
|
});
|
|
2716
2716
|
}, _i = () => {
|
|
2717
|
-
let { message: e } =
|
|
2718
|
-
return e.metadata?.custom_type ===
|
|
2717
|
+
let { message: e } = V("CustomMessageActions");
|
|
2718
|
+
return e.metadata?.custom_type === G.ATTACHMENT ? /* @__PURE__ */ U(Xe, { messageActionSet: [{
|
|
2719
2719
|
Component: hi,
|
|
2720
2720
|
placement: "quick",
|
|
2721
2721
|
type: "delete"
|
|
@@ -2725,14 +2725,14 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2725
2725
|
type: "flag"
|
|
2726
2726
|
}] }) : null;
|
|
2727
2727
|
}, vi = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => _.previewIsLoaded(e) || _.previewIsLoading(e)) }), yi = () => {
|
|
2728
|
-
let { linkPreviewsManager: e } =
|
|
2728
|
+
let { linkPreviewsManager: e } = _e(), { linkPreviews: t } = xe(e.state, vi), n = (t) => {
|
|
2729
2729
|
e.dismissPreview(t);
|
|
2730
2730
|
};
|
|
2731
|
-
return t.length > 0 ? /* @__PURE__ */
|
|
2731
|
+
return t.length > 0 ? /* @__PURE__ */ U("div", {
|
|
2732
2732
|
className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2",
|
|
2733
2733
|
children: t.map((e) => {
|
|
2734
2734
|
let t = _.previewIsLoading(e);
|
|
2735
|
-
return /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ U(zn.Composer, {
|
|
2736
2736
|
title: e.title,
|
|
2737
2737
|
url: e.og_scrape_url,
|
|
2738
2738
|
thumbnailUrl: e.image_url,
|
|
@@ -2742,19 +2742,19 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2742
2742
|
}, e.og_scrape_url);
|
|
2743
2743
|
})
|
|
2744
2744
|
}) : null;
|
|
2745
|
-
}, bi = o.createContext(!1), xi = 200, Si = () => u(bi), Ci = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */
|
|
2745
|
+
}, bi = o.createContext(!1), xi = 200, Si = () => u(bi), Ci = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ U("button", {
|
|
2746
2746
|
...n,
|
|
2747
2747
|
type: "button",
|
|
2748
2748
|
"aria-label": "Send",
|
|
2749
2749
|
disabled: t,
|
|
2750
2750
|
onPointerDown: (e) => e.preventDefault(),
|
|
2751
2751
|
onClick: e,
|
|
2752
|
-
children: /* @__PURE__ */
|
|
2752
|
+
children: /* @__PURE__ */ U(Oe, {
|
|
2753
2753
|
weight: "bold",
|
|
2754
2754
|
className: "size-4"
|
|
2755
2755
|
})
|
|
2756
2756
|
}), wi = () => {
|
|
2757
|
-
let e = u(bi), { handleSubmit: t } =
|
|
2757
|
+
let e = u(bi), { handleSubmit: t } = ye(), n = ve(), r = e || !n, { SendButton: i = Ci, AttachmentPreviewList: a = x } = ge("CustomMessageInput"), s = o.useRef(null);
|
|
2758
2758
|
return o.useEffect(() => {
|
|
2759
2759
|
let e = s.current;
|
|
2760
2760
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -2769,20 +2769,20 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2769
2769
|
Array.from(e.clipboardData?.items ?? []).some((e) => e.kind === "file") || e.stopPropagation();
|
|
2770
2770
|
};
|
|
2771
2771
|
return e.addEventListener("paste", t), () => e.removeEventListener("paste", t);
|
|
2772
|
-
}, []), /* @__PURE__ */
|
|
2772
|
+
}, []), /* @__PURE__ */ W("div", {
|
|
2773
2773
|
ref: s,
|
|
2774
2774
|
className: "central-container flex flex-col min-w-0 w-full max-h-[calc(var(--messaging-surface-height,100dvh)*0.5)] overflow-y-auto overscroll-contain 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)] [&>:not(.messaging-composer-previews):not(.messaging-composer-row)]:p-2",
|
|
2775
2775
|
"data-dd-privacy": "mask",
|
|
2776
|
-
children: [/* @__PURE__ */
|
|
2776
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2777
2777
|
className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2",
|
|
2778
2778
|
children: [
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
2779
|
+
/* @__PURE__ */ U(te, {}),
|
|
2780
|
+
/* @__PURE__ */ U(yi, {}),
|
|
2781
|
+
/* @__PURE__ */ U(a, {})
|
|
2782
2782
|
]
|
|
2783
|
-
}), /* @__PURE__ */
|
|
2783
|
+
}), /* @__PURE__ */ W("div", {
|
|
2784
2784
|
className: "messaging-composer-row flex items-start",
|
|
2785
|
-
children: [/* @__PURE__ */
|
|
2785
|
+
children: [/* @__PURE__ */ U(ie, {
|
|
2786
2786
|
"aria-disabled": e || void 0,
|
|
2787
2787
|
containerClassName: "min-w-0 flex-1 leading-[0]",
|
|
2788
2788
|
className: "w-full resize-none overflow-hidden bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -2791,9 +2791,9 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2791
2791
|
maxRows: Infinity,
|
|
2792
2792
|
readOnly: e,
|
|
2793
2793
|
tabIndex: e ? -1 : void 0
|
|
2794
|
-
}), /* @__PURE__ */
|
|
2794
|
+
}), /* @__PURE__ */ U("div", {
|
|
2795
2795
|
className: "sticky bottom-2 mt-auto mb-2 mr-2 shrink-0 pt-2",
|
|
2796
|
-
children: /* @__PURE__ */
|
|
2796
|
+
children: /* @__PURE__ */ U(i, {
|
|
2797
2797
|
sendMessage: t,
|
|
2798
2798
|
"aria-label": "Send",
|
|
2799
2799
|
className: "str-chat__send-button relative flex justify-center items-center rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring before:absolute before:-inset-2 before:content-['']",
|
|
@@ -2804,19 +2804,19 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2804
2804
|
})]
|
|
2805
2805
|
})]
|
|
2806
2806
|
});
|
|
2807
|
-
}, Ti = () => /* @__PURE__ */
|
|
2807
|
+
}, Ti = () => /* @__PURE__ */ W("div", {
|
|
2808
2808
|
className: "messaging-composer-backdrop",
|
|
2809
2809
|
"aria-hidden": "true",
|
|
2810
2810
|
children: [
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2812
|
+
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2813
|
+
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2814
|
+
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2815
|
+
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2816
|
+
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-gradient" })
|
|
2817
2817
|
]
|
|
2818
2818
|
}), Ei = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: i, composerInput: a }) => {
|
|
2819
|
-
let { channel: s } =
|
|
2819
|
+
let { channel: s } = me(), c = s?.data?.frozen === !0, l = !!a, u = o.useRef(null);
|
|
2820
2820
|
return o.useEffect(() => {
|
|
2821
2821
|
if (!l) return;
|
|
2822
2822
|
let e = u.current, t = e?.parentElement;
|
|
@@ -2832,16 +2832,16 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2832
2832
|
return i.observe(e), () => {
|
|
2833
2833
|
i.disconnect(), t.style.removeProperty("--messaging-composer-height");
|
|
2834
2834
|
};
|
|
2835
|
-
}, [l]), r ? l ? /* @__PURE__ */
|
|
2835
|
+
}, [l]), r ? l ? /* @__PURE__ */ W("div", {
|
|
2836
2836
|
ref: u,
|
|
2837
2837
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2838
|
-
children: [/* @__PURE__ */
|
|
2838
|
+
children: [/* @__PURE__ */ U(Ti, {}), /* @__PURE__ */ W("div", {
|
|
2839
2839
|
className: "relative z-10 flex flex-col",
|
|
2840
2840
|
children: [
|
|
2841
2841
|
t?.(),
|
|
2842
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ U("div", {
|
|
2843
2843
|
className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4",
|
|
2844
|
-
children: i ? /* @__PURE__ */
|
|
2844
|
+
children: i ? /* @__PURE__ */ U("p", {
|
|
2845
2845
|
className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40",
|
|
2846
2846
|
children: i
|
|
2847
2847
|
}) : null
|
|
@@ -2849,51 +2849,51 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2849
2849
|
n?.()
|
|
2850
2850
|
]
|
|
2851
2851
|
})]
|
|
2852
|
-
}) : /* @__PURE__ */
|
|
2852
|
+
}) : /* @__PURE__ */ W(H, { children: [
|
|
2853
2853
|
t?.(),
|
|
2854
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ U("div", {
|
|
2855
2855
|
className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4",
|
|
2856
|
-
children: i ? /* @__PURE__ */
|
|
2856
|
+
children: i ? /* @__PURE__ */ U("p", {
|
|
2857
2857
|
className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40",
|
|
2858
2858
|
children: i
|
|
2859
2859
|
}) : null
|
|
2860
2860
|
}),
|
|
2861
2861
|
n?.()
|
|
2862
|
-
] }) : l ? /* @__PURE__ */
|
|
2862
|
+
] }) : l ? /* @__PURE__ */ W("div", {
|
|
2863
2863
|
ref: u,
|
|
2864
2864
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2865
|
-
children: [/* @__PURE__ */
|
|
2865
|
+
children: [/* @__PURE__ */ U(Ti, {}), /* @__PURE__ */ W("div", {
|
|
2866
2866
|
className: "relative z-10 flex min-h-0 flex-col",
|
|
2867
|
-
children: [t?.(), /* @__PURE__ */
|
|
2867
|
+
children: [t?.(), /* @__PURE__ */ W("div", {
|
|
2868
2868
|
className: "flex min-h-0 flex-col gap-4 p-3 pb-5 md:p-5",
|
|
2869
|
-
children: [/* @__PURE__ */
|
|
2869
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2870
2870
|
inert: c ? "" : void 0,
|
|
2871
2871
|
"aria-disabled": c || void 0,
|
|
2872
2872
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
2873
|
-
children: [e && /* @__PURE__ */
|
|
2873
|
+
children: [e && /* @__PURE__ */ U("div", {
|
|
2874
2874
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2875
2875
|
children: e()
|
|
2876
|
-
}), /* @__PURE__ */
|
|
2876
|
+
}), /* @__PURE__ */ U(bi.Provider, {
|
|
2877
2877
|
value: c,
|
|
2878
|
-
children: /* @__PURE__ */
|
|
2878
|
+
children: /* @__PURE__ */ U(N, { Input: a ?? wi })
|
|
2879
2879
|
})]
|
|
2880
2880
|
}), n?.()]
|
|
2881
2881
|
})]
|
|
2882
2882
|
})]
|
|
2883
|
-
}) : /* @__PURE__ */
|
|
2883
|
+
}) : /* @__PURE__ */ W("div", {
|
|
2884
2884
|
className: "flex min-h-0 flex-col gap-4 p-4",
|
|
2885
2885
|
children: [
|
|
2886
2886
|
t?.(),
|
|
2887
|
-
/* @__PURE__ */
|
|
2887
|
+
/* @__PURE__ */ W("div", {
|
|
2888
2888
|
inert: c ? "" : void 0,
|
|
2889
2889
|
"aria-disabled": c || void 0,
|
|
2890
2890
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
2891
|
-
children: [e && /* @__PURE__ */
|
|
2891
|
+
children: [e && /* @__PURE__ */ U("div", {
|
|
2892
2892
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2893
2893
|
children: e()
|
|
2894
|
-
}), /* @__PURE__ */
|
|
2894
|
+
}), /* @__PURE__ */ U(bi.Provider, {
|
|
2895
2895
|
value: c,
|
|
2896
|
-
children: /* @__PURE__ */
|
|
2896
|
+
children: /* @__PURE__ */ U(N, { Input: wi })
|
|
2897
2897
|
})]
|
|
2898
2898
|
}),
|
|
2899
2899
|
n?.()
|
|
@@ -2904,16 +2904,16 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2904
2904
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
2905
2905
|
}, Oi = ["SYSTEM_AGE_SAFETY_BLOCKED"], ki = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, Ai = "age safety guidelines.", ji = "https://linktr.ee/s/about/contact", Mi = (e) => Oi.includes(e), Ni = (e) => Mi(e.metadata?.custom_type), Pi = (e) => {
|
|
2906
2906
|
let t = e.metadata?.custom_type;
|
|
2907
|
-
if (
|
|
2907
|
+
if (q(t)) return {
|
|
2908
2908
|
kind: "dm-agent",
|
|
2909
2909
|
type: t
|
|
2910
2910
|
};
|
|
2911
|
-
if (
|
|
2911
|
+
if (Ce(t)) return {
|
|
2912
2912
|
kind: "age-safety",
|
|
2913
2913
|
type: t
|
|
2914
2914
|
};
|
|
2915
2915
|
let n = e.dm_agent_system_type;
|
|
2916
|
-
if (
|
|
2916
|
+
if (q(n)) return {
|
|
2917
2917
|
kind: "dm-agent",
|
|
2918
2918
|
type: n
|
|
2919
2919
|
};
|
|
@@ -2921,9 +2921,9 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2921
2921
|
let t = e.indexOf(Ai);
|
|
2922
2922
|
if (t === -1) return e;
|
|
2923
2923
|
let n = t + 22;
|
|
2924
|
-
return /* @__PURE__ */
|
|
2924
|
+
return /* @__PURE__ */ W(H, { children: [
|
|
2925
2925
|
e.slice(0, t),
|
|
2926
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ U("a", {
|
|
2927
2927
|
href: ji,
|
|
2928
2928
|
target: "_blank",
|
|
2929
2929
|
rel: "noopener noreferrer",
|
|
@@ -2936,68 +2936,68 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2936
2936
|
let t = !Ni(e.message), n = Pi(e.message);
|
|
2937
2937
|
if (n?.kind === "dm-agent") {
|
|
2938
2938
|
let r = e.message.text?.trim() || Di[n.type];
|
|
2939
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ W("div", {
|
|
2940
2940
|
className: "str-chat__message--system",
|
|
2941
2941
|
"data-testid": "message-system",
|
|
2942
|
-
children: [/* @__PURE__ */
|
|
2942
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2943
2943
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
2944
2944
|
"data-testid": "dm-agent-system-message",
|
|
2945
2945
|
"data-dm-agent-system-type": n.type,
|
|
2946
|
-
children: [/* @__PURE__ */
|
|
2946
|
+
children: [/* @__PURE__ */ U(He, {
|
|
2947
2947
|
size: 16,
|
|
2948
2948
|
weight: "regular",
|
|
2949
2949
|
"aria-hidden": !0,
|
|
2950
2950
|
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
2951
|
-
}), /* @__PURE__ */
|
|
2951
|
+
}), /* @__PURE__ */ U("p", {
|
|
2952
2952
|
className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]",
|
|
2953
2953
|
children: r
|
|
2954
2954
|
})]
|
|
2955
|
-
}), !t && /* @__PURE__ */
|
|
2955
|
+
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
2956
2956
|
});
|
|
2957
2957
|
}
|
|
2958
2958
|
if (n?.kind === "age-safety") {
|
|
2959
2959
|
let r = e.message.text?.trim() || ki[n.type];
|
|
2960
|
-
return /* @__PURE__ */
|
|
2960
|
+
return /* @__PURE__ */ W("div", {
|
|
2961
2961
|
className: "str-chat__message--system",
|
|
2962
2962
|
"data-testid": "message-system",
|
|
2963
|
-
children: [/* @__PURE__ */
|
|
2963
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2964
2964
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
2965
2965
|
"data-testid": "age-safety-system-message",
|
|
2966
2966
|
"data-age-safety-system-type": n.type,
|
|
2967
|
-
children: [/* @__PURE__ */
|
|
2967
|
+
children: [/* @__PURE__ */ U(ze, {
|
|
2968
2968
|
size: 24,
|
|
2969
2969
|
weight: "duotone",
|
|
2970
2970
|
"aria-hidden": !0,
|
|
2971
2971
|
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
2972
2972
|
"data-testid": "age-safety-system-message-icon"
|
|
2973
|
-
}), /* @__PURE__ */
|
|
2973
|
+
}), /* @__PURE__ */ U("div", {
|
|
2974
2974
|
className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]",
|
|
2975
|
-
children: /* @__PURE__ */
|
|
2975
|
+
children: /* @__PURE__ */ U("p", {
|
|
2976
2976
|
className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
2977
2977
|
children: Fi(r)
|
|
2978
2978
|
})
|
|
2979
2979
|
})]
|
|
2980
|
-
}), !t && /* @__PURE__ */
|
|
2980
|
+
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
2981
2981
|
});
|
|
2982
2982
|
}
|
|
2983
|
-
return /* @__PURE__ */
|
|
2983
|
+
return /* @__PURE__ */ W("div", {
|
|
2984
2984
|
className: "str-chat__message--system",
|
|
2985
2985
|
"data-testid": "message-system",
|
|
2986
|
-
children: [/* @__PURE__ */
|
|
2986
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2987
2987
|
className: "str-chat__message--system__text",
|
|
2988
2988
|
children: [
|
|
2989
|
-
/* @__PURE__ */
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ U("div", { className: "str-chat__message--system__line" }),
|
|
2990
|
+
/* @__PURE__ */ U("p", { children: e.message.text }),
|
|
2991
|
+
/* @__PURE__ */ U("div", { className: "str-chat__message--system__line" })
|
|
2992
2992
|
]
|
|
2993
|
-
}), !t && /* @__PURE__ */
|
|
2993
|
+
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
2994
2994
|
});
|
|
2995
|
-
}, Li = c(!1), Ri = ({ cx: e, index: t }) => /* @__PURE__ */
|
|
2995
|
+
}, Li = c(!1), Ri = ({ cx: e, index: t }) => /* @__PURE__ */ U("circle", {
|
|
2996
2996
|
cx: e,
|
|
2997
2997
|
cy: "6.15",
|
|
2998
2998
|
r: "3.9",
|
|
2999
2999
|
fill: "#A0A0A0",
|
|
3000
|
-
children: /* @__PURE__ */
|
|
3000
|
+
children: /* @__PURE__ */ U("animateTransform", {
|
|
3001
3001
|
attributeName: "transform",
|
|
3002
3002
|
type: "translate",
|
|
3003
3003
|
values: "0 0; 0 -2.25; 0 0;",
|
|
@@ -3010,10 +3010,10 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3010
3010
|
y.Generating,
|
|
3011
3011
|
y.ExternalSources
|
|
3012
3012
|
]), Bi = ({ threadList: e }) => {
|
|
3013
|
-
let { channel: t, channelConfig: n, thread: r } =
|
|
3013
|
+
let { channel: t, channelConfig: n, thread: r } = me(), { client: i } = he(), { typing: a = {} } = Se(), { aiState: o } = fe(t), s = u(Li);
|
|
3014
3014
|
if (!e && s && zi.has(o)) {
|
|
3015
3015
|
let e = Hi(t, i.user?.id);
|
|
3016
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ U(Vi, {
|
|
3017
3017
|
avatarId: e?.id ?? "ai-agent",
|
|
3018
3018
|
avatarName: e?.name ?? e?.id ?? "Agent",
|
|
3019
3019
|
avatarImage: e?.image,
|
|
@@ -3024,36 +3024,36 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3024
3024
|
let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], d = e ? l : c;
|
|
3025
3025
|
if (!d.length) return null;
|
|
3026
3026
|
let f = d[0]?.user, p = f?.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3027
|
-
return /* @__PURE__ */
|
|
3027
|
+
return /* @__PURE__ */ U(Vi, {
|
|
3028
3028
|
avatarId: f?.id ?? p?.id ?? "typing-user",
|
|
3029
3029
|
avatarName: f?.name ?? p?.name ?? f?.id ?? "Typing user",
|
|
3030
3030
|
avatarImage: f?.image ?? p?.image,
|
|
3031
3031
|
testId: "typing-indicator"
|
|
3032
3032
|
});
|
|
3033
|
-
}, Vi = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */
|
|
3033
|
+
}, Vi = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ U("div", {
|
|
3034
3034
|
className: "str-chat__li str-chat__li--single str-chat__typing-indicator !static",
|
|
3035
3035
|
"data-testid": r,
|
|
3036
3036
|
style: { marginBottom: "var(--messaging-channel-input-spacer-height, 80px)" },
|
|
3037
|
-
children: /* @__PURE__ */
|
|
3037
|
+
children: /* @__PURE__ */ W("div", {
|
|
3038
3038
|
className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text",
|
|
3039
|
-
children: [/* @__PURE__ */
|
|
3039
|
+
children: [/* @__PURE__ */ U(_t, {
|
|
3040
3040
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3041
3041
|
id: e,
|
|
3042
3042
|
name: t,
|
|
3043
3043
|
image: n ?? void 0,
|
|
3044
3044
|
size: 24,
|
|
3045
3045
|
shape: "circle"
|
|
3046
|
-
}), /* @__PURE__ */
|
|
3046
|
+
}), /* @__PURE__ */ U("div", {
|
|
3047
3047
|
className: "str-chat__message-inner mx-0",
|
|
3048
|
-
children: /* @__PURE__ */
|
|
3048
|
+
children: /* @__PURE__ */ U("div", {
|
|
3049
3049
|
className: "str-chat__message-bubble-wrapper",
|
|
3050
|
-
children: /* @__PURE__ */
|
|
3050
|
+
children: /* @__PURE__ */ W("div", {
|
|
3051
3051
|
className: "str-chat__message-bubble relative isolate",
|
|
3052
|
-
children: [/* @__PURE__ */
|
|
3052
|
+
children: [/* @__PURE__ */ U("div", {
|
|
3053
3053
|
className: "str-chat__message-text min-h-11 flex items-center",
|
|
3054
|
-
children: /* @__PURE__ */
|
|
3054
|
+
children: /* @__PURE__ */ U("div", {
|
|
3055
3055
|
className: "str-chat__message-text-inner str-chat__message-simple-text-inner",
|
|
3056
|
-
children: /* @__PURE__ */
|
|
3056
|
+
children: /* @__PURE__ */ W("svg", {
|
|
3057
3057
|
"aria-hidden": "true",
|
|
3058
3058
|
className: "block overflow-visible",
|
|
3059
3059
|
viewBox: "0 0 32 12.3",
|
|
@@ -3061,22 +3061,22 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3061
3061
|
height: "13",
|
|
3062
3062
|
overflow: "visible",
|
|
3063
3063
|
children: [
|
|
3064
|
-
/* @__PURE__ */
|
|
3064
|
+
/* @__PURE__ */ U(Ri, {
|
|
3065
3065
|
cx: "4",
|
|
3066
3066
|
index: 0
|
|
3067
3067
|
}),
|
|
3068
|
-
/* @__PURE__ */
|
|
3068
|
+
/* @__PURE__ */ U(Ri, {
|
|
3069
3069
|
cx: "16",
|
|
3070
3070
|
index: 1
|
|
3071
3071
|
}),
|
|
3072
|
-
/* @__PURE__ */
|
|
3072
|
+
/* @__PURE__ */ U(Ri, {
|
|
3073
3073
|
cx: "28",
|
|
3074
3074
|
index: 2
|
|
3075
3075
|
})
|
|
3076
3076
|
]
|
|
3077
3077
|
})
|
|
3078
3078
|
})
|
|
3079
|
-
}), /* @__PURE__ */
|
|
3079
|
+
}), /* @__PURE__ */ U(Jt, { side: "other" })]
|
|
3080
3080
|
})
|
|
3081
3081
|
})
|
|
3082
3082
|
})]
|
|
@@ -3091,18 +3091,18 @@ function Hi(e, t) {
|
|
|
3091
3091
|
}
|
|
3092
3092
|
//#endregion
|
|
3093
3093
|
//#region src/components/MessagingShell/ChannelEmptyState.tsx
|
|
3094
|
-
var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */
|
|
3095
|
-
className:
|
|
3096
|
-
children: [/* @__PURE__ */
|
|
3094
|
+
var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ W("div", {
|
|
3095
|
+
className: J("flex items-center justify-center h-full", e),
|
|
3096
|
+
children: [/* @__PURE__ */ W("svg", {
|
|
3097
3097
|
viewBox: "0 0 100 100",
|
|
3098
3098
|
className: "size-8 fill-pebble",
|
|
3099
3099
|
stroke: "none",
|
|
3100
3100
|
children: [
|
|
3101
|
-
/* @__PURE__ */
|
|
3101
|
+
/* @__PURE__ */ U("circle", {
|
|
3102
3102
|
cx: "6",
|
|
3103
3103
|
cy: "50",
|
|
3104
3104
|
r: "6",
|
|
3105
|
-
children: /* @__PURE__ */
|
|
3105
|
+
children: /* @__PURE__ */ U("animateTransform", {
|
|
3106
3106
|
attributeName: "transform",
|
|
3107
3107
|
dur: "1s",
|
|
3108
3108
|
type: "translate",
|
|
@@ -3111,11 +3111,11 @@ var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3111
3111
|
begin: "0.1"
|
|
3112
3112
|
})
|
|
3113
3113
|
}),
|
|
3114
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ U("circle", {
|
|
3115
3115
|
cx: "30",
|
|
3116
3116
|
cy: "50",
|
|
3117
3117
|
r: "6",
|
|
3118
|
-
children: /* @__PURE__ */
|
|
3118
|
+
children: /* @__PURE__ */ U("animateTransform", {
|
|
3119
3119
|
attributeName: "transform",
|
|
3120
3120
|
dur: "1s",
|
|
3121
3121
|
type: "translate",
|
|
@@ -3124,11 +3124,11 @@ var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3124
3124
|
begin: "0.2"
|
|
3125
3125
|
})
|
|
3126
3126
|
}),
|
|
3127
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ U("circle", {
|
|
3128
3128
|
cx: "54",
|
|
3129
3129
|
cy: "50",
|
|
3130
3130
|
r: "6",
|
|
3131
|
-
children: /* @__PURE__ */
|
|
3131
|
+
children: /* @__PURE__ */ U("animateTransform", {
|
|
3132
3132
|
attributeName: "transform",
|
|
3133
3133
|
dur: "1s",
|
|
3134
3134
|
type: "translate",
|
|
@@ -3138,15 +3138,15 @@ var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3138
3138
|
})
|
|
3139
3139
|
})
|
|
3140
3140
|
]
|
|
3141
|
-
}), t && /* @__PURE__ */
|
|
3141
|
+
}), t && /* @__PURE__ */ U("span", {
|
|
3142
3142
|
className: "text-stone",
|
|
3143
3143
|
children: t
|
|
3144
3144
|
})]
|
|
3145
|
-
}), Gi = o.memo(() => /* @__PURE__ */
|
|
3145
|
+
}), Gi = o.memo(() => /* @__PURE__ */ U("div", {
|
|
3146
3146
|
className: "messaging-loading-state flex items-center justify-center h-full",
|
|
3147
|
-
children: /* @__PURE__ */
|
|
3147
|
+
children: /* @__PURE__ */ W("div", {
|
|
3148
3148
|
className: "flex items-center",
|
|
3149
|
-
children: [/* @__PURE__ */
|
|
3149
|
+
children: [/* @__PURE__ */ U(Wi, { className: "w-6 h-6" }), /* @__PURE__ */ U("span", {
|
|
3150
3150
|
className: "text-sm text-stone",
|
|
3151
3151
|
children: "Loading messages"
|
|
3152
3152
|
})]
|
|
@@ -3156,13 +3156,13 @@ Gi.displayName = "LoadingState";
|
|
|
3156
3156
|
//#endregion
|
|
3157
3157
|
//#region src/components/ChannelView.tsx
|
|
3158
3158
|
var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: i, onLeaveConversation: a, onBlockParticipant: s, showDeleteConversation: c = !0, onDeleteConversationClick: u, onBlockParticipantClick: f, onReportParticipantClick: p, showBlockParticipant: h = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
|
|
3159
|
-
let { channel: A, messages: j } =
|
|
3159
|
+
let { channel: A, messages: j } = me(), M = m(D);
|
|
3160
3160
|
d(() => {
|
|
3161
3161
|
M.current = D;
|
|
3162
3162
|
}, [D]);
|
|
3163
3163
|
let N = l((e) => {
|
|
3164
3164
|
M.current?.(e);
|
|
3165
|
-
}, []), P = D ? N : void 0, I =
|
|
3165
|
+
}, []), P = D ? N : void 0, I = $t(j, O), L = A.state.messages.some((e) => e.type !== "deleted"), R = b ? /* @__PURE__ */ U(o.Fragment, { children: b() }, "lt-channel-banner") : null, z = /* @__PURE__ */ U(Tt, {
|
|
3166
3166
|
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%)]",
|
|
3167
3167
|
onBack: e,
|
|
3168
3168
|
showBackButton: t,
|
|
@@ -3180,7 +3180,7 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3180
3180
|
renderChannelActions: S,
|
|
3181
3181
|
onParticipantNameClick: E
|
|
3182
3182
|
}), ee = l((e) => {
|
|
3183
|
-
let { message: t } =
|
|
3183
|
+
let { message: t } = V("ChannelView"), n = /* @__PURE__ */ U(mi, {
|
|
3184
3184
|
...e,
|
|
3185
3185
|
viewerLanguage: w,
|
|
3186
3186
|
onOutboundClick: P
|
|
@@ -3191,34 +3191,34 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3191
3191
|
C,
|
|
3192
3192
|
w
|
|
3193
3193
|
]);
|
|
3194
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ U(Yt.Provider, {
|
|
3195
3195
|
value: I,
|
|
3196
|
-
children: /* @__PURE__ */
|
|
3196
|
+
children: /* @__PURE__ */ U(ae, {
|
|
3197
3197
|
overrides: {
|
|
3198
3198
|
Message: ee,
|
|
3199
3199
|
MessageActions: _i,
|
|
3200
3200
|
UnreadMessagesNotification: () => null,
|
|
3201
3201
|
UnreadMessagesSeparator: () => null
|
|
3202
3202
|
},
|
|
3203
|
-
children: /* @__PURE__ */
|
|
3203
|
+
children: /* @__PURE__ */ U(B, { children: k ? /* @__PURE__ */ W("div", {
|
|
3204
3204
|
className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col",
|
|
3205
|
-
children: [/* @__PURE__ */
|
|
3205
|
+
children: [/* @__PURE__ */ W("div", {
|
|
3206
3206
|
className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
|
|
3207
|
-
children: [!L && /* @__PURE__ */
|
|
3207
|
+
children: [!L && /* @__PURE__ */ U("div", {
|
|
3208
3208
|
className: "str-chat__list",
|
|
3209
|
-
children: /* @__PURE__ */
|
|
3209
|
+
children: /* @__PURE__ */ W("div", {
|
|
3210
3210
|
className: "str-chat__message-list-scroll",
|
|
3211
3211
|
children: [z, R]
|
|
3212
3212
|
})
|
|
3213
|
-
}), /* @__PURE__ */
|
|
3214
|
-
head: L ? /* @__PURE__ */
|
|
3213
|
+
}), /* @__PURE__ */ U(F, {
|
|
3214
|
+
head: L ? /* @__PURE__ */ W("div", {
|
|
3215
3215
|
className: "sticky top-0 z-10",
|
|
3216
3216
|
children: [z, R]
|
|
3217
3217
|
}) : void 0,
|
|
3218
3218
|
hideDeletedMessages: !0,
|
|
3219
3219
|
hideNewMessageSeparator: !1
|
|
3220
3220
|
})]
|
|
3221
|
-
}, "lt-channel-message-list"), /* @__PURE__ */
|
|
3221
|
+
}, "lt-channel-message-list"), /* @__PURE__ */ U(Ei, {
|
|
3222
3222
|
...n && { renderActions: () => n?.(A) },
|
|
3223
3223
|
...i && { renderHeader: () => i(A) },
|
|
3224
3224
|
renderFooter: () => r?.(A),
|
|
@@ -3226,17 +3226,17 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3226
3226
|
disabledReason: v,
|
|
3227
3227
|
composerInput: k
|
|
3228
3228
|
}, "lt-channel-message-input")]
|
|
3229
|
-
}) : /* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3229
|
+
}) : /* @__PURE__ */ W(H, { children: [
|
|
3230
|
+
/* @__PURE__ */ W("div", {
|
|
3231
3231
|
className: "flex-1 overflow-hidden relative",
|
|
3232
|
-
children: [!L && /* @__PURE__ */
|
|
3232
|
+
children: [!L && /* @__PURE__ */ U("div", {
|
|
3233
3233
|
className: "str-chat__list",
|
|
3234
|
-
children: /* @__PURE__ */
|
|
3234
|
+
children: /* @__PURE__ */ W("div", {
|
|
3235
3235
|
className: "str-chat__message-list-scroll",
|
|
3236
3236
|
children: [z, R]
|
|
3237
3237
|
})
|
|
3238
|
-
}), /* @__PURE__ */
|
|
3239
|
-
head: L ? /* @__PURE__ */
|
|
3238
|
+
}), /* @__PURE__ */ U(F, {
|
|
3239
|
+
head: L ? /* @__PURE__ */ W("div", {
|
|
3240
3240
|
className: "sticky top-0 z-10",
|
|
3241
3241
|
children: [z, R]
|
|
3242
3242
|
}) : void 0,
|
|
@@ -3244,8 +3244,8 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3244
3244
|
hideNewMessageSeparator: !1
|
|
3245
3245
|
})]
|
|
3246
3246
|
}, "lt-channel-message-list"),
|
|
3247
|
-
i ? /* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3247
|
+
i ? /* @__PURE__ */ U(o.Fragment, { children: i(A) }, "lt-channel-conversation-footer") : null,
|
|
3248
|
+
/* @__PURE__ */ U(Ei, {
|
|
3249
3249
|
...n && { renderActions: () => n?.(A) },
|
|
3250
3250
|
renderFooter: () => r?.(A),
|
|
3251
3251
|
disabled: _,
|
|
@@ -3288,23 +3288,23 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3288
3288
|
return t.addEventListener("click", n), () => t.removeEventListener("click", n);
|
|
3289
3289
|
}, [A, e]);
|
|
3290
3290
|
let te = we(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
|
|
3291
|
-
return /* @__PURE__ */
|
|
3291
|
+
return /* @__PURE__ */ U("div", {
|
|
3292
3292
|
ref: ee,
|
|
3293
|
-
className:
|
|
3293
|
+
className: J("messaging-channel-view h-full flex flex-col", c),
|
|
3294
3294
|
style: te,
|
|
3295
|
-
children: /* @__PURE__ */
|
|
3295
|
+
children: /* @__PURE__ */ U(Li.Provider, {
|
|
3296
3296
|
value: x ?? !1,
|
|
3297
|
-
children: /* @__PURE__ */
|
|
3297
|
+
children: /* @__PURE__ */ U(S, {
|
|
3298
3298
|
channel: e,
|
|
3299
3299
|
MessageSystem: Ii,
|
|
3300
3300
|
EmptyStateIndicator: u,
|
|
3301
3301
|
LoadingIndicator: Gi,
|
|
3302
|
-
DateSeparator:
|
|
3302
|
+
DateSeparator: Et,
|
|
3303
3303
|
TypingIndicator: Bi,
|
|
3304
3304
|
doSendMessageRequest: z,
|
|
3305
3305
|
...j ? { SendButton: j } : {},
|
|
3306
3306
|
...M ? { AttachmentPreviewList: M } : {},
|
|
3307
|
-
children: /* @__PURE__ */
|
|
3307
|
+
children: /* @__PURE__ */ U(Ki, {
|
|
3308
3308
|
onBack: t,
|
|
3309
3309
|
showBackButton: n,
|
|
3310
3310
|
renderMessageInputActions: r,
|
|
@@ -3340,27 +3340,27 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3340
3340
|
qi.displayName = "ChannelView";
|
|
3341
3341
|
//#endregion
|
|
3342
3342
|
//#region src/components/MessagingShell/ErrorState.tsx
|
|
3343
|
-
var Ji = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */
|
|
3343
|
+
var Ji = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ U("div", {
|
|
3344
3344
|
className: "messaging-error-state flex items-center justify-center h-full p-8",
|
|
3345
|
-
children: /* @__PURE__ */
|
|
3345
|
+
children: /* @__PURE__ */ W("div", {
|
|
3346
3346
|
className: "text-center max-w-sm",
|
|
3347
3347
|
children: [
|
|
3348
|
-
/* @__PURE__ */
|
|
3348
|
+
/* @__PURE__ */ U("div", {
|
|
3349
3349
|
className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6",
|
|
3350
|
-
children: /* @__PURE__ */
|
|
3350
|
+
children: /* @__PURE__ */ U("span", {
|
|
3351
3351
|
className: "text-4xl",
|
|
3352
3352
|
children: "⚠️"
|
|
3353
3353
|
})
|
|
3354
3354
|
}),
|
|
3355
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ U("h2", {
|
|
3356
3356
|
className: "font-semibold text-charcoal mb-2",
|
|
3357
3357
|
children: "Oops!"
|
|
3358
3358
|
}),
|
|
3359
|
-
/* @__PURE__ */
|
|
3359
|
+
/* @__PURE__ */ U("p", {
|
|
3360
3360
|
className: "text-stone text-sm mb-6",
|
|
3361
3361
|
children: e
|
|
3362
3362
|
}),
|
|
3363
|
-
t && /* @__PURE__ */
|
|
3363
|
+
t && /* @__PURE__ */ U("button", {
|
|
3364
3364
|
type: "button",
|
|
3365
3365
|
onClick: t,
|
|
3366
3366
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[#7f22fe] hover:bg-primary-alt rounded-lg transition-colors focus-ring",
|
|
@@ -3373,7 +3373,7 @@ Ji.displayName = "ErrorState";
|
|
|
3373
3373
|
//#endregion
|
|
3374
3374
|
//#region src/components/MessagingShell/index.tsx
|
|
3375
3375
|
var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: s, onBlockParticipantClick: c, onReportParticipantClick: u, dmAgentEnabled: f, onMessageSent: p, viewerLanguage: g, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
|
|
3376
|
-
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } =
|
|
3376
|
+
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = at(), [F, I] = h(null), [L, R] = h(null), [z, ee] = h(!1), { showDeleteConversation: te = !0 } = e, ne = m(o);
|
|
3377
3377
|
ne.current = o;
|
|
3378
3378
|
let re = m(r);
|
|
3379
3379
|
re.current = r;
|
|
@@ -3432,17 +3432,17 @@ var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3432
3432
|
let oe = l(() => {
|
|
3433
3433
|
I(null), ee(!0), ae.current?.();
|
|
3434
3434
|
}, []);
|
|
3435
|
-
return A ? /* @__PURE__ */
|
|
3435
|
+
return A ? /* @__PURE__ */ U(Gi, {}) : j ? /* @__PURE__ */ U(Ji, {
|
|
3436
3436
|
message: j,
|
|
3437
3437
|
onBack: M
|
|
3438
|
-
}) : !k || !O ? /* @__PURE__ */
|
|
3438
|
+
}) : !k || !O ? /* @__PURE__ */ U(Ji, {
|
|
3439
3439
|
message: "Not connected to messaging service",
|
|
3440
3440
|
onBack: M
|
|
3441
|
-
}) : L ? /* @__PURE__ */
|
|
3441
|
+
}) : L ? /* @__PURE__ */ U(Ji, { message: L }) : z && !F ? /* @__PURE__ */ U(Ji, { message: "Conversation ended" }) : F ? /* @__PURE__ */ U("div", {
|
|
3442
3442
|
className: "messaging-shell h-full bg-background-primary overflow-hidden",
|
|
3443
|
-
children: /* @__PURE__ */
|
|
3443
|
+
children: /* @__PURE__ */ U("div", {
|
|
3444
3444
|
className: "flex h-full min-h-0 flex-col",
|
|
3445
|
-
children: /* @__PURE__ */
|
|
3445
|
+
children: /* @__PURE__ */ U(qi, {
|
|
3446
3446
|
channel: F,
|
|
3447
3447
|
renderMessageInputActions: t,
|
|
3448
3448
|
renderConversationFooter: n,
|
|
@@ -3468,7 +3468,7 @@ var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3468
3468
|
attachmentPreviewList: D
|
|
3469
3469
|
}, F.id)
|
|
3470
3470
|
})
|
|
3471
|
-
}) : /* @__PURE__ */
|
|
3471
|
+
}) : /* @__PURE__ */ U(Gi, {});
|
|
3472
3472
|
};
|
|
3473
3473
|
//#endregion
|
|
3474
3474
|
//#region src/hooks/useRestorePendingMessages.ts
|
|
@@ -3505,8 +3505,8 @@ var Zi = o.createContext({
|
|
|
3505
3505
|
year: "numeric"
|
|
3506
3506
|
});
|
|
3507
3507
|
}, na = o.memo((e) => {
|
|
3508
|
-
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = $i(), { client: l } =
|
|
3509
|
-
if (o) return /* @__PURE__ */
|
|
3508
|
+
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = $i(), { client: l } = he(), u = r?.id === t?.id, d = ot(t);
|
|
3509
|
+
if (o) return /* @__PURE__ */ U(o, {
|
|
3510
3510
|
...e,
|
|
3511
3511
|
active: u,
|
|
3512
3512
|
selectedChannel: r,
|
|
@@ -3518,70 +3518,70 @@ var Zi = o.createContext({
|
|
|
3518
3518
|
}, p = (e) => {
|
|
3519
3519
|
let t = e.key === "Enter" || e.key === " ", n = e.repeat;
|
|
3520
3520
|
!t || n || (e.preventDefault(), f());
|
|
3521
|
-
}, m =
|
|
3521
|
+
}, m = st(t?.state?.members, l?.userID, t?.type), h = dt(m?.user), g = m?.user?.image, _ = (() => {
|
|
3522
3522
|
let e = t?.state?.messages;
|
|
3523
3523
|
if (e?.length) {
|
|
3524
3524
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].type !== "system") return e[t];
|
|
3525
3525
|
}
|
|
3526
3526
|
})(), v = (() => {
|
|
3527
|
-
let e =
|
|
3527
|
+
let e = Ot({
|
|
3528
3528
|
message: _,
|
|
3529
3529
|
viewerLanguage: c
|
|
3530
3530
|
}), { custom_type: t, attachment_content_type: n } = _?.metadata || {};
|
|
3531
|
-
if (t ===
|
|
3532
|
-
if (t ===
|
|
3533
|
-
if (t ===
|
|
3531
|
+
if (t === G.TIP) return e || "Sent a tip";
|
|
3532
|
+
if (t === G.PAID) return e || "Sent a message";
|
|
3533
|
+
if (t === G.ATTACHMENT) {
|
|
3534
3534
|
if (n === "text") return "🔒 Sent a locked message";
|
|
3535
3535
|
if (n === "media") return "🔒 Sent a locked attachment";
|
|
3536
3536
|
}
|
|
3537
3537
|
if (e) return e;
|
|
3538
3538
|
let r = _?.attachments?.[0];
|
|
3539
3539
|
return r ? r.og_scrape_url ? r.og_scrape_url : r.type === "image" ? "📷 Sent an image" : r.type === "video" ? "🎥 Sent a video" : r.type === "audio" ? "🎵 Sent audio" : r.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
3540
|
-
})(), y = _?.created_at ? ta(new Date(_.created_at)) : "", b = _ ?
|
|
3540
|
+
})(), y = _?.created_at ? ta(new Date(_.created_at)) : "", b = _ ? Bt(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
|
|
3541
3541
|
return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
3542
3542
|
channelId: t?.id,
|
|
3543
3543
|
isSelected: u,
|
|
3544
3544
|
participantName: h,
|
|
3545
3545
|
unreadCount: S,
|
|
3546
3546
|
hasTimestamp: !!y
|
|
3547
|
-
}), /* @__PURE__ */
|
|
3547
|
+
}), /* @__PURE__ */ U("div", {
|
|
3548
3548
|
role: "button",
|
|
3549
3549
|
tabIndex: 0,
|
|
3550
3550
|
onClick: f,
|
|
3551
3551
|
onKeyDown: p,
|
|
3552
|
-
className:
|
|
3552
|
+
className: J("group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2", {
|
|
3553
3553
|
"bg-black/[0.04]": u,
|
|
3554
3554
|
"hover:bg-black/[0.02]": !u
|
|
3555
3555
|
}),
|
|
3556
3556
|
"data-dd-privacy": "mask",
|
|
3557
|
-
children: /* @__PURE__ */
|
|
3557
|
+
children: /* @__PURE__ */ W("div", {
|
|
3558
3558
|
className: "flex items-start gap-4",
|
|
3559
|
-
children: [/* @__PURE__ */
|
|
3559
|
+
children: [/* @__PURE__ */ U(_t, {
|
|
3560
3560
|
id: m?.user?.id || t.id || "unknown",
|
|
3561
3561
|
name: h,
|
|
3562
3562
|
image: g,
|
|
3563
3563
|
size: 48,
|
|
3564
3564
|
starred: d
|
|
3565
|
-
}), /* @__PURE__ */
|
|
3565
|
+
}), /* @__PURE__ */ W("div", {
|
|
3566
3566
|
className: "flex-1 min-w-0 flex flex-col gap-1",
|
|
3567
|
-
children: [/* @__PURE__ */
|
|
3567
|
+
children: [/* @__PURE__ */ W("div", {
|
|
3568
3568
|
className: "flex items-center justify-between gap-2",
|
|
3569
|
-
children: [/* @__PURE__ */
|
|
3570
|
-
className:
|
|
3571
|
-
children: [d && /* @__PURE__ */
|
|
3569
|
+
children: [/* @__PURE__ */ W("h3", {
|
|
3570
|
+
className: J("text-sm font-medium truncate text-[#191918]"),
|
|
3571
|
+
children: [d && /* @__PURE__ */ U("span", {
|
|
3572
3572
|
className: "sr-only",
|
|
3573
3573
|
children: "Starred conversation. "
|
|
3574
3574
|
}), h]
|
|
3575
|
-
}), y && /* @__PURE__ */
|
|
3575
|
+
}), y && /* @__PURE__ */ U("span", {
|
|
3576
3576
|
className: "text-xs text-[#717070] flex-shrink-0",
|
|
3577
3577
|
children: y
|
|
3578
3578
|
})]
|
|
3579
|
-
}), /* @__PURE__ */
|
|
3579
|
+
}), /* @__PURE__ */ W("div", {
|
|
3580
3580
|
className: "flex items-center justify-between gap-2 min-w-0",
|
|
3581
|
-
children: [/* @__PURE__ */
|
|
3581
|
+
children: [/* @__PURE__ */ U("p", {
|
|
3582
3582
|
className: "text-sm text-[#717070] flex-1 line-clamp-1",
|
|
3583
3583
|
children: x
|
|
3584
|
-
}), S > 0 && /* @__PURE__ */
|
|
3584
|
+
}), S > 0 && /* @__PURE__ */ U("span", {
|
|
3585
3585
|
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",
|
|
3586
3586
|
children: S > 99 ? "99+" : S
|
|
3587
3587
|
})]
|
|
@@ -3596,7 +3596,7 @@ na.displayName = "CustomChannelPreview";
|
|
|
3596
3596
|
var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: i, sort: a = ra, className: s, customEmptyStateIndicator: c, channelListPaginator: l = D, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
|
|
3597
3597
|
let y = o.useRef(0);
|
|
3598
3598
|
y.current++;
|
|
3599
|
-
let { debug: b = !1 } =
|
|
3599
|
+
let { debug: b = !1 } = rt(), x = o.useCallback((e) => {
|
|
3600
3600
|
for (let t of e) Xi(t);
|
|
3601
3601
|
return i ? i(e) : e;
|
|
3602
3602
|
}, [i]);
|
|
@@ -3620,13 +3620,13 @@ var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3620
3620
|
d,
|
|
3621
3621
|
f
|
|
3622
3622
|
]);
|
|
3623
|
-
return /* @__PURE__ */
|
|
3624
|
-
className:
|
|
3625
|
-
children: /* @__PURE__ */
|
|
3623
|
+
return /* @__PURE__ */ U("div", {
|
|
3624
|
+
className: J("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", s),
|
|
3625
|
+
children: /* @__PURE__ */ U("div", {
|
|
3626
3626
|
className: "flex-1 overflow-hidden min-w-0",
|
|
3627
|
-
children: /* @__PURE__ */
|
|
3627
|
+
children: /* @__PURE__ */ U(Qi, {
|
|
3628
3628
|
value: S,
|
|
3629
|
-
children: /* @__PURE__ */
|
|
3629
|
+
children: /* @__PURE__ */ U(C, {
|
|
3630
3630
|
filters: n,
|
|
3631
3631
|
sort: a,
|
|
3632
3632
|
options: { limit: 30 },
|
|
@@ -3649,19 +3649,22 @@ var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3649
3649
|
ia.displayName = "ChannelList";
|
|
3650
3650
|
//#endregion
|
|
3651
3651
|
//#region src/components/RichCard/RichCardBody.tsx
|
|
3652
|
-
var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.
|
|
3652
|
+
var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa = "text-[14px] leading-5 tracking-[0.02em]", sa = () => /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("br", {}), /* @__PURE__ */ U("span", {
|
|
3653
|
+
"aria-hidden": !0,
|
|
3654
|
+
className: "block h-1.5"
|
|
3655
|
+
})] }), ca = (e) => e.split(/\r?\n/).map((e, t, n) => /* @__PURE__ */ W(o.Fragment, { children: [e, t < n.length - 1 ? /* @__PURE__ */ U(sa, {}) : null] }, t)), la = ({ surface: e, actions: t, layout: n }) => {
|
|
3653
3656
|
if (t == null || t.length === 0) return null;
|
|
3654
3657
|
let r = n === "stacked";
|
|
3655
|
-
return /* @__PURE__ */
|
|
3656
|
-
className:
|
|
3657
|
-
children: t.map((t, n) => /* @__PURE__ */
|
|
3658
|
+
return /* @__PURE__ */ U("div", {
|
|
3659
|
+
className: J("flex gap-2", r ? "mt-4 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"),
|
|
3660
|
+
children: t.map((t, n) => /* @__PURE__ */ U(pn, {
|
|
3658
3661
|
variant: e,
|
|
3659
3662
|
cta: t,
|
|
3660
3663
|
fullWidth: r,
|
|
3661
3664
|
standalone: !0
|
|
3662
3665
|
}, `${t.label}-${n}`))
|
|
3663
3666
|
});
|
|
3664
|
-
},
|
|
3667
|
+
}, ua = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
|
|
3665
3668
|
let s = n != null && n.trim() !== "", c = r != null && r.trim() !== "", l = o != null && o.length > 0;
|
|
3666
3669
|
if (!s && !c && !l) return null;
|
|
3667
3670
|
let u = { color: t }, d = i > 1 ? {
|
|
@@ -3670,43 +3673,43 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3670
3673
|
WebkitBoxOrient: "vertical",
|
|
3671
3674
|
WebkitLineClamp: i,
|
|
3672
3675
|
overflow: "hidden"
|
|
3673
|
-
} : u, f = l && (o?.[0]?.variant ?? "primary") === "secondary", p = /* @__PURE__ */
|
|
3674
|
-
className: "flex min-w-0 flex-1 flex-col gap-
|
|
3675
|
-
children: [s && /* @__PURE__ */
|
|
3676
|
+
} : u, f = l && (o?.[0]?.variant ?? "primary") === "secondary", p = /* @__PURE__ */ W("div", {
|
|
3677
|
+
className: "flex min-w-0 flex-1 flex-col gap-4",
|
|
3678
|
+
children: [s && /* @__PURE__ */ W("div", {
|
|
3676
3679
|
className: "flex min-w-0 items-center gap-2",
|
|
3677
|
-
children: [a ? /* @__PURE__ */
|
|
3680
|
+
children: [a ? /* @__PURE__ */ U("span", {
|
|
3678
3681
|
className: "shrink-0",
|
|
3679
3682
|
children: a
|
|
3680
|
-
}) : null, /* @__PURE__ */
|
|
3681
|
-
className:
|
|
3683
|
+
}) : null, /* @__PURE__ */ U("p", {
|
|
3684
|
+
className: J("min-w-0", aa),
|
|
3682
3685
|
style: u,
|
|
3683
3686
|
children: n
|
|
3684
3687
|
})]
|
|
3685
|
-
}), c && /* @__PURE__ */
|
|
3686
|
-
className:
|
|
3688
|
+
}), c && /* @__PURE__ */ U("p", {
|
|
3689
|
+
className: J(oa, i <= 1 && "truncate"),
|
|
3687
3690
|
style: d,
|
|
3688
|
-
children: r
|
|
3691
|
+
children: i > 1 ? ca(r ?? "") : r
|
|
3689
3692
|
})]
|
|
3690
3693
|
});
|
|
3691
|
-
return /* @__PURE__ */
|
|
3694
|
+
return /* @__PURE__ */ U("div", {
|
|
3692
3695
|
className: "shrink-0 px-4 py-3",
|
|
3693
|
-
children: f ? /* @__PURE__ */
|
|
3696
|
+
children: f ? /* @__PURE__ */ W("div", {
|
|
3694
3697
|
className: "flex items-center justify-between gap-3",
|
|
3695
|
-
children: [p, /* @__PURE__ */
|
|
3698
|
+
children: [p, /* @__PURE__ */ U(la, {
|
|
3696
3699
|
surface: e,
|
|
3697
3700
|
actions: o,
|
|
3698
3701
|
layout: "row"
|
|
3699
3702
|
})]
|
|
3700
|
-
}) : /* @__PURE__ */
|
|
3703
|
+
}) : /* @__PURE__ */ W(H, { children: [p, /* @__PURE__ */ U(la, {
|
|
3701
3704
|
surface: e,
|
|
3702
3705
|
actions: o,
|
|
3703
3706
|
layout: "stacked"
|
|
3704
3707
|
})] })
|
|
3705
3708
|
});
|
|
3706
|
-
},
|
|
3709
|
+
}, da = {
|
|
3707
3710
|
dark: "bg-white/[0.06]",
|
|
3708
3711
|
light: "bg-black/[0.04]"
|
|
3709
|
-
},
|
|
3712
|
+
}, fa = {
|
|
3710
3713
|
1: [0],
|
|
3711
3714
|
2: [-10, 10],
|
|
3712
3715
|
3: [
|
|
@@ -3714,7 +3717,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3714
3717
|
0,
|
|
3715
3718
|
13
|
|
3716
3719
|
]
|
|
3717
|
-
},
|
|
3720
|
+
}, pa = {
|
|
3718
3721
|
1: [0],
|
|
3719
3722
|
2: [-26, 26],
|
|
3720
3723
|
3: [
|
|
@@ -3722,7 +3725,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3722
3725
|
0,
|
|
3723
3726
|
40
|
|
3724
3727
|
]
|
|
3725
|
-
},
|
|
3728
|
+
}, ma = {
|
|
3726
3729
|
1: [0],
|
|
3727
3730
|
2: [0, 1],
|
|
3728
3731
|
3: [
|
|
@@ -3730,7 +3733,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3730
3733
|
3,
|
|
3731
3734
|
2
|
|
3732
3735
|
]
|
|
3733
|
-
},
|
|
3736
|
+
}, ha = {
|
|
3734
3737
|
1: [1],
|
|
3735
3738
|
2: [1, 1],
|
|
3736
3739
|
3: [
|
|
@@ -3738,16 +3741,16 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3738
3741
|
1.08,
|
|
3739
3742
|
1
|
|
3740
3743
|
]
|
|
3741
|
-
},
|
|
3744
|
+
}, ga = ({ variant: e, images: t }) => {
|
|
3742
3745
|
let [n, r] = o.useState({}), i = t.join("\n"), [s, c] = o.useState(i);
|
|
3743
3746
|
i !== s && (c(i), r({}));
|
|
3744
3747
|
let l = t.slice(0, 3).map((e, t) => ({
|
|
3745
3748
|
src: e,
|
|
3746
3749
|
index: t
|
|
3747
|
-
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d =
|
|
3748
|
-
return /* @__PURE__ */
|
|
3749
|
-
className:
|
|
3750
|
-
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */
|
|
3750
|
+
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = fa[u], f = pa[u], p = ma[u], m = ha[u];
|
|
3751
|
+
return /* @__PURE__ */ U("div", {
|
|
3752
|
+
className: J("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", da[e]),
|
|
3753
|
+
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */ U("img", {
|
|
3751
3754
|
src: a(e) ?? e,
|
|
3752
3755
|
alt: "",
|
|
3753
3756
|
draggable: !1,
|
|
@@ -3764,44 +3767,44 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3764
3767
|
}
|
|
3765
3768
|
}, `${e}-${t}`))
|
|
3766
3769
|
});
|
|
3767
|
-
},
|
|
3768
|
-
className:
|
|
3769
|
-
children: t === "fan" ? /* @__PURE__ */
|
|
3770
|
+
}, _a = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", va = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ U("div", {
|
|
3771
|
+
className: _a,
|
|
3772
|
+
children: t === "fan" ? /* @__PURE__ */ U(ga, {
|
|
3770
3773
|
variant: e,
|
|
3771
3774
|
images: n
|
|
3772
|
-
}) : /* @__PURE__ */
|
|
3775
|
+
}) : /* @__PURE__ */ U(On, {
|
|
3773
3776
|
variant: e,
|
|
3774
3777
|
thumbnailUrl: i,
|
|
3775
3778
|
title: r,
|
|
3776
3779
|
mimeType: "image/*",
|
|
3777
3780
|
onImageError: a
|
|
3778
3781
|
})
|
|
3779
|
-
}),
|
|
3782
|
+
}), ya = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
|
|
3780
3783
|
let u = Te({
|
|
3781
3784
|
imagePresentation: a,
|
|
3782
3785
|
images: i
|
|
3783
|
-
}), d = i.length > 0, f = d && u === "hero", p =
|
|
3786
|
+
}), d = i.length > 0, f = d && u === "hero", p = Pn({
|
|
3784
3787
|
variant: e,
|
|
3785
3788
|
accentColor: c,
|
|
3786
3789
|
layout: "featured",
|
|
3787
3790
|
thumbnailUrl: f ? i[0] : void 0
|
|
3788
3791
|
}), m = l === "single" || l === "end";
|
|
3789
|
-
return /* @__PURE__ */
|
|
3792
|
+
return /* @__PURE__ */ U(Rn, {
|
|
3790
3793
|
accentHex: p.accentHex,
|
|
3791
3794
|
side: e === "dark" ? "sender" : "receiver",
|
|
3792
3795
|
visible: m,
|
|
3793
|
-
children: /* @__PURE__ */
|
|
3796
|
+
children: /* @__PURE__ */ W(Sn, {
|
|
3794
3797
|
variant: e,
|
|
3795
3798
|
accentHex: p.accentHex,
|
|
3796
3799
|
"data-testid": "rich-card",
|
|
3797
|
-
children: [d && /* @__PURE__ */
|
|
3800
|
+
children: [d && /* @__PURE__ */ U(va, {
|
|
3798
3801
|
variant: e,
|
|
3799
3802
|
presentation: u,
|
|
3800
3803
|
images: i,
|
|
3801
3804
|
title: t,
|
|
3802
3805
|
heroUrl: f ? p.thumbnailUrl : void 0,
|
|
3803
3806
|
onHeroError: p.onImageError
|
|
3804
|
-
}), /* @__PURE__ */
|
|
3807
|
+
}), /* @__PURE__ */ U(ua, {
|
|
3805
3808
|
ctaSurface: p.surface,
|
|
3806
3809
|
chinTextColor: p.chinTextColor,
|
|
3807
3810
|
title: t,
|
|
@@ -3812,31 +3815,31 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3812
3815
|
})]
|
|
3813
3816
|
})
|
|
3814
3817
|
});
|
|
3815
|
-
},
|
|
3816
|
-
Sent: (e) => /* @__PURE__ */
|
|
3818
|
+
}, ba = {
|
|
3819
|
+
Sent: (e) => /* @__PURE__ */ U(ya, {
|
|
3817
3820
|
...e,
|
|
3818
3821
|
variant: "dark"
|
|
3819
3822
|
}),
|
|
3820
|
-
Received: (e) => /* @__PURE__ */
|
|
3823
|
+
Received: (e) => /* @__PURE__ */ U(ya, {
|
|
3821
3824
|
...e,
|
|
3822
3825
|
variant: "light"
|
|
3823
3826
|
})
|
|
3824
|
-
},
|
|
3827
|
+
}, xa = "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%", Sa = {
|
|
3825
3828
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3826
3829
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
3827
|
-
},
|
|
3830
|
+
}, Ca = ({ variant: e }) => /* @__PURE__ */ U("span", {
|
|
3828
3831
|
"aria-hidden": "true",
|
|
3829
3832
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
3830
3833
|
style: {
|
|
3831
|
-
insetInlineEnd: e === "sent" ? "calc(-1 * 0.
|
|
3832
|
-
insetInlineStart: e === "received" ? "calc(-1 * 0.
|
|
3834
|
+
insetInlineEnd: e === "sent" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
3835
|
+
insetInlineStart: e === "received" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
3833
3836
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
3834
3837
|
transformOrigin: "center",
|
|
3835
|
-
backgroundColor:
|
|
3836
|
-
WebkitMask:
|
|
3837
|
-
mask:
|
|
3838
|
+
backgroundColor: Sa[e],
|
|
3839
|
+
WebkitMask: xa,
|
|
3840
|
+
mask: xa
|
|
3838
3841
|
}
|
|
3839
|
-
}),
|
|
3842
|
+
}), wa = {
|
|
3840
3843
|
sent: {
|
|
3841
3844
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3842
3845
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -3845,72 +3848,72 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3845
3848
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
3846
3849
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
3847
3850
|
}
|
|
3848
|
-
},
|
|
3851
|
+
}, Ta = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ W("div", {
|
|
3849
3852
|
"data-dd-privacy": "mask",
|
|
3850
|
-
className:
|
|
3853
|
+
className: J("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
|
|
3851
3854
|
style: {
|
|
3852
|
-
...
|
|
3855
|
+
...wa[e],
|
|
3853
3856
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
3854
3857
|
isolation: "isolate"
|
|
3855
3858
|
},
|
|
3856
3859
|
children: [
|
|
3857
|
-
r != null && /* @__PURE__ */
|
|
3860
|
+
r != null && /* @__PURE__ */ U("div", {
|
|
3858
3861
|
className: "mb-1 font-medium",
|
|
3859
3862
|
"data-testid": "message-bubble-header",
|
|
3860
3863
|
children: r
|
|
3861
3864
|
}),
|
|
3862
|
-
/* @__PURE__ */
|
|
3865
|
+
/* @__PURE__ */ U("p", {
|
|
3863
3866
|
className: "m-0 whitespace-pre-wrap break-words hyphens-manual",
|
|
3864
3867
|
children: t
|
|
3865
3868
|
}),
|
|
3866
|
-
n && /* @__PURE__ */
|
|
3869
|
+
n && /* @__PURE__ */ U(Ca, { variant: e })
|
|
3867
3870
|
]
|
|
3868
|
-
}),
|
|
3869
|
-
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */
|
|
3871
|
+
}), Ea = {
|
|
3872
|
+
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ U(Ta, {
|
|
3870
3873
|
variant: "sent",
|
|
3871
3874
|
text: e,
|
|
3872
3875
|
tail: t,
|
|
3873
3876
|
className: n
|
|
3874
3877
|
}),
|
|
3875
|
-
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */
|
|
3878
|
+
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ U(Ta, {
|
|
3876
3879
|
variant: "received",
|
|
3877
3880
|
text: e,
|
|
3878
3881
|
tail: t,
|
|
3879
3882
|
header: n,
|
|
3880
3883
|
className: r
|
|
3881
3884
|
})
|
|
3882
|
-
},
|
|
3885
|
+
}, Da = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ U("button", {
|
|
3883
3886
|
type: "button",
|
|
3884
3887
|
onClick: t,
|
|
3885
3888
|
disabled: n,
|
|
3886
3889
|
style: { backgroundColor: "#E6E5E3" },
|
|
3887
|
-
className:
|
|
3890
|
+
className: J("w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring", {
|
|
3888
3891
|
"hover:brightness-95 active:brightness-90": !n,
|
|
3889
3892
|
"opacity-50 cursor-not-allowed": n
|
|
3890
3893
|
}, r),
|
|
3891
3894
|
children: e
|
|
3892
|
-
}),
|
|
3893
|
-
let s =
|
|
3894
|
-
return s.length === 0 ? null : /* @__PURE__ */
|
|
3895
|
+
}), Oa = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
|
|
3896
|
+
let s = Ee(e);
|
|
3897
|
+
return s.length === 0 ? null : /* @__PURE__ */ U("div", {
|
|
3895
3898
|
className: i,
|
|
3896
|
-
children: /* @__PURE__ */
|
|
3899
|
+
children: /* @__PURE__ */ W("div", {
|
|
3897
3900
|
className: "flex gap-3 items-end",
|
|
3898
|
-
children: [(a || o) && /* @__PURE__ */
|
|
3901
|
+
children: [(a || o) && /* @__PURE__ */ U("div", {
|
|
3899
3902
|
className: "flex-none",
|
|
3900
|
-
children: /* @__PURE__ */
|
|
3903
|
+
children: /* @__PURE__ */ U(_t, {
|
|
3901
3904
|
id: o || "account",
|
|
3902
3905
|
name: o || "Account",
|
|
3903
3906
|
image: a,
|
|
3904
3907
|
size: 24,
|
|
3905
3908
|
shape: "circle"
|
|
3906
3909
|
})
|
|
3907
|
-
}), /* @__PURE__ */
|
|
3910
|
+
}), /* @__PURE__ */ W("div", {
|
|
3908
3911
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
3909
3912
|
style: { backgroundColor: "#F1F0EE" },
|
|
3910
|
-
children: [r && /* @__PURE__ */
|
|
3913
|
+
children: [r && /* @__PURE__ */ U("p", {
|
|
3911
3914
|
className: "text-md text-charcoal mb-4",
|
|
3912
3915
|
children: r
|
|
3913
|
-
}), s.map((e) => /* @__PURE__ */
|
|
3916
|
+
}), s.map((e) => /* @__PURE__ */ U(Da, {
|
|
3914
3917
|
question: e.question,
|
|
3915
3918
|
onClick: () => t(e.id),
|
|
3916
3919
|
loading: n === e.id
|
|
@@ -3920,6 +3923,6 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
|
|
|
3920
3923
|
});
|
|
3921
3924
|
};
|
|
3922
3925
|
//#endregion
|
|
3923
|
-
export {
|
|
3926
|
+
export { bt as ActionButton, _t as Avatar, Ui as ChannelEmptyState, ia as ChannelList, qi as ChannelView, Mt as CustomMessageProvider, Oa as FaqList, Da as FaqListItem, zn as LinkAttachment, Lt as LockedAttachment, Q as MessageAttachment, Ea as MessageBubble, et as MessagingLoggerProvider, it as MessagingProvider, Yi as MessagingShell, ba as RichCard, tn as TipMessage, nr as buildCompactMetaLabel, $n as formatFileSize, ta as formatRelativeTime, tr as getFileExtensionLabel, Ot as getMessageDisplayText, kt as isLinkAttachment, en as isTipMessage, lt as isUuidLike, Jn as messageAttachmentGroupPositionFromStream, Dt as normalizeLanguageCode, a as optimizeMessagingAttachmentUrl, st as resolveConversationParticipant, dt as resolveParticipantDisplayName, Si as useComposerLocked, Nt as useCustomMessage, at as useMessaging, tt as useMessagingLogger };
|
|
3924
3927
|
|
|
3925
3928
|
//# sourceMappingURL=index.js.map
|