@linktr.ee/messaging-react 3.3.12 → 3.3.13-rc-1782276914
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-BFZ1B4yP.js → Card-CqIwxaqP.js} +3 -3
- package/dist/{Card-BFZ1B4yP.js.map → Card-CqIwxaqP.js.map} +1 -1
- package/dist/{Card-BuBLZ_4c.cjs → Card-D3GZ1U9K.cjs} +2 -2
- package/dist/{Card-BuBLZ_4c.cjs.map → Card-D3GZ1U9K.cjs.map} +1 -1
- package/dist/{Card-CsIaqk8-.cjs → Card-D7dNfO0R.cjs} +2 -2
- package/dist/{Card-CsIaqk8-.cjs.map → Card-D7dNfO0R.cjs.map} +1 -1
- package/dist/{Card-B6PddKn5.js → Card-Dj4FxfS8.js} +2 -2
- package/dist/{Card-B6PddKn5.js.map → Card-Dj4FxfS8.js.map} +1 -1
- package/dist/{Card-B2uabBS_.cjs → Card-hH0rGjK-.cjs} +2 -2
- package/dist/{Card-B2uabBS_.cjs.map → Card-hH0rGjK-.cjs.map} +1 -1
- package/dist/{Card-BveKZ9sz.js → Card-mB_H4qWR.js} +2 -2
- package/dist/{Card-BveKZ9sz.js.map → Card-mB_H4qWR.js.map} +1 -1
- package/dist/{LockedThumbnail-5UGGs2Ej.cjs → LockedThumbnail-BxPfcpA1.cjs} +2 -2
- package/dist/{LockedThumbnail-5UGGs2Ej.cjs.map → LockedThumbnail-BxPfcpA1.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BF6rowLR.js → LockedThumbnail-Cr5Ef1lP.js} +2 -2
- package/dist/{LockedThumbnail-BF6rowLR.js.map → LockedThumbnail-Cr5Ef1lP.js.map} +1 -1
- package/dist/{index-xHqGJLy1.js → index-BtwKlrVN.js} +821 -814
- package/dist/index-BtwKlrVN.js.map +1 -0
- package/dist/index-ZypBvHiI.cjs +2 -0
- package/dist/index-ZypBvHiI.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.tsx +50 -35
- package/src/types.ts +14 -0
- package/dist/index-BDIKMoh5.cjs +0 -2
- package/dist/index-BDIKMoh5.cjs.map +0 -1
- package/dist/index-xHqGJLy1.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import V, { createContext as Ge, useContext as Te, useCallback as W, useState as P, useRef as G, useEffect as Y, useId as En, useMemo as ne, Suspense as He } from "react";
|
|
3
3
|
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as In, LinkPreviewsManager as Tt } from "stream-chat";
|
|
5
|
-
import { Chat as Tn, DateSeparator as An, useChannelStateContext as
|
|
6
|
-
import { StarIcon as Fe, DotsThreeIcon as ms, SpinnerGapIcon as Ce, SignOutIcon as hs, ProhibitInsetIcon as Mt, FlagIcon as jt, FileIcon as Vt, ImageIcon as fs, SpeakerHighIcon as gs, VideoCameraIcon as Gt, FileMdIcon as bs, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as xs, FileCsvIcon as ws, FileXlsIcon as _s, FileDocIcon as Ns, FilePdfIcon as ys, CircleNotchIcon as
|
|
7
|
-
import
|
|
5
|
+
import { Chat as Tn, DateSeparator as An, useChannelStateContext as de, useChatContext as Ye, areMessageUIPropsEqual as Mn, useMessageReminder as Rn, useComponentContext as Ut, Attachment as Ln, EditMessageModal as Dn, MessageBlocked as Pn, MessageBouncePrompt as On, MessageDeleted as zn, MessageIsThreadReplyInChannelButtonIndicator as $n, MessageRepliesCountButton as Fn, ReminderNotification as Bn, StreamedMessageText as Un, messageHasAttachments as jn, messageHasReactions as Vn, isDateSeparatorMessage as Gn, isMessageBlocked as Hn, isMessageBounced as Yn, MessageBounceModal as qn, MessageText as At, Poll as Wn, MessageErrorIcon as Xn, useMessageContext as ve, useMessageComposer as Kn, useStateStore as Jn, MessageInput as Zn, useMessageInputContext as Qn, useMessageComposerHasSendableData as es, AttachmentPreviewList as ts, QuotedMessagePreview as ns, TextareaComposer as ss, MessageTimestamp as Le, AIStates as De, useTypingContext as as, useAIState as rs, Channel as is, WithComponents as os, Window as ls, MessageList as cs, ChannelList as ds, InfiniteScroll as us } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Fe, DotsThreeIcon as ms, SpinnerGapIcon as Ce, SignOutIcon as hs, ProhibitInsetIcon as Mt, FlagIcon as jt, FileIcon as Vt, ImageIcon as fs, SpeakerHighIcon as gs, VideoCameraIcon as Gt, FileMdIcon as bs, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as xs, FileCsvIcon as ws, FileXlsIcon as _s, FileDocIcon as Ns, FilePdfIcon as ys, CircleNotchIcon as be, PlayIcon as Be, PauseIcon as Cs, LinkIcon as ks, DownloadSimpleIcon as pe, GiftIcon as Es, ThumbsUpIcon as Ss, ThumbsDownIcon as Is, TrashSimpleIcon as Ts, XIcon as Ae, ArrowUpIcon as As, SparkleIcon as Ue, ProhibitIcon as Ms, ArrowLeftIcon as Rt, PencilSimpleIcon as Rs, CaretLeftIcon as Ls, CaretRightIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
+
import C from "classnames";
|
|
8
8
|
import { MessageActions as Ps, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
|
|
9
9
|
const Yt = Ge({
|
|
10
10
|
service: null,
|
|
@@ -24,10 +24,10 @@ const Yt = Ge({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
27
|
+
var F, I;
|
|
28
28
|
const o = W(
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
29
|
+
(A, ...M) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${A}`, ...M);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,77 +37,77 @@ const Yt = Ge({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [l, d] =
|
|
41
|
-
|
|
40
|
+
const [l, d] = P(null), [m, g] = P(null), [u, f] = P(!1), [c, b] = P(!1), [x, p] = P(null), w = G(!1), _ = G(null), k = G(s);
|
|
41
|
+
k.current = s;
|
|
42
42
|
const S = G(i);
|
|
43
43
|
S.current = i;
|
|
44
|
-
const
|
|
44
|
+
const R = G({
|
|
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
|
+
}), D = G(0);
|
|
50
|
+
D.current++, o("📊 RENDER INFO", {
|
|
51
|
+
renderCount: D.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: R.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: R.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: R.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: R.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), R.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
|
|
65
|
+
const O = G(null);
|
|
66
|
+
a && ((F = O.current) == null ? void 0 : F.apiKey) !== a && (O.current = { apiKey: a, client: new In(a) });
|
|
67
|
+
const T = a ? ((I = O.current) == null ? void 0 : I.client) ?? null : null;
|
|
68
68
|
Y(() => {
|
|
69
|
-
const
|
|
70
|
-
if (!a || !
|
|
69
|
+
const A = D.current, M = k.current;
|
|
70
|
+
if (!a || !T || !M) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: A,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
o("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: A,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
81
|
+
const z = new Sn({
|
|
82
|
+
...M,
|
|
83
83
|
apiKey: a,
|
|
84
84
|
debug: S.current,
|
|
85
|
-
client:
|
|
85
|
+
client: T
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance:
|
|
87
|
+
_.current = z, d(z), o("✅ SERVICE SET", {
|
|
88
|
+
renderCount: A,
|
|
89
|
+
serviceInstance: !!z
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
91
|
+
}, [a, T]);
|
|
92
92
|
const N = G(null);
|
|
93
93
|
Y(() => {
|
|
94
|
-
var
|
|
94
|
+
var M, z;
|
|
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: w.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 (w.current) {
|
|
107
107
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((M = N.current) == null ? void 0 : M.serviceId) === l && ((z = N.current) == null ? void 0 : z.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 Yt = Ge({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), w.current = !0, b(!0), p(null);
|
|
119
119
|
try {
|
|
120
120
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
|
|
121
|
+
const $ = await l.connectUser(t);
|
|
122
|
+
g($), f(!0), N.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 U =
|
|
128
|
-
|
|
126
|
+
} catch ($) {
|
|
127
|
+
const U = $ instanceof Error ? $.message : "Connection failed";
|
|
128
|
+
p(U), o("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
130
|
error: U
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
b(!1), w.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
139
|
}, [l, t, o, u]), Y(() => {
|
|
140
|
-
const
|
|
140
|
+
const A = T;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var M;
|
|
143
|
+
A && (N.current = null, (M = _.current) == null || M.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
146
|
-
const
|
|
145
|
+
}, [T]);
|
|
146
|
+
const E = W(async () => {
|
|
147
147
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!l,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,55 +151,55 @@ const Yt = Ge({
|
|
|
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 }), b(!0);
|
|
155
155
|
try {
|
|
156
156
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const A = await l.connectUser(t);
|
|
158
|
+
g(A), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (A) {
|
|
160
|
+
const M = A instanceof Error ? A.message : "Refresh failed";
|
|
161
|
+
p(M), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: M
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [l, t, o]),
|
|
168
|
+
}, [l, t, o]), L = V.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: !!x,
|
|
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: x,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: E,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
l,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
x,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
E,
|
|
192
192
|
i,
|
|
193
193
|
o
|
|
194
194
|
]);
|
|
195
195
|
return o("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
197
|
-
willRenderChat: !!
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(Yt.Provider, { value:
|
|
196
|
+
renderCount: D.current,
|
|
197
|
+
willRenderChat: !!T,
|
|
198
|
+
contextValueReady: !!L
|
|
199
|
+
}), /* @__PURE__ */ n(Yt.Provider, { value: L, children: T ? /* @__PURE__ */ n(
|
|
200
200
|
Tn,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: T,
|
|
203
203
|
customClasses: {
|
|
204
204
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
205
|
},
|
|
@@ -208,7 +208,7 @@ const Yt = Ge({
|
|
|
208
208
|
) : e });
|
|
209
209
|
}, Os = () => qe(), qt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = P(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
214
|
return Y(() => {
|
|
@@ -279,7 +279,7 @@ function Bs(e) {
|
|
|
279
279
|
const s = Fs(e) % Dt.length;
|
|
280
280
|
return Dt[s];
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const ie = ({
|
|
283
283
|
id: e,
|
|
284
284
|
image: t,
|
|
285
285
|
size: s = 40,
|
|
@@ -288,7 +288,7 @@ const ae = ({
|
|
|
288
288
|
shape: i = "squircle",
|
|
289
289
|
dmAgentEnabled: o = !1
|
|
290
290
|
}) => {
|
|
291
|
-
const l = Bs(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl",
|
|
291
|
+
const l = Bs(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 ae = ({
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
302
|
+
className: C(
|
|
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 ae = ({
|
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: C(
|
|
313
313
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
314
|
a
|
|
315
315
|
),
|
|
@@ -331,14 +331,14 @@ const ae = ({
|
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
334
|
+
className: C(
|
|
335
335
|
"h-full w-full",
|
|
336
336
|
"bg-transparent"
|
|
337
337
|
),
|
|
338
338
|
style: {
|
|
339
339
|
...u,
|
|
340
340
|
...o && {
|
|
341
|
-
borderWidth: `${
|
|
341
|
+
borderWidth: `${g}px`,
|
|
342
342
|
borderStyle: "solid",
|
|
343
343
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
344
344
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
@@ -361,75 +361,75 @@ const ae = ({
|
|
|
361
361
|
onBlockParticipantClick: l,
|
|
362
362
|
onReportParticipantClick: d,
|
|
363
363
|
onActionComplete: m,
|
|
364
|
-
logLabel:
|
|
364
|
+
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } = qe(), c = (
|
|
366
|
+
var F;
|
|
367
|
+
const { service: u, debug: f } = qe(), c = (F = t == null ? void 0 : t.user) == null ? void 0 : F.id, b = !!(a && s && u && c), [x, p] = P(!1), [w, _] = P(null), [k, S] = P(!1), [R, D] = P(!1), O = b && ((w == null ? void 0 : w.participantId) !== c || (w == null ? void 0 : w.service) !== u);
|
|
368
368
|
return Y(() => {
|
|
369
|
-
if (!
|
|
370
|
-
|
|
369
|
+
if (!b || !u || !c) {
|
|
370
|
+
p(!1), _(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let I = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
(
|
|
376
|
+
const A = await u.getBlockedUsers();
|
|
377
|
+
if (I) return;
|
|
378
|
+
p(
|
|
379
|
+
A.some(
|
|
380
|
+
(M) => M.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
383
|
+
} catch (A) {
|
|
384
|
+
I || console.error(`[${g}] Failed to check blocked status:`, A);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
I || _({ participantId: c, service: u });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
I = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
395
|
-
isUpdatingBlockStatus:
|
|
391
|
+
}, [b, u, c, g]), {
|
|
392
|
+
isParticipantBlocked: x,
|
|
393
|
+
isCheckingBlockedStatus: O,
|
|
394
|
+
isLeaving: k,
|
|
395
|
+
isUpdatingBlockStatus: R,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
398
|
-
if (!
|
|
399
|
-
o == null || o(), f && console.log(`[${
|
|
397
|
+
var I;
|
|
398
|
+
if (!k) {
|
|
399
|
+
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), S(!0);
|
|
400
400
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${
|
|
401
|
+
const A = ((I = e._client) == null ? void 0 : I.userID) ?? null;
|
|
402
|
+
await e.hide(A, !1), r && await r(e), m == null || m();
|
|
403
|
+
} catch (A) {
|
|
404
|
+
console.error(`[${g}] Failed to leave conversation`, A);
|
|
405
405
|
} finally {
|
|
406
406
|
S(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
l == null || l(), f && console.log(`[${
|
|
411
|
+
var I, A, M;
|
|
412
|
+
if (!(R || !u)) {
|
|
413
|
+
l == null || l(), f && console.log(`[${g}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), D(!0);
|
|
414
414
|
try {
|
|
415
|
-
await u.blockUser((
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${
|
|
415
|
+
await u.blockUser((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
|
|
416
|
+
} catch (z) {
|
|
417
|
+
console.error(`[${g}] Failed to block member`, z);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
D(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
l == null || l(), f && console.log(`[${
|
|
424
|
+
var I, A, M;
|
|
425
|
+
if (!(R || !u)) {
|
|
426
|
+
l == null || l(), f && console.log(`[${g}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), D(!0);
|
|
427
427
|
try {
|
|
428
|
-
await u.unBlockUser((
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${
|
|
428
|
+
await u.unBlockUser((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
|
|
429
|
+
} catch (z) {
|
|
430
|
+
console.error(`[${g}] Failed to unblock member`, z);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
D(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
@@ -437,7 +437,7 @@ const ae = ({
|
|
|
437
437
|
d == null || d(), m == null || m(), window.open(Us, "_blank", "noopener,noreferrer");
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
},
|
|
440
|
+
}, fe = ({
|
|
441
441
|
variant: e = "default",
|
|
442
442
|
className: t,
|
|
443
443
|
children: s,
|
|
@@ -446,7 +446,7 @@ const ae = ({
|
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
449
|
-
className:
|
|
449
|
+
className: C(
|
|
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
|
|
@@ -465,18 +465,18 @@ const ae = ({
|
|
|
465
465
|
onDeleteConversationClick: l,
|
|
466
466
|
onBlockParticipantClick: d,
|
|
467
467
|
onReportParticipantClick: m,
|
|
468
|
-
customChannelActions:
|
|
468
|
+
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
472
|
-
isParticipantBlocked:
|
|
473
|
-
isCheckingBlockedStatus:
|
|
474
|
-
isLeaving:
|
|
471
|
+
const [f, c] = P(!1), b = G(null), x = En(), p = W(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: w,
|
|
473
|
+
isCheckingBlockedStatus: _,
|
|
474
|
+
isLeaving: k,
|
|
475
475
|
isUpdatingBlockStatus: S,
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
479
|
-
handleReportUser:
|
|
476
|
+
handleLeaveConversation: R,
|
|
477
|
+
handleBlockUser: D,
|
|
478
|
+
handleUnblockUser: O,
|
|
479
|
+
handleReportUser: T
|
|
480
480
|
} = js({
|
|
481
481
|
channel: e,
|
|
482
482
|
participant: t,
|
|
@@ -487,20 +487,20 @@ const ae = ({
|
|
|
487
487
|
onDeleteConversationClick: l,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: m,
|
|
490
|
-
onActionComplete:
|
|
490
|
+
onActionComplete: p,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
493
|
return Y(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
},
|
|
498
|
-
|
|
495
|
+
const E = (F) => {
|
|
496
|
+
b.current && !b.current.contains(F.target) && c(!1);
|
|
497
|
+
}, L = (F) => {
|
|
498
|
+
F.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", E), document.addEventListener("keydown", L), () => {
|
|
501
|
+
document.removeEventListener("mousedown", E), document.removeEventListener("keydown", L);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -508,8 +508,8 @@ const ae = ({
|
|
|
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 ? x : void 0,
|
|
512
|
+
onClick: () => c((E) => !E),
|
|
513
513
|
children: [
|
|
514
514
|
/* @__PURE__ */ n(ms, { className: "size-5 text-black/90" }),
|
|
515
515
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -519,36 +519,36 @@ const ae = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: x,
|
|
523
523
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
524
|
+
className: C(
|
|
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
|
),
|
|
528
528
|
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
|
-
|
|
530
|
+
fe,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
532
|
+
onClick: R,
|
|
533
|
+
disabled: k,
|
|
534
|
+
"aria-busy": k,
|
|
535
535
|
children: [
|
|
536
|
-
|
|
536
|
+
k ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(hs, { 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: _ ? (
|
|
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
|
-
/* @__PURE__ */ h(
|
|
544
|
+
/* @__PURE__ */ h(fe, { disabled: !0, "aria-busy": !0, children: [
|
|
545
545
|
/* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
549
|
-
|
|
548
|
+
) : w ? /* @__PURE__ */ h(
|
|
549
|
+
fe,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: O,
|
|
552
552
|
disabled: S,
|
|
553
553
|
"aria-busy": S,
|
|
554
554
|
children: [
|
|
@@ -557,9 +557,9 @@ const ae = ({
|
|
|
557
557
|
]
|
|
558
558
|
}
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
|
-
|
|
560
|
+
fe,
|
|
561
561
|
{
|
|
562
|
-
onClick:
|
|
562
|
+
onClick: D,
|
|
563
563
|
disabled: S,
|
|
564
564
|
"aria-busy": S,
|
|
565
565
|
children: [
|
|
@@ -568,11 +568,11 @@ const ae = ({
|
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
571
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(fe, { variant: "danger", onClick: T, children: [
|
|
572
572
|
/* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
575
|
-
|
|
575
|
+
g
|
|
576
576
|
] })
|
|
577
577
|
}
|
|
578
578
|
)
|
|
@@ -582,7 +582,7 @@ function Gs(e) {
|
|
|
582
582
|
return e != null && e.length ? e.some((t) => t.type === Ve) ? "down" : e.some((t) => t.type === je) ? "up" : null : null;
|
|
583
583
|
}
|
|
584
584
|
function Hs(e) {
|
|
585
|
-
const { channel: t } =
|
|
585
|
+
const { channel: t } = de(), { client: s } = Ye("useMessageVote"), a = ne(
|
|
586
586
|
() => Gs(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
588
|
), r = W(async () => {
|
|
@@ -619,7 +619,7 @@ function Xt({
|
|
|
619
619
|
const s = e == null ? void 0 : e.text, a = Ys(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const qs =
|
|
622
|
+
const qs = V.lazy(() => import("./Card-Dj4FxfS8.js")), Ws = V.lazy(() => import("./Card-mB_H4qWR.js")), Xs = V.lazy(() => import("./Card-CqIwxaqP.js")), We = () => /* @__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)]",
|
|
@@ -635,7 +635,7 @@ const qs = j.lazy(() => import("./Card-B6PddKn5.js")), Ws = j.lazy(() => import(
|
|
|
635
635
|
[/plain|rtf/, "text"],
|
|
636
636
|
[/markdown/, "markdown"]
|
|
637
637
|
];
|
|
638
|
-
function
|
|
638
|
+
function ae(e) {
|
|
639
639
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
640
|
}
|
|
641
641
|
function Zt(e) {
|
|
@@ -661,11 +661,11 @@ const ea = {
|
|
|
661
661
|
generic: Vt
|
|
662
662
|
};
|
|
663
663
|
function na(e) {
|
|
664
|
-
const t =
|
|
664
|
+
const t = ae(e);
|
|
665
665
|
return t !== "document" ? ea[t] : ta[Zt(e)];
|
|
666
666
|
}
|
|
667
|
-
function
|
|
668
|
-
return
|
|
667
|
+
function ce(e, t) {
|
|
668
|
+
return V.createElement(na(e), t);
|
|
669
669
|
}
|
|
670
670
|
const sa = (e) => {
|
|
671
671
|
var t, s;
|
|
@@ -682,78 +682,78 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const
|
|
685
|
+
const g = ae(t), u = G(null), f = G(null), c = G(null), b = G(r), [x, p] = P(a), [w, _] = P(0), [k, S] = P(!1), [R, D] = P(!1), [O, T] = P(!1), [N, E] = P(!1), [L, F] = P(!0), [I, A] = P(null), M = W(() => {
|
|
686
|
+
T(!1), p(!0);
|
|
687
|
+
}, []), z = W((v) => {
|
|
688
|
+
const y = f.current;
|
|
689
|
+
if (!y) return 0;
|
|
690
|
+
const j = y.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (sa(
|
|
693
|
+
Math.min(1, (sa(v) - j.left) / j.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []), U = (
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
|
|
695
|
+
}, []), $ = W((v) => {
|
|
696
|
+
const y = u.current;
|
|
697
|
+
y && y.duration && (y.currentTime = v * y.duration);
|
|
698
|
+
}, []), U = (v) => {
|
|
699
|
+
v.stopPropagation(), S(!0);
|
|
700
|
+
const y = z(v);
|
|
701
|
+
_(y), $(y);
|
|
702
702
|
};
|
|
703
703
|
Y(() => {
|
|
704
|
-
r !== void 0 && r !==
|
|
704
|
+
r !== void 0 && r !== b.current && (b.current = r, p(r));
|
|
705
705
|
}, [r]), Y(() => {
|
|
706
|
-
if (!
|
|
706
|
+
if (!x) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
711
|
-
const
|
|
712
|
-
|
|
710
|
+
const v = () => {
|
|
711
|
+
const y = u.current;
|
|
712
|
+
y && y.duration && !k && _(y.currentTime / y.duration), c.current = requestAnimationFrame(v);
|
|
713
713
|
};
|
|
714
|
-
return c.current = requestAnimationFrame(
|
|
714
|
+
return c.current = requestAnimationFrame(v), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}) :
|
|
722
|
-
}, [
|
|
723
|
-
if (!
|
|
724
|
-
const
|
|
725
|
-
S(!1),
|
|
717
|
+
}, [x, k]), Y(() => {
|
|
718
|
+
const v = u.current;
|
|
719
|
+
v && (x ? v.play().catch((y) => {
|
|
720
|
+
p(!1), T(!0);
|
|
721
|
+
}) : v.pause());
|
|
722
|
+
}, [x]), Y(() => {
|
|
723
|
+
if (!k) return;
|
|
724
|
+
const v = (j) => _(z(j)), y = (j) => {
|
|
725
|
+
S(!1), $(z(j));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
727
|
+
return window.addEventListener("mousemove", v), window.addEventListener("mouseup", y), window.addEventListener("touchmove", v, { passive: !0 }), window.addEventListener("touchend", y), () => {
|
|
728
|
+
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", y), window.removeEventListener("touchmove", v), window.removeEventListener("touchend", y);
|
|
729
729
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
730
|
+
}, [k, z, $]);
|
|
731
|
+
const H = I ? { aspectRatio: String(I) } : void 0, X = I ? "" : " aspect-video", B = Math.round(w * 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 ${X}`,
|
|
738
|
+
style: H,
|
|
739
|
+
onClick: (v) => {
|
|
740
740
|
if (m) {
|
|
741
|
-
m(
|
|
741
|
+
m(v);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
O || o && p((y) => !y);
|
|
745
745
|
},
|
|
746
|
-
onKeyDown: (
|
|
747
|
-
if (!(
|
|
748
|
-
if (
|
|
749
|
-
m(
|
|
746
|
+
onKeyDown: (v) => {
|
|
747
|
+
if (!(v.key !== "Enter" && v.key !== " ")) {
|
|
748
|
+
if (v.preventDefault(), m) {
|
|
749
|
+
m(v);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
O || o && p((y) => !y);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (
|
|
756
|
+
s && (g === "audio" || L) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,11 +761,11 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (
|
|
764
|
+
!s && (g === "audio" || L) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
768
|
-
/* @__PURE__ */ n("div", { className: "absolute inset-0", children:
|
|
768
|
+
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: g === "audio" ? /* @__PURE__ */ n(
|
|
769
769
|
"audio",
|
|
770
770
|
{
|
|
771
771
|
ref: u,
|
|
@@ -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: () => E(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
E(!1), F(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
781
|
-
onPlay: () =>
|
|
780
|
+
onWaiting: () => E(!0),
|
|
781
|
+
onPlay: () => T(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
783
|
+
i || (p(!1), _(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: () => E(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
E(!1), F(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
801
|
-
onPlay: () =>
|
|
800
|
+
onWaiting: () => E(!0),
|
|
801
|
+
onPlay: () => T(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const v = u.current;
|
|
804
|
+
v instanceof HTMLVideoElement && v.videoWidth && v.videoHeight && A(v.videoWidth / v.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
807
|
+
i || (p(!1), _(0));
|
|
808
808
|
},
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
N && !
|
|
813
|
-
|
|
812
|
+
N && !O && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
|
+
be,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
O && !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: (v) => {
|
|
827
|
+
v.stopPropagation(), M();
|
|
828
828
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
829
|
+
onKeyDown: (v) => {
|
|
830
|
+
v.key !== "Enter" && v.key !== " " || (v.preventDefault(), v.stopPropagation(), M());
|
|
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(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
@@ -837,7 +837,7 @@ const sa = (e) => {
|
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
839
839
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
840
|
+
"aria-valuenow": B,
|
|
841
841
|
"aria-valuemin": 0,
|
|
842
842
|
"aria-valuemax": 100,
|
|
843
843
|
tabIndex: 0,
|
|
@@ -845,15 +845,15 @@ const sa = (e) => {
|
|
|
845
845
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
846
|
onMouseDown: U,
|
|
847
847
|
onTouchStart: U,
|
|
848
|
-
onClick: (
|
|
849
|
-
onKeyDown: (
|
|
850
|
-
|
|
848
|
+
onClick: (v) => v.stopPropagation(),
|
|
849
|
+
onKeyDown: (v) => {
|
|
850
|
+
v.key === "ArrowRight" && $(Math.min(1, w + 0.05)), v.key === "ArrowLeft" && $(Math.max(0, w - 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: `${B}%` }
|
|
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: (v) => {
|
|
867
|
+
v.stopPropagation(), p((y) => !y);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": x ? "Pause" : "Play",
|
|
871
|
+
children: x ? /* @__PURE__ */ n(Cs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Be, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -876,7 +876,7 @@ const sa = (e) => {
|
|
|
876
876
|
{
|
|
877
877
|
role: "slider",
|
|
878
878
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
879
|
+
"aria-valuenow": B,
|
|
880
880
|
"aria-valuemin": 0,
|
|
881
881
|
"aria-valuemax": 100,
|
|
882
882
|
tabIndex: 0,
|
|
@@ -884,22 +884,22 @@ const sa = (e) => {
|
|
|
884
884
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
885
|
onMouseDown: U,
|
|
886
886
|
onTouchStart: U,
|
|
887
|
-
onClick: (
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
887
|
+
onClick: (v) => v.stopPropagation(),
|
|
888
|
+
onMouseEnter: () => D(!0),
|
|
889
|
+
onMouseLeave: () => D(!1),
|
|
890
|
+
onKeyDown: (v) => {
|
|
891
|
+
v.key === "ArrowRight" && $(Math.min(1, w + 0.05)), v.key === "ArrowLeft" && $(Math.max(0, w - 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 ${R || k ? "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: `${B}%` }
|
|
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 ${R || k ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${B}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
]
|
|
@@ -927,7 +927,7 @@ const sa = (e) => {
|
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
928
|
containedImage: o = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const l =
|
|
930
|
+
const l = ae(e), [d, m] = P(!1);
|
|
931
931
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
932
932
|
aa,
|
|
933
933
|
{
|
|
@@ -975,7 +975,7 @@ const sa = (e) => {
|
|
|
975
975
|
"div",
|
|
976
976
|
{
|
|
977
977
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
|
-
children:
|
|
978
|
+
children: ce(e, {
|
|
979
979
|
className: zt(r),
|
|
980
980
|
weight: "regular"
|
|
981
981
|
})
|
|
@@ -992,7 +992,7 @@ const sa = (e) => {
|
|
|
992
992
|
"div",
|
|
993
993
|
{
|
|
994
994
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
|
-
children:
|
|
995
|
+
children: ce(e, {
|
|
996
996
|
className: zt(r),
|
|
997
997
|
weight: "regular"
|
|
998
998
|
})
|
|
@@ -1009,16 +1009,16 @@ const sa = (e) => {
|
|
|
1009
1009
|
action: l,
|
|
1010
1010
|
topLeft: d,
|
|
1011
1011
|
topRight: m,
|
|
1012
|
-
rootRef:
|
|
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 ?? "", b = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
|
-
ref:
|
|
1019
|
+
ref: g,
|
|
1020
1020
|
"data-testid": u,
|
|
1021
|
-
className:
|
|
1021
|
+
className: C(
|
|
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: C("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 && b,
|
|
1036
|
+
"text-white": f && !b
|
|
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
|
-
|
|
1043
|
-
className:
|
|
1042
|
+
ce(r, {
|
|
1043
|
+
className: C(
|
|
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: C(
|
|
1053
1053
|
"text-xs font-medium",
|
|
1054
1054
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1055
|
),
|
|
@@ -1086,7 +1086,7 @@ function da(e) {
|
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
1088
|
const Ke = ({ 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(
|
|
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(V.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
1092
1092
|
{
|
|
@@ -1132,7 +1132,7 @@ const ma = ({
|
|
|
1132
1132
|
url: e,
|
|
1133
1133
|
filename: t
|
|
1134
1134
|
}) => {
|
|
1135
|
-
const [s, a] =
|
|
1135
|
+
const [s, a] = P(!1);
|
|
1136
1136
|
return /* @__PURE__ */ n(
|
|
1137
1137
|
"button",
|
|
1138
1138
|
{
|
|
@@ -1148,32 +1148,32 @@ 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(be, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(V.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ n(pe, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
1158
|
function Ze(e) {
|
|
1159
|
-
var u, f, c,
|
|
1159
|
+
var u, f, c, b;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1161
|
+
(x) => x.type === "video" && x.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(x) => x.type === "image" && x.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1166
|
-
), r = (
|
|
1167
|
-
(
|
|
1165
|
+
(x) => x.type === "audio" && x.asset_url
|
|
1166
|
+
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1167
|
+
(x) => x.type === "file" && x.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
|
-
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,
|
|
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;
|
|
1171
1171
|
return {
|
|
1172
1172
|
resolvedUrl: o,
|
|
1173
1173
|
resolvedType: l,
|
|
1174
1174
|
title: d,
|
|
1175
1175
|
fileSize: m,
|
|
1176
|
-
thumbnailUrl:
|
|
1176
|
+
thumbnailUrl: g
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
1179
|
const sn = ({
|
|
@@ -1211,7 +1211,7 @@ const sn = ({
|
|
|
1211
1211
|
fileSize: a,
|
|
1212
1212
|
thumbnailUrl: r
|
|
1213
1213
|
}) => {
|
|
1214
|
-
const i =
|
|
1214
|
+
const i = ae(t), o = a !== void 0 ? tn(a) : void 0;
|
|
1215
1215
|
return /* @__PURE__ */ n(
|
|
1216
1216
|
en,
|
|
1217
1217
|
{
|
|
@@ -1240,7 +1240,7 @@ const sn = ({
|
|
|
1240
1240
|
const s = Je(e), a = Ze(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,
|
|
1244
1244
|
{
|
|
1245
1245
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1246
1246
|
id: e.user.id,
|
|
@@ -1336,22 +1336,22 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
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", b = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
1341
|
/* @__PURE__ */ n(Es, { size: t ? 14 : 12 }),
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: b })
|
|
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 }),
|
|
1350
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(
|
|
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(xa, { size: o ? 12 : 15 }) });
|
|
1350
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(se, { children: [
|
|
1351
1351
|
m,
|
|
1352
|
-
|
|
1353
|
-
] }) : /* @__PURE__ */ h(
|
|
1354
|
-
|
|
1352
|
+
g
|
|
1353
|
+
] }) : /* @__PURE__ */ h(se, { children: [
|
|
1354
|
+
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
1357
1357
|
}, Ca = ({
|
|
@@ -1363,7 +1363,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1363
|
"button",
|
|
1364
1364
|
{
|
|
1365
1365
|
type: "button",
|
|
1366
|
-
className:
|
|
1366
|
+
className: C("message-vote-button focus-ring", {
|
|
1367
1367
|
"message-vote-button--selected": e === "up"
|
|
1368
1368
|
}),
|
|
1369
1369
|
onClick: t,
|
|
@@ -1377,7 +1377,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
1379
1379
|
type: "button",
|
|
1380
|
-
className:
|
|
1380
|
+
className: C("message-vote-button focus-ring", {
|
|
1381
1381
|
"message-vote-button--selected": e === "down"
|
|
1382
1382
|
}),
|
|
1383
1383
|
onClick: s,
|
|
@@ -1399,77 +1399,77 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1399
1399
|
handleAction: l,
|
|
1400
1400
|
handleOpenThread: d,
|
|
1401
1401
|
handleRetry: m,
|
|
1402
|
-
highlighted:
|
|
1402
|
+
highlighted: g,
|
|
1403
1403
|
isMessageAIGenerated: u,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1407
|
-
threadList:
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal:
|
|
1412
|
-
MessageActions:
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1406
|
+
renderText: b,
|
|
1407
|
+
threadList: x,
|
|
1408
|
+
viewerLanguage: p
|
|
1409
|
+
} = e, { client: w } = Ye("CustomMessage"), { channel: _ } = de("CustomMessage"), { isUnlocking: k, onUnlockClick: S, onFetchSource: R, onDownloadClick: D } = va("LockedAttachment"), [O, T] = P(!1), N = Rn(c.id), { selected: E, voteUp: L, voteDown: F } = Hs(c), {
|
|
1410
|
+
Attachment: I = Ln,
|
|
1411
|
+
EditMessageModal: A = Dn,
|
|
1412
|
+
MessageActions: M,
|
|
1413
|
+
MessageBlocked: z = Pn,
|
|
1414
|
+
MessageBouncePrompt: $ = On,
|
|
1415
1415
|
MessageDeleted: U = zn,
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} = Ut("CustomMessage"),
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: H = $n,
|
|
1417
|
+
MessageRepliesCountButton: X = Fn,
|
|
1418
|
+
ReminderNotification: B = Bn,
|
|
1419
|
+
StreamedMessageText: v = Un,
|
|
1420
|
+
PinIndicator: y
|
|
1421
|
+
} = Ut("CustomMessage"), j = jn(c), q = Vn(c), K = ne(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
|
-
),
|
|
1425
|
-
const
|
|
1424
|
+
), J = ne(() => {
|
|
1425
|
+
const he = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...he] : he;
|
|
1426
1426
|
if (!ke(c)) return ye;
|
|
1427
1427
|
const St = ye.filter((It) => !("type" in It) || !nn(It));
|
|
1428
1428
|
return St.length === ye.length ? ye : St;
|
|
1429
|
-
}, [c]),
|
|
1430
|
-
const
|
|
1431
|
-
return
|
|
1432
|
-
}, [c,
|
|
1429
|
+
}, [c]), oe = ne(() => {
|
|
1430
|
+
const he = Xt({ message: c, viewerLanguage: p });
|
|
1431
|
+
return he === c.text ? c : { ...c, text: he };
|
|
1432
|
+
}, [c, p]);
|
|
1433
1433
|
if (Gn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
1436
|
return /* @__PURE__ */ n(U, { message: c });
|
|
1437
1437
|
if (Hn(c))
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
|
|
1442
|
-
const
|
|
1438
|
+
return /* @__PURE__ */ n(z, {});
|
|
1439
|
+
const Z = !x && !!c.reply_count, re = !x && c.show_in_channel && c.parent_id, ee = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Yn(c);
|
|
1440
|
+
let le;
|
|
1441
|
+
ee ? le = () => m(c) : lt && (le = () => T(!0));
|
|
1442
|
+
const ue = f(), kn = C(
|
|
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
|
+
ue ? "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":
|
|
1450
|
-
"str-chat__message--highlighted":
|
|
1449
|
+
"str-chat__message--has-attachment": j,
|
|
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
1453
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((ft = c == null ? void 0 : c.error) == null ? void 0 : ft.status) !== 403,
|
|
1454
|
-
"str-chat__message-with-thread-link":
|
|
1454
|
+
"str-chat__message-with-thread-link": Z || re,
|
|
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
|
-
), ct = c.poll_id &&
|
|
1460
|
-
return /* @__PURE__ */ h(
|
|
1459
|
+
), ct = c.poll_id && w.polls.fromState(c.poll_id), dt = ya(c), me = ke(c), ut = Na(c), Re = !!(J != null && J.length && !c.quoted_message), mt = me && ue && Re;
|
|
1460
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
A,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1467
|
+
O && /* @__PURE__ */ n(
|
|
1468
1468
|
qn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1471
|
-
onClose: () =>
|
|
1472
|
-
open:
|
|
1470
|
+
MessageBouncePrompt: $,
|
|
1471
|
+
onClose: () => T(!1),
|
|
1472
|
+
open: O
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
@@ -1478,10 +1478,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1478
1478
|
className: kn,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
1480
|
children: [
|
|
1481
|
-
|
|
1482
|
-
!!N && /* @__PURE__ */ n(
|
|
1481
|
+
y && /* @__PURE__ */ n(y, {}),
|
|
1482
|
+
!!N && /* @__PURE__ */ n(B, { reminder: N }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
|
-
|
|
1484
|
+
ie,
|
|
1485
1485
|
{
|
|
1486
1486
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1487
1487
|
id: c.user.id,
|
|
@@ -1489,20 +1489,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1489
1489
|
name: c.user.name || c.user.id,
|
|
1490
1490
|
size: 24,
|
|
1491
1491
|
shape: "circle",
|
|
1492
|
-
dmAgentEnabled:
|
|
1492
|
+
dmAgentEnabled: me
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ n(
|
|
1496
1496
|
"div",
|
|
1497
1497
|
{
|
|
1498
|
-
className:
|
|
1499
|
-
"str-chat__simple-message--error-failed":
|
|
1498
|
+
className: C("str-chat__message-inner", {
|
|
1499
|
+
"str-chat__simple-message--error-failed": ee || lt
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
1502
|
-
onClick:
|
|
1503
|
-
onKeyDown:
|
|
1504
|
-
role:
|
|
1505
|
-
tabIndex:
|
|
1502
|
+
onClick: le,
|
|
1503
|
+
onKeyDown: le,
|
|
1504
|
+
role: le ? "button" : void 0,
|
|
1505
|
+
tabIndex: le ? 0 : void 0,
|
|
1506
1506
|
style: {
|
|
1507
1507
|
// Force margins to 0 to prevent hover layout shift
|
|
1508
1508
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
@@ -1510,8 +1510,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1510
1510
|
marginInlineStart: 0
|
|
1511
1511
|
},
|
|
1512
1512
|
children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
|
-
|
|
1514
|
-
|
|
1513
|
+
ue ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
|
+
M && /* @__PURE__ */ n(M, {}),
|
|
1515
1515
|
/* @__PURE__ */ n(
|
|
1516
1516
|
Ot.Sent,
|
|
1517
1517
|
{
|
|
@@ -1521,8 +1521,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1521
1521
|
amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
|
|
1522
1522
|
detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
|
|
1523
1523
|
paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
|
|
1524
|
-
onPreviewClick: () => S == null ? void 0 : S(c,
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1524
|
+
onPreviewClick: () => S == null ? void 0 : S(c, _),
|
|
1525
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, _))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1535,52 +1535,52 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1535
1535
|
amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
|
|
1536
1536
|
detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
|
|
1537
1537
|
paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
|
|
1538
|
-
isUnlocking:
|
|
1539
|
-
onUnlockClick: () => S == null ? void 0 : S(c,
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1541
|
-
onDownloadClick: () =>
|
|
1538
|
+
isUnlocking: k(c.id),
|
|
1539
|
+
onUnlockClick: () => S == null ? void 0 : S(c, _),
|
|
1540
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, _)),
|
|
1541
|
+
onDownloadClick: () => D == null ? void 0 : D(c, _)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
M && /* @__PURE__ */ n(M, {})
|
|
1545
1545
|
] }),
|
|
1546
1546
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
1547
|
At,
|
|
1548
1548
|
{
|
|
1549
|
-
message:
|
|
1550
|
-
renderText:
|
|
1549
|
+
message: oe,
|
|
1550
|
+
renderText: b
|
|
1551
1551
|
}
|
|
1552
1552
|
) })
|
|
1553
1553
|
] }) : dt ? (
|
|
1554
1554
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
1555
|
/* @__PURE__ */ n(Pe, { 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
|
-
|
|
1557
|
+
me && !mt && /* @__PURE__ */ n(
|
|
1558
1558
|
Pe,
|
|
1559
1559
|
{
|
|
1560
1560
|
message: c,
|
|
1561
1561
|
hasAttachment: Re,
|
|
1562
|
-
isMyMessage:
|
|
1562
|
+
isMyMessage: ue
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
1565
|
ct && /* @__PURE__ */ n(Wn, { poll: ct }),
|
|
1566
|
-
|
|
1567
|
-
|
|
1566
|
+
J != null && J.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
|
+
I,
|
|
1568
1568
|
{
|
|
1569
1569
|
actionHandler: l,
|
|
1570
|
-
attachments:
|
|
1570
|
+
attachments: J
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
|
-
|
|
1574
|
-
|
|
1573
|
+
K ? /* @__PURE__ */ n(
|
|
1574
|
+
v,
|
|
1575
1575
|
{
|
|
1576
|
-
message:
|
|
1577
|
-
renderText:
|
|
1576
|
+
message: oe,
|
|
1577
|
+
renderText: b
|
|
1578
1578
|
}
|
|
1579
1579
|
) : /* @__PURE__ */ n(
|
|
1580
1580
|
At,
|
|
1581
1581
|
{
|
|
1582
|
-
message:
|
|
1583
|
-
renderText:
|
|
1582
|
+
message: oe,
|
|
1583
|
+
renderText: b
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
1586
|
/* @__PURE__ */ n(Xn, {})
|
|
@@ -1588,45 +1588,45 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
1590
|
!ut && !dt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
-
(!
|
|
1591
|
+
(!me || mt) && /* @__PURE__ */ n(
|
|
1592
1592
|
Pe,
|
|
1593
1593
|
{
|
|
1594
1594
|
message: c,
|
|
1595
1595
|
hasAttachment: Re,
|
|
1596
|
-
isMyMessage:
|
|
1596
|
+
isMyMessage: ue
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
|
-
s &&
|
|
1599
|
+
s && me && /* @__PURE__ */ n(
|
|
1600
1600
|
Ca,
|
|
1601
1601
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1602
|
+
selected: E,
|
|
1603
|
+
onVoteUp: L,
|
|
1604
|
+
onVoteDown: F
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
1608
|
-
|
|
1609
|
-
|
|
1608
|
+
Z && /* @__PURE__ */ n(
|
|
1609
|
+
X,
|
|
1610
1610
|
{
|
|
1611
1611
|
onClick: d,
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
|
|
1615
|
+
re && /* @__PURE__ */ n(H, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
1619
1619
|
)
|
|
1620
1620
|
] });
|
|
1621
|
-
}, Ea =
|
|
1621
|
+
}, Ea = V.memo(
|
|
1622
1622
|
ka,
|
|
1623
1623
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Mn(e, t)
|
|
1624
1624
|
), Sa = (e) => {
|
|
1625
|
-
const t =
|
|
1625
|
+
const t = ve("CustomMessage");
|
|
1626
1626
|
return /* @__PURE__ */ n(Ea, { ...t, ...e });
|
|
1627
1627
|
}, Ia = () => {
|
|
1628
1628
|
var s;
|
|
1629
|
-
const { handleDelete: e, message: t } =
|
|
1629
|
+
const { handleDelete: e, message: t } = ve("CustomMessageActions");
|
|
1630
1630
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
1631
|
Ht,
|
|
1632
1632
|
{
|
|
@@ -1638,7 +1638,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1638
1638
|
}
|
|
1639
1639
|
);
|
|
1640
1640
|
}, Ta = () => {
|
|
1641
|
-
const { handleFlag: e } =
|
|
1641
|
+
const { handleFlag: e } = ve("CustomMessageActions");
|
|
1642
1642
|
return /* @__PURE__ */ n(
|
|
1643
1643
|
Ht,
|
|
1644
1644
|
{
|
|
@@ -1651,7 +1651,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1651
1651
|
);
|
|
1652
1652
|
}, Aa = () => {
|
|
1653
1653
|
var t;
|
|
1654
|
-
const { message: e } =
|
|
1654
|
+
const { message: e } = ve("CustomMessageActions");
|
|
1655
1655
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
1656
|
Ps,
|
|
1657
1657
|
{
|
|
@@ -1720,7 +1720,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1720
1720
|
},
|
|
1721
1721
|
r.og_scrape_url
|
|
1722
1722
|
)) }) : null;
|
|
1723
|
-
}, ln =
|
|
1723
|
+
}, ln = V.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
...s,
|
|
@@ -1771,8 +1771,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1771
1771
|
disabledReason: a
|
|
1772
1772
|
}) => {
|
|
1773
1773
|
var o;
|
|
1774
|
-
const { channel: r } =
|
|
1775
|
-
return s ? /* @__PURE__ */ h(
|
|
1774
|
+
const { channel: r } = de(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
|
|
1775
|
+
return s ? /* @__PURE__ */ h(se, { children: [
|
|
1776
1776
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1777
1777
|
t == null ? void 0 : t()
|
|
1778
1778
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1824,7 +1824,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1824
1824
|
if (t === -1)
|
|
1825
1825
|
return e;
|
|
1826
1826
|
const s = t + Oe.length;
|
|
1827
|
-
return /* @__PURE__ */ h(
|
|
1827
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1828
1828
|
e.slice(0, t),
|
|
1829
1829
|
/* @__PURE__ */ n(
|
|
1830
1830
|
"a",
|
|
@@ -1919,16 +1919,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1919
1919
|
De.Generating,
|
|
1920
1920
|
De.ExternalSources
|
|
1921
1921
|
]), qa = ({ threadList: e }) => {
|
|
1922
|
-
var
|
|
1923
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
1922
|
+
var b, x;
|
|
1923
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ye(), { typing: i = {} } = as(), { aiState: o } = rs(t), l = Te(cn);
|
|
1924
1924
|
if (!e && l && Ya.has(o)) {
|
|
1925
|
-
const
|
|
1925
|
+
const p = Wa(t, (b = r.user) == null ? void 0 : b.id);
|
|
1926
1926
|
return /* @__PURE__ */ n(
|
|
1927
1927
|
Ft,
|
|
1928
1928
|
{
|
|
1929
|
-
avatarId: (
|
|
1930
|
-
avatarName: (
|
|
1931
|
-
avatarImage:
|
|
1929
|
+
avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
|
|
1930
|
+
avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
|
|
1931
|
+
avatarImage: p == null ? void 0 : p.image,
|
|
1932
1932
|
testId: "typing-indicator-ai"
|
|
1933
1933
|
}
|
|
1934
1934
|
);
|
|
@@ -1936,19 +1936,19 @@ 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: p, user: w }) => {
|
|
1940
|
+
var _;
|
|
1941
|
+
return (w == null ? void 0 : w.id) !== ((_ = r.user) == null ? void 0 : _.id) && !p;
|
|
1942
1942
|
}
|
|
1943
|
-
),
|
|
1944
|
-
({ parent_id:
|
|
1945
|
-
var
|
|
1946
|
-
return (
|
|
1943
|
+
), g = e ? Object.values(i).filter(
|
|
1944
|
+
({ parent_id: p, user: w }) => {
|
|
1945
|
+
var _;
|
|
1946
|
+
return (w == null ? void 0 : w.id) !== ((_ = r.user) == null ? void 0 : _.id) && p === (a == null ? void 0 : a.id);
|
|
1947
1947
|
}
|
|
1948
|
-
) : [], u = e ?
|
|
1948
|
+
) : [], u = e ? g : m;
|
|
1949
1949
|
if (!u.length)
|
|
1950
1950
|
return null;
|
|
1951
|
-
const f = (
|
|
1951
|
+
const f = (x = u[0]) == null ? void 0 : x.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
|
Ft,
|
|
1954
1954
|
{
|
|
@@ -1973,7 +1973,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1973
1973
|
},
|
|
1974
1974
|
children: /* @__PURE__ */ h("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
1975
1975
|
/* @__PURE__ */ n(
|
|
1976
|
-
|
|
1976
|
+
ie,
|
|
1977
1977
|
{
|
|
1978
1978
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1979
1979
|
id: e,
|
|
@@ -2014,7 +2014,7 @@ function Wa(e, t) {
|
|
|
2014
2014
|
const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2015
2015
|
"div",
|
|
2016
2016
|
{
|
|
2017
|
-
className:
|
|
2017
|
+
className: C("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,12 @@ 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
|
-
), Ee =
|
|
2057
|
+
), Ee = V.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
2058
|
/* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
|
|
2059
2059
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2060
2060
|
] }) }));
|
|
2061
2061
|
Ee.displayName = "LoadingState";
|
|
2062
|
-
const
|
|
2062
|
+
const te = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bt = "Replies instantly with AI assistant", Ja = ({
|
|
2063
2063
|
onBack: e,
|
|
2064
2064
|
showBackButton: t,
|
|
2065
2065
|
showStarButton: s = !1,
|
|
@@ -2070,28 +2070,29 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2070
2070
|
showBlockParticipant: l = !0,
|
|
2071
2071
|
showReportParticipant: d = !0,
|
|
2072
2072
|
onDeleteConversationClick: m,
|
|
2073
|
-
onBlockParticipantClick:
|
|
2073
|
+
onBlockParticipantClick: g,
|
|
2074
2074
|
onReportParticipantClick: u,
|
|
2075
2075
|
customChannelActions: f,
|
|
2076
|
-
|
|
2076
|
+
renderChannelActions: c,
|
|
2077
|
+
showChannelInfo: b = !0
|
|
2077
2078
|
}) => {
|
|
2078
|
-
var
|
|
2079
|
-
const { channel:
|
|
2080
|
-
var
|
|
2081
|
-
const
|
|
2082
|
-
return
|
|
2083
|
-
(
|
|
2084
|
-
var
|
|
2085
|
-
return ((
|
|
2079
|
+
var R, D, O, T, N;
|
|
2080
|
+
const { channel: x } = de(), p = V.useMemo(() => {
|
|
2081
|
+
var F, I;
|
|
2082
|
+
const E = (F = x._client) == null ? void 0 : F.userID;
|
|
2083
|
+
return E ? Object.values(((I = x.state) == null ? void 0 : I.members) || {}).find(
|
|
2084
|
+
(A) => {
|
|
2085
|
+
var M;
|
|
2086
|
+
return ((M = A.user) == null ? void 0 : M.id) && A.user.id !== E;
|
|
2086
2087
|
}
|
|
2087
2088
|
) : void 0;
|
|
2088
|
-
}, [(
|
|
2089
|
+
}, [(R = x._client) == null ? void 0 : R.userID, (D = x.state) == null ? void 0 : D.members]), w = Wt(p == null ? void 0 : p.user), _ = (O = p == null ? void 0 : p.user) == null ? void 0 : O.image, k = qt(x), S = async () => {
|
|
2089
2090
|
try {
|
|
2090
|
-
|
|
2091
|
-
} catch (
|
|
2091
|
+
k ? await x.unpin() : await x.pin();
|
|
2092
|
+
} catch (E) {
|
|
2092
2093
|
console.error(
|
|
2093
2094
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2094
|
-
|
|
2095
|
+
E
|
|
2095
2096
|
);
|
|
2096
2097
|
}
|
|
2097
2098
|
};
|
|
@@ -2100,8 +2101,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2100
2101
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2101
2102
|
"button",
|
|
2102
2103
|
{
|
|
2103
|
-
className:
|
|
2104
|
-
|
|
2104
|
+
className: C(
|
|
2105
|
+
te,
|
|
2105
2106
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2106
2107
|
),
|
|
2107
2108
|
onClick: e || (() => {
|
|
@@ -2113,17 +2114,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2113
2114
|
) }),
|
|
2114
2115
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2115
2116
|
/* @__PURE__ */ n(
|
|
2116
|
-
|
|
2117
|
+
ie,
|
|
2117
2118
|
{
|
|
2118
|
-
id: ((
|
|
2119
|
-
name:
|
|
2119
|
+
id: ((T = p == null ? void 0 : p.user) == null ? void 0 : T.id) || x.id || "unknown",
|
|
2120
|
+
name: w,
|
|
2120
2121
|
image: _,
|
|
2121
|
-
starred: s &&
|
|
2122
|
+
starred: s && k,
|
|
2122
2123
|
dmAgentEnabled: a,
|
|
2123
2124
|
size: 48
|
|
2124
2125
|
}
|
|
2125
2126
|
),
|
|
2126
|
-
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children:
|
|
2127
|
+
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: w }),
|
|
2127
2128
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2128
2129
|
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2129
2130
|
/* @__PURE__ */ n("span", { children: Bt })
|
|
@@ -2133,26 +2134,28 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2133
2134
|
s && /* @__PURE__ */ n(
|
|
2134
2135
|
"button",
|
|
2135
2136
|
{
|
|
2136
|
-
className:
|
|
2137
|
-
onClick:
|
|
2137
|
+
className: te,
|
|
2138
|
+
onClick: S,
|
|
2138
2139
|
type: "button",
|
|
2139
|
-
"aria-label":
|
|
2140
|
+
"aria-label": k ? "Unstar conversation" : "Star conversation",
|
|
2140
2141
|
children: /* @__PURE__ */ n(
|
|
2141
2142
|
Fe,
|
|
2142
2143
|
{
|
|
2143
|
-
className:
|
|
2144
|
-
"text-yellow-600":
|
|
2145
|
-
"text-black/90": !
|
|
2144
|
+
className: C("size-5", {
|
|
2145
|
+
"text-yellow-600": k,
|
|
2146
|
+
"text-black/90": !k
|
|
2146
2147
|
}),
|
|
2147
|
-
weight:
|
|
2148
|
+
weight: k ? "duotone" : "regular"
|
|
2148
2149
|
}
|
|
2149
2150
|
)
|
|
2150
2151
|
}
|
|
2151
2152
|
),
|
|
2152
|
-
|
|
2153
|
+
b && (c ? c({
|
|
2154
|
+
triggerClassName: C(te, "bg-[#F1F0EE]")
|
|
2155
|
+
}) : /* @__PURE__ */ n(
|
|
2153
2156
|
Pt,
|
|
2154
2157
|
{
|
|
2155
|
-
channel:
|
|
2158
|
+
channel: x,
|
|
2156
2159
|
participant: p,
|
|
2157
2160
|
showDeleteConversation: o,
|
|
2158
2161
|
showBlockParticipant: l,
|
|
@@ -2160,12 +2163,12 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2160
2163
|
onLeaveConversation: r,
|
|
2161
2164
|
onBlockParticipant: i,
|
|
2162
2165
|
onDeleteConversationClick: m,
|
|
2163
|
-
onBlockParticipantClick:
|
|
2166
|
+
onBlockParticipantClick: g,
|
|
2164
2167
|
onReportParticipantClick: u,
|
|
2165
2168
|
customChannelActions: f,
|
|
2166
|
-
triggerClassName:
|
|
2169
|
+
triggerClassName: C(te, "bg-[#F1F0EE]")
|
|
2167
2170
|
}
|
|
2168
|
-
)
|
|
2171
|
+
))
|
|
2169
2172
|
] })
|
|
2170
2173
|
] }),
|
|
2171
2174
|
/* @__PURE__ */ h("div", { className: "px-6 py-3 hidden @lg:flex items-center justify-between gap-3 min-h-12 border-b border-b-black/[0.08]", children: [
|
|
@@ -2173,8 +2176,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2173
2176
|
t && e && /* @__PURE__ */ n(
|
|
2174
2177
|
"button",
|
|
2175
2178
|
{
|
|
2176
|
-
className:
|
|
2177
|
-
|
|
2179
|
+
className: C(
|
|
2180
|
+
te,
|
|
2178
2181
|
"messaging-channel-view-back-button-desktop"
|
|
2179
2182
|
),
|
|
2180
2183
|
type: "button",
|
|
@@ -2184,18 +2187,18 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2184
2187
|
}
|
|
2185
2188
|
),
|
|
2186
2189
|
/* @__PURE__ */ n(
|
|
2187
|
-
|
|
2190
|
+
ie,
|
|
2188
2191
|
{
|
|
2189
|
-
id: ((
|
|
2190
|
-
name:
|
|
2192
|
+
id: ((N = p == null ? void 0 : p.user) == null ? void 0 : N.id) || x.id || "unknown",
|
|
2193
|
+
name: w,
|
|
2191
2194
|
image: _,
|
|
2192
|
-
starred: s &&
|
|
2195
|
+
starred: s && k,
|
|
2193
2196
|
dmAgentEnabled: a,
|
|
2194
2197
|
size: 48
|
|
2195
2198
|
}
|
|
2196
2199
|
),
|
|
2197
2200
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2198
|
-
/* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children:
|
|
2201
|
+
/* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: w }),
|
|
2199
2202
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2200
2203
|
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2201
2204
|
/* @__PURE__ */ n("span", { className: "truncate", children: Bt })
|
|
@@ -2206,26 +2209,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2206
2209
|
s && /* @__PURE__ */ n(
|
|
2207
2210
|
"button",
|
|
2208
2211
|
{
|
|
2209
|
-
className:
|
|
2210
|
-
onClick:
|
|
2212
|
+
className: te,
|
|
2213
|
+
onClick: S,
|
|
2211
2214
|
type: "button",
|
|
2212
|
-
"aria-label":
|
|
2215
|
+
"aria-label": k ? "Unstar conversation" : "Star conversation",
|
|
2213
2216
|
children: /* @__PURE__ */ n(
|
|
2214
2217
|
Fe,
|
|
2215
2218
|
{
|
|
2216
|
-
className:
|
|
2217
|
-
"text-yellow-600":
|
|
2218
|
-
"text-black/90": !
|
|
2219
|
+
className: C("size-6", {
|
|
2220
|
+
"text-yellow-600": k,
|
|
2221
|
+
"text-black/90": !k
|
|
2219
2222
|
}),
|
|
2220
|
-
weight:
|
|
2223
|
+
weight: k ? "duotone" : "regular"
|
|
2221
2224
|
}
|
|
2222
2225
|
)
|
|
2223
2226
|
}
|
|
2224
2227
|
),
|
|
2225
|
-
|
|
2228
|
+
b && (c ? c({ triggerClassName: te }) : /* @__PURE__ */ n(
|
|
2226
2229
|
Pt,
|
|
2227
2230
|
{
|
|
2228
|
-
channel:
|
|
2231
|
+
channel: x,
|
|
2229
2232
|
participant: p,
|
|
2230
2233
|
showDeleteConversation: o,
|
|
2231
2234
|
showBlockParticipant: l,
|
|
@@ -2233,12 +2236,12 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2233
2236
|
onLeaveConversation: r,
|
|
2234
2237
|
onBlockParticipant: i,
|
|
2235
2238
|
onDeleteConversationClick: m,
|
|
2236
|
-
onBlockParticipantClick:
|
|
2239
|
+
onBlockParticipantClick: g,
|
|
2237
2240
|
onReportParticipantClick: u,
|
|
2238
2241
|
customChannelActions: f,
|
|
2239
|
-
triggerClassName:
|
|
2242
|
+
triggerClassName: te
|
|
2240
2243
|
}
|
|
2241
|
-
)
|
|
2244
|
+
))
|
|
2242
2245
|
] })
|
|
2243
2246
|
] })
|
|
2244
2247
|
] });
|
|
@@ -2253,56 +2256,57 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2253
2256
|
showDeleteConversation: l = !0,
|
|
2254
2257
|
onDeleteConversationClick: d,
|
|
2255
2258
|
onBlockParticipantClick: m,
|
|
2256
|
-
onReportParticipantClick:
|
|
2259
|
+
onReportParticipantClick: g,
|
|
2257
2260
|
showBlockParticipant: u = !0,
|
|
2258
2261
|
showReportParticipant: f = !0,
|
|
2259
2262
|
composerDisabled: c = !1,
|
|
2260
|
-
composerDisabledReason:
|
|
2261
|
-
showStarButton:
|
|
2262
|
-
chatbotVotingEnabled:
|
|
2263
|
-
renderChannelBanner:
|
|
2264
|
-
customChannelActions:
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2263
|
+
composerDisabledReason: b,
|
|
2264
|
+
showStarButton: x = !1,
|
|
2265
|
+
chatbotVotingEnabled: p = !1,
|
|
2266
|
+
renderChannelBanner: w,
|
|
2267
|
+
customChannelActions: _,
|
|
2268
|
+
renderChannelActions: k,
|
|
2269
|
+
renderMessage: S,
|
|
2270
|
+
dmAgentEnabled: R = !1,
|
|
2271
|
+
viewerLanguage: D,
|
|
2272
|
+
showChannelInfo: O = !0
|
|
2269
2273
|
}) => {
|
|
2270
|
-
var
|
|
2271
|
-
const { channel:
|
|
2272
|
-
var
|
|
2273
|
-
const
|
|
2274
|
-
return
|
|
2275
|
-
(
|
|
2276
|
-
var
|
|
2277
|
-
return ((
|
|
2274
|
+
var M, z, $, U, H, X;
|
|
2275
|
+
const { channel: T } = de(), N = V.useMemo(() => {
|
|
2276
|
+
var y, j;
|
|
2277
|
+
const B = (y = T._client) == null ? void 0 : y.userID;
|
|
2278
|
+
return B ? Object.values(((j = T.state) == null ? void 0 : j.members) || {}).find(
|
|
2279
|
+
(q) => {
|
|
2280
|
+
var K;
|
|
2281
|
+
return ((K = q.user) == null ? void 0 : K.id) && q.user.id !== B;
|
|
2278
2282
|
}
|
|
2279
2283
|
) : void 0;
|
|
2280
|
-
}, [(
|
|
2281
|
-
var
|
|
2282
|
-
const
|
|
2283
|
-
return
|
|
2284
|
-
var
|
|
2285
|
-
return ((
|
|
2284
|
+
}, [(M = T._client) == null ? void 0 : M.userID, (z = T.state) == null ? void 0 : z.members]), E = V.useMemo(() => {
|
|
2285
|
+
var y, j;
|
|
2286
|
+
const B = (y = T._client) == null ? void 0 : y.userID;
|
|
2287
|
+
return B ? Object.values(((j = T.state) == null ? void 0 : j.members) || {}).find((q) => {
|
|
2288
|
+
var K;
|
|
2289
|
+
return ((K = q.user) == null ? void 0 : K.id) === B;
|
|
2286
2290
|
}) : void 0;
|
|
2287
|
-
}, [($ =
|
|
2288
|
-
(
|
|
2289
|
-
const { message:
|
|
2291
|
+
}, [($ = T._client) == null ? void 0 : $.userID, (U = T.state) == null ? void 0 : U.members]), L = ((H = E == null ? void 0 : E.user) == null ? void 0 : H.is_account) ?? (E == null ? void 0 : E.is_account), F = ((X = N == null ? void 0 : N.user) == null ? void 0 : X.is_account) ?? (N == null ? void 0 : N.is_account), I = R && L === !1 && F === !0, A = W(
|
|
2292
|
+
(B) => {
|
|
2293
|
+
const { message: v } = ve("ChannelView"), y = /* @__PURE__ */ n(
|
|
2290
2294
|
Sa,
|
|
2291
2295
|
{
|
|
2292
|
-
...
|
|
2293
|
-
chatbotVotingEnabled:
|
|
2294
|
-
viewerLanguage:
|
|
2296
|
+
...B,
|
|
2297
|
+
chatbotVotingEnabled: p,
|
|
2298
|
+
viewerLanguage: D
|
|
2295
2299
|
}
|
|
2296
2300
|
);
|
|
2297
|
-
return !
|
|
2301
|
+
return !S || !v ? y : S(y, v);
|
|
2298
2302
|
},
|
|
2299
|
-
[
|
|
2303
|
+
[p, S, D]
|
|
2300
2304
|
);
|
|
2301
|
-
return /* @__PURE__ */ n(
|
|
2305
|
+
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2302
2306
|
os,
|
|
2303
2307
|
{
|
|
2304
2308
|
overrides: {
|
|
2305
|
-
Message:
|
|
2309
|
+
Message: A,
|
|
2306
2310
|
MessageActions: Aa
|
|
2307
2311
|
},
|
|
2308
2312
|
children: /* @__PURE__ */ h(ls, { children: [
|
|
@@ -2311,9 +2315,9 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2311
2315
|
{
|
|
2312
2316
|
onBack: e,
|
|
2313
2317
|
showBackButton: t,
|
|
2314
|
-
|
|
2315
|
-
showStarButton:
|
|
2316
|
-
dmAgentEnabled:
|
|
2318
|
+
showChannelInfo: O,
|
|
2319
|
+
showStarButton: x,
|
|
2320
|
+
dmAgentEnabled: I,
|
|
2317
2321
|
onLeaveConversation: i,
|
|
2318
2322
|
onBlockParticipant: o,
|
|
2319
2323
|
showDeleteConversation: l,
|
|
@@ -2321,11 +2325,12 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2321
2325
|
showReportParticipant: f,
|
|
2322
2326
|
onDeleteConversationClick: d,
|
|
2323
2327
|
onBlockParticipantClick: m,
|
|
2324
|
-
onReportParticipantClick:
|
|
2325
|
-
customChannelActions:
|
|
2328
|
+
onReportParticipantClick: g,
|
|
2329
|
+
customChannelActions: _,
|
|
2330
|
+
renderChannelActions: k
|
|
2326
2331
|
}
|
|
2327
2332
|
) }, "lt-channel-header"),
|
|
2328
|
-
|
|
2333
|
+
w ? /* @__PURE__ */ n(V.Fragment, { children: w() }, "lt-channel-banner") : null,
|
|
2329
2334
|
/* @__PURE__ */ n(
|
|
2330
2335
|
"div",
|
|
2331
2336
|
{
|
|
@@ -2334,23 +2339,23 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2334
2339
|
},
|
|
2335
2340
|
"lt-channel-message-list"
|
|
2336
2341
|
),
|
|
2337
|
-
r ? /* @__PURE__ */ n(
|
|
2342
|
+
r ? /* @__PURE__ */ n(V.Fragment, { children: r(T) }, "lt-channel-conversation-footer") : null,
|
|
2338
2343
|
/* @__PURE__ */ n(
|
|
2339
2344
|
Oa,
|
|
2340
2345
|
{
|
|
2341
2346
|
...s && {
|
|
2342
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2347
|
+
renderActions: () => s == null ? void 0 : s(T)
|
|
2343
2348
|
},
|
|
2344
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2349
|
+
renderFooter: () => a == null ? void 0 : a(T),
|
|
2345
2350
|
disabled: c,
|
|
2346
|
-
disabledReason:
|
|
2351
|
+
disabledReason: b
|
|
2347
2352
|
},
|
|
2348
2353
|
"lt-channel-message-input"
|
|
2349
2354
|
)
|
|
2350
2355
|
] })
|
|
2351
2356
|
}
|
|
2352
2357
|
) });
|
|
2353
|
-
}, dn =
|
|
2358
|
+
}, dn = V.memo(
|
|
2354
2359
|
({
|
|
2355
2360
|
channel: e,
|
|
2356
2361
|
onBack: t,
|
|
@@ -2362,68 +2367,69 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2362
2367
|
onBlockParticipant: l,
|
|
2363
2368
|
className: d,
|
|
2364
2369
|
CustomChannelEmptyState: m = Xa,
|
|
2365
|
-
showDeleteConversation:
|
|
2370
|
+
showDeleteConversation: g = !0,
|
|
2366
2371
|
onDeleteConversationClick: u,
|
|
2367
2372
|
onBlockParticipantClick: f,
|
|
2368
2373
|
onReportParticipantClick: c,
|
|
2369
|
-
showBlockParticipant:
|
|
2370
|
-
showReportParticipant:
|
|
2371
|
-
composerDisabled:
|
|
2372
|
-
composerDisabledReason:
|
|
2373
|
-
dmAgentEnabled:
|
|
2374
|
-
messageMetadata:
|
|
2374
|
+
showBlockParticipant: b = !0,
|
|
2375
|
+
showReportParticipant: x = !0,
|
|
2376
|
+
composerDisabled: p = !1,
|
|
2377
|
+
composerDisabledReason: w,
|
|
2378
|
+
dmAgentEnabled: _,
|
|
2379
|
+
messageMetadata: k,
|
|
2375
2380
|
onMessageSent: S,
|
|
2376
|
-
showStarButton:
|
|
2377
|
-
chatbotVotingEnabled:
|
|
2378
|
-
renderChannelBanner:
|
|
2379
|
-
customChannelActions:
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2381
|
+
showStarButton: R = !1,
|
|
2382
|
+
chatbotVotingEnabled: D = !1,
|
|
2383
|
+
renderChannelBanner: O,
|
|
2384
|
+
customChannelActions: T,
|
|
2385
|
+
renderChannelActions: N,
|
|
2386
|
+
renderMessage: E,
|
|
2387
|
+
onMessageLinkClick: L,
|
|
2388
|
+
sendButton: F,
|
|
2389
|
+
attachmentPreviewList: I,
|
|
2390
|
+
viewerLanguage: A,
|
|
2391
|
+
showChannelInfo: M = !0
|
|
2386
2392
|
}) => {
|
|
2387
|
-
const
|
|
2388
|
-
async (
|
|
2389
|
-
var
|
|
2390
|
-
const
|
|
2391
|
-
...
|
|
2392
|
-
...
|
|
2393
|
-
...
|
|
2393
|
+
const z = W(
|
|
2394
|
+
async (U, H, X) => {
|
|
2395
|
+
var K;
|
|
2396
|
+
const B = ((K = e.data) == null ? void 0 : K.chatbot_paused) === !0, v = _ && !B, y = {
|
|
2397
|
+
...H,
|
|
2398
|
+
...v && { silent: !0 },
|
|
2399
|
+
...k && {
|
|
2394
2400
|
metadata: {
|
|
2395
|
-
...
|
|
2396
|
-
...
|
|
2401
|
+
...H.metadata ?? {},
|
|
2402
|
+
...k
|
|
2397
2403
|
}
|
|
2398
2404
|
}
|
|
2399
|
-
},
|
|
2405
|
+
}, j = {
|
|
2400
2406
|
...X,
|
|
2401
|
-
...
|
|
2402
|
-
},
|
|
2403
|
-
return S == null || S(
|
|
2407
|
+
...v && { skip_push: !0 }
|
|
2408
|
+
}, q = await e.sendMessage(y, j);
|
|
2409
|
+
return S == null || S(q), q;
|
|
2404
2410
|
},
|
|
2405
|
-
[e,
|
|
2411
|
+
[e, _, k, S]
|
|
2406
2412
|
), $ = G(null);
|
|
2407
2413
|
return Y(() => {
|
|
2408
|
-
if (!
|
|
2409
|
-
const
|
|
2410
|
-
if (!
|
|
2411
|
-
const
|
|
2412
|
-
const
|
|
2413
|
-
if (!
|
|
2414
|
-
const
|
|
2415
|
-
|
|
2414
|
+
if (!L) return;
|
|
2415
|
+
const U = $.current;
|
|
2416
|
+
if (!U) return;
|
|
2417
|
+
const H = (X) => {
|
|
2418
|
+
const B = X.target, v = B == null ? void 0 : B.closest("a[href]"), y = v == null ? void 0 : v.getAttribute("href");
|
|
2419
|
+
if (!y) return;
|
|
2420
|
+
const j = v == null ? void 0 : v.closest("[data-message-id]"), q = j == null ? void 0 : j.getAttribute("data-message-id"), K = q ? e.state.messages.find((J) => J.id === q) : void 0;
|
|
2421
|
+
L(y, K);
|
|
2416
2422
|
};
|
|
2417
|
-
return
|
|
2418
|
-
}, [
|
|
2423
|
+
return U.addEventListener("click", H), () => U.removeEventListener("click", H);
|
|
2424
|
+
}, [L, e]), /* @__PURE__ */ n(
|
|
2419
2425
|
"div",
|
|
2420
2426
|
{
|
|
2421
2427
|
ref: $,
|
|
2422
|
-
className:
|
|
2428
|
+
className: C(
|
|
2423
2429
|
"messaging-channel-view h-full flex flex-col",
|
|
2424
2430
|
d
|
|
2425
2431
|
),
|
|
2426
|
-
children: /* @__PURE__ */ n(cn.Provider, { value:
|
|
2432
|
+
children: /* @__PURE__ */ n(cn.Provider, { value: _ ?? !1, children: /* @__PURE__ */ n(
|
|
2427
2433
|
is,
|
|
2428
2434
|
{
|
|
2429
2435
|
channel: e,
|
|
@@ -2432,9 +2438,9 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2432
2438
|
LoadingIndicator: Ee,
|
|
2433
2439
|
DateSeparator: Vs,
|
|
2434
2440
|
TypingIndicator: qa,
|
|
2435
|
-
doSendMessageRequest:
|
|
2436
|
-
...
|
|
2437
|
-
...
|
|
2441
|
+
doSendMessageRequest: z,
|
|
2442
|
+
...F ? { SendButton: F } : {},
|
|
2443
|
+
...I ? { AttachmentPreviewList: I } : {},
|
|
2438
2444
|
children: /* @__PURE__ */ n(
|
|
2439
2445
|
Za,
|
|
2440
2446
|
{
|
|
@@ -2446,22 +2452,23 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2446
2452
|
onLeaveConversation: o,
|
|
2447
2453
|
onBlockParticipant: l,
|
|
2448
2454
|
CustomChannelEmptyState: m,
|
|
2449
|
-
showDeleteConversation:
|
|
2455
|
+
showDeleteConversation: g,
|
|
2450
2456
|
onDeleteConversationClick: u,
|
|
2451
2457
|
onBlockParticipantClick: f,
|
|
2452
2458
|
onReportParticipantClick: c,
|
|
2453
|
-
showBlockParticipant:
|
|
2454
|
-
showReportParticipant:
|
|
2455
|
-
composerDisabled:
|
|
2456
|
-
composerDisabledReason:
|
|
2457
|
-
showStarButton:
|
|
2458
|
-
dmAgentEnabled:
|
|
2459
|
-
chatbotVotingEnabled:
|
|
2460
|
-
renderChannelBanner:
|
|
2461
|
-
customChannelActions:
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2459
|
+
showBlockParticipant: b,
|
|
2460
|
+
showReportParticipant: x,
|
|
2461
|
+
composerDisabled: p,
|
|
2462
|
+
composerDisabledReason: w,
|
|
2463
|
+
showStarButton: R,
|
|
2464
|
+
dmAgentEnabled: _,
|
|
2465
|
+
chatbotVotingEnabled: D,
|
|
2466
|
+
renderChannelBanner: O,
|
|
2467
|
+
customChannelActions: T,
|
|
2468
|
+
renderChannelActions: N,
|
|
2469
|
+
renderMessage: E,
|
|
2470
|
+
viewerLanguage: A,
|
|
2471
|
+
showChannelInfo: M
|
|
2465
2472
|
}
|
|
2466
2473
|
)
|
|
2467
2474
|
}
|
|
@@ -2471,7 +2478,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2471
2478
|
}
|
|
2472
2479
|
);
|
|
2473
2480
|
dn.displayName = "ChannelView";
|
|
2474
|
-
const
|
|
2481
|
+
const ge = V.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: [
|
|
2475
2482
|
/* @__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: "⚠️" }) }),
|
|
2476
2483
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2477
2484
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2485,7 +2492,7 @@ const fe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2485
2492
|
}
|
|
2486
2493
|
)
|
|
2487
2494
|
] }) }));
|
|
2488
|
-
|
|
2495
|
+
ge.displayName = "ErrorState";
|
|
2489
2496
|
const ki = ({
|
|
2490
2497
|
capabilities: e = {},
|
|
2491
2498
|
renderMessageInputActions: t,
|
|
@@ -2497,130 +2504,130 @@ const ki = ({
|
|
|
2497
2504
|
CustomChannelEmptyState: l,
|
|
2498
2505
|
onBlockParticipantClick: d,
|
|
2499
2506
|
onReportParticipantClick: m,
|
|
2500
|
-
dmAgentEnabled:
|
|
2507
|
+
dmAgentEnabled: g,
|
|
2501
2508
|
onMessageSent: u,
|
|
2502
2509
|
chatbotVotingEnabled: f = !1,
|
|
2503
2510
|
viewerLanguage: c,
|
|
2504
|
-
renderChannelBanner:
|
|
2505
|
-
customChannelActions:
|
|
2506
|
-
renderMessage:
|
|
2507
|
-
onMessageLinkClick:
|
|
2508
|
-
showChannelInfo:
|
|
2511
|
+
renderChannelBanner: b,
|
|
2512
|
+
customChannelActions: x,
|
|
2513
|
+
renderMessage: p,
|
|
2514
|
+
onMessageLinkClick: w,
|
|
2515
|
+
showChannelInfo: _
|
|
2509
2516
|
}) => {
|
|
2510
2517
|
const {
|
|
2511
|
-
client:
|
|
2518
|
+
client: k,
|
|
2512
2519
|
isConnected: S,
|
|
2513
|
-
isLoading:
|
|
2514
|
-
error:
|
|
2515
|
-
refreshConnection:
|
|
2516
|
-
service:
|
|
2520
|
+
isLoading: R,
|
|
2521
|
+
error: D,
|
|
2522
|
+
refreshConnection: O,
|
|
2523
|
+
service: T,
|
|
2517
2524
|
debug: N
|
|
2518
|
-
} = Os(), [
|
|
2519
|
-
|
|
2525
|
+
} = Os(), [E, L] = P(null), [F, I] = P(null), [A, M] = P(!1), { showDeleteConversation: z = !0 } = e, $ = G(o);
|
|
2526
|
+
$.current = o;
|
|
2520
2527
|
const U = G(a);
|
|
2521
2528
|
U.current = a;
|
|
2522
|
-
const
|
|
2529
|
+
const H = G(null), X = G(null);
|
|
2523
2530
|
Y(() => {
|
|
2524
|
-
|
|
2525
|
-
}, [
|
|
2526
|
-
if (!
|
|
2527
|
-
const
|
|
2528
|
-
if (!
|
|
2529
|
-
const
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2531
|
+
X.current = E;
|
|
2532
|
+
}, [E]), Y(() => {
|
|
2533
|
+
if (!k || !S) return;
|
|
2534
|
+
const y = k.userID;
|
|
2535
|
+
if (!y) return;
|
|
2536
|
+
const j = `${y}::${i}`;
|
|
2537
|
+
if (H.current === j) return;
|
|
2538
|
+
H.current = j;
|
|
2532
2539
|
const q = () => {
|
|
2533
|
-
|
|
2540
|
+
H.current === j && (H.current = null);
|
|
2534
2541
|
};
|
|
2535
2542
|
(async () => {
|
|
2536
|
-
var
|
|
2543
|
+
var J, oe;
|
|
2537
2544
|
try {
|
|
2538
2545
|
N && console.log(
|
|
2539
2546
|
"[MessagingShell] Loading initial conversation with:",
|
|
2540
2547
|
i
|
|
2541
2548
|
);
|
|
2542
|
-
const
|
|
2549
|
+
const Z = await k.queryChannels(
|
|
2543
2550
|
{
|
|
2544
2551
|
type: "messaging",
|
|
2545
|
-
members: { $eq: [
|
|
2552
|
+
members: { $eq: [y, i] }
|
|
2546
2553
|
},
|
|
2547
2554
|
{},
|
|
2548
2555
|
{ limit: 1 }
|
|
2549
2556
|
);
|
|
2550
|
-
if (
|
|
2551
|
-
|
|
2557
|
+
if (Z.length > 0) {
|
|
2558
|
+
L(Z[0]), I(null), (J = U.current) == null || J.call(U, Z[0]), N && console.log(
|
|
2552
2559
|
"[MessagingShell] Initial conversation loaded:",
|
|
2553
|
-
|
|
2560
|
+
Z[0].id
|
|
2554
2561
|
);
|
|
2555
2562
|
return;
|
|
2556
2563
|
}
|
|
2557
|
-
const
|
|
2558
|
-
if (!
|
|
2559
|
-
q(),
|
|
2564
|
+
const re = $.current;
|
|
2565
|
+
if (!re || !T) {
|
|
2566
|
+
q(), I("No conversation found with this account"), N && console.log(
|
|
2560
2567
|
"[MessagingShell] No conversation found for:",
|
|
2561
2568
|
i
|
|
2562
2569
|
);
|
|
2563
2570
|
return;
|
|
2564
2571
|
}
|
|
2565
2572
|
try {
|
|
2566
|
-
const
|
|
2567
|
-
id:
|
|
2568
|
-
name:
|
|
2569
|
-
phone:
|
|
2573
|
+
const ee = await T.startChannelWithParticipant({
|
|
2574
|
+
id: re.id,
|
|
2575
|
+
name: re.name,
|
|
2576
|
+
phone: re.phone
|
|
2570
2577
|
});
|
|
2571
|
-
|
|
2578
|
+
L(ee), I(null), (oe = U.current) == null || oe.call(U, ee), N && console.log(
|
|
2572
2579
|
"[MessagingShell] Channel created and loaded:",
|
|
2573
|
-
|
|
2580
|
+
ee.id
|
|
2574
2581
|
);
|
|
2575
|
-
} catch (
|
|
2582
|
+
} catch (ee) {
|
|
2576
2583
|
console.error(
|
|
2577
2584
|
"[MessagingShell] Failed to create conversation:",
|
|
2578
|
-
|
|
2579
|
-
), q(),
|
|
2585
|
+
ee
|
|
2586
|
+
), q(), I("Failed to create conversation");
|
|
2580
2587
|
}
|
|
2581
|
-
} catch (
|
|
2588
|
+
} catch (Z) {
|
|
2582
2589
|
console.error(
|
|
2583
2590
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2584
|
-
|
|
2585
|
-
), q(),
|
|
2591
|
+
Z
|
|
2592
|
+
), q(), X.current || I("Failed to load conversation");
|
|
2586
2593
|
}
|
|
2587
2594
|
})();
|
|
2588
|
-
}, [i,
|
|
2589
|
-
const
|
|
2590
|
-
|
|
2591
|
-
const
|
|
2592
|
-
var
|
|
2593
|
-
|
|
2595
|
+
}, [i, k, S, T, N]);
|
|
2596
|
+
const B = G(r);
|
|
2597
|
+
B.current = r;
|
|
2598
|
+
const v = W(() => {
|
|
2599
|
+
var y;
|
|
2600
|
+
L(null), M(!0), (y = B.current) == null || y.call(B);
|
|
2594
2601
|
}, []);
|
|
2595
|
-
return
|
|
2596
|
-
|
|
2602
|
+
return R ? /* @__PURE__ */ n(Ee, {}) : D ? /* @__PURE__ */ n(ge, { message: D, onBack: O }) : !S || !k ? /* @__PURE__ */ n(
|
|
2603
|
+
ge,
|
|
2597
2604
|
{
|
|
2598
2605
|
message: "Not connected to messaging service",
|
|
2599
|
-
onBack:
|
|
2606
|
+
onBack: O
|
|
2600
2607
|
}
|
|
2601
|
-
) :
|
|
2608
|
+
) : F ? /* @__PURE__ */ n(ge, { message: F }) : A && !E ? /* @__PURE__ */ n(ge, { message: "Conversation ended" }) : E ? /* @__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(
|
|
2602
2609
|
dn,
|
|
2603
2610
|
{
|
|
2604
|
-
channel:
|
|
2611
|
+
channel: E,
|
|
2605
2612
|
renderMessageInputActions: t,
|
|
2606
2613
|
renderConversationFooter: s,
|
|
2607
|
-
renderChannelBanner:
|
|
2608
|
-
onLeaveConversation:
|
|
2609
|
-
onBlockParticipant:
|
|
2614
|
+
renderChannelBanner: b,
|
|
2615
|
+
onLeaveConversation: v,
|
|
2616
|
+
onBlockParticipant: v,
|
|
2610
2617
|
CustomChannelEmptyState: l,
|
|
2611
|
-
showDeleteConversation:
|
|
2618
|
+
showDeleteConversation: z,
|
|
2612
2619
|
onBlockParticipantClick: d,
|
|
2613
2620
|
onReportParticipantClick: m,
|
|
2614
|
-
dmAgentEnabled:
|
|
2621
|
+
dmAgentEnabled: g,
|
|
2615
2622
|
onMessageSent: u,
|
|
2616
2623
|
chatbotVotingEnabled: f,
|
|
2617
2624
|
viewerLanguage: c,
|
|
2618
|
-
customChannelActions:
|
|
2619
|
-
renderMessage:
|
|
2620
|
-
onMessageLinkClick:
|
|
2621
|
-
showChannelInfo:
|
|
2625
|
+
customChannelActions: x,
|
|
2626
|
+
renderMessage: p,
|
|
2627
|
+
onMessageLinkClick: w,
|
|
2628
|
+
showChannelInfo: _
|
|
2622
2629
|
},
|
|
2623
|
-
|
|
2630
|
+
E.id
|
|
2624
2631
|
) }) }) : /* @__PURE__ */ n(Ee, {});
|
|
2625
2632
|
};
|
|
2626
2633
|
function Qa(e) {
|
|
@@ -2629,14 +2636,14 @@ function Qa(e) {
|
|
|
2629
2636
|
for (const s of t)
|
|
2630
2637
|
e.state.addMessageSorted(s.message);
|
|
2631
2638
|
}
|
|
2632
|
-
const un =
|
|
2639
|
+
const un = V.createContext({
|
|
2633
2640
|
selectedChannel: void 0,
|
|
2634
2641
|
onChannelSelect: () => {
|
|
2635
2642
|
},
|
|
2636
2643
|
debug: !1,
|
|
2637
2644
|
renderMessagePreview: void 0,
|
|
2638
2645
|
viewerLanguage: void 0
|
|
2639
|
-
}), er = un.Provider, tr = () =>
|
|
2646
|
+
}), er = un.Provider, tr = () => V.useContext(un), nr = (e, t) => {
|
|
2640
2647
|
const s = new Date(
|
|
2641
2648
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2642
2649
|
), r = new Date(
|
|
@@ -2657,9 +2664,9 @@ const un = j.createContext({
|
|
|
2657
2664
|
day: "numeric",
|
|
2658
2665
|
year: "2-digit"
|
|
2659
2666
|
});
|
|
2660
|
-
}, mn =
|
|
2667
|
+
}, mn = V.memo(
|
|
2661
2668
|
({ channel: e, unread: t }) => {
|
|
2662
|
-
var
|
|
2669
|
+
var D, O, T;
|
|
2663
2670
|
const {
|
|
2664
2671
|
selectedChannel: s,
|
|
2665
2672
|
onChannelSelect: a,
|
|
@@ -2669,39 +2676,39 @@ const un = j.createContext({
|
|
|
2669
2676
|
} = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2670
2677
|
e && a(e);
|
|
2671
2678
|
}, m = (N) => {
|
|
2672
|
-
const
|
|
2673
|
-
!
|
|
2674
|
-
}, u = Object.values(((
|
|
2679
|
+
const E = N.key === "Enter" || N.key === " ", L = N.repeat;
|
|
2680
|
+
!E || L || (N.preventDefault(), d());
|
|
2681
|
+
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
2675
2682
|
(N) => {
|
|
2676
|
-
var
|
|
2677
|
-
return ((
|
|
2683
|
+
var E, L;
|
|
2684
|
+
return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== ((L = e == null ? void 0 : e._client) == null ? void 0 : L.userID);
|
|
2678
2685
|
}
|
|
2679
|
-
), f = Wt(u == null ? void 0 : u.user), c = (
|
|
2680
|
-
var
|
|
2681
|
-
const N = (
|
|
2686
|
+
), f = Wt(u == null ? void 0 : u.user), c = (O = u == null ? void 0 : u.user) == null ? void 0 : O.image, b = (() => {
|
|
2687
|
+
var E;
|
|
2688
|
+
const N = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
|
|
2682
2689
|
if (N != null && N.length) {
|
|
2683
|
-
for (let
|
|
2684
|
-
if (N[
|
|
2690
|
+
for (let L = N.length - 1; L >= 0; L--)
|
|
2691
|
+
if (N[L].type !== "system") return N[L];
|
|
2685
2692
|
}
|
|
2686
|
-
})(),
|
|
2687
|
-
var
|
|
2693
|
+
})(), p = (() => {
|
|
2694
|
+
var A, M, z, $;
|
|
2688
2695
|
const N = Xt({
|
|
2689
|
-
message:
|
|
2696
|
+
message: b,
|
|
2690
2697
|
viewerLanguage: o
|
|
2691
2698
|
});
|
|
2692
|
-
if (((
|
|
2693
|
-
if (((
|
|
2694
|
-
if (((
|
|
2699
|
+
if (((A = b == null ? void 0 : b.metadata) == null ? void 0 : A.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
|
|
2700
|
+
if (((M = b == null ? void 0 : b.metadata) == null ? void 0 : M.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
|
|
2701
|
+
if (((z = b == null ? void 0 : b.metadata) == null ? void 0 : z.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
|
|
2695
2702
|
if (N) return N;
|
|
2696
|
-
const
|
|
2697
|
-
return
|
|
2698
|
-
})(),
|
|
2703
|
+
const I = ($ = b == null ? void 0 : b.attachments) == null ? void 0 : $[0];
|
|
2704
|
+
return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2705
|
+
})(), w = b != null && b.created_at ? sr(new Date(b.created_at)) : "", _ = b ? ke(b) : !1, k = i ? i(b, p) : `${_ ? "✨ " : ""}${p}`, S = qt(e), R = t ?? 0;
|
|
2699
2706
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2700
2707
|
channelId: e == null ? void 0 : e.id,
|
|
2701
2708
|
isSelected: l,
|
|
2702
2709
|
participantName: f,
|
|
2703
|
-
unreadCount:
|
|
2704
|
-
hasTimestamp: !!
|
|
2710
|
+
unreadCount: R,
|
|
2711
|
+
hasTimestamp: !!w
|
|
2705
2712
|
}), /* @__PURE__ */ n(
|
|
2706
2713
|
"div",
|
|
2707
2714
|
{
|
|
@@ -2709,7 +2716,7 @@ const un = j.createContext({
|
|
|
2709
2716
|
tabIndex: 0,
|
|
2710
2717
|
onClick: d,
|
|
2711
2718
|
onKeyDown: m,
|
|
2712
|
-
className:
|
|
2719
|
+
className: C(
|
|
2713
2720
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2714
2721
|
{
|
|
2715
2722
|
"bg-black/[0.04]": l,
|
|
@@ -2718,9 +2725,9 @@ const un = j.createContext({
|
|
|
2718
2725
|
),
|
|
2719
2726
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2720
2727
|
/* @__PURE__ */ n(
|
|
2721
|
-
|
|
2728
|
+
ie,
|
|
2722
2729
|
{
|
|
2723
|
-
id: ((
|
|
2730
|
+
id: ((T = u == null ? void 0 : u.user) == null ? void 0 : T.id) || e.id || "unknown",
|
|
2724
2731
|
name: f,
|
|
2725
2732
|
image: c,
|
|
2726
2733
|
size: 48,
|
|
@@ -2732,7 +2739,7 @@ const un = j.createContext({
|
|
|
2732
2739
|
/* @__PURE__ */ h(
|
|
2733
2740
|
"h3",
|
|
2734
2741
|
{
|
|
2735
|
-
className:
|
|
2742
|
+
className: C(
|
|
2736
2743
|
"text-sm font-medium truncate text-[#191918]"
|
|
2737
2744
|
),
|
|
2738
2745
|
children: [
|
|
@@ -2741,11 +2748,11 @@ const un = j.createContext({
|
|
|
2741
2748
|
]
|
|
2742
2749
|
}
|
|
2743
2750
|
),
|
|
2744
|
-
|
|
2751
|
+
w && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: w })
|
|
2745
2752
|
] }),
|
|
2746
2753
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2747
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2748
|
-
|
|
2754
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: k }),
|
|
2755
|
+
R > 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: R > 99 ? "99+" : R })
|
|
2749
2756
|
] })
|
|
2750
2757
|
] })
|
|
2751
2758
|
] })
|
|
@@ -2754,7 +2761,7 @@ const un = j.createContext({
|
|
|
2754
2761
|
}
|
|
2755
2762
|
);
|
|
2756
2763
|
mn.displayName = "CustomChannelPreview";
|
|
2757
|
-
const ar = { last_message_at: -1 }, rr =
|
|
2764
|
+
const ar = { last_message_at: -1 }, rr = V.memo(
|
|
2758
2765
|
({
|
|
2759
2766
|
onChannelSelect: e,
|
|
2760
2767
|
selectedChannel: t,
|
|
@@ -2767,22 +2774,22 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2767
2774
|
renderMessagePreview: d,
|
|
2768
2775
|
viewerLanguage: m
|
|
2769
2776
|
}) => {
|
|
2770
|
-
const
|
|
2771
|
-
|
|
2772
|
-
const { debug: u = !1 } = qe(), f =
|
|
2773
|
-
(
|
|
2774
|
-
for (const
|
|
2775
|
-
Qa(
|
|
2776
|
-
return r ? r(
|
|
2777
|
+
const g = V.useRef(0);
|
|
2778
|
+
g.current++;
|
|
2779
|
+
const { debug: u = !1 } = qe(), f = V.useCallback(
|
|
2780
|
+
(b) => {
|
|
2781
|
+
for (const x of b)
|
|
2782
|
+
Qa(x);
|
|
2783
|
+
return r ? r(b) : b;
|
|
2777
2784
|
},
|
|
2778
2785
|
[r]
|
|
2779
2786
|
);
|
|
2780
2787
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
2781
|
-
renderCount:
|
|
2788
|
+
renderCount: g.current,
|
|
2782
2789
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2783
2790
|
filters: s
|
|
2784
2791
|
});
|
|
2785
|
-
const c =
|
|
2792
|
+
const c = V.useMemo(
|
|
2786
2793
|
() => ({
|
|
2787
2794
|
selectedChannel: t,
|
|
2788
2795
|
onChannelSelect: e,
|
|
@@ -2801,7 +2808,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2801
2808
|
return /* @__PURE__ */ n(
|
|
2802
2809
|
"div",
|
|
2803
2810
|
{
|
|
2804
|
-
className:
|
|
2811
|
+
className: C(
|
|
2805
2812
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2806
2813
|
o
|
|
2807
2814
|
),
|
|
@@ -2840,7 +2847,7 @@ const lr = {
|
|
|
2840
2847
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2841
2848
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2842
2849
|
}, cr = ({ variant: e, cta: t }) => {
|
|
2843
|
-
const s =
|
|
2850
|
+
const s = C(
|
|
2844
2851
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2845
2852
|
lr[e]
|
|
2846
2853
|
), a = Qe(t.href);
|
|
@@ -2885,12 +2892,12 @@ const lr = {
|
|
|
2885
2892
|
cta: o,
|
|
2886
2893
|
trailingAction: l
|
|
2887
2894
|
}) => {
|
|
2888
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "",
|
|
2889
|
-
if (!
|
|
2890
|
-
const
|
|
2895
|
+
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 !== "", b = o != null;
|
|
2896
|
+
if (!g && !u && !c && !b) return null;
|
|
2897
|
+
const p = C(
|
|
2891
2898
|
"truncate text-base font-medium leading-6",
|
|
2892
2899
|
d && !t ? ur : dr[e]
|
|
2893
|
-
),
|
|
2900
|
+
), w = C(
|
|
2894
2901
|
"truncate text-xs leading-4",
|
|
2895
2902
|
mr[e]
|
|
2896
2903
|
);
|
|
@@ -2898,19 +2905,19 @@ const lr = {
|
|
|
2898
2905
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
2899
2906
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2900
2907
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2901
|
-
|
|
2908
|
+
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2902
2909
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2903
|
-
/* @__PURE__ */ n("p", { className:
|
|
2910
|
+
/* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
|
|
2904
2911
|
] }),
|
|
2905
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2912
|
+
u && /* @__PURE__ */ n("p", { className: w, children: a })
|
|
2906
2913
|
] }),
|
|
2907
|
-
!
|
|
2914
|
+
!b && c && /* @__PURE__ */ n("p", { className: w, children: f })
|
|
2908
2915
|
] }),
|
|
2909
2916
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2910
2917
|
] }),
|
|
2911
2918
|
o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
|
|
2912
2919
|
] });
|
|
2913
|
-
}, hr =
|
|
2920
|
+
}, hr = C(
|
|
2914
2921
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2915
2922
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2916
2923
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2928,7 +2935,7 @@ const lr = {
|
|
|
2928
2935
|
bgClassName: l,
|
|
2929
2936
|
"data-testid": d
|
|
2930
2937
|
}) => {
|
|
2931
|
-
const m = s != null || a != null,
|
|
2938
|
+
const m = s != null || a != null, g = C(
|
|
2932
2939
|
hr,
|
|
2933
2940
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2934
2941
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -2945,7 +2952,7 @@ const lr = {
|
|
|
2945
2952
|
rel: "noopener noreferrer",
|
|
2946
2953
|
onClick: a,
|
|
2947
2954
|
"data-testid": d,
|
|
2948
|
-
className:
|
|
2955
|
+
className: g,
|
|
2949
2956
|
children: [
|
|
2950
2957
|
t,
|
|
2951
2958
|
u
|
|
@@ -2959,7 +2966,7 @@ const lr = {
|
|
|
2959
2966
|
onClick: a,
|
|
2960
2967
|
"aria-label": r,
|
|
2961
2968
|
"data-testid": d,
|
|
2962
|
-
className:
|
|
2969
|
+
className: C(g, "text-left"),
|
|
2963
2970
|
children: [
|
|
2964
2971
|
t,
|
|
2965
2972
|
u
|
|
@@ -2970,7 +2977,7 @@ const lr = {
|
|
|
2970
2977
|
{
|
|
2971
2978
|
ref: i,
|
|
2972
2979
|
"data-testid": d,
|
|
2973
|
-
className:
|
|
2980
|
+
className: g,
|
|
2974
2981
|
children: [
|
|
2975
2982
|
t,
|
|
2976
2983
|
u
|
|
@@ -2983,9 +2990,9 @@ const lr = {
|
|
|
2983
2990
|
}, gr = {
|
|
2984
2991
|
dark: "size-16 text-white/25",
|
|
2985
2992
|
light: "size-16 text-black/25"
|
|
2986
|
-
}, Me = (e, t) => !!t && !!e &&
|
|
2993
|
+
}, Me = (e, t) => !!t && !!e && ae(e) === "audio", hn = (e, t) => {
|
|
2987
2994
|
if (!t || !e) return !1;
|
|
2988
|
-
const s =
|
|
2995
|
+
const s = ae(e);
|
|
2989
2996
|
return s === "video" || s === "audio";
|
|
2990
2997
|
}, tt = "bg-[#F2F3F4]", Ie = ({
|
|
2991
2998
|
variant: e,
|
|
@@ -2996,7 +3003,7 @@ const lr = {
|
|
|
2996
3003
|
topLeft: i,
|
|
2997
3004
|
topRight: o
|
|
2998
3005
|
}) => {
|
|
2999
|
-
const l =
|
|
3006
|
+
const l = ae(r), d = !!s && l === "video";
|
|
3000
3007
|
return Me(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3001
3008
|
"audio",
|
|
3002
3009
|
{
|
|
@@ -3009,7 +3016,7 @@ const lr = {
|
|
|
3009
3016
|
) }) : /* @__PURE__ */ h(
|
|
3010
3017
|
"div",
|
|
3011
3018
|
{
|
|
3012
|
-
className:
|
|
3019
|
+
className: C(
|
|
3013
3020
|
"relative h-[180px] w-full overflow-hidden",
|
|
3014
3021
|
d && "bg-black"
|
|
3015
3022
|
),
|
|
@@ -3036,11 +3043,11 @@ const lr = {
|
|
|
3036
3043
|
) : /* @__PURE__ */ n(
|
|
3037
3044
|
"div",
|
|
3038
3045
|
{
|
|
3039
|
-
className:
|
|
3046
|
+
className: C(
|
|
3040
3047
|
"flex h-full w-full items-center justify-center",
|
|
3041
3048
|
fr[e]
|
|
3042
3049
|
),
|
|
3043
|
-
children:
|
|
3050
|
+
children: ce(r, {
|
|
3044
3051
|
className: gr[e],
|
|
3045
3052
|
weight: "regular"
|
|
3046
3053
|
})
|
|
@@ -3062,19 +3069,19 @@ const lr = {
|
|
|
3062
3069
|
layout: l = "featured",
|
|
3063
3070
|
appIcon: d,
|
|
3064
3071
|
cta: m,
|
|
3065
|
-
onDismiss:
|
|
3072
|
+
onDismiss: g,
|
|
3066
3073
|
onEditClick: u
|
|
3067
3074
|
}) => {
|
|
3068
|
-
const f = l === "classic", c = Me(r, o),
|
|
3075
|
+
const f = l === "classic", c = Me(r, o), b = g ? /* @__PURE__ */ n(
|
|
3069
3076
|
"button",
|
|
3070
3077
|
{
|
|
3071
3078
|
type: "button",
|
|
3072
|
-
onClick:
|
|
3079
|
+
onClick: g,
|
|
3073
3080
|
"aria-label": "Dismiss attachment",
|
|
3074
3081
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3075
3082
|
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3076
3083
|
}
|
|
3077
|
-
) : void 0,
|
|
3084
|
+
) : void 0, x = u ? /* @__PURE__ */ n(
|
|
3078
3085
|
"button",
|
|
3079
3086
|
{
|
|
3080
3087
|
type: "button",
|
|
@@ -3094,12 +3101,12 @@ const lr = {
|
|
|
3094
3101
|
mimeType: r
|
|
3095
3102
|
}
|
|
3096
3103
|
) }),
|
|
3097
|
-
|
|
3104
|
+
b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
|
|
3098
3105
|
] }) }) : /* @__PURE__ */ h(
|
|
3099
3106
|
Se,
|
|
3100
3107
|
{
|
|
3101
3108
|
variant: "dark",
|
|
3102
|
-
topRight: f ?
|
|
3109
|
+
topRight: f ? b : void 0,
|
|
3103
3110
|
children: [
|
|
3104
3111
|
!f && /* @__PURE__ */ n(
|
|
3105
3112
|
Ie,
|
|
@@ -3109,7 +3116,7 @@ const lr = {
|
|
|
3109
3116
|
sourceUrl: o,
|
|
3110
3117
|
title: e,
|
|
3111
3118
|
mimeType: r,
|
|
3112
|
-
topRight:
|
|
3119
|
+
topRight: b
|
|
3113
3120
|
}
|
|
3114
3121
|
),
|
|
3115
3122
|
/* @__PURE__ */ n(
|
|
@@ -3122,7 +3129,7 @@ const lr = {
|
|
|
3122
3129
|
url: a,
|
|
3123
3130
|
appIcon: d,
|
|
3124
3131
|
cta: m,
|
|
3125
|
-
trailingAction:
|
|
3132
|
+
trailingAction: x
|
|
3126
3133
|
}
|
|
3127
3134
|
)
|
|
3128
3135
|
]
|
|
@@ -3140,11 +3147,11 @@ const lr = {
|
|
|
3140
3147
|
cta: d,
|
|
3141
3148
|
onClick: m
|
|
3142
3149
|
}) => {
|
|
3143
|
-
const
|
|
3150
|
+
const g = hn(a, i), u = Qe(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Me(a, i) ? tt : void 0, x = d && m ? {
|
|
3144
3151
|
...d,
|
|
3145
3152
|
onClick: () => {
|
|
3146
|
-
var
|
|
3147
|
-
m(), (
|
|
3153
|
+
var p;
|
|
3154
|
+
m(), (p = d.onClick) == null || p.call(d);
|
|
3148
3155
|
}
|
|
3149
3156
|
} : d;
|
|
3150
3157
|
return /* @__PURE__ */ h(
|
|
@@ -3154,7 +3161,7 @@ const lr = {
|
|
|
3154
3161
|
href: f,
|
|
3155
3162
|
onClick: c,
|
|
3156
3163
|
ariaLabel: e ?? "Open attachment preview",
|
|
3157
|
-
bgClassName:
|
|
3164
|
+
bgClassName: b,
|
|
3158
3165
|
"data-testid": "link-attachment",
|
|
3159
3166
|
children: [
|
|
3160
3167
|
o === "featured" && /* @__PURE__ */ n(
|
|
@@ -3175,7 +3182,7 @@ const lr = {
|
|
|
3175
3182
|
description: t,
|
|
3176
3183
|
url: s,
|
|
3177
3184
|
appIcon: l,
|
|
3178
|
-
cta:
|
|
3185
|
+
cta: x
|
|
3179
3186
|
}
|
|
3180
3187
|
)
|
|
3181
3188
|
]
|
|
@@ -3192,15 +3199,15 @@ const lr = {
|
|
|
3192
3199
|
layout: l = "featured",
|
|
3193
3200
|
appIcon: d,
|
|
3194
3201
|
cta: m,
|
|
3195
|
-
onClick:
|
|
3202
|
+
onClick: g
|
|
3196
3203
|
}) => {
|
|
3197
|
-
const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0,
|
|
3204
|
+
const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
|
|
3198
3205
|
return /* @__PURE__ */ h(
|
|
3199
3206
|
Se,
|
|
3200
3207
|
{
|
|
3201
3208
|
variant: "dark",
|
|
3202
3209
|
href: c,
|
|
3203
|
-
onClick:
|
|
3210
|
+
onClick: b,
|
|
3204
3211
|
bgClassName: Me(r, o) ? tt : void 0,
|
|
3205
3212
|
children: [
|
|
3206
3213
|
l === "featured" && /* @__PURE__ */ n(
|
|
@@ -3254,7 +3261,7 @@ const lr = {
|
|
|
3254
3261
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3255
3262
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3256
3263
|
}
|
|
3257
|
-
},
|
|
3264
|
+
}, xe = ({
|
|
3258
3265
|
variant: e,
|
|
3259
3266
|
text: t,
|
|
3260
3267
|
bordered: s = !0,
|
|
@@ -3269,7 +3276,7 @@ const lr = {
|
|
|
3269
3276
|
{
|
|
3270
3277
|
"data-testid": o,
|
|
3271
3278
|
"data-group-position": a,
|
|
3272
|
-
className:
|
|
3279
|
+
className: C(
|
|
3273
3280
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3274
3281
|
// and keeps the document / image / audio bubbles visually
|
|
3275
3282
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3289,7 +3296,7 @@ const lr = {
|
|
|
3289
3296
|
l ? /* @__PURE__ */ n(
|
|
3290
3297
|
"p",
|
|
3291
3298
|
{
|
|
3292
|
-
className:
|
|
3299
|
+
className: C(
|
|
3293
3300
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3294
3301
|
// the same font family + size as `.str-chat__message-text`
|
|
3295
3302
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3306,7 +3313,7 @@ const lr = {
|
|
|
3306
3313
|
]
|
|
3307
3314
|
}
|
|
3308
3315
|
);
|
|
3309
|
-
},
|
|
3316
|
+
}, we = ({
|
|
3310
3317
|
onClick: e,
|
|
3311
3318
|
variant: t = "overlay",
|
|
3312
3319
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3318,13 +3325,13 @@ const lr = {
|
|
|
3318
3325
|
a.stopPropagation(), e();
|
|
3319
3326
|
},
|
|
3320
3327
|
"aria-label": s,
|
|
3321
|
-
className:
|
|
3328
|
+
className: C(
|
|
3322
3329
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3323
3330
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3324
3331
|
),
|
|
3325
3332
|
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3326
3333
|
}
|
|
3327
|
-
),
|
|
3334
|
+
), _e = (e) => e === "received" ? "light" : "dark", Si = ({
|
|
3328
3335
|
firstOfGroup: e,
|
|
3329
3336
|
endOfGroup: t,
|
|
3330
3337
|
groupedByUser: s
|
|
@@ -3356,18 +3363,18 @@ const lr = {
|
|
|
3356
3363
|
preload: l,
|
|
3357
3364
|
onDismiss: d
|
|
3358
3365
|
}) => {
|
|
3359
|
-
const m =
|
|
3366
|
+
const m = _e(e), g = e === "composer" && !!d, u = Cr({ src: t, mimeType: s, filename: a, items: r });
|
|
3360
3367
|
if (u.length === 0)
|
|
3361
3368
|
return null;
|
|
3362
3369
|
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
3363
3370
|
return /* @__PURE__ */ n(
|
|
3364
|
-
|
|
3371
|
+
xe,
|
|
3365
3372
|
{
|
|
3366
3373
|
variant: m,
|
|
3367
3374
|
text: i,
|
|
3368
3375
|
groupPosition: o,
|
|
3369
3376
|
"data-testid": "audio-attachment",
|
|
3370
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3377
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
|
|
3371
3378
|
kr,
|
|
3372
3379
|
{
|
|
3373
3380
|
item: c,
|
|
@@ -3375,10 +3382,10 @@ const lr = {
|
|
|
3375
3382
|
trailingAction: (
|
|
3376
3383
|
// Composer only supports a single attachment, so the
|
|
3377
3384
|
// dismiss control sits on the only player.
|
|
3378
|
-
|
|
3385
|
+
g && b === 0 ? /* @__PURE__ */ n(we, { onClick: d, variant: "inline" }) : void 0
|
|
3379
3386
|
)
|
|
3380
3387
|
},
|
|
3381
|
-
`${c.src}-${
|
|
3388
|
+
`${c.src}-${b}`
|
|
3382
3389
|
)) })
|
|
3383
3390
|
}
|
|
3384
3391
|
);
|
|
@@ -3409,7 +3416,7 @@ function Rr(e, t) {
|
|
|
3409
3416
|
}
|
|
3410
3417
|
}
|
|
3411
3418
|
if (!e) return;
|
|
3412
|
-
if (
|
|
3419
|
+
if (ae(e) === "document") {
|
|
3413
3420
|
const r = Zt(e), i = Mr[r];
|
|
3414
3421
|
if (i) return i;
|
|
3415
3422
|
if (e === "application/octet-stream") return;
|
|
@@ -3422,7 +3429,7 @@ function Lr(e, t, s) {
|
|
|
3422
3429
|
const a = Rr(e, t), r = typeof s == "number" && s > 0 ? Ar(s) : void 0;
|
|
3423
3430
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3424
3431
|
}
|
|
3425
|
-
function
|
|
3432
|
+
function Q(e) {
|
|
3426
3433
|
try {
|
|
3427
3434
|
const s = new URL(e).pathname.split("/").pop();
|
|
3428
3435
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3449,16 +3456,16 @@ const Dr = {
|
|
|
3449
3456
|
activateLabel: o,
|
|
3450
3457
|
trailingAction: l
|
|
3451
3458
|
}) => {
|
|
3452
|
-
const d = s ?? t ?? "File", m = Lr(a, t, r),
|
|
3459
|
+
const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
|
|
3453
3460
|
"div",
|
|
3454
3461
|
{
|
|
3455
|
-
className:
|
|
3462
|
+
className: C(
|
|
3456
3463
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3457
3464
|
Pr[e]
|
|
3458
3465
|
),
|
|
3459
3466
|
"aria-hidden": !0,
|
|
3460
|
-
children:
|
|
3461
|
-
className:
|
|
3467
|
+
children: ce(a, {
|
|
3468
|
+
className: C("size-6", Or[e]),
|
|
3462
3469
|
weight: "regular"
|
|
3463
3470
|
})
|
|
3464
3471
|
}
|
|
@@ -3467,7 +3474,7 @@ const Dr = {
|
|
|
3467
3474
|
m ? /* @__PURE__ */ n(
|
|
3468
3475
|
"p",
|
|
3469
3476
|
{
|
|
3470
|
-
className:
|
|
3477
|
+
className: C(
|
|
3471
3478
|
"truncate text-xs leading-4",
|
|
3472
3479
|
Dr[e]
|
|
3473
3480
|
),
|
|
@@ -3480,17 +3487,17 @@ const Dr = {
|
|
|
3480
3487
|
type: "button",
|
|
3481
3488
|
onClick: i,
|
|
3482
3489
|
"aria-label": o,
|
|
3483
|
-
className:
|
|
3490
|
+
className: C(
|
|
3484
3491
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3485
3492
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3486
3493
|
),
|
|
3487
3494
|
children: [
|
|
3488
|
-
|
|
3495
|
+
g,
|
|
3489
3496
|
u
|
|
3490
3497
|
]
|
|
3491
3498
|
}
|
|
3492
|
-
) : /* @__PURE__ */ h(
|
|
3493
|
-
|
|
3499
|
+
) : /* @__PURE__ */ h(se, { children: [
|
|
3500
|
+
g,
|
|
3494
3501
|
u
|
|
3495
3502
|
] });
|
|
3496
3503
|
return /* @__PURE__ */ h("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
@@ -3499,7 +3506,7 @@ const Dr = {
|
|
|
3499
3506
|
] });
|
|
3500
3507
|
};
|
|
3501
3508
|
async function gn(e, t) {
|
|
3502
|
-
const s = t ??
|
|
3509
|
+
const s = t ?? Q(e);
|
|
3503
3510
|
try {
|
|
3504
3511
|
const a = await fetch(e, { mode: "cors" });
|
|
3505
3512
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -3526,7 +3533,7 @@ const zr = ({
|
|
|
3526
3533
|
onActivate: a,
|
|
3527
3534
|
trailingAction: r
|
|
3528
3535
|
}) => {
|
|
3529
|
-
const i = t.filename ??
|
|
3536
|
+
const i = t.filename ?? Q(t.src);
|
|
3530
3537
|
return /* @__PURE__ */ n(
|
|
3531
3538
|
fn,
|
|
3532
3539
|
{
|
|
@@ -3551,52 +3558,52 @@ const zr = ({
|
|
|
3551
3558
|
text: l,
|
|
3552
3559
|
groupPosition: d,
|
|
3553
3560
|
onClick: m,
|
|
3554
|
-
onDismiss:
|
|
3561
|
+
onDismiss: g
|
|
3555
3562
|
}) => {
|
|
3556
|
-
const u =
|
|
3563
|
+
const u = _e(e), f = e === "composer" && !!g, c = zr({
|
|
3557
3564
|
src: t,
|
|
3558
3565
|
filename: s,
|
|
3559
3566
|
fileSize: a,
|
|
3560
3567
|
mimeType: r,
|
|
3561
3568
|
title: i,
|
|
3562
3569
|
items: o
|
|
3563
|
-
}),
|
|
3564
|
-
if ((m == null ? void 0 : m(
|
|
3565
|
-
const
|
|
3566
|
-
if (!
|
|
3567
|
-
const
|
|
3568
|
-
gn(
|
|
3570
|
+
}), b = (p) => {
|
|
3571
|
+
if ((m == null ? void 0 : m(p)) === !1) return;
|
|
3572
|
+
const w = c[p];
|
|
3573
|
+
if (!w) return;
|
|
3574
|
+
const _ = w.filename ?? Q(w.src);
|
|
3575
|
+
gn(w.src, _);
|
|
3569
3576
|
};
|
|
3570
3577
|
if (c.length === 0)
|
|
3571
3578
|
return null;
|
|
3572
|
-
const
|
|
3579
|
+
const x = /* @__PURE__ */ n(
|
|
3573
3580
|
"span",
|
|
3574
3581
|
{
|
|
3575
|
-
className:
|
|
3582
|
+
className: C(
|
|
3576
3583
|
"flex size-8 items-center justify-center rounded-full",
|
|
3577
3584
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3578
3585
|
),
|
|
3579
3586
|
"aria-hidden": !0,
|
|
3580
|
-
children: /* @__PURE__ */ n(
|
|
3587
|
+
children: /* @__PURE__ */ n(pe, { className: "size-5", weight: "bold" })
|
|
3581
3588
|
}
|
|
3582
3589
|
);
|
|
3583
3590
|
return /* @__PURE__ */ n(
|
|
3584
|
-
|
|
3591
|
+
xe,
|
|
3585
3592
|
{
|
|
3586
3593
|
variant: u,
|
|
3587
3594
|
text: l,
|
|
3588
3595
|
groupPosition: d,
|
|
3589
3596
|
"data-testid": "file-attachment",
|
|
3590
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3597
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, w) => /* @__PURE__ */ n(
|
|
3591
3598
|
$r,
|
|
3592
3599
|
{
|
|
3593
3600
|
variant: u,
|
|
3594
|
-
item:
|
|
3595
|
-
index:
|
|
3596
|
-
onActivate:
|
|
3597
|
-
trailingAction: f &&
|
|
3601
|
+
item: p,
|
|
3602
|
+
index: w,
|
|
3603
|
+
onActivate: b,
|
|
3604
|
+
trailingAction: f && w === 0 ? /* @__PURE__ */ n(we, { onClick: g, variant: "inline" }) : x
|
|
3598
3605
|
},
|
|
3599
|
-
`${
|
|
3606
|
+
`${p.src}-${w}`
|
|
3600
3607
|
)) })
|
|
3601
3608
|
}
|
|
3602
3609
|
);
|
|
@@ -3609,7 +3616,7 @@ const zr = ({
|
|
|
3609
3616
|
onNext: t,
|
|
3610
3617
|
prevLabel: s = "Previous",
|
|
3611
3618
|
nextLabel: a = "Next"
|
|
3612
|
-
}) => /* @__PURE__ */ h(
|
|
3619
|
+
}) => /* @__PURE__ */ h(se, { children: [
|
|
3613
3620
|
/* @__PURE__ */ n(
|
|
3614
3621
|
"button",
|
|
3615
3622
|
{
|
|
@@ -3639,7 +3646,7 @@ const zr = ({
|
|
|
3639
3646
|
tone: i = "dark",
|
|
3640
3647
|
onTriggered: o
|
|
3641
3648
|
}) => {
|
|
3642
|
-
const [l, d] =
|
|
3649
|
+
const [l, d] = P(!1), m = W(
|
|
3643
3650
|
(c) => {
|
|
3644
3651
|
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3645
3652
|
}).finally(() => {
|
|
@@ -3647,7 +3654,7 @@ const zr = ({
|
|
|
3647
3654
|
}));
|
|
3648
3655
|
},
|
|
3649
3656
|
[l, e, t, o]
|
|
3650
|
-
),
|
|
3657
|
+
), g = r ?? s !== "pill", f = { className: C(
|
|
3651
3658
|
s === "pill" ? "size-4" : "size-5",
|
|
3652
3659
|
"shrink-0"
|
|
3653
3660
|
), weight: "bold" };
|
|
@@ -3658,7 +3665,7 @@ const zr = ({
|
|
|
3658
3665
|
onClick: m,
|
|
3659
3666
|
disabled: l,
|
|
3660
3667
|
"aria-label": a,
|
|
3661
|
-
className:
|
|
3668
|
+
className: C(
|
|
3662
3669
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3663
3670
|
{
|
|
3664
3671
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3666,14 +3673,14 @@ const zr = ({
|
|
|
3666
3673
|
}[i]
|
|
3667
3674
|
),
|
|
3668
3675
|
children: l ? /* @__PURE__ */ n(
|
|
3669
|
-
|
|
3676
|
+
be,
|
|
3670
3677
|
{
|
|
3671
3678
|
className: "size-4 animate-spin",
|
|
3672
3679
|
weight: "bold",
|
|
3673
3680
|
"aria-hidden": !0
|
|
3674
3681
|
}
|
|
3675
3682
|
) : /* @__PURE__ */ n(
|
|
3676
|
-
|
|
3683
|
+
pe,
|
|
3677
3684
|
{
|
|
3678
3685
|
className: "size-5 shrink-0",
|
|
3679
3686
|
weight: "bold",
|
|
@@ -3689,7 +3696,7 @@ const zr = ({
|
|
|
3689
3696
|
disabled: l,
|
|
3690
3697
|
"aria-label": a,
|
|
3691
3698
|
className: "mes-media-viewer__action",
|
|
3692
|
-
children: l ? /* @__PURE__ */ n(
|
|
3699
|
+
children: l ? /* @__PURE__ */ n(be, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(pe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3693
3700
|
}
|
|
3694
3701
|
) : /* @__PURE__ */ h(
|
|
3695
3702
|
"button",
|
|
@@ -3697,21 +3704,21 @@ const zr = ({
|
|
|
3697
3704
|
type: "button",
|
|
3698
3705
|
onClick: m,
|
|
3699
3706
|
disabled: l,
|
|
3700
|
-
"aria-label":
|
|
3701
|
-
className:
|
|
3707
|
+
"aria-label": g ? a : void 0,
|
|
3708
|
+
className: C(
|
|
3702
3709
|
"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",
|
|
3703
3710
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3704
3711
|
),
|
|
3705
3712
|
children: [
|
|
3706
3713
|
l ? /* @__PURE__ */ n(
|
|
3707
|
-
|
|
3714
|
+
be,
|
|
3708
3715
|
{
|
|
3709
3716
|
className: "size-4 animate-spin",
|
|
3710
3717
|
weight: "bold",
|
|
3711
3718
|
"aria-hidden": !0
|
|
3712
3719
|
}
|
|
3713
|
-
) : /* @__PURE__ */ n(
|
|
3714
|
-
|
|
3720
|
+
) : /* @__PURE__ */ n(pe, { ...f, "aria-hidden": !0 }),
|
|
3721
|
+
g ? null : a
|
|
3715
3722
|
]
|
|
3716
3723
|
}
|
|
3717
3724
|
);
|
|
@@ -3720,7 +3727,7 @@ const zr = ({
|
|
|
3720
3727
|
initialIndex: t,
|
|
3721
3728
|
open: s
|
|
3722
3729
|
}) => {
|
|
3723
|
-
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3730
|
+
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = P(a);
|
|
3724
3731
|
Y(() => {
|
|
3725
3732
|
s && i($e(t, 0, Math.max(e - 1, 0)));
|
|
3726
3733
|
}, [s, t, e]), Y(() => {
|
|
@@ -3735,8 +3742,8 @@ const zr = ({
|
|
|
3735
3742
|
if (!s || e <= 1) return;
|
|
3736
3743
|
const d = (m) => {
|
|
3737
3744
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
3738
|
-
const
|
|
3739
|
-
|
|
3745
|
+
const g = document.activeElement;
|
|
3746
|
+
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
|
|
3740
3747
|
};
|
|
3741
3748
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3742
3749
|
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
@@ -3840,8 +3847,8 @@ const zr = ({
|
|
|
3840
3847
|
length: t.length,
|
|
3841
3848
|
initialIndex: s,
|
|
3842
3849
|
open: e
|
|
3843
|
-
}), l = t[r], d =
|
|
3844
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3850
|
+
}), l = t[r], d = ne(
|
|
3851
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "image"),
|
|
3845
3852
|
[l]
|
|
3846
3853
|
);
|
|
3847
3854
|
return l ? /* @__PURE__ */ h(
|
|
@@ -3894,30 +3901,30 @@ const zr = ({
|
|
|
3894
3901
|
}) => {
|
|
3895
3902
|
const r = e.length;
|
|
3896
3903
|
if (r === 0) return null;
|
|
3897
|
-
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m,
|
|
3898
|
-
const u =
|
|
3904
|
+
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
3905
|
+
const u = C(Vr, "h-full w-full");
|
|
3899
3906
|
return t ? /* @__PURE__ */ h(
|
|
3900
3907
|
"button",
|
|
3901
3908
|
{
|
|
3902
3909
|
type: "button",
|
|
3903
3910
|
onClick: () => t(m),
|
|
3904
3911
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3905
|
-
className:
|
|
3912
|
+
className: C(u, "cursor-zoom-in"),
|
|
3906
3913
|
children: [
|
|
3907
3914
|
d.content,
|
|
3908
|
-
|
|
3915
|
+
g
|
|
3909
3916
|
]
|
|
3910
3917
|
},
|
|
3911
3918
|
m
|
|
3912
3919
|
) : /* @__PURE__ */ h("div", { className: u, children: [
|
|
3913
3920
|
d.content,
|
|
3914
|
-
|
|
3921
|
+
g
|
|
3915
3922
|
] }, m);
|
|
3916
3923
|
};
|
|
3917
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3924
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3918
3925
|
"div",
|
|
3919
3926
|
{
|
|
3920
|
-
className:
|
|
3927
|
+
className: C(
|
|
3921
3928
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3922
3929
|
a
|
|
3923
3930
|
),
|
|
@@ -3926,7 +3933,7 @@ const zr = ({
|
|
|
3926
3933
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3927
3934
|
"div",
|
|
3928
3935
|
{
|
|
3929
|
-
className:
|
|
3936
|
+
className: C(
|
|
3930
3937
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3931
3938
|
a
|
|
3932
3939
|
),
|
|
@@ -3939,16 +3946,16 @@ const zr = ({
|
|
|
3939
3946
|
) : /* @__PURE__ */ n(
|
|
3940
3947
|
"div",
|
|
3941
3948
|
{
|
|
3942
|
-
className:
|
|
3949
|
+
className: C(
|
|
3943
3950
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3944
3951
|
a
|
|
3945
3952
|
),
|
|
3946
3953
|
children: i.map((d, m) => {
|
|
3947
|
-
const
|
|
3954
|
+
const g = o > 0 && m === i.length - 1;
|
|
3948
3955
|
return l(
|
|
3949
3956
|
d,
|
|
3950
3957
|
m,
|
|
3951
|
-
|
|
3958
|
+
g ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
3952
3959
|
"+",
|
|
3953
3960
|
o
|
|
3954
3961
|
] }) : null
|
|
@@ -3956,8 +3963,8 @@ const zr = ({
|
|
|
3956
3963
|
})
|
|
3957
3964
|
}
|
|
3958
3965
|
);
|
|
3959
|
-
},
|
|
3960
|
-
const [t, s] =
|
|
3966
|
+
}, Ne = (e) => {
|
|
3967
|
+
const [t, s] = P(!1), [a, r] = P(0), i = W(
|
|
3961
3968
|
(l) => {
|
|
3962
3969
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3963
3970
|
},
|
|
@@ -3988,7 +3995,7 @@ const zr = ({
|
|
|
3988
3995
|
alt: s.alt,
|
|
3989
3996
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3990
3997
|
})), Yr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
3991
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } =
|
|
3998
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ne(
|
|
3992
3999
|
r
|
|
3993
4000
|
);
|
|
3994
4001
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4012,7 +4019,7 @@ const zr = ({
|
|
|
4012
4019
|
)
|
|
4013
4020
|
}
|
|
4014
4021
|
),
|
|
4015
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4022
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(we, { onClick: i }) }) : null,
|
|
4016
4023
|
/* @__PURE__ */ n(
|
|
4017
4024
|
pn,
|
|
4018
4025
|
{
|
|
@@ -4034,30 +4041,30 @@ const zr = ({
|
|
|
4034
4041
|
loading: l = "lazy",
|
|
4035
4042
|
onClick: d
|
|
4036
4043
|
}) => {
|
|
4037
|
-
const m = Hr({ src: t, alt: s, items: r }),
|
|
4044
|
+
const m = Hr({ src: t, alt: s, items: r }), g = _e(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ne(
|
|
4038
4045
|
d
|
|
4039
4046
|
);
|
|
4040
4047
|
if (m.length === 0)
|
|
4041
4048
|
return null;
|
|
4042
|
-
const
|
|
4043
|
-
(
|
|
4049
|
+
const x = m.map(
|
|
4050
|
+
(p, w) => Gr(p, w, m.length, l)
|
|
4044
4051
|
);
|
|
4045
4052
|
return /* @__PURE__ */ h(
|
|
4046
|
-
|
|
4053
|
+
xe,
|
|
4047
4054
|
{
|
|
4048
|
-
variant:
|
|
4055
|
+
variant: g,
|
|
4049
4056
|
text: i,
|
|
4050
4057
|
groupPosition: o,
|
|
4051
4058
|
"data-testid": "image-attachment",
|
|
4052
4059
|
children: [
|
|
4053
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles:
|
|
4060
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: x, onTileActivate: c }) }),
|
|
4054
4061
|
/* @__PURE__ */ n(
|
|
4055
4062
|
pn,
|
|
4056
4063
|
{
|
|
4057
4064
|
open: u,
|
|
4058
4065
|
items: xn(m, a),
|
|
4059
4066
|
initialIndex: f,
|
|
4060
|
-
onClose:
|
|
4067
|
+
onClose: b
|
|
4061
4068
|
}
|
|
4062
4069
|
)
|
|
4063
4070
|
]
|
|
@@ -4077,10 +4084,10 @@ const zr = ({
|
|
|
4077
4084
|
length: t.length,
|
|
4078
4085
|
initialIndex: s,
|
|
4079
4086
|
open: e
|
|
4080
|
-
}), l = t[r], d =
|
|
4081
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4087
|
+
}), l = t[r], d = ne(
|
|
4088
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "document"),
|
|
4082
4089
|
[l]
|
|
4083
|
-
), m =
|
|
4090
|
+
), m = ne(
|
|
4084
4091
|
() => l ? Zr(l.src) : void 0,
|
|
4085
4092
|
[l]
|
|
4086
4093
|
);
|
|
@@ -4131,7 +4138,7 @@ const zr = ({
|
|
|
4131
4138
|
onActivate: a,
|
|
4132
4139
|
trailingAction: r
|
|
4133
4140
|
}) => {
|
|
4134
|
-
const i = t.filename ??
|
|
4141
|
+
const i = t.filename ?? Q(t.src);
|
|
4135
4142
|
return /* @__PURE__ */ n(
|
|
4136
4143
|
fn,
|
|
4137
4144
|
{
|
|
@@ -4157,53 +4164,53 @@ const zr = ({
|
|
|
4157
4164
|
onClick: d,
|
|
4158
4165
|
onDismiss: m
|
|
4159
4166
|
}) => {
|
|
4160
|
-
const
|
|
4167
|
+
const g = _e(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: x } = Ne(
|
|
4161
4168
|
d
|
|
4162
|
-
),
|
|
4169
|
+
), p = e === "composer" && !!m;
|
|
4163
4170
|
if (u.length === 0)
|
|
4164
4171
|
return null;
|
|
4165
|
-
const
|
|
4166
|
-
src:
|
|
4167
|
-
filename:
|
|
4172
|
+
const w = u.map((_) => ({
|
|
4173
|
+
src: _.src,
|
|
4174
|
+
filename: _.filename ?? Q(_.src)
|
|
4168
4175
|
}));
|
|
4169
4176
|
return /* @__PURE__ */ h(
|
|
4170
|
-
|
|
4177
|
+
xe,
|
|
4171
4178
|
{
|
|
4172
|
-
variant:
|
|
4179
|
+
variant: g,
|
|
4173
4180
|
text: o,
|
|
4174
4181
|
groupPosition: l,
|
|
4175
4182
|
"data-testid": "pdf-attachment",
|
|
4176
4183
|
children: [
|
|
4177
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4178
|
-
const S =
|
|
4184
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_, k) => {
|
|
4185
|
+
const S = _.filename ?? Q(_.src), R = p && k === 0 ? /* @__PURE__ */ n(we, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4179
4186
|
bn,
|
|
4180
4187
|
{
|
|
4181
|
-
url:
|
|
4188
|
+
url: _.src,
|
|
4182
4189
|
filename: S,
|
|
4183
4190
|
variant: "inline",
|
|
4184
4191
|
label: `Download ${S}`,
|
|
4185
|
-
tone:
|
|
4192
|
+
tone: g
|
|
4186
4193
|
}
|
|
4187
4194
|
);
|
|
4188
4195
|
return /* @__PURE__ */ n(
|
|
4189
4196
|
ei,
|
|
4190
4197
|
{
|
|
4191
|
-
variant:
|
|
4192
|
-
item:
|
|
4193
|
-
index:
|
|
4194
|
-
onActivate:
|
|
4195
|
-
trailingAction:
|
|
4198
|
+
variant: g,
|
|
4199
|
+
item: _,
|
|
4200
|
+
index: k,
|
|
4201
|
+
onActivate: b,
|
|
4202
|
+
trailingAction: R
|
|
4196
4203
|
},
|
|
4197
|
-
`${
|
|
4204
|
+
`${_.src}-${k}`
|
|
4198
4205
|
);
|
|
4199
4206
|
}) }),
|
|
4200
4207
|
/* @__PURE__ */ n(
|
|
4201
4208
|
Jr,
|
|
4202
4209
|
{
|
|
4203
4210
|
open: f,
|
|
4204
|
-
items:
|
|
4211
|
+
items: w,
|
|
4205
4212
|
initialIndex: c,
|
|
4206
|
-
onClose:
|
|
4213
|
+
onClose: x
|
|
4207
4214
|
}
|
|
4208
4215
|
)
|
|
4209
4216
|
]
|
|
@@ -4223,8 +4230,8 @@ const zr = ({
|
|
|
4223
4230
|
length: t.length,
|
|
4224
4231
|
initialIndex: s,
|
|
4225
4232
|
open: e
|
|
4226
|
-
}), l = t[r], d =
|
|
4227
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4233
|
+
}), l = t[r], d = ne(
|
|
4234
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "video"),
|
|
4228
4235
|
[l]
|
|
4229
4236
|
);
|
|
4230
4237
|
return l ? /* @__PURE__ */ h(
|
|
@@ -4302,7 +4309,7 @@ const zr = ({
|
|
|
4302
4309
|
preload: s.preload,
|
|
4303
4310
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4304
4311
|
})), li = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4305
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer:
|
|
4312
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = Ne(
|
|
4306
4313
|
i
|
|
4307
4314
|
);
|
|
4308
4315
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4316,7 +4323,7 @@ const zr = ({
|
|
|
4316
4323
|
children: /* @__PURE__ */ n(Nn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4317
4324
|
}
|
|
4318
4325
|
),
|
|
4319
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4326
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(we, { onClick: o }) }) : null,
|
|
4320
4327
|
/* @__PURE__ */ n(
|
|
4321
4328
|
_n,
|
|
4322
4329
|
{
|
|
@@ -4326,7 +4333,7 @@ const zr = ({
|
|
|
4326
4333
|
a
|
|
4327
4334
|
),
|
|
4328
4335
|
initialIndex: d,
|
|
4329
|
-
onClose:
|
|
4336
|
+
onClose: g
|
|
4330
4337
|
}
|
|
4331
4338
|
)
|
|
4332
4339
|
] });
|
|
@@ -4342,16 +4349,16 @@ const zr = ({
|
|
|
4342
4349
|
preload: d,
|
|
4343
4350
|
onClick: m
|
|
4344
4351
|
}) => {
|
|
4345
|
-
const
|
|
4352
|
+
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = _e(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: x } = Ne(
|
|
4346
4353
|
m
|
|
4347
4354
|
);
|
|
4348
|
-
if (
|
|
4355
|
+
if (g.length === 0)
|
|
4349
4356
|
return null;
|
|
4350
|
-
const
|
|
4351
|
-
(
|
|
4357
|
+
const p = g.map(
|
|
4358
|
+
(w, _) => ii(w, _, g.length)
|
|
4352
4359
|
);
|
|
4353
4360
|
return /* @__PURE__ */ h(
|
|
4354
|
-
|
|
4361
|
+
xe,
|
|
4355
4362
|
{
|
|
4356
4363
|
variant: u,
|
|
4357
4364
|
text: o,
|
|
@@ -4361,8 +4368,8 @@ const zr = ({
|
|
|
4361
4368
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4362
4369
|
vn,
|
|
4363
4370
|
{
|
|
4364
|
-
tiles:
|
|
4365
|
-
onTileActivate:
|
|
4371
|
+
tiles: p,
|
|
4372
|
+
onTileActivate: b,
|
|
4366
4373
|
className: "overflow-hidden rounded-md"
|
|
4367
4374
|
}
|
|
4368
4375
|
) }),
|
|
@@ -4370,9 +4377,9 @@ const zr = ({
|
|
|
4370
4377
|
_n,
|
|
4371
4378
|
{
|
|
4372
4379
|
open: f,
|
|
4373
|
-
items: yn(
|
|
4380
|
+
items: yn(g, r),
|
|
4374
4381
|
initialIndex: c,
|
|
4375
|
-
onClose:
|
|
4382
|
+
onClose: x
|
|
4376
4383
|
}
|
|
4377
4384
|
)
|
|
4378
4385
|
]
|
|
@@ -4400,7 +4407,7 @@ const zr = ({
|
|
|
4400
4407
|
onClick: t,
|
|
4401
4408
|
disabled: s,
|
|
4402
4409
|
style: { backgroundColor: "#E6E5E3" },
|
|
4403
|
-
className:
|
|
4410
|
+
className: C(
|
|
4404
4411
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4405
4412
|
{
|
|
4406
4413
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4422,7 +4429,7 @@ const zr = ({
|
|
|
4422
4429
|
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4423
4430
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4424
4431
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4425
|
-
|
|
4432
|
+
ie,
|
|
4426
4433
|
{
|
|
4427
4434
|
id: o || "account",
|
|
4428
4435
|
name: o || "Account",
|
|
@@ -4460,13 +4467,13 @@ export {
|
|
|
4460
4467
|
Ti as F,
|
|
4461
4468
|
Ei as L,
|
|
4462
4469
|
yi as M,
|
|
4463
|
-
|
|
4464
|
-
|
|
4470
|
+
fe as a,
|
|
4471
|
+
ie as b,
|
|
4465
4472
|
rr as c,
|
|
4466
4473
|
dn as d,
|
|
4467
4474
|
Ci as e,
|
|
4468
4475
|
hi as f,
|
|
4469
|
-
|
|
4476
|
+
ae as g,
|
|
4470
4477
|
Ot as h,
|
|
4471
4478
|
Ii as i,
|
|
4472
4479
|
Ca as j,
|
|
@@ -4477,7 +4484,7 @@ export {
|
|
|
4477
4484
|
sr as o,
|
|
4478
4485
|
Rr as p,
|
|
4479
4486
|
Xt as q,
|
|
4480
|
-
|
|
4487
|
+
ce as r,
|
|
4481
4488
|
nn as s,
|
|
4482
4489
|
$s as t,
|
|
4483
4490
|
Si as u,
|
|
@@ -4487,4 +4494,4 @@ export {
|
|
|
4487
4494
|
Wt as y,
|
|
4488
4495
|
va as z
|
|
4489
4496
|
};
|
|
4490
|
-
//# sourceMappingURL=index-
|
|
4497
|
+
//# sourceMappingURL=index-BtwKlrVN.js.map
|