@linktr.ee/messaging-react 1.33.1 → 1.33.2-rc-1777444067
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-Ddi8bg90.js → Card-CQYlmwhm.js} +2 -2
- package/dist/{Card-Ddi8bg90.js.map → Card-CQYlmwhm.js.map} +1 -1
- package/dist/{Card-DEe10CiS.js → Card-V-Et3tc4.js} +2 -2
- package/dist/{Card-DEe10CiS.js.map → Card-V-Et3tc4.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-BePLvyvi.js → index-CahzrNJz.js} +1363 -1127
- package/dist/{index-BePLvyvi.js.map → index-CahzrNJz.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/LockedAttachment/components/MediaPlayer.tsx +10 -1
- package/src/components/MediaMessage/MediaMessage.stories.tsx +82 -19
- package/src/components/MediaMessage/MediaMessage.test.tsx +277 -18
- package/src/components/MediaMessage/index.tsx +388 -77
- package/src/providers/MessagingProvider.stories.tsx +214 -0
- package/src/providers/MessagingProvider.test.tsx +126 -0
- package/src/styles.css +53 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import z, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Be, GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import O from "classnames";
|
|
3
|
+
import z, { createContext as rt, useContext as ot, useCallback as A, useState as k, useRef as X, useEffect as q, useMemo as ze, Suspense as lt } from "react";
|
|
4
|
+
import { StreamChatService as Tt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Mt, ChannelList as Dt, DateSeparator as Rt, useChannelStateContext as fe, useChatContext as it, areMessageUIPropsEqual as Lt, useMessageReminder as Pt, useComponentContext as ct, Attachment as Ft, EditMessageModal as At, MessageBlocked as Ut, MessageBouncePrompt as Ot, MessageDeleted as $t, MessageIsThreadReplyInChannelButtonIndicator as zt, MessageRepliesCountButton as Bt, ReminderNotification as jt, StreamedMessageText as Gt, messageHasAttachments as Vt, messageHasReactions as Ht, isDateSeparatorMessage as Yt, isMessageBlocked as Wt, isMessageBounced as qt, MessageBounceModal as Zt, MessageText as Ze, Poll as Xt, MessageErrorIcon as Kt, useMessageContext as dt, useMessageComposer as Jt, useStateStore as Qt, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ss, SimpleAttachmentSelector as ns, QuotedMessagePreview as as, AttachmentPreviewList as rs, TextareaComposer as os, MessageTimestamp as Ue, Channel as ls, WithComponents as is, Window as cs, MessageList as ds } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Be, GiftIcon as us, XIcon as Re, SpinnerGapIcon as ke, SignOutIcon as ms, ProhibitInsetIcon as Xe, FlagIcon as hs, ArrowUpIcon as fs, SparkleIcon as gs, ProhibitIcon as bs, ArrowLeftIcon as Ke, DotsThreeIcon as Je, MagnifyingGlassIcon as ps, ChatCircleDotsIcon as Qe, FileIcon as ut, ImageIcon as xs, SpeakerHighIcon as ws, VideoCameraIcon as vs, FileMdIcon as Ns, FileTextIcon as ys, FileZipIcon as Cs, FilePptIcon as _s, FileCsvIcon as Es, FileXlsIcon as Ss, FileDocIcon as Is, FilePdfIcon as ks, CircleNotchIcon as mt, PlayIcon as et, PauseIcon as Ts, LinkIcon as Ms, DownloadSimpleIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as tt } from "stream-chat";
|
|
8
|
+
const ht = rt({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,94 +15,94 @@ const dt = nt({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), Le = () => ot(ht), ta = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
22
|
apiKey: o,
|
|
23
|
-
capabilities:
|
|
24
|
-
debug:
|
|
23
|
+
capabilities: l = {},
|
|
24
|
+
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const r = A(
|
|
27
|
-
(
|
|
28
|
-
|
|
27
|
+
(m, ...f) => {
|
|
28
|
+
d && console.log(`🔥 [MessagingProvider] ${m}`, ...f);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[d]
|
|
31
31
|
);
|
|
32
32
|
r("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
34
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
|
-
capabilities: Object.keys(
|
|
36
|
+
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c,
|
|
38
|
+
const [c, x] = k(null), [u, g] = k(null), [h, N] = k(!1), [a, _] = k(!1), [v, p] = k(null), E = X(!1), S = X({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
|
-
capabilities:
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
42
|
+
capabilities: l
|
|
43
|
+
}), C = X(0);
|
|
44
|
+
C.current++, r("📊 RENDER INFO", {
|
|
45
|
+
renderCount: C.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: S.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: S.current.apiKey !== o,
|
|
50
|
+
serviceConfigChanged: S.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: S.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), S.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
|
-
capabilities:
|
|
58
|
-
},
|
|
59
|
-
const
|
|
57
|
+
capabilities: l
|
|
58
|
+
}, q(() => {
|
|
59
|
+
const m = C.current;
|
|
60
60
|
if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
61
|
+
renderCount: m,
|
|
62
62
|
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: S.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: S.current.apiKey === o
|
|
69
69
|
}
|
|
70
70
|
}), !o || !n) {
|
|
71
71
|
r("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: m,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
r("🚀 CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: m,
|
|
79
79
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: S.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const f = new Tt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: o,
|
|
85
|
-
debug:
|
|
85
|
+
debug: d
|
|
86
86
|
});
|
|
87
|
-
return f
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return x(f), r("✅ SERVICE SET", {
|
|
88
|
+
renderCount: m,
|
|
89
|
+
serviceInstance: !!f
|
|
90
90
|
}), () => {
|
|
91
91
|
r("🧹 SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), f.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [o, n,
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
96
|
+
}, [o, n, d, r]);
|
|
97
|
+
const I = X(null);
|
|
98
|
+
q(() => {
|
|
99
|
+
var f, T;
|
|
100
100
|
if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
104
|
isConnecting: E.current,
|
|
105
|
-
isConnected:
|
|
105
|
+
isConnected: h,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
108
|
r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
@@ -112,7 +112,7 @@ const dt = nt({
|
|
|
112
112
|
r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((f = I.current) == null ? void 0 : f.serviceId) === c && ((T = I.current) == null ? void 0 : T.userId) === s.id) {
|
|
116
116
|
r(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,39 +120,39 @@ const dt = nt({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
r("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0,
|
|
123
|
+
r("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, _(!0), p(null);
|
|
124
124
|
try {
|
|
125
125
|
r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
g(
|
|
126
|
+
const M = await c.connectUser(s);
|
|
127
|
+
g(M), N(!0), I.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: M.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const L =
|
|
133
|
-
|
|
131
|
+
} catch (M) {
|
|
132
|
+
const L = M instanceof Error ? M.message : "Connection failed";
|
|
133
|
+
p(L), r("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
135
|
error: L
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
_(!1), E.current = !1, r("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: h
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, r,
|
|
144
|
+
}, [c, s, r, h]), q(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: h
|
|
147
147
|
}), () => {
|
|
148
|
-
c &&
|
|
148
|
+
c && h ? (r(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), I.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: h
|
|
154
154
|
});
|
|
155
|
-
}), [c,
|
|
155
|
+
}), [c, h, r]);
|
|
156
156
|
const P = A(async () => {
|
|
157
157
|
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
@@ -161,108 +161,108 @@ const dt = nt({
|
|
|
161
161
|
r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), _(!0);
|
|
165
165
|
try {
|
|
166
166
|
r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
|
|
167
|
-
const
|
|
168
|
-
g(
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
167
|
+
const m = await c.connectUser(s);
|
|
168
|
+
g(m), N(!0), p(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (m) {
|
|
170
|
+
const f = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
p(f), r("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: f
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
_(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s, r]),
|
|
178
|
+
}, [c, s, r]), w = z.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
180
|
+
hasClient: !!u,
|
|
181
|
+
isConnected: h,
|
|
182
182
|
isLoading: a,
|
|
183
|
-
hasError: !!
|
|
184
|
-
capabilitiesKeys: Object.keys(
|
|
183
|
+
hasError: !!v,
|
|
184
|
+
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
187
|
+
client: u,
|
|
188
|
+
isConnected: h,
|
|
189
189
|
isLoading: a,
|
|
190
|
-
error:
|
|
191
|
-
capabilities:
|
|
190
|
+
error: v,
|
|
191
|
+
capabilities: l,
|
|
192
192
|
refreshConnection: P,
|
|
193
|
-
debug:
|
|
193
|
+
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
u,
|
|
197
|
+
h,
|
|
198
198
|
a,
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
v,
|
|
200
|
+
l,
|
|
201
201
|
P,
|
|
202
|
-
|
|
202
|
+
d,
|
|
203
203
|
r
|
|
204
204
|
]);
|
|
205
205
|
return r("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
206
|
+
renderCount: C.current,
|
|
207
|
+
willRenderChat: !!(u && h),
|
|
208
|
+
contextValueReady: !!w
|
|
209
|
+
}), /* @__PURE__ */ e(ht.Provider, { value: w, children: u && h ? /* @__PURE__ */ e(
|
|
210
|
+
Mt,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: u,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, Rs = () => Le();
|
|
220
|
+
function Ls(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
t.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const ft = z.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
233
|
-
var o,
|
|
234
|
-
const [s, n] =
|
|
235
|
-
!!((
|
|
232
|
+
}), Ps = ft.Provider, Fs = () => z.useContext(ft), gt = (t) => {
|
|
233
|
+
var o, l;
|
|
234
|
+
const [s, n] = k(
|
|
235
|
+
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
236
236
|
);
|
|
237
|
-
return
|
|
237
|
+
return q(() => {
|
|
238
238
|
var r;
|
|
239
239
|
if (!t) {
|
|
240
240
|
n(!1);
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
n(!!((r = t.state.membership) != null && r.pinned_at));
|
|
244
|
-
const
|
|
245
|
-
var
|
|
244
|
+
const d = (c) => {
|
|
245
|
+
var x;
|
|
246
246
|
n(
|
|
247
|
-
c != null && c.member ? !!c.member.pinned_at : !!((
|
|
247
|
+
c != null && c.member ? !!c.member.pinned_at : !!((x = t.state.membership) != null && x.pinned_at)
|
|
248
248
|
);
|
|
249
249
|
};
|
|
250
|
-
return t.on("member.updated",
|
|
251
|
-
t.off("member.updated",
|
|
250
|
+
return t.on("member.updated", d), () => {
|
|
251
|
+
t.off("member.updated", d);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, As = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
|
-
),
|
|
257
|
+
), l = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
|
-
return Math.floor(
|
|
261
|
-
},
|
|
260
|
+
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
261
|
+
}, Us = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const o =
|
|
265
|
+
const o = As(t, s);
|
|
266
266
|
return o === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
@@ -272,7 +272,7 @@ const ut = z.createContext({
|
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, st = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,7 +300,7 @@ const ut = z.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function Os(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
306
|
const o = t.charCodeAt(n);
|
|
@@ -308,32 +308,32 @@ function Rs(t) {
|
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function $s(t) {
|
|
312
|
+
const n = Os(t) % st.length;
|
|
313
|
+
return st[n];
|
|
314
314
|
}
|
|
315
315
|
const oe = ({
|
|
316
316
|
id: t,
|
|
317
317
|
image: s,
|
|
318
318
|
size: n = 40,
|
|
319
319
|
className: o,
|
|
320
|
-
starred:
|
|
321
|
-
shape:
|
|
320
|
+
starred: l = !1,
|
|
321
|
+
shape: d = "squircle"
|
|
322
322
|
}) => {
|
|
323
|
-
const r =
|
|
323
|
+
const r = $s(t), x = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", u = d === "circle" ? { borderRadius: "50%" } : {
|
|
324
324
|
borderRadius: "33%",
|
|
325
325
|
"corner-shape": "superellipse(1.3)"
|
|
326
326
|
};
|
|
327
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ i(
|
|
328
328
|
"div",
|
|
329
329
|
{
|
|
330
|
-
className:
|
|
330
|
+
className: O("relative flex-shrink-0", o),
|
|
331
331
|
style: {
|
|
332
332
|
width: `${n}px`,
|
|
333
333
|
height: `${n}px`
|
|
334
334
|
},
|
|
335
335
|
children: [
|
|
336
|
-
|
|
336
|
+
l && /* @__PURE__ */ e(
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
339
339
|
"aria-hidden": "true",
|
|
@@ -341,7 +341,7 @@ const oe = ({
|
|
|
341
341
|
children: /* @__PURE__ */ e(Be, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
|
-
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style:
|
|
344
|
+
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: u, children: s ? /* @__PURE__ */ e(
|
|
345
345
|
"img",
|
|
346
346
|
{
|
|
347
347
|
src: s,
|
|
@@ -352,9 +352,9 @@ const oe = ({
|
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
354
|
"aria-hidden": "true",
|
|
355
|
-
className:
|
|
355
|
+
className: O(
|
|
356
356
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
357
|
-
|
|
357
|
+
x
|
|
358
358
|
),
|
|
359
359
|
children: r
|
|
360
360
|
}
|
|
@@ -362,7 +362,7 @@ const oe = ({
|
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
|
-
},
|
|
365
|
+
}, zs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
366
366
|
"svg",
|
|
367
367
|
{
|
|
368
368
|
width: t,
|
|
@@ -379,131 +379,131 @@ const oe = ({
|
|
|
379
379
|
}
|
|
380
380
|
)
|
|
381
381
|
}
|
|
382
|
-
),
|
|
382
|
+
), Bs = (t) => {
|
|
383
383
|
var s;
|
|
384
384
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
385
|
-
},
|
|
385
|
+
}, js = (t) => {
|
|
386
386
|
var s;
|
|
387
387
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
388
|
-
},
|
|
388
|
+
}, He = (t) => {
|
|
389
389
|
var s;
|
|
390
390
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
391
|
-
},
|
|
391
|
+
}, Gs = (t) => {
|
|
392
392
|
var s;
|
|
393
393
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
394
|
-
},
|
|
394
|
+
}, bt = (t) => Bs(t) || js(t), Vs = (t) => {
|
|
395
395
|
var s;
|
|
396
|
-
return
|
|
397
|
-
},
|
|
396
|
+
return bt(t) && !((s = t.text) != null && s.trim());
|
|
397
|
+
}, Oe = ({
|
|
398
398
|
message: t,
|
|
399
399
|
standalone: s = !1,
|
|
400
400
|
isMyMessage: n = !1,
|
|
401
401
|
hasAttachment: o = !1
|
|
402
402
|
}) => {
|
|
403
|
-
var
|
|
404
|
-
const
|
|
405
|
-
if (!
|
|
403
|
+
var h;
|
|
404
|
+
const l = bt(t), d = He(t);
|
|
405
|
+
if (!l && !d)
|
|
406
406
|
return null;
|
|
407
|
-
if (
|
|
408
|
-
const N = (
|
|
407
|
+
if (l) {
|
|
408
|
+
const N = (h = t.metadata) == null ? void 0 : h.amount_text;
|
|
409
409
|
if (!N) return null;
|
|
410
|
-
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */ e(
|
|
413
|
-
/* @__PURE__ */ e("span", { children:
|
|
410
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${N} tip` : `Delivered with ${N} tip`;
|
|
411
|
+
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
412
|
+
/* @__PURE__ */ e(us, { size: s ? 14 : 12 }),
|
|
413
|
+
/* @__PURE__ */ e("span", { children: _ })
|
|
414
414
|
] });
|
|
415
415
|
}
|
|
416
|
-
const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent",
|
|
416
|
+
const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", x = [
|
|
417
417
|
"message-chatbot-indicator",
|
|
418
418
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
419
419
|
r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
420
|
-
].join(" "),
|
|
421
|
-
return /* @__PURE__ */ e("div", { className:
|
|
422
|
-
|
|
420
|
+
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), g = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(zs, { size: r ? 12 : 15 }) });
|
|
421
|
+
return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(se, { children: [
|
|
422
|
+
u,
|
|
423
423
|
g
|
|
424
|
-
] }) : /* @__PURE__ */
|
|
424
|
+
] }) : /* @__PURE__ */ i(se, { children: [
|
|
425
425
|
g,
|
|
426
|
-
|
|
426
|
+
u
|
|
427
427
|
] }) });
|
|
428
|
-
},
|
|
428
|
+
}, pt = z.memo(
|
|
429
429
|
({ channel: t, unread: s }) => {
|
|
430
|
-
var P,
|
|
431
|
-
const { selectedChannel: n, onChannelSelect: o, debug:
|
|
430
|
+
var P, w, m, f;
|
|
431
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = Fs(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
432
432
|
t && o(t);
|
|
433
|
-
},
|
|
434
|
-
const
|
|
435
|
-
!
|
|
433
|
+
}, x = (T) => {
|
|
434
|
+
const M = T.key === "Enter" || T.key === " ", L = T.repeat;
|
|
435
|
+
!M || L || (T.preventDefault(), c());
|
|
436
436
|
}, g = Object.values(((P = t == null ? void 0 : t.state) == null ? void 0 : P.members) || {}).find(
|
|
437
|
-
(
|
|
438
|
-
var
|
|
439
|
-
return ((
|
|
437
|
+
(T) => {
|
|
438
|
+
var M, L;
|
|
439
|
+
return ((M = T.user) == null ? void 0 : M.id) && T.user.id !== ((L = t == null ? void 0 : t._client) == null ? void 0 : L.userID);
|
|
440
440
|
}
|
|
441
|
-
),
|
|
442
|
-
var
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
445
|
-
for (let L =
|
|
446
|
-
if (
|
|
441
|
+
), h = ((w = g == null ? void 0 : g.user) == null ? void 0 : w.name) || "Conversation", N = (m = g == null ? void 0 : g.user) == null ? void 0 : m.image, a = (() => {
|
|
442
|
+
var M;
|
|
443
|
+
const T = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
|
|
444
|
+
if (T != null && T.length) {
|
|
445
|
+
for (let L = T.length - 1; L >= 0; L--)
|
|
446
|
+
if (T[L].type !== "system") return T[L];
|
|
447
447
|
}
|
|
448
|
-
})(),
|
|
449
|
-
var L,
|
|
448
|
+
})(), v = (() => {
|
|
449
|
+
var L, R;
|
|
450
450
|
if (a != null && a.text) return a.text;
|
|
451
451
|
if (((L = a == null ? void 0 : a.metadata) == null ? void 0 : L.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
452
|
-
const
|
|
453
|
-
return
|
|
454
|
-
})(),
|
|
455
|
-
return
|
|
452
|
+
const M = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
|
|
453
|
+
return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
454
|
+
})(), p = a != null && a.created_at ? Us(new Date(a.created_at)) : "", E = a ? He(a) : !1, S = d ? d(a, v) : `${E ? "✨ " : ""}${v}`, C = gt(t), I = s ?? 0;
|
|
455
|
+
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
456
456
|
channelId: t == null ? void 0 : t.id,
|
|
457
457
|
isSelected: r,
|
|
458
|
-
participantName:
|
|
459
|
-
unreadCount:
|
|
460
|
-
hasTimestamp: !!
|
|
458
|
+
participantName: h,
|
|
459
|
+
unreadCount: I,
|
|
460
|
+
hasTimestamp: !!p
|
|
461
461
|
}), /* @__PURE__ */ e(
|
|
462
462
|
"div",
|
|
463
463
|
{
|
|
464
464
|
role: "button",
|
|
465
465
|
tabIndex: 0,
|
|
466
466
|
onClick: c,
|
|
467
|
-
onKeyDown:
|
|
468
|
-
className:
|
|
467
|
+
onKeyDown: x,
|
|
468
|
+
className: O(
|
|
469
469
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
470
470
|
{
|
|
471
471
|
"bg-primary-alt/10 border-l-4 border-l-primary": r,
|
|
472
472
|
"hover:bg-sand": !r
|
|
473
473
|
}
|
|
474
474
|
),
|
|
475
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
476
476
|
/* @__PURE__ */ e(
|
|
477
477
|
oe,
|
|
478
478
|
{
|
|
479
|
-
id: ((
|
|
480
|
-
name:
|
|
479
|
+
id: ((f = g == null ? void 0 : g.user) == null ? void 0 : f.id) || t.id || "unknown",
|
|
480
|
+
name: h,
|
|
481
481
|
image: N,
|
|
482
482
|
size: 44,
|
|
483
|
-
starred:
|
|
483
|
+
starred: C,
|
|
484
484
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
485
485
|
}
|
|
486
486
|
),
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
488
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
|
|
489
|
+
/* @__PURE__ */ i(
|
|
490
490
|
"h3",
|
|
491
491
|
{
|
|
492
|
-
className:
|
|
492
|
+
className: O(
|
|
493
493
|
"text-sm font-medium truncate",
|
|
494
494
|
r ? "text-primary" : "text-charcoal"
|
|
495
495
|
),
|
|
496
496
|
children: [
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
C && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
498
|
+
h
|
|
499
499
|
]
|
|
500
500
|
}
|
|
501
501
|
),
|
|
502
|
-
|
|
502
|
+
p && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: p })
|
|
503
503
|
] }),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
506
|
-
|
|
504
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
505
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
|
|
506
|
+
I > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: I > 99 ? "99+" : I })
|
|
507
507
|
] })
|
|
508
508
|
] })
|
|
509
509
|
] })
|
|
@@ -511,37 +511,37 @@ const oe = ({
|
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
513
|
);
|
|
514
|
-
|
|
515
|
-
const
|
|
514
|
+
pt.displayName = "CustomChannelPreview";
|
|
515
|
+
const Hs = { last_message_at: -1 }, xt = z.memo(
|
|
516
516
|
({
|
|
517
517
|
onChannelSelect: t,
|
|
518
518
|
selectedChannel: s,
|
|
519
519
|
filters: n,
|
|
520
520
|
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
521
|
-
onMessageNew:
|
|
522
|
-
onAddedToChannel:
|
|
521
|
+
onMessageNew: l,
|
|
522
|
+
onAddedToChannel: d,
|
|
523
523
|
channelRenderFilterFn: r,
|
|
524
|
-
sort: c =
|
|
525
|
-
className:
|
|
526
|
-
customEmptyStateIndicator:
|
|
524
|
+
sort: c = Hs,
|
|
525
|
+
className: x,
|
|
526
|
+
customEmptyStateIndicator: u,
|
|
527
527
|
renderMessagePreview: g
|
|
528
528
|
}) => {
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
const { debug: N = !1 } =
|
|
532
|
-
(
|
|
533
|
-
for (const
|
|
534
|
-
|
|
535
|
-
return r ? r(
|
|
529
|
+
const h = z.useRef(0);
|
|
530
|
+
h.current++;
|
|
531
|
+
const { debug: N = !1 } = Le(), a = z.useCallback(
|
|
532
|
+
(v) => {
|
|
533
|
+
for (const p of v)
|
|
534
|
+
Ls(p);
|
|
535
|
+
return r ? r(v) : v;
|
|
536
536
|
},
|
|
537
537
|
[r]
|
|
538
538
|
);
|
|
539
539
|
N && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
540
|
-
renderCount:
|
|
540
|
+
renderCount: h.current,
|
|
541
541
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
542
542
|
filters: n
|
|
543
543
|
});
|
|
544
|
-
const
|
|
544
|
+
const _ = z.useMemo(
|
|
545
545
|
() => ({
|
|
546
546
|
selectedChannel: s,
|
|
547
547
|
onChannelSelect: t,
|
|
@@ -553,22 +553,22 @@ const Bs = { last_message_at: -1 }, gt = z.memo(
|
|
|
553
553
|
return /* @__PURE__ */ e(
|
|
554
554
|
"div",
|
|
555
555
|
{
|
|
556
|
-
className:
|
|
556
|
+
className: O(
|
|
557
557
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
558
|
-
|
|
558
|
+
x
|
|
559
559
|
),
|
|
560
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
561
|
-
|
|
560
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Ps, { value: _, children: /* @__PURE__ */ e(
|
|
561
|
+
Dt,
|
|
562
562
|
{
|
|
563
563
|
filters: n,
|
|
564
564
|
sort: c,
|
|
565
565
|
options: { limit: 30 },
|
|
566
566
|
allowNewMessagesFromUnfilteredChannels: o,
|
|
567
|
-
onMessageNew:
|
|
568
|
-
onAddedToChannel:
|
|
567
|
+
onMessageNew: l,
|
|
568
|
+
onAddedToChannel: d,
|
|
569
569
|
channelRenderFilterFn: a,
|
|
570
|
-
Preview:
|
|
571
|
-
EmptyStateIndicator:
|
|
570
|
+
Preview: pt,
|
|
571
|
+
EmptyStateIndicator: u
|
|
572
572
|
},
|
|
573
573
|
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
574
574
|
) }) })
|
|
@@ -576,8 +576,8 @@ const Bs = { last_message_at: -1 }, gt = z.memo(
|
|
|
576
576
|
);
|
|
577
577
|
}
|
|
578
578
|
);
|
|
579
|
-
|
|
580
|
-
const
|
|
579
|
+
xt.displayName = "ChannelList";
|
|
580
|
+
const Ie = ({
|
|
581
581
|
variant: t = "default",
|
|
582
582
|
className: s,
|
|
583
583
|
children: n,
|
|
@@ -586,7 +586,7 @@ const Se = ({
|
|
|
586
586
|
"button",
|
|
587
587
|
{
|
|
588
588
|
type: "button",
|
|
589
|
-
className:
|
|
589
|
+
className: O(
|
|
590
590
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
591
591
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
592
592
|
s
|
|
@@ -595,12 +595,12 @@ const Se = ({
|
|
|
595
595
|
children: n
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
|
-
function
|
|
599
|
-
return /* @__PURE__ */
|
|
598
|
+
function wt({ label: t, className: s, children: n, ...o }) {
|
|
599
|
+
return /* @__PURE__ */ i(
|
|
600
600
|
"button",
|
|
601
601
|
{
|
|
602
602
|
type: "button",
|
|
603
|
-
className:
|
|
603
|
+
className: O(
|
|
604
604
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
605
605
|
{
|
|
606
606
|
"cursor-not-allowed opacity-50": o.disabled,
|
|
@@ -616,84 +616,84 @@ function bt({ label: t, className: s, children: n, ...o }) {
|
|
|
616
616
|
}
|
|
617
617
|
);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return /* @__PURE__ */ e(
|
|
619
|
+
function vt({ onClick: t }) {
|
|
620
|
+
return /* @__PURE__ */ e(wt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const Ys = ({
|
|
623
623
|
dialogRef: t,
|
|
624
624
|
onClose: s,
|
|
625
625
|
participant: n,
|
|
626
626
|
channel: o,
|
|
627
|
-
followerStatusLabel:
|
|
628
|
-
onLeaveConversation:
|
|
627
|
+
followerStatusLabel: l,
|
|
628
|
+
onLeaveConversation: d,
|
|
629
629
|
onBlockParticipant: r,
|
|
630
630
|
showDeleteConversation: c = !0,
|
|
631
|
-
onDeleteConversationClick:
|
|
632
|
-
onBlockParticipantClick:
|
|
631
|
+
onDeleteConversationClick: x,
|
|
632
|
+
onBlockParticipantClick: u,
|
|
633
633
|
onReportParticipantClick: g,
|
|
634
|
-
customProfileContent:
|
|
634
|
+
customProfileContent: h,
|
|
635
635
|
customChannelActions: N
|
|
636
636
|
}) => {
|
|
637
|
-
var
|
|
638
|
-
const { service: a, debug:
|
|
639
|
-
var
|
|
640
|
-
if (!(!a || !((
|
|
637
|
+
var V, F, H, Z, ae, K, b;
|
|
638
|
+
const { service: a, debug: _ } = Le(), [v, p] = k(!1), [E, S] = k(!1), [C, I] = k(!1), P = A(async () => {
|
|
639
|
+
var y;
|
|
640
|
+
if (!(!a || !((y = n == null ? void 0 : n.user) != null && y.id)))
|
|
641
641
|
try {
|
|
642
642
|
const j = (await a.getBlockedUsers()).some(
|
|
643
|
-
(
|
|
644
|
-
var
|
|
645
|
-
return
|
|
643
|
+
(te) => {
|
|
644
|
+
var le;
|
|
645
|
+
return te.blocked_user_id === ((le = n == null ? void 0 : n.user) == null ? void 0 : le.id);
|
|
646
646
|
}
|
|
647
647
|
);
|
|
648
|
-
|
|
649
|
-
} catch (
|
|
648
|
+
p(j);
|
|
649
|
+
} catch (U) {
|
|
650
650
|
console.error(
|
|
651
651
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
652
|
-
|
|
652
|
+
U
|
|
653
653
|
);
|
|
654
654
|
}
|
|
655
|
-
}, [a, (
|
|
656
|
-
|
|
655
|
+
}, [a, (V = n == null ? void 0 : n.user) == null ? void 0 : V.id]);
|
|
656
|
+
q(() => {
|
|
657
657
|
P();
|
|
658
658
|
}, [P]);
|
|
659
|
-
const
|
|
660
|
-
var
|
|
659
|
+
const w = async () => {
|
|
660
|
+
var y;
|
|
661
661
|
if (!E) {
|
|
662
|
-
|
|
662
|
+
x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation", o.cid), S(!0);
|
|
663
663
|
try {
|
|
664
|
-
const
|
|
665
|
-
await o.hide(
|
|
666
|
-
} catch (
|
|
667
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
664
|
+
const U = ((y = o._client) == null ? void 0 : y.userID) ?? null;
|
|
665
|
+
await o.hide(U, !1), d && await d(o), s();
|
|
666
|
+
} catch (U) {
|
|
667
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
668
668
|
} finally {
|
|
669
|
-
|
|
669
|
+
S(!1);
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
|
-
},
|
|
673
|
-
var
|
|
674
|
-
if (!(
|
|
675
|
-
|
|
672
|
+
}, m = async () => {
|
|
673
|
+
var y, U, j;
|
|
674
|
+
if (!(C || !a)) {
|
|
675
|
+
u == null || u(), _ && console.log("[ChannelInfoDialog] Block member", (y = n == null ? void 0 : n.user) == null ? void 0 : y.id), I(!0);
|
|
676
676
|
try {
|
|
677
|
-
await a.blockUser((
|
|
678
|
-
} catch (
|
|
679
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
677
|
+
await a.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
678
|
+
} catch (te) {
|
|
679
|
+
console.error("[ChannelInfoDialog] Failed to block member", te);
|
|
680
680
|
} finally {
|
|
681
|
-
|
|
681
|
+
I(!1);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
},
|
|
685
|
-
var
|
|
686
|
-
if (!(
|
|
687
|
-
|
|
684
|
+
}, f = async () => {
|
|
685
|
+
var y, U, j;
|
|
686
|
+
if (!(C || !a)) {
|
|
687
|
+
u == null || u(), _ && console.log("[ChannelInfoDialog] Unblock member", (y = n == null ? void 0 : n.user) == null ? void 0 : y.id), I(!0);
|
|
688
688
|
try {
|
|
689
|
-
await a.unBlockUser((
|
|
690
|
-
} catch (
|
|
691
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
689
|
+
await a.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
690
|
+
} catch (te) {
|
|
691
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", te);
|
|
692
692
|
} finally {
|
|
693
|
-
|
|
693
|
+
I(!1);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
},
|
|
696
|
+
}, T = () => {
|
|
697
697
|
g == null || g(), s(), window.open(
|
|
698
698
|
"https://linktr.ee/s/about/trust-center/report",
|
|
699
699
|
"_blank",
|
|
@@ -701,7 +701,7 @@ const zs = ({
|
|
|
701
701
|
);
|
|
702
702
|
};
|
|
703
703
|
if (!n) return null;
|
|
704
|
-
const
|
|
704
|
+
const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member", L = (Z = n.user) == null ? void 0 : Z.image, R = (ae = n.user) == null ? void 0 : ae.email, B = (K = n.user) == null ? void 0 : K.username, ee = R || (B ? `linktr.ee/${B}` : void 0), J = ((b = n.user) == null ? void 0 : b.id) || "unknown";
|
|
705
705
|
return (
|
|
706
706
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
707
707
|
/* @__PURE__ */ e(
|
|
@@ -710,91 +710,91 @@ const zs = ({
|
|
|
710
710
|
ref: t,
|
|
711
711
|
className: "mes-dialog group",
|
|
712
712
|
onClose: s,
|
|
713
|
-
onClick: (
|
|
714
|
-
|
|
713
|
+
onClick: (y) => {
|
|
714
|
+
y.target === t.current && s();
|
|
715
715
|
},
|
|
716
|
-
children: /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
716
|
+
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
717
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
718
718
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
719
|
-
/* @__PURE__ */ e(
|
|
719
|
+
/* @__PURE__ */ e(vt, { onClick: s })
|
|
720
720
|
] }),
|
|
721
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
722
722
|
/* @__PURE__ */ e(
|
|
723
723
|
"div",
|
|
724
724
|
{
|
|
725
725
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
726
726
|
style: { backgroundColor: "#FBFAF9" },
|
|
727
|
-
children: /* @__PURE__ */
|
|
727
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
728
728
|
/* @__PURE__ */ e(
|
|
729
729
|
oe,
|
|
730
730
|
{
|
|
731
|
-
id:
|
|
732
|
-
name:
|
|
731
|
+
id: J,
|
|
732
|
+
name: M,
|
|
733
733
|
image: L,
|
|
734
734
|
size: 88,
|
|
735
735
|
shape: "circle"
|
|
736
736
|
}
|
|
737
737
|
),
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
738
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
739
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
|
|
740
740
|
ee && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: ee }),
|
|
741
|
-
|
|
741
|
+
l && !h && /* @__PURE__ */ e(
|
|
742
742
|
"span",
|
|
743
743
|
{
|
|
744
744
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
745
745
|
style: {
|
|
746
746
|
padding: "4px 8px",
|
|
747
|
-
backgroundColor:
|
|
748
|
-
color:
|
|
747
|
+
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
748
|
+
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
749
749
|
lineHeight: "133.333%",
|
|
750
750
|
letterSpacing: "0.21px"
|
|
751
751
|
},
|
|
752
|
-
children:
|
|
752
|
+
children: l
|
|
753
753
|
}
|
|
754
754
|
),
|
|
755
|
-
|
|
755
|
+
h
|
|
756
756
|
] })
|
|
757
757
|
] })
|
|
758
758
|
}
|
|
759
759
|
),
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
-
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
762
|
-
|
|
760
|
+
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
761
|
+
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
762
|
+
Ie,
|
|
763
763
|
{
|
|
764
|
-
onClick:
|
|
764
|
+
onClick: w,
|
|
765
765
|
disabled: E,
|
|
766
766
|
"aria-busy": E,
|
|
767
767
|
children: [
|
|
768
|
-
E ? /* @__PURE__ */ e(
|
|
768
|
+
E ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ms, { className: "h-5 w-5" }),
|
|
769
769
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
770
770
|
]
|
|
771
771
|
}
|
|
772
772
|
) }),
|
|
773
|
-
/* @__PURE__ */ e("li", { children:
|
|
774
|
-
|
|
773
|
+
/* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ i(
|
|
774
|
+
Ie,
|
|
775
775
|
{
|
|
776
|
-
onClick:
|
|
777
|
-
disabled:
|
|
778
|
-
"aria-busy":
|
|
776
|
+
onClick: f,
|
|
777
|
+
disabled: C,
|
|
778
|
+
"aria-busy": C,
|
|
779
779
|
children: [
|
|
780
|
-
|
|
780
|
+
C ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
|
|
781
781
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
782
782
|
]
|
|
783
783
|
}
|
|
784
|
-
) : /* @__PURE__ */
|
|
785
|
-
|
|
784
|
+
) : /* @__PURE__ */ i(
|
|
785
|
+
Ie,
|
|
786
786
|
{
|
|
787
|
-
onClick:
|
|
788
|
-
disabled:
|
|
789
|
-
"aria-busy":
|
|
787
|
+
onClick: m,
|
|
788
|
+
disabled: C,
|
|
789
|
+
"aria-busy": C,
|
|
790
790
|
children: [
|
|
791
|
-
|
|
791
|
+
C ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
|
|
792
792
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
793
793
|
]
|
|
794
794
|
}
|
|
795
795
|
) }),
|
|
796
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */ e(
|
|
796
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(Ie, { variant: "danger", onClick: T, children: [
|
|
797
|
+
/* @__PURE__ */ e(hs, { className: "h-5 w-5" }),
|
|
798
798
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
799
799
|
] }) }),
|
|
800
800
|
N
|
|
@@ -804,52 +804,52 @@ const zs = ({
|
|
|
804
804
|
}
|
|
805
805
|
)
|
|
806
806
|
);
|
|
807
|
-
},
|
|
808
|
-
function
|
|
809
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
807
|
+
}, Ws = (t) => /* @__PURE__ */ e(Rt, { ...t, position: "center" }), je = "vote_up", Ge = "vote_down";
|
|
808
|
+
function qs(t) {
|
|
809
|
+
return t != null && t.length ? t.some((s) => s.type === Ge) ? "down" : t.some((s) => s.type === je) ? "up" : null : null;
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
const { channel: s } = fe(), { client: n } =
|
|
813
|
-
() =>
|
|
811
|
+
function Zs(t) {
|
|
812
|
+
const { channel: s } = fe(), { client: n } = it("useMessageVote"), o = ze(
|
|
813
|
+
() => qs(t.own_reactions),
|
|
814
814
|
[t.own_reactions]
|
|
815
|
-
),
|
|
815
|
+
), l = A(async () => {
|
|
816
816
|
if (n != null && n.userID)
|
|
817
817
|
try {
|
|
818
|
-
o === "up" ? await s.deleteReaction(t.id,
|
|
818
|
+
o === "up" ? await s.deleteReaction(t.id, je) : await s.sendReaction(
|
|
819
819
|
t.id,
|
|
820
|
-
{ type:
|
|
820
|
+
{ type: je },
|
|
821
821
|
{ enforce_unique: !0, skip_push: !0 }
|
|
822
822
|
);
|
|
823
823
|
} catch {
|
|
824
824
|
}
|
|
825
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]),
|
|
825
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = A(async () => {
|
|
826
826
|
if (n != null && n.userID)
|
|
827
827
|
try {
|
|
828
|
-
o === "down" ? await s.deleteReaction(t.id,
|
|
828
|
+
o === "down" ? await s.deleteReaction(t.id, Ge) : await s.sendReaction(
|
|
829
829
|
t.id,
|
|
830
|
-
{ type:
|
|
830
|
+
{ type: Ge },
|
|
831
831
|
{ enforce_unique: !0, skip_push: !0 }
|
|
832
832
|
);
|
|
833
833
|
} catch {
|
|
834
834
|
}
|
|
835
835
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
836
|
-
return { selected: o, voteUp:
|
|
836
|
+
return { selected: o, voteUp: l, voteDown: d };
|
|
837
837
|
}
|
|
838
|
-
const
|
|
838
|
+
const Xs = z.lazy(() => import("./Card-V-Et3tc4.js")), Ks = z.lazy(() => import("./Card-CQYlmwhm.js")), Nt = () => /* @__PURE__ */ e(
|
|
839
839
|
"div",
|
|
840
840
|
{
|
|
841
841
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
842
842
|
"aria-hidden": !0
|
|
843
843
|
}
|
|
844
|
-
),
|
|
844
|
+
), Js = (t) => /* @__PURE__ */ e(lt, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Xs, { ...t }) }), Qs = (t) => /* @__PURE__ */ e(lt, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Ks, { ...t }) }), nt = { Creator: Js, Visitor: Qs }, en = {
|
|
845
845
|
isUnlocking: () => !1
|
|
846
|
-
},
|
|
847
|
-
LockedAttachment:
|
|
848
|
-
},
|
|
849
|
-
function
|
|
850
|
-
return
|
|
846
|
+
}, tn = {
|
|
847
|
+
LockedAttachment: en
|
|
848
|
+
}, yt = rt({}), sa = yt.Provider;
|
|
849
|
+
function sn(t) {
|
|
850
|
+
return ot(yt)[t] ?? tn[t];
|
|
851
851
|
}
|
|
852
|
-
const
|
|
852
|
+
const nn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
853
853
|
"path",
|
|
854
854
|
{
|
|
855
855
|
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
@@ -859,7 +859,7 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
859
859
|
strokeLinejoin: "round",
|
|
860
860
|
fill: t ? "currentColor" : "none"
|
|
861
861
|
}
|
|
862
|
-
) }),
|
|
862
|
+
) }), an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
863
863
|
"path",
|
|
864
864
|
{
|
|
865
865
|
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
@@ -869,11 +869,11 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
869
869
|
strokeLinejoin: "round",
|
|
870
870
|
fill: t ? "currentColor" : "none"
|
|
871
871
|
}
|
|
872
|
-
) }),
|
|
872
|
+
) }), rn = ({
|
|
873
873
|
selected: t,
|
|
874
874
|
onVoteUp: s,
|
|
875
875
|
onVoteDown: n
|
|
876
|
-
}) => /* @__PURE__ */
|
|
876
|
+
}) => /* @__PURE__ */ i("div", { className: "message-vote-buttons", children: [
|
|
877
877
|
/* @__PURE__ */ e(
|
|
878
878
|
"button",
|
|
879
879
|
{
|
|
@@ -882,7 +882,7 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
882
882
|
onClick: s,
|
|
883
883
|
"aria-label": "Helpful",
|
|
884
884
|
"aria-pressed": t === "up",
|
|
885
|
-
children: /* @__PURE__ */ e(
|
|
885
|
+
children: /* @__PURE__ */ e(nn, { filled: t === "up" })
|
|
886
886
|
}
|
|
887
887
|
),
|
|
888
888
|
/* @__PURE__ */ e(
|
|
@@ -893,90 +893,90 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
893
893
|
onClick: n,
|
|
894
894
|
"aria-label": "Not helpful",
|
|
895
895
|
"aria-pressed": t === "down",
|
|
896
|
-
children: /* @__PURE__ */ e(
|
|
896
|
+
children: /* @__PURE__ */ e(an, { filled: t === "down" })
|
|
897
897
|
}
|
|
898
898
|
)
|
|
899
|
-
] }),
|
|
900
|
-
var ce, ne,
|
|
899
|
+
] }), on = (t) => {
|
|
900
|
+
var ce, ne, Ne, ye, Ce, de, _e, Ee, Se, ue, D, W, $, G;
|
|
901
901
|
const {
|
|
902
902
|
additionalMessageInputProps: s,
|
|
903
903
|
chatbotVotingEnabled: n,
|
|
904
904
|
editing: o,
|
|
905
|
-
endOfGroup:
|
|
906
|
-
firstOfGroup:
|
|
905
|
+
endOfGroup: l,
|
|
906
|
+
firstOfGroup: d,
|
|
907
907
|
groupedByUser: r,
|
|
908
908
|
handleAction: c,
|
|
909
|
-
handleOpenThread:
|
|
910
|
-
handleRetry:
|
|
909
|
+
handleOpenThread: x,
|
|
910
|
+
handleRetry: u,
|
|
911
911
|
highlighted: g,
|
|
912
|
-
isMessageAIGenerated:
|
|
912
|
+
isMessageAIGenerated: h,
|
|
913
913
|
isMyMessage: N,
|
|
914
914
|
message: a,
|
|
915
|
-
renderText:
|
|
916
|
-
threadList:
|
|
917
|
-
} = t, { client:
|
|
918
|
-
Attachment:
|
|
919
|
-
EditMessageModal:
|
|
920
|
-
MessageBlocked: ee =
|
|
921
|
-
MessageBouncePrompt:
|
|
922
|
-
MessageDeleted:
|
|
923
|
-
MessageIsThreadReplyInChannelButtonIndicator: F =
|
|
924
|
-
MessageRepliesCountButton:
|
|
925
|
-
ReminderNotification: Z =
|
|
926
|
-
StreamedMessageText:
|
|
927
|
-
PinIndicator:
|
|
928
|
-
} =
|
|
929
|
-
() =>
|
|
930
|
-
[
|
|
931
|
-
), j =
|
|
915
|
+
renderText: _,
|
|
916
|
+
threadList: v
|
|
917
|
+
} = t, { client: p } = it("CustomMessage"), { channel: E } = fe("CustomMessage"), { isUnlocking: S, onUnlockClick: C, onFetchSource: I, onDownloadClick: P } = sn("LockedAttachment"), [w, m] = k(!1), f = Pt(a.id), { selected: T, voteUp: M, voteDown: L } = Zs(a), {
|
|
918
|
+
Attachment: R = Ft,
|
|
919
|
+
EditMessageModal: B = At,
|
|
920
|
+
MessageBlocked: ee = Ut,
|
|
921
|
+
MessageBouncePrompt: J = Ot,
|
|
922
|
+
MessageDeleted: V = $t,
|
|
923
|
+
MessageIsThreadReplyInChannelButtonIndicator: F = zt,
|
|
924
|
+
MessageRepliesCountButton: H = Bt,
|
|
925
|
+
ReminderNotification: Z = jt,
|
|
926
|
+
StreamedMessageText: ae = Gt,
|
|
927
|
+
PinIndicator: K
|
|
928
|
+
} = ct("CustomMessage"), b = Vt(a), y = Ht(a), U = ze(
|
|
929
|
+
() => h == null ? void 0 : h(a),
|
|
930
|
+
[h, a]
|
|
931
|
+
), j = ze(
|
|
932
932
|
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
933
933
|
[a]
|
|
934
934
|
);
|
|
935
|
-
if (
|
|
935
|
+
if (Yt(a))
|
|
936
936
|
return null;
|
|
937
937
|
if (a.deleted_at || a.type === "deleted")
|
|
938
|
-
return /* @__PURE__ */ e(
|
|
939
|
-
if (
|
|
938
|
+
return /* @__PURE__ */ e(V, { message: a });
|
|
939
|
+
if (Wt(a))
|
|
940
940
|
return /* @__PURE__ */ e(ee, {});
|
|
941
|
-
const
|
|
941
|
+
const te = !v && !!a.reply_count, le = !v && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Pe = qt(a);
|
|
942
942
|
let Y;
|
|
943
|
-
|
|
944
|
-
const
|
|
943
|
+
pe ? Y = () => u(a) : Pe && (Y = () => m(!0));
|
|
944
|
+
const Q = N(), xe = O(
|
|
945
945
|
"str-chat__message str-chat__message-simple",
|
|
946
946
|
`str-chat__message--${a.type}`,
|
|
947
947
|
`str-chat__message--${a.status}`,
|
|
948
|
-
|
|
948
|
+
Q ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
949
949
|
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
950
950
|
{
|
|
951
|
-
"str-chat__message--has-attachment":
|
|
951
|
+
"str-chat__message--has-attachment": b,
|
|
952
952
|
"str-chat__message--highlighted": g,
|
|
953
953
|
"str-chat__message--pinned pinned-message": a.pinned,
|
|
954
|
-
"str-chat__message--with-reactions":
|
|
954
|
+
"str-chat__message--with-reactions": y,
|
|
955
955
|
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ne = a == null ? void 0 : a.error) == null ? void 0 : ne.status) !== 403,
|
|
956
|
-
"str-chat__message-with-thread-link":
|
|
957
|
-
"str-chat__virtual-message__wrapper--end":
|
|
958
|
-
"str-chat__virtual-message__wrapper--first":
|
|
956
|
+
"str-chat__message-with-thread-link": te || le,
|
|
957
|
+
"str-chat__virtual-message__wrapper--end": l,
|
|
958
|
+
"str-chat__virtual-message__wrapper--first": d,
|
|
959
959
|
"str-chat__virtual-message__wrapper--group": r
|
|
960
960
|
}
|
|
961
|
-
),
|
|
962
|
-
return /* @__PURE__ */
|
|
961
|
+
), re = a.poll_id && p.polls.fromState(a.poll_id), me = Vs(a), ie = He(a), we = Gs(a), ge = !!(j != null && j.length && !a.quoted_message), ve = ie && Q && ge;
|
|
962
|
+
return /* @__PURE__ */ i(se, { children: [
|
|
963
963
|
o && /* @__PURE__ */ e(
|
|
964
|
-
|
|
964
|
+
B,
|
|
965
965
|
{
|
|
966
966
|
additionalMessageInputProps: s
|
|
967
967
|
}
|
|
968
968
|
),
|
|
969
|
-
|
|
970
|
-
|
|
969
|
+
w && /* @__PURE__ */ e(
|
|
970
|
+
Zt,
|
|
971
971
|
{
|
|
972
|
-
MessageBouncePrompt:
|
|
973
|
-
onClose: () =>
|
|
974
|
-
open:
|
|
972
|
+
MessageBouncePrompt: J,
|
|
973
|
+
onClose: () => m(!1),
|
|
974
|
+
open: w
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
|
|
979
|
-
!!
|
|
977
|
+
/* @__PURE__ */ i("div", { className: xe, children: [
|
|
978
|
+
K && /* @__PURE__ */ e(K, {}),
|
|
979
|
+
!!f && /* @__PURE__ */ e(Z, { reminder: f }),
|
|
980
980
|
a.user && /* @__PURE__ */ e(
|
|
981
981
|
oe,
|
|
982
982
|
{
|
|
@@ -989,8 +989,8 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
989
989
|
/* @__PURE__ */ e(
|
|
990
990
|
"div",
|
|
991
991
|
{
|
|
992
|
-
className:
|
|
993
|
-
"str-chat__simple-message--error-failed":
|
|
992
|
+
className: O("str-chat__message-inner", {
|
|
993
|
+
"str-chat__simple-message--error-failed": pe || Pe
|
|
994
994
|
}),
|
|
995
995
|
"data-testid": "message-inner",
|
|
996
996
|
onClick: Y,
|
|
@@ -1003,108 +1003,108 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1003
1003
|
marginInlineEnd: 0,
|
|
1004
1004
|
marginInlineStart: 0
|
|
1005
1005
|
},
|
|
1006
|
-
children:
|
|
1007
|
-
|
|
1008
|
-
|
|
1006
|
+
children: we ? /* @__PURE__ */ i("div", { className: `flex flex-col gap-1 ${Q ? "items-end" : "items-start"}`, children: [
|
|
1007
|
+
Q ? /* @__PURE__ */ e(
|
|
1008
|
+
nt.Creator,
|
|
1009
1009
|
{
|
|
1010
|
-
title: (
|
|
1011
|
-
mimeType: (
|
|
1012
|
-
thumbnailUrl: (
|
|
1010
|
+
title: (Ne = a.metadata) == null ? void 0 : Ne.attachment_title,
|
|
1011
|
+
mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
|
|
1012
|
+
thumbnailUrl: (Ce = a.metadata) == null ? void 0 : Ce.attachment_thumbnail,
|
|
1013
1013
|
amountText: (de = a.metadata) == null ? void 0 : de.amount_text,
|
|
1014
|
-
detail: (
|
|
1015
|
-
paymentStatus: (
|
|
1014
|
+
detail: (_e = a.metadata) == null ? void 0 : _e.attachment_detail,
|
|
1015
|
+
paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status
|
|
1016
1016
|
}
|
|
1017
1017
|
) : /* @__PURE__ */ e(
|
|
1018
|
-
|
|
1018
|
+
nt.Visitor,
|
|
1019
1019
|
{
|
|
1020
|
-
title: (
|
|
1020
|
+
title: (Se = a.metadata) == null ? void 0 : Se.attachment_title,
|
|
1021
1021
|
mimeType: (ue = a.metadata) == null ? void 0 : ue.attachment_mime_type,
|
|
1022
|
-
thumbnailUrl: (
|
|
1022
|
+
thumbnailUrl: (D = a.metadata) == null ? void 0 : D.attachment_thumbnail,
|
|
1023
1023
|
amountText: (W = a.metadata) == null ? void 0 : W.amount_text,
|
|
1024
|
-
detail: (
|
|
1025
|
-
paymentStatus: (
|
|
1026
|
-
isUnlocking:
|
|
1027
|
-
onUnlockClick: () =>
|
|
1028
|
-
onFetchSource: async () => await (
|
|
1024
|
+
detail: ($ = a.metadata) == null ? void 0 : $.attachment_detail,
|
|
1025
|
+
paymentStatus: (G = a.metadata) == null ? void 0 : G.payment_status,
|
|
1026
|
+
isUnlocking: S(a.id),
|
|
1027
|
+
onUnlockClick: () => C == null ? void 0 : C(a, E),
|
|
1028
|
+
onFetchSource: async () => await (I == null ? void 0 : I(a, E)),
|
|
1029
1029
|
onDownloadClick: () => P == null ? void 0 : P(a, E)
|
|
1030
1030
|
}
|
|
1031
1031
|
),
|
|
1032
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(
|
|
1032
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Ze, { message: a, renderText: _ }) }) })
|
|
1033
1033
|
] }) : me ? (
|
|
1034
1034
|
/* Tip-only messages render as a standalone bubble */
|
|
1035
|
-
/* @__PURE__ */ e(
|
|
1036
|
-
) : /* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
|
|
1039
|
-
|
|
1035
|
+
/* @__PURE__ */ e(Oe, { message: a, standalone: !0 })
|
|
1036
|
+
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1037
|
+
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
1038
|
+
ie && !ve && /* @__PURE__ */ e(
|
|
1039
|
+
Oe,
|
|
1040
1040
|
{
|
|
1041
1041
|
message: a,
|
|
1042
1042
|
hasAttachment: ge,
|
|
1043
|
-
isMyMessage:
|
|
1043
|
+
isMyMessage: Q
|
|
1044
1044
|
}
|
|
1045
1045
|
),
|
|
1046
|
-
|
|
1046
|
+
re && /* @__PURE__ */ e(Xt, { poll: re }),
|
|
1047
1047
|
j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1048
|
-
|
|
1048
|
+
R,
|
|
1049
1049
|
{
|
|
1050
1050
|
actionHandler: c,
|
|
1051
1051
|
attachments: j
|
|
1052
1052
|
}
|
|
1053
1053
|
) : null,
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
U ? /* @__PURE__ */ e(
|
|
1055
|
+
ae,
|
|
1056
1056
|
{
|
|
1057
1057
|
message: a,
|
|
1058
|
-
renderText:
|
|
1058
|
+
renderText: _
|
|
1059
1059
|
}
|
|
1060
|
-
) : /* @__PURE__ */ e(
|
|
1061
|
-
/* @__PURE__ */ e(
|
|
1060
|
+
) : /* @__PURE__ */ e(Ze, { message: a, renderText: _ }),
|
|
1061
|
+
/* @__PURE__ */ e(Kt, {})
|
|
1062
1062
|
] }),
|
|
1063
|
-
(!
|
|
1064
|
-
|
|
1063
|
+
(!ie || ve) && /* @__PURE__ */ e(
|
|
1064
|
+
Oe,
|
|
1065
1065
|
{
|
|
1066
1066
|
message: a,
|
|
1067
1067
|
hasAttachment: ge,
|
|
1068
|
-
isMyMessage:
|
|
1068
|
+
isMyMessage: Q
|
|
1069
1069
|
}
|
|
1070
1070
|
),
|
|
1071
|
-
n &&
|
|
1072
|
-
|
|
1071
|
+
n && ie && /* @__PURE__ */ e(
|
|
1072
|
+
rn,
|
|
1073
1073
|
{
|
|
1074
|
-
selected:
|
|
1075
|
-
onVoteUp:
|
|
1074
|
+
selected: T,
|
|
1075
|
+
onVoteUp: M,
|
|
1076
1076
|
onVoteDown: L
|
|
1077
1077
|
}
|
|
1078
1078
|
)
|
|
1079
1079
|
] })
|
|
1080
1080
|
}
|
|
1081
1081
|
),
|
|
1082
|
-
|
|
1083
|
-
|
|
1082
|
+
te && /* @__PURE__ */ e(
|
|
1083
|
+
H,
|
|
1084
1084
|
{
|
|
1085
|
-
onClick:
|
|
1085
|
+
onClick: x,
|
|
1086
1086
|
reply_count: a.reply_count
|
|
1087
1087
|
}
|
|
1088
1088
|
),
|
|
1089
|
-
|
|
1089
|
+
le && /* @__PURE__ */ e(F, {})
|
|
1090
1090
|
] }, a.id)
|
|
1091
1091
|
] });
|
|
1092
|
-
},
|
|
1093
|
-
|
|
1094
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 :
|
|
1095
|
-
),
|
|
1096
|
-
const s =
|
|
1097
|
-
return /* @__PURE__ */ e(
|
|
1098
|
-
},
|
|
1092
|
+
}, ln = z.memo(
|
|
1093
|
+
on,
|
|
1094
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : Lt(t, s)
|
|
1095
|
+
), cn = (t) => {
|
|
1096
|
+
const s = dt("CustomMessage");
|
|
1097
|
+
return /* @__PURE__ */ e(ln, { ...s, ...t });
|
|
1098
|
+
}, dn = (t) => ({
|
|
1099
1099
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1100
|
-
(s) =>
|
|
1100
|
+
(s) => tt.previewIsLoaded(s) || tt.previewIsLoading(s)
|
|
1101
1101
|
)
|
|
1102
|
-
}),
|
|
1102
|
+
}), un = ({
|
|
1103
1103
|
link: t,
|
|
1104
1104
|
onDismiss: s
|
|
1105
1105
|
}) => {
|
|
1106
|
-
const { og_scrape_url: n, title: o, image_url:
|
|
1107
|
-
return /* @__PURE__ */
|
|
1106
|
+
const { og_scrape_url: n, title: o, image_url: l } = t;
|
|
1107
|
+
return /* @__PURE__ */ i(
|
|
1108
1108
|
"a",
|
|
1109
1109
|
{
|
|
1110
1110
|
href: n,
|
|
@@ -1112,10 +1112,10 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1112
1112
|
rel: "noopener noreferrer",
|
|
1113
1113
|
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
1114
1114
|
children: [
|
|
1115
|
-
|
|
1115
|
+
l && /* @__PURE__ */ e(
|
|
1116
1116
|
"img",
|
|
1117
1117
|
{
|
|
1118
|
-
src:
|
|
1118
|
+
src: l,
|
|
1119
1119
|
alt: o || "",
|
|
1120
1120
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1121
1121
|
}
|
|
@@ -1129,32 +1129,32 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1129
1129
|
},
|
|
1130
1130
|
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",
|
|
1131
1131
|
"aria-label": "Close link preview",
|
|
1132
|
-
children: /* @__PURE__ */ e(
|
|
1132
|
+
children: /* @__PURE__ */ e(Re, { className: "size-4 text-black/90" })
|
|
1133
1133
|
}
|
|
1134
1134
|
),
|
|
1135
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
1136
1136
|
o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
|
|
1137
1137
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1138
1138
|
] })
|
|
1139
1139
|
]
|
|
1140
1140
|
}
|
|
1141
1141
|
);
|
|
1142
|
-
},
|
|
1143
|
-
const { linkPreviewsManager: t } =
|
|
1142
|
+
}, mn = () => {
|
|
1143
|
+
const { linkPreviewsManager: t } = Jt(), { linkPreviews: s } = Qt(
|
|
1144
1144
|
t.state,
|
|
1145
|
-
|
|
1146
|
-
), n = (
|
|
1147
|
-
t.dismissPreview(
|
|
1145
|
+
dn
|
|
1146
|
+
), n = (l) => {
|
|
1147
|
+
t.dismissPreview(l);
|
|
1148
1148
|
};
|
|
1149
|
-
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((
|
|
1150
|
-
|
|
1149
|
+
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
|
|
1150
|
+
un,
|
|
1151
1151
|
{
|
|
1152
|
-
link:
|
|
1152
|
+
link: l,
|
|
1153
1153
|
onDismiss: n
|
|
1154
1154
|
},
|
|
1155
|
-
|
|
1155
|
+
l.og_scrape_url
|
|
1156
1156
|
)) }) : null;
|
|
1157
|
-
},
|
|
1157
|
+
}, hn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1158
1158
|
"button",
|
|
1159
1159
|
{
|
|
1160
1160
|
...n,
|
|
@@ -1162,22 +1162,22 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1162
1162
|
"aria-label": "Send",
|
|
1163
1163
|
disabled: s,
|
|
1164
1164
|
onClick: t,
|
|
1165
|
-
children: /* @__PURE__ */ e(
|
|
1165
|
+
children: /* @__PURE__ */ e(fs, { weight: "bold", className: "size-4" })
|
|
1166
1166
|
}
|
|
1167
|
-
),
|
|
1167
|
+
), fn = () => {
|
|
1168
1168
|
var c;
|
|
1169
|
-
const { channel: t } = fe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } =
|
|
1169
|
+
const { channel: t } = fe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = ts(), { SendButton: o } = ct(
|
|
1170
1170
|
"CustomMessageInput"
|
|
1171
|
-
),
|
|
1172
|
-
return /* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */ e(
|
|
1176
|
-
/* @__PURE__ */ e(
|
|
1177
|
-
/* @__PURE__ */ e(
|
|
1178
|
-
/* @__PURE__ */
|
|
1171
|
+
), l = o ?? hn, d = ss();
|
|
1172
|
+
return /* @__PURE__ */ i(se, { children: [
|
|
1173
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(ns, {}) }),
|
|
1174
|
+
/* @__PURE__ */ i("div", { className: "central-container 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: [
|
|
1175
|
+
/* @__PURE__ */ e(as, {}),
|
|
1176
|
+
/* @__PURE__ */ e(mn, {}),
|
|
1177
|
+
/* @__PURE__ */ e(rs, {}),
|
|
1178
|
+
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1179
1179
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1180
|
-
|
|
1180
|
+
os,
|
|
1181
1181
|
{
|
|
1182
1182
|
"aria-disabled": s || void 0,
|
|
1183
1183
|
className: "w-full resize-none outline-none leading-6",
|
|
@@ -1188,25 +1188,25 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1188
1188
|
}
|
|
1189
1189
|
) }),
|
|
1190
1190
|
/* @__PURE__ */ e(
|
|
1191
|
-
|
|
1191
|
+
l,
|
|
1192
1192
|
{
|
|
1193
1193
|
sendMessage: n,
|
|
1194
1194
|
"aria-label": "Send",
|
|
1195
1195
|
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1196
1196
|
"data-testid": "send-button",
|
|
1197
|
-
disabled: s || !
|
|
1197
|
+
disabled: s || !d,
|
|
1198
1198
|
type: "button"
|
|
1199
1199
|
}
|
|
1200
1200
|
)
|
|
1201
1201
|
] })
|
|
1202
1202
|
] })
|
|
1203
1203
|
] });
|
|
1204
|
-
},
|
|
1204
|
+
}, gn = ({
|
|
1205
1205
|
renderActions: t
|
|
1206
1206
|
}) => {
|
|
1207
1207
|
var o;
|
|
1208
1208
|
const { channel: s } = fe(), n = ((o = s == null ? void 0 : s.data) == null ? void 0 : o.frozen) === !0;
|
|
1209
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ i(
|
|
1210
1210
|
"div",
|
|
1211
1211
|
{
|
|
1212
1212
|
inert: n ? "" : void 0,
|
|
@@ -1214,67 +1214,67 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1214
1214
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1215
1215
|
children: [
|
|
1216
1216
|
t == null ? void 0 : t(),
|
|
1217
|
-
/* @__PURE__ */ e(
|
|
1217
|
+
/* @__PURE__ */ e(es, { Input: fn })
|
|
1218
1218
|
]
|
|
1219
1219
|
}
|
|
1220
1220
|
);
|
|
1221
|
-
},
|
|
1221
|
+
}, bn = [
|
|
1222
1222
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1223
1223
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1224
|
-
],
|
|
1224
|
+
], pn = {
|
|
1225
1225
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1226
1226
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1227
|
-
},
|
|
1227
|
+
}, xn = [
|
|
1228
1228
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1229
|
-
],
|
|
1229
|
+
], wn = {
|
|
1230
1230
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1231
|
-
},
|
|
1231
|
+
}, $e = "age safety guidelines.", vn = "https://linktr.ee/s/about/contact", at = (t) => bn.includes(t), Nn = (t) => xn.includes(t), yn = (t) => {
|
|
1232
1232
|
var o;
|
|
1233
1233
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1234
|
-
if (
|
|
1234
|
+
if (at(s))
|
|
1235
1235
|
return {
|
|
1236
1236
|
kind: "dm-agent",
|
|
1237
1237
|
type: s
|
|
1238
1238
|
};
|
|
1239
|
-
if (
|
|
1239
|
+
if (Nn(s))
|
|
1240
1240
|
return {
|
|
1241
1241
|
kind: "age-safety",
|
|
1242
1242
|
type: s
|
|
1243
1243
|
};
|
|
1244
1244
|
const n = t.dm_agent_system_type;
|
|
1245
|
-
if (
|
|
1245
|
+
if (at(n))
|
|
1246
1246
|
return {
|
|
1247
1247
|
kind: "dm-agent",
|
|
1248
1248
|
type: n
|
|
1249
1249
|
};
|
|
1250
|
-
},
|
|
1251
|
-
const s = t.indexOf(
|
|
1250
|
+
}, Cn = (t) => {
|
|
1251
|
+
const s = t.indexOf($e);
|
|
1252
1252
|
if (s === -1)
|
|
1253
1253
|
return t;
|
|
1254
|
-
const n = s +
|
|
1255
|
-
return /* @__PURE__ */
|
|
1254
|
+
const n = s + $e.length;
|
|
1255
|
+
return /* @__PURE__ */ i(se, { children: [
|
|
1256
1256
|
t.slice(0, s),
|
|
1257
1257
|
/* @__PURE__ */ e(
|
|
1258
1258
|
"a",
|
|
1259
1259
|
{
|
|
1260
|
-
href:
|
|
1260
|
+
href: vn,
|
|
1261
1261
|
target: "_blank",
|
|
1262
1262
|
rel: "noopener noreferrer",
|
|
1263
1263
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1264
|
-
children:
|
|
1264
|
+
children: $e
|
|
1265
1265
|
}
|
|
1266
1266
|
),
|
|
1267
1267
|
t.slice(n)
|
|
1268
1268
|
] });
|
|
1269
|
-
},
|
|
1270
|
-
var o,
|
|
1271
|
-
const s = t.message.hide_date === !0, n =
|
|
1269
|
+
}, _n = (t) => {
|
|
1270
|
+
var o, l;
|
|
1271
|
+
const s = t.message.hide_date === !0, n = yn(
|
|
1272
1272
|
t.message
|
|
1273
1273
|
);
|
|
1274
1274
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1275
|
-
const
|
|
1276
|
-
return /* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */
|
|
1275
|
+
const d = ((o = t.message.text) == null ? void 0 : o.trim()) || pn[n.type];
|
|
1276
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1277
|
+
/* @__PURE__ */ i(
|
|
1278
1278
|
"div",
|
|
1279
1279
|
{
|
|
1280
1280
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
@@ -1282,7 +1282,7 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1282
1282
|
"data-dm-agent-system-type": n.type,
|
|
1283
1283
|
children: [
|
|
1284
1284
|
/* @__PURE__ */ e(
|
|
1285
|
-
|
|
1285
|
+
gs,
|
|
1286
1286
|
{
|
|
1287
1287
|
size: 16,
|
|
1288
1288
|
weight: "regular",
|
|
@@ -1290,17 +1290,17 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1290
1290
|
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1291
1291
|
}
|
|
1292
1292
|
),
|
|
1293
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children:
|
|
1293
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: d })
|
|
1294
1294
|
]
|
|
1295
1295
|
}
|
|
1296
1296
|
),
|
|
1297
|
-
!s && /* @__PURE__ */ e(
|
|
1297
|
+
!s && /* @__PURE__ */ e(Ue, { message: t.message })
|
|
1298
1298
|
] });
|
|
1299
1299
|
}
|
|
1300
1300
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1301
|
-
const
|
|
1302
|
-
return /* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1301
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || wn[n.type];
|
|
1302
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1303
|
+
/* @__PURE__ */ i(
|
|
1304
1304
|
"div",
|
|
1305
1305
|
{
|
|
1306
1306
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
@@ -1308,7 +1308,7 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1308
1308
|
"data-age-safety-system-type": n.type,
|
|
1309
1309
|
children: [
|
|
1310
1310
|
/* @__PURE__ */ e(
|
|
1311
|
-
|
|
1311
|
+
bs,
|
|
1312
1312
|
{
|
|
1313
1313
|
size: 24,
|
|
1314
1314
|
weight: "duotone",
|
|
@@ -1317,27 +1317,27 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1317
1317
|
"data-testid": "age-safety-system-message-icon"
|
|
1318
1318
|
}
|
|
1319
1319
|
),
|
|
1320
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("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:
|
|
1320
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("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: Cn(d) }) })
|
|
1321
1321
|
]
|
|
1322
1322
|
}
|
|
1323
1323
|
),
|
|
1324
|
-
!s && /* @__PURE__ */ e(
|
|
1324
|
+
!s && /* @__PURE__ */ e(Ue, { message: t.message })
|
|
1325
1325
|
] });
|
|
1326
1326
|
}
|
|
1327
|
-
return /* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1328
|
+
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
1329
1329
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
1330
1330
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1331
1331
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1332
1332
|
] }),
|
|
1333
|
-
!s && /* @__PURE__ */ e(
|
|
1333
|
+
!s && /* @__PURE__ */ e(Ue, { message: t.message })
|
|
1334
1334
|
] });
|
|
1335
|
-
},
|
|
1335
|
+
}, En = () => null, Sn = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1336
1336
|
"div",
|
|
1337
1337
|
{
|
|
1338
|
-
className:
|
|
1338
|
+
className: O("flex items-center justify-center h-full", t),
|
|
1339
1339
|
children: [
|
|
1340
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1341
1341
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1342
1342
|
"animateTransform",
|
|
1343
1343
|
{
|
|
@@ -1375,36 +1375,36 @@ const Ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1375
1375
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1376
1376
|
]
|
|
1377
1377
|
}
|
|
1378
|
-
),
|
|
1379
|
-
/* @__PURE__ */ e(
|
|
1378
|
+
), De = z.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1379
|
+
/* @__PURE__ */ e(Sn, { className: "w-6 h-6" }),
|
|
1380
1380
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1381
1381
|
] }) }));
|
|
1382
|
-
|
|
1383
|
-
const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
1382
|
+
De.displayName = "LoadingState";
|
|
1383
|
+
const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", In = ({
|
|
1384
1384
|
onBack: t,
|
|
1385
1385
|
showBackButton: s,
|
|
1386
1386
|
onShowInfo: n,
|
|
1387
1387
|
canShowInfo: o,
|
|
1388
|
-
showStarButton:
|
|
1388
|
+
showStarButton: l = !1
|
|
1389
1389
|
}) => {
|
|
1390
|
-
var
|
|
1391
|
-
const { channel:
|
|
1390
|
+
var h, N, a, _, v;
|
|
1391
|
+
const { channel: d } = fe(), r = z.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1392
1392
|
(E) => {
|
|
1393
|
-
var
|
|
1394
|
-
return ((
|
|
1393
|
+
var S;
|
|
1394
|
+
return ((S = E.user) == null ? void 0 : S.id) && E.user.id !== d._client.userID;
|
|
1395
1395
|
}
|
|
1396
|
-
), [
|
|
1396
|
+
), [d._client.userID, d.state.members]), c = ((h = r == null ? void 0 : r.user) == null ? void 0 : h.name) || ((N = r == null ? void 0 : r.user) == null ? void 0 : N.id) || "Unknown member", x = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, u = gt(d), g = async () => {
|
|
1397
1397
|
try {
|
|
1398
|
-
|
|
1399
|
-
} catch (
|
|
1398
|
+
u ? await d.unpin() : await d.pin();
|
|
1399
|
+
} catch (p) {
|
|
1400
1400
|
console.error(
|
|
1401
1401
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1402
|
-
|
|
1402
|
+
p
|
|
1403
1403
|
);
|
|
1404
1404
|
}
|
|
1405
1405
|
};
|
|
1406
|
-
return /* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1406
|
+
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
1407
|
+
/* @__PURE__ */ i("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
1408
1408
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1409
1409
|
"button",
|
|
1410
1410
|
{
|
|
@@ -1413,38 +1413,38 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1413
1413
|
}),
|
|
1414
1414
|
type: "button",
|
|
1415
1415
|
"aria-label": "Back to conversations",
|
|
1416
|
-
children: /* @__PURE__ */ e(
|
|
1416
|
+
children: /* @__PURE__ */ e(Ke, { className: "size-5 text-black/90" })
|
|
1417
1417
|
}
|
|
1418
1418
|
) }),
|
|
1419
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1420
1420
|
/* @__PURE__ */ e(
|
|
1421
1421
|
oe,
|
|
1422
1422
|
{
|
|
1423
|
-
id: ((
|
|
1423
|
+
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) || d.id || "unknown",
|
|
1424
1424
|
name: c,
|
|
1425
|
-
image:
|
|
1426
|
-
starred:
|
|
1425
|
+
image: x,
|
|
1426
|
+
starred: l && u,
|
|
1427
1427
|
size: 40
|
|
1428
1428
|
}
|
|
1429
1429
|
),
|
|
1430
1430
|
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: c })
|
|
1431
1431
|
] }),
|
|
1432
|
-
/* @__PURE__ */
|
|
1433
|
-
|
|
1432
|
+
/* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1433
|
+
l && /* @__PURE__ */ e(
|
|
1434
1434
|
"button",
|
|
1435
1435
|
{
|
|
1436
1436
|
className: he,
|
|
1437
1437
|
onClick: g,
|
|
1438
1438
|
type: "button",
|
|
1439
|
-
"aria-label":
|
|
1439
|
+
"aria-label": u ? "Unstar conversation" : "Star conversation",
|
|
1440
1440
|
children: /* @__PURE__ */ e(
|
|
1441
1441
|
Be,
|
|
1442
1442
|
{
|
|
1443
|
-
className:
|
|
1444
|
-
"text-yellow-600":
|
|
1445
|
-
"text-black/90": !
|
|
1443
|
+
className: O("size-5", {
|
|
1444
|
+
"text-yellow-600": u,
|
|
1445
|
+
"text-black/90": !u
|
|
1446
1446
|
}),
|
|
1447
|
-
weight:
|
|
1447
|
+
weight: u ? "duotone" : "regular"
|
|
1448
1448
|
}
|
|
1449
1449
|
)
|
|
1450
1450
|
}
|
|
@@ -1456,13 +1456,13 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1456
1456
|
onClick: n,
|
|
1457
1457
|
type: "button",
|
|
1458
1458
|
"aria-label": "Show info",
|
|
1459
|
-
children: /* @__PURE__ */ e(
|
|
1459
|
+
children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
|
|
1460
1460
|
}
|
|
1461
1461
|
)
|
|
1462
1462
|
] })
|
|
1463
1463
|
] }),
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1465
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1466
1466
|
s && t && /* @__PURE__ */ e(
|
|
1467
1467
|
"button",
|
|
1468
1468
|
{
|
|
@@ -1470,37 +1470,37 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1470
1470
|
onClick: t,
|
|
1471
1471
|
className: he,
|
|
1472
1472
|
"aria-label": "Back to conversations",
|
|
1473
|
-
children: /* @__PURE__ */ e(
|
|
1473
|
+
children: /* @__PURE__ */ e(Ke, { className: "size-5 text-black/90" })
|
|
1474
1474
|
}
|
|
1475
1475
|
),
|
|
1476
1476
|
/* @__PURE__ */ e(
|
|
1477
1477
|
oe,
|
|
1478
1478
|
{
|
|
1479
|
-
id: ((
|
|
1479
|
+
id: ((v = r == null ? void 0 : r.user) == null ? void 0 : v.id) || d.id || "unknown",
|
|
1480
1480
|
name: c,
|
|
1481
|
-
image:
|
|
1482
|
-
starred:
|
|
1481
|
+
image: x,
|
|
1482
|
+
starred: l && u,
|
|
1483
1483
|
size: 40
|
|
1484
1484
|
}
|
|
1485
1485
|
),
|
|
1486
1486
|
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: c }) })
|
|
1487
1487
|
] }),
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
|
|
1488
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1489
|
+
l && /* @__PURE__ */ e(
|
|
1490
1490
|
"button",
|
|
1491
1491
|
{
|
|
1492
1492
|
className: he,
|
|
1493
1493
|
onClick: g,
|
|
1494
1494
|
type: "button",
|
|
1495
|
-
"aria-label":
|
|
1495
|
+
"aria-label": u ? "Unstar conversation" : "Star conversation",
|
|
1496
1496
|
children: /* @__PURE__ */ e(
|
|
1497
1497
|
Be,
|
|
1498
1498
|
{
|
|
1499
|
-
className:
|
|
1500
|
-
"text-yellow-600":
|
|
1501
|
-
"text-black/90": !
|
|
1499
|
+
className: O("size-5", {
|
|
1500
|
+
"text-yellow-600": u,
|
|
1501
|
+
"text-black/90": !u
|
|
1502
1502
|
}),
|
|
1503
|
-
weight:
|
|
1503
|
+
weight: u ? "duotone" : "regular"
|
|
1504
1504
|
}
|
|
1505
1505
|
)
|
|
1506
1506
|
}
|
|
@@ -1512,190 +1512,190 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1512
1512
|
onClick: n,
|
|
1513
1513
|
type: "button",
|
|
1514
1514
|
"aria-label": "Show info",
|
|
1515
|
-
children: /* @__PURE__ */ e(
|
|
1515
|
+
children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
|
|
1516
1516
|
}
|
|
1517
1517
|
)
|
|
1518
1518
|
] })
|
|
1519
1519
|
] })
|
|
1520
1520
|
] });
|
|
1521
|
-
},
|
|
1521
|
+
}, kn = ({
|
|
1522
1522
|
onBack: t,
|
|
1523
1523
|
showBackButton: s,
|
|
1524
1524
|
renderMessageInputActions: n,
|
|
1525
1525
|
renderConversationFooter: o,
|
|
1526
|
-
onLeaveConversation:
|
|
1527
|
-
onBlockParticipant:
|
|
1526
|
+
onLeaveConversation: l,
|
|
1527
|
+
onBlockParticipant: d,
|
|
1528
1528
|
showDeleteConversation: r = !0,
|
|
1529
1529
|
onDeleteConversationClick: c,
|
|
1530
|
-
onBlockParticipantClick:
|
|
1531
|
-
onReportParticipantClick:
|
|
1530
|
+
onBlockParticipantClick: x,
|
|
1531
|
+
onReportParticipantClick: u,
|
|
1532
1532
|
showStarButton: g = !1,
|
|
1533
|
-
chatbotVotingEnabled:
|
|
1533
|
+
chatbotVotingEnabled: h = !1,
|
|
1534
1534
|
renderChannelBanner: N,
|
|
1535
1535
|
customProfileContent: a,
|
|
1536
|
-
customChannelActions:
|
|
1537
|
-
renderMessage:
|
|
1536
|
+
customChannelActions: _,
|
|
1537
|
+
renderMessage: v
|
|
1538
1538
|
}) => {
|
|
1539
|
-
const { channel:
|
|
1540
|
-
(
|
|
1541
|
-
var
|
|
1542
|
-
return ((
|
|
1539
|
+
const { channel: p } = fe(), E = X(null), S = z.useMemo(() => Object.values(p.state.members || {}).find(
|
|
1540
|
+
(f) => {
|
|
1541
|
+
var T;
|
|
1542
|
+
return ((T = f.user) == null ? void 0 : T.id) && f.user.id !== p._client.userID;
|
|
1543
1543
|
}
|
|
1544
|
-
), [
|
|
1545
|
-
const
|
|
1546
|
-
if (
|
|
1547
|
-
return String(
|
|
1548
|
-
if (
|
|
1549
|
-
return
|
|
1550
|
-
}, [
|
|
1551
|
-
var
|
|
1552
|
-
(
|
|
1544
|
+
), [p._client.userID, p.state.members]), C = z.useMemo(() => {
|
|
1545
|
+
const m = p.data ?? {};
|
|
1546
|
+
if (m.followerStatus)
|
|
1547
|
+
return String(m.followerStatus);
|
|
1548
|
+
if (m.isFollower !== void 0)
|
|
1549
|
+
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1550
|
+
}, [p.data]), I = A(() => {
|
|
1551
|
+
var m;
|
|
1552
|
+
(m = E.current) == null || m.showModal();
|
|
1553
1553
|
}, []), P = A(() => {
|
|
1554
|
-
var
|
|
1555
|
-
(
|
|
1556
|
-
}, []),
|
|
1557
|
-
(
|
|
1558
|
-
const { message:
|
|
1559
|
-
|
|
1554
|
+
var m;
|
|
1555
|
+
(m = E.current) == null || m.close();
|
|
1556
|
+
}, []), w = A(
|
|
1557
|
+
(m) => {
|
|
1558
|
+
const { message: f } = dt("ChannelView"), T = /* @__PURE__ */ e(
|
|
1559
|
+
cn,
|
|
1560
1560
|
{
|
|
1561
|
-
...
|
|
1562
|
-
chatbotVotingEnabled:
|
|
1561
|
+
...m,
|
|
1562
|
+
chatbotVotingEnabled: h
|
|
1563
1563
|
}
|
|
1564
1564
|
);
|
|
1565
|
-
return !
|
|
1565
|
+
return !v || !f ? T : v(T, f);
|
|
1566
1566
|
},
|
|
1567
|
-
[
|
|
1567
|
+
[h, v]
|
|
1568
1568
|
);
|
|
1569
|
-
return /* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */ e(
|
|
1569
|
+
return /* @__PURE__ */ i(se, { children: [
|
|
1570
|
+
/* @__PURE__ */ e(is, { overrides: { Message: w }, children: /* @__PURE__ */ i(cs, { children: [
|
|
1571
1571
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1572
|
-
|
|
1572
|
+
In,
|
|
1573
1573
|
{
|
|
1574
1574
|
onBack: t,
|
|
1575
1575
|
showBackButton: s,
|
|
1576
|
-
onShowInfo:
|
|
1577
|
-
canShowInfo: !!
|
|
1576
|
+
onShowInfo: I,
|
|
1577
|
+
canShowInfo: !!S,
|
|
1578
1578
|
showStarButton: g
|
|
1579
1579
|
}
|
|
1580
1580
|
) }),
|
|
1581
1581
|
N == null ? void 0 : N(),
|
|
1582
1582
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1583
|
-
|
|
1583
|
+
ds,
|
|
1584
1584
|
{
|
|
1585
1585
|
hideDeletedMessages: !0,
|
|
1586
1586
|
hideNewMessageSeparator: !1,
|
|
1587
1587
|
messageActions: void 0
|
|
1588
1588
|
}
|
|
1589
1589
|
) }),
|
|
1590
|
-
o == null ? void 0 : o(
|
|
1590
|
+
o == null ? void 0 : o(p),
|
|
1591
1591
|
/* @__PURE__ */ e(
|
|
1592
|
-
|
|
1592
|
+
gn,
|
|
1593
1593
|
{
|
|
1594
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1594
|
+
renderActions: () => n == null ? void 0 : n(p)
|
|
1595
1595
|
}
|
|
1596
1596
|
)
|
|
1597
1597
|
] }) }),
|
|
1598
1598
|
/* @__PURE__ */ e(
|
|
1599
|
-
|
|
1599
|
+
Ys,
|
|
1600
1600
|
{
|
|
1601
1601
|
dialogRef: E,
|
|
1602
1602
|
onClose: P,
|
|
1603
|
-
participant:
|
|
1604
|
-
channel:
|
|
1605
|
-
followerStatusLabel:
|
|
1606
|
-
onLeaveConversation:
|
|
1607
|
-
onBlockParticipant:
|
|
1603
|
+
participant: S,
|
|
1604
|
+
channel: p,
|
|
1605
|
+
followerStatusLabel: C,
|
|
1606
|
+
onLeaveConversation: l,
|
|
1607
|
+
onBlockParticipant: d,
|
|
1608
1608
|
showDeleteConversation: r,
|
|
1609
1609
|
onDeleteConversationClick: c,
|
|
1610
|
-
onBlockParticipantClick:
|
|
1611
|
-
onReportParticipantClick:
|
|
1610
|
+
onBlockParticipantClick: x,
|
|
1611
|
+
onReportParticipantClick: u,
|
|
1612
1612
|
customProfileContent: a,
|
|
1613
|
-
customChannelActions:
|
|
1613
|
+
customChannelActions: _
|
|
1614
1614
|
}
|
|
1615
1615
|
)
|
|
1616
1616
|
] });
|
|
1617
|
-
},
|
|
1617
|
+
}, Ct = z.memo(
|
|
1618
1618
|
({
|
|
1619
1619
|
channel: t,
|
|
1620
1620
|
onBack: s,
|
|
1621
1621
|
showBackButton: n = !1,
|
|
1622
1622
|
renderMessageInputActions: o,
|
|
1623
|
-
renderConversationFooter:
|
|
1624
|
-
onLeaveConversation:
|
|
1623
|
+
renderConversationFooter: l,
|
|
1624
|
+
onLeaveConversation: d,
|
|
1625
1625
|
onBlockParticipant: r,
|
|
1626
1626
|
className: c,
|
|
1627
|
-
CustomChannelEmptyState:
|
|
1628
|
-
showDeleteConversation:
|
|
1627
|
+
CustomChannelEmptyState: x = En,
|
|
1628
|
+
showDeleteConversation: u = !0,
|
|
1629
1629
|
onDeleteConversationClick: g,
|
|
1630
|
-
onBlockParticipantClick:
|
|
1630
|
+
onBlockParticipantClick: h,
|
|
1631
1631
|
onReportParticipantClick: N,
|
|
1632
1632
|
dmAgentEnabled: a,
|
|
1633
|
-
messageMetadata:
|
|
1634
|
-
onMessageSent:
|
|
1635
|
-
showStarButton:
|
|
1633
|
+
messageMetadata: _,
|
|
1634
|
+
onMessageSent: v,
|
|
1635
|
+
showStarButton: p = !1,
|
|
1636
1636
|
chatbotVotingEnabled: E = !1,
|
|
1637
|
-
renderChannelBanner:
|
|
1638
|
-
customProfileContent:
|
|
1639
|
-
customChannelActions:
|
|
1637
|
+
renderChannelBanner: S,
|
|
1638
|
+
customProfileContent: C,
|
|
1639
|
+
customChannelActions: I,
|
|
1640
1640
|
renderMessage: P,
|
|
1641
|
-
sendButton:
|
|
1641
|
+
sendButton: w
|
|
1642
1642
|
}) => {
|
|
1643
|
-
const
|
|
1644
|
-
async (
|
|
1645
|
-
var
|
|
1646
|
-
const L = ((
|
|
1647
|
-
...
|
|
1648
|
-
...
|
|
1649
|
-
...
|
|
1643
|
+
const m = A(
|
|
1644
|
+
async (f, T, M) => {
|
|
1645
|
+
var V;
|
|
1646
|
+
const L = ((V = t.data) == null ? void 0 : V.chatbot_paused) === !0, R = a && !L, B = {
|
|
1647
|
+
...T,
|
|
1648
|
+
...R && { silent: !0 },
|
|
1649
|
+
..._ && {
|
|
1650
1650
|
metadata: {
|
|
1651
|
-
...
|
|
1652
|
-
...
|
|
1651
|
+
...T.metadata ?? {},
|
|
1652
|
+
..._
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
}, ee = {
|
|
1656
|
-
...
|
|
1657
|
-
...
|
|
1658
|
-
},
|
|
1659
|
-
return
|
|
1656
|
+
...M,
|
|
1657
|
+
...R && { skip_push: !0 }
|
|
1658
|
+
}, J = await t.sendMessage(B, ee);
|
|
1659
|
+
return v == null || v(J), J;
|
|
1660
1660
|
},
|
|
1661
|
-
[t, a,
|
|
1661
|
+
[t, a, _, v]
|
|
1662
1662
|
);
|
|
1663
1663
|
return /* @__PURE__ */ e(
|
|
1664
1664
|
"div",
|
|
1665
1665
|
{
|
|
1666
|
-
className:
|
|
1666
|
+
className: O(
|
|
1667
1667
|
"messaging-channel-view h-full flex flex-col",
|
|
1668
1668
|
c
|
|
1669
1669
|
),
|
|
1670
1670
|
children: /* @__PURE__ */ e(
|
|
1671
|
-
|
|
1671
|
+
ls,
|
|
1672
1672
|
{
|
|
1673
1673
|
channel: t,
|
|
1674
|
-
MessageSystem:
|
|
1675
|
-
EmptyStateIndicator:
|
|
1676
|
-
LoadingIndicator:
|
|
1677
|
-
DateSeparator:
|
|
1678
|
-
doSendMessageRequest:
|
|
1679
|
-
...
|
|
1674
|
+
MessageSystem: _n,
|
|
1675
|
+
EmptyStateIndicator: x,
|
|
1676
|
+
LoadingIndicator: De,
|
|
1677
|
+
DateSeparator: Ws,
|
|
1678
|
+
doSendMessageRequest: m,
|
|
1679
|
+
...w ? { SendButton: w } : {},
|
|
1680
1680
|
children: /* @__PURE__ */ e(
|
|
1681
|
-
|
|
1681
|
+
kn,
|
|
1682
1682
|
{
|
|
1683
1683
|
onBack: s,
|
|
1684
1684
|
showBackButton: n,
|
|
1685
1685
|
renderMessageInputActions: o,
|
|
1686
|
-
renderConversationFooter:
|
|
1687
|
-
onLeaveConversation:
|
|
1686
|
+
renderConversationFooter: l,
|
|
1687
|
+
onLeaveConversation: d,
|
|
1688
1688
|
onBlockParticipant: r,
|
|
1689
|
-
CustomChannelEmptyState:
|
|
1690
|
-
showDeleteConversation:
|
|
1689
|
+
CustomChannelEmptyState: x,
|
|
1690
|
+
showDeleteConversation: u,
|
|
1691
1691
|
onDeleteConversationClick: g,
|
|
1692
|
-
onBlockParticipantClick:
|
|
1692
|
+
onBlockParticipantClick: h,
|
|
1693
1693
|
onReportParticipantClick: N,
|
|
1694
|
-
showStarButton:
|
|
1694
|
+
showStarButton: p,
|
|
1695
1695
|
chatbotVotingEnabled: E,
|
|
1696
|
-
renderChannelBanner:
|
|
1697
|
-
customProfileContent:
|
|
1698
|
-
customChannelActions:
|
|
1696
|
+
renderChannelBanner: S,
|
|
1697
|
+
customProfileContent: C,
|
|
1698
|
+
customChannelActions: I,
|
|
1699
1699
|
renderMessage: P
|
|
1700
1700
|
}
|
|
1701
1701
|
)
|
|
@@ -1705,16 +1705,16 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1705
1705
|
);
|
|
1706
1706
|
}
|
|
1707
1707
|
);
|
|
1708
|
-
|
|
1709
|
-
function
|
|
1708
|
+
Ct.displayName = "ChannelView";
|
|
1709
|
+
function Tn({
|
|
1710
1710
|
searchQuery: t,
|
|
1711
1711
|
setSearchQuery: s,
|
|
1712
1712
|
placeholder: n
|
|
1713
1713
|
}) {
|
|
1714
|
-
const o =
|
|
1715
|
-
return /* @__PURE__ */
|
|
1714
|
+
const o = X(null);
|
|
1715
|
+
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1716
1716
|
/* @__PURE__ */ e(
|
|
1717
|
-
|
|
1717
|
+
ps,
|
|
1718
1718
|
{
|
|
1719
1719
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1720
1720
|
weight: "bold"
|
|
@@ -1727,164 +1727,164 @@ function Cn({
|
|
|
1727
1727
|
type: "text",
|
|
1728
1728
|
placeholder: n,
|
|
1729
1729
|
value: t,
|
|
1730
|
-
onChange: (
|
|
1730
|
+
onChange: (l) => s(l.target.value),
|
|
1731
1731
|
className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
|
|
1732
1732
|
}
|
|
1733
1733
|
),
|
|
1734
1734
|
t && /* @__PURE__ */ e(
|
|
1735
|
-
|
|
1735
|
+
wt,
|
|
1736
1736
|
{
|
|
1737
1737
|
label: "Clear search",
|
|
1738
1738
|
onClick: () => {
|
|
1739
|
-
var
|
|
1740
|
-
s(""), (
|
|
1739
|
+
var l;
|
|
1740
|
+
s(""), (l = o.current) == null || l.focus();
|
|
1741
1741
|
},
|
|
1742
1742
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1743
|
-
children: /* @__PURE__ */ e(
|
|
1743
|
+
children: /* @__PURE__ */ e(Re, { className: "h-4 w-4", weight: "bold" })
|
|
1744
1744
|
}
|
|
1745
1745
|
)
|
|
1746
1746
|
] });
|
|
1747
1747
|
}
|
|
1748
|
-
const
|
|
1748
|
+
const Mn = ({
|
|
1749
1749
|
participantSource: t,
|
|
1750
1750
|
onSelectParticipant: s,
|
|
1751
1751
|
onClose: n,
|
|
1752
1752
|
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1753
|
-
participantLabel:
|
|
1754
|
-
searchPlaceholder:
|
|
1753
|
+
participantLabel: l = "participants",
|
|
1754
|
+
searchPlaceholder: d = "Search participants...",
|
|
1755
1755
|
className: r
|
|
1756
1756
|
}) => {
|
|
1757
|
-
const { debug: c } =
|
|
1757
|
+
const { debug: c } = Le(), [x, u] = k(""), [g, h] = k([]), [N, a] = k(!1), [_, v] = k(null), [p, E] = k(
|
|
1758
1758
|
null
|
|
1759
|
-
),
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}, [t]),
|
|
1759
|
+
), S = X(!1);
|
|
1760
|
+
q(() => {
|
|
1761
|
+
S.current = !1;
|
|
1762
|
+
}, [t]), q(() => {
|
|
1763
1763
|
if (t.loading) {
|
|
1764
1764
|
c && console.log(
|
|
1765
1765
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1766
1766
|
);
|
|
1767
1767
|
return;
|
|
1768
1768
|
}
|
|
1769
|
-
if (
|
|
1769
|
+
if (S.current) return;
|
|
1770
1770
|
(async () => {
|
|
1771
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0),
|
|
1771
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), v(null);
|
|
1772
1772
|
try {
|
|
1773
|
-
const
|
|
1773
|
+
const m = await t.loadParticipants({
|
|
1774
1774
|
search: "",
|
|
1775
1775
|
// Load all participants initially
|
|
1776
1776
|
limit: 100
|
|
1777
1777
|
});
|
|
1778
|
-
|
|
1778
|
+
h(m.participants), S.current = !0, c && console.log(
|
|
1779
1779
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1780
|
-
|
|
1780
|
+
m.participants.length
|
|
1781
1781
|
);
|
|
1782
|
-
} catch (
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1782
|
+
} catch (m) {
|
|
1783
|
+
const f = m instanceof Error ? m.message : "Failed to load participants";
|
|
1784
|
+
v(f), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1785
1785
|
} finally {
|
|
1786
1786
|
a(!1);
|
|
1787
1787
|
}
|
|
1788
1788
|
})();
|
|
1789
1789
|
}, [t, c]);
|
|
1790
|
-
const
|
|
1791
|
-
var
|
|
1792
|
-
if (!
|
|
1793
|
-
const
|
|
1794
|
-
return
|
|
1795
|
-
}),
|
|
1796
|
-
async (
|
|
1797
|
-
if (!
|
|
1798
|
-
E(
|
|
1790
|
+
const C = g.filter((w) => !o.has(w.id)).filter((w) => {
|
|
1791
|
+
var f;
|
|
1792
|
+
if (!x) return !0;
|
|
1793
|
+
const m = x.toLowerCase();
|
|
1794
|
+
return w.name.toLowerCase().includes(m) || ((f = w.email) == null ? void 0 : f.toLowerCase().includes(m)) || !1;
|
|
1795
|
+
}), I = A(
|
|
1796
|
+
async (w) => {
|
|
1797
|
+
if (!p) {
|
|
1798
|
+
E(w.id);
|
|
1799
1799
|
try {
|
|
1800
|
-
await s(
|
|
1801
|
-
} catch (
|
|
1802
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1800
|
+
await s(w);
|
|
1801
|
+
} catch (m) {
|
|
1802
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), E(null);
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
},
|
|
1806
|
-
[s,
|
|
1807
|
-
), P = (
|
|
1808
|
-
(
|
|
1806
|
+
[s, p]
|
|
1807
|
+
), P = (w, m) => {
|
|
1808
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), I(m));
|
|
1809
1809
|
};
|
|
1810
|
-
return /* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ i("div", { className: O("flex flex-col h-full", r), children: [
|
|
1811
|
+
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1812
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1813
1813
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1814
|
-
/* @__PURE__ */ e(
|
|
1814
|
+
/* @__PURE__ */ e(vt, { onClick: n })
|
|
1815
1815
|
] }),
|
|
1816
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1817
1817
|
"Select a ",
|
|
1818
|
-
|
|
1818
|
+
l.slice(0, -1),
|
|
1819
1819
|
" to start messaging (",
|
|
1820
|
-
|
|
1820
|
+
C.length,
|
|
1821
1821
|
" available)",
|
|
1822
|
-
t.totalCount !== void 0 && ` • ${t.totalCount} ${
|
|
1822
|
+
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1823
1823
|
] }),
|
|
1824
1824
|
/* @__PURE__ */ e(
|
|
1825
|
-
|
|
1825
|
+
Tn,
|
|
1826
1826
|
{
|
|
1827
|
-
searchQuery:
|
|
1828
|
-
setSearchQuery:
|
|
1829
|
-
placeholder:
|
|
1827
|
+
searchQuery: x,
|
|
1828
|
+
setSearchQuery: u,
|
|
1829
|
+
placeholder: d
|
|
1830
1830
|
}
|
|
1831
1831
|
)
|
|
1832
1832
|
] }),
|
|
1833
|
-
|
|
1833
|
+
_ && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1834
1834
|
"Error loading ",
|
|
1835
|
-
|
|
1835
|
+
l,
|
|
1836
1836
|
": ",
|
|
1837
|
-
|
|
1837
|
+
_
|
|
1838
1838
|
] }),
|
|
1839
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N &&
|
|
1839
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1840
1840
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1841
|
-
/* @__PURE__ */
|
|
1841
|
+
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1842
1842
|
"Loading ",
|
|
1843
|
-
|
|
1843
|
+
l,
|
|
1844
1844
|
"..."
|
|
1845
1845
|
] })
|
|
1846
|
-
] }) }) :
|
|
1847
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1848
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1849
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1850
|
-
] }) : /* @__PURE__ */
|
|
1851
|
-
|
|
1852
|
-
const
|
|
1846
|
+
] }) }) : C.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1847
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Qe, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1848
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : g.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1849
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : g.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1850
|
+
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1851
|
+
C.map((w) => {
|
|
1852
|
+
const m = w.name || w.email || w.id, f = w.email && w.name ? w.email : w.phone;
|
|
1853
1853
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1854
1854
|
"button",
|
|
1855
1855
|
{
|
|
1856
1856
|
type: "button",
|
|
1857
|
-
onClick: () =>
|
|
1858
|
-
onKeyDown: (
|
|
1857
|
+
onClick: () => I(w),
|
|
1858
|
+
onKeyDown: (T) => P(T, w),
|
|
1859
1859
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1860
|
-
children: /* @__PURE__ */
|
|
1861
|
-
/* @__PURE__ */
|
|
1860
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1861
|
+
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1862
1862
|
/* @__PURE__ */ e(
|
|
1863
1863
|
oe,
|
|
1864
1864
|
{
|
|
1865
|
-
id:
|
|
1866
|
-
name:
|
|
1867
|
-
image:
|
|
1865
|
+
id: w.id,
|
|
1866
|
+
name: m,
|
|
1867
|
+
image: w.image,
|
|
1868
1868
|
size: 40
|
|
1869
1869
|
}
|
|
1870
1870
|
),
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1873
|
-
|
|
1871
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1872
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1873
|
+
f && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: f })
|
|
1874
1874
|
] })
|
|
1875
1875
|
] }),
|
|
1876
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1876
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: p === w.id ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Qe, { className: "h-5 w-5 text-stone" }) })
|
|
1877
1877
|
] })
|
|
1878
1878
|
}
|
|
1879
|
-
) },
|
|
1879
|
+
) }, w.id);
|
|
1880
1880
|
}),
|
|
1881
|
-
N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */
|
|
1881
|
+
N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1882
1882
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1883
1883
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1884
1884
|
] }) })
|
|
1885
1885
|
] }) })
|
|
1886
1886
|
] });
|
|
1887
|
-
},
|
|
1887
|
+
}, Dn = ({ className: t }) => /* @__PURE__ */ i(
|
|
1888
1888
|
"svg",
|
|
1889
1889
|
{
|
|
1890
1890
|
width: "140",
|
|
@@ -1894,7 +1894,7 @@ const _n = ({
|
|
|
1894
1894
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1895
1895
|
className: t,
|
|
1896
1896
|
children: [
|
|
1897
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1898
1898
|
/* @__PURE__ */ e(
|
|
1899
1899
|
"path",
|
|
1900
1900
|
{
|
|
@@ -1923,7 +1923,7 @@ const _n = ({
|
|
|
1923
1923
|
fill: "white"
|
|
1924
1924
|
}
|
|
1925
1925
|
),
|
|
1926
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1927
1927
|
/* @__PURE__ */ e(
|
|
1928
1928
|
"path",
|
|
1929
1929
|
{
|
|
@@ -1963,8 +1963,8 @@ const _n = ({
|
|
|
1963
1963
|
}
|
|
1964
1964
|
)
|
|
1965
1965
|
] }),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ i("defs", { children: [
|
|
1967
|
+
/* @__PURE__ */ i(
|
|
1968
1968
|
"filter",
|
|
1969
1969
|
{
|
|
1970
1970
|
id: "filter0_empty_state",
|
|
@@ -2018,17 +2018,17 @@ const _n = ({
|
|
|
2018
2018
|
] })
|
|
2019
2019
|
]
|
|
2020
2020
|
}
|
|
2021
|
-
),
|
|
2022
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */ e(
|
|
2024
|
-
s && !t && /* @__PURE__ */
|
|
2021
|
+
), _t = z.memo(
|
|
2022
|
+
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2023
|
+
/* @__PURE__ */ e(Dn, {}),
|
|
2024
|
+
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
2025
2025
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2026
2026
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2027
2027
|
] })
|
|
2028
2028
|
] }) })
|
|
2029
2029
|
);
|
|
2030
|
-
|
|
2031
|
-
const
|
|
2030
|
+
_t.displayName = "EmptyState";
|
|
2031
|
+
const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
2032
2032
|
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2033
2033
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2034
2034
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -2042,105 +2042,105 @@ const ke = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
2042
2042
|
}
|
|
2043
2043
|
)
|
|
2044
2044
|
] }) }));
|
|
2045
|
-
|
|
2046
|
-
const
|
|
2045
|
+
Te.displayName = "ErrorState";
|
|
2046
|
+
const na = ({
|
|
2047
2047
|
capabilities: t = {},
|
|
2048
2048
|
className: s,
|
|
2049
2049
|
renderMessageInputActions: n,
|
|
2050
2050
|
renderConversationFooter: o,
|
|
2051
|
-
onChannelSelect:
|
|
2052
|
-
onParticipantSelect:
|
|
2051
|
+
onChannelSelect: l,
|
|
2052
|
+
onParticipantSelect: d,
|
|
2053
2053
|
initialParticipantFilter: r,
|
|
2054
2054
|
initialParticipantData: c,
|
|
2055
|
-
CustomChannelEmptyState:
|
|
2056
|
-
showChannelList:
|
|
2055
|
+
CustomChannelEmptyState: x,
|
|
2056
|
+
showChannelList: u = !0,
|
|
2057
2057
|
filters: g,
|
|
2058
|
-
channelRenderFilterFn:
|
|
2058
|
+
channelRenderFilterFn: h,
|
|
2059
2059
|
channelListCustomEmptyStateIndicator: N,
|
|
2060
2060
|
onDeleteConversationClick: a,
|
|
2061
|
-
onBlockParticipantClick:
|
|
2062
|
-
onReportParticipantClick:
|
|
2063
|
-
dmAgentEnabled:
|
|
2061
|
+
onBlockParticipantClick: _,
|
|
2062
|
+
onReportParticipantClick: v,
|
|
2063
|
+
dmAgentEnabled: p,
|
|
2064
2064
|
messageMetadata: E,
|
|
2065
|
-
onMessageSent:
|
|
2066
|
-
showStarButton:
|
|
2067
|
-
chatbotVotingEnabled:
|
|
2065
|
+
onMessageSent: S,
|
|
2066
|
+
showStarButton: C = !1,
|
|
2067
|
+
chatbotVotingEnabled: I = !1,
|
|
2068
2068
|
renderMessagePreview: P,
|
|
2069
|
-
renderChannelBanner:
|
|
2070
|
-
customProfileContent:
|
|
2071
|
-
customChannelActions:
|
|
2072
|
-
renderMessage:
|
|
2073
|
-
sendButton:
|
|
2069
|
+
renderChannelBanner: w,
|
|
2070
|
+
customProfileContent: m,
|
|
2071
|
+
customChannelActions: f,
|
|
2072
|
+
renderMessage: T,
|
|
2073
|
+
sendButton: M
|
|
2074
2074
|
}) => {
|
|
2075
2075
|
const {
|
|
2076
2076
|
service: L,
|
|
2077
|
-
client:
|
|
2078
|
-
isConnected:
|
|
2077
|
+
client: R,
|
|
2078
|
+
isConnected: B,
|
|
2079
2079
|
isLoading: ee,
|
|
2080
|
-
error:
|
|
2081
|
-
refreshConnection:
|
|
2080
|
+
error: J,
|
|
2081
|
+
refreshConnection: V,
|
|
2082
2082
|
debug: F
|
|
2083
|
-
} =
|
|
2084
|
-
participantSource:
|
|
2085
|
-
participantLabel:
|
|
2083
|
+
} = Rs(), [H, Z] = k(null), [ae, K] = k(!1), [b, y] = k(!1), [U, j] = k(!1), [te, le] = k(/* @__PURE__ */ new Set()), [pe, Pe] = k(0), [Y, Q] = k(!1), [xe, re] = k(null), me = X(null), {
|
|
2084
|
+
participantSource: ie,
|
|
2085
|
+
participantLabel: we = "participants",
|
|
2086
2086
|
showDeleteConversation: ge = !0
|
|
2087
2087
|
} = t, ve = z.useMemo(() => {
|
|
2088
|
-
const
|
|
2088
|
+
const D = R == null ? void 0 : R.userID;
|
|
2089
2089
|
return {
|
|
2090
2090
|
...{
|
|
2091
2091
|
type: "messaging",
|
|
2092
2092
|
last_message_at: { $exists: !0 },
|
|
2093
|
-
...
|
|
2094
|
-
members: { $in: [
|
|
2093
|
+
...D && {
|
|
2094
|
+
members: { $in: [D] },
|
|
2095
2095
|
hidden: !1
|
|
2096
2096
|
}
|
|
2097
2097
|
},
|
|
2098
2098
|
...g
|
|
2099
2099
|
};
|
|
2100
|
-
}, [g,
|
|
2101
|
-
if (!
|
|
2102
|
-
const
|
|
2103
|
-
if (
|
|
2100
|
+
}, [g, R == null ? void 0 : R.userID]), ce = X(null), ne = A(async () => {
|
|
2101
|
+
if (!R || !B) return;
|
|
2102
|
+
const D = R.userID;
|
|
2103
|
+
if (D)
|
|
2104
2104
|
try {
|
|
2105
|
-
F && console.log("[MessagingShell] Syncing channels for user:",
|
|
2106
|
-
const W = await
|
|
2105
|
+
F && console.log("[MessagingShell] Syncing channels for user:", D);
|
|
2106
|
+
const W = await R.queryChannels(
|
|
2107
2107
|
{
|
|
2108
2108
|
type: "messaging",
|
|
2109
|
-
members: { $in: [
|
|
2109
|
+
members: { $in: [D] }
|
|
2110
2110
|
},
|
|
2111
2111
|
{},
|
|
2112
2112
|
{ limit: 100 }
|
|
2113
|
-
),
|
|
2114
|
-
W.forEach((
|
|
2115
|
-
const
|
|
2116
|
-
Object.values(
|
|
2117
|
-
var
|
|
2118
|
-
const
|
|
2119
|
-
|
|
2113
|
+
), $ = /* @__PURE__ */ new Set();
|
|
2114
|
+
W.forEach((G) => {
|
|
2115
|
+
const Fe = G.state.members;
|
|
2116
|
+
Object.values(Fe).forEach((kt) => {
|
|
2117
|
+
var qe;
|
|
2118
|
+
const Ae = (qe = kt.user) == null ? void 0 : qe.id;
|
|
2119
|
+
Ae && Ae !== D && $.add(Ae);
|
|
2120
2120
|
});
|
|
2121
|
-
}),
|
|
2121
|
+
}), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0), y(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2122
2122
|
channelCount: W.length,
|
|
2123
|
-
memberCount:
|
|
2123
|
+
memberCount: $.size
|
|
2124
2124
|
});
|
|
2125
2125
|
} catch (W) {
|
|
2126
2126
|
console.error("[MessagingShell] Failed to sync channels:", W);
|
|
2127
2127
|
}
|
|
2128
|
-
}, [
|
|
2129
|
-
|
|
2130
|
-
if (!
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2133
|
-
}, [
|
|
2134
|
-
if (!r || !
|
|
2128
|
+
}, [R, B, F]);
|
|
2129
|
+
q(() => {
|
|
2130
|
+
if (!R || !B) return;
|
|
2131
|
+
const D = R.userID;
|
|
2132
|
+
D && ce.current !== D && ne();
|
|
2133
|
+
}, [R, B, ne]), q(() => {
|
|
2134
|
+
if (!r || !R || !B) return;
|
|
2135
2135
|
(async () => {
|
|
2136
|
-
const W =
|
|
2136
|
+
const W = R.userID;
|
|
2137
2137
|
if (W)
|
|
2138
2138
|
try {
|
|
2139
2139
|
F && console.log(
|
|
2140
2140
|
"[MessagingShell] Loading initial conversation with:",
|
|
2141
2141
|
r
|
|
2142
2142
|
);
|
|
2143
|
-
const
|
|
2143
|
+
const $ = await R.queryChannels(
|
|
2144
2144
|
{
|
|
2145
2145
|
type: "messaging",
|
|
2146
2146
|
members: { $eq: [W, r] }
|
|
@@ -2148,10 +2148,10 @@ const Vn = ({
|
|
|
2148
2148
|
{},
|
|
2149
2149
|
{ limit: 1 }
|
|
2150
2150
|
);
|
|
2151
|
-
if (
|
|
2152
|
-
Z(
|
|
2151
|
+
if ($.length > 0)
|
|
2152
|
+
Z($[0]), Q(!0), re(null), l && l($[0]), F && console.log(
|
|
2153
2153
|
"[MessagingShell] Initial conversation loaded:",
|
|
2154
|
-
|
|
2154
|
+
$[0].id
|
|
2155
2155
|
);
|
|
2156
2156
|
else if (c && L) {
|
|
2157
2157
|
F && console.log(
|
|
@@ -2159,132 +2159,132 @@ const Vn = ({
|
|
|
2159
2159
|
c
|
|
2160
2160
|
);
|
|
2161
2161
|
try {
|
|
2162
|
-
const
|
|
2162
|
+
const G = await L.startChannelWithParticipant({
|
|
2163
2163
|
id: c.id,
|
|
2164
2164
|
name: c.name,
|
|
2165
2165
|
email: c.email,
|
|
2166
2166
|
phone: c.phone
|
|
2167
2167
|
});
|
|
2168
|
-
Z(
|
|
2168
|
+
Z(G), Q(!0), re(null), l && l(G), F && console.log(
|
|
2169
2169
|
"[MessagingShell] Channel created and loaded:",
|
|
2170
|
-
|
|
2170
|
+
G.id
|
|
2171
2171
|
);
|
|
2172
|
-
} catch (
|
|
2172
|
+
} catch (G) {
|
|
2173
2173
|
console.error(
|
|
2174
2174
|
"[MessagingShell] Failed to create conversation:",
|
|
2175
|
-
|
|
2176
|
-
),
|
|
2175
|
+
G
|
|
2176
|
+
), re("Failed to create conversation");
|
|
2177
2177
|
}
|
|
2178
2178
|
} else
|
|
2179
|
-
|
|
2179
|
+
re(
|
|
2180
2180
|
"No conversation found with this account"
|
|
2181
2181
|
), F && console.log(
|
|
2182
2182
|
"[MessagingShell] No conversation found for:",
|
|
2183
2183
|
r
|
|
2184
2184
|
);
|
|
2185
|
-
} catch (
|
|
2185
|
+
} catch ($) {
|
|
2186
2186
|
console.error(
|
|
2187
2187
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2188
|
-
|
|
2189
|
-
),
|
|
2188
|
+
$
|
|
2189
|
+
), re("Failed to load conversation");
|
|
2190
2190
|
}
|
|
2191
2191
|
})();
|
|
2192
2192
|
}, [
|
|
2193
2193
|
r,
|
|
2194
2194
|
c,
|
|
2195
|
-
|
|
2196
|
-
|
|
2195
|
+
R,
|
|
2196
|
+
B,
|
|
2197
2197
|
L,
|
|
2198
2198
|
F,
|
|
2199
|
-
|
|
2199
|
+
l
|
|
2200
2200
|
]);
|
|
2201
|
-
const
|
|
2202
|
-
(
|
|
2203
|
-
Z(
|
|
2201
|
+
const Ne = A(
|
|
2202
|
+
(D) => {
|
|
2203
|
+
Z(D), l == null || l(D);
|
|
2204
2204
|
},
|
|
2205
|
-
[
|
|
2206
|
-
),
|
|
2205
|
+
[l]
|
|
2206
|
+
), ye = A(() => {
|
|
2207
2207
|
Y || Z(null);
|
|
2208
|
-
}, [Y]),
|
|
2209
|
-
async (
|
|
2208
|
+
}, [Y]), Ce = A(
|
|
2209
|
+
async (D) => {
|
|
2210
2210
|
var W;
|
|
2211
2211
|
if (L)
|
|
2212
2212
|
try {
|
|
2213
2213
|
F && console.log(
|
|
2214
2214
|
"[MessagingShell] Starting conversation with:",
|
|
2215
|
-
|
|
2215
|
+
D.id
|
|
2216
2216
|
);
|
|
2217
|
-
const
|
|
2218
|
-
id:
|
|
2219
|
-
name:
|
|
2220
|
-
email:
|
|
2221
|
-
phone:
|
|
2217
|
+
const $ = await L.startChannelWithParticipant({
|
|
2218
|
+
id: D.id,
|
|
2219
|
+
name: D.name,
|
|
2220
|
+
email: D.email,
|
|
2221
|
+
phone: D.phone
|
|
2222
2222
|
});
|
|
2223
2223
|
try {
|
|
2224
|
-
await
|
|
2225
|
-
} catch (
|
|
2226
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
2224
|
+
await $.show();
|
|
2225
|
+
} catch (G) {
|
|
2226
|
+
console.warn("[MessagingShell] Failed to unhide channel:", G);
|
|
2227
2227
|
}
|
|
2228
|
-
Z(
|
|
2229
|
-
} catch (
|
|
2230
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2228
|
+
Z($), j(!1), (W = me.current) == null || W.close(), d == null || d(D);
|
|
2229
|
+
} catch ($) {
|
|
2230
|
+
console.error("[MessagingShell] Failed to start conversation:", $);
|
|
2231
2231
|
}
|
|
2232
2232
|
},
|
|
2233
|
-
[L,
|
|
2233
|
+
[L, d, F]
|
|
2234
2234
|
), de = A(() => {
|
|
2235
|
-
var
|
|
2236
|
-
j(!1), (
|
|
2237
|
-
}, []),
|
|
2238
|
-
(
|
|
2239
|
-
|
|
2235
|
+
var D;
|
|
2236
|
+
j(!1), (D = me.current) == null || D.close();
|
|
2237
|
+
}, []), _e = A(
|
|
2238
|
+
(D) => {
|
|
2239
|
+
D.target === me.current && de();
|
|
2240
2240
|
},
|
|
2241
2241
|
[de]
|
|
2242
|
-
),
|
|
2243
|
-
async (
|
|
2244
|
-
F && console.log("[MessagingShell] Leaving conversation:",
|
|
2242
|
+
), Ee = A(
|
|
2243
|
+
async (D) => {
|
|
2244
|
+
F && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), Q(!1), ce.current = null, await ne();
|
|
2245
2245
|
},
|
|
2246
2246
|
[ne, F]
|
|
2247
|
-
),
|
|
2248
|
-
async (
|
|
2249
|
-
F && console.log("[MessagingShell] Blocking participant:",
|
|
2247
|
+
), Se = A(
|
|
2248
|
+
async (D) => {
|
|
2249
|
+
F && console.log("[MessagingShell] Blocking participant:", D), Z(null), Q(!1), ce.current = null, await ne();
|
|
2250
2250
|
},
|
|
2251
2251
|
[ne, F]
|
|
2252
|
-
), ue = !!
|
|
2253
|
-
return ee ? /* @__PURE__ */ e("div", { className:
|
|
2254
|
-
|
|
2252
|
+
), ue = !!H;
|
|
2253
|
+
return ee ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : J ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: J, onBack: V }) }) : !B || !R ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(
|
|
2254
|
+
Te,
|
|
2255
2255
|
{
|
|
2256
2256
|
message: "Not connected to messaging service",
|
|
2257
|
-
onBack:
|
|
2257
|
+
onBack: V
|
|
2258
2258
|
}
|
|
2259
|
-
) }) : xe ? /* @__PURE__ */ e("div", { className:
|
|
2259
|
+
) }) : xe ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */ i(
|
|
2260
2260
|
"div",
|
|
2261
2261
|
{
|
|
2262
|
-
className:
|
|
2262
|
+
className: O(
|
|
2263
2263
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2264
2264
|
s
|
|
2265
2265
|
),
|
|
2266
2266
|
children: [
|
|
2267
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
2268
2268
|
/* @__PURE__ */ e(
|
|
2269
2269
|
"div",
|
|
2270
2270
|
{
|
|
2271
|
-
className:
|
|
2271
|
+
className: O(
|
|
2272
2272
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2273
2273
|
{
|
|
2274
|
-
"!hidden":
|
|
2274
|
+
"!hidden": u === !1 || Y,
|
|
2275
2275
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2276
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2276
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !Y && ue,
|
|
2277
2277
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2278
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2278
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !Y && !ue
|
|
2279
2279
|
}
|
|
2280
2280
|
),
|
|
2281
2281
|
children: /* @__PURE__ */ e(
|
|
2282
|
-
|
|
2282
|
+
xt,
|
|
2283
2283
|
{
|
|
2284
|
-
onChannelSelect:
|
|
2285
|
-
selectedChannel:
|
|
2284
|
+
onChannelSelect: Ne,
|
|
2285
|
+
selectedChannel: H || void 0,
|
|
2286
2286
|
filters: ve,
|
|
2287
|
-
channelRenderFilterFn:
|
|
2287
|
+
channelRenderFilterFn: h,
|
|
2288
2288
|
customEmptyStateIndicator: N,
|
|
2289
2289
|
renderMessagePreview: P
|
|
2290
2290
|
}
|
|
@@ -2294,7 +2294,7 @@ const Vn = ({
|
|
|
2294
2294
|
/* @__PURE__ */ e(
|
|
2295
2295
|
"div",
|
|
2296
2296
|
{
|
|
2297
|
-
className:
|
|
2297
|
+
className: O(
|
|
2298
2298
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2299
2299
|
{
|
|
2300
2300
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
@@ -2303,72 +2303,72 @@ const Vn = ({
|
|
|
2303
2303
|
"hidden lg:flex": !Y && !ue && !r
|
|
2304
2304
|
}
|
|
2305
2305
|
),
|
|
2306
|
-
children:
|
|
2307
|
-
|
|
2306
|
+
children: H ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2307
|
+
Ct,
|
|
2308
2308
|
{
|
|
2309
|
-
channel:
|
|
2310
|
-
onBack:
|
|
2309
|
+
channel: H,
|
|
2310
|
+
onBack: ye,
|
|
2311
2311
|
showBackButton: !Y,
|
|
2312
2312
|
renderMessageInputActions: n,
|
|
2313
2313
|
renderConversationFooter: o,
|
|
2314
|
-
renderChannelBanner:
|
|
2315
|
-
onLeaveConversation:
|
|
2316
|
-
onBlockParticipant:
|
|
2317
|
-
CustomChannelEmptyState:
|
|
2314
|
+
renderChannelBanner: w,
|
|
2315
|
+
onLeaveConversation: Ee,
|
|
2316
|
+
onBlockParticipant: Se,
|
|
2317
|
+
CustomChannelEmptyState: x,
|
|
2318
2318
|
showDeleteConversation: ge,
|
|
2319
2319
|
onDeleteConversationClick: a,
|
|
2320
|
-
onBlockParticipantClick:
|
|
2321
|
-
onReportParticipantClick:
|
|
2322
|
-
dmAgentEnabled:
|
|
2320
|
+
onBlockParticipantClick: _,
|
|
2321
|
+
onReportParticipantClick: v,
|
|
2322
|
+
dmAgentEnabled: p,
|
|
2323
2323
|
messageMetadata: E,
|
|
2324
|
-
onMessageSent:
|
|
2325
|
-
showStarButton:
|
|
2326
|
-
chatbotVotingEnabled:
|
|
2327
|
-
customProfileContent:
|
|
2328
|
-
customChannelActions:
|
|
2329
|
-
renderMessage:
|
|
2330
|
-
sendButton:
|
|
2324
|
+
onMessageSent: S,
|
|
2325
|
+
showStarButton: C,
|
|
2326
|
+
chatbotVotingEnabled: I,
|
|
2327
|
+
customProfileContent: m,
|
|
2328
|
+
customChannelActions: f,
|
|
2329
|
+
renderMessage: T,
|
|
2330
|
+
sendButton: M
|
|
2331
2331
|
},
|
|
2332
|
-
|
|
2332
|
+
H.id
|
|
2333
2333
|
) }) : r ? (
|
|
2334
2334
|
// Show loading while creating/loading direct conversation channel
|
|
2335
|
-
/* @__PURE__ */ e(
|
|
2335
|
+
/* @__PURE__ */ e(De, {})
|
|
2336
2336
|
) : /* @__PURE__ */ e(
|
|
2337
|
-
|
|
2337
|
+
_t,
|
|
2338
2338
|
{
|
|
2339
|
-
hasChannels:
|
|
2340
|
-
channelsLoaded:
|
|
2339
|
+
hasChannels: ae,
|
|
2340
|
+
channelsLoaded: b
|
|
2341
2341
|
}
|
|
2342
2342
|
)
|
|
2343
2343
|
}
|
|
2344
2344
|
)
|
|
2345
2345
|
] }),
|
|
2346
|
-
|
|
2346
|
+
ie && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2347
2347
|
/* @__PURE__ */ e(
|
|
2348
2348
|
"dialog",
|
|
2349
2349
|
{
|
|
2350
2350
|
ref: me,
|
|
2351
2351
|
className: "mes-dialog",
|
|
2352
|
-
onClick:
|
|
2352
|
+
onClick: _e,
|
|
2353
2353
|
onClose: de,
|
|
2354
2354
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2355
|
-
|
|
2355
|
+
Mn,
|
|
2356
2356
|
{
|
|
2357
|
-
participantSource:
|
|
2358
|
-
onSelectParticipant:
|
|
2357
|
+
participantSource: ie,
|
|
2358
|
+
onSelectParticipant: Ce,
|
|
2359
2359
|
onClose: de,
|
|
2360
|
-
existingParticipantIds:
|
|
2361
|
-
participantLabel:
|
|
2362
|
-
searchPlaceholder: `Search ${
|
|
2360
|
+
existingParticipantIds: te,
|
|
2361
|
+
participantLabel: we,
|
|
2362
|
+
searchPlaceholder: `Search ${we}...`
|
|
2363
2363
|
},
|
|
2364
|
-
|
|
2364
|
+
pe
|
|
2365
2365
|
) })
|
|
2366
2366
|
}
|
|
2367
2367
|
)
|
|
2368
2368
|
]
|
|
2369
2369
|
}
|
|
2370
2370
|
);
|
|
2371
|
-
},
|
|
2371
|
+
}, Rn = ({
|
|
2372
2372
|
question: t,
|
|
2373
2373
|
onClick: s,
|
|
2374
2374
|
loading: n = !1,
|
|
@@ -2380,7 +2380,7 @@ const Vn = ({
|
|
|
2380
2380
|
onClick: s,
|
|
2381
2381
|
disabled: n,
|
|
2382
2382
|
style: { backgroundColor: "#E6E5E3" },
|
|
2383
|
-
className:
|
|
2383
|
+
className: O(
|
|
2384
2384
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2385
2385
|
{
|
|
2386
2386
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2390,48 +2390,48 @@ const Vn = ({
|
|
|
2390
2390
|
),
|
|
2391
2391
|
children: t
|
|
2392
2392
|
}
|
|
2393
|
-
),
|
|
2393
|
+
), aa = ({
|
|
2394
2394
|
faqs: t,
|
|
2395
2395
|
onFaqClick: s,
|
|
2396
2396
|
loadingFaqId: n,
|
|
2397
2397
|
headerText: o,
|
|
2398
|
-
className:
|
|
2399
|
-
avatarImage:
|
|
2398
|
+
className: l,
|
|
2399
|
+
avatarImage: d,
|
|
2400
2400
|
avatarName: r
|
|
2401
2401
|
}) => {
|
|
2402
|
-
const c = t.filter((
|
|
2403
|
-
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className:
|
|
2404
|
-
(
|
|
2402
|
+
const c = t.filter((x) => x.enabled).sort((x, u) => (x.order ?? 0) - (u.order ?? 0));
|
|
2403
|
+
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2404
|
+
(d || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2405
2405
|
oe,
|
|
2406
2406
|
{
|
|
2407
2407
|
id: r || "account",
|
|
2408
2408
|
name: r || "Account",
|
|
2409
|
-
image:
|
|
2409
|
+
image: d,
|
|
2410
2410
|
size: 24,
|
|
2411
2411
|
shape: "circle"
|
|
2412
2412
|
}
|
|
2413
2413
|
) }),
|
|
2414
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ i(
|
|
2415
2415
|
"div",
|
|
2416
2416
|
{
|
|
2417
2417
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2418
2418
|
style: { backgroundColor: "#F1F0EE" },
|
|
2419
2419
|
children: [
|
|
2420
2420
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2421
|
-
c.map((
|
|
2422
|
-
|
|
2421
|
+
c.map((x) => /* @__PURE__ */ e(
|
|
2422
|
+
Rn,
|
|
2423
2423
|
{
|
|
2424
|
-
question:
|
|
2425
|
-
onClick: () => s(
|
|
2426
|
-
loading: n ===
|
|
2424
|
+
question: x.question,
|
|
2425
|
+
onClick: () => s(x.id),
|
|
2426
|
+
loading: n === x.id
|
|
2427
2427
|
},
|
|
2428
|
-
|
|
2428
|
+
x.id
|
|
2429
2429
|
))
|
|
2430
2430
|
]
|
|
2431
2431
|
}
|
|
2432
2432
|
)
|
|
2433
2433
|
] }) });
|
|
2434
|
-
},
|
|
2434
|
+
}, Ln = [
|
|
2435
2435
|
[/pdf/, "pdf"],
|
|
2436
2436
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2437
2437
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -2441,114 +2441,125 @@ const Vn = ({
|
|
|
2441
2441
|
[/plain|rtf/, "text"],
|
|
2442
2442
|
[/markdown/, "markdown"]
|
|
2443
2443
|
];
|
|
2444
|
-
function
|
|
2444
|
+
function Ye(t) {
|
|
2445
2445
|
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2446
2446
|
}
|
|
2447
|
-
function
|
|
2448
|
-
const s =
|
|
2447
|
+
function Pn(t) {
|
|
2448
|
+
const s = Ln.find(
|
|
2449
2449
|
([n]) => n.test(t)
|
|
2450
2450
|
);
|
|
2451
2451
|
return s ? s[1] : "generic";
|
|
2452
2452
|
}
|
|
2453
|
-
const
|
|
2454
|
-
video:
|
|
2455
|
-
audio:
|
|
2456
|
-
image:
|
|
2457
|
-
document:
|
|
2458
|
-
},
|
|
2459
|
-
pdf:
|
|
2460
|
-
doc:
|
|
2461
|
-
xls:
|
|
2462
|
-
csv:
|
|
2463
|
-
ppt:
|
|
2464
|
-
zip:
|
|
2465
|
-
text:
|
|
2466
|
-
markdown:
|
|
2467
|
-
generic:
|
|
2453
|
+
const Fn = {
|
|
2454
|
+
video: vs,
|
|
2455
|
+
audio: ws,
|
|
2456
|
+
image: xs,
|
|
2457
|
+
document: ut
|
|
2458
|
+
}, An = {
|
|
2459
|
+
pdf: ks,
|
|
2460
|
+
doc: Is,
|
|
2461
|
+
xls: Ss,
|
|
2462
|
+
csv: Es,
|
|
2463
|
+
ppt: _s,
|
|
2464
|
+
zip: Cs,
|
|
2465
|
+
text: ys,
|
|
2466
|
+
markdown: Ns,
|
|
2467
|
+
generic: ut
|
|
2468
2468
|
};
|
|
2469
|
-
function
|
|
2470
|
-
const s =
|
|
2471
|
-
return s !== "document" ?
|
|
2469
|
+
function Un(t) {
|
|
2470
|
+
const s = Ye(t);
|
|
2471
|
+
return s !== "document" ? Fn[s] : An[Pn(t)];
|
|
2472
2472
|
}
|
|
2473
|
-
function
|
|
2474
|
-
return z.createElement(
|
|
2473
|
+
function We(t, s) {
|
|
2474
|
+
return z.createElement(Un(t), s);
|
|
2475
2475
|
}
|
|
2476
|
-
const
|
|
2476
|
+
const On = (t) => {
|
|
2477
2477
|
var s, n;
|
|
2478
2478
|
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2479
|
-
},
|
|
2479
|
+
}, Ve = ({
|
|
2480
2480
|
source: t,
|
|
2481
2481
|
mimeType: s,
|
|
2482
2482
|
poster: n,
|
|
2483
2483
|
autoPlay: o = !1,
|
|
2484
|
-
playing:
|
|
2485
|
-
loop:
|
|
2484
|
+
playing: l,
|
|
2485
|
+
loop: d = !1,
|
|
2486
2486
|
controls: r = !0,
|
|
2487
2487
|
showProgress: c = !1,
|
|
2488
|
-
muted:
|
|
2488
|
+
muted: x = !1,
|
|
2489
|
+
onContainerClick: u
|
|
2489
2490
|
}) => {
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2492
|
-
}, []),
|
|
2493
|
-
const
|
|
2494
|
-
if (!
|
|
2495
|
-
const
|
|
2491
|
+
const g = Ye(s), h = X(null), N = X(null), a = X(null), _ = X(l), [v, p] = k(o), [E, S] = k(0), [C, I] = k(!1), [P, w] = k(!1), [m, f] = k(!1), [T, M] = k(!1), [L, R] = k(!0), [B, ee] = k(null), J = A(() => {
|
|
2492
|
+
f(!1), p(!0);
|
|
2493
|
+
}, []), V = A((b) => {
|
|
2494
|
+
const y = N.current;
|
|
2495
|
+
if (!y) return 0;
|
|
2496
|
+
const U = y.getBoundingClientRect();
|
|
2496
2497
|
return Math.max(
|
|
2497
2498
|
0,
|
|
2498
|
-
Math.min(1, (
|
|
2499
|
+
Math.min(1, (On(b) - U.left) / U.width)
|
|
2499
2500
|
);
|
|
2500
|
-
}, []),
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2503
|
-
}, []),
|
|
2504
|
-
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2501
|
+
}, []), F = A((b) => {
|
|
2502
|
+
const y = h.current;
|
|
2503
|
+
y && y.duration && (y.currentTime = b * y.duration);
|
|
2504
|
+
}, []), H = (b) => {
|
|
2505
|
+
b.stopPropagation(), I(!0);
|
|
2506
|
+
const y = V(b);
|
|
2507
|
+
S(y), F(y);
|
|
2507
2508
|
};
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
}, [
|
|
2511
|
-
if (!
|
|
2512
|
-
|
|
2509
|
+
q(() => {
|
|
2510
|
+
l !== void 0 && l !== _.current && (_.current = l, p(l));
|
|
2511
|
+
}, [l]), q(() => {
|
|
2512
|
+
if (!v) {
|
|
2513
|
+
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2513
2514
|
return;
|
|
2514
2515
|
}
|
|
2515
|
-
const
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2516
|
+
const b = () => {
|
|
2517
|
+
const y = h.current;
|
|
2518
|
+
y && y.duration && !C && S(y.currentTime / y.duration), a.current = requestAnimationFrame(b);
|
|
2518
2519
|
};
|
|
2519
|
-
return
|
|
2520
|
-
|
|
2520
|
+
return a.current = requestAnimationFrame(b), () => {
|
|
2521
|
+
a.current !== null && cancelAnimationFrame(a.current);
|
|
2521
2522
|
};
|
|
2522
|
-
}, [
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
}) :
|
|
2527
|
-
}, [
|
|
2528
|
-
if (!
|
|
2529
|
-
const
|
|
2530
|
-
I(!1),
|
|
2523
|
+
}, [v, C]), q(() => {
|
|
2524
|
+
const b = h.current;
|
|
2525
|
+
b && (v ? b.play().catch((y) => {
|
|
2526
|
+
p(!1), f(!0);
|
|
2527
|
+
}) : b.pause());
|
|
2528
|
+
}, [v]), q(() => {
|
|
2529
|
+
if (!C) return;
|
|
2530
|
+
const b = (U) => S(V(U)), y = (U) => {
|
|
2531
|
+
I(!1), F(V(U));
|
|
2531
2532
|
};
|
|
2532
|
-
return window.addEventListener("mousemove",
|
|
2533
|
-
window.removeEventListener("mousemove",
|
|
2533
|
+
return window.addEventListener("mousemove", b), window.addEventListener("mouseup", y), window.addEventListener("touchmove", b, { passive: !0 }), window.addEventListener("touchend", y), () => {
|
|
2534
|
+
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", y), window.removeEventListener("touchmove", b), window.removeEventListener("touchend", y);
|
|
2534
2535
|
};
|
|
2535
|
-
}, [
|
|
2536
|
-
const
|
|
2537
|
-
return /* @__PURE__ */
|
|
2536
|
+
}, [C, V, F]);
|
|
2537
|
+
const Z = B ? { aspectRatio: String(B) } : void 0, ae = B ? "" : " aspect-video", K = Math.round(E * 100);
|
|
2538
|
+
return /* @__PURE__ */ i(
|
|
2538
2539
|
"div",
|
|
2539
2540
|
{
|
|
2540
2541
|
role: "button",
|
|
2541
2542
|
tabIndex: 0,
|
|
2542
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
2543
|
-
style:
|
|
2544
|
-
onClick: () => {
|
|
2545
|
-
|
|
2543
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${ae}`,
|
|
2544
|
+
style: Z,
|
|
2545
|
+
onClick: (b) => {
|
|
2546
|
+
if (u) {
|
|
2547
|
+
u(b);
|
|
2548
|
+
return;
|
|
2549
|
+
}
|
|
2550
|
+
m || r && p((y) => !y);
|
|
2546
2551
|
},
|
|
2547
|
-
onKeyDown: (
|
|
2548
|
-
|
|
2552
|
+
onKeyDown: (b) => {
|
|
2553
|
+
if (!(b.key !== "Enter" && b.key !== " ")) {
|
|
2554
|
+
if (b.preventDefault(), u) {
|
|
2555
|
+
u(b);
|
|
2556
|
+
return;
|
|
2557
|
+
}
|
|
2558
|
+
m || r && p((y) => !y);
|
|
2559
|
+
}
|
|
2549
2560
|
},
|
|
2550
2561
|
children: [
|
|
2551
|
-
n && (
|
|
2562
|
+
n && (g === "audio" || L) && /* @__PURE__ */ e(
|
|
2552
2563
|
"img",
|
|
2553
2564
|
{
|
|
2554
2565
|
src: n,
|
|
@@ -2556,75 +2567,75 @@ const Rn = (t) => {
|
|
|
2556
2567
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
2557
2568
|
}
|
|
2558
2569
|
),
|
|
2559
|
-
!n && (
|
|
2570
|
+
!n && (g === "audio" || L) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: We(s, {
|
|
2560
2571
|
className: "size-12 text-black/20",
|
|
2561
2572
|
weight: "regular"
|
|
2562
2573
|
}) }),
|
|
2563
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0", children:
|
|
2574
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: g === "audio" ? /* @__PURE__ */ e(
|
|
2564
2575
|
"audio",
|
|
2565
2576
|
{
|
|
2566
|
-
ref:
|
|
2577
|
+
ref: h,
|
|
2567
2578
|
src: t,
|
|
2568
|
-
loop:
|
|
2569
|
-
muted:
|
|
2579
|
+
loop: d,
|
|
2580
|
+
muted: x,
|
|
2570
2581
|
style: { width: "100%", height: "100%" },
|
|
2571
|
-
onLoadStart: () =>
|
|
2582
|
+
onLoadStart: () => M(!0),
|
|
2572
2583
|
onCanPlay: () => {
|
|
2573
|
-
|
|
2584
|
+
M(!1), R(!1);
|
|
2574
2585
|
},
|
|
2575
|
-
onWaiting: () =>
|
|
2576
|
-
onPlay: () =>
|
|
2586
|
+
onWaiting: () => M(!0),
|
|
2587
|
+
onPlay: () => f(!1),
|
|
2577
2588
|
onEnded: () => {
|
|
2578
|
-
|
|
2589
|
+
d || (p(!1), S(0));
|
|
2579
2590
|
},
|
|
2580
2591
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2581
2592
|
}
|
|
2582
2593
|
) : /* @__PURE__ */ e(
|
|
2583
2594
|
"video",
|
|
2584
2595
|
{
|
|
2585
|
-
ref:
|
|
2596
|
+
ref: h,
|
|
2586
2597
|
src: t,
|
|
2587
|
-
loop:
|
|
2588
|
-
muted:
|
|
2598
|
+
loop: d,
|
|
2599
|
+
muted: x,
|
|
2589
2600
|
playsInline: !0,
|
|
2590
2601
|
style: { width: "100%", height: "100%" },
|
|
2591
|
-
onLoadStart: () =>
|
|
2602
|
+
onLoadStart: () => M(!0),
|
|
2592
2603
|
onCanPlay: () => {
|
|
2593
|
-
|
|
2604
|
+
M(!1), R(!1);
|
|
2594
2605
|
},
|
|
2595
|
-
onWaiting: () =>
|
|
2596
|
-
onPlay: () =>
|
|
2606
|
+
onWaiting: () => M(!0),
|
|
2607
|
+
onPlay: () => f(!1),
|
|
2597
2608
|
onLoadedMetadata: () => {
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2609
|
+
const b = h.current;
|
|
2610
|
+
b instanceof HTMLVideoElement && b.videoWidth && b.videoHeight && ee(b.videoWidth / b.videoHeight);
|
|
2600
2611
|
},
|
|
2601
2612
|
onEnded: () => {
|
|
2602
|
-
|
|
2613
|
+
d || (p(!1), S(0));
|
|
2603
2614
|
},
|
|
2604
2615
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2605
2616
|
}
|
|
2606
2617
|
) }),
|
|
2607
|
-
|
|
2608
|
-
|
|
2618
|
+
T && !m && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2619
|
+
mt,
|
|
2609
2620
|
{
|
|
2610
2621
|
className: "size-8 animate-spin text-white/80",
|
|
2611
2622
|
weight: "bold"
|
|
2612
2623
|
}
|
|
2613
2624
|
) }),
|
|
2614
|
-
|
|
2625
|
+
m && !r && /* @__PURE__ */ e(
|
|
2615
2626
|
"div",
|
|
2616
2627
|
{
|
|
2617
2628
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
2618
2629
|
role: "button",
|
|
2619
2630
|
tabIndex: 0,
|
|
2620
2631
|
"aria-label": "Play preview",
|
|
2621
|
-
onClick: (
|
|
2622
|
-
|
|
2632
|
+
onClick: (b) => {
|
|
2633
|
+
b.stopPropagation(), J();
|
|
2623
2634
|
},
|
|
2624
|
-
onKeyDown: (
|
|
2625
|
-
|
|
2635
|
+
onKeyDown: (b) => {
|
|
2636
|
+
b.key !== "Enter" && b.key !== " " || (b.preventDefault(), b.stopPropagation(), J());
|
|
2626
2637
|
},
|
|
2627
|
-
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(
|
|
2638
|
+
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2628
2639
|
}
|
|
2629
2640
|
),
|
|
2630
2641
|
c && !r && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ e(
|
|
@@ -2632,69 +2643,69 @@ const Rn = (t) => {
|
|
|
2632
2643
|
{
|
|
2633
2644
|
role: "slider",
|
|
2634
2645
|
"aria-label": "Playback position",
|
|
2635
|
-
"aria-valuenow":
|
|
2646
|
+
"aria-valuenow": K,
|
|
2636
2647
|
"aria-valuemin": 0,
|
|
2637
2648
|
"aria-valuemax": 100,
|
|
2638
2649
|
tabIndex: 0,
|
|
2639
|
-
ref:
|
|
2650
|
+
ref: N,
|
|
2640
2651
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2641
|
-
onMouseDown:
|
|
2642
|
-
onTouchStart:
|
|
2643
|
-
onClick: (
|
|
2644
|
-
onKeyDown: (
|
|
2645
|
-
|
|
2652
|
+
onMouseDown: H,
|
|
2653
|
+
onTouchStart: H,
|
|
2654
|
+
onClick: (b) => b.stopPropagation(),
|
|
2655
|
+
onKeyDown: (b) => {
|
|
2656
|
+
b.key === "ArrowRight" && F(Math.min(1, E + 0.05)), b.key === "ArrowLeft" && F(Math.max(0, E - 0.05));
|
|
2646
2657
|
},
|
|
2647
2658
|
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
2648
2659
|
"div",
|
|
2649
2660
|
{
|
|
2650
2661
|
className: "h-full rounded-full bg-white",
|
|
2651
|
-
style: { width: `${
|
|
2662
|
+
style: { width: `${K}%` }
|
|
2652
2663
|
}
|
|
2653
2664
|
) })
|
|
2654
2665
|
}
|
|
2655
2666
|
) }),
|
|
2656
|
-
r && /* @__PURE__ */
|
|
2667
|
+
r && /* @__PURE__ */ i("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
2657
2668
|
/* @__PURE__ */ e(
|
|
2658
2669
|
"button",
|
|
2659
2670
|
{
|
|
2660
2671
|
type: "button",
|
|
2661
|
-
onClick: (
|
|
2662
|
-
|
|
2672
|
+
onClick: (b) => {
|
|
2673
|
+
b.stopPropagation(), p((y) => !y);
|
|
2663
2674
|
},
|
|
2664
2675
|
className: "shrink-0 text-white",
|
|
2665
|
-
"aria-label":
|
|
2666
|
-
children:
|
|
2676
|
+
"aria-label": v ? "Pause" : "Play",
|
|
2677
|
+
children: v ? /* @__PURE__ */ e(Ts, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2667
2678
|
}
|
|
2668
2679
|
),
|
|
2669
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ i(
|
|
2670
2681
|
"div",
|
|
2671
2682
|
{
|
|
2672
2683
|
role: "slider",
|
|
2673
2684
|
"aria-label": "Playback position",
|
|
2674
|
-
"aria-valuenow":
|
|
2685
|
+
"aria-valuenow": K,
|
|
2675
2686
|
"aria-valuemin": 0,
|
|
2676
2687
|
"aria-valuemax": 100,
|
|
2677
2688
|
tabIndex: 0,
|
|
2678
|
-
ref:
|
|
2689
|
+
ref: N,
|
|
2679
2690
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2680
|
-
onMouseDown:
|
|
2681
|
-
onTouchStart:
|
|
2682
|
-
onClick: (
|
|
2683
|
-
onMouseEnter: () =>
|
|
2684
|
-
onMouseLeave: () =>
|
|
2685
|
-
onKeyDown: (
|
|
2686
|
-
|
|
2691
|
+
onMouseDown: H,
|
|
2692
|
+
onTouchStart: H,
|
|
2693
|
+
onClick: (b) => b.stopPropagation(),
|
|
2694
|
+
onMouseEnter: () => w(!0),
|
|
2695
|
+
onMouseLeave: () => w(!1),
|
|
2696
|
+
onKeyDown: (b) => {
|
|
2697
|
+
b.key === "ArrowRight" && F(Math.min(1, E + 0.05)), b.key === "ArrowLeft" && F(Math.max(0, E - 0.05));
|
|
2687
2698
|
},
|
|
2688
2699
|
children: [
|
|
2689
2700
|
/* @__PURE__ */ e(
|
|
2690
2701
|
"div",
|
|
2691
2702
|
{
|
|
2692
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
2703
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || C ? "h-1.5" : "h-1"}`,
|
|
2693
2704
|
children: /* @__PURE__ */ e(
|
|
2694
2705
|
"div",
|
|
2695
2706
|
{
|
|
2696
2707
|
className: "h-full rounded-full bg-white",
|
|
2697
|
-
style: { width: `${
|
|
2708
|
+
style: { width: `${K}%` }
|
|
2698
2709
|
}
|
|
2699
2710
|
)
|
|
2700
2711
|
}
|
|
@@ -2702,8 +2713,8 @@ const Rn = (t) => {
|
|
|
2702
2713
|
/* @__PURE__ */ e(
|
|
2703
2714
|
"div",
|
|
2704
2715
|
{
|
|
2705
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
2706
|
-
style: { left: `${
|
|
2716
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || C ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
2717
|
+
style: { left: `${K}%` }
|
|
2707
2718
|
}
|
|
2708
2719
|
)
|
|
2709
2720
|
]
|
|
@@ -2714,155 +2725,380 @@ const Rn = (t) => {
|
|
|
2714
2725
|
}
|
|
2715
2726
|
);
|
|
2716
2727
|
};
|
|
2717
|
-
function
|
|
2728
|
+
function $n(t) {
|
|
2718
2729
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
2719
2730
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2731
|
+
function zn(t) {
|
|
2732
|
+
return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
2733
|
+
}
|
|
2734
|
+
function Et(t) {
|
|
2735
|
+
return t ? "text-white" : "text-black";
|
|
2736
|
+
}
|
|
2737
|
+
function be(t) {
|
|
2738
|
+
return t ? "text-white/55" : "text-black/55";
|
|
2739
|
+
}
|
|
2740
|
+
function Bn(t) {
|
|
2741
|
+
return t ? "text-white/40" : "text-black/40";
|
|
2742
|
+
}
|
|
2743
|
+
function St(t) {
|
|
2744
|
+
return t ? "bg-white/10" : "bg-black/5";
|
|
2745
|
+
}
|
|
2746
|
+
function It(t) {
|
|
2747
|
+
return t ? "text-white/20" : "text-black/20";
|
|
2748
|
+
}
|
|
2749
|
+
function jn(t) {
|
|
2750
|
+
return t ? "bg-white/10 hover:bg-white/15" : "bg-black/[0.06] hover:bg-black/10";
|
|
2751
|
+
}
|
|
2752
|
+
async function Gn(t, s) {
|
|
2753
|
+
let n;
|
|
2754
|
+
try {
|
|
2755
|
+
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
2756
|
+
} catch {
|
|
2757
|
+
n = s ?? "download";
|
|
2758
|
+
}
|
|
2759
|
+
const o = await fetch(t, { mode: "cors" });
|
|
2760
|
+
if (!o.ok) throw new Error(`HTTP ${o.status}`);
|
|
2761
|
+
const l = await o.blob(), d = URL.createObjectURL(l), r = document.createElement("a");
|
|
2762
|
+
r.href = d, r.download = n, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(d);
|
|
2763
|
+
}
|
|
2764
|
+
const Vn = ({
|
|
2765
|
+
url: t,
|
|
2766
|
+
filename: s,
|
|
2767
|
+
isMyMessage: n
|
|
2742
2768
|
}) => {
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2769
|
+
const [o, l] = k(!1);
|
|
2770
|
+
return /* @__PURE__ */ e(
|
|
2771
|
+
"button",
|
|
2772
|
+
{
|
|
2773
|
+
type: "button",
|
|
2774
|
+
onClick: (r) => {
|
|
2775
|
+
r.stopPropagation();
|
|
2776
|
+
const c = window.open("", "_blank", "noopener,noreferrer");
|
|
2777
|
+
l(!0), Gn(t, s).then(() => {
|
|
2778
|
+
c == null || c.close();
|
|
2779
|
+
}).catch(() => {
|
|
2780
|
+
c && (c.location.href = t);
|
|
2781
|
+
}).finally(() => l(!1));
|
|
2782
|
+
},
|
|
2783
|
+
disabled: o,
|
|
2784
|
+
className: `flex size-8 items-center justify-center rounded-full ${jn(n)} disabled:opacity-50`,
|
|
2785
|
+
"aria-label": "Download",
|
|
2786
|
+
children: o ? /* @__PURE__ */ e(mt, { className: `size-4 animate-spin ${be(n)}`, weight: "bold" }) : /* @__PURE__ */ e(Ds, { className: `size-4 ${be(n)}`, weight: "bold" })
|
|
2787
|
+
}
|
|
2788
|
+
);
|
|
2789
|
+
}, Me = ({ mimeType: t, title: s, fileSize: n, url: o, isMyMessage: l }) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2 px-4 pb-3 pt-3", children: [
|
|
2790
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
2791
|
+
s && /* @__PURE__ */ e("p", { className: `mb-1.5 truncate text-base font-medium ${Et(l)}`, children: s }),
|
|
2792
|
+
n !== void 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2793
|
+
We(t, {
|
|
2794
|
+
className: `size-5 shrink-0 ${be(l)}`,
|
|
2795
|
+
weight: "regular"
|
|
2796
|
+
}),
|
|
2797
|
+
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children: $n(n) })
|
|
2798
|
+
] })
|
|
2799
|
+
] }),
|
|
2800
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(Vn, { url: o, filename: s, isMyMessage: l }) })
|
|
2801
|
+
] }), Hn = ({ url: t, mimeType: s, title: n, fileSize: o, isMyMessage: l, onExpand: d }) => {
|
|
2802
|
+
const r = /* @__PURE__ */ e(
|
|
2803
|
+
"div",
|
|
2804
|
+
{
|
|
2805
|
+
className: `aspect-video w-full ${St(l)} flex items-center justify-center`,
|
|
2806
|
+
children: We(s, {
|
|
2807
|
+
className: `size-12 ${It(l)}`,
|
|
2808
|
+
weight: "regular"
|
|
2809
|
+
})
|
|
2810
|
+
}
|
|
2811
|
+
);
|
|
2812
|
+
return /* @__PURE__ */ i("div", { children: [
|
|
2813
|
+
d ? /* @__PURE__ */ e(
|
|
2814
|
+
"button",
|
|
2758
2815
|
{
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2816
|
+
type: "button",
|
|
2817
|
+
onClick: d,
|
|
2818
|
+
className: "block w-full",
|
|
2819
|
+
"aria-label": "Open PDF viewer",
|
|
2820
|
+
children: r
|
|
2763
2821
|
}
|
|
2764
|
-
),
|
|
2822
|
+
) : /* @__PURE__ */ e("a", { href: t, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: r }),
|
|
2765
2823
|
/* @__PURE__ */ e(
|
|
2824
|
+
Me,
|
|
2825
|
+
{
|
|
2826
|
+
mimeType: s,
|
|
2827
|
+
title: n,
|
|
2828
|
+
fileSize: o,
|
|
2829
|
+
url: t,
|
|
2830
|
+
isMyMessage: l
|
|
2831
|
+
}
|
|
2832
|
+
)
|
|
2833
|
+
] });
|
|
2834
|
+
}, Yn = ({ attachment: t, isMyMessage: s }) => {
|
|
2835
|
+
const { title: n, text: o, image_url: l, og_scrape_url: d, title_link: r } = t, c = d ?? r;
|
|
2836
|
+
return /* @__PURE__ */ i("a", { href: c, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: [
|
|
2837
|
+
/* @__PURE__ */ e("div", { className: "p-2", children: l ? /* @__PURE__ */ e(
|
|
2838
|
+
"img",
|
|
2839
|
+
{
|
|
2840
|
+
src: l,
|
|
2841
|
+
alt: n ?? "",
|
|
2842
|
+
className: "aspect-video w-full rounded-[20px] object-cover"
|
|
2843
|
+
}
|
|
2844
|
+
) : /* @__PURE__ */ e(
|
|
2766
2845
|
"div",
|
|
2767
2846
|
{
|
|
2768
|
-
className:
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2847
|
+
className: `aspect-video w-full rounded-[20px] ${St(s)} flex items-center justify-center`,
|
|
2848
|
+
children: /* @__PURE__ */ e(Ms, { className: `size-12 ${It(s)}` })
|
|
2849
|
+
}
|
|
2850
|
+
) }),
|
|
2851
|
+
/* @__PURE__ */ i("div", { className: "px-3 pb-3", children: [
|
|
2852
|
+
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Et(s)}`, children: n }),
|
|
2853
|
+
o && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${be(s)}`, children: o }),
|
|
2854
|
+
c && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Bn(s)}`, children: c })
|
|
2855
|
+
] })
|
|
2856
|
+
] });
|
|
2857
|
+
}, Wn = ({ sourceType: t, url: s, mimeType: n, title: o, poster: l, onClose: d }) => {
|
|
2858
|
+
const r = X(null);
|
|
2859
|
+
return q(() => {
|
|
2860
|
+
const u = r.current;
|
|
2861
|
+
return u == null || u.showModal(), () => {
|
|
2862
|
+
u != null && u.open && u.close();
|
|
2863
|
+
};
|
|
2864
|
+
}, []), // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2865
|
+
/* @__PURE__ */ e(
|
|
2866
|
+
"dialog",
|
|
2867
|
+
{
|
|
2868
|
+
ref: r,
|
|
2869
|
+
className: "mes-media-viewer",
|
|
2870
|
+
onClose: d,
|
|
2871
|
+
onClick: (u) => {
|
|
2872
|
+
u.target === r.current && d();
|
|
2873
|
+
},
|
|
2874
|
+
children: /* @__PURE__ */ i("div", { className: "relative flex h-full w-full items-center justify-center p-6", children: [
|
|
2875
|
+
/* @__PURE__ */ e(
|
|
2876
|
+
"button",
|
|
2877
|
+
{
|
|
2878
|
+
type: "button",
|
|
2879
|
+
onClick: d,
|
|
2880
|
+
className: "absolute right-4 top-4 z-10 flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20",
|
|
2881
|
+
"aria-label": "Close",
|
|
2882
|
+
children: /* @__PURE__ */ e(Re, { className: "size-5", weight: "bold" })
|
|
2883
|
+
}
|
|
2884
|
+
),
|
|
2885
|
+
t === "image" ? /* @__PURE__ */ e(
|
|
2886
|
+
"img",
|
|
2782
2887
|
{
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
fileSize: b
|
|
2888
|
+
src: s,
|
|
2889
|
+
alt: o ?? "",
|
|
2890
|
+
className: "max-h-[90vh] max-w-[90vw] rounded-2xl object-contain"
|
|
2787
2891
|
}
|
|
2788
|
-
) : /* @__PURE__ */
|
|
2892
|
+
) : n === "application/pdf" ? /* @__PURE__ */ i("div", { className: "flex h-full w-full max-w-4xl flex-col pt-14", children: [
|
|
2893
|
+
o && /* @__PURE__ */ e("p", { className: "mb-2 shrink-0 truncate text-sm font-medium text-white/70", children: o }),
|
|
2789
2894
|
/* @__PURE__ */ e(
|
|
2790
|
-
|
|
2895
|
+
"iframe",
|
|
2791
2896
|
{
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
controls: !0
|
|
2897
|
+
src: s,
|
|
2898
|
+
title: o ?? "Document",
|
|
2899
|
+
className: "w-full flex-1 rounded-xl"
|
|
2796
2900
|
}
|
|
2797
|
-
)
|
|
2798
|
-
|
|
2799
|
-
|
|
2901
|
+
)
|
|
2902
|
+
] }) : /* @__PURE__ */ i("div", { className: "w-full max-w-2xl", children: [
|
|
2903
|
+
o && /* @__PURE__ */ e("p", { className: "mb-4 text-center text-sm font-medium text-white/70", children: o }),
|
|
2904
|
+
/* @__PURE__ */ e(Ve, { source: s, mimeType: n, poster: l, controls: !0 })
|
|
2905
|
+
] })
|
|
2906
|
+
] })
|
|
2907
|
+
}
|
|
2908
|
+
);
|
|
2909
|
+
}, ra = ({
|
|
2910
|
+
message: t,
|
|
2911
|
+
isMyMessage: s = !1
|
|
2912
|
+
}) => {
|
|
2913
|
+
var C, I, P, w, m;
|
|
2914
|
+
const [n, o] = k(!1), l = (C = t.attachments) == null ? void 0 : C.find(
|
|
2915
|
+
(f) => f.type === "link" || f.og_scrape_url && !f.asset_url
|
|
2916
|
+
), d = (I = t.attachments) == null ? void 0 : I.find(
|
|
2917
|
+
(f) => f.type === "video" && f.asset_url
|
|
2918
|
+
), r = (P = t.attachments) == null ? void 0 : P.find(
|
|
2919
|
+
(f) => f.type === "image" && f.image_url
|
|
2920
|
+
), c = (w = t.attachments) == null ? void 0 : w.find(
|
|
2921
|
+
(f) => f.type === "audio" && f.asset_url
|
|
2922
|
+
), x = (m = t.attachments) == null ? void 0 : m.find(
|
|
2923
|
+
(f) => f.type === "file" && f.asset_url
|
|
2924
|
+
), u = d ?? r ?? c ?? x, g = (d == null ? void 0 : d.asset_url) ?? (r == null ? void 0 : r.image_url) ?? (c == null ? void 0 : c.asset_url) ?? (x == null ? void 0 : x.asset_url), h = (u == null ? void 0 : u.mime_type) ?? ((u == null ? void 0 : u.type) === "image" ? "image/jpeg" : (u == null ? void 0 : u.type) === "video" ? "video/mp4" : (u == null ? void 0 : u.type) === "audio" ? "audio/mpeg" : "application/octet-stream");
|
|
2925
|
+
if (!l && !g) return null;
|
|
2926
|
+
const N = g ? Ye(h) : null, a = u == null ? void 0 : u.title, _ = u == null ? void 0 : u.file_size, v = d == null ? void 0 : d.thumb_url, p = h === "application/pdf", E = s ? "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", S = N === "image" || N === "video" || p;
|
|
2927
|
+
return /* @__PURE__ */ i(se, { children: [
|
|
2928
|
+
/* @__PURE__ */ i("div", { className: E, children: [
|
|
2929
|
+
!s && t.user && /* @__PURE__ */ e(
|
|
2930
|
+
oe,
|
|
2931
|
+
{
|
|
2932
|
+
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2933
|
+
id: t.user.id,
|
|
2934
|
+
image: t.user.image,
|
|
2935
|
+
name: t.user.name ?? t.user.id
|
|
2936
|
+
}
|
|
2937
|
+
),
|
|
2938
|
+
/* @__PURE__ */ e(
|
|
2939
|
+
"div",
|
|
2940
|
+
{
|
|
2941
|
+
className: "str-chat__message-inner",
|
|
2942
|
+
style: { marginInlineEnd: 0, marginInlineStart: 0 },
|
|
2943
|
+
children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e(
|
|
2944
|
+
"div",
|
|
2945
|
+
{
|
|
2946
|
+
className: "str-chat__message-bubble",
|
|
2947
|
+
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
2948
|
+
children: /* @__PURE__ */ e("div", { className: zn(s), children: l ? /* @__PURE__ */ e(Yn, { attachment: l, isMyMessage: s }) : N === "image" ? /* @__PURE__ */ i(se, { children: [
|
|
2949
|
+
/* @__PURE__ */ e(
|
|
2950
|
+
"button",
|
|
2951
|
+
{
|
|
2952
|
+
type: "button",
|
|
2953
|
+
onClick: () => o(!0),
|
|
2954
|
+
className: "block w-full cursor-zoom-in",
|
|
2955
|
+
children: /* @__PURE__ */ e("img", { src: g, alt: a ?? "", className: "block w-full" })
|
|
2956
|
+
}
|
|
2957
|
+
),
|
|
2958
|
+
/* @__PURE__ */ e(
|
|
2959
|
+
Me,
|
|
2960
|
+
{
|
|
2961
|
+
mimeType: h,
|
|
2962
|
+
title: a,
|
|
2963
|
+
fileSize: _,
|
|
2964
|
+
url: g,
|
|
2965
|
+
isMyMessage: s
|
|
2966
|
+
}
|
|
2967
|
+
)
|
|
2968
|
+
] }) : N === "video" ? /* @__PURE__ */ i(se, { children: [
|
|
2969
|
+
/* @__PURE__ */ e(
|
|
2970
|
+
Ve,
|
|
2971
|
+
{
|
|
2972
|
+
source: g,
|
|
2973
|
+
mimeType: h,
|
|
2974
|
+
poster: v,
|
|
2975
|
+
controls: !0,
|
|
2976
|
+
onContainerClick: () => o(!0)
|
|
2977
|
+
}
|
|
2978
|
+
),
|
|
2979
|
+
/* @__PURE__ */ e(
|
|
2980
|
+
Me,
|
|
2981
|
+
{
|
|
2982
|
+
mimeType: h,
|
|
2983
|
+
title: a,
|
|
2984
|
+
fileSize: _,
|
|
2985
|
+
url: g,
|
|
2986
|
+
isMyMessage: s
|
|
2987
|
+
}
|
|
2988
|
+
)
|
|
2989
|
+
] }) : N === "audio" ? /* @__PURE__ */ i(se, { children: [
|
|
2990
|
+
/* @__PURE__ */ e(
|
|
2991
|
+
Ve,
|
|
2992
|
+
{
|
|
2993
|
+
source: g,
|
|
2994
|
+
mimeType: h,
|
|
2995
|
+
controls: !0
|
|
2996
|
+
}
|
|
2997
|
+
),
|
|
2998
|
+
/* @__PURE__ */ e(
|
|
2999
|
+
Me,
|
|
3000
|
+
{
|
|
3001
|
+
mimeType: h,
|
|
3002
|
+
title: a,
|
|
3003
|
+
fileSize: _,
|
|
3004
|
+
url: g,
|
|
3005
|
+
isMyMessage: s
|
|
3006
|
+
}
|
|
3007
|
+
)
|
|
3008
|
+
] }) : (
|
|
3009
|
+
// document: PDF gets viewer, unknown gets link-only thumbnail
|
|
3010
|
+
/* @__PURE__ */ e(
|
|
3011
|
+
Hn,
|
|
3012
|
+
{
|
|
3013
|
+
url: g,
|
|
3014
|
+
mimeType: h,
|
|
3015
|
+
title: a,
|
|
3016
|
+
fileSize: _,
|
|
3017
|
+
isMyMessage: s,
|
|
3018
|
+
onExpand: p ? () => o(!0) : void 0
|
|
3019
|
+
}
|
|
3020
|
+
)
|
|
3021
|
+
) })
|
|
3022
|
+
}
|
|
3023
|
+
) })
|
|
3024
|
+
}
|
|
3025
|
+
)
|
|
3026
|
+
] }),
|
|
3027
|
+
n && S && g && /* @__PURE__ */ e(
|
|
3028
|
+
Wn,
|
|
3029
|
+
{
|
|
3030
|
+
sourceType: N,
|
|
3031
|
+
url: g,
|
|
3032
|
+
mimeType: h,
|
|
3033
|
+
title: a,
|
|
3034
|
+
poster: v,
|
|
3035
|
+
onClose: () => o(!1)
|
|
2800
3036
|
}
|
|
2801
3037
|
)
|
|
2802
3038
|
] });
|
|
2803
|
-
},
|
|
2804
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [
|
|
3039
|
+
}, oa = (t, s = {}) => {
|
|
3040
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = k([]), [r, c] = k(!1), [x, u] = k(null), [g, h] = k(n), [N, a] = k(!0), [_, v] = k(), p = A(async (I = !1, P) => {
|
|
2805
3041
|
if (r) return;
|
|
2806
|
-
const
|
|
2807
|
-
c(!0),
|
|
3042
|
+
const w = P !== void 0 ? P : g;
|
|
3043
|
+
c(!0), u(null);
|
|
2808
3044
|
try {
|
|
2809
|
-
const
|
|
2810
|
-
search:
|
|
3045
|
+
const m = await t.loadParticipants({
|
|
3046
|
+
search: w || void 0,
|
|
2811
3047
|
limit: o,
|
|
2812
|
-
cursor:
|
|
3048
|
+
cursor: I ? void 0 : _
|
|
2813
3049
|
});
|
|
2814
|
-
|
|
2815
|
-
(
|
|
2816
|
-
), a(
|
|
2817
|
-
} catch (
|
|
2818
|
-
const
|
|
2819
|
-
|
|
3050
|
+
d(
|
|
3051
|
+
(f) => I ? m.participants : [...f, ...m.participants]
|
|
3052
|
+
), a(m.hasMore), v(m.nextCursor);
|
|
3053
|
+
} catch (m) {
|
|
3054
|
+
const f = m instanceof Error ? m.message : "Failed to load participants";
|
|
3055
|
+
u(f), console.error("[useParticipants] Load error:", m);
|
|
2820
3056
|
} finally {
|
|
2821
3057
|
c(!1);
|
|
2822
3058
|
}
|
|
2823
|
-
}, [t, g,
|
|
2824
|
-
N && !r &&
|
|
2825
|
-
}, [N, r,
|
|
2826
|
-
|
|
2827
|
-
}, [
|
|
2828
|
-
|
|
2829
|
-
}, [
|
|
2830
|
-
return
|
|
2831
|
-
|
|
3059
|
+
}, [t, g, _, o, r]), E = A(() => {
|
|
3060
|
+
N && !r && p(!1);
|
|
3061
|
+
}, [N, r, p]), S = A((I) => {
|
|
3062
|
+
h(I), v(void 0), p(!0, I);
|
|
3063
|
+
}, [p]), C = A(() => {
|
|
3064
|
+
v(void 0), p(!0);
|
|
3065
|
+
}, [p]);
|
|
3066
|
+
return q(() => {
|
|
3067
|
+
p(!0);
|
|
2832
3068
|
}, [t.loadParticipants]), {
|
|
2833
|
-
participants:
|
|
3069
|
+
participants: l,
|
|
2834
3070
|
loading: r,
|
|
2835
|
-
error:
|
|
3071
|
+
error: x,
|
|
2836
3072
|
searchQuery: g,
|
|
2837
3073
|
hasMore: N,
|
|
2838
3074
|
totalCount: t.totalCount,
|
|
2839
3075
|
loadMore: E,
|
|
2840
|
-
search:
|
|
2841
|
-
refresh:
|
|
3076
|
+
search: S,
|
|
3077
|
+
refresh: C
|
|
2842
3078
|
};
|
|
2843
3079
|
};
|
|
2844
3080
|
export {
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
3081
|
+
Ie as A,
|
|
3082
|
+
En as C,
|
|
3083
|
+
aa as F,
|
|
3084
|
+
nt as L,
|
|
3085
|
+
Ve as M,
|
|
3086
|
+
Mn as P,
|
|
2851
3087
|
oe as a,
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
3088
|
+
xt as b,
|
|
3089
|
+
Ct as c,
|
|
3090
|
+
sa as d,
|
|
3091
|
+
Rn as e,
|
|
3092
|
+
ra as f,
|
|
3093
|
+
Ye as g,
|
|
3094
|
+
rn as h,
|
|
3095
|
+
ta as i,
|
|
3096
|
+
na as j,
|
|
3097
|
+
Us as k,
|
|
3098
|
+
Zs as l,
|
|
3099
|
+
Rs as m,
|
|
3100
|
+
oa as n,
|
|
3101
|
+
We as r,
|
|
3102
|
+
sn as u
|
|
2867
3103
|
};
|
|
2868
|
-
//# sourceMappingURL=index-
|
|
3104
|
+
//# sourceMappingURL=index-CahzrNJz.js.map
|