@linktr.ee/messaging-react 3.1.4-rc-1780636753 → 3.2.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-BkgsPkp4.cjs → Card-B5TCecD6.cjs} +2 -2
- package/dist/{Card-BkgsPkp4.cjs.map → Card-B5TCecD6.cjs.map} +1 -1
- package/dist/{Card-D_XOj1eE.cjs → Card-CO089n1e.cjs} +2 -2
- package/dist/{Card-D_XOj1eE.cjs.map → Card-CO089n1e.cjs.map} +1 -1
- package/dist/{Card-BwFdJXYm.js → Card-DQYLHbDI.js} +2 -2
- package/dist/{Card-BwFdJXYm.js.map → Card-DQYLHbDI.js.map} +1 -1
- package/dist/{Card-B9atg4sP.js → Card-DTaHgygz.js} +2 -2
- package/dist/{Card-B9atg4sP.js.map → Card-DTaHgygz.js.map} +1 -1
- package/dist/{Card-1U2tLPcp.cjs → Card-aO1qZWDU.cjs} +2 -2
- package/dist/{Card-1U2tLPcp.cjs.map → Card-aO1qZWDU.cjs.map} +1 -1
- package/dist/{Card-jyXjZZ0u.js → Card-bdnjL_4d.js} +3 -3
- package/dist/{Card-jyXjZZ0u.js.map → Card-bdnjL_4d.js.map} +1 -1
- package/dist/{LockedThumbnail-oxtdpgut.cjs → LockedThumbnail-CWVybsBb.cjs} +2 -2
- package/dist/{LockedThumbnail-oxtdpgut.cjs.map → LockedThumbnail-CWVybsBb.cjs.map} +1 -1
- package/dist/{LockedThumbnail-Dwt_goCX.js → LockedThumbnail-nsFA3DjA.js} +2 -2
- package/dist/{LockedThumbnail-Dwt_goCX.js.map → LockedThumbnail-nsFA3DjA.js.map} +1 -1
- package/dist/index-BO2VfA-M.cjs +2 -0
- package/dist/index-BO2VfA-M.cjs.map +1 -0
- package/dist/{index-CO975B6P.js → index-DJKFVBkP.js} +1108 -1143
- package/dist/index-DJKFVBkP.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -39
- package/dist/index.js +1 -1
- package/package.json +4 -3
- package/src/components/ChannelList/index.test.tsx +3 -151
- package/src/components/ChannelList/index.tsx +4 -72
- package/src/components/ChannelView.test.tsx +31 -0
- package/src/components/ChannelView.tsx +41 -30
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/index.ts +0 -1
- package/src/types.ts +10 -38
- package/dist/index-CO975B6P.js.map +0 -1
- package/dist/index-D4Dse1Lu.cjs +0 -2
- package/dist/index-D4Dse1Lu.cjs.map +0 -1
|
@@ -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 Be, XIcon as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import z, { createContext as He, useContext as Te, useCallback as W, useState as O, useRef as K, useEffect as J, useMemo as se, Suspense as Ye } from "react";
|
|
3
|
+
import { StreamChatService as En } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { Chat as In, DateSeparator as Sn, useChannelStateContext as de, useChatContext as qe, areMessageUIPropsEqual as Tn, useMessageReminder as An, useComponentContext as Ut, Attachment as Mn, EditMessageModal as Dn, MessageBlocked as Rn, MessageBouncePrompt as Ln, MessageDeleted as Pn, MessageIsThreadReplyInChannelButtonIndicator as On, MessageRepliesCountButton as zn, ReminderNotification as Fn, StreamedMessageText as $n, messageHasAttachments as Bn, messageHasReactions as jn, isDateSeparatorMessage as Un, isMessageBlocked as Vn, isMessageBounced as Gn, MessageBounceModal as Hn, MessageText as At, Poll as Yn, MessageErrorIcon as qn, useMessageContext as pe, useMessageComposer as Wn, useStateStore as Xn, MessageInput as Kn, useMessageInputContext as Jn, useMessageComposerHasSendableData as Zn, AttachmentPreviewList as Qn, QuotedMessagePreview as es, TextareaComposer as ts, MessageTimestamp as Re, AIStates as Le, useTypingContext as ns, useAIState as ss, Channel as as, WithComponents as rs, Window as is, MessageList as os, ChannelList as ls } from "stream-chat-react";
|
|
5
|
+
import { StarIcon as Be, XIcon as ve, SpinnerGapIcon as Pe, SignOutIcon as cs, ProhibitInsetIcon as Mt, FlagIcon as Vt, FileIcon as Gt, ImageIcon as ds, SpeakerHighIcon as us, VideoCameraIcon as Ht, FileMdIcon as ms, FileTextIcon as hs, FileZipIcon as fs, FilePptIcon as gs, FileCsvIcon as bs, FileXlsIcon as ps, FileDocIcon as vs, FilePdfIcon as xs, CircleNotchIcon as ge, PlayIcon as je, PauseIcon as ws, LinkIcon as Ns, DownloadSimpleIcon as be, GiftIcon as _s, ThumbsUpIcon as ys, ThumbsDownIcon as Cs, TrashSimpleIcon as ks, ArrowUpIcon as Es, SparkleIcon as Ue, ProhibitIcon as Is, ArrowLeftIcon as Dt, DotsThreeIcon as Rt, PencilSimpleIcon as Ss, CaretLeftIcon as Ts, CaretRightIcon as As } from "@phosphor-icons/react";
|
|
6
6
|
import C from "classnames";
|
|
7
|
-
import { MessageActions as
|
|
8
|
-
import { LinkPreviewsManager as
|
|
9
|
-
const
|
|
7
|
+
import { MessageActions as Ms, DefaultDropdownActionButton as Yt } from "stream-chat-react/experimental";
|
|
8
|
+
import { LinkPreviewsManager as Lt } from "stream-chat";
|
|
9
|
+
const qt = He({
|
|
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
|
-
}), We = () => Te(
|
|
19
|
+
}), We = () => Te(qt), xi = ({
|
|
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
|
-
(
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
const o = W(
|
|
28
|
+
(T, ...M) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${T}`, ...M);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
@@ -36,84 +36,84 @@ const Wt = He({
|
|
|
36
36
|
serviceConfig: !!s,
|
|
37
37
|
capabilities: Object.keys(r)
|
|
38
38
|
});
|
|
39
|
-
const [l, d] =
|
|
39
|
+
const [l, d] = O(null), [m, g] = O(null), [u, f] = O(!1), [c, b] = O(!1), [_, v] = O(null), w = K(!1), y = K({
|
|
40
40
|
userId: t == null ? void 0 : t.id,
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
renderCount:
|
|
44
|
+
}), S = K(0);
|
|
45
|
+
S.current++, o("📊 RENDER INFO", {
|
|
46
|
+
renderCount: S.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: y.current.userId !== (t == null ? void 0 : t.id),
|
|
50
|
+
apiKeyChanged: y.current.apiKey !== a,
|
|
51
|
+
serviceConfigChanged: y.current.serviceConfig !== s,
|
|
52
|
+
capabilitiesChanged: y.current.capabilities !== r
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), y.current = {
|
|
55
55
|
userId: t == null ? void 0 : t.id,
|
|
56
56
|
apiKey: a,
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
59
|
}, J(() => {
|
|
60
|
-
const
|
|
60
|
+
const T = S.current;
|
|
61
61
|
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
|
-
renderCount:
|
|
62
|
+
renderCount: T,
|
|
63
63
|
apiKey: !!a,
|
|
64
64
|
serviceConfig: !!s,
|
|
65
65
|
dependencies: {
|
|
66
66
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
67
67
|
serviceConfigRef: s,
|
|
68
|
-
serviceConfigStable:
|
|
69
|
-
apiKeyStable:
|
|
68
|
+
serviceConfigStable: y.current.serviceConfig === s,
|
|
69
|
+
apiKeyStable: y.current.apiKey === a
|
|
70
70
|
}
|
|
71
71
|
}), !a || !s) {
|
|
72
72
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
73
|
-
renderCount:
|
|
73
|
+
renderCount: T,
|
|
74
74
|
reason: "Missing apiKey or serviceConfig"
|
|
75
75
|
});
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
o("🚀 CREATING NEW SERVICE", {
|
|
79
|
-
renderCount:
|
|
79
|
+
renderCount: T,
|
|
80
80
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
|
-
serviceConfigChanged:
|
|
81
|
+
serviceConfigChanged: y.current.serviceConfig !== s
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const M = new En({
|
|
84
84
|
...s,
|
|
85
85
|
apiKey: a,
|
|
86
86
|
debug: i
|
|
87
87
|
});
|
|
88
|
-
return d(
|
|
89
|
-
renderCount:
|
|
90
|
-
serviceInstance: !!
|
|
88
|
+
return d(M), o("✅ SERVICE SET", {
|
|
89
|
+
renderCount: T,
|
|
90
|
+
serviceInstance: !!M
|
|
91
91
|
}), () => {
|
|
92
92
|
o("🧹 SERVICE CLEANUP", {
|
|
93
|
-
renderCount:
|
|
93
|
+
renderCount: T,
|
|
94
94
|
reason: "Effect cleanup"
|
|
95
|
-
}),
|
|
95
|
+
}), M.disconnectUser().catch(console.error);
|
|
96
96
|
};
|
|
97
97
|
}, [a, s, i, o]);
|
|
98
|
-
const
|
|
98
|
+
const k = K(null);
|
|
99
99
|
J(() => {
|
|
100
|
-
var
|
|
100
|
+
var M, N;
|
|
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: w.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 (w.current) {
|
|
113
113
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (((
|
|
116
|
+
if (((M = k.current) == null ? void 0 : M.serviceId) === l && ((N = k.current) == null ? void 0 : N.userId) === t.id) {
|
|
117
117
|
o(
|
|
118
118
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
119
|
"Already connected this user with this service"
|
|
@@ -121,22 +121,22 @@ 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 }), w.current = !0, b(!0), v(null);
|
|
125
125
|
try {
|
|
126
126
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
-
const
|
|
128
|
-
g(
|
|
127
|
+
const E = await l.connectUser(t);
|
|
128
|
+
g(E), f(!0), k.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
130
|
+
clientId: E.userID
|
|
131
131
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const
|
|
134
|
-
v(
|
|
132
|
+
} catch (E) {
|
|
133
|
+
const I = E instanceof Error ? E.message : "Connection failed";
|
|
134
|
+
v(I), o("❌ USER CONNECTION ERROR", {
|
|
135
135
|
userId: t.id,
|
|
136
|
-
error:
|
|
136
|
+
error: I
|
|
137
137
|
});
|
|
138
138
|
} finally {
|
|
139
|
-
|
|
139
|
+
b(!1), w.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
140
140
|
userId: t.id,
|
|
141
141
|
isConnected: u
|
|
142
142
|
});
|
|
@@ -149,12 +149,12 @@ const Wt = He({
|
|
|
149
149
|
l && u ? (o(
|
|
150
150
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
151
151
|
"Cleaning up connection on unmount"
|
|
152
|
-
),
|
|
152
|
+
), k.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 A = 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 }), b(!0);
|
|
166
166
|
try {
|
|
167
167
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
168
|
-
const
|
|
169
|
-
g(
|
|
170
|
-
} catch (
|
|
171
|
-
const
|
|
172
|
-
v(
|
|
168
|
+
const T = await l.connectUser(t);
|
|
169
|
+
g(T), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
170
|
+
} catch (T) {
|
|
171
|
+
const M = T instanceof Error ? T.message : "Refresh failed";
|
|
172
|
+
v(M), o("❌ CONNECTION REFRESH ERROR", {
|
|
173
173
|
userId: t.id,
|
|
174
|
-
error:
|
|
174
|
+
error: M
|
|
175
175
|
});
|
|
176
176
|
} finally {
|
|
177
|
-
|
|
177
|
+
b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
178
|
}
|
|
179
|
-
}, [l, t, o]),
|
|
179
|
+
}, [l, t, o]), D = 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: !!_,
|
|
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: _,
|
|
192
192
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
193
|
+
refreshConnection: A,
|
|
194
194
|
debug: i
|
|
195
195
|
}), [
|
|
196
196
|
l,
|
|
197
197
|
m,
|
|
198
198
|
u,
|
|
199
199
|
c,
|
|
200
|
-
|
|
200
|
+
_,
|
|
201
201
|
r,
|
|
202
|
-
|
|
202
|
+
A,
|
|
203
203
|
i,
|
|
204
204
|
o
|
|
205
205
|
]);
|
|
206
206
|
return o("🔄 RENDER END", {
|
|
207
|
-
renderCount:
|
|
207
|
+
renderCount: S.current,
|
|
208
208
|
willRenderChat: !!(m && u),
|
|
209
|
-
contextValueReady: !!
|
|
210
|
-
}), /* @__PURE__ */ n(
|
|
211
|
-
|
|
209
|
+
contextValueReady: !!D
|
|
210
|
+
}), /* @__PURE__ */ n(qt.Provider, { value: D, children: m && u ? /* @__PURE__ */ n(
|
|
211
|
+
In,
|
|
212
212
|
{
|
|
213
213
|
client: m,
|
|
214
214
|
customClasses: {
|
|
@@ -217,9 +217,9 @@ const Wt = He({
|
|
|
217
217
|
children: e
|
|
218
218
|
}
|
|
219
219
|
) : e });
|
|
220
|
-
},
|
|
220
|
+
}, Ds = () => We(), Wt = (e) => {
|
|
221
221
|
var a, r;
|
|
222
|
-
const [t, s] =
|
|
222
|
+
const [t, s] = O(
|
|
223
223
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
224
224
|
);
|
|
225
225
|
return J(() => {
|
|
@@ -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
|
+
}, Rs = /^[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 Ls(e) {
|
|
244
|
+
return Rs.test(e.trim());
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Pt(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 : !Ls(s);
|
|
249
249
|
}
|
|
250
250
|
function Ae(e) {
|
|
251
|
-
return
|
|
251
|
+
return Pt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Pt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
252
252
|
}
|
|
253
|
-
const
|
|
253
|
+
const Ot = [
|
|
254
254
|
"🍎",
|
|
255
255
|
// Apple
|
|
256
256
|
"🍌",
|
|
@@ -278,7 +278,7 @@ const zt = [
|
|
|
278
278
|
"🍈"
|
|
279
279
|
// Melon
|
|
280
280
|
];
|
|
281
|
-
function
|
|
281
|
+
function Ps(e) {
|
|
282
282
|
let t = 0;
|
|
283
283
|
for (let s = 0; s < e.length; s++) {
|
|
284
284
|
const a = e.charCodeAt(s);
|
|
@@ -286,11 +286,11 @@ function Os(e) {
|
|
|
286
286
|
}
|
|
287
287
|
return Math.abs(t);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const s =
|
|
291
|
-
return
|
|
289
|
+
function Os(e) {
|
|
290
|
+
const s = Ps(e) % Ot.length;
|
|
291
|
+
return Ot[s];
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const re = ({
|
|
294
294
|
id: e,
|
|
295
295
|
image: t,
|
|
296
296
|
size: s = 40,
|
|
@@ -299,7 +299,7 @@ const ae = ({
|
|
|
299
299
|
shape: i = "squircle",
|
|
300
300
|
dmAgentEnabled: o = !1
|
|
301
301
|
}) => {
|
|
302
|
-
const l =
|
|
302
|
+
const l = Os(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
303
303
|
"img",
|
|
304
304
|
{
|
|
305
305
|
src: t,
|
|
@@ -361,7 +361,7 @@ const ae = ({
|
|
|
361
361
|
]
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
|
-
},
|
|
364
|
+
}, Ce = ({
|
|
365
365
|
variant: e = "default",
|
|
366
366
|
className: t,
|
|
367
367
|
children: s,
|
|
@@ -379,7 +379,7 @@ const ae = ({
|
|
|
379
379
|
children: s
|
|
380
380
|
}
|
|
381
381
|
);
|
|
382
|
-
function
|
|
382
|
+
function zs({ label: e, className: t, children: s, ...a }) {
|
|
383
383
|
return /* @__PURE__ */ h(
|
|
384
384
|
"button",
|
|
385
385
|
{
|
|
@@ -400,10 +400,10 @@ function Fs({ label: e, className: t, children: s, ...a }) {
|
|
|
400
400
|
}
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
return /* @__PURE__ */ n(
|
|
403
|
+
function Fs({ onClick: e }) {
|
|
404
|
+
return /* @__PURE__ */ n(zs, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(ve, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
405
405
|
}
|
|
406
|
-
const
|
|
406
|
+
const $s = ({
|
|
407
407
|
dialogRef: e,
|
|
408
408
|
onClose: t,
|
|
409
409
|
participant: s,
|
|
@@ -418,69 +418,69 @@ const Bs = ({
|
|
|
418
418
|
onDeleteConversationClick: u,
|
|
419
419
|
onBlockParticipantClick: f,
|
|
420
420
|
onReportParticipantClick: c,
|
|
421
|
-
customProfileContent:
|
|
422
|
-
customChannelActions:
|
|
421
|
+
customProfileContent: b,
|
|
422
|
+
customChannelActions: _
|
|
423
423
|
}) => {
|
|
424
|
-
var
|
|
425
|
-
const { service: v, debug:
|
|
426
|
-
var
|
|
427
|
-
if (!(!m || !v || !((
|
|
424
|
+
var F, Y, q, $;
|
|
425
|
+
const { service: v, debug: w } = We(), [y, S] = O(!1), [k, A] = O(!1), [D, T] = O(!1), M = W(async () => {
|
|
426
|
+
var p;
|
|
427
|
+
if (!(!m || !v || !((p = s == null ? void 0 : s.user) != null && p.id)))
|
|
428
428
|
try {
|
|
429
|
-
const
|
|
430
|
-
(
|
|
431
|
-
var
|
|
432
|
-
return
|
|
429
|
+
const L = (await v.getBlockedUsers()).some(
|
|
430
|
+
(U) => {
|
|
431
|
+
var R;
|
|
432
|
+
return U.blocked_user_id === ((R = s == null ? void 0 : s.user) == null ? void 0 : R.id);
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
|
-
|
|
436
|
-
} catch (
|
|
435
|
+
S(L);
|
|
436
|
+
} catch (x) {
|
|
437
437
|
console.error(
|
|
438
438
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
439
|
-
|
|
439
|
+
x
|
|
440
440
|
);
|
|
441
441
|
}
|
|
442
|
-
}, [v, (
|
|
442
|
+
}, [v, (F = s == null ? void 0 : s.user) == null ? void 0 : F.id, m]);
|
|
443
443
|
J(() => {
|
|
444
|
-
|
|
445
|
-
}, [
|
|
446
|
-
const
|
|
447
|
-
var
|
|
448
|
-
if (!
|
|
449
|
-
u == null || u(),
|
|
444
|
+
M();
|
|
445
|
+
}, [M]);
|
|
446
|
+
const N = async () => {
|
|
447
|
+
var p;
|
|
448
|
+
if (!k) {
|
|
449
|
+
u == null || u(), w && console.log("[ChannelInfoDialog] Leave conversation", r.cid), A(!0);
|
|
450
450
|
try {
|
|
451
|
-
const
|
|
452
|
-
await r.hide(
|
|
453
|
-
} catch (
|
|
454
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
451
|
+
const x = ((p = r._client) == null ? void 0 : p.userID) ?? null;
|
|
452
|
+
await r.hide(x, !1), o && await o(r), t();
|
|
453
|
+
} catch (x) {
|
|
454
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", x);
|
|
455
455
|
} finally {
|
|
456
|
-
|
|
456
|
+
A(!1);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
},
|
|
460
|
-
var
|
|
461
|
-
if (!(
|
|
462
|
-
f == null || f(),
|
|
459
|
+
}, E = async () => {
|
|
460
|
+
var p, x, L;
|
|
461
|
+
if (!(D || !v)) {
|
|
462
|
+
f == null || f(), w && console.log("[ChannelInfoDialog] Block member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), T(!0);
|
|
463
463
|
try {
|
|
464
|
-
await v.blockUser((
|
|
465
|
-
} catch (
|
|
466
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
464
|
+
await v.blockUser((x = s == null ? void 0 : s.user) == null ? void 0 : x.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
|
|
465
|
+
} catch (U) {
|
|
466
|
+
console.error("[ChannelInfoDialog] Failed to block member", U);
|
|
467
467
|
} finally {
|
|
468
|
-
|
|
468
|
+
T(!1);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
},
|
|
472
|
-
var
|
|
473
|
-
if (!(
|
|
474
|
-
f == null || f(),
|
|
471
|
+
}, I = async () => {
|
|
472
|
+
var p, x, L;
|
|
473
|
+
if (!(D || !v)) {
|
|
474
|
+
f == null || f(), w && console.log("[ChannelInfoDialog] Unblock member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), T(!0);
|
|
475
475
|
try {
|
|
476
|
-
await v.unBlockUser((
|
|
477
|
-
} catch (
|
|
478
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
476
|
+
await v.unBlockUser((x = s == null ? void 0 : s.user) == null ? void 0 : x.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
|
|
477
|
+
} catch (U) {
|
|
478
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", U);
|
|
479
479
|
} finally {
|
|
480
|
-
|
|
480
|
+
T(!1);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
},
|
|
483
|
+
}, B = () => {
|
|
484
484
|
c == null || c(), t(), window.open(
|
|
485
485
|
"https://linktr.ee/s/about/trust-center/report",
|
|
486
486
|
"_blank",
|
|
@@ -488,7 +488,7 @@ const Bs = ({
|
|
|
488
488
|
);
|
|
489
489
|
};
|
|
490
490
|
if (!s) return null;
|
|
491
|
-
const
|
|
491
|
+
const P = a ?? Ae(s.user), Z = (Y = s.user) == null ? void 0 : Y.image, G = (q = s.user) == null ? void 0 : q.username, H = G ? `linktr.ee/${G}` : void 0, j = (($ = s.user) == null ? void 0 : $.id) || "unknown";
|
|
492
492
|
return (
|
|
493
493
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
494
494
|
/* @__PURE__ */ n(
|
|
@@ -497,13 +497,13 @@ const Bs = ({
|
|
|
497
497
|
ref: e,
|
|
498
498
|
className: "mes-dialog group",
|
|
499
499
|
onClose: t,
|
|
500
|
-
onClick: (
|
|
501
|
-
|
|
500
|
+
onClick: (p) => {
|
|
501
|
+
p.target === e.current && t();
|
|
502
502
|
},
|
|
503
503
|
children: /* @__PURE__ */ h("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
504
504
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
505
505
|
/* @__PURE__ */ n("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
506
|
-
/* @__PURE__ */ n(
|
|
506
|
+
/* @__PURE__ */ n(Fs, { onClick: t })
|
|
507
507
|
] }),
|
|
508
508
|
/* @__PURE__ */ h("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
509
509
|
/* @__PURE__ */ h(
|
|
@@ -514,19 +514,19 @@ const Bs = ({
|
|
|
514
514
|
children: [
|
|
515
515
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-3 w-full", children: [
|
|
516
516
|
/* @__PURE__ */ n(
|
|
517
|
-
|
|
517
|
+
re,
|
|
518
518
|
{
|
|
519
|
-
id:
|
|
520
|
-
name:
|
|
519
|
+
id: j,
|
|
520
|
+
name: P,
|
|
521
521
|
image: Z,
|
|
522
522
|
size: 88,
|
|
523
523
|
shape: "circle"
|
|
524
524
|
}
|
|
525
525
|
),
|
|
526
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:
|
|
528
|
-
|
|
529
|
-
i && !
|
|
527
|
+
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: P }),
|
|
528
|
+
H && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: H }),
|
|
529
|
+
i && !b && /* @__PURE__ */ n(
|
|
530
530
|
"span",
|
|
531
531
|
{
|
|
532
532
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -542,76 +542,76 @@ const Bs = ({
|
|
|
542
542
|
)
|
|
543
543
|
] })
|
|
544
544
|
] }),
|
|
545
|
-
|
|
545
|
+
b && /* @__PURE__ */ n("div", { className: "w-full", children: b })
|
|
546
546
|
]
|
|
547
547
|
}
|
|
548
548
|
),
|
|
549
549
|
/* @__PURE__ */ h("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
550
550
|
d && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
551
|
-
|
|
551
|
+
Ce,
|
|
552
552
|
{
|
|
553
|
-
onClick:
|
|
554
|
-
disabled:
|
|
555
|
-
"aria-busy":
|
|
553
|
+
onClick: N,
|
|
554
|
+
disabled: k,
|
|
555
|
+
"aria-busy": k,
|
|
556
556
|
children: [
|
|
557
|
-
|
|
557
|
+
k ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(cs, { className: "h-5 w-5" }),
|
|
558
558
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
559
559
|
]
|
|
560
560
|
}
|
|
561
561
|
) }),
|
|
562
|
-
m && /* @__PURE__ */ n("li", { children:
|
|
563
|
-
|
|
562
|
+
m && /* @__PURE__ */ n("li", { children: y ? /* @__PURE__ */ h(
|
|
563
|
+
Ce,
|
|
564
564
|
{
|
|
565
|
-
onClick:
|
|
566
|
-
disabled:
|
|
567
|
-
"aria-busy":
|
|
565
|
+
onClick: I,
|
|
566
|
+
disabled: D,
|
|
567
|
+
"aria-busy": D,
|
|
568
568
|
children: [
|
|
569
|
-
|
|
569
|
+
D ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
570
570
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
571
571
|
]
|
|
572
572
|
}
|
|
573
573
|
) : /* @__PURE__ */ h(
|
|
574
|
-
|
|
574
|
+
Ce,
|
|
575
575
|
{
|
|
576
|
-
onClick:
|
|
577
|
-
disabled:
|
|
578
|
-
"aria-busy":
|
|
576
|
+
onClick: E,
|
|
577
|
+
disabled: D,
|
|
578
|
+
"aria-busy": D,
|
|
579
579
|
children: [
|
|
580
|
-
|
|
580
|
+
D ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
581
581
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
) }),
|
|
585
|
-
g && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
586
|
-
/* @__PURE__ */ n(
|
|
585
|
+
g && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(Ce, { variant: "danger", onClick: B, children: [
|
|
586
|
+
/* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
|
|
587
587
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
588
588
|
] }) }),
|
|
589
|
-
|
|
589
|
+
_
|
|
590
590
|
] })
|
|
591
591
|
] })
|
|
592
592
|
] })
|
|
593
593
|
}
|
|
594
594
|
)
|
|
595
595
|
);
|
|
596
|
-
},
|
|
597
|
-
function
|
|
598
|
-
return e != null && e.length ? e.some((t) => t.type === Ge) ? "down" : e.some((t) => t.type ===
|
|
596
|
+
}, Bs = (e) => /* @__PURE__ */ n(Sn, { ...e, position: "center" }), Ve = "vote_up", Ge = "vote_down";
|
|
597
|
+
function js(e) {
|
|
598
|
+
return e != null && e.length ? e.some((t) => t.type === Ge) ? "down" : e.some((t) => t.type === Ve) ? "up" : null : null;
|
|
599
599
|
}
|
|
600
600
|
function Us(e) {
|
|
601
|
-
const { channel: t } =
|
|
602
|
-
() =>
|
|
601
|
+
const { channel: t } = de(), { client: s } = qe("useMessageVote"), a = se(
|
|
602
|
+
() => js(e.own_reactions),
|
|
603
603
|
[e.own_reactions]
|
|
604
|
-
), r =
|
|
604
|
+
), r = W(async () => {
|
|
605
605
|
if (s != null && s.userID)
|
|
606
606
|
try {
|
|
607
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
607
|
+
a === "up" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
|
|
608
608
|
e.id,
|
|
609
|
-
{ type:
|
|
609
|
+
{ type: Ve },
|
|
610
610
|
{ enforce_unique: !0, skip_push: !0 }
|
|
611
611
|
);
|
|
612
612
|
} catch {
|
|
613
613
|
}
|
|
614
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
614
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = W(async () => {
|
|
615
615
|
if (s != null && s.userID)
|
|
616
616
|
try {
|
|
617
617
|
a === "down" ? await t.deleteReaction(e.id, Ge) : await t.sendReaction(
|
|
@@ -624,24 +624,24 @@ function Us(e) {
|
|
|
624
624
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
625
625
|
return { selected: a, voteUp: r, voteDown: i };
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function Vs(e) {
|
|
628
628
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Xt({
|
|
631
631
|
message: e,
|
|
632
632
|
viewerLanguage: t
|
|
633
633
|
}) {
|
|
634
634
|
var r;
|
|
635
|
-
const s = e == null ? void 0 : e.text, a =
|
|
635
|
+
const s = e == null ? void 0 : e.text, a = Vs(t);
|
|
636
636
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
637
637
|
}
|
|
638
|
-
const
|
|
638
|
+
const Gs = z.lazy(() => import("./Card-DQYLHbDI.js")), Hs = z.lazy(() => import("./Card-DTaHgygz.js")), Ys = z.lazy(() => import("./Card-bdnjL_4d.js")), Xe = () => /* @__PURE__ */ n(
|
|
639
639
|
"div",
|
|
640
640
|
{
|
|
641
641
|
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
642
|
"aria-hidden": !0
|
|
643
643
|
}
|
|
644
|
-
),
|
|
644
|
+
), qs = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Gs, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Hs, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Ys, { ...e }) }), Ws = Kt, Xs = Jt, zt = { Composer: qs, Sent: Kt, Received: Jt, Creator: Ws, Visitor: Xs }, Ks = [
|
|
645
645
|
[/pdf/, "pdf"],
|
|
646
646
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
647
647
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -651,42 +651,42 @@ const Hs = R.lazy(() => import("./Card-BwFdJXYm.js")), Ys = R.lazy(() => import(
|
|
|
651
651
|
[/plain|rtf/, "text"],
|
|
652
652
|
[/markdown/, "markdown"]
|
|
653
653
|
];
|
|
654
|
-
function
|
|
654
|
+
function ie(e) {
|
|
655
655
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
const t =
|
|
657
|
+
function Zt(e) {
|
|
658
|
+
const t = Ks.find(
|
|
659
659
|
([s]) => s.test(e)
|
|
660
660
|
);
|
|
661
661
|
return t ? t[1] : "generic";
|
|
662
662
|
}
|
|
663
|
-
const
|
|
664
|
-
video:
|
|
665
|
-
audio:
|
|
666
|
-
image:
|
|
667
|
-
document:
|
|
668
|
-
},
|
|
669
|
-
pdf:
|
|
670
|
-
doc:
|
|
671
|
-
xls:
|
|
672
|
-
csv:
|
|
673
|
-
ppt:
|
|
674
|
-
zip:
|
|
675
|
-
text:
|
|
676
|
-
markdown:
|
|
677
|
-
generic:
|
|
663
|
+
const Js = {
|
|
664
|
+
video: Ht,
|
|
665
|
+
audio: us,
|
|
666
|
+
image: ds,
|
|
667
|
+
document: Gt
|
|
668
|
+
}, Zs = {
|
|
669
|
+
pdf: xs,
|
|
670
|
+
doc: vs,
|
|
671
|
+
xls: ps,
|
|
672
|
+
csv: bs,
|
|
673
|
+
ppt: gs,
|
|
674
|
+
zip: fs,
|
|
675
|
+
text: hs,
|
|
676
|
+
markdown: ms,
|
|
677
|
+
generic: Gt
|
|
678
678
|
};
|
|
679
|
-
function
|
|
680
|
-
const t =
|
|
681
|
-
return t !== "document" ?
|
|
679
|
+
function Qs(e) {
|
|
680
|
+
const t = ie(e);
|
|
681
|
+
return t !== "document" ? Js[t] : Zs[Zt(e)];
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
return
|
|
683
|
+
function ce(e, t) {
|
|
684
|
+
return z.createElement(Qs(e), t);
|
|
685
685
|
}
|
|
686
|
-
const
|
|
686
|
+
const ea = (e) => {
|
|
687
687
|
var t, s;
|
|
688
688
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
689
|
-
},
|
|
689
|
+
}, ta = ({
|
|
690
690
|
source: e,
|
|
691
691
|
mimeType: t,
|
|
692
692
|
poster: s,
|
|
@@ -698,78 +698,78 @@ const ta = (e) => {
|
|
|
698
698
|
muted: d = !1,
|
|
699
699
|
onContainerClick: m
|
|
700
700
|
}) => {
|
|
701
|
-
const g =
|
|
702
|
-
|
|
703
|
-
}, []),
|
|
704
|
-
const
|
|
705
|
-
if (!
|
|
706
|
-
const
|
|
701
|
+
const g = ie(t), u = K(null), f = K(null), c = K(null), b = K(r), [_, v] = O(a), [w, y] = O(0), [S, k] = O(!1), [A, D] = O(!1), [T, M] = O(!1), [N, E] = O(!1), [I, B] = O(!0), [P, Z] = O(null), G = W(() => {
|
|
702
|
+
M(!1), v(!0);
|
|
703
|
+
}, []), H = W((p) => {
|
|
704
|
+
const x = f.current;
|
|
705
|
+
if (!x) return 0;
|
|
706
|
+
const L = x.getBoundingClientRect();
|
|
707
707
|
return Math.max(
|
|
708
708
|
0,
|
|
709
|
-
Math.min(1, (
|
|
709
|
+
Math.min(1, (ea(p) - L.left) / L.width)
|
|
710
710
|
);
|
|
711
|
-
}, []),
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
}, []),
|
|
715
|
-
|
|
716
|
-
const
|
|
717
|
-
|
|
711
|
+
}, []), j = W((p) => {
|
|
712
|
+
const x = u.current;
|
|
713
|
+
x && x.duration && (x.currentTime = p * x.duration);
|
|
714
|
+
}, []), F = (p) => {
|
|
715
|
+
p.stopPropagation(), k(!0);
|
|
716
|
+
const x = H(p);
|
|
717
|
+
y(x), j(x);
|
|
718
718
|
};
|
|
719
719
|
J(() => {
|
|
720
|
-
r !== void 0 && r !==
|
|
720
|
+
r !== void 0 && r !== b.current && (b.current = r, v(r));
|
|
721
721
|
}, [r]), J(() => {
|
|
722
|
-
if (!
|
|
722
|
+
if (!_) {
|
|
723
723
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
|
-
const
|
|
727
|
-
const
|
|
728
|
-
|
|
726
|
+
const p = () => {
|
|
727
|
+
const x = u.current;
|
|
728
|
+
x && x.duration && !S && y(x.currentTime / x.duration), c.current = requestAnimationFrame(p);
|
|
729
729
|
};
|
|
730
|
-
return c.current = requestAnimationFrame(
|
|
730
|
+
return c.current = requestAnimationFrame(p), () => {
|
|
731
731
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
732
732
|
};
|
|
733
|
-
}, [
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
v(!1),
|
|
737
|
-
}) :
|
|
738
|
-
}, [
|
|
739
|
-
if (!
|
|
740
|
-
const
|
|
741
|
-
|
|
733
|
+
}, [_, S]), J(() => {
|
|
734
|
+
const p = u.current;
|
|
735
|
+
p && (_ ? p.play().catch((x) => {
|
|
736
|
+
v(!1), M(!0);
|
|
737
|
+
}) : p.pause());
|
|
738
|
+
}, [_]), J(() => {
|
|
739
|
+
if (!S) return;
|
|
740
|
+
const p = (L) => y(H(L)), x = (L) => {
|
|
741
|
+
k(!1), j(H(L));
|
|
742
742
|
};
|
|
743
|
-
return window.addEventListener("mousemove",
|
|
744
|
-
window.removeEventListener("mousemove",
|
|
743
|
+
return window.addEventListener("mousemove", p), window.addEventListener("mouseup", x), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", x), () => {
|
|
744
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", x), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", x);
|
|
745
745
|
};
|
|
746
|
-
}, [
|
|
747
|
-
const
|
|
746
|
+
}, [S, H, j]);
|
|
747
|
+
const Y = P ? { aspectRatio: String(P) } : void 0, q = P ? "" : " aspect-video", $ = Math.round(w * 100);
|
|
748
748
|
return /* @__PURE__ */ h(
|
|
749
749
|
"div",
|
|
750
750
|
{
|
|
751
751
|
role: "button",
|
|
752
752
|
tabIndex: 0,
|
|
753
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
754
|
-
style:
|
|
755
|
-
onClick: (
|
|
753
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${q}`,
|
|
754
|
+
style: Y,
|
|
755
|
+
onClick: (p) => {
|
|
756
756
|
if (m) {
|
|
757
|
-
m(
|
|
757
|
+
m(p);
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
|
-
|
|
760
|
+
T || o && v((x) => !x);
|
|
761
761
|
},
|
|
762
|
-
onKeyDown: (
|
|
763
|
-
if (!(
|
|
764
|
-
if (
|
|
765
|
-
m(
|
|
762
|
+
onKeyDown: (p) => {
|
|
763
|
+
if (!(p.key !== "Enter" && p.key !== " ")) {
|
|
764
|
+
if (p.preventDefault(), m) {
|
|
765
|
+
m(p);
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
T || o && v((x) => !x);
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
771
|
children: [
|
|
772
|
-
s && (g === "audio" ||
|
|
772
|
+
s && (g === "audio" || I) && /* @__PURE__ */ n(
|
|
773
773
|
"img",
|
|
774
774
|
{
|
|
775
775
|
src: s,
|
|
@@ -777,7 +777,7 @@ const ta = (e) => {
|
|
|
777
777
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
778
778
|
}
|
|
779
779
|
),
|
|
780
|
-
!s && (g === "audio" ||
|
|
780
|
+
!s && (g === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
781
781
|
className: "size-12 text-black/20",
|
|
782
782
|
weight: "regular"
|
|
783
783
|
}) }),
|
|
@@ -789,14 +789,14 @@ const ta = (e) => {
|
|
|
789
789
|
loop: i,
|
|
790
790
|
muted: d,
|
|
791
791
|
style: { width: "100%", height: "100%" },
|
|
792
|
-
onLoadStart: () =>
|
|
792
|
+
onLoadStart: () => E(!0),
|
|
793
793
|
onCanPlay: () => {
|
|
794
|
-
|
|
794
|
+
E(!1), B(!1);
|
|
795
795
|
},
|
|
796
|
-
onWaiting: () =>
|
|
797
|
-
onPlay: () =>
|
|
796
|
+
onWaiting: () => E(!0),
|
|
797
|
+
onPlay: () => M(!1),
|
|
798
798
|
onEnded: () => {
|
|
799
|
-
i || (v(!1),
|
|
799
|
+
i || (v(!1), y(0));
|
|
800
800
|
},
|
|
801
801
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
802
802
|
}
|
|
@@ -809,41 +809,41 @@ const ta = (e) => {
|
|
|
809
809
|
muted: d,
|
|
810
810
|
playsInline: !0,
|
|
811
811
|
style: { width: "100%", height: "100%" },
|
|
812
|
-
onLoadStart: () =>
|
|
812
|
+
onLoadStart: () => E(!0),
|
|
813
813
|
onCanPlay: () => {
|
|
814
|
-
|
|
814
|
+
E(!1), B(!1);
|
|
815
815
|
},
|
|
816
|
-
onWaiting: () =>
|
|
817
|
-
onPlay: () =>
|
|
816
|
+
onWaiting: () => E(!0),
|
|
817
|
+
onPlay: () => M(!1),
|
|
818
818
|
onLoadedMetadata: () => {
|
|
819
|
-
const
|
|
820
|
-
|
|
819
|
+
const p = u.current;
|
|
820
|
+
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && Z(p.videoWidth / p.videoHeight);
|
|
821
821
|
},
|
|
822
822
|
onEnded: () => {
|
|
823
|
-
i || (v(!1),
|
|
823
|
+
i || (v(!1), y(0));
|
|
824
824
|
},
|
|
825
825
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
826
826
|
}
|
|
827
827
|
) }),
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
N && !T && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
829
|
+
ge,
|
|
830
830
|
{
|
|
831
831
|
className: "size-8 animate-spin text-white/80",
|
|
832
832
|
weight: "bold"
|
|
833
833
|
}
|
|
834
834
|
) }),
|
|
835
|
-
|
|
835
|
+
T && !o && /* @__PURE__ */ n(
|
|
836
836
|
"div",
|
|
837
837
|
{
|
|
838
838
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
839
839
|
role: "button",
|
|
840
840
|
tabIndex: 0,
|
|
841
841
|
"aria-label": "Play preview",
|
|
842
|
-
onClick: (
|
|
843
|
-
|
|
842
|
+
onClick: (p) => {
|
|
843
|
+
p.stopPropagation(), G();
|
|
844
844
|
},
|
|
845
|
-
onKeyDown: (
|
|
846
|
-
|
|
845
|
+
onKeyDown: (p) => {
|
|
846
|
+
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), G());
|
|
847
847
|
},
|
|
848
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(je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
849
849
|
}
|
|
@@ -859,11 +859,11 @@ const ta = (e) => {
|
|
|
859
859
|
tabIndex: 0,
|
|
860
860
|
ref: f,
|
|
861
861
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
862
|
-
onMouseDown:
|
|
863
|
-
onTouchStart:
|
|
864
|
-
onClick: (
|
|
865
|
-
onKeyDown: (
|
|
866
|
-
|
|
862
|
+
onMouseDown: F,
|
|
863
|
+
onTouchStart: F,
|
|
864
|
+
onClick: (p) => p.stopPropagation(),
|
|
865
|
+
onKeyDown: (p) => {
|
|
866
|
+
p.key === "ArrowRight" && j(Math.min(1, w + 0.05)), p.key === "ArrowLeft" && j(Math.max(0, w - 0.05));
|
|
867
867
|
},
|
|
868
868
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
869
869
|
"div",
|
|
@@ -879,12 +879,12 @@ const ta = (e) => {
|
|
|
879
879
|
"button",
|
|
880
880
|
{
|
|
881
881
|
type: "button",
|
|
882
|
-
onClick: (
|
|
883
|
-
|
|
882
|
+
onClick: (p) => {
|
|
883
|
+
p.stopPropagation(), v((x) => !x);
|
|
884
884
|
},
|
|
885
885
|
className: "shrink-0 text-white",
|
|
886
|
-
"aria-label":
|
|
887
|
-
children:
|
|
886
|
+
"aria-label": _ ? "Pause" : "Play",
|
|
887
|
+
children: _ ? /* @__PURE__ */ n(ws, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(je, { className: "size-5 translate-x-px", weight: "fill" })
|
|
888
888
|
}
|
|
889
889
|
),
|
|
890
890
|
/* @__PURE__ */ h(
|
|
@@ -898,19 +898,19 @@ const ta = (e) => {
|
|
|
898
898
|
tabIndex: 0,
|
|
899
899
|
ref: f,
|
|
900
900
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
901
|
-
onMouseDown:
|
|
902
|
-
onTouchStart:
|
|
903
|
-
onClick: (
|
|
904
|
-
onMouseEnter: () =>
|
|
905
|
-
onMouseLeave: () =>
|
|
906
|
-
onKeyDown: (
|
|
907
|
-
|
|
901
|
+
onMouseDown: F,
|
|
902
|
+
onTouchStart: F,
|
|
903
|
+
onClick: (p) => p.stopPropagation(),
|
|
904
|
+
onMouseEnter: () => D(!0),
|
|
905
|
+
onMouseLeave: () => D(!1),
|
|
906
|
+
onKeyDown: (p) => {
|
|
907
|
+
p.key === "ArrowRight" && j(Math.min(1, w + 0.05)), p.key === "ArrowLeft" && j(Math.max(0, w - 0.05));
|
|
908
908
|
},
|
|
909
909
|
children: [
|
|
910
910
|
/* @__PURE__ */ n(
|
|
911
911
|
"div",
|
|
912
912
|
{
|
|
913
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
913
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${A || S ? "h-1.5" : "h-1"}`,
|
|
914
914
|
children: /* @__PURE__ */ n(
|
|
915
915
|
"div",
|
|
916
916
|
{
|
|
@@ -923,7 +923,7 @@ const ta = (e) => {
|
|
|
923
923
|
/* @__PURE__ */ n(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
926
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
926
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${A || S ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
927
927
|
style: { left: `${$}%` }
|
|
928
928
|
}
|
|
929
929
|
)
|
|
@@ -934,7 +934,7 @@ const ta = (e) => {
|
|
|
934
934
|
]
|
|
935
935
|
}
|
|
936
936
|
);
|
|
937
|
-
},
|
|
937
|
+
}, Ft = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", na = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Qt = ({
|
|
938
938
|
mimeType: e,
|
|
939
939
|
sourceUrl: t,
|
|
940
940
|
thumbnailUrl: s,
|
|
@@ -943,9 +943,9 @@ const ta = (e) => {
|
|
|
943
943
|
mediaPlayerProps: i,
|
|
944
944
|
containedImage: o = !1
|
|
945
945
|
}) => {
|
|
946
|
-
const l =
|
|
946
|
+
const l = ie(e), [d, m] = O(!1);
|
|
947
947
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
948
|
-
|
|
948
|
+
ta,
|
|
949
949
|
{
|
|
950
950
|
source: t,
|
|
951
951
|
mimeType: e,
|
|
@@ -991,12 +991,12 @@ const ta = (e) => {
|
|
|
991
991
|
"div",
|
|
992
992
|
{
|
|
993
993
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
994
|
-
children:
|
|
995
|
-
className:
|
|
994
|
+
children: ce(e, {
|
|
995
|
+
className: Ft(r),
|
|
996
996
|
weight: "regular"
|
|
997
997
|
})
|
|
998
998
|
}
|
|
999
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
999
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${na(r)}`, children: /* @__PURE__ */ n(
|
|
1000
1000
|
"img",
|
|
1001
1001
|
{
|
|
1002
1002
|
src: s,
|
|
@@ -1008,13 +1008,13 @@ const ta = (e) => {
|
|
|
1008
1008
|
"div",
|
|
1009
1009
|
{
|
|
1010
1010
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1011
|
-
children:
|
|
1012
|
-
className:
|
|
1011
|
+
children: ce(e, {
|
|
1012
|
+
className: Ft(r),
|
|
1013
1013
|
weight: "regular"
|
|
1014
1014
|
})
|
|
1015
1015
|
}
|
|
1016
1016
|
);
|
|
1017
|
-
},
|
|
1017
|
+
}, en = ({
|
|
1018
1018
|
variant: e,
|
|
1019
1019
|
thumbnail: t,
|
|
1020
1020
|
title: s,
|
|
@@ -1028,7 +1028,7 @@ const ta = (e) => {
|
|
|
1028
1028
|
rootRef: g,
|
|
1029
1029
|
"data-testid": u
|
|
1030
1030
|
}) => {
|
|
1031
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1031
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
|
|
1032
1032
|
return /* @__PURE__ */ h(
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
@@ -1048,14 +1048,14 @@ const ta = (e) => {
|
|
|
1048
1048
|
{
|
|
1049
1049
|
className: C("mb-0.5 truncate text-base font-medium", {
|
|
1050
1050
|
"text-black": !f,
|
|
1051
|
-
"text-white/30": f &&
|
|
1052
|
-
"text-white": f && !
|
|
1051
|
+
"text-white/30": f && b,
|
|
1052
|
+
"text-white": f && !b
|
|
1053
1053
|
}),
|
|
1054
1054
|
children: c
|
|
1055
1055
|
}
|
|
1056
1056
|
),
|
|
1057
1057
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1058
|
-
|
|
1058
|
+
ce(r, {
|
|
1059
1059
|
className: C(
|
|
1060
1060
|
"size-5 shrink-0",
|
|
1061
1061
|
f ? "text-white/55" : "text-black/55"
|
|
@@ -1080,29 +1080,29 @@ const ta = (e) => {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
);
|
|
1082
1082
|
};
|
|
1083
|
-
function
|
|
1083
|
+
function tn(e) {
|
|
1084
1084
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1085
1085
|
}
|
|
1086
1086
|
function Ke(e) {
|
|
1087
1087
|
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
1088
|
}
|
|
1089
|
-
function
|
|
1089
|
+
function sa(e) {
|
|
1090
1090
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function aa(e) {
|
|
1093
1093
|
return e ? "text-white" : "text-black";
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function ra(e) {
|
|
1096
1096
|
return e ? "text-white/55" : "text-black/55";
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function ia(e) {
|
|
1099
1099
|
return e ? "text-white/40" : "text-black/40";
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1101
|
+
function oa(e) {
|
|
1102
1102
|
return e ? "text-white/20" : "text-black/20";
|
|
1103
1103
|
}
|
|
1104
1104
|
const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
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(
|
|
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(z.Fragment, { children: [
|
|
1106
1106
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1107
1107
|
"img",
|
|
1108
1108
|
{
|
|
@@ -1113,26 +1113,26 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1113
1113
|
) : /* @__PURE__ */ n(
|
|
1114
1114
|
"div",
|
|
1115
1115
|
{
|
|
1116
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1117
|
-
children: /* @__PURE__ */ n(
|
|
1116
|
+
className: `aspect-video w-full rounded-[20px] ${sa(t)} flex items-center justify-center`,
|
|
1117
|
+
children: /* @__PURE__ */ n(Ns, { className: `size-12 ${oa(t)}` })
|
|
1118
1118
|
}
|
|
1119
1119
|
) }),
|
|
1120
1120
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1121
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1122
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1123
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1121
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${aa(t)}`, children: s }),
|
|
1122
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${ra(t)}`, children: a }),
|
|
1123
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ia(t)}`, children: d })
|
|
1124
1124
|
] })
|
|
1125
1125
|
] });
|
|
1126
1126
|
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
1127
|
};
|
|
1128
|
-
function
|
|
1128
|
+
function nn(e) {
|
|
1129
1129
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1130
1130
|
}
|
|
1131
1131
|
function Ze(e) {
|
|
1132
1132
|
var t;
|
|
1133
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1133
|
+
return (t = e.attachments) == null ? void 0 : t.find(nn);
|
|
1134
1134
|
}
|
|
1135
|
-
async function
|
|
1135
|
+
async function la(e, t) {
|
|
1136
1136
|
let s;
|
|
1137
1137
|
try {
|
|
1138
1138
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1144,11 +1144,11 @@ async function ca(e, t) {
|
|
|
1144
1144
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1145
1145
|
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1146
1146
|
}
|
|
1147
|
-
const
|
|
1147
|
+
const ca = ({
|
|
1148
1148
|
url: e,
|
|
1149
1149
|
filename: t
|
|
1150
1150
|
}) => {
|
|
1151
|
-
const [s, a] =
|
|
1151
|
+
const [s, a] = O(!1);
|
|
1152
1152
|
return /* @__PURE__ */ n(
|
|
1153
1153
|
"button",
|
|
1154
1154
|
{
|
|
@@ -1156,7 +1156,7 @@ const da = ({
|
|
|
1156
1156
|
onClick: (i) => {
|
|
1157
1157
|
i.stopPropagation();
|
|
1158
1158
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1159
|
-
a(!0),
|
|
1159
|
+
a(!0), la(e, t).then(() => {
|
|
1160
1160
|
o == null || o.close();
|
|
1161
1161
|
}).catch(() => {
|
|
1162
1162
|
o && (o.location.href = e);
|
|
@@ -1164,23 +1164,23 @@ const da = ({
|
|
|
1164
1164
|
},
|
|
1165
1165
|
disabled: s,
|
|
1166
1166
|
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(
|
|
1167
|
+
children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(z.Fragment, { children: [
|
|
1168
|
+
/* @__PURE__ */ n(be, { className: "size-4 text-white", weight: "bold" }),
|
|
1169
1169
|
"Download"
|
|
1170
1170
|
] })
|
|
1171
1171
|
}
|
|
1172
1172
|
);
|
|
1173
1173
|
};
|
|
1174
1174
|
function Qe(e) {
|
|
1175
|
-
var u, f, c,
|
|
1175
|
+
var u, f, c, b;
|
|
1176
1176
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1177
|
-
(
|
|
1177
|
+
(_) => _.type === "video" && _.asset_url
|
|
1178
1178
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1179
|
-
(
|
|
1179
|
+
(_) => _.type === "image" && _.image_url
|
|
1180
1180
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1181
|
-
(
|
|
1182
|
-
), r = (
|
|
1183
|
-
(
|
|
1181
|
+
(_) => _.type === "audio" && _.asset_url
|
|
1182
|
+
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1183
|
+
(_) => _.type === "file" && _.asset_url
|
|
1184
1184
|
), 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
1185
|
if (!o) return null;
|
|
1186
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, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1192,16 +1192,16 @@ function Qe(e) {
|
|
|
1192
1192
|
thumbnailUrl: g
|
|
1193
1193
|
};
|
|
1194
1194
|
}
|
|
1195
|
-
const
|
|
1195
|
+
const sn = ({
|
|
1196
1196
|
resolvedUrl: e,
|
|
1197
1197
|
resolvedType: t,
|
|
1198
1198
|
title: s,
|
|
1199
1199
|
fileSize: a,
|
|
1200
1200
|
thumbnailUrl: r
|
|
1201
1201
|
}) => {
|
|
1202
|
-
const i = a !== void 0 ?
|
|
1202
|
+
const i = a !== void 0 ? tn(a) : void 0;
|
|
1203
1203
|
return /* @__PURE__ */ n(
|
|
1204
|
-
|
|
1204
|
+
en,
|
|
1205
1205
|
{
|
|
1206
1206
|
variant: "dark",
|
|
1207
1207
|
title: s,
|
|
@@ -1209,7 +1209,7 @@ const an = ({
|
|
|
1209
1209
|
mimeType: t,
|
|
1210
1210
|
detail: i,
|
|
1211
1211
|
thumbnail: /* @__PURE__ */ n(
|
|
1212
|
-
|
|
1212
|
+
Qt,
|
|
1213
1213
|
{
|
|
1214
1214
|
mimeType: t,
|
|
1215
1215
|
sourceUrl: e,
|
|
@@ -1220,23 +1220,23 @@ const an = ({
|
|
|
1220
1220
|
)
|
|
1221
1221
|
}
|
|
1222
1222
|
);
|
|
1223
|
-
},
|
|
1223
|
+
}, an = ({
|
|
1224
1224
|
resolvedUrl: e,
|
|
1225
1225
|
resolvedType: t,
|
|
1226
1226
|
title: s,
|
|
1227
1227
|
fileSize: a,
|
|
1228
1228
|
thumbnailUrl: r
|
|
1229
1229
|
}) => {
|
|
1230
|
-
const i =
|
|
1230
|
+
const i = ie(t), o = a !== void 0 ? tn(a) : void 0;
|
|
1231
1231
|
return /* @__PURE__ */ n(
|
|
1232
|
-
|
|
1232
|
+
en,
|
|
1233
1233
|
{
|
|
1234
1234
|
variant: "light",
|
|
1235
1235
|
title: s,
|
|
1236
1236
|
mimeType: t,
|
|
1237
1237
|
detail: o,
|
|
1238
1238
|
thumbnail: /* @__PURE__ */ n(
|
|
1239
|
-
|
|
1239
|
+
Qt,
|
|
1240
1240
|
{
|
|
1241
1241
|
mimeType: t,
|
|
1242
1242
|
sourceUrl: e,
|
|
@@ -1246,17 +1246,17 @@ const an = ({
|
|
|
1246
1246
|
containedImage: i === "image" || i === "document"
|
|
1247
1247
|
}
|
|
1248
1248
|
),
|
|
1249
|
-
action: /* @__PURE__ */ n(
|
|
1249
|
+
action: /* @__PURE__ */ n(ca, { url: e, filename: s })
|
|
1250
1250
|
}
|
|
1251
1251
|
);
|
|
1252
|
-
},
|
|
1252
|
+
}, da = ({
|
|
1253
1253
|
message: e,
|
|
1254
1254
|
isMyMessage: t = !1
|
|
1255
1255
|
}) => {
|
|
1256
1256
|
const s = Ze(e), a = Qe(e);
|
|
1257
1257
|
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
1258
|
!t && e.user && /* @__PURE__ */ n(
|
|
1259
|
-
|
|
1259
|
+
re,
|
|
1260
1260
|
{
|
|
1261
1261
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1262
1262
|
id: e.user.id,
|
|
@@ -1274,40 +1274,40 @@ const an = ({
|
|
|
1274
1274
|
{
|
|
1275
1275
|
className: "str-chat__message-bubble",
|
|
1276
1276
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1277
|
-
children: s ? /* @__PURE__ */ n("div", { className: Ke(t), children: /* @__PURE__ */ n(Je, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(
|
|
1277
|
+
children: s ? /* @__PURE__ */ n("div", { className: Ke(t), children: /* @__PURE__ */ n(Je, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
|
|
1278
1278
|
}
|
|
1279
1279
|
) })
|
|
1280
1280
|
}
|
|
1281
1281
|
)
|
|
1282
1282
|
] });
|
|
1283
|
-
},
|
|
1283
|
+
}, ua = ({
|
|
1284
1284
|
message: e
|
|
1285
1285
|
}) => {
|
|
1286
1286
|
const t = Ze(e);
|
|
1287
1287
|
if (t)
|
|
1288
1288
|
return /* @__PURE__ */ n("div", { className: Ke(!0), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !0 }) });
|
|
1289
1289
|
const s = Qe(e);
|
|
1290
|
-
return s ? /* @__PURE__ */ n(
|
|
1291
|
-
},
|
|
1290
|
+
return s ? /* @__PURE__ */ n(sn, { ...s }) : null;
|
|
1291
|
+
}, ma = ({
|
|
1292
1292
|
message: e
|
|
1293
1293
|
}) => {
|
|
1294
1294
|
const t = Ze(e);
|
|
1295
1295
|
if (t)
|
|
1296
1296
|
return /* @__PURE__ */ n("div", { className: Ke(!1), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !1 }) });
|
|
1297
1297
|
const s = Qe(e);
|
|
1298
|
-
return s ? /* @__PURE__ */ n(
|
|
1299
|
-
},
|
|
1300
|
-
Creator:
|
|
1301
|
-
Visitor:
|
|
1302
|
-
}),
|
|
1298
|
+
return s ? /* @__PURE__ */ n(an, { ...s }) : null;
|
|
1299
|
+
}, wi = Object.assign(da, {
|
|
1300
|
+
Creator: ua,
|
|
1301
|
+
Visitor: ma
|
|
1302
|
+
}), ha = {
|
|
1303
1303
|
isUnlocking: () => !1
|
|
1304
|
-
},
|
|
1305
|
-
LockedAttachment:
|
|
1306
|
-
},
|
|
1307
|
-
function
|
|
1308
|
-
return Te(
|
|
1304
|
+
}, fa = {
|
|
1305
|
+
LockedAttachment: ha
|
|
1306
|
+
}, rn = He({}), Ni = rn.Provider;
|
|
1307
|
+
function ga(e) {
|
|
1308
|
+
return Te(rn)[e] ?? fa[e];
|
|
1309
1309
|
}
|
|
1310
|
-
const
|
|
1310
|
+
const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1311
1311
|
"svg",
|
|
1312
1312
|
{
|
|
1313
1313
|
width: e,
|
|
@@ -1324,21 +1324,21 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1324
1324
|
}
|
|
1325
1325
|
)
|
|
1326
1326
|
}
|
|
1327
|
-
),
|
|
1327
|
+
), pa = (e) => {
|
|
1328
1328
|
var t;
|
|
1329
1329
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1330
|
-
},
|
|
1330
|
+
}, va = (e) => {
|
|
1331
1331
|
var t;
|
|
1332
1332
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1333
1333
|
}, ke = (e) => {
|
|
1334
1334
|
var t;
|
|
1335
1335
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1336
|
-
},
|
|
1336
|
+
}, xa = (e) => {
|
|
1337
1337
|
var t;
|
|
1338
1338
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1339
|
-
},
|
|
1339
|
+
}, on = (e) => pa(e) || va(e), wa = (e) => {
|
|
1340
1340
|
var t;
|
|
1341
|
-
return
|
|
1341
|
+
return on(e) && !((t = e.text) != null && t.trim());
|
|
1342
1342
|
}, Oe = ({
|
|
1343
1343
|
message: e,
|
|
1344
1344
|
standalone: t = !1,
|
|
@@ -1346,31 +1346,31 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1346
1346
|
hasAttachment: a = !1
|
|
1347
1347
|
}) => {
|
|
1348
1348
|
var u;
|
|
1349
|
-
const r =
|
|
1349
|
+
const r = on(e), i = ke(e);
|
|
1350
1350
|
if (!r && !i)
|
|
1351
1351
|
return null;
|
|
1352
1352
|
if (r) {
|
|
1353
1353
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1354
1354
|
if (!f) return null;
|
|
1355
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1355
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1356
1356
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1357
|
-
/* @__PURE__ */ n(
|
|
1358
|
-
/* @__PURE__ */ n("span", { children:
|
|
1357
|
+
/* @__PURE__ */ n(_s, { size: t ? 14 : 12 }),
|
|
1358
|
+
/* @__PURE__ */ n("span", { children: b })
|
|
1359
1359
|
] });
|
|
1360
1360
|
}
|
|
1361
1361
|
const o = s && a, l = o ? "Sent with AI" : "Sent with DM Agent", d = [
|
|
1362
1362
|
"message-chatbot-indicator",
|
|
1363
1363
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1364
1364
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1365
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
1366
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(
|
|
1365
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(ba, { size: o ? 12 : 15 }) });
|
|
1366
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(ae, { children: [
|
|
1367
1367
|
m,
|
|
1368
1368
|
g
|
|
1369
|
-
] }) : /* @__PURE__ */ h(
|
|
1369
|
+
] }) : /* @__PURE__ */ h(ae, { children: [
|
|
1370
1370
|
g,
|
|
1371
1371
|
m
|
|
1372
1372
|
] }) });
|
|
1373
|
-
},
|
|
1373
|
+
}, Na = ({
|
|
1374
1374
|
selected: e,
|
|
1375
1375
|
onVoteUp: t,
|
|
1376
1376
|
onVoteDown: s
|
|
@@ -1386,7 +1386,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1386
1386
|
"aria-label": "Good response",
|
|
1387
1387
|
"aria-pressed": e === "up",
|
|
1388
1388
|
"data-tooltip": "Good response",
|
|
1389
|
-
children: /* @__PURE__ */ n(
|
|
1389
|
+
children: /* @__PURE__ */ n(ys, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1390
1390
|
}
|
|
1391
1391
|
),
|
|
1392
1392
|
/* @__PURE__ */ n(
|
|
@@ -1400,11 +1400,11 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1400
1400
|
"aria-label": "Bad response",
|
|
1401
1401
|
"aria-pressed": e === "down",
|
|
1402
1402
|
"data-tooltip": "Bad response",
|
|
1403
|
-
children: /* @__PURE__ */ n(
|
|
1403
|
+
children: /* @__PURE__ */ n(Cs, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1404
1404
|
}
|
|
1405
1405
|
)
|
|
1406
|
-
] }),
|
|
1407
|
-
var gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et, It
|
|
1406
|
+
] }), _a = (e) => {
|
|
1407
|
+
var ft, gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et, It;
|
|
1408
1408
|
const {
|
|
1409
1409
|
additionalMessageInputProps: t,
|
|
1410
1410
|
chatbotVotingEnabled: s,
|
|
@@ -1419,85 +1419,85 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1419
1419
|
isMessageAIGenerated: u,
|
|
1420
1420
|
isMyMessage: f,
|
|
1421
1421
|
message: c,
|
|
1422
|
-
renderText:
|
|
1423
|
-
threadList:
|
|
1422
|
+
renderText: b,
|
|
1423
|
+
threadList: _,
|
|
1424
1424
|
viewerLanguage: v
|
|
1425
|
-
} = e, { client:
|
|
1426
|
-
Attachment:
|
|
1427
|
-
EditMessageModal: Z =
|
|
1428
|
-
MessageActions:
|
|
1429
|
-
MessageBlocked:
|
|
1430
|
-
MessageBouncePrompt:
|
|
1431
|
-
MessageDeleted:
|
|
1432
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1433
|
-
MessageRepliesCountButton:
|
|
1434
|
-
ReminderNotification: $ =
|
|
1435
|
-
StreamedMessageText:
|
|
1436
|
-
PinIndicator:
|
|
1437
|
-
} = Ut("CustomMessage"),
|
|
1425
|
+
} = e, { client: w } = qe("CustomMessage"), { channel: y } = de("CustomMessage"), { isUnlocking: S, onUnlockClick: k, onFetchSource: A, onDownloadClick: D } = ga("LockedAttachment"), [T, M] = O(!1), N = An(c.id), { selected: E, voteUp: I, voteDown: B } = Us(c), {
|
|
1426
|
+
Attachment: P = Mn,
|
|
1427
|
+
EditMessageModal: Z = Dn,
|
|
1428
|
+
MessageActions: G,
|
|
1429
|
+
MessageBlocked: H = Rn,
|
|
1430
|
+
MessageBouncePrompt: j = Ln,
|
|
1431
|
+
MessageDeleted: F = Pn,
|
|
1432
|
+
MessageIsThreadReplyInChannelButtonIndicator: Y = On,
|
|
1433
|
+
MessageRepliesCountButton: q = zn,
|
|
1434
|
+
ReminderNotification: $ = Fn,
|
|
1435
|
+
StreamedMessageText: p = $n,
|
|
1436
|
+
PinIndicator: x
|
|
1437
|
+
} = Ut("CustomMessage"), L = Bn(c), U = jn(c), R = se(
|
|
1438
1438
|
() => u == null ? void 0 : u(c),
|
|
1439
1439
|
[u, c]
|
|
1440
|
-
),
|
|
1441
|
-
const
|
|
1442
|
-
if (!ke(c)) return
|
|
1443
|
-
const
|
|
1444
|
-
return
|
|
1445
|
-
}, [c]),
|
|
1446
|
-
const
|
|
1447
|
-
return
|
|
1440
|
+
), V = se(() => {
|
|
1441
|
+
const he = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...he] : he;
|
|
1442
|
+
if (!ke(c)) return ye;
|
|
1443
|
+
const St = ye.filter((Tt) => !("type" in Tt) || !nn(Tt));
|
|
1444
|
+
return St.length === ye.length ? ye : St;
|
|
1445
|
+
}, [c]), X = se(() => {
|
|
1446
|
+
const he = Xt({ message: c, viewerLanguage: v });
|
|
1447
|
+
return he === c.text ? c : { ...c, text: he };
|
|
1448
1448
|
}, [c, v]);
|
|
1449
1449
|
if (Un(c))
|
|
1450
1450
|
return null;
|
|
1451
1451
|
if (c.deleted_at || c.type === "deleted")
|
|
1452
|
-
return /* @__PURE__ */ n(
|
|
1453
|
-
if (
|
|
1454
|
-
return /* @__PURE__ */ n(
|
|
1455
|
-
const
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
const
|
|
1452
|
+
return /* @__PURE__ */ n(F, { message: c });
|
|
1453
|
+
if (Vn(c))
|
|
1454
|
+
return /* @__PURE__ */ n(H, {});
|
|
1455
|
+
const Q = !_ && !!c.reply_count, te = !_ && c.show_in_channel && c.parent_id, ee = c.status === "failed" && ((ft = c.error) == null ? void 0 : ft.status) !== 403, ct = Gn(c);
|
|
1456
|
+
let oe;
|
|
1457
|
+
ee ? oe = () => m(c) : ct && (oe = () => M(!0));
|
|
1458
|
+
const ue = f(), kn = C(
|
|
1459
1459
|
"str-chat__message str-chat__message-simple",
|
|
1460
1460
|
`str-chat__message--${c.type}`,
|
|
1461
1461
|
`str-chat__message--${c.status}`,
|
|
1462
|
-
|
|
1462
|
+
ue ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1463
1463
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1464
1464
|
{
|
|
1465
|
-
"str-chat__message--has-attachment":
|
|
1465
|
+
"str-chat__message--has-attachment": L,
|
|
1466
1466
|
"str-chat__message--highlighted": g,
|
|
1467
1467
|
"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":
|
|
1468
|
+
"str-chat__message--with-reactions": U,
|
|
1469
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((gt = c == null ? void 0 : c.error) == null ? void 0 : gt.status) !== 403,
|
|
1470
|
+
"str-chat__message-with-thread-link": Q || te,
|
|
1471
1471
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1472
1472
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1473
1473
|
"str-chat__virtual-message__wrapper--group": o
|
|
1474
1474
|
}
|
|
1475
|
-
),
|
|
1476
|
-
return /* @__PURE__ */ h(
|
|
1475
|
+
), dt = c.poll_id && w.polls.fromState(c.poll_id), ut = wa(c), me = ke(c), mt = xa(c), De = !!(V != null && V.length && !c.quoted_message), ht = me && ue && De;
|
|
1476
|
+
return /* @__PURE__ */ h(ae, { children: [
|
|
1477
1477
|
a && /* @__PURE__ */ n(
|
|
1478
1478
|
Z,
|
|
1479
1479
|
{
|
|
1480
1480
|
additionalMessageInputProps: t
|
|
1481
1481
|
}
|
|
1482
1482
|
),
|
|
1483
|
-
|
|
1484
|
-
|
|
1483
|
+
T && /* @__PURE__ */ n(
|
|
1484
|
+
Hn,
|
|
1485
1485
|
{
|
|
1486
|
-
MessageBouncePrompt:
|
|
1487
|
-
onClose: () =>
|
|
1488
|
-
open:
|
|
1486
|
+
MessageBouncePrompt: j,
|
|
1487
|
+
onClose: () => M(!1),
|
|
1488
|
+
open: T
|
|
1489
1489
|
}
|
|
1490
1490
|
),
|
|
1491
1491
|
/* @__PURE__ */ h(
|
|
1492
1492
|
"div",
|
|
1493
1493
|
{
|
|
1494
|
-
className:
|
|
1494
|
+
className: kn,
|
|
1495
1495
|
"data-message-id": c.id,
|
|
1496
1496
|
children: [
|
|
1497
|
-
|
|
1498
|
-
!!
|
|
1497
|
+
x && /* @__PURE__ */ n(x, {}),
|
|
1498
|
+
!!N && /* @__PURE__ */ n($, { reminder: N }),
|
|
1499
1499
|
c.user && /* @__PURE__ */ n(
|
|
1500
|
-
|
|
1500
|
+
re,
|
|
1501
1501
|
{
|
|
1502
1502
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1503
1503
|
id: c.user.id,
|
|
@@ -1505,183 +1505,183 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1505
1505
|
name: c.user.name || c.user.id,
|
|
1506
1506
|
size: 24,
|
|
1507
1507
|
shape: "circle",
|
|
1508
|
-
dmAgentEnabled:
|
|
1508
|
+
dmAgentEnabled: me
|
|
1509
1509
|
}
|
|
1510
1510
|
),
|
|
1511
1511
|
/* @__PURE__ */ n(
|
|
1512
1512
|
"div",
|
|
1513
1513
|
{
|
|
1514
1514
|
className: C("str-chat__message-inner", {
|
|
1515
|
-
"str-chat__simple-message--error-failed":
|
|
1515
|
+
"str-chat__simple-message--error-failed": ee || ct
|
|
1516
1516
|
}),
|
|
1517
1517
|
"data-testid": "message-inner",
|
|
1518
|
-
onClick:
|
|
1519
|
-
onKeyDown:
|
|
1520
|
-
role:
|
|
1521
|
-
tabIndex:
|
|
1518
|
+
onClick: oe,
|
|
1519
|
+
onKeyDown: oe,
|
|
1520
|
+
role: oe ? "button" : void 0,
|
|
1521
|
+
tabIndex: oe ? 0 : void 0,
|
|
1522
1522
|
style: {
|
|
1523
1523
|
// Force margins to 0 to prevent hover layout shift
|
|
1524
1524
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1525
1525
|
marginInlineEnd: 0,
|
|
1526
1526
|
marginInlineStart: 0
|
|
1527
1527
|
},
|
|
1528
|
-
children:
|
|
1529
|
-
|
|
1530
|
-
|
|
1528
|
+
children: mt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1529
|
+
ue ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1530
|
+
G && /* @__PURE__ */ n(G, {}),
|
|
1531
1531
|
/* @__PURE__ */ n(
|
|
1532
|
-
|
|
1532
|
+
zt.Sent,
|
|
1533
1533
|
{
|
|
1534
|
-
title: (
|
|
1535
|
-
mimeType: (
|
|
1536
|
-
thumbnailUrl: (
|
|
1537
|
-
amountText: (
|
|
1538
|
-
detail: (
|
|
1539
|
-
paymentStatus: (
|
|
1540
|
-
onPreviewClick: () =>
|
|
1541
|
-
onFetchSource: async () => await (
|
|
1534
|
+
title: (bt = c.metadata) == null ? void 0 : bt.attachment_title,
|
|
1535
|
+
mimeType: (pt = c.metadata) == null ? void 0 : pt.attachment_mime_type,
|
|
1536
|
+
thumbnailUrl: (vt = c.metadata) == null ? void 0 : vt.attachment_thumbnail,
|
|
1537
|
+
amountText: (xt = c.metadata) == null ? void 0 : xt.amount_text,
|
|
1538
|
+
detail: (wt = c.metadata) == null ? void 0 : wt.attachment_detail,
|
|
1539
|
+
paymentStatus: (Nt = c.metadata) == null ? void 0 : Nt.payment_status,
|
|
1540
|
+
onPreviewClick: () => k == null ? void 0 : k(c, y),
|
|
1541
|
+
onFetchSource: async () => await (A == null ? void 0 : A(c, y))
|
|
1542
1542
|
}
|
|
1543
1543
|
)
|
|
1544
1544
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1545
1545
|
/* @__PURE__ */ n(
|
|
1546
|
-
|
|
1546
|
+
zt.Received,
|
|
1547
1547
|
{
|
|
1548
|
-
title: (
|
|
1549
|
-
mimeType: (
|
|
1550
|
-
thumbnailUrl: (
|
|
1551
|
-
amountText: (
|
|
1552
|
-
detail: (
|
|
1553
|
-
paymentStatus: (
|
|
1554
|
-
isUnlocking:
|
|
1555
|
-
onUnlockClick: () =>
|
|
1556
|
-
onFetchSource: async () => await (
|
|
1557
|
-
onDownloadClick: () =>
|
|
1548
|
+
title: (_t = c.metadata) == null ? void 0 : _t.attachment_title,
|
|
1549
|
+
mimeType: (yt = c.metadata) == null ? void 0 : yt.attachment_mime_type,
|
|
1550
|
+
thumbnailUrl: (Ct = c.metadata) == null ? void 0 : Ct.attachment_thumbnail,
|
|
1551
|
+
amountText: (kt = c.metadata) == null ? void 0 : kt.amount_text,
|
|
1552
|
+
detail: (Et = c.metadata) == null ? void 0 : Et.attachment_detail,
|
|
1553
|
+
paymentStatus: (It = c.metadata) == null ? void 0 : It.payment_status,
|
|
1554
|
+
isUnlocking: S(c.id),
|
|
1555
|
+
onUnlockClick: () => k == null ? void 0 : k(c, y),
|
|
1556
|
+
onFetchSource: async () => await (A == null ? void 0 : A(c, y)),
|
|
1557
|
+
onDownloadClick: () => D == null ? void 0 : D(c, y)
|
|
1558
1558
|
}
|
|
1559
1559
|
),
|
|
1560
|
-
|
|
1560
|
+
G && /* @__PURE__ */ n(G, {})
|
|
1561
1561
|
] }),
|
|
1562
1562
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1563
|
-
|
|
1563
|
+
At,
|
|
1564
1564
|
{
|
|
1565
|
-
message:
|
|
1566
|
-
renderText:
|
|
1565
|
+
message: X,
|
|
1566
|
+
renderText: b
|
|
1567
1567
|
}
|
|
1568
1568
|
) })
|
|
1569
|
-
] }) :
|
|
1569
|
+
] }) : ut ? (
|
|
1570
1570
|
/* Tip-only messages render as a standalone bubble */
|
|
1571
1571
|
/* @__PURE__ */ n(Oe, { message: c, standalone: !0 })
|
|
1572
1572
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1573
|
-
|
|
1573
|
+
me && !ht && /* @__PURE__ */ n(
|
|
1574
1574
|
Oe,
|
|
1575
1575
|
{
|
|
1576
1576
|
message: c,
|
|
1577
1577
|
hasAttachment: De,
|
|
1578
|
-
isMyMessage:
|
|
1578
|
+
isMyMessage: ue
|
|
1579
1579
|
}
|
|
1580
1580
|
),
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1581
|
+
dt && /* @__PURE__ */ n(Yn, { poll: dt }),
|
|
1582
|
+
V != null && V.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1583
|
+
P,
|
|
1584
1584
|
{
|
|
1585
1585
|
actionHandler: l,
|
|
1586
|
-
attachments:
|
|
1586
|
+
attachments: V
|
|
1587
1587
|
}
|
|
1588
1588
|
) : null,
|
|
1589
|
-
|
|
1590
|
-
|
|
1589
|
+
R ? /* @__PURE__ */ n(
|
|
1590
|
+
p,
|
|
1591
1591
|
{
|
|
1592
|
-
message:
|
|
1593
|
-
renderText:
|
|
1592
|
+
message: X,
|
|
1593
|
+
renderText: b
|
|
1594
1594
|
}
|
|
1595
1595
|
) : /* @__PURE__ */ n(
|
|
1596
|
-
|
|
1596
|
+
At,
|
|
1597
1597
|
{
|
|
1598
|
-
message:
|
|
1599
|
-
renderText:
|
|
1598
|
+
message: X,
|
|
1599
|
+
renderText: b
|
|
1600
1600
|
}
|
|
1601
1601
|
),
|
|
1602
|
-
/* @__PURE__ */ n(
|
|
1602
|
+
/* @__PURE__ */ n(qn, {})
|
|
1603
1603
|
] }) })
|
|
1604
1604
|
}
|
|
1605
1605
|
),
|
|
1606
|
-
!
|
|
1607
|
-
(!
|
|
1606
|
+
!mt && !ut && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1607
|
+
(!me || ht) && /* @__PURE__ */ n(
|
|
1608
1608
|
Oe,
|
|
1609
1609
|
{
|
|
1610
1610
|
message: c,
|
|
1611
1611
|
hasAttachment: De,
|
|
1612
|
-
isMyMessage:
|
|
1612
|
+
isMyMessage: ue
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
s &&
|
|
1616
|
-
|
|
1615
|
+
s && me && /* @__PURE__ */ n(
|
|
1616
|
+
Na,
|
|
1617
1617
|
{
|
|
1618
|
-
selected:
|
|
1619
|
-
onVoteUp:
|
|
1620
|
-
onVoteDown:
|
|
1618
|
+
selected: E,
|
|
1619
|
+
onVoteUp: I,
|
|
1620
|
+
onVoteDown: B
|
|
1621
1621
|
}
|
|
1622
1622
|
)
|
|
1623
1623
|
] }),
|
|
1624
|
-
|
|
1625
|
-
|
|
1624
|
+
Q && /* @__PURE__ */ n(
|
|
1625
|
+
q,
|
|
1626
1626
|
{
|
|
1627
1627
|
onClick: d,
|
|
1628
1628
|
reply_count: c.reply_count
|
|
1629
1629
|
}
|
|
1630
1630
|
),
|
|
1631
|
-
|
|
1631
|
+
te && /* @__PURE__ */ n(Y, {})
|
|
1632
1632
|
]
|
|
1633
1633
|
},
|
|
1634
1634
|
c.id
|
|
1635
1635
|
)
|
|
1636
1636
|
] });
|
|
1637
|
-
},
|
|
1638
|
-
|
|
1639
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1640
|
-
),
|
|
1641
|
-
const t =
|
|
1642
|
-
return /* @__PURE__ */ n(
|
|
1643
|
-
},
|
|
1637
|
+
}, ya = z.memo(
|
|
1638
|
+
_a,
|
|
1639
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Tn(e, t)
|
|
1640
|
+
), Ca = (e) => {
|
|
1641
|
+
const t = pe("CustomMessage");
|
|
1642
|
+
return /* @__PURE__ */ n(ya, { ...t, ...e });
|
|
1643
|
+
}, ka = () => {
|
|
1644
1644
|
var s;
|
|
1645
|
-
const { handleDelete: e, message: t } =
|
|
1645
|
+
const { handleDelete: e, message: t } = pe("CustomMessageActions");
|
|
1646
1646
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1647
|
-
|
|
1647
|
+
Yt,
|
|
1648
1648
|
{
|
|
1649
1649
|
onClick: e,
|
|
1650
1650
|
"aria-label": "Delete",
|
|
1651
1651
|
title: "Delete",
|
|
1652
1652
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1653
|
-
children: /* @__PURE__ */ n(
|
|
1653
|
+
children: /* @__PURE__ */ n(ks, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1654
1654
|
}
|
|
1655
1655
|
);
|
|
1656
|
-
},
|
|
1657
|
-
const { handleFlag: e } =
|
|
1656
|
+
}, Ea = () => {
|
|
1657
|
+
const { handleFlag: e } = pe("CustomMessageActions");
|
|
1658
1658
|
return /* @__PURE__ */ n(
|
|
1659
|
-
|
|
1659
|
+
Yt,
|
|
1660
1660
|
{
|
|
1661
1661
|
onClick: e,
|
|
1662
1662
|
"aria-label": "Report",
|
|
1663
1663
|
title: "Report",
|
|
1664
1664
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1665
|
-
children: /* @__PURE__ */ n(
|
|
1665
|
+
children: /* @__PURE__ */ n(Vt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1666
1666
|
}
|
|
1667
1667
|
);
|
|
1668
|
-
},
|
|
1668
|
+
}, Ia = () => {
|
|
1669
1669
|
var t;
|
|
1670
|
-
const { message: e } =
|
|
1670
|
+
const { message: e } = pe("CustomMessageActions");
|
|
1671
1671
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1672
|
-
|
|
1672
|
+
Ms,
|
|
1673
1673
|
{
|
|
1674
1674
|
messageActionSet: [
|
|
1675
|
-
{ Component:
|
|
1676
|
-
{ Component:
|
|
1675
|
+
{ Component: ka, placement: "quick", type: "delete" },
|
|
1676
|
+
{ Component: Ea, placement: "quick", type: "flag" }
|
|
1677
1677
|
]
|
|
1678
1678
|
}
|
|
1679
1679
|
);
|
|
1680
|
-
},
|
|
1680
|
+
}, Sa = (e) => ({
|
|
1681
1681
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1682
|
-
(t) =>
|
|
1682
|
+
(t) => Lt.previewIsLoaded(t) || Lt.previewIsLoading(t)
|
|
1683
1683
|
)
|
|
1684
|
-
}),
|
|
1684
|
+
}), Ta = ({
|
|
1685
1685
|
link: e,
|
|
1686
1686
|
onDismiss: t
|
|
1687
1687
|
}) => {
|
|
@@ -1711,7 +1711,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1711
1711
|
},
|
|
1712
1712
|
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
1713
|
"aria-label": "Close link preview",
|
|
1714
|
-
children: /* @__PURE__ */ n(
|
|
1714
|
+
children: /* @__PURE__ */ n(ve, { className: "size-4 text-black/90" })
|
|
1715
1715
|
}
|
|
1716
1716
|
),
|
|
1717
1717
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1721,22 +1721,22 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1721
1721
|
]
|
|
1722
1722
|
}
|
|
1723
1723
|
);
|
|
1724
|
-
},
|
|
1725
|
-
const { linkPreviewsManager: e } =
|
|
1724
|
+
}, Aa = () => {
|
|
1725
|
+
const { linkPreviewsManager: e } = Wn(), { linkPreviews: t } = Xn(
|
|
1726
1726
|
e.state,
|
|
1727
|
-
|
|
1727
|
+
Sa
|
|
1728
1728
|
), s = (r) => {
|
|
1729
1729
|
e.dismissPreview(r);
|
|
1730
1730
|
};
|
|
1731
1731
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1732
|
-
|
|
1732
|
+
Ta,
|
|
1733
1733
|
{
|
|
1734
1734
|
link: r,
|
|
1735
1735
|
onDismiss: s
|
|
1736
1736
|
},
|
|
1737
1737
|
r.og_scrape_url
|
|
1738
1738
|
)) }) : null;
|
|
1739
|
-
},
|
|
1739
|
+
}, ln = z.createContext(!1), Ma = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1740
1740
|
"button",
|
|
1741
1741
|
{
|
|
1742
1742
|
...s,
|
|
@@ -1744,20 +1744,20 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1744
1744
|
"aria-label": "Send",
|
|
1745
1745
|
disabled: t,
|
|
1746
1746
|
onClick: e,
|
|
1747
|
-
children: /* @__PURE__ */ n(
|
|
1747
|
+
children: /* @__PURE__ */ n(Es, { weight: "bold", className: "size-4" })
|
|
1748
1748
|
}
|
|
1749
|
-
),
|
|
1750
|
-
const e = Te(
|
|
1751
|
-
SendButton: r =
|
|
1752
|
-
AttachmentPreviewList: i =
|
|
1749
|
+
), Da = () => {
|
|
1750
|
+
const e = Te(ln), { handleSubmit: t } = Jn(), s = Zn(), a = e || !s, {
|
|
1751
|
+
SendButton: r = Ma,
|
|
1752
|
+
AttachmentPreviewList: i = Qn
|
|
1753
1753
|
} = Ut("CustomMessageInput");
|
|
1754
1754
|
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: [
|
|
1755
|
-
/* @__PURE__ */ n(
|
|
1756
|
-
/* @__PURE__ */ n(
|
|
1755
|
+
/* @__PURE__ */ n(es, {}),
|
|
1756
|
+
/* @__PURE__ */ n(Aa, {}),
|
|
1757
1757
|
/* @__PURE__ */ n(i, {}),
|
|
1758
1758
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1759
1759
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1760
|
-
|
|
1760
|
+
ts,
|
|
1761
1761
|
{
|
|
1762
1762
|
"aria-disabled": e || void 0,
|
|
1763
1763
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1780,15 +1780,15 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1780
1780
|
)
|
|
1781
1781
|
] })
|
|
1782
1782
|
] });
|
|
1783
|
-
},
|
|
1783
|
+
}, Ra = ({
|
|
1784
1784
|
renderActions: e,
|
|
1785
1785
|
renderFooter: t,
|
|
1786
1786
|
disabled: s = !1,
|
|
1787
1787
|
disabledReason: a
|
|
1788
1788
|
}) => {
|
|
1789
1789
|
var o;
|
|
1790
|
-
const { channel: r } =
|
|
1791
|
-
return s ? /* @__PURE__ */ h(
|
|
1790
|
+
const { channel: r } = de(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
|
|
1791
|
+
return s ? /* @__PURE__ */ h(ae, { children: [
|
|
1792
1792
|
/* @__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
1793
|
t == null ? void 0 : t()
|
|
1794
1794
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1800,52 +1800,52 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1800
1800
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1801
1801
|
children: [
|
|
1802
1802
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1803
|
-
/* @__PURE__ */ n(
|
|
1803
|
+
/* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(Kn, { Input: Da }) })
|
|
1804
1804
|
]
|
|
1805
1805
|
}
|
|
1806
1806
|
),
|
|
1807
1807
|
t == null ? void 0 : t()
|
|
1808
1808
|
] });
|
|
1809
|
-
},
|
|
1809
|
+
}, La = [
|
|
1810
1810
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1811
1811
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1812
|
-
],
|
|
1812
|
+
], Pa = {
|
|
1813
1813
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1814
1814
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1815
|
-
},
|
|
1815
|
+
}, Oa = [
|
|
1816
1816
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1817
|
-
],
|
|
1817
|
+
], za = {
|
|
1818
1818
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1819
|
-
}, ze = "age safety guidelines.",
|
|
1819
|
+
}, ze = "age safety guidelines.", Fa = "https://linktr.ee/s/about/contact", $t = (e) => La.includes(e), $a = (e) => Oa.includes(e), Ba = (e) => {
|
|
1820
1820
|
var a;
|
|
1821
1821
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1822
|
-
if (
|
|
1822
|
+
if ($t(t))
|
|
1823
1823
|
return {
|
|
1824
1824
|
kind: "dm-agent",
|
|
1825
1825
|
type: t
|
|
1826
1826
|
};
|
|
1827
|
-
if (
|
|
1827
|
+
if ($a(t))
|
|
1828
1828
|
return {
|
|
1829
1829
|
kind: "age-safety",
|
|
1830
1830
|
type: t
|
|
1831
1831
|
};
|
|
1832
1832
|
const s = e.dm_agent_system_type;
|
|
1833
|
-
if (
|
|
1833
|
+
if ($t(s))
|
|
1834
1834
|
return {
|
|
1835
1835
|
kind: "dm-agent",
|
|
1836
1836
|
type: s
|
|
1837
1837
|
};
|
|
1838
|
-
},
|
|
1838
|
+
}, ja = (e) => {
|
|
1839
1839
|
const t = e.indexOf(ze);
|
|
1840
1840
|
if (t === -1)
|
|
1841
1841
|
return e;
|
|
1842
1842
|
const s = t + ze.length;
|
|
1843
|
-
return /* @__PURE__ */ h(
|
|
1843
|
+
return /* @__PURE__ */ h(ae, { children: [
|
|
1844
1844
|
e.slice(0, t),
|
|
1845
1845
|
/* @__PURE__ */ n(
|
|
1846
1846
|
"a",
|
|
1847
1847
|
{
|
|
1848
|
-
href:
|
|
1848
|
+
href: Fa,
|
|
1849
1849
|
target: "_blank",
|
|
1850
1850
|
rel: "noopener noreferrer",
|
|
1851
1851
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1856,11 +1856,11 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1856
1856
|
] });
|
|
1857
1857
|
}, Ua = (e) => {
|
|
1858
1858
|
var a, r;
|
|
1859
|
-
const t = e.message.hide_date === !0, s =
|
|
1859
|
+
const t = e.message.hide_date === !0, s = Ba(
|
|
1860
1860
|
e.message
|
|
1861
1861
|
);
|
|
1862
1862
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1863
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1863
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Pa[s.type];
|
|
1864
1864
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1865
1865
|
/* @__PURE__ */ h(
|
|
1866
1866
|
"div",
|
|
@@ -1870,7 +1870,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1870
1870
|
"data-dm-agent-system-type": s.type,
|
|
1871
1871
|
children: [
|
|
1872
1872
|
/* @__PURE__ */ n(
|
|
1873
|
-
|
|
1873
|
+
Ue,
|
|
1874
1874
|
{
|
|
1875
1875
|
size: 16,
|
|
1876
1876
|
weight: "regular",
|
|
@@ -1886,7 +1886,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1886
1886
|
] });
|
|
1887
1887
|
}
|
|
1888
1888
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1889
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1889
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || za[s.type];
|
|
1890
1890
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1891
1891
|
/* @__PURE__ */ h(
|
|
1892
1892
|
"div",
|
|
@@ -1896,7 +1896,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1896
1896
|
"data-age-safety-system-type": s.type,
|
|
1897
1897
|
children: [
|
|
1898
1898
|
/* @__PURE__ */ n(
|
|
1899
|
-
|
|
1899
|
+
Is,
|
|
1900
1900
|
{
|
|
1901
1901
|
size: 24,
|
|
1902
1902
|
weight: "duotone",
|
|
@@ -1905,7 +1905,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1905
1905
|
"data-testid": "age-safety-system-message-icon"
|
|
1906
1906
|
}
|
|
1907
1907
|
),
|
|
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:
|
|
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: ja(i) }) })
|
|
1909
1909
|
]
|
|
1910
1910
|
}
|
|
1911
1911
|
),
|
|
@@ -1920,7 +1920,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1920
1920
|
] }),
|
|
1921
1921
|
!t && /* @__PURE__ */ n(Re, { message: e.message })
|
|
1922
1922
|
] });
|
|
1923
|
-
},
|
|
1923
|
+
}, cn = He(!1), Fe = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1924
1924
|
"animateTransform",
|
|
1925
1925
|
{
|
|
1926
1926
|
attributeName: "transform",
|
|
@@ -1930,17 +1930,17 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1930
1930
|
begin: `${120 * t}ms`,
|
|
1931
1931
|
repeatCount: "indefinite"
|
|
1932
1932
|
}
|
|
1933
|
-
) }),
|
|
1933
|
+
) }), Va = /* @__PURE__ */ new Set([
|
|
1934
1934
|
Le.Thinking,
|
|
1935
1935
|
Le.Generating,
|
|
1936
1936
|
Le.ExternalSources
|
|
1937
|
-
]),
|
|
1938
|
-
var
|
|
1939
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
1940
|
-
if (!e && l &&
|
|
1941
|
-
const v =
|
|
1937
|
+
]), Ga = ({ threadList: e }) => {
|
|
1938
|
+
var b, _;
|
|
1939
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = qe(), { typing: i = {} } = ns(), { aiState: o } = ss(t), l = Te(cn);
|
|
1940
|
+
if (!e && l && Va.has(o)) {
|
|
1941
|
+
const v = Ha(t, (b = r.user) == null ? void 0 : b.id);
|
|
1942
1942
|
return /* @__PURE__ */ n(
|
|
1943
|
-
|
|
1943
|
+
Bt,
|
|
1944
1944
|
{
|
|
1945
1945
|
avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
|
|
1946
1946
|
avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
|
|
@@ -1952,21 +1952,21 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1952
1952
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1953
1953
|
return null;
|
|
1954
1954
|
const m = e ? [] : Object.values(i).filter(
|
|
1955
|
-
({ parent_id: v, user:
|
|
1956
|
-
var
|
|
1957
|
-
return (
|
|
1955
|
+
({ parent_id: v, user: w }) => {
|
|
1956
|
+
var y;
|
|
1957
|
+
return (w == null ? void 0 : w.id) !== ((y = r.user) == null ? void 0 : y.id) && !v;
|
|
1958
1958
|
}
|
|
1959
1959
|
), g = e ? Object.values(i).filter(
|
|
1960
|
-
({ parent_id: v, user:
|
|
1961
|
-
var
|
|
1962
|
-
return (
|
|
1960
|
+
({ parent_id: v, user: w }) => {
|
|
1961
|
+
var y;
|
|
1962
|
+
return (w == null ? void 0 : w.id) !== ((y = r.user) == null ? void 0 : y.id) && v === (a == null ? void 0 : a.id);
|
|
1963
1963
|
}
|
|
1964
1964
|
) : [], u = e ? g : m;
|
|
1965
1965
|
if (!u.length)
|
|
1966
1966
|
return null;
|
|
1967
|
-
const f = (
|
|
1967
|
+
const f = (_ = u[0]) == null ? void 0 : _.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1968
1968
|
return /* @__PURE__ */ n(
|
|
1969
|
-
|
|
1969
|
+
Bt,
|
|
1970
1970
|
{
|
|
1971
1971
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1972
1972
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1974,7 +1974,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1974
1974
|
testId: "typing-indicator"
|
|
1975
1975
|
}
|
|
1976
1976
|
);
|
|
1977
|
-
},
|
|
1977
|
+
}, Bt = ({
|
|
1978
1978
|
avatarId: e,
|
|
1979
1979
|
avatarName: t,
|
|
1980
1980
|
avatarImage: s,
|
|
@@ -1987,7 +1987,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1987
1987
|
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
1988
1988
|
children: [
|
|
1989
1989
|
/* @__PURE__ */ n("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1990
|
-
|
|
1990
|
+
re,
|
|
1991
1991
|
{
|
|
1992
1992
|
id: e,
|
|
1993
1993
|
name: t,
|
|
@@ -2015,7 +2015,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2015
2015
|
]
|
|
2016
2016
|
}
|
|
2017
2017
|
);
|
|
2018
|
-
function
|
|
2018
|
+
function Ha(e, t) {
|
|
2019
2019
|
var a;
|
|
2020
2020
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2021
2021
|
for (const r of Object.values(s)) {
|
|
@@ -2024,7 +2024,7 @@ function Ya(e, t) {
|
|
|
2024
2024
|
return i;
|
|
2025
2025
|
}
|
|
2026
2026
|
}
|
|
2027
|
-
const
|
|
2027
|
+
const Ya = () => null, qa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2028
2028
|
"div",
|
|
2029
2029
|
{
|
|
2030
2030
|
className: C("flex items-center justify-center h-full", e),
|
|
@@ -2067,12 +2067,12 @@ const qa = () => null, Wa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2067
2067
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2068
2068
|
]
|
|
2069
2069
|
}
|
|
2070
|
-
), Ee =
|
|
2071
|
-
/* @__PURE__ */ n(
|
|
2070
|
+
), 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
|
+
/* @__PURE__ */ n(qa, { className: "w-6 h-6" }),
|
|
2072
2072
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2073
2073
|
] }) }));
|
|
2074
2074
|
Ee.displayName = "LoadingState";
|
|
2075
|
-
const
|
|
2075
|
+
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", jt = "Replies instantly with AI assistant", Wa = ({
|
|
2076
2076
|
onBack: e,
|
|
2077
2077
|
showBackButton: t,
|
|
2078
2078
|
onShowInfo: s,
|
|
@@ -2080,23 +2080,23 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2080
2080
|
showStarButton: r = !1,
|
|
2081
2081
|
dmAgentEnabled: i = !1
|
|
2082
2082
|
}) => {
|
|
2083
|
-
var f, c,
|
|
2084
|
-
const { channel: o } =
|
|
2085
|
-
var
|
|
2086
|
-
const
|
|
2087
|
-
return
|
|
2088
|
-
(
|
|
2089
|
-
var
|
|
2090
|
-
return ((
|
|
2083
|
+
var f, c, b, _, v;
|
|
2084
|
+
const { channel: o } = de(), l = z.useMemo(() => {
|
|
2085
|
+
var S, k;
|
|
2086
|
+
const w = (S = o._client) == null ? void 0 : S.userID;
|
|
2087
|
+
return w ? Object.values(((k = o.state) == null ? void 0 : k.members) || {}).find(
|
|
2088
|
+
(A) => {
|
|
2089
|
+
var D;
|
|
2090
|
+
return ((D = A.user) == null ? void 0 : D.id) && A.user.id !== w;
|
|
2091
2091
|
}
|
|
2092
2092
|
) : void 0;
|
|
2093
|
-
}, [(f = o._client) == null ? void 0 : f.userID, (c = o.state) == null ? void 0 : c.members]), d = Ae(l == null ? void 0 : l.user), m = (
|
|
2093
|
+
}, [(f = o._client) == null ? void 0 : f.userID, (c = o.state) == null ? void 0 : c.members]), d = Ae(l == null ? void 0 : l.user), m = (b = l == null ? void 0 : l.user) == null ? void 0 : b.image, g = Wt(o), u = async () => {
|
|
2094
2094
|
try {
|
|
2095
2095
|
g ? await o.unpin() : await o.pin();
|
|
2096
|
-
} catch (
|
|
2096
|
+
} catch (w) {
|
|
2097
2097
|
console.error(
|
|
2098
2098
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2099
|
-
|
|
2099
|
+
w
|
|
2100
2100
|
);
|
|
2101
2101
|
}
|
|
2102
2102
|
};
|
|
@@ -2106,21 +2106,21 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2106
2106
|
"button",
|
|
2107
2107
|
{
|
|
2108
2108
|
className: C(
|
|
2109
|
-
|
|
2109
|
+
le,
|
|
2110
2110
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2111
2111
|
),
|
|
2112
2112
|
onClick: e || (() => {
|
|
2113
2113
|
}),
|
|
2114
2114
|
type: "button",
|
|
2115
2115
|
"aria-label": "Back to conversations",
|
|
2116
|
-
children: /* @__PURE__ */ n(
|
|
2116
|
+
children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
|
|
2117
2117
|
}
|
|
2118
2118
|
) }),
|
|
2119
2119
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2120
2120
|
/* @__PURE__ */ n(
|
|
2121
|
-
|
|
2121
|
+
re,
|
|
2122
2122
|
{
|
|
2123
|
-
id: ((
|
|
2123
|
+
id: ((_ = l == null ? void 0 : l.user) == null ? void 0 : _.id) || o.id || "unknown",
|
|
2124
2124
|
name: d,
|
|
2125
2125
|
image: m,
|
|
2126
2126
|
starred: r && g,
|
|
@@ -2130,15 +2130,15 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2130
2130
|
),
|
|
2131
2131
|
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: d }),
|
|
2132
2132
|
i && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2133
|
-
/* @__PURE__ */ n(
|
|
2134
|
-
/* @__PURE__ */ n("span", { children:
|
|
2133
|
+
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2134
|
+
/* @__PURE__ */ n("span", { children: jt })
|
|
2135
2135
|
] })
|
|
2136
2136
|
] }),
|
|
2137
2137
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
2138
2138
|
r && /* @__PURE__ */ n(
|
|
2139
2139
|
"button",
|
|
2140
2140
|
{
|
|
2141
|
-
className:
|
|
2141
|
+
className: le,
|
|
2142
2142
|
onClick: u,
|
|
2143
2143
|
type: "button",
|
|
2144
2144
|
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
@@ -2154,14 +2154,14 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2154
2154
|
)
|
|
2155
2155
|
}
|
|
2156
2156
|
),
|
|
2157
|
-
/* @__PURE__ */ n(
|
|
2157
|
+
a && /* @__PURE__ */ n(
|
|
2158
2158
|
"button",
|
|
2159
2159
|
{
|
|
2160
|
-
className: C(
|
|
2160
|
+
className: C(le, "bg-[#F1F0EE]"),
|
|
2161
2161
|
onClick: s,
|
|
2162
2162
|
type: "button",
|
|
2163
2163
|
"aria-label": "Show info",
|
|
2164
|
-
children: /* @__PURE__ */ n(
|
|
2164
|
+
children: /* @__PURE__ */ n(Rt, { className: "size-5 text-black/90" })
|
|
2165
2165
|
}
|
|
2166
2166
|
)
|
|
2167
2167
|
] })
|
|
@@ -2172,17 +2172,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2172
2172
|
"button",
|
|
2173
2173
|
{
|
|
2174
2174
|
className: C(
|
|
2175
|
-
|
|
2175
|
+
le,
|
|
2176
2176
|
"messaging-channel-view-back-button-desktop"
|
|
2177
2177
|
),
|
|
2178
2178
|
type: "button",
|
|
2179
2179
|
onClick: e,
|
|
2180
2180
|
"aria-label": "Back to conversations",
|
|
2181
|
-
children: /* @__PURE__ */ n(
|
|
2181
|
+
children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
|
|
2182
2182
|
}
|
|
2183
2183
|
),
|
|
2184
2184
|
/* @__PURE__ */ n(
|
|
2185
|
-
|
|
2185
|
+
re,
|
|
2186
2186
|
{
|
|
2187
2187
|
id: ((v = l == null ? void 0 : l.user) == null ? void 0 : v.id) || o.id || "unknown",
|
|
2188
2188
|
name: d,
|
|
@@ -2204,8 +2204,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2204
2204
|
}
|
|
2205
2205
|
) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: d }),
|
|
2206
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(
|
|
2208
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2207
|
+
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2208
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: jt })
|
|
2209
2209
|
] })
|
|
2210
2210
|
] })
|
|
2211
2211
|
] }),
|
|
@@ -2213,7 +2213,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2213
2213
|
r && /* @__PURE__ */ n(
|
|
2214
2214
|
"button",
|
|
2215
2215
|
{
|
|
2216
|
-
className:
|
|
2216
|
+
className: le,
|
|
2217
2217
|
onClick: u,
|
|
2218
2218
|
type: "button",
|
|
2219
2219
|
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
@@ -2232,17 +2232,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2232
2232
|
a && s && /* @__PURE__ */ n(
|
|
2233
2233
|
"button",
|
|
2234
2234
|
{
|
|
2235
|
-
className:
|
|
2235
|
+
className: le,
|
|
2236
2236
|
onClick: s,
|
|
2237
2237
|
type: "button",
|
|
2238
2238
|
"aria-label": "Show info",
|
|
2239
|
-
children: /* @__PURE__ */ n(
|
|
2239
|
+
children: /* @__PURE__ */ n(Rt, { className: "size-6 text-black/90" })
|
|
2240
2240
|
}
|
|
2241
2241
|
)
|
|
2242
2242
|
] })
|
|
2243
2243
|
] })
|
|
2244
2244
|
] });
|
|
2245
|
-
},
|
|
2245
|
+
}, Xa = ({
|
|
2246
2246
|
onBack: e,
|
|
2247
2247
|
showBackButton: t,
|
|
2248
2248
|
renderMessageInputActions: s,
|
|
@@ -2257,117 +2257,118 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2257
2257
|
showBlockParticipant: u = !0,
|
|
2258
2258
|
showReportParticipant: f = !0,
|
|
2259
2259
|
showFollowerStatus: c = !0,
|
|
2260
|
-
composerDisabled:
|
|
2261
|
-
composerDisabledReason:
|
|
2260
|
+
composerDisabled: b = !1,
|
|
2261
|
+
composerDisabledReason: _,
|
|
2262
2262
|
showStarButton: v = !1,
|
|
2263
|
-
chatbotVotingEnabled:
|
|
2264
|
-
renderChannelBanner:
|
|
2265
|
-
customProfileContent:
|
|
2266
|
-
customChannelActions:
|
|
2267
|
-
renderMessage:
|
|
2268
|
-
dmAgentEnabled:
|
|
2269
|
-
viewerLanguage:
|
|
2263
|
+
chatbotVotingEnabled: w = !1,
|
|
2264
|
+
renderChannelBanner: y,
|
|
2265
|
+
customProfileContent: S,
|
|
2266
|
+
customChannelActions: k,
|
|
2267
|
+
renderMessage: A,
|
|
2268
|
+
dmAgentEnabled: D = !1,
|
|
2269
|
+
viewerLanguage: T,
|
|
2270
|
+
showChannelInfo: M = !0
|
|
2270
2271
|
}) => {
|
|
2271
|
-
var
|
|
2272
|
-
const { channel:
|
|
2273
|
-
var
|
|
2274
|
-
const
|
|
2275
|
-
return
|
|
2276
|
-
(
|
|
2277
|
-
var
|
|
2278
|
-
return ((
|
|
2272
|
+
var q, $, p, x, L, U;
|
|
2273
|
+
const { channel: N } = de(), E = K(null), I = z.useMemo(() => {
|
|
2274
|
+
var X, Q;
|
|
2275
|
+
const R = (X = N._client) == null ? void 0 : X.userID;
|
|
2276
|
+
return R ? Object.values(((Q = N.state) == null ? void 0 : Q.members) || {}).find(
|
|
2277
|
+
(te) => {
|
|
2278
|
+
var ee;
|
|
2279
|
+
return ((ee = te.user) == null ? void 0 : ee.id) && te.user.id !== R;
|
|
2279
2280
|
}
|
|
2280
2281
|
) : void 0;
|
|
2281
|
-
}, [(
|
|
2282
|
-
var
|
|
2283
|
-
const
|
|
2284
|
-
return
|
|
2285
|
-
var
|
|
2286
|
-
return ((
|
|
2282
|
+
}, [(q = N._client) == null ? void 0 : q.userID, ($ = N.state) == null ? void 0 : $.members]), B = z.useMemo(() => {
|
|
2283
|
+
var X, Q;
|
|
2284
|
+
const R = (X = N._client) == null ? void 0 : X.userID;
|
|
2285
|
+
return R ? Object.values(((Q = N.state) == null ? void 0 : Q.members) || {}).find((te) => {
|
|
2286
|
+
var ee;
|
|
2287
|
+
return ((ee = te.user) == null ? void 0 : ee.id) === R;
|
|
2287
2288
|
}) : void 0;
|
|
2288
|
-
}, [(
|
|
2289
|
+
}, [(p = N._client) == null ? void 0 : p.userID, (x = N.state) == null ? void 0 : x.members]), P = ((L = B == null ? void 0 : B.user) == null ? void 0 : L.is_account) ?? (B == null ? void 0 : B.is_account), Z = ((U = I == null ? void 0 : I.user) == null ? void 0 : U.is_account) ?? (I == null ? void 0 : I.is_account), G = D && P === !1 && Z === !0, H = z.useMemo(() => {
|
|
2289
2290
|
if (!c) return;
|
|
2290
|
-
const
|
|
2291
|
-
if (
|
|
2292
|
-
return String(
|
|
2293
|
-
if (
|
|
2294
|
-
return
|
|
2295
|
-
}, [
|
|
2296
|
-
var
|
|
2297
|
-
(
|
|
2298
|
-
}, []),
|
|
2299
|
-
var
|
|
2300
|
-
(
|
|
2301
|
-
}, []),
|
|
2302
|
-
(
|
|
2303
|
-
const { message:
|
|
2304
|
-
|
|
2291
|
+
const R = N.data ?? {};
|
|
2292
|
+
if (R.followerStatus)
|
|
2293
|
+
return String(R.followerStatus);
|
|
2294
|
+
if (R.isFollower !== void 0)
|
|
2295
|
+
return R.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2296
|
+
}, [N.data, c]), j = W(() => {
|
|
2297
|
+
var R;
|
|
2298
|
+
(R = E.current) == null || R.showModal();
|
|
2299
|
+
}, []), F = W(() => {
|
|
2300
|
+
var R;
|
|
2301
|
+
(R = E.current) == null || R.close();
|
|
2302
|
+
}, []), Y = W(
|
|
2303
|
+
(R) => {
|
|
2304
|
+
const { message: V } = pe("ChannelView"), X = /* @__PURE__ */ n(
|
|
2305
|
+
Ca,
|
|
2305
2306
|
{
|
|
2306
|
-
...
|
|
2307
|
-
chatbotVotingEnabled:
|
|
2308
|
-
viewerLanguage:
|
|
2307
|
+
...R,
|
|
2308
|
+
chatbotVotingEnabled: w,
|
|
2309
|
+
viewerLanguage: T
|
|
2309
2310
|
}
|
|
2310
2311
|
);
|
|
2311
|
-
return !
|
|
2312
|
+
return !A || !V ? X : A(X, V);
|
|
2312
2313
|
},
|
|
2313
|
-
[
|
|
2314
|
+
[w, A, T]
|
|
2314
2315
|
);
|
|
2315
|
-
return /* @__PURE__ */ h(
|
|
2316
|
+
return /* @__PURE__ */ h(ae, { children: [
|
|
2316
2317
|
/* @__PURE__ */ n(
|
|
2317
|
-
|
|
2318
|
+
rs,
|
|
2318
2319
|
{
|
|
2319
2320
|
overrides: {
|
|
2320
|
-
Message:
|
|
2321
|
-
MessageActions:
|
|
2321
|
+
Message: Y,
|
|
2322
|
+
MessageActions: Ia
|
|
2322
2323
|
},
|
|
2323
|
-
children: /* @__PURE__ */ h(
|
|
2324
|
+
children: /* @__PURE__ */ h(is, { children: [
|
|
2324
2325
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2325
|
-
|
|
2326
|
+
Wa,
|
|
2326
2327
|
{
|
|
2327
2328
|
onBack: e,
|
|
2328
2329
|
showBackButton: t,
|
|
2329
|
-
onShowInfo:
|
|
2330
|
-
canShowInfo: !!I,
|
|
2330
|
+
onShowInfo: j,
|
|
2331
|
+
canShowInfo: M && !!I,
|
|
2331
2332
|
showStarButton: v,
|
|
2332
|
-
dmAgentEnabled:
|
|
2333
|
+
dmAgentEnabled: G
|
|
2333
2334
|
}
|
|
2334
2335
|
) }, "lt-channel-header"),
|
|
2335
|
-
|
|
2336
|
+
y ? /* @__PURE__ */ n(z.Fragment, { children: y() }, "lt-channel-banner") : null,
|
|
2336
2337
|
/* @__PURE__ */ n(
|
|
2337
2338
|
"div",
|
|
2338
2339
|
{
|
|
2339
2340
|
className: "flex-1 overflow-hidden relative",
|
|
2340
|
-
children: /* @__PURE__ */ n(
|
|
2341
|
+
children: /* @__PURE__ */ n(os, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2341
2342
|
},
|
|
2342
2343
|
"lt-channel-message-list"
|
|
2343
2344
|
),
|
|
2344
|
-
r ? /* @__PURE__ */ n(
|
|
2345
|
+
r ? /* @__PURE__ */ n(z.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
|
|
2345
2346
|
/* @__PURE__ */ n(
|
|
2346
|
-
|
|
2347
|
+
Ra,
|
|
2347
2348
|
{
|
|
2348
2349
|
...s && {
|
|
2349
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2350
|
+
renderActions: () => s == null ? void 0 : s(N)
|
|
2350
2351
|
},
|
|
2351
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2352
|
-
disabled:
|
|
2353
|
-
disabledReason:
|
|
2352
|
+
renderFooter: () => a == null ? void 0 : a(N),
|
|
2353
|
+
disabled: b,
|
|
2354
|
+
disabledReason: _
|
|
2354
2355
|
},
|
|
2355
2356
|
"lt-channel-message-input"
|
|
2356
2357
|
)
|
|
2357
2358
|
] })
|
|
2358
2359
|
}
|
|
2359
2360
|
),
|
|
2360
|
-
/* @__PURE__ */ n(
|
|
2361
|
-
|
|
2361
|
+
M && /* @__PURE__ */ n(
|
|
2362
|
+
$s,
|
|
2362
2363
|
{
|
|
2363
|
-
dialogRef:
|
|
2364
|
-
onClose:
|
|
2364
|
+
dialogRef: E,
|
|
2365
|
+
onClose: F,
|
|
2365
2366
|
participant: I,
|
|
2366
2367
|
participantDisplayName: Ae(
|
|
2367
2368
|
I == null ? void 0 : I.user
|
|
2368
2369
|
),
|
|
2369
|
-
channel:
|
|
2370
|
-
followerStatusLabel:
|
|
2370
|
+
channel: N,
|
|
2371
|
+
followerStatusLabel: H,
|
|
2371
2372
|
onLeaveConversation: i,
|
|
2372
2373
|
onBlockParticipant: o,
|
|
2373
2374
|
showDeleteConversation: l,
|
|
@@ -2376,12 +2377,12 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2376
2377
|
onDeleteConversationClick: d,
|
|
2377
2378
|
onBlockParticipantClick: m,
|
|
2378
2379
|
onReportParticipantClick: g,
|
|
2379
|
-
customProfileContent:
|
|
2380
|
-
customChannelActions:
|
|
2380
|
+
customProfileContent: S,
|
|
2381
|
+
customChannelActions: k
|
|
2381
2382
|
}
|
|
2382
2383
|
)
|
|
2383
2384
|
] });
|
|
2384
|
-
},
|
|
2385
|
+
}, dn = z.memo(
|
|
2385
2386
|
({
|
|
2386
2387
|
channel: e,
|
|
2387
2388
|
onBack: t,
|
|
@@ -2392,83 +2393,84 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2392
2393
|
onLeaveConversation: o,
|
|
2393
2394
|
onBlockParticipant: l,
|
|
2394
2395
|
className: d,
|
|
2395
|
-
CustomChannelEmptyState: m =
|
|
2396
|
+
CustomChannelEmptyState: m = Ya,
|
|
2396
2397
|
showDeleteConversation: g = !0,
|
|
2397
2398
|
onDeleteConversationClick: u,
|
|
2398
2399
|
onBlockParticipantClick: f,
|
|
2399
2400
|
onReportParticipantClick: c,
|
|
2400
|
-
showBlockParticipant:
|
|
2401
|
-
showReportParticipant:
|
|
2401
|
+
showBlockParticipant: b = !0,
|
|
2402
|
+
showReportParticipant: _ = !0,
|
|
2402
2403
|
showFollowerStatus: v = !0,
|
|
2403
|
-
composerDisabled:
|
|
2404
|
-
composerDisabledReason:
|
|
2405
|
-
dmAgentEnabled:
|
|
2406
|
-
messageMetadata:
|
|
2407
|
-
onMessageSent:
|
|
2408
|
-
showStarButton:
|
|
2409
|
-
chatbotVotingEnabled:
|
|
2410
|
-
renderChannelBanner:
|
|
2411
|
-
customProfileContent:
|
|
2412
|
-
customChannelActions:
|
|
2413
|
-
renderMessage:
|
|
2414
|
-
onMessageLinkClick:
|
|
2415
|
-
sendButton:
|
|
2404
|
+
composerDisabled: w = !1,
|
|
2405
|
+
composerDisabledReason: y,
|
|
2406
|
+
dmAgentEnabled: S,
|
|
2407
|
+
messageMetadata: k,
|
|
2408
|
+
onMessageSent: A,
|
|
2409
|
+
showStarButton: D = !1,
|
|
2410
|
+
chatbotVotingEnabled: T = !1,
|
|
2411
|
+
renderChannelBanner: M,
|
|
2412
|
+
customProfileContent: N,
|
|
2413
|
+
customChannelActions: E,
|
|
2414
|
+
renderMessage: I,
|
|
2415
|
+
onMessageLinkClick: B,
|
|
2416
|
+
sendButton: P,
|
|
2416
2417
|
attachmentPreviewList: Z,
|
|
2417
|
-
viewerLanguage:
|
|
2418
|
+
viewerLanguage: G,
|
|
2419
|
+
showChannelInfo: H = !0
|
|
2418
2420
|
}) => {
|
|
2419
|
-
const
|
|
2420
|
-
async (
|
|
2421
|
-
var
|
|
2422
|
-
const
|
|
2423
|
-
...
|
|
2424
|
-
...
|
|
2425
|
-
...
|
|
2421
|
+
const j = W(
|
|
2422
|
+
async (Y, q, $) => {
|
|
2423
|
+
var V;
|
|
2424
|
+
const p = ((V = e.data) == null ? void 0 : V.chatbot_paused) === !0, x = S && !p, L = {
|
|
2425
|
+
...q,
|
|
2426
|
+
...x && { silent: !0 },
|
|
2427
|
+
...k && {
|
|
2426
2428
|
metadata: {
|
|
2427
|
-
...
|
|
2428
|
-
...
|
|
2429
|
+
...q.metadata ?? {},
|
|
2430
|
+
...k
|
|
2429
2431
|
}
|
|
2430
2432
|
}
|
|
2431
|
-
},
|
|
2432
|
-
|
|
2433
|
-
...
|
|
2434
|
-
},
|
|
2435
|
-
return
|
|
2433
|
+
}, U = {
|
|
2434
|
+
...$,
|
|
2435
|
+
...x && { skip_push: !0 }
|
|
2436
|
+
}, R = await e.sendMessage(L, U);
|
|
2437
|
+
return A == null || A(R), R;
|
|
2436
2438
|
},
|
|
2437
|
-
[e,
|
|
2438
|
-
),
|
|
2439
|
+
[e, S, k, A]
|
|
2440
|
+
), F = K(null);
|
|
2439
2441
|
return J(() => {
|
|
2440
|
-
if (!V) return;
|
|
2441
|
-
const B = O.current;
|
|
2442
2442
|
if (!B) return;
|
|
2443
|
-
const
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
const
|
|
2447
|
-
|
|
2443
|
+
const Y = F.current;
|
|
2444
|
+
if (!Y) return;
|
|
2445
|
+
const q = ($) => {
|
|
2446
|
+
const p = $.target, x = p == null ? void 0 : p.closest("a[href]"), L = x == null ? void 0 : x.getAttribute("href");
|
|
2447
|
+
if (!L) return;
|
|
2448
|
+
const U = x == null ? void 0 : x.closest("[data-message-id]"), R = U == null ? void 0 : U.getAttribute("data-message-id"), V = R ? e.state.messages.find((X) => X.id === R) : void 0;
|
|
2449
|
+
B(L, V);
|
|
2448
2450
|
};
|
|
2449
|
-
return
|
|
2450
|
-
}, [
|
|
2451
|
+
return Y.addEventListener("click", q), () => Y.removeEventListener("click", q);
|
|
2452
|
+
}, [B, e]), /* @__PURE__ */ n(
|
|
2451
2453
|
"div",
|
|
2452
2454
|
{
|
|
2453
|
-
ref:
|
|
2455
|
+
ref: F,
|
|
2454
2456
|
className: C(
|
|
2455
2457
|
"messaging-channel-view h-full flex flex-col",
|
|
2456
2458
|
d
|
|
2457
2459
|
),
|
|
2458
|
-
children: /* @__PURE__ */ n(
|
|
2459
|
-
|
|
2460
|
+
children: /* @__PURE__ */ n(cn.Provider, { value: S ?? !1, children: /* @__PURE__ */ n(
|
|
2461
|
+
as,
|
|
2460
2462
|
{
|
|
2461
2463
|
channel: e,
|
|
2462
2464
|
MessageSystem: Ua,
|
|
2463
2465
|
EmptyStateIndicator: m,
|
|
2464
2466
|
LoadingIndicator: Ee,
|
|
2465
|
-
DateSeparator:
|
|
2466
|
-
TypingIndicator:
|
|
2467
|
-
doSendMessageRequest:
|
|
2468
|
-
...
|
|
2467
|
+
DateSeparator: Bs,
|
|
2468
|
+
TypingIndicator: Ga,
|
|
2469
|
+
doSendMessageRequest: j,
|
|
2470
|
+
...P ? { SendButton: P } : {},
|
|
2469
2471
|
...Z ? { AttachmentPreviewList: Z } : {},
|
|
2470
2472
|
children: /* @__PURE__ */ n(
|
|
2471
|
-
|
|
2473
|
+
Xa,
|
|
2472
2474
|
{
|
|
2473
2475
|
onBack: t,
|
|
2474
2476
|
showBackButton: s,
|
|
@@ -2482,19 +2484,20 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2482
2484
|
onDeleteConversationClick: u,
|
|
2483
2485
|
onBlockParticipantClick: f,
|
|
2484
2486
|
onReportParticipantClick: c,
|
|
2485
|
-
showBlockParticipant:
|
|
2486
|
-
showReportParticipant:
|
|
2487
|
+
showBlockParticipant: b,
|
|
2488
|
+
showReportParticipant: _,
|
|
2487
2489
|
showFollowerStatus: v,
|
|
2488
|
-
composerDisabled:
|
|
2489
|
-
composerDisabledReason:
|
|
2490
|
-
showStarButton:
|
|
2491
|
-
dmAgentEnabled:
|
|
2492
|
-
chatbotVotingEnabled:
|
|
2493
|
-
renderChannelBanner:
|
|
2494
|
-
customProfileContent:
|
|
2495
|
-
customChannelActions:
|
|
2496
|
-
renderMessage:
|
|
2497
|
-
viewerLanguage:
|
|
2490
|
+
composerDisabled: w,
|
|
2491
|
+
composerDisabledReason: y,
|
|
2492
|
+
showStarButton: D,
|
|
2493
|
+
dmAgentEnabled: S,
|
|
2494
|
+
chatbotVotingEnabled: T,
|
|
2495
|
+
renderChannelBanner: M,
|
|
2496
|
+
customProfileContent: N,
|
|
2497
|
+
customChannelActions: E,
|
|
2498
|
+
renderMessage: I,
|
|
2499
|
+
viewerLanguage: G,
|
|
2500
|
+
showChannelInfo: H
|
|
2498
2501
|
}
|
|
2499
2502
|
)
|
|
2500
2503
|
}
|
|
@@ -2503,8 +2506,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2503
2506
|
);
|
|
2504
2507
|
}
|
|
2505
2508
|
);
|
|
2506
|
-
|
|
2507
|
-
const
|
|
2509
|
+
dn.displayName = "ChannelView";
|
|
2510
|
+
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
2511
|
/* @__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
2512
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2510
2513
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2518,8 +2521,8 @@ const he = R.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2518
2521
|
}
|
|
2519
2522
|
)
|
|
2520
2523
|
] }) }));
|
|
2521
|
-
|
|
2522
|
-
const
|
|
2524
|
+
fe.displayName = "ErrorState";
|
|
2525
|
+
const _i = ({
|
|
2523
2526
|
capabilities: e = {},
|
|
2524
2527
|
renderMessageInputActions: t,
|
|
2525
2528
|
renderConversationFooter: s,
|
|
@@ -2534,151 +2537,153 @@ const yi = ({
|
|
|
2534
2537
|
onMessageSent: u,
|
|
2535
2538
|
chatbotVotingEnabled: f = !1,
|
|
2536
2539
|
viewerLanguage: c,
|
|
2537
|
-
renderChannelBanner:
|
|
2538
|
-
customChannelActions:
|
|
2540
|
+
renderChannelBanner: b,
|
|
2541
|
+
customChannelActions: _,
|
|
2539
2542
|
renderMessage: v,
|
|
2540
|
-
onMessageLinkClick:
|
|
2543
|
+
onMessageLinkClick: w,
|
|
2544
|
+
showChannelInfo: y
|
|
2541
2545
|
}) => {
|
|
2542
2546
|
const {
|
|
2543
|
-
client:
|
|
2544
|
-
isConnected:
|
|
2547
|
+
client: S,
|
|
2548
|
+
isConnected: k,
|
|
2545
2549
|
isLoading: A,
|
|
2546
|
-
error:
|
|
2547
|
-
refreshConnection:
|
|
2548
|
-
service:
|
|
2549
|
-
debug:
|
|
2550
|
-
} =
|
|
2551
|
-
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
const
|
|
2550
|
+
error: D,
|
|
2551
|
+
refreshConnection: T,
|
|
2552
|
+
service: M,
|
|
2553
|
+
debug: N
|
|
2554
|
+
} = Ds(), [E, I] = O(null), [B, P] = O(null), [Z, G] = O(!1), { showDeleteConversation: H = !0 } = e, j = K(o);
|
|
2555
|
+
j.current = o;
|
|
2556
|
+
const F = K(a);
|
|
2557
|
+
F.current = a;
|
|
2558
|
+
const Y = K(null), q = K(null);
|
|
2555
2559
|
J(() => {
|
|
2556
|
-
|
|
2557
|
-
}, [
|
|
2558
|
-
if (!
|
|
2559
|
-
const
|
|
2560
|
-
if (!
|
|
2561
|
-
const
|
|
2562
|
-
if (
|
|
2563
|
-
|
|
2564
|
-
const
|
|
2565
|
-
|
|
2560
|
+
q.current = E;
|
|
2561
|
+
}, [E]), J(() => {
|
|
2562
|
+
if (!S || !k) return;
|
|
2563
|
+
const x = S.userID;
|
|
2564
|
+
if (!x) return;
|
|
2565
|
+
const L = `${x}::${i}`;
|
|
2566
|
+
if (Y.current === L) return;
|
|
2567
|
+
Y.current = L;
|
|
2568
|
+
const U = () => {
|
|
2569
|
+
Y.current === L && (Y.current = null);
|
|
2566
2570
|
};
|
|
2567
2571
|
(async () => {
|
|
2568
|
-
var
|
|
2572
|
+
var V, X;
|
|
2569
2573
|
try {
|
|
2570
|
-
|
|
2574
|
+
N && console.log(
|
|
2571
2575
|
"[MessagingShell] Loading initial conversation with:",
|
|
2572
2576
|
i
|
|
2573
2577
|
);
|
|
2574
|
-
const
|
|
2578
|
+
const Q = await S.queryChannels(
|
|
2575
2579
|
{
|
|
2576
2580
|
type: "messaging",
|
|
2577
|
-
members: { $eq: [
|
|
2581
|
+
members: { $eq: [x, i] }
|
|
2578
2582
|
},
|
|
2579
2583
|
{},
|
|
2580
2584
|
{ limit: 1 }
|
|
2581
2585
|
);
|
|
2582
|
-
if (
|
|
2583
|
-
I(
|
|
2586
|
+
if (Q.length > 0) {
|
|
2587
|
+
I(Q[0]), P(null), (V = F.current) == null || V.call(F, Q[0]), N && console.log(
|
|
2584
2588
|
"[MessagingShell] Initial conversation loaded:",
|
|
2585
|
-
|
|
2589
|
+
Q[0].id
|
|
2586
2590
|
);
|
|
2587
2591
|
return;
|
|
2588
2592
|
}
|
|
2589
|
-
const
|
|
2590
|
-
if (!
|
|
2591
|
-
|
|
2593
|
+
const te = j.current;
|
|
2594
|
+
if (!te || !M) {
|
|
2595
|
+
U(), P("No conversation found with this account"), N && console.log(
|
|
2592
2596
|
"[MessagingShell] No conversation found for:",
|
|
2593
2597
|
i
|
|
2594
2598
|
);
|
|
2595
2599
|
return;
|
|
2596
2600
|
}
|
|
2597
2601
|
try {
|
|
2598
|
-
const
|
|
2599
|
-
id:
|
|
2600
|
-
name:
|
|
2601
|
-
phone:
|
|
2602
|
+
const ee = await M.startChannelWithParticipant({
|
|
2603
|
+
id: te.id,
|
|
2604
|
+
name: te.name,
|
|
2605
|
+
phone: te.phone
|
|
2602
2606
|
});
|
|
2603
|
-
I(
|
|
2607
|
+
I(ee), P(null), (X = F.current) == null || X.call(F, ee), N && console.log(
|
|
2604
2608
|
"[MessagingShell] Channel created and loaded:",
|
|
2605
|
-
|
|
2609
|
+
ee.id
|
|
2606
2610
|
);
|
|
2607
|
-
} catch (
|
|
2611
|
+
} catch (ee) {
|
|
2608
2612
|
console.error(
|
|
2609
2613
|
"[MessagingShell] Failed to create conversation:",
|
|
2610
|
-
|
|
2611
|
-
),
|
|
2614
|
+
ee
|
|
2615
|
+
), U(), P("Failed to create conversation");
|
|
2612
2616
|
}
|
|
2613
|
-
} catch (
|
|
2617
|
+
} catch (Q) {
|
|
2614
2618
|
console.error(
|
|
2615
2619
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2616
|
-
|
|
2617
|
-
),
|
|
2620
|
+
Q
|
|
2621
|
+
), U(), q.current || P("Failed to load conversation");
|
|
2618
2622
|
}
|
|
2619
2623
|
})();
|
|
2620
|
-
}, [i,
|
|
2621
|
-
const
|
|
2622
|
-
|
|
2623
|
-
const
|
|
2624
|
-
var
|
|
2625
|
-
I(null),
|
|
2624
|
+
}, [i, S, k, M, N]);
|
|
2625
|
+
const $ = K(r);
|
|
2626
|
+
$.current = r;
|
|
2627
|
+
const p = W(() => {
|
|
2628
|
+
var x;
|
|
2629
|
+
I(null), G(!0), (x = $.current) == null || x.call($);
|
|
2626
2630
|
}, []);
|
|
2627
|
-
return A ? /* @__PURE__ */ n(Ee, {}) :
|
|
2628
|
-
|
|
2631
|
+
return A ? /* @__PURE__ */ n(Ee, {}) : D ? /* @__PURE__ */ n(fe, { message: D, onBack: T }) : !k || !S ? /* @__PURE__ */ n(
|
|
2632
|
+
fe,
|
|
2629
2633
|
{
|
|
2630
2634
|
message: "Not connected to messaging service",
|
|
2631
|
-
onBack:
|
|
2635
|
+
onBack: T
|
|
2632
2636
|
}
|
|
2633
|
-
) :
|
|
2634
|
-
|
|
2637
|
+
) : B ? /* @__PURE__ */ n(fe, { message: B }) : Z && !E ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : E ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2638
|
+
dn,
|
|
2635
2639
|
{
|
|
2636
|
-
channel:
|
|
2640
|
+
channel: E,
|
|
2637
2641
|
renderMessageInputActions: t,
|
|
2638
2642
|
renderConversationFooter: s,
|
|
2639
|
-
renderChannelBanner:
|
|
2640
|
-
onLeaveConversation:
|
|
2641
|
-
onBlockParticipant:
|
|
2643
|
+
renderChannelBanner: b,
|
|
2644
|
+
onLeaveConversation: p,
|
|
2645
|
+
onBlockParticipant: p,
|
|
2642
2646
|
CustomChannelEmptyState: l,
|
|
2643
|
-
showDeleteConversation:
|
|
2647
|
+
showDeleteConversation: H,
|
|
2644
2648
|
onBlockParticipantClick: d,
|
|
2645
2649
|
onReportParticipantClick: m,
|
|
2646
2650
|
dmAgentEnabled: g,
|
|
2647
2651
|
onMessageSent: u,
|
|
2648
2652
|
chatbotVotingEnabled: f,
|
|
2649
2653
|
viewerLanguage: c,
|
|
2650
|
-
customChannelActions:
|
|
2654
|
+
customChannelActions: _,
|
|
2651
2655
|
renderMessage: v,
|
|
2652
|
-
onMessageLinkClick:
|
|
2656
|
+
onMessageLinkClick: w,
|
|
2657
|
+
showChannelInfo: y
|
|
2653
2658
|
},
|
|
2654
|
-
|
|
2659
|
+
E.id
|
|
2655
2660
|
) }) }) : /* @__PURE__ */ n(Ee, {});
|
|
2656
2661
|
};
|
|
2657
|
-
function
|
|
2662
|
+
function Ka(e) {
|
|
2658
2663
|
const t = e.state.pending_messages;
|
|
2659
2664
|
if (t != null && t.length)
|
|
2660
2665
|
for (const s of t)
|
|
2661
2666
|
e.state.addMessageSorted(s.message);
|
|
2662
2667
|
}
|
|
2663
|
-
const
|
|
2668
|
+
const un = z.createContext({
|
|
2664
2669
|
selectedChannel: void 0,
|
|
2665
2670
|
onChannelSelect: () => {
|
|
2666
2671
|
},
|
|
2667
2672
|
debug: !1,
|
|
2668
2673
|
renderMessagePreview: void 0,
|
|
2669
2674
|
viewerLanguage: void 0
|
|
2670
|
-
}),
|
|
2675
|
+
}), Ja = un.Provider, Za = () => z.useContext(un), Qa = (e, t) => {
|
|
2671
2676
|
const s = new Date(
|
|
2672
2677
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2673
2678
|
), r = new Date(
|
|
2674
2679
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2675
2680
|
).getTime() - s.getTime();
|
|
2676
2681
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2677
|
-
},
|
|
2682
|
+
}, er = (e) => {
|
|
2678
2683
|
const t = /* @__PURE__ */ new Date();
|
|
2679
2684
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2680
2685
|
return "Just now";
|
|
2681
|
-
const a =
|
|
2686
|
+
const a = Qa(e, t);
|
|
2682
2687
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2683
2688
|
hour: "numeric",
|
|
2684
2689
|
minute: "2-digit",
|
|
@@ -2688,51 +2693,51 @@ const mn = R.createContext({
|
|
|
2688
2693
|
day: "numeric",
|
|
2689
2694
|
year: "2-digit"
|
|
2690
2695
|
});
|
|
2691
|
-
},
|
|
2696
|
+
}, mn = z.memo(
|
|
2692
2697
|
({ channel: e, unread: t }) => {
|
|
2693
|
-
var
|
|
2698
|
+
var D, T, M;
|
|
2694
2699
|
const {
|
|
2695
2700
|
selectedChannel: s,
|
|
2696
2701
|
onChannelSelect: a,
|
|
2697
2702
|
debug: r,
|
|
2698
2703
|
renderMessagePreview: i,
|
|
2699
2704
|
viewerLanguage: o
|
|
2700
|
-
} =
|
|
2705
|
+
} = Za(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2701
2706
|
e && a(e);
|
|
2702
|
-
}, m = (
|
|
2703
|
-
const
|
|
2704
|
-
!
|
|
2705
|
-
}, u = Object.values(((
|
|
2706
|
-
(
|
|
2707
|
-
var
|
|
2708
|
-
return ((
|
|
2707
|
+
}, m = (N) => {
|
|
2708
|
+
const E = N.key === "Enter" || N.key === " ", I = N.repeat;
|
|
2709
|
+
!E || I || (N.preventDefault(), d());
|
|
2710
|
+
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
2711
|
+
(N) => {
|
|
2712
|
+
var E, I;
|
|
2713
|
+
return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== ((I = e == null ? void 0 : e._client) == null ? void 0 : I.userID);
|
|
2709
2714
|
}
|
|
2710
|
-
), f = Ae(u == null ? void 0 : u.user), c = (
|
|
2711
|
-
var
|
|
2712
|
-
const
|
|
2713
|
-
if (
|
|
2714
|
-
for (let
|
|
2715
|
-
if (
|
|
2715
|
+
), f = Ae(u == null ? void 0 : u.user), c = (T = u == null ? void 0 : u.user) == null ? void 0 : T.image, b = (() => {
|
|
2716
|
+
var E;
|
|
2717
|
+
const N = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
|
|
2718
|
+
if (N != null && N.length) {
|
|
2719
|
+
for (let I = N.length - 1; I >= 0; I--)
|
|
2720
|
+
if (N[I].type !== "system") return N[I];
|
|
2716
2721
|
}
|
|
2717
2722
|
})(), v = (() => {
|
|
2718
|
-
var Z,
|
|
2719
|
-
const
|
|
2720
|
-
message:
|
|
2723
|
+
var Z, G, H, j;
|
|
2724
|
+
const N = Xt({
|
|
2725
|
+
message: b,
|
|
2721
2726
|
viewerLanguage: o
|
|
2722
2727
|
});
|
|
2723
|
-
if (((Z =
|
|
2724
|
-
if (((
|
|
2725
|
-
if (((
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
return
|
|
2729
|
-
})(),
|
|
2728
|
+
if (((Z = b == null ? void 0 : b.metadata) == null ? void 0 : Z.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
|
|
2729
|
+
if (((G = b == null ? void 0 : b.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
|
|
2730
|
+
if (((H = b == null ? void 0 : b.metadata) == null ? void 0 : H.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
|
|
2731
|
+
if (N) return N;
|
|
2732
|
+
const P = (j = b == null ? void 0 : b.attachments) == null ? void 0 : j[0];
|
|
2733
|
+
return P ? P.og_scrape_url ? P.og_scrape_url : P.type === "image" ? "📷 Sent an image" : P.type === "video" ? "🎥 Sent a video" : P.type === "audio" ? "🎵 Sent audio" : P.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2734
|
+
})(), w = b != null && b.created_at ? er(new Date(b.created_at)) : "", y = b ? ke(b) : !1, S = i ? i(b, v) : `${y ? "✨ " : ""}${v}`, k = Wt(e), A = t ?? 0;
|
|
2730
2735
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2731
2736
|
channelId: e == null ? void 0 : e.id,
|
|
2732
2737
|
isSelected: l,
|
|
2733
2738
|
participantName: f,
|
|
2734
|
-
unreadCount:
|
|
2735
|
-
hasTimestamp: !!
|
|
2739
|
+
unreadCount: A,
|
|
2740
|
+
hasTimestamp: !!w
|
|
2736
2741
|
}), /* @__PURE__ */ n(
|
|
2737
2742
|
"div",
|
|
2738
2743
|
{
|
|
@@ -2749,13 +2754,13 @@ const mn = R.createContext({
|
|
|
2749
2754
|
),
|
|
2750
2755
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2751
2756
|
/* @__PURE__ */ n(
|
|
2752
|
-
|
|
2757
|
+
re,
|
|
2753
2758
|
{
|
|
2754
|
-
id: ((
|
|
2759
|
+
id: ((M = u == null ? void 0 : u.user) == null ? void 0 : M.id) || e.id || "unknown",
|
|
2755
2760
|
name: f,
|
|
2756
2761
|
image: c,
|
|
2757
2762
|
size: 48,
|
|
2758
|
-
starred:
|
|
2763
|
+
starred: k
|
|
2759
2764
|
}
|
|
2760
2765
|
),
|
|
2761
2766
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2767,16 +2772,16 @@ const mn = R.createContext({
|
|
|
2767
2772
|
"text-sm font-medium truncate text-[#191918]"
|
|
2768
2773
|
),
|
|
2769
2774
|
children: [
|
|
2770
|
-
|
|
2775
|
+
k && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2771
2776
|
f
|
|
2772
2777
|
]
|
|
2773
2778
|
}
|
|
2774
2779
|
),
|
|
2775
|
-
|
|
2780
|
+
w && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: w })
|
|
2776
2781
|
] }),
|
|
2777
2782
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2778
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2779
|
-
|
|
2783
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: S }),
|
|
2784
|
+
A > 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: A > 99 ? "99+" : A })
|
|
2780
2785
|
] })
|
|
2781
2786
|
] })
|
|
2782
2787
|
] })
|
|
@@ -2784,135 +2789,95 @@ const mn = R.createContext({
|
|
|
2784
2789
|
);
|
|
2785
2790
|
}
|
|
2786
2791
|
);
|
|
2787
|
-
|
|
2788
|
-
const
|
|
2789
|
-
isInitialLoadSettled: !1,
|
|
2790
|
-
channels: [],
|
|
2791
|
-
rawChannels: [],
|
|
2792
|
-
hasChannels: !1,
|
|
2793
|
-
unreadCount: 0
|
|
2794
|
-
}, sr = R.memo(
|
|
2792
|
+
mn.displayName = "CustomChannelPreview";
|
|
2793
|
+
const tr = { last_message_at: -1 }, nr = z.memo(
|
|
2795
2794
|
({
|
|
2796
2795
|
onChannelSelect: e,
|
|
2797
2796
|
selectedChannel: t,
|
|
2798
2797
|
filters: s,
|
|
2799
2798
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2800
2799
|
channelRenderFilterFn: r,
|
|
2801
|
-
sort: i =
|
|
2800
|
+
sort: i = tr,
|
|
2802
2801
|
className: o,
|
|
2803
2802
|
customEmptyStateIndicator: l,
|
|
2804
2803
|
renderMessagePreview: d,
|
|
2805
|
-
viewerLanguage: m
|
|
2806
|
-
onStateChange: g
|
|
2804
|
+
viewerLanguage: m
|
|
2807
2805
|
}) => {
|
|
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;
|
|
2806
|
+
const g = z.useRef(0);
|
|
2807
|
+
g.current++;
|
|
2808
|
+
const { debug: u = !1 } = We(), f = z.useCallback(
|
|
2809
|
+
(b) => {
|
|
2810
|
+
for (const _ of b)
|
|
2811
|
+
Ka(_);
|
|
2812
|
+
return r ? r(b) : b;
|
|
2844
2813
|
},
|
|
2845
|
-
[r
|
|
2814
|
+
[r]
|
|
2846
2815
|
);
|
|
2847
|
-
|
|
2848
|
-
renderCount:
|
|
2816
|
+
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
2817
|
+
renderCount: g.current,
|
|
2849
2818
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2850
2819
|
filters: s
|
|
2851
2820
|
});
|
|
2852
|
-
const
|
|
2821
|
+
const c = z.useMemo(
|
|
2853
2822
|
() => ({
|
|
2854
2823
|
selectedChannel: t,
|
|
2855
2824
|
onChannelSelect: e,
|
|
2856
|
-
debug:
|
|
2825
|
+
debug: u,
|
|
2857
2826
|
renderMessagePreview: d,
|
|
2858
2827
|
viewerLanguage: m
|
|
2859
2828
|
}),
|
|
2860
2829
|
[
|
|
2861
2830
|
t,
|
|
2862
2831
|
e,
|
|
2863
|
-
|
|
2832
|
+
u,
|
|
2864
2833
|
d,
|
|
2865
2834
|
m
|
|
2866
2835
|
]
|
|
2867
2836
|
);
|
|
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(
|
|
2837
|
+
return /* @__PURE__ */ n(
|
|
2873
2838
|
"div",
|
|
2874
2839
|
{
|
|
2875
2840
|
className: C(
|
|
2876
2841
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2877
2842
|
o
|
|
2878
2843
|
),
|
|
2879
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2880
|
-
|
|
2844
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Ja, { value: c, children: /* @__PURE__ */ n(
|
|
2845
|
+
ls,
|
|
2881
2846
|
{
|
|
2882
2847
|
filters: s,
|
|
2883
2848
|
sort: i,
|
|
2884
2849
|
options: { limit: 30 },
|
|
2885
2850
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2886
|
-
channelRenderFilterFn:
|
|
2887
|
-
Preview:
|
|
2851
|
+
channelRenderFilterFn: f,
|
|
2852
|
+
Preview: mn,
|
|
2888
2853
|
EmptyStateIndicator: l
|
|
2889
2854
|
},
|
|
2890
|
-
|
|
2855
|
+
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
2891
2856
|
) }) })
|
|
2892
2857
|
}
|
|
2893
2858
|
);
|
|
2894
2859
|
}
|
|
2895
2860
|
);
|
|
2896
|
-
|
|
2897
|
-
const
|
|
2861
|
+
nr.displayName = "ChannelList";
|
|
2862
|
+
const sr = /^([a-z][a-z0-9+.-]*):/i, ar = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2898
2863
|
function et(e) {
|
|
2899
2864
|
if (typeof e != "string") return;
|
|
2900
2865
|
const t = e.trim();
|
|
2901
2866
|
if (t === "") return;
|
|
2902
|
-
const s =
|
|
2867
|
+
const s = sr.exec(t);
|
|
2903
2868
|
if (s) {
|
|
2904
2869
|
const a = s[1].toLowerCase();
|
|
2905
|
-
return
|
|
2870
|
+
return ar.has(a) ? t : void 0;
|
|
2906
2871
|
}
|
|
2907
2872
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2908
2873
|
}
|
|
2909
|
-
const
|
|
2874
|
+
const rr = {
|
|
2910
2875
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2911
2876
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2912
|
-
},
|
|
2877
|
+
}, ir = ({ variant: e, cta: t }) => {
|
|
2913
2878
|
const s = C(
|
|
2914
2879
|
"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
|
-
|
|
2880
|
+
rr[e]
|
|
2916
2881
|
), a = et(t.href);
|
|
2917
2882
|
return a ? /* @__PURE__ */ n(
|
|
2918
2883
|
"a",
|
|
@@ -2939,10 +2904,10 @@ const ir = {
|
|
|
2939
2904
|
children: t.label
|
|
2940
2905
|
}
|
|
2941
2906
|
);
|
|
2942
|
-
},
|
|
2907
|
+
}, or = {
|
|
2943
2908
|
dark: "text-white",
|
|
2944
2909
|
light: "text-black/90"
|
|
2945
|
-
},
|
|
2910
|
+
}, lr = "text-white/30", cr = {
|
|
2946
2911
|
dark: "text-white/55",
|
|
2947
2912
|
light: "text-black/55"
|
|
2948
2913
|
}, tt = ({
|
|
@@ -2955,14 +2920,14 @@ const ir = {
|
|
|
2955
2920
|
cta: o,
|
|
2956
2921
|
trailingAction: l
|
|
2957
2922
|
}) => {
|
|
2958
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
2959
|
-
if (!g && !u && !c && !
|
|
2923
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = o != null;
|
|
2924
|
+
if (!g && !u && !c && !b) return null;
|
|
2960
2925
|
const v = C(
|
|
2961
2926
|
"truncate text-base font-medium leading-6",
|
|
2962
|
-
d && !t ?
|
|
2963
|
-
),
|
|
2927
|
+
d && !t ? lr : or[e]
|
|
2928
|
+
), w = C(
|
|
2964
2929
|
"truncate text-xs leading-4",
|
|
2965
|
-
|
|
2930
|
+
cr[e]
|
|
2966
2931
|
);
|
|
2967
2932
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2968
2933
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2972,15 +2937,15 @@ const ir = {
|
|
|
2972
2937
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2973
2938
|
/* @__PURE__ */ n("p", { className: C("min-w-0", v), children: m })
|
|
2974
2939
|
] }),
|
|
2975
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2940
|
+
u && /* @__PURE__ */ n("p", { className: w, children: a })
|
|
2976
2941
|
] }),
|
|
2977
|
-
!
|
|
2942
|
+
!b && c && /* @__PURE__ */ n("p", { className: w, children: f })
|
|
2978
2943
|
] }),
|
|
2979
2944
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2980
2945
|
] }),
|
|
2981
|
-
o && /* @__PURE__ */ n(
|
|
2946
|
+
o && /* @__PURE__ */ n(ir, { variant: e, cta: o })
|
|
2982
2947
|
] });
|
|
2983
|
-
},
|
|
2948
|
+
}, dr = C(
|
|
2984
2949
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2985
2950
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2986
2951
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2999,7 +2964,7 @@ const ir = {
|
|
|
2999
2964
|
"data-testid": d
|
|
3000
2965
|
}) => {
|
|
3001
2966
|
const m = s != null || a != null, g = C(
|
|
3002
|
-
|
|
2967
|
+
dr,
|
|
3003
2968
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3004
2969
|
// `focus-ring` is a design-system utility from the component-library
|
|
3005
2970
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -3047,15 +3012,15 @@ const ir = {
|
|
|
3047
3012
|
]
|
|
3048
3013
|
}
|
|
3049
3014
|
);
|
|
3050
|
-
},
|
|
3015
|
+
}, ur = {
|
|
3051
3016
|
dark: "bg-white/10",
|
|
3052
3017
|
light: "bg-black/5"
|
|
3053
|
-
},
|
|
3018
|
+
}, mr = {
|
|
3054
3019
|
dark: "size-16 text-white/25",
|
|
3055
3020
|
light: "size-16 text-black/25"
|
|
3056
|
-
}, Me = (e, t) => !!t && !!e &&
|
|
3021
|
+
}, Me = (e, t) => !!t && !!e && ie(e) === "audio", hn = (e, t) => {
|
|
3057
3022
|
if (!t || !e) return !1;
|
|
3058
|
-
const s =
|
|
3023
|
+
const s = ie(e);
|
|
3059
3024
|
return s === "video" || s === "audio";
|
|
3060
3025
|
}, nt = "bg-[#F2F3F4]", Se = ({
|
|
3061
3026
|
variant: e,
|
|
@@ -3066,7 +3031,7 @@ const ir = {
|
|
|
3066
3031
|
topLeft: i,
|
|
3067
3032
|
topRight: o
|
|
3068
3033
|
}) => {
|
|
3069
|
-
const l =
|
|
3034
|
+
const l = ie(r), d = !!s && l === "video";
|
|
3070
3035
|
return Me(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3071
3036
|
"audio",
|
|
3072
3037
|
{
|
|
@@ -3108,10 +3073,10 @@ const ir = {
|
|
|
3108
3073
|
{
|
|
3109
3074
|
className: C(
|
|
3110
3075
|
"flex h-full w-full items-center justify-center",
|
|
3111
|
-
|
|
3076
|
+
ur[e]
|
|
3112
3077
|
),
|
|
3113
|
-
children:
|
|
3114
|
-
className:
|
|
3078
|
+
children: ce(r, {
|
|
3079
|
+
className: mr[e],
|
|
3115
3080
|
weight: "regular"
|
|
3116
3081
|
})
|
|
3117
3082
|
}
|
|
@@ -3121,7 +3086,7 @@ const ir = {
|
|
|
3121
3086
|
]
|
|
3122
3087
|
}
|
|
3123
3088
|
);
|
|
3124
|
-
},
|
|
3089
|
+
}, hr = ({
|
|
3125
3090
|
title: e,
|
|
3126
3091
|
placeholderTitle: t,
|
|
3127
3092
|
description: s,
|
|
@@ -3135,23 +3100,23 @@ const ir = {
|
|
|
3135
3100
|
onDismiss: g,
|
|
3136
3101
|
onEditClick: u
|
|
3137
3102
|
}) => {
|
|
3138
|
-
const f = l === "classic", c = Me(r, o),
|
|
3103
|
+
const f = l === "classic", c = Me(r, o), b = g ? /* @__PURE__ */ n(
|
|
3139
3104
|
"button",
|
|
3140
3105
|
{
|
|
3141
3106
|
type: "button",
|
|
3142
3107
|
onClick: g,
|
|
3143
3108
|
"aria-label": "Dismiss attachment",
|
|
3144
3109
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3145
|
-
children: /* @__PURE__ */ n(
|
|
3110
|
+
children: /* @__PURE__ */ n(ve, { className: "size-3", weight: "bold" })
|
|
3146
3111
|
}
|
|
3147
|
-
) : void 0,
|
|
3112
|
+
) : void 0, _ = u ? /* @__PURE__ */ n(
|
|
3148
3113
|
"button",
|
|
3149
3114
|
{
|
|
3150
3115
|
type: "button",
|
|
3151
3116
|
onClick: u,
|
|
3152
3117
|
"aria-label": "Edit attachment",
|
|
3153
3118
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3154
|
-
children: /* @__PURE__ */ n(
|
|
3119
|
+
children: /* @__PURE__ */ n(Ss, { className: "size-5", weight: "regular" })
|
|
3155
3120
|
}
|
|
3156
3121
|
) : void 0;
|
|
3157
3122
|
return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: nt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
@@ -3164,12 +3129,12 @@ const ir = {
|
|
|
3164
3129
|
mimeType: r
|
|
3165
3130
|
}
|
|
3166
3131
|
) }),
|
|
3167
|
-
|
|
3132
|
+
b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
|
|
3168
3133
|
] }) }) : /* @__PURE__ */ h(
|
|
3169
3134
|
Ie,
|
|
3170
3135
|
{
|
|
3171
3136
|
variant: "dark",
|
|
3172
|
-
topRight: f ?
|
|
3137
|
+
topRight: f ? b : void 0,
|
|
3173
3138
|
children: [
|
|
3174
3139
|
!f && /* @__PURE__ */ n(
|
|
3175
3140
|
Se,
|
|
@@ -3179,7 +3144,7 @@ const ir = {
|
|
|
3179
3144
|
sourceUrl: o,
|
|
3180
3145
|
title: e,
|
|
3181
3146
|
mimeType: r,
|
|
3182
|
-
topRight:
|
|
3147
|
+
topRight: b
|
|
3183
3148
|
}
|
|
3184
3149
|
),
|
|
3185
3150
|
/* @__PURE__ */ n(
|
|
@@ -3192,13 +3157,13 @@ const ir = {
|
|
|
3192
3157
|
url: a,
|
|
3193
3158
|
appIcon: d,
|
|
3194
3159
|
cta: m,
|
|
3195
|
-
trailingAction:
|
|
3160
|
+
trailingAction: _
|
|
3196
3161
|
}
|
|
3197
3162
|
)
|
|
3198
3163
|
]
|
|
3199
3164
|
}
|
|
3200
3165
|
);
|
|
3201
|
-
},
|
|
3166
|
+
}, fr = ({
|
|
3202
3167
|
title: e,
|
|
3203
3168
|
description: t,
|
|
3204
3169
|
url: s,
|
|
@@ -3210,7 +3175,7 @@ const ir = {
|
|
|
3210
3175
|
cta: d,
|
|
3211
3176
|
onClick: m
|
|
3212
3177
|
}) => {
|
|
3213
|
-
const g =
|
|
3178
|
+
const g = hn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Me(a, i) ? nt : void 0, _ = d && m ? {
|
|
3214
3179
|
...d,
|
|
3215
3180
|
onClick: () => {
|
|
3216
3181
|
var v;
|
|
@@ -3224,7 +3189,7 @@ const ir = {
|
|
|
3224
3189
|
href: f,
|
|
3225
3190
|
onClick: c,
|
|
3226
3191
|
ariaLabel: e ?? "Open attachment preview",
|
|
3227
|
-
bgClassName:
|
|
3192
|
+
bgClassName: b,
|
|
3228
3193
|
"data-testid": "link-attachment",
|
|
3229
3194
|
children: [
|
|
3230
3195
|
o === "featured" && /* @__PURE__ */ n(
|
|
@@ -3245,13 +3210,13 @@ const ir = {
|
|
|
3245
3210
|
description: t,
|
|
3246
3211
|
url: s,
|
|
3247
3212
|
appIcon: l,
|
|
3248
|
-
cta:
|
|
3213
|
+
cta: _
|
|
3249
3214
|
}
|
|
3250
3215
|
)
|
|
3251
3216
|
]
|
|
3252
3217
|
}
|
|
3253
3218
|
);
|
|
3254
|
-
},
|
|
3219
|
+
}, gr = ({
|
|
3255
3220
|
title: e,
|
|
3256
3221
|
placeholderTitle: t,
|
|
3257
3222
|
description: s,
|
|
@@ -3264,13 +3229,13 @@ const ir = {
|
|
|
3264
3229
|
cta: m,
|
|
3265
3230
|
onClick: g
|
|
3266
3231
|
}) => {
|
|
3267
|
-
const u =
|
|
3232
|
+
const u = hn(r, o), f = et(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
|
|
3268
3233
|
return /* @__PURE__ */ h(
|
|
3269
3234
|
Ie,
|
|
3270
3235
|
{
|
|
3271
3236
|
variant: "dark",
|
|
3272
3237
|
href: c,
|
|
3273
|
-
onClick:
|
|
3238
|
+
onClick: b,
|
|
3274
3239
|
bgClassName: Me(r, o) ? nt : void 0,
|
|
3275
3240
|
children: [
|
|
3276
3241
|
l === "featured" && /* @__PURE__ */ n(
|
|
@@ -3298,20 +3263,20 @@ const ir = {
|
|
|
3298
3263
|
]
|
|
3299
3264
|
}
|
|
3300
3265
|
);
|
|
3301
|
-
},
|
|
3302
|
-
Composer:
|
|
3303
|
-
Sent:
|
|
3304
|
-
Received:
|
|
3305
|
-
},
|
|
3266
|
+
}, yi = {
|
|
3267
|
+
Composer: hr,
|
|
3268
|
+
Sent: gr,
|
|
3269
|
+
Received: fr
|
|
3270
|
+
}, br = {
|
|
3306
3271
|
dark: "bg-[#121110]",
|
|
3307
3272
|
light: "bg-[#e9eaed]"
|
|
3308
|
-
},
|
|
3273
|
+
}, pr = {
|
|
3309
3274
|
dark: "text-white",
|
|
3310
3275
|
light: "text-[#080707]"
|
|
3311
|
-
},
|
|
3276
|
+
}, vr = {
|
|
3312
3277
|
dark: "border-white/[0.08]",
|
|
3313
3278
|
light: "border-black/[0.08]"
|
|
3314
|
-
},
|
|
3279
|
+
}, xr = (e) => e === "dark" ? "sender" : "receiver", wr = {
|
|
3315
3280
|
sender: {
|
|
3316
3281
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3317
3282
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3324,7 +3289,7 @@ const ir = {
|
|
|
3324
3289
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3325
3290
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3326
3291
|
}
|
|
3327
|
-
},
|
|
3292
|
+
}, xe = ({
|
|
3328
3293
|
variant: e,
|
|
3329
3294
|
text: t,
|
|
3330
3295
|
bordered: s = !0,
|
|
@@ -3333,7 +3298,7 @@ const ir = {
|
|
|
3333
3298
|
children: i,
|
|
3334
3299
|
"data-testid": o
|
|
3335
3300
|
}) => {
|
|
3336
|
-
const l = t != null && t !== "", d =
|
|
3301
|
+
const l = t != null && t !== "", d = wr[xr(e)][a];
|
|
3337
3302
|
return /* @__PURE__ */ h(
|
|
3338
3303
|
"div",
|
|
3339
3304
|
{
|
|
@@ -3348,10 +3313,10 @@ const ir = {
|
|
|
3348
3313
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3349
3314
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3350
3315
|
d,
|
|
3316
|
+
br[e],
|
|
3351
3317
|
pr[e],
|
|
3352
|
-
vr[e],
|
|
3353
3318
|
s && "border",
|
|
3354
|
-
s &&
|
|
3319
|
+
s && vr[e],
|
|
3355
3320
|
r
|
|
3356
3321
|
),
|
|
3357
3322
|
children: [
|
|
@@ -3376,7 +3341,7 @@ const ir = {
|
|
|
3376
3341
|
]
|
|
3377
3342
|
}
|
|
3378
3343
|
);
|
|
3379
|
-
},
|
|
3344
|
+
}, we = ({
|
|
3380
3345
|
onClick: e,
|
|
3381
3346
|
variant: t = "overlay",
|
|
3382
3347
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3392,18 +3357,18 @@ const ir = {
|
|
|
3392
3357
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3393
3358
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3394
3359
|
),
|
|
3395
|
-
children: /* @__PURE__ */ n(
|
|
3360
|
+
children: /* @__PURE__ */ n(ve, { className: "size-3", weight: "bold" })
|
|
3396
3361
|
}
|
|
3397
|
-
),
|
|
3362
|
+
), Ne = (e) => e === "received" ? "light" : "dark", Ci = ({
|
|
3398
3363
|
firstOfGroup: e,
|
|
3399
3364
|
endOfGroup: t,
|
|
3400
3365
|
groupedByUser: s
|
|
3401
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3366
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Nr = ({
|
|
3402
3367
|
src: e,
|
|
3403
3368
|
mimeType: t,
|
|
3404
3369
|
filename: s,
|
|
3405
3370
|
items: a
|
|
3406
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3371
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], _r = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3407
3372
|
/* @__PURE__ */ n(
|
|
3408
3373
|
"audio",
|
|
3409
3374
|
{
|
|
@@ -3426,41 +3391,41 @@ const ir = {
|
|
|
3426
3391
|
preload: l,
|
|
3427
3392
|
onDismiss: d
|
|
3428
3393
|
}) => {
|
|
3429
|
-
const m =
|
|
3394
|
+
const m = Ne(e), g = e === "composer" && !!d, u = Nr({ src: t, mimeType: s, filename: a, items: r });
|
|
3430
3395
|
if (u.length === 0)
|
|
3431
3396
|
return null;
|
|
3432
3397
|
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
3433
3398
|
return /* @__PURE__ */ n(
|
|
3434
|
-
|
|
3399
|
+
xe,
|
|
3435
3400
|
{
|
|
3436
3401
|
variant: m,
|
|
3437
3402
|
text: i,
|
|
3438
3403
|
groupPosition: o,
|
|
3439
3404
|
"data-testid": "audio-attachment",
|
|
3440
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3441
|
-
|
|
3405
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
|
|
3406
|
+
_r,
|
|
3442
3407
|
{
|
|
3443
3408
|
item: c,
|
|
3444
3409
|
preload: f,
|
|
3445
3410
|
trailingAction: (
|
|
3446
3411
|
// Composer only supports a single attachment, so the
|
|
3447
3412
|
// dismiss control sits on the only player.
|
|
3448
|
-
g &&
|
|
3413
|
+
g && b === 0 ? /* @__PURE__ */ n(we, { onClick: d, variant: "inline" }) : void 0
|
|
3449
3414
|
)
|
|
3450
3415
|
},
|
|
3451
|
-
`${c.src}-${
|
|
3416
|
+
`${c.src}-${b}`
|
|
3452
3417
|
)) })
|
|
3453
3418
|
}
|
|
3454
3419
|
);
|
|
3455
|
-
},
|
|
3456
|
-
Composer:
|
|
3457
|
-
Sent:
|
|
3458
|
-
Received:
|
|
3420
|
+
}, yr = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), Cr = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), kr = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), Er = {
|
|
3421
|
+
Composer: yr,
|
|
3422
|
+
Sent: Cr,
|
|
3423
|
+
Received: kr
|
|
3459
3424
|
};
|
|
3460
|
-
function
|
|
3425
|
+
function Ir(e) {
|
|
3461
3426
|
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
3427
|
}
|
|
3463
|
-
const
|
|
3428
|
+
const Sr = {
|
|
3464
3429
|
pdf: "PDF",
|
|
3465
3430
|
doc: "DOC",
|
|
3466
3431
|
xls: "XLS",
|
|
@@ -3470,7 +3435,7 @@ const Tr = {
|
|
|
3470
3435
|
text: "TXT",
|
|
3471
3436
|
markdown: "MD"
|
|
3472
3437
|
};
|
|
3473
|
-
function
|
|
3438
|
+
function Tr(e, t) {
|
|
3474
3439
|
if (t) {
|
|
3475
3440
|
const r = t.lastIndexOf(".");
|
|
3476
3441
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3479,8 +3444,8 @@ function Ar(e, t) {
|
|
|
3479
3444
|
}
|
|
3480
3445
|
}
|
|
3481
3446
|
if (!e) return;
|
|
3482
|
-
if (
|
|
3483
|
-
const r =
|
|
3447
|
+
if (ie(e) === "document") {
|
|
3448
|
+
const r = Zt(e), i = Sr[r];
|
|
3484
3449
|
if (i) return i;
|
|
3485
3450
|
if (e === "application/octet-stream") return;
|
|
3486
3451
|
}
|
|
@@ -3488,11 +3453,11 @@ function Ar(e, t) {
|
|
|
3488
3453
|
if (!(!a || a === "*"))
|
|
3489
3454
|
return a.toUpperCase();
|
|
3490
3455
|
}
|
|
3491
|
-
function
|
|
3492
|
-
const a =
|
|
3456
|
+
function Ar(e, t, s) {
|
|
3457
|
+
const a = Tr(e, t), r = typeof s == "number" && s > 0 ? Ir(s) : void 0;
|
|
3493
3458
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3494
3459
|
}
|
|
3495
|
-
function
|
|
3460
|
+
function ne(e) {
|
|
3496
3461
|
try {
|
|
3497
3462
|
const s = new URL(e).pathname.split("/").pop();
|
|
3498
3463
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3500,16 +3465,16 @@ function te(e) {
|
|
|
3500
3465
|
return "download";
|
|
3501
3466
|
}
|
|
3502
3467
|
}
|
|
3503
|
-
const
|
|
3468
|
+
const Mr = {
|
|
3504
3469
|
dark: "text-white/55",
|
|
3505
3470
|
light: "text-black/65"
|
|
3506
|
-
},
|
|
3471
|
+
}, Dr = {
|
|
3507
3472
|
dark: "bg-white/10",
|
|
3508
3473
|
light: "bg-black/5"
|
|
3509
|
-
},
|
|
3474
|
+
}, Rr = {
|
|
3510
3475
|
dark: "text-white/85",
|
|
3511
3476
|
light: "text-black/85"
|
|
3512
|
-
},
|
|
3477
|
+
}, fn = ({
|
|
3513
3478
|
variant: e,
|
|
3514
3479
|
filename: t,
|
|
3515
3480
|
title: s,
|
|
@@ -3519,16 +3484,16 @@ const Dr = {
|
|
|
3519
3484
|
activateLabel: o,
|
|
3520
3485
|
trailingAction: l
|
|
3521
3486
|
}) => {
|
|
3522
|
-
const d = s ?? t ?? "File", m =
|
|
3487
|
+
const d = s ?? t ?? "File", m = Ar(a, t, r), g = /* @__PURE__ */ n(
|
|
3523
3488
|
"div",
|
|
3524
3489
|
{
|
|
3525
3490
|
className: C(
|
|
3526
3491
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3527
|
-
|
|
3492
|
+
Dr[e]
|
|
3528
3493
|
),
|
|
3529
3494
|
"aria-hidden": !0,
|
|
3530
|
-
children:
|
|
3531
|
-
className: C("size-6",
|
|
3495
|
+
children: ce(a, {
|
|
3496
|
+
className: C("size-6", Rr[e]),
|
|
3532
3497
|
weight: "regular"
|
|
3533
3498
|
})
|
|
3534
3499
|
}
|
|
@@ -3539,7 +3504,7 @@ const Dr = {
|
|
|
3539
3504
|
{
|
|
3540
3505
|
className: C(
|
|
3541
3506
|
"truncate text-xs leading-4",
|
|
3542
|
-
|
|
3507
|
+
Mr[e]
|
|
3543
3508
|
),
|
|
3544
3509
|
children: m
|
|
3545
3510
|
}
|
|
@@ -3559,7 +3524,7 @@ const Dr = {
|
|
|
3559
3524
|
u
|
|
3560
3525
|
]
|
|
3561
3526
|
}
|
|
3562
|
-
) : /* @__PURE__ */ h(
|
|
3527
|
+
) : /* @__PURE__ */ h(ae, { children: [
|
|
3563
3528
|
g,
|
|
3564
3529
|
u
|
|
3565
3530
|
] });
|
|
@@ -3568,8 +3533,8 @@ const Dr = {
|
|
|
3568
3533
|
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
3569
3534
|
] });
|
|
3570
3535
|
};
|
|
3571
|
-
async function
|
|
3572
|
-
const s = t ??
|
|
3536
|
+
async function gn(e, t) {
|
|
3537
|
+
const s = t ?? ne(e);
|
|
3573
3538
|
try {
|
|
3574
3539
|
const a = await fetch(e, { mode: "cors" });
|
|
3575
3540
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -3582,23 +3547,23 @@ async function bn(e, t) {
|
|
|
3582
3547
|
}
|
|
3583
3548
|
}
|
|
3584
3549
|
}
|
|
3585
|
-
const
|
|
3550
|
+
const Lr = ({
|
|
3586
3551
|
src: e,
|
|
3587
3552
|
filename: t,
|
|
3588
3553
|
fileSize: s,
|
|
3589
3554
|
mimeType: a,
|
|
3590
3555
|
title: r,
|
|
3591
3556
|
items: i
|
|
3592
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3557
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Pr = ({
|
|
3593
3558
|
variant: e,
|
|
3594
3559
|
item: t,
|
|
3595
3560
|
index: s,
|
|
3596
3561
|
onActivate: a,
|
|
3597
3562
|
trailingAction: r
|
|
3598
3563
|
}) => {
|
|
3599
|
-
const i = t.filename ??
|
|
3564
|
+
const i = t.filename ?? ne(t.src);
|
|
3600
3565
|
return /* @__PURE__ */ n(
|
|
3601
|
-
|
|
3566
|
+
fn,
|
|
3602
3567
|
{
|
|
3603
3568
|
variant: e,
|
|
3604
3569
|
filename: i,
|
|
@@ -3623,23 +3588,23 @@ const Pr = ({
|
|
|
3623
3588
|
onClick: m,
|
|
3624
3589
|
onDismiss: g
|
|
3625
3590
|
}) => {
|
|
3626
|
-
const u =
|
|
3591
|
+
const u = Ne(e), f = e === "composer" && !!g, c = Lr({
|
|
3627
3592
|
src: t,
|
|
3628
3593
|
filename: s,
|
|
3629
3594
|
fileSize: a,
|
|
3630
3595
|
mimeType: r,
|
|
3631
3596
|
title: i,
|
|
3632
3597
|
items: o
|
|
3633
|
-
}),
|
|
3598
|
+
}), b = (v) => {
|
|
3634
3599
|
if ((m == null ? void 0 : m(v)) === !1) return;
|
|
3635
|
-
const
|
|
3636
|
-
if (!
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3600
|
+
const w = c[v];
|
|
3601
|
+
if (!w) return;
|
|
3602
|
+
const y = w.filename ?? ne(w.src);
|
|
3603
|
+
gn(w.src, y);
|
|
3639
3604
|
};
|
|
3640
3605
|
if (c.length === 0)
|
|
3641
3606
|
return null;
|
|
3642
|
-
const
|
|
3607
|
+
const _ = /* @__PURE__ */ n(
|
|
3643
3608
|
"span",
|
|
3644
3609
|
{
|
|
3645
3610
|
className: C(
|
|
@@ -3647,39 +3612,39 @@ const Pr = ({
|
|
|
3647
3612
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3648
3613
|
),
|
|
3649
3614
|
"aria-hidden": !0,
|
|
3650
|
-
children: /* @__PURE__ */ n(
|
|
3615
|
+
children: /* @__PURE__ */ n(be, { className: "size-5", weight: "bold" })
|
|
3651
3616
|
}
|
|
3652
3617
|
);
|
|
3653
3618
|
return /* @__PURE__ */ n(
|
|
3654
|
-
|
|
3619
|
+
xe,
|
|
3655
3620
|
{
|
|
3656
3621
|
variant: u,
|
|
3657
3622
|
text: l,
|
|
3658
3623
|
groupPosition: d,
|
|
3659
3624
|
"data-testid": "file-attachment",
|
|
3660
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v,
|
|
3661
|
-
|
|
3625
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, w) => /* @__PURE__ */ n(
|
|
3626
|
+
Pr,
|
|
3662
3627
|
{
|
|
3663
3628
|
variant: u,
|
|
3664
3629
|
item: v,
|
|
3665
|
-
index:
|
|
3666
|
-
onActivate:
|
|
3667
|
-
trailingAction: f &&
|
|
3630
|
+
index: w,
|
|
3631
|
+
onActivate: b,
|
|
3632
|
+
trailingAction: f && w === 0 ? /* @__PURE__ */ n(we, { onClick: g, variant: "inline" }) : _
|
|
3668
3633
|
},
|
|
3669
|
-
`${v.src}-${
|
|
3634
|
+
`${v.src}-${w}`
|
|
3670
3635
|
)) })
|
|
3671
3636
|
}
|
|
3672
3637
|
);
|
|
3673
|
-
},
|
|
3674
|
-
Composer:
|
|
3675
|
-
Sent:
|
|
3676
|
-
Received:
|
|
3638
|
+
}, Or = (e) => /* @__PURE__ */ n(at, { ...e, state: "composer" }), zr = (e) => /* @__PURE__ */ n(at, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ n(at, { ...e, state: "received" }), $r = {
|
|
3639
|
+
Composer: Or,
|
|
3640
|
+
Sent: zr,
|
|
3641
|
+
Received: Fr
|
|
3677
3642
|
}, rt = ({
|
|
3678
3643
|
onPrev: e,
|
|
3679
3644
|
onNext: t,
|
|
3680
3645
|
prevLabel: s = "Previous",
|
|
3681
3646
|
nextLabel: a = "Next"
|
|
3682
|
-
}) => /* @__PURE__ */ h(
|
|
3647
|
+
}) => /* @__PURE__ */ h(ae, { children: [
|
|
3683
3648
|
/* @__PURE__ */ n(
|
|
3684
3649
|
"button",
|
|
3685
3650
|
{
|
|
@@ -3687,7 +3652,7 @@ const Pr = ({
|
|
|
3687
3652
|
onClick: e,
|
|
3688
3653
|
"aria-label": s,
|
|
3689
3654
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3690
|
-
children: /* @__PURE__ */ n(
|
|
3655
|
+
children: /* @__PURE__ */ n(Ts, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3691
3656
|
}
|
|
3692
3657
|
),
|
|
3693
3658
|
/* @__PURE__ */ n(
|
|
@@ -3697,10 +3662,10 @@ const Pr = ({
|
|
|
3697
3662
|
onClick: t,
|
|
3698
3663
|
"aria-label": a,
|
|
3699
3664
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3700
|
-
children: /* @__PURE__ */ n(
|
|
3665
|
+
children: /* @__PURE__ */ n(As, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3701
3666
|
}
|
|
3702
3667
|
)
|
|
3703
|
-
] }),
|
|
3668
|
+
] }), bn = ({
|
|
3704
3669
|
url: e,
|
|
3705
3670
|
filename: t,
|
|
3706
3671
|
variant: s = "pill",
|
|
@@ -3709,9 +3674,9 @@ const Pr = ({
|
|
|
3709
3674
|
tone: i = "dark",
|
|
3710
3675
|
onTriggered: o
|
|
3711
3676
|
}) => {
|
|
3712
|
-
const [l, d] =
|
|
3677
|
+
const [l, d] = O(!1), m = W(
|
|
3713
3678
|
(c) => {
|
|
3714
|
-
c.stopPropagation(), !l && (d(!0),
|
|
3679
|
+
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3715
3680
|
}).finally(() => {
|
|
3716
3681
|
d(!1), o == null || o();
|
|
3717
3682
|
}));
|
|
@@ -3736,14 +3701,14 @@ const Pr = ({
|
|
|
3736
3701
|
}[i]
|
|
3737
3702
|
),
|
|
3738
3703
|
children: l ? /* @__PURE__ */ n(
|
|
3739
|
-
|
|
3704
|
+
ge,
|
|
3740
3705
|
{
|
|
3741
3706
|
className: "size-4 animate-spin",
|
|
3742
3707
|
weight: "bold",
|
|
3743
3708
|
"aria-hidden": !0
|
|
3744
3709
|
}
|
|
3745
3710
|
) : /* @__PURE__ */ n(
|
|
3746
|
-
|
|
3711
|
+
be,
|
|
3747
3712
|
{
|
|
3748
3713
|
className: "size-5 shrink-0",
|
|
3749
3714
|
weight: "bold",
|
|
@@ -3759,7 +3724,7 @@ const Pr = ({
|
|
|
3759
3724
|
disabled: l,
|
|
3760
3725
|
"aria-label": a,
|
|
3761
3726
|
className: "mes-media-viewer__action",
|
|
3762
|
-
children: l ? /* @__PURE__ */ n(
|
|
3727
|
+
children: l ? /* @__PURE__ */ n(ge, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(be, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3763
3728
|
}
|
|
3764
3729
|
) : /* @__PURE__ */ h(
|
|
3765
3730
|
"button",
|
|
@@ -3774,13 +3739,13 @@ const Pr = ({
|
|
|
3774
3739
|
),
|
|
3775
3740
|
children: [
|
|
3776
3741
|
l ? /* @__PURE__ */ n(
|
|
3777
|
-
|
|
3742
|
+
ge,
|
|
3778
3743
|
{
|
|
3779
3744
|
className: "size-4 animate-spin",
|
|
3780
3745
|
weight: "bold",
|
|
3781
3746
|
"aria-hidden": !0
|
|
3782
3747
|
}
|
|
3783
|
-
) : /* @__PURE__ */ n(
|
|
3748
|
+
) : /* @__PURE__ */ n(be, { ...f, "aria-hidden": !0 }),
|
|
3784
3749
|
g ? null : a
|
|
3785
3750
|
]
|
|
3786
3751
|
}
|
|
@@ -3790,15 +3755,15 @@ const Pr = ({
|
|
|
3790
3755
|
initialIndex: t,
|
|
3791
3756
|
open: s
|
|
3792
3757
|
}) => {
|
|
3793
|
-
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3758
|
+
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = O(a);
|
|
3794
3759
|
J(() => {
|
|
3795
3760
|
s && i($e(t, 0, Math.max(e - 1, 0)));
|
|
3796
3761
|
}, [s, t, e]), J(() => {
|
|
3797
3762
|
i((d) => $e(d, 0, Math.max(e - 1, 0)));
|
|
3798
3763
|
}, [e]);
|
|
3799
|
-
const o =
|
|
3764
|
+
const o = W(() => {
|
|
3800
3765
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3801
|
-
}, [e]), l =
|
|
3766
|
+
}, [e]), l = W(() => {
|
|
3802
3767
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3803
3768
|
}, [e]);
|
|
3804
3769
|
return J(() => {
|
|
@@ -3819,7 +3784,7 @@ const Pr = ({
|
|
|
3819
3784
|
children: i,
|
|
3820
3785
|
"data-testid": o
|
|
3821
3786
|
}) => {
|
|
3822
|
-
const l =
|
|
3787
|
+
const l = K(null), d = K(null);
|
|
3823
3788
|
return J(() => {
|
|
3824
3789
|
var f;
|
|
3825
3790
|
const u = l.current;
|
|
@@ -3891,7 +3856,7 @@ const Pr = ({
|
|
|
3891
3856
|
onClick: t,
|
|
3892
3857
|
"aria-label": "Close viewer",
|
|
3893
3858
|
className: "mes-media-viewer__action",
|
|
3894
|
-
children: /* @__PURE__ */ n(
|
|
3859
|
+
children: /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3895
3860
|
}
|
|
3896
3861
|
)
|
|
3897
3862
|
] })
|
|
@@ -3900,7 +3865,7 @@ const Pr = ({
|
|
|
3900
3865
|
]
|
|
3901
3866
|
}
|
|
3902
3867
|
);
|
|
3903
|
-
},
|
|
3868
|
+
}, pn = ({
|
|
3904
3869
|
open: e,
|
|
3905
3870
|
items: t,
|
|
3906
3871
|
initialIndex: s = 0,
|
|
@@ -3910,8 +3875,8 @@ const Pr = ({
|
|
|
3910
3875
|
length: t.length,
|
|
3911
3876
|
initialIndex: s,
|
|
3912
3877
|
open: e
|
|
3913
|
-
}), l = t[r], d =
|
|
3914
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3878
|
+
}), l = t[r], d = se(
|
|
3879
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "image"),
|
|
3915
3880
|
[l]
|
|
3916
3881
|
);
|
|
3917
3882
|
return l ? /* @__PURE__ */ h(
|
|
@@ -3922,7 +3887,7 @@ const Pr = ({
|
|
|
3922
3887
|
ariaLabel: d,
|
|
3923
3888
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
3924
3889
|
actions: /* @__PURE__ */ n(
|
|
3925
|
-
|
|
3890
|
+
bn,
|
|
3926
3891
|
{
|
|
3927
3892
|
url: l.src,
|
|
3928
3893
|
filename: d,
|
|
@@ -3956,7 +3921,7 @@ const Pr = ({
|
|
|
3956
3921
|
]
|
|
3957
3922
|
}
|
|
3958
3923
|
) : null;
|
|
3959
|
-
},
|
|
3924
|
+
}, Br = "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
3925
|
tiles: e,
|
|
3961
3926
|
onTileActivate: t,
|
|
3962
3927
|
maxVisible: s = 4,
|
|
@@ -3965,7 +3930,7 @@ const Pr = ({
|
|
|
3965
3930
|
const r = e.length;
|
|
3966
3931
|
if (r === 0) return null;
|
|
3967
3932
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
3968
|
-
const u = C(
|
|
3933
|
+
const u = C(Br, "h-full w-full");
|
|
3969
3934
|
return t ? /* @__PURE__ */ h(
|
|
3970
3935
|
"button",
|
|
3971
3936
|
{
|
|
@@ -4026,15 +3991,15 @@ const Pr = ({
|
|
|
4026
3991
|
})
|
|
4027
3992
|
}
|
|
4028
3993
|
);
|
|
4029
|
-
},
|
|
4030
|
-
const [t, s] =
|
|
3994
|
+
}, _e = (e) => {
|
|
3995
|
+
const [t, s] = O(!1), [a, r] = O(0), i = W(
|
|
4031
3996
|
(l) => {
|
|
4032
3997
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
4033
3998
|
},
|
|
4034
3999
|
[e]
|
|
4035
|
-
), o =
|
|
4000
|
+
), o = W(() => s(!1), []);
|
|
4036
4001
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
4037
|
-
},
|
|
4002
|
+
}, jr = (e, t, s, a) => ({
|
|
4038
4003
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4039
4004
|
content: /* @__PURE__ */ n(
|
|
4040
4005
|
"img",
|
|
@@ -4053,12 +4018,12 @@ const Pr = ({
|
|
|
4053
4018
|
src: e,
|
|
4054
4019
|
alt: t,
|
|
4055
4020
|
items: s
|
|
4056
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4021
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], xn = (e, t) => e.map((s, a) => ({
|
|
4057
4022
|
src: s.src,
|
|
4058
4023
|
alt: s.alt,
|
|
4059
4024
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4060
|
-
})),
|
|
4061
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } =
|
|
4025
|
+
})), Vr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4026
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = _e(
|
|
4062
4027
|
r
|
|
4063
4028
|
);
|
|
4064
4029
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4082,18 +4047,18 @@ const Pr = ({
|
|
|
4082
4047
|
)
|
|
4083
4048
|
}
|
|
4084
4049
|
),
|
|
4085
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4050
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(we, { onClick: i }) }) : null,
|
|
4086
4051
|
/* @__PURE__ */ n(
|
|
4087
|
-
|
|
4052
|
+
pn,
|
|
4088
4053
|
{
|
|
4089
4054
|
open: o,
|
|
4090
|
-
items:
|
|
4055
|
+
items: xn([{ src: e, alt: t }], s),
|
|
4091
4056
|
initialIndex: l,
|
|
4092
4057
|
onClose: m
|
|
4093
4058
|
}
|
|
4094
4059
|
)
|
|
4095
4060
|
] });
|
|
4096
|
-
},
|
|
4061
|
+
}, wn = ({
|
|
4097
4062
|
state: e,
|
|
4098
4063
|
src: t,
|
|
4099
4064
|
alt: s,
|
|
@@ -4104,40 +4069,40 @@ const Pr = ({
|
|
|
4104
4069
|
loading: l = "lazy",
|
|
4105
4070
|
onClick: d
|
|
4106
4071
|
}) => {
|
|
4107
|
-
const m = Ur({ src: t, alt: s, items: r }), g =
|
|
4072
|
+
const m = Ur({ src: t, alt: s, items: r }), g = Ne(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = _e(
|
|
4108
4073
|
d
|
|
4109
4074
|
);
|
|
4110
4075
|
if (m.length === 0)
|
|
4111
4076
|
return null;
|
|
4112
|
-
const
|
|
4113
|
-
(v,
|
|
4077
|
+
const _ = m.map(
|
|
4078
|
+
(v, w) => jr(v, w, m.length, l)
|
|
4114
4079
|
);
|
|
4115
4080
|
return /* @__PURE__ */ h(
|
|
4116
|
-
|
|
4081
|
+
xe,
|
|
4117
4082
|
{
|
|
4118
4083
|
variant: g,
|
|
4119
4084
|
text: i,
|
|
4120
4085
|
groupPosition: o,
|
|
4121
4086
|
"data-testid": "image-attachment",
|
|
4122
4087
|
children: [
|
|
4123
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4088
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: _, onTileActivate: c }) }),
|
|
4124
4089
|
/* @__PURE__ */ n(
|
|
4125
|
-
|
|
4090
|
+
pn,
|
|
4126
4091
|
{
|
|
4127
4092
|
open: u,
|
|
4128
|
-
items:
|
|
4093
|
+
items: xn(m, a),
|
|
4129
4094
|
initialIndex: f,
|
|
4130
|
-
onClose:
|
|
4095
|
+
onClose: b
|
|
4131
4096
|
}
|
|
4132
4097
|
)
|
|
4133
4098
|
]
|
|
4134
4099
|
}
|
|
4135
4100
|
);
|
|
4136
|
-
},
|
|
4137
|
-
Composer:
|
|
4138
|
-
Sent:
|
|
4139
|
-
Received:
|
|
4140
|
-
},
|
|
4101
|
+
}, Gr = (e) => /* @__PURE__ */ n(Vr, { ...e }), Hr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), Yr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), qr = {
|
|
4102
|
+
Composer: Gr,
|
|
4103
|
+
Sent: Hr,
|
|
4104
|
+
Received: Yr
|
|
4105
|
+
}, Wr = ({
|
|
4141
4106
|
open: e,
|
|
4142
4107
|
items: t,
|
|
4143
4108
|
initialIndex: s = 0,
|
|
@@ -4147,11 +4112,11 @@ const Pr = ({
|
|
|
4147
4112
|
length: t.length,
|
|
4148
4113
|
initialIndex: s,
|
|
4149
4114
|
open: e
|
|
4150
|
-
}), l = t[r], d =
|
|
4151
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4115
|
+
}), l = t[r], d = se(
|
|
4116
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "document"),
|
|
4152
4117
|
[l]
|
|
4153
|
-
), m =
|
|
4154
|
-
() => l ?
|
|
4118
|
+
), m = se(
|
|
4119
|
+
() => l ? Xr(l.src) : void 0,
|
|
4155
4120
|
[l]
|
|
4156
4121
|
);
|
|
4157
4122
|
return !l || !m ? null : /* @__PURE__ */ h(
|
|
@@ -4185,25 +4150,25 @@ const Pr = ({
|
|
|
4185
4150
|
]
|
|
4186
4151
|
}
|
|
4187
4152
|
);
|
|
4188
|
-
},
|
|
4153
|
+
}, Xr = (e) => {
|
|
4189
4154
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4190
4155
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4191
|
-
},
|
|
4156
|
+
}, Kr = ({
|
|
4192
4157
|
src: e,
|
|
4193
4158
|
filename: t,
|
|
4194
4159
|
fileSize: s,
|
|
4195
4160
|
title: a,
|
|
4196
4161
|
items: r
|
|
4197
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4162
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], Jr = ({
|
|
4198
4163
|
variant: e,
|
|
4199
4164
|
item: t,
|
|
4200
4165
|
index: s,
|
|
4201
4166
|
onActivate: a,
|
|
4202
4167
|
trailingAction: r
|
|
4203
4168
|
}) => {
|
|
4204
|
-
const i = t.filename ??
|
|
4169
|
+
const i = t.filename ?? ne(t.src);
|
|
4205
4170
|
return /* @__PURE__ */ n(
|
|
4206
|
-
|
|
4171
|
+
fn,
|
|
4207
4172
|
{
|
|
4208
4173
|
variant: e,
|
|
4209
4174
|
filename: i,
|
|
@@ -4227,63 +4192,63 @@ const Pr = ({
|
|
|
4227
4192
|
onClick: d,
|
|
4228
4193
|
onDismiss: m
|
|
4229
4194
|
}) => {
|
|
4230
|
-
const g =
|
|
4195
|
+
const g = Ne(e), u = Kr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = _e(
|
|
4231
4196
|
d
|
|
4232
4197
|
), v = e === "composer" && !!m;
|
|
4233
4198
|
if (u.length === 0)
|
|
4234
4199
|
return null;
|
|
4235
|
-
const
|
|
4236
|
-
src:
|
|
4237
|
-
filename:
|
|
4200
|
+
const w = u.map((y) => ({
|
|
4201
|
+
src: y.src,
|
|
4202
|
+
filename: y.filename ?? ne(y.src)
|
|
4238
4203
|
}));
|
|
4239
4204
|
return /* @__PURE__ */ h(
|
|
4240
|
-
|
|
4205
|
+
xe,
|
|
4241
4206
|
{
|
|
4242
4207
|
variant: g,
|
|
4243
4208
|
text: o,
|
|
4244
4209
|
groupPosition: l,
|
|
4245
4210
|
"data-testid": "pdf-attachment",
|
|
4246
4211
|
children: [
|
|
4247
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4248
|
-
const
|
|
4249
|
-
|
|
4212
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((y, S) => {
|
|
4213
|
+
const k = y.filename ?? ne(y.src), A = v && S === 0 ? /* @__PURE__ */ n(we, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4214
|
+
bn,
|
|
4250
4215
|
{
|
|
4251
|
-
url:
|
|
4252
|
-
filename:
|
|
4216
|
+
url: y.src,
|
|
4217
|
+
filename: k,
|
|
4253
4218
|
variant: "inline",
|
|
4254
|
-
label: `Download ${
|
|
4219
|
+
label: `Download ${k}`,
|
|
4255
4220
|
tone: g
|
|
4256
4221
|
}
|
|
4257
4222
|
);
|
|
4258
4223
|
return /* @__PURE__ */ n(
|
|
4259
|
-
|
|
4224
|
+
Jr,
|
|
4260
4225
|
{
|
|
4261
4226
|
variant: g,
|
|
4262
|
-
item:
|
|
4263
|
-
index:
|
|
4264
|
-
onActivate:
|
|
4265
|
-
trailingAction:
|
|
4227
|
+
item: y,
|
|
4228
|
+
index: S,
|
|
4229
|
+
onActivate: b,
|
|
4230
|
+
trailingAction: A
|
|
4266
4231
|
},
|
|
4267
|
-
`${
|
|
4232
|
+
`${y.src}-${S}`
|
|
4268
4233
|
);
|
|
4269
4234
|
}) }),
|
|
4270
4235
|
/* @__PURE__ */ n(
|
|
4271
|
-
|
|
4236
|
+
Wr,
|
|
4272
4237
|
{
|
|
4273
4238
|
open: f,
|
|
4274
|
-
items:
|
|
4239
|
+
items: w,
|
|
4275
4240
|
initialIndex: c,
|
|
4276
|
-
onClose:
|
|
4241
|
+
onClose: _
|
|
4277
4242
|
}
|
|
4278
4243
|
)
|
|
4279
4244
|
]
|
|
4280
4245
|
}
|
|
4281
4246
|
);
|
|
4282
|
-
},
|
|
4283
|
-
Composer:
|
|
4284
|
-
Sent:
|
|
4285
|
-
Received:
|
|
4286
|
-
},
|
|
4247
|
+
}, Zr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Qr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), ei = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), ti = {
|
|
4248
|
+
Composer: Zr,
|
|
4249
|
+
Sent: Qr,
|
|
4250
|
+
Received: ei
|
|
4251
|
+
}, Nn = ({
|
|
4287
4252
|
open: e,
|
|
4288
4253
|
items: t,
|
|
4289
4254
|
initialIndex: s = 0,
|
|
@@ -4293,8 +4258,8 @@ const Pr = ({
|
|
|
4293
4258
|
length: t.length,
|
|
4294
4259
|
initialIndex: s,
|
|
4295
4260
|
open: e
|
|
4296
|
-
}), l = t[r], d =
|
|
4297
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4261
|
+
}), l = t[r], d = se(
|
|
4262
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "video"),
|
|
4298
4263
|
[l]
|
|
4299
4264
|
);
|
|
4300
4265
|
return l ? /* @__PURE__ */ h(
|
|
@@ -4333,7 +4298,7 @@ const Pr = ({
|
|
|
4333
4298
|
]
|
|
4334
4299
|
}
|
|
4335
4300
|
) : null;
|
|
4336
|
-
},
|
|
4301
|
+
}, ni = () => /* @__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(je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), _n = ({
|
|
4337
4302
|
item: e,
|
|
4338
4303
|
index: t
|
|
4339
4304
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4348,31 +4313,31 @@ const Pr = ({
|
|
|
4348
4313
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4349
4314
|
}
|
|
4350
4315
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4351
|
-
|
|
4316
|
+
Ht,
|
|
4352
4317
|
{
|
|
4353
4318
|
className: "size-16 rounded-md text-white/30",
|
|
4354
4319
|
weight: "regular",
|
|
4355
4320
|
"aria-hidden": !0
|
|
4356
4321
|
}
|
|
4357
4322
|
) }),
|
|
4358
|
-
/* @__PURE__ */ n(
|
|
4359
|
-
] }),
|
|
4323
|
+
/* @__PURE__ */ n(ni, {})
|
|
4324
|
+
] }), si = (e, t, s) => ({
|
|
4360
4325
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4361
|
-
content: /* @__PURE__ */ n(
|
|
4362
|
-
}),
|
|
4326
|
+
content: /* @__PURE__ */ n(_n, { item: e, index: t })
|
|
4327
|
+
}), ai = ({
|
|
4363
4328
|
src: e,
|
|
4364
4329
|
poster: t,
|
|
4365
4330
|
mimeType: s,
|
|
4366
4331
|
preload: a,
|
|
4367
4332
|
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 }] : [],
|
|
4333
|
+
}) => 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
4334
|
src: s.src,
|
|
4370
4335
|
poster: s.poster,
|
|
4371
4336
|
mimeType: s.mimeType,
|
|
4372
4337
|
preload: s.preload,
|
|
4373
4338
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4374
|
-
})),
|
|
4375
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } =
|
|
4339
|
+
})), ri = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4340
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = _e(
|
|
4376
4341
|
i
|
|
4377
4342
|
);
|
|
4378
4343
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4383,15 +4348,15 @@ const Pr = ({
|
|
|
4383
4348
|
onClick: () => m(0),
|
|
4384
4349
|
"aria-label": "Play video",
|
|
4385
4350
|
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(
|
|
4351
|
+
children: /* @__PURE__ */ n(_n, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4387
4352
|
}
|
|
4388
4353
|
),
|
|
4389
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4354
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(we, { onClick: o }) }) : null,
|
|
4390
4355
|
/* @__PURE__ */ n(
|
|
4391
|
-
|
|
4356
|
+
Nn,
|
|
4392
4357
|
{
|
|
4393
4358
|
open: l,
|
|
4394
|
-
items:
|
|
4359
|
+
items: yn(
|
|
4395
4360
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4396
4361
|
a
|
|
4397
4362
|
),
|
|
@@ -4400,7 +4365,7 @@ const Pr = ({
|
|
|
4400
4365
|
}
|
|
4401
4366
|
)
|
|
4402
4367
|
] });
|
|
4403
|
-
},
|
|
4368
|
+
}, Cn = ({
|
|
4404
4369
|
state: e,
|
|
4405
4370
|
src: t,
|
|
4406
4371
|
poster: s,
|
|
@@ -4412,16 +4377,16 @@ const Pr = ({
|
|
|
4412
4377
|
preload: d,
|
|
4413
4378
|
onClick: m
|
|
4414
4379
|
}) => {
|
|
4415
|
-
const g =
|
|
4380
|
+
const g = ai({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = _e(
|
|
4416
4381
|
m
|
|
4417
4382
|
);
|
|
4418
4383
|
if (g.length === 0)
|
|
4419
4384
|
return null;
|
|
4420
4385
|
const v = g.map(
|
|
4421
|
-
(
|
|
4386
|
+
(w, y) => si(w, y, g.length)
|
|
4422
4387
|
);
|
|
4423
4388
|
return /* @__PURE__ */ h(
|
|
4424
|
-
|
|
4389
|
+
xe,
|
|
4425
4390
|
{
|
|
4426
4391
|
variant: u,
|
|
4427
4392
|
text: o,
|
|
@@ -4429,36 +4394,36 @@ const Pr = ({
|
|
|
4429
4394
|
"data-testid": "video-attachment",
|
|
4430
4395
|
children: [
|
|
4431
4396
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4432
|
-
|
|
4397
|
+
vn,
|
|
4433
4398
|
{
|
|
4434
4399
|
tiles: v,
|
|
4435
|
-
onTileActivate:
|
|
4400
|
+
onTileActivate: b,
|
|
4436
4401
|
className: "overflow-hidden rounded-md"
|
|
4437
4402
|
}
|
|
4438
4403
|
) }),
|
|
4439
4404
|
/* @__PURE__ */ n(
|
|
4440
|
-
|
|
4405
|
+
Nn,
|
|
4441
4406
|
{
|
|
4442
4407
|
open: f,
|
|
4443
|
-
items:
|
|
4408
|
+
items: yn(g, r),
|
|
4444
4409
|
initialIndex: c,
|
|
4445
|
-
onClose:
|
|
4410
|
+
onClose: _
|
|
4446
4411
|
}
|
|
4447
4412
|
)
|
|
4448
4413
|
]
|
|
4449
4414
|
}
|
|
4450
4415
|
);
|
|
4451
|
-
},
|
|
4452
|
-
Composer:
|
|
4453
|
-
Sent:
|
|
4454
|
-
Received:
|
|
4455
|
-
},
|
|
4456
|
-
Image:
|
|
4457
|
-
Video:
|
|
4458
|
-
Audio:
|
|
4459
|
-
Pdf:
|
|
4460
|
-
File:
|
|
4461
|
-
},
|
|
4416
|
+
}, ii = (e) => /* @__PURE__ */ n(ri, { ...e }), oi = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "sent" }), li = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "received" }), ci = {
|
|
4417
|
+
Composer: ii,
|
|
4418
|
+
Sent: oi,
|
|
4419
|
+
Received: li
|
|
4420
|
+
}, ki = {
|
|
4421
|
+
Image: qr,
|
|
4422
|
+
Video: ci,
|
|
4423
|
+
Audio: Er,
|
|
4424
|
+
Pdf: ti,
|
|
4425
|
+
File: $r
|
|
4426
|
+
}, di = ({
|
|
4462
4427
|
question: e,
|
|
4463
4428
|
onClick: t,
|
|
4464
4429
|
loading: s = !1,
|
|
@@ -4480,7 +4445,7 @@ const Pr = ({
|
|
|
4480
4445
|
),
|
|
4481
4446
|
children: e
|
|
4482
4447
|
}
|
|
4483
|
-
),
|
|
4448
|
+
), Ei = ({
|
|
4484
4449
|
faqs: e,
|
|
4485
4450
|
onFaqClick: t,
|
|
4486
4451
|
loadingFaqId: s,
|
|
@@ -4492,7 +4457,7 @@ const Pr = ({
|
|
|
4492
4457
|
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4493
4458
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4494
4459
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4495
|
-
|
|
4460
|
+
re,
|
|
4496
4461
|
{
|
|
4497
4462
|
id: o || "account",
|
|
4498
4463
|
name: o || "Account",
|
|
@@ -4509,7 +4474,7 @@ const Pr = ({
|
|
|
4509
4474
|
children: [
|
|
4510
4475
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4511
4476
|
l.map((d) => /* @__PURE__ */ n(
|
|
4512
|
-
|
|
4477
|
+
di,
|
|
4513
4478
|
{
|
|
4514
4479
|
question: d.question,
|
|
4515
4480
|
onClick: () => t(d.id),
|
|
@@ -4523,38 +4488,38 @@ const Pr = ({
|
|
|
4523
4488
|
] }) });
|
|
4524
4489
|
};
|
|
4525
4490
|
export {
|
|
4526
|
-
|
|
4491
|
+
Qt as A,
|
|
4527
4492
|
Us as B,
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4493
|
+
Ya as C,
|
|
4494
|
+
Ds as D,
|
|
4495
|
+
Ei as F,
|
|
4496
|
+
yi as L,
|
|
4497
|
+
wi as M,
|
|
4498
|
+
Ce as a,
|
|
4499
|
+
re as b,
|
|
4500
|
+
nr as c,
|
|
4501
|
+
dn as d,
|
|
4502
|
+
Ni as e,
|
|
4503
|
+
di as f,
|
|
4504
|
+
ie as g,
|
|
4505
|
+
zt as h,
|
|
4506
|
+
ki as i,
|
|
4507
|
+
Na as j,
|
|
4508
|
+
xi as k,
|
|
4509
|
+
_i as l,
|
|
4510
|
+
Ar as m,
|
|
4511
|
+
Ir as n,
|
|
4512
|
+
er as o,
|
|
4513
|
+
Tr as p,
|
|
4514
|
+
Xt as q,
|
|
4515
|
+
ce as r,
|
|
4516
|
+
nn as s,
|
|
4517
|
+
Ls as t,
|
|
4518
|
+
Ci as u,
|
|
4519
|
+
Vs as v,
|
|
4555
4520
|
Ze as w,
|
|
4556
4521
|
Qe as x,
|
|
4557
4522
|
Ae as y,
|
|
4558
|
-
|
|
4523
|
+
ga as z
|
|
4559
4524
|
};
|
|
4560
|
-
//# sourceMappingURL=index-
|
|
4525
|
+
//# sourceMappingURL=index-DJKFVBkP.js.map
|