@linktr.ee/messaging-react 1.22.0-rc-1771907607 → 1.22.0-rc-1771993226
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/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as me } from "react/jsx-runtime";
|
|
2
2
|
import D from "classnames";
|
|
3
|
-
import B, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import B, { createContext as dt, useContext as ut, useCallback as L, useState as M, useRef as H, useEffect as X, useMemo as Me } from "react";
|
|
4
|
+
import { StreamChatService as mt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as ht, ChannelList as ft, DateSeparator as gt, useChannelStateContext as Te, useChatContext as Ve, areMessageUIPropsEqual as xt, useMessageReminder as bt, useComponentContext as Ct, Attachment as Nt, EditMessageModal as yt, MessageBlocked as vt, MessageBouncePrompt as wt, MessageDeleted as pt, MessageIsThreadReplyInChannelButtonIndicator as Et, MessageRepliesCountButton as _t, ReminderNotification as It, StreamedMessageText as St, messageHasAttachments as Mt, messageHasReactions as kt, isDateSeparatorMessage as Dt, isMessageBlocked as Tt, isMessageBounced as Rt, MessageBounceModal as Ft, Poll as Lt, MessageText as At, MessageErrorIcon as Ut, useMessageContext as Pt, useMessageComposer as Ot, useStateStore as Bt, MessageInput as jt, useMessageInputContext as $t, useMessageComposerHasSendableData as zt, SimpleAttachmentSelector as Gt, QuotedMessagePreview as Ht, AttachmentPreviewList as Vt, TextareaComposer as qt, MessageTimestamp as Ae, Channel as Wt, WithComponents as Yt, Window as Zt, MessageList as Xt } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as Qt, XIcon as Re, ArrowUpIcon as Jt, SparkleIcon as Kt, ArrowLeftIcon as Ue, StarIcon as Pe, DotsThreeIcon as Oe, SpinnerGapIcon as Ne, SignOutIcon as es, ProhibitInsetIcon as Be, FlagIcon as ts, MagnifyingGlassIcon as ss, ChatCircleDotsIcon as je } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as $e } from "stream-chat";
|
|
8
|
+
const qe = dt({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,88 +15,88 @@ const Be = et({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), pe = () => ut(qe), Js = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: a,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const o = L(
|
|
27
|
-
(
|
|
28
|
-
|
|
27
|
+
(d, ...C) => {
|
|
28
|
+
c && console.log(`🔥 [MessagingProvider] ${d}`, ...C);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[c]
|
|
31
31
|
);
|
|
32
32
|
o("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [u,
|
|
38
|
+
const [u, f] = M(null), [h, b] = M(null), [x, y] = M(!1), [r, v] = M(!1), [E, w] = M(null), k = H(!1), N = H({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: a,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}), m =
|
|
43
|
+
}), m = H(0);
|
|
44
44
|
m.current++, o("📊 RENDER INFO", {
|
|
45
45
|
renderCount: m.current,
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
48
|
userChanged: N.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
-
apiKeyChanged: N.current.apiKey !==
|
|
49
|
+
apiKeyChanged: N.current.apiKey !== a,
|
|
50
50
|
serviceConfigChanged: N.current.serviceConfig !== n,
|
|
51
51
|
capabilitiesChanged: N.current.capabilities !== l
|
|
52
52
|
}
|
|
53
53
|
}), N.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: a,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const
|
|
58
|
+
}, X(() => {
|
|
59
|
+
const d = m.current;
|
|
60
60
|
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
62
|
-
apiKey: !!
|
|
61
|
+
renderCount: d,
|
|
62
|
+
apiKey: !!a,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
67
|
serviceConfigStable: N.current.serviceConfig === n,
|
|
68
|
-
apiKeyStable: N.current.apiKey ===
|
|
68
|
+
apiKeyStable: N.current.apiKey === a
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
70
|
+
}), !a || !n) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: d,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
o("🚀 CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
79
|
-
apiKey: (
|
|
78
|
+
renderCount: d,
|
|
79
|
+
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: N.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const C = new mt({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
85
|
-
debug:
|
|
84
|
+
apiKey: a,
|
|
85
|
+
debug: c
|
|
86
86
|
});
|
|
87
|
-
return
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return f(C), o("✅ SERVICE SET", {
|
|
88
|
+
renderCount: d,
|
|
89
|
+
serviceInstance: !!C
|
|
90
90
|
}), () => {
|
|
91
91
|
o("🧹 SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: d,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), C.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
96
|
+
}, [a, n, c, o]);
|
|
97
|
+
const p = H(null);
|
|
98
|
+
X(() => {
|
|
99
|
+
var C, O;
|
|
100
100
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!u,
|
|
102
102
|
hasUser: !!s,
|
|
@@ -112,7 +112,7 @@ const Be = et({
|
|
|
112
112
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((C = p.current) == null ? void 0 : C.serviceId) === u && ((O = p.current) == null ? void 0 : O.userId) === s.id) {
|
|
116
116
|
o(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,35 +120,35 @@ const Be = et({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
o("🚀 STARTING USER CONNECTION", { userId: s.id }), k.current = !0,
|
|
123
|
+
o("🚀 STARTING USER CONNECTION", { userId: s.id }), k.current = !0, v(!0), w(null);
|
|
124
124
|
try {
|
|
125
125
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const _ = await u.connectUser(s);
|
|
127
|
-
|
|
127
|
+
b(_), y(!0), p.current = { serviceId: u, userId: s.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: _.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (_) {
|
|
132
132
|
const R = _ instanceof Error ? _.message : "Connection failed";
|
|
133
|
-
|
|
133
|
+
w(R), o("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
135
|
error: R
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
v(!1), k.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: x
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [u, s, o, x]),
|
|
144
|
+
}, [u, s, o, x]), X(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!u,
|
|
146
146
|
isConnected: x
|
|
147
147
|
}), () => {
|
|
148
148
|
u && x ? (o(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), p.current = null, u.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!u,
|
|
153
153
|
isConnected: x
|
|
154
154
|
});
|
|
@@ -161,83 +161,83 @@ const Be = et({
|
|
|
161
161
|
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
o("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
|
|
165
165
|
try {
|
|
166
166
|
o("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
167
|
+
const d = await u.connectUser(s);
|
|
168
|
+
b(d), y(!0), w(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (d) {
|
|
170
|
+
const C = d instanceof Error ? d.message : "Refresh failed";
|
|
171
|
+
w(C), o("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: C
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
v(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [u, s, o]),
|
|
178
|
+
}, [u, s, o]), g = B.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!u,
|
|
180
|
-
hasClient: !!
|
|
180
|
+
hasClient: !!h,
|
|
181
181
|
isConnected: x,
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
182
|
+
isLoading: r,
|
|
183
|
+
hasError: !!E,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: u,
|
|
187
|
-
client:
|
|
187
|
+
client: h,
|
|
188
188
|
isConnected: x,
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
189
|
+
isLoading: r,
|
|
190
|
+
error: E,
|
|
191
191
|
capabilities: l,
|
|
192
192
|
refreshConnection: T,
|
|
193
|
-
debug:
|
|
193
|
+
debug: c
|
|
194
194
|
}), [
|
|
195
195
|
u,
|
|
196
|
-
|
|
196
|
+
h,
|
|
197
197
|
x,
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
r,
|
|
199
|
+
E,
|
|
200
200
|
l,
|
|
201
201
|
T,
|
|
202
|
-
|
|
202
|
+
c,
|
|
203
203
|
o
|
|
204
204
|
]);
|
|
205
205
|
return o("🔄 RENDER END", {
|
|
206
206
|
renderCount: m.current,
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
207
|
+
willRenderChat: !!(h && x),
|
|
208
|
+
contextValueReady: !!g
|
|
209
|
+
}), /* @__PURE__ */ e(qe.Provider, { value: g, children: h && x ? /* @__PURE__ */ e(
|
|
210
|
+
ht,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: h,
|
|
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
|
-
},
|
|
219
|
+
}, ns = () => pe(), rs = (t, s) => {
|
|
220
220
|
const n = new Date(
|
|
221
221
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
222
|
), l = new Date(
|
|
223
223
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
225
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
226
|
-
},
|
|
226
|
+
}, as = (t) => {
|
|
227
227
|
const s = /* @__PURE__ */ new Date();
|
|
228
228
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
230
|
-
const
|
|
231
|
-
return
|
|
230
|
+
const a = rs(t, s);
|
|
231
|
+
return a === 0 ? t.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit",
|
|
234
234
|
hour12: !0
|
|
235
|
-
}) :
|
|
235
|
+
}) : a === 1 ? "Yesterday" : a < 7 ? `${a}d` : a < 28 ? `${Math.floor(a / 7)}w` : t.toLocaleDateString("en-US", {
|
|
236
236
|
month: "numeric",
|
|
237
237
|
day: "numeric",
|
|
238
238
|
year: "2-digit"
|
|
239
239
|
});
|
|
240
|
-
},
|
|
240
|
+
}, ze = [
|
|
241
241
|
"🍎",
|
|
242
242
|
// Apple
|
|
243
243
|
"🍌",
|
|
@@ -265,37 +265,37 @@ const Be = et({
|
|
|
265
265
|
"🍈"
|
|
266
266
|
// Melon
|
|
267
267
|
];
|
|
268
|
-
function
|
|
268
|
+
function os(t) {
|
|
269
269
|
let s = 0;
|
|
270
270
|
for (let n = 0; n < t.length; n++) {
|
|
271
|
-
const
|
|
272
|
-
s = (s << 5) - s +
|
|
271
|
+
const a = t.charCodeAt(n);
|
|
272
|
+
s = (s << 5) - s + a, s = s & s;
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
278
|
-
return
|
|
276
|
+
function ls(t) {
|
|
277
|
+
const n = os(t) % ze.length;
|
|
278
|
+
return ze[n];
|
|
279
279
|
}
|
|
280
|
-
const
|
|
280
|
+
const ne = ({
|
|
281
281
|
id: t,
|
|
282
282
|
image: s,
|
|
283
283
|
size: n = 40,
|
|
284
|
-
className:
|
|
284
|
+
className: a,
|
|
285
285
|
shape: l = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const
|
|
287
|
+
const c = ls(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", f = l === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
291
291
|
return /* @__PURE__ */ e(
|
|
292
292
|
"div",
|
|
293
293
|
{
|
|
294
|
-
className: D("flex-shrink-0 overflow-hidden",
|
|
294
|
+
className: D("flex-shrink-0 overflow-hidden", a),
|
|
295
295
|
style: {
|
|
296
296
|
width: `${n}px`,
|
|
297
297
|
height: `${n}px`,
|
|
298
|
-
...
|
|
298
|
+
...f
|
|
299
299
|
},
|
|
300
300
|
children: s ? /* @__PURE__ */ e(
|
|
301
301
|
"img",
|
|
@@ -312,12 +312,12 @@ const ee = ({
|
|
|
312
312
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
313
313
|
u
|
|
314
314
|
),
|
|
315
|
-
children:
|
|
315
|
+
children: c
|
|
316
316
|
}
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, is = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
321
321
|
"svg",
|
|
322
322
|
{
|
|
323
323
|
width: t,
|
|
@@ -334,88 +334,88 @@ const ee = ({
|
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
}
|
|
337
|
-
),
|
|
337
|
+
), cs = (t) => {
|
|
338
338
|
var s;
|
|
339
339
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
340
|
-
},
|
|
340
|
+
}, ds = (t) => {
|
|
341
341
|
var s;
|
|
342
342
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
343
|
-
},
|
|
343
|
+
}, Fe = (t) => {
|
|
344
344
|
var s;
|
|
345
345
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
346
|
-
},
|
|
346
|
+
}, We = (t) => cs(t) || ds(t), us = (t) => {
|
|
347
347
|
var s;
|
|
348
|
-
return
|
|
349
|
-
},
|
|
348
|
+
return We(t) && !((s = t.text) != null && s.trim());
|
|
349
|
+
}, Ie = ({
|
|
350
350
|
message: t,
|
|
351
351
|
standalone: s = !1,
|
|
352
352
|
isMyMessage: n = !1,
|
|
353
|
-
hasAttachment:
|
|
353
|
+
hasAttachment: a = !1
|
|
354
354
|
}) => {
|
|
355
355
|
var x;
|
|
356
|
-
const l =
|
|
357
|
-
if (!l && !
|
|
356
|
+
const l = We(t), c = Fe(t);
|
|
357
|
+
if (!l && !c)
|
|
358
358
|
return null;
|
|
359
359
|
if (l) {
|
|
360
|
-
const
|
|
361
|
-
if (!
|
|
362
|
-
const
|
|
363
|
-
return /* @__PURE__ */ i("div", { className:
|
|
364
|
-
/* @__PURE__ */ e(
|
|
365
|
-
/* @__PURE__ */ e("span", { children:
|
|
360
|
+
const y = (x = t.metadata) == null ? void 0 : x.amount_text;
|
|
361
|
+
if (!y) return null;
|
|
362
|
+
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", v = s ? `${y} tip` : `Delivered with ${y} tip`;
|
|
363
|
+
return /* @__PURE__ */ i("div", { className: r, children: [
|
|
364
|
+
/* @__PURE__ */ e(Qt, { size: s ? 14 : 12 }),
|
|
365
|
+
/* @__PURE__ */ e("span", { children: v })
|
|
366
366
|
] });
|
|
367
367
|
}
|
|
368
|
-
const o = n &&
|
|
368
|
+
const o = n && a, u = o ? "Sent with AI" : "Sent with DM Agent", f = [
|
|
369
369
|
"message-chatbot-indicator",
|
|
370
370
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
371
371
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
372
|
-
].join(" "),
|
|
373
|
-
return /* @__PURE__ */ e("div", { className:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
] }) : /* @__PURE__ */ i(
|
|
377
|
-
|
|
378
|
-
|
|
372
|
+
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: u }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(is, { size: o ? 12 : 15 }) });
|
|
373
|
+
return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ i(me, { children: [
|
|
374
|
+
h,
|
|
375
|
+
b
|
|
376
|
+
] }) : /* @__PURE__ */ i(me, { children: [
|
|
377
|
+
b,
|
|
378
|
+
h
|
|
379
379
|
] }) });
|
|
380
|
-
},
|
|
380
|
+
}, Ye = B.memo(
|
|
381
381
|
({
|
|
382
382
|
channel: t,
|
|
383
383
|
selectedChannel: s,
|
|
384
384
|
onChannelSelect: n,
|
|
385
|
-
debug:
|
|
385
|
+
debug: a = !1,
|
|
386
386
|
unread: l,
|
|
387
|
-
renderMessagePreview:
|
|
387
|
+
renderMessagePreview: c
|
|
388
388
|
}) => {
|
|
389
|
-
var
|
|
389
|
+
var p, T, g, d, C, O;
|
|
390
390
|
const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
|
|
391
391
|
t && n(t);
|
|
392
|
-
},
|
|
393
|
-
const R = _.key === "Enter" || _.key === " ",
|
|
394
|
-
!R ||
|
|
395
|
-
},
|
|
392
|
+
}, f = (_) => {
|
|
393
|
+
const R = _.key === "Enter" || _.key === " ", I = _.repeat;
|
|
394
|
+
!R || I || (_.preventDefault(), u());
|
|
395
|
+
}, b = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
|
|
396
396
|
(_) => {
|
|
397
|
-
var R,
|
|
398
|
-
return ((R = _.user) == null ? void 0 : R.id) && _.user.id !== ((
|
|
397
|
+
var R, I;
|
|
398
|
+
return ((R = _.user) == null ? void 0 : R.id) && _.user.id !== ((I = t == null ? void 0 : t._client) == null ? void 0 : I.userID);
|
|
399
399
|
}
|
|
400
|
-
), x = ((T =
|
|
400
|
+
), x = ((T = b == null ? void 0 : b.user) == null ? void 0 : T.name) || "Conversation", y = (g = b == null ? void 0 : b.user) == null ? void 0 : g.image, r = (C = (d = t == null ? void 0 : t.state) == null ? void 0 : d.messages) == null ? void 0 : C[t.state.messages.length - 1], E = (() => {
|
|
401
401
|
var R;
|
|
402
|
-
if (
|
|
403
|
-
const _ = (R =
|
|
402
|
+
if (r != null && r.text) return r.text;
|
|
403
|
+
const _ = (R = r == null ? void 0 : r.attachments) == null ? void 0 : R[0];
|
|
404
404
|
return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
405
|
-
})(),
|
|
406
|
-
return
|
|
405
|
+
})(), w = r != null && r.created_at ? as(new Date(r.created_at)) : "", k = r ? Fe(r) : !1, N = c ? c(r, E) : `${k ? "✨ " : ""}${E}`, m = l ?? 0;
|
|
406
|
+
return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
407
407
|
channelId: t == null ? void 0 : t.id,
|
|
408
408
|
isSelected: o,
|
|
409
409
|
participantName: x,
|
|
410
410
|
unreadCount: m,
|
|
411
|
-
hasTimestamp: !!
|
|
411
|
+
hasTimestamp: !!w
|
|
412
412
|
}), /* @__PURE__ */ e(
|
|
413
413
|
"div",
|
|
414
414
|
{
|
|
415
415
|
role: "button",
|
|
416
416
|
tabIndex: 0,
|
|
417
417
|
onClick: u,
|
|
418
|
-
onKeyDown:
|
|
418
|
+
onKeyDown: f,
|
|
419
419
|
className: D(
|
|
420
420
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
421
421
|
{
|
|
@@ -425,11 +425,11 @@ const ee = ({
|
|
|
425
425
|
),
|
|
426
426
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
427
427
|
/* @__PURE__ */ e(
|
|
428
|
-
|
|
428
|
+
ne,
|
|
429
429
|
{
|
|
430
|
-
id: ((
|
|
430
|
+
id: ((O = b == null ? void 0 : b.user) == null ? void 0 : O.id) || t.id || "unknown",
|
|
431
431
|
name: x,
|
|
432
|
-
image:
|
|
432
|
+
image: y,
|
|
433
433
|
size: 44,
|
|
434
434
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
435
435
|
}
|
|
@@ -446,7 +446,7 @@ const ee = ({
|
|
|
446
446
|
children: x
|
|
447
447
|
}
|
|
448
448
|
),
|
|
449
|
-
|
|
449
|
+
w && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: w })
|
|
450
450
|
] }),
|
|
451
451
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
452
452
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
|
|
@@ -458,48 +458,48 @@ const ee = ({
|
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
460
|
);
|
|
461
|
-
|
|
462
|
-
const
|
|
461
|
+
Ye.displayName = "CustomChannelPreview";
|
|
462
|
+
const Ze = B.memo(
|
|
463
463
|
({
|
|
464
464
|
onChannelSelect: t,
|
|
465
465
|
selectedChannel: s,
|
|
466
466
|
filters: n,
|
|
467
|
-
className:
|
|
467
|
+
className: a,
|
|
468
468
|
customEmptyStateIndicator: l,
|
|
469
|
-
renderMessagePreview:
|
|
469
|
+
renderMessagePreview: c
|
|
470
470
|
}) => {
|
|
471
471
|
const o = B.useRef(0);
|
|
472
472
|
o.current++;
|
|
473
|
-
const { debug: u = !1 } =
|
|
473
|
+
const { debug: u = !1 } = pe();
|
|
474
474
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
475
475
|
renderCount: o.current,
|
|
476
476
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
477
477
|
filters: n
|
|
478
478
|
});
|
|
479
|
-
const
|
|
480
|
-
|
|
479
|
+
const f = B.useMemo(() => (b) => /* @__PURE__ */ e(
|
|
480
|
+
Ye,
|
|
481
481
|
{
|
|
482
|
-
...
|
|
482
|
+
...b,
|
|
483
483
|
selectedChannel: s,
|
|
484
484
|
onChannelSelect: t,
|
|
485
485
|
debug: u,
|
|
486
|
-
renderMessagePreview:
|
|
486
|
+
renderMessagePreview: c
|
|
487
487
|
}
|
|
488
|
-
), [s, t, u,
|
|
488
|
+
), [s, t, u, c]);
|
|
489
489
|
return /* @__PURE__ */ e(
|
|
490
490
|
"div",
|
|
491
491
|
{
|
|
492
492
|
className: D(
|
|
493
493
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
494
|
-
|
|
494
|
+
a
|
|
495
495
|
),
|
|
496
496
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
497
|
-
|
|
497
|
+
ft,
|
|
498
498
|
{
|
|
499
499
|
filters: n,
|
|
500
500
|
sort: { last_message_at: -1 },
|
|
501
501
|
options: { limit: 30 },
|
|
502
|
-
Preview:
|
|
502
|
+
Preview: f,
|
|
503
503
|
EmptyStateIndicator: l
|
|
504
504
|
},
|
|
505
505
|
JSON.stringify(n)
|
|
@@ -508,12 +508,12 @@ const Ge = B.memo(
|
|
|
508
508
|
);
|
|
509
509
|
}
|
|
510
510
|
);
|
|
511
|
-
|
|
512
|
-
const
|
|
511
|
+
Ze.displayName = "ChannelList";
|
|
512
|
+
const Ce = ({
|
|
513
513
|
variant: t = "default",
|
|
514
514
|
className: s,
|
|
515
515
|
children: n,
|
|
516
|
-
...
|
|
516
|
+
...a
|
|
517
517
|
}) => /* @__PURE__ */ e(
|
|
518
518
|
"button",
|
|
519
519
|
{
|
|
@@ -523,11 +523,11 @@ const fe = ({
|
|
|
523
523
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
524
524
|
s
|
|
525
525
|
),
|
|
526
|
-
...
|
|
526
|
+
...a,
|
|
527
527
|
children: n
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
|
-
function
|
|
530
|
+
function Xe({ label: t, className: s, children: n, ...a }) {
|
|
531
531
|
return /* @__PURE__ */ i(
|
|
532
532
|
"button",
|
|
533
533
|
{
|
|
@@ -535,12 +535,12 @@ function ze({ label: t, className: s, children: n, ...r }) {
|
|
|
535
535
|
className: D(
|
|
536
536
|
"rounded-full p-2 transition-colors focus-ring",
|
|
537
537
|
{
|
|
538
|
-
"cursor-not-allowed opacity-50":
|
|
539
|
-
"hover:bg-sand": !
|
|
538
|
+
"cursor-not-allowed opacity-50": a.disabled,
|
|
539
|
+
"hover:bg-sand": !a.disabled
|
|
540
540
|
},
|
|
541
541
|
s
|
|
542
542
|
),
|
|
543
|
-
...
|
|
543
|
+
...a,
|
|
544
544
|
children: [
|
|
545
545
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
546
546
|
n
|
|
@@ -548,41 +548,41 @@ function ze({ label: t, className: s, children: n, ...r }) {
|
|
|
548
548
|
}
|
|
549
549
|
);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
return /* @__PURE__ */ e(
|
|
551
|
+
function Qe({ onClick: t }) {
|
|
552
|
+
return /* @__PURE__ */ e(Xe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
556
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
554
|
+
const ms = (t) => /* @__PURE__ */ e(gt, { ...t, position: "center" }), ke = "vote_up", De = "vote_down";
|
|
555
|
+
function hs(t) {
|
|
556
|
+
return t != null && t.length ? t.some((s) => s.type === De) ? "down" : t.some((s) => s.type === ke) ? "up" : null : null;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
const { channel: s } =
|
|
560
|
-
() =>
|
|
558
|
+
function fs(t) {
|
|
559
|
+
const { channel: s } = Te(), { client: n } = Ve("useMessageVote"), a = Me(
|
|
560
|
+
() => hs(t.own_reactions),
|
|
561
561
|
[t.own_reactions]
|
|
562
562
|
), l = L(async () => {
|
|
563
563
|
if (n != null && n.userID)
|
|
564
564
|
try {
|
|
565
|
-
|
|
565
|
+
a === "up" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
|
|
566
566
|
t.id,
|
|
567
|
-
{ type:
|
|
567
|
+
{ type: ke },
|
|
568
568
|
{ enforce_unique: !0, skip_push: !0 }
|
|
569
569
|
);
|
|
570
570
|
} catch {
|
|
571
571
|
}
|
|
572
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
572
|
+
}, [s, n == null ? void 0 : n.userID, t.id, a]), c = L(async () => {
|
|
573
573
|
if (n != null && n.userID)
|
|
574
574
|
try {
|
|
575
|
-
|
|
575
|
+
a === "down" ? await s.deleteReaction(t.id, De) : await s.sendReaction(
|
|
576
576
|
t.id,
|
|
577
|
-
{ type:
|
|
577
|
+
{ type: De },
|
|
578
578
|
{ enforce_unique: !0, skip_push: !0 }
|
|
579
579
|
);
|
|
580
580
|
} catch {
|
|
581
581
|
}
|
|
582
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
583
|
-
return { selected:
|
|
582
|
+
}, [s, n == null ? void 0 : n.userID, t.id, a]);
|
|
583
|
+
return { selected: a, voteUp: l, voteDown: c };
|
|
584
584
|
}
|
|
585
|
-
const
|
|
585
|
+
const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
586
586
|
"path",
|
|
587
587
|
{
|
|
588
588
|
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",
|
|
@@ -592,7 +592,7 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
592
592
|
strokeLinejoin: "round",
|
|
593
593
|
fill: t ? "currentColor" : "none"
|
|
594
594
|
}
|
|
595
|
-
) }),
|
|
595
|
+
) }), xs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
596
596
|
"path",
|
|
597
597
|
{
|
|
598
598
|
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",
|
|
@@ -602,7 +602,7 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
602
602
|
strokeLinejoin: "round",
|
|
603
603
|
fill: t ? "currentColor" : "none"
|
|
604
604
|
}
|
|
605
|
-
) }),
|
|
605
|
+
) }), bs = ({
|
|
606
606
|
selected: t,
|
|
607
607
|
onVoteUp: s,
|
|
608
608
|
onVoteDown: n
|
|
@@ -615,7 +615,7 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
615
615
|
onClick: s,
|
|
616
616
|
"aria-label": "Helpful",
|
|
617
617
|
"aria-pressed": t === "up",
|
|
618
|
-
children: /* @__PURE__ */ e(
|
|
618
|
+
children: /* @__PURE__ */ e(gs, { filled: t === "up" })
|
|
619
619
|
}
|
|
620
620
|
),
|
|
621
621
|
/* @__PURE__ */ e(
|
|
@@ -626,104 +626,104 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
626
626
|
onClick: n,
|
|
627
627
|
"aria-label": "Not helpful",
|
|
628
628
|
"aria-pressed": t === "down",
|
|
629
|
-
children: /* @__PURE__ */ e(
|
|
629
|
+
children: /* @__PURE__ */ e(xs, { filled: t === "down" })
|
|
630
630
|
}
|
|
631
631
|
)
|
|
632
|
-
] }),
|
|
633
|
-
var
|
|
632
|
+
] }), Cs = (t) => {
|
|
633
|
+
var ge, te;
|
|
634
634
|
const {
|
|
635
635
|
additionalMessageInputProps: s,
|
|
636
636
|
chatbotVotingEnabled: n,
|
|
637
|
-
editing:
|
|
637
|
+
editing: a,
|
|
638
638
|
endOfGroup: l,
|
|
639
|
-
firstOfGroup:
|
|
639
|
+
firstOfGroup: c,
|
|
640
640
|
groupedByUser: o,
|
|
641
641
|
handleAction: u,
|
|
642
|
-
handleOpenThread:
|
|
643
|
-
handleRetry:
|
|
644
|
-
highlighted:
|
|
642
|
+
handleOpenThread: f,
|
|
643
|
+
handleRetry: h,
|
|
644
|
+
highlighted: b,
|
|
645
645
|
isMessageAIGenerated: x,
|
|
646
|
-
isMyMessage:
|
|
647
|
-
message:
|
|
648
|
-
renderText:
|
|
649
|
-
threadList:
|
|
650
|
-
} = t, { client:
|
|
651
|
-
Attachment:
|
|
652
|
-
EditMessageModal:
|
|
653
|
-
MessageBlocked:
|
|
654
|
-
MessageBouncePrompt: _ =
|
|
655
|
-
MessageDeleted: R =
|
|
656
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
657
|
-
MessageRepliesCountButton:
|
|
658
|
-
ReminderNotification:
|
|
659
|
-
StreamedMessageText:
|
|
646
|
+
isMyMessage: y,
|
|
647
|
+
message: r,
|
|
648
|
+
renderText: v,
|
|
649
|
+
threadList: E
|
|
650
|
+
} = t, { client: w } = Ve("CustomMessage"), [k, N] = M(!1), m = bt(r.id), { selected: p, voteUp: T, voteDown: g } = fs(r), {
|
|
651
|
+
Attachment: d = Nt,
|
|
652
|
+
EditMessageModal: C = yt,
|
|
653
|
+
MessageBlocked: O = vt,
|
|
654
|
+
MessageBouncePrompt: _ = wt,
|
|
655
|
+
MessageDeleted: R = pt,
|
|
656
|
+
MessageIsThreadReplyInChannelButtonIndicator: I = Et,
|
|
657
|
+
MessageRepliesCountButton: Y = _t,
|
|
658
|
+
ReminderNotification: V = It,
|
|
659
|
+
StreamedMessageText: re = St,
|
|
660
660
|
PinIndicator: J
|
|
661
|
-
} =
|
|
662
|
-
() => x == null ? void 0 : x(
|
|
663
|
-
[x,
|
|
664
|
-
), j =
|
|
665
|
-
() => !
|
|
666
|
-
[
|
|
661
|
+
} = Ct("CustomMessage"), ae = Mt(r), oe = kt(r), ue = Me(
|
|
662
|
+
() => x == null ? void 0 : x(r),
|
|
663
|
+
[x, r]
|
|
664
|
+
), j = Me(
|
|
665
|
+
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
666
|
+
[r]
|
|
667
667
|
);
|
|
668
|
-
if (
|
|
668
|
+
if (Dt(r))
|
|
669
669
|
return null;
|
|
670
|
-
if (
|
|
671
|
-
return /* @__PURE__ */ e(R, { message:
|
|
672
|
-
if (
|
|
673
|
-
return /* @__PURE__ */ e(
|
|
674
|
-
const
|
|
670
|
+
if (r.deleted_at || r.type === "deleted")
|
|
671
|
+
return /* @__PURE__ */ e(R, { message: r });
|
|
672
|
+
if (Tt(r))
|
|
673
|
+
return /* @__PURE__ */ e(O, {});
|
|
674
|
+
const K = !E && !!r.reply_count, A = !E && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((ge = r.error) == null ? void 0 : ge.status) !== 403, q = Rt(r);
|
|
675
675
|
let F;
|
|
676
|
-
U ? F = () =>
|
|
677
|
-
const
|
|
676
|
+
U ? F = () => h(r) : q && (F = () => N(!0));
|
|
677
|
+
const z = y(), he = D(
|
|
678
678
|
"str-chat__message str-chat__message-simple",
|
|
679
|
-
`str-chat__message--${
|
|
680
|
-
`str-chat__message--${
|
|
681
|
-
|
|
682
|
-
|
|
679
|
+
`str-chat__message--${r.type}`,
|
|
680
|
+
`str-chat__message--${r.status}`,
|
|
681
|
+
z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
682
|
+
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
683
683
|
{
|
|
684
|
-
"str-chat__message--has-attachment":
|
|
685
|
-
"str-chat__message--highlighted":
|
|
686
|
-
"str-chat__message--pinned pinned-message":
|
|
687
|
-
"str-chat__message--with-reactions":
|
|
688
|
-
"str-chat__message-send-can-be-retried": (
|
|
689
|
-
"str-chat__message-with-thread-link":
|
|
684
|
+
"str-chat__message--has-attachment": ae,
|
|
685
|
+
"str-chat__message--highlighted": b,
|
|
686
|
+
"str-chat__message--pinned pinned-message": r.pinned,
|
|
687
|
+
"str-chat__message--with-reactions": oe,
|
|
688
|
+
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((te = r == null ? void 0 : r.error) == null ? void 0 : te.status) !== 403,
|
|
689
|
+
"str-chat__message-with-thread-link": K || A,
|
|
690
690
|
"str-chat__virtual-message__wrapper--end": l,
|
|
691
|
-
"str-chat__virtual-message__wrapper--first":
|
|
691
|
+
"str-chat__virtual-message__wrapper--first": c,
|
|
692
692
|
"str-chat__virtual-message__wrapper--group": o
|
|
693
693
|
}
|
|
694
|
-
),
|
|
695
|
-
return /* @__PURE__ */ i(
|
|
696
|
-
|
|
697
|
-
|
|
694
|
+
), Q = r.poll_id && w.polls.fromState(r.poll_id), le = us(r), ee = Fe(r), ie = !!(j != null && j.length && !r.quoted_message), fe = ee && z && ie;
|
|
695
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
696
|
+
a && /* @__PURE__ */ e(
|
|
697
|
+
C,
|
|
698
698
|
{
|
|
699
699
|
additionalMessageInputProps: s
|
|
700
700
|
}
|
|
701
701
|
),
|
|
702
702
|
k && /* @__PURE__ */ e(
|
|
703
|
-
|
|
703
|
+
Ft,
|
|
704
704
|
{
|
|
705
705
|
MessageBouncePrompt: _,
|
|
706
706
|
onClose: () => N(!1),
|
|
707
707
|
open: k
|
|
708
708
|
}
|
|
709
709
|
),
|
|
710
|
-
/* @__PURE__ */ i("div", { className:
|
|
710
|
+
/* @__PURE__ */ i("div", { className: he, children: [
|
|
711
711
|
J && /* @__PURE__ */ e(J, {}),
|
|
712
|
-
!!m && /* @__PURE__ */ e(
|
|
713
|
-
|
|
714
|
-
|
|
712
|
+
!!m && /* @__PURE__ */ e(V, { reminder: m }),
|
|
713
|
+
r.user && /* @__PURE__ */ e(
|
|
714
|
+
ne,
|
|
715
715
|
{
|
|
716
716
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
717
|
-
id:
|
|
718
|
-
image:
|
|
719
|
-
name:
|
|
717
|
+
id: r.user.id,
|
|
718
|
+
image: r.user.image,
|
|
719
|
+
name: r.user.name || r.user.id
|
|
720
720
|
}
|
|
721
721
|
),
|
|
722
722
|
/* @__PURE__ */ e(
|
|
723
723
|
"div",
|
|
724
724
|
{
|
|
725
725
|
className: D("str-chat__message-inner", {
|
|
726
|
-
"str-chat__simple-message--error-failed": U ||
|
|
726
|
+
"str-chat__simple-message--error-failed": U || q
|
|
727
727
|
}),
|
|
728
728
|
"data-testid": "message-inner",
|
|
729
729
|
onClick: F,
|
|
@@ -736,80 +736,80 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
736
736
|
marginInlineEnd: 0,
|
|
737
737
|
marginInlineStart: 0
|
|
738
738
|
},
|
|
739
|
-
children:
|
|
739
|
+
children: le ? (
|
|
740
740
|
/* Tip-only messages render as a standalone bubble */
|
|
741
|
-
/* @__PURE__ */ e(
|
|
741
|
+
/* @__PURE__ */ e(Ie, { message: r, standalone: !0 })
|
|
742
742
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
743
743
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
744
|
-
|
|
745
|
-
|
|
744
|
+
ee && !fe && /* @__PURE__ */ e(
|
|
745
|
+
Ie,
|
|
746
746
|
{
|
|
747
|
-
message:
|
|
748
|
-
hasAttachment:
|
|
749
|
-
isMyMessage:
|
|
747
|
+
message: r,
|
|
748
|
+
hasAttachment: ie,
|
|
749
|
+
isMyMessage: z
|
|
750
750
|
}
|
|
751
751
|
),
|
|
752
|
-
|
|
753
|
-
j != null && j.length && !
|
|
754
|
-
|
|
752
|
+
Q && /* @__PURE__ */ e(Lt, { poll: Q }),
|
|
753
|
+
j != null && j.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
754
|
+
d,
|
|
755
755
|
{
|
|
756
756
|
actionHandler: u,
|
|
757
757
|
attachments: j
|
|
758
758
|
}
|
|
759
759
|
) : null,
|
|
760
|
-
|
|
761
|
-
|
|
760
|
+
ue ? /* @__PURE__ */ e(
|
|
761
|
+
re,
|
|
762
762
|
{
|
|
763
|
-
message:
|
|
764
|
-
renderText:
|
|
763
|
+
message: r,
|
|
764
|
+
renderText: v
|
|
765
765
|
}
|
|
766
|
-
) : /* @__PURE__ */ e(
|
|
767
|
-
/* @__PURE__ */ e(
|
|
766
|
+
) : /* @__PURE__ */ e(At, { message: r, renderText: v }),
|
|
767
|
+
/* @__PURE__ */ e(Ut, {})
|
|
768
768
|
] }),
|
|
769
|
-
(!
|
|
770
|
-
|
|
769
|
+
(!ee || fe) && /* @__PURE__ */ e(
|
|
770
|
+
Ie,
|
|
771
771
|
{
|
|
772
|
-
message:
|
|
773
|
-
hasAttachment:
|
|
774
|
-
isMyMessage:
|
|
772
|
+
message: r,
|
|
773
|
+
hasAttachment: ie,
|
|
774
|
+
isMyMessage: z
|
|
775
775
|
}
|
|
776
776
|
),
|
|
777
|
-
n &&
|
|
778
|
-
|
|
777
|
+
n && ee && /* @__PURE__ */ e(
|
|
778
|
+
bs,
|
|
779
779
|
{
|
|
780
|
-
selected:
|
|
780
|
+
selected: p,
|
|
781
781
|
onVoteUp: T,
|
|
782
|
-
onVoteDown:
|
|
782
|
+
onVoteDown: g
|
|
783
783
|
}
|
|
784
784
|
)
|
|
785
785
|
] })
|
|
786
786
|
}
|
|
787
787
|
),
|
|
788
|
-
|
|
789
|
-
|
|
788
|
+
K && /* @__PURE__ */ e(
|
|
789
|
+
Y,
|
|
790
790
|
{
|
|
791
|
-
onClick:
|
|
792
|
-
reply_count:
|
|
791
|
+
onClick: f,
|
|
792
|
+
reply_count: r.reply_count
|
|
793
793
|
}
|
|
794
794
|
),
|
|
795
|
-
|
|
796
|
-
] },
|
|
795
|
+
A && /* @__PURE__ */ e(I, {})
|
|
796
|
+
] }, r.id)
|
|
797
797
|
] });
|
|
798
|
-
},
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
),
|
|
802
|
-
const s =
|
|
803
|
-
return /* @__PURE__ */ e(
|
|
804
|
-
},
|
|
798
|
+
}, Ns = B.memo(
|
|
799
|
+
Cs,
|
|
800
|
+
xt
|
|
801
|
+
), ys = (t) => {
|
|
802
|
+
const s = Pt("CustomMessage");
|
|
803
|
+
return /* @__PURE__ */ e(Ns, { ...s, ...t });
|
|
804
|
+
}, vs = (t) => ({
|
|
805
805
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
806
|
-
(s) =>
|
|
806
|
+
(s) => $e.previewIsLoaded(s) || $e.previewIsLoading(s)
|
|
807
807
|
)
|
|
808
|
-
}),
|
|
808
|
+
}), ws = ({
|
|
809
809
|
link: t,
|
|
810
810
|
onDismiss: s
|
|
811
811
|
}) => {
|
|
812
|
-
const { og_scrape_url: n, title:
|
|
812
|
+
const { og_scrape_url: n, title: a, image_url: l } = t;
|
|
813
813
|
return /* @__PURE__ */ i(
|
|
814
814
|
"a",
|
|
815
815
|
{
|
|
@@ -822,7 +822,7 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
822
822
|
"img",
|
|
823
823
|
{
|
|
824
824
|
src: l,
|
|
825
|
-
alt:
|
|
825
|
+
alt: a || "",
|
|
826
826
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
827
827
|
}
|
|
828
828
|
),
|
|
@@ -835,42 +835,42 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
835
835
|
},
|
|
836
836
|
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",
|
|
837
837
|
"aria-label": "Close link preview",
|
|
838
|
-
children: /* @__PURE__ */ e(
|
|
838
|
+
children: /* @__PURE__ */ e(Re, { className: "size-4 text-black/90" })
|
|
839
839
|
}
|
|
840
840
|
),
|
|
841
841
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
842
|
-
|
|
842
|
+
a && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: a }),
|
|
843
843
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
844
844
|
] })
|
|
845
845
|
]
|
|
846
846
|
}
|
|
847
847
|
);
|
|
848
|
-
},
|
|
849
|
-
const { linkPreviewsManager: t } =
|
|
848
|
+
}, ps = () => {
|
|
849
|
+
const { linkPreviewsManager: t } = Ot(), { linkPreviews: s } = Bt(
|
|
850
850
|
t.state,
|
|
851
|
-
|
|
851
|
+
vs
|
|
852
852
|
), n = (l) => {
|
|
853
853
|
t.dismissPreview(l);
|
|
854
854
|
};
|
|
855
855
|
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(
|
|
856
|
-
|
|
856
|
+
ws,
|
|
857
857
|
{
|
|
858
858
|
link: l,
|
|
859
859
|
onDismiss: n
|
|
860
860
|
},
|
|
861
861
|
l.og_scrape_url
|
|
862
862
|
)) }) : null;
|
|
863
|
-
},
|
|
864
|
-
const { handleSubmit: t } =
|
|
865
|
-
return /* @__PURE__ */ i(
|
|
866
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
863
|
+
}, Es = () => {
|
|
864
|
+
const { handleSubmit: t } = $t(), s = zt();
|
|
865
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
866
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Gt, {}) }),
|
|
867
867
|
/* @__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: [
|
|
868
|
-
/* @__PURE__ */ e(
|
|
869
|
-
/* @__PURE__ */ e(
|
|
870
|
-
/* @__PURE__ */ e(
|
|
868
|
+
/* @__PURE__ */ e(Ht, {}),
|
|
869
|
+
/* @__PURE__ */ e(ps, {}),
|
|
870
|
+
/* @__PURE__ */ e(Vt, {}),
|
|
871
871
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
872
872
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
873
|
-
|
|
873
|
+
qt,
|
|
874
874
|
{
|
|
875
875
|
className: "w-full resize-none outline-none leading-6",
|
|
876
876
|
autoFocus: !0,
|
|
@@ -886,36 +886,36 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
886
886
|
disabled: !s,
|
|
887
887
|
onClick: t,
|
|
888
888
|
type: "button",
|
|
889
|
-
children: /* @__PURE__ */ e(
|
|
889
|
+
children: /* @__PURE__ */ e(Jt, { className: "size-4" })
|
|
890
890
|
}
|
|
891
891
|
)
|
|
892
892
|
] })
|
|
893
893
|
] })
|
|
894
894
|
] });
|
|
895
|
-
},
|
|
895
|
+
}, _s = ({
|
|
896
896
|
renderActions: t
|
|
897
897
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
898
898
|
t && (t == null ? void 0 : t()),
|
|
899
|
-
/* @__PURE__ */ e(
|
|
900
|
-
] }),
|
|
899
|
+
/* @__PURE__ */ e(jt, { Input: Es })
|
|
900
|
+
] }), Is = [
|
|
901
901
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
902
902
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
903
|
-
],
|
|
903
|
+
], Ss = {
|
|
904
904
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
905
905
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
906
|
-
},
|
|
907
|
-
var
|
|
908
|
-
const s = (
|
|
909
|
-
if (
|
|
906
|
+
}, Ge = (t) => Is.includes(t), Ms = (t) => {
|
|
907
|
+
var a;
|
|
908
|
+
const s = (a = t.metadata) == null ? void 0 : a.custom_type;
|
|
909
|
+
if (Ge(s))
|
|
910
910
|
return s;
|
|
911
911
|
const n = t.dm_agent_system_type;
|
|
912
|
-
if (
|
|
912
|
+
if (Ge(n))
|
|
913
913
|
return n;
|
|
914
|
-
},
|
|
915
|
-
var
|
|
916
|
-
const s = t.message.hide_date === !0, n =
|
|
914
|
+
}, ks = (t) => {
|
|
915
|
+
var a;
|
|
916
|
+
const s = t.message.hide_date === !0, n = Ms(t.message);
|
|
917
917
|
if (n) {
|
|
918
|
-
const l = ((
|
|
918
|
+
const l = ((a = t.message.text) == null ? void 0 : a.trim()) || Ss[n];
|
|
919
919
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
920
920
|
/* @__PURE__ */ i(
|
|
921
921
|
"div",
|
|
@@ -925,7 +925,7 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
925
925
|
"data-dm-agent-system-type": n,
|
|
926
926
|
children: [
|
|
927
927
|
/* @__PURE__ */ e(
|
|
928
|
-
|
|
928
|
+
Kt,
|
|
929
929
|
{
|
|
930
930
|
size: 16,
|
|
931
931
|
weight: "regular",
|
|
@@ -937,7 +937,7 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
937
937
|
]
|
|
938
938
|
}
|
|
939
939
|
),
|
|
940
|
-
!s && /* @__PURE__ */ e(
|
|
940
|
+
!s && /* @__PURE__ */ e(Ae, { message: t.message })
|
|
941
941
|
] });
|
|
942
942
|
}
|
|
943
943
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -946,9 +946,9 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
946
946
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
947
947
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
948
948
|
] }),
|
|
949
|
-
!s && /* @__PURE__ */ e(
|
|
949
|
+
!s && /* @__PURE__ */ e(Ae, { message: t.message })
|
|
950
950
|
] });
|
|
951
|
-
},
|
|
951
|
+
}, Ds = () => null, Ts = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
952
952
|
"div",
|
|
953
953
|
{
|
|
954
954
|
className: D("flex items-center justify-center h-full", t),
|
|
@@ -991,41 +991,41 @@ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
991
991
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
992
992
|
]
|
|
993
993
|
}
|
|
994
|
-
),
|
|
995
|
-
/* @__PURE__ */ e(
|
|
994
|
+
), ve = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
995
|
+
/* @__PURE__ */ e(Ts, { className: "w-6 h-6" }),
|
|
996
996
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
997
997
|
] }) }));
|
|
998
|
-
|
|
999
|
-
const
|
|
998
|
+
ve.displayName = "LoadingState";
|
|
999
|
+
const Rs = ({
|
|
1000
1000
|
onBack: t,
|
|
1001
1001
|
showBackButton: s,
|
|
1002
1002
|
onShowInfo: n,
|
|
1003
|
-
canShowInfo:
|
|
1003
|
+
canShowInfo: a,
|
|
1004
1004
|
showStarButton: l = !1
|
|
1005
1005
|
}) => {
|
|
1006
|
-
var
|
|
1007
|
-
const { channel:
|
|
1006
|
+
var y, r, v, E, w, k;
|
|
1007
|
+
const { channel: c } = Te(), o = B.useMemo(() => Object.values(c.state.members || {}).find(
|
|
1008
1008
|
(m) => {
|
|
1009
|
-
var
|
|
1010
|
-
return ((
|
|
1009
|
+
var p;
|
|
1010
|
+
return ((p = m.user) == null ? void 0 : p.id) && m.user.id !== c._client.userID;
|
|
1011
1011
|
}
|
|
1012
|
-
), [
|
|
1013
|
-
!!((
|
|
1012
|
+
), [c._client.userID, c.state.members]), u = ((y = o == null ? void 0 : o.user) == null ? void 0 : y.name) || ((r = o == null ? void 0 : o.user) == null ? void 0 : r.id) || "Unknown member", f = (v = o == null ? void 0 : o.user) == null ? void 0 : v.image, [h, b] = M(
|
|
1013
|
+
!!((E = c.state.membership) != null && E.pinned_at)
|
|
1014
1014
|
);
|
|
1015
|
-
|
|
1015
|
+
X(() => {
|
|
1016
1016
|
const N = (m) => {
|
|
1017
|
-
var
|
|
1018
|
-
|
|
1019
|
-
m != null && m.member ? !!m.member.pinned_at : !!((
|
|
1017
|
+
var p;
|
|
1018
|
+
b(
|
|
1019
|
+
m != null && m.member ? !!m.member.pinned_at : !!((p = c.state.membership) != null && p.pinned_at)
|
|
1020
1020
|
);
|
|
1021
1021
|
};
|
|
1022
|
-
return
|
|
1023
|
-
|
|
1022
|
+
return c.on("member.updated", N), () => {
|
|
1023
|
+
c.off("member.updated", N);
|
|
1024
1024
|
};
|
|
1025
|
-
}, [
|
|
1025
|
+
}, [c]);
|
|
1026
1026
|
const x = async () => {
|
|
1027
1027
|
try {
|
|
1028
|
-
|
|
1028
|
+
h ? await c.unpin() : await c.pin();
|
|
1029
1029
|
} catch (N) {
|
|
1030
1030
|
console.error(
|
|
1031
1031
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -1045,16 +1045,16 @@ const ys = ({
|
|
|
1045
1045
|
}),
|
|
1046
1046
|
type: "button",
|
|
1047
1047
|
"aria-label": "Back to conversations",
|
|
1048
|
-
children: /* @__PURE__ */ e(
|
|
1048
|
+
children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
|
|
1049
1049
|
}
|
|
1050
1050
|
) }),
|
|
1051
1051
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1052
1052
|
/* @__PURE__ */ e(
|
|
1053
|
-
|
|
1053
|
+
ne,
|
|
1054
1054
|
{
|
|
1055
|
-
id: ((
|
|
1055
|
+
id: ((w = o == null ? void 0 : o.user) == null ? void 0 : w.id) || c.id || "unknown",
|
|
1056
1056
|
name: u,
|
|
1057
|
-
image:
|
|
1057
|
+
image: f,
|
|
1058
1058
|
size: 40
|
|
1059
1059
|
}
|
|
1060
1060
|
),
|
|
@@ -1067,15 +1067,15 @@ const ys = ({
|
|
|
1067
1067
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1068
1068
|
onClick: x,
|
|
1069
1069
|
type: "button",
|
|
1070
|
-
"aria-label":
|
|
1070
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1071
1071
|
children: /* @__PURE__ */ e(
|
|
1072
|
-
|
|
1072
|
+
Pe,
|
|
1073
1073
|
{
|
|
1074
1074
|
className: D("size-5", {
|
|
1075
|
-
"text-yellow-600":
|
|
1076
|
-
"text-black/90": !
|
|
1075
|
+
"text-yellow-600": h,
|
|
1076
|
+
"text-black/90": !h
|
|
1077
1077
|
}),
|
|
1078
|
-
weight:
|
|
1078
|
+
weight: h ? "duotone" : "regular"
|
|
1079
1079
|
}
|
|
1080
1080
|
)
|
|
1081
1081
|
}
|
|
@@ -1087,7 +1087,7 @@ const ys = ({
|
|
|
1087
1087
|
onClick: n,
|
|
1088
1088
|
type: "button",
|
|
1089
1089
|
"aria-label": "Show info",
|
|
1090
|
-
children: /* @__PURE__ */ e(
|
|
1090
|
+
children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
|
|
1091
1091
|
}
|
|
1092
1092
|
)
|
|
1093
1093
|
] })
|
|
@@ -1101,15 +1101,15 @@ const ys = ({
|
|
|
1101
1101
|
onClick: t,
|
|
1102
1102
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1103
1103
|
"aria-label": "Back to conversations",
|
|
1104
|
-
children: /* @__PURE__ */ e(
|
|
1104
|
+
children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
1107
|
/* @__PURE__ */ e(
|
|
1108
|
-
|
|
1108
|
+
ne,
|
|
1109
1109
|
{
|
|
1110
|
-
id: ((k = o == null ? void 0 : o.user) == null ? void 0 : k.id) ||
|
|
1110
|
+
id: ((k = o == null ? void 0 : o.user) == null ? void 0 : k.id) || c.id || "unknown",
|
|
1111
1111
|
name: u,
|
|
1112
|
-
image:
|
|
1112
|
+
image: f,
|
|
1113
1113
|
size: 40
|
|
1114
1114
|
}
|
|
1115
1115
|
),
|
|
@@ -1122,114 +1122,114 @@ const ys = ({
|
|
|
1122
1122
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1123
1123
|
onClick: x,
|
|
1124
1124
|
type: "button",
|
|
1125
|
-
"aria-label":
|
|
1125
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1126
1126
|
children: /* @__PURE__ */ e(
|
|
1127
|
-
|
|
1127
|
+
Pe,
|
|
1128
1128
|
{
|
|
1129
1129
|
className: D("size-5", {
|
|
1130
|
-
"text-yellow-600":
|
|
1131
|
-
"text-black/90": !
|
|
1130
|
+
"text-yellow-600": h,
|
|
1131
|
+
"text-black/90": !h
|
|
1132
1132
|
}),
|
|
1133
|
-
weight:
|
|
1133
|
+
weight: h ? "duotone" : "regular"
|
|
1134
1134
|
}
|
|
1135
1135
|
)
|
|
1136
1136
|
}
|
|
1137
1137
|
),
|
|
1138
|
-
|
|
1138
|
+
a && n && /* @__PURE__ */ e(
|
|
1139
1139
|
"button",
|
|
1140
1140
|
{
|
|
1141
1141
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1142
1142
|
onClick: n,
|
|
1143
1143
|
type: "button",
|
|
1144
1144
|
"aria-label": "Show info",
|
|
1145
|
-
children: /* @__PURE__ */ e(
|
|
1145
|
+
children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
|
|
1146
1146
|
}
|
|
1147
1147
|
)
|
|
1148
1148
|
] })
|
|
1149
1149
|
] })
|
|
1150
1150
|
] });
|
|
1151
|
-
},
|
|
1151
|
+
}, Fs = ({
|
|
1152
1152
|
dialogRef: t,
|
|
1153
1153
|
onClose: s,
|
|
1154
1154
|
participant: n,
|
|
1155
|
-
channel:
|
|
1155
|
+
channel: a,
|
|
1156
1156
|
followerStatusLabel: l,
|
|
1157
|
-
onLeaveConversation:
|
|
1157
|
+
onLeaveConversation: c,
|
|
1158
1158
|
onBlockParticipant: o,
|
|
1159
1159
|
showDeleteConversation: u = !0,
|
|
1160
|
-
onDeleteConversationClick:
|
|
1161
|
-
onBlockParticipantClick:
|
|
1162
|
-
onReportParticipantClick:
|
|
1160
|
+
onDeleteConversationClick: f,
|
|
1161
|
+
onBlockParticipantClick: h,
|
|
1162
|
+
onReportParticipantClick: b,
|
|
1163
1163
|
customChannelActions: x
|
|
1164
1164
|
}) => {
|
|
1165
|
-
var
|
|
1166
|
-
const { service:
|
|
1167
|
-
var
|
|
1168
|
-
if (!(!
|
|
1165
|
+
var re, J, ae, oe, ue, j, K;
|
|
1166
|
+
const { service: y, debug: r } = pe(), [v, E] = M(!1), [w, k] = M(!1), [N, m] = M(!1), p = L(async () => {
|
|
1167
|
+
var A;
|
|
1168
|
+
if (!(!y || !((A = n == null ? void 0 : n.user) != null && A.id)))
|
|
1169
1169
|
try {
|
|
1170
|
-
const
|
|
1170
|
+
const q = (await y.getBlockedUsers()).some(
|
|
1171
1171
|
(F) => {
|
|
1172
|
-
var
|
|
1173
|
-
return F.blocked_user_id === ((
|
|
1172
|
+
var z;
|
|
1173
|
+
return F.blocked_user_id === ((z = n == null ? void 0 : n.user) == null ? void 0 : z.id);
|
|
1174
1174
|
}
|
|
1175
1175
|
);
|
|
1176
|
-
|
|
1176
|
+
E(q);
|
|
1177
1177
|
} catch (U) {
|
|
1178
1178
|
console.error(
|
|
1179
1179
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1180
1180
|
U
|
|
1181
1181
|
);
|
|
1182
1182
|
}
|
|
1183
|
-
}, [
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
}, [
|
|
1183
|
+
}, [y, (re = n == null ? void 0 : n.user) == null ? void 0 : re.id]);
|
|
1184
|
+
X(() => {
|
|
1185
|
+
p();
|
|
1186
|
+
}, [p]);
|
|
1187
1187
|
const T = async () => {
|
|
1188
|
-
var
|
|
1189
|
-
if (!
|
|
1190
|
-
|
|
1188
|
+
var A;
|
|
1189
|
+
if (!w) {
|
|
1190
|
+
f == null || f(), r && console.log("[ChannelInfoDialog] Leave conversation", a.cid), k(!0);
|
|
1191
1191
|
try {
|
|
1192
|
-
const U = ((
|
|
1193
|
-
await
|
|
1192
|
+
const U = ((A = a._client) == null ? void 0 : A.userID) ?? null;
|
|
1193
|
+
await a.hide(U, !1), c && await c(a), s();
|
|
1194
1194
|
} catch (U) {
|
|
1195
1195
|
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
1196
1196
|
} finally {
|
|
1197
1197
|
k(!1);
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
|
-
},
|
|
1201
|
-
var
|
|
1202
|
-
if (!(N || !
|
|
1203
|
-
|
|
1200
|
+
}, g = async () => {
|
|
1201
|
+
var A, U, q;
|
|
1202
|
+
if (!(N || !y)) {
|
|
1203
|
+
h == null || h(), r && console.log("[ChannelInfoDialog] Block member", (A = n == null ? void 0 : n.user) == null ? void 0 : A.id), m(!0);
|
|
1204
1204
|
try {
|
|
1205
|
-
await
|
|
1205
|
+
await y.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), o && await o((q = n == null ? void 0 : n.user) == null ? void 0 : q.id), s();
|
|
1206
1206
|
} catch (F) {
|
|
1207
1207
|
console.error("[ChannelInfoDialog] Failed to block member", F);
|
|
1208
1208
|
} finally {
|
|
1209
1209
|
m(!1);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
},
|
|
1213
|
-
var
|
|
1214
|
-
if (!(N || !
|
|
1215
|
-
|
|
1212
|
+
}, d = async () => {
|
|
1213
|
+
var A, U, q;
|
|
1214
|
+
if (!(N || !y)) {
|
|
1215
|
+
h == null || h(), r && console.log("[ChannelInfoDialog] Unblock member", (A = n == null ? void 0 : n.user) == null ? void 0 : A.id), m(!0);
|
|
1216
1216
|
try {
|
|
1217
|
-
await
|
|
1217
|
+
await y.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), o && await o((q = n == null ? void 0 : n.user) == null ? void 0 : q.id), s();
|
|
1218
1218
|
} catch (F) {
|
|
1219
1219
|
console.error("[ChannelInfoDialog] Failed to unblock member", F);
|
|
1220
1220
|
} finally {
|
|
1221
1221
|
m(!1);
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
},
|
|
1225
|
-
|
|
1224
|
+
}, C = () => {
|
|
1225
|
+
b == null || b(), s(), window.open(
|
|
1226
1226
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1227
1227
|
"_blank",
|
|
1228
1228
|
"noopener,noreferrer"
|
|
1229
1229
|
);
|
|
1230
1230
|
};
|
|
1231
1231
|
if (!n) return null;
|
|
1232
|
-
const
|
|
1232
|
+
const O = ((J = n.user) == null ? void 0 : J.name) || ((ae = n.user) == null ? void 0 : ae.id) || "Unknown member", _ = (oe = n.user) == null ? void 0 : oe.image, R = (ue = n.user) == null ? void 0 : ue.email, I = (j = n.user) == null ? void 0 : j.username, Y = R || (I ? `linktr.ee/${I}` : void 0), V = ((K = n.user) == null ? void 0 : K.id) || "unknown";
|
|
1233
1233
|
return (
|
|
1234
1234
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1235
1235
|
/* @__PURE__ */ e(
|
|
@@ -1238,13 +1238,13 @@ const ys = ({
|
|
|
1238
1238
|
ref: t,
|
|
1239
1239
|
className: "mes-dialog group",
|
|
1240
1240
|
onClose: s,
|
|
1241
|
-
onClick: (
|
|
1242
|
-
|
|
1241
|
+
onClick: (A) => {
|
|
1242
|
+
A.target === t.current && s();
|
|
1243
1243
|
},
|
|
1244
1244
|
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: [
|
|
1245
1245
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1246
1246
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1247
|
-
/* @__PURE__ */ e(
|
|
1247
|
+
/* @__PURE__ */ e(Qe, { onClick: s })
|
|
1248
1248
|
] }),
|
|
1249
1249
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1250
1250
|
/* @__PURE__ */ e(
|
|
@@ -1254,18 +1254,18 @@ const ys = ({
|
|
|
1254
1254
|
style: { backgroundColor: "#FBFAF9" },
|
|
1255
1255
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1256
1256
|
/* @__PURE__ */ e(
|
|
1257
|
-
|
|
1257
|
+
ne,
|
|
1258
1258
|
{
|
|
1259
|
-
id:
|
|
1260
|
-
name:
|
|
1259
|
+
id: V,
|
|
1260
|
+
name: O,
|
|
1261
1261
|
image: _,
|
|
1262
1262
|
size: 88,
|
|
1263
1263
|
shape: "circle"
|
|
1264
1264
|
}
|
|
1265
1265
|
),
|
|
1266
1266
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1267
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1268
|
-
|
|
1267
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: O }),
|
|
1268
|
+
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
1269
1269
|
l && /* @__PURE__ */ e(
|
|
1270
1270
|
"span",
|
|
1271
1271
|
{
|
|
@@ -1286,42 +1286,42 @@ const ys = ({
|
|
|
1286
1286
|
),
|
|
1287
1287
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1288
1288
|
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1289
|
-
|
|
1289
|
+
Ce,
|
|
1290
1290
|
{
|
|
1291
1291
|
onClick: T,
|
|
1292
|
-
disabled:
|
|
1293
|
-
"aria-busy":
|
|
1292
|
+
disabled: w,
|
|
1293
|
+
"aria-busy": w,
|
|
1294
1294
|
children: [
|
|
1295
|
-
|
|
1295
|
+
w ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(es, { className: "h-5 w-5" }),
|
|
1296
1296
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1297
1297
|
]
|
|
1298
1298
|
}
|
|
1299
1299
|
) }),
|
|
1300
|
-
/* @__PURE__ */ e("li", { children:
|
|
1301
|
-
|
|
1300
|
+
/* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ i(
|
|
1301
|
+
Ce,
|
|
1302
1302
|
{
|
|
1303
|
-
onClick:
|
|
1303
|
+
onClick: d,
|
|
1304
1304
|
disabled: N,
|
|
1305
1305
|
"aria-busy": N,
|
|
1306
1306
|
children: [
|
|
1307
|
-
N ? /* @__PURE__ */ e(
|
|
1307
|
+
N ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Be, { className: "h-5 w-5" }),
|
|
1308
1308
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1309
1309
|
]
|
|
1310
1310
|
}
|
|
1311
1311
|
) : /* @__PURE__ */ i(
|
|
1312
|
-
|
|
1312
|
+
Ce,
|
|
1313
1313
|
{
|
|
1314
|
-
onClick:
|
|
1314
|
+
onClick: g,
|
|
1315
1315
|
disabled: N,
|
|
1316
1316
|
"aria-busy": N,
|
|
1317
1317
|
children: [
|
|
1318
|
-
N ? /* @__PURE__ */ e(
|
|
1318
|
+
N ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Be, { className: "h-5 w-5" }),
|
|
1319
1319
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1320
1320
|
]
|
|
1321
1321
|
}
|
|
1322
1322
|
) }),
|
|
1323
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1324
|
-
/* @__PURE__ */ e(
|
|
1323
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(Ce, { variant: "danger", onClick: C, children: [
|
|
1324
|
+
/* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
|
|
1325
1325
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1326
1326
|
] }) }),
|
|
1327
1327
|
x
|
|
@@ -1331,60 +1331,60 @@ const ys = ({
|
|
|
1331
1331
|
}
|
|
1332
1332
|
)
|
|
1333
1333
|
);
|
|
1334
|
-
},
|
|
1334
|
+
}, Ls = ({
|
|
1335
1335
|
onBack: t,
|
|
1336
1336
|
showBackButton: s,
|
|
1337
1337
|
renderMessageInputActions: n,
|
|
1338
|
-
onLeaveConversation:
|
|
1338
|
+
onLeaveConversation: a,
|
|
1339
1339
|
onBlockParticipant: l,
|
|
1340
|
-
showDeleteConversation:
|
|
1340
|
+
showDeleteConversation: c = !0,
|
|
1341
1341
|
onDeleteConversationClick: o,
|
|
1342
1342
|
onBlockParticipantClick: u,
|
|
1343
|
-
onReportParticipantClick:
|
|
1344
|
-
showStarButton:
|
|
1345
|
-
chatbotVotingEnabled:
|
|
1343
|
+
onReportParticipantClick: f,
|
|
1344
|
+
showStarButton: h = !1,
|
|
1345
|
+
chatbotVotingEnabled: b = !1,
|
|
1346
1346
|
renderChannelBanner: x,
|
|
1347
|
-
customChannelActions:
|
|
1347
|
+
customChannelActions: y
|
|
1348
1348
|
}) => {
|
|
1349
|
-
const { channel:
|
|
1350
|
-
(
|
|
1349
|
+
const { channel: r } = Te(), v = H(null), E = B.useMemo(() => Object.values(r.state.members || {}).find(
|
|
1350
|
+
(p) => {
|
|
1351
1351
|
var T;
|
|
1352
|
-
return ((T =
|
|
1352
|
+
return ((T = p.user) == null ? void 0 : T.id) && p.user.id !== r._client.userID;
|
|
1353
1353
|
}
|
|
1354
|
-
), [
|
|
1355
|
-
const m =
|
|
1354
|
+
), [r._client.userID, r.state.members]), w = B.useMemo(() => {
|
|
1355
|
+
const m = r.data ?? {};
|
|
1356
1356
|
if (m.followerStatus)
|
|
1357
1357
|
return String(m.followerStatus);
|
|
1358
1358
|
if (m.isFollower !== void 0)
|
|
1359
1359
|
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1360
|
-
}, [
|
|
1360
|
+
}, [r.data]), k = L(() => {
|
|
1361
1361
|
var m;
|
|
1362
|
-
(m =
|
|
1362
|
+
(m = v.current) == null || m.showModal();
|
|
1363
1363
|
}, []), N = L(() => {
|
|
1364
1364
|
var m;
|
|
1365
|
-
(m =
|
|
1365
|
+
(m = v.current) == null || m.close();
|
|
1366
1366
|
}, []);
|
|
1367
|
-
return /* @__PURE__ */ i(
|
|
1367
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
1368
1368
|
/* @__PURE__ */ e(
|
|
1369
|
-
|
|
1369
|
+
Yt,
|
|
1370
1370
|
{
|
|
1371
1371
|
overrides: {
|
|
1372
|
-
Message: (m) => /* @__PURE__ */ e(
|
|
1372
|
+
Message: (m) => /* @__PURE__ */ e(ys, { ...m, chatbotVotingEnabled: b })
|
|
1373
1373
|
},
|
|
1374
|
-
children: /* @__PURE__ */ i(
|
|
1374
|
+
children: /* @__PURE__ */ i(Zt, { children: [
|
|
1375
1375
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1376
|
-
|
|
1376
|
+
Rs,
|
|
1377
1377
|
{
|
|
1378
1378
|
onBack: t,
|
|
1379
1379
|
showBackButton: s,
|
|
1380
1380
|
onShowInfo: k,
|
|
1381
|
-
canShowInfo: !!
|
|
1382
|
-
showStarButton:
|
|
1381
|
+
canShowInfo: !!E,
|
|
1382
|
+
showStarButton: h
|
|
1383
1383
|
}
|
|
1384
1384
|
) }),
|
|
1385
1385
|
x == null ? void 0 : x(),
|
|
1386
1386
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1387
|
-
|
|
1387
|
+
Xt,
|
|
1388
1388
|
{
|
|
1389
1389
|
hideDeletedMessages: !0,
|
|
1390
1390
|
hideNewMessageSeparator: !1,
|
|
@@ -1392,73 +1392,73 @@ const ys = ({
|
|
|
1392
1392
|
}
|
|
1393
1393
|
) }),
|
|
1394
1394
|
/* @__PURE__ */ e(
|
|
1395
|
-
|
|
1395
|
+
_s,
|
|
1396
1396
|
{
|
|
1397
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1397
|
+
renderActions: () => n == null ? void 0 : n(r)
|
|
1398
1398
|
}
|
|
1399
1399
|
)
|
|
1400
1400
|
] })
|
|
1401
1401
|
}
|
|
1402
1402
|
),
|
|
1403
1403
|
/* @__PURE__ */ e(
|
|
1404
|
-
|
|
1404
|
+
Fs,
|
|
1405
1405
|
{
|
|
1406
|
-
dialogRef:
|
|
1406
|
+
dialogRef: v,
|
|
1407
1407
|
onClose: N,
|
|
1408
|
-
participant:
|
|
1409
|
-
channel:
|
|
1410
|
-
followerStatusLabel:
|
|
1411
|
-
onLeaveConversation:
|
|
1408
|
+
participant: E,
|
|
1409
|
+
channel: r,
|
|
1410
|
+
followerStatusLabel: w,
|
|
1411
|
+
onLeaveConversation: a,
|
|
1412
1412
|
onBlockParticipant: l,
|
|
1413
|
-
showDeleteConversation:
|
|
1413
|
+
showDeleteConversation: c,
|
|
1414
1414
|
onDeleteConversationClick: o,
|
|
1415
1415
|
onBlockParticipantClick: u,
|
|
1416
|
-
onReportParticipantClick:
|
|
1417
|
-
customChannelActions:
|
|
1416
|
+
onReportParticipantClick: f,
|
|
1417
|
+
customChannelActions: y
|
|
1418
1418
|
}
|
|
1419
1419
|
)
|
|
1420
1420
|
] });
|
|
1421
|
-
},
|
|
1421
|
+
}, Je = B.memo(
|
|
1422
1422
|
({
|
|
1423
1423
|
channel: t,
|
|
1424
1424
|
onBack: s,
|
|
1425
1425
|
showBackButton: n = !1,
|
|
1426
|
-
renderMessageInputActions:
|
|
1426
|
+
renderMessageInputActions: a,
|
|
1427
1427
|
onLeaveConversation: l,
|
|
1428
|
-
onBlockParticipant:
|
|
1428
|
+
onBlockParticipant: c,
|
|
1429
1429
|
className: o,
|
|
1430
|
-
CustomChannelEmptyState: u =
|
|
1431
|
-
showDeleteConversation:
|
|
1432
|
-
onDeleteConversationClick:
|
|
1433
|
-
onBlockParticipantClick:
|
|
1430
|
+
CustomChannelEmptyState: u = Ds,
|
|
1431
|
+
showDeleteConversation: f = !0,
|
|
1432
|
+
onDeleteConversationClick: h,
|
|
1433
|
+
onBlockParticipantClick: b,
|
|
1434
1434
|
onReportParticipantClick: x,
|
|
1435
|
-
dmAgentEnabled:
|
|
1436
|
-
messageMetadata:
|
|
1437
|
-
onMessageSent:
|
|
1438
|
-
showStarButton:
|
|
1439
|
-
chatbotVotingEnabled:
|
|
1435
|
+
dmAgentEnabled: y,
|
|
1436
|
+
messageMetadata: r,
|
|
1437
|
+
onMessageSent: v,
|
|
1438
|
+
showStarButton: E = !1,
|
|
1439
|
+
chatbotVotingEnabled: w = !1,
|
|
1440
1440
|
renderChannelBanner: k,
|
|
1441
1441
|
customChannelActions: N
|
|
1442
1442
|
}) => {
|
|
1443
1443
|
const m = L(
|
|
1444
|
-
async (
|
|
1445
|
-
var
|
|
1446
|
-
const
|
|
1444
|
+
async (p, T, g) => {
|
|
1445
|
+
var I;
|
|
1446
|
+
const d = ((I = t.data) == null ? void 0 : I.chatbot_paused) === !0, C = y && !d, O = {
|
|
1447
1447
|
...T,
|
|
1448
|
-
...
|
|
1449
|
-
...
|
|
1448
|
+
...C && { silent: !0 },
|
|
1449
|
+
...r && {
|
|
1450
1450
|
metadata: {
|
|
1451
1451
|
...T.metadata ?? {},
|
|
1452
|
-
...
|
|
1452
|
+
...r
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
1455
|
}, _ = {
|
|
1456
|
-
...
|
|
1457
|
-
...
|
|
1458
|
-
}, R = await t.sendMessage(
|
|
1459
|
-
return
|
|
1456
|
+
...g,
|
|
1457
|
+
...C && { skip_push: !0 }
|
|
1458
|
+
}, R = await t.sendMessage(O, _);
|
|
1459
|
+
return v == null || v(R), R;
|
|
1460
1460
|
},
|
|
1461
|
-
[t,
|
|
1461
|
+
[t, y, r, v]
|
|
1462
1462
|
);
|
|
1463
1463
|
return /* @__PURE__ */ e(
|
|
1464
1464
|
"div",
|
|
@@ -1468,29 +1468,29 @@ const ys = ({
|
|
|
1468
1468
|
o
|
|
1469
1469
|
),
|
|
1470
1470
|
children: /* @__PURE__ */ e(
|
|
1471
|
-
|
|
1471
|
+
Wt,
|
|
1472
1472
|
{
|
|
1473
1473
|
channel: t,
|
|
1474
|
-
MessageSystem:
|
|
1474
|
+
MessageSystem: ks,
|
|
1475
1475
|
EmptyStateIndicator: u,
|
|
1476
|
-
LoadingIndicator:
|
|
1477
|
-
DateSeparator:
|
|
1476
|
+
LoadingIndicator: ve,
|
|
1477
|
+
DateSeparator: ms,
|
|
1478
1478
|
doSendMessageRequest: m,
|
|
1479
1479
|
children: /* @__PURE__ */ e(
|
|
1480
|
-
|
|
1480
|
+
Ls,
|
|
1481
1481
|
{
|
|
1482
1482
|
onBack: s,
|
|
1483
1483
|
showBackButton: n,
|
|
1484
|
-
renderMessageInputActions:
|
|
1484
|
+
renderMessageInputActions: a,
|
|
1485
1485
|
onLeaveConversation: l,
|
|
1486
|
-
onBlockParticipant:
|
|
1486
|
+
onBlockParticipant: c,
|
|
1487
1487
|
CustomChannelEmptyState: u,
|
|
1488
|
-
showDeleteConversation:
|
|
1489
|
-
onDeleteConversationClick:
|
|
1490
|
-
onBlockParticipantClick:
|
|
1488
|
+
showDeleteConversation: f,
|
|
1489
|
+
onDeleteConversationClick: h,
|
|
1490
|
+
onBlockParticipantClick: b,
|
|
1491
1491
|
onReportParticipantClick: x,
|
|
1492
|
-
showStarButton:
|
|
1493
|
-
chatbotVotingEnabled:
|
|
1492
|
+
showStarButton: E,
|
|
1493
|
+
chatbotVotingEnabled: w,
|
|
1494
1494
|
renderChannelBanner: k,
|
|
1495
1495
|
customChannelActions: N
|
|
1496
1496
|
}
|
|
@@ -1501,16 +1501,16 @@ const ys = ({
|
|
|
1501
1501
|
);
|
|
1502
1502
|
}
|
|
1503
1503
|
);
|
|
1504
|
-
|
|
1505
|
-
function
|
|
1504
|
+
Je.displayName = "ChannelView";
|
|
1505
|
+
function As({
|
|
1506
1506
|
searchQuery: t,
|
|
1507
1507
|
setSearchQuery: s,
|
|
1508
1508
|
placeholder: n
|
|
1509
1509
|
}) {
|
|
1510
|
-
const
|
|
1510
|
+
const a = H(null);
|
|
1511
1511
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1512
1512
|
/* @__PURE__ */ e(
|
|
1513
|
-
|
|
1513
|
+
ss,
|
|
1514
1514
|
{
|
|
1515
1515
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1516
1516
|
weight: "bold"
|
|
@@ -1519,7 +1519,7 @@ function _s({
|
|
|
1519
1519
|
/* @__PURE__ */ e(
|
|
1520
1520
|
"input",
|
|
1521
1521
|
{
|
|
1522
|
-
ref:
|
|
1522
|
+
ref: a,
|
|
1523
1523
|
type: "text",
|
|
1524
1524
|
placeholder: n,
|
|
1525
1525
|
value: t,
|
|
@@ -1528,32 +1528,32 @@ function _s({
|
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
1530
1530
|
t && /* @__PURE__ */ e(
|
|
1531
|
-
|
|
1531
|
+
Xe,
|
|
1532
1532
|
{
|
|
1533
1533
|
label: "Clear search",
|
|
1534
1534
|
onClick: () => {
|
|
1535
1535
|
var l;
|
|
1536
|
-
s(""), (l =
|
|
1536
|
+
s(""), (l = a.current) == null || l.focus();
|
|
1537
1537
|
},
|
|
1538
1538
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1539
|
-
children: /* @__PURE__ */ e(
|
|
1539
|
+
children: /* @__PURE__ */ e(Re, { className: "h-4 w-4", weight: "bold" })
|
|
1540
1540
|
}
|
|
1541
1541
|
)
|
|
1542
1542
|
] });
|
|
1543
1543
|
}
|
|
1544
|
-
const
|
|
1544
|
+
const Us = ({
|
|
1545
1545
|
participantSource: t,
|
|
1546
1546
|
onSelectParticipant: s,
|
|
1547
1547
|
onClose: n,
|
|
1548
|
-
existingParticipantIds:
|
|
1548
|
+
existingParticipantIds: a = /* @__PURE__ */ new Set(),
|
|
1549
1549
|
participantLabel: l = "participants",
|
|
1550
|
-
searchPlaceholder:
|
|
1550
|
+
searchPlaceholder: c = "Search participants...",
|
|
1551
1551
|
className: o
|
|
1552
1552
|
}) => {
|
|
1553
|
-
const { debug: u } =
|
|
1553
|
+
const { debug: u } = pe(), [f, h] = M(""), [b, x] = M([]), [y, r] = M(!1), [v, E] = M(null), [w, k] = M(
|
|
1554
1554
|
null
|
|
1555
|
-
), N =
|
|
1556
|
-
|
|
1555
|
+
), N = H(!1);
|
|
1556
|
+
X(() => {
|
|
1557
1557
|
if (t.loading) {
|
|
1558
1558
|
u && console.log(
|
|
1559
1559
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
@@ -1562,50 +1562,50 @@ const Is = ({
|
|
|
1562
1562
|
}
|
|
1563
1563
|
if (N.current) return;
|
|
1564
1564
|
(async () => {
|
|
1565
|
-
u && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1565
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), E(null);
|
|
1566
1566
|
try {
|
|
1567
|
-
const
|
|
1567
|
+
const d = await t.loadParticipants({
|
|
1568
1568
|
search: "",
|
|
1569
1569
|
// Load all participants initially
|
|
1570
1570
|
limit: 100
|
|
1571
1571
|
});
|
|
1572
|
-
x(
|
|
1572
|
+
x(d.participants), N.current = !0, u && console.log(
|
|
1573
1573
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1574
|
-
|
|
1574
|
+
d.participants.length
|
|
1575
1575
|
);
|
|
1576
|
-
} catch (
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1576
|
+
} catch (d) {
|
|
1577
|
+
const C = d instanceof Error ? d.message : "Failed to load participants";
|
|
1578
|
+
E(C), console.error("[ParticipantPicker] Failed to load participants:", d);
|
|
1579
1579
|
} finally {
|
|
1580
|
-
|
|
1580
|
+
r(!1);
|
|
1581
1581
|
}
|
|
1582
1582
|
})();
|
|
1583
1583
|
}, [t.loading, u]);
|
|
1584
|
-
const m =
|
|
1585
|
-
var
|
|
1586
|
-
if (!
|
|
1587
|
-
const
|
|
1588
|
-
return
|
|
1589
|
-
}),
|
|
1590
|
-
async (
|
|
1591
|
-
if (!
|
|
1592
|
-
k(
|
|
1584
|
+
const m = b.filter((g) => !a.has(g.id)).filter((g) => {
|
|
1585
|
+
var C;
|
|
1586
|
+
if (!f) return !0;
|
|
1587
|
+
const d = f.toLowerCase();
|
|
1588
|
+
return g.name.toLowerCase().includes(d) || ((C = g.email) == null ? void 0 : C.toLowerCase().includes(d)) || !1;
|
|
1589
|
+
}), p = L(
|
|
1590
|
+
async (g) => {
|
|
1591
|
+
if (!w) {
|
|
1592
|
+
k(g.id);
|
|
1593
1593
|
try {
|
|
1594
|
-
await s(
|
|
1595
|
-
} catch (
|
|
1596
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1594
|
+
await s(g);
|
|
1595
|
+
} catch (d) {
|
|
1596
|
+
console.error("[ParticipantPicker] Failed to start chat:", d), k(null);
|
|
1597
1597
|
}
|
|
1598
1598
|
}
|
|
1599
1599
|
},
|
|
1600
|
-
[s,
|
|
1601
|
-
), T = (
|
|
1602
|
-
(
|
|
1600
|
+
[s, w]
|
|
1601
|
+
), T = (g, d) => {
|
|
1602
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), p(d));
|
|
1603
1603
|
};
|
|
1604
1604
|
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", o), children: [
|
|
1605
1605
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1606
1606
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1607
1607
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1608
|
-
/* @__PURE__ */ e(
|
|
1608
|
+
/* @__PURE__ */ e(Qe, { onClick: n })
|
|
1609
1609
|
] }),
|
|
1610
1610
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1611
1611
|
"Select a ",
|
|
@@ -1616,21 +1616,21 @@ const Is = ({
|
|
|
1616
1616
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1617
1617
|
] }),
|
|
1618
1618
|
/* @__PURE__ */ e(
|
|
1619
|
-
|
|
1619
|
+
As,
|
|
1620
1620
|
{
|
|
1621
|
-
searchQuery:
|
|
1622
|
-
setSearchQuery:
|
|
1623
|
-
placeholder:
|
|
1621
|
+
searchQuery: f,
|
|
1622
|
+
setSearchQuery: h,
|
|
1623
|
+
placeholder: c
|
|
1624
1624
|
}
|
|
1625
1625
|
)
|
|
1626
1626
|
] }),
|
|
1627
|
-
|
|
1627
|
+
v && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1628
1628
|
"Error loading ",
|
|
1629
1629
|
l,
|
|
1630
1630
|
": ",
|
|
1631
|
-
|
|
1631
|
+
v
|
|
1632
1632
|
] }),
|
|
1633
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1633
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: y && m.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: [
|
|
1634
1634
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1635
1635
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1636
1636
|
"Loading ",
|
|
@@ -1638,47 +1638,47 @@ const Is = ({
|
|
|
1638
1638
|
"..."
|
|
1639
1639
|
] })
|
|
1640
1640
|
] }) }) : m.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1641
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1642
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1643
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1641
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(je, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1642
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1643
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1644
1644
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1645
|
-
m.map((
|
|
1646
|
-
const
|
|
1645
|
+
m.map((g) => {
|
|
1646
|
+
const d = g.name || g.email || g.id, C = g.email && g.name ? g.email : g.phone;
|
|
1647
1647
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1648
1648
|
"button",
|
|
1649
1649
|
{
|
|
1650
1650
|
type: "button",
|
|
1651
|
-
onClick: () =>
|
|
1652
|
-
onKeyDown: (
|
|
1651
|
+
onClick: () => p(g),
|
|
1652
|
+
onKeyDown: (O) => T(O, g),
|
|
1653
1653
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
|
|
1654
1654
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1655
1655
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1656
1656
|
/* @__PURE__ */ e(
|
|
1657
|
-
|
|
1657
|
+
ne,
|
|
1658
1658
|
{
|
|
1659
|
-
id:
|
|
1660
|
-
name:
|
|
1661
|
-
image:
|
|
1659
|
+
id: g.id,
|
|
1660
|
+
name: d,
|
|
1661
|
+
image: g.image,
|
|
1662
1662
|
size: 40
|
|
1663
1663
|
}
|
|
1664
1664
|
),
|
|
1665
1665
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1666
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1667
|
-
|
|
1666
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: d }),
|
|
1667
|
+
C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
|
|
1668
1668
|
] })
|
|
1669
1669
|
] }),
|
|
1670
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1670
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === g.id ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(je, { className: "h-5 w-5 text-stone" }) })
|
|
1671
1671
|
] })
|
|
1672
1672
|
}
|
|
1673
|
-
) },
|
|
1673
|
+
) }, g.id);
|
|
1674
1674
|
}),
|
|
1675
|
-
|
|
1675
|
+
y && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1676
1676
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1677
1677
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1678
1678
|
] }) })
|
|
1679
1679
|
] }) })
|
|
1680
1680
|
] });
|
|
1681
|
-
},
|
|
1681
|
+
}, Ps = ({ className: t }) => /* @__PURE__ */ i(
|
|
1682
1682
|
"svg",
|
|
1683
1683
|
{
|
|
1684
1684
|
width: "140",
|
|
@@ -1812,17 +1812,17 @@ const Is = ({
|
|
|
1812
1812
|
] })
|
|
1813
1813
|
]
|
|
1814
1814
|
}
|
|
1815
|
-
),
|
|
1815
|
+
), Ke = B.memo(
|
|
1816
1816
|
({ 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: [
|
|
1817
|
-
/* @__PURE__ */ e(
|
|
1817
|
+
/* @__PURE__ */ e(Ps, {}),
|
|
1818
1818
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1819
1819
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1820
1820
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1821
1821
|
] })
|
|
1822
1822
|
] }) })
|
|
1823
1823
|
);
|
|
1824
|
-
|
|
1825
|
-
const
|
|
1824
|
+
Ke.displayName = "EmptyState";
|
|
1825
|
+
const ye = B.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: [
|
|
1826
1826
|
/* @__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: "⚠️" }) }),
|
|
1827
1827
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1828
1828
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1836,216 +1836,321 @@ const xe = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1836
1836
|
}
|
|
1837
1837
|
)
|
|
1838
1838
|
] }) }));
|
|
1839
|
-
|
|
1840
|
-
const Os = ({
|
|
1839
|
+
ye.displayName = "ErrorState";
|
|
1840
|
+
const Os = 2, Bs = 300, Se = 1e4, js = async (t) => await new Promise((s) => setTimeout(s, t)), He = (t, s) => {
|
|
1841
|
+
if (!t) return;
|
|
1842
|
+
const n = Object.entries(t).find(
|
|
1843
|
+
([a]) => a.toLowerCase() === s.toLowerCase()
|
|
1844
|
+
);
|
|
1845
|
+
return n ? n[1] : void 0;
|
|
1846
|
+
}, we = (t) => {
|
|
1847
|
+
const s = Number(t);
|
|
1848
|
+
return Number.isFinite(s) ? s : null;
|
|
1849
|
+
}, et = (t) => {
|
|
1850
|
+
if (!t || typeof t != "object") return null;
|
|
1851
|
+
const s = t.response;
|
|
1852
|
+
return !s || typeof s != "object" ? null : s;
|
|
1853
|
+
}, $s = (t) => {
|
|
1854
|
+
const s = et(t);
|
|
1855
|
+
if ((s == null ? void 0 : s.status) === 429) return !0;
|
|
1856
|
+
if (t && typeof t == "object") {
|
|
1857
|
+
if (we(t.code) === 9 || we(t.status) === 429) return !0;
|
|
1858
|
+
const l = t.message;
|
|
1859
|
+
if (typeof l == "string") {
|
|
1860
|
+
const c = l.toLowerCase();
|
|
1861
|
+
if (c.includes("too many requests") || c.includes("rate limit"))
|
|
1862
|
+
return !0;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
return !1;
|
|
1866
|
+
}, zs = (t, s, n = Date.now()) => {
|
|
1867
|
+
var h;
|
|
1868
|
+
const a = (h = et(t)) == null ? void 0 : h.headers, l = He(a, "retry-after"), c = we(
|
|
1869
|
+
Array.isArray(l) ? l[0] : l
|
|
1870
|
+
);
|
|
1871
|
+
if (c !== null && c >= 0)
|
|
1872
|
+
return Math.min(Math.round(c * 1e3), Se);
|
|
1873
|
+
const o = He(a, "x-ratelimit-reset"), u = we(
|
|
1874
|
+
Array.isArray(o) ? o[0] : o
|
|
1875
|
+
);
|
|
1876
|
+
if (u !== null && u > 0) {
|
|
1877
|
+
const b = Math.round(u * 1e3 - n);
|
|
1878
|
+
return Math.min(Math.max(b, 0), Se);
|
|
1879
|
+
}
|
|
1880
|
+
const f = Bs * 2 ** s;
|
|
1881
|
+
return Math.min(f, Se);
|
|
1882
|
+
}, Gs = ({
|
|
1883
|
+
client: t,
|
|
1884
|
+
maxRetries: s = Os,
|
|
1885
|
+
wait: n = js,
|
|
1886
|
+
now: a = Date.now,
|
|
1887
|
+
onRetry: l
|
|
1888
|
+
}) => {
|
|
1889
|
+
const c = /* @__PURE__ */ new Map();
|
|
1890
|
+
return { query: async ({
|
|
1891
|
+
requestKey: u,
|
|
1892
|
+
filters: f,
|
|
1893
|
+
sort: h = {},
|
|
1894
|
+
options: b = {}
|
|
1895
|
+
}) => {
|
|
1896
|
+
const x = c.get(u);
|
|
1897
|
+
if (x)
|
|
1898
|
+
return await x;
|
|
1899
|
+
const y = (async () => {
|
|
1900
|
+
for (let r = 0; ; r += 1)
|
|
1901
|
+
try {
|
|
1902
|
+
return await t.queryChannels(f, h, b);
|
|
1903
|
+
} catch (v) {
|
|
1904
|
+
if (!$s(v) || r >= s)
|
|
1905
|
+
throw v;
|
|
1906
|
+
const E = zs(
|
|
1907
|
+
v,
|
|
1908
|
+
r,
|
|
1909
|
+
a()
|
|
1910
|
+
);
|
|
1911
|
+
l == null || l({
|
|
1912
|
+
requestKey: u,
|
|
1913
|
+
attempt: r + 1,
|
|
1914
|
+
delayMs: E,
|
|
1915
|
+
error: v
|
|
1916
|
+
}), await n(E);
|
|
1917
|
+
}
|
|
1918
|
+
})();
|
|
1919
|
+
c.set(u, y);
|
|
1920
|
+
try {
|
|
1921
|
+
return await y;
|
|
1922
|
+
} finally {
|
|
1923
|
+
c.delete(u);
|
|
1924
|
+
}
|
|
1925
|
+
} };
|
|
1926
|
+
}, Ks = ({
|
|
1841
1927
|
capabilities: t = {},
|
|
1842
1928
|
className: s,
|
|
1843
1929
|
renderMessageInputActions: n,
|
|
1844
|
-
onChannelSelect:
|
|
1930
|
+
onChannelSelect: a,
|
|
1845
1931
|
onParticipantSelect: l,
|
|
1846
|
-
initialParticipantFilter:
|
|
1932
|
+
initialParticipantFilter: c,
|
|
1847
1933
|
initialParticipantData: o,
|
|
1848
1934
|
CustomChannelEmptyState: u,
|
|
1849
|
-
showChannelList:
|
|
1850
|
-
filters:
|
|
1851
|
-
channelListCustomEmptyStateIndicator:
|
|
1935
|
+
showChannelList: f = !0,
|
|
1936
|
+
filters: h,
|
|
1937
|
+
channelListCustomEmptyStateIndicator: b,
|
|
1852
1938
|
onDeleteConversationClick: x,
|
|
1853
|
-
onBlockParticipantClick:
|
|
1854
|
-
onReportParticipantClick:
|
|
1855
|
-
dmAgentEnabled:
|
|
1856
|
-
messageMetadata:
|
|
1857
|
-
onMessageSent:
|
|
1939
|
+
onBlockParticipantClick: y,
|
|
1940
|
+
onReportParticipantClick: r,
|
|
1941
|
+
dmAgentEnabled: v,
|
|
1942
|
+
messageMetadata: E,
|
|
1943
|
+
onMessageSent: w,
|
|
1858
1944
|
showStarButton: k = !1,
|
|
1859
1945
|
chatbotVotingEnabled: N = !1,
|
|
1860
1946
|
renderMessagePreview: m,
|
|
1861
|
-
renderChannelBanner:
|
|
1947
|
+
renderChannelBanner: p,
|
|
1862
1948
|
customChannelActions: T
|
|
1863
1949
|
}) => {
|
|
1864
1950
|
const {
|
|
1865
|
-
service:
|
|
1866
|
-
client:
|
|
1867
|
-
isConnected:
|
|
1868
|
-
isLoading:
|
|
1951
|
+
service: g,
|
|
1952
|
+
client: d,
|
|
1953
|
+
isConnected: C,
|
|
1954
|
+
isLoading: O,
|
|
1869
1955
|
error: _,
|
|
1870
1956
|
refreshConnection: R,
|
|
1871
|
-
debug:
|
|
1872
|
-
} =
|
|
1873
|
-
participantSource:
|
|
1874
|
-
participantLabel:
|
|
1875
|
-
showDeleteConversation:
|
|
1876
|
-
} = t,
|
|
1877
|
-
const
|
|
1957
|
+
debug: I
|
|
1958
|
+
} = ns(), [Y, V] = M(null), [re, J] = M(!1), [ae, oe] = M(!1), [ue, j] = M(!1), [K, A] = M(/* @__PURE__ */ new Set()), [U, q] = M(0), [F, z] = M(!1), [he, Q] = M(null), le = H(null), {
|
|
1959
|
+
participantSource: ee,
|
|
1960
|
+
participantLabel: ie = "participants",
|
|
1961
|
+
showDeleteConversation: fe = !0
|
|
1962
|
+
} = t, ge = B.useMemo(() => {
|
|
1963
|
+
const S = d == null ? void 0 : d.userID;
|
|
1878
1964
|
return {
|
|
1879
1965
|
...{
|
|
1880
1966
|
type: "messaging",
|
|
1881
1967
|
last_message_at: { $exists: !0 },
|
|
1882
|
-
...
|
|
1883
|
-
members: { $in: [
|
|
1968
|
+
...S && {
|
|
1969
|
+
members: { $in: [S] },
|
|
1884
1970
|
hidden: !1
|
|
1885
1971
|
}
|
|
1886
1972
|
},
|
|
1887
|
-
...
|
|
1973
|
+
...h
|
|
1888
1974
|
};
|
|
1889
|
-
}, [
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1975
|
+
}, [h, d == null ? void 0 : d.userID]), te = H(null), tt = H(0), se = H(a), st = H(I);
|
|
1976
|
+
X(() => {
|
|
1977
|
+
se.current = a;
|
|
1978
|
+
}, [a]);
|
|
1979
|
+
const ce = B.useMemo(() => d ? Gs({
|
|
1980
|
+
client: d,
|
|
1981
|
+
onRetry: ({ requestKey: S, attempt: P, delayMs: $, error: Z }) => {
|
|
1982
|
+
st.current && console.warn("[MessagingShell] queryChannels rate limited; retrying", {
|
|
1983
|
+
requestKey: S,
|
|
1984
|
+
attempt: P,
|
|
1985
|
+
delayMs: $,
|
|
1986
|
+
error: Z
|
|
1987
|
+
});
|
|
1988
|
+
}
|
|
1989
|
+
}) : null, [d]), de = L(
|
|
1990
|
+
async ({ forceFresh: S = !1 } = {}) => {
|
|
1991
|
+
if (!d || !C || !ce) return;
|
|
1992
|
+
const P = d.userID;
|
|
1993
|
+
if (P)
|
|
1994
|
+
try {
|
|
1995
|
+
I && console.log("[MessagingShell] Syncing channels for user:", P);
|
|
1996
|
+
const $ = S ? `sync:${P}:refresh:${tt.current++}` : `sync:${P}`, Z = await ce.query({
|
|
1997
|
+
requestKey: $,
|
|
1998
|
+
filters: {
|
|
1999
|
+
type: "messaging",
|
|
2000
|
+
members: { $in: [P] }
|
|
2001
|
+
},
|
|
2002
|
+
options: { limit: 100 }
|
|
2003
|
+
}), G = /* @__PURE__ */ new Set();
|
|
2004
|
+
Z.forEach((W) => {
|
|
2005
|
+
const Ee = W.state.members;
|
|
2006
|
+
Object.values(Ee).forEach((ct) => {
|
|
2007
|
+
var Le;
|
|
2008
|
+
const _e = (Le = ct.user) == null ? void 0 : Le.id;
|
|
2009
|
+
_e && _e !== P && G.add(_e);
|
|
2010
|
+
});
|
|
2011
|
+
}), A((W) => W.size === G.size && [...W].every((Ee) => G.has(Ee)) ? W : G), J(Z.length > 0), oe(!0), te.current = P, I && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2012
|
+
channelCount: Z.length,
|
|
2013
|
+
memberCount: G.size
|
|
1909
2014
|
});
|
|
1910
|
-
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
if (!d || !c || !b) return;
|
|
2015
|
+
} catch ($) {
|
|
2016
|
+
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
[d, C, I, ce]
|
|
2020
|
+
);
|
|
2021
|
+
X(() => {
|
|
2022
|
+
if (!d || !C) return;
|
|
2023
|
+
const S = d.userID;
|
|
2024
|
+
S && te.current !== S && de();
|
|
2025
|
+
}, [d, C, de]), X(() => {
|
|
2026
|
+
if (!c || !d || !C || !ce)
|
|
2027
|
+
return;
|
|
1924
2028
|
(async () => {
|
|
1925
|
-
|
|
1926
|
-
|
|
2029
|
+
var $, Z;
|
|
2030
|
+
const P = d.userID;
|
|
2031
|
+
if (P)
|
|
1927
2032
|
try {
|
|
1928
|
-
|
|
2033
|
+
I && console.log(
|
|
1929
2034
|
"[MessagingShell] Loading initial conversation with:",
|
|
1930
|
-
|
|
2035
|
+
c
|
|
1931
2036
|
);
|
|
1932
|
-
const
|
|
1933
|
-
{
|
|
2037
|
+
const G = await ce.query({
|
|
2038
|
+
requestKey: `direct:${P}:${c}`,
|
|
2039
|
+
filters: {
|
|
1934
2040
|
type: "messaging",
|
|
1935
|
-
members: { $eq: [
|
|
2041
|
+
members: { $eq: [P, c] }
|
|
1936
2042
|
},
|
|
1937
|
-
{}
|
|
1938
|
-
|
|
1939
|
-
)
|
|
1940
|
-
|
|
1941
|
-
H(O[0]), G(!0), Z(null), r && r(O[0]), M && console.log(
|
|
2043
|
+
options: { limit: 1 }
|
|
2044
|
+
});
|
|
2045
|
+
if (G.length > 0)
|
|
2046
|
+
V(G[0]), z(!0), Q(null), ($ = se.current) == null || $.call(se, G[0]), I && console.log(
|
|
1942
2047
|
"[MessagingShell] Initial conversation loaded:",
|
|
1943
|
-
|
|
2048
|
+
G[0].id
|
|
1944
2049
|
);
|
|
1945
|
-
else if (o &&
|
|
1946
|
-
|
|
2050
|
+
else if (o && g) {
|
|
2051
|
+
I && console.log(
|
|
1947
2052
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1948
2053
|
o
|
|
1949
2054
|
);
|
|
1950
2055
|
try {
|
|
1951
|
-
const
|
|
2056
|
+
const W = await g.startChannelWithParticipant({
|
|
1952
2057
|
id: o.id,
|
|
1953
2058
|
name: o.name,
|
|
1954
2059
|
email: o.email,
|
|
1955
2060
|
phone: o.phone
|
|
1956
2061
|
});
|
|
1957
|
-
|
|
2062
|
+
V(W), z(!0), Q(null), (Z = se.current) == null || Z.call(se, W), I && console.log(
|
|
1958
2063
|
"[MessagingShell] Channel created and loaded:",
|
|
1959
|
-
|
|
2064
|
+
W.id
|
|
1960
2065
|
);
|
|
1961
|
-
} catch (
|
|
2066
|
+
} catch (W) {
|
|
1962
2067
|
console.error(
|
|
1963
2068
|
"[MessagingShell] Failed to create conversation:",
|
|
1964
|
-
|
|
1965
|
-
),
|
|
2069
|
+
W
|
|
2070
|
+
), Q("Failed to create conversation");
|
|
1966
2071
|
}
|
|
1967
2072
|
} else
|
|
1968
|
-
|
|
2073
|
+
Q(
|
|
1969
2074
|
"No conversation found with this account"
|
|
1970
|
-
),
|
|
2075
|
+
), I && console.log(
|
|
1971
2076
|
"[MessagingShell] No conversation found for:",
|
|
1972
|
-
|
|
2077
|
+
c
|
|
1973
2078
|
);
|
|
1974
|
-
} catch (
|
|
2079
|
+
} catch (G) {
|
|
1975
2080
|
console.error(
|
|
1976
2081
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1977
|
-
|
|
1978
|
-
),
|
|
2082
|
+
G
|
|
2083
|
+
), Q("Failed to load conversation");
|
|
1979
2084
|
}
|
|
1980
2085
|
})();
|
|
1981
2086
|
}, [
|
|
1982
|
-
d,
|
|
1983
|
-
o,
|
|
1984
2087
|
c,
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2088
|
+
o,
|
|
2089
|
+
d,
|
|
2090
|
+
C,
|
|
2091
|
+
g,
|
|
2092
|
+
I,
|
|
2093
|
+
ce
|
|
1989
2094
|
]);
|
|
1990
|
-
const
|
|
1991
|
-
(
|
|
1992
|
-
|
|
2095
|
+
const nt = L(
|
|
2096
|
+
(S) => {
|
|
2097
|
+
V(S), a == null || a(S);
|
|
1993
2098
|
},
|
|
1994
|
-
[
|
|
1995
|
-
),
|
|
1996
|
-
F ||
|
|
1997
|
-
}, [F]),
|
|
1998
|
-
async (
|
|
1999
|
-
var
|
|
2000
|
-
if (
|
|
2099
|
+
[a]
|
|
2100
|
+
), rt = L(() => {
|
|
2101
|
+
F || V(null);
|
|
2102
|
+
}, [F]), at = L(
|
|
2103
|
+
async (S) => {
|
|
2104
|
+
var P;
|
|
2105
|
+
if (g)
|
|
2001
2106
|
try {
|
|
2002
|
-
|
|
2107
|
+
I && console.log(
|
|
2003
2108
|
"[MessagingShell] Starting conversation with:",
|
|
2004
|
-
|
|
2109
|
+
S.id
|
|
2005
2110
|
);
|
|
2006
|
-
const
|
|
2007
|
-
id:
|
|
2008
|
-
name:
|
|
2009
|
-
email:
|
|
2010
|
-
phone:
|
|
2111
|
+
const $ = await g.startChannelWithParticipant({
|
|
2112
|
+
id: S.id,
|
|
2113
|
+
name: S.name,
|
|
2114
|
+
email: S.email,
|
|
2115
|
+
phone: S.phone
|
|
2011
2116
|
});
|
|
2012
2117
|
try {
|
|
2013
|
-
await
|
|
2014
|
-
} catch (
|
|
2015
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
2118
|
+
await $.show();
|
|
2119
|
+
} catch (Z) {
|
|
2120
|
+
console.warn("[MessagingShell] Failed to unhide channel:", Z);
|
|
2016
2121
|
}
|
|
2017
|
-
|
|
2018
|
-
} catch (
|
|
2019
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2122
|
+
V($), j(!1), (P = le.current) == null || P.close(), l == null || l(S);
|
|
2123
|
+
} catch ($) {
|
|
2124
|
+
console.error("[MessagingShell] Failed to start conversation:", $);
|
|
2020
2125
|
}
|
|
2021
2126
|
},
|
|
2022
|
-
[
|
|
2023
|
-
),
|
|
2024
|
-
var
|
|
2025
|
-
j(!1), (
|
|
2026
|
-
}, []),
|
|
2027
|
-
(
|
|
2028
|
-
|
|
2127
|
+
[g, l, I]
|
|
2128
|
+
), xe = L(() => {
|
|
2129
|
+
var S;
|
|
2130
|
+
j(!1), (S = le.current) == null || S.close();
|
|
2131
|
+
}, []), ot = L(
|
|
2132
|
+
(S) => {
|
|
2133
|
+
S.target === le.current && xe();
|
|
2029
2134
|
},
|
|
2030
|
-
[
|
|
2031
|
-
),
|
|
2032
|
-
async (
|
|
2033
|
-
|
|
2135
|
+
[xe]
|
|
2136
|
+
), lt = L(
|
|
2137
|
+
async (S) => {
|
|
2138
|
+
I && console.log("[MessagingShell] Leaving conversation:", S.id), V(null), z(!1), te.current = null, await de({ forceFresh: !0 });
|
|
2034
2139
|
},
|
|
2035
|
-
[
|
|
2036
|
-
),
|
|
2037
|
-
async (
|
|
2038
|
-
|
|
2140
|
+
[de, I]
|
|
2141
|
+
), it = L(
|
|
2142
|
+
async (S) => {
|
|
2143
|
+
I && console.log("[MessagingShell] Blocking participant:", S), V(null), z(!1), te.current = null, await de({ forceFresh: !0 });
|
|
2039
2144
|
},
|
|
2040
|
-
[
|
|
2041
|
-
),
|
|
2042
|
-
return
|
|
2043
|
-
|
|
2145
|
+
[de, I]
|
|
2146
|
+
), be = !!Y;
|
|
2147
|
+
return O ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(ve, {}) }) : _ ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(ye, { message: _, onBack: R }) }) : !C || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
2148
|
+
ye,
|
|
2044
2149
|
{
|
|
2045
2150
|
message: "Not connected to messaging service",
|
|
2046
2151
|
onBack: R
|
|
2047
2152
|
}
|
|
2048
|
-
) }) :
|
|
2153
|
+
) }) : he ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(ye, { message: he }) }) : /* @__PURE__ */ i(
|
|
2049
2154
|
"div",
|
|
2050
2155
|
{
|
|
2051
2156
|
className: D(
|
|
@@ -2060,20 +2165,20 @@ const Os = ({
|
|
|
2060
2165
|
className: D(
|
|
2061
2166
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2062
2167
|
{
|
|
2063
|
-
"!hidden":
|
|
2168
|
+
"!hidden": f === !1 || F,
|
|
2064
2169
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2065
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2170
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !F && be,
|
|
2066
2171
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2067
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2172
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !F && !be
|
|
2068
2173
|
}
|
|
2069
2174
|
),
|
|
2070
2175
|
children: /* @__PURE__ */ e(
|
|
2071
|
-
|
|
2176
|
+
Ze,
|
|
2072
2177
|
{
|
|
2073
|
-
onChannelSelect:
|
|
2074
|
-
selectedChannel:
|
|
2075
|
-
filters:
|
|
2076
|
-
customEmptyStateIndicator:
|
|
2178
|
+
onChannelSelect: nt,
|
|
2179
|
+
selectedChannel: Y || void 0,
|
|
2180
|
+
filters: ge,
|
|
2181
|
+
customEmptyStateIndicator: b,
|
|
2077
2182
|
renderMessagePreview: m
|
|
2078
2183
|
}
|
|
2079
2184
|
)
|
|
@@ -2086,64 +2191,64 @@ const Os = ({
|
|
|
2086
2191
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2087
2192
|
{
|
|
2088
2193
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2089
|
-
flex: F ||
|
|
2194
|
+
flex: F || be || c,
|
|
2090
2195
|
// Normal mode: hide on mobile when no channel selected
|
|
2091
|
-
"hidden lg:flex": !F && !
|
|
2196
|
+
"hidden lg:flex": !F && !be && !c
|
|
2092
2197
|
}
|
|
2093
2198
|
),
|
|
2094
|
-
children:
|
|
2095
|
-
|
|
2199
|
+
children: Y ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2200
|
+
Je,
|
|
2096
2201
|
{
|
|
2097
|
-
channel:
|
|
2098
|
-
onBack:
|
|
2202
|
+
channel: Y,
|
|
2203
|
+
onBack: rt,
|
|
2099
2204
|
showBackButton: !F,
|
|
2100
2205
|
renderMessageInputActions: n,
|
|
2101
|
-
renderChannelBanner:
|
|
2102
|
-
onLeaveConversation:
|
|
2103
|
-
onBlockParticipant:
|
|
2206
|
+
renderChannelBanner: p,
|
|
2207
|
+
onLeaveConversation: lt,
|
|
2208
|
+
onBlockParticipant: it,
|
|
2104
2209
|
CustomChannelEmptyState: u,
|
|
2105
|
-
showDeleteConversation:
|
|
2210
|
+
showDeleteConversation: fe,
|
|
2106
2211
|
onDeleteConversationClick: x,
|
|
2107
|
-
onBlockParticipantClick:
|
|
2108
|
-
onReportParticipantClick:
|
|
2109
|
-
dmAgentEnabled:
|
|
2110
|
-
messageMetadata:
|
|
2111
|
-
onMessageSent:
|
|
2212
|
+
onBlockParticipantClick: y,
|
|
2213
|
+
onReportParticipantClick: r,
|
|
2214
|
+
dmAgentEnabled: v,
|
|
2215
|
+
messageMetadata: E,
|
|
2216
|
+
onMessageSent: w,
|
|
2112
2217
|
showStarButton: k,
|
|
2113
2218
|
chatbotVotingEnabled: N,
|
|
2114
2219
|
customChannelActions: T
|
|
2115
2220
|
},
|
|
2116
|
-
|
|
2117
|
-
) }) :
|
|
2221
|
+
Y.id
|
|
2222
|
+
) }) : c ? (
|
|
2118
2223
|
// Show loading while creating/loading direct conversation channel
|
|
2119
|
-
/* @__PURE__ */ e(
|
|
2224
|
+
/* @__PURE__ */ e(ve, {})
|
|
2120
2225
|
) : /* @__PURE__ */ e(
|
|
2121
|
-
|
|
2226
|
+
Ke,
|
|
2122
2227
|
{
|
|
2123
|
-
hasChannels:
|
|
2124
|
-
channelsLoaded:
|
|
2228
|
+
hasChannels: re,
|
|
2229
|
+
channelsLoaded: ae
|
|
2125
2230
|
}
|
|
2126
2231
|
)
|
|
2127
2232
|
}
|
|
2128
2233
|
)
|
|
2129
2234
|
] }),
|
|
2130
|
-
|
|
2235
|
+
ee && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2131
2236
|
/* @__PURE__ */ e(
|
|
2132
2237
|
"dialog",
|
|
2133
2238
|
{
|
|
2134
|
-
ref:
|
|
2239
|
+
ref: le,
|
|
2135
2240
|
className: "mes-dialog",
|
|
2136
|
-
onClick:
|
|
2137
|
-
onClose:
|
|
2241
|
+
onClick: ot,
|
|
2242
|
+
onClose: xe,
|
|
2138
2243
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2139
|
-
|
|
2244
|
+
Us,
|
|
2140
2245
|
{
|
|
2141
|
-
participantSource:
|
|
2142
|
-
onSelectParticipant:
|
|
2143
|
-
onClose:
|
|
2144
|
-
existingParticipantIds:
|
|
2145
|
-
participantLabel:
|
|
2146
|
-
searchPlaceholder: `Search ${
|
|
2246
|
+
participantSource: ee,
|
|
2247
|
+
onSelectParticipant: at,
|
|
2248
|
+
onClose: xe,
|
|
2249
|
+
existingParticipantIds: K,
|
|
2250
|
+
participantLabel: ie,
|
|
2251
|
+
searchPlaceholder: `Search ${ie}...`
|
|
2147
2252
|
},
|
|
2148
2253
|
U
|
|
2149
2254
|
) })
|
|
@@ -2152,11 +2257,11 @@ const Os = ({
|
|
|
2152
2257
|
]
|
|
2153
2258
|
}
|
|
2154
2259
|
);
|
|
2155
|
-
},
|
|
2260
|
+
}, Hs = ({
|
|
2156
2261
|
question: t,
|
|
2157
2262
|
onClick: s,
|
|
2158
2263
|
loading: n = !1,
|
|
2159
|
-
className:
|
|
2264
|
+
className: a
|
|
2160
2265
|
}) => /* @__PURE__ */ e(
|
|
2161
2266
|
"button",
|
|
2162
2267
|
{
|
|
@@ -2170,27 +2275,27 @@ const Os = ({
|
|
|
2170
2275
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2171
2276
|
"opacity-50 cursor-not-allowed": n
|
|
2172
2277
|
},
|
|
2173
|
-
|
|
2278
|
+
a
|
|
2174
2279
|
),
|
|
2175
2280
|
children: t
|
|
2176
2281
|
}
|
|
2177
|
-
),
|
|
2282
|
+
), en = ({
|
|
2178
2283
|
faqs: t,
|
|
2179
2284
|
onFaqClick: s,
|
|
2180
2285
|
loadingFaqId: n,
|
|
2181
|
-
headerText:
|
|
2286
|
+
headerText: a,
|
|
2182
2287
|
className: l,
|
|
2183
|
-
avatarImage:
|
|
2288
|
+
avatarImage: c,
|
|
2184
2289
|
avatarName: o
|
|
2185
2290
|
}) => {
|
|
2186
|
-
const u = t.filter((
|
|
2291
|
+
const u = t.filter((f) => f.enabled).sort((f, h) => (f.order ?? 0) - (h.order ?? 0));
|
|
2187
2292
|
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2188
|
-
(
|
|
2189
|
-
|
|
2293
|
+
(c || o) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2294
|
+
ne,
|
|
2190
2295
|
{
|
|
2191
2296
|
id: o || "account",
|
|
2192
2297
|
name: o || "Account",
|
|
2193
|
-
image:
|
|
2298
|
+
image: c,
|
|
2194
2299
|
size: 24,
|
|
2195
2300
|
shape: "circle"
|
|
2196
2301
|
}
|
|
@@ -2201,55 +2306,55 @@ const Os = ({
|
|
|
2201
2306
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2202
2307
|
style: { backgroundColor: "#F1F0EE" },
|
|
2203
2308
|
children: [
|
|
2204
|
-
|
|
2205
|
-
u.map((
|
|
2206
|
-
|
|
2309
|
+
a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
2310
|
+
u.map((f) => /* @__PURE__ */ e(
|
|
2311
|
+
Hs,
|
|
2207
2312
|
{
|
|
2208
|
-
question:
|
|
2209
|
-
onClick: () => s(
|
|
2210
|
-
loading: n ===
|
|
2313
|
+
question: f.question,
|
|
2314
|
+
onClick: () => s(f.id),
|
|
2315
|
+
loading: n === f.id
|
|
2211
2316
|
},
|
|
2212
|
-
|
|
2317
|
+
f.id
|
|
2213
2318
|
))
|
|
2214
2319
|
]
|
|
2215
2320
|
}
|
|
2216
2321
|
)
|
|
2217
2322
|
] }) });
|
|
2218
|
-
},
|
|
2219
|
-
const { initialSearch: n = "", pageSize:
|
|
2323
|
+
}, tn = (t, s = {}) => {
|
|
2324
|
+
const { initialSearch: n = "", pageSize: a = 20 } = s, [l, c] = M([]), [o, u] = M(!1), [f, h] = M(null), [b, x] = M(n), [y, r] = M(!0), [v, E] = M(), w = L(async (p = !1, T) => {
|
|
2220
2325
|
if (o) return;
|
|
2221
|
-
const
|
|
2222
|
-
u(!0),
|
|
2326
|
+
const g = T !== void 0 ? T : b;
|
|
2327
|
+
u(!0), h(null);
|
|
2223
2328
|
try {
|
|
2224
|
-
const
|
|
2225
|
-
search:
|
|
2226
|
-
limit:
|
|
2227
|
-
cursor:
|
|
2329
|
+
const d = await t.loadParticipants({
|
|
2330
|
+
search: g || void 0,
|
|
2331
|
+
limit: a,
|
|
2332
|
+
cursor: p ? void 0 : v
|
|
2228
2333
|
});
|
|
2229
|
-
|
|
2230
|
-
(
|
|
2231
|
-
),
|
|
2232
|
-
} catch (
|
|
2233
|
-
const
|
|
2234
|
-
|
|
2334
|
+
c(
|
|
2335
|
+
(C) => p ? d.participants : [...C, ...d.participants]
|
|
2336
|
+
), r(d.hasMore), E(d.nextCursor);
|
|
2337
|
+
} catch (d) {
|
|
2338
|
+
const C = d instanceof Error ? d.message : "Failed to load participants";
|
|
2339
|
+
h(C), console.error("[useParticipants] Load error:", d);
|
|
2235
2340
|
} finally {
|
|
2236
2341
|
u(!1);
|
|
2237
2342
|
}
|
|
2238
|
-
}, [t,
|
|
2239
|
-
|
|
2240
|
-
}, [
|
|
2241
|
-
x(
|
|
2242
|
-
}, [
|
|
2243
|
-
|
|
2244
|
-
}, [
|
|
2245
|
-
return
|
|
2246
|
-
|
|
2343
|
+
}, [t, b, v, a, o]), k = L(() => {
|
|
2344
|
+
y && !o && w(!1);
|
|
2345
|
+
}, [y, o, w]), N = L((p) => {
|
|
2346
|
+
x(p), E(void 0), w(!0, p);
|
|
2347
|
+
}, [w]), m = L(() => {
|
|
2348
|
+
E(void 0), w(!0);
|
|
2349
|
+
}, [w]);
|
|
2350
|
+
return X(() => {
|
|
2351
|
+
w(!0);
|
|
2247
2352
|
}, [t.loadParticipants]), {
|
|
2248
2353
|
participants: l,
|
|
2249
2354
|
loading: o,
|
|
2250
|
-
error:
|
|
2251
|
-
searchQuery:
|
|
2252
|
-
hasMore:
|
|
2355
|
+
error: f,
|
|
2356
|
+
searchQuery: b,
|
|
2357
|
+
hasMore: y,
|
|
2253
2358
|
totalCount: t.totalCount,
|
|
2254
2359
|
loadMore: k,
|
|
2255
2360
|
search: N,
|
|
@@ -2257,20 +2362,20 @@ const Os = ({
|
|
|
2257
2362
|
};
|
|
2258
2363
|
};
|
|
2259
2364
|
export {
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2365
|
+
Ce as ActionButton,
|
|
2366
|
+
ne as Avatar,
|
|
2367
|
+
Ds as ChannelEmptyState,
|
|
2368
|
+
Ze as ChannelList,
|
|
2369
|
+
Je as ChannelView,
|
|
2370
|
+
en as FaqList,
|
|
2371
|
+
Hs as FaqListItem,
|
|
2372
|
+
bs as MessageVoteButtons,
|
|
2373
|
+
Js as MessagingProvider,
|
|
2374
|
+
Ks as MessagingShell,
|
|
2375
|
+
Us as ParticipantPicker,
|
|
2376
|
+
as as formatRelativeTime,
|
|
2377
|
+
fs as useMessageVote,
|
|
2378
|
+
ns as useMessaging,
|
|
2379
|
+
tn as useParticipants
|
|
2275
2380
|
};
|
|
2276
2381
|
//# sourceMappingURL=index.js.map
|