@linktr.ee/messaging-react 3.3.13 → 3.3.14-rc-1782376133
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-BSIZi_Cu.cjs → Card-Bfigt254.cjs} +2 -2
- package/dist/{Card-BSIZi_Cu.cjs.map → Card-Bfigt254.cjs.map} +1 -1
- package/dist/{Card-BCFhuR1g.cjs → Card-C_dE3Qu1.cjs} +2 -2
- package/dist/{Card-BCFhuR1g.cjs.map → Card-C_dE3Qu1.cjs.map} +1 -1
- package/dist/{Card-jmfDlxVY.js → Card-Ch_mEI0W.js} +2 -2
- package/dist/{Card-jmfDlxVY.js.map → Card-Ch_mEI0W.js.map} +1 -1
- package/dist/{Card-CI6Trmpw.js → Card-Cj77HUEV.js} +2 -2
- package/dist/{Card-CI6Trmpw.js.map → Card-Cj77HUEV.js.map} +1 -1
- package/dist/{Card-Bl0tPvn7.js → Card-QGq8FOuB.js} +3 -3
- package/dist/{Card-Bl0tPvn7.js.map → Card-QGq8FOuB.js.map} +1 -1
- package/dist/{Card-p74GBYEd.cjs → Card-UNYUEkhB.cjs} +2 -2
- package/dist/{Card-p74GBYEd.cjs.map → Card-UNYUEkhB.cjs.map} +1 -1
- package/dist/{LockedThumbnail-yoFQqnl6.cjs → LockedThumbnail-BhRg8vCA.cjs} +2 -2
- package/dist/{LockedThumbnail-yoFQqnl6.cjs.map → LockedThumbnail-BhRg8vCA.cjs.map} +1 -1
- package/dist/{LockedThumbnail-qhUBSijq.js → LockedThumbnail-DpBD4eNW.js} +2 -2
- package/dist/{LockedThumbnail-qhUBSijq.js.map → LockedThumbnail-DpBD4eNW.js.map} +1 -1
- package/dist/{index-BHFdqj7Z.js → index-BS5mKzxR.js} +645 -629
- package/dist/index-BS5mKzxR.js.map +1 -0
- package/dist/index-BpVRd7bJ.cjs +2 -0
- package/dist/index-BpVRd7bJ.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.stories.tsx +21 -0
- package/src/components/ChannelView.tsx +25 -4
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/types.ts +11 -0
- package/dist/index-BHFdqj7Z.js.map +0 -1
- package/dist/index-D31aF4s2.cjs +0 -2
- package/dist/index-D31aF4s2.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import U, { createContext as He, useContext as Ae, useCallback as K, useState as z, useRef as V, useEffect as W, useId as En, useMemo as te, Suspense as Ye } 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
|
|
5
|
+
import { Chat as Tn, DateSeparator as An, useChannelStateContext as ce, useChatContext as qe, 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 xe, 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 De, AIStates as Pe, 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
6
|
import { StarIcon as Be, DotsThreeIcon as ms, SpinnerGapIcon as ke, 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 pe, PlayIcon as Ue, PauseIcon as Cs, LinkIcon as ks, DownloadSimpleIcon as ve, GiftIcon as Es, ThumbsUpIcon as Ss, ThumbsDownIcon as Is, TrashSimpleIcon as Ts, XIcon as Me, ArrowUpIcon as As, SparkleIcon as je, ProhibitIcon as Ms, ArrowLeftIcon as Rt, PencilSimpleIcon as Rs, CaretLeftIcon as Ls, CaretRightIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
-
import
|
|
7
|
+
import C from "classnames";
|
|
8
8
|
import { MessageActions as Ps, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
|
|
9
9
|
const Yt = He({
|
|
10
10
|
service: null,
|
|
@@ -24,10 +24,10 @@ const Yt = He({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const o =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var L, M;
|
|
28
|
+
const o = K(
|
|
29
|
+
(S, ...I) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${S}`, ...I);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,11 +37,11 @@ const Yt = He({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [l, d] =
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
40
|
+
const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, b] = z(!1), [w, p] = z(null), v = V(!1), _ = V(null), R = V(s);
|
|
41
|
+
R.current = s;
|
|
42
|
+
const k = V(i);
|
|
43
|
+
k.current = i;
|
|
44
|
+
const E = V({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
@@ -51,63 +51,63 @@ const Yt = He({
|
|
|
51
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: E.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: E.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: E.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: E.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), E.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
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
if (!a || !
|
|
65
|
+
const $ = V(null);
|
|
66
|
+
a && ((L = $.current) == null ? void 0 : L.apiKey) !== a && ($.current = { apiKey: a, client: new In(a) });
|
|
67
|
+
const P = a ? ((M = $.current) == null ? void 0 : M.client) ?? null : null;
|
|
68
|
+
W(() => {
|
|
69
|
+
const S = D.current, I = R.current;
|
|
70
|
+
if (!a || !P || !I) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: S,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
o("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: S,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
81
|
+
const O = new Sn({
|
|
82
|
+
...I,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: k.current,
|
|
85
|
+
client: P
|
|
86
86
|
});
|
|
87
|
-
_.current =
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance:
|
|
87
|
+
_.current = O, d(O), o("✅ SERVICE SET", {
|
|
88
|
+
renderCount: S,
|
|
89
|
+
serviceInstance: !!O
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
91
|
+
}, [a, P]);
|
|
92
92
|
const N = V(null);
|
|
93
|
-
|
|
94
|
-
var
|
|
93
|
+
W(() => {
|
|
94
|
+
var I, O;
|
|
95
95
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!l,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: v.current,
|
|
100
100
|
isConnected: u,
|
|
101
101
|
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !l || !t) {
|
|
103
103
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (v.current) {
|
|
107
107
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((I = N.current) == null ? void 0 : I.serviceId) === l && ((O = N.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
111
|
o(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const Yt = He({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, b(!0), p(null);
|
|
119
119
|
try {
|
|
120
120
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const F = await l.connectUser(t);
|
|
122
|
+
g(F), f(!0), N.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: F.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
p(
|
|
126
|
+
} catch (F) {
|
|
127
|
+
const q = F instanceof Error ? F.message : "Connection failed";
|
|
128
|
+
p(q), o("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: q
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
b(!1),
|
|
133
|
+
b(!1), v.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [l, t, o, u]),
|
|
140
|
-
const
|
|
139
|
+
}, [l, t, o, u]), W(() => {
|
|
140
|
+
const S = P;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var I;
|
|
143
|
+
S && (N.current = null, (I = _.current) == null || I.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
146
|
-
const
|
|
145
|
+
}, [P]);
|
|
146
|
+
const T = K(async () => {
|
|
147
147
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!l,
|
|
149
149
|
hasUser: !!t
|
|
@@ -154,52 +154,52 @@ const Yt = He({
|
|
|
154
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
|
-
g(
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
p(
|
|
157
|
+
const S = await l.connectUser(t);
|
|
158
|
+
g(S), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (S) {
|
|
160
|
+
const I = S instanceof Error ? S.message : "Refresh failed";
|
|
161
|
+
p(I), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: I
|
|
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]), A = U.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!l,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!w,
|
|
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: w,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: T,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
l,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
w,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
T,
|
|
192
192
|
i,
|
|
193
193
|
o
|
|
194
194
|
]);
|
|
195
195
|
return o("🔄 RENDER END", {
|
|
196
196
|
renderCount: D.current,
|
|
197
|
-
willRenderChat: !!
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(Yt.Provider, { value:
|
|
197
|
+
willRenderChat: !!P,
|
|
198
|
+
contextValueReady: !!A
|
|
199
|
+
}), /* @__PURE__ */ n(Yt.Provider, { value: A, children: P ? /* @__PURE__ */ n(
|
|
200
200
|
Tn,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: P,
|
|
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,10 +208,10 @@ const Yt = He({
|
|
|
208
208
|
) : e });
|
|
209
209
|
}, Os = () => We(), qt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = z(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return W(() => {
|
|
215
215
|
var o;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -299,7 +299,7 @@ const re = ({
|
|
|
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 re = ({
|
|
|
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,7 +331,7 @@ const re = ({
|
|
|
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
|
),
|
|
@@ -363,9 +363,9 @@ const re = ({
|
|
|
363
363
|
onActionComplete: m,
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } = We(), c = (
|
|
368
|
-
return
|
|
366
|
+
var L;
|
|
367
|
+
const { service: u, debug: f } = We(), c = (L = t == null ? void 0 : t.user) == null ? void 0 : L.id, b = !!(a && s && u && c), [w, p] = z(!1), [v, _] = z(null), [R, k] = z(!1), [E, D] = z(!1), $ = b && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
|
|
368
|
+
return W(() => {
|
|
369
369
|
if (!b || !u || !c) {
|
|
370
370
|
p(!1), _(null);
|
|
371
371
|
return;
|
|
@@ -373,15 +373,15 @@ const re = ({
|
|
|
373
373
|
let M = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
376
|
+
const S = await u.getBlockedUsers();
|
|
377
377
|
if (M) return;
|
|
378
378
|
p(
|
|
379
|
-
|
|
380
|
-
(
|
|
379
|
+
S.some(
|
|
380
|
+
(I) => I.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
M || console.error(`[${g}] Failed to check blocked status:`,
|
|
383
|
+
} catch (S) {
|
|
384
|
+
M || console.error(`[${g}] Failed to check blocked status:`, S);
|
|
385
385
|
} finally {
|
|
386
386
|
M || _({ participantId: c, service: u });
|
|
387
387
|
}
|
|
@@ -389,45 +389,45 @@ const re = ({
|
|
|
389
389
|
M = !0;
|
|
390
390
|
};
|
|
391
391
|
}, [b, u, c, g]), {
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
395
|
-
isUpdatingBlockStatus:
|
|
392
|
+
isParticipantBlocked: w,
|
|
393
|
+
isCheckingBlockedStatus: $,
|
|
394
|
+
isLeaving: R,
|
|
395
|
+
isUpdatingBlockStatus: E,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
397
|
var M;
|
|
398
|
-
if (!
|
|
399
|
-
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
398
|
+
if (!R) {
|
|
399
|
+
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), k(!0);
|
|
400
400
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
401
|
+
const S = ((M = e._client) == null ? void 0 : M.userID) ?? null;
|
|
402
|
+
await e.hide(S, !1), r && await r(e), m == null || m();
|
|
403
|
+
} catch (S) {
|
|
404
|
+
console.error(`[${g}] Failed to leave conversation`, S);
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
k(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var M,
|
|
412
|
-
if (!(
|
|
411
|
+
var M, S, I;
|
|
412
|
+
if (!(E || !u)) {
|
|
413
413
|
l == null || l(), f && console.log(`[${g}] Block member`, (M = t == null ? void 0 : t.user) == null ? void 0 : M.id), D(!0);
|
|
414
414
|
try {
|
|
415
|
-
await u.blockUser((
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
415
|
+
await u.blockUser((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), m == null || m();
|
|
416
|
+
} catch (O) {
|
|
417
|
+
console.error(`[${g}] Failed to block member`, O);
|
|
418
418
|
} finally {
|
|
419
419
|
D(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var M,
|
|
425
|
-
if (!(
|
|
424
|
+
var M, S, I;
|
|
425
|
+
if (!(E || !u)) {
|
|
426
426
|
l == null || l(), f && console.log(`[${g}] Unblock member`, (M = t == null ? void 0 : t.user) == null ? void 0 : M.id), D(!0);
|
|
427
427
|
try {
|
|
428
|
-
await u.unBlockUser((
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
428
|
+
await u.unBlockUser((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), m == null || m();
|
|
429
|
+
} catch (O) {
|
|
430
|
+
console.error(`[${g}] Failed to unblock member`, O);
|
|
431
431
|
} finally {
|
|
432
432
|
D(!1);
|
|
433
433
|
}
|
|
@@ -446,7 +446,7 @@ const re = ({
|
|
|
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
|
|
@@ -468,15 +468,15 @@ const re = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
472
|
-
isParticipantBlocked:
|
|
471
|
+
const [f, c] = z(!1), b = V(null), w = En(), p = K(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: v,
|
|
473
473
|
isCheckingBlockedStatus: _,
|
|
474
|
-
isLeaving:
|
|
475
|
-
isUpdatingBlockStatus:
|
|
476
|
-
handleLeaveConversation:
|
|
474
|
+
isLeaving: R,
|
|
475
|
+
isUpdatingBlockStatus: k,
|
|
476
|
+
handleLeaveConversation: E,
|
|
477
477
|
handleBlockUser: D,
|
|
478
|
-
handleUnblockUser:
|
|
479
|
-
handleReportUser:
|
|
478
|
+
handleUnblockUser: $,
|
|
479
|
+
handleReportUser: P
|
|
480
480
|
} = js({
|
|
481
481
|
channel: e,
|
|
482
482
|
participant: t,
|
|
@@ -490,15 +490,15 @@ const re = ({
|
|
|
490
490
|
onActionComplete: p,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
|
-
return
|
|
493
|
+
return W(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
b.current && !b.current.contains(
|
|
497
|
-
},
|
|
498
|
-
|
|
495
|
+
const T = (L) => {
|
|
496
|
+
b.current && !b.current.contains(L.target) && c(!1);
|
|
497
|
+
}, A = (L) => {
|
|
498
|
+
L.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", T), document.addEventListener("keydown", A), () => {
|
|
501
|
+
document.removeEventListener("mousedown", T), document.removeEventListener("keydown", A);
|
|
502
502
|
};
|
|
503
503
|
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
@@ -508,8 +508,8 @@ const re = ({
|
|
|
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 ? w : void 0,
|
|
512
|
+
onClick: () => c((T) => !T),
|
|
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,9 +519,9 @@ const re = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: w,
|
|
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
|
),
|
|
@@ -529,11 +529,11 @@ const re = ({
|
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
530
|
ge,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
532
|
+
onClick: E,
|
|
533
|
+
disabled: R,
|
|
534
|
+
"aria-busy": R,
|
|
535
535
|
children: [
|
|
536
|
-
|
|
536
|
+
R ? /* @__PURE__ */ n(ke, { 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
|
}
|
|
@@ -545,14 +545,14 @@ const re = ({
|
|
|
545
545
|
/* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
548
|
+
) : v ? /* @__PURE__ */ h(
|
|
549
549
|
ge,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
551
|
+
onClick: $,
|
|
552
|
+
disabled: k,
|
|
553
|
+
"aria-busy": k,
|
|
554
554
|
children: [
|
|
555
|
-
|
|
555
|
+
k ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
556
556
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
557
|
]
|
|
558
558
|
}
|
|
@@ -560,15 +560,15 @@ const re = ({
|
|
|
560
560
|
ge,
|
|
561
561
|
{
|
|
562
562
|
onClick: D,
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
563
|
+
disabled: k,
|
|
564
|
+
"aria-busy": k,
|
|
565
565
|
children: [
|
|
566
|
-
|
|
566
|
+
k ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
567
567
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick:
|
|
571
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: P, children: [
|
|
572
572
|
/* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
@@ -582,10 +582,10 @@ function Gs(e) {
|
|
|
582
582
|
return e != null && e.length ? e.some((t) => t.type === Ge) ? "down" : e.some((t) => t.type === Ve) ? "up" : null : null;
|
|
583
583
|
}
|
|
584
584
|
function Hs(e) {
|
|
585
|
-
const { channel: t } =
|
|
585
|
+
const { channel: t } = ce(), { client: s } = qe("useMessageVote"), a = te(
|
|
586
586
|
() => Gs(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
588
|
+
), r = K(async () => {
|
|
589
589
|
if (s != null && s.userID)
|
|
590
590
|
try {
|
|
591
591
|
a === "up" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
|
|
@@ -595,7 +595,7 @@ function Hs(e) {
|
|
|
595
595
|
);
|
|
596
596
|
} catch {
|
|
597
597
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
598
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
|
|
599
599
|
if (s != null && s.userID)
|
|
600
600
|
try {
|
|
601
601
|
a === "down" ? await t.deleteReaction(e.id, Ge) : await t.sendReaction(
|
|
@@ -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 = U.lazy(() => import("./Card-Cj77HUEV.js")), Ws = U.lazy(() => import("./Card-Ch_mEI0W.js")), Xs = U.lazy(() => import("./Card-QGq8FOuB.js")), Xe = () => /* @__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)]",
|
|
@@ -664,8 +664,8 @@ function na(e) {
|
|
|
664
664
|
const t = se(e);
|
|
665
665
|
return t !== "document" ? ea[t] : ta[Zt(e)];
|
|
666
666
|
}
|
|
667
|
-
function
|
|
668
|
-
return
|
|
667
|
+
function le(e, t) {
|
|
668
|
+
return U.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 g = se(t), u = V(null), f = V(null), c = V(null), b = V(r), [
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const
|
|
685
|
+
const g = se(t), u = V(null), f = V(null), c = V(null), b = V(r), [w, p] = z(a), [v, _] = z(0), [R, k] = z(!1), [E, D] = z(!1), [$, P] = z(!1), [N, T] = z(!1), [A, L] = z(!0), [M, S] = z(null), I = K(() => {
|
|
686
|
+
P(!1), p(!0);
|
|
687
|
+
}, []), O = K((x) => {
|
|
688
|
+
const y = f.current;
|
|
689
|
+
if (!y) return 0;
|
|
690
|
+
const B = y.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (sa(
|
|
693
|
+
Math.min(1, (sa(x) - B.left) / B.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
_(
|
|
695
|
+
}, []), F = K((x) => {
|
|
696
|
+
const y = u.current;
|
|
697
|
+
y && y.duration && (y.currentTime = x * y.duration);
|
|
698
|
+
}, []), q = (x) => {
|
|
699
|
+
x.stopPropagation(), k(!0);
|
|
700
|
+
const y = O(x);
|
|
701
|
+
_(y), F(y);
|
|
702
702
|
};
|
|
703
|
-
|
|
703
|
+
W(() => {
|
|
704
704
|
r !== void 0 && r !== b.current && (b.current = r, p(r));
|
|
705
|
-
}, [r]),
|
|
706
|
-
if (!
|
|
705
|
+
}, [r]), W(() => {
|
|
706
|
+
if (!w) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
711
|
-
const
|
|
712
|
-
|
|
710
|
+
const x = () => {
|
|
711
|
+
const y = u.current;
|
|
712
|
+
y && y.duration && !R && _(y.currentTime / y.duration), c.current = requestAnimationFrame(x);
|
|
713
713
|
};
|
|
714
|
-
return c.current = requestAnimationFrame(
|
|
714
|
+
return c.current = requestAnimationFrame(x), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
p(!1),
|
|
721
|
-
}) :
|
|
722
|
-
}, [
|
|
723
|
-
if (!
|
|
724
|
-
const
|
|
725
|
-
|
|
717
|
+
}, [w, R]), W(() => {
|
|
718
|
+
const x = u.current;
|
|
719
|
+
x && (w ? x.play().catch((y) => {
|
|
720
|
+
p(!1), P(!0);
|
|
721
|
+
}) : x.pause());
|
|
722
|
+
}, [w]), W(() => {
|
|
723
|
+
if (!R) return;
|
|
724
|
+
const x = (B) => _(O(B)), y = (B) => {
|
|
725
|
+
k(!1), F(O(B));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
727
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", y), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", y), () => {
|
|
728
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", y), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", y);
|
|
729
729
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
730
|
+
}, [R, O, F]);
|
|
731
|
+
const J = M ? { aspectRatio: String(M) } : void 0, G = M ? "" : " aspect-video", Y = Math.round(v * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
739
|
-
onClick: (
|
|
737
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${G}`,
|
|
738
|
+
style: J,
|
|
739
|
+
onClick: (x) => {
|
|
740
740
|
if (m) {
|
|
741
|
-
m(
|
|
741
|
+
m(x);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
$ || o && p((y) => !y);
|
|
745
745
|
},
|
|
746
|
-
onKeyDown: (
|
|
747
|
-
if (!(
|
|
748
|
-
if (
|
|
749
|
-
m(
|
|
746
|
+
onKeyDown: (x) => {
|
|
747
|
+
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
748
|
+
if (x.preventDefault(), m) {
|
|
749
|
+
m(x);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
$ || o && p((y) => !y);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || A) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,7 +761,7 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
764
|
+
!s && (g === "audio" || A) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
@@ -773,12 +773,12 @@ const sa = (e) => {
|
|
|
773
773
|
loop: i,
|
|
774
774
|
muted: d,
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
776
|
+
onLoadStart: () => T(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
T(!1), L(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
781
|
-
onPlay: () =>
|
|
780
|
+
onWaiting: () => T(!0),
|
|
781
|
+
onPlay: () => P(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
783
|
i || (p(!1), _(0));
|
|
784
784
|
},
|
|
@@ -793,15 +793,15 @@ const sa = (e) => {
|
|
|
793
793
|
muted: d,
|
|
794
794
|
playsInline: !0,
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
796
|
+
onLoadStart: () => T(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
T(!1), L(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
801
|
-
onPlay: () =>
|
|
800
|
+
onWaiting: () => T(!0),
|
|
801
|
+
onPlay: () => P(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const x = u.current;
|
|
804
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && S(x.videoWidth / x.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
807
|
i || (p(!1), _(0));
|
|
@@ -809,25 +809,25 @@ const sa = (e) => {
|
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
N &&
|
|
812
|
+
N && !$ && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
813
|
pe,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
$ && !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: (x) => {
|
|
827
|
+
x.stopPropagation(), I();
|
|
828
828
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
829
|
+
onKeyDown: (x) => {
|
|
830
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), I());
|
|
831
831
|
},
|
|
832
832
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Ue, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
@@ -837,23 +837,23 @@ const sa = (e) => {
|
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
839
839
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
840
|
+
"aria-valuenow": Y,
|
|
841
841
|
"aria-valuemin": 0,
|
|
842
842
|
"aria-valuemax": 100,
|
|
843
843
|
tabIndex: 0,
|
|
844
844
|
ref: f,
|
|
845
845
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
848
|
-
onClick: (
|
|
849
|
-
onKeyDown: (
|
|
850
|
-
|
|
846
|
+
onMouseDown: q,
|
|
847
|
+
onTouchStart: q,
|
|
848
|
+
onClick: (x) => x.stopPropagation(),
|
|
849
|
+
onKeyDown: (x) => {
|
|
850
|
+
x.key === "ArrowRight" && F(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && F(Math.max(0, v - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
854
854
|
{
|
|
855
855
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
856
|
+
style: { width: `${Y}%` }
|
|
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: (x) => {
|
|
867
|
+
x.stopPropagation(), p((y) => !y);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": w ? "Pause" : "Play",
|
|
871
|
+
children: w ? /* @__PURE__ */ n(Cs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -876,30 +876,30 @@ const sa = (e) => {
|
|
|
876
876
|
{
|
|
877
877
|
role: "slider",
|
|
878
878
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
879
|
+
"aria-valuenow": Y,
|
|
880
880
|
"aria-valuemin": 0,
|
|
881
881
|
"aria-valuemax": 100,
|
|
882
882
|
tabIndex: 0,
|
|
883
883
|
ref: f,
|
|
884
884
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
887
|
-
onClick: (
|
|
885
|
+
onMouseDown: q,
|
|
886
|
+
onTouchStart: q,
|
|
887
|
+
onClick: (x) => x.stopPropagation(),
|
|
888
888
|
onMouseEnter: () => D(!0),
|
|
889
889
|
onMouseLeave: () => D(!1),
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
890
|
+
onKeyDown: (x) => {
|
|
891
|
+
x.key === "ArrowRight" && F(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && F(Math.max(0, v - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
897
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${E || R ? "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: `${Y}%` }
|
|
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 ${E || R ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${Y}%` }
|
|
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 = se(e), [d, m] =
|
|
930
|
+
const l = se(e), [d, m] = z(!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: le(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: le(e, {
|
|
996
996
|
className: zt(r),
|
|
997
997
|
weight: "regular"
|
|
998
998
|
})
|
|
@@ -1018,7 +1018,7 @@ const sa = (e) => {
|
|
|
1018
1018
|
{
|
|
1019
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,7 +1030,7 @@ 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
1035
|
"text-white/30": f && b,
|
|
1036
1036
|
"text-white": f && !b
|
|
@@ -1039,8 +1039,8 @@ const sa = (e) => {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
|
-
|
|
1043
|
-
className:
|
|
1042
|
+
le(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 Je = ({ 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(U.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] = z(!1);
|
|
1136
1136
|
return /* @__PURE__ */ n(
|
|
1137
1137
|
"button",
|
|
1138
1138
|
{
|
|
@@ -1148,7 +1148,7 @@ 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(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(U.Fragment, { children: [
|
|
1152
1152
|
/* @__PURE__ */ n(ve, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
@@ -1158,13 +1158,13 @@ const ma = ({
|
|
|
1158
1158
|
function Qe(e) {
|
|
1159
1159
|
var u, f, c, b;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1161
|
+
(w) => w.type === "video" && w.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(w) => w.type === "image" && w.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1165
|
+
(w) => w.type === "audio" && w.asset_url
|
|
1166
1166
|
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1167
|
-
(
|
|
1167
|
+
(w) => w.type === "file" && w.asset_url
|
|
1168
1168
|
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1169
|
if (!o) return null;
|
|
1170
1170
|
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -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,
|
|
@@ -1404,24 +1404,24 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
1406
|
renderText: b,
|
|
1407
|
-
threadList:
|
|
1407
|
+
threadList: w,
|
|
1408
1408
|
viewerLanguage: p
|
|
1409
|
-
} = e, { client:
|
|
1409
|
+
} = e, { client: v } = qe("CustomMessage"), { channel: _ } = ce("CustomMessage"), { isUnlocking: R, onUnlockClick: k, onFetchSource: E, onDownloadClick: D } = va("LockedAttachment"), [$, P] = z(!1), N = Rn(c.id), { selected: T, voteUp: A, voteDown: L } = Hs(c), {
|
|
1410
1410
|
Attachment: M = Ln,
|
|
1411
|
-
EditMessageModal:
|
|
1412
|
-
MessageActions:
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} = Ut("CustomMessage"),
|
|
1411
|
+
EditMessageModal: S = Dn,
|
|
1412
|
+
MessageActions: I,
|
|
1413
|
+
MessageBlocked: O = Pn,
|
|
1414
|
+
MessageBouncePrompt: F = On,
|
|
1415
|
+
MessageDeleted: q = zn,
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: J = $n,
|
|
1417
|
+
MessageRepliesCountButton: G = Fn,
|
|
1418
|
+
ReminderNotification: Y = Bn,
|
|
1419
|
+
StreamedMessageText: x = Un,
|
|
1420
|
+
PinIndicator: y
|
|
1421
|
+
} = Ut("CustomMessage"), B = jn(c), H = Vn(c), X = te(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
|
-
),
|
|
1424
|
+
), j = te(() => {
|
|
1425
1425
|
const fe = c.attachments ?? [], Ce = c.shared_location ? [c.shared_location, ...fe] : fe;
|
|
1426
1426
|
if (!Ee(c)) return Ce;
|
|
1427
1427
|
const St = Ce.filter((It) => !("type" in It) || !nn(It));
|
|
@@ -1433,43 +1433,43 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1433
1433
|
if (Gn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1436
|
+
return /* @__PURE__ */ n(q, { message: c });
|
|
1437
1437
|
if (Hn(c))
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
|
|
1442
|
-
const me = f(), kn =
|
|
1438
|
+
return /* @__PURE__ */ n(O, {});
|
|
1439
|
+
const de = !w && !!c.reply_count, ue = !w && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, ae = Yn(c);
|
|
1440
|
+
let Z;
|
|
1441
|
+
Q ? Z = () => m(c) : ae && (Z = () => P(!0));
|
|
1442
|
+
const me = 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
|
me ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1447
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1448
|
{
|
|
1449
|
-
"str-chat__message--has-attachment":
|
|
1449
|
+
"str-chat__message--has-attachment": B,
|
|
1450
1450
|
"str-chat__message--highlighted": g,
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1452
|
+
"str-chat__message--with-reactions": H,
|
|
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": de || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1457
|
"str-chat__virtual-message__wrapper--group": o
|
|
1458
1458
|
}
|
|
1459
|
-
), ct = c.poll_id &&
|
|
1459
|
+
), ct = c.poll_id && v.polls.fromState(c.poll_id), dt = ya(c), he = Ee(c), ut = Na(c), Le = !!(j != null && j.length && !c.quoted_message), mt = he && me && Le;
|
|
1460
1460
|
return /* @__PURE__ */ h(ne, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
S,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1467
|
+
$ && /* @__PURE__ */ n(
|
|
1468
1468
|
qn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1471
|
-
onClose: () =>
|
|
1472
|
-
open:
|
|
1470
|
+
MessageBouncePrompt: F,
|
|
1471
|
+
onClose: () => P(!1),
|
|
1472
|
+
open: $
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
@@ -1478,8 +1478,8 @@ 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(Y, { reminder: N }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
1484
|
re,
|
|
1485
1485
|
{
|
|
@@ -1495,14 +1495,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
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": Q || ae
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
1502
|
-
onClick:
|
|
1503
|
-
onKeyDown:
|
|
1504
|
-
role:
|
|
1505
|
-
tabIndex:
|
|
1502
|
+
onClick: Z,
|
|
1503
|
+
onKeyDown: Z,
|
|
1504
|
+
role: Z ? "button" : void 0,
|
|
1505
|
+
tabIndex: Z ? 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
|
|
@@ -1511,7 +1511,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1511
1511
|
},
|
|
1512
1512
|
children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
1513
|
me ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
|
-
|
|
1514
|
+
I && /* @__PURE__ */ n(I, {}),
|
|
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: () =>
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1524
|
+
onPreviewClick: () => k == null ? void 0 : k(c, _),
|
|
1525
|
+
onFetchSource: async () => await (E == null ? void 0 : E(c, _))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1535,13 +1535,13 @@ 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: () =>
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1538
|
+
isUnlocking: R(c.id),
|
|
1539
|
+
onUnlockClick: () => k == null ? void 0 : k(c, _),
|
|
1540
|
+
onFetchSource: async () => await (E == null ? void 0 : E(c, _)),
|
|
1541
1541
|
onDownloadClick: () => D == null ? void 0 : D(c, _)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
I && /* @__PURE__ */ n(I, {})
|
|
1545
1545
|
] }),
|
|
1546
1546
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
1547
|
At,
|
|
@@ -1563,15 +1563,15 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
1565
|
ct && /* @__PURE__ */ n(Wn, { poll: ct }),
|
|
1566
|
-
|
|
1566
|
+
j != null && j.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
1567
|
M,
|
|
1568
1568
|
{
|
|
1569
1569
|
actionHandler: l,
|
|
1570
|
-
attachments:
|
|
1570
|
+
attachments: j
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
|
-
|
|
1574
|
-
|
|
1573
|
+
X ? /* @__PURE__ */ n(
|
|
1574
|
+
x,
|
|
1575
1575
|
{
|
|
1576
1576
|
message: ie,
|
|
1577
1577
|
renderText: b
|
|
@@ -1599,26 +1599,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1599
1599
|
s && he && /* @__PURE__ */ n(
|
|
1600
1600
|
Ca,
|
|
1601
1601
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1602
|
+
selected: T,
|
|
1603
|
+
onVoteUp: A,
|
|
1604
|
+
onVoteDown: L
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
1608
|
-
|
|
1609
|
-
|
|
1608
|
+
de && /* @__PURE__ */ n(
|
|
1609
|
+
G,
|
|
1610
1610
|
{
|
|
1611
1611
|
onClick: d,
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
|
|
1615
|
+
ue && /* @__PURE__ */ n(J, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
1619
1619
|
)
|
|
1620
1620
|
] });
|
|
1621
|
-
}, Ea =
|
|
1621
|
+
}, Ea = U.memo(
|
|
1622
1622
|
ka,
|
|
1623
1623
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Mn(e, t)
|
|
1624
1624
|
), Sa = (e) => {
|
|
@@ -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 = U.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
...s,
|
|
@@ -1771,7 +1771,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1771
1771
|
disabledReason: a
|
|
1772
1772
|
}) => {
|
|
1773
1773
|
var o;
|
|
1774
|
-
const { channel: r } =
|
|
1774
|
+
const { channel: r } = ce(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
|
|
1775
1775
|
return s ? /* @__PURE__ */ h(ne, { 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()
|
|
@@ -1919,8 +1919,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1919
1919
|
Pe.Generating,
|
|
1920
1920
|
Pe.ExternalSources
|
|
1921
1921
|
]), qa = ({ threadList: e }) => {
|
|
1922
|
-
var b,
|
|
1923
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
1922
|
+
var b, w;
|
|
1923
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = qe(), { typing: i = {} } = as(), { aiState: o } = rs(t), l = Ae(cn);
|
|
1924
1924
|
if (!e && l && Ya.has(o)) {
|
|
1925
1925
|
const p = Wa(t, (b = r.user) == null ? void 0 : b.id);
|
|
1926
1926
|
return /* @__PURE__ */ n(
|
|
@@ -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: p, user:
|
|
1939
|
+
({ parent_id: p, user: v }) => {
|
|
1940
1940
|
var _;
|
|
1941
|
-
return (
|
|
1941
|
+
return (v == null ? void 0 : v.id) !== ((_ = r.user) == null ? void 0 : _.id) && !p;
|
|
1942
1942
|
}
|
|
1943
1943
|
), g = e ? Object.values(i).filter(
|
|
1944
|
-
({ parent_id: p, user:
|
|
1944
|
+
({ parent_id: p, user: v }) => {
|
|
1945
1945
|
var _;
|
|
1946
|
-
return (
|
|
1946
|
+
return (v == null ? void 0 : v.id) !== ((_ = r.user) == null ? void 0 : _.id) && p === (a == null ? void 0 : a.id);
|
|
1947
1947
|
}
|
|
1948
1948
|
) : [], u = e ? g : m;
|
|
1949
1949
|
if (!u.length)
|
|
1950
1950
|
return null;
|
|
1951
|
-
const f = (
|
|
1951
|
+
const f = (w = u[0]) == null ? void 0 : w.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
|
{
|
|
@@ -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
|
-
), Se =
|
|
2057
|
+
), Se = U.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2058
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
|
Se.displayName = "LoadingState";
|
|
2062
|
-
const
|
|
2062
|
+
const oe = "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,
|
|
@@ -2074,25 +2074,29 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2074
2074
|
onReportParticipantClick: u,
|
|
2075
2075
|
customChannelActions: f,
|
|
2076
2076
|
renderChannelActions: c,
|
|
2077
|
-
showChannelInfo: b = !0
|
|
2077
|
+
showChannelInfo: b = !0,
|
|
2078
|
+
renderHeaderTitleBadges: w
|
|
2078
2079
|
}) => {
|
|
2079
|
-
var
|
|
2080
|
-
const { channel:
|
|
2081
|
-
var
|
|
2082
|
-
const
|
|
2083
|
-
return
|
|
2084
|
-
(
|
|
2085
|
-
var
|
|
2086
|
-
return ((
|
|
2080
|
+
var $, P, N, T, A;
|
|
2081
|
+
const { channel: p } = ce(), v = U.useMemo(() => {
|
|
2082
|
+
var S, I;
|
|
2083
|
+
const L = (S = p._client) == null ? void 0 : S.userID;
|
|
2084
|
+
return L ? Object.values(((I = p.state) == null ? void 0 : I.members) || {}).find(
|
|
2085
|
+
(O) => {
|
|
2086
|
+
var F;
|
|
2087
|
+
return ((F = O.user) == null ? void 0 : F.id) && O.user.id !== L;
|
|
2087
2088
|
}
|
|
2088
2089
|
) : void 0;
|
|
2089
|
-
}, [(
|
|
2090
|
+
}, [($ = p._client) == null ? void 0 : $.userID, (P = p.state) == null ? void 0 : P.members]), _ = Wt(v == null ? void 0 : v.user), R = (N = v == null ? void 0 : v.user) == null ? void 0 : N.image, k = qt(p), E = w == null ? void 0 : w({
|
|
2091
|
+
channel: p,
|
|
2092
|
+
participant: v
|
|
2093
|
+
}), D = async () => {
|
|
2090
2094
|
try {
|
|
2091
|
-
|
|
2092
|
-
} catch (
|
|
2095
|
+
k ? await p.unpin() : await p.pin();
|
|
2096
|
+
} catch (L) {
|
|
2093
2097
|
console.error(
|
|
2094
2098
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2095
|
-
|
|
2099
|
+
L
|
|
2096
2100
|
);
|
|
2097
2101
|
}
|
|
2098
2102
|
};
|
|
@@ -2101,8 +2105,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2101
2105
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2102
2106
|
"button",
|
|
2103
2107
|
{
|
|
2104
|
-
className:
|
|
2105
|
-
|
|
2108
|
+
className: C(
|
|
2109
|
+
oe,
|
|
2106
2110
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2107
2111
|
),
|
|
2108
2112
|
onClick: e || (() => {
|
|
@@ -2116,15 +2120,18 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2116
2120
|
/* @__PURE__ */ n(
|
|
2117
2121
|
re,
|
|
2118
2122
|
{
|
|
2119
|
-
id: ((T =
|
|
2120
|
-
name:
|
|
2121
|
-
image:
|
|
2122
|
-
starred: s &&
|
|
2123
|
+
id: ((T = v == null ? void 0 : v.user) == null ? void 0 : T.id) || p.id || "unknown",
|
|
2124
|
+
name: _,
|
|
2125
|
+
image: R,
|
|
2126
|
+
starred: s && k,
|
|
2123
2127
|
dmAgentEnabled: a,
|
|
2124
2128
|
size: 48
|
|
2125
2129
|
}
|
|
2126
2130
|
),
|
|
2127
|
-
/* @__PURE__ */
|
|
2131
|
+
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
|
|
2132
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: _ }),
|
|
2133
|
+
E && /* @__PURE__ */ n("span", { className: "flex shrink-0 items-center", children: E })
|
|
2134
|
+
] }),
|
|
2128
2135
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2129
2136
|
/* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
|
|
2130
2137
|
/* @__PURE__ */ n("span", { children: Bt })
|
|
@@ -2134,18 +2141,18 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2134
2141
|
s && /* @__PURE__ */ n(
|
|
2135
2142
|
"button",
|
|
2136
2143
|
{
|
|
2137
|
-
className:
|
|
2138
|
-
onClick:
|
|
2144
|
+
className: oe,
|
|
2145
|
+
onClick: D,
|
|
2139
2146
|
type: "button",
|
|
2140
|
-
"aria-label":
|
|
2147
|
+
"aria-label": k ? "Unstar conversation" : "Star conversation",
|
|
2141
2148
|
children: /* @__PURE__ */ n(
|
|
2142
2149
|
Be,
|
|
2143
2150
|
{
|
|
2144
|
-
className:
|
|
2145
|
-
"text-yellow-600":
|
|
2146
|
-
"text-black/90": !
|
|
2151
|
+
className: C("size-5", {
|
|
2152
|
+
"text-yellow-600": k,
|
|
2153
|
+
"text-black/90": !k
|
|
2147
2154
|
}),
|
|
2148
|
-
weight:
|
|
2155
|
+
weight: k ? "duotone" : "regular"
|
|
2149
2156
|
}
|
|
2150
2157
|
)
|
|
2151
2158
|
}
|
|
@@ -2153,8 +2160,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2153
2160
|
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2154
2161
|
Pt,
|
|
2155
2162
|
{
|
|
2156
|
-
channel:
|
|
2157
|
-
participant:
|
|
2163
|
+
channel: p,
|
|
2164
|
+
participant: v,
|
|
2158
2165
|
showDeleteConversation: o,
|
|
2159
2166
|
showBlockParticipant: l,
|
|
2160
2167
|
showReportParticipant: d,
|
|
@@ -2164,7 +2171,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2164
2171
|
onBlockParticipantClick: g,
|
|
2165
2172
|
onReportParticipantClick: u,
|
|
2166
2173
|
customChannelActions: f,
|
|
2167
|
-
triggerClassName:
|
|
2174
|
+
triggerClassName: C(oe, "bg-[#F1F0EE]")
|
|
2168
2175
|
}
|
|
2169
2176
|
))
|
|
2170
2177
|
] })
|
|
@@ -2174,8 +2181,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2174
2181
|
t && e && /* @__PURE__ */ n(
|
|
2175
2182
|
"button",
|
|
2176
2183
|
{
|
|
2177
|
-
className:
|
|
2178
|
-
|
|
2184
|
+
className: C(
|
|
2185
|
+
oe,
|
|
2179
2186
|
"messaging-channel-view-back-button-desktop"
|
|
2180
2187
|
),
|
|
2181
2188
|
type: "button",
|
|
@@ -2187,16 +2194,19 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2187
2194
|
/* @__PURE__ */ n(
|
|
2188
2195
|
re,
|
|
2189
2196
|
{
|
|
2190
|
-
id: ((
|
|
2191
|
-
name:
|
|
2192
|
-
image:
|
|
2193
|
-
starred: s &&
|
|
2197
|
+
id: ((A = v == null ? void 0 : v.user) == null ? void 0 : A.id) || p.id || "unknown",
|
|
2198
|
+
name: _,
|
|
2199
|
+
image: R,
|
|
2200
|
+
starred: s && k,
|
|
2194
2201
|
dmAgentEnabled: a,
|
|
2195
2202
|
size: 48
|
|
2196
2203
|
}
|
|
2197
2204
|
),
|
|
2198
2205
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2199
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2207
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: _ }),
|
|
2208
|
+
E && /* @__PURE__ */ n("span", { className: "flex shrink-0 items-center", children: E })
|
|
2209
|
+
] }),
|
|
2200
2210
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2201
2211
|
/* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
|
|
2202
2212
|
/* @__PURE__ */ n("span", { className: "truncate", children: Bt })
|
|
@@ -2207,18 +2217,18 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2207
2217
|
s && /* @__PURE__ */ n(
|
|
2208
2218
|
"button",
|
|
2209
2219
|
{
|
|
2210
|
-
className:
|
|
2211
|
-
onClick:
|
|
2220
|
+
className: oe,
|
|
2221
|
+
onClick: D,
|
|
2212
2222
|
type: "button",
|
|
2213
|
-
"aria-label":
|
|
2223
|
+
"aria-label": k ? "Unstar conversation" : "Star conversation",
|
|
2214
2224
|
children: /* @__PURE__ */ n(
|
|
2215
2225
|
Be,
|
|
2216
2226
|
{
|
|
2217
|
-
className:
|
|
2218
|
-
"text-yellow-600":
|
|
2219
|
-
"text-black/90": !
|
|
2227
|
+
className: C("size-6", {
|
|
2228
|
+
"text-yellow-600": k,
|
|
2229
|
+
"text-black/90": !k
|
|
2220
2230
|
}),
|
|
2221
|
-
weight:
|
|
2231
|
+
weight: k ? "duotone" : "regular"
|
|
2222
2232
|
}
|
|
2223
2233
|
)
|
|
2224
2234
|
}
|
|
@@ -2226,8 +2236,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2226
2236
|
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2227
2237
|
Pt,
|
|
2228
2238
|
{
|
|
2229
|
-
channel:
|
|
2230
|
-
participant:
|
|
2239
|
+
channel: p,
|
|
2240
|
+
participant: v,
|
|
2231
2241
|
showDeleteConversation: o,
|
|
2232
2242
|
showBlockParticipant: l,
|
|
2233
2243
|
showReportParticipant: d,
|
|
@@ -2237,7 +2247,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2237
2247
|
onBlockParticipantClick: g,
|
|
2238
2248
|
onReportParticipantClick: u,
|
|
2239
2249
|
customChannelActions: f,
|
|
2240
|
-
triggerClassName:
|
|
2250
|
+
triggerClassName: oe
|
|
2241
2251
|
}
|
|
2242
2252
|
))
|
|
2243
2253
|
] })
|
|
@@ -2259,52 +2269,53 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2259
2269
|
showReportParticipant: f = !0,
|
|
2260
2270
|
composerDisabled: c = !1,
|
|
2261
2271
|
composerDisabledReason: b,
|
|
2262
|
-
showStarButton:
|
|
2272
|
+
showStarButton: w = !1,
|
|
2263
2273
|
chatbotVotingEnabled: p = !1,
|
|
2264
|
-
renderChannelBanner:
|
|
2265
|
-
|
|
2266
|
-
|
|
2274
|
+
renderChannelBanner: v,
|
|
2275
|
+
renderHeaderTitleBadges: _,
|
|
2276
|
+
customChannelActions: R,
|
|
2277
|
+
renderChannelActions: k,
|
|
2267
2278
|
renderMessage: E,
|
|
2268
|
-
dmAgentEnabled:
|
|
2269
|
-
viewerLanguage:
|
|
2270
|
-
showChannelInfo:
|
|
2279
|
+
dmAgentEnabled: D = !1,
|
|
2280
|
+
viewerLanguage: $,
|
|
2281
|
+
showChannelInfo: P = !0
|
|
2271
2282
|
}) => {
|
|
2272
|
-
var
|
|
2273
|
-
const { channel:
|
|
2274
|
-
var
|
|
2275
|
-
const
|
|
2276
|
-
return
|
|
2277
|
-
(
|
|
2278
|
-
var
|
|
2279
|
-
return ((
|
|
2283
|
+
var O, F, q, J, G, Y;
|
|
2284
|
+
const { channel: N } = ce(), T = U.useMemo(() => {
|
|
2285
|
+
var B, H;
|
|
2286
|
+
const x = (B = N._client) == null ? void 0 : B.userID;
|
|
2287
|
+
return x ? Object.values(((H = N.state) == null ? void 0 : H.members) || {}).find(
|
|
2288
|
+
(X) => {
|
|
2289
|
+
var j;
|
|
2290
|
+
return ((j = X.user) == null ? void 0 : j.id) && X.user.id !== x;
|
|
2280
2291
|
}
|
|
2281
2292
|
) : void 0;
|
|
2282
|
-
}, [(
|
|
2283
|
-
var
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2286
|
-
var
|
|
2287
|
-
return ((
|
|
2293
|
+
}, [(O = N._client) == null ? void 0 : O.userID, (F = N.state) == null ? void 0 : F.members]), A = U.useMemo(() => {
|
|
2294
|
+
var B, H;
|
|
2295
|
+
const x = (B = N._client) == null ? void 0 : B.userID;
|
|
2296
|
+
return x ? Object.values(((H = N.state) == null ? void 0 : H.members) || {}).find((X) => {
|
|
2297
|
+
var j;
|
|
2298
|
+
return ((j = X.user) == null ? void 0 : j.id) === x;
|
|
2288
2299
|
}) : void 0;
|
|
2289
|
-
}, [(
|
|
2290
|
-
(
|
|
2291
|
-
const { message:
|
|
2300
|
+
}, [(q = N._client) == null ? void 0 : q.userID, (J = N.state) == null ? void 0 : J.members]), L = ((G = A == null ? void 0 : A.user) == null ? void 0 : G.is_account) ?? (A == null ? void 0 : A.is_account), M = ((Y = T == null ? void 0 : T.user) == null ? void 0 : Y.is_account) ?? (T == null ? void 0 : T.is_account), S = D && L === !1 && M === !0, I = K(
|
|
2301
|
+
(x) => {
|
|
2302
|
+
const { message: y } = xe("ChannelView"), B = /* @__PURE__ */ n(
|
|
2292
2303
|
Sa,
|
|
2293
2304
|
{
|
|
2294
|
-
...
|
|
2305
|
+
...x,
|
|
2295
2306
|
chatbotVotingEnabled: p,
|
|
2296
|
-
viewerLanguage:
|
|
2307
|
+
viewerLanguage: $
|
|
2297
2308
|
}
|
|
2298
2309
|
);
|
|
2299
|
-
return !E || !
|
|
2310
|
+
return !E || !y ? B : E(B, y);
|
|
2300
2311
|
},
|
|
2301
|
-
[p, E,
|
|
2312
|
+
[p, E, $]
|
|
2302
2313
|
);
|
|
2303
2314
|
return /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(
|
|
2304
2315
|
os,
|
|
2305
2316
|
{
|
|
2306
2317
|
overrides: {
|
|
2307
|
-
Message:
|
|
2318
|
+
Message: I,
|
|
2308
2319
|
MessageActions: Aa
|
|
2309
2320
|
},
|
|
2310
2321
|
children: /* @__PURE__ */ h(ls, { children: [
|
|
@@ -2313,9 +2324,9 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2313
2324
|
{
|
|
2314
2325
|
onBack: e,
|
|
2315
2326
|
showBackButton: t,
|
|
2316
|
-
showChannelInfo:
|
|
2317
|
-
showStarButton:
|
|
2318
|
-
dmAgentEnabled:
|
|
2327
|
+
showChannelInfo: P,
|
|
2328
|
+
showStarButton: w,
|
|
2329
|
+
dmAgentEnabled: S,
|
|
2319
2330
|
onLeaveConversation: i,
|
|
2320
2331
|
onBlockParticipant: o,
|
|
2321
2332
|
showDeleteConversation: l,
|
|
@@ -2324,11 +2335,12 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2324
2335
|
onDeleteConversationClick: d,
|
|
2325
2336
|
onBlockParticipantClick: m,
|
|
2326
2337
|
onReportParticipantClick: g,
|
|
2327
|
-
customChannelActions:
|
|
2328
|
-
renderChannelActions:
|
|
2338
|
+
customChannelActions: R,
|
|
2339
|
+
renderChannelActions: k,
|
|
2340
|
+
renderHeaderTitleBadges: _
|
|
2329
2341
|
}
|
|
2330
2342
|
) }, "lt-channel-header"),
|
|
2331
|
-
|
|
2343
|
+
v ? /* @__PURE__ */ n(U.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
2332
2344
|
/* @__PURE__ */ n(
|
|
2333
2345
|
"div",
|
|
2334
2346
|
{
|
|
@@ -2337,14 +2349,14 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2337
2349
|
},
|
|
2338
2350
|
"lt-channel-message-list"
|
|
2339
2351
|
),
|
|
2340
|
-
r ? /* @__PURE__ */ n(
|
|
2352
|
+
r ? /* @__PURE__ */ n(U.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
|
|
2341
2353
|
/* @__PURE__ */ n(
|
|
2342
2354
|
Oa,
|
|
2343
2355
|
{
|
|
2344
2356
|
...s && {
|
|
2345
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2357
|
+
renderActions: () => s == null ? void 0 : s(N)
|
|
2346
2358
|
},
|
|
2347
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2359
|
+
renderFooter: () => a == null ? void 0 : a(N),
|
|
2348
2360
|
disabled: c,
|
|
2349
2361
|
disabledReason: b
|
|
2350
2362
|
},
|
|
@@ -2353,7 +2365,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2353
2365
|
] })
|
|
2354
2366
|
}
|
|
2355
2367
|
) });
|
|
2356
|
-
}, dn =
|
|
2368
|
+
}, dn = U.memo(
|
|
2357
2369
|
({
|
|
2358
2370
|
channel: e,
|
|
2359
2371
|
onBack: t,
|
|
@@ -2370,60 +2382,61 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2370
2382
|
onBlockParticipantClick: f,
|
|
2371
2383
|
onReportParticipantClick: c,
|
|
2372
2384
|
showBlockParticipant: b = !0,
|
|
2373
|
-
showReportParticipant:
|
|
2385
|
+
showReportParticipant: w = !0,
|
|
2374
2386
|
composerDisabled: p = !1,
|
|
2375
|
-
composerDisabledReason:
|
|
2387
|
+
composerDisabledReason: v,
|
|
2376
2388
|
dmAgentEnabled: _,
|
|
2377
|
-
messageMetadata:
|
|
2378
|
-
onMessageSent:
|
|
2379
|
-
showStarButton:
|
|
2389
|
+
messageMetadata: R,
|
|
2390
|
+
onMessageSent: k,
|
|
2391
|
+
showStarButton: E = !1,
|
|
2380
2392
|
chatbotVotingEnabled: D = !1,
|
|
2381
|
-
renderChannelBanner:
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2393
|
+
renderChannelBanner: $,
|
|
2394
|
+
renderHeaderTitleBadges: P,
|
|
2395
|
+
customChannelActions: N,
|
|
2396
|
+
renderChannelActions: T,
|
|
2397
|
+
renderMessage: A,
|
|
2385
2398
|
onMessageLinkClick: L,
|
|
2386
|
-
sendButton:
|
|
2387
|
-
attachmentPreviewList:
|
|
2388
|
-
viewerLanguage:
|
|
2389
|
-
showChannelInfo:
|
|
2399
|
+
sendButton: M,
|
|
2400
|
+
attachmentPreviewList: S,
|
|
2401
|
+
viewerLanguage: I,
|
|
2402
|
+
showChannelInfo: O = !0
|
|
2390
2403
|
}) => {
|
|
2391
|
-
const
|
|
2392
|
-
async (
|
|
2393
|
-
var
|
|
2394
|
-
const
|
|
2395
|
-
...
|
|
2396
|
-
...
|
|
2397
|
-
...
|
|
2404
|
+
const F = K(
|
|
2405
|
+
async (J, G, Y) => {
|
|
2406
|
+
var j;
|
|
2407
|
+
const x = ((j = e.data) == null ? void 0 : j.chatbot_paused) === !0, y = _ && !x, B = {
|
|
2408
|
+
...G,
|
|
2409
|
+
...y && { silent: !0 },
|
|
2410
|
+
...R && {
|
|
2398
2411
|
metadata: {
|
|
2399
|
-
...
|
|
2400
|
-
...
|
|
2412
|
+
...G.metadata ?? {},
|
|
2413
|
+
...R
|
|
2401
2414
|
}
|
|
2402
2415
|
}
|
|
2403
|
-
},
|
|
2404
|
-
...
|
|
2405
|
-
...
|
|
2406
|
-
},
|
|
2407
|
-
return
|
|
2416
|
+
}, H = {
|
|
2417
|
+
...Y,
|
|
2418
|
+
...y && { skip_push: !0 }
|
|
2419
|
+
}, X = await e.sendMessage(B, H);
|
|
2420
|
+
return k == null || k(X), X;
|
|
2408
2421
|
},
|
|
2409
|
-
[e, _,
|
|
2410
|
-
),
|
|
2411
|
-
return
|
|
2422
|
+
[e, _, R, k]
|
|
2423
|
+
), q = V(null);
|
|
2424
|
+
return W(() => {
|
|
2412
2425
|
if (!L) return;
|
|
2413
|
-
const
|
|
2414
|
-
if (!
|
|
2415
|
-
const
|
|
2416
|
-
const
|
|
2417
|
-
if (!
|
|
2418
|
-
const
|
|
2419
|
-
L(
|
|
2426
|
+
const J = q.current;
|
|
2427
|
+
if (!J) return;
|
|
2428
|
+
const G = (Y) => {
|
|
2429
|
+
const x = Y.target, y = x == null ? void 0 : x.closest("a[href]"), B = y == null ? void 0 : y.getAttribute("href");
|
|
2430
|
+
if (!B) return;
|
|
2431
|
+
const H = y == null ? void 0 : y.closest("[data-message-id]"), X = H == null ? void 0 : H.getAttribute("data-message-id"), j = X ? e.state.messages.find((ie) => ie.id === X) : void 0;
|
|
2432
|
+
L(B, j);
|
|
2420
2433
|
};
|
|
2421
|
-
return
|
|
2434
|
+
return J.addEventListener("click", G), () => J.removeEventListener("click", G);
|
|
2422
2435
|
}, [L, e]), /* @__PURE__ */ n(
|
|
2423
2436
|
"div",
|
|
2424
2437
|
{
|
|
2425
|
-
ref:
|
|
2426
|
-
className:
|
|
2438
|
+
ref: q,
|
|
2439
|
+
className: C(
|
|
2427
2440
|
"messaging-channel-view h-full flex flex-col",
|
|
2428
2441
|
d
|
|
2429
2442
|
),
|
|
@@ -2436,9 +2449,9 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2436
2449
|
LoadingIndicator: Se,
|
|
2437
2450
|
DateSeparator: Vs,
|
|
2438
2451
|
TypingIndicator: qa,
|
|
2439
|
-
doSendMessageRequest:
|
|
2440
|
-
...
|
|
2441
|
-
...
|
|
2452
|
+
doSendMessageRequest: F,
|
|
2453
|
+
...M ? { SendButton: M } : {},
|
|
2454
|
+
...S ? { AttachmentPreviewList: S } : {},
|
|
2442
2455
|
children: /* @__PURE__ */ n(
|
|
2443
2456
|
Za,
|
|
2444
2457
|
{
|
|
@@ -2455,18 +2468,19 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2455
2468
|
onBlockParticipantClick: f,
|
|
2456
2469
|
onReportParticipantClick: c,
|
|
2457
2470
|
showBlockParticipant: b,
|
|
2458
|
-
showReportParticipant:
|
|
2471
|
+
showReportParticipant: w,
|
|
2459
2472
|
composerDisabled: p,
|
|
2460
|
-
composerDisabledReason:
|
|
2461
|
-
showStarButton:
|
|
2473
|
+
composerDisabledReason: v,
|
|
2474
|
+
showStarButton: E,
|
|
2462
2475
|
dmAgentEnabled: _,
|
|
2463
2476
|
chatbotVotingEnabled: D,
|
|
2464
|
-
renderChannelBanner:
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2477
|
+
renderChannelBanner: $,
|
|
2478
|
+
renderHeaderTitleBadges: P,
|
|
2479
|
+
customChannelActions: N,
|
|
2480
|
+
renderChannelActions: T,
|
|
2481
|
+
renderMessage: A,
|
|
2482
|
+
viewerLanguage: I,
|
|
2483
|
+
showChannelInfo: O
|
|
2470
2484
|
}
|
|
2471
2485
|
)
|
|
2472
2486
|
}
|
|
@@ -2476,7 +2490,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2476
2490
|
}
|
|
2477
2491
|
);
|
|
2478
2492
|
dn.displayName = "ChannelView";
|
|
2479
|
-
const be =
|
|
2493
|
+
const be = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2480
2494
|
/* @__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: "⚠️" }) }),
|
|
2481
2495
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2482
2496
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2506,126 +2520,128 @@ const ki = ({
|
|
|
2506
2520
|
onMessageSent: u,
|
|
2507
2521
|
chatbotVotingEnabled: f = !1,
|
|
2508
2522
|
viewerLanguage: c,
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2523
|
+
renderHeaderTitleBadges: b,
|
|
2524
|
+
renderChannelBanner: w,
|
|
2525
|
+
customChannelActions: p,
|
|
2526
|
+
renderChannelActions: v,
|
|
2527
|
+
renderMessage: _,
|
|
2528
|
+
onMessageLinkClick: R,
|
|
2529
|
+
showChannelInfo: k
|
|
2515
2530
|
}) => {
|
|
2516
2531
|
const {
|
|
2517
2532
|
client: E,
|
|
2518
|
-
isConnected:
|
|
2519
|
-
isLoading:
|
|
2520
|
-
error:
|
|
2521
|
-
refreshConnection:
|
|
2522
|
-
service:
|
|
2523
|
-
debug:
|
|
2524
|
-
} = Os(), [L,
|
|
2525
|
-
|
|
2526
|
-
const
|
|
2527
|
-
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
}, [L]),
|
|
2532
|
-
if (!E || !
|
|
2533
|
-
const
|
|
2534
|
-
if (!
|
|
2535
|
-
const
|
|
2536
|
-
if (
|
|
2537
|
-
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2533
|
+
isConnected: D,
|
|
2534
|
+
isLoading: $,
|
|
2535
|
+
error: P,
|
|
2536
|
+
refreshConnection: N,
|
|
2537
|
+
service: T,
|
|
2538
|
+
debug: A
|
|
2539
|
+
} = Os(), [L, M] = z(null), [S, I] = z(null), [O, F] = z(!1), { showDeleteConversation: q = !0 } = e, J = V(o);
|
|
2540
|
+
J.current = o;
|
|
2541
|
+
const G = V(a);
|
|
2542
|
+
G.current = a;
|
|
2543
|
+
const Y = V(null), x = V(null);
|
|
2544
|
+
W(() => {
|
|
2545
|
+
x.current = L;
|
|
2546
|
+
}, [L]), W(() => {
|
|
2547
|
+
if (!E || !D) return;
|
|
2548
|
+
const H = E.userID;
|
|
2549
|
+
if (!H) return;
|
|
2550
|
+
const X = `${H}::${i}`;
|
|
2551
|
+
if (Y.current === X) return;
|
|
2552
|
+
Y.current = X;
|
|
2553
|
+
const j = () => {
|
|
2554
|
+
Y.current === X && (Y.current = null);
|
|
2540
2555
|
};
|
|
2541
2556
|
(async () => {
|
|
2542
|
-
var
|
|
2557
|
+
var de, ue;
|
|
2543
2558
|
try {
|
|
2544
|
-
|
|
2559
|
+
A && console.log(
|
|
2545
2560
|
"[MessagingShell] Loading initial conversation with:",
|
|
2546
2561
|
i
|
|
2547
2562
|
);
|
|
2548
|
-
const
|
|
2563
|
+
const Q = await E.queryChannels(
|
|
2549
2564
|
{
|
|
2550
2565
|
type: "messaging",
|
|
2551
|
-
members: { $eq: [
|
|
2566
|
+
members: { $eq: [H, i] }
|
|
2552
2567
|
},
|
|
2553
2568
|
{},
|
|
2554
2569
|
{ limit: 1 }
|
|
2555
2570
|
);
|
|
2556
|
-
if (
|
|
2557
|
-
|
|
2571
|
+
if (Q.length > 0) {
|
|
2572
|
+
M(Q[0]), I(null), (de = G.current) == null || de.call(G, Q[0]), A && console.log(
|
|
2558
2573
|
"[MessagingShell] Initial conversation loaded:",
|
|
2559
|
-
|
|
2574
|
+
Q[0].id
|
|
2560
2575
|
);
|
|
2561
2576
|
return;
|
|
2562
2577
|
}
|
|
2563
|
-
const ae =
|
|
2564
|
-
if (!ae || !
|
|
2565
|
-
|
|
2578
|
+
const ae = J.current;
|
|
2579
|
+
if (!ae || !T) {
|
|
2580
|
+
j(), I("No conversation found with this account"), A && console.log(
|
|
2566
2581
|
"[MessagingShell] No conversation found for:",
|
|
2567
2582
|
i
|
|
2568
2583
|
);
|
|
2569
2584
|
return;
|
|
2570
2585
|
}
|
|
2571
2586
|
try {
|
|
2572
|
-
const
|
|
2587
|
+
const Z = await T.startChannelWithParticipant({
|
|
2573
2588
|
id: ae.id,
|
|
2574
2589
|
name: ae.name,
|
|
2575
2590
|
phone: ae.phone
|
|
2576
2591
|
});
|
|
2577
|
-
|
|
2592
|
+
M(Z), I(null), (ue = G.current) == null || ue.call(G, Z), A && console.log(
|
|
2578
2593
|
"[MessagingShell] Channel created and loaded:",
|
|
2579
|
-
|
|
2594
|
+
Z.id
|
|
2580
2595
|
);
|
|
2581
|
-
} catch (
|
|
2596
|
+
} catch (Z) {
|
|
2582
2597
|
console.error(
|
|
2583
2598
|
"[MessagingShell] Failed to create conversation:",
|
|
2584
|
-
|
|
2585
|
-
),
|
|
2599
|
+
Z
|
|
2600
|
+
), j(), I("Failed to create conversation");
|
|
2586
2601
|
}
|
|
2587
|
-
} catch (
|
|
2602
|
+
} catch (Q) {
|
|
2588
2603
|
console.error(
|
|
2589
2604
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2590
|
-
|
|
2591
|
-
),
|
|
2605
|
+
Q
|
|
2606
|
+
), j(), x.current || I("Failed to load conversation");
|
|
2592
2607
|
}
|
|
2593
2608
|
})();
|
|
2594
|
-
}, [i, E,
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2597
|
-
const
|
|
2598
|
-
var
|
|
2599
|
-
|
|
2609
|
+
}, [i, E, D, T, A]);
|
|
2610
|
+
const y = V(r);
|
|
2611
|
+
y.current = r;
|
|
2612
|
+
const B = K(() => {
|
|
2613
|
+
var H;
|
|
2614
|
+
M(null), F(!0), (H = y.current) == null || H.call(y);
|
|
2600
2615
|
}, []);
|
|
2601
|
-
return
|
|
2616
|
+
return $ ? /* @__PURE__ */ n(Se, {}) : P ? /* @__PURE__ */ n(be, { message: P, onBack: N }) : !D || !E ? /* @__PURE__ */ n(
|
|
2602
2617
|
be,
|
|
2603
2618
|
{
|
|
2604
2619
|
message: "Not connected to messaging service",
|
|
2605
|
-
onBack:
|
|
2620
|
+
onBack: N
|
|
2606
2621
|
}
|
|
2607
|
-
) :
|
|
2622
|
+
) : S ? /* @__PURE__ */ n(be, { message: S }) : O && !L ? /* @__PURE__ */ n(be, { message: "Conversation ended" }) : L ? /* @__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(
|
|
2608
2623
|
dn,
|
|
2609
2624
|
{
|
|
2610
2625
|
channel: L,
|
|
2611
2626
|
renderMessageInputActions: t,
|
|
2612
2627
|
renderConversationFooter: s,
|
|
2613
|
-
renderChannelBanner:
|
|
2614
|
-
onLeaveConversation:
|
|
2615
|
-
onBlockParticipant:
|
|
2628
|
+
renderChannelBanner: w,
|
|
2629
|
+
onLeaveConversation: B,
|
|
2630
|
+
onBlockParticipant: B,
|
|
2616
2631
|
CustomChannelEmptyState: l,
|
|
2617
|
-
showDeleteConversation:
|
|
2632
|
+
showDeleteConversation: q,
|
|
2618
2633
|
onBlockParticipantClick: d,
|
|
2619
2634
|
onReportParticipantClick: m,
|
|
2620
2635
|
dmAgentEnabled: g,
|
|
2621
2636
|
onMessageSent: u,
|
|
2622
2637
|
chatbotVotingEnabled: f,
|
|
2623
2638
|
viewerLanguage: c,
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2639
|
+
renderHeaderTitleBadges: b,
|
|
2640
|
+
customChannelActions: p,
|
|
2641
|
+
renderChannelActions: v,
|
|
2642
|
+
renderMessage: _,
|
|
2643
|
+
onMessageLinkClick: R,
|
|
2644
|
+
showChannelInfo: k
|
|
2629
2645
|
},
|
|
2630
2646
|
L.id
|
|
2631
2647
|
) }) }) : /* @__PURE__ */ n(Se, {});
|
|
@@ -2636,14 +2652,14 @@ function Qa(e) {
|
|
|
2636
2652
|
for (const s of t)
|
|
2637
2653
|
e.state.addMessageSorted(s.message);
|
|
2638
2654
|
}
|
|
2639
|
-
const un =
|
|
2655
|
+
const un = U.createContext({
|
|
2640
2656
|
selectedChannel: void 0,
|
|
2641
2657
|
onChannelSelect: () => {
|
|
2642
2658
|
},
|
|
2643
2659
|
debug: !1,
|
|
2644
2660
|
renderMessagePreview: void 0,
|
|
2645
2661
|
viewerLanguage: void 0
|
|
2646
|
-
}), er = un.Provider, tr = () =>
|
|
2662
|
+
}), er = un.Provider, tr = () => U.useContext(un), nr = (e, t) => {
|
|
2647
2663
|
const s = new Date(
|
|
2648
2664
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2649
2665
|
), r = new Date(
|
|
@@ -2664,9 +2680,9 @@ const un = j.createContext({
|
|
|
2664
2680
|
day: "numeric",
|
|
2665
2681
|
year: "2-digit"
|
|
2666
2682
|
});
|
|
2667
|
-
}, mn =
|
|
2683
|
+
}, mn = U.memo(
|
|
2668
2684
|
({ channel: e, unread: t }) => {
|
|
2669
|
-
var D,
|
|
2685
|
+
var D, $, P;
|
|
2670
2686
|
const {
|
|
2671
2687
|
selectedChannel: s,
|
|
2672
2688
|
onChannelSelect: a,
|
|
@@ -2676,39 +2692,39 @@ const un = j.createContext({
|
|
|
2676
2692
|
} = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2677
2693
|
e && a(e);
|
|
2678
2694
|
}, m = (N) => {
|
|
2679
|
-
const
|
|
2680
|
-
!
|
|
2695
|
+
const T = N.key === "Enter" || N.key === " ", A = N.repeat;
|
|
2696
|
+
!T || A || (N.preventDefault(), d());
|
|
2681
2697
|
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
2682
2698
|
(N) => {
|
|
2683
|
-
var
|
|
2684
|
-
return ((
|
|
2699
|
+
var T, A;
|
|
2700
|
+
return ((T = N.user) == null ? void 0 : T.id) && N.user.id !== ((A = e == null ? void 0 : e._client) == null ? void 0 : A.userID);
|
|
2685
2701
|
}
|
|
2686
|
-
), f = Wt(u == null ? void 0 : u.user), c = (
|
|
2687
|
-
var
|
|
2688
|
-
const N = (
|
|
2702
|
+
), f = Wt(u == null ? void 0 : u.user), c = ($ = u == null ? void 0 : u.user) == null ? void 0 : $.image, b = (() => {
|
|
2703
|
+
var T;
|
|
2704
|
+
const N = (T = e == null ? void 0 : e.state) == null ? void 0 : T.messages;
|
|
2689
2705
|
if (N != null && N.length) {
|
|
2690
|
-
for (let
|
|
2691
|
-
if (N[
|
|
2706
|
+
for (let A = N.length - 1; A >= 0; A--)
|
|
2707
|
+
if (N[A].type !== "system") return N[A];
|
|
2692
2708
|
}
|
|
2693
2709
|
})(), p = (() => {
|
|
2694
|
-
var
|
|
2710
|
+
var S, I, O, F;
|
|
2695
2711
|
const N = Xt({
|
|
2696
2712
|
message: b,
|
|
2697
2713
|
viewerLanguage: o
|
|
2698
2714
|
});
|
|
2699
|
-
if (((
|
|
2700
|
-
if (((
|
|
2701
|
-
if (((
|
|
2715
|
+
if (((S = b == null ? void 0 : b.metadata) == null ? void 0 : S.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
|
|
2716
|
+
if (((I = b == null ? void 0 : b.metadata) == null ? void 0 : I.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
|
|
2717
|
+
if (((O = b == null ? void 0 : b.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
|
|
2702
2718
|
if (N) return N;
|
|
2703
|
-
const M = (
|
|
2719
|
+
const M = (F = b == null ? void 0 : b.attachments) == null ? void 0 : F[0];
|
|
2704
2720
|
return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2705
|
-
})(),
|
|
2721
|
+
})(), v = b != null && b.created_at ? sr(new Date(b.created_at)) : "", _ = b ? Ee(b) : !1, R = i ? i(b, p) : `${_ ? "✨ " : ""}${p}`, k = qt(e), E = t ?? 0;
|
|
2706
2722
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2707
2723
|
channelId: e == null ? void 0 : e.id,
|
|
2708
2724
|
isSelected: l,
|
|
2709
2725
|
participantName: f,
|
|
2710
|
-
unreadCount:
|
|
2711
|
-
hasTimestamp: !!
|
|
2726
|
+
unreadCount: E,
|
|
2727
|
+
hasTimestamp: !!v
|
|
2712
2728
|
}), /* @__PURE__ */ n(
|
|
2713
2729
|
"div",
|
|
2714
2730
|
{
|
|
@@ -2716,7 +2732,7 @@ const un = j.createContext({
|
|
|
2716
2732
|
tabIndex: 0,
|
|
2717
2733
|
onClick: d,
|
|
2718
2734
|
onKeyDown: m,
|
|
2719
|
-
className:
|
|
2735
|
+
className: C(
|
|
2720
2736
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2721
2737
|
{
|
|
2722
2738
|
"bg-black/[0.04]": l,
|
|
@@ -2727,11 +2743,11 @@ const un = j.createContext({
|
|
|
2727
2743
|
/* @__PURE__ */ n(
|
|
2728
2744
|
re,
|
|
2729
2745
|
{
|
|
2730
|
-
id: ((
|
|
2746
|
+
id: ((P = u == null ? void 0 : u.user) == null ? void 0 : P.id) || e.id || "unknown",
|
|
2731
2747
|
name: f,
|
|
2732
2748
|
image: c,
|
|
2733
2749
|
size: 48,
|
|
2734
|
-
starred:
|
|
2750
|
+
starred: k
|
|
2735
2751
|
}
|
|
2736
2752
|
),
|
|
2737
2753
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2739,20 +2755,20 @@ const un = j.createContext({
|
|
|
2739
2755
|
/* @__PURE__ */ h(
|
|
2740
2756
|
"h3",
|
|
2741
2757
|
{
|
|
2742
|
-
className:
|
|
2758
|
+
className: C(
|
|
2743
2759
|
"text-sm font-medium truncate text-[#191918]"
|
|
2744
2760
|
),
|
|
2745
2761
|
children: [
|
|
2746
|
-
|
|
2762
|
+
k && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2747
2763
|
f
|
|
2748
2764
|
]
|
|
2749
2765
|
}
|
|
2750
2766
|
),
|
|
2751
|
-
|
|
2767
|
+
v && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: v })
|
|
2752
2768
|
] }),
|
|
2753
2769
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2754
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2755
|
-
|
|
2770
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
|
|
2771
|
+
E > 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: E > 99 ? "99+" : E })
|
|
2756
2772
|
] })
|
|
2757
2773
|
] })
|
|
2758
2774
|
] })
|
|
@@ -2761,7 +2777,7 @@ const un = j.createContext({
|
|
|
2761
2777
|
}
|
|
2762
2778
|
);
|
|
2763
2779
|
mn.displayName = "CustomChannelPreview";
|
|
2764
|
-
const ar = { last_message_at: -1 }, rr =
|
|
2780
|
+
const ar = { last_message_at: -1 }, rr = U.memo(
|
|
2765
2781
|
({
|
|
2766
2782
|
onChannelSelect: e,
|
|
2767
2783
|
selectedChannel: t,
|
|
@@ -2774,12 +2790,12 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2774
2790
|
renderMessagePreview: d,
|
|
2775
2791
|
viewerLanguage: m
|
|
2776
2792
|
}) => {
|
|
2777
|
-
const g =
|
|
2793
|
+
const g = U.useRef(0);
|
|
2778
2794
|
g.current++;
|
|
2779
|
-
const { debug: u = !1 } = We(), f =
|
|
2795
|
+
const { debug: u = !1 } = We(), f = U.useCallback(
|
|
2780
2796
|
(b) => {
|
|
2781
|
-
for (const
|
|
2782
|
-
Qa(
|
|
2797
|
+
for (const w of b)
|
|
2798
|
+
Qa(w);
|
|
2783
2799
|
return r ? r(b) : b;
|
|
2784
2800
|
},
|
|
2785
2801
|
[r]
|
|
@@ -2789,7 +2805,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2789
2805
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2790
2806
|
filters: s
|
|
2791
2807
|
});
|
|
2792
|
-
const c =
|
|
2808
|
+
const c = U.useMemo(
|
|
2793
2809
|
() => ({
|
|
2794
2810
|
selectedChannel: t,
|
|
2795
2811
|
onChannelSelect: e,
|
|
@@ -2808,7 +2824,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2808
2824
|
return /* @__PURE__ */ n(
|
|
2809
2825
|
"div",
|
|
2810
2826
|
{
|
|
2811
|
-
className:
|
|
2827
|
+
className: C(
|
|
2812
2828
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2813
2829
|
o
|
|
2814
2830
|
),
|
|
@@ -2847,7 +2863,7 @@ const lr = {
|
|
|
2847
2863
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2848
2864
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2849
2865
|
}, cr = ({ variant: e, cta: t }) => {
|
|
2850
|
-
const s =
|
|
2866
|
+
const s = C(
|
|
2851
2867
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2852
2868
|
lr[e]
|
|
2853
2869
|
), a = et(t.href);
|
|
@@ -2894,10 +2910,10 @@ const lr = {
|
|
|
2894
2910
|
}) => {
|
|
2895
2911
|
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
2912
|
if (!g && !u && !c && !b) return null;
|
|
2897
|
-
const p =
|
|
2913
|
+
const p = C(
|
|
2898
2914
|
"truncate text-base font-medium leading-6",
|
|
2899
2915
|
d && !t ? ur : dr[e]
|
|
2900
|
-
),
|
|
2916
|
+
), v = C(
|
|
2901
2917
|
"truncate text-xs leading-4",
|
|
2902
2918
|
mr[e]
|
|
2903
2919
|
);
|
|
@@ -2907,17 +2923,17 @@ const lr = {
|
|
|
2907
2923
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2908
2924
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2909
2925
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2910
|
-
/* @__PURE__ */ n("p", { className:
|
|
2926
|
+
/* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
|
|
2911
2927
|
] }),
|
|
2912
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2928
|
+
u && /* @__PURE__ */ n("p", { className: v, children: a })
|
|
2913
2929
|
] }),
|
|
2914
|
-
!b && c && /* @__PURE__ */ n("p", { className:
|
|
2930
|
+
!b && c && /* @__PURE__ */ n("p", { className: v, children: f })
|
|
2915
2931
|
] }),
|
|
2916
2932
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2917
2933
|
] }),
|
|
2918
2934
|
o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
|
|
2919
2935
|
] });
|
|
2920
|
-
}, hr =
|
|
2936
|
+
}, hr = C(
|
|
2921
2937
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2922
2938
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2923
2939
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2935,7 +2951,7 @@ const lr = {
|
|
|
2935
2951
|
bgClassName: l,
|
|
2936
2952
|
"data-testid": d
|
|
2937
2953
|
}) => {
|
|
2938
|
-
const m = s != null || a != null, g =
|
|
2954
|
+
const m = s != null || a != null, g = C(
|
|
2939
2955
|
hr,
|
|
2940
2956
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2941
2957
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -2966,7 +2982,7 @@ const lr = {
|
|
|
2966
2982
|
onClick: a,
|
|
2967
2983
|
"aria-label": r,
|
|
2968
2984
|
"data-testid": d,
|
|
2969
|
-
className:
|
|
2985
|
+
className: C(g, "text-left"),
|
|
2970
2986
|
children: [
|
|
2971
2987
|
t,
|
|
2972
2988
|
u
|
|
@@ -3016,7 +3032,7 @@ const lr = {
|
|
|
3016
3032
|
) }) : /* @__PURE__ */ h(
|
|
3017
3033
|
"div",
|
|
3018
3034
|
{
|
|
3019
|
-
className:
|
|
3035
|
+
className: C(
|
|
3020
3036
|
"relative h-[180px] w-full overflow-hidden",
|
|
3021
3037
|
d && "bg-black"
|
|
3022
3038
|
),
|
|
@@ -3043,11 +3059,11 @@ const lr = {
|
|
|
3043
3059
|
) : /* @__PURE__ */ n(
|
|
3044
3060
|
"div",
|
|
3045
3061
|
{
|
|
3046
|
-
className:
|
|
3062
|
+
className: C(
|
|
3047
3063
|
"flex h-full w-full items-center justify-center",
|
|
3048
3064
|
fr[e]
|
|
3049
3065
|
),
|
|
3050
|
-
children:
|
|
3066
|
+
children: le(r, {
|
|
3051
3067
|
className: gr[e],
|
|
3052
3068
|
weight: "regular"
|
|
3053
3069
|
})
|
|
@@ -3081,7 +3097,7 @@ const lr = {
|
|
|
3081
3097
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3082
3098
|
children: /* @__PURE__ */ n(Me, { className: "size-3", weight: "bold" })
|
|
3083
3099
|
}
|
|
3084
|
-
) : void 0,
|
|
3100
|
+
) : void 0, w = u ? /* @__PURE__ */ n(
|
|
3085
3101
|
"button",
|
|
3086
3102
|
{
|
|
3087
3103
|
type: "button",
|
|
@@ -3129,7 +3145,7 @@ const lr = {
|
|
|
3129
3145
|
url: a,
|
|
3130
3146
|
appIcon: d,
|
|
3131
3147
|
cta: m,
|
|
3132
|
-
trailingAction:
|
|
3148
|
+
trailingAction: w
|
|
3133
3149
|
}
|
|
3134
3150
|
)
|
|
3135
3151
|
]
|
|
@@ -3147,7 +3163,7 @@ const lr = {
|
|
|
3147
3163
|
cta: d,
|
|
3148
3164
|
onClick: m
|
|
3149
3165
|
}) => {
|
|
3150
|
-
const g = hn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Re(a, i) ? nt : void 0,
|
|
3166
|
+
const g = hn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Re(a, i) ? nt : void 0, w = d && m ? {
|
|
3151
3167
|
...d,
|
|
3152
3168
|
onClick: () => {
|
|
3153
3169
|
var p;
|
|
@@ -3182,7 +3198,7 @@ const lr = {
|
|
|
3182
3198
|
description: t,
|
|
3183
3199
|
url: s,
|
|
3184
3200
|
appIcon: l,
|
|
3185
|
-
cta:
|
|
3201
|
+
cta: w
|
|
3186
3202
|
}
|
|
3187
3203
|
)
|
|
3188
3204
|
]
|
|
@@ -3276,7 +3292,7 @@ const lr = {
|
|
|
3276
3292
|
{
|
|
3277
3293
|
"data-testid": o,
|
|
3278
3294
|
"data-group-position": a,
|
|
3279
|
-
className:
|
|
3295
|
+
className: C(
|
|
3280
3296
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3281
3297
|
// and keeps the document / image / audio bubbles visually
|
|
3282
3298
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3296,7 +3312,7 @@ const lr = {
|
|
|
3296
3312
|
l ? /* @__PURE__ */ n(
|
|
3297
3313
|
"p",
|
|
3298
3314
|
{
|
|
3299
|
-
className:
|
|
3315
|
+
className: C(
|
|
3300
3316
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3301
3317
|
// the same font family + size as `.str-chat__message-text`
|
|
3302
3318
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3325,7 +3341,7 @@ const lr = {
|
|
|
3325
3341
|
a.stopPropagation(), e();
|
|
3326
3342
|
},
|
|
3327
3343
|
"aria-label": s,
|
|
3328
|
-
className:
|
|
3344
|
+
className: C(
|
|
3329
3345
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3330
3346
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3331
3347
|
),
|
|
@@ -3429,7 +3445,7 @@ function Lr(e, t, s) {
|
|
|
3429
3445
|
const a = Rr(e, t), r = typeof s == "number" && s > 0 ? Ar(s) : void 0;
|
|
3430
3446
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3431
3447
|
}
|
|
3432
|
-
function
|
|
3448
|
+
function ee(e) {
|
|
3433
3449
|
try {
|
|
3434
3450
|
const s = new URL(e).pathname.split("/").pop();
|
|
3435
3451
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3459,13 +3475,13 @@ const Dr = {
|
|
|
3459
3475
|
const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
|
|
3460
3476
|
"div",
|
|
3461
3477
|
{
|
|
3462
|
-
className:
|
|
3478
|
+
className: C(
|
|
3463
3479
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3464
3480
|
Pr[e]
|
|
3465
3481
|
),
|
|
3466
3482
|
"aria-hidden": !0,
|
|
3467
|
-
children:
|
|
3468
|
-
className:
|
|
3483
|
+
children: le(a, {
|
|
3484
|
+
className: C("size-6", Or[e]),
|
|
3469
3485
|
weight: "regular"
|
|
3470
3486
|
})
|
|
3471
3487
|
}
|
|
@@ -3474,7 +3490,7 @@ const Dr = {
|
|
|
3474
3490
|
m ? /* @__PURE__ */ n(
|
|
3475
3491
|
"p",
|
|
3476
3492
|
{
|
|
3477
|
-
className:
|
|
3493
|
+
className: C(
|
|
3478
3494
|
"truncate text-xs leading-4",
|
|
3479
3495
|
Dr[e]
|
|
3480
3496
|
),
|
|
@@ -3487,7 +3503,7 @@ const Dr = {
|
|
|
3487
3503
|
type: "button",
|
|
3488
3504
|
onClick: i,
|
|
3489
3505
|
"aria-label": o,
|
|
3490
|
-
className:
|
|
3506
|
+
className: C(
|
|
3491
3507
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3492
3508
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3493
3509
|
),
|
|
@@ -3506,7 +3522,7 @@ const Dr = {
|
|
|
3506
3522
|
] });
|
|
3507
3523
|
};
|
|
3508
3524
|
async function gn(e, t) {
|
|
3509
|
-
const s = t ??
|
|
3525
|
+
const s = t ?? ee(e);
|
|
3510
3526
|
try {
|
|
3511
3527
|
const a = await fetch(e, { mode: "cors" });
|
|
3512
3528
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -3533,7 +3549,7 @@ const zr = ({
|
|
|
3533
3549
|
onActivate: a,
|
|
3534
3550
|
trailingAction: r
|
|
3535
3551
|
}) => {
|
|
3536
|
-
const i = t.filename ??
|
|
3552
|
+
const i = t.filename ?? ee(t.src);
|
|
3537
3553
|
return /* @__PURE__ */ n(
|
|
3538
3554
|
fn,
|
|
3539
3555
|
{
|
|
@@ -3569,17 +3585,17 @@ const zr = ({
|
|
|
3569
3585
|
items: o
|
|
3570
3586
|
}), b = (p) => {
|
|
3571
3587
|
if ((m == null ? void 0 : m(p)) === !1) return;
|
|
3572
|
-
const
|
|
3573
|
-
if (!
|
|
3574
|
-
const _ =
|
|
3575
|
-
gn(
|
|
3588
|
+
const v = c[p];
|
|
3589
|
+
if (!v) return;
|
|
3590
|
+
const _ = v.filename ?? ee(v.src);
|
|
3591
|
+
gn(v.src, _);
|
|
3576
3592
|
};
|
|
3577
3593
|
if (c.length === 0)
|
|
3578
3594
|
return null;
|
|
3579
|
-
const
|
|
3595
|
+
const w = /* @__PURE__ */ n(
|
|
3580
3596
|
"span",
|
|
3581
3597
|
{
|
|
3582
|
-
className:
|
|
3598
|
+
className: C(
|
|
3583
3599
|
"flex size-8 items-center justify-center rounded-full",
|
|
3584
3600
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3585
3601
|
),
|
|
@@ -3594,16 +3610,16 @@ const zr = ({
|
|
|
3594
3610
|
text: l,
|
|
3595
3611
|
groupPosition: d,
|
|
3596
3612
|
"data-testid": "file-attachment",
|
|
3597
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p,
|
|
3613
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, v) => /* @__PURE__ */ n(
|
|
3598
3614
|
$r,
|
|
3599
3615
|
{
|
|
3600
3616
|
variant: u,
|
|
3601
3617
|
item: p,
|
|
3602
|
-
index:
|
|
3618
|
+
index: v,
|
|
3603
3619
|
onActivate: b,
|
|
3604
|
-
trailingAction: f &&
|
|
3620
|
+
trailingAction: f && v === 0 ? /* @__PURE__ */ n(_e, { onClick: g, variant: "inline" }) : w
|
|
3605
3621
|
},
|
|
3606
|
-
`${p.src}-${
|
|
3622
|
+
`${p.src}-${v}`
|
|
3607
3623
|
)) })
|
|
3608
3624
|
}
|
|
3609
3625
|
);
|
|
@@ -3646,7 +3662,7 @@ const zr = ({
|
|
|
3646
3662
|
tone: i = "dark",
|
|
3647
3663
|
onTriggered: o
|
|
3648
3664
|
}) => {
|
|
3649
|
-
const [l, d] =
|
|
3665
|
+
const [l, d] = z(!1), m = K(
|
|
3650
3666
|
(c) => {
|
|
3651
3667
|
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3652
3668
|
}).finally(() => {
|
|
@@ -3654,7 +3670,7 @@ const zr = ({
|
|
|
3654
3670
|
}));
|
|
3655
3671
|
},
|
|
3656
3672
|
[l, e, t, o]
|
|
3657
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3673
|
+
), g = r ?? s !== "pill", f = { className: C(
|
|
3658
3674
|
s === "pill" ? "size-4" : "size-5",
|
|
3659
3675
|
"shrink-0"
|
|
3660
3676
|
), weight: "bold" };
|
|
@@ -3665,7 +3681,7 @@ const zr = ({
|
|
|
3665
3681
|
onClick: m,
|
|
3666
3682
|
disabled: l,
|
|
3667
3683
|
"aria-label": a,
|
|
3668
|
-
className:
|
|
3684
|
+
className: C(
|
|
3669
3685
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3670
3686
|
{
|
|
3671
3687
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3705,7 +3721,7 @@ const zr = ({
|
|
|
3705
3721
|
onClick: m,
|
|
3706
3722
|
disabled: l,
|
|
3707
3723
|
"aria-label": g ? a : void 0,
|
|
3708
|
-
className:
|
|
3724
|
+
className: C(
|
|
3709
3725
|
"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",
|
|
3710
3726
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3711
3727
|
),
|
|
@@ -3727,18 +3743,18 @@ const zr = ({
|
|
|
3727
3743
|
initialIndex: t,
|
|
3728
3744
|
open: s
|
|
3729
3745
|
}) => {
|
|
3730
|
-
const a = Fe(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3731
|
-
|
|
3746
|
+
const a = Fe(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
|
|
3747
|
+
W(() => {
|
|
3732
3748
|
s && i(Fe(t, 0, Math.max(e - 1, 0)));
|
|
3733
|
-
}, [s, t, e]),
|
|
3749
|
+
}, [s, t, e]), W(() => {
|
|
3734
3750
|
i((d) => Fe(d, 0, Math.max(e - 1, 0)));
|
|
3735
3751
|
}, [e]);
|
|
3736
|
-
const o =
|
|
3752
|
+
const o = K(() => {
|
|
3737
3753
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3738
|
-
}, [e]), l =
|
|
3754
|
+
}, [e]), l = K(() => {
|
|
3739
3755
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3740
3756
|
}, [e]);
|
|
3741
|
-
return
|
|
3757
|
+
return W(() => {
|
|
3742
3758
|
if (!s || e <= 1) return;
|
|
3743
3759
|
const d = (m) => {
|
|
3744
3760
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
@@ -3757,7 +3773,7 @@ const zr = ({
|
|
|
3757
3773
|
"data-testid": o
|
|
3758
3774
|
}) => {
|
|
3759
3775
|
const l = V(null), d = V(null);
|
|
3760
|
-
return
|
|
3776
|
+
return W(() => {
|
|
3761
3777
|
var f;
|
|
3762
3778
|
const u = l.current;
|
|
3763
3779
|
if (u) {
|
|
@@ -3848,7 +3864,7 @@ const zr = ({
|
|
|
3848
3864
|
initialIndex: s,
|
|
3849
3865
|
open: e
|
|
3850
3866
|
}), l = t[r], d = te(
|
|
3851
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3867
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ee(l.src) : "image"),
|
|
3852
3868
|
[l]
|
|
3853
3869
|
);
|
|
3854
3870
|
return l ? /* @__PURE__ */ h(
|
|
@@ -3902,14 +3918,14 @@ const zr = ({
|
|
|
3902
3918
|
const r = e.length;
|
|
3903
3919
|
if (r === 0) return null;
|
|
3904
3920
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
3905
|
-
const u =
|
|
3921
|
+
const u = C(Vr, "h-full w-full");
|
|
3906
3922
|
return t ? /* @__PURE__ */ h(
|
|
3907
3923
|
"button",
|
|
3908
3924
|
{
|
|
3909
3925
|
type: "button",
|
|
3910
3926
|
onClick: () => t(m),
|
|
3911
3927
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3912
|
-
className:
|
|
3928
|
+
className: C(u, "cursor-zoom-in"),
|
|
3913
3929
|
children: [
|
|
3914
3930
|
d.content,
|
|
3915
3931
|
g
|
|
@@ -3921,10 +3937,10 @@ const zr = ({
|
|
|
3921
3937
|
g
|
|
3922
3938
|
] }, m);
|
|
3923
3939
|
};
|
|
3924
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3940
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3925
3941
|
"div",
|
|
3926
3942
|
{
|
|
3927
|
-
className:
|
|
3943
|
+
className: C(
|
|
3928
3944
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3929
3945
|
a
|
|
3930
3946
|
),
|
|
@@ -3933,7 +3949,7 @@ const zr = ({
|
|
|
3933
3949
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3934
3950
|
"div",
|
|
3935
3951
|
{
|
|
3936
|
-
className:
|
|
3952
|
+
className: C(
|
|
3937
3953
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3938
3954
|
a
|
|
3939
3955
|
),
|
|
@@ -3946,7 +3962,7 @@ const zr = ({
|
|
|
3946
3962
|
) : /* @__PURE__ */ n(
|
|
3947
3963
|
"div",
|
|
3948
3964
|
{
|
|
3949
|
-
className:
|
|
3965
|
+
className: C(
|
|
3950
3966
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3951
3967
|
a
|
|
3952
3968
|
),
|
|
@@ -3964,12 +3980,12 @@ const zr = ({
|
|
|
3964
3980
|
}
|
|
3965
3981
|
);
|
|
3966
3982
|
}, ye = (e) => {
|
|
3967
|
-
const [t, s] =
|
|
3983
|
+
const [t, s] = z(!1), [a, r] = z(0), i = K(
|
|
3968
3984
|
(l) => {
|
|
3969
3985
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3970
3986
|
},
|
|
3971
3987
|
[e]
|
|
3972
|
-
), o =
|
|
3988
|
+
), o = K(() => s(!1), []);
|
|
3973
3989
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
3974
3990
|
}, Gr = (e, t, s, a) => ({
|
|
3975
3991
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
@@ -4046,8 +4062,8 @@ const zr = ({
|
|
|
4046
4062
|
);
|
|
4047
4063
|
if (m.length === 0)
|
|
4048
4064
|
return null;
|
|
4049
|
-
const
|
|
4050
|
-
(p,
|
|
4065
|
+
const w = m.map(
|
|
4066
|
+
(p, v) => Gr(p, v, m.length, l)
|
|
4051
4067
|
);
|
|
4052
4068
|
return /* @__PURE__ */ h(
|
|
4053
4069
|
we,
|
|
@@ -4057,7 +4073,7 @@ const zr = ({
|
|
|
4057
4073
|
groupPosition: o,
|
|
4058
4074
|
"data-testid": "image-attachment",
|
|
4059
4075
|
children: [
|
|
4060
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles:
|
|
4076
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: w, onTileActivate: c }) }),
|
|
4061
4077
|
/* @__PURE__ */ n(
|
|
4062
4078
|
pn,
|
|
4063
4079
|
{
|
|
@@ -4085,7 +4101,7 @@ const zr = ({
|
|
|
4085
4101
|
initialIndex: s,
|
|
4086
4102
|
open: e
|
|
4087
4103
|
}), l = t[r], d = te(
|
|
4088
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4104
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ee(l.src) : "document"),
|
|
4089
4105
|
[l]
|
|
4090
4106
|
), m = te(
|
|
4091
4107
|
() => l ? Zr(l.src) : void 0,
|
|
@@ -4138,7 +4154,7 @@ const zr = ({
|
|
|
4138
4154
|
onActivate: a,
|
|
4139
4155
|
trailingAction: r
|
|
4140
4156
|
}) => {
|
|
4141
|
-
const i = t.filename ??
|
|
4157
|
+
const i = t.filename ?? ee(t.src);
|
|
4142
4158
|
return /* @__PURE__ */ n(
|
|
4143
4159
|
fn,
|
|
4144
4160
|
{
|
|
@@ -4164,14 +4180,14 @@ const zr = ({
|
|
|
4164
4180
|
onClick: d,
|
|
4165
4181
|
onDismiss: m
|
|
4166
4182
|
}) => {
|
|
4167
|
-
const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer:
|
|
4183
|
+
const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: w } = ye(
|
|
4168
4184
|
d
|
|
4169
4185
|
), p = e === "composer" && !!m;
|
|
4170
4186
|
if (u.length === 0)
|
|
4171
4187
|
return null;
|
|
4172
|
-
const
|
|
4188
|
+
const v = u.map((_) => ({
|
|
4173
4189
|
src: _.src,
|
|
4174
|
-
filename: _.filename ??
|
|
4190
|
+
filename: _.filename ?? ee(_.src)
|
|
4175
4191
|
}));
|
|
4176
4192
|
return /* @__PURE__ */ h(
|
|
4177
4193
|
we,
|
|
@@ -4181,14 +4197,14 @@ const zr = ({
|
|
|
4181
4197
|
groupPosition: l,
|
|
4182
4198
|
"data-testid": "pdf-attachment",
|
|
4183
4199
|
children: [
|
|
4184
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_,
|
|
4185
|
-
const
|
|
4200
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_, R) => {
|
|
4201
|
+
const k = _.filename ?? ee(_.src), E = p && R === 0 ? /* @__PURE__ */ n(_e, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4186
4202
|
bn,
|
|
4187
4203
|
{
|
|
4188
4204
|
url: _.src,
|
|
4189
|
-
filename:
|
|
4205
|
+
filename: k,
|
|
4190
4206
|
variant: "inline",
|
|
4191
|
-
label: `Download ${
|
|
4207
|
+
label: `Download ${k}`,
|
|
4192
4208
|
tone: g
|
|
4193
4209
|
}
|
|
4194
4210
|
);
|
|
@@ -4197,20 +4213,20 @@ const zr = ({
|
|
|
4197
4213
|
{
|
|
4198
4214
|
variant: g,
|
|
4199
4215
|
item: _,
|
|
4200
|
-
index:
|
|
4216
|
+
index: R,
|
|
4201
4217
|
onActivate: b,
|
|
4202
|
-
trailingAction:
|
|
4218
|
+
trailingAction: E
|
|
4203
4219
|
},
|
|
4204
|
-
`${_.src}-${
|
|
4220
|
+
`${_.src}-${R}`
|
|
4205
4221
|
);
|
|
4206
4222
|
}) }),
|
|
4207
4223
|
/* @__PURE__ */ n(
|
|
4208
4224
|
Jr,
|
|
4209
4225
|
{
|
|
4210
4226
|
open: f,
|
|
4211
|
-
items:
|
|
4227
|
+
items: v,
|
|
4212
4228
|
initialIndex: c,
|
|
4213
|
-
onClose:
|
|
4229
|
+
onClose: w
|
|
4214
4230
|
}
|
|
4215
4231
|
)
|
|
4216
4232
|
]
|
|
@@ -4231,7 +4247,7 @@ const zr = ({
|
|
|
4231
4247
|
initialIndex: s,
|
|
4232
4248
|
open: e
|
|
4233
4249
|
}), l = t[r], d = te(
|
|
4234
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4250
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ee(l.src) : "video"),
|
|
4235
4251
|
[l]
|
|
4236
4252
|
);
|
|
4237
4253
|
return l ? /* @__PURE__ */ h(
|
|
@@ -4349,13 +4365,13 @@ const zr = ({
|
|
|
4349
4365
|
preload: d,
|
|
4350
4366
|
onClick: m
|
|
4351
4367
|
}) => {
|
|
4352
|
-
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer:
|
|
4368
|
+
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: w } = ye(
|
|
4353
4369
|
m
|
|
4354
4370
|
);
|
|
4355
4371
|
if (g.length === 0)
|
|
4356
4372
|
return null;
|
|
4357
4373
|
const p = g.map(
|
|
4358
|
-
(
|
|
4374
|
+
(v, _) => ii(v, _, g.length)
|
|
4359
4375
|
);
|
|
4360
4376
|
return /* @__PURE__ */ h(
|
|
4361
4377
|
we,
|
|
@@ -4379,7 +4395,7 @@ const zr = ({
|
|
|
4379
4395
|
open: f,
|
|
4380
4396
|
items: yn(g, r),
|
|
4381
4397
|
initialIndex: c,
|
|
4382
|
-
onClose:
|
|
4398
|
+
onClose: w
|
|
4383
4399
|
}
|
|
4384
4400
|
)
|
|
4385
4401
|
]
|
|
@@ -4407,7 +4423,7 @@ const zr = ({
|
|
|
4407
4423
|
onClick: t,
|
|
4408
4424
|
disabled: s,
|
|
4409
4425
|
style: { backgroundColor: "#E6E5E3" },
|
|
4410
|
-
className:
|
|
4426
|
+
className: C(
|
|
4411
4427
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4412
4428
|
{
|
|
4413
4429
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4484,7 +4500,7 @@ export {
|
|
|
4484
4500
|
sr as o,
|
|
4485
4501
|
Rr as p,
|
|
4486
4502
|
Xt as q,
|
|
4487
|
-
|
|
4503
|
+
le as r,
|
|
4488
4504
|
nn as s,
|
|
4489
4505
|
$s as t,
|
|
4490
4506
|
Si as u,
|
|
@@ -4494,4 +4510,4 @@ export {
|
|
|
4494
4510
|
Wt as y,
|
|
4495
4511
|
va as z
|
|
4496
4512
|
};
|
|
4497
|
-
//# sourceMappingURL=index-
|
|
4513
|
+
//# sourceMappingURL=index-BS5mKzxR.js.map
|