@linktr.ee/messaging-react 3.4.1 → 3.5.0-rc-1782408966
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Card-BKd0E-B9.js → Card-BNzC_bp8.js} +3 -3
- package/dist/{Card-BKd0E-B9.js.map → Card-BNzC_bp8.js.map} +1 -1
- package/dist/{Card-CrTBu2I6.js → Card-CUHEDe8O.js} +2 -2
- package/dist/{Card-CrTBu2I6.js.map → Card-CUHEDe8O.js.map} +1 -1
- package/dist/{Card-CdaZxDEx.cjs → Card-DEa50m9p.cjs} +2 -2
- package/dist/{Card-CdaZxDEx.cjs.map → Card-DEa50m9p.cjs.map} +1 -1
- package/dist/{Card-DaalkoQW.cjs → Card-DJtDI03Y.cjs} +2 -2
- package/dist/{Card-DaalkoQW.cjs.map → Card-DJtDI03Y.cjs.map} +1 -1
- package/dist/{Card-DXWp0uwi.cjs → Card-DuMr5KMP.cjs} +2 -2
- package/dist/{Card-DXWp0uwi.cjs.map → Card-DuMr5KMP.cjs.map} +1 -1
- package/dist/{Card-XVTz8IYz.js → Card-iekRe643.js} +2 -2
- package/dist/{Card-XVTz8IYz.js.map → Card-iekRe643.js.map} +1 -1
- package/dist/{LockedThumbnail-D_44b-Uy.js → LockedThumbnail-CvpRZFi-.js} +2 -2
- package/dist/{LockedThumbnail-D_44b-Uy.js.map → LockedThumbnail-CvpRZFi-.js.map} +1 -1
- package/dist/{LockedThumbnail-D3Xwdb5_.cjs → LockedThumbnail-aME0f_ZF.cjs} +2 -2
- package/dist/{LockedThumbnail-D3Xwdb5_.cjs.map → LockedThumbnail-aME0f_ZF.cjs.map} +1 -1
- package/dist/index-BIWS3Inh.cjs +2 -0
- package/dist/index-BIWS3Inh.cjs.map +1 -0
- package/dist/{index-DPGZRLRM.js → index-BlpDX5fl.js} +1175 -1165
- package/dist/index-BlpDX5fl.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +20 -19
- package/package.json +2 -2
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +38 -0
- package/src/components/ChannelList/CustomChannelPreview.tsx +5 -6
- package/src/components/ChannelView.test.tsx +35 -0
- package/src/components/ChannelView.tsx +6 -0
- package/src/components/VerifiedBadge/index.tsx +25 -0
- package/src/index.ts +2 -0
- package/src/stream-custom-data.ts +8 -0
- package/dist/index-Cds2w5zi.cjs +0 -2
- package/dist/index-Cds2w5zi.cjs.map +0 -1
- package/dist/index-DPGZRLRM.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
2
|
+
import U, { createContext as qe, useContext as Me, useCallback as Z, useState as z, useRef as H, useEffect as J, useId as In, useMemo as se, Suspense as We } from "react";
|
|
3
|
+
import { StreamChatService as Tn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as An, LinkPreviewsManager as Mt } from "stream-chat";
|
|
5
|
+
import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as ce, useChatContext as Xe, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as jt, Attachment as Pn, EditMessageModal as On, MessageBlocked as zn, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Vn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Rt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as we, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as Pe, AIStates as Oe, useTypingContext as is, useAIState as os, Channel as ls, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ve, DotsThreeIcon as fs, SpinnerGapIcon as Ee, SignOutIcon as gs, ProhibitInsetIcon as Lt, FlagIcon as Gt, FileIcon as Ht, ImageIcon as bs, SpeakerHighIcon as ps, VideoCameraIcon as Yt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as _s, FileCsvIcon as Ns, FileXlsIcon as ys, FileDocIcon as Cs, FilePdfIcon as ks, CircleNotchIcon as ve, PlayIcon as Ue, PauseIcon as Es, LinkIcon as Ss, DownloadSimpleIcon as xe, GiftIcon as Is, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Re, ArrowUpIcon as Rs, SparkleIcon as je, ProhibitIcon as Ls, SealCheckIcon as Ds, ArrowLeftIcon as Dt, CaretRightIcon as Ge, PencilSimpleIcon as Ps, CaretLeftIcon as Os } from "@phosphor-icons/react";
|
|
7
|
+
import y from "classnames";
|
|
8
|
+
import { MessageActions as zs, DefaultDropdownActionButton as qt } from "stream-chat-react/experimental";
|
|
9
|
+
const Wt = qe({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const qt = Ye({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), Ke = () => Me(Wt), Ci = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,10 +24,10 @@ const qt = Ye({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const o =
|
|
29
|
-
(I, ...
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${I}`, ...
|
|
27
|
+
var T, k;
|
|
28
|
+
const o = Z(
|
|
29
|
+
(I, ...C) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${I}`, ...C);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,37 +37,37 @@ const qt = Ye({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [l, d] =
|
|
40
|
+
const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, x] = z(!1), [b, w] = z(null), v = H(!1), p = H(null), A = H(s);
|
|
41
41
|
A.current = s;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
42
|
+
const R = H(i);
|
|
43
|
+
R.current = i;
|
|
44
|
+
const L = H({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), S = H(0);
|
|
50
|
+
S.current++, o("📊 RENDER INFO", {
|
|
51
|
+
renderCount: S.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
54
|
+
userChanged: L.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: L.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: L.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: L.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), L.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((
|
|
67
|
-
const P = a ? ((
|
|
68
|
-
|
|
69
|
-
const I =
|
|
70
|
-
if (!a || !P || !
|
|
65
|
+
const D = H(null);
|
|
66
|
+
a && ((T = D.current) == null ? void 0 : T.apiKey) !== a && (D.current = { apiKey: a, client: new An(a) });
|
|
67
|
+
const P = a ? ((k = D.current) == null ? void 0 : k.client) ?? null : null;
|
|
68
|
+
J(() => {
|
|
69
|
+
const I = S.current, C = A.current;
|
|
70
|
+
if (!a || !P || !C) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: I,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,36 +78,36 @@ const qt = Ye({
|
|
|
78
78
|
renderCount: I,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const O = new
|
|
82
|
-
...
|
|
81
|
+
const O = new Tn({
|
|
82
|
+
...C,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
84
|
+
debug: R.current,
|
|
85
85
|
client: P
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
p.current = O, d(O), o("✅ SERVICE SET", {
|
|
88
88
|
renderCount: I,
|
|
89
89
|
serviceInstance: !!O
|
|
90
90
|
});
|
|
91
91
|
}, [a, P]);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
var
|
|
92
|
+
const B = H(null);
|
|
93
|
+
J(() => {
|
|
94
|
+
var C, O;
|
|
95
95
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!l,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: v.current,
|
|
100
100
|
isConnected: u,
|
|
101
101
|
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !l || !t) {
|
|
103
103
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (v.current) {
|
|
107
107
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((C = B.current) == null ? void 0 : C.serviceId) === l && ((O = B.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
111
|
o(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const qt = Ye({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, x(!0), w(null);
|
|
119
119
|
try {
|
|
120
120
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const $ = await l.connectUser(t);
|
|
122
|
+
g($), f(!0), B.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: $.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch ($) {
|
|
127
|
+
const j = $ instanceof Error ? $.message : "Connection failed";
|
|
128
|
+
w(j), o("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: j
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
x(!1), v.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [l, t, o, u]),
|
|
139
|
+
}, [l, t, o, u]), J(() => {
|
|
140
140
|
const I = P;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
I && (
|
|
142
|
+
var C;
|
|
143
|
+
I && (B.current = null, (C = p.current) == null || C.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [P]);
|
|
146
|
-
const
|
|
146
|
+
const M = Z(async () => {
|
|
147
147
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!l,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,53 +151,53 @@ const qt = Ye({
|
|
|
151
151
|
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
154
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), x(!0);
|
|
155
155
|
try {
|
|
156
156
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
157
157
|
const I = await l.connectUser(t);
|
|
158
|
-
g(I), f(!0),
|
|
158
|
+
g(I), f(!0), w(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
159
|
} catch (I) {
|
|
160
|
-
const
|
|
161
|
-
|
|
160
|
+
const C = I instanceof Error ? I.message : "Refresh failed";
|
|
161
|
+
w(C), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: C
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
x(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [l, t, o]),
|
|
168
|
+
}, [l, t, o]), N = U.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!l,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!b,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: l,
|
|
177
177
|
client: m,
|
|
178
178
|
isConnected: u,
|
|
179
179
|
isLoading: c,
|
|
180
|
-
error:
|
|
180
|
+
error: b,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: M,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
l,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
b,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
M,
|
|
192
192
|
i,
|
|
193
193
|
o
|
|
194
194
|
]);
|
|
195
195
|
return o("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
196
|
+
renderCount: S.current,
|
|
197
197
|
willRenderChat: !!P,
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(
|
|
200
|
-
|
|
198
|
+
contextValueReady: !!N
|
|
199
|
+
}), /* @__PURE__ */ n(Wt.Provider, { value: N, children: P ? /* @__PURE__ */ n(
|
|
200
|
+
Mn,
|
|
201
201
|
{
|
|
202
202
|
client: P,
|
|
203
203
|
customClasses: {
|
|
@@ -206,12 +206,12 @@ const qt = Ye({
|
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, $s = () => Ke(), Xt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = z(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return J(() => {
|
|
215
215
|
var o;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -228,16 +228,16 @@ const qt = Ye({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
232
|
-
function
|
|
233
|
-
return
|
|
231
|
+
}, Fs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
232
|
+
function Bs(e) {
|
|
233
|
+
return Fs.test(e.trim());
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Pt(e, t) {
|
|
236
236
|
const s = e == null ? void 0 : e.trim();
|
|
237
|
-
return !s || t && s === t ? !1 :
|
|
237
|
+
return !s || t && s === t ? !1 : !Bs(s);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
239
|
+
function Kt(e) {
|
|
240
|
+
return Pt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Pt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
241
|
}
|
|
242
242
|
const Ot = [
|
|
243
243
|
"🍎",
|
|
@@ -267,7 +267,7 @@ const Ot = [
|
|
|
267
267
|
"🍈"
|
|
268
268
|
// Melon
|
|
269
269
|
];
|
|
270
|
-
function
|
|
270
|
+
function Vs(e) {
|
|
271
271
|
let t = 0;
|
|
272
272
|
for (let s = 0; s < e.length; s++) {
|
|
273
273
|
const a = e.charCodeAt(s);
|
|
@@ -275,8 +275,8 @@ function Fs(e) {
|
|
|
275
275
|
}
|
|
276
276
|
return Math.abs(t);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const s =
|
|
278
|
+
function Us(e) {
|
|
279
|
+
const s = Vs(e) % Ot.length;
|
|
280
280
|
return Ot[s];
|
|
281
281
|
}
|
|
282
282
|
const ie = ({
|
|
@@ -288,7 +288,7 @@ const ie = ({
|
|
|
288
288
|
shape: i = "squircle",
|
|
289
289
|
dmAgentEnabled: o = !1
|
|
290
290
|
}) => {
|
|
291
|
-
const l =
|
|
291
|
+
const l = Us(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
292
292
|
"img",
|
|
293
293
|
{
|
|
294
294
|
src: t,
|
|
@@ -299,7 +299,7 @@ const ie = ({
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
302
|
+
className: y(
|
|
303
303
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
304
304
|
m
|
|
305
305
|
),
|
|
@@ -309,7 +309,7 @@ const ie = ({
|
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: y(
|
|
313
313
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
314
|
a
|
|
315
315
|
),
|
|
@@ -324,14 +324,14 @@ const ie = ({
|
|
|
324
324
|
{
|
|
325
325
|
"aria-hidden": "true",
|
|
326
326
|
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)]",
|
|
327
|
-
children: /* @__PURE__ */ n(
|
|
327
|
+
children: /* @__PURE__ */ n(Ve, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
330
|
/* @__PURE__ */ n(
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
334
|
+
className: y(
|
|
335
335
|
"h-full w-full",
|
|
336
336
|
"bg-transparent"
|
|
337
337
|
),
|
|
@@ -350,7 +350,7 @@ const ie = ({
|
|
|
350
350
|
]
|
|
351
351
|
}
|
|
352
352
|
);
|
|
353
|
-
},
|
|
353
|
+
}, js = "https://linktr.ee/s/about/trust-center/report", Gs = ({
|
|
354
354
|
channel: e,
|
|
355
355
|
participant: t,
|
|
356
356
|
showBlockParticipant: s = !0,
|
|
@@ -363,78 +363,78 @@ const ie = ({
|
|
|
363
363
|
onActionComplete: m,
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } =
|
|
368
|
-
return
|
|
369
|
-
if (!
|
|
370
|
-
|
|
366
|
+
var T;
|
|
367
|
+
const { service: u, debug: f } = Ke(), c = (T = t == null ? void 0 : t.user) == null ? void 0 : T.id, x = !!(a && s && u && c), [b, w] = z(!1), [v, p] = z(null), [A, R] = z(!1), [L, S] = z(!1), D = x && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
|
|
368
|
+
return J(() => {
|
|
369
|
+
if (!x || !u || !c) {
|
|
370
|
+
w(!1), p(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let k = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
376
|
const I = await u.getBlockedUsers();
|
|
377
|
-
if (
|
|
378
|
-
|
|
377
|
+
if (k) return;
|
|
378
|
+
w(
|
|
379
379
|
I.some(
|
|
380
|
-
(
|
|
380
|
+
(C) => C.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
383
|
} catch (I) {
|
|
384
|
-
|
|
384
|
+
k || console.error(`[${g}] Failed to check blocked status:`, I);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
k || p({ participantId: c, service: u });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
k = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
391
|
+
}, [x, u, c, g]), {
|
|
392
|
+
isParticipantBlocked: b,
|
|
393
|
+
isCheckingBlockedStatus: D,
|
|
394
394
|
isLeaving: A,
|
|
395
|
-
isUpdatingBlockStatus:
|
|
395
|
+
isUpdatingBlockStatus: L,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
397
|
+
var k;
|
|
398
398
|
if (!A) {
|
|
399
|
-
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
399
|
+
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), R(!0);
|
|
400
400
|
try {
|
|
401
|
-
const I = ((
|
|
401
|
+
const I = ((k = e._client) == null ? void 0 : k.userID) ?? null;
|
|
402
402
|
await e.hide(I, !1), r && await r(e), m == null || m();
|
|
403
403
|
} catch (I) {
|
|
404
404
|
console.error(`[${g}] Failed to leave conversation`, I);
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
R(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
l == null || l(), f && console.log(`[${g}] Block member`, (
|
|
411
|
+
var k, I, C;
|
|
412
|
+
if (!(L || !u)) {
|
|
413
|
+
l == null || l(), f && console.log(`[${g}] Block member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), S(!0);
|
|
414
414
|
try {
|
|
415
|
-
await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((
|
|
415
|
+
await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
|
|
416
416
|
} catch (O) {
|
|
417
417
|
console.error(`[${g}] Failed to block member`, O);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
S(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
l == null || l(), f && console.log(`[${g}] Unblock member`, (
|
|
424
|
+
var k, I, C;
|
|
425
|
+
if (!(L || !u)) {
|
|
426
|
+
l == null || l(), f && console.log(`[${g}] Unblock member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), S(!0);
|
|
427
427
|
try {
|
|
428
|
-
await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((
|
|
428
|
+
await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
|
|
429
429
|
} catch (O) {
|
|
430
430
|
console.error(`[${g}] Failed to unblock member`, O);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
S(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
handleReportUser: () => {
|
|
437
|
-
d == null || d(), m == null || m(), window.open(
|
|
437
|
+
d == null || d(), m == null || m(), window.open(js, "_blank", "noopener,noreferrer");
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
440
|
}, ge = ({
|
|
@@ -446,7 +446,7 @@ const ie = ({
|
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
449
|
-
className:
|
|
449
|
+
className: y(
|
|
450
450
|
"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",
|
|
451
451
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
452
452
|
t
|
|
@@ -454,7 +454,7 @@ const ie = ({
|
|
|
454
454
|
...a,
|
|
455
455
|
children: s
|
|
456
456
|
}
|
|
457
|
-
),
|
|
457
|
+
), zt = ({
|
|
458
458
|
channel: e,
|
|
459
459
|
participant: t,
|
|
460
460
|
showDeleteConversation: s = !0,
|
|
@@ -468,16 +468,16 @@ const ie = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
472
|
-
isParticipantBlocked:
|
|
473
|
-
isCheckingBlockedStatus:
|
|
471
|
+
const [f, c] = z(!1), x = H(null), b = In(), w = Z(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: v,
|
|
473
|
+
isCheckingBlockedStatus: p,
|
|
474
474
|
isLeaving: A,
|
|
475
|
-
isUpdatingBlockStatus:
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
475
|
+
isUpdatingBlockStatus: R,
|
|
476
|
+
handleLeaveConversation: L,
|
|
477
|
+
handleBlockUser: S,
|
|
478
|
+
handleUnblockUser: D,
|
|
479
479
|
handleReportUser: P
|
|
480
|
-
} =
|
|
480
|
+
} = Gs({
|
|
481
481
|
channel: e,
|
|
482
482
|
participant: t,
|
|
483
483
|
showBlockParticipant: a,
|
|
@@ -487,20 +487,20 @@ const ie = ({
|
|
|
487
487
|
onDeleteConversationClick: l,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: m,
|
|
490
|
-
onActionComplete:
|
|
490
|
+
onActionComplete: w,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
|
-
return
|
|
493
|
+
return J(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
},
|
|
498
|
-
|
|
495
|
+
const M = (T) => {
|
|
496
|
+
x.current && !x.current.contains(T.target) && c(!1);
|
|
497
|
+
}, N = (T) => {
|
|
498
|
+
T.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", M), document.addEventListener("keydown", N), () => {
|
|
501
|
+
document.removeEventListener("mousedown", M), document.removeEventListener("keydown", N);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: x, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -508,10 +508,10 @@ const ie = ({
|
|
|
508
508
|
type: "button",
|
|
509
509
|
"aria-haspopup": "true",
|
|
510
510
|
"aria-expanded": f,
|
|
511
|
-
"aria-controls": f ?
|
|
512
|
-
onClick: () => c((
|
|
511
|
+
"aria-controls": f ? b : void 0,
|
|
512
|
+
onClick: () => c((M) => !M),
|
|
513
513
|
children: [
|
|
514
|
-
/* @__PURE__ */ n(
|
|
514
|
+
/* @__PURE__ */ n(fs, { className: "size-5 text-black/90" }),
|
|
515
515
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
516
516
|
]
|
|
517
517
|
}
|
|
@@ -519,9 +519,9 @@ const ie = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: b,
|
|
523
523
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
524
|
+
className: y(
|
|
525
525
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
526
526
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
527
527
|
),
|
|
@@ -529,47 +529,47 @@ const ie = ({
|
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
530
|
ge,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: L,
|
|
533
533
|
disabled: A,
|
|
534
534
|
"aria-busy": A,
|
|
535
535
|
children: [
|
|
536
|
-
A ? /* @__PURE__ */ n(
|
|
536
|
+
A ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
|
|
537
537
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
538
|
]
|
|
539
539
|
}
|
|
540
540
|
) }),
|
|
541
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
541
|
+
a && /* @__PURE__ */ n("li", { children: p ? (
|
|
542
542
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
543
|
// so a premature click can't act on a stale block state.
|
|
544
544
|
/* @__PURE__ */ h(ge, { disabled: !0, "aria-busy": !0, children: [
|
|
545
|
-
/* @__PURE__ */ n(
|
|
545
|
+
/* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
548
|
+
) : v ? /* @__PURE__ */ h(
|
|
549
549
|
ge,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
551
|
+
onClick: D,
|
|
552
|
+
disabled: R,
|
|
553
|
+
"aria-busy": R,
|
|
554
554
|
children: [
|
|
555
|
-
|
|
555
|
+
R ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Lt, { className: "h-5 w-5" }),
|
|
556
556
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
557
|
]
|
|
558
558
|
}
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
560
|
ge,
|
|
561
561
|
{
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
562
|
+
onClick: S,
|
|
563
|
+
disabled: R,
|
|
564
|
+
"aria-busy": R,
|
|
565
565
|
children: [
|
|
566
|
-
|
|
566
|
+
R ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Lt, { className: "h-5 w-5" }),
|
|
567
567
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
571
|
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: P, children: [
|
|
572
|
-
/* @__PURE__ */ n(
|
|
572
|
+
/* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
575
575
|
g
|
|
@@ -577,30 +577,30 @@ const ie = ({
|
|
|
577
577
|
}
|
|
578
578
|
)
|
|
579
579
|
] });
|
|
580
|
-
},
|
|
581
|
-
function
|
|
582
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
580
|
+
}, Hs = (e) => /* @__PURE__ */ n(Rn, { ...e, position: "center" }), He = "vote_up", Ye = "vote_down";
|
|
581
|
+
function Ys(e) {
|
|
582
|
+
return e != null && e.length ? e.some((t) => t.type === Ye) ? "down" : e.some((t) => t.type === He) ? "up" : null : null;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
const { channel: t } = ce(), { client: s } =
|
|
586
|
-
() =>
|
|
584
|
+
function qs(e) {
|
|
585
|
+
const { channel: t } = ce(), { client: s } = Xe("useMessageVote"), a = se(
|
|
586
|
+
() => Ys(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
588
|
+
), r = Z(async () => {
|
|
589
589
|
if (s != null && s.userID)
|
|
590
590
|
try {
|
|
591
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
591
|
+
a === "up" ? await t.deleteReaction(e.id, He) : await t.sendReaction(
|
|
592
592
|
e.id,
|
|
593
|
-
{ type:
|
|
593
|
+
{ type: He },
|
|
594
594
|
{ enforce_unique: !0, skip_push: !0 }
|
|
595
595
|
);
|
|
596
596
|
} catch {
|
|
597
597
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
598
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = Z(async () => {
|
|
599
599
|
if (s != null && s.userID)
|
|
600
600
|
try {
|
|
601
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
601
|
+
a === "down" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
|
|
602
602
|
e.id,
|
|
603
|
-
{ type:
|
|
603
|
+
{ type: Ye },
|
|
604
604
|
{ enforce_unique: !0, skip_push: !0 }
|
|
605
605
|
);
|
|
606
606
|
} catch {
|
|
@@ -608,24 +608,24 @@ function Hs(e) {
|
|
|
608
608
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
609
609
|
return { selected: a, voteUp: r, voteDown: i };
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function Ws(e) {
|
|
612
612
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Jt({
|
|
615
615
|
message: e,
|
|
616
616
|
viewerLanguage: t
|
|
617
617
|
}) {
|
|
618
618
|
var r;
|
|
619
|
-
const s = e == null ? void 0 : e.text, a =
|
|
619
|
+
const s = e == null ? void 0 : e.text, a = Ws(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const Xs = U.lazy(() => import("./Card-iekRe643.js")), Ks = U.lazy(() => import("./Card-CUHEDe8O.js")), Js = U.lazy(() => import("./Card-BNzC_bp8.js")), Je = () => /* @__PURE__ */ n(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
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)]",
|
|
626
626
|
"aria-hidden": !0
|
|
627
627
|
}
|
|
628
|
-
),
|
|
628
|
+
), Zs = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Zt = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), Qt = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), Qs = Zt, ea = Qt, $t = { Composer: Zs, Sent: Zt, Received: Qt, Creator: Qs, Visitor: ea }, ta = [
|
|
629
629
|
[/pdf/, "pdf"],
|
|
630
630
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
631
631
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -638,39 +638,39 @@ const qs = j.lazy(() => import("./Card-XVTz8IYz.js")), Ws = j.lazy(() => import(
|
|
|
638
638
|
function re(e) {
|
|
639
639
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
const t =
|
|
641
|
+
function en(e) {
|
|
642
|
+
const t = ta.find(
|
|
643
643
|
([s]) => s.test(e)
|
|
644
644
|
);
|
|
645
645
|
return t ? t[1] : "generic";
|
|
646
646
|
}
|
|
647
|
-
const
|
|
648
|
-
video:
|
|
649
|
-
audio:
|
|
650
|
-
image:
|
|
651
|
-
document:
|
|
652
|
-
},
|
|
653
|
-
pdf:
|
|
654
|
-
doc:
|
|
655
|
-
xls:
|
|
656
|
-
csv:
|
|
657
|
-
ppt:
|
|
658
|
-
zip:
|
|
659
|
-
text:
|
|
660
|
-
markdown:
|
|
661
|
-
generic:
|
|
647
|
+
const na = {
|
|
648
|
+
video: Yt,
|
|
649
|
+
audio: ps,
|
|
650
|
+
image: bs,
|
|
651
|
+
document: Ht
|
|
652
|
+
}, sa = {
|
|
653
|
+
pdf: ks,
|
|
654
|
+
doc: Cs,
|
|
655
|
+
xls: ys,
|
|
656
|
+
csv: Ns,
|
|
657
|
+
ppt: _s,
|
|
658
|
+
zip: ws,
|
|
659
|
+
text: xs,
|
|
660
|
+
markdown: vs,
|
|
661
|
+
generic: Ht
|
|
662
662
|
};
|
|
663
|
-
function
|
|
663
|
+
function aa(e) {
|
|
664
664
|
const t = re(e);
|
|
665
|
-
return t !== "document" ?
|
|
665
|
+
return t !== "document" ? na[t] : sa[en(e)];
|
|
666
666
|
}
|
|
667
667
|
function le(e, t) {
|
|
668
|
-
return
|
|
668
|
+
return U.createElement(aa(e), t);
|
|
669
669
|
}
|
|
670
|
-
const
|
|
670
|
+
const ra = (e) => {
|
|
671
671
|
var t, s;
|
|
672
672
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
673
|
-
},
|
|
673
|
+
}, ia = ({
|
|
674
674
|
source: e,
|
|
675
675
|
mimeType: t,
|
|
676
676
|
poster: s,
|
|
@@ -682,78 +682,78 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const g = re(t), u =
|
|
686
|
-
P(!1),
|
|
687
|
-
}, []), O =
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const
|
|
685
|
+
const g = re(t), u = H(null), f = H(null), c = H(null), x = H(r), [b, w] = z(a), [v, p] = z(0), [A, R] = z(!1), [L, S] = z(!1), [D, P] = z(!1), [B, M] = z(!1), [N, T] = z(!0), [k, I] = z(null), C = Z(() => {
|
|
686
|
+
P(!1), w(!0);
|
|
687
|
+
}, []), O = Z((_) => {
|
|
688
|
+
const E = f.current;
|
|
689
|
+
if (!E) return 0;
|
|
690
|
+
const F = E.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (
|
|
693
|
+
Math.min(1, (ra(_) - F.left) / F.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
|
|
695
|
+
}, []), $ = Z((_) => {
|
|
696
|
+
const E = u.current;
|
|
697
|
+
E && E.duration && (E.currentTime = _ * E.duration);
|
|
698
|
+
}, []), j = (_) => {
|
|
699
|
+
_.stopPropagation(), R(!0);
|
|
700
|
+
const E = O(_);
|
|
701
|
+
p(E), $(E);
|
|
702
702
|
};
|
|
703
|
-
|
|
704
|
-
r !== void 0 && r !==
|
|
705
|
-
}, [r]),
|
|
706
|
-
if (!
|
|
703
|
+
J(() => {
|
|
704
|
+
r !== void 0 && r !== x.current && (x.current = r, w(r));
|
|
705
|
+
}, [r]), J(() => {
|
|
706
|
+
if (!b) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
711
|
-
const
|
|
712
|
-
|
|
710
|
+
const _ = () => {
|
|
711
|
+
const E = u.current;
|
|
712
|
+
E && E.duration && !A && p(E.currentTime / E.duration), c.current = requestAnimationFrame(_);
|
|
713
713
|
};
|
|
714
|
-
return c.current = requestAnimationFrame(
|
|
714
|
+
return c.current = requestAnimationFrame(_), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}) :
|
|
722
|
-
}, [
|
|
717
|
+
}, [b, A]), J(() => {
|
|
718
|
+
const _ = u.current;
|
|
719
|
+
_ && (b ? _.play().catch((E) => {
|
|
720
|
+
w(!1), P(!0);
|
|
721
|
+
}) : _.pause());
|
|
722
|
+
}, [b]), J(() => {
|
|
723
723
|
if (!A) return;
|
|
724
|
-
const
|
|
725
|
-
|
|
724
|
+
const _ = (F) => p(O(F)), E = (F) => {
|
|
725
|
+
R(!1), $(O(F));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
727
|
+
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", E), window.addEventListener("touchmove", _, { passive: !0 }), window.addEventListener("touchend", E), () => {
|
|
728
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", E), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", E);
|
|
729
729
|
};
|
|
730
|
-
}, [A, O,
|
|
731
|
-
const
|
|
730
|
+
}, [A, O, $]);
|
|
731
|
+
const X = k ? { aspectRatio: String(k) } : void 0, K = k ? "" : " aspect-video", V = Math.round(v * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
739
|
-
onClick: (
|
|
737
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${K}`,
|
|
738
|
+
style: X,
|
|
739
|
+
onClick: (_) => {
|
|
740
740
|
if (m) {
|
|
741
|
-
m(
|
|
741
|
+
m(_);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
D || o && w((E) => !E);
|
|
745
745
|
},
|
|
746
|
-
onKeyDown: (
|
|
747
|
-
if (!(
|
|
748
|
-
if (
|
|
749
|
-
m(
|
|
746
|
+
onKeyDown: (_) => {
|
|
747
|
+
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
748
|
+
if (_.preventDefault(), m) {
|
|
749
|
+
m(_);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
D || o && w((E) => !E);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || N) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,7 +761,7 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
764
|
+
!s && (g === "audio" || N) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
@@ -773,14 +773,14 @@ const sa = (e) => {
|
|
|
773
773
|
loop: i,
|
|
774
774
|
muted: d,
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
776
|
+
onLoadStart: () => M(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
M(!1), T(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
780
|
+
onWaiting: () => M(!0),
|
|
781
781
|
onPlay: () => P(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
783
|
+
i || (w(!1), p(0));
|
|
784
784
|
},
|
|
785
785
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
786
|
}
|
|
@@ -793,41 +793,41 @@ const sa = (e) => {
|
|
|
793
793
|
muted: d,
|
|
794
794
|
playsInline: !0,
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
796
|
+
onLoadStart: () => M(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
M(!1), T(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
800
|
+
onWaiting: () => M(!0),
|
|
801
801
|
onPlay: () => P(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const _ = u.current;
|
|
804
|
+
_ instanceof HTMLVideoElement && _.videoWidth && _.videoHeight && I(_.videoWidth / _.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
807
|
+
i || (w(!1), p(0));
|
|
808
808
|
},
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
|
|
813
|
-
|
|
812
|
+
B && !D && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
|
+
ve,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
D && !o && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
823
823
|
role: "button",
|
|
824
824
|
tabIndex: 0,
|
|
825
825
|
"aria-label": "Play preview",
|
|
826
|
-
onClick: (
|
|
827
|
-
|
|
826
|
+
onClick: (_) => {
|
|
827
|
+
_.stopPropagation(), C();
|
|
828
828
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
829
|
+
onKeyDown: (_) => {
|
|
830
|
+
_.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), C());
|
|
831
831
|
},
|
|
832
832
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Ue, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
@@ -837,23 +837,23 @@ const sa = (e) => {
|
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
839
839
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
840
|
+
"aria-valuenow": V,
|
|
841
841
|
"aria-valuemin": 0,
|
|
842
842
|
"aria-valuemax": 100,
|
|
843
843
|
tabIndex: 0,
|
|
844
844
|
ref: f,
|
|
845
845
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
848
|
-
onClick: (
|
|
849
|
-
onKeyDown: (
|
|
850
|
-
|
|
846
|
+
onMouseDown: j,
|
|
847
|
+
onTouchStart: j,
|
|
848
|
+
onClick: (_) => _.stopPropagation(),
|
|
849
|
+
onKeyDown: (_) => {
|
|
850
|
+
_.key === "ArrowRight" && $(Math.min(1, v + 0.05)), _.key === "ArrowLeft" && $(Math.max(0, v - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
854
854
|
{
|
|
855
855
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
856
|
+
style: { width: `${V}%` }
|
|
857
857
|
}
|
|
858
858
|
) })
|
|
859
859
|
}
|
|
@@ -863,12 +863,12 @@ const sa = (e) => {
|
|
|
863
863
|
"button",
|
|
864
864
|
{
|
|
865
865
|
type: "button",
|
|
866
|
-
onClick: (
|
|
867
|
-
|
|
866
|
+
onClick: (_) => {
|
|
867
|
+
_.stopPropagation(), w((E) => !E);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": b ? "Pause" : "Play",
|
|
871
|
+
children: b ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -876,30 +876,30 @@ const sa = (e) => {
|
|
|
876
876
|
{
|
|
877
877
|
role: "slider",
|
|
878
878
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
879
|
+
"aria-valuenow": V,
|
|
880
880
|
"aria-valuemin": 0,
|
|
881
881
|
"aria-valuemax": 100,
|
|
882
882
|
tabIndex: 0,
|
|
883
883
|
ref: f,
|
|
884
884
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
887
|
-
onClick: (
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
885
|
+
onMouseDown: j,
|
|
886
|
+
onTouchStart: j,
|
|
887
|
+
onClick: (_) => _.stopPropagation(),
|
|
888
|
+
onMouseEnter: () => S(!0),
|
|
889
|
+
onMouseLeave: () => S(!1),
|
|
890
|
+
onKeyDown: (_) => {
|
|
891
|
+
_.key === "ArrowRight" && $(Math.min(1, v + 0.05)), _.key === "ArrowLeft" && $(Math.max(0, v - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
897
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || A ? "h-1.5" : "h-1"}`,
|
|
898
898
|
children: /* @__PURE__ */ n(
|
|
899
899
|
"div",
|
|
900
900
|
{
|
|
901
901
|
className: "h-full rounded-full bg-white",
|
|
902
|
-
style: { width: `${
|
|
902
|
+
style: { width: `${V}%` }
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
}
|
|
@@ -907,8 +907,8 @@ const sa = (e) => {
|
|
|
907
907
|
/* @__PURE__ */ n(
|
|
908
908
|
"div",
|
|
909
909
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
911
|
-
style: { left: `${
|
|
910
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${V}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
]
|
|
@@ -918,7 +918,7 @@ const sa = (e) => {
|
|
|
918
918
|
]
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
|
-
},
|
|
921
|
+
}, Ft = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", oa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", tn = ({
|
|
922
922
|
mimeType: e,
|
|
923
923
|
sourceUrl: t,
|
|
924
924
|
thumbnailUrl: s,
|
|
@@ -927,9 +927,9 @@ const sa = (e) => {
|
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
928
|
containedImage: o = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const l = re(e), [d, m] =
|
|
930
|
+
const l = re(e), [d, m] = z(!1);
|
|
931
931
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
932
|
-
|
|
932
|
+
ia,
|
|
933
933
|
{
|
|
934
934
|
source: t,
|
|
935
935
|
mimeType: e,
|
|
@@ -976,11 +976,11 @@ const sa = (e) => {
|
|
|
976
976
|
{
|
|
977
977
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
978
|
children: le(e, {
|
|
979
|
-
className:
|
|
979
|
+
className: Ft(r),
|
|
980
980
|
weight: "regular"
|
|
981
981
|
})
|
|
982
982
|
}
|
|
983
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
983
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${oa(r)}`, children: /* @__PURE__ */ n(
|
|
984
984
|
"img",
|
|
985
985
|
{
|
|
986
986
|
src: s,
|
|
@@ -993,12 +993,12 @@ const sa = (e) => {
|
|
|
993
993
|
{
|
|
994
994
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
995
|
children: le(e, {
|
|
996
|
-
className:
|
|
996
|
+
className: Ft(r),
|
|
997
997
|
weight: "regular"
|
|
998
998
|
})
|
|
999
999
|
}
|
|
1000
1000
|
);
|
|
1001
|
-
},
|
|
1001
|
+
}, nn = ({
|
|
1002
1002
|
variant: e,
|
|
1003
1003
|
thumbnail: t,
|
|
1004
1004
|
title: s,
|
|
@@ -1012,13 +1012,13 @@ const sa = (e) => {
|
|
|
1012
1012
|
rootRef: g,
|
|
1013
1013
|
"data-testid": u
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1015
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", x = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
ref: g,
|
|
1020
1020
|
"data-testid": u,
|
|
1021
|
-
className:
|
|
1021
|
+
className: y(
|
|
1022
1022
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1023
1023
|
f ? "bg-[#121110]" : "bg-white"
|
|
1024
1024
|
),
|
|
@@ -1030,17 +1030,17 @@ const sa = (e) => {
|
|
|
1030
1030
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1031
1031
|
"p",
|
|
1032
1032
|
{
|
|
1033
|
-
className:
|
|
1033
|
+
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1035
|
+
"text-white/30": f && x,
|
|
1036
|
+
"text-white": f && !x
|
|
1037
1037
|
}),
|
|
1038
1038
|
children: c
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
1042
|
le(r, {
|
|
1043
|
-
className:
|
|
1043
|
+
className: y(
|
|
1044
1044
|
"size-5 shrink-0",
|
|
1045
1045
|
f ? "text-white/55" : "text-black/55"
|
|
1046
1046
|
),
|
|
@@ -1049,7 +1049,7 @@ const sa = (e) => {
|
|
|
1049
1049
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1050
1050
|
"span",
|
|
1051
1051
|
{
|
|
1052
|
-
className:
|
|
1052
|
+
className: y(
|
|
1053
1053
|
"text-xs font-medium",
|
|
1054
1054
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1055
|
),
|
|
@@ -1064,29 +1064,29 @@ const sa = (e) => {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
);
|
|
1066
1066
|
};
|
|
1067
|
-
function
|
|
1067
|
+
function sn(e) {
|
|
1068
1068
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Ze(e) {
|
|
1071
1071
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function la(e) {
|
|
1074
1074
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function ca(e) {
|
|
1077
1077
|
return e ? "text-white" : "text-black";
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function da(e) {
|
|
1080
1080
|
return e ? "text-white/55" : "text-black/55";
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function ua(e) {
|
|
1083
1083
|
return e ? "text-white/40" : "text-black/40";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function ma(e) {
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1089
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(
|
|
1088
|
+
const Qe = ({ attachment: e, isMyMessage: t }) => {
|
|
1089
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(U.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
1092
1092
|
{
|
|
@@ -1097,26 +1097,26 @@ const Ze = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1097
1097
|
) : /* @__PURE__ */ n(
|
|
1098
1098
|
"div",
|
|
1099
1099
|
{
|
|
1100
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1101
|
-
children: /* @__PURE__ */ n(
|
|
1100
|
+
className: `aspect-video w-full rounded-[20px] ${la(t)} flex items-center justify-center`,
|
|
1101
|
+
children: /* @__PURE__ */ n(Ss, { className: `size-12 ${ma(t)}` })
|
|
1102
1102
|
}
|
|
1103
1103
|
) }),
|
|
1104
1104
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1105
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1106
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1107
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1105
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${ca(t)}`, children: s }),
|
|
1106
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${da(t)}`, children: a }),
|
|
1107
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ua(t)}`, children: d })
|
|
1108
1108
|
] })
|
|
1109
1109
|
] });
|
|
1110
1110
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
|
|
1111
1111
|
};
|
|
1112
|
-
function
|
|
1112
|
+
function an(e) {
|
|
1113
1113
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function et(e) {
|
|
1116
1116
|
var t;
|
|
1117
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1117
|
+
return (t = e.attachments) == null ? void 0 : t.find(an);
|
|
1118
1118
|
}
|
|
1119
|
-
async function
|
|
1119
|
+
async function ha(e, t) {
|
|
1120
1120
|
let s;
|
|
1121
1121
|
try {
|
|
1122
1122
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1128,11 +1128,11 @@ async function ua(e, t) {
|
|
|
1128
1128
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1129
1129
|
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1130
1130
|
}
|
|
1131
|
-
const
|
|
1131
|
+
const fa = ({
|
|
1132
1132
|
url: e,
|
|
1133
1133
|
filename: t
|
|
1134
1134
|
}) => {
|
|
1135
|
-
const [s, a] =
|
|
1135
|
+
const [s, a] = z(!1);
|
|
1136
1136
|
return /* @__PURE__ */ n(
|
|
1137
1137
|
"button",
|
|
1138
1138
|
{
|
|
@@ -1140,7 +1140,7 @@ const ma = ({
|
|
|
1140
1140
|
onClick: (i) => {
|
|
1141
1141
|
i.stopPropagation();
|
|
1142
1142
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1143
|
-
a(!0),
|
|
1143
|
+
a(!0), ha(e, t).then(() => {
|
|
1144
1144
|
o == null || o.close();
|
|
1145
1145
|
}).catch(() => {
|
|
1146
1146
|
o && (o.location.href = e);
|
|
@@ -1148,23 +1148,23 @@ const ma = ({
|
|
|
1148
1148
|
},
|
|
1149
1149
|
disabled: s,
|
|
1150
1150
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1151
|
-
children: s ? /* @__PURE__ */ n(
|
|
1152
|
-
/* @__PURE__ */ n(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(ve, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(U.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ n(xe, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
|
-
function
|
|
1159
|
-
var u, f, c,
|
|
1158
|
+
function tt(e) {
|
|
1159
|
+
var u, f, c, x;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1161
|
+
(b) => b.type === "video" && b.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(b) => b.type === "image" && b.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1166
|
-
), r = (
|
|
1167
|
-
(
|
|
1165
|
+
(b) => b.type === "audio" && b.asset_url
|
|
1166
|
+
), r = (x = e.attachments) == null ? void 0 : x.find(
|
|
1167
|
+
(b) => b.type === "file" && b.asset_url
|
|
1168
1168
|
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1169
|
if (!o) return null;
|
|
1170
1170
|
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1176,16 +1176,16 @@ function et(e) {
|
|
|
1176
1176
|
thumbnailUrl: g
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1179
|
+
const rn = ({
|
|
1180
1180
|
resolvedUrl: e,
|
|
1181
1181
|
resolvedType: t,
|
|
1182
1182
|
title: s,
|
|
1183
1183
|
fileSize: a,
|
|
1184
1184
|
thumbnailUrl: r
|
|
1185
1185
|
}) => {
|
|
1186
|
-
const i = a !== void 0 ?
|
|
1186
|
+
const i = a !== void 0 ? sn(a) : void 0;
|
|
1187
1187
|
return /* @__PURE__ */ n(
|
|
1188
|
-
|
|
1188
|
+
nn,
|
|
1189
1189
|
{
|
|
1190
1190
|
variant: "dark",
|
|
1191
1191
|
title: s,
|
|
@@ -1193,7 +1193,7 @@ const an = ({
|
|
|
1193
1193
|
mimeType: t,
|
|
1194
1194
|
detail: i,
|
|
1195
1195
|
thumbnail: /* @__PURE__ */ n(
|
|
1196
|
-
|
|
1196
|
+
tn,
|
|
1197
1197
|
{
|
|
1198
1198
|
mimeType: t,
|
|
1199
1199
|
sourceUrl: e,
|
|
@@ -1204,23 +1204,23 @@ const an = ({
|
|
|
1204
1204
|
)
|
|
1205
1205
|
}
|
|
1206
1206
|
);
|
|
1207
|
-
},
|
|
1207
|
+
}, on = ({
|
|
1208
1208
|
resolvedUrl: e,
|
|
1209
1209
|
resolvedType: t,
|
|
1210
1210
|
title: s,
|
|
1211
1211
|
fileSize: a,
|
|
1212
1212
|
thumbnailUrl: r
|
|
1213
1213
|
}) => {
|
|
1214
|
-
const i = re(t), o = a !== void 0 ?
|
|
1214
|
+
const i = re(t), o = a !== void 0 ? sn(a) : void 0;
|
|
1215
1215
|
return /* @__PURE__ */ n(
|
|
1216
|
-
|
|
1216
|
+
nn,
|
|
1217
1217
|
{
|
|
1218
1218
|
variant: "light",
|
|
1219
1219
|
title: s,
|
|
1220
1220
|
mimeType: t,
|
|
1221
1221
|
detail: o,
|
|
1222
1222
|
thumbnail: /* @__PURE__ */ n(
|
|
1223
|
-
|
|
1223
|
+
tn,
|
|
1224
1224
|
{
|
|
1225
1225
|
mimeType: t,
|
|
1226
1226
|
sourceUrl: e,
|
|
@@ -1230,14 +1230,14 @@ const an = ({
|
|
|
1230
1230
|
containedImage: i === "image" || i === "document"
|
|
1231
1231
|
}
|
|
1232
1232
|
),
|
|
1233
|
-
action: /* @__PURE__ */ n(
|
|
1233
|
+
action: /* @__PURE__ */ n(fa, { url: e, filename: s })
|
|
1234
1234
|
}
|
|
1235
1235
|
);
|
|
1236
|
-
},
|
|
1236
|
+
}, ga = ({
|
|
1237
1237
|
message: e,
|
|
1238
1238
|
isMyMessage: t = !1
|
|
1239
1239
|
}) => {
|
|
1240
|
-
const s =
|
|
1240
|
+
const s = et(e), a = tt(e);
|
|
1241
1241
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
1242
1242
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
1243
|
ie,
|
|
@@ -1258,40 +1258,40 @@ const an = ({
|
|
|
1258
1258
|
{
|
|
1259
1259
|
className: "str-chat__message-bubble",
|
|
1260
1260
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1261
|
+
children: s ? /* @__PURE__ */ n("div", { className: Ze(t), children: /* @__PURE__ */ n(Qe, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(rn, { ...a }) : /* @__PURE__ */ n(on, { ...a })
|
|
1262
1262
|
}
|
|
1263
1263
|
) })
|
|
1264
1264
|
}
|
|
1265
1265
|
)
|
|
1266
1266
|
] });
|
|
1267
|
-
},
|
|
1267
|
+
}, ba = ({
|
|
1268
1268
|
message: e
|
|
1269
1269
|
}) => {
|
|
1270
|
-
const t =
|
|
1270
|
+
const t = et(e);
|
|
1271
1271
|
if (t)
|
|
1272
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1273
|
-
const s =
|
|
1274
|
-
return s ? /* @__PURE__ */ n(
|
|
1275
|
-
},
|
|
1272
|
+
return /* @__PURE__ */ n("div", { className: Ze(!0), children: /* @__PURE__ */ n(Qe, { attachment: t, isMyMessage: !0 }) });
|
|
1273
|
+
const s = tt(e);
|
|
1274
|
+
return s ? /* @__PURE__ */ n(rn, { ...s }) : null;
|
|
1275
|
+
}, pa = ({
|
|
1276
1276
|
message: e
|
|
1277
1277
|
}) => {
|
|
1278
|
-
const t =
|
|
1278
|
+
const t = et(e);
|
|
1279
1279
|
if (t)
|
|
1280
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1281
|
-
const s =
|
|
1282
|
-
return s ? /* @__PURE__ */ n(
|
|
1283
|
-
},
|
|
1284
|
-
Creator:
|
|
1285
|
-
Visitor:
|
|
1286
|
-
}),
|
|
1280
|
+
return /* @__PURE__ */ n("div", { className: Ze(!1), children: /* @__PURE__ */ n(Qe, { attachment: t, isMyMessage: !1 }) });
|
|
1281
|
+
const s = tt(e);
|
|
1282
|
+
return s ? /* @__PURE__ */ n(on, { ...s }) : null;
|
|
1283
|
+
}, ki = Object.assign(ga, {
|
|
1284
|
+
Creator: ba,
|
|
1285
|
+
Visitor: pa
|
|
1286
|
+
}), va = {
|
|
1287
1287
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1290
|
-
},
|
|
1291
|
-
function
|
|
1292
|
-
return
|
|
1288
|
+
}, xa = {
|
|
1289
|
+
LockedAttachment: va
|
|
1290
|
+
}, ln = qe({}), Ei = ln.Provider;
|
|
1291
|
+
function wa(e) {
|
|
1292
|
+
return Me(ln)[e] ?? xa[e];
|
|
1293
1293
|
}
|
|
1294
|
-
const
|
|
1294
|
+
const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1295
|
"svg",
|
|
1296
1296
|
{
|
|
1297
1297
|
width: e,
|
|
@@ -1308,45 +1308,45 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1308
1308
|
}
|
|
1309
1309
|
)
|
|
1310
1310
|
}
|
|
1311
|
-
),
|
|
1311
|
+
), Na = (e) => {
|
|
1312
1312
|
var t;
|
|
1313
1313
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1314
|
-
},
|
|
1314
|
+
}, ya = (e) => {
|
|
1315
1315
|
var t;
|
|
1316
1316
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1317
|
-
},
|
|
1317
|
+
}, Se = (e) => {
|
|
1318
1318
|
var t;
|
|
1319
1319
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1320
|
-
},
|
|
1320
|
+
}, Ca = (e) => {
|
|
1321
1321
|
var t;
|
|
1322
1322
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1323
|
-
},
|
|
1323
|
+
}, cn = (e) => Na(e) || ya(e), ka = (e) => {
|
|
1324
1324
|
var t;
|
|
1325
|
-
return
|
|
1326
|
-
},
|
|
1325
|
+
return cn(e) && !((t = e.text) != null && t.trim());
|
|
1326
|
+
}, ze = ({
|
|
1327
1327
|
message: e,
|
|
1328
1328
|
standalone: t = !1,
|
|
1329
1329
|
isMyMessage: s = !1,
|
|
1330
1330
|
hasAttachment: a = !1
|
|
1331
1331
|
}) => {
|
|
1332
1332
|
var u;
|
|
1333
|
-
const r =
|
|
1333
|
+
const r = cn(e), i = Se(e);
|
|
1334
1334
|
if (!r && !i)
|
|
1335
1335
|
return null;
|
|
1336
1336
|
if (r) {
|
|
1337
1337
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1338
1338
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1339
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", x = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
|
-
/* @__PURE__ */ n(
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1341
|
+
/* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: x })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
1345
|
const o = s && a, l = o ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
1346
1346
|
"message-chatbot-indicator",
|
|
1347
1347
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1348
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
1349
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(_a, { size: o ? 12 : 15 }) });
|
|
1350
1350
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(ae, { children: [
|
|
1351
1351
|
m,
|
|
1352
1352
|
g
|
|
@@ -1354,7 +1354,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1354
1354
|
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
1357
|
-
},
|
|
1357
|
+
}, Ea = ({
|
|
1358
1358
|
selected: e,
|
|
1359
1359
|
onVoteUp: t,
|
|
1360
1360
|
onVoteDown: s
|
|
@@ -1363,32 +1363,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1363
|
"button",
|
|
1364
1364
|
{
|
|
1365
1365
|
type: "button",
|
|
1366
|
-
className:
|
|
1366
|
+
className: y("message-vote-button focus-ring", {
|
|
1367
1367
|
"message-vote-button--selected": e === "up"
|
|
1368
1368
|
}),
|
|
1369
1369
|
onClick: t,
|
|
1370
1370
|
"aria-label": "Good response",
|
|
1371
1371
|
"aria-pressed": e === "up",
|
|
1372
1372
|
"data-tooltip": "Good response",
|
|
1373
|
-
children: /* @__PURE__ */ n(
|
|
1373
|
+
children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1374
1374
|
}
|
|
1375
1375
|
),
|
|
1376
1376
|
/* @__PURE__ */ n(
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
1379
1379
|
type: "button",
|
|
1380
|
-
className:
|
|
1380
|
+
className: y("message-vote-button focus-ring", {
|
|
1381
1381
|
"message-vote-button--selected": e === "down"
|
|
1382
1382
|
}),
|
|
1383
1383
|
onClick: s,
|
|
1384
1384
|
"aria-label": "Bad response",
|
|
1385
1385
|
"aria-pressed": e === "down",
|
|
1386
1386
|
"data-tooltip": "Bad response",
|
|
1387
|
-
children: /* @__PURE__ */ n(
|
|
1387
|
+
children: /* @__PURE__ */ n(As, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
|
-
] }),
|
|
1391
|
-
var
|
|
1390
|
+
] }), Sa = (e) => {
|
|
1391
|
+
var gt, bt, pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St, It;
|
|
1392
1392
|
const {
|
|
1393
1393
|
additionalMessageInputProps: t,
|
|
1394
1394
|
chatbotVotingEnabled: s,
|
|
@@ -1403,60 +1403,60 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1403
1403
|
isMessageAIGenerated: u,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1407
|
-
threadList:
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1406
|
+
renderText: x,
|
|
1407
|
+
threadList: b,
|
|
1408
|
+
viewerLanguage: w
|
|
1409
|
+
} = e, { client: v } = Xe("CustomMessage"), { channel: p } = ce("CustomMessage"), { isUnlocking: A, onUnlockClick: R, onFetchSource: L, onDownloadClick: S } = wa("LockedAttachment"), [D, P] = z(!1), B = Dn(c.id), { selected: M, voteUp: N, voteDown: T } = qs(c), {
|
|
1410
|
+
Attachment: k = Pn,
|
|
1411
1411
|
EditMessageModal: I = On,
|
|
1412
|
-
MessageActions:
|
|
1413
|
-
MessageBlocked: O =
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} = jt("CustomMessage"),
|
|
1412
|
+
MessageActions: C,
|
|
1413
|
+
MessageBlocked: O = zn,
|
|
1414
|
+
MessageBouncePrompt: $ = $n,
|
|
1415
|
+
MessageDeleted: j = Fn,
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = Bn,
|
|
1417
|
+
MessageRepliesCountButton: K = Vn,
|
|
1418
|
+
ReminderNotification: V = Un,
|
|
1419
|
+
StreamedMessageText: _ = jn,
|
|
1420
|
+
PinIndicator: E
|
|
1421
|
+
} = jt("CustomMessage"), F = Gn(c), q = Hn(c), Y = se(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
|
-
),
|
|
1425
|
-
const fe = c.attachments ?? [],
|
|
1426
|
-
if (!
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1424
|
+
), G = se(() => {
|
|
1425
|
+
const fe = c.attachments ?? [], ke = c.shared_location ? [c.shared_location, ...fe] : fe;
|
|
1426
|
+
if (!Se(c)) return ke;
|
|
1427
|
+
const Tt = ke.filter((At) => !("type" in At) || !an(At));
|
|
1428
|
+
return Tt.length === ke.length ? ke : Tt;
|
|
1429
1429
|
}, [c]), W = se(() => {
|
|
1430
|
-
const fe =
|
|
1430
|
+
const fe = Jt({ message: c, viewerLanguage: w });
|
|
1431
1431
|
return fe === c.text ? c : { ...c, text: fe };
|
|
1432
|
-
}, [c,
|
|
1433
|
-
if (
|
|
1432
|
+
}, [c, w]);
|
|
1433
|
+
if (Yn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1437
|
-
if (
|
|
1436
|
+
return /* @__PURE__ */ n(j, { message: c });
|
|
1437
|
+
if (qn(c))
|
|
1438
1438
|
return /* @__PURE__ */ n(O, {});
|
|
1439
|
-
const de = !
|
|
1439
|
+
const de = !b && !!c.reply_count, ue = !b && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((gt = c.error) == null ? void 0 : gt.status) !== 403, te = Wn(c);
|
|
1440
1440
|
let Q;
|
|
1441
1441
|
me ? Q = () => m(c) : te && (Q = () => P(!0));
|
|
1442
|
-
const ee = f(),
|
|
1442
|
+
const ee = f(), Sn = y(
|
|
1443
1443
|
"str-chat__message str-chat__message-simple",
|
|
1444
1444
|
`str-chat__message--${c.type}`,
|
|
1445
1445
|
`str-chat__message--${c.status}`,
|
|
1446
1446
|
ee ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1447
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1448
|
{
|
|
1449
|
-
"str-chat__message--has-attachment":
|
|
1449
|
+
"str-chat__message--has-attachment": F,
|
|
1450
1450
|
"str-chat__message--highlighted": g,
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
1452
|
"str-chat__message--with-reactions": q,
|
|
1453
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1453
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((bt = c == null ? void 0 : c.error) == null ? void 0 : bt.status) !== 403,
|
|
1454
1454
|
"str-chat__message-with-thread-link": de || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1457
|
"str-chat__virtual-message__wrapper--group": o
|
|
1458
1458
|
}
|
|
1459
|
-
),
|
|
1459
|
+
), ut = c.poll_id && v.polls.fromState(c.poll_id), mt = ka(c), he = Se(c), ht = Ca(c), De = !!(G != null && G.length && !c.quoted_message), ft = he && ee && De;
|
|
1460
1460
|
return /* @__PURE__ */ h(ae, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
1462
|
I,
|
|
@@ -1464,22 +1464,22 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1468
|
-
|
|
1467
|
+
D && /* @__PURE__ */ n(
|
|
1468
|
+
Xn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1470
|
+
MessageBouncePrompt: $,
|
|
1471
1471
|
onClose: () => P(!1),
|
|
1472
|
-
open:
|
|
1472
|
+
open: D
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
1476
1476
|
"div",
|
|
1477
1477
|
{
|
|
1478
|
-
className:
|
|
1478
|
+
className: Sn,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
1480
|
children: [
|
|
1481
|
-
|
|
1482
|
-
!!
|
|
1481
|
+
E && /* @__PURE__ */ n(E, {}),
|
|
1482
|
+
!!B && /* @__PURE__ */ n(V, { reminder: B }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
1484
|
ie,
|
|
1485
1485
|
{
|
|
@@ -1495,7 +1495,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1495
1495
|
/* @__PURE__ */ n(
|
|
1496
1496
|
"div",
|
|
1497
1497
|
{
|
|
1498
|
-
className:
|
|
1498
|
+
className: y("str-chat__message-inner", {
|
|
1499
1499
|
"str-chat__simple-message--error-failed": me || te
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
@@ -1509,159 +1509,159 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1509
1509
|
marginInlineEnd: 0,
|
|
1510
1510
|
marginInlineStart: 0
|
|
1511
1511
|
},
|
|
1512
|
-
children:
|
|
1512
|
+
children: ht ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
1513
|
ee ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
|
-
|
|
1514
|
+
C && /* @__PURE__ */ n(C, {}),
|
|
1515
1515
|
/* @__PURE__ */ n(
|
|
1516
|
-
|
|
1516
|
+
$t.Sent,
|
|
1517
1517
|
{
|
|
1518
|
-
title: (
|
|
1519
|
-
mimeType: (
|
|
1520
|
-
thumbnailUrl: (
|
|
1521
|
-
amountText: (
|
|
1522
|
-
detail: (
|
|
1523
|
-
paymentStatus: (
|
|
1524
|
-
onPreviewClick: () =>
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1518
|
+
title: (pt = c.metadata) == null ? void 0 : pt.attachment_title,
|
|
1519
|
+
mimeType: (vt = c.metadata) == null ? void 0 : vt.attachment_mime_type,
|
|
1520
|
+
thumbnailUrl: (xt = c.metadata) == null ? void 0 : xt.attachment_thumbnail,
|
|
1521
|
+
amountText: (wt = c.metadata) == null ? void 0 : wt.amount_text,
|
|
1522
|
+
detail: (_t = c.metadata) == null ? void 0 : _t.attachment_detail,
|
|
1523
|
+
paymentStatus: (Nt = c.metadata) == null ? void 0 : Nt.payment_status,
|
|
1524
|
+
onPreviewClick: () => R == null ? void 0 : R(c, p),
|
|
1525
|
+
onFetchSource: async () => await (L == null ? void 0 : L(c, p))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1529
1529
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1530
|
+
$t.Received,
|
|
1531
1531
|
{
|
|
1532
|
-
title: (
|
|
1533
|
-
mimeType: (
|
|
1534
|
-
thumbnailUrl: (
|
|
1535
|
-
amountText: (
|
|
1536
|
-
detail: (
|
|
1537
|
-
paymentStatus: (
|
|
1532
|
+
title: (yt = c.metadata) == null ? void 0 : yt.attachment_title,
|
|
1533
|
+
mimeType: (Ct = c.metadata) == null ? void 0 : Ct.attachment_mime_type,
|
|
1534
|
+
thumbnailUrl: (kt = c.metadata) == null ? void 0 : kt.attachment_thumbnail,
|
|
1535
|
+
amountText: (Et = c.metadata) == null ? void 0 : Et.amount_text,
|
|
1536
|
+
detail: (St = c.metadata) == null ? void 0 : St.attachment_detail,
|
|
1537
|
+
paymentStatus: (It = c.metadata) == null ? void 0 : It.payment_status,
|
|
1538
1538
|
isUnlocking: A(c.id),
|
|
1539
|
-
onUnlockClick: () =>
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1541
|
-
onDownloadClick: () =>
|
|
1539
|
+
onUnlockClick: () => R == null ? void 0 : R(c, p),
|
|
1540
|
+
onFetchSource: async () => await (L == null ? void 0 : L(c, p)),
|
|
1541
|
+
onDownloadClick: () => S == null ? void 0 : S(c, p)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
C && /* @__PURE__ */ n(C, {})
|
|
1545
1545
|
] }),
|
|
1546
1546
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
|
-
|
|
1547
|
+
Rt,
|
|
1548
1548
|
{
|
|
1549
1549
|
message: W,
|
|
1550
|
-
renderText:
|
|
1550
|
+
renderText: x
|
|
1551
1551
|
}
|
|
1552
1552
|
) })
|
|
1553
|
-
] }) :
|
|
1553
|
+
] }) : mt ? (
|
|
1554
1554
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
|
-
/* @__PURE__ */ n(
|
|
1555
|
+
/* @__PURE__ */ n(ze, { message: c, standalone: !0 })
|
|
1556
1556
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1557
|
-
he && !
|
|
1558
|
-
|
|
1557
|
+
he && !ft && /* @__PURE__ */ n(
|
|
1558
|
+
ze,
|
|
1559
1559
|
{
|
|
1560
1560
|
message: c,
|
|
1561
|
-
hasAttachment:
|
|
1561
|
+
hasAttachment: De,
|
|
1562
1562
|
isMyMessage: ee
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1565
|
+
ut && /* @__PURE__ */ n(Kn, { poll: ut }),
|
|
1566
|
+
G != null && G.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
|
+
k,
|
|
1568
1568
|
{
|
|
1569
1569
|
actionHandler: l,
|
|
1570
|
-
attachments:
|
|
1570
|
+
attachments: G
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
|
-
|
|
1574
|
-
|
|
1573
|
+
Y ? /* @__PURE__ */ n(
|
|
1574
|
+
_,
|
|
1575
1575
|
{
|
|
1576
1576
|
message: W,
|
|
1577
|
-
renderText:
|
|
1577
|
+
renderText: x
|
|
1578
1578
|
}
|
|
1579
1579
|
) : /* @__PURE__ */ n(
|
|
1580
|
-
|
|
1580
|
+
Rt,
|
|
1581
1581
|
{
|
|
1582
1582
|
message: W,
|
|
1583
|
-
renderText:
|
|
1583
|
+
renderText: x
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
|
-
/* @__PURE__ */ n(
|
|
1586
|
+
/* @__PURE__ */ n(Jn, {})
|
|
1587
1587
|
] }) })
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
|
-
!
|
|
1591
|
-
(!he ||
|
|
1592
|
-
|
|
1590
|
+
!ht && !mt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
+
(!he || ft) && /* @__PURE__ */ n(
|
|
1592
|
+
ze,
|
|
1593
1593
|
{
|
|
1594
1594
|
message: c,
|
|
1595
|
-
hasAttachment:
|
|
1595
|
+
hasAttachment: De,
|
|
1596
1596
|
isMyMessage: ee
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
1599
|
s && he && /* @__PURE__ */ n(
|
|
1600
|
-
|
|
1600
|
+
Ea,
|
|
1601
1601
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1602
|
+
selected: M,
|
|
1603
|
+
onVoteUp: N,
|
|
1604
|
+
onVoteDown: T
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
1608
1608
|
de && /* @__PURE__ */ n(
|
|
1609
|
-
|
|
1609
|
+
K,
|
|
1610
1610
|
{
|
|
1611
1611
|
onClick: d,
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
ue && /* @__PURE__ */ n(
|
|
1615
|
+
ue && /* @__PURE__ */ n(X, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
1619
1619
|
)
|
|
1620
1620
|
] });
|
|
1621
|
-
},
|
|
1622
|
-
|
|
1623
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1624
|
-
),
|
|
1625
|
-
const t =
|
|
1626
|
-
return /* @__PURE__ */ n(
|
|
1627
|
-
},
|
|
1621
|
+
}, Ia = U.memo(
|
|
1622
|
+
Sa,
|
|
1623
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ln(e, t)
|
|
1624
|
+
), Ta = (e) => {
|
|
1625
|
+
const t = we("CustomMessage");
|
|
1626
|
+
return /* @__PURE__ */ n(Ia, { ...t, ...e });
|
|
1627
|
+
}, Aa = () => {
|
|
1628
1628
|
var s;
|
|
1629
|
-
const { handleDelete: e, message: t } =
|
|
1629
|
+
const { handleDelete: e, message: t } = we("CustomMessageActions");
|
|
1630
1630
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
|
-
|
|
1631
|
+
qt,
|
|
1632
1632
|
{
|
|
1633
1633
|
onClick: e,
|
|
1634
1634
|
"aria-label": "Delete",
|
|
1635
1635
|
title: "Delete",
|
|
1636
1636
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1637
|
-
children: /* @__PURE__ */ n(
|
|
1637
|
+
children: /* @__PURE__ */ n(Ms, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1638
1638
|
}
|
|
1639
1639
|
);
|
|
1640
|
-
},
|
|
1641
|
-
const { handleFlag: e } =
|
|
1640
|
+
}, Ma = () => {
|
|
1641
|
+
const { handleFlag: e } = we("CustomMessageActions");
|
|
1642
1642
|
return /* @__PURE__ */ n(
|
|
1643
|
-
|
|
1643
|
+
qt,
|
|
1644
1644
|
{
|
|
1645
1645
|
onClick: e,
|
|
1646
1646
|
"aria-label": "Report",
|
|
1647
1647
|
title: "Report",
|
|
1648
1648
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1649
|
-
children: /* @__PURE__ */ n(
|
|
1649
|
+
children: /* @__PURE__ */ n(Gt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1650
1650
|
}
|
|
1651
1651
|
);
|
|
1652
|
-
},
|
|
1652
|
+
}, Ra = () => {
|
|
1653
1653
|
var t;
|
|
1654
|
-
const { message: e } =
|
|
1654
|
+
const { message: e } = we("CustomMessageActions");
|
|
1655
1655
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
|
-
|
|
1656
|
+
zs,
|
|
1657
1657
|
{
|
|
1658
1658
|
messageActionSet: [
|
|
1659
|
-
{ Component:
|
|
1660
|
-
{ Component:
|
|
1659
|
+
{ Component: Aa, placement: "quick", type: "delete" },
|
|
1660
|
+
{ Component: Ma, placement: "quick", type: "flag" }
|
|
1661
1661
|
]
|
|
1662
1662
|
}
|
|
1663
1663
|
);
|
|
1664
|
-
},
|
|
1664
|
+
}, La = ({
|
|
1665
1665
|
link: e,
|
|
1666
1666
|
onDismiss: t
|
|
1667
1667
|
}) => {
|
|
@@ -1691,7 +1691,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1691
1691
|
},
|
|
1692
1692
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1693
1693
|
"aria-label": "Close link preview",
|
|
1694
|
-
children: /* @__PURE__ */ n(
|
|
1694
|
+
children: /* @__PURE__ */ n(Re, { className: "size-4 text-black/90" })
|
|
1695
1695
|
}
|
|
1696
1696
|
),
|
|
1697
1697
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1701,26 +1701,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1701
1701
|
]
|
|
1702
1702
|
}
|
|
1703
1703
|
);
|
|
1704
|
-
},
|
|
1704
|
+
}, Da = (e) => ({
|
|
1705
1705
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1706
|
-
(t) =>
|
|
1706
|
+
(t) => Mt.previewIsLoaded(t) || Mt.previewIsLoading(t)
|
|
1707
1707
|
)
|
|
1708
|
-
}),
|
|
1709
|
-
const { linkPreviewsManager: e } =
|
|
1708
|
+
}), Pa = () => {
|
|
1709
|
+
const { linkPreviewsManager: e } = Zn(), { linkPreviews: t } = Qn(
|
|
1710
1710
|
e.state,
|
|
1711
|
-
|
|
1711
|
+
Da
|
|
1712
1712
|
), s = (r) => {
|
|
1713
1713
|
e.dismissPreview(r);
|
|
1714
1714
|
};
|
|
1715
1715
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-stretch w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1716
|
-
|
|
1716
|
+
La,
|
|
1717
1717
|
{
|
|
1718
1718
|
link: r,
|
|
1719
1719
|
onDismiss: s
|
|
1720
1720
|
},
|
|
1721
1721
|
r.og_scrape_url
|
|
1722
1722
|
)) }) : null;
|
|
1723
|
-
},
|
|
1723
|
+
}, dn = U.createContext(!1), Oa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
...s,
|
|
@@ -1728,20 +1728,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1728
1728
|
"aria-label": "Send",
|
|
1729
1729
|
disabled: t,
|
|
1730
1730
|
onClick: e,
|
|
1731
|
-
children: /* @__PURE__ */ n(
|
|
1731
|
+
children: /* @__PURE__ */ n(Rs, { weight: "bold", className: "size-4" })
|
|
1732
1732
|
}
|
|
1733
|
-
),
|
|
1734
|
-
const e =
|
|
1735
|
-
SendButton: r =
|
|
1736
|
-
AttachmentPreviewList: i =
|
|
1733
|
+
), za = () => {
|
|
1734
|
+
const e = Me(dn), { handleSubmit: t } = ts(), s = ns(), a = e || !s, {
|
|
1735
|
+
SendButton: r = Oa,
|
|
1736
|
+
AttachmentPreviewList: i = ss
|
|
1737
1737
|
} = jt("CustomMessageInput");
|
|
1738
1738
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1739
|
-
/* @__PURE__ */ n(
|
|
1740
|
-
/* @__PURE__ */ n(
|
|
1739
|
+
/* @__PURE__ */ n(as, {}),
|
|
1740
|
+
/* @__PURE__ */ n(Pa, {}),
|
|
1741
1741
|
/* @__PURE__ */ n(i, {}),
|
|
1742
1742
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1743
1743
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1744
|
-
|
|
1744
|
+
rs,
|
|
1745
1745
|
{
|
|
1746
1746
|
"aria-disabled": e || void 0,
|
|
1747
1747
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1764,7 +1764,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1764
1764
|
)
|
|
1765
1765
|
] })
|
|
1766
1766
|
] });
|
|
1767
|
-
},
|
|
1767
|
+
}, $a = ({
|
|
1768
1768
|
renderActions: e,
|
|
1769
1769
|
renderFooter: t,
|
|
1770
1770
|
disabled: s = !1,
|
|
@@ -1784,67 +1784,67 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1784
1784
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1785
1785
|
children: [
|
|
1786
1786
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1787
|
-
/* @__PURE__ */ n(
|
|
1787
|
+
/* @__PURE__ */ n(dn.Provider, { value: i, children: /* @__PURE__ */ n(es, { Input: za }) })
|
|
1788
1788
|
]
|
|
1789
1789
|
}
|
|
1790
1790
|
),
|
|
1791
1791
|
t == null ? void 0 : t()
|
|
1792
1792
|
] });
|
|
1793
|
-
},
|
|
1793
|
+
}, Fa = [
|
|
1794
1794
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1795
1795
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1796
|
-
],
|
|
1796
|
+
], Ba = {
|
|
1797
1797
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1798
1798
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1799
|
-
},
|
|
1799
|
+
}, Va = [
|
|
1800
1800
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1801
|
-
],
|
|
1801
|
+
], Ua = {
|
|
1802
1802
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1803
|
-
},
|
|
1803
|
+
}, $e = "age safety guidelines.", ja = "https://linktr.ee/s/about/contact", Bt = (e) => Fa.includes(e), Ga = (e) => Va.includes(e), Ha = (e) => {
|
|
1804
1804
|
var a;
|
|
1805
1805
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1806
|
-
if (
|
|
1806
|
+
if (Bt(t))
|
|
1807
1807
|
return {
|
|
1808
1808
|
kind: "dm-agent",
|
|
1809
1809
|
type: t
|
|
1810
1810
|
};
|
|
1811
|
-
if (
|
|
1811
|
+
if (Ga(t))
|
|
1812
1812
|
return {
|
|
1813
1813
|
kind: "age-safety",
|
|
1814
1814
|
type: t
|
|
1815
1815
|
};
|
|
1816
1816
|
const s = e.dm_agent_system_type;
|
|
1817
|
-
if (
|
|
1817
|
+
if (Bt(s))
|
|
1818
1818
|
return {
|
|
1819
1819
|
kind: "dm-agent",
|
|
1820
1820
|
type: s
|
|
1821
1821
|
};
|
|
1822
|
-
},
|
|
1823
|
-
const t = e.indexOf(
|
|
1822
|
+
}, Ya = (e) => {
|
|
1823
|
+
const t = e.indexOf($e);
|
|
1824
1824
|
if (t === -1)
|
|
1825
1825
|
return e;
|
|
1826
|
-
const s = t +
|
|
1826
|
+
const s = t + $e.length;
|
|
1827
1827
|
return /* @__PURE__ */ h(ae, { children: [
|
|
1828
1828
|
e.slice(0, t),
|
|
1829
1829
|
/* @__PURE__ */ n(
|
|
1830
1830
|
"a",
|
|
1831
1831
|
{
|
|
1832
|
-
href:
|
|
1832
|
+
href: ja,
|
|
1833
1833
|
target: "_blank",
|
|
1834
1834
|
rel: "noopener noreferrer",
|
|
1835
1835
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1836
|
-
children:
|
|
1836
|
+
children: $e
|
|
1837
1837
|
}
|
|
1838
1838
|
),
|
|
1839
1839
|
e.slice(s)
|
|
1840
1840
|
] });
|
|
1841
|
-
},
|
|
1841
|
+
}, qa = (e) => {
|
|
1842
1842
|
var a, r;
|
|
1843
|
-
const t = e.message.hide_date === !0, s =
|
|
1843
|
+
const t = e.message.hide_date === !0, s = Ha(
|
|
1844
1844
|
e.message
|
|
1845
1845
|
);
|
|
1846
1846
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1847
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1847
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ba[s.type];
|
|
1848
1848
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1849
1849
|
/* @__PURE__ */ h(
|
|
1850
1850
|
"div",
|
|
@@ -1866,11 +1866,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1866
1866
|
]
|
|
1867
1867
|
}
|
|
1868
1868
|
),
|
|
1869
|
-
!t && /* @__PURE__ */ n(
|
|
1869
|
+
!t && /* @__PURE__ */ n(Pe, { message: e.message })
|
|
1870
1870
|
] });
|
|
1871
1871
|
}
|
|
1872
1872
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1873
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1873
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ua[s.type];
|
|
1874
1874
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1875
1875
|
/* @__PURE__ */ h(
|
|
1876
1876
|
"div",
|
|
@@ -1880,7 +1880,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1880
1880
|
"data-age-safety-system-type": s.type,
|
|
1881
1881
|
children: [
|
|
1882
1882
|
/* @__PURE__ */ n(
|
|
1883
|
-
|
|
1883
|
+
Ls,
|
|
1884
1884
|
{
|
|
1885
1885
|
size: 24,
|
|
1886
1886
|
weight: "duotone",
|
|
@@ -1889,11 +1889,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1889
1889
|
"data-testid": "age-safety-system-message-icon"
|
|
1890
1890
|
}
|
|
1891
1891
|
),
|
|
1892
|
-
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1892
|
+
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ya(i) }) })
|
|
1893
1893
|
]
|
|
1894
1894
|
}
|
|
1895
1895
|
),
|
|
1896
|
-
!t && /* @__PURE__ */ n(
|
|
1896
|
+
!t && /* @__PURE__ */ n(Pe, { message: e.message })
|
|
1897
1897
|
] });
|
|
1898
1898
|
}
|
|
1899
1899
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1902,9 +1902,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1902
1902
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
1903
1903
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
1904
1904
|
] }),
|
|
1905
|
-
!t && /* @__PURE__ */ n(
|
|
1905
|
+
!t && /* @__PURE__ */ n(Pe, { message: e.message })
|
|
1906
1906
|
] });
|
|
1907
|
-
},
|
|
1907
|
+
}, un = qe(!1), Fe = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1908
1908
|
"animateTransform",
|
|
1909
1909
|
{
|
|
1910
1910
|
attributeName: "transform",
|
|
@@ -1914,21 +1914,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1914
1914
|
begin: `${120 * t}ms`,
|
|
1915
1915
|
repeatCount: "indefinite"
|
|
1916
1916
|
}
|
|
1917
|
-
) }),
|
|
1917
|
+
) }), Wa = /* @__PURE__ */ new Set([
|
|
1918
1918
|
Oe.Thinking,
|
|
1919
1919
|
Oe.Generating,
|
|
1920
1920
|
Oe.ExternalSources
|
|
1921
|
-
]),
|
|
1922
|
-
var
|
|
1923
|
-
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } =
|
|
1924
|
-
if (!e && l &&
|
|
1925
|
-
const
|
|
1921
|
+
]), Xa = ({ threadList: e }) => {
|
|
1922
|
+
var x, b;
|
|
1923
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Xe(), { typing: i = {} } = is(), { aiState: o } = os(t), l = Me(un);
|
|
1924
|
+
if (!e && l && Wa.has(o)) {
|
|
1925
|
+
const w = Ka(t, (x = r.user) == null ? void 0 : x.id);
|
|
1926
1926
|
return /* @__PURE__ */ n(
|
|
1927
|
-
|
|
1927
|
+
Vt,
|
|
1928
1928
|
{
|
|
1929
|
-
avatarId: (
|
|
1930
|
-
avatarName: (
|
|
1931
|
-
avatarImage:
|
|
1929
|
+
avatarId: (w == null ? void 0 : w.id) ?? "ai-agent",
|
|
1930
|
+
avatarName: (w == null ? void 0 : w.name) ?? (w == null ? void 0 : w.id) ?? "Agent",
|
|
1931
|
+
avatarImage: w == null ? void 0 : w.image,
|
|
1932
1932
|
testId: "typing-indicator-ai"
|
|
1933
1933
|
}
|
|
1934
1934
|
);
|
|
@@ -1936,21 +1936,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1936
1936
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1937
1937
|
return null;
|
|
1938
1938
|
const m = e ? [] : Object.values(i).filter(
|
|
1939
|
-
({ parent_id:
|
|
1940
|
-
var
|
|
1941
|
-
return (
|
|
1939
|
+
({ parent_id: w, user: v }) => {
|
|
1940
|
+
var p;
|
|
1941
|
+
return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && !w;
|
|
1942
1942
|
}
|
|
1943
1943
|
), g = e ? Object.values(i).filter(
|
|
1944
|
-
({ parent_id:
|
|
1945
|
-
var
|
|
1946
|
-
return (
|
|
1944
|
+
({ parent_id: w, user: v }) => {
|
|
1945
|
+
var p;
|
|
1946
|
+
return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && w === (a == null ? void 0 : a.id);
|
|
1947
1947
|
}
|
|
1948
1948
|
) : [], u = e ? g : m;
|
|
1949
1949
|
if (!u.length)
|
|
1950
1950
|
return null;
|
|
1951
|
-
const f = (
|
|
1951
|
+
const f = (b = u[0]) == null ? void 0 : b.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1952
1952
|
return /* @__PURE__ */ n(
|
|
1953
|
-
|
|
1953
|
+
Vt,
|
|
1954
1954
|
{
|
|
1955
1955
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1956
1956
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1958,7 +1958,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1958
1958
|
testId: "typing-indicator"
|
|
1959
1959
|
}
|
|
1960
1960
|
);
|
|
1961
|
-
},
|
|
1961
|
+
}, Vt = ({
|
|
1962
1962
|
avatarId: e,
|
|
1963
1963
|
avatarName: t,
|
|
1964
1964
|
avatarImage: s,
|
|
@@ -1993,16 +1993,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1993
1993
|
height: "13",
|
|
1994
1994
|
overflow: "visible",
|
|
1995
1995
|
children: [
|
|
1996
|
-
/* @__PURE__ */ n(
|
|
1997
|
-
/* @__PURE__ */ n(
|
|
1998
|
-
/* @__PURE__ */ n(
|
|
1996
|
+
/* @__PURE__ */ n(Fe, { cx: "4", index: 0 }),
|
|
1997
|
+
/* @__PURE__ */ n(Fe, { cx: "16", index: 1 }),
|
|
1998
|
+
/* @__PURE__ */ n(Fe, { cx: "28", index: 2 })
|
|
1999
1999
|
]
|
|
2000
2000
|
}
|
|
2001
2001
|
) }) }) }) }) })
|
|
2002
2002
|
] })
|
|
2003
2003
|
}
|
|
2004
2004
|
);
|
|
2005
|
-
function
|
|
2005
|
+
function Ka(e, t) {
|
|
2006
2006
|
var a;
|
|
2007
2007
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2008
2008
|
for (const r of Object.values(s)) {
|
|
@@ -2011,10 +2011,10 @@ function Wa(e, t) {
|
|
|
2011
2011
|
return i;
|
|
2012
2012
|
}
|
|
2013
2013
|
}
|
|
2014
|
-
const
|
|
2014
|
+
const Ja = () => null, Za = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2015
2015
|
"div",
|
|
2016
2016
|
{
|
|
2017
|
-
className:
|
|
2017
|
+
className: y("flex items-center justify-center h-full", e),
|
|
2018
2018
|
children: [
|
|
2019
2019
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2020
2020
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2054,12 +2054,24 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2054
2054
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2055
2055
|
]
|
|
2056
2056
|
}
|
|
2057
|
-
),
|
|
2058
|
-
/* @__PURE__ */ n(
|
|
2057
|
+
), Ie = U.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2058
|
+
/* @__PURE__ */ n(Za, { className: "w-6 h-6" }),
|
|
2059
2059
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2060
2060
|
] }) }));
|
|
2061
|
-
|
|
2062
|
-
const
|
|
2061
|
+
Ie.displayName = "LoadingState";
|
|
2062
|
+
const be = ({
|
|
2063
|
+
className: e,
|
|
2064
|
+
size: t = 16
|
|
2065
|
+
}) => /* @__PURE__ */ n(
|
|
2066
|
+
Ds,
|
|
2067
|
+
{
|
|
2068
|
+
weight: "fill",
|
|
2069
|
+
size: t,
|
|
2070
|
+
className: y("shrink-0 text-[#1D9BF0]", e),
|
|
2071
|
+
"aria-label": "Verified",
|
|
2072
|
+
role: "img"
|
|
2073
|
+
}
|
|
2074
|
+
), oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ut = "Replies instantly with AI assistant", Qa = ({
|
|
2063
2075
|
onBack: e,
|
|
2064
2076
|
showBackButton: t,
|
|
2065
2077
|
showStarButton: s = !1,
|
|
@@ -2074,26 +2086,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2074
2086
|
onReportParticipantClick: u,
|
|
2075
2087
|
customChannelActions: f,
|
|
2076
2088
|
renderChannelActions: c,
|
|
2077
|
-
showChannelInfo:
|
|
2078
|
-
onParticipantNameClick:
|
|
2079
|
-
renderHeaderTitleBadges:
|
|
2089
|
+
showChannelInfo: x = !0,
|
|
2090
|
+
onParticipantNameClick: b,
|
|
2091
|
+
renderHeaderTitleBadges: w
|
|
2080
2092
|
}) => {
|
|
2081
|
-
var
|
|
2082
|
-
const { channel:
|
|
2083
|
-
var
|
|
2084
|
-
const C = (
|
|
2085
|
-
return C ? Object.values(((
|
|
2086
|
-
(
|
|
2087
|
-
var
|
|
2088
|
-
return ((
|
|
2093
|
+
var B, M, N, T, k, I;
|
|
2094
|
+
const { channel: v } = ce(), p = U.useMemo(() => {
|
|
2095
|
+
var $, j;
|
|
2096
|
+
const C = ($ = v._client) == null ? void 0 : $.userID;
|
|
2097
|
+
return C ? Object.values(((j = v.state) == null ? void 0 : j.members) || {}).find(
|
|
2098
|
+
(X) => {
|
|
2099
|
+
var K;
|
|
2100
|
+
return ((K = X.user) == null ? void 0 : K.id) && X.user.id !== C;
|
|
2089
2101
|
}
|
|
2090
2102
|
) : void 0;
|
|
2091
|
-
}, [(
|
|
2092
|
-
channel:
|
|
2093
|
-
participant:
|
|
2094
|
-
}),
|
|
2103
|
+
}, [(B = v._client) == null ? void 0 : B.userID, (M = v.state) == null ? void 0 : M.members]), A = Kt(p == null ? void 0 : p.user), R = (N = p == null ? void 0 : p.user) == null ? void 0 : N.image, L = ((T = p == null ? void 0 : p.user) == null ? void 0 : T.is_verified) === !0, S = Xt(v), D = w == null ? void 0 : w({
|
|
2104
|
+
channel: v,
|
|
2105
|
+
participant: p
|
|
2106
|
+
}), P = async () => {
|
|
2095
2107
|
try {
|
|
2096
|
-
|
|
2108
|
+
S ? await v.unpin() : await v.pin();
|
|
2097
2109
|
} catch (C) {
|
|
2098
2110
|
console.error(
|
|
2099
2111
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -2106,7 +2118,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2106
2118
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2107
2119
|
"button",
|
|
2108
2120
|
{
|
|
2109
|
-
className:
|
|
2121
|
+
className: y(
|
|
2110
2122
|
oe,
|
|
2111
2123
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2112
2124
|
),
|
|
@@ -2114,37 +2126,39 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2114
2126
|
}),
|
|
2115
2127
|
type: "button",
|
|
2116
2128
|
"aria-label": "Back to conversations",
|
|
2117
|
-
children: /* @__PURE__ */ n(
|
|
2129
|
+
children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
|
|
2118
2130
|
}
|
|
2119
2131
|
) }),
|
|
2120
2132
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2121
2133
|
/* @__PURE__ */ n(
|
|
2122
2134
|
ie,
|
|
2123
2135
|
{
|
|
2124
|
-
id: ((
|
|
2136
|
+
id: ((k = p == null ? void 0 : p.user) == null ? void 0 : k.id) || v.id || "unknown",
|
|
2125
2137
|
name: A,
|
|
2126
|
-
image:
|
|
2127
|
-
starred: s &&
|
|
2138
|
+
image: R,
|
|
2139
|
+
starred: s && S,
|
|
2128
2140
|
dmAgentEnabled: a,
|
|
2129
2141
|
size: 48
|
|
2130
2142
|
}
|
|
2131
2143
|
),
|
|
2132
|
-
|
|
2144
|
+
b ? /* @__PURE__ */ h(
|
|
2133
2145
|
"button",
|
|
2134
2146
|
{
|
|
2135
2147
|
type: "button",
|
|
2136
|
-
onClick:
|
|
2148
|
+
onClick: b,
|
|
2137
2149
|
"aria-label": `View details for ${A}`,
|
|
2138
2150
|
className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2139
2151
|
children: [
|
|
2140
2152
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2141
|
-
|
|
2142
|
-
/* @__PURE__ */ n(
|
|
2153
|
+
L && /* @__PURE__ */ n(be, {}),
|
|
2154
|
+
D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D }),
|
|
2155
|
+
/* @__PURE__ */ n(Ge, { className: "size-3 shrink-0", weight: "bold" })
|
|
2143
2156
|
]
|
|
2144
2157
|
}
|
|
2145
2158
|
) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
|
|
2146
2159
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2147
|
-
|
|
2160
|
+
L && /* @__PURE__ */ n(be, {}),
|
|
2161
|
+
D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D })
|
|
2148
2162
|
] }),
|
|
2149
2163
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2150
2164
|
/* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
|
|
@@ -2156,26 +2170,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2156
2170
|
"button",
|
|
2157
2171
|
{
|
|
2158
2172
|
className: oe,
|
|
2159
|
-
onClick:
|
|
2173
|
+
onClick: P,
|
|
2160
2174
|
type: "button",
|
|
2161
|
-
"aria-label":
|
|
2175
|
+
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
2162
2176
|
children: /* @__PURE__ */ n(
|
|
2163
|
-
|
|
2177
|
+
Ve,
|
|
2164
2178
|
{
|
|
2165
|
-
className:
|
|
2166
|
-
"text-yellow-600":
|
|
2167
|
-
"text-black/90": !
|
|
2179
|
+
className: y("size-5", {
|
|
2180
|
+
"text-yellow-600": S,
|
|
2181
|
+
"text-black/90": !S
|
|
2168
2182
|
}),
|
|
2169
|
-
weight:
|
|
2183
|
+
weight: S ? "duotone" : "regular"
|
|
2170
2184
|
}
|
|
2171
2185
|
)
|
|
2172
2186
|
}
|
|
2173
2187
|
),
|
|
2174
|
-
|
|
2175
|
-
|
|
2188
|
+
x && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2189
|
+
zt,
|
|
2176
2190
|
{
|
|
2177
|
-
channel:
|
|
2178
|
-
participant:
|
|
2191
|
+
channel: v,
|
|
2192
|
+
participant: p,
|
|
2179
2193
|
showDeleteConversation: o,
|
|
2180
2194
|
showBlockParticipant: l,
|
|
2181
2195
|
showReportParticipant: d,
|
|
@@ -2185,7 +2199,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2185
2199
|
onBlockParticipantClick: g,
|
|
2186
2200
|
onReportParticipantClick: u,
|
|
2187
2201
|
customChannelActions: f,
|
|
2188
|
-
triggerClassName:
|
|
2202
|
+
triggerClassName: y(oe, "bg-[#F1F0EE]")
|
|
2189
2203
|
}
|
|
2190
2204
|
))
|
|
2191
2205
|
] })
|
|
@@ -2195,44 +2209,46 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2195
2209
|
t && e && /* @__PURE__ */ n(
|
|
2196
2210
|
"button",
|
|
2197
2211
|
{
|
|
2198
|
-
className:
|
|
2212
|
+
className: y(
|
|
2199
2213
|
oe,
|
|
2200
2214
|
"messaging-channel-view-back-button-desktop"
|
|
2201
2215
|
),
|
|
2202
2216
|
type: "button",
|
|
2203
2217
|
onClick: e,
|
|
2204
2218
|
"aria-label": "Back to conversations",
|
|
2205
|
-
children: /* @__PURE__ */ n(
|
|
2219
|
+
children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
|
|
2206
2220
|
}
|
|
2207
2221
|
),
|
|
2208
2222
|
/* @__PURE__ */ n(
|
|
2209
2223
|
ie,
|
|
2210
2224
|
{
|
|
2211
|
-
id: ((
|
|
2225
|
+
id: ((I = p == null ? void 0 : p.user) == null ? void 0 : I.id) || v.id || "unknown",
|
|
2212
2226
|
name: A,
|
|
2213
|
-
image:
|
|
2214
|
-
starred: s &&
|
|
2227
|
+
image: R,
|
|
2228
|
+
starred: s && S,
|
|
2215
2229
|
dmAgentEnabled: a,
|
|
2216
2230
|
size: 48
|
|
2217
2231
|
}
|
|
2218
2232
|
),
|
|
2219
2233
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2220
|
-
|
|
2234
|
+
b ? /* @__PURE__ */ h(
|
|
2221
2235
|
"button",
|
|
2222
2236
|
{
|
|
2223
2237
|
type: "button",
|
|
2224
|
-
onClick:
|
|
2238
|
+
onClick: b,
|
|
2225
2239
|
"aria-label": `View details for ${A}`,
|
|
2226
2240
|
className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2227
2241
|
children: [
|
|
2228
2242
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2229
|
-
|
|
2230
|
-
/* @__PURE__ */ n(
|
|
2243
|
+
L && /* @__PURE__ */ n(be, {}),
|
|
2244
|
+
D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D }),
|
|
2245
|
+
/* @__PURE__ */ n(Ge, { className: "size-4 shrink-0", weight: "bold" })
|
|
2231
2246
|
]
|
|
2232
2247
|
}
|
|
2233
2248
|
) : /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2234
2249
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2235
|
-
|
|
2250
|
+
L && /* @__PURE__ */ n(be, {}),
|
|
2251
|
+
D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D })
|
|
2236
2252
|
] }),
|
|
2237
2253
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2238
2254
|
/* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
|
|
@@ -2245,26 +2261,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2245
2261
|
"button",
|
|
2246
2262
|
{
|
|
2247
2263
|
className: oe,
|
|
2248
|
-
onClick:
|
|
2264
|
+
onClick: P,
|
|
2249
2265
|
type: "button",
|
|
2250
|
-
"aria-label":
|
|
2266
|
+
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
2251
2267
|
children: /* @__PURE__ */ n(
|
|
2252
|
-
|
|
2268
|
+
Ve,
|
|
2253
2269
|
{
|
|
2254
|
-
className:
|
|
2255
|
-
"text-yellow-600":
|
|
2256
|
-
"text-black/90": !
|
|
2270
|
+
className: y("size-6", {
|
|
2271
|
+
"text-yellow-600": S,
|
|
2272
|
+
"text-black/90": !S
|
|
2257
2273
|
}),
|
|
2258
|
-
weight:
|
|
2274
|
+
weight: S ? "duotone" : "regular"
|
|
2259
2275
|
}
|
|
2260
2276
|
)
|
|
2261
2277
|
}
|
|
2262
2278
|
),
|
|
2263
|
-
|
|
2264
|
-
|
|
2279
|
+
x && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2280
|
+
zt,
|
|
2265
2281
|
{
|
|
2266
|
-
channel:
|
|
2267
|
-
participant:
|
|
2282
|
+
channel: v,
|
|
2283
|
+
participant: p,
|
|
2268
2284
|
showDeleteConversation: o,
|
|
2269
2285
|
showBlockParticipant: l,
|
|
2270
2286
|
showReportParticipant: d,
|
|
@@ -2280,7 +2296,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2280
2296
|
] })
|
|
2281
2297
|
] })
|
|
2282
2298
|
] });
|
|
2283
|
-
},
|
|
2299
|
+
}, er = ({
|
|
2284
2300
|
onBack: e,
|
|
2285
2301
|
showBackButton: t,
|
|
2286
2302
|
renderMessageInputActions: s,
|
|
@@ -2295,66 +2311,66 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2295
2311
|
showBlockParticipant: u = !0,
|
|
2296
2312
|
showReportParticipant: f = !0,
|
|
2297
2313
|
composerDisabled: c = !1,
|
|
2298
|
-
composerDisabledReason:
|
|
2299
|
-
showStarButton:
|
|
2300
|
-
chatbotVotingEnabled:
|
|
2301
|
-
renderChannelBanner:
|
|
2302
|
-
renderHeaderTitleBadges:
|
|
2314
|
+
composerDisabledReason: x,
|
|
2315
|
+
showStarButton: b = !1,
|
|
2316
|
+
chatbotVotingEnabled: w = !1,
|
|
2317
|
+
renderChannelBanner: v,
|
|
2318
|
+
renderHeaderTitleBadges: p,
|
|
2303
2319
|
customChannelActions: A,
|
|
2304
|
-
renderChannelActions:
|
|
2305
|
-
renderMessage:
|
|
2306
|
-
dmAgentEnabled:
|
|
2307
|
-
viewerLanguage:
|
|
2320
|
+
renderChannelActions: R,
|
|
2321
|
+
renderMessage: L,
|
|
2322
|
+
dmAgentEnabled: S = !1,
|
|
2323
|
+
viewerLanguage: D,
|
|
2308
2324
|
showChannelInfo: P = !0,
|
|
2309
|
-
onParticipantNameClick:
|
|
2325
|
+
onParticipantNameClick: B
|
|
2310
2326
|
}) => {
|
|
2311
|
-
var
|
|
2312
|
-
const { channel:
|
|
2313
|
-
var q,
|
|
2314
|
-
const
|
|
2315
|
-
return
|
|
2316
|
-
(
|
|
2327
|
+
var $, j, X, K, V, _;
|
|
2328
|
+
const { channel: M } = ce(), N = U.useMemo(() => {
|
|
2329
|
+
var q, Y;
|
|
2330
|
+
const E = (q = M._client) == null ? void 0 : q.userID;
|
|
2331
|
+
return E ? Object.values(((Y = M.state) == null ? void 0 : Y.members) || {}).find(
|
|
2332
|
+
(G) => {
|
|
2317
2333
|
var W;
|
|
2318
|
-
return ((W =
|
|
2334
|
+
return ((W = G.user) == null ? void 0 : W.id) && G.user.id !== E;
|
|
2319
2335
|
}
|
|
2320
2336
|
) : void 0;
|
|
2321
|
-
}, [(
|
|
2322
|
-
var q,
|
|
2323
|
-
const
|
|
2324
|
-
return
|
|
2337
|
+
}, [($ = M._client) == null ? void 0 : $.userID, (j = M.state) == null ? void 0 : j.members]), T = U.useMemo(() => {
|
|
2338
|
+
var q, Y;
|
|
2339
|
+
const E = (q = M._client) == null ? void 0 : q.userID;
|
|
2340
|
+
return E ? Object.values(((Y = M.state) == null ? void 0 : Y.members) || {}).find((G) => {
|
|
2325
2341
|
var W;
|
|
2326
|
-
return ((W =
|
|
2342
|
+
return ((W = G.user) == null ? void 0 : W.id) === E;
|
|
2327
2343
|
}) : void 0;
|
|
2328
|
-
}, [(
|
|
2329
|
-
(
|
|
2330
|
-
const { message:
|
|
2331
|
-
|
|
2344
|
+
}, [(X = M._client) == null ? void 0 : X.userID, (K = M.state) == null ? void 0 : K.members]), k = ((V = T == null ? void 0 : T.user) == null ? void 0 : V.is_account) ?? (T == null ? void 0 : T.is_account), I = ((_ = N == null ? void 0 : N.user) == null ? void 0 : _.is_account) ?? (N == null ? void 0 : N.is_account), C = S && k === !1 && I === !0, O = Z(
|
|
2345
|
+
(E) => {
|
|
2346
|
+
const { message: F } = we("ChannelView"), q = /* @__PURE__ */ n(
|
|
2347
|
+
Ta,
|
|
2332
2348
|
{
|
|
2333
|
-
...
|
|
2334
|
-
chatbotVotingEnabled:
|
|
2335
|
-
viewerLanguage:
|
|
2349
|
+
...E,
|
|
2350
|
+
chatbotVotingEnabled: w,
|
|
2351
|
+
viewerLanguage: D
|
|
2336
2352
|
}
|
|
2337
2353
|
);
|
|
2338
|
-
return !
|
|
2354
|
+
return !L || !F ? q : L(q, F);
|
|
2339
2355
|
},
|
|
2340
|
-
[
|
|
2356
|
+
[w, L, D]
|
|
2341
2357
|
);
|
|
2342
2358
|
return /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(
|
|
2343
|
-
|
|
2359
|
+
cs,
|
|
2344
2360
|
{
|
|
2345
2361
|
overrides: {
|
|
2346
2362
|
Message: O,
|
|
2347
|
-
MessageActions:
|
|
2363
|
+
MessageActions: Ra
|
|
2348
2364
|
},
|
|
2349
|
-
children: /* @__PURE__ */ h(
|
|
2365
|
+
children: /* @__PURE__ */ h(ds, { children: [
|
|
2350
2366
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2351
|
-
|
|
2367
|
+
Qa,
|
|
2352
2368
|
{
|
|
2353
2369
|
onBack: e,
|
|
2354
2370
|
showBackButton: t,
|
|
2355
2371
|
showChannelInfo: P,
|
|
2356
|
-
showStarButton:
|
|
2357
|
-
dmAgentEnabled:
|
|
2372
|
+
showStarButton: b,
|
|
2373
|
+
dmAgentEnabled: C,
|
|
2358
2374
|
onLeaveConversation: i,
|
|
2359
2375
|
onBlockParticipant: o,
|
|
2360
2376
|
showDeleteConversation: l,
|
|
@@ -2364,37 +2380,37 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2364
2380
|
onBlockParticipantClick: m,
|
|
2365
2381
|
onReportParticipantClick: g,
|
|
2366
2382
|
customChannelActions: A,
|
|
2367
|
-
renderChannelActions:
|
|
2368
|
-
onParticipantNameClick:
|
|
2369
|
-
renderHeaderTitleBadges:
|
|
2383
|
+
renderChannelActions: R,
|
|
2384
|
+
onParticipantNameClick: B,
|
|
2385
|
+
renderHeaderTitleBadges: p
|
|
2370
2386
|
}
|
|
2371
2387
|
) }, "lt-channel-header"),
|
|
2372
|
-
|
|
2388
|
+
v ? /* @__PURE__ */ n(U.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
2373
2389
|
/* @__PURE__ */ n(
|
|
2374
2390
|
"div",
|
|
2375
2391
|
{
|
|
2376
2392
|
className: "flex-1 overflow-hidden relative",
|
|
2377
|
-
children: /* @__PURE__ */ n(
|
|
2393
|
+
children: /* @__PURE__ */ n(us, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2378
2394
|
},
|
|
2379
2395
|
"lt-channel-message-list"
|
|
2380
2396
|
),
|
|
2381
|
-
r ? /* @__PURE__ */ n(
|
|
2397
|
+
r ? /* @__PURE__ */ n(U.Fragment, { children: r(M) }, "lt-channel-conversation-footer") : null,
|
|
2382
2398
|
/* @__PURE__ */ n(
|
|
2383
|
-
|
|
2399
|
+
$a,
|
|
2384
2400
|
{
|
|
2385
2401
|
...s && {
|
|
2386
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2402
|
+
renderActions: () => s == null ? void 0 : s(M)
|
|
2387
2403
|
},
|
|
2388
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2404
|
+
renderFooter: () => a == null ? void 0 : a(M),
|
|
2389
2405
|
disabled: c,
|
|
2390
|
-
disabledReason:
|
|
2406
|
+
disabledReason: x
|
|
2391
2407
|
},
|
|
2392
2408
|
"lt-channel-message-input"
|
|
2393
2409
|
)
|
|
2394
2410
|
] })
|
|
2395
2411
|
}
|
|
2396
2412
|
) });
|
|
2397
|
-
},
|
|
2413
|
+
}, mn = U.memo(
|
|
2398
2414
|
({
|
|
2399
2415
|
channel: e,
|
|
2400
2416
|
onBack: t,
|
|
@@ -2405,85 +2421,85 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2405
2421
|
onLeaveConversation: o,
|
|
2406
2422
|
onBlockParticipant: l,
|
|
2407
2423
|
className: d,
|
|
2408
|
-
CustomChannelEmptyState: m =
|
|
2424
|
+
CustomChannelEmptyState: m = Ja,
|
|
2409
2425
|
showDeleteConversation: g = !0,
|
|
2410
2426
|
onDeleteConversationClick: u,
|
|
2411
2427
|
onBlockParticipantClick: f,
|
|
2412
2428
|
onReportParticipantClick: c,
|
|
2413
|
-
showBlockParticipant:
|
|
2414
|
-
showReportParticipant:
|
|
2415
|
-
composerDisabled:
|
|
2416
|
-
composerDisabledReason:
|
|
2417
|
-
dmAgentEnabled:
|
|
2429
|
+
showBlockParticipant: x = !0,
|
|
2430
|
+
showReportParticipant: b = !0,
|
|
2431
|
+
composerDisabled: w = !1,
|
|
2432
|
+
composerDisabledReason: v,
|
|
2433
|
+
dmAgentEnabled: p,
|
|
2418
2434
|
messageMetadata: A,
|
|
2419
|
-
onMessageSent:
|
|
2420
|
-
showStarButton:
|
|
2421
|
-
chatbotVotingEnabled:
|
|
2422
|
-
renderChannelBanner:
|
|
2435
|
+
onMessageSent: R,
|
|
2436
|
+
showStarButton: L = !1,
|
|
2437
|
+
chatbotVotingEnabled: S = !1,
|
|
2438
|
+
renderChannelBanner: D,
|
|
2423
2439
|
renderHeaderTitleBadges: P,
|
|
2424
|
-
customChannelActions:
|
|
2425
|
-
renderChannelActions:
|
|
2426
|
-
renderMessage:
|
|
2427
|
-
onMessageLinkClick:
|
|
2428
|
-
sendButton:
|
|
2440
|
+
customChannelActions: B,
|
|
2441
|
+
renderChannelActions: M,
|
|
2442
|
+
renderMessage: N,
|
|
2443
|
+
onMessageLinkClick: T,
|
|
2444
|
+
sendButton: k,
|
|
2429
2445
|
attachmentPreviewList: I,
|
|
2430
|
-
viewerLanguage:
|
|
2446
|
+
viewerLanguage: C,
|
|
2431
2447
|
showChannelInfo: O = !0,
|
|
2432
|
-
onParticipantNameClick:
|
|
2448
|
+
onParticipantNameClick: $
|
|
2433
2449
|
}) => {
|
|
2434
|
-
const
|
|
2435
|
-
async (
|
|
2450
|
+
const j = Z(
|
|
2451
|
+
async (K, V, _) => {
|
|
2436
2452
|
var W;
|
|
2437
|
-
const
|
|
2438
|
-
...
|
|
2439
|
-
...
|
|
2453
|
+
const E = ((W = e.data) == null ? void 0 : W.chatbot_paused) === !0, F = p && !E, q = {
|
|
2454
|
+
...V,
|
|
2455
|
+
...F && { silent: !0 },
|
|
2440
2456
|
...A && {
|
|
2441
2457
|
metadata: {
|
|
2442
|
-
...
|
|
2458
|
+
...V.metadata ?? {},
|
|
2443
2459
|
...A
|
|
2444
2460
|
}
|
|
2445
2461
|
}
|
|
2446
|
-
},
|
|
2447
|
-
...
|
|
2448
|
-
...
|
|
2449
|
-
},
|
|
2450
|
-
return
|
|
2462
|
+
}, Y = {
|
|
2463
|
+
..._,
|
|
2464
|
+
...F && { skip_push: !0 }
|
|
2465
|
+
}, G = await e.sendMessage(q, Y);
|
|
2466
|
+
return R == null || R(G), G;
|
|
2451
2467
|
},
|
|
2452
|
-
[e,
|
|
2453
|
-
),
|
|
2454
|
-
return
|
|
2455
|
-
if (!
|
|
2456
|
-
const
|
|
2457
|
-
if (!
|
|
2458
|
-
const
|
|
2459
|
-
const
|
|
2468
|
+
[e, p, A, R]
|
|
2469
|
+
), X = H(null);
|
|
2470
|
+
return J(() => {
|
|
2471
|
+
if (!T) return;
|
|
2472
|
+
const K = X.current;
|
|
2473
|
+
if (!K) return;
|
|
2474
|
+
const V = (_) => {
|
|
2475
|
+
const E = _.target, F = E == null ? void 0 : E.closest("a[href]"), q = F == null ? void 0 : F.getAttribute("href");
|
|
2460
2476
|
if (!q) return;
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2477
|
+
const Y = F == null ? void 0 : F.closest("[data-message-id]"), G = Y == null ? void 0 : Y.getAttribute("data-message-id"), W = G ? e.state.messages.find((de) => de.id === G) : void 0;
|
|
2478
|
+
T(q, W);
|
|
2463
2479
|
};
|
|
2464
|
-
return
|
|
2465
|
-
}, [
|
|
2480
|
+
return K.addEventListener("click", V), () => K.removeEventListener("click", V);
|
|
2481
|
+
}, [T, e]), /* @__PURE__ */ n(
|
|
2466
2482
|
"div",
|
|
2467
2483
|
{
|
|
2468
|
-
ref:
|
|
2469
|
-
className:
|
|
2484
|
+
ref: X,
|
|
2485
|
+
className: y(
|
|
2470
2486
|
"messaging-channel-view h-full flex flex-col",
|
|
2471
2487
|
d
|
|
2472
2488
|
),
|
|
2473
|
-
children: /* @__PURE__ */ n(
|
|
2474
|
-
|
|
2489
|
+
children: /* @__PURE__ */ n(un.Provider, { value: p ?? !1, children: /* @__PURE__ */ n(
|
|
2490
|
+
ls,
|
|
2475
2491
|
{
|
|
2476
2492
|
channel: e,
|
|
2477
|
-
MessageSystem:
|
|
2493
|
+
MessageSystem: qa,
|
|
2478
2494
|
EmptyStateIndicator: m,
|
|
2479
|
-
LoadingIndicator:
|
|
2480
|
-
DateSeparator:
|
|
2481
|
-
TypingIndicator:
|
|
2482
|
-
doSendMessageRequest:
|
|
2483
|
-
...
|
|
2495
|
+
LoadingIndicator: Ie,
|
|
2496
|
+
DateSeparator: Hs,
|
|
2497
|
+
TypingIndicator: Xa,
|
|
2498
|
+
doSendMessageRequest: j,
|
|
2499
|
+
...k ? { SendButton: k } : {},
|
|
2484
2500
|
...I ? { AttachmentPreviewList: I } : {},
|
|
2485
2501
|
children: /* @__PURE__ */ n(
|
|
2486
|
-
|
|
2502
|
+
er,
|
|
2487
2503
|
{
|
|
2488
2504
|
onBack: t,
|
|
2489
2505
|
showBackButton: s,
|
|
@@ -2497,21 +2513,21 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2497
2513
|
onDeleteConversationClick: u,
|
|
2498
2514
|
onBlockParticipantClick: f,
|
|
2499
2515
|
onReportParticipantClick: c,
|
|
2500
|
-
showBlockParticipant:
|
|
2501
|
-
showReportParticipant:
|
|
2502
|
-
composerDisabled:
|
|
2503
|
-
composerDisabledReason:
|
|
2504
|
-
showStarButton:
|
|
2505
|
-
dmAgentEnabled:
|
|
2506
|
-
chatbotVotingEnabled:
|
|
2507
|
-
renderChannelBanner:
|
|
2516
|
+
showBlockParticipant: x,
|
|
2517
|
+
showReportParticipant: b,
|
|
2518
|
+
composerDisabled: w,
|
|
2519
|
+
composerDisabledReason: v,
|
|
2520
|
+
showStarButton: L,
|
|
2521
|
+
dmAgentEnabled: p,
|
|
2522
|
+
chatbotVotingEnabled: S,
|
|
2523
|
+
renderChannelBanner: D,
|
|
2508
2524
|
renderHeaderTitleBadges: P,
|
|
2509
|
-
customChannelActions:
|
|
2510
|
-
renderChannelActions:
|
|
2511
|
-
renderMessage:
|
|
2512
|
-
viewerLanguage:
|
|
2525
|
+
customChannelActions: B,
|
|
2526
|
+
renderChannelActions: M,
|
|
2527
|
+
renderMessage: N,
|
|
2528
|
+
viewerLanguage: C,
|
|
2513
2529
|
showChannelInfo: O,
|
|
2514
|
-
onParticipantNameClick:
|
|
2530
|
+
onParticipantNameClick: $
|
|
2515
2531
|
}
|
|
2516
2532
|
)
|
|
2517
2533
|
}
|
|
@@ -2520,8 +2536,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2520
2536
|
);
|
|
2521
2537
|
}
|
|
2522
2538
|
);
|
|
2523
|
-
|
|
2524
|
-
const
|
|
2539
|
+
mn.displayName = "ChannelView";
|
|
2540
|
+
const pe = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2525
2541
|
/* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2526
2542
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2527
2543
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2535,8 +2551,8 @@ const be = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2535
2551
|
}
|
|
2536
2552
|
)
|
|
2537
2553
|
] }) }));
|
|
2538
|
-
|
|
2539
|
-
const
|
|
2554
|
+
pe.displayName = "ErrorState";
|
|
2555
|
+
const Si = ({
|
|
2540
2556
|
capabilities: e = {},
|
|
2541
2557
|
renderMessageInputActions: t,
|
|
2542
2558
|
renderConversationFooter: s,
|
|
@@ -2551,77 +2567,77 @@ const ki = ({
|
|
|
2551
2567
|
onMessageSent: u,
|
|
2552
2568
|
chatbotVotingEnabled: f = !1,
|
|
2553
2569
|
viewerLanguage: c,
|
|
2554
|
-
renderHeaderTitleBadges:
|
|
2555
|
-
renderChannelBanner:
|
|
2556
|
-
customChannelActions:
|
|
2557
|
-
renderChannelActions:
|
|
2558
|
-
onParticipantNameClick:
|
|
2570
|
+
renderHeaderTitleBadges: x,
|
|
2571
|
+
renderChannelBanner: b,
|
|
2572
|
+
customChannelActions: w,
|
|
2573
|
+
renderChannelActions: v,
|
|
2574
|
+
onParticipantNameClick: p,
|
|
2559
2575
|
renderMessage: A,
|
|
2560
|
-
onMessageLinkClick:
|
|
2561
|
-
showChannelInfo:
|
|
2576
|
+
onMessageLinkClick: R,
|
|
2577
|
+
showChannelInfo: L
|
|
2562
2578
|
}) => {
|
|
2563
2579
|
const {
|
|
2564
|
-
client:
|
|
2565
|
-
isConnected:
|
|
2580
|
+
client: S,
|
|
2581
|
+
isConnected: D,
|
|
2566
2582
|
isLoading: P,
|
|
2567
|
-
error:
|
|
2568
|
-
refreshConnection:
|
|
2569
|
-
service:
|
|
2570
|
-
debug:
|
|
2571
|
-
} =
|
|
2572
|
-
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2575
|
-
const
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
}, [
|
|
2579
|
-
if (!
|
|
2580
|
-
const
|
|
2581
|
-
if (!
|
|
2582
|
-
const
|
|
2583
|
-
if (
|
|
2584
|
-
|
|
2583
|
+
error: B,
|
|
2584
|
+
refreshConnection: M,
|
|
2585
|
+
service: N,
|
|
2586
|
+
debug: T
|
|
2587
|
+
} = $s(), [k, I] = z(null), [C, O] = z(null), [$, j] = z(!1), { showDeleteConversation: X = !0 } = e, K = H(o);
|
|
2588
|
+
K.current = o;
|
|
2589
|
+
const V = H(a);
|
|
2590
|
+
V.current = a;
|
|
2591
|
+
const _ = H(null), E = H(null);
|
|
2592
|
+
J(() => {
|
|
2593
|
+
E.current = k;
|
|
2594
|
+
}, [k]), J(() => {
|
|
2595
|
+
if (!S || !D) return;
|
|
2596
|
+
const Y = S.userID;
|
|
2597
|
+
if (!Y) return;
|
|
2598
|
+
const G = `${Y}::${i}`;
|
|
2599
|
+
if (_.current === G) return;
|
|
2600
|
+
_.current = G;
|
|
2585
2601
|
const W = () => {
|
|
2586
|
-
|
|
2602
|
+
_.current === G && (_.current = null);
|
|
2587
2603
|
};
|
|
2588
2604
|
(async () => {
|
|
2589
2605
|
var ue, me;
|
|
2590
2606
|
try {
|
|
2591
|
-
|
|
2607
|
+
T && console.log(
|
|
2592
2608
|
"[MessagingShell] Loading initial conversation with:",
|
|
2593
2609
|
i
|
|
2594
2610
|
);
|
|
2595
|
-
const te = await
|
|
2611
|
+
const te = await S.queryChannels(
|
|
2596
2612
|
{
|
|
2597
2613
|
type: "messaging",
|
|
2598
|
-
members: { $eq: [
|
|
2614
|
+
members: { $eq: [Y, i] }
|
|
2599
2615
|
},
|
|
2600
2616
|
{},
|
|
2601
2617
|
{ limit: 1 }
|
|
2602
2618
|
);
|
|
2603
2619
|
if (te.length > 0) {
|
|
2604
|
-
I(te[0]), O(null), (ue =
|
|
2620
|
+
I(te[0]), O(null), (ue = V.current) == null || ue.call(V, te[0]), T && console.log(
|
|
2605
2621
|
"[MessagingShell] Initial conversation loaded:",
|
|
2606
2622
|
te[0].id
|
|
2607
2623
|
);
|
|
2608
2624
|
return;
|
|
2609
2625
|
}
|
|
2610
|
-
const Q =
|
|
2611
|
-
if (!Q || !
|
|
2612
|
-
W(), O("No conversation found with this account"),
|
|
2626
|
+
const Q = K.current;
|
|
2627
|
+
if (!Q || !N) {
|
|
2628
|
+
W(), O("No conversation found with this account"), T && console.log(
|
|
2613
2629
|
"[MessagingShell] No conversation found for:",
|
|
2614
2630
|
i
|
|
2615
2631
|
);
|
|
2616
2632
|
return;
|
|
2617
2633
|
}
|
|
2618
2634
|
try {
|
|
2619
|
-
const ee = await
|
|
2635
|
+
const ee = await N.startChannelWithParticipant({
|
|
2620
2636
|
id: Q.id,
|
|
2621
2637
|
name: Q.name,
|
|
2622
2638
|
phone: Q.phone
|
|
2623
2639
|
});
|
|
2624
|
-
I(ee), O(null), (me =
|
|
2640
|
+
I(ee), O(null), (me = V.current) == null || me.call(V, ee), T && console.log(
|
|
2625
2641
|
"[MessagingShell] Channel created and loaded:",
|
|
2626
2642
|
ee.id
|
|
2627
2643
|
);
|
|
@@ -2635,75 +2651,75 @@ const ki = ({
|
|
|
2635
2651
|
console.error(
|
|
2636
2652
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2637
2653
|
te
|
|
2638
|
-
), W(),
|
|
2654
|
+
), W(), E.current || O("Failed to load conversation");
|
|
2639
2655
|
}
|
|
2640
2656
|
})();
|
|
2641
|
-
}, [i,
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2644
|
-
const q =
|
|
2645
|
-
var
|
|
2646
|
-
I(null),
|
|
2657
|
+
}, [i, S, D, N, T]);
|
|
2658
|
+
const F = H(r);
|
|
2659
|
+
F.current = r;
|
|
2660
|
+
const q = Z(() => {
|
|
2661
|
+
var Y;
|
|
2662
|
+
I(null), j(!0), (Y = F.current) == null || Y.call(F);
|
|
2647
2663
|
}, []);
|
|
2648
|
-
return P ? /* @__PURE__ */ n(
|
|
2649
|
-
|
|
2664
|
+
return P ? /* @__PURE__ */ n(Ie, {}) : B ? /* @__PURE__ */ n(pe, { message: B, onBack: M }) : !D || !S ? /* @__PURE__ */ n(
|
|
2665
|
+
pe,
|
|
2650
2666
|
{
|
|
2651
2667
|
message: "Not connected to messaging service",
|
|
2652
|
-
onBack:
|
|
2668
|
+
onBack: M
|
|
2653
2669
|
}
|
|
2654
|
-
) :
|
|
2655
|
-
|
|
2670
|
+
) : C ? /* @__PURE__ */ n(pe, { message: C }) : $ && !k ? /* @__PURE__ */ n(pe, { message: "Conversation ended" }) : k ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2671
|
+
mn,
|
|
2656
2672
|
{
|
|
2657
|
-
channel:
|
|
2673
|
+
channel: k,
|
|
2658
2674
|
renderMessageInputActions: t,
|
|
2659
2675
|
renderConversationFooter: s,
|
|
2660
|
-
renderChannelBanner:
|
|
2676
|
+
renderChannelBanner: b,
|
|
2661
2677
|
onLeaveConversation: q,
|
|
2662
2678
|
onBlockParticipant: q,
|
|
2663
2679
|
CustomChannelEmptyState: l,
|
|
2664
|
-
showDeleteConversation:
|
|
2680
|
+
showDeleteConversation: X,
|
|
2665
2681
|
onBlockParticipantClick: d,
|
|
2666
2682
|
onReportParticipantClick: m,
|
|
2667
2683
|
dmAgentEnabled: g,
|
|
2668
2684
|
onMessageSent: u,
|
|
2669
2685
|
chatbotVotingEnabled: f,
|
|
2670
2686
|
viewerLanguage: c,
|
|
2671
|
-
renderHeaderTitleBadges:
|
|
2672
|
-
customChannelActions:
|
|
2673
|
-
renderChannelActions:
|
|
2674
|
-
onParticipantNameClick:
|
|
2687
|
+
renderHeaderTitleBadges: x,
|
|
2688
|
+
customChannelActions: w,
|
|
2689
|
+
renderChannelActions: v,
|
|
2690
|
+
onParticipantNameClick: p,
|
|
2675
2691
|
renderMessage: A,
|
|
2676
|
-
onMessageLinkClick:
|
|
2677
|
-
showChannelInfo:
|
|
2692
|
+
onMessageLinkClick: R,
|
|
2693
|
+
showChannelInfo: L
|
|
2678
2694
|
},
|
|
2679
|
-
|
|
2680
|
-
) }) }) : /* @__PURE__ */ n(
|
|
2695
|
+
k.id
|
|
2696
|
+
) }) }) : /* @__PURE__ */ n(Ie, {});
|
|
2681
2697
|
};
|
|
2682
|
-
function
|
|
2698
|
+
function tr(e) {
|
|
2683
2699
|
const t = e.state.pending_messages;
|
|
2684
2700
|
if (t != null && t.length)
|
|
2685
2701
|
for (const s of t)
|
|
2686
2702
|
e.state.addMessageSorted(s.message);
|
|
2687
2703
|
}
|
|
2688
|
-
const
|
|
2704
|
+
const hn = U.createContext({
|
|
2689
2705
|
selectedChannel: void 0,
|
|
2690
2706
|
onChannelSelect: () => {
|
|
2691
2707
|
},
|
|
2692
2708
|
debug: !1,
|
|
2693
2709
|
renderMessagePreview: void 0,
|
|
2694
2710
|
viewerLanguage: void 0
|
|
2695
|
-
}),
|
|
2711
|
+
}), nr = hn.Provider, sr = () => U.useContext(hn), ar = (e, t) => {
|
|
2696
2712
|
const s = new Date(
|
|
2697
2713
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2698
2714
|
), r = new Date(
|
|
2699
2715
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2700
2716
|
).getTime() - s.getTime();
|
|
2701
2717
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2702
|
-
},
|
|
2718
|
+
}, rr = (e) => {
|
|
2703
2719
|
const t = /* @__PURE__ */ new Date();
|
|
2704
2720
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2705
2721
|
return "Just now";
|
|
2706
|
-
const a =
|
|
2722
|
+
const a = ar(e, t);
|
|
2707
2723
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2708
2724
|
hour: "numeric",
|
|
2709
2725
|
minute: "2-digit",
|
|
@@ -2713,50 +2729,50 @@ const mn = j.createContext({
|
|
|
2713
2729
|
day: "numeric",
|
|
2714
2730
|
year: "2-digit"
|
|
2715
2731
|
});
|
|
2716
|
-
},
|
|
2732
|
+
}, fn = U.memo(
|
|
2717
2733
|
({ channel: e, unread: t }) => {
|
|
2718
|
-
var
|
|
2734
|
+
var D, P, B, M;
|
|
2719
2735
|
const {
|
|
2720
2736
|
selectedChannel: s,
|
|
2721
2737
|
onChannelSelect: a,
|
|
2722
2738
|
debug: r,
|
|
2723
2739
|
renderMessagePreview: i,
|
|
2724
2740
|
viewerLanguage: o
|
|
2725
|
-
} =
|
|
2741
|
+
} = sr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2726
2742
|
e && a(e);
|
|
2727
|
-
}, m = (
|
|
2728
|
-
const
|
|
2729
|
-
!
|
|
2730
|
-
}, u = Object.values(((
|
|
2731
|
-
(
|
|
2732
|
-
var
|
|
2733
|
-
return ((
|
|
2743
|
+
}, m = (N) => {
|
|
2744
|
+
const T = N.key === "Enter" || N.key === " ", k = N.repeat;
|
|
2745
|
+
!T || k || (N.preventDefault(), d());
|
|
2746
|
+
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
2747
|
+
(N) => {
|
|
2748
|
+
var T, k;
|
|
2749
|
+
return ((T = N.user) == null ? void 0 : T.id) && N.user.id !== ((k = e == null ? void 0 : e._client) == null ? void 0 : k.userID);
|
|
2734
2750
|
}
|
|
2735
|
-
), f =
|
|
2736
|
-
var
|
|
2737
|
-
const
|
|
2738
|
-
if (
|
|
2739
|
-
for (let
|
|
2740
|
-
if (
|
|
2751
|
+
), f = Kt(u == null ? void 0 : u.user), c = (P = u == null ? void 0 : u.user) == null ? void 0 : P.image, x = ((B = u == null ? void 0 : u.user) == null ? void 0 : B.is_verified) === !0, b = (() => {
|
|
2752
|
+
var T;
|
|
2753
|
+
const N = (T = e == null ? void 0 : e.state) == null ? void 0 : T.messages;
|
|
2754
|
+
if (N != null && N.length) {
|
|
2755
|
+
for (let k = N.length - 1; k >= 0; k--)
|
|
2756
|
+
if (N[k].type !== "system") return N[k];
|
|
2741
2757
|
}
|
|
2742
2758
|
})(), v = (() => {
|
|
2743
|
-
var
|
|
2744
|
-
const
|
|
2759
|
+
var O, $, j, X;
|
|
2760
|
+
const N = Jt({
|
|
2745
2761
|
message: b,
|
|
2746
2762
|
viewerLanguage: o
|
|
2747
2763
|
});
|
|
2748
|
-
if (((
|
|
2749
|
-
if (((
|
|
2750
|
-
if (((
|
|
2751
|
-
if (
|
|
2752
|
-
const C = (
|
|
2764
|
+
if (((O = b == null ? void 0 : b.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
|
|
2765
|
+
if ((($ = b == null ? void 0 : b.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
|
|
2766
|
+
if (((j = b == null ? void 0 : b.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
|
|
2767
|
+
if (N) return N;
|
|
2768
|
+
const C = (X = b == null ? void 0 : b.attachments) == null ? void 0 : X[0];
|
|
2753
2769
|
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2754
|
-
})(), p = b != null && b.created_at ?
|
|
2770
|
+
})(), p = b != null && b.created_at ? rr(new Date(b.created_at)) : "", A = b ? Se(b) : !1, R = i ? i(b, v) : `${A ? "✨ " : ""}${v}`, L = Xt(e), S = t ?? 0;
|
|
2755
2771
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2756
2772
|
channelId: e == null ? void 0 : e.id,
|
|
2757
2773
|
isSelected: l,
|
|
2758
2774
|
participantName: f,
|
|
2759
|
-
unreadCount:
|
|
2775
|
+
unreadCount: S,
|
|
2760
2776
|
hasTimestamp: !!p
|
|
2761
2777
|
}), /* @__PURE__ */ n(
|
|
2762
2778
|
"div",
|
|
@@ -2765,7 +2781,7 @@ const mn = j.createContext({
|
|
|
2765
2781
|
tabIndex: 0,
|
|
2766
2782
|
onClick: d,
|
|
2767
2783
|
onKeyDown: m,
|
|
2768
|
-
className:
|
|
2784
|
+
className: y(
|
|
2769
2785
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2770
2786
|
{
|
|
2771
2787
|
"bg-black/[0.04]": l,
|
|
@@ -2776,32 +2792,25 @@ const mn = j.createContext({
|
|
|
2776
2792
|
/* @__PURE__ */ n(
|
|
2777
2793
|
ie,
|
|
2778
2794
|
{
|
|
2779
|
-
id: ((
|
|
2795
|
+
id: ((M = u == null ? void 0 : u.user) == null ? void 0 : M.id) || e.id || "unknown",
|
|
2780
2796
|
name: f,
|
|
2781
2797
|
image: c,
|
|
2782
2798
|
size: 48,
|
|
2783
|
-
starred:
|
|
2799
|
+
starred: L
|
|
2784
2800
|
}
|
|
2785
2801
|
),
|
|
2786
2802
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
2787
2803
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2788
|
-
/* @__PURE__ */ h(
|
|
2789
|
-
"
|
|
2790
|
-
{
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
),
|
|
2794
|
-
children: [
|
|
2795
|
-
M && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2796
|
-
f
|
|
2797
|
-
]
|
|
2798
|
-
}
|
|
2799
|
-
),
|
|
2804
|
+
/* @__PURE__ */ h("h3", { className: "flex min-w-0 items-center gap-1 text-sm font-medium text-[#191918]", children: [
|
|
2805
|
+
L && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2806
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: f }),
|
|
2807
|
+
x && /* @__PURE__ */ n(be, {})
|
|
2808
|
+
] }),
|
|
2800
2809
|
p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
|
|
2801
2810
|
] }),
|
|
2802
2811
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2803
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2804
|
-
|
|
2812
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
|
|
2813
|
+
S > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: S > 99 ? "99+" : S })
|
|
2805
2814
|
] })
|
|
2806
2815
|
] })
|
|
2807
2816
|
] })
|
|
@@ -2809,27 +2818,27 @@ const mn = j.createContext({
|
|
|
2809
2818
|
);
|
|
2810
2819
|
}
|
|
2811
2820
|
);
|
|
2812
|
-
|
|
2813
|
-
const
|
|
2821
|
+
fn.displayName = "CustomChannelPreview";
|
|
2822
|
+
const ir = { last_message_at: -1 }, or = U.memo(
|
|
2814
2823
|
({
|
|
2815
2824
|
onChannelSelect: e,
|
|
2816
2825
|
selectedChannel: t,
|
|
2817
2826
|
filters: s,
|
|
2818
2827
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2819
2828
|
channelRenderFilterFn: r,
|
|
2820
|
-
sort: i =
|
|
2829
|
+
sort: i = ir,
|
|
2821
2830
|
className: o,
|
|
2822
2831
|
customEmptyStateIndicator: l,
|
|
2823
2832
|
renderMessagePreview: d,
|
|
2824
2833
|
viewerLanguage: m
|
|
2825
2834
|
}) => {
|
|
2826
|
-
const g =
|
|
2835
|
+
const g = U.useRef(0);
|
|
2827
2836
|
g.current++;
|
|
2828
|
-
const { debug: u = !1 } =
|
|
2829
|
-
(
|
|
2830
|
-
for (const
|
|
2831
|
-
|
|
2832
|
-
return r ? r(
|
|
2837
|
+
const { debug: u = !1 } = Ke(), f = U.useCallback(
|
|
2838
|
+
(x) => {
|
|
2839
|
+
for (const b of x)
|
|
2840
|
+
tr(b);
|
|
2841
|
+
return r ? r(x) : x;
|
|
2833
2842
|
},
|
|
2834
2843
|
[r]
|
|
2835
2844
|
);
|
|
@@ -2838,7 +2847,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2838
2847
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2839
2848
|
filters: s
|
|
2840
2849
|
});
|
|
2841
|
-
const c =
|
|
2850
|
+
const c = U.useMemo(
|
|
2842
2851
|
() => ({
|
|
2843
2852
|
selectedChannel: t,
|
|
2844
2853
|
onChannelSelect: e,
|
|
@@ -2857,20 +2866,20 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2857
2866
|
return /* @__PURE__ */ n(
|
|
2858
2867
|
"div",
|
|
2859
2868
|
{
|
|
2860
|
-
className:
|
|
2869
|
+
className: y(
|
|
2861
2870
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2862
2871
|
o
|
|
2863
2872
|
),
|
|
2864
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2865
|
-
|
|
2873
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(nr, { value: c, children: /* @__PURE__ */ n(
|
|
2874
|
+
ms,
|
|
2866
2875
|
{
|
|
2867
2876
|
filters: s,
|
|
2868
2877
|
sort: i,
|
|
2869
2878
|
options: { limit: 30 },
|
|
2870
2879
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2871
2880
|
channelRenderFilterFn: f,
|
|
2872
|
-
Paginator:
|
|
2873
|
-
Preview:
|
|
2881
|
+
Paginator: hs,
|
|
2882
|
+
Preview: fn,
|
|
2874
2883
|
EmptyStateIndicator: l
|
|
2875
2884
|
},
|
|
2876
2885
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
@@ -2879,27 +2888,27 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2879
2888
|
);
|
|
2880
2889
|
}
|
|
2881
2890
|
);
|
|
2882
|
-
|
|
2883
|
-
const
|
|
2884
|
-
function
|
|
2891
|
+
or.displayName = "ChannelList";
|
|
2892
|
+
const lr = /^([a-z][a-z0-9+.-]*):/i, cr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2893
|
+
function nt(e) {
|
|
2885
2894
|
if (typeof e != "string") return;
|
|
2886
2895
|
const t = e.trim();
|
|
2887
2896
|
if (t === "") return;
|
|
2888
|
-
const s =
|
|
2897
|
+
const s = lr.exec(t);
|
|
2889
2898
|
if (s) {
|
|
2890
2899
|
const a = s[1].toLowerCase();
|
|
2891
|
-
return
|
|
2900
|
+
return cr.has(a) ? t : void 0;
|
|
2892
2901
|
}
|
|
2893
2902
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2894
2903
|
}
|
|
2895
|
-
const
|
|
2904
|
+
const dr = {
|
|
2896
2905
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2897
2906
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2898
|
-
},
|
|
2899
|
-
const s =
|
|
2907
|
+
}, ur = ({ variant: e, cta: t }) => {
|
|
2908
|
+
const s = y(
|
|
2900
2909
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2901
|
-
|
|
2902
|
-
), a =
|
|
2910
|
+
dr[e]
|
|
2911
|
+
), a = nt(t.href);
|
|
2903
2912
|
return a ? /* @__PURE__ */ n(
|
|
2904
2913
|
"a",
|
|
2905
2914
|
{
|
|
@@ -2925,13 +2934,13 @@ const lr = {
|
|
|
2925
2934
|
children: t.label
|
|
2926
2935
|
}
|
|
2927
2936
|
);
|
|
2928
|
-
},
|
|
2937
|
+
}, mr = {
|
|
2929
2938
|
dark: "text-white",
|
|
2930
2939
|
light: "text-black/90"
|
|
2931
|
-
},
|
|
2940
|
+
}, hr = "text-white/30", fr = {
|
|
2932
2941
|
dark: "text-white/55",
|
|
2933
2942
|
light: "text-black/55"
|
|
2934
|
-
},
|
|
2943
|
+
}, st = ({
|
|
2935
2944
|
variant: e,
|
|
2936
2945
|
title: t,
|
|
2937
2946
|
placeholderTitle: s,
|
|
@@ -2941,14 +2950,14 @@ const lr = {
|
|
|
2941
2950
|
cta: o,
|
|
2942
2951
|
trailingAction: l
|
|
2943
2952
|
}) => {
|
|
2944
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
2945
|
-
if (!g && !u && !c && !
|
|
2946
|
-
const
|
|
2953
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", x = o != null;
|
|
2954
|
+
if (!g && !u && !c && !x) return null;
|
|
2955
|
+
const w = y(
|
|
2947
2956
|
"truncate text-base font-medium leading-6",
|
|
2948
|
-
d && !t ?
|
|
2949
|
-
),
|
|
2957
|
+
d && !t ? hr : mr[e]
|
|
2958
|
+
), v = y(
|
|
2950
2959
|
"truncate text-xs leading-4",
|
|
2951
|
-
|
|
2960
|
+
fr[e]
|
|
2952
2961
|
);
|
|
2953
2962
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2954
2963
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2956,24 +2965,24 @@ const lr = {
|
|
|
2956
2965
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2957
2966
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2958
2967
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2959
|
-
/* @__PURE__ */ n("p", { className:
|
|
2968
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", w), children: m })
|
|
2960
2969
|
] }),
|
|
2961
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2970
|
+
u && /* @__PURE__ */ n("p", { className: v, children: a })
|
|
2962
2971
|
] }),
|
|
2963
|
-
!
|
|
2972
|
+
!x && c && /* @__PURE__ */ n("p", { className: v, children: f })
|
|
2964
2973
|
] }),
|
|
2965
2974
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2966
2975
|
] }),
|
|
2967
|
-
o && /* @__PURE__ */ n(
|
|
2976
|
+
o && /* @__PURE__ */ n(ur, { variant: e, cta: o })
|
|
2968
2977
|
] });
|
|
2969
|
-
},
|
|
2978
|
+
}, gr = y(
|
|
2970
2979
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2971
2980
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2972
2981
|
// the messaging design system's "small border around link attachments"
|
|
2973
2982
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2974
2983
|
"border border-black/[0.08]",
|
|
2975
2984
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2976
|
-
),
|
|
2985
|
+
), Te = ({
|
|
2977
2986
|
variant: e,
|
|
2978
2987
|
children: t,
|
|
2979
2988
|
href: s,
|
|
@@ -2984,8 +2993,8 @@ const lr = {
|
|
|
2984
2993
|
bgClassName: l,
|
|
2985
2994
|
"data-testid": d
|
|
2986
2995
|
}) => {
|
|
2987
|
-
const m = s != null || a != null, g =
|
|
2988
|
-
|
|
2996
|
+
const m = s != null || a != null, g = y(
|
|
2997
|
+
gr,
|
|
2989
2998
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2990
2999
|
// `focus-ring` is a design-system utility from the component-library
|
|
2991
3000
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -3015,7 +3024,7 @@ const lr = {
|
|
|
3015
3024
|
onClick: a,
|
|
3016
3025
|
"aria-label": r,
|
|
3017
3026
|
"data-testid": d,
|
|
3018
|
-
className:
|
|
3027
|
+
className: y(g, "text-left"),
|
|
3019
3028
|
children: [
|
|
3020
3029
|
t,
|
|
3021
3030
|
u
|
|
@@ -3033,17 +3042,17 @@ const lr = {
|
|
|
3033
3042
|
]
|
|
3034
3043
|
}
|
|
3035
3044
|
);
|
|
3036
|
-
},
|
|
3045
|
+
}, br = {
|
|
3037
3046
|
dark: "bg-white/10",
|
|
3038
3047
|
light: "bg-black/5"
|
|
3039
|
-
},
|
|
3048
|
+
}, pr = {
|
|
3040
3049
|
dark: "size-16 text-white/25",
|
|
3041
3050
|
light: "size-16 text-black/25"
|
|
3042
|
-
},
|
|
3051
|
+
}, Le = (e, t) => !!t && !!e && re(e) === "audio", gn = (e, t) => {
|
|
3043
3052
|
if (!t || !e) return !1;
|
|
3044
3053
|
const s = re(e);
|
|
3045
3054
|
return s === "video" || s === "audio";
|
|
3046
|
-
},
|
|
3055
|
+
}, at = "bg-[#F2F3F4]", Ae = ({
|
|
3047
3056
|
variant: e,
|
|
3048
3057
|
thumbnailUrl: t,
|
|
3049
3058
|
sourceUrl: s,
|
|
@@ -3053,7 +3062,7 @@ const lr = {
|
|
|
3053
3062
|
topRight: o
|
|
3054
3063
|
}) => {
|
|
3055
3064
|
const l = re(r), d = !!s && l === "video";
|
|
3056
|
-
return
|
|
3065
|
+
return Le(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3057
3066
|
"audio",
|
|
3058
3067
|
{
|
|
3059
3068
|
src: s,
|
|
@@ -3065,7 +3074,7 @@ const lr = {
|
|
|
3065
3074
|
) }) : /* @__PURE__ */ h(
|
|
3066
3075
|
"div",
|
|
3067
3076
|
{
|
|
3068
|
-
className:
|
|
3077
|
+
className: y(
|
|
3069
3078
|
"relative h-[180px] w-full overflow-hidden",
|
|
3070
3079
|
d && "bg-black"
|
|
3071
3080
|
),
|
|
@@ -3092,12 +3101,12 @@ const lr = {
|
|
|
3092
3101
|
) : /* @__PURE__ */ n(
|
|
3093
3102
|
"div",
|
|
3094
3103
|
{
|
|
3095
|
-
className:
|
|
3104
|
+
className: y(
|
|
3096
3105
|
"flex h-full w-full items-center justify-center",
|
|
3097
|
-
|
|
3106
|
+
br[e]
|
|
3098
3107
|
),
|
|
3099
3108
|
children: le(r, {
|
|
3100
|
-
className:
|
|
3109
|
+
className: pr[e],
|
|
3101
3110
|
weight: "regular"
|
|
3102
3111
|
})
|
|
3103
3112
|
}
|
|
@@ -3107,7 +3116,7 @@ const lr = {
|
|
|
3107
3116
|
]
|
|
3108
3117
|
}
|
|
3109
3118
|
);
|
|
3110
|
-
},
|
|
3119
|
+
}, vr = ({
|
|
3111
3120
|
title: e,
|
|
3112
3121
|
placeholderTitle: t,
|
|
3113
3122
|
description: s,
|
|
@@ -3121,28 +3130,28 @@ const lr = {
|
|
|
3121
3130
|
onDismiss: g,
|
|
3122
3131
|
onEditClick: u
|
|
3123
3132
|
}) => {
|
|
3124
|
-
const f = l === "classic", c =
|
|
3133
|
+
const f = l === "classic", c = Le(r, o), x = g ? /* @__PURE__ */ n(
|
|
3125
3134
|
"button",
|
|
3126
3135
|
{
|
|
3127
3136
|
type: "button",
|
|
3128
3137
|
onClick: g,
|
|
3129
3138
|
"aria-label": "Dismiss attachment",
|
|
3130
3139
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3131
|
-
children: /* @__PURE__ */ n(
|
|
3140
|
+
children: /* @__PURE__ */ n(Re, { className: "size-3", weight: "bold" })
|
|
3132
3141
|
}
|
|
3133
|
-
) : void 0,
|
|
3142
|
+
) : void 0, b = u ? /* @__PURE__ */ n(
|
|
3134
3143
|
"button",
|
|
3135
3144
|
{
|
|
3136
3145
|
type: "button",
|
|
3137
3146
|
onClick: u,
|
|
3138
3147
|
"aria-label": "Edit attachment",
|
|
3139
3148
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3140
|
-
children: /* @__PURE__ */ n(
|
|
3149
|
+
children: /* @__PURE__ */ n(Ps, { className: "size-5", weight: "regular" })
|
|
3141
3150
|
}
|
|
3142
3151
|
) : void 0;
|
|
3143
|
-
return c ? /* @__PURE__ */ n(
|
|
3152
|
+
return c ? /* @__PURE__ */ n(Te, { variant: "dark", bgClassName: at, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3144
3153
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3145
|
-
|
|
3154
|
+
Ae,
|
|
3146
3155
|
{
|
|
3147
3156
|
variant: "dark",
|
|
3148
3157
|
sourceUrl: o,
|
|
@@ -3150,26 +3159,26 @@ const lr = {
|
|
|
3150
3159
|
mimeType: r
|
|
3151
3160
|
}
|
|
3152
3161
|
) }),
|
|
3153
|
-
|
|
3162
|
+
x && /* @__PURE__ */ n("div", { className: "shrink-0", children: x })
|
|
3154
3163
|
] }) }) : /* @__PURE__ */ h(
|
|
3155
|
-
|
|
3164
|
+
Te,
|
|
3156
3165
|
{
|
|
3157
3166
|
variant: "dark",
|
|
3158
|
-
topRight: f ?
|
|
3167
|
+
topRight: f ? x : void 0,
|
|
3159
3168
|
children: [
|
|
3160
3169
|
!f && /* @__PURE__ */ n(
|
|
3161
|
-
|
|
3170
|
+
Ae,
|
|
3162
3171
|
{
|
|
3163
3172
|
variant: "dark",
|
|
3164
3173
|
thumbnailUrl: i,
|
|
3165
3174
|
sourceUrl: o,
|
|
3166
3175
|
title: e,
|
|
3167
3176
|
mimeType: r,
|
|
3168
|
-
topRight:
|
|
3177
|
+
topRight: x
|
|
3169
3178
|
}
|
|
3170
3179
|
),
|
|
3171
3180
|
/* @__PURE__ */ n(
|
|
3172
|
-
|
|
3181
|
+
st,
|
|
3173
3182
|
{
|
|
3174
3183
|
variant: "dark",
|
|
3175
3184
|
title: e,
|
|
@@ -3178,13 +3187,13 @@ const lr = {
|
|
|
3178
3187
|
url: a,
|
|
3179
3188
|
appIcon: d,
|
|
3180
3189
|
cta: m,
|
|
3181
|
-
trailingAction:
|
|
3190
|
+
trailingAction: b
|
|
3182
3191
|
}
|
|
3183
3192
|
)
|
|
3184
3193
|
]
|
|
3185
3194
|
}
|
|
3186
3195
|
);
|
|
3187
|
-
},
|
|
3196
|
+
}, xr = ({
|
|
3188
3197
|
title: e,
|
|
3189
3198
|
description: t,
|
|
3190
3199
|
url: s,
|
|
@@ -3196,25 +3205,25 @@ const lr = {
|
|
|
3196
3205
|
cta: d,
|
|
3197
3206
|
onClick: m
|
|
3198
3207
|
}) => {
|
|
3199
|
-
const g =
|
|
3208
|
+
const g = gn(a, i), u = nt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, x = Le(a, i) ? at : void 0, b = d && m ? {
|
|
3200
3209
|
...d,
|
|
3201
3210
|
onClick: () => {
|
|
3202
|
-
var
|
|
3203
|
-
m(), (
|
|
3211
|
+
var w;
|
|
3212
|
+
m(), (w = d.onClick) == null || w.call(d);
|
|
3204
3213
|
}
|
|
3205
3214
|
} : d;
|
|
3206
3215
|
return /* @__PURE__ */ h(
|
|
3207
|
-
|
|
3216
|
+
Te,
|
|
3208
3217
|
{
|
|
3209
3218
|
variant: "light",
|
|
3210
3219
|
href: f,
|
|
3211
3220
|
onClick: c,
|
|
3212
3221
|
ariaLabel: e ?? "Open attachment preview",
|
|
3213
|
-
bgClassName:
|
|
3222
|
+
bgClassName: x,
|
|
3214
3223
|
"data-testid": "link-attachment",
|
|
3215
3224
|
children: [
|
|
3216
3225
|
o === "featured" && /* @__PURE__ */ n(
|
|
3217
|
-
|
|
3226
|
+
Ae,
|
|
3218
3227
|
{
|
|
3219
3228
|
variant: "light",
|
|
3220
3229
|
thumbnailUrl: r,
|
|
@@ -3224,20 +3233,20 @@ const lr = {
|
|
|
3224
3233
|
}
|
|
3225
3234
|
),
|
|
3226
3235
|
/* @__PURE__ */ n(
|
|
3227
|
-
|
|
3236
|
+
st,
|
|
3228
3237
|
{
|
|
3229
3238
|
variant: "light",
|
|
3230
3239
|
title: e,
|
|
3231
3240
|
description: t,
|
|
3232
3241
|
url: s,
|
|
3233
3242
|
appIcon: l,
|
|
3234
|
-
cta:
|
|
3243
|
+
cta: b
|
|
3235
3244
|
}
|
|
3236
3245
|
)
|
|
3237
3246
|
]
|
|
3238
3247
|
}
|
|
3239
3248
|
);
|
|
3240
|
-
},
|
|
3249
|
+
}, wr = ({
|
|
3241
3250
|
title: e,
|
|
3242
3251
|
placeholderTitle: t,
|
|
3243
3252
|
description: s,
|
|
@@ -3250,17 +3259,17 @@ const lr = {
|
|
|
3250
3259
|
cta: m,
|
|
3251
3260
|
onClick: g
|
|
3252
3261
|
}) => {
|
|
3253
|
-
const u =
|
|
3262
|
+
const u = gn(r, o), f = nt(a), c = m == null && f != null && !u ? f : void 0, x = m == null && !u && c != null ? g : void 0;
|
|
3254
3263
|
return /* @__PURE__ */ h(
|
|
3255
|
-
|
|
3264
|
+
Te,
|
|
3256
3265
|
{
|
|
3257
3266
|
variant: "dark",
|
|
3258
3267
|
href: c,
|
|
3259
|
-
onClick:
|
|
3260
|
-
bgClassName:
|
|
3268
|
+
onClick: x,
|
|
3269
|
+
bgClassName: Le(r, o) ? at : void 0,
|
|
3261
3270
|
children: [
|
|
3262
3271
|
l === "featured" && /* @__PURE__ */ n(
|
|
3263
|
-
|
|
3272
|
+
Ae,
|
|
3264
3273
|
{
|
|
3265
3274
|
variant: "dark",
|
|
3266
3275
|
thumbnailUrl: i,
|
|
@@ -3270,7 +3279,7 @@ const lr = {
|
|
|
3270
3279
|
}
|
|
3271
3280
|
),
|
|
3272
3281
|
/* @__PURE__ */ n(
|
|
3273
|
-
|
|
3282
|
+
st,
|
|
3274
3283
|
{
|
|
3275
3284
|
variant: "dark",
|
|
3276
3285
|
title: e,
|
|
@@ -3284,20 +3293,20 @@ const lr = {
|
|
|
3284
3293
|
]
|
|
3285
3294
|
}
|
|
3286
3295
|
);
|
|
3287
|
-
},
|
|
3288
|
-
Composer:
|
|
3289
|
-
Sent:
|
|
3290
|
-
Received:
|
|
3291
|
-
},
|
|
3296
|
+
}, Ii = {
|
|
3297
|
+
Composer: vr,
|
|
3298
|
+
Sent: wr,
|
|
3299
|
+
Received: xr
|
|
3300
|
+
}, _r = {
|
|
3292
3301
|
dark: "bg-[#121110]",
|
|
3293
3302
|
light: "bg-[#e9eaed]"
|
|
3294
|
-
},
|
|
3303
|
+
}, Nr = {
|
|
3295
3304
|
dark: "text-white",
|
|
3296
3305
|
light: "text-[#080707]"
|
|
3297
|
-
},
|
|
3306
|
+
}, yr = {
|
|
3298
3307
|
dark: "border-white/[0.08]",
|
|
3299
3308
|
light: "border-black/[0.08]"
|
|
3300
|
-
},
|
|
3309
|
+
}, Cr = (e) => e === "dark" ? "sender" : "receiver", kr = {
|
|
3301
3310
|
sender: {
|
|
3302
3311
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3303
3312
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3310,7 +3319,7 @@ const lr = {
|
|
|
3310
3319
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3311
3320
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3312
3321
|
}
|
|
3313
|
-
},
|
|
3322
|
+
}, _e = ({
|
|
3314
3323
|
variant: e,
|
|
3315
3324
|
text: t,
|
|
3316
3325
|
bordered: s = !0,
|
|
@@ -3319,13 +3328,13 @@ const lr = {
|
|
|
3319
3328
|
children: i,
|
|
3320
3329
|
"data-testid": o
|
|
3321
3330
|
}) => {
|
|
3322
|
-
const l = t != null && t !== "", d =
|
|
3331
|
+
const l = t != null && t !== "", d = kr[Cr(e)][a];
|
|
3323
3332
|
return /* @__PURE__ */ h(
|
|
3324
3333
|
"div",
|
|
3325
3334
|
{
|
|
3326
3335
|
"data-testid": o,
|
|
3327
3336
|
"data-group-position": a,
|
|
3328
|
-
className:
|
|
3337
|
+
className: y(
|
|
3329
3338
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3330
3339
|
// and keeps the document / image / audio bubbles visually
|
|
3331
3340
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3334,10 +3343,10 @@ const lr = {
|
|
|
3334
3343
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3335
3344
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3336
3345
|
d,
|
|
3337
|
-
|
|
3338
|
-
|
|
3346
|
+
_r[e],
|
|
3347
|
+
Nr[e],
|
|
3339
3348
|
s && "border",
|
|
3340
|
-
s &&
|
|
3349
|
+
s && yr[e],
|
|
3341
3350
|
r
|
|
3342
3351
|
),
|
|
3343
3352
|
children: [
|
|
@@ -3345,7 +3354,7 @@ const lr = {
|
|
|
3345
3354
|
l ? /* @__PURE__ */ n(
|
|
3346
3355
|
"p",
|
|
3347
3356
|
{
|
|
3348
|
-
className:
|
|
3357
|
+
className: y(
|
|
3349
3358
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3350
3359
|
// the same font family + size as `.str-chat__message-text`
|
|
3351
3360
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3362,7 +3371,7 @@ const lr = {
|
|
|
3362
3371
|
]
|
|
3363
3372
|
}
|
|
3364
3373
|
);
|
|
3365
|
-
},
|
|
3374
|
+
}, Ne = ({
|
|
3366
3375
|
onClick: e,
|
|
3367
3376
|
variant: t = "overlay",
|
|
3368
3377
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3374,22 +3383,22 @@ const lr = {
|
|
|
3374
3383
|
a.stopPropagation(), e();
|
|
3375
3384
|
},
|
|
3376
3385
|
"aria-label": s,
|
|
3377
|
-
className:
|
|
3386
|
+
className: y(
|
|
3378
3387
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3379
3388
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3380
3389
|
),
|
|
3381
|
-
children: /* @__PURE__ */ n(
|
|
3390
|
+
children: /* @__PURE__ */ n(Re, { className: "size-3", weight: "bold" })
|
|
3382
3391
|
}
|
|
3383
|
-
),
|
|
3392
|
+
), ye = (e) => e === "received" ? "light" : "dark", Ti = ({
|
|
3384
3393
|
firstOfGroup: e,
|
|
3385
3394
|
endOfGroup: t,
|
|
3386
3395
|
groupedByUser: s
|
|
3387
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3396
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Er = ({
|
|
3388
3397
|
src: e,
|
|
3389
3398
|
mimeType: t,
|
|
3390
3399
|
filename: s,
|
|
3391
3400
|
items: a
|
|
3392
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3401
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Sr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3393
3402
|
/* @__PURE__ */ n(
|
|
3394
3403
|
"audio",
|
|
3395
3404
|
{
|
|
@@ -3401,7 +3410,7 @@ const lr = {
|
|
|
3401
3410
|
}
|
|
3402
3411
|
),
|
|
3403
3412
|
s ?? null
|
|
3404
|
-
] }),
|
|
3413
|
+
] }), rt = ({
|
|
3405
3414
|
state: e,
|
|
3406
3415
|
src: t,
|
|
3407
3416
|
mimeType: s,
|
|
@@ -3412,41 +3421,41 @@ const lr = {
|
|
|
3412
3421
|
preload: l,
|
|
3413
3422
|
onDismiss: d
|
|
3414
3423
|
}) => {
|
|
3415
|
-
const m =
|
|
3424
|
+
const m = ye(e), g = e === "composer" && !!d, u = Er({ src: t, mimeType: s, filename: a, items: r });
|
|
3416
3425
|
if (u.length === 0)
|
|
3417
3426
|
return null;
|
|
3418
3427
|
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
3419
3428
|
return /* @__PURE__ */ n(
|
|
3420
|
-
|
|
3429
|
+
_e,
|
|
3421
3430
|
{
|
|
3422
3431
|
variant: m,
|
|
3423
3432
|
text: i,
|
|
3424
3433
|
groupPosition: o,
|
|
3425
3434
|
"data-testid": "audio-attachment",
|
|
3426
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3427
|
-
|
|
3435
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, x) => /* @__PURE__ */ n(
|
|
3436
|
+
Sr,
|
|
3428
3437
|
{
|
|
3429
3438
|
item: c,
|
|
3430
3439
|
preload: f,
|
|
3431
3440
|
trailingAction: (
|
|
3432
3441
|
// Composer only supports a single attachment, so the
|
|
3433
3442
|
// dismiss control sits on the only player.
|
|
3434
|
-
g &&
|
|
3443
|
+
g && x === 0 ? /* @__PURE__ */ n(Ne, { onClick: d, variant: "inline" }) : void 0
|
|
3435
3444
|
)
|
|
3436
3445
|
},
|
|
3437
|
-
`${c.src}-${
|
|
3446
|
+
`${c.src}-${x}`
|
|
3438
3447
|
)) })
|
|
3439
3448
|
}
|
|
3440
3449
|
);
|
|
3441
|
-
},
|
|
3442
|
-
Composer:
|
|
3443
|
-
Sent:
|
|
3444
|
-
Received:
|
|
3450
|
+
}, Ir = (e) => /* @__PURE__ */ n(rt, { ...e, state: "composer" }), Tr = (e) => /* @__PURE__ */ n(rt, { ...e, state: "sent" }), Ar = (e) => /* @__PURE__ */ n(rt, { ...e, state: "received" }), Mr = {
|
|
3451
|
+
Composer: Ir,
|
|
3452
|
+
Sent: Tr,
|
|
3453
|
+
Received: Ar
|
|
3445
3454
|
};
|
|
3446
|
-
function
|
|
3455
|
+
function Rr(e) {
|
|
3447
3456
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
3448
3457
|
}
|
|
3449
|
-
const
|
|
3458
|
+
const Lr = {
|
|
3450
3459
|
pdf: "PDF",
|
|
3451
3460
|
doc: "DOC",
|
|
3452
3461
|
xls: "XLS",
|
|
@@ -3456,7 +3465,7 @@ const Mr = {
|
|
|
3456
3465
|
text: "TXT",
|
|
3457
3466
|
markdown: "MD"
|
|
3458
3467
|
};
|
|
3459
|
-
function
|
|
3468
|
+
function Dr(e, t) {
|
|
3460
3469
|
if (t) {
|
|
3461
3470
|
const r = t.lastIndexOf(".");
|
|
3462
3471
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3466,7 +3475,7 @@ function Rr(e, t) {
|
|
|
3466
3475
|
}
|
|
3467
3476
|
if (!e) return;
|
|
3468
3477
|
if (re(e) === "document") {
|
|
3469
|
-
const r =
|
|
3478
|
+
const r = en(e), i = Lr[r];
|
|
3470
3479
|
if (i) return i;
|
|
3471
3480
|
if (e === "application/octet-stream") return;
|
|
3472
3481
|
}
|
|
@@ -3474,8 +3483,8 @@ function Rr(e, t) {
|
|
|
3474
3483
|
if (!(!a || a === "*"))
|
|
3475
3484
|
return a.toUpperCase();
|
|
3476
3485
|
}
|
|
3477
|
-
function
|
|
3478
|
-
const a =
|
|
3486
|
+
function Pr(e, t, s) {
|
|
3487
|
+
const a = Dr(e, t), r = typeof s == "number" && s > 0 ? Rr(s) : void 0;
|
|
3479
3488
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3480
3489
|
}
|
|
3481
3490
|
function ne(e) {
|
|
@@ -3486,16 +3495,16 @@ function ne(e) {
|
|
|
3486
3495
|
return "download";
|
|
3487
3496
|
}
|
|
3488
3497
|
}
|
|
3489
|
-
const
|
|
3498
|
+
const Or = {
|
|
3490
3499
|
dark: "text-white/55",
|
|
3491
3500
|
light: "text-black/65"
|
|
3492
|
-
},
|
|
3501
|
+
}, zr = {
|
|
3493
3502
|
dark: "bg-white/10",
|
|
3494
3503
|
light: "bg-black/5"
|
|
3495
|
-
},
|
|
3504
|
+
}, $r = {
|
|
3496
3505
|
dark: "text-white/85",
|
|
3497
3506
|
light: "text-black/85"
|
|
3498
|
-
},
|
|
3507
|
+
}, bn = ({
|
|
3499
3508
|
variant: e,
|
|
3500
3509
|
filename: t,
|
|
3501
3510
|
title: s,
|
|
@@ -3505,16 +3514,16 @@ const Dr = {
|
|
|
3505
3514
|
activateLabel: o,
|
|
3506
3515
|
trailingAction: l
|
|
3507
3516
|
}) => {
|
|
3508
|
-
const d = s ?? t ?? "File", m =
|
|
3517
|
+
const d = s ?? t ?? "File", m = Pr(a, t, r), g = /* @__PURE__ */ n(
|
|
3509
3518
|
"div",
|
|
3510
3519
|
{
|
|
3511
|
-
className:
|
|
3520
|
+
className: y(
|
|
3512
3521
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3513
|
-
|
|
3522
|
+
zr[e]
|
|
3514
3523
|
),
|
|
3515
3524
|
"aria-hidden": !0,
|
|
3516
3525
|
children: le(a, {
|
|
3517
|
-
className:
|
|
3526
|
+
className: y("size-6", $r[e]),
|
|
3518
3527
|
weight: "regular"
|
|
3519
3528
|
})
|
|
3520
3529
|
}
|
|
@@ -3523,9 +3532,9 @@ const Dr = {
|
|
|
3523
3532
|
m ? /* @__PURE__ */ n(
|
|
3524
3533
|
"p",
|
|
3525
3534
|
{
|
|
3526
|
-
className:
|
|
3535
|
+
className: y(
|
|
3527
3536
|
"truncate text-xs leading-4",
|
|
3528
|
-
|
|
3537
|
+
Or[e]
|
|
3529
3538
|
),
|
|
3530
3539
|
children: m
|
|
3531
3540
|
}
|
|
@@ -3536,7 +3545,7 @@ const Dr = {
|
|
|
3536
3545
|
type: "button",
|
|
3537
3546
|
onClick: i,
|
|
3538
3547
|
"aria-label": o,
|
|
3539
|
-
className:
|
|
3548
|
+
className: y(
|
|
3540
3549
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3541
3550
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3542
3551
|
),
|
|
@@ -3554,7 +3563,7 @@ const Dr = {
|
|
|
3554
3563
|
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
3555
3564
|
] });
|
|
3556
3565
|
};
|
|
3557
|
-
async function
|
|
3566
|
+
async function pn(e, t) {
|
|
3558
3567
|
const s = t ?? ne(e);
|
|
3559
3568
|
try {
|
|
3560
3569
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -3568,14 +3577,14 @@ async function bn(e, t) {
|
|
|
3568
3577
|
}
|
|
3569
3578
|
}
|
|
3570
3579
|
}
|
|
3571
|
-
const
|
|
3580
|
+
const Fr = ({
|
|
3572
3581
|
src: e,
|
|
3573
3582
|
filename: t,
|
|
3574
3583
|
fileSize: s,
|
|
3575
3584
|
mimeType: a,
|
|
3576
3585
|
title: r,
|
|
3577
3586
|
items: i
|
|
3578
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3587
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Br = ({
|
|
3579
3588
|
variant: e,
|
|
3580
3589
|
item: t,
|
|
3581
3590
|
index: s,
|
|
@@ -3584,7 +3593,7 @@ const zr = ({
|
|
|
3584
3593
|
}) => {
|
|
3585
3594
|
const i = t.filename ?? ne(t.src);
|
|
3586
3595
|
return /* @__PURE__ */ n(
|
|
3587
|
-
|
|
3596
|
+
bn,
|
|
3588
3597
|
{
|
|
3589
3598
|
variant: e,
|
|
3590
3599
|
filename: i,
|
|
@@ -3596,7 +3605,7 @@ const zr = ({
|
|
|
3596
3605
|
trailingAction: r
|
|
3597
3606
|
}
|
|
3598
3607
|
);
|
|
3599
|
-
},
|
|
3608
|
+
}, it = ({
|
|
3600
3609
|
state: e,
|
|
3601
3610
|
src: t,
|
|
3602
3611
|
filename: s,
|
|
@@ -3609,58 +3618,58 @@ const zr = ({
|
|
|
3609
3618
|
onClick: m,
|
|
3610
3619
|
onDismiss: g
|
|
3611
3620
|
}) => {
|
|
3612
|
-
const u =
|
|
3621
|
+
const u = ye(e), f = e === "composer" && !!g, c = Fr({
|
|
3613
3622
|
src: t,
|
|
3614
3623
|
filename: s,
|
|
3615
3624
|
fileSize: a,
|
|
3616
3625
|
mimeType: r,
|
|
3617
3626
|
title: i,
|
|
3618
3627
|
items: o
|
|
3619
|
-
}),
|
|
3620
|
-
if ((m == null ? void 0 : m(
|
|
3621
|
-
const
|
|
3622
|
-
if (!
|
|
3623
|
-
const
|
|
3624
|
-
|
|
3628
|
+
}), x = (w) => {
|
|
3629
|
+
if ((m == null ? void 0 : m(w)) === !1) return;
|
|
3630
|
+
const v = c[w];
|
|
3631
|
+
if (!v) return;
|
|
3632
|
+
const p = v.filename ?? ne(v.src);
|
|
3633
|
+
pn(v.src, p);
|
|
3625
3634
|
};
|
|
3626
3635
|
if (c.length === 0)
|
|
3627
3636
|
return null;
|
|
3628
|
-
const
|
|
3637
|
+
const b = /* @__PURE__ */ n(
|
|
3629
3638
|
"span",
|
|
3630
3639
|
{
|
|
3631
|
-
className:
|
|
3640
|
+
className: y(
|
|
3632
3641
|
"flex size-8 items-center justify-center rounded-full",
|
|
3633
3642
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3634
3643
|
),
|
|
3635
3644
|
"aria-hidden": !0,
|
|
3636
|
-
children: /* @__PURE__ */ n(
|
|
3645
|
+
children: /* @__PURE__ */ n(xe, { className: "size-5", weight: "bold" })
|
|
3637
3646
|
}
|
|
3638
3647
|
);
|
|
3639
3648
|
return /* @__PURE__ */ n(
|
|
3640
|
-
|
|
3649
|
+
_e,
|
|
3641
3650
|
{
|
|
3642
3651
|
variant: u,
|
|
3643
3652
|
text: l,
|
|
3644
3653
|
groupPosition: d,
|
|
3645
3654
|
"data-testid": "file-attachment",
|
|
3646
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3647
|
-
|
|
3655
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w, v) => /* @__PURE__ */ n(
|
|
3656
|
+
Br,
|
|
3648
3657
|
{
|
|
3649
3658
|
variant: u,
|
|
3650
|
-
item:
|
|
3651
|
-
index:
|
|
3652
|
-
onActivate:
|
|
3653
|
-
trailingAction: f &&
|
|
3659
|
+
item: w,
|
|
3660
|
+
index: v,
|
|
3661
|
+
onActivate: x,
|
|
3662
|
+
trailingAction: f && v === 0 ? /* @__PURE__ */ n(Ne, { onClick: g, variant: "inline" }) : b
|
|
3654
3663
|
},
|
|
3655
|
-
`${
|
|
3664
|
+
`${w.src}-${v}`
|
|
3656
3665
|
)) })
|
|
3657
3666
|
}
|
|
3658
3667
|
);
|
|
3659
|
-
},
|
|
3660
|
-
Composer:
|
|
3661
|
-
Sent:
|
|
3662
|
-
Received:
|
|
3663
|
-
},
|
|
3668
|
+
}, Vr = (e) => /* @__PURE__ */ n(it, { ...e, state: "composer" }), Ur = (e) => /* @__PURE__ */ n(it, { ...e, state: "sent" }), jr = (e) => /* @__PURE__ */ n(it, { ...e, state: "received" }), Gr = {
|
|
3669
|
+
Composer: Vr,
|
|
3670
|
+
Sent: Ur,
|
|
3671
|
+
Received: jr
|
|
3672
|
+
}, ot = ({
|
|
3664
3673
|
onPrev: e,
|
|
3665
3674
|
onNext: t,
|
|
3666
3675
|
prevLabel: s = "Previous",
|
|
@@ -3673,7 +3682,7 @@ const zr = ({
|
|
|
3673
3682
|
onClick: e,
|
|
3674
3683
|
"aria-label": s,
|
|
3675
3684
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3676
|
-
children: /* @__PURE__ */ n(
|
|
3685
|
+
children: /* @__PURE__ */ n(Os, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3677
3686
|
}
|
|
3678
3687
|
),
|
|
3679
3688
|
/* @__PURE__ */ n(
|
|
@@ -3683,10 +3692,10 @@ const zr = ({
|
|
|
3683
3692
|
onClick: t,
|
|
3684
3693
|
"aria-label": a,
|
|
3685
3694
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3686
|
-
children: /* @__PURE__ */ n(
|
|
3695
|
+
children: /* @__PURE__ */ n(Ge, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3687
3696
|
}
|
|
3688
3697
|
)
|
|
3689
|
-
] }),
|
|
3698
|
+
] }), vn = ({
|
|
3690
3699
|
url: e,
|
|
3691
3700
|
filename: t,
|
|
3692
3701
|
variant: s = "pill",
|
|
@@ -3695,15 +3704,15 @@ const zr = ({
|
|
|
3695
3704
|
tone: i = "dark",
|
|
3696
3705
|
onTriggered: o
|
|
3697
3706
|
}) => {
|
|
3698
|
-
const [l, d] =
|
|
3707
|
+
const [l, d] = z(!1), m = Z(
|
|
3699
3708
|
(c) => {
|
|
3700
|
-
c.stopPropagation(), !l && (d(!0),
|
|
3709
|
+
c.stopPropagation(), !l && (d(!0), pn(e, t).catch(() => {
|
|
3701
3710
|
}).finally(() => {
|
|
3702
3711
|
d(!1), o == null || o();
|
|
3703
3712
|
}));
|
|
3704
3713
|
},
|
|
3705
3714
|
[l, e, t, o]
|
|
3706
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3715
|
+
), g = r ?? s !== "pill", f = { className: y(
|
|
3707
3716
|
s === "pill" ? "size-4" : "size-5",
|
|
3708
3717
|
"shrink-0"
|
|
3709
3718
|
), weight: "bold" };
|
|
@@ -3714,7 +3723,7 @@ const zr = ({
|
|
|
3714
3723
|
onClick: m,
|
|
3715
3724
|
disabled: l,
|
|
3716
3725
|
"aria-label": a,
|
|
3717
|
-
className:
|
|
3726
|
+
className: y(
|
|
3718
3727
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3719
3728
|
{
|
|
3720
3729
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3722,14 +3731,14 @@ const zr = ({
|
|
|
3722
3731
|
}[i]
|
|
3723
3732
|
),
|
|
3724
3733
|
children: l ? /* @__PURE__ */ n(
|
|
3725
|
-
|
|
3734
|
+
ve,
|
|
3726
3735
|
{
|
|
3727
3736
|
className: "size-4 animate-spin",
|
|
3728
3737
|
weight: "bold",
|
|
3729
3738
|
"aria-hidden": !0
|
|
3730
3739
|
}
|
|
3731
3740
|
) : /* @__PURE__ */ n(
|
|
3732
|
-
|
|
3741
|
+
xe,
|
|
3733
3742
|
{
|
|
3734
3743
|
className: "size-5 shrink-0",
|
|
3735
3744
|
weight: "bold",
|
|
@@ -3745,7 +3754,7 @@ const zr = ({
|
|
|
3745
3754
|
disabled: l,
|
|
3746
3755
|
"aria-label": a,
|
|
3747
3756
|
className: "mes-media-viewer__action",
|
|
3748
|
-
children: l ? /* @__PURE__ */ n(
|
|
3757
|
+
children: l ? /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(xe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3749
3758
|
}
|
|
3750
3759
|
) : /* @__PURE__ */ h(
|
|
3751
3760
|
"button",
|
|
@@ -3754,40 +3763,40 @@ const zr = ({
|
|
|
3754
3763
|
onClick: m,
|
|
3755
3764
|
disabled: l,
|
|
3756
3765
|
"aria-label": g ? a : void 0,
|
|
3757
|
-
className:
|
|
3766
|
+
className: y(
|
|
3758
3767
|
"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",
|
|
3759
3768
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3760
3769
|
),
|
|
3761
3770
|
children: [
|
|
3762
3771
|
l ? /* @__PURE__ */ n(
|
|
3763
|
-
|
|
3772
|
+
ve,
|
|
3764
3773
|
{
|
|
3765
3774
|
className: "size-4 animate-spin",
|
|
3766
3775
|
weight: "bold",
|
|
3767
3776
|
"aria-hidden": !0
|
|
3768
3777
|
}
|
|
3769
|
-
) : /* @__PURE__ */ n(
|
|
3778
|
+
) : /* @__PURE__ */ n(xe, { ...f, "aria-hidden": !0 }),
|
|
3770
3779
|
g ? null : a
|
|
3771
3780
|
]
|
|
3772
3781
|
}
|
|
3773
3782
|
);
|
|
3774
|
-
},
|
|
3783
|
+
}, Be = (e, t, s) => Math.min(Math.max(e, t), s), lt = ({
|
|
3775
3784
|
length: e,
|
|
3776
3785
|
initialIndex: t,
|
|
3777
3786
|
open: s
|
|
3778
3787
|
}) => {
|
|
3779
|
-
const a =
|
|
3780
|
-
|
|
3781
|
-
s && i(
|
|
3782
|
-
}, [s, t, e]),
|
|
3783
|
-
i((d) =>
|
|
3788
|
+
const a = Be(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
|
|
3789
|
+
J(() => {
|
|
3790
|
+
s && i(Be(t, 0, Math.max(e - 1, 0)));
|
|
3791
|
+
}, [s, t, e]), J(() => {
|
|
3792
|
+
i((d) => Be(d, 0, Math.max(e - 1, 0)));
|
|
3784
3793
|
}, [e]);
|
|
3785
|
-
const o =
|
|
3794
|
+
const o = Z(() => {
|
|
3786
3795
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3787
|
-
}, [e]), l =
|
|
3796
|
+
}, [e]), l = Z(() => {
|
|
3788
3797
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3789
3798
|
}, [e]);
|
|
3790
|
-
return
|
|
3799
|
+
return J(() => {
|
|
3791
3800
|
if (!s || e <= 1) return;
|
|
3792
3801
|
const d = (m) => {
|
|
3793
3802
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
@@ -3796,7 +3805,7 @@ const zr = ({
|
|
|
3796
3805
|
};
|
|
3797
3806
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3798
3807
|
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
3799
|
-
},
|
|
3808
|
+
}, ct = ({
|
|
3800
3809
|
open: e,
|
|
3801
3810
|
onClose: t,
|
|
3802
3811
|
ariaLabel: s,
|
|
@@ -3805,8 +3814,8 @@ const zr = ({
|
|
|
3805
3814
|
children: i,
|
|
3806
3815
|
"data-testid": o
|
|
3807
3816
|
}) => {
|
|
3808
|
-
const l =
|
|
3809
|
-
return
|
|
3817
|
+
const l = H(null), d = H(null);
|
|
3818
|
+
return J(() => {
|
|
3810
3819
|
var f;
|
|
3811
3820
|
const u = l.current;
|
|
3812
3821
|
if (u) {
|
|
@@ -3877,7 +3886,7 @@ const zr = ({
|
|
|
3877
3886
|
onClick: t,
|
|
3878
3887
|
"aria-label": "Close viewer",
|
|
3879
3888
|
className: "mes-media-viewer__action",
|
|
3880
|
-
children: /* @__PURE__ */ n(
|
|
3889
|
+
children: /* @__PURE__ */ n(Re, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3881
3890
|
}
|
|
3882
3891
|
)
|
|
3883
3892
|
] })
|
|
@@ -3886,13 +3895,13 @@ const zr = ({
|
|
|
3886
3895
|
]
|
|
3887
3896
|
}
|
|
3888
3897
|
);
|
|
3889
|
-
},
|
|
3898
|
+
}, xn = ({
|
|
3890
3899
|
open: e,
|
|
3891
3900
|
items: t,
|
|
3892
3901
|
initialIndex: s = 0,
|
|
3893
3902
|
onClose: a
|
|
3894
3903
|
}) => {
|
|
3895
|
-
const { index: r, prev: i, next: o } =
|
|
3904
|
+
const { index: r, prev: i, next: o } = lt({
|
|
3896
3905
|
length: t.length,
|
|
3897
3906
|
initialIndex: s,
|
|
3898
3907
|
open: e
|
|
@@ -3901,14 +3910,14 @@ const zr = ({
|
|
|
3901
3910
|
[l]
|
|
3902
3911
|
);
|
|
3903
3912
|
return l ? /* @__PURE__ */ h(
|
|
3904
|
-
|
|
3913
|
+
ct,
|
|
3905
3914
|
{
|
|
3906
3915
|
open: e,
|
|
3907
3916
|
onClose: a,
|
|
3908
3917
|
ariaLabel: d,
|
|
3909
3918
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
3910
3919
|
actions: /* @__PURE__ */ n(
|
|
3911
|
-
|
|
3920
|
+
vn,
|
|
3912
3921
|
{
|
|
3913
3922
|
url: l.src,
|
|
3914
3923
|
filename: d,
|
|
@@ -3931,7 +3940,7 @@ const zr = ({
|
|
|
3931
3940
|
`${r}:${l.src}`
|
|
3932
3941
|
),
|
|
3933
3942
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3934
|
-
|
|
3943
|
+
ot,
|
|
3935
3944
|
{
|
|
3936
3945
|
onPrev: i,
|
|
3937
3946
|
onNext: o,
|
|
@@ -3942,7 +3951,7 @@ const zr = ({
|
|
|
3942
3951
|
]
|
|
3943
3952
|
}
|
|
3944
3953
|
) : null;
|
|
3945
|
-
},
|
|
3954
|
+
}, Hr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", wn = ({
|
|
3946
3955
|
tiles: e,
|
|
3947
3956
|
onTileActivate: t,
|
|
3948
3957
|
maxVisible: s = 4,
|
|
@@ -3951,14 +3960,14 @@ const zr = ({
|
|
|
3951
3960
|
const r = e.length;
|
|
3952
3961
|
if (r === 0) return null;
|
|
3953
3962
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
3954
|
-
const u =
|
|
3963
|
+
const u = y(Hr, "h-full w-full");
|
|
3955
3964
|
return t ? /* @__PURE__ */ h(
|
|
3956
3965
|
"button",
|
|
3957
3966
|
{
|
|
3958
3967
|
type: "button",
|
|
3959
3968
|
onClick: () => t(m),
|
|
3960
3969
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3961
|
-
className:
|
|
3970
|
+
className: y(u, "cursor-zoom-in"),
|
|
3962
3971
|
children: [
|
|
3963
3972
|
d.content,
|
|
3964
3973
|
g
|
|
@@ -3970,10 +3979,10 @@ const zr = ({
|
|
|
3970
3979
|
g
|
|
3971
3980
|
] }, m);
|
|
3972
3981
|
};
|
|
3973
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3982
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3974
3983
|
"div",
|
|
3975
3984
|
{
|
|
3976
|
-
className:
|
|
3985
|
+
className: y(
|
|
3977
3986
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3978
3987
|
a
|
|
3979
3988
|
),
|
|
@@ -3982,7 +3991,7 @@ const zr = ({
|
|
|
3982
3991
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3983
3992
|
"div",
|
|
3984
3993
|
{
|
|
3985
|
-
className:
|
|
3994
|
+
className: y(
|
|
3986
3995
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3987
3996
|
a
|
|
3988
3997
|
),
|
|
@@ -3995,7 +4004,7 @@ const zr = ({
|
|
|
3995
4004
|
) : /* @__PURE__ */ n(
|
|
3996
4005
|
"div",
|
|
3997
4006
|
{
|
|
3998
|
-
className:
|
|
4007
|
+
className: y(
|
|
3999
4008
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4000
4009
|
a
|
|
4001
4010
|
),
|
|
@@ -4012,15 +4021,15 @@ const zr = ({
|
|
|
4012
4021
|
})
|
|
4013
4022
|
}
|
|
4014
4023
|
);
|
|
4015
|
-
},
|
|
4016
|
-
const [t, s] =
|
|
4024
|
+
}, Ce = (e) => {
|
|
4025
|
+
const [t, s] = z(!1), [a, r] = z(0), i = Z(
|
|
4017
4026
|
(l) => {
|
|
4018
4027
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
4019
4028
|
},
|
|
4020
4029
|
[e]
|
|
4021
|
-
), o =
|
|
4030
|
+
), o = Z(() => s(!1), []);
|
|
4022
4031
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
4023
|
-
},
|
|
4032
|
+
}, Yr = (e, t, s, a) => ({
|
|
4024
4033
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4025
4034
|
content: /* @__PURE__ */ n(
|
|
4026
4035
|
"img",
|
|
@@ -4035,16 +4044,16 @@ const zr = ({
|
|
|
4035
4044
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4036
4045
|
}
|
|
4037
4046
|
)
|
|
4038
|
-
}),
|
|
4047
|
+
}), qr = ({
|
|
4039
4048
|
src: e,
|
|
4040
4049
|
alt: t,
|
|
4041
4050
|
items: s
|
|
4042
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4051
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], _n = (e, t) => e.map((s, a) => ({
|
|
4043
4052
|
src: s.src,
|
|
4044
4053
|
alt: s.alt,
|
|
4045
4054
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4046
|
-
})),
|
|
4047
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } =
|
|
4055
|
+
})), Wr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4056
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ce(
|
|
4048
4057
|
r
|
|
4049
4058
|
);
|
|
4050
4059
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4068,18 +4077,18 @@ const zr = ({
|
|
|
4068
4077
|
)
|
|
4069
4078
|
}
|
|
4070
4079
|
),
|
|
4071
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4080
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ne, { onClick: i }) }) : null,
|
|
4072
4081
|
/* @__PURE__ */ n(
|
|
4073
|
-
|
|
4082
|
+
xn,
|
|
4074
4083
|
{
|
|
4075
4084
|
open: o,
|
|
4076
|
-
items:
|
|
4085
|
+
items: _n([{ src: e, alt: t }], s),
|
|
4077
4086
|
initialIndex: l,
|
|
4078
4087
|
onClose: m
|
|
4079
4088
|
}
|
|
4080
4089
|
)
|
|
4081
4090
|
] });
|
|
4082
|
-
},
|
|
4091
|
+
}, Nn = ({
|
|
4083
4092
|
state: e,
|
|
4084
4093
|
src: t,
|
|
4085
4094
|
alt: s,
|
|
@@ -4090,46 +4099,46 @@ const zr = ({
|
|
|
4090
4099
|
loading: l = "lazy",
|
|
4091
4100
|
onClick: d
|
|
4092
4101
|
}) => {
|
|
4093
|
-
const m =
|
|
4102
|
+
const m = qr({ src: t, alt: s, items: r }), g = ye(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: x } = Ce(
|
|
4094
4103
|
d
|
|
4095
4104
|
);
|
|
4096
4105
|
if (m.length === 0)
|
|
4097
4106
|
return null;
|
|
4098
|
-
const
|
|
4099
|
-
(
|
|
4107
|
+
const b = m.map(
|
|
4108
|
+
(w, v) => Yr(w, v, m.length, l)
|
|
4100
4109
|
);
|
|
4101
4110
|
return /* @__PURE__ */ h(
|
|
4102
|
-
|
|
4111
|
+
_e,
|
|
4103
4112
|
{
|
|
4104
4113
|
variant: g,
|
|
4105
4114
|
text: i,
|
|
4106
4115
|
groupPosition: o,
|
|
4107
4116
|
"data-testid": "image-attachment",
|
|
4108
4117
|
children: [
|
|
4109
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4118
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles: b, onTileActivate: c }) }),
|
|
4110
4119
|
/* @__PURE__ */ n(
|
|
4111
|
-
|
|
4120
|
+
xn,
|
|
4112
4121
|
{
|
|
4113
4122
|
open: u,
|
|
4114
|
-
items:
|
|
4123
|
+
items: _n(m, a),
|
|
4115
4124
|
initialIndex: f,
|
|
4116
|
-
onClose:
|
|
4125
|
+
onClose: x
|
|
4117
4126
|
}
|
|
4118
4127
|
)
|
|
4119
4128
|
]
|
|
4120
4129
|
}
|
|
4121
4130
|
);
|
|
4122
|
-
},
|
|
4123
|
-
Composer:
|
|
4124
|
-
Sent:
|
|
4125
|
-
Received:
|
|
4126
|
-
},
|
|
4131
|
+
}, Xr = (e) => /* @__PURE__ */ n(Wr, { ...e }), Kr = (e) => /* @__PURE__ */ n(Nn, { ...e, state: "sent" }), Jr = (e) => /* @__PURE__ */ n(Nn, { ...e, state: "received" }), Zr = {
|
|
4132
|
+
Composer: Xr,
|
|
4133
|
+
Sent: Kr,
|
|
4134
|
+
Received: Jr
|
|
4135
|
+
}, Qr = ({
|
|
4127
4136
|
open: e,
|
|
4128
4137
|
items: t,
|
|
4129
4138
|
initialIndex: s = 0,
|
|
4130
4139
|
onClose: a
|
|
4131
4140
|
}) => {
|
|
4132
|
-
const { index: r, prev: i, next: o } =
|
|
4141
|
+
const { index: r, prev: i, next: o } = lt({
|
|
4133
4142
|
length: t.length,
|
|
4134
4143
|
initialIndex: s,
|
|
4135
4144
|
open: e
|
|
@@ -4137,11 +4146,11 @@ const zr = ({
|
|
|
4137
4146
|
() => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "document"),
|
|
4138
4147
|
[l]
|
|
4139
4148
|
), m = se(
|
|
4140
|
-
() => l ?
|
|
4149
|
+
() => l ? ei(l.src) : void 0,
|
|
4141
4150
|
[l]
|
|
4142
4151
|
);
|
|
4143
4152
|
return !l || !m ? null : /* @__PURE__ */ h(
|
|
4144
|
-
|
|
4153
|
+
ct,
|
|
4145
4154
|
{
|
|
4146
4155
|
open: e,
|
|
4147
4156
|
onClose: a,
|
|
@@ -4160,7 +4169,7 @@ const zr = ({
|
|
|
4160
4169
|
`${r}:${l.src}`
|
|
4161
4170
|
),
|
|
4162
4171
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4163
|
-
|
|
4172
|
+
ot,
|
|
4164
4173
|
{
|
|
4165
4174
|
onPrev: i,
|
|
4166
4175
|
onNext: o,
|
|
@@ -4171,16 +4180,16 @@ const zr = ({
|
|
|
4171
4180
|
]
|
|
4172
4181
|
}
|
|
4173
4182
|
);
|
|
4174
|
-
},
|
|
4183
|
+
}, ei = (e) => {
|
|
4175
4184
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4176
4185
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4177
|
-
},
|
|
4186
|
+
}, ti = ({
|
|
4178
4187
|
src: e,
|
|
4179
4188
|
filename: t,
|
|
4180
4189
|
fileSize: s,
|
|
4181
4190
|
title: a,
|
|
4182
4191
|
items: r
|
|
4183
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4192
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], ni = ({
|
|
4184
4193
|
variant: e,
|
|
4185
4194
|
item: t,
|
|
4186
4195
|
index: s,
|
|
@@ -4189,7 +4198,7 @@ const zr = ({
|
|
|
4189
4198
|
}) => {
|
|
4190
4199
|
const i = t.filename ?? ne(t.src);
|
|
4191
4200
|
return /* @__PURE__ */ n(
|
|
4192
|
-
|
|
4201
|
+
bn,
|
|
4193
4202
|
{
|
|
4194
4203
|
variant: e,
|
|
4195
4204
|
filename: i,
|
|
@@ -4201,7 +4210,7 @@ const zr = ({
|
|
|
4201
4210
|
trailingAction: r
|
|
4202
4211
|
}
|
|
4203
4212
|
);
|
|
4204
|
-
},
|
|
4213
|
+
}, dt = ({
|
|
4205
4214
|
state: e,
|
|
4206
4215
|
src: t,
|
|
4207
4216
|
filename: s,
|
|
@@ -4213,69 +4222,69 @@ const zr = ({
|
|
|
4213
4222
|
onClick: d,
|
|
4214
4223
|
onDismiss: m
|
|
4215
4224
|
}) => {
|
|
4216
|
-
const g =
|
|
4225
|
+
const g = ye(e), u = ti({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: x, closeViewer: b } = Ce(
|
|
4217
4226
|
d
|
|
4218
|
-
),
|
|
4227
|
+
), w = e === "composer" && !!m;
|
|
4219
4228
|
if (u.length === 0)
|
|
4220
4229
|
return null;
|
|
4221
|
-
const
|
|
4222
|
-
src:
|
|
4223
|
-
filename:
|
|
4230
|
+
const v = u.map((p) => ({
|
|
4231
|
+
src: p.src,
|
|
4232
|
+
filename: p.filename ?? ne(p.src)
|
|
4224
4233
|
}));
|
|
4225
4234
|
return /* @__PURE__ */ h(
|
|
4226
|
-
|
|
4235
|
+
_e,
|
|
4227
4236
|
{
|
|
4228
4237
|
variant: g,
|
|
4229
4238
|
text: o,
|
|
4230
4239
|
groupPosition: l,
|
|
4231
4240
|
"data-testid": "pdf-attachment",
|
|
4232
4241
|
children: [
|
|
4233
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4234
|
-
const
|
|
4235
|
-
|
|
4242
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((p, A) => {
|
|
4243
|
+
const R = p.filename ?? ne(p.src), L = w && A === 0 ? /* @__PURE__ */ n(Ne, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4244
|
+
vn,
|
|
4236
4245
|
{
|
|
4237
|
-
url:
|
|
4238
|
-
filename:
|
|
4246
|
+
url: p.src,
|
|
4247
|
+
filename: R,
|
|
4239
4248
|
variant: "inline",
|
|
4240
|
-
label: `Download ${
|
|
4249
|
+
label: `Download ${R}`,
|
|
4241
4250
|
tone: g
|
|
4242
4251
|
}
|
|
4243
4252
|
);
|
|
4244
4253
|
return /* @__PURE__ */ n(
|
|
4245
|
-
|
|
4254
|
+
ni,
|
|
4246
4255
|
{
|
|
4247
4256
|
variant: g,
|
|
4248
|
-
item:
|
|
4257
|
+
item: p,
|
|
4249
4258
|
index: A,
|
|
4250
|
-
onActivate:
|
|
4251
|
-
trailingAction:
|
|
4259
|
+
onActivate: x,
|
|
4260
|
+
trailingAction: L
|
|
4252
4261
|
},
|
|
4253
|
-
`${
|
|
4262
|
+
`${p.src}-${A}`
|
|
4254
4263
|
);
|
|
4255
4264
|
}) }),
|
|
4256
4265
|
/* @__PURE__ */ n(
|
|
4257
|
-
|
|
4266
|
+
Qr,
|
|
4258
4267
|
{
|
|
4259
4268
|
open: f,
|
|
4260
|
-
items:
|
|
4269
|
+
items: v,
|
|
4261
4270
|
initialIndex: c,
|
|
4262
|
-
onClose:
|
|
4271
|
+
onClose: b
|
|
4263
4272
|
}
|
|
4264
4273
|
)
|
|
4265
4274
|
]
|
|
4266
4275
|
}
|
|
4267
4276
|
);
|
|
4268
|
-
},
|
|
4269
|
-
Composer:
|
|
4270
|
-
Sent:
|
|
4271
|
-
Received:
|
|
4272
|
-
},
|
|
4277
|
+
}, si = (e) => /* @__PURE__ */ n(dt, { ...e, state: "composer" }), ai = (e) => /* @__PURE__ */ n(dt, { ...e, state: "sent" }), ri = (e) => /* @__PURE__ */ n(dt, { ...e, state: "received" }), ii = {
|
|
4278
|
+
Composer: si,
|
|
4279
|
+
Sent: ai,
|
|
4280
|
+
Received: ri
|
|
4281
|
+
}, yn = ({
|
|
4273
4282
|
open: e,
|
|
4274
4283
|
items: t,
|
|
4275
4284
|
initialIndex: s = 0,
|
|
4276
4285
|
onClose: a
|
|
4277
4286
|
}) => {
|
|
4278
|
-
const { index: r, prev: i, next: o } =
|
|
4287
|
+
const { index: r, prev: i, next: o } = lt({
|
|
4279
4288
|
length: t.length,
|
|
4280
4289
|
initialIndex: s,
|
|
4281
4290
|
open: e
|
|
@@ -4284,7 +4293,7 @@ const zr = ({
|
|
|
4284
4293
|
[l]
|
|
4285
4294
|
);
|
|
4286
4295
|
return l ? /* @__PURE__ */ h(
|
|
4287
|
-
|
|
4296
|
+
ct,
|
|
4288
4297
|
{
|
|
4289
4298
|
open: e,
|
|
4290
4299
|
onClose: a,
|
|
@@ -4308,7 +4317,7 @@ const zr = ({
|
|
|
4308
4317
|
`${r}:${l.src}`
|
|
4309
4318
|
),
|
|
4310
4319
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4311
|
-
|
|
4320
|
+
ot,
|
|
4312
4321
|
{
|
|
4313
4322
|
onPrev: i,
|
|
4314
4323
|
onNext: o,
|
|
@@ -4319,7 +4328,7 @@ const zr = ({
|
|
|
4319
4328
|
]
|
|
4320
4329
|
}
|
|
4321
4330
|
) : null;
|
|
4322
|
-
},
|
|
4331
|
+
}, oi = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(Ue, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Cn = ({
|
|
4323
4332
|
item: e,
|
|
4324
4333
|
index: t
|
|
4325
4334
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4334,31 +4343,31 @@ const zr = ({
|
|
|
4334
4343
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4335
4344
|
}
|
|
4336
4345
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4337
|
-
|
|
4346
|
+
Yt,
|
|
4338
4347
|
{
|
|
4339
4348
|
className: "size-16 rounded-md text-white/30",
|
|
4340
4349
|
weight: "regular",
|
|
4341
4350
|
"aria-hidden": !0
|
|
4342
4351
|
}
|
|
4343
4352
|
) }),
|
|
4344
|
-
/* @__PURE__ */ n(
|
|
4345
|
-
] }),
|
|
4353
|
+
/* @__PURE__ */ n(oi, {})
|
|
4354
|
+
] }), li = (e, t, s) => ({
|
|
4346
4355
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4347
|
-
content: /* @__PURE__ */ n(
|
|
4348
|
-
}),
|
|
4356
|
+
content: /* @__PURE__ */ n(Cn, { item: e, index: t })
|
|
4357
|
+
}), ci = ({
|
|
4349
4358
|
src: e,
|
|
4350
4359
|
poster: t,
|
|
4351
4360
|
mimeType: s,
|
|
4352
4361
|
preload: a,
|
|
4353
4362
|
items: r
|
|
4354
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4363
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], kn = (e, t) => e.map((s, a) => ({
|
|
4355
4364
|
src: s.src,
|
|
4356
4365
|
poster: s.poster,
|
|
4357
4366
|
mimeType: s.mimeType,
|
|
4358
4367
|
preload: s.preload,
|
|
4359
4368
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4360
|
-
})),
|
|
4361
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } =
|
|
4369
|
+
})), di = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4370
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = Ce(
|
|
4362
4371
|
i
|
|
4363
4372
|
);
|
|
4364
4373
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4369,15 +4378,15 @@ const zr = ({
|
|
|
4369
4378
|
onClick: () => m(0),
|
|
4370
4379
|
"aria-label": "Play video",
|
|
4371
4380
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4372
|
-
children: /* @__PURE__ */ n(
|
|
4381
|
+
children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4373
4382
|
}
|
|
4374
4383
|
),
|
|
4375
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4384
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ne, { onClick: o }) }) : null,
|
|
4376
4385
|
/* @__PURE__ */ n(
|
|
4377
|
-
|
|
4386
|
+
yn,
|
|
4378
4387
|
{
|
|
4379
4388
|
open: l,
|
|
4380
|
-
items:
|
|
4389
|
+
items: kn(
|
|
4381
4390
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4382
4391
|
a
|
|
4383
4392
|
),
|
|
@@ -4386,7 +4395,7 @@ const zr = ({
|
|
|
4386
4395
|
}
|
|
4387
4396
|
)
|
|
4388
4397
|
] });
|
|
4389
|
-
},
|
|
4398
|
+
}, En = ({
|
|
4390
4399
|
state: e,
|
|
4391
4400
|
src: t,
|
|
4392
4401
|
poster: s,
|
|
@@ -4398,16 +4407,16 @@ const zr = ({
|
|
|
4398
4407
|
preload: d,
|
|
4399
4408
|
onClick: m
|
|
4400
4409
|
}) => {
|
|
4401
|
-
const g =
|
|
4410
|
+
const g = ci({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = ye(e), { viewerOpen: f, viewerIndex: c, handleActivate: x, closeViewer: b } = Ce(
|
|
4402
4411
|
m
|
|
4403
4412
|
);
|
|
4404
4413
|
if (g.length === 0)
|
|
4405
4414
|
return null;
|
|
4406
|
-
const
|
|
4407
|
-
(
|
|
4415
|
+
const w = g.map(
|
|
4416
|
+
(v, p) => li(v, p, g.length)
|
|
4408
4417
|
);
|
|
4409
4418
|
return /* @__PURE__ */ h(
|
|
4410
|
-
|
|
4419
|
+
_e,
|
|
4411
4420
|
{
|
|
4412
4421
|
variant: u,
|
|
4413
4422
|
text: o,
|
|
@@ -4415,36 +4424,36 @@ const zr = ({
|
|
|
4415
4424
|
"data-testid": "video-attachment",
|
|
4416
4425
|
children: [
|
|
4417
4426
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4418
|
-
|
|
4427
|
+
wn,
|
|
4419
4428
|
{
|
|
4420
|
-
tiles:
|
|
4421
|
-
onTileActivate:
|
|
4429
|
+
tiles: w,
|
|
4430
|
+
onTileActivate: x,
|
|
4422
4431
|
className: "overflow-hidden rounded-md"
|
|
4423
4432
|
}
|
|
4424
4433
|
) }),
|
|
4425
4434
|
/* @__PURE__ */ n(
|
|
4426
|
-
|
|
4435
|
+
yn,
|
|
4427
4436
|
{
|
|
4428
4437
|
open: f,
|
|
4429
|
-
items:
|
|
4438
|
+
items: kn(g, r),
|
|
4430
4439
|
initialIndex: c,
|
|
4431
|
-
onClose:
|
|
4440
|
+
onClose: b
|
|
4432
4441
|
}
|
|
4433
4442
|
)
|
|
4434
4443
|
]
|
|
4435
4444
|
}
|
|
4436
4445
|
);
|
|
4437
|
-
},
|
|
4438
|
-
Composer:
|
|
4439
|
-
Sent:
|
|
4440
|
-
Received:
|
|
4441
|
-
},
|
|
4442
|
-
Image:
|
|
4443
|
-
Video:
|
|
4444
|
-
Audio:
|
|
4445
|
-
Pdf:
|
|
4446
|
-
File:
|
|
4447
|
-
},
|
|
4446
|
+
}, ui = (e) => /* @__PURE__ */ n(di, { ...e }), mi = (e) => /* @__PURE__ */ n(En, { ...e, state: "sent" }), hi = (e) => /* @__PURE__ */ n(En, { ...e, state: "received" }), fi = {
|
|
4447
|
+
Composer: ui,
|
|
4448
|
+
Sent: mi,
|
|
4449
|
+
Received: hi
|
|
4450
|
+
}, Ai = {
|
|
4451
|
+
Image: Zr,
|
|
4452
|
+
Video: fi,
|
|
4453
|
+
Audio: Mr,
|
|
4454
|
+
Pdf: ii,
|
|
4455
|
+
File: Gr
|
|
4456
|
+
}, gi = ({
|
|
4448
4457
|
question: e,
|
|
4449
4458
|
onClick: t,
|
|
4450
4459
|
loading: s = !1,
|
|
@@ -4456,7 +4465,7 @@ const zr = ({
|
|
|
4456
4465
|
onClick: t,
|
|
4457
4466
|
disabled: s,
|
|
4458
4467
|
style: { backgroundColor: "#E6E5E3" },
|
|
4459
|
-
className:
|
|
4468
|
+
className: y(
|
|
4460
4469
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4461
4470
|
{
|
|
4462
4471
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4466,7 +4475,7 @@ const zr = ({
|
|
|
4466
4475
|
),
|
|
4467
4476
|
children: e
|
|
4468
4477
|
}
|
|
4469
|
-
),
|
|
4478
|
+
), Mi = ({
|
|
4470
4479
|
faqs: e,
|
|
4471
4480
|
onFaqClick: t,
|
|
4472
4481
|
loadingFaqId: s,
|
|
@@ -4495,7 +4504,7 @@ const zr = ({
|
|
|
4495
4504
|
children: [
|
|
4496
4505
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4497
4506
|
l.map((d) => /* @__PURE__ */ n(
|
|
4498
|
-
|
|
4507
|
+
gi,
|
|
4499
4508
|
{
|
|
4500
4509
|
question: d.question,
|
|
4501
4510
|
onClick: () => t(d.id),
|
|
@@ -4509,38 +4518,39 @@ const zr = ({
|
|
|
4509
4518
|
] }) });
|
|
4510
4519
|
};
|
|
4511
4520
|
export {
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4521
|
+
tn as A,
|
|
4522
|
+
qs as B,
|
|
4523
|
+
Ja as C,
|
|
4524
|
+
$s as D,
|
|
4525
|
+
Mi as F,
|
|
4526
|
+
Ii as L,
|
|
4527
|
+
ki as M,
|
|
4528
|
+
be as V,
|
|
4519
4529
|
ge as a,
|
|
4520
4530
|
ie as b,
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4531
|
+
or as c,
|
|
4532
|
+
mn as d,
|
|
4533
|
+
Ei as e,
|
|
4534
|
+
gi as f,
|
|
4525
4535
|
re as g,
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
+
$t as h,
|
|
4537
|
+
Ai as i,
|
|
4538
|
+
Ea as j,
|
|
4539
|
+
Ci as k,
|
|
4540
|
+
Si as l,
|
|
4541
|
+
Pr as m,
|
|
4542
|
+
Rr as n,
|
|
4543
|
+
rr as o,
|
|
4544
|
+
Dr as p,
|
|
4545
|
+
Jt as q,
|
|
4536
4546
|
le as r,
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4547
|
+
an as s,
|
|
4548
|
+
Bs as t,
|
|
4549
|
+
Ti as u,
|
|
4550
|
+
Ws as v,
|
|
4551
|
+
et as w,
|
|
4552
|
+
tt as x,
|
|
4553
|
+
Kt as y,
|
|
4554
|
+
wa as z
|
|
4545
4555
|
};
|
|
4546
|
-
//# sourceMappingURL=index-
|
|
4556
|
+
//# sourceMappingURL=index-BlpDX5fl.js.map
|