@linktr.ee/messaging-react 3.1.4-rc-1780636753 → 3.3.0
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/README.md +1 -18
- package/dist/{Card-jyXjZZ0u.js → Card-BAc2cgtn.js} +3 -3
- package/dist/{Card-jyXjZZ0u.js.map → Card-BAc2cgtn.js.map} +1 -1
- package/dist/{Card-D_XOj1eE.cjs → Card-Cn1cBVnr.cjs} +2 -2
- package/dist/{Card-D_XOj1eE.cjs.map → Card-Cn1cBVnr.cjs.map} +1 -1
- package/dist/{Card-BkgsPkp4.cjs → Card-DAyszUxa.cjs} +2 -2
- package/dist/{Card-BkgsPkp4.cjs.map → Card-DAyszUxa.cjs.map} +1 -1
- package/dist/{Card-BwFdJXYm.js → Card-D_2VQScd.js} +2 -2
- package/dist/{Card-BwFdJXYm.js.map → Card-D_2VQScd.js.map} +1 -1
- package/dist/{Card-B9atg4sP.js → Card-D_G8133I.js} +2 -2
- package/dist/{Card-B9atg4sP.js.map → Card-D_G8133I.js.map} +1 -1
- package/dist/{Card-1U2tLPcp.cjs → Card-gYxPXe_W.cjs} +2 -2
- package/dist/{Card-1U2tLPcp.cjs.map → Card-gYxPXe_W.cjs.map} +1 -1
- package/dist/{LockedThumbnail-Dwt_goCX.js → LockedThumbnail-C7tWpOQr.js} +2 -2
- package/dist/{LockedThumbnail-Dwt_goCX.js.map → LockedThumbnail-C7tWpOQr.js.map} +1 -1
- package/dist/{LockedThumbnail-oxtdpgut.cjs → LockedThumbnail-DtOTZl3l.cjs} +2 -2
- package/dist/{LockedThumbnail-oxtdpgut.cjs.map → LockedThumbnail-DtOTZl3l.cjs.map} +1 -1
- package/dist/{index-CO975B6P.js → index-C_NFzAB9.js} +1228 -1289
- package/dist/index-C_NFzAB9.js.map +1 -0
- package/dist/index-_Se6ovQm.cjs +2 -0
- package/dist/index-_Se6ovQm.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +24 -49
- package/dist/index.js +1 -1
- package/package.json +4 -3
- package/src/components/ChannelActionsMenu/ChannelActionsMenu.test.tsx +305 -0
- package/src/components/ChannelActionsMenu/index.tsx +221 -0
- package/src/components/ChannelList/index.test.tsx +3 -151
- package/src/components/ChannelList/index.tsx +4 -72
- package/src/components/ChannelView.stories.tsx +3 -73
- package/src/components/ChannelView.test.tsx +33 -29
- package/src/components/ChannelView.tsx +71 -109
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/hooks/useChannelModerationActions.ts +227 -0
- package/src/index.ts +0 -1
- package/src/types.ts +25 -48
- package/dist/index-CO975B6P.js.map +0 -1
- package/dist/index-D4Dse1Lu.cjs +0 -2
- package/dist/index-D4Dse1Lu.cjs.map +0 -1
- package/src/components/ChannelInfoDialog/ChannelInfoDialog.test.tsx +0 -333
- package/src/components/ChannelInfoDialog/index.tsx +0 -336
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { Chat as
|
|
5
|
-
import { StarIcon as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import z, { createContext as Ge, useContext as Te, useCallback as W, useState as D, useRef as H, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
|
|
3
|
+
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { Chat as In, DateSeparator as Tn, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as An, useMessageReminder as Mn, useComponentContext as Ut, Attachment as Rn, EditMessageModal as Ln, MessageBlocked as Dn, MessageBouncePrompt as Pn, MessageDeleted as On, MessageIsThreadReplyInChannelButtonIndicator as zn, MessageRepliesCountButton as $n, ReminderNotification as Fn, StreamedMessageText as Bn, messageHasAttachments as Un, messageHasReactions as jn, isDateSeparatorMessage as Vn, isMessageBlocked as Gn, isMessageBounced as Hn, MessageBounceModal as Yn, MessageText as Tt, Poll as qn, MessageErrorIcon as Wn, useMessageContext as pe, useMessageComposer as Xn, useStateStore as Kn, MessageInput as Jn, useMessageInputContext as Zn, useMessageComposerHasSendableData as Qn, AttachmentPreviewList as es, QuotedMessagePreview as ts, TextareaComposer as ns, MessageTimestamp as Le, AIStates as De, useTypingContext as ss, useAIState as as, Channel as rs, WithComponents as is, Window as os, MessageList as ls, ChannelList as cs } from "stream-chat-react";
|
|
5
|
+
import { StarIcon as Fe, DotsThreeIcon as ds, SpinnerGapIcon as Ce, SignOutIcon as us, ProhibitInsetIcon as At, FlagIcon as jt, FileIcon as Vt, ImageIcon as ms, SpeakerHighIcon as hs, VideoCameraIcon as Gt, FileMdIcon as fs, FileTextIcon as gs, FileZipIcon as bs, FilePptIcon as ps, FileCsvIcon as vs, FileXlsIcon as xs, FileDocIcon as ws, FilePdfIcon as Ns, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as _s, LinkIcon as ys, DownloadSimpleIcon as be, GiftIcon as Cs, ThumbsUpIcon as ks, ThumbsDownIcon as Es, TrashSimpleIcon as Ss, XIcon as Ae, ArrowUpIcon as Is, SparkleIcon as Ue, ProhibitIcon as Ts, ArrowLeftIcon as Mt, PencilSimpleIcon as As, CaretLeftIcon as Ms, CaretRightIcon as Rs } from "@phosphor-icons/react";
|
|
6
6
|
import C from "classnames";
|
|
7
|
-
import { MessageActions as
|
|
8
|
-
import { LinkPreviewsManager as
|
|
9
|
-
const
|
|
7
|
+
import { MessageActions as Ls, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
|
|
8
|
+
import { LinkPreviewsManager as Rt } from "stream-chat";
|
|
9
|
+
const Yt = Ge({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Wt = He({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), qe = () => Te(Yt), wi = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,9 +24,9 @@ const Wt = He({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
const o =
|
|
28
|
-
(E, ...
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${E}`, ...
|
|
27
|
+
const o = W(
|
|
28
|
+
(E, ...A) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${E}`, ...A);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
@@ -36,27 +36,27 @@ const Wt = He({
|
|
|
36
36
|
serviceConfig: !!s,
|
|
37
37
|
capabilities: Object.keys(r)
|
|
38
38
|
});
|
|
39
|
-
const [l, d] =
|
|
39
|
+
const [l, d] = D(null), [m, b] = D(null), [u, f] = D(!1), [c, g] = D(!1), [v, p] = D(null), N = H(!1), x = H({
|
|
40
40
|
userId: t == null ? void 0 : t.id,
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}), T =
|
|
44
|
+
}), T = H(0);
|
|
45
45
|
T.current++, o("📊 RENDER INFO", {
|
|
46
46
|
renderCount: T.current,
|
|
47
47
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
48
48
|
propChanges: {
|
|
49
|
-
userChanged:
|
|
50
|
-
apiKeyChanged:
|
|
51
|
-
serviceConfigChanged:
|
|
52
|
-
capabilitiesChanged:
|
|
49
|
+
userChanged: x.current.userId !== (t == null ? void 0 : t.id),
|
|
50
|
+
apiKeyChanged: x.current.apiKey !== a,
|
|
51
|
+
serviceConfigChanged: x.current.serviceConfig !== s,
|
|
52
|
+
capabilitiesChanged: x.current.capabilities !== r
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), x.current = {
|
|
55
55
|
userId: t == null ? void 0 : t.id,
|
|
56
56
|
apiKey: a,
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
|
-
},
|
|
59
|
+
}, Y(() => {
|
|
60
60
|
const E = T.current;
|
|
61
61
|
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
62
|
renderCount: E,
|
|
@@ -65,8 +65,8 @@ const Wt = He({
|
|
|
65
65
|
dependencies: {
|
|
66
66
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
67
67
|
serviceConfigRef: s,
|
|
68
|
-
serviceConfigStable:
|
|
69
|
-
apiKeyStable:
|
|
68
|
+
serviceConfigStable: x.current.serviceConfig === s,
|
|
69
|
+
apiKeyStable: x.current.apiKey === a
|
|
70
70
|
}
|
|
71
71
|
}), !a || !s) {
|
|
72
72
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
@@ -78,42 +78,42 @@ const Wt = He({
|
|
|
78
78
|
o("🚀 CREATING NEW SERVICE", {
|
|
79
79
|
renderCount: E,
|
|
80
80
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
|
-
serviceConfigChanged:
|
|
81
|
+
serviceConfigChanged: x.current.serviceConfig !== s
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const A = new Sn({
|
|
84
84
|
...s,
|
|
85
85
|
apiKey: a,
|
|
86
86
|
debug: i
|
|
87
87
|
});
|
|
88
|
-
return d(
|
|
88
|
+
return d(A), o("✅ SERVICE SET", {
|
|
89
89
|
renderCount: E,
|
|
90
|
-
serviceInstance: !!
|
|
90
|
+
serviceInstance: !!A
|
|
91
91
|
}), () => {
|
|
92
92
|
o("🧹 SERVICE CLEANUP", {
|
|
93
93
|
renderCount: E,
|
|
94
94
|
reason: "Effect cleanup"
|
|
95
|
-
}),
|
|
95
|
+
}), A.disconnectUser().catch(console.error);
|
|
96
96
|
};
|
|
97
97
|
}, [a, s, i, o]);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
var
|
|
98
|
+
const S = H(null);
|
|
99
|
+
Y(() => {
|
|
100
|
+
var A, y;
|
|
101
101
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
102
|
hasService: !!l,
|
|
103
103
|
hasUser: !!t,
|
|
104
104
|
userId: t == null ? void 0 : t.id,
|
|
105
|
-
isConnecting:
|
|
105
|
+
isConnecting: N.current,
|
|
106
106
|
isConnected: u,
|
|
107
107
|
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
108
108
|
}), !l || !t) {
|
|
109
109
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
if (
|
|
112
|
+
if (N.current) {
|
|
113
113
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (((
|
|
116
|
+
if (((A = S.current) == null ? void 0 : A.serviceId) === l && ((y = S.current) == null ? void 0 : y.userId) === t.id) {
|
|
117
117
|
o(
|
|
118
118
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
119
|
"Already connected this user with this service"
|
|
@@ -121,40 +121,40 @@ const Wt = He({
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
(async () => {
|
|
124
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
124
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0), p(null);
|
|
125
125
|
try {
|
|
126
126
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const _ = await l.connectUser(t);
|
|
128
|
+
b(_), f(!0), S.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
130
|
+
clientId: _.userID
|
|
131
131
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const
|
|
134
|
-
|
|
132
|
+
} catch (_) {
|
|
133
|
+
const I = _ instanceof Error ? _.message : "Connection failed";
|
|
134
|
+
p(I), o("❌ USER CONNECTION ERROR", {
|
|
135
135
|
userId: t.id,
|
|
136
|
-
error:
|
|
136
|
+
error: I
|
|
137
137
|
});
|
|
138
138
|
} finally {
|
|
139
|
-
|
|
139
|
+
g(!1), N.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
140
140
|
userId: t.id,
|
|
141
141
|
isConnected: u
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
})();
|
|
145
|
-
}, [l, t, o, u]),
|
|
145
|
+
}, [l, t, o, u]), Y(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
|
|
146
146
|
hasService: !!l,
|
|
147
147
|
isConnected: u
|
|
148
148
|
}), () => {
|
|
149
149
|
l && u ? (o(
|
|
150
150
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
151
151
|
"Cleaning up connection on unmount"
|
|
152
|
-
),
|
|
152
|
+
), S.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
|
|
153
153
|
hasService: !!l,
|
|
154
154
|
isConnected: u
|
|
155
155
|
});
|
|
156
156
|
}), [l, u, o]);
|
|
157
|
-
const
|
|
157
|
+
const R = W(async () => {
|
|
158
158
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
159
159
|
hasService: !!l,
|
|
160
160
|
hasUser: !!t
|
|
@@ -162,53 +162,53 @@ const Wt = He({
|
|
|
162
162
|
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
|
-
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
165
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), g(!0);
|
|
166
166
|
try {
|
|
167
167
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
168
168
|
const E = await l.connectUser(t);
|
|
169
|
-
|
|
169
|
+
b(E), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
170
170
|
} catch (E) {
|
|
171
|
-
const
|
|
172
|
-
|
|
171
|
+
const A = E instanceof Error ? E.message : "Refresh failed";
|
|
172
|
+
p(A), o("❌ CONNECTION REFRESH ERROR", {
|
|
173
173
|
userId: t.id,
|
|
174
|
-
error:
|
|
174
|
+
error: A
|
|
175
175
|
});
|
|
176
176
|
} finally {
|
|
177
|
-
|
|
177
|
+
g(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
178
|
}
|
|
179
|
-
}, [l, t, o]),
|
|
179
|
+
}, [l, t, o]), O = z.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
180
180
|
hasService: !!l,
|
|
181
181
|
hasClient: !!m,
|
|
182
182
|
isConnected: u,
|
|
183
183
|
isLoading: c,
|
|
184
|
-
hasError: !!
|
|
184
|
+
hasError: !!v,
|
|
185
185
|
capabilitiesKeys: Object.keys(r)
|
|
186
186
|
}), {
|
|
187
187
|
service: l,
|
|
188
188
|
client: m,
|
|
189
189
|
isConnected: u,
|
|
190
190
|
isLoading: c,
|
|
191
|
-
error:
|
|
191
|
+
error: v,
|
|
192
192
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
193
|
+
refreshConnection: R,
|
|
194
194
|
debug: i
|
|
195
195
|
}), [
|
|
196
196
|
l,
|
|
197
197
|
m,
|
|
198
198
|
u,
|
|
199
199
|
c,
|
|
200
|
-
|
|
200
|
+
v,
|
|
201
201
|
r,
|
|
202
|
-
|
|
202
|
+
R,
|
|
203
203
|
i,
|
|
204
204
|
o
|
|
205
205
|
]);
|
|
206
206
|
return o("🔄 RENDER END", {
|
|
207
207
|
renderCount: T.current,
|
|
208
208
|
willRenderChat: !!(m && u),
|
|
209
|
-
contextValueReady: !!
|
|
210
|
-
}), /* @__PURE__ */ n(
|
|
211
|
-
|
|
209
|
+
contextValueReady: !!O
|
|
210
|
+
}), /* @__PURE__ */ n(Yt.Provider, { value: O, children: m && u ? /* @__PURE__ */ n(
|
|
211
|
+
In,
|
|
212
212
|
{
|
|
213
213
|
client: m,
|
|
214
214
|
customClasses: {
|
|
@@ -217,12 +217,12 @@ const Wt = He({
|
|
|
217
217
|
children: e
|
|
218
218
|
}
|
|
219
219
|
) : e });
|
|
220
|
-
},
|
|
220
|
+
}, Ds = () => qe(), qt = (e) => {
|
|
221
221
|
var a, r;
|
|
222
|
-
const [t, s] =
|
|
222
|
+
const [t, s] = D(
|
|
223
223
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
224
224
|
);
|
|
225
|
-
return
|
|
225
|
+
return Y(() => {
|
|
226
226
|
var o;
|
|
227
227
|
if (!e) {
|
|
228
228
|
s(!1);
|
|
@@ -239,18 +239,18 @@ const Wt = He({
|
|
|
239
239
|
e.off("member.updated", i);
|
|
240
240
|
};
|
|
241
241
|
}, [e]), t;
|
|
242
|
-
},
|
|
243
|
-
function
|
|
244
|
-
return
|
|
242
|
+
}, Ps = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
243
|
+
function Os(e) {
|
|
244
|
+
return Ps.test(e.trim());
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Lt(e, t) {
|
|
247
247
|
const s = e == null ? void 0 : e.trim();
|
|
248
|
-
return !s || t && s === t ? !1 : !
|
|
248
|
+
return !s || t && s === t ? !1 : !Os(s);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
250
|
+
function Wt(e) {
|
|
251
|
+
return Lt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Lt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
252
252
|
}
|
|
253
|
-
const
|
|
253
|
+
const Dt = [
|
|
254
254
|
"🍎",
|
|
255
255
|
// Apple
|
|
256
256
|
"🍌",
|
|
@@ -278,7 +278,7 @@ const zt = [
|
|
|
278
278
|
"🍈"
|
|
279
279
|
// Melon
|
|
280
280
|
];
|
|
281
|
-
function
|
|
281
|
+
function zs(e) {
|
|
282
282
|
let t = 0;
|
|
283
283
|
for (let s = 0; s < e.length; s++) {
|
|
284
284
|
const a = e.charCodeAt(s);
|
|
@@ -286,9 +286,9 @@ function Os(e) {
|
|
|
286
286
|
}
|
|
287
287
|
return Math.abs(t);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const s =
|
|
291
|
-
return
|
|
289
|
+
function $s(e) {
|
|
290
|
+
const s = zs(e) % Dt.length;
|
|
291
|
+
return Dt[s];
|
|
292
292
|
}
|
|
293
293
|
const ae = ({
|
|
294
294
|
id: e,
|
|
@@ -299,7 +299,7 @@ const ae = ({
|
|
|
299
299
|
shape: i = "squircle",
|
|
300
300
|
dmAgentEnabled: o = !1
|
|
301
301
|
}) => {
|
|
302
|
-
const l =
|
|
302
|
+
const l = $s(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", b = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
303
303
|
"img",
|
|
304
304
|
{
|
|
305
305
|
src: t,
|
|
@@ -335,7 +335,7 @@ const ae = ({
|
|
|
335
335
|
{
|
|
336
336
|
"aria-hidden": "true",
|
|
337
337
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
338
|
-
children: /* @__PURE__ */ n(
|
|
338
|
+
children: /* @__PURE__ */ n(Fe, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
341
|
/* @__PURE__ */ n(
|
|
@@ -349,7 +349,7 @@ const ae = ({
|
|
|
349
349
|
style: {
|
|
350
350
|
...u,
|
|
351
351
|
...o && {
|
|
352
|
-
borderWidth: `${
|
|
352
|
+
borderWidth: `${b}px`,
|
|
353
353
|
borderStyle: "solid",
|
|
354
354
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
355
355
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
@@ -361,7 +361,96 @@ const ae = ({
|
|
|
361
361
|
]
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
|
-
},
|
|
364
|
+
}, Fs = "https://linktr.ee/s/about/trust-center/report", Bs = ({
|
|
365
|
+
channel: e,
|
|
366
|
+
participant: t,
|
|
367
|
+
showBlockParticipant: s = !0,
|
|
368
|
+
enabled: a = !0,
|
|
369
|
+
onLeaveConversation: r,
|
|
370
|
+
onBlockParticipant: i,
|
|
371
|
+
onDeleteConversationClick: o,
|
|
372
|
+
onBlockParticipantClick: l,
|
|
373
|
+
onReportParticipantClick: d,
|
|
374
|
+
onActionComplete: m,
|
|
375
|
+
logLabel: b = "useChannelModerationActions"
|
|
376
|
+
}) => {
|
|
377
|
+
var y;
|
|
378
|
+
const { service: u, debug: f } = qe(), [c, g] = D(!1), [v, p] = D(!1), [N, x] = D(!1), [T, S] = D(!1);
|
|
379
|
+
return Y(() => {
|
|
380
|
+
var L;
|
|
381
|
+
if (!a || !s || !u || !((L = t == null ? void 0 : t.user) != null && L.id)) {
|
|
382
|
+
g(!1), p(!1);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
let _ = !1;
|
|
386
|
+
const I = t.user.id;
|
|
387
|
+
return p(!0), (async () => {
|
|
388
|
+
try {
|
|
389
|
+
const M = await u.getBlockedUsers();
|
|
390
|
+
if (_) return;
|
|
391
|
+
g(
|
|
392
|
+
M.some(
|
|
393
|
+
(j) => j.blocked_user_id === I
|
|
394
|
+
)
|
|
395
|
+
);
|
|
396
|
+
} catch (M) {
|
|
397
|
+
_ || console.error(`[${b}] Failed to check blocked status:`, M);
|
|
398
|
+
} finally {
|
|
399
|
+
_ || p(!1);
|
|
400
|
+
}
|
|
401
|
+
})(), () => {
|
|
402
|
+
_ = !0;
|
|
403
|
+
};
|
|
404
|
+
}, [a, u, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id, s, b]), {
|
|
405
|
+
isParticipantBlocked: c,
|
|
406
|
+
isCheckingBlockedStatus: v,
|
|
407
|
+
isLeaving: N,
|
|
408
|
+
isUpdatingBlockStatus: T,
|
|
409
|
+
handleLeaveConversation: async () => {
|
|
410
|
+
var _;
|
|
411
|
+
if (!N) {
|
|
412
|
+
o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), x(!0);
|
|
413
|
+
try {
|
|
414
|
+
const I = ((_ = e._client) == null ? void 0 : _.userID) ?? null;
|
|
415
|
+
await e.hide(I, !1), r && await r(e), m == null || m();
|
|
416
|
+
} catch (I) {
|
|
417
|
+
console.error(`[${b}] Failed to leave conversation`, I);
|
|
418
|
+
} finally {
|
|
419
|
+
x(!1);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
handleBlockUser: async () => {
|
|
424
|
+
var _, I, L;
|
|
425
|
+
if (!(T || !u)) {
|
|
426
|
+
l == null || l(), f && console.log(`[${b}] Block member`, (_ = t == null ? void 0 : t.user) == null ? void 0 : _.id), S(!0);
|
|
427
|
+
try {
|
|
428
|
+
await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), m == null || m();
|
|
429
|
+
} catch (M) {
|
|
430
|
+
console.error(`[${b}] Failed to block member`, M);
|
|
431
|
+
} finally {
|
|
432
|
+
S(!1);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
handleUnblockUser: async () => {
|
|
437
|
+
var _, I, L;
|
|
438
|
+
if (!(T || !u)) {
|
|
439
|
+
l == null || l(), f && console.log(`[${b}] Unblock member`, (_ = t == null ? void 0 : t.user) == null ? void 0 : _.id), S(!0);
|
|
440
|
+
try {
|
|
441
|
+
await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), m == null || m();
|
|
442
|
+
} catch (M) {
|
|
443
|
+
console.error(`[${b}] Failed to unblock member`, M);
|
|
444
|
+
} finally {
|
|
445
|
+
S(!1);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
handleReportUser: () => {
|
|
450
|
+
d == null || d(), m == null || m(), window.open(Fs, "_blank", "noopener,noreferrer");
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}, he = ({
|
|
365
454
|
variant: e = "default",
|
|
366
455
|
className: t,
|
|
367
456
|
children: s,
|
|
@@ -378,245 +467,153 @@ const ae = ({
|
|
|
378
467
|
...a,
|
|
379
468
|
children: s
|
|
380
469
|
}
|
|
381
|
-
)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
),
|
|
395
|
-
...a,
|
|
396
|
-
children: [
|
|
397
|
-
/* @__PURE__ */ n("span", { className: "sr-only", children: e }),
|
|
398
|
-
s
|
|
399
|
-
]
|
|
400
|
-
}
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
function $s({ onClick: e }) {
|
|
404
|
-
return /* @__PURE__ */ n(Fs, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
405
|
-
}
|
|
406
|
-
const Bs = ({
|
|
407
|
-
dialogRef: e,
|
|
408
|
-
onClose: t,
|
|
409
|
-
participant: s,
|
|
410
|
-
participantDisplayName: a,
|
|
411
|
-
channel: r,
|
|
412
|
-
followerStatusLabel: i,
|
|
413
|
-
onLeaveConversation: o,
|
|
414
|
-
onBlockParticipant: l,
|
|
415
|
-
showDeleteConversation: d = !0,
|
|
416
|
-
showBlockParticipant: m = !0,
|
|
417
|
-
showReportParticipant: g = !0,
|
|
418
|
-
onDeleteConversationClick: u,
|
|
419
|
-
onBlockParticipantClick: f,
|
|
420
|
-
onReportParticipantClick: c,
|
|
421
|
-
customProfileContent: p,
|
|
422
|
-
customChannelActions: N
|
|
470
|
+
), Pt = ({
|
|
471
|
+
channel: e,
|
|
472
|
+
participant: t,
|
|
473
|
+
showDeleteConversation: s = !0,
|
|
474
|
+
showBlockParticipant: a = !0,
|
|
475
|
+
showReportParticipant: r = !0,
|
|
476
|
+
onLeaveConversation: i,
|
|
477
|
+
onBlockParticipant: o,
|
|
478
|
+
onDeleteConversationClick: l,
|
|
479
|
+
onBlockParticipantClick: d,
|
|
480
|
+
onReportParticipantClick: m,
|
|
481
|
+
customChannelActions: b,
|
|
482
|
+
triggerClassName: u
|
|
423
483
|
}) => {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
}, L = async () => {
|
|
472
|
-
var b, y, P;
|
|
473
|
-
if (!(M || !v)) {
|
|
474
|
-
f == null || f(), x && console.log("[ChannelInfoDialog] Unblock member", (b = s == null ? void 0 : s.user) == null ? void 0 : b.id), E(!0);
|
|
475
|
-
try {
|
|
476
|
-
await v.unBlockUser((y = s == null ? void 0 : s.user) == null ? void 0 : y.id), l && await l((P = s == null ? void 0 : s.user) == null ? void 0 : P.id), t();
|
|
477
|
-
} catch (D) {
|
|
478
|
-
console.error("[ChannelInfoDialog] Failed to unblock member", D);
|
|
479
|
-
} finally {
|
|
480
|
-
E(!1);
|
|
484
|
+
const [f, c] = D(!1), g = H(null), v = En(), p = W(() => c(!1), []), {
|
|
485
|
+
isParticipantBlocked: N,
|
|
486
|
+
isCheckingBlockedStatus: x,
|
|
487
|
+
isLeaving: T,
|
|
488
|
+
isUpdatingBlockStatus: S,
|
|
489
|
+
handleLeaveConversation: R,
|
|
490
|
+
handleBlockUser: O,
|
|
491
|
+
handleUnblockUser: E,
|
|
492
|
+
handleReportUser: A
|
|
493
|
+
} = Bs({
|
|
494
|
+
channel: e,
|
|
495
|
+
participant: t,
|
|
496
|
+
showBlockParticipant: a,
|
|
497
|
+
enabled: f,
|
|
498
|
+
onLeaveConversation: i,
|
|
499
|
+
onBlockParticipant: o,
|
|
500
|
+
onDeleteConversationClick: l,
|
|
501
|
+
onBlockParticipantClick: d,
|
|
502
|
+
onReportParticipantClick: m,
|
|
503
|
+
onActionComplete: p,
|
|
504
|
+
logLabel: "ChannelActionsMenu"
|
|
505
|
+
});
|
|
506
|
+
return Y(() => {
|
|
507
|
+
if (!f) return;
|
|
508
|
+
const _ = (L) => {
|
|
509
|
+
g.current && !g.current.contains(L.target) && c(!1);
|
|
510
|
+
}, I = (L) => {
|
|
511
|
+
L.key === "Escape" && c(!1);
|
|
512
|
+
};
|
|
513
|
+
return document.addEventListener("mousedown", _), document.addEventListener("keydown", I), () => {
|
|
514
|
+
document.removeEventListener("mousedown", _), document.removeEventListener("keydown", I);
|
|
515
|
+
};
|
|
516
|
+
}, [f]), !t || !(s || a || r || !!b) ? null : /* @__PURE__ */ h("div", { ref: g, className: "relative", children: [
|
|
517
|
+
/* @__PURE__ */ h(
|
|
518
|
+
"button",
|
|
519
|
+
{
|
|
520
|
+
className: u,
|
|
521
|
+
type: "button",
|
|
522
|
+
"aria-haspopup": "true",
|
|
523
|
+
"aria-expanded": f,
|
|
524
|
+
"aria-controls": f ? v : void 0,
|
|
525
|
+
onClick: () => c((_) => !_),
|
|
526
|
+
children: [
|
|
527
|
+
/* @__PURE__ */ n(ds, { className: "size-5 text-black/90" }),
|
|
528
|
+
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
529
|
+
]
|
|
481
530
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
"https://linktr.ee/s/about/trust-center/report",
|
|
486
|
-
"_blank",
|
|
487
|
-
"noopener,noreferrer"
|
|
488
|
-
);
|
|
489
|
-
};
|
|
490
|
-
if (!s) return null;
|
|
491
|
-
const F = a ?? Ae(s.user), Z = (H = s.user) == null ? void 0 : H.image, U = (Y = s.user) == null ? void 0 : Y.username, G = U ? `linktr.ee/${U}` : void 0, O = (($ = s.user) == null ? void 0 : $.id) || "unknown";
|
|
492
|
-
return (
|
|
493
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
494
|
-
/* @__PURE__ */ n(
|
|
495
|
-
"dialog",
|
|
531
|
+
),
|
|
532
|
+
f && /* @__PURE__ */ n(
|
|
533
|
+
"div",
|
|
496
534
|
{
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
children: /* @__PURE__ */ h("
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
size: 88,
|
|
523
|
-
shape: "circle"
|
|
524
|
-
}
|
|
525
|
-
),
|
|
526
|
-
/* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
527
|
-
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: F }),
|
|
528
|
-
G && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: G }),
|
|
529
|
-
i && !p && /* @__PURE__ */ n(
|
|
530
|
-
"span",
|
|
531
|
-
{
|
|
532
|
-
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
533
|
-
style: {
|
|
534
|
-
padding: "4px 8px",
|
|
535
|
-
backgroundColor: i === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
536
|
-
color: i === "Subscribed to you" ? "#008236" : "#78716C",
|
|
537
|
-
lineHeight: "133.333%",
|
|
538
|
-
letterSpacing: "0.21px"
|
|
539
|
-
},
|
|
540
|
-
children: i
|
|
541
|
-
}
|
|
542
|
-
)
|
|
543
|
-
] })
|
|
544
|
-
] }),
|
|
545
|
-
p && /* @__PURE__ */ n("div", { className: "w-full", children: p })
|
|
546
|
-
]
|
|
547
|
-
}
|
|
548
|
-
),
|
|
549
|
-
/* @__PURE__ */ h("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
550
|
-
d && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
551
|
-
ye,
|
|
552
|
-
{
|
|
553
|
-
onClick: k,
|
|
554
|
-
disabled: A,
|
|
555
|
-
"aria-busy": A,
|
|
556
|
-
children: [
|
|
557
|
-
A ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(ds, { className: "h-5 w-5" }),
|
|
558
|
-
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
) }),
|
|
562
|
-
m && /* @__PURE__ */ n("li", { children: w ? /* @__PURE__ */ h(
|
|
563
|
-
ye,
|
|
564
|
-
{
|
|
565
|
-
onClick: L,
|
|
566
|
-
disabled: M,
|
|
567
|
-
"aria-busy": M,
|
|
568
|
-
children: [
|
|
569
|
-
M ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
|
|
570
|
-
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
571
|
-
]
|
|
572
|
-
}
|
|
573
|
-
) : /* @__PURE__ */ h(
|
|
574
|
-
ye,
|
|
575
|
-
{
|
|
576
|
-
onClick: I,
|
|
577
|
-
disabled: M,
|
|
578
|
-
"aria-busy": M,
|
|
579
|
-
children: [
|
|
580
|
-
M ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
|
|
581
|
-
/* @__PURE__ */ n("span", { children: "Block" })
|
|
582
|
-
]
|
|
583
|
-
}
|
|
584
|
-
) }),
|
|
585
|
-
g && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ye, { variant: "danger", onClick: V, children: [
|
|
586
|
-
/* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
587
|
-
/* @__PURE__ */ n("span", { children: "Report" })
|
|
588
|
-
] }) }),
|
|
589
|
-
N
|
|
535
|
+
id: v,
|
|
536
|
+
"aria-label": "Conversation options",
|
|
537
|
+
className: C(
|
|
538
|
+
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
539
|
+
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
540
|
+
),
|
|
541
|
+
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
542
|
+
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
543
|
+
he,
|
|
544
|
+
{
|
|
545
|
+
onClick: R,
|
|
546
|
+
disabled: T,
|
|
547
|
+
"aria-busy": T,
|
|
548
|
+
children: [
|
|
549
|
+
T ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(us, { className: "h-5 w-5" }),
|
|
550
|
+
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
) }),
|
|
554
|
+
a && /* @__PURE__ */ n("li", { children: x ? (
|
|
555
|
+
// Block status not yet resolved — show a disabled placeholder
|
|
556
|
+
// so a premature click can't act on a stale block state.
|
|
557
|
+
/* @__PURE__ */ h(he, { disabled: !0, "aria-busy": !0, children: [
|
|
558
|
+
/* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }),
|
|
559
|
+
/* @__PURE__ */ n("span", { children: "Block" })
|
|
590
560
|
] })
|
|
591
|
-
|
|
561
|
+
) : N ? /* @__PURE__ */ h(
|
|
562
|
+
he,
|
|
563
|
+
{
|
|
564
|
+
onClick: E,
|
|
565
|
+
disabled: S,
|
|
566
|
+
"aria-busy": S,
|
|
567
|
+
children: [
|
|
568
|
+
S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
|
|
569
|
+
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
) : /* @__PURE__ */ h(
|
|
573
|
+
he,
|
|
574
|
+
{
|
|
575
|
+
onClick: O,
|
|
576
|
+
disabled: S,
|
|
577
|
+
"aria-busy": S,
|
|
578
|
+
children: [
|
|
579
|
+
S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
|
|
580
|
+
/* @__PURE__ */ n("span", { children: "Block" })
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
) }),
|
|
584
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: A, children: [
|
|
585
|
+
/* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
|
|
586
|
+
/* @__PURE__ */ n("span", { children: "Report" })
|
|
587
|
+
] }) }),
|
|
588
|
+
b
|
|
592
589
|
] })
|
|
593
590
|
}
|
|
594
591
|
)
|
|
595
|
-
);
|
|
596
|
-
},
|
|
597
|
-
function
|
|
598
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
592
|
+
] });
|
|
593
|
+
}, Us = (e) => /* @__PURE__ */ n(Tn, { ...e, position: "center" }), je = "vote_up", Ve = "vote_down";
|
|
594
|
+
function js(e) {
|
|
595
|
+
return e != null && e.length ? e.some((t) => t.type === Ve) ? "down" : e.some((t) => t.type === je) ? "up" : null : null;
|
|
599
596
|
}
|
|
600
|
-
function
|
|
601
|
-
const { channel: t } = ce(), { client: s } =
|
|
602
|
-
() =>
|
|
597
|
+
function Vs(e) {
|
|
598
|
+
const { channel: t } = ce(), { client: s } = Ye("useMessageVote"), a = ee(
|
|
599
|
+
() => js(e.own_reactions),
|
|
603
600
|
[e.own_reactions]
|
|
604
|
-
), r =
|
|
601
|
+
), r = W(async () => {
|
|
605
602
|
if (s != null && s.userID)
|
|
606
603
|
try {
|
|
607
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
604
|
+
a === "up" ? await t.deleteReaction(e.id, je) : await t.sendReaction(
|
|
608
605
|
e.id,
|
|
609
|
-
{ type:
|
|
606
|
+
{ type: je },
|
|
610
607
|
{ enforce_unique: !0, skip_push: !0 }
|
|
611
608
|
);
|
|
612
609
|
} catch {
|
|
613
610
|
}
|
|
614
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
611
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = W(async () => {
|
|
615
612
|
if (s != null && s.userID)
|
|
616
613
|
try {
|
|
617
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
614
|
+
a === "down" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
|
|
618
615
|
e.id,
|
|
619
|
-
{ type:
|
|
616
|
+
{ type: Ve },
|
|
620
617
|
{ enforce_unique: !0, skip_push: !0 }
|
|
621
618
|
);
|
|
622
619
|
} catch {
|
|
@@ -627,7 +624,7 @@ function Us(e) {
|
|
|
627
624
|
function Gs(e) {
|
|
628
625
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
629
626
|
}
|
|
630
|
-
function
|
|
627
|
+
function Xt({
|
|
631
628
|
message: e,
|
|
632
629
|
viewerLanguage: t
|
|
633
630
|
}) {
|
|
@@ -635,13 +632,13 @@ function Kt({
|
|
|
635
632
|
const s = e == null ? void 0 : e.text, a = Gs(t);
|
|
636
633
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
637
634
|
}
|
|
638
|
-
const Hs =
|
|
635
|
+
const Hs = z.lazy(() => import("./Card-D_2VQScd.js")), Ys = z.lazy(() => import("./Card-D_G8133I.js")), qs = z.lazy(() => import("./Card-BAc2cgtn.js")), We = () => /* @__PURE__ */ n(
|
|
639
636
|
"div",
|
|
640
637
|
{
|
|
641
638
|
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)]",
|
|
642
639
|
"aria-hidden": !0
|
|
643
640
|
}
|
|
644
|
-
), Ws = (e) => /* @__PURE__ */ n(
|
|
641
|
+
), Ws = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Hs, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Ys, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Xs = Kt, Ks = Jt, Ot = { Composer: Ws, Sent: Kt, Received: Jt, Creator: Xs, Visitor: Ks }, Js = [
|
|
645
642
|
[/pdf/, "pdf"],
|
|
646
643
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
647
644
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -651,37 +648,37 @@ const Hs = R.lazy(() => import("./Card-BwFdJXYm.js")), Ys = R.lazy(() => import(
|
|
|
651
648
|
[/plain|rtf/, "text"],
|
|
652
649
|
[/markdown/, "markdown"]
|
|
653
650
|
];
|
|
654
|
-
function
|
|
651
|
+
function ne(e) {
|
|
655
652
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
656
653
|
}
|
|
657
|
-
function
|
|
654
|
+
function Zt(e) {
|
|
658
655
|
const t = Js.find(
|
|
659
656
|
([s]) => s.test(e)
|
|
660
657
|
);
|
|
661
658
|
return t ? t[1] : "generic";
|
|
662
659
|
}
|
|
663
660
|
const Zs = {
|
|
664
|
-
video:
|
|
665
|
-
audio:
|
|
666
|
-
image:
|
|
667
|
-
document:
|
|
661
|
+
video: Gt,
|
|
662
|
+
audio: hs,
|
|
663
|
+
image: ms,
|
|
664
|
+
document: Vt
|
|
668
665
|
}, Qs = {
|
|
669
|
-
pdf:
|
|
670
|
-
doc:
|
|
671
|
-
xls:
|
|
672
|
-
csv:
|
|
673
|
-
ppt:
|
|
674
|
-
zip:
|
|
675
|
-
text:
|
|
676
|
-
markdown:
|
|
677
|
-
generic:
|
|
666
|
+
pdf: Ns,
|
|
667
|
+
doc: ws,
|
|
668
|
+
xls: xs,
|
|
669
|
+
csv: vs,
|
|
670
|
+
ppt: ps,
|
|
671
|
+
zip: bs,
|
|
672
|
+
text: gs,
|
|
673
|
+
markdown: fs,
|
|
674
|
+
generic: Vt
|
|
678
675
|
};
|
|
679
676
|
function ea(e) {
|
|
680
|
-
const t =
|
|
681
|
-
return t !== "document" ? Zs[t] : Qs[
|
|
677
|
+
const t = ne(e);
|
|
678
|
+
return t !== "document" ? Zs[t] : Qs[Zt(e)];
|
|
682
679
|
}
|
|
683
680
|
function le(e, t) {
|
|
684
|
-
return
|
|
681
|
+
return z.createElement(ea(e), t);
|
|
685
682
|
}
|
|
686
683
|
const ta = (e) => {
|
|
687
684
|
var t, s;
|
|
@@ -698,78 +695,78 @@ const ta = (e) => {
|
|
|
698
695
|
muted: d = !1,
|
|
699
696
|
onContainerClick: m
|
|
700
697
|
}) => {
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
}, []), G =
|
|
704
|
-
const
|
|
705
|
-
if (!
|
|
706
|
-
const
|
|
698
|
+
const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [v, p] = D(a), [N, x] = D(0), [T, S] = D(!1), [R, O] = D(!1), [E, A] = D(!1), [y, _] = D(!1), [I, L] = D(!0), [M, j] = D(null), V = W(() => {
|
|
699
|
+
A(!1), p(!0);
|
|
700
|
+
}, []), G = W((w) => {
|
|
701
|
+
const k = f.current;
|
|
702
|
+
if (!k) return 0;
|
|
703
|
+
const B = k.getBoundingClientRect();
|
|
707
704
|
return Math.max(
|
|
708
705
|
0,
|
|
709
|
-
Math.min(1, (ta(
|
|
706
|
+
Math.min(1, (ta(w) - B.left) / B.width)
|
|
710
707
|
);
|
|
711
|
-
}, []),
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
}, []),
|
|
715
|
-
|
|
716
|
-
const
|
|
717
|
-
|
|
708
|
+
}, []), $ = W((w) => {
|
|
709
|
+
const k = u.current;
|
|
710
|
+
k && k.duration && (k.currentTime = w * k.duration);
|
|
711
|
+
}, []), F = (w) => {
|
|
712
|
+
w.stopPropagation(), S(!0);
|
|
713
|
+
const k = G(w);
|
|
714
|
+
x(k), $(k);
|
|
718
715
|
};
|
|
719
|
-
|
|
720
|
-
r !== void 0 && r !==
|
|
721
|
-
}, [r]),
|
|
722
|
-
if (!
|
|
716
|
+
Y(() => {
|
|
717
|
+
r !== void 0 && r !== g.current && (g.current = r, p(r));
|
|
718
|
+
}, [r]), Y(() => {
|
|
719
|
+
if (!v) {
|
|
723
720
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
724
721
|
return;
|
|
725
722
|
}
|
|
726
|
-
const
|
|
727
|
-
const
|
|
728
|
-
|
|
723
|
+
const w = () => {
|
|
724
|
+
const k = u.current;
|
|
725
|
+
k && k.duration && !T && x(k.currentTime / k.duration), c.current = requestAnimationFrame(w);
|
|
729
726
|
};
|
|
730
|
-
return c.current = requestAnimationFrame(
|
|
727
|
+
return c.current = requestAnimationFrame(w), () => {
|
|
731
728
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
732
729
|
};
|
|
733
|
-
}, [
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}) :
|
|
738
|
-
}, [
|
|
730
|
+
}, [v, T]), Y(() => {
|
|
731
|
+
const w = u.current;
|
|
732
|
+
w && (v ? w.play().catch((k) => {
|
|
733
|
+
p(!1), A(!0);
|
|
734
|
+
}) : w.pause());
|
|
735
|
+
}, [v]), Y(() => {
|
|
739
736
|
if (!T) return;
|
|
740
|
-
const
|
|
741
|
-
|
|
737
|
+
const w = (B) => x(G(B)), k = (B) => {
|
|
738
|
+
S(!1), $(G(B));
|
|
742
739
|
};
|
|
743
|
-
return window.addEventListener("mousemove",
|
|
744
|
-
window.removeEventListener("mousemove",
|
|
740
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", k), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", k), () => {
|
|
741
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", k);
|
|
745
742
|
};
|
|
746
|
-
}, [T, G,
|
|
747
|
-
const
|
|
743
|
+
}, [T, G, $]);
|
|
744
|
+
const X = M ? { aspectRatio: String(M) } : void 0, U = M ? "" : " aspect-video", P = Math.round(N * 100);
|
|
748
745
|
return /* @__PURE__ */ h(
|
|
749
746
|
"div",
|
|
750
747
|
{
|
|
751
748
|
role: "button",
|
|
752
749
|
tabIndex: 0,
|
|
753
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
754
|
-
style:
|
|
755
|
-
onClick: (
|
|
750
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${U}`,
|
|
751
|
+
style: X,
|
|
752
|
+
onClick: (w) => {
|
|
756
753
|
if (m) {
|
|
757
|
-
m(
|
|
754
|
+
m(w);
|
|
758
755
|
return;
|
|
759
756
|
}
|
|
760
|
-
E || o &&
|
|
757
|
+
E || o && p((k) => !k);
|
|
761
758
|
},
|
|
762
|
-
onKeyDown: (
|
|
763
|
-
if (!(
|
|
764
|
-
if (
|
|
765
|
-
m(
|
|
759
|
+
onKeyDown: (w) => {
|
|
760
|
+
if (!(w.key !== "Enter" && w.key !== " ")) {
|
|
761
|
+
if (w.preventDefault(), m) {
|
|
762
|
+
m(w);
|
|
766
763
|
return;
|
|
767
764
|
}
|
|
768
|
-
E || o &&
|
|
765
|
+
E || o && p((k) => !k);
|
|
769
766
|
}
|
|
770
767
|
},
|
|
771
768
|
children: [
|
|
772
|
-
s && (
|
|
769
|
+
s && (b === "audio" || I) && /* @__PURE__ */ n(
|
|
773
770
|
"img",
|
|
774
771
|
{
|
|
775
772
|
src: s,
|
|
@@ -777,11 +774,11 @@ const ta = (e) => {
|
|
|
777
774
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
778
775
|
}
|
|
779
776
|
),
|
|
780
|
-
!s && (
|
|
777
|
+
!s && (b === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
|
|
781
778
|
className: "size-12 text-black/20",
|
|
782
779
|
weight: "regular"
|
|
783
780
|
}) }),
|
|
784
|
-
/* @__PURE__ */ n("div", { className: "absolute inset-0", children:
|
|
781
|
+
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: b === "audio" ? /* @__PURE__ */ n(
|
|
785
782
|
"audio",
|
|
786
783
|
{
|
|
787
784
|
ref: u,
|
|
@@ -789,14 +786,14 @@ const ta = (e) => {
|
|
|
789
786
|
loop: i,
|
|
790
787
|
muted: d,
|
|
791
788
|
style: { width: "100%", height: "100%" },
|
|
792
|
-
onLoadStart: () =>
|
|
789
|
+
onLoadStart: () => _(!0),
|
|
793
790
|
onCanPlay: () => {
|
|
794
|
-
|
|
791
|
+
_(!1), L(!1);
|
|
795
792
|
},
|
|
796
|
-
onWaiting: () =>
|
|
797
|
-
onPlay: () =>
|
|
793
|
+
onWaiting: () => _(!0),
|
|
794
|
+
onPlay: () => A(!1),
|
|
798
795
|
onEnded: () => {
|
|
799
|
-
i || (
|
|
796
|
+
i || (p(!1), x(0));
|
|
800
797
|
},
|
|
801
798
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
802
799
|
}
|
|
@@ -809,24 +806,24 @@ const ta = (e) => {
|
|
|
809
806
|
muted: d,
|
|
810
807
|
playsInline: !0,
|
|
811
808
|
style: { width: "100%", height: "100%" },
|
|
812
|
-
onLoadStart: () =>
|
|
809
|
+
onLoadStart: () => _(!0),
|
|
813
810
|
onCanPlay: () => {
|
|
814
|
-
|
|
811
|
+
_(!1), L(!1);
|
|
815
812
|
},
|
|
816
|
-
onWaiting: () =>
|
|
817
|
-
onPlay: () =>
|
|
813
|
+
onWaiting: () => _(!0),
|
|
814
|
+
onPlay: () => A(!1),
|
|
818
815
|
onLoadedMetadata: () => {
|
|
819
|
-
const
|
|
820
|
-
|
|
816
|
+
const w = u.current;
|
|
817
|
+
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && j(w.videoWidth / w.videoHeight);
|
|
821
818
|
},
|
|
822
819
|
onEnded: () => {
|
|
823
|
-
i || (
|
|
820
|
+
i || (p(!1), x(0));
|
|
824
821
|
},
|
|
825
822
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
826
823
|
}
|
|
827
824
|
) }),
|
|
828
|
-
|
|
829
|
-
|
|
825
|
+
y && !E && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
826
|
+
ge,
|
|
830
827
|
{
|
|
831
828
|
className: "size-8 animate-spin text-white/80",
|
|
832
829
|
weight: "bold"
|
|
@@ -839,13 +836,13 @@ const ta = (e) => {
|
|
|
839
836
|
role: "button",
|
|
840
837
|
tabIndex: 0,
|
|
841
838
|
"aria-label": "Play preview",
|
|
842
|
-
onClick: (
|
|
843
|
-
|
|
839
|
+
onClick: (w) => {
|
|
840
|
+
w.stopPropagation(), V();
|
|
844
841
|
},
|
|
845
|
-
onKeyDown: (
|
|
846
|
-
|
|
842
|
+
onKeyDown: (w) => {
|
|
843
|
+
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), V());
|
|
847
844
|
},
|
|
848
|
-
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(
|
|
845
|
+
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
849
846
|
}
|
|
850
847
|
),
|
|
851
848
|
l && !o && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
@@ -853,23 +850,23 @@ const ta = (e) => {
|
|
|
853
850
|
{
|
|
854
851
|
role: "slider",
|
|
855
852
|
"aria-label": "Playback position",
|
|
856
|
-
"aria-valuenow":
|
|
853
|
+
"aria-valuenow": P,
|
|
857
854
|
"aria-valuemin": 0,
|
|
858
855
|
"aria-valuemax": 100,
|
|
859
856
|
tabIndex: 0,
|
|
860
857
|
ref: f,
|
|
861
858
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
862
|
-
onMouseDown:
|
|
863
|
-
onTouchStart:
|
|
864
|
-
onClick: (
|
|
865
|
-
onKeyDown: (
|
|
866
|
-
|
|
859
|
+
onMouseDown: F,
|
|
860
|
+
onTouchStart: F,
|
|
861
|
+
onClick: (w) => w.stopPropagation(),
|
|
862
|
+
onKeyDown: (w) => {
|
|
863
|
+
w.key === "ArrowRight" && $(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, N - 0.05));
|
|
867
864
|
},
|
|
868
865
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
869
866
|
"div",
|
|
870
867
|
{
|
|
871
868
|
className: "h-full rounded-full bg-white",
|
|
872
|
-
style: { width: `${
|
|
869
|
+
style: { width: `${P}%` }
|
|
873
870
|
}
|
|
874
871
|
) })
|
|
875
872
|
}
|
|
@@ -879,12 +876,12 @@ const ta = (e) => {
|
|
|
879
876
|
"button",
|
|
880
877
|
{
|
|
881
878
|
type: "button",
|
|
882
|
-
onClick: (
|
|
883
|
-
|
|
879
|
+
onClick: (w) => {
|
|
880
|
+
w.stopPropagation(), p((k) => !k);
|
|
884
881
|
},
|
|
885
882
|
className: "shrink-0 text-white",
|
|
886
|
-
"aria-label":
|
|
887
|
-
children:
|
|
883
|
+
"aria-label": v ? "Pause" : "Play",
|
|
884
|
+
children: v ? /* @__PURE__ */ n(_s, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Be, { className: "size-5 translate-x-px", weight: "fill" })
|
|
888
885
|
}
|
|
889
886
|
),
|
|
890
887
|
/* @__PURE__ */ h(
|
|
@@ -892,30 +889,30 @@ const ta = (e) => {
|
|
|
892
889
|
{
|
|
893
890
|
role: "slider",
|
|
894
891
|
"aria-label": "Playback position",
|
|
895
|
-
"aria-valuenow":
|
|
892
|
+
"aria-valuenow": P,
|
|
896
893
|
"aria-valuemin": 0,
|
|
897
894
|
"aria-valuemax": 100,
|
|
898
895
|
tabIndex: 0,
|
|
899
896
|
ref: f,
|
|
900
897
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
901
|
-
onMouseDown:
|
|
902
|
-
onTouchStart:
|
|
903
|
-
onClick: (
|
|
904
|
-
onMouseEnter: () =>
|
|
905
|
-
onMouseLeave: () =>
|
|
906
|
-
onKeyDown: (
|
|
907
|
-
|
|
898
|
+
onMouseDown: F,
|
|
899
|
+
onTouchStart: F,
|
|
900
|
+
onClick: (w) => w.stopPropagation(),
|
|
901
|
+
onMouseEnter: () => O(!0),
|
|
902
|
+
onMouseLeave: () => O(!1),
|
|
903
|
+
onKeyDown: (w) => {
|
|
904
|
+
w.key === "ArrowRight" && $(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, N - 0.05));
|
|
908
905
|
},
|
|
909
906
|
children: [
|
|
910
907
|
/* @__PURE__ */ n(
|
|
911
908
|
"div",
|
|
912
909
|
{
|
|
913
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
910
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${R || T ? "h-1.5" : "h-1"}`,
|
|
914
911
|
children: /* @__PURE__ */ n(
|
|
915
912
|
"div",
|
|
916
913
|
{
|
|
917
914
|
className: "h-full rounded-full bg-white",
|
|
918
|
-
style: { width: `${
|
|
915
|
+
style: { width: `${P}%` }
|
|
919
916
|
}
|
|
920
917
|
)
|
|
921
918
|
}
|
|
@@ -923,8 +920,8 @@ const ta = (e) => {
|
|
|
923
920
|
/* @__PURE__ */ n(
|
|
924
921
|
"div",
|
|
925
922
|
{
|
|
926
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
927
|
-
style: { left: `${
|
|
923
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${R || T ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
924
|
+
style: { left: `${P}%` }
|
|
928
925
|
}
|
|
929
926
|
)
|
|
930
927
|
]
|
|
@@ -934,7 +931,7 @@ const ta = (e) => {
|
|
|
934
931
|
]
|
|
935
932
|
}
|
|
936
933
|
);
|
|
937
|
-
},
|
|
934
|
+
}, zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", sa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Qt = ({
|
|
938
935
|
mimeType: e,
|
|
939
936
|
sourceUrl: t,
|
|
940
937
|
thumbnailUrl: s,
|
|
@@ -943,7 +940,7 @@ const ta = (e) => {
|
|
|
943
940
|
mediaPlayerProps: i,
|
|
944
941
|
containedImage: o = !1
|
|
945
942
|
}) => {
|
|
946
|
-
const l =
|
|
943
|
+
const l = ne(e), [d, m] = D(!1);
|
|
947
944
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
948
945
|
na,
|
|
949
946
|
{
|
|
@@ -992,7 +989,7 @@ const ta = (e) => {
|
|
|
992
989
|
{
|
|
993
990
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
994
991
|
children: le(e, {
|
|
995
|
-
className:
|
|
992
|
+
className: zt(r),
|
|
996
993
|
weight: "regular"
|
|
997
994
|
})
|
|
998
995
|
}
|
|
@@ -1009,12 +1006,12 @@ const ta = (e) => {
|
|
|
1009
1006
|
{
|
|
1010
1007
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1011
1008
|
children: le(e, {
|
|
1012
|
-
className:
|
|
1009
|
+
className: zt(r),
|
|
1013
1010
|
weight: "regular"
|
|
1014
1011
|
})
|
|
1015
1012
|
}
|
|
1016
1013
|
);
|
|
1017
|
-
},
|
|
1014
|
+
}, en = ({
|
|
1018
1015
|
variant: e,
|
|
1019
1016
|
thumbnail: t,
|
|
1020
1017
|
title: s,
|
|
@@ -1025,14 +1022,14 @@ const ta = (e) => {
|
|
|
1025
1022
|
action: l,
|
|
1026
1023
|
topLeft: d,
|
|
1027
1024
|
topRight: m,
|
|
1028
|
-
rootRef:
|
|
1025
|
+
rootRef: b,
|
|
1029
1026
|
"data-testid": u
|
|
1030
1027
|
}) => {
|
|
1031
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1028
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", g = f && !s;
|
|
1032
1029
|
return /* @__PURE__ */ h(
|
|
1033
1030
|
"div",
|
|
1034
1031
|
{
|
|
1035
|
-
ref:
|
|
1032
|
+
ref: b,
|
|
1036
1033
|
"data-testid": u,
|
|
1037
1034
|
className: C(
|
|
1038
1035
|
"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)]",
|
|
@@ -1048,8 +1045,8 @@ const ta = (e) => {
|
|
|
1048
1045
|
{
|
|
1049
1046
|
className: C("mb-0.5 truncate text-base font-medium", {
|
|
1050
1047
|
"text-black": !f,
|
|
1051
|
-
"text-white/30": f &&
|
|
1052
|
-
"text-white": f && !
|
|
1048
|
+
"text-white/30": f && g,
|
|
1049
|
+
"text-white": f && !g
|
|
1053
1050
|
}),
|
|
1054
1051
|
children: c
|
|
1055
1052
|
}
|
|
@@ -1080,10 +1077,10 @@ const ta = (e) => {
|
|
|
1080
1077
|
}
|
|
1081
1078
|
);
|
|
1082
1079
|
};
|
|
1083
|
-
function
|
|
1080
|
+
function tn(e) {
|
|
1084
1081
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1085
1082
|
}
|
|
1086
|
-
function
|
|
1083
|
+
function Xe(e) {
|
|
1087
1084
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1088
1085
|
}
|
|
1089
1086
|
function aa(e) {
|
|
@@ -1101,8 +1098,8 @@ function oa(e) {
|
|
|
1101
1098
|
function la(e) {
|
|
1102
1099
|
return e ? "text-white/20" : "text-black/20";
|
|
1103
1100
|
}
|
|
1104
|
-
const
|
|
1105
|
-
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(
|
|
1101
|
+
const Ke = ({ attachment: e, isMyMessage: t }) => {
|
|
1102
|
+
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(z.Fragment, { children: [
|
|
1106
1103
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1107
1104
|
"img",
|
|
1108
1105
|
{
|
|
@@ -1114,7 +1111,7 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1114
1111
|
"div",
|
|
1115
1112
|
{
|
|
1116
1113
|
className: `aspect-video w-full rounded-[20px] ${aa(t)} flex items-center justify-center`,
|
|
1117
|
-
children: /* @__PURE__ */ n(
|
|
1114
|
+
children: /* @__PURE__ */ n(ys, { className: `size-12 ${la(t)}` })
|
|
1118
1115
|
}
|
|
1119
1116
|
) }),
|
|
1120
1117
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
@@ -1125,12 +1122,12 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1125
1122
|
] });
|
|
1126
1123
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
|
|
1127
1124
|
};
|
|
1128
|
-
function
|
|
1125
|
+
function nn(e) {
|
|
1129
1126
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1130
1127
|
}
|
|
1131
|
-
function
|
|
1128
|
+
function Je(e) {
|
|
1132
1129
|
var t;
|
|
1133
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1130
|
+
return (t = e.attachments) == null ? void 0 : t.find(nn);
|
|
1134
1131
|
}
|
|
1135
1132
|
async function ca(e, t) {
|
|
1136
1133
|
let s;
|
|
@@ -1148,7 +1145,7 @@ const da = ({
|
|
|
1148
1145
|
url: e,
|
|
1149
1146
|
filename: t
|
|
1150
1147
|
}) => {
|
|
1151
|
-
const [s, a] =
|
|
1148
|
+
const [s, a] = D(!1);
|
|
1152
1149
|
return /* @__PURE__ */ n(
|
|
1153
1150
|
"button",
|
|
1154
1151
|
{
|
|
@@ -1164,44 +1161,44 @@ const da = ({
|
|
|
1164
1161
|
},
|
|
1165
1162
|
disabled: s,
|
|
1166
1163
|
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",
|
|
1167
|
-
children: s ? /* @__PURE__ */ n(
|
|
1168
|
-
/* @__PURE__ */ n(
|
|
1164
|
+
children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(z.Fragment, { children: [
|
|
1165
|
+
/* @__PURE__ */ n(be, { className: "size-4 text-white", weight: "bold" }),
|
|
1169
1166
|
"Download"
|
|
1170
1167
|
] })
|
|
1171
1168
|
}
|
|
1172
1169
|
);
|
|
1173
1170
|
};
|
|
1174
|
-
function
|
|
1175
|
-
var u, f, c,
|
|
1171
|
+
function Ze(e) {
|
|
1172
|
+
var u, f, c, g;
|
|
1176
1173
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1177
|
-
(
|
|
1174
|
+
(v) => v.type === "video" && v.asset_url
|
|
1178
1175
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1179
|
-
(
|
|
1176
|
+
(v) => v.type === "image" && v.image_url
|
|
1180
1177
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1181
|
-
(
|
|
1182
|
-
), r = (
|
|
1183
|
-
(
|
|
1178
|
+
(v) => v.type === "audio" && v.asset_url
|
|
1179
|
+
), r = (g = e.attachments) == null ? void 0 : g.find(
|
|
1180
|
+
(v) => v.type === "file" && v.asset_url
|
|
1184
1181
|
), 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);
|
|
1185
1182
|
if (!o) return null;
|
|
1186
|
-
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,
|
|
1183
|
+
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, b = t == null ? void 0 : t.thumb_url;
|
|
1187
1184
|
return {
|
|
1188
1185
|
resolvedUrl: o,
|
|
1189
1186
|
resolvedType: l,
|
|
1190
1187
|
title: d,
|
|
1191
1188
|
fileSize: m,
|
|
1192
|
-
thumbnailUrl:
|
|
1189
|
+
thumbnailUrl: b
|
|
1193
1190
|
};
|
|
1194
1191
|
}
|
|
1195
|
-
const
|
|
1192
|
+
const sn = ({
|
|
1196
1193
|
resolvedUrl: e,
|
|
1197
1194
|
resolvedType: t,
|
|
1198
1195
|
title: s,
|
|
1199
1196
|
fileSize: a,
|
|
1200
1197
|
thumbnailUrl: r
|
|
1201
1198
|
}) => {
|
|
1202
|
-
const i = a !== void 0 ?
|
|
1199
|
+
const i = a !== void 0 ? tn(a) : void 0;
|
|
1203
1200
|
return /* @__PURE__ */ n(
|
|
1204
|
-
|
|
1201
|
+
en,
|
|
1205
1202
|
{
|
|
1206
1203
|
variant: "dark",
|
|
1207
1204
|
title: s,
|
|
@@ -1209,7 +1206,7 @@ const an = ({
|
|
|
1209
1206
|
mimeType: t,
|
|
1210
1207
|
detail: i,
|
|
1211
1208
|
thumbnail: /* @__PURE__ */ n(
|
|
1212
|
-
|
|
1209
|
+
Qt,
|
|
1213
1210
|
{
|
|
1214
1211
|
mimeType: t,
|
|
1215
1212
|
sourceUrl: e,
|
|
@@ -1220,23 +1217,23 @@ const an = ({
|
|
|
1220
1217
|
)
|
|
1221
1218
|
}
|
|
1222
1219
|
);
|
|
1223
|
-
},
|
|
1220
|
+
}, an = ({
|
|
1224
1221
|
resolvedUrl: e,
|
|
1225
1222
|
resolvedType: t,
|
|
1226
1223
|
title: s,
|
|
1227
1224
|
fileSize: a,
|
|
1228
1225
|
thumbnailUrl: r
|
|
1229
1226
|
}) => {
|
|
1230
|
-
const i =
|
|
1227
|
+
const i = ne(t), o = a !== void 0 ? tn(a) : void 0;
|
|
1231
1228
|
return /* @__PURE__ */ n(
|
|
1232
|
-
|
|
1229
|
+
en,
|
|
1233
1230
|
{
|
|
1234
1231
|
variant: "light",
|
|
1235
1232
|
title: s,
|
|
1236
1233
|
mimeType: t,
|
|
1237
1234
|
detail: o,
|
|
1238
1235
|
thumbnail: /* @__PURE__ */ n(
|
|
1239
|
-
|
|
1236
|
+
Qt,
|
|
1240
1237
|
{
|
|
1241
1238
|
mimeType: t,
|
|
1242
1239
|
sourceUrl: e,
|
|
@@ -1253,7 +1250,7 @@ const an = ({
|
|
|
1253
1250
|
message: e,
|
|
1254
1251
|
isMyMessage: t = !1
|
|
1255
1252
|
}) => {
|
|
1256
|
-
const s =
|
|
1253
|
+
const s = Je(e), a = Ze(e);
|
|
1257
1254
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
1258
1255
|
!t && e.user && /* @__PURE__ */ n(
|
|
1259
1256
|
ae,
|
|
@@ -1274,7 +1271,7 @@ const an = ({
|
|
|
1274
1271
|
{
|
|
1275
1272
|
className: "str-chat__message-bubble",
|
|
1276
1273
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1277
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1274
|
+
children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(Ke, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
|
|
1278
1275
|
}
|
|
1279
1276
|
) })
|
|
1280
1277
|
}
|
|
@@ -1283,19 +1280,19 @@ const an = ({
|
|
|
1283
1280
|
}, ma = ({
|
|
1284
1281
|
message: e
|
|
1285
1282
|
}) => {
|
|
1286
|
-
const t =
|
|
1283
|
+
const t = Je(e);
|
|
1287
1284
|
if (t)
|
|
1288
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1289
|
-
const s =
|
|
1290
|
-
return s ? /* @__PURE__ */ n(
|
|
1285
|
+
return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !0 }) });
|
|
1286
|
+
const s = Ze(e);
|
|
1287
|
+
return s ? /* @__PURE__ */ n(sn, { ...s }) : null;
|
|
1291
1288
|
}, ha = ({
|
|
1292
1289
|
message: e
|
|
1293
1290
|
}) => {
|
|
1294
|
-
const t =
|
|
1291
|
+
const t = Je(e);
|
|
1295
1292
|
if (t)
|
|
1296
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1297
|
-
const s =
|
|
1298
|
-
return s ? /* @__PURE__ */ n(
|
|
1293
|
+
return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !1 }) });
|
|
1294
|
+
const s = Ze(e);
|
|
1295
|
+
return s ? /* @__PURE__ */ n(an, { ...s }) : null;
|
|
1299
1296
|
}, Ni = Object.assign(ua, {
|
|
1300
1297
|
Creator: ma,
|
|
1301
1298
|
Visitor: ha
|
|
@@ -1303,9 +1300,9 @@ const an = ({
|
|
|
1303
1300
|
isUnlocking: () => !1
|
|
1304
1301
|
}, ga = {
|
|
1305
1302
|
LockedAttachment: fa
|
|
1306
|
-
},
|
|
1303
|
+
}, rn = Ge({}), _i = rn.Provider;
|
|
1307
1304
|
function ba(e) {
|
|
1308
|
-
return Te(
|
|
1305
|
+
return Te(rn)[e] ?? ga[e];
|
|
1309
1306
|
}
|
|
1310
1307
|
const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1311
1308
|
"svg",
|
|
@@ -1336,38 +1333,38 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1336
1333
|
}, wa = (e) => {
|
|
1337
1334
|
var t;
|
|
1338
1335
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1339
|
-
},
|
|
1336
|
+
}, on = (e) => va(e) || xa(e), Na = (e) => {
|
|
1340
1337
|
var t;
|
|
1341
|
-
return
|
|
1342
|
-
},
|
|
1338
|
+
return on(e) && !((t = e.text) != null && t.trim());
|
|
1339
|
+
}, Pe = ({
|
|
1343
1340
|
message: e,
|
|
1344
1341
|
standalone: t = !1,
|
|
1345
1342
|
isMyMessage: s = !1,
|
|
1346
1343
|
hasAttachment: a = !1
|
|
1347
1344
|
}) => {
|
|
1348
1345
|
var u;
|
|
1349
|
-
const r =
|
|
1346
|
+
const r = on(e), i = ke(e);
|
|
1350
1347
|
if (!r && !i)
|
|
1351
1348
|
return null;
|
|
1352
1349
|
if (r) {
|
|
1353
1350
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1354
1351
|
if (!f) return null;
|
|
1355
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1352
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", g = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1356
1353
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1357
|
-
/* @__PURE__ */ n(
|
|
1358
|
-
/* @__PURE__ */ n("span", { children:
|
|
1354
|
+
/* @__PURE__ */ n(Cs, { size: t ? 14 : 12 }),
|
|
1355
|
+
/* @__PURE__ */ n("span", { children: g })
|
|
1359
1356
|
] });
|
|
1360
1357
|
}
|
|
1361
1358
|
const o = s && a, l = o ? "Sent with AI" : "Sent with DM Agent", d = [
|
|
1362
1359
|
"message-chatbot-indicator",
|
|
1363
1360
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1364
1361
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1365
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }),
|
|
1366
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(
|
|
1362
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), b = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(pa, { size: o ? 12 : 15 }) });
|
|
1363
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(te, { children: [
|
|
1367
1364
|
m,
|
|
1368
|
-
|
|
1369
|
-
] }) : /* @__PURE__ */ h(
|
|
1370
|
-
|
|
1365
|
+
b
|
|
1366
|
+
] }) : /* @__PURE__ */ h(te, { children: [
|
|
1367
|
+
b,
|
|
1371
1368
|
m
|
|
1372
1369
|
] }) });
|
|
1373
1370
|
}, _a = ({
|
|
@@ -1386,7 +1383,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1386
1383
|
"aria-label": "Good response",
|
|
1387
1384
|
"aria-pressed": e === "up",
|
|
1388
1385
|
"data-tooltip": "Good response",
|
|
1389
|
-
children: /* @__PURE__ */ n(
|
|
1386
|
+
children: /* @__PURE__ */ n(ks, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1390
1387
|
}
|
|
1391
1388
|
),
|
|
1392
1389
|
/* @__PURE__ */ n(
|
|
@@ -1400,11 +1397,11 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1400
1397
|
"aria-label": "Bad response",
|
|
1401
1398
|
"aria-pressed": e === "down",
|
|
1402
1399
|
"data-tooltip": "Bad response",
|
|
1403
|
-
children: /* @__PURE__ */ n(
|
|
1400
|
+
children: /* @__PURE__ */ n(Es, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1404
1401
|
}
|
|
1405
1402
|
)
|
|
1406
1403
|
] }), ya = (e) => {
|
|
1407
|
-
var gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et
|
|
1404
|
+
var ht, ft, gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et;
|
|
1408
1405
|
const {
|
|
1409
1406
|
additionalMessageInputProps: t,
|
|
1410
1407
|
chatbotVotingEnabled: s,
|
|
@@ -1415,67 +1412,67 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1415
1412
|
handleAction: l,
|
|
1416
1413
|
handleOpenThread: d,
|
|
1417
1414
|
handleRetry: m,
|
|
1418
|
-
highlighted:
|
|
1415
|
+
highlighted: b,
|
|
1419
1416
|
isMessageAIGenerated: u,
|
|
1420
1417
|
isMyMessage: f,
|
|
1421
1418
|
message: c,
|
|
1422
|
-
renderText:
|
|
1423
|
-
threadList:
|
|
1424
|
-
viewerLanguage:
|
|
1425
|
-
} = e, { client:
|
|
1426
|
-
Attachment:
|
|
1427
|
-
EditMessageModal:
|
|
1428
|
-
MessageActions:
|
|
1429
|
-
MessageBlocked: G =
|
|
1430
|
-
MessageBouncePrompt:
|
|
1431
|
-
MessageDeleted:
|
|
1432
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1433
|
-
MessageRepliesCountButton:
|
|
1434
|
-
ReminderNotification:
|
|
1435
|
-
StreamedMessageText:
|
|
1436
|
-
PinIndicator:
|
|
1437
|
-
} = Ut("CustomMessage"),
|
|
1419
|
+
renderText: g,
|
|
1420
|
+
threadList: v,
|
|
1421
|
+
viewerLanguage: p
|
|
1422
|
+
} = e, { client: N } = Ye("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking: T, onUnlockClick: S, onFetchSource: R, onDownloadClick: O } = ba("LockedAttachment"), [E, A] = D(!1), y = Mn(c.id), { selected: _, voteUp: I, voteDown: L } = Vs(c), {
|
|
1423
|
+
Attachment: M = Rn,
|
|
1424
|
+
EditMessageModal: j = Ln,
|
|
1425
|
+
MessageActions: V,
|
|
1426
|
+
MessageBlocked: G = Dn,
|
|
1427
|
+
MessageBouncePrompt: $ = Pn,
|
|
1428
|
+
MessageDeleted: F = On,
|
|
1429
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = zn,
|
|
1430
|
+
MessageRepliesCountButton: U = $n,
|
|
1431
|
+
ReminderNotification: P = Fn,
|
|
1432
|
+
StreamedMessageText: w = Bn,
|
|
1433
|
+
PinIndicator: k
|
|
1434
|
+
} = Ut("CustomMessage"), B = Un(c), q = jn(c), _e = ee(
|
|
1438
1435
|
() => u == null ? void 0 : u(c),
|
|
1439
1436
|
[u, c]
|
|
1440
|
-
),
|
|
1441
|
-
const me = c.attachments ?? [],
|
|
1442
|
-
if (!ke(c)) return
|
|
1443
|
-
const
|
|
1444
|
-
return
|
|
1445
|
-
}, [c]),
|
|
1446
|
-
const me =
|
|
1437
|
+
), K = ee(() => {
|
|
1438
|
+
const me = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...me] : me;
|
|
1439
|
+
if (!ke(c)) return ye;
|
|
1440
|
+
const St = ye.filter((It) => !("type" in It) || !nn(It));
|
|
1441
|
+
return St.length === ye.length ? ye : St;
|
|
1442
|
+
}, [c]), re = ee(() => {
|
|
1443
|
+
const me = Xt({ message: c, viewerLanguage: p });
|
|
1447
1444
|
return me === c.text ? c : { ...c, text: me };
|
|
1448
|
-
}, [c,
|
|
1449
|
-
if (
|
|
1445
|
+
}, [c, p]);
|
|
1446
|
+
if (Vn(c))
|
|
1450
1447
|
return null;
|
|
1451
1448
|
if (c.deleted_at || c.type === "deleted")
|
|
1452
|
-
return /* @__PURE__ */ n(
|
|
1449
|
+
return /* @__PURE__ */ n(F, { message: c });
|
|
1453
1450
|
if (Gn(c))
|
|
1454
1451
|
return /* @__PURE__ */ n(G, {});
|
|
1455
|
-
const
|
|
1452
|
+
const J = !v && !!c.reply_count, se = !v && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Hn(c);
|
|
1456
1453
|
let ie;
|
|
1457
|
-
|
|
1458
|
-
const de = f(),
|
|
1454
|
+
Q ? ie = () => m(c) : lt && (ie = () => A(!0));
|
|
1455
|
+
const de = f(), kn = C(
|
|
1459
1456
|
"str-chat__message str-chat__message-simple",
|
|
1460
1457
|
`str-chat__message--${c.type}`,
|
|
1461
1458
|
`str-chat__message--${c.status}`,
|
|
1462
1459
|
de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1463
1460
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1464
1461
|
{
|
|
1465
|
-
"str-chat__message--has-attachment":
|
|
1466
|
-
"str-chat__message--highlighted":
|
|
1462
|
+
"str-chat__message--has-attachment": B,
|
|
1463
|
+
"str-chat__message--highlighted": b,
|
|
1467
1464
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1468
|
-
"str-chat__message--with-reactions":
|
|
1469
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1470
|
-
"str-chat__message-with-thread-link":
|
|
1465
|
+
"str-chat__message--with-reactions": q,
|
|
1466
|
+
"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,
|
|
1467
|
+
"str-chat__message-with-thread-link": J || se,
|
|
1471
1468
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1472
1469
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1473
1470
|
"str-chat__virtual-message__wrapper--group": o
|
|
1474
1471
|
}
|
|
1475
|
-
),
|
|
1476
|
-
return /* @__PURE__ */ h(
|
|
1472
|
+
), ct = c.poll_id && N.polls.fromState(c.poll_id), dt = Na(c), ue = ke(c), ut = wa(c), Re = !!(K != null && K.length && !c.quoted_message), mt = ue && de && Re;
|
|
1473
|
+
return /* @__PURE__ */ h(te, { children: [
|
|
1477
1474
|
a && /* @__PURE__ */ n(
|
|
1478
|
-
|
|
1475
|
+
j,
|
|
1479
1476
|
{
|
|
1480
1477
|
additionalMessageInputProps: t
|
|
1481
1478
|
}
|
|
@@ -1483,19 +1480,19 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1483
1480
|
E && /* @__PURE__ */ n(
|
|
1484
1481
|
Yn,
|
|
1485
1482
|
{
|
|
1486
|
-
MessageBouncePrompt:
|
|
1487
|
-
onClose: () =>
|
|
1483
|
+
MessageBouncePrompt: $,
|
|
1484
|
+
onClose: () => A(!1),
|
|
1488
1485
|
open: E
|
|
1489
1486
|
}
|
|
1490
1487
|
),
|
|
1491
1488
|
/* @__PURE__ */ h(
|
|
1492
1489
|
"div",
|
|
1493
1490
|
{
|
|
1494
|
-
className:
|
|
1491
|
+
className: kn,
|
|
1495
1492
|
"data-message-id": c.id,
|
|
1496
1493
|
children: [
|
|
1497
|
-
|
|
1498
|
-
!!
|
|
1494
|
+
k && /* @__PURE__ */ n(k, {}),
|
|
1495
|
+
!!y && /* @__PURE__ */ n(P, { reminder: y }),
|
|
1499
1496
|
c.user && /* @__PURE__ */ n(
|
|
1500
1497
|
ae,
|
|
1501
1498
|
{
|
|
@@ -1512,7 +1509,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1512
1509
|
"div",
|
|
1513
1510
|
{
|
|
1514
1511
|
className: C("str-chat__message-inner", {
|
|
1515
|
-
"str-chat__simple-message--error-failed":
|
|
1512
|
+
"str-chat__simple-message--error-failed": Q || lt
|
|
1516
1513
|
}),
|
|
1517
1514
|
"data-testid": "message-inner",
|
|
1518
1515
|
onClick: ie,
|
|
@@ -1525,161 +1522,161 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1525
1522
|
marginInlineEnd: 0,
|
|
1526
1523
|
marginInlineStart: 0
|
|
1527
1524
|
},
|
|
1528
|
-
children:
|
|
1525
|
+
children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1529
1526
|
de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1530
|
-
|
|
1527
|
+
V && /* @__PURE__ */ n(V, {}),
|
|
1531
1528
|
/* @__PURE__ */ n(
|
|
1532
|
-
|
|
1529
|
+
Ot.Sent,
|
|
1533
1530
|
{
|
|
1534
|
-
title: (
|
|
1535
|
-
mimeType: (
|
|
1536
|
-
thumbnailUrl: (
|
|
1537
|
-
amountText: (
|
|
1538
|
-
detail: (
|
|
1539
|
-
paymentStatus: (
|
|
1540
|
-
onPreviewClick: () =>
|
|
1541
|
-
onFetchSource: async () => await (
|
|
1531
|
+
title: (gt = c.metadata) == null ? void 0 : gt.attachment_title,
|
|
1532
|
+
mimeType: (bt = c.metadata) == null ? void 0 : bt.attachment_mime_type,
|
|
1533
|
+
thumbnailUrl: (pt = c.metadata) == null ? void 0 : pt.attachment_thumbnail,
|
|
1534
|
+
amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
|
|
1535
|
+
detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
|
|
1536
|
+
paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
|
|
1537
|
+
onPreviewClick: () => S == null ? void 0 : S(c, x),
|
|
1538
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, x))
|
|
1542
1539
|
}
|
|
1543
1540
|
)
|
|
1544
1541
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1545
1542
|
/* @__PURE__ */ n(
|
|
1546
|
-
|
|
1543
|
+
Ot.Received,
|
|
1547
1544
|
{
|
|
1548
|
-
title: (
|
|
1549
|
-
mimeType: (
|
|
1550
|
-
thumbnailUrl: (
|
|
1551
|
-
amountText: (
|
|
1552
|
-
detail: (
|
|
1553
|
-
paymentStatus: (
|
|
1545
|
+
title: (Nt = c.metadata) == null ? void 0 : Nt.attachment_title,
|
|
1546
|
+
mimeType: (_t = c.metadata) == null ? void 0 : _t.attachment_mime_type,
|
|
1547
|
+
thumbnailUrl: (yt = c.metadata) == null ? void 0 : yt.attachment_thumbnail,
|
|
1548
|
+
amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
|
|
1549
|
+
detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
|
|
1550
|
+
paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
|
|
1554
1551
|
isUnlocking: T(c.id),
|
|
1555
|
-
onUnlockClick: () =>
|
|
1556
|
-
onFetchSource: async () => await (
|
|
1557
|
-
onDownloadClick: () =>
|
|
1552
|
+
onUnlockClick: () => S == null ? void 0 : S(c, x),
|
|
1553
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, x)),
|
|
1554
|
+
onDownloadClick: () => O == null ? void 0 : O(c, x)
|
|
1558
1555
|
}
|
|
1559
1556
|
),
|
|
1560
|
-
|
|
1557
|
+
V && /* @__PURE__ */ n(V, {})
|
|
1561
1558
|
] }),
|
|
1562
1559
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1563
|
-
|
|
1560
|
+
Tt,
|
|
1564
1561
|
{
|
|
1565
|
-
message:
|
|
1566
|
-
renderText:
|
|
1562
|
+
message: re,
|
|
1563
|
+
renderText: g
|
|
1567
1564
|
}
|
|
1568
1565
|
) })
|
|
1569
|
-
] }) :
|
|
1566
|
+
] }) : dt ? (
|
|
1570
1567
|
/* Tip-only messages render as a standalone bubble */
|
|
1571
|
-
/* @__PURE__ */ n(
|
|
1568
|
+
/* @__PURE__ */ n(Pe, { message: c, standalone: !0 })
|
|
1572
1569
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1573
|
-
ue && !
|
|
1574
|
-
|
|
1570
|
+
ue && !mt && /* @__PURE__ */ n(
|
|
1571
|
+
Pe,
|
|
1575
1572
|
{
|
|
1576
1573
|
message: c,
|
|
1577
|
-
hasAttachment:
|
|
1574
|
+
hasAttachment: Re,
|
|
1578
1575
|
isMyMessage: de
|
|
1579
1576
|
}
|
|
1580
1577
|
),
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1578
|
+
ct && /* @__PURE__ */ n(qn, { poll: ct }),
|
|
1579
|
+
K != null && K.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1580
|
+
M,
|
|
1584
1581
|
{
|
|
1585
1582
|
actionHandler: l,
|
|
1586
|
-
attachments:
|
|
1583
|
+
attachments: K
|
|
1587
1584
|
}
|
|
1588
1585
|
) : null,
|
|
1589
|
-
|
|
1590
|
-
|
|
1586
|
+
_e ? /* @__PURE__ */ n(
|
|
1587
|
+
w,
|
|
1591
1588
|
{
|
|
1592
|
-
message:
|
|
1593
|
-
renderText:
|
|
1589
|
+
message: re,
|
|
1590
|
+
renderText: g
|
|
1594
1591
|
}
|
|
1595
1592
|
) : /* @__PURE__ */ n(
|
|
1596
|
-
|
|
1593
|
+
Tt,
|
|
1597
1594
|
{
|
|
1598
|
-
message:
|
|
1599
|
-
renderText:
|
|
1595
|
+
message: re,
|
|
1596
|
+
renderText: g
|
|
1600
1597
|
}
|
|
1601
1598
|
),
|
|
1602
1599
|
/* @__PURE__ */ n(Wn, {})
|
|
1603
1600
|
] }) })
|
|
1604
1601
|
}
|
|
1605
1602
|
),
|
|
1606
|
-
!
|
|
1607
|
-
(!ue ||
|
|
1608
|
-
|
|
1603
|
+
!ut && !dt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1604
|
+
(!ue || mt) && /* @__PURE__ */ n(
|
|
1605
|
+
Pe,
|
|
1609
1606
|
{
|
|
1610
1607
|
message: c,
|
|
1611
|
-
hasAttachment:
|
|
1608
|
+
hasAttachment: Re,
|
|
1612
1609
|
isMyMessage: de
|
|
1613
1610
|
}
|
|
1614
1611
|
),
|
|
1615
1612
|
s && ue && /* @__PURE__ */ n(
|
|
1616
1613
|
_a,
|
|
1617
1614
|
{
|
|
1618
|
-
selected:
|
|
1619
|
-
onVoteUp:
|
|
1620
|
-
onVoteDown:
|
|
1615
|
+
selected: _,
|
|
1616
|
+
onVoteUp: I,
|
|
1617
|
+
onVoteDown: L
|
|
1621
1618
|
}
|
|
1622
1619
|
)
|
|
1623
1620
|
] }),
|
|
1624
|
-
|
|
1625
|
-
|
|
1621
|
+
J && /* @__PURE__ */ n(
|
|
1622
|
+
U,
|
|
1626
1623
|
{
|
|
1627
1624
|
onClick: d,
|
|
1628
1625
|
reply_count: c.reply_count
|
|
1629
1626
|
}
|
|
1630
1627
|
),
|
|
1631
|
-
|
|
1628
|
+
se && /* @__PURE__ */ n(X, {})
|
|
1632
1629
|
]
|
|
1633
1630
|
},
|
|
1634
1631
|
c.id
|
|
1635
1632
|
)
|
|
1636
1633
|
] });
|
|
1637
|
-
}, Ca =
|
|
1634
|
+
}, Ca = z.memo(
|
|
1638
1635
|
ya,
|
|
1639
1636
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : An(e, t)
|
|
1640
1637
|
), ka = (e) => {
|
|
1641
|
-
const t =
|
|
1638
|
+
const t = pe("CustomMessage");
|
|
1642
1639
|
return /* @__PURE__ */ n(Ca, { ...t, ...e });
|
|
1643
1640
|
}, Ea = () => {
|
|
1644
1641
|
var s;
|
|
1645
|
-
const { handleDelete: e, message: t } =
|
|
1642
|
+
const { handleDelete: e, message: t } = pe("CustomMessageActions");
|
|
1646
1643
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1647
|
-
|
|
1644
|
+
Ht,
|
|
1648
1645
|
{
|
|
1649
1646
|
onClick: e,
|
|
1650
1647
|
"aria-label": "Delete",
|
|
1651
1648
|
title: "Delete",
|
|
1652
1649
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1653
|
-
children: /* @__PURE__ */ n(
|
|
1650
|
+
children: /* @__PURE__ */ n(Ss, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1654
1651
|
}
|
|
1655
1652
|
);
|
|
1656
|
-
},
|
|
1657
|
-
const { handleFlag: e } =
|
|
1653
|
+
}, Sa = () => {
|
|
1654
|
+
const { handleFlag: e } = pe("CustomMessageActions");
|
|
1658
1655
|
return /* @__PURE__ */ n(
|
|
1659
|
-
|
|
1656
|
+
Ht,
|
|
1660
1657
|
{
|
|
1661
1658
|
onClick: e,
|
|
1662
1659
|
"aria-label": "Report",
|
|
1663
1660
|
title: "Report",
|
|
1664
1661
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1665
|
-
children: /* @__PURE__ */ n(
|
|
1662
|
+
children: /* @__PURE__ */ n(jt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1666
1663
|
}
|
|
1667
1664
|
);
|
|
1668
|
-
},
|
|
1665
|
+
}, Ia = () => {
|
|
1669
1666
|
var t;
|
|
1670
|
-
const { message: e } =
|
|
1667
|
+
const { message: e } = pe("CustomMessageActions");
|
|
1671
1668
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1672
|
-
|
|
1669
|
+
Ls,
|
|
1673
1670
|
{
|
|
1674
1671
|
messageActionSet: [
|
|
1675
1672
|
{ Component: Ea, placement: "quick", type: "delete" },
|
|
1676
|
-
{ Component:
|
|
1673
|
+
{ Component: Sa, placement: "quick", type: "flag" }
|
|
1677
1674
|
]
|
|
1678
1675
|
}
|
|
1679
1676
|
);
|
|
1680
1677
|
}, Ta = (e) => ({
|
|
1681
1678
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1682
|
-
(t) =>
|
|
1679
|
+
(t) => Rt.previewIsLoaded(t) || Rt.previewIsLoading(t)
|
|
1683
1680
|
)
|
|
1684
1681
|
}), Aa = ({
|
|
1685
1682
|
link: e,
|
|
@@ -1711,7 +1708,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1711
1708
|
},
|
|
1712
1709
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1713
1710
|
"aria-label": "Close link preview",
|
|
1714
|
-
children: /* @__PURE__ */ n(
|
|
1711
|
+
children: /* @__PURE__ */ n(Ae, { className: "size-4 text-black/90" })
|
|
1715
1712
|
}
|
|
1716
1713
|
),
|
|
1717
1714
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1736,7 +1733,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1736
1733
|
},
|
|
1737
1734
|
r.og_scrape_url
|
|
1738
1735
|
)) }) : null;
|
|
1739
|
-
},
|
|
1736
|
+
}, ln = z.createContext(!1), Ra = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1740
1737
|
"button",
|
|
1741
1738
|
{
|
|
1742
1739
|
...s,
|
|
@@ -1746,9 +1743,9 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1746
1743
|
onClick: e,
|
|
1747
1744
|
children: /* @__PURE__ */ n(Is, { weight: "bold", className: "size-4" })
|
|
1748
1745
|
}
|
|
1749
|
-
),
|
|
1750
|
-
const e = Te(
|
|
1751
|
-
SendButton: r =
|
|
1746
|
+
), La = () => {
|
|
1747
|
+
const e = Te(ln), { handleSubmit: t } = Zn(), s = Qn(), a = e || !s, {
|
|
1748
|
+
SendButton: r = Ra,
|
|
1752
1749
|
AttachmentPreviewList: i = es
|
|
1753
1750
|
} = Ut("CustomMessageInput");
|
|
1754
1751
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
@@ -1780,7 +1777,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1780
1777
|
)
|
|
1781
1778
|
] })
|
|
1782
1779
|
] });
|
|
1783
|
-
},
|
|
1780
|
+
}, Da = ({
|
|
1784
1781
|
renderActions: e,
|
|
1785
1782
|
renderFooter: t,
|
|
1786
1783
|
disabled: s = !1,
|
|
@@ -1788,7 +1785,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1788
1785
|
}) => {
|
|
1789
1786
|
var o;
|
|
1790
1787
|
const { channel: r } = ce(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
|
|
1791
|
-
return s ? /* @__PURE__ */ h(
|
|
1788
|
+
return s ? /* @__PURE__ */ h(te, { children: [
|
|
1792
1789
|
/* @__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 }),
|
|
1793
1790
|
t == null ? void 0 : t()
|
|
1794
1791
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1800,7 +1797,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1800
1797
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1801
1798
|
children: [
|
|
1802
1799
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1803
|
-
/* @__PURE__ */ n(
|
|
1800
|
+
/* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(Jn, { Input: La }) })
|
|
1804
1801
|
]
|
|
1805
1802
|
}
|
|
1806
1803
|
),
|
|
@@ -1814,12 +1811,12 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1814
1811
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1815
1812
|
}, za = [
|
|
1816
1813
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1817
|
-
],
|
|
1814
|
+
], $a = {
|
|
1818
1815
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1819
|
-
},
|
|
1816
|
+
}, Oe = "age safety guidelines.", Fa = "https://linktr.ee/s/about/contact", $t = (e) => Pa.includes(e), Ba = (e) => za.includes(e), Ua = (e) => {
|
|
1820
1817
|
var a;
|
|
1821
1818
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1822
|
-
if (
|
|
1819
|
+
if ($t(t))
|
|
1823
1820
|
return {
|
|
1824
1821
|
kind: "dm-agent",
|
|
1825
1822
|
type: t
|
|
@@ -1830,33 +1827,33 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1830
1827
|
type: t
|
|
1831
1828
|
};
|
|
1832
1829
|
const s = e.dm_agent_system_type;
|
|
1833
|
-
if (
|
|
1830
|
+
if ($t(s))
|
|
1834
1831
|
return {
|
|
1835
1832
|
kind: "dm-agent",
|
|
1836
1833
|
type: s
|
|
1837
1834
|
};
|
|
1838
|
-
},
|
|
1839
|
-
const t = e.indexOf(
|
|
1835
|
+
}, ja = (e) => {
|
|
1836
|
+
const t = e.indexOf(Oe);
|
|
1840
1837
|
if (t === -1)
|
|
1841
1838
|
return e;
|
|
1842
|
-
const s = t +
|
|
1843
|
-
return /* @__PURE__ */ h(
|
|
1839
|
+
const s = t + Oe.length;
|
|
1840
|
+
return /* @__PURE__ */ h(te, { children: [
|
|
1844
1841
|
e.slice(0, t),
|
|
1845
1842
|
/* @__PURE__ */ n(
|
|
1846
1843
|
"a",
|
|
1847
1844
|
{
|
|
1848
|
-
href:
|
|
1845
|
+
href: Fa,
|
|
1849
1846
|
target: "_blank",
|
|
1850
1847
|
rel: "noopener noreferrer",
|
|
1851
1848
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1852
|
-
children:
|
|
1849
|
+
children: Oe
|
|
1853
1850
|
}
|
|
1854
1851
|
),
|
|
1855
1852
|
e.slice(s)
|
|
1856
1853
|
] });
|
|
1857
|
-
},
|
|
1854
|
+
}, Va = (e) => {
|
|
1858
1855
|
var a, r;
|
|
1859
|
-
const t = e.message.hide_date === !0, s =
|
|
1856
|
+
const t = e.message.hide_date === !0, s = Ua(
|
|
1860
1857
|
e.message
|
|
1861
1858
|
);
|
|
1862
1859
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
@@ -1870,7 +1867,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1870
1867
|
"data-dm-agent-system-type": s.type,
|
|
1871
1868
|
children: [
|
|
1872
1869
|
/* @__PURE__ */ n(
|
|
1873
|
-
|
|
1870
|
+
Ue,
|
|
1874
1871
|
{
|
|
1875
1872
|
size: 16,
|
|
1876
1873
|
weight: "regular",
|
|
@@ -1882,11 +1879,11 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1882
1879
|
]
|
|
1883
1880
|
}
|
|
1884
1881
|
),
|
|
1885
|
-
!t && /* @__PURE__ */ n(
|
|
1882
|
+
!t && /* @__PURE__ */ n(Le, { message: e.message })
|
|
1886
1883
|
] });
|
|
1887
1884
|
}
|
|
1888
1885
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1889
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1886
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || $a[s.type];
|
|
1890
1887
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1891
1888
|
/* @__PURE__ */ h(
|
|
1892
1889
|
"div",
|
|
@@ -1896,7 +1893,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1896
1893
|
"data-age-safety-system-type": s.type,
|
|
1897
1894
|
children: [
|
|
1898
1895
|
/* @__PURE__ */ n(
|
|
1899
|
-
|
|
1896
|
+
Ts,
|
|
1900
1897
|
{
|
|
1901
1898
|
size: 24,
|
|
1902
1899
|
weight: "duotone",
|
|
@@ -1905,11 +1902,11 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1905
1902
|
"data-testid": "age-safety-system-message-icon"
|
|
1906
1903
|
}
|
|
1907
1904
|
),
|
|
1908
|
-
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1905
|
+
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: ja(i) }) })
|
|
1909
1906
|
]
|
|
1910
1907
|
}
|
|
1911
1908
|
),
|
|
1912
|
-
!t && /* @__PURE__ */ n(
|
|
1909
|
+
!t && /* @__PURE__ */ n(Le, { message: e.message })
|
|
1913
1910
|
] });
|
|
1914
1911
|
}
|
|
1915
1912
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1918,9 +1915,9 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1918
1915
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
1919
1916
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
1920
1917
|
] }),
|
|
1921
|
-
!t && /* @__PURE__ */ n(
|
|
1918
|
+
!t && /* @__PURE__ */ n(Le, { message: e.message })
|
|
1922
1919
|
] });
|
|
1923
|
-
},
|
|
1920
|
+
}, cn = Ge(!1), ze = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1924
1921
|
"animateTransform",
|
|
1925
1922
|
{
|
|
1926
1923
|
attributeName: "transform",
|
|
@@ -1931,20 +1928,20 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1931
1928
|
repeatCount: "indefinite"
|
|
1932
1929
|
}
|
|
1933
1930
|
) }), Ga = /* @__PURE__ */ new Set([
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1931
|
+
De.Thinking,
|
|
1932
|
+
De.Generating,
|
|
1933
|
+
De.ExternalSources
|
|
1937
1934
|
]), Ha = ({ threadList: e }) => {
|
|
1938
|
-
var
|
|
1939
|
-
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } =
|
|
1935
|
+
var g, v;
|
|
1936
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Ye(), { typing: i = {} } = ss(), { aiState: o } = as(t), l = Te(cn);
|
|
1940
1937
|
if (!e && l && Ga.has(o)) {
|
|
1941
|
-
const
|
|
1938
|
+
const p = Ya(t, (g = r.user) == null ? void 0 : g.id);
|
|
1942
1939
|
return /* @__PURE__ */ n(
|
|
1943
|
-
|
|
1940
|
+
Ft,
|
|
1944
1941
|
{
|
|
1945
|
-
avatarId: (
|
|
1946
|
-
avatarName: (
|
|
1947
|
-
avatarImage:
|
|
1942
|
+
avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
|
|
1943
|
+
avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
|
|
1944
|
+
avatarImage: p == null ? void 0 : p.image,
|
|
1948
1945
|
testId: "typing-indicator-ai"
|
|
1949
1946
|
}
|
|
1950
1947
|
);
|
|
@@ -1952,21 +1949,21 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1952
1949
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1953
1950
|
return null;
|
|
1954
1951
|
const m = e ? [] : Object.values(i).filter(
|
|
1955
|
-
({ parent_id:
|
|
1956
|
-
var
|
|
1957
|
-
return (
|
|
1952
|
+
({ parent_id: p, user: N }) => {
|
|
1953
|
+
var x;
|
|
1954
|
+
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && !p;
|
|
1958
1955
|
}
|
|
1959
|
-
),
|
|
1960
|
-
({ parent_id:
|
|
1961
|
-
var
|
|
1962
|
-
return (
|
|
1956
|
+
), b = e ? Object.values(i).filter(
|
|
1957
|
+
({ parent_id: p, user: N }) => {
|
|
1958
|
+
var x;
|
|
1959
|
+
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && p === (a == null ? void 0 : a.id);
|
|
1963
1960
|
}
|
|
1964
|
-
) : [], u = e ?
|
|
1961
|
+
) : [], u = e ? b : m;
|
|
1965
1962
|
if (!u.length)
|
|
1966
1963
|
return null;
|
|
1967
|
-
const f = (
|
|
1964
|
+
const f = (v = u[0]) == null ? void 0 : v.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1968
1965
|
return /* @__PURE__ */ n(
|
|
1969
|
-
|
|
1966
|
+
Ft,
|
|
1970
1967
|
{
|
|
1971
1968
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1972
1969
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1974,7 +1971,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1974
1971
|
testId: "typing-indicator"
|
|
1975
1972
|
}
|
|
1976
1973
|
);
|
|
1977
|
-
},
|
|
1974
|
+
}, Ft = ({
|
|
1978
1975
|
avatarId: e,
|
|
1979
1976
|
avatarName: t,
|
|
1980
1977
|
avatarImage: s,
|
|
@@ -2006,9 +2003,9 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2006
2003
|
height: "8",
|
|
2007
2004
|
overflow: "visible",
|
|
2008
2005
|
children: [
|
|
2009
|
-
/* @__PURE__ */ n(
|
|
2010
|
-
/* @__PURE__ */ n(
|
|
2011
|
-
/* @__PURE__ */ n(
|
|
2006
|
+
/* @__PURE__ */ n(ze, { cx: "4", index: 0 }),
|
|
2007
|
+
/* @__PURE__ */ n(ze, { cx: "16", index: 1 }),
|
|
2008
|
+
/* @__PURE__ */ n(ze, { cx: "28", index: 2 })
|
|
2012
2009
|
]
|
|
2013
2010
|
}
|
|
2014
2011
|
) })
|
|
@@ -2067,36 +2064,44 @@ const qa = () => null, Wa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2067
2064
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2068
2065
|
]
|
|
2069
2066
|
}
|
|
2070
|
-
), Ee =
|
|
2067
|
+
), Ee = z.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2071
2068
|
/* @__PURE__ */ n(Wa, { className: "w-6 h-6" }),
|
|
2072
2069
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2073
2070
|
] }) }));
|
|
2074
2071
|
Ee.displayName = "LoadingState";
|
|
2075
|
-
const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
2072
|
+
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", Xa = ({
|
|
2076
2073
|
onBack: e,
|
|
2077
2074
|
showBackButton: t,
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2075
|
+
showStarButton: s = !1,
|
|
2076
|
+
dmAgentEnabled: a = !1,
|
|
2077
|
+
onLeaveConversation: r,
|
|
2078
|
+
onBlockParticipant: i,
|
|
2079
|
+
showDeleteConversation: o = !0,
|
|
2080
|
+
showBlockParticipant: l = !0,
|
|
2081
|
+
showReportParticipant: d = !0,
|
|
2082
|
+
onDeleteConversationClick: m,
|
|
2083
|
+
onBlockParticipantClick: b,
|
|
2084
|
+
onReportParticipantClick: u,
|
|
2085
|
+
customChannelActions: f,
|
|
2086
|
+
showActionsMenu: c = !0
|
|
2082
2087
|
}) => {
|
|
2083
|
-
var
|
|
2084
|
-
const { channel:
|
|
2085
|
-
var
|
|
2086
|
-
const
|
|
2087
|
-
return
|
|
2088
|
-
(
|
|
2089
|
-
var
|
|
2090
|
-
return ((
|
|
2088
|
+
var S, R, O, E, A;
|
|
2089
|
+
const { channel: g } = ce(), v = z.useMemo(() => {
|
|
2090
|
+
var I, L;
|
|
2091
|
+
const y = (I = g._client) == null ? void 0 : I.userID;
|
|
2092
|
+
return y ? Object.values(((L = g.state) == null ? void 0 : L.members) || {}).find(
|
|
2093
|
+
(M) => {
|
|
2094
|
+
var j;
|
|
2095
|
+
return ((j = M.user) == null ? void 0 : j.id) && M.user.id !== y;
|
|
2091
2096
|
}
|
|
2092
2097
|
) : void 0;
|
|
2093
|
-
}, [(
|
|
2098
|
+
}, [(S = g._client) == null ? void 0 : S.userID, (R = g.state) == null ? void 0 : R.members]), p = Wt(v == null ? void 0 : v.user), N = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, x = qt(g), T = async () => {
|
|
2094
2099
|
try {
|
|
2095
|
-
|
|
2096
|
-
} catch (
|
|
2100
|
+
x ? await g.unpin() : await g.pin();
|
|
2101
|
+
} catch (y) {
|
|
2097
2102
|
console.error(
|
|
2098
2103
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2099
|
-
|
|
2104
|
+
y
|
|
2100
2105
|
);
|
|
2101
2106
|
}
|
|
2102
2107
|
};
|
|
@@ -2113,55 +2118,62 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2113
2118
|
}),
|
|
2114
2119
|
type: "button",
|
|
2115
2120
|
"aria-label": "Back to conversations",
|
|
2116
|
-
children: /* @__PURE__ */ n(
|
|
2121
|
+
children: /* @__PURE__ */ n(Mt, { className: "size-5 text-black/90" })
|
|
2117
2122
|
}
|
|
2118
2123
|
) }),
|
|
2119
2124
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2120
2125
|
/* @__PURE__ */ n(
|
|
2121
2126
|
ae,
|
|
2122
2127
|
{
|
|
2123
|
-
id: ((
|
|
2124
|
-
name:
|
|
2125
|
-
image:
|
|
2126
|
-
starred:
|
|
2127
|
-
dmAgentEnabled:
|
|
2128
|
+
id: ((E = v == null ? void 0 : v.user) == null ? void 0 : E.id) || g.id || "unknown",
|
|
2129
|
+
name: p,
|
|
2130
|
+
image: N,
|
|
2131
|
+
starred: s && x,
|
|
2132
|
+
dmAgentEnabled: a,
|
|
2128
2133
|
size: 48
|
|
2129
2134
|
}
|
|
2130
2135
|
),
|
|
2131
|
-
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children:
|
|
2132
|
-
|
|
2133
|
-
/* @__PURE__ */ n(
|
|
2134
|
-
/* @__PURE__ */ n("span", { children:
|
|
2136
|
+
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: p }),
|
|
2137
|
+
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2138
|
+
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2139
|
+
/* @__PURE__ */ n("span", { children: Bt })
|
|
2135
2140
|
] })
|
|
2136
2141
|
] }),
|
|
2137
2142
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
2138
|
-
|
|
2143
|
+
s && /* @__PURE__ */ n(
|
|
2139
2144
|
"button",
|
|
2140
2145
|
{
|
|
2141
2146
|
className: oe,
|
|
2142
|
-
onClick:
|
|
2147
|
+
onClick: T,
|
|
2143
2148
|
type: "button",
|
|
2144
|
-
"aria-label":
|
|
2149
|
+
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
2145
2150
|
children: /* @__PURE__ */ n(
|
|
2146
|
-
|
|
2151
|
+
Fe,
|
|
2147
2152
|
{
|
|
2148
2153
|
className: C("size-5", {
|
|
2149
|
-
"text-yellow-600":
|
|
2150
|
-
"text-black/90": !
|
|
2154
|
+
"text-yellow-600": x,
|
|
2155
|
+
"text-black/90": !x
|
|
2151
2156
|
}),
|
|
2152
|
-
weight:
|
|
2157
|
+
weight: x ? "duotone" : "regular"
|
|
2153
2158
|
}
|
|
2154
2159
|
)
|
|
2155
2160
|
}
|
|
2156
2161
|
),
|
|
2157
|
-
/* @__PURE__ */ n(
|
|
2158
|
-
|
|
2162
|
+
c && /* @__PURE__ */ n(
|
|
2163
|
+
Pt,
|
|
2159
2164
|
{
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
+
channel: g,
|
|
2166
|
+
participant: v,
|
|
2167
|
+
showDeleteConversation: o,
|
|
2168
|
+
showBlockParticipant: l,
|
|
2169
|
+
showReportParticipant: d,
|
|
2170
|
+
onLeaveConversation: r,
|
|
2171
|
+
onBlockParticipant: i,
|
|
2172
|
+
onDeleteConversationClick: m,
|
|
2173
|
+
onBlockParticipantClick: b,
|
|
2174
|
+
onReportParticipantClick: u,
|
|
2175
|
+
customChannelActions: f,
|
|
2176
|
+
triggerClassName: C(oe, "bg-[#F1F0EE]")
|
|
2165
2177
|
}
|
|
2166
2178
|
)
|
|
2167
2179
|
] })
|
|
@@ -2178,65 +2190,63 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2178
2190
|
type: "button",
|
|
2179
2191
|
onClick: e,
|
|
2180
2192
|
"aria-label": "Back to conversations",
|
|
2181
|
-
children: /* @__PURE__ */ n(
|
|
2193
|
+
children: /* @__PURE__ */ n(Mt, { className: "size-5 text-black/90" })
|
|
2182
2194
|
}
|
|
2183
2195
|
),
|
|
2184
2196
|
/* @__PURE__ */ n(
|
|
2185
2197
|
ae,
|
|
2186
2198
|
{
|
|
2187
|
-
id: ((
|
|
2188
|
-
name:
|
|
2189
|
-
image:
|
|
2190
|
-
starred:
|
|
2191
|
-
dmAgentEnabled:
|
|
2199
|
+
id: ((A = v == null ? void 0 : v.user) == null ? void 0 : A.id) || g.id || "unknown",
|
|
2200
|
+
name: p,
|
|
2201
|
+
image: N,
|
|
2202
|
+
starred: s && x,
|
|
2203
|
+
dmAgentEnabled: a,
|
|
2192
2204
|
size: 48
|
|
2193
2205
|
}
|
|
2194
2206
|
),
|
|
2195
2207
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
{
|
|
2199
|
-
|
|
2200
|
-
onClick: s,
|
|
2201
|
-
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
2202
|
-
"aria-label": `View info for ${d}`,
|
|
2203
|
-
children: /* @__PURE__ */ n("span", { className: "truncate", children: d })
|
|
2204
|
-
}
|
|
2205
|
-
) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: d }),
|
|
2206
|
-
i && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2207
|
-
/* @__PURE__ */ n(Ve, { className: "size-3 shrink-0 text-black/55" }),
|
|
2208
|
-
/* @__PURE__ */ n("span", { className: "truncate", children: Vt })
|
|
2208
|
+
/* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: p }),
|
|
2209
|
+
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2210
|
+
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2211
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Bt })
|
|
2209
2212
|
] })
|
|
2210
2213
|
] })
|
|
2211
2214
|
] }),
|
|
2212
2215
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
2213
|
-
|
|
2216
|
+
s && /* @__PURE__ */ n(
|
|
2214
2217
|
"button",
|
|
2215
2218
|
{
|
|
2216
2219
|
className: oe,
|
|
2217
|
-
onClick:
|
|
2220
|
+
onClick: T,
|
|
2218
2221
|
type: "button",
|
|
2219
|
-
"aria-label":
|
|
2222
|
+
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
2220
2223
|
children: /* @__PURE__ */ n(
|
|
2221
|
-
|
|
2224
|
+
Fe,
|
|
2222
2225
|
{
|
|
2223
2226
|
className: C("size-6", {
|
|
2224
|
-
"text-yellow-600":
|
|
2225
|
-
"text-black/90": !
|
|
2227
|
+
"text-yellow-600": x,
|
|
2228
|
+
"text-black/90": !x
|
|
2226
2229
|
}),
|
|
2227
|
-
weight:
|
|
2230
|
+
weight: x ? "duotone" : "regular"
|
|
2228
2231
|
}
|
|
2229
2232
|
)
|
|
2230
2233
|
}
|
|
2231
2234
|
),
|
|
2232
|
-
|
|
2233
|
-
|
|
2235
|
+
c && /* @__PURE__ */ n(
|
|
2236
|
+
Pt,
|
|
2234
2237
|
{
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2238
|
+
channel: g,
|
|
2239
|
+
participant: v,
|
|
2240
|
+
showDeleteConversation: o,
|
|
2241
|
+
showBlockParticipant: l,
|
|
2242
|
+
showReportParticipant: d,
|
|
2243
|
+
onLeaveConversation: r,
|
|
2244
|
+
onBlockParticipant: i,
|
|
2245
|
+
onDeleteConversationClick: m,
|
|
2246
|
+
onBlockParticipantClick: b,
|
|
2247
|
+
onReportParticipantClick: u,
|
|
2248
|
+
customChannelActions: f,
|
|
2249
|
+
triggerClassName: oe
|
|
2240
2250
|
}
|
|
2241
2251
|
)
|
|
2242
2252
|
] })
|
|
@@ -2253,135 +2263,104 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2253
2263
|
showDeleteConversation: l = !0,
|
|
2254
2264
|
onDeleteConversationClick: d,
|
|
2255
2265
|
onBlockParticipantClick: m,
|
|
2256
|
-
onReportParticipantClick:
|
|
2266
|
+
onReportParticipantClick: b,
|
|
2257
2267
|
showBlockParticipant: u = !0,
|
|
2258
2268
|
showReportParticipant: f = !0,
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
composerDisabledReason: N,
|
|
2269
|
+
composerDisabled: c = !1,
|
|
2270
|
+
composerDisabledReason: g,
|
|
2262
2271
|
showStarButton: v = !1,
|
|
2263
|
-
chatbotVotingEnabled:
|
|
2264
|
-
renderChannelBanner:
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2272
|
+
chatbotVotingEnabled: p = !1,
|
|
2273
|
+
renderChannelBanner: N,
|
|
2274
|
+
customChannelActions: x,
|
|
2275
|
+
renderMessage: T,
|
|
2276
|
+
dmAgentEnabled: S = !1,
|
|
2277
|
+
viewerLanguage: R,
|
|
2278
|
+
showChannelInfo: O = !0
|
|
2270
2279
|
}) => {
|
|
2271
|
-
var
|
|
2272
|
-
const { channel:
|
|
2273
|
-
var
|
|
2274
|
-
const
|
|
2275
|
-
return
|
|
2276
|
-
(
|
|
2277
|
-
var
|
|
2278
|
-
return ((
|
|
2280
|
+
var j, V, G, $, F, X;
|
|
2281
|
+
const { channel: E } = ce(), A = z.useMemo(() => {
|
|
2282
|
+
var w, k;
|
|
2283
|
+
const U = (w = E._client) == null ? void 0 : w.userID;
|
|
2284
|
+
return U ? Object.values(((k = E.state) == null ? void 0 : k.members) || {}).find(
|
|
2285
|
+
(B) => {
|
|
2286
|
+
var q;
|
|
2287
|
+
return ((q = B.user) == null ? void 0 : q.id) && B.user.id !== U;
|
|
2279
2288
|
}
|
|
2280
2289
|
) : void 0;
|
|
2281
|
-
}, [(
|
|
2282
|
-
var
|
|
2283
|
-
const
|
|
2284
|
-
return
|
|
2285
|
-
var
|
|
2286
|
-
return ((
|
|
2290
|
+
}, [(j = E._client) == null ? void 0 : j.userID, (V = E.state) == null ? void 0 : V.members]), y = z.useMemo(() => {
|
|
2291
|
+
var w, k;
|
|
2292
|
+
const U = (w = E._client) == null ? void 0 : w.userID;
|
|
2293
|
+
return U ? Object.values(((k = E.state) == null ? void 0 : k.members) || {}).find((B) => {
|
|
2294
|
+
var q;
|
|
2295
|
+
return ((q = B.user) == null ? void 0 : q.id) === U;
|
|
2287
2296
|
}) : void 0;
|
|
2288
|
-
}, [(
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
if (D.followerStatus)
|
|
2292
|
-
return String(D.followerStatus);
|
|
2293
|
-
if (D.isFollower !== void 0)
|
|
2294
|
-
return D.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2295
|
-
}, [_.data, c]), G = q(() => {
|
|
2296
|
-
var D;
|
|
2297
|
-
(D = k.current) == null || D.showModal();
|
|
2298
|
-
}, []), O = q(() => {
|
|
2299
|
-
var D;
|
|
2300
|
-
(D = k.current) == null || D.close();
|
|
2301
|
-
}, []), B = q(
|
|
2302
|
-
(D) => {
|
|
2303
|
-
const { message: W } = be("ChannelView"), j = /* @__PURE__ */ n(
|
|
2297
|
+
}, [(G = E._client) == null ? void 0 : G.userID, ($ = E.state) == null ? void 0 : $.members]), _ = ((F = y == null ? void 0 : y.user) == null ? void 0 : F.is_account) ?? (y == null ? void 0 : y.is_account), I = ((X = A == null ? void 0 : A.user) == null ? void 0 : X.is_account) ?? (A == null ? void 0 : A.is_account), L = S && _ === !1 && I === !0, M = W(
|
|
2298
|
+
(U) => {
|
|
2299
|
+
const { message: P } = pe("ChannelView"), w = /* @__PURE__ */ n(
|
|
2304
2300
|
ka,
|
|
2305
2301
|
{
|
|
2306
|
-
...
|
|
2307
|
-
chatbotVotingEnabled:
|
|
2308
|
-
viewerLanguage:
|
|
2302
|
+
...U,
|
|
2303
|
+
chatbotVotingEnabled: p,
|
|
2304
|
+
viewerLanguage: R
|
|
2309
2305
|
}
|
|
2310
2306
|
);
|
|
2311
|
-
return !
|
|
2307
|
+
return !T || !P ? w : T(w, P);
|
|
2312
2308
|
},
|
|
2313
|
-
[
|
|
2309
|
+
[p, T, R]
|
|
2314
2310
|
);
|
|
2315
|
-
return /* @__PURE__ */
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
{
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
{
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
},
|
|
2351
|
-
renderFooter: () => a == null ? void 0 : a(_),
|
|
2352
|
-
disabled: p,
|
|
2353
|
-
disabledReason: N
|
|
2354
|
-
},
|
|
2355
|
-
"lt-channel-message-input"
|
|
2356
|
-
)
|
|
2357
|
-
] })
|
|
2358
|
-
}
|
|
2359
|
-
),
|
|
2360
|
-
/* @__PURE__ */ n(
|
|
2361
|
-
Bs,
|
|
2362
|
-
{
|
|
2363
|
-
dialogRef: k,
|
|
2364
|
-
onClose: O,
|
|
2365
|
-
participant: I,
|
|
2366
|
-
participantDisplayName: Ae(
|
|
2367
|
-
I == null ? void 0 : I.user
|
|
2311
|
+
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
2312
|
+
is,
|
|
2313
|
+
{
|
|
2314
|
+
overrides: {
|
|
2315
|
+
Message: M,
|
|
2316
|
+
MessageActions: Ia
|
|
2317
|
+
},
|
|
2318
|
+
children: /* @__PURE__ */ h(os, { children: [
|
|
2319
|
+
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2320
|
+
Xa,
|
|
2321
|
+
{
|
|
2322
|
+
onBack: e,
|
|
2323
|
+
showBackButton: t,
|
|
2324
|
+
showActionsMenu: O,
|
|
2325
|
+
showStarButton: v,
|
|
2326
|
+
dmAgentEnabled: L,
|
|
2327
|
+
onLeaveConversation: i,
|
|
2328
|
+
onBlockParticipant: o,
|
|
2329
|
+
showDeleteConversation: l,
|
|
2330
|
+
showBlockParticipant: u,
|
|
2331
|
+
showReportParticipant: f,
|
|
2332
|
+
onDeleteConversationClick: d,
|
|
2333
|
+
onBlockParticipantClick: m,
|
|
2334
|
+
onReportParticipantClick: b,
|
|
2335
|
+
customChannelActions: x
|
|
2336
|
+
}
|
|
2337
|
+
) }, "lt-channel-header"),
|
|
2338
|
+
N ? /* @__PURE__ */ n(z.Fragment, { children: N() }, "lt-channel-banner") : null,
|
|
2339
|
+
/* @__PURE__ */ n(
|
|
2340
|
+
"div",
|
|
2341
|
+
{
|
|
2342
|
+
className: "flex-1 overflow-hidden relative",
|
|
2343
|
+
children: /* @__PURE__ */ n(ls, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2344
|
+
},
|
|
2345
|
+
"lt-channel-message-list"
|
|
2368
2346
|
),
|
|
2369
|
-
channel:
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
}
|
|
2347
|
+
r ? /* @__PURE__ */ n(z.Fragment, { children: r(E) }, "lt-channel-conversation-footer") : null,
|
|
2348
|
+
/* @__PURE__ */ n(
|
|
2349
|
+
Da,
|
|
2350
|
+
{
|
|
2351
|
+
...s && {
|
|
2352
|
+
renderActions: () => s == null ? void 0 : s(E)
|
|
2353
|
+
},
|
|
2354
|
+
renderFooter: () => a == null ? void 0 : a(E),
|
|
2355
|
+
disabled: c,
|
|
2356
|
+
disabledReason: g
|
|
2357
|
+
},
|
|
2358
|
+
"lt-channel-message-input"
|
|
2359
|
+
)
|
|
2360
|
+
] })
|
|
2361
|
+
}
|
|
2362
|
+
) });
|
|
2363
|
+
}, dn = z.memo(
|
|
2385
2364
|
({
|
|
2386
2365
|
channel: e,
|
|
2387
2366
|
onBack: t,
|
|
@@ -2393,80 +2372,79 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2393
2372
|
onBlockParticipant: l,
|
|
2394
2373
|
className: d,
|
|
2395
2374
|
CustomChannelEmptyState: m = qa,
|
|
2396
|
-
showDeleteConversation:
|
|
2375
|
+
showDeleteConversation: b = !0,
|
|
2397
2376
|
onDeleteConversationClick: u,
|
|
2398
2377
|
onBlockParticipantClick: f,
|
|
2399
2378
|
onReportParticipantClick: c,
|
|
2400
|
-
showBlockParticipant:
|
|
2401
|
-
showReportParticipant:
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
messageMetadata: A,
|
|
2379
|
+
showBlockParticipant: g = !0,
|
|
2380
|
+
showReportParticipant: v = !0,
|
|
2381
|
+
composerDisabled: p = !1,
|
|
2382
|
+
composerDisabledReason: N,
|
|
2383
|
+
dmAgentEnabled: x,
|
|
2384
|
+
messageMetadata: T,
|
|
2407
2385
|
onMessageSent: S,
|
|
2408
|
-
showStarButton:
|
|
2409
|
-
chatbotVotingEnabled:
|
|
2410
|
-
renderChannelBanner:
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2386
|
+
showStarButton: R = !1,
|
|
2387
|
+
chatbotVotingEnabled: O = !1,
|
|
2388
|
+
renderChannelBanner: E,
|
|
2389
|
+
customChannelActions: A,
|
|
2390
|
+
renderMessage: y,
|
|
2391
|
+
onMessageLinkClick: _,
|
|
2392
|
+
sendButton: I,
|
|
2393
|
+
attachmentPreviewList: L,
|
|
2394
|
+
viewerLanguage: M,
|
|
2395
|
+
showChannelInfo: j = !0
|
|
2418
2396
|
}) => {
|
|
2419
|
-
const
|
|
2420
|
-
async (
|
|
2421
|
-
var
|
|
2422
|
-
const
|
|
2423
|
-
...
|
|
2424
|
-
...
|
|
2425
|
-
...
|
|
2397
|
+
const V = W(
|
|
2398
|
+
async ($, F, X) => {
|
|
2399
|
+
var q;
|
|
2400
|
+
const U = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, P = x && !U, w = {
|
|
2401
|
+
...F,
|
|
2402
|
+
...P && { silent: !0 },
|
|
2403
|
+
...T && {
|
|
2426
2404
|
metadata: {
|
|
2427
|
-
...
|
|
2428
|
-
...
|
|
2405
|
+
...F.metadata ?? {},
|
|
2406
|
+
...T
|
|
2429
2407
|
}
|
|
2430
2408
|
}
|
|
2431
|
-
},
|
|
2432
|
-
...
|
|
2433
|
-
...
|
|
2434
|
-
},
|
|
2435
|
-
return S == null || S(
|
|
2409
|
+
}, k = {
|
|
2410
|
+
...X,
|
|
2411
|
+
...P && { skip_push: !0 }
|
|
2412
|
+
}, B = await e.sendMessage(w, k);
|
|
2413
|
+
return S == null || S(B), B;
|
|
2436
2414
|
},
|
|
2437
|
-
[e,
|
|
2438
|
-
),
|
|
2439
|
-
return
|
|
2440
|
-
if (!
|
|
2441
|
-
const
|
|
2442
|
-
if (
|
|
2443
|
-
const
|
|
2444
|
-
const
|
|
2445
|
-
if (!
|
|
2446
|
-
const
|
|
2447
|
-
|
|
2415
|
+
[e, x, T, S]
|
|
2416
|
+
), G = H(null);
|
|
2417
|
+
return Y(() => {
|
|
2418
|
+
if (!_) return;
|
|
2419
|
+
const $ = G.current;
|
|
2420
|
+
if (!$) return;
|
|
2421
|
+
const F = (X) => {
|
|
2422
|
+
const U = X.target, P = U == null ? void 0 : U.closest("a[href]"), w = P == null ? void 0 : P.getAttribute("href");
|
|
2423
|
+
if (!w) return;
|
|
2424
|
+
const k = P == null ? void 0 : P.closest("[data-message-id]"), B = k == null ? void 0 : k.getAttribute("data-message-id"), q = B ? e.state.messages.find((_e) => _e.id === B) : void 0;
|
|
2425
|
+
_(w, q);
|
|
2448
2426
|
};
|
|
2449
|
-
return
|
|
2450
|
-
}, [
|
|
2427
|
+
return $.addEventListener("click", F), () => $.removeEventListener("click", F);
|
|
2428
|
+
}, [_, e]), /* @__PURE__ */ n(
|
|
2451
2429
|
"div",
|
|
2452
2430
|
{
|
|
2453
|
-
ref:
|
|
2431
|
+
ref: G,
|
|
2454
2432
|
className: C(
|
|
2455
2433
|
"messaging-channel-view h-full flex flex-col",
|
|
2456
2434
|
d
|
|
2457
2435
|
),
|
|
2458
|
-
children: /* @__PURE__ */ n(
|
|
2436
|
+
children: /* @__PURE__ */ n(cn.Provider, { value: x ?? !1, children: /* @__PURE__ */ n(
|
|
2459
2437
|
rs,
|
|
2460
2438
|
{
|
|
2461
2439
|
channel: e,
|
|
2462
|
-
MessageSystem:
|
|
2440
|
+
MessageSystem: Va,
|
|
2463
2441
|
EmptyStateIndicator: m,
|
|
2464
2442
|
LoadingIndicator: Ee,
|
|
2465
|
-
DateSeparator:
|
|
2443
|
+
DateSeparator: Us,
|
|
2466
2444
|
TypingIndicator: Ha,
|
|
2467
|
-
doSendMessageRequest:
|
|
2468
|
-
...
|
|
2469
|
-
...
|
|
2445
|
+
doSendMessageRequest: V,
|
|
2446
|
+
...I ? { SendButton: I } : {},
|
|
2447
|
+
...L ? { AttachmentPreviewList: L } : {},
|
|
2470
2448
|
children: /* @__PURE__ */ n(
|
|
2471
2449
|
Ka,
|
|
2472
2450
|
{
|
|
@@ -2478,23 +2456,22 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2478
2456
|
onLeaveConversation: o,
|
|
2479
2457
|
onBlockParticipant: l,
|
|
2480
2458
|
CustomChannelEmptyState: m,
|
|
2481
|
-
showDeleteConversation:
|
|
2459
|
+
showDeleteConversation: b,
|
|
2482
2460
|
onDeleteConversationClick: u,
|
|
2483
2461
|
onBlockParticipantClick: f,
|
|
2484
2462
|
onReportParticipantClick: c,
|
|
2485
|
-
showBlockParticipant:
|
|
2486
|
-
showReportParticipant:
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
viewerLanguage: U
|
|
2463
|
+
showBlockParticipant: g,
|
|
2464
|
+
showReportParticipant: v,
|
|
2465
|
+
composerDisabled: p,
|
|
2466
|
+
composerDisabledReason: N,
|
|
2467
|
+
showStarButton: R,
|
|
2468
|
+
dmAgentEnabled: x,
|
|
2469
|
+
chatbotVotingEnabled: O,
|
|
2470
|
+
renderChannelBanner: E,
|
|
2471
|
+
customChannelActions: A,
|
|
2472
|
+
renderMessage: y,
|
|
2473
|
+
viewerLanguage: M,
|
|
2474
|
+
showChannelInfo: j
|
|
2498
2475
|
}
|
|
2499
2476
|
)
|
|
2500
2477
|
}
|
|
@@ -2503,8 +2480,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2503
2480
|
);
|
|
2504
2481
|
}
|
|
2505
2482
|
);
|
|
2506
|
-
|
|
2507
|
-
const
|
|
2483
|
+
dn.displayName = "ChannelView";
|
|
2484
|
+
const fe = z.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: [
|
|
2508
2485
|
/* @__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: "⚠️" }) }),
|
|
2509
2486
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2510
2487
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2518,7 +2495,7 @@ const he = R.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2518
2495
|
}
|
|
2519
2496
|
)
|
|
2520
2497
|
] }) }));
|
|
2521
|
-
|
|
2498
|
+
fe.displayName = "ErrorState";
|
|
2522
2499
|
const yi = ({
|
|
2523
2500
|
capabilities: e = {},
|
|
2524
2501
|
renderMessageInputActions: t,
|
|
@@ -2530,77 +2507,78 @@ const yi = ({
|
|
|
2530
2507
|
CustomChannelEmptyState: l,
|
|
2531
2508
|
onBlockParticipantClick: d,
|
|
2532
2509
|
onReportParticipantClick: m,
|
|
2533
|
-
dmAgentEnabled:
|
|
2510
|
+
dmAgentEnabled: b,
|
|
2534
2511
|
onMessageSent: u,
|
|
2535
2512
|
chatbotVotingEnabled: f = !1,
|
|
2536
2513
|
viewerLanguage: c,
|
|
2537
|
-
renderChannelBanner:
|
|
2538
|
-
customChannelActions:
|
|
2539
|
-
renderMessage:
|
|
2540
|
-
onMessageLinkClick:
|
|
2514
|
+
renderChannelBanner: g,
|
|
2515
|
+
customChannelActions: v,
|
|
2516
|
+
renderMessage: p,
|
|
2517
|
+
onMessageLinkClick: N,
|
|
2518
|
+
showChannelInfo: x
|
|
2541
2519
|
}) => {
|
|
2542
2520
|
const {
|
|
2543
|
-
client:
|
|
2544
|
-
isConnected:
|
|
2545
|
-
isLoading:
|
|
2546
|
-
error:
|
|
2547
|
-
refreshConnection:
|
|
2548
|
-
service:
|
|
2549
|
-
debug:
|
|
2550
|
-
} =
|
|
2551
|
-
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
}, [
|
|
2558
|
-
if (!
|
|
2559
|
-
const
|
|
2560
|
-
if (!
|
|
2561
|
-
const
|
|
2562
|
-
if (
|
|
2563
|
-
|
|
2564
|
-
const
|
|
2565
|
-
|
|
2521
|
+
client: T,
|
|
2522
|
+
isConnected: S,
|
|
2523
|
+
isLoading: R,
|
|
2524
|
+
error: O,
|
|
2525
|
+
refreshConnection: E,
|
|
2526
|
+
service: A,
|
|
2527
|
+
debug: y
|
|
2528
|
+
} = Ds(), [_, I] = D(null), [L, M] = D(null), [j, V] = D(!1), { showDeleteConversation: G = !0 } = e, $ = H(o);
|
|
2529
|
+
$.current = o;
|
|
2530
|
+
const F = H(a);
|
|
2531
|
+
F.current = a;
|
|
2532
|
+
const X = H(null), U = H(null);
|
|
2533
|
+
Y(() => {
|
|
2534
|
+
U.current = _;
|
|
2535
|
+
}, [_]), Y(() => {
|
|
2536
|
+
if (!T || !S) return;
|
|
2537
|
+
const k = T.userID;
|
|
2538
|
+
if (!k) return;
|
|
2539
|
+
const B = `${k}::${i}`;
|
|
2540
|
+
if (X.current === B) return;
|
|
2541
|
+
X.current = B;
|
|
2542
|
+
const q = () => {
|
|
2543
|
+
X.current === B && (X.current = null);
|
|
2566
2544
|
};
|
|
2567
2545
|
(async () => {
|
|
2568
|
-
var
|
|
2546
|
+
var K, re;
|
|
2569
2547
|
try {
|
|
2570
|
-
|
|
2548
|
+
y && console.log(
|
|
2571
2549
|
"[MessagingShell] Loading initial conversation with:",
|
|
2572
2550
|
i
|
|
2573
2551
|
);
|
|
2574
|
-
const
|
|
2552
|
+
const J = await T.queryChannels(
|
|
2575
2553
|
{
|
|
2576
2554
|
type: "messaging",
|
|
2577
|
-
members: { $eq: [
|
|
2555
|
+
members: { $eq: [k, i] }
|
|
2578
2556
|
},
|
|
2579
2557
|
{},
|
|
2580
2558
|
{ limit: 1 }
|
|
2581
2559
|
);
|
|
2582
|
-
if (
|
|
2583
|
-
I(
|
|
2560
|
+
if (J.length > 0) {
|
|
2561
|
+
I(J[0]), M(null), (K = F.current) == null || K.call(F, J[0]), y && console.log(
|
|
2584
2562
|
"[MessagingShell] Initial conversation loaded:",
|
|
2585
|
-
|
|
2563
|
+
J[0].id
|
|
2586
2564
|
);
|
|
2587
2565
|
return;
|
|
2588
2566
|
}
|
|
2589
|
-
const
|
|
2590
|
-
if (!
|
|
2591
|
-
|
|
2567
|
+
const se = $.current;
|
|
2568
|
+
if (!se || !A) {
|
|
2569
|
+
q(), M("No conversation found with this account"), y && console.log(
|
|
2592
2570
|
"[MessagingShell] No conversation found for:",
|
|
2593
2571
|
i
|
|
2594
2572
|
);
|
|
2595
2573
|
return;
|
|
2596
2574
|
}
|
|
2597
2575
|
try {
|
|
2598
|
-
const Q = await
|
|
2599
|
-
id:
|
|
2600
|
-
name:
|
|
2601
|
-
phone:
|
|
2576
|
+
const Q = await A.startChannelWithParticipant({
|
|
2577
|
+
id: se.id,
|
|
2578
|
+
name: se.name,
|
|
2579
|
+
phone: se.phone
|
|
2602
2580
|
});
|
|
2603
|
-
I(Q),
|
|
2581
|
+
I(Q), M(null), (re = F.current) == null || re.call(F, Q), y && console.log(
|
|
2604
2582
|
"[MessagingShell] Channel created and loaded:",
|
|
2605
2583
|
Q.id
|
|
2606
2584
|
);
|
|
@@ -2608,50 +2586,51 @@ const yi = ({
|
|
|
2608
2586
|
console.error(
|
|
2609
2587
|
"[MessagingShell] Failed to create conversation:",
|
|
2610
2588
|
Q
|
|
2611
|
-
),
|
|
2589
|
+
), q(), M("Failed to create conversation");
|
|
2612
2590
|
}
|
|
2613
|
-
} catch (
|
|
2591
|
+
} catch (J) {
|
|
2614
2592
|
console.error(
|
|
2615
2593
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2616
|
-
|
|
2617
|
-
),
|
|
2594
|
+
J
|
|
2595
|
+
), q(), U.current || M("Failed to load conversation");
|
|
2618
2596
|
}
|
|
2619
2597
|
})();
|
|
2620
|
-
}, [i,
|
|
2621
|
-
const
|
|
2622
|
-
|
|
2623
|
-
const
|
|
2624
|
-
var
|
|
2625
|
-
I(null),
|
|
2598
|
+
}, [i, T, S, A, y]);
|
|
2599
|
+
const P = H(r);
|
|
2600
|
+
P.current = r;
|
|
2601
|
+
const w = W(() => {
|
|
2602
|
+
var k;
|
|
2603
|
+
I(null), V(!0), (k = P.current) == null || k.call(P);
|
|
2626
2604
|
}, []);
|
|
2627
|
-
return
|
|
2628
|
-
|
|
2605
|
+
return R ? /* @__PURE__ */ n(Ee, {}) : O ? /* @__PURE__ */ n(fe, { message: O, onBack: E }) : !S || !T ? /* @__PURE__ */ n(
|
|
2606
|
+
fe,
|
|
2629
2607
|
{
|
|
2630
2608
|
message: "Not connected to messaging service",
|
|
2631
|
-
onBack:
|
|
2609
|
+
onBack: E
|
|
2632
2610
|
}
|
|
2633
|
-
) : L ? /* @__PURE__ */ n(
|
|
2634
|
-
|
|
2611
|
+
) : L ? /* @__PURE__ */ n(fe, { message: L }) : j && !_ ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : _ ? /* @__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(
|
|
2612
|
+
dn,
|
|
2635
2613
|
{
|
|
2636
|
-
channel:
|
|
2614
|
+
channel: _,
|
|
2637
2615
|
renderMessageInputActions: t,
|
|
2638
2616
|
renderConversationFooter: s,
|
|
2639
|
-
renderChannelBanner:
|
|
2640
|
-
onLeaveConversation:
|
|
2641
|
-
onBlockParticipant:
|
|
2617
|
+
renderChannelBanner: g,
|
|
2618
|
+
onLeaveConversation: w,
|
|
2619
|
+
onBlockParticipant: w,
|
|
2642
2620
|
CustomChannelEmptyState: l,
|
|
2643
|
-
showDeleteConversation:
|
|
2621
|
+
showDeleteConversation: G,
|
|
2644
2622
|
onBlockParticipantClick: d,
|
|
2645
2623
|
onReportParticipantClick: m,
|
|
2646
|
-
dmAgentEnabled:
|
|
2624
|
+
dmAgentEnabled: b,
|
|
2647
2625
|
onMessageSent: u,
|
|
2648
2626
|
chatbotVotingEnabled: f,
|
|
2649
2627
|
viewerLanguage: c,
|
|
2650
|
-
customChannelActions:
|
|
2651
|
-
renderMessage:
|
|
2652
|
-
onMessageLinkClick:
|
|
2628
|
+
customChannelActions: v,
|
|
2629
|
+
renderMessage: p,
|
|
2630
|
+
onMessageLinkClick: N,
|
|
2631
|
+
showChannelInfo: x
|
|
2653
2632
|
},
|
|
2654
|
-
|
|
2633
|
+
_.id
|
|
2655
2634
|
) }) }) : /* @__PURE__ */ n(Ee, {});
|
|
2656
2635
|
};
|
|
2657
2636
|
function Ja(e) {
|
|
@@ -2660,14 +2639,14 @@ function Ja(e) {
|
|
|
2660
2639
|
for (const s of t)
|
|
2661
2640
|
e.state.addMessageSorted(s.message);
|
|
2662
2641
|
}
|
|
2663
|
-
const
|
|
2642
|
+
const un = z.createContext({
|
|
2664
2643
|
selectedChannel: void 0,
|
|
2665
2644
|
onChannelSelect: () => {
|
|
2666
2645
|
},
|
|
2667
2646
|
debug: !1,
|
|
2668
2647
|
renderMessagePreview: void 0,
|
|
2669
2648
|
viewerLanguage: void 0
|
|
2670
|
-
}), Za =
|
|
2649
|
+
}), Za = un.Provider, Qa = () => z.useContext(un), er = (e, t) => {
|
|
2671
2650
|
const s = new Date(
|
|
2672
2651
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2673
2652
|
), r = new Date(
|
|
@@ -2688,9 +2667,9 @@ const mn = R.createContext({
|
|
|
2688
2667
|
day: "numeric",
|
|
2689
2668
|
year: "2-digit"
|
|
2690
2669
|
});
|
|
2691
|
-
},
|
|
2670
|
+
}, mn = z.memo(
|
|
2692
2671
|
({ channel: e, unread: t }) => {
|
|
2693
|
-
var
|
|
2672
|
+
var O, E, A;
|
|
2694
2673
|
const {
|
|
2695
2674
|
selectedChannel: s,
|
|
2696
2675
|
onChannelSelect: a,
|
|
@@ -2699,40 +2678,40 @@ const mn = R.createContext({
|
|
|
2699
2678
|
viewerLanguage: o
|
|
2700
2679
|
} = Qa(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2701
2680
|
e && a(e);
|
|
2702
|
-
}, m = (
|
|
2703
|
-
const
|
|
2704
|
-
!
|
|
2705
|
-
}, u = Object.values(((
|
|
2706
|
-
(
|
|
2707
|
-
var
|
|
2708
|
-
return ((
|
|
2681
|
+
}, m = (y) => {
|
|
2682
|
+
const _ = y.key === "Enter" || y.key === " ", I = y.repeat;
|
|
2683
|
+
!_ || I || (y.preventDefault(), d());
|
|
2684
|
+
}, u = Object.values(((O = e == null ? void 0 : e.state) == null ? void 0 : O.members) || {}).find(
|
|
2685
|
+
(y) => {
|
|
2686
|
+
var _, I;
|
|
2687
|
+
return ((_ = y.user) == null ? void 0 : _.id) && y.user.id !== ((I = e == null ? void 0 : e._client) == null ? void 0 : I.userID);
|
|
2709
2688
|
}
|
|
2710
|
-
), f =
|
|
2711
|
-
var
|
|
2712
|
-
const
|
|
2713
|
-
if (
|
|
2714
|
-
for (let
|
|
2715
|
-
if (
|
|
2689
|
+
), f = Wt(u == null ? void 0 : u.user), c = (E = u == null ? void 0 : u.user) == null ? void 0 : E.image, g = (() => {
|
|
2690
|
+
var _;
|
|
2691
|
+
const y = (_ = e == null ? void 0 : e.state) == null ? void 0 : _.messages;
|
|
2692
|
+
if (y != null && y.length) {
|
|
2693
|
+
for (let I = y.length - 1; I >= 0; I--)
|
|
2694
|
+
if (y[I].type !== "system") return y[I];
|
|
2716
2695
|
}
|
|
2717
|
-
})(),
|
|
2718
|
-
var
|
|
2719
|
-
const
|
|
2720
|
-
message:
|
|
2696
|
+
})(), p = (() => {
|
|
2697
|
+
var j, V, G, $;
|
|
2698
|
+
const y = Xt({
|
|
2699
|
+
message: g,
|
|
2721
2700
|
viewerLanguage: o
|
|
2722
2701
|
});
|
|
2723
|
-
if (((
|
|
2724
|
-
if (((
|
|
2725
|
-
if (((G =
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
return
|
|
2729
|
-
})(),
|
|
2702
|
+
if (((j = g == null ? void 0 : g.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_TIP") return y ? `💵 ${y}` : "💵 Sent a tip";
|
|
2703
|
+
if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_PAID") return y ? `💰 ${y}` : "💰 Sent a message";
|
|
2704
|
+
if (((G = g == null ? void 0 : g.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_ATTACHMENT") return y ? `📎 ${y}` : "📎 Sent an attachment";
|
|
2705
|
+
if (y) return y;
|
|
2706
|
+
const M = ($ = g == null ? void 0 : g.attachments) == null ? void 0 : $[0];
|
|
2707
|
+
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";
|
|
2708
|
+
})(), N = g != null && g.created_at ? tr(new Date(g.created_at)) : "", x = g ? ke(g) : !1, T = i ? i(g, p) : `${x ? "✨ " : ""}${p}`, S = qt(e), R = t ?? 0;
|
|
2730
2709
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2731
2710
|
channelId: e == null ? void 0 : e.id,
|
|
2732
2711
|
isSelected: l,
|
|
2733
2712
|
participantName: f,
|
|
2734
|
-
unreadCount:
|
|
2735
|
-
hasTimestamp: !!
|
|
2713
|
+
unreadCount: R,
|
|
2714
|
+
hasTimestamp: !!N
|
|
2736
2715
|
}), /* @__PURE__ */ n(
|
|
2737
2716
|
"div",
|
|
2738
2717
|
{
|
|
@@ -2751,11 +2730,11 @@ const mn = R.createContext({
|
|
|
2751
2730
|
/* @__PURE__ */ n(
|
|
2752
2731
|
ae,
|
|
2753
2732
|
{
|
|
2754
|
-
id: ((
|
|
2733
|
+
id: ((A = u == null ? void 0 : u.user) == null ? void 0 : A.id) || e.id || "unknown",
|
|
2755
2734
|
name: f,
|
|
2756
2735
|
image: c,
|
|
2757
2736
|
size: 48,
|
|
2758
|
-
starred:
|
|
2737
|
+
starred: S
|
|
2759
2738
|
}
|
|
2760
2739
|
),
|
|
2761
2740
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2767,16 +2746,16 @@ const mn = R.createContext({
|
|
|
2767
2746
|
"text-sm font-medium truncate text-[#191918]"
|
|
2768
2747
|
),
|
|
2769
2748
|
children: [
|
|
2770
|
-
|
|
2749
|
+
S && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2771
2750
|
f
|
|
2772
2751
|
]
|
|
2773
2752
|
}
|
|
2774
2753
|
),
|
|
2775
|
-
|
|
2754
|
+
N && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
|
|
2776
2755
|
] }),
|
|
2777
2756
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2778
2757
|
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: T }),
|
|
2779
|
-
|
|
2758
|
+
R > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: R > 99 ? "99+" : R })
|
|
2780
2759
|
] })
|
|
2781
2760
|
] })
|
|
2782
2761
|
] })
|
|
@@ -2784,14 +2763,8 @@ const mn = R.createContext({
|
|
|
2784
2763
|
);
|
|
2785
2764
|
}
|
|
2786
2765
|
);
|
|
2787
|
-
|
|
2788
|
-
const nr = { last_message_at: -1 },
|
|
2789
|
-
isInitialLoadSettled: !1,
|
|
2790
|
-
channels: [],
|
|
2791
|
-
rawChannels: [],
|
|
2792
|
-
hasChannels: !1,
|
|
2793
|
-
unreadCount: 0
|
|
2794
|
-
}, sr = R.memo(
|
|
2766
|
+
mn.displayName = "CustomChannelPreview";
|
|
2767
|
+
const nr = { last_message_at: -1 }, sr = z.memo(
|
|
2795
2768
|
({
|
|
2796
2769
|
onChannelSelect: e,
|
|
2797
2770
|
selectedChannel: t,
|
|
@@ -2802,92 +2775,58 @@ const nr = { last_message_at: -1 }, Ce = {
|
|
|
2802
2775
|
className: o,
|
|
2803
2776
|
customEmptyStateIndicator: l,
|
|
2804
2777
|
renderMessagePreview: d,
|
|
2805
|
-
viewerLanguage: m
|
|
2806
|
-
onStateChange: g
|
|
2778
|
+
viewerLanguage: m
|
|
2807
2779
|
}) => {
|
|
2808
|
-
const
|
|
2809
|
-
|
|
2810
|
-
const { debug:
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
), v = R.useRef(
|
|
2816
|
-
Ce
|
|
2817
|
-
), x = R.useRef(!1), w = R.useRef(0), T = R.useCallback(
|
|
2818
|
-
(M) => {
|
|
2819
|
-
const E = w.current;
|
|
2820
|
-
v.current = M, !x.current && (x.current = !0, queueMicrotask(() => {
|
|
2821
|
-
if (E !== w.current) {
|
|
2822
|
-
x.current = !1;
|
|
2823
|
-
return;
|
|
2824
|
-
}
|
|
2825
|
-
x.current = !1, p((_) => {
|
|
2826
|
-
const k = v.current;
|
|
2827
|
-
return _ === k ? _ : k;
|
|
2828
|
-
});
|
|
2829
|
-
}));
|
|
2830
|
-
},
|
|
2831
|
-
[]
|
|
2832
|
-
), A = R.useCallback(
|
|
2833
|
-
(M) => {
|
|
2834
|
-
for (const _ of M)
|
|
2835
|
-
Ja(_);
|
|
2836
|
-
const E = r ? r(M) : M;
|
|
2837
|
-
return T({
|
|
2838
|
-
isInitialLoadSettled: !0,
|
|
2839
|
-
channels: E,
|
|
2840
|
-
rawChannels: M,
|
|
2841
|
-
hasChannels: E.length > 0,
|
|
2842
|
-
unreadCount: E.filter((_) => _.countUnread() > 0).length
|
|
2843
|
-
}), E;
|
|
2780
|
+
const b = z.useRef(0);
|
|
2781
|
+
b.current++;
|
|
2782
|
+
const { debug: u = !1 } = qe(), f = z.useCallback(
|
|
2783
|
+
(g) => {
|
|
2784
|
+
for (const v of g)
|
|
2785
|
+
Ja(v);
|
|
2786
|
+
return r ? r(g) : g;
|
|
2844
2787
|
},
|
|
2845
|
-
[r
|
|
2788
|
+
[r]
|
|
2846
2789
|
);
|
|
2847
|
-
|
|
2848
|
-
renderCount:
|
|
2790
|
+
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
2791
|
+
renderCount: b.current,
|
|
2849
2792
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2850
2793
|
filters: s
|
|
2851
2794
|
});
|
|
2852
|
-
const
|
|
2795
|
+
const c = z.useMemo(
|
|
2853
2796
|
() => ({
|
|
2854
2797
|
selectedChannel: t,
|
|
2855
2798
|
onChannelSelect: e,
|
|
2856
|
-
debug:
|
|
2799
|
+
debug: u,
|
|
2857
2800
|
renderMessagePreview: d,
|
|
2858
2801
|
viewerLanguage: m
|
|
2859
2802
|
}),
|
|
2860
2803
|
[
|
|
2861
2804
|
t,
|
|
2862
2805
|
e,
|
|
2863
|
-
|
|
2806
|
+
u,
|
|
2864
2807
|
d,
|
|
2865
2808
|
m
|
|
2866
2809
|
]
|
|
2867
2810
|
);
|
|
2868
|
-
return
|
|
2869
|
-
w.current += 1, v.current = Ce, x.current = !1, p(Ce);
|
|
2870
|
-
}, [N]), R.useEffect(() => {
|
|
2871
|
-
g == null || g(c);
|
|
2872
|
-
}, [c, g]), /* @__PURE__ */ n(
|
|
2811
|
+
return /* @__PURE__ */ n(
|
|
2873
2812
|
"div",
|
|
2874
2813
|
{
|
|
2875
2814
|
className: C(
|
|
2876
2815
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2877
2816
|
o
|
|
2878
2817
|
),
|
|
2879
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Za, { value:
|
|
2818
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Za, { value: c, children: /* @__PURE__ */ n(
|
|
2880
2819
|
cs,
|
|
2881
2820
|
{
|
|
2882
2821
|
filters: s,
|
|
2883
2822
|
sort: i,
|
|
2884
2823
|
options: { limit: 30 },
|
|
2885
2824
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2886
|
-
channelRenderFilterFn:
|
|
2887
|
-
Preview:
|
|
2825
|
+
channelRenderFilterFn: f,
|
|
2826
|
+
Preview: mn,
|
|
2888
2827
|
EmptyStateIndicator: l
|
|
2889
2828
|
},
|
|
2890
|
-
|
|
2829
|
+
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
2891
2830
|
) }) })
|
|
2892
2831
|
}
|
|
2893
2832
|
);
|
|
@@ -2895,7 +2834,7 @@ const nr = { last_message_at: -1 }, Ce = {
|
|
|
2895
2834
|
);
|
|
2896
2835
|
sr.displayName = "ChannelList";
|
|
2897
2836
|
const ar = /^([a-z][a-z0-9+.-]*):/i, rr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2898
|
-
function
|
|
2837
|
+
function Qe(e) {
|
|
2899
2838
|
if (typeof e != "string") return;
|
|
2900
2839
|
const t = e.trim();
|
|
2901
2840
|
if (t === "") return;
|
|
@@ -2913,7 +2852,7 @@ const ir = {
|
|
|
2913
2852
|
const s = C(
|
|
2914
2853
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2915
2854
|
ir[e]
|
|
2916
|
-
), a =
|
|
2855
|
+
), a = Qe(t.href);
|
|
2917
2856
|
return a ? /* @__PURE__ */ n(
|
|
2918
2857
|
"a",
|
|
2919
2858
|
{
|
|
@@ -2945,7 +2884,7 @@ const ir = {
|
|
|
2945
2884
|
}, cr = "text-white/30", dr = {
|
|
2946
2885
|
dark: "text-white/55",
|
|
2947
2886
|
light: "text-black/55"
|
|
2948
|
-
},
|
|
2887
|
+
}, et = ({
|
|
2949
2888
|
variant: e,
|
|
2950
2889
|
title: t,
|
|
2951
2890
|
placeholderTitle: s,
|
|
@@ -2955,12 +2894,12 @@ const ir = {
|
|
|
2955
2894
|
cta: o,
|
|
2956
2895
|
trailingAction: l
|
|
2957
2896
|
}) => {
|
|
2958
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "",
|
|
2959
|
-
if (!
|
|
2960
|
-
const
|
|
2897
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", b = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", g = o != null;
|
|
2898
|
+
if (!b && !u && !c && !g) return null;
|
|
2899
|
+
const p = C(
|
|
2961
2900
|
"truncate text-base font-medium leading-6",
|
|
2962
2901
|
d && !t ? cr : lr[e]
|
|
2963
|
-
),
|
|
2902
|
+
), N = C(
|
|
2964
2903
|
"truncate text-xs leading-4",
|
|
2965
2904
|
dr[e]
|
|
2966
2905
|
);
|
|
@@ -2968,13 +2907,13 @@ const ir = {
|
|
|
2968
2907
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
2969
2908
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2970
2909
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2971
|
-
|
|
2910
|
+
b && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2972
2911
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2973
|
-
/* @__PURE__ */ n("p", { className: C("min-w-0",
|
|
2912
|
+
/* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
|
|
2974
2913
|
] }),
|
|
2975
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2914
|
+
u && /* @__PURE__ */ n("p", { className: N, children: a })
|
|
2976
2915
|
] }),
|
|
2977
|
-
!
|
|
2916
|
+
!g && c && /* @__PURE__ */ n("p", { className: N, children: f })
|
|
2978
2917
|
] }),
|
|
2979
2918
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2980
2919
|
] }),
|
|
@@ -2987,7 +2926,7 @@ const ir = {
|
|
|
2987
2926
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2988
2927
|
"border border-black/[0.08]",
|
|
2989
2928
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2990
|
-
),
|
|
2929
|
+
), Se = ({
|
|
2991
2930
|
variant: e,
|
|
2992
2931
|
children: t,
|
|
2993
2932
|
href: s,
|
|
@@ -2998,7 +2937,7 @@ const ir = {
|
|
|
2998
2937
|
bgClassName: l,
|
|
2999
2938
|
"data-testid": d
|
|
3000
2939
|
}) => {
|
|
3001
|
-
const m = s != null || a != null,
|
|
2940
|
+
const m = s != null || a != null, b = C(
|
|
3002
2941
|
ur,
|
|
3003
2942
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3004
2943
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -3015,7 +2954,7 @@ const ir = {
|
|
|
3015
2954
|
rel: "noopener noreferrer",
|
|
3016
2955
|
onClick: a,
|
|
3017
2956
|
"data-testid": d,
|
|
3018
|
-
className:
|
|
2957
|
+
className: b,
|
|
3019
2958
|
children: [
|
|
3020
2959
|
t,
|
|
3021
2960
|
u
|
|
@@ -3029,7 +2968,7 @@ const ir = {
|
|
|
3029
2968
|
onClick: a,
|
|
3030
2969
|
"aria-label": r,
|
|
3031
2970
|
"data-testid": d,
|
|
3032
|
-
className: C(
|
|
2971
|
+
className: C(b, "text-left"),
|
|
3033
2972
|
children: [
|
|
3034
2973
|
t,
|
|
3035
2974
|
u
|
|
@@ -3040,7 +2979,7 @@ const ir = {
|
|
|
3040
2979
|
{
|
|
3041
2980
|
ref: i,
|
|
3042
2981
|
"data-testid": d,
|
|
3043
|
-
className:
|
|
2982
|
+
className: b,
|
|
3044
2983
|
children: [
|
|
3045
2984
|
t,
|
|
3046
2985
|
u
|
|
@@ -3053,11 +2992,11 @@ const ir = {
|
|
|
3053
2992
|
}, hr = {
|
|
3054
2993
|
dark: "size-16 text-white/25",
|
|
3055
2994
|
light: "size-16 text-black/25"
|
|
3056
|
-
}, Me = (e, t) => !!t && !!e &&
|
|
2995
|
+
}, Me = (e, t) => !!t && !!e && ne(e) === "audio", hn = (e, t) => {
|
|
3057
2996
|
if (!t || !e) return !1;
|
|
3058
|
-
const s =
|
|
2997
|
+
const s = ne(e);
|
|
3059
2998
|
return s === "video" || s === "audio";
|
|
3060
|
-
},
|
|
2999
|
+
}, tt = "bg-[#F2F3F4]", Ie = ({
|
|
3061
3000
|
variant: e,
|
|
3062
3001
|
thumbnailUrl: t,
|
|
3063
3002
|
sourceUrl: s,
|
|
@@ -3066,7 +3005,7 @@ const ir = {
|
|
|
3066
3005
|
topLeft: i,
|
|
3067
3006
|
topRight: o
|
|
3068
3007
|
}) => {
|
|
3069
|
-
const l =
|
|
3008
|
+
const l = ne(r), d = !!s && l === "video";
|
|
3070
3009
|
return Me(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3071
3010
|
"audio",
|
|
3072
3011
|
{
|
|
@@ -3132,31 +3071,31 @@ const ir = {
|
|
|
3132
3071
|
layout: l = "featured",
|
|
3133
3072
|
appIcon: d,
|
|
3134
3073
|
cta: m,
|
|
3135
|
-
onDismiss:
|
|
3074
|
+
onDismiss: b,
|
|
3136
3075
|
onEditClick: u
|
|
3137
3076
|
}) => {
|
|
3138
|
-
const f = l === "classic", c = Me(r, o),
|
|
3077
|
+
const f = l === "classic", c = Me(r, o), g = b ? /* @__PURE__ */ n(
|
|
3139
3078
|
"button",
|
|
3140
3079
|
{
|
|
3141
3080
|
type: "button",
|
|
3142
|
-
onClick:
|
|
3081
|
+
onClick: b,
|
|
3143
3082
|
"aria-label": "Dismiss attachment",
|
|
3144
3083
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3145
|
-
children: /* @__PURE__ */ n(
|
|
3084
|
+
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3146
3085
|
}
|
|
3147
|
-
) : void 0,
|
|
3086
|
+
) : void 0, v = u ? /* @__PURE__ */ n(
|
|
3148
3087
|
"button",
|
|
3149
3088
|
{
|
|
3150
3089
|
type: "button",
|
|
3151
3090
|
onClick: u,
|
|
3152
3091
|
"aria-label": "Edit attachment",
|
|
3153
3092
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3154
|
-
children: /* @__PURE__ */ n(
|
|
3093
|
+
children: /* @__PURE__ */ n(As, { className: "size-5", weight: "regular" })
|
|
3155
3094
|
}
|
|
3156
3095
|
) : void 0;
|
|
3157
|
-
return c ? /* @__PURE__ */ n(
|
|
3096
|
+
return c ? /* @__PURE__ */ n(Se, { variant: "dark", bgClassName: tt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3158
3097
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3159
|
-
|
|
3098
|
+
Ie,
|
|
3160
3099
|
{
|
|
3161
3100
|
variant: "dark",
|
|
3162
3101
|
sourceUrl: o,
|
|
@@ -3164,26 +3103,26 @@ const ir = {
|
|
|
3164
3103
|
mimeType: r
|
|
3165
3104
|
}
|
|
3166
3105
|
) }),
|
|
3167
|
-
|
|
3106
|
+
g && /* @__PURE__ */ n("div", { className: "shrink-0", children: g })
|
|
3168
3107
|
] }) }) : /* @__PURE__ */ h(
|
|
3169
|
-
|
|
3108
|
+
Se,
|
|
3170
3109
|
{
|
|
3171
3110
|
variant: "dark",
|
|
3172
|
-
topRight: f ?
|
|
3111
|
+
topRight: f ? g : void 0,
|
|
3173
3112
|
children: [
|
|
3174
3113
|
!f && /* @__PURE__ */ n(
|
|
3175
|
-
|
|
3114
|
+
Ie,
|
|
3176
3115
|
{
|
|
3177
3116
|
variant: "dark",
|
|
3178
3117
|
thumbnailUrl: i,
|
|
3179
3118
|
sourceUrl: o,
|
|
3180
3119
|
title: e,
|
|
3181
3120
|
mimeType: r,
|
|
3182
|
-
topRight:
|
|
3121
|
+
topRight: g
|
|
3183
3122
|
}
|
|
3184
3123
|
),
|
|
3185
3124
|
/* @__PURE__ */ n(
|
|
3186
|
-
|
|
3125
|
+
et,
|
|
3187
3126
|
{
|
|
3188
3127
|
variant: "dark",
|
|
3189
3128
|
title: e,
|
|
@@ -3192,7 +3131,7 @@ const ir = {
|
|
|
3192
3131
|
url: a,
|
|
3193
3132
|
appIcon: d,
|
|
3194
3133
|
cta: m,
|
|
3195
|
-
trailingAction:
|
|
3134
|
+
trailingAction: v
|
|
3196
3135
|
}
|
|
3197
3136
|
)
|
|
3198
3137
|
]
|
|
@@ -3210,25 +3149,25 @@ const ir = {
|
|
|
3210
3149
|
cta: d,
|
|
3211
3150
|
onClick: m
|
|
3212
3151
|
}) => {
|
|
3213
|
-
const
|
|
3152
|
+
const b = hn(a, i), u = Qe(s), f = d == null && u != null && !b ? u : void 0, c = d == null && !b ? m : void 0, g = Me(a, i) ? tt : void 0, v = d && m ? {
|
|
3214
3153
|
...d,
|
|
3215
3154
|
onClick: () => {
|
|
3216
|
-
var
|
|
3217
|
-
m(), (
|
|
3155
|
+
var p;
|
|
3156
|
+
m(), (p = d.onClick) == null || p.call(d);
|
|
3218
3157
|
}
|
|
3219
3158
|
} : d;
|
|
3220
3159
|
return /* @__PURE__ */ h(
|
|
3221
|
-
|
|
3160
|
+
Se,
|
|
3222
3161
|
{
|
|
3223
3162
|
variant: "light",
|
|
3224
3163
|
href: f,
|
|
3225
3164
|
onClick: c,
|
|
3226
3165
|
ariaLabel: e ?? "Open attachment preview",
|
|
3227
|
-
bgClassName:
|
|
3166
|
+
bgClassName: g,
|
|
3228
3167
|
"data-testid": "link-attachment",
|
|
3229
3168
|
children: [
|
|
3230
3169
|
o === "featured" && /* @__PURE__ */ n(
|
|
3231
|
-
|
|
3170
|
+
Ie,
|
|
3232
3171
|
{
|
|
3233
3172
|
variant: "light",
|
|
3234
3173
|
thumbnailUrl: r,
|
|
@@ -3238,14 +3177,14 @@ const ir = {
|
|
|
3238
3177
|
}
|
|
3239
3178
|
),
|
|
3240
3179
|
/* @__PURE__ */ n(
|
|
3241
|
-
|
|
3180
|
+
et,
|
|
3242
3181
|
{
|
|
3243
3182
|
variant: "light",
|
|
3244
3183
|
title: e,
|
|
3245
3184
|
description: t,
|
|
3246
3185
|
url: s,
|
|
3247
3186
|
appIcon: l,
|
|
3248
|
-
cta:
|
|
3187
|
+
cta: v
|
|
3249
3188
|
}
|
|
3250
3189
|
)
|
|
3251
3190
|
]
|
|
@@ -3262,19 +3201,19 @@ const ir = {
|
|
|
3262
3201
|
layout: l = "featured",
|
|
3263
3202
|
appIcon: d,
|
|
3264
3203
|
cta: m,
|
|
3265
|
-
onClick:
|
|
3204
|
+
onClick: b
|
|
3266
3205
|
}) => {
|
|
3267
|
-
const u =
|
|
3206
|
+
const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0, g = m == null && !u && c != null ? b : void 0;
|
|
3268
3207
|
return /* @__PURE__ */ h(
|
|
3269
|
-
|
|
3208
|
+
Se,
|
|
3270
3209
|
{
|
|
3271
3210
|
variant: "dark",
|
|
3272
3211
|
href: c,
|
|
3273
|
-
onClick:
|
|
3274
|
-
bgClassName: Me(r, o) ?
|
|
3212
|
+
onClick: g,
|
|
3213
|
+
bgClassName: Me(r, o) ? tt : void 0,
|
|
3275
3214
|
children: [
|
|
3276
3215
|
l === "featured" && /* @__PURE__ */ n(
|
|
3277
|
-
|
|
3216
|
+
Ie,
|
|
3278
3217
|
{
|
|
3279
3218
|
variant: "dark",
|
|
3280
3219
|
thumbnailUrl: i,
|
|
@@ -3284,7 +3223,7 @@ const ir = {
|
|
|
3284
3223
|
}
|
|
3285
3224
|
),
|
|
3286
3225
|
/* @__PURE__ */ n(
|
|
3287
|
-
|
|
3226
|
+
et,
|
|
3288
3227
|
{
|
|
3289
3228
|
variant: "dark",
|
|
3290
3229
|
title: e,
|
|
@@ -3392,7 +3331,7 @@ const ir = {
|
|
|
3392
3331
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3393
3332
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3394
3333
|
),
|
|
3395
|
-
children: /* @__PURE__ */ n(
|
|
3334
|
+
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3396
3335
|
}
|
|
3397
3336
|
), we = (e) => e === "received" ? "light" : "dark", ki = ({
|
|
3398
3337
|
firstOfGroup: e,
|
|
@@ -3415,7 +3354,7 @@ const ir = {
|
|
|
3415
3354
|
}
|
|
3416
3355
|
),
|
|
3417
3356
|
s ?? null
|
|
3418
|
-
] }),
|
|
3357
|
+
] }), nt = ({
|
|
3419
3358
|
state: e,
|
|
3420
3359
|
src: t,
|
|
3421
3360
|
mimeType: s,
|
|
@@ -3426,7 +3365,7 @@ const ir = {
|
|
|
3426
3365
|
preload: l,
|
|
3427
3366
|
onDismiss: d
|
|
3428
3367
|
}) => {
|
|
3429
|
-
const m = we(e),
|
|
3368
|
+
const m = we(e), b = e === "composer" && !!d, u = _r({ src: t, mimeType: s, filename: a, items: r });
|
|
3430
3369
|
if (u.length === 0)
|
|
3431
3370
|
return null;
|
|
3432
3371
|
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
@@ -3437,7 +3376,7 @@ const ir = {
|
|
|
3437
3376
|
text: i,
|
|
3438
3377
|
groupPosition: o,
|
|
3439
3378
|
"data-testid": "audio-attachment",
|
|
3440
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3379
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, g) => /* @__PURE__ */ n(
|
|
3441
3380
|
yr,
|
|
3442
3381
|
{
|
|
3443
3382
|
item: c,
|
|
@@ -3445,19 +3384,19 @@ const ir = {
|
|
|
3445
3384
|
trailingAction: (
|
|
3446
3385
|
// Composer only supports a single attachment, so the
|
|
3447
3386
|
// dismiss control sits on the only player.
|
|
3448
|
-
|
|
3387
|
+
b && g === 0 ? /* @__PURE__ */ n(xe, { onClick: d, variant: "inline" }) : void 0
|
|
3449
3388
|
)
|
|
3450
3389
|
},
|
|
3451
|
-
`${c.src}-${
|
|
3390
|
+
`${c.src}-${g}`
|
|
3452
3391
|
)) })
|
|
3453
3392
|
}
|
|
3454
3393
|
);
|
|
3455
|
-
}, Cr = (e) => /* @__PURE__ */ n(
|
|
3394
|
+
}, Cr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "composer" }), kr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "sent" }), Er = (e) => /* @__PURE__ */ n(nt, { ...e, state: "received" }), Sr = {
|
|
3456
3395
|
Composer: Cr,
|
|
3457
3396
|
Sent: kr,
|
|
3458
3397
|
Received: Er
|
|
3459
3398
|
};
|
|
3460
|
-
function
|
|
3399
|
+
function Ir(e) {
|
|
3461
3400
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
3462
3401
|
}
|
|
3463
3402
|
const Tr = {
|
|
@@ -3479,8 +3418,8 @@ function Ar(e, t) {
|
|
|
3479
3418
|
}
|
|
3480
3419
|
}
|
|
3481
3420
|
if (!e) return;
|
|
3482
|
-
if (
|
|
3483
|
-
const r =
|
|
3421
|
+
if (ne(e) === "document") {
|
|
3422
|
+
const r = Zt(e), i = Tr[r];
|
|
3484
3423
|
if (i) return i;
|
|
3485
3424
|
if (e === "application/octet-stream") return;
|
|
3486
3425
|
}
|
|
@@ -3489,10 +3428,10 @@ function Ar(e, t) {
|
|
|
3489
3428
|
return a.toUpperCase();
|
|
3490
3429
|
}
|
|
3491
3430
|
function Mr(e, t, s) {
|
|
3492
|
-
const a = Ar(e, t), r = typeof s == "number" && s > 0 ?
|
|
3431
|
+
const a = Ar(e, t), r = typeof s == "number" && s > 0 ? Ir(s) : void 0;
|
|
3493
3432
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3494
3433
|
}
|
|
3495
|
-
function
|
|
3434
|
+
function Z(e) {
|
|
3496
3435
|
try {
|
|
3497
3436
|
const s = new URL(e).pathname.split("/").pop();
|
|
3498
3437
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3500,16 +3439,16 @@ function te(e) {
|
|
|
3500
3439
|
return "download";
|
|
3501
3440
|
}
|
|
3502
3441
|
}
|
|
3503
|
-
const
|
|
3442
|
+
const Rr = {
|
|
3504
3443
|
dark: "text-white/55",
|
|
3505
3444
|
light: "text-black/65"
|
|
3506
|
-
},
|
|
3445
|
+
}, Lr = {
|
|
3507
3446
|
dark: "bg-white/10",
|
|
3508
3447
|
light: "bg-black/5"
|
|
3509
|
-
},
|
|
3448
|
+
}, Dr = {
|
|
3510
3449
|
dark: "text-white/85",
|
|
3511
3450
|
light: "text-black/85"
|
|
3512
|
-
},
|
|
3451
|
+
}, fn = ({
|
|
3513
3452
|
variant: e,
|
|
3514
3453
|
filename: t,
|
|
3515
3454
|
title: s,
|
|
@@ -3519,16 +3458,16 @@ const Dr = {
|
|
|
3519
3458
|
activateLabel: o,
|
|
3520
3459
|
trailingAction: l
|
|
3521
3460
|
}) => {
|
|
3522
|
-
const d = s ?? t ?? "File", m = Mr(a, t, r),
|
|
3461
|
+
const d = s ?? t ?? "File", m = Mr(a, t, r), b = /* @__PURE__ */ n(
|
|
3523
3462
|
"div",
|
|
3524
3463
|
{
|
|
3525
3464
|
className: C(
|
|
3526
3465
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3527
|
-
|
|
3466
|
+
Lr[e]
|
|
3528
3467
|
),
|
|
3529
3468
|
"aria-hidden": !0,
|
|
3530
3469
|
children: le(a, {
|
|
3531
|
-
className: C("size-6",
|
|
3470
|
+
className: C("size-6", Dr[e]),
|
|
3532
3471
|
weight: "regular"
|
|
3533
3472
|
})
|
|
3534
3473
|
}
|
|
@@ -3539,7 +3478,7 @@ const Dr = {
|
|
|
3539
3478
|
{
|
|
3540
3479
|
className: C(
|
|
3541
3480
|
"truncate text-xs leading-4",
|
|
3542
|
-
|
|
3481
|
+
Rr[e]
|
|
3543
3482
|
),
|
|
3544
3483
|
children: m
|
|
3545
3484
|
}
|
|
@@ -3555,12 +3494,12 @@ const Dr = {
|
|
|
3555
3494
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3556
3495
|
),
|
|
3557
3496
|
children: [
|
|
3558
|
-
|
|
3497
|
+
b,
|
|
3559
3498
|
u
|
|
3560
3499
|
]
|
|
3561
3500
|
}
|
|
3562
|
-
) : /* @__PURE__ */ h(
|
|
3563
|
-
|
|
3501
|
+
) : /* @__PURE__ */ h(te, { children: [
|
|
3502
|
+
b,
|
|
3564
3503
|
u
|
|
3565
3504
|
] });
|
|
3566
3505
|
return /* @__PURE__ */ h("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
@@ -3568,8 +3507,8 @@ const Dr = {
|
|
|
3568
3507
|
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
3569
3508
|
] });
|
|
3570
3509
|
};
|
|
3571
|
-
async function
|
|
3572
|
-
const s = t ??
|
|
3510
|
+
async function gn(e, t) {
|
|
3511
|
+
const s = t ?? Z(e);
|
|
3573
3512
|
try {
|
|
3574
3513
|
const a = await fetch(e, { mode: "cors" });
|
|
3575
3514
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -3596,9 +3535,9 @@ const Pr = ({
|
|
|
3596
3535
|
onActivate: a,
|
|
3597
3536
|
trailingAction: r
|
|
3598
3537
|
}) => {
|
|
3599
|
-
const i = t.filename ??
|
|
3538
|
+
const i = t.filename ?? Z(t.src);
|
|
3600
3539
|
return /* @__PURE__ */ n(
|
|
3601
|
-
|
|
3540
|
+
fn,
|
|
3602
3541
|
{
|
|
3603
3542
|
variant: e,
|
|
3604
3543
|
filename: i,
|
|
@@ -3610,7 +3549,7 @@ const Pr = ({
|
|
|
3610
3549
|
trailingAction: r
|
|
3611
3550
|
}
|
|
3612
3551
|
);
|
|
3613
|
-
},
|
|
3552
|
+
}, st = ({
|
|
3614
3553
|
state: e,
|
|
3615
3554
|
src: t,
|
|
3616
3555
|
filename: s,
|
|
@@ -3621,25 +3560,25 @@ const Pr = ({
|
|
|
3621
3560
|
text: l,
|
|
3622
3561
|
groupPosition: d,
|
|
3623
3562
|
onClick: m,
|
|
3624
|
-
onDismiss:
|
|
3563
|
+
onDismiss: b
|
|
3625
3564
|
}) => {
|
|
3626
|
-
const u = we(e), f = e === "composer" && !!
|
|
3565
|
+
const u = we(e), f = e === "composer" && !!b, c = Pr({
|
|
3627
3566
|
src: t,
|
|
3628
3567
|
filename: s,
|
|
3629
3568
|
fileSize: a,
|
|
3630
3569
|
mimeType: r,
|
|
3631
3570
|
title: i,
|
|
3632
3571
|
items: o
|
|
3633
|
-
}),
|
|
3634
|
-
if ((m == null ? void 0 : m(
|
|
3635
|
-
const
|
|
3636
|
-
if (!
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3572
|
+
}), g = (p) => {
|
|
3573
|
+
if ((m == null ? void 0 : m(p)) === !1) return;
|
|
3574
|
+
const N = c[p];
|
|
3575
|
+
if (!N) return;
|
|
3576
|
+
const x = N.filename ?? Z(N.src);
|
|
3577
|
+
gn(N.src, x);
|
|
3639
3578
|
};
|
|
3640
3579
|
if (c.length === 0)
|
|
3641
3580
|
return null;
|
|
3642
|
-
const
|
|
3581
|
+
const v = /* @__PURE__ */ n(
|
|
3643
3582
|
"span",
|
|
3644
3583
|
{
|
|
3645
3584
|
className: C(
|
|
@@ -3647,7 +3586,7 @@ const Pr = ({
|
|
|
3647
3586
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3648
3587
|
),
|
|
3649
3588
|
"aria-hidden": !0,
|
|
3650
|
-
children: /* @__PURE__ */ n(
|
|
3589
|
+
children: /* @__PURE__ */ n(be, { className: "size-5", weight: "bold" })
|
|
3651
3590
|
}
|
|
3652
3591
|
);
|
|
3653
3592
|
return /* @__PURE__ */ n(
|
|
@@ -3657,29 +3596,29 @@ const Pr = ({
|
|
|
3657
3596
|
text: l,
|
|
3658
3597
|
groupPosition: d,
|
|
3659
3598
|
"data-testid": "file-attachment",
|
|
3660
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3599
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, N) => /* @__PURE__ */ n(
|
|
3661
3600
|
Or,
|
|
3662
3601
|
{
|
|
3663
3602
|
variant: u,
|
|
3664
|
-
item:
|
|
3665
|
-
index:
|
|
3666
|
-
onActivate:
|
|
3667
|
-
trailingAction: f &&
|
|
3603
|
+
item: p,
|
|
3604
|
+
index: N,
|
|
3605
|
+
onActivate: g,
|
|
3606
|
+
trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : v
|
|
3668
3607
|
},
|
|
3669
|
-
`${
|
|
3608
|
+
`${p.src}-${N}`
|
|
3670
3609
|
)) })
|
|
3671
3610
|
}
|
|
3672
3611
|
);
|
|
3673
|
-
}, zr = (e) => /* @__PURE__ */ n(
|
|
3612
|
+
}, zr = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), $r = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), Br = {
|
|
3674
3613
|
Composer: zr,
|
|
3675
|
-
Sent:
|
|
3676
|
-
Received:
|
|
3677
|
-
},
|
|
3614
|
+
Sent: $r,
|
|
3615
|
+
Received: Fr
|
|
3616
|
+
}, at = ({
|
|
3678
3617
|
onPrev: e,
|
|
3679
3618
|
onNext: t,
|
|
3680
3619
|
prevLabel: s = "Previous",
|
|
3681
3620
|
nextLabel: a = "Next"
|
|
3682
|
-
}) => /* @__PURE__ */ h(
|
|
3621
|
+
}) => /* @__PURE__ */ h(te, { children: [
|
|
3683
3622
|
/* @__PURE__ */ n(
|
|
3684
3623
|
"button",
|
|
3685
3624
|
{
|
|
@@ -3687,7 +3626,7 @@ const Pr = ({
|
|
|
3687
3626
|
onClick: e,
|
|
3688
3627
|
"aria-label": s,
|
|
3689
3628
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3690
|
-
children: /* @__PURE__ */ n(
|
|
3629
|
+
children: /* @__PURE__ */ n(Ms, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3691
3630
|
}
|
|
3692
3631
|
),
|
|
3693
3632
|
/* @__PURE__ */ n(
|
|
@@ -3697,10 +3636,10 @@ const Pr = ({
|
|
|
3697
3636
|
onClick: t,
|
|
3698
3637
|
"aria-label": a,
|
|
3699
3638
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3700
|
-
children: /* @__PURE__ */ n(
|
|
3639
|
+
children: /* @__PURE__ */ n(Rs, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3701
3640
|
}
|
|
3702
3641
|
)
|
|
3703
|
-
] }),
|
|
3642
|
+
] }), bn = ({
|
|
3704
3643
|
url: e,
|
|
3705
3644
|
filename: t,
|
|
3706
3645
|
variant: s = "pill",
|
|
@@ -3709,15 +3648,15 @@ const Pr = ({
|
|
|
3709
3648
|
tone: i = "dark",
|
|
3710
3649
|
onTriggered: o
|
|
3711
3650
|
}) => {
|
|
3712
|
-
const [l, d] =
|
|
3651
|
+
const [l, d] = D(!1), m = W(
|
|
3713
3652
|
(c) => {
|
|
3714
|
-
c.stopPropagation(), !l && (d(!0),
|
|
3653
|
+
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3715
3654
|
}).finally(() => {
|
|
3716
3655
|
d(!1), o == null || o();
|
|
3717
3656
|
}));
|
|
3718
3657
|
},
|
|
3719
3658
|
[l, e, t, o]
|
|
3720
|
-
),
|
|
3659
|
+
), b = r ?? s !== "pill", f = { className: C(
|
|
3721
3660
|
s === "pill" ? "size-4" : "size-5",
|
|
3722
3661
|
"shrink-0"
|
|
3723
3662
|
), weight: "bold" };
|
|
@@ -3736,14 +3675,14 @@ const Pr = ({
|
|
|
3736
3675
|
}[i]
|
|
3737
3676
|
),
|
|
3738
3677
|
children: l ? /* @__PURE__ */ n(
|
|
3739
|
-
|
|
3678
|
+
ge,
|
|
3740
3679
|
{
|
|
3741
3680
|
className: "size-4 animate-spin",
|
|
3742
3681
|
weight: "bold",
|
|
3743
3682
|
"aria-hidden": !0
|
|
3744
3683
|
}
|
|
3745
3684
|
) : /* @__PURE__ */ n(
|
|
3746
|
-
|
|
3685
|
+
be,
|
|
3747
3686
|
{
|
|
3748
3687
|
className: "size-5 shrink-0",
|
|
3749
3688
|
weight: "bold",
|
|
@@ -3759,7 +3698,7 @@ const Pr = ({
|
|
|
3759
3698
|
disabled: l,
|
|
3760
3699
|
"aria-label": a,
|
|
3761
3700
|
className: "mes-media-viewer__action",
|
|
3762
|
-
children: l ? /* @__PURE__ */ n(
|
|
3701
|
+
children: l ? /* @__PURE__ */ n(ge, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(be, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3763
3702
|
}
|
|
3764
3703
|
) : /* @__PURE__ */ h(
|
|
3765
3704
|
"button",
|
|
@@ -3767,50 +3706,50 @@ const Pr = ({
|
|
|
3767
3706
|
type: "button",
|
|
3768
3707
|
onClick: m,
|
|
3769
3708
|
disabled: l,
|
|
3770
|
-
"aria-label":
|
|
3709
|
+
"aria-label": b ? a : void 0,
|
|
3771
3710
|
className: C(
|
|
3772
3711
|
"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",
|
|
3773
3712
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3774
3713
|
),
|
|
3775
3714
|
children: [
|
|
3776
3715
|
l ? /* @__PURE__ */ n(
|
|
3777
|
-
|
|
3716
|
+
ge,
|
|
3778
3717
|
{
|
|
3779
3718
|
className: "size-4 animate-spin",
|
|
3780
3719
|
weight: "bold",
|
|
3781
3720
|
"aria-hidden": !0
|
|
3782
3721
|
}
|
|
3783
|
-
) : /* @__PURE__ */ n(
|
|
3784
|
-
|
|
3722
|
+
) : /* @__PURE__ */ n(be, { ...f, "aria-hidden": !0 }),
|
|
3723
|
+
b ? null : a
|
|
3785
3724
|
]
|
|
3786
3725
|
}
|
|
3787
3726
|
);
|
|
3788
|
-
}, $e = (e, t, s) => Math.min(Math.max(e, t), s),
|
|
3727
|
+
}, $e = (e, t, s) => Math.min(Math.max(e, t), s), rt = ({
|
|
3789
3728
|
length: e,
|
|
3790
3729
|
initialIndex: t,
|
|
3791
3730
|
open: s
|
|
3792
3731
|
}) => {
|
|
3793
|
-
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3794
|
-
|
|
3732
|
+
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = D(a);
|
|
3733
|
+
Y(() => {
|
|
3795
3734
|
s && i($e(t, 0, Math.max(e - 1, 0)));
|
|
3796
|
-
}, [s, t, e]),
|
|
3735
|
+
}, [s, t, e]), Y(() => {
|
|
3797
3736
|
i((d) => $e(d, 0, Math.max(e - 1, 0)));
|
|
3798
3737
|
}, [e]);
|
|
3799
|
-
const o =
|
|
3738
|
+
const o = W(() => {
|
|
3800
3739
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3801
|
-
}, [e]), l =
|
|
3740
|
+
}, [e]), l = W(() => {
|
|
3802
3741
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3803
3742
|
}, [e]);
|
|
3804
|
-
return
|
|
3743
|
+
return Y(() => {
|
|
3805
3744
|
if (!s || e <= 1) return;
|
|
3806
3745
|
const d = (m) => {
|
|
3807
3746
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
3808
|
-
const
|
|
3809
|
-
|
|
3747
|
+
const b = document.activeElement;
|
|
3748
|
+
b && (b.tagName === "VIDEO" || b.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
|
|
3810
3749
|
};
|
|
3811
3750
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3812
3751
|
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
3813
|
-
},
|
|
3752
|
+
}, it = ({
|
|
3814
3753
|
open: e,
|
|
3815
3754
|
onClose: t,
|
|
3816
3755
|
ariaLabel: s,
|
|
@@ -3819,8 +3758,8 @@ const Pr = ({
|
|
|
3819
3758
|
children: i,
|
|
3820
3759
|
"data-testid": o
|
|
3821
3760
|
}) => {
|
|
3822
|
-
const l =
|
|
3823
|
-
return
|
|
3761
|
+
const l = H(null), d = H(null);
|
|
3762
|
+
return Y(() => {
|
|
3824
3763
|
var f;
|
|
3825
3764
|
const u = l.current;
|
|
3826
3765
|
if (u) {
|
|
@@ -3891,7 +3830,7 @@ const Pr = ({
|
|
|
3891
3830
|
onClick: t,
|
|
3892
3831
|
"aria-label": "Close viewer",
|
|
3893
3832
|
className: "mes-media-viewer__action",
|
|
3894
|
-
children: /* @__PURE__ */ n(
|
|
3833
|
+
children: /* @__PURE__ */ n(Ae, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3895
3834
|
}
|
|
3896
3835
|
)
|
|
3897
3836
|
] })
|
|
@@ -3900,29 +3839,29 @@ const Pr = ({
|
|
|
3900
3839
|
]
|
|
3901
3840
|
}
|
|
3902
3841
|
);
|
|
3903
|
-
},
|
|
3842
|
+
}, pn = ({
|
|
3904
3843
|
open: e,
|
|
3905
3844
|
items: t,
|
|
3906
3845
|
initialIndex: s = 0,
|
|
3907
3846
|
onClose: a
|
|
3908
3847
|
}) => {
|
|
3909
|
-
const { index: r, prev: i, next: o } =
|
|
3848
|
+
const { index: r, prev: i, next: o } = rt({
|
|
3910
3849
|
length: t.length,
|
|
3911
3850
|
initialIndex: s,
|
|
3912
3851
|
open: e
|
|
3913
|
-
}), l = t[r], d =
|
|
3914
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3852
|
+
}), l = t[r], d = ee(
|
|
3853
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "image"),
|
|
3915
3854
|
[l]
|
|
3916
3855
|
);
|
|
3917
3856
|
return l ? /* @__PURE__ */ h(
|
|
3918
|
-
|
|
3857
|
+
it,
|
|
3919
3858
|
{
|
|
3920
3859
|
open: e,
|
|
3921
3860
|
onClose: a,
|
|
3922
3861
|
ariaLabel: d,
|
|
3923
3862
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
3924
3863
|
actions: /* @__PURE__ */ n(
|
|
3925
|
-
|
|
3864
|
+
bn,
|
|
3926
3865
|
{
|
|
3927
3866
|
url: l.src,
|
|
3928
3867
|
filename: d,
|
|
@@ -3945,7 +3884,7 @@ const Pr = ({
|
|
|
3945
3884
|
`${r}:${l.src}`
|
|
3946
3885
|
),
|
|
3947
3886
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3948
|
-
|
|
3887
|
+
at,
|
|
3949
3888
|
{
|
|
3950
3889
|
onPrev: i,
|
|
3951
3890
|
onNext: o,
|
|
@@ -3956,7 +3895,7 @@ const Pr = ({
|
|
|
3956
3895
|
]
|
|
3957
3896
|
}
|
|
3958
3897
|
) : null;
|
|
3959
|
-
},
|
|
3898
|
+
}, Ur = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", vn = ({
|
|
3960
3899
|
tiles: e,
|
|
3961
3900
|
onTileActivate: t,
|
|
3962
3901
|
maxVisible: s = 4,
|
|
@@ -3964,8 +3903,8 @@ const Pr = ({
|
|
|
3964
3903
|
}) => {
|
|
3965
3904
|
const r = e.length;
|
|
3966
3905
|
if (r === 0) return null;
|
|
3967
|
-
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m,
|
|
3968
|
-
const u = C(
|
|
3906
|
+
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, b) => {
|
|
3907
|
+
const u = C(Ur, "h-full w-full");
|
|
3969
3908
|
return t ? /* @__PURE__ */ h(
|
|
3970
3909
|
"button",
|
|
3971
3910
|
{
|
|
@@ -3975,13 +3914,13 @@ const Pr = ({
|
|
|
3975
3914
|
className: C(u, "cursor-zoom-in"),
|
|
3976
3915
|
children: [
|
|
3977
3916
|
d.content,
|
|
3978
|
-
|
|
3917
|
+
b
|
|
3979
3918
|
]
|
|
3980
3919
|
},
|
|
3981
3920
|
m
|
|
3982
3921
|
) : /* @__PURE__ */ h("div", { className: u, children: [
|
|
3983
3922
|
d.content,
|
|
3984
|
-
|
|
3923
|
+
b
|
|
3985
3924
|
] }, m);
|
|
3986
3925
|
};
|
|
3987
3926
|
return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
@@ -4014,11 +3953,11 @@ const Pr = ({
|
|
|
4014
3953
|
a
|
|
4015
3954
|
),
|
|
4016
3955
|
children: i.map((d, m) => {
|
|
4017
|
-
const
|
|
3956
|
+
const b = o > 0 && m === i.length - 1;
|
|
4018
3957
|
return l(
|
|
4019
3958
|
d,
|
|
4020
3959
|
m,
|
|
4021
|
-
|
|
3960
|
+
b ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
4022
3961
|
"+",
|
|
4023
3962
|
o
|
|
4024
3963
|
] }) : null
|
|
@@ -4027,14 +3966,14 @@ const Pr = ({
|
|
|
4027
3966
|
}
|
|
4028
3967
|
);
|
|
4029
3968
|
}, Ne = (e) => {
|
|
4030
|
-
const [t, s] =
|
|
3969
|
+
const [t, s] = D(!1), [a, r] = D(0), i = W(
|
|
4031
3970
|
(l) => {
|
|
4032
3971
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
4033
3972
|
},
|
|
4034
3973
|
[e]
|
|
4035
|
-
), o =
|
|
3974
|
+
), o = W(() => s(!1), []);
|
|
4036
3975
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
4037
|
-
},
|
|
3976
|
+
}, jr = (e, t, s, a) => ({
|
|
4038
3977
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4039
3978
|
content: /* @__PURE__ */ n(
|
|
4040
3979
|
"img",
|
|
@@ -4049,11 +3988,11 @@ const Pr = ({
|
|
|
4049
3988
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4050
3989
|
}
|
|
4051
3990
|
)
|
|
4052
|
-
}),
|
|
3991
|
+
}), Vr = ({
|
|
4053
3992
|
src: e,
|
|
4054
3993
|
alt: t,
|
|
4055
3994
|
items: s
|
|
4056
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
3995
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], xn = (e, t) => e.map((s, a) => ({
|
|
4057
3996
|
src: s.src,
|
|
4058
3997
|
alt: s.alt,
|
|
4059
3998
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
@@ -4084,16 +4023,16 @@ const Pr = ({
|
|
|
4084
4023
|
),
|
|
4085
4024
|
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: i }) }) : null,
|
|
4086
4025
|
/* @__PURE__ */ n(
|
|
4087
|
-
|
|
4026
|
+
pn,
|
|
4088
4027
|
{
|
|
4089
4028
|
open: o,
|
|
4090
|
-
items:
|
|
4029
|
+
items: xn([{ src: e, alt: t }], s),
|
|
4091
4030
|
initialIndex: l,
|
|
4092
4031
|
onClose: m
|
|
4093
4032
|
}
|
|
4094
4033
|
)
|
|
4095
4034
|
] });
|
|
4096
|
-
},
|
|
4035
|
+
}, wn = ({
|
|
4097
4036
|
state: e,
|
|
4098
4037
|
src: t,
|
|
4099
4038
|
alt: s,
|
|
@@ -4104,36 +4043,36 @@ const Pr = ({
|
|
|
4104
4043
|
loading: l = "lazy",
|
|
4105
4044
|
onClick: d
|
|
4106
4045
|
}) => {
|
|
4107
|
-
const m =
|
|
4046
|
+
const m = Vr({ src: t, alt: s, items: r }), b = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: g } = Ne(
|
|
4108
4047
|
d
|
|
4109
4048
|
);
|
|
4110
4049
|
if (m.length === 0)
|
|
4111
4050
|
return null;
|
|
4112
|
-
const
|
|
4113
|
-
(
|
|
4051
|
+
const v = m.map(
|
|
4052
|
+
(p, N) => jr(p, N, m.length, l)
|
|
4114
4053
|
);
|
|
4115
4054
|
return /* @__PURE__ */ h(
|
|
4116
4055
|
ve,
|
|
4117
4056
|
{
|
|
4118
|
-
variant:
|
|
4057
|
+
variant: b,
|
|
4119
4058
|
text: i,
|
|
4120
4059
|
groupPosition: o,
|
|
4121
4060
|
"data-testid": "image-attachment",
|
|
4122
4061
|
children: [
|
|
4123
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4062
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: v, onTileActivate: c }) }),
|
|
4124
4063
|
/* @__PURE__ */ n(
|
|
4125
|
-
|
|
4064
|
+
pn,
|
|
4126
4065
|
{
|
|
4127
4066
|
open: u,
|
|
4128
|
-
items:
|
|
4067
|
+
items: xn(m, a),
|
|
4129
4068
|
initialIndex: f,
|
|
4130
|
-
onClose:
|
|
4069
|
+
onClose: g
|
|
4131
4070
|
}
|
|
4132
4071
|
)
|
|
4133
4072
|
]
|
|
4134
4073
|
}
|
|
4135
4074
|
);
|
|
4136
|
-
}, Hr = (e) => /* @__PURE__ */ n(Gr, { ...e }), Yr = (e) => /* @__PURE__ */ n(
|
|
4075
|
+
}, Hr = (e) => /* @__PURE__ */ n(Gr, { ...e }), Yr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), qr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), Wr = {
|
|
4137
4076
|
Composer: Hr,
|
|
4138
4077
|
Sent: Yr,
|
|
4139
4078
|
Received: qr
|
|
@@ -4143,19 +4082,19 @@ const Pr = ({
|
|
|
4143
4082
|
initialIndex: s = 0,
|
|
4144
4083
|
onClose: a
|
|
4145
4084
|
}) => {
|
|
4146
|
-
const { index: r, prev: i, next: o } =
|
|
4085
|
+
const { index: r, prev: i, next: o } = rt({
|
|
4147
4086
|
length: t.length,
|
|
4148
4087
|
initialIndex: s,
|
|
4149
4088
|
open: e
|
|
4150
|
-
}), l = t[r], d =
|
|
4151
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4089
|
+
}), l = t[r], d = ee(
|
|
4090
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "document"),
|
|
4152
4091
|
[l]
|
|
4153
|
-
), m =
|
|
4092
|
+
), m = ee(
|
|
4154
4093
|
() => l ? Kr(l.src) : void 0,
|
|
4155
4094
|
[l]
|
|
4156
4095
|
);
|
|
4157
4096
|
return !l || !m ? null : /* @__PURE__ */ h(
|
|
4158
|
-
|
|
4097
|
+
it,
|
|
4159
4098
|
{
|
|
4160
4099
|
open: e,
|
|
4161
4100
|
onClose: a,
|
|
@@ -4174,7 +4113,7 @@ const Pr = ({
|
|
|
4174
4113
|
`${r}:${l.src}`
|
|
4175
4114
|
),
|
|
4176
4115
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4177
|
-
|
|
4116
|
+
at,
|
|
4178
4117
|
{
|
|
4179
4118
|
onPrev: i,
|
|
4180
4119
|
onNext: o,
|
|
@@ -4201,9 +4140,9 @@ const Pr = ({
|
|
|
4201
4140
|
onActivate: a,
|
|
4202
4141
|
trailingAction: r
|
|
4203
4142
|
}) => {
|
|
4204
|
-
const i = t.filename ??
|
|
4143
|
+
const i = t.filename ?? Z(t.src);
|
|
4205
4144
|
return /* @__PURE__ */ n(
|
|
4206
|
-
|
|
4145
|
+
fn,
|
|
4207
4146
|
{
|
|
4208
4147
|
variant: e,
|
|
4209
4148
|
filename: i,
|
|
@@ -4215,7 +4154,7 @@ const Pr = ({
|
|
|
4215
4154
|
trailingAction: r
|
|
4216
4155
|
}
|
|
4217
4156
|
);
|
|
4218
|
-
},
|
|
4157
|
+
}, ot = ({
|
|
4219
4158
|
state: e,
|
|
4220
4159
|
src: t,
|
|
4221
4160
|
filename: s,
|
|
@@ -4227,78 +4166,78 @@ const Pr = ({
|
|
|
4227
4166
|
onClick: d,
|
|
4228
4167
|
onDismiss: m
|
|
4229
4168
|
}) => {
|
|
4230
|
-
const
|
|
4169
|
+
const b = we(e), u = Jr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: v } = Ne(
|
|
4231
4170
|
d
|
|
4232
|
-
),
|
|
4171
|
+
), p = e === "composer" && !!m;
|
|
4233
4172
|
if (u.length === 0)
|
|
4234
4173
|
return null;
|
|
4235
|
-
const
|
|
4236
|
-
src:
|
|
4237
|
-
filename:
|
|
4174
|
+
const N = u.map((x) => ({
|
|
4175
|
+
src: x.src,
|
|
4176
|
+
filename: x.filename ?? Z(x.src)
|
|
4238
4177
|
}));
|
|
4239
4178
|
return /* @__PURE__ */ h(
|
|
4240
4179
|
ve,
|
|
4241
4180
|
{
|
|
4242
|
-
variant:
|
|
4181
|
+
variant: b,
|
|
4243
4182
|
text: o,
|
|
4244
4183
|
groupPosition: l,
|
|
4245
4184
|
"data-testid": "pdf-attachment",
|
|
4246
4185
|
children: [
|
|
4247
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4248
|
-
const
|
|
4249
|
-
|
|
4186
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x, T) => {
|
|
4187
|
+
const S = x.filename ?? Z(x.src), R = p && T === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4188
|
+
bn,
|
|
4250
4189
|
{
|
|
4251
|
-
url:
|
|
4252
|
-
filename:
|
|
4190
|
+
url: x.src,
|
|
4191
|
+
filename: S,
|
|
4253
4192
|
variant: "inline",
|
|
4254
|
-
label: `Download ${
|
|
4255
|
-
tone:
|
|
4193
|
+
label: `Download ${S}`,
|
|
4194
|
+
tone: b
|
|
4256
4195
|
}
|
|
4257
4196
|
);
|
|
4258
4197
|
return /* @__PURE__ */ n(
|
|
4259
4198
|
Zr,
|
|
4260
4199
|
{
|
|
4261
|
-
variant:
|
|
4262
|
-
item:
|
|
4200
|
+
variant: b,
|
|
4201
|
+
item: x,
|
|
4263
4202
|
index: T,
|
|
4264
|
-
onActivate:
|
|
4265
|
-
trailingAction:
|
|
4203
|
+
onActivate: g,
|
|
4204
|
+
trailingAction: R
|
|
4266
4205
|
},
|
|
4267
|
-
`${
|
|
4206
|
+
`${x.src}-${T}`
|
|
4268
4207
|
);
|
|
4269
4208
|
}) }),
|
|
4270
4209
|
/* @__PURE__ */ n(
|
|
4271
4210
|
Xr,
|
|
4272
4211
|
{
|
|
4273
4212
|
open: f,
|
|
4274
|
-
items:
|
|
4213
|
+
items: N,
|
|
4275
4214
|
initialIndex: c,
|
|
4276
|
-
onClose:
|
|
4215
|
+
onClose: v
|
|
4277
4216
|
}
|
|
4278
4217
|
)
|
|
4279
4218
|
]
|
|
4280
4219
|
}
|
|
4281
4220
|
);
|
|
4282
|
-
}, Qr = (e) => /* @__PURE__ */ n(
|
|
4221
|
+
}, Qr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), ei = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), ti = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), ni = {
|
|
4283
4222
|
Composer: Qr,
|
|
4284
4223
|
Sent: ei,
|
|
4285
4224
|
Received: ti
|
|
4286
|
-
},
|
|
4225
|
+
}, Nn = ({
|
|
4287
4226
|
open: e,
|
|
4288
4227
|
items: t,
|
|
4289
4228
|
initialIndex: s = 0,
|
|
4290
4229
|
onClose: a
|
|
4291
4230
|
}) => {
|
|
4292
|
-
const { index: r, prev: i, next: o } =
|
|
4231
|
+
const { index: r, prev: i, next: o } = rt({
|
|
4293
4232
|
length: t.length,
|
|
4294
4233
|
initialIndex: s,
|
|
4295
4234
|
open: e
|
|
4296
|
-
}), l = t[r], d =
|
|
4297
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4235
|
+
}), l = t[r], d = ee(
|
|
4236
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "video"),
|
|
4298
4237
|
[l]
|
|
4299
4238
|
);
|
|
4300
4239
|
return l ? /* @__PURE__ */ h(
|
|
4301
|
-
|
|
4240
|
+
it,
|
|
4302
4241
|
{
|
|
4303
4242
|
open: e,
|
|
4304
4243
|
onClose: a,
|
|
@@ -4322,7 +4261,7 @@ const Pr = ({
|
|
|
4322
4261
|
`${r}:${l.src}`
|
|
4323
4262
|
),
|
|
4324
4263
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4325
|
-
|
|
4264
|
+
at,
|
|
4326
4265
|
{
|
|
4327
4266
|
onPrev: i,
|
|
4328
4267
|
onNext: o,
|
|
@@ -4333,7 +4272,7 @@ const Pr = ({
|
|
|
4333
4272
|
]
|
|
4334
4273
|
}
|
|
4335
4274
|
) : null;
|
|
4336
|
-
}, si = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(
|
|
4275
|
+
}, si = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(Be, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), _n = ({
|
|
4337
4276
|
item: e,
|
|
4338
4277
|
index: t
|
|
4339
4278
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4348,7 +4287,7 @@ const Pr = ({
|
|
|
4348
4287
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4349
4288
|
}
|
|
4350
4289
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4351
|
-
|
|
4290
|
+
Gt,
|
|
4352
4291
|
{
|
|
4353
4292
|
className: "size-16 rounded-md text-white/30",
|
|
4354
4293
|
weight: "regular",
|
|
@@ -4358,21 +4297,21 @@ const Pr = ({
|
|
|
4358
4297
|
/* @__PURE__ */ n(si, {})
|
|
4359
4298
|
] }), ai = (e, t, s) => ({
|
|
4360
4299
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4361
|
-
content: /* @__PURE__ */ n(
|
|
4300
|
+
content: /* @__PURE__ */ n(_n, { item: e, index: t })
|
|
4362
4301
|
}), ri = ({
|
|
4363
4302
|
src: e,
|
|
4364
4303
|
poster: t,
|
|
4365
4304
|
mimeType: s,
|
|
4366
4305
|
preload: a,
|
|
4367
4306
|
items: r
|
|
4368
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4307
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], yn = (e, t) => e.map((s, a) => ({
|
|
4369
4308
|
src: s.src,
|
|
4370
4309
|
poster: s.poster,
|
|
4371
4310
|
mimeType: s.mimeType,
|
|
4372
4311
|
preload: s.preload,
|
|
4373
4312
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4374
4313
|
})), ii = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4375
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer:
|
|
4314
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: b } = Ne(
|
|
4376
4315
|
i
|
|
4377
4316
|
);
|
|
4378
4317
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4383,24 +4322,24 @@ const Pr = ({
|
|
|
4383
4322
|
onClick: () => m(0),
|
|
4384
4323
|
"aria-label": "Play video",
|
|
4385
4324
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4386
|
-
children: /* @__PURE__ */ n(
|
|
4325
|
+
children: /* @__PURE__ */ n(_n, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4387
4326
|
}
|
|
4388
4327
|
),
|
|
4389
4328
|
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: o }) }) : null,
|
|
4390
4329
|
/* @__PURE__ */ n(
|
|
4391
|
-
|
|
4330
|
+
Nn,
|
|
4392
4331
|
{
|
|
4393
4332
|
open: l,
|
|
4394
|
-
items:
|
|
4333
|
+
items: yn(
|
|
4395
4334
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4396
4335
|
a
|
|
4397
4336
|
),
|
|
4398
4337
|
initialIndex: d,
|
|
4399
|
-
onClose:
|
|
4338
|
+
onClose: b
|
|
4400
4339
|
}
|
|
4401
4340
|
)
|
|
4402
4341
|
] });
|
|
4403
|
-
},
|
|
4342
|
+
}, Cn = ({
|
|
4404
4343
|
state: e,
|
|
4405
4344
|
src: t,
|
|
4406
4345
|
poster: s,
|
|
@@ -4412,13 +4351,13 @@ const Pr = ({
|
|
|
4412
4351
|
preload: d,
|
|
4413
4352
|
onClick: m
|
|
4414
4353
|
}) => {
|
|
4415
|
-
const
|
|
4354
|
+
const b = ri({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: v } = Ne(
|
|
4416
4355
|
m
|
|
4417
4356
|
);
|
|
4418
|
-
if (
|
|
4357
|
+
if (b.length === 0)
|
|
4419
4358
|
return null;
|
|
4420
|
-
const
|
|
4421
|
-
(
|
|
4359
|
+
const p = b.map(
|
|
4360
|
+
(N, x) => ai(N, x, b.length)
|
|
4422
4361
|
);
|
|
4423
4362
|
return /* @__PURE__ */ h(
|
|
4424
4363
|
ve,
|
|
@@ -4429,33 +4368,33 @@ const Pr = ({
|
|
|
4429
4368
|
"data-testid": "video-attachment",
|
|
4430
4369
|
children: [
|
|
4431
4370
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4432
|
-
|
|
4371
|
+
vn,
|
|
4433
4372
|
{
|
|
4434
|
-
tiles:
|
|
4435
|
-
onTileActivate:
|
|
4373
|
+
tiles: p,
|
|
4374
|
+
onTileActivate: g,
|
|
4436
4375
|
className: "overflow-hidden rounded-md"
|
|
4437
4376
|
}
|
|
4438
4377
|
) }),
|
|
4439
4378
|
/* @__PURE__ */ n(
|
|
4440
|
-
|
|
4379
|
+
Nn,
|
|
4441
4380
|
{
|
|
4442
4381
|
open: f,
|
|
4443
|
-
items:
|
|
4382
|
+
items: yn(b, r),
|
|
4444
4383
|
initialIndex: c,
|
|
4445
|
-
onClose:
|
|
4384
|
+
onClose: v
|
|
4446
4385
|
}
|
|
4447
4386
|
)
|
|
4448
4387
|
]
|
|
4449
4388
|
}
|
|
4450
4389
|
);
|
|
4451
|
-
}, oi = (e) => /* @__PURE__ */ n(ii, { ...e }), li = (e) => /* @__PURE__ */ n(
|
|
4390
|
+
}, oi = (e) => /* @__PURE__ */ n(ii, { ...e }), li = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "sent" }), ci = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "received" }), di = {
|
|
4452
4391
|
Composer: oi,
|
|
4453
4392
|
Sent: li,
|
|
4454
4393
|
Received: ci
|
|
4455
4394
|
}, Ei = {
|
|
4456
4395
|
Image: Wr,
|
|
4457
4396
|
Video: di,
|
|
4458
|
-
Audio:
|
|
4397
|
+
Audio: Sr,
|
|
4459
4398
|
Pdf: ni,
|
|
4460
4399
|
File: Br
|
|
4461
4400
|
}, ui = ({
|
|
@@ -4480,7 +4419,7 @@ const Pr = ({
|
|
|
4480
4419
|
),
|
|
4481
4420
|
children: e
|
|
4482
4421
|
}
|
|
4483
|
-
),
|
|
4422
|
+
), Si = ({
|
|
4484
4423
|
faqs: e,
|
|
4485
4424
|
onFaqClick: t,
|
|
4486
4425
|
loadingFaqId: s,
|
|
@@ -4523,38 +4462,38 @@ const Pr = ({
|
|
|
4523
4462
|
] }) });
|
|
4524
4463
|
};
|
|
4525
4464
|
export {
|
|
4526
|
-
|
|
4527
|
-
|
|
4465
|
+
Qt as A,
|
|
4466
|
+
Vs as B,
|
|
4528
4467
|
qa as C,
|
|
4529
|
-
|
|
4530
|
-
|
|
4468
|
+
Ds as D,
|
|
4469
|
+
Si as F,
|
|
4531
4470
|
Ci as L,
|
|
4532
4471
|
Ni as M,
|
|
4533
|
-
|
|
4472
|
+
he as a,
|
|
4534
4473
|
ae as b,
|
|
4535
4474
|
sr as c,
|
|
4536
|
-
|
|
4475
|
+
dn as d,
|
|
4537
4476
|
_i as e,
|
|
4538
4477
|
ui as f,
|
|
4539
|
-
|
|
4540
|
-
|
|
4478
|
+
ne as g,
|
|
4479
|
+
Ot as h,
|
|
4541
4480
|
Ei as i,
|
|
4542
4481
|
_a as j,
|
|
4543
4482
|
wi as k,
|
|
4544
4483
|
yi as l,
|
|
4545
4484
|
Mr as m,
|
|
4546
|
-
|
|
4485
|
+
Ir as n,
|
|
4547
4486
|
tr as o,
|
|
4548
4487
|
Ar as p,
|
|
4549
|
-
|
|
4488
|
+
Xt as q,
|
|
4550
4489
|
le as r,
|
|
4551
|
-
|
|
4552
|
-
|
|
4490
|
+
nn as s,
|
|
4491
|
+
Os as t,
|
|
4553
4492
|
ki as u,
|
|
4554
4493
|
Gs as v,
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4494
|
+
Je as w,
|
|
4495
|
+
Ze as x,
|
|
4496
|
+
Wt as y,
|
|
4558
4497
|
ba as z
|
|
4559
4498
|
};
|
|
4560
|
-
//# sourceMappingURL=index-
|
|
4499
|
+
//# sourceMappingURL=index-C_NFzAB9.js.map
|