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