@linktr.ee/messaging-react 1.25.1 โ 1.26.1
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.d.ts +25 -0
- package/dist/index.js +731 -727
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/index.test.tsx +18 -0
- package/src/components/ChannelList/index.tsx +2 -0
- package/src/components/ChannelView.test.tsx +50 -1
- package/src/components/ChannelView.tsx +2 -2
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/types.ts +26 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ie, GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import D from "classnames";
|
|
3
|
+
import G, { createContext as ct, useContext as dt, useCallback as A, useState as k, useRef as X, useEffect as K, useMemo as Se } from "react";
|
|
4
|
+
import { StreamChatService as mt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as ut, ChannelList as ht, DateSeparator as ft, useChannelStateContext as Te, useChatContext as je, areMessageUIPropsEqual as gt, useMessageReminder as xt, useComponentContext as bt, Attachment as Ct, EditMessageModal as Nt, MessageBlocked as vt, MessageBouncePrompt as pt, MessageDeleted as yt, MessageIsThreadReplyInChannelButtonIndicator as wt, MessageRepliesCountButton as _t, ReminderNotification as Et, StreamedMessageText as St, messageHasAttachments as It, messageHasReactions as Mt, isDateSeparatorMessage as kt, isMessageBlocked as Tt, isMessageBounced as Dt, MessageBounceModal as Rt, Poll as Lt, MessageText as At, MessageErrorIcon as Pt, useMessageContext as ze, useMessageComposer as Ft, useStateStore as Ot, MessageInput as Ut, useMessageInputContext as Bt, useMessageComposerHasSendableData as Gt, SimpleAttachmentSelector as $t, QuotedMessagePreview as jt, AttachmentPreviewList as zt, TextareaComposer as Ht, MessageTimestamp as we, Channel as Vt, WithComponents as Yt, Window as Wt, MessageList as qt } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ie, GiftIcon as Zt, XIcon as De, SpinnerGapIcon as xe, SignOutIcon as Jt, ProhibitInsetIcon as Pe, FlagIcon as Xt, ArrowUpIcon as Kt, SparkleIcon as Qt, ProhibitIcon as es, ArrowLeftIcon as Fe, DotsThreeIcon as Oe, MagnifyingGlassIcon as ts, ChatCircleDotsIcon as Ue } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as Be } from "stream-chat";
|
|
8
|
+
const He = ct({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const ze = it({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), Ne = () => dt(He), Qs = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -23,25 +23,25 @@ const ze = it({
|
|
|
23
23
|
capabilities: l = {},
|
|
24
24
|
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(u, ...
|
|
28
|
-
d && console.log(`๐ฅ [MessagingProvider] ${u}`, ...
|
|
26
|
+
const r = A(
|
|
27
|
+
(u, ...C) => {
|
|
28
|
+
d && console.log(`๐ฅ [MessagingProvider] ${u}`, ...C);
|
|
29
29
|
},
|
|
30
30
|
[d]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
r("๐ RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
34
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c,
|
|
38
|
+
const [c, f] = k(null), [h, x] = k(null), [g, p] = k(!1), [a, w] = k(!1), [_, b] = k(null), M = X(!1), E = X({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
43
|
}), y = X(0);
|
|
44
|
-
y.current++,
|
|
44
|
+
y.current++, r("๐ RENDER INFO", {
|
|
45
45
|
renderCount: y.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
@@ -57,7 +57,7 @@ const ze = it({
|
|
|
57
57
|
capabilities: l
|
|
58
58
|
}, K(() => {
|
|
59
59
|
const u = y.current;
|
|
60
|
-
if (
|
|
60
|
+
if (r("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
@@ -68,146 +68,146 @@ const ze = it({
|
|
|
68
68
|
apiKeyStable: E.current.apiKey === o
|
|
69
69
|
}
|
|
70
70
|
}), !o || !n) {
|
|
71
|
-
|
|
71
|
+
r("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: u,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
r("๐ CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: u,
|
|
79
79
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: E.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const C = new mt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: o,
|
|
85
85
|
debug: d
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return f(C), r("โ
SERVICE SET", {
|
|
88
88
|
renderCount: u,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!C
|
|
90
90
|
}), () => {
|
|
91
|
-
|
|
91
|
+
r("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: u,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), C.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [o, n, d,
|
|
96
|
+
}, [o, n, d, r]);
|
|
97
97
|
const S = X(null);
|
|
98
98
|
K(() => {
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
99
|
+
var C, T;
|
|
100
|
+
if (r("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
104
|
isConnecting: M.current,
|
|
105
|
-
isConnected:
|
|
105
|
+
isConnected: g,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
|
-
|
|
108
|
+
r("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
if (M.current) {
|
|
112
|
-
|
|
112
|
+
r("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
116
|
-
|
|
115
|
+
if (((C = S.current) == null ? void 0 : C.serviceId) === c && ((T = S.current) == null ? void 0 : T.userId) === s.id) {
|
|
116
|
+
r(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
119
119
|
);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
|
|
123
|
+
r("๐ STARTING USER CONNECTION", { userId: s.id }), M.current = !0, w(!0), b(null);
|
|
124
124
|
try {
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
125
|
+
r("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
+
const v = await c.connectUser(s);
|
|
127
|
+
x(v), p(!0), S.current = { serviceId: c, userId: s.id }, r("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: v.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (v) {
|
|
132
|
+
const N = v instanceof Error ? v.message : "Connection failed";
|
|
133
|
+
b(N), r("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: N
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
w(!1), M.current = !1,
|
|
138
|
+
w(!1), M.current = !1, r("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: g
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s,
|
|
144
|
+
}, [c, s, r, g]), K(() => (r("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: g
|
|
147
147
|
}), () => {
|
|
148
|
-
c &&
|
|
148
|
+
c && g ? (r(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
), S.current = null, c.disconnectUser().catch(console.error)) :
|
|
151
|
+
), S.current = null, c.disconnectUser().catch(console.error)) : r("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: g
|
|
154
154
|
});
|
|
155
|
-
}), [c,
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
155
|
+
}), [c, g, r]);
|
|
156
|
+
const R = A(async () => {
|
|
157
|
+
if (r("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
160
160
|
}), !c || !s) {
|
|
161
|
-
|
|
161
|
+
r("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
r("๐ STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
|
|
165
165
|
try {
|
|
166
|
-
|
|
166
|
+
r("๐ DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("๐ RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await c.connectUser(s);
|
|
168
|
-
|
|
168
|
+
x(u), p(!0), b(null), r("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
|
-
const
|
|
171
|
-
C
|
|
170
|
+
const C = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
+
b(C), r("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: C
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
w(!1),
|
|
176
|
+
w(!1), r("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s,
|
|
178
|
+
}, [c, s, r]), m = G.useMemo(() => (r("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!h,
|
|
181
|
-
isConnected:
|
|
182
|
-
isLoading:
|
|
181
|
+
isConnected: g,
|
|
182
|
+
isLoading: a,
|
|
183
183
|
hasError: !!_,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
187
|
client: h,
|
|
188
|
-
isConnected:
|
|
189
|
-
isLoading:
|
|
188
|
+
isConnected: g,
|
|
189
|
+
isLoading: a,
|
|
190
190
|
error: _,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: R,
|
|
193
193
|
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
h,
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
g,
|
|
198
|
+
a,
|
|
199
199
|
_,
|
|
200
200
|
l,
|
|
201
|
-
|
|
201
|
+
R,
|
|
202
202
|
d,
|
|
203
|
-
|
|
203
|
+
r
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
205
|
+
return r("๐ RENDER END", {
|
|
206
206
|
renderCount: y.current,
|
|
207
|
-
willRenderChat: !!(h &&
|
|
207
|
+
willRenderChat: !!(h && g),
|
|
208
208
|
contextValueReady: !!m
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(He.Provider, { value: m, children: h && g ? /* @__PURE__ */ e(
|
|
210
|
+
ut,
|
|
211
211
|
{
|
|
212
212
|
client: h,
|
|
213
213
|
customClasses: {
|
|
@@ -216,46 +216,46 @@ const ze = it({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, ss = () => Ne(), Ve = G.createContext({
|
|
220
220
|
selectedChannel: void 0,
|
|
221
221
|
onChannelSelect: () => {
|
|
222
222
|
},
|
|
223
223
|
debug: !1,
|
|
224
224
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
225
|
+
}), ns = Ve.Provider, as = () => G.useContext(Ve), Ye = (t) => {
|
|
226
226
|
var o, l;
|
|
227
|
-
const [s, n] =
|
|
227
|
+
const [s, n] = k(
|
|
228
228
|
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
229
229
|
);
|
|
230
230
|
return K(() => {
|
|
231
|
-
var
|
|
231
|
+
var r;
|
|
232
232
|
if (!t) {
|
|
233
233
|
n(!1);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
n(!!((
|
|
236
|
+
n(!!((r = t.state.membership) != null && r.pinned_at));
|
|
237
237
|
const d = (c) => {
|
|
238
|
-
var
|
|
238
|
+
var f;
|
|
239
239
|
n(
|
|
240
|
-
c != null && c.member ? !!c.member.pinned_at : !!((
|
|
240
|
+
c != null && c.member ? !!c.member.pinned_at : !!((f = t.state.membership) != null && f.pinned_at)
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
243
|
return t.on("member.updated", d), () => {
|
|
244
244
|
t.off("member.updated", d);
|
|
245
245
|
};
|
|
246
246
|
}, [t]), s;
|
|
247
|
-
},
|
|
247
|
+
}, rs = (t, s) => {
|
|
248
248
|
const n = new Date(
|
|
249
249
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
250
250
|
), l = new Date(
|
|
251
251
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
252
252
|
).getTime() - n.getTime();
|
|
253
253
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
254
|
-
},
|
|
254
|
+
}, os = (t) => {
|
|
255
255
|
const s = /* @__PURE__ */ new Date();
|
|
256
256
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
257
257
|
return "Just now";
|
|
258
|
-
const o =
|
|
258
|
+
const o = rs(t, s);
|
|
259
259
|
return o === 0 ? t.toLocaleTimeString([], {
|
|
260
260
|
hour: "numeric",
|
|
261
261
|
minute: "2-digit",
|
|
@@ -265,7 +265,7 @@ const ze = it({
|
|
|
265
265
|
day: "numeric",
|
|
266
266
|
year: "2-digit"
|
|
267
267
|
});
|
|
268
|
-
},
|
|
268
|
+
}, Ge = [
|
|
269
269
|
"๐",
|
|
270
270
|
// Apple
|
|
271
271
|
"๐",
|
|
@@ -293,7 +293,7 @@ const ze = it({
|
|
|
293
293
|
"๐"
|
|
294
294
|
// Melon
|
|
295
295
|
];
|
|
296
|
-
function
|
|
296
|
+
function ls(t) {
|
|
297
297
|
let s = 0;
|
|
298
298
|
for (let n = 0; n < t.length; n++) {
|
|
299
299
|
const o = t.charCodeAt(n);
|
|
@@ -301,11 +301,11 @@ function os(t) {
|
|
|
301
301
|
}
|
|
302
302
|
return Math.abs(s);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const n =
|
|
306
|
-
return
|
|
304
|
+
function is(t) {
|
|
305
|
+
const n = ls(t) % Ge.length;
|
|
306
|
+
return Ge[n];
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const ae = ({
|
|
309
309
|
id: t,
|
|
310
310
|
image: s,
|
|
311
311
|
size: n = 40,
|
|
@@ -313,14 +313,14 @@ const se = ({
|
|
|
313
313
|
starred: l = !1,
|
|
314
314
|
shape: d = "squircle"
|
|
315
315
|
}) => {
|
|
316
|
-
const
|
|
316
|
+
const r = is(t), f = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
|
|
317
317
|
borderRadius: "33%",
|
|
318
318
|
"corner-shape": "superellipse(1.3)"
|
|
319
319
|
};
|
|
320
320
|
return /* @__PURE__ */ i(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: D("relative flex-shrink-0", o),
|
|
324
324
|
style: {
|
|
325
325
|
width: `${n}px`,
|
|
326
326
|
height: `${n}px`
|
|
@@ -345,17 +345,17 @@ const se = ({
|
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
"aria-hidden": "true",
|
|
348
|
-
className:
|
|
348
|
+
className: D(
|
|
349
349
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
350
|
-
|
|
350
|
+
f
|
|
351
351
|
),
|
|
352
|
-
children:
|
|
352
|
+
children: r
|
|
353
353
|
}
|
|
354
354
|
) })
|
|
355
355
|
]
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
|
-
},
|
|
358
|
+
}, cs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
359
359
|
"svg",
|
|
360
360
|
{
|
|
361
361
|
width: t,
|
|
@@ -372,102 +372,102 @@ const se = ({
|
|
|
372
372
|
}
|
|
373
373
|
)
|
|
374
374
|
}
|
|
375
|
-
),
|
|
375
|
+
), ds = (t) => {
|
|
376
376
|
var s;
|
|
377
377
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
378
|
-
},
|
|
378
|
+
}, ms = (t) => {
|
|
379
379
|
var s;
|
|
380
380
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
381
381
|
}, Re = (t) => {
|
|
382
382
|
var s;
|
|
383
383
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
384
|
-
},
|
|
384
|
+
}, We = (t) => ds(t) || ms(t), us = (t) => {
|
|
385
385
|
var s;
|
|
386
|
-
return
|
|
386
|
+
return We(t) && !((s = t.text) != null && s.trim());
|
|
387
387
|
}, _e = ({
|
|
388
388
|
message: t,
|
|
389
389
|
standalone: s = !1,
|
|
390
390
|
isMyMessage: n = !1,
|
|
391
391
|
hasAttachment: o = !1
|
|
392
392
|
}) => {
|
|
393
|
-
var
|
|
394
|
-
const l =
|
|
393
|
+
var g;
|
|
394
|
+
const l = We(t), d = Re(t);
|
|
395
395
|
if (!l && !d)
|
|
396
396
|
return null;
|
|
397
397
|
if (l) {
|
|
398
|
-
const p = (
|
|
398
|
+
const p = (g = t.metadata) == null ? void 0 : g.amount_text;
|
|
399
399
|
if (!p) return null;
|
|
400
|
-
const
|
|
401
|
-
return /* @__PURE__ */ i("div", { className:
|
|
402
|
-
/* @__PURE__ */ e(
|
|
400
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", w = s ? `${p} tip` : `Delivered with ${p} tip`;
|
|
401
|
+
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
402
|
+
/* @__PURE__ */ e(Zt, { size: s ? 14 : 12 }),
|
|
403
403
|
/* @__PURE__ */ e("span", { children: w })
|
|
404
404
|
] });
|
|
405
405
|
}
|
|
406
|
-
const
|
|
406
|
+
const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", f = [
|
|
407
407
|
"message-chatbot-indicator",
|
|
408
408
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
409
|
-
|
|
410
|
-
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }),
|
|
411
|
-
return /* @__PURE__ */ e("div", { className:
|
|
409
|
+
r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
410
|
+
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(cs, { size: r ? 12 : 15 }) });
|
|
411
|
+
return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(de, { children: [
|
|
412
412
|
h,
|
|
413
|
-
|
|
414
|
-
] }) : /* @__PURE__ */ i(
|
|
415
|
-
|
|
413
|
+
x
|
|
414
|
+
] }) : /* @__PURE__ */ i(de, { children: [
|
|
415
|
+
x,
|
|
416
416
|
h
|
|
417
417
|
] }) });
|
|
418
|
-
},
|
|
418
|
+
}, qe = G.memo(
|
|
419
419
|
({ channel: t, unread: s }) => {
|
|
420
|
-
var
|
|
421
|
-
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } =
|
|
420
|
+
var R, m, u, C;
|
|
421
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = as(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
422
422
|
t && o(t);
|
|
423
|
-
},
|
|
424
|
-
const
|
|
425
|
-
!
|
|
426
|
-
},
|
|
427
|
-
(
|
|
428
|
-
var
|
|
429
|
-
return ((
|
|
423
|
+
}, f = (T) => {
|
|
424
|
+
const v = T.key === "Enter" || T.key === " ", N = T.repeat;
|
|
425
|
+
!v || N || (T.preventDefault(), c());
|
|
426
|
+
}, x = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
|
|
427
|
+
(T) => {
|
|
428
|
+
var v, N;
|
|
429
|
+
return ((v = T.user) == null ? void 0 : v.id) && T.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
|
|
430
430
|
}
|
|
431
|
-
),
|
|
432
|
-
var
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
for (let
|
|
436
|
-
if (
|
|
431
|
+
), g = ((m = x == null ? void 0 : x.user) == null ? void 0 : m.name) || "Conversation", p = (u = x == null ? void 0 : x.user) == null ? void 0 : u.image, a = (() => {
|
|
432
|
+
var v;
|
|
433
|
+
const T = (v = t == null ? void 0 : t.state) == null ? void 0 : v.messages;
|
|
434
|
+
if (T != null && T.length) {
|
|
435
|
+
for (let N = T.length - 1; N >= 0; N--)
|
|
436
|
+
if (T[N].type !== "system") return T[N];
|
|
437
437
|
}
|
|
438
438
|
})(), _ = (() => {
|
|
439
|
-
var
|
|
440
|
-
if (
|
|
441
|
-
if (((
|
|
442
|
-
const
|
|
443
|
-
return
|
|
444
|
-
})(),
|
|
439
|
+
var N, F;
|
|
440
|
+
if (a != null && a.text) return a.text;
|
|
441
|
+
if (((N = a == null ? void 0 : a.metadata) == null ? void 0 : N.custom_type) === "MESSAGE_TIP") return "๐ต Sent a tip";
|
|
442
|
+
const v = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
|
|
443
|
+
return v ? v.og_scrape_url ? v.og_scrape_url : v.type === "image" ? "๐ท Sent an image" : v.type === "video" ? "๐ฅ Sent a video" : v.type === "audio" ? "๐ต Sent audio" : v.type === "file" ? "๐ Sent a file" : "๐ Sent an attachment" : "No messages yet";
|
|
444
|
+
})(), b = a != null && a.created_at ? os(new Date(a.created_at)) : "", M = a ? Re(a) : !1, E = d ? d(a, _) : `${M ? "โจ " : ""}${_}`, y = Ye(t), S = s ?? 0;
|
|
445
445
|
return l && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
446
446
|
channelId: t == null ? void 0 : t.id,
|
|
447
|
-
isSelected:
|
|
448
|
-
participantName:
|
|
447
|
+
isSelected: r,
|
|
448
|
+
participantName: g,
|
|
449
449
|
unreadCount: S,
|
|
450
|
-
hasTimestamp: !!
|
|
450
|
+
hasTimestamp: !!b
|
|
451
451
|
}), /* @__PURE__ */ e(
|
|
452
452
|
"div",
|
|
453
453
|
{
|
|
454
454
|
role: "button",
|
|
455
455
|
tabIndex: 0,
|
|
456
456
|
onClick: c,
|
|
457
|
-
onKeyDown:
|
|
458
|
-
className:
|
|
457
|
+
onKeyDown: f,
|
|
458
|
+
className: D(
|
|
459
459
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
460
460
|
{
|
|
461
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
462
|
-
"hover:bg-sand": !
|
|
461
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": r,
|
|
462
|
+
"hover:bg-sand": !r
|
|
463
463
|
}
|
|
464
464
|
),
|
|
465
465
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
466
466
|
/* @__PURE__ */ e(
|
|
467
|
-
|
|
467
|
+
ae,
|
|
468
468
|
{
|
|
469
|
-
id: ((
|
|
470
|
-
name:
|
|
469
|
+
id: ((C = x == null ? void 0 : x.user) == null ? void 0 : C.id) || t.id || "unknown",
|
|
470
|
+
name: g,
|
|
471
471
|
image: p,
|
|
472
472
|
size: 44,
|
|
473
473
|
starred: y,
|
|
@@ -479,17 +479,17 @@ const se = ({
|
|
|
479
479
|
/* @__PURE__ */ i(
|
|
480
480
|
"h3",
|
|
481
481
|
{
|
|
482
|
-
className:
|
|
482
|
+
className: D(
|
|
483
483
|
"text-sm font-medium truncate",
|
|
484
|
-
|
|
484
|
+
r ? "text-primary" : "text-charcoal"
|
|
485
485
|
),
|
|
486
486
|
children: [
|
|
487
487
|
y && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
488
|
-
|
|
488
|
+
g
|
|
489
489
|
]
|
|
490
490
|
}
|
|
491
491
|
),
|
|
492
|
-
|
|
492
|
+
b && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: b })
|
|
493
493
|
] }),
|
|
494
494
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
495
495
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: E }),
|
|
@@ -501,8 +501,8 @@ const se = ({
|
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
503
|
);
|
|
504
|
-
|
|
505
|
-
const
|
|
504
|
+
qe.displayName = "CustomChannelPreview";
|
|
505
|
+
const hs = { last_message_at: -1 }, Ze = G.memo(
|
|
506
506
|
({
|
|
507
507
|
onChannelSelect: t,
|
|
508
508
|
selectedChannel: s,
|
|
@@ -510,55 +510,57 @@ const us = { last_message_at: -1 }, qe = B.memo(
|
|
|
510
510
|
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
511
511
|
onMessageNew: l,
|
|
512
512
|
onAddedToChannel: d,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
513
|
+
channelRenderFilterFn: r,
|
|
514
|
+
sort: c = hs,
|
|
515
|
+
className: f,
|
|
516
|
+
customEmptyStateIndicator: h,
|
|
517
|
+
renderMessagePreview: x
|
|
517
518
|
}) => {
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
const { debug:
|
|
521
|
-
|
|
522
|
-
renderCount:
|
|
519
|
+
const g = G.useRef(0);
|
|
520
|
+
g.current++;
|
|
521
|
+
const { debug: p = !1 } = Ne();
|
|
522
|
+
p && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
523
|
+
renderCount: g.current,
|
|
523
524
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
524
525
|
filters: n
|
|
525
526
|
});
|
|
526
|
-
const
|
|
527
|
+
const a = G.useMemo(
|
|
527
528
|
() => ({
|
|
528
529
|
selectedChannel: s,
|
|
529
530
|
onChannelSelect: t,
|
|
530
|
-
debug:
|
|
531
|
-
renderMessagePreview:
|
|
531
|
+
debug: p,
|
|
532
|
+
renderMessagePreview: x
|
|
532
533
|
}),
|
|
533
|
-
[s, t,
|
|
534
|
+
[s, t, p, x]
|
|
534
535
|
);
|
|
535
536
|
return /* @__PURE__ */ e(
|
|
536
537
|
"div",
|
|
537
538
|
{
|
|
538
|
-
className:
|
|
539
|
+
className: D(
|
|
539
540
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
540
|
-
|
|
541
|
+
f
|
|
541
542
|
),
|
|
542
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
543
|
-
|
|
543
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(ns, { value: a, children: /* @__PURE__ */ e(
|
|
544
|
+
ht,
|
|
544
545
|
{
|
|
545
546
|
filters: n,
|
|
546
|
-
sort:
|
|
547
|
+
sort: c,
|
|
547
548
|
options: { limit: 30 },
|
|
548
549
|
allowNewMessagesFromUnfilteredChannels: o,
|
|
549
550
|
onMessageNew: l,
|
|
550
551
|
onAddedToChannel: d,
|
|
551
|
-
|
|
552
|
-
|
|
552
|
+
channelRenderFilterFn: r,
|
|
553
|
+
Preview: qe,
|
|
554
|
+
EmptyStateIndicator: h
|
|
553
555
|
},
|
|
554
|
-
`${JSON.stringify(n)}:${JSON.stringify(
|
|
556
|
+
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
555
557
|
) }) })
|
|
556
558
|
}
|
|
557
559
|
);
|
|
558
560
|
}
|
|
559
561
|
);
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
+
Ze.displayName = "ChannelList";
|
|
563
|
+
const ge = ({
|
|
562
564
|
variant: t = "default",
|
|
563
565
|
className: s,
|
|
564
566
|
children: n,
|
|
@@ -567,7 +569,7 @@ const xe = ({
|
|
|
567
569
|
"button",
|
|
568
570
|
{
|
|
569
571
|
type: "button",
|
|
570
|
-
className:
|
|
572
|
+
className: D(
|
|
571
573
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
572
574
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
573
575
|
s
|
|
@@ -576,12 +578,12 @@ const xe = ({
|
|
|
576
578
|
children: n
|
|
577
579
|
}
|
|
578
580
|
);
|
|
579
|
-
function
|
|
581
|
+
function Je({ label: t, className: s, children: n, ...o }) {
|
|
580
582
|
return /* @__PURE__ */ i(
|
|
581
583
|
"button",
|
|
582
584
|
{
|
|
583
585
|
type: "button",
|
|
584
|
-
className:
|
|
586
|
+
className: D(
|
|
585
587
|
"rounded-full p-2 transition-colors focus-ring",
|
|
586
588
|
{
|
|
587
589
|
"cursor-not-allowed opacity-50": o.disabled,
|
|
@@ -597,92 +599,92 @@ function Ze({ label: t, className: s, children: n, ...o }) {
|
|
|
597
599
|
}
|
|
598
600
|
);
|
|
599
601
|
}
|
|
600
|
-
function
|
|
601
|
-
return /* @__PURE__ */ e(
|
|
602
|
+
function Xe({ onClick: t }) {
|
|
603
|
+
return /* @__PURE__ */ e(Je, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(De, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
602
604
|
}
|
|
603
|
-
const
|
|
605
|
+
const fs = ({
|
|
604
606
|
dialogRef: t,
|
|
605
607
|
onClose: s,
|
|
606
608
|
participant: n,
|
|
607
609
|
channel: o,
|
|
608
610
|
followerStatusLabel: l,
|
|
609
611
|
onLeaveConversation: d,
|
|
610
|
-
onBlockParticipant:
|
|
612
|
+
onBlockParticipant: r,
|
|
611
613
|
showDeleteConversation: c = !0,
|
|
612
|
-
onDeleteConversationClick:
|
|
614
|
+
onDeleteConversationClick: f,
|
|
613
615
|
onBlockParticipantClick: h,
|
|
614
|
-
onReportParticipantClick:
|
|
615
|
-
customProfileContent:
|
|
616
|
+
onReportParticipantClick: x,
|
|
617
|
+
customProfileContent: g,
|
|
616
618
|
customChannelActions: p
|
|
617
619
|
}) => {
|
|
618
|
-
var
|
|
619
|
-
const { service:
|
|
620
|
-
var
|
|
621
|
-
if (!(!
|
|
620
|
+
var L, W, j, re, z, te, se;
|
|
621
|
+
const { service: a, debug: w } = Ne(), [_, b] = k(!1), [M, E] = k(!1), [y, S] = k(!1), R = A(async () => {
|
|
622
|
+
var O;
|
|
623
|
+
if (!(!a || !((O = n == null ? void 0 : n.user) != null && O.id)))
|
|
622
624
|
try {
|
|
623
|
-
const
|
|
624
|
-
(
|
|
625
|
-
var
|
|
626
|
-
return
|
|
625
|
+
const B = (await a.getBlockedUsers()).some(
|
|
626
|
+
(H) => {
|
|
627
|
+
var oe;
|
|
628
|
+
return H.blocked_user_id === ((oe = n == null ? void 0 : n.user) == null ? void 0 : oe.id);
|
|
627
629
|
}
|
|
628
630
|
);
|
|
629
|
-
|
|
630
|
-
} catch (
|
|
631
|
+
b(B);
|
|
632
|
+
} catch (P) {
|
|
631
633
|
console.error(
|
|
632
634
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
633
|
-
|
|
635
|
+
P
|
|
634
636
|
);
|
|
635
637
|
}
|
|
636
|
-
}, [
|
|
638
|
+
}, [a, (L = n == null ? void 0 : n.user) == null ? void 0 : L.id]);
|
|
637
639
|
K(() => {
|
|
638
|
-
|
|
639
|
-
}, [
|
|
640
|
+
R();
|
|
641
|
+
}, [R]);
|
|
640
642
|
const m = async () => {
|
|
641
|
-
var
|
|
643
|
+
var O;
|
|
642
644
|
if (!M) {
|
|
643
|
-
|
|
645
|
+
f == null || f(), w && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
|
|
644
646
|
try {
|
|
645
|
-
const
|
|
646
|
-
await o.hide(
|
|
647
|
-
} catch (
|
|
648
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
647
|
+
const P = ((O = o._client) == null ? void 0 : O.userID) ?? null;
|
|
648
|
+
await o.hide(P, !1), d && await d(o), s();
|
|
649
|
+
} catch (P) {
|
|
650
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", P);
|
|
649
651
|
} finally {
|
|
650
652
|
E(!1);
|
|
651
653
|
}
|
|
652
654
|
}
|
|
653
655
|
}, u = async () => {
|
|
654
|
-
var
|
|
655
|
-
if (!(y || !
|
|
656
|
-
h == null || h(), w && console.log("[ChannelInfoDialog] Block member", (
|
|
656
|
+
var O, P, B;
|
|
657
|
+
if (!(y || !a)) {
|
|
658
|
+
h == null || h(), w && console.log("[ChannelInfoDialog] Block member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), S(!0);
|
|
657
659
|
try {
|
|
658
|
-
await
|
|
659
|
-
} catch (
|
|
660
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
660
|
+
await a.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
|
|
661
|
+
} catch (H) {
|
|
662
|
+
console.error("[ChannelInfoDialog] Failed to block member", H);
|
|
661
663
|
} finally {
|
|
662
664
|
S(!1);
|
|
663
665
|
}
|
|
664
666
|
}
|
|
665
|
-
},
|
|
666
|
-
var
|
|
667
|
-
if (!(y || !
|
|
668
|
-
h == null || h(), w && console.log("[ChannelInfoDialog] Unblock member", (
|
|
667
|
+
}, C = async () => {
|
|
668
|
+
var O, P, B;
|
|
669
|
+
if (!(y || !a)) {
|
|
670
|
+
h == null || h(), w && console.log("[ChannelInfoDialog] Unblock member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), S(!0);
|
|
669
671
|
try {
|
|
670
|
-
await
|
|
671
|
-
} catch (
|
|
672
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
672
|
+
await a.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
|
|
673
|
+
} catch (H) {
|
|
674
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", H);
|
|
673
675
|
} finally {
|
|
674
676
|
S(!1);
|
|
675
677
|
}
|
|
676
678
|
}
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
+
}, T = () => {
|
|
680
|
+
x == null || x(), s(), window.open(
|
|
679
681
|
"https://linktr.ee/s/about/trust-center/report",
|
|
680
682
|
"_blank",
|
|
681
683
|
"noopener,noreferrer"
|
|
682
684
|
);
|
|
683
685
|
};
|
|
684
686
|
if (!n) return null;
|
|
685
|
-
const
|
|
687
|
+
const v = ((W = n.user) == null ? void 0 : W.name) || ((j = n.user) == null ? void 0 : j.id) || "Unknown member", N = (re = n.user) == null ? void 0 : re.image, F = (z = n.user) == null ? void 0 : z.email, Q = (te = n.user) == null ? void 0 : te.username, Y = F || (Q ? `linktr.ee/${Q}` : void 0), Z = ((se = n.user) == null ? void 0 : se.id) || "unknown";
|
|
686
688
|
return (
|
|
687
689
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
688
690
|
/* @__PURE__ */ e(
|
|
@@ -691,13 +693,13 @@ const hs = ({
|
|
|
691
693
|
ref: t,
|
|
692
694
|
className: "mes-dialog group",
|
|
693
695
|
onClose: s,
|
|
694
|
-
onClick: (
|
|
695
|
-
|
|
696
|
+
onClick: (O) => {
|
|
697
|
+
O.target === t.current && s();
|
|
696
698
|
},
|
|
697
699
|
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: [
|
|
698
700
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
699
701
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
700
|
-
/* @__PURE__ */ e(
|
|
702
|
+
/* @__PURE__ */ e(Xe, { onClick: s })
|
|
701
703
|
] }),
|
|
702
704
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
703
705
|
/* @__PURE__ */ e(
|
|
@@ -707,19 +709,19 @@ const hs = ({
|
|
|
707
709
|
style: { backgroundColor: "#FBFAF9" },
|
|
708
710
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
709
711
|
/* @__PURE__ */ e(
|
|
710
|
-
|
|
712
|
+
ae,
|
|
711
713
|
{
|
|
712
|
-
id:
|
|
713
|
-
name:
|
|
714
|
-
image:
|
|
714
|
+
id: Z,
|
|
715
|
+
name: v,
|
|
716
|
+
image: N,
|
|
715
717
|
size: 88,
|
|
716
718
|
shape: "circle"
|
|
717
719
|
}
|
|
718
720
|
),
|
|
719
721
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
720
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
721
|
-
|
|
722
|
-
l && !
|
|
722
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
|
|
723
|
+
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
724
|
+
l && !g && /* @__PURE__ */ e(
|
|
723
725
|
"span",
|
|
724
726
|
{
|
|
725
727
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -733,49 +735,49 @@ const hs = ({
|
|
|
733
735
|
children: l
|
|
734
736
|
}
|
|
735
737
|
),
|
|
736
|
-
|
|
738
|
+
g
|
|
737
739
|
] })
|
|
738
740
|
] })
|
|
739
741
|
}
|
|
740
742
|
),
|
|
741
743
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
742
744
|
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
743
|
-
|
|
745
|
+
ge,
|
|
744
746
|
{
|
|
745
747
|
onClick: m,
|
|
746
748
|
disabled: M,
|
|
747
749
|
"aria-busy": M,
|
|
748
750
|
children: [
|
|
749
|
-
M ? /* @__PURE__ */ e(
|
|
751
|
+
M ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Jt, { className: "h-5 w-5" }),
|
|
750
752
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
751
753
|
]
|
|
752
754
|
}
|
|
753
755
|
) }),
|
|
754
756
|
/* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ i(
|
|
755
|
-
|
|
757
|
+
ge,
|
|
756
758
|
{
|
|
757
|
-
onClick:
|
|
759
|
+
onClick: C,
|
|
758
760
|
disabled: y,
|
|
759
761
|
"aria-busy": y,
|
|
760
762
|
children: [
|
|
761
|
-
y ? /* @__PURE__ */ e(
|
|
763
|
+
y ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
|
|
762
764
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
763
765
|
]
|
|
764
766
|
}
|
|
765
767
|
) : /* @__PURE__ */ i(
|
|
766
|
-
|
|
768
|
+
ge,
|
|
767
769
|
{
|
|
768
770
|
onClick: u,
|
|
769
771
|
disabled: y,
|
|
770
772
|
"aria-busy": y,
|
|
771
773
|
children: [
|
|
772
|
-
y ? /* @__PURE__ */ e(
|
|
774
|
+
y ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
|
|
773
775
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
774
776
|
]
|
|
775
777
|
}
|
|
776
778
|
) }),
|
|
777
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
778
|
-
/* @__PURE__ */ e(
|
|
779
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ge, { variant: "danger", onClick: T, children: [
|
|
780
|
+
/* @__PURE__ */ e(Xt, { className: "h-5 w-5" }),
|
|
779
781
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
780
782
|
] }) }),
|
|
781
783
|
p
|
|
@@ -785,13 +787,13 @@ const hs = ({
|
|
|
785
787
|
}
|
|
786
788
|
)
|
|
787
789
|
);
|
|
788
|
-
},
|
|
789
|
-
function
|
|
790
|
+
}, gs = (t) => /* @__PURE__ */ e(ft, { ...t, position: "center" }), Me = "vote_up", ke = "vote_down";
|
|
791
|
+
function xs(t) {
|
|
790
792
|
return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Me) ? "up" : null : null;
|
|
791
793
|
}
|
|
792
|
-
function
|
|
793
|
-
const { channel: s } = Te(), { client: n } =
|
|
794
|
-
() =>
|
|
794
|
+
function bs(t) {
|
|
795
|
+
const { channel: s } = Te(), { client: n } = je("useMessageVote"), o = Se(
|
|
796
|
+
() => xs(t.own_reactions),
|
|
795
797
|
[t.own_reactions]
|
|
796
798
|
), l = A(async () => {
|
|
797
799
|
if (n != null && n.userID)
|
|
@@ -816,7 +818,7 @@ function xs(t) {
|
|
|
816
818
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
817
819
|
return { selected: o, voteUp: l, voteDown: d };
|
|
818
820
|
}
|
|
819
|
-
const
|
|
821
|
+
const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
820
822
|
"path",
|
|
821
823
|
{
|
|
822
824
|
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",
|
|
@@ -826,7 +828,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
826
828
|
strokeLinejoin: "round",
|
|
827
829
|
fill: t ? "currentColor" : "none"
|
|
828
830
|
}
|
|
829
|
-
) }),
|
|
831
|
+
) }), Ns = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
830
832
|
"path",
|
|
831
833
|
{
|
|
832
834
|
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",
|
|
@@ -836,7 +838,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
836
838
|
strokeLinejoin: "round",
|
|
837
839
|
fill: t ? "currentColor" : "none"
|
|
838
840
|
}
|
|
839
|
-
) }),
|
|
841
|
+
) }), vs = ({
|
|
840
842
|
selected: t,
|
|
841
843
|
onVoteUp: s,
|
|
842
844
|
onVoteDown: n
|
|
@@ -849,7 +851,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
849
851
|
onClick: s,
|
|
850
852
|
"aria-label": "Helpful",
|
|
851
853
|
"aria-pressed": t === "up",
|
|
852
|
-
children: /* @__PURE__ */ e(
|
|
854
|
+
children: /* @__PURE__ */ e(Cs, { filled: t === "up" })
|
|
853
855
|
}
|
|
854
856
|
),
|
|
855
857
|
/* @__PURE__ */ e(
|
|
@@ -860,186 +862,186 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
860
862
|
onClick: n,
|
|
861
863
|
"aria-label": "Not helpful",
|
|
862
864
|
"aria-pressed": t === "down",
|
|
863
|
-
children: /* @__PURE__ */ e(
|
|
865
|
+
children: /* @__PURE__ */ e(Ns, { filled: t === "down" })
|
|
864
866
|
}
|
|
865
867
|
)
|
|
866
|
-
] }),
|
|
867
|
-
var
|
|
868
|
+
] }), ps = (t) => {
|
|
869
|
+
var ne, me;
|
|
868
870
|
const {
|
|
869
871
|
additionalMessageInputProps: s,
|
|
870
872
|
chatbotVotingEnabled: n,
|
|
871
873
|
editing: o,
|
|
872
874
|
endOfGroup: l,
|
|
873
875
|
firstOfGroup: d,
|
|
874
|
-
groupedByUser:
|
|
876
|
+
groupedByUser: r,
|
|
875
877
|
handleAction: c,
|
|
876
|
-
handleOpenThread:
|
|
878
|
+
handleOpenThread: f,
|
|
877
879
|
handleRetry: h,
|
|
878
|
-
highlighted:
|
|
879
|
-
isMessageAIGenerated:
|
|
880
|
+
highlighted: x,
|
|
881
|
+
isMessageAIGenerated: g,
|
|
880
882
|
isMyMessage: p,
|
|
881
|
-
message:
|
|
883
|
+
message: a,
|
|
882
884
|
renderText: w,
|
|
883
885
|
threadList: _
|
|
884
|
-
} = t, { client:
|
|
885
|
-
Attachment: u =
|
|
886
|
-
EditMessageModal:
|
|
887
|
-
MessageBlocked:
|
|
888
|
-
MessageBouncePrompt:
|
|
889
|
-
MessageDeleted:
|
|
890
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
891
|
-
MessageRepliesCountButton:
|
|
892
|
-
ReminderNotification:
|
|
893
|
-
StreamedMessageText:
|
|
894
|
-
PinIndicator:
|
|
895
|
-
} =
|
|
896
|
-
() =>
|
|
897
|
-
[
|
|
898
|
-
),
|
|
899
|
-
() => !
|
|
900
|
-
[
|
|
886
|
+
} = t, { client: b } = je("CustomMessage"), [M, E] = k(!1), y = xt(a.id), { selected: S, voteUp: R, voteDown: m } = bs(a), {
|
|
887
|
+
Attachment: u = Ct,
|
|
888
|
+
EditMessageModal: C = Nt,
|
|
889
|
+
MessageBlocked: T = vt,
|
|
890
|
+
MessageBouncePrompt: v = pt,
|
|
891
|
+
MessageDeleted: N = yt,
|
|
892
|
+
MessageIsThreadReplyInChannelButtonIndicator: F = wt,
|
|
893
|
+
MessageRepliesCountButton: Q = _t,
|
|
894
|
+
ReminderNotification: Y = Et,
|
|
895
|
+
StreamedMessageText: Z = St,
|
|
896
|
+
PinIndicator: L
|
|
897
|
+
} = bt("CustomMessage"), W = It(a), j = Mt(a), re = Se(
|
|
898
|
+
() => g == null ? void 0 : g(a),
|
|
899
|
+
[g, a]
|
|
900
|
+
), z = Se(
|
|
901
|
+
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
902
|
+
[a]
|
|
901
903
|
);
|
|
902
|
-
if (
|
|
904
|
+
if (kt(a))
|
|
903
905
|
return null;
|
|
904
|
-
if (
|
|
905
|
-
return /* @__PURE__ */ e(
|
|
906
|
-
if (
|
|
907
|
-
return /* @__PURE__ */ e(
|
|
908
|
-
const
|
|
909
|
-
let
|
|
910
|
-
|
|
911
|
-
const
|
|
906
|
+
if (a.deleted_at || a.type === "deleted")
|
|
907
|
+
return /* @__PURE__ */ e(N, { message: a });
|
|
908
|
+
if (Tt(a))
|
|
909
|
+
return /* @__PURE__ */ e(T, {});
|
|
910
|
+
const te = !_ && !!a.reply_count, se = !_ && a.show_in_channel && a.parent_id, O = a.status === "failed" && ((ne = a.error) == null ? void 0 : ne.status) !== 403, P = Dt(a);
|
|
911
|
+
let B;
|
|
912
|
+
O ? B = () => h(a) : P && (B = () => E(!0));
|
|
913
|
+
const H = p(), oe = D(
|
|
912
914
|
"str-chat__message str-chat__message-simple",
|
|
913
|
-
`str-chat__message--${
|
|
914
|
-
`str-chat__message--${
|
|
915
|
-
|
|
916
|
-
|
|
915
|
+
`str-chat__message--${a.type}`,
|
|
916
|
+
`str-chat__message--${a.status}`,
|
|
917
|
+
H ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
918
|
+
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
917
919
|
{
|
|
918
|
-
"str-chat__message--has-attachment":
|
|
919
|
-
"str-chat__message--highlighted":
|
|
920
|
-
"str-chat__message--pinned pinned-message":
|
|
921
|
-
"str-chat__message--with-reactions":
|
|
922
|
-
"str-chat__message-send-can-be-retried": (
|
|
923
|
-
"str-chat__message-with-thread-link":
|
|
920
|
+
"str-chat__message--has-attachment": W,
|
|
921
|
+
"str-chat__message--highlighted": x,
|
|
922
|
+
"str-chat__message--pinned pinned-message": a.pinned,
|
|
923
|
+
"str-chat__message--with-reactions": j,
|
|
924
|
+
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((me = a == null ? void 0 : a.error) == null ? void 0 : me.status) !== 403,
|
|
925
|
+
"str-chat__message-with-thread-link": te || se,
|
|
924
926
|
"str-chat__virtual-message__wrapper--end": l,
|
|
925
927
|
"str-chat__virtual-message__wrapper--first": d,
|
|
926
|
-
"str-chat__virtual-message__wrapper--group":
|
|
928
|
+
"str-chat__virtual-message__wrapper--group": r
|
|
927
929
|
}
|
|
928
|
-
),
|
|
929
|
-
return /* @__PURE__ */ i(
|
|
930
|
+
), ve = a.poll_id && b.polls.fromState(a.poll_id), q = us(a), J = Re(a), le = !!(z != null && z.length && !a.quoted_message), ee = J && H && le;
|
|
931
|
+
return /* @__PURE__ */ i(de, { children: [
|
|
930
932
|
o && /* @__PURE__ */ e(
|
|
931
|
-
|
|
933
|
+
C,
|
|
932
934
|
{
|
|
933
935
|
additionalMessageInputProps: s
|
|
934
936
|
}
|
|
935
937
|
),
|
|
936
938
|
M && /* @__PURE__ */ e(
|
|
937
|
-
|
|
939
|
+
Rt,
|
|
938
940
|
{
|
|
939
|
-
MessageBouncePrompt:
|
|
941
|
+
MessageBouncePrompt: v,
|
|
940
942
|
onClose: () => E(!1),
|
|
941
943
|
open: M
|
|
942
944
|
}
|
|
943
945
|
),
|
|
944
|
-
/* @__PURE__ */ i("div", { className:
|
|
945
|
-
|
|
946
|
-
!!y && /* @__PURE__ */ e(
|
|
947
|
-
|
|
948
|
-
|
|
946
|
+
/* @__PURE__ */ i("div", { className: oe, children: [
|
|
947
|
+
L && /* @__PURE__ */ e(L, {}),
|
|
948
|
+
!!y && /* @__PURE__ */ e(Y, { reminder: y }),
|
|
949
|
+
a.user && /* @__PURE__ */ e(
|
|
950
|
+
ae,
|
|
949
951
|
{
|
|
950
952
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
951
|
-
id:
|
|
952
|
-
image:
|
|
953
|
-
name:
|
|
953
|
+
id: a.user.id,
|
|
954
|
+
image: a.user.image,
|
|
955
|
+
name: a.user.name || a.user.id
|
|
954
956
|
}
|
|
955
957
|
),
|
|
956
958
|
/* @__PURE__ */ e(
|
|
957
959
|
"div",
|
|
958
960
|
{
|
|
959
|
-
className:
|
|
960
|
-
"str-chat__simple-message--error-failed":
|
|
961
|
+
className: D("str-chat__message-inner", {
|
|
962
|
+
"str-chat__simple-message--error-failed": O || P
|
|
961
963
|
}),
|
|
962
964
|
"data-testid": "message-inner",
|
|
963
|
-
onClick:
|
|
964
|
-
onKeyDown:
|
|
965
|
-
role:
|
|
966
|
-
tabIndex:
|
|
965
|
+
onClick: B,
|
|
966
|
+
onKeyDown: B,
|
|
967
|
+
role: B ? "button" : void 0,
|
|
968
|
+
tabIndex: B ? 0 : void 0,
|
|
967
969
|
style: {
|
|
968
970
|
// Force margins to 0 to prevent hover layout shift
|
|
969
971
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
970
972
|
marginInlineEnd: 0,
|
|
971
973
|
marginInlineStart: 0
|
|
972
974
|
},
|
|
973
|
-
children:
|
|
975
|
+
children: q ? (
|
|
974
976
|
/* Tip-only messages render as a standalone bubble */
|
|
975
|
-
/* @__PURE__ */ e(_e, { message:
|
|
977
|
+
/* @__PURE__ */ e(_e, { message: a, standalone: !0 })
|
|
976
978
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
977
979
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
978
|
-
|
|
980
|
+
J && !ee && /* @__PURE__ */ e(
|
|
979
981
|
_e,
|
|
980
982
|
{
|
|
981
|
-
message:
|
|
982
|
-
hasAttachment:
|
|
983
|
-
isMyMessage:
|
|
983
|
+
message: a,
|
|
984
|
+
hasAttachment: le,
|
|
985
|
+
isMyMessage: H
|
|
984
986
|
}
|
|
985
987
|
),
|
|
986
|
-
|
|
987
|
-
|
|
988
|
+
ve && /* @__PURE__ */ e(Lt, { poll: ve }),
|
|
989
|
+
z != null && z.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
988
990
|
u,
|
|
989
991
|
{
|
|
990
992
|
actionHandler: c,
|
|
991
|
-
attachments:
|
|
993
|
+
attachments: z
|
|
992
994
|
}
|
|
993
995
|
) : null,
|
|
994
|
-
|
|
995
|
-
|
|
996
|
+
re ? /* @__PURE__ */ e(
|
|
997
|
+
Z,
|
|
996
998
|
{
|
|
997
|
-
message:
|
|
999
|
+
message: a,
|
|
998
1000
|
renderText: w
|
|
999
1001
|
}
|
|
1000
|
-
) : /* @__PURE__ */ e(
|
|
1001
|
-
/* @__PURE__ */ e(
|
|
1002
|
+
) : /* @__PURE__ */ e(At, { message: a, renderText: w }),
|
|
1003
|
+
/* @__PURE__ */ e(Pt, {})
|
|
1002
1004
|
] }),
|
|
1003
|
-
(!
|
|
1005
|
+
(!J || ee) && /* @__PURE__ */ e(
|
|
1004
1006
|
_e,
|
|
1005
1007
|
{
|
|
1006
|
-
message:
|
|
1007
|
-
hasAttachment:
|
|
1008
|
-
isMyMessage:
|
|
1008
|
+
message: a,
|
|
1009
|
+
hasAttachment: le,
|
|
1010
|
+
isMyMessage: H
|
|
1009
1011
|
}
|
|
1010
1012
|
),
|
|
1011
|
-
n &&
|
|
1012
|
-
|
|
1013
|
+
n && J && /* @__PURE__ */ e(
|
|
1014
|
+
vs,
|
|
1013
1015
|
{
|
|
1014
1016
|
selected: S,
|
|
1015
|
-
onVoteUp:
|
|
1017
|
+
onVoteUp: R,
|
|
1016
1018
|
onVoteDown: m
|
|
1017
1019
|
}
|
|
1018
1020
|
)
|
|
1019
1021
|
] })
|
|
1020
1022
|
}
|
|
1021
1023
|
),
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
+
te && /* @__PURE__ */ e(
|
|
1025
|
+
Q,
|
|
1024
1026
|
{
|
|
1025
|
-
onClick:
|
|
1026
|
-
reply_count:
|
|
1027
|
+
onClick: f,
|
|
1028
|
+
reply_count: a.reply_count
|
|
1027
1029
|
}
|
|
1028
1030
|
),
|
|
1029
|
-
|
|
1030
|
-
] },
|
|
1031
|
+
se && /* @__PURE__ */ e(F, {})
|
|
1032
|
+
] }, a.id)
|
|
1031
1033
|
] });
|
|
1032
|
-
},
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
),
|
|
1036
|
-
const s =
|
|
1037
|
-
return /* @__PURE__ */ e(
|
|
1038
|
-
},
|
|
1034
|
+
}, ys = G.memo(
|
|
1035
|
+
ps,
|
|
1036
|
+
gt
|
|
1037
|
+
), ws = (t) => {
|
|
1038
|
+
const s = ze("CustomMessage");
|
|
1039
|
+
return /* @__PURE__ */ e(ys, { ...s, ...t });
|
|
1040
|
+
}, _s = (t) => ({
|
|
1039
1041
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1040
|
-
(s) =>
|
|
1042
|
+
(s) => Be.previewIsLoaded(s) || Be.previewIsLoading(s)
|
|
1041
1043
|
)
|
|
1042
|
-
}),
|
|
1044
|
+
}), Es = ({
|
|
1043
1045
|
link: t,
|
|
1044
1046
|
onDismiss: s
|
|
1045
1047
|
}) => {
|
|
@@ -1064,8 +1066,8 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1064
1066
|
"button",
|
|
1065
1067
|
{
|
|
1066
1068
|
type: "button",
|
|
1067
|
-
onClick: (
|
|
1068
|
-
|
|
1069
|
+
onClick: (r) => {
|
|
1070
|
+
r.preventDefault(), s(n);
|
|
1069
1071
|
},
|
|
1070
1072
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1071
1073
|
"aria-label": "Close link preview",
|
|
@@ -1079,32 +1081,32 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1079
1081
|
]
|
|
1080
1082
|
}
|
|
1081
1083
|
);
|
|
1082
|
-
},
|
|
1083
|
-
const { linkPreviewsManager: t } =
|
|
1084
|
+
}, Ss = () => {
|
|
1085
|
+
const { linkPreviewsManager: t } = Ft(), { linkPreviews: s } = Ot(
|
|
1084
1086
|
t.state,
|
|
1085
|
-
|
|
1087
|
+
_s
|
|
1086
1088
|
), n = (l) => {
|
|
1087
1089
|
t.dismissPreview(l);
|
|
1088
1090
|
};
|
|
1089
1091
|
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(
|
|
1090
|
-
|
|
1092
|
+
Es,
|
|
1091
1093
|
{
|
|
1092
1094
|
link: l,
|
|
1093
1095
|
onDismiss: n
|
|
1094
1096
|
},
|
|
1095
1097
|
l.og_scrape_url
|
|
1096
1098
|
)) }) : null;
|
|
1097
|
-
},
|
|
1098
|
-
const { handleSubmit: t } =
|
|
1099
|
-
return /* @__PURE__ */ i(
|
|
1100
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1099
|
+
}, Is = () => {
|
|
1100
|
+
const { handleSubmit: t } = Bt(), s = Gt();
|
|
1101
|
+
return /* @__PURE__ */ i(de, { children: [
|
|
1102
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e($t, {}) }),
|
|
1101
1103
|
/* @__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: [
|
|
1102
|
-
/* @__PURE__ */ e($t, {}),
|
|
1103
|
-
/* @__PURE__ */ e(Es, {}),
|
|
1104
1104
|
/* @__PURE__ */ e(jt, {}),
|
|
1105
|
+
/* @__PURE__ */ e(Ss, {}),
|
|
1106
|
+
/* @__PURE__ */ e(zt, {}),
|
|
1105
1107
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1106
1108
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1107
|
-
|
|
1109
|
+
Ht,
|
|
1108
1110
|
{
|
|
1109
1111
|
className: "w-full resize-none outline-none leading-6",
|
|
1110
1112
|
autoFocus: !0,
|
|
@@ -1120,57 +1122,57 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1120
1122
|
disabled: !s,
|
|
1121
1123
|
onClick: t,
|
|
1122
1124
|
type: "button",
|
|
1123
|
-
children: /* @__PURE__ */ e(
|
|
1125
|
+
children: /* @__PURE__ */ e(Kt, { className: "size-4" })
|
|
1124
1126
|
}
|
|
1125
1127
|
)
|
|
1126
1128
|
] })
|
|
1127
1129
|
] })
|
|
1128
1130
|
] });
|
|
1129
|
-
},
|
|
1131
|
+
}, Ms = ({
|
|
1130
1132
|
renderActions: t
|
|
1131
1133
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
1132
1134
|
t && (t == null ? void 0 : t()),
|
|
1133
|
-
/* @__PURE__ */ e(
|
|
1134
|
-
] }),
|
|
1135
|
+
/* @__PURE__ */ e(Ut, { Input: Is })
|
|
1136
|
+
] }), ks = [
|
|
1135
1137
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1136
1138
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1137
|
-
],
|
|
1139
|
+
], Ts = {
|
|
1138
1140
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1139
1141
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1140
|
-
},
|
|
1142
|
+
}, Ds = [
|
|
1141
1143
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1142
|
-
],
|
|
1144
|
+
], Rs = {
|
|
1143
1145
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isnโt able to reply because they donโt meet our age safety guidelines."
|
|
1144
|
-
}, Ee = "age safety guidelines.",
|
|
1146
|
+
}, Ee = "age safety guidelines.", Ls = "https://linktr.ee/s/about/contact", $e = (t) => ks.includes(t), As = (t) => Ds.includes(t), Ps = (t) => {
|
|
1145
1147
|
var o;
|
|
1146
1148
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1147
|
-
if (
|
|
1149
|
+
if ($e(s))
|
|
1148
1150
|
return {
|
|
1149
1151
|
kind: "dm-agent",
|
|
1150
1152
|
type: s
|
|
1151
1153
|
};
|
|
1152
|
-
if (
|
|
1154
|
+
if (As(s))
|
|
1153
1155
|
return {
|
|
1154
1156
|
kind: "age-safety",
|
|
1155
1157
|
type: s
|
|
1156
1158
|
};
|
|
1157
1159
|
const n = t.dm_agent_system_type;
|
|
1158
|
-
if (
|
|
1160
|
+
if ($e(n))
|
|
1159
1161
|
return {
|
|
1160
1162
|
kind: "dm-agent",
|
|
1161
1163
|
type: n
|
|
1162
1164
|
};
|
|
1163
|
-
},
|
|
1165
|
+
}, Fs = (t) => {
|
|
1164
1166
|
const s = t.indexOf(Ee);
|
|
1165
1167
|
if (s === -1)
|
|
1166
1168
|
return t;
|
|
1167
1169
|
const n = s + Ee.length;
|
|
1168
|
-
return /* @__PURE__ */ i(
|
|
1170
|
+
return /* @__PURE__ */ i(de, { children: [
|
|
1169
1171
|
t.slice(0, s),
|
|
1170
1172
|
/* @__PURE__ */ e(
|
|
1171
1173
|
"a",
|
|
1172
1174
|
{
|
|
1173
|
-
href:
|
|
1175
|
+
href: Ls,
|
|
1174
1176
|
target: "_blank",
|
|
1175
1177
|
rel: "noopener noreferrer",
|
|
1176
1178
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1179,13 +1181,13 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1179
1181
|
),
|
|
1180
1182
|
t.slice(n)
|
|
1181
1183
|
] });
|
|
1182
|
-
},
|
|
1184
|
+
}, Os = (t) => {
|
|
1183
1185
|
var o, l;
|
|
1184
|
-
const s = t.message.hide_date === !0, n =
|
|
1186
|
+
const s = t.message.hide_date === !0, n = Ps(
|
|
1185
1187
|
t.message
|
|
1186
1188
|
);
|
|
1187
1189
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1188
|
-
const d = ((o = t.message.text) == null ? void 0 : o.trim()) ||
|
|
1190
|
+
const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Ts[n.type];
|
|
1189
1191
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1190
1192
|
/* @__PURE__ */ i(
|
|
1191
1193
|
"div",
|
|
@@ -1195,7 +1197,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1195
1197
|
"data-dm-agent-system-type": n.type,
|
|
1196
1198
|
children: [
|
|
1197
1199
|
/* @__PURE__ */ e(
|
|
1198
|
-
|
|
1200
|
+
Qt,
|
|
1199
1201
|
{
|
|
1200
1202
|
size: 16,
|
|
1201
1203
|
weight: "regular",
|
|
@@ -1211,7 +1213,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1211
1213
|
] });
|
|
1212
1214
|
}
|
|
1213
1215
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1214
|
-
const d = ((l = t.message.text) == null ? void 0 : l.trim()) ||
|
|
1216
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Rs[n.type];
|
|
1215
1217
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1216
1218
|
/* @__PURE__ */ i(
|
|
1217
1219
|
"div",
|
|
@@ -1221,7 +1223,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1221
1223
|
"data-age-safety-system-type": n.type,
|
|
1222
1224
|
children: [
|
|
1223
1225
|
/* @__PURE__ */ e(
|
|
1224
|
-
|
|
1226
|
+
es,
|
|
1225
1227
|
{
|
|
1226
1228
|
size: 24,
|
|
1227
1229
|
weight: "duotone",
|
|
@@ -1230,7 +1232,7 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1230
1232
|
"data-testid": "age-safety-system-message-icon"
|
|
1231
1233
|
}
|
|
1232
1234
|
),
|
|
1233
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1235
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Fs(d) }) })
|
|
1234
1236
|
]
|
|
1235
1237
|
}
|
|
1236
1238
|
),
|
|
@@ -1245,10 +1247,10 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1245
1247
|
] }),
|
|
1246
1248
|
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1247
1249
|
] });
|
|
1248
|
-
},
|
|
1250
|
+
}, Us = () => null, Bs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1249
1251
|
"div",
|
|
1250
1252
|
{
|
|
1251
|
-
className:
|
|
1253
|
+
className: D("flex items-center justify-center h-full", t),
|
|
1252
1254
|
children: [
|
|
1253
1255
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1254
1256
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -1288,31 +1290,31 @@ const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1288
1290
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1289
1291
|
]
|
|
1290
1292
|
}
|
|
1291
|
-
),
|
|
1292
|
-
/* @__PURE__ */ e(
|
|
1293
|
+
), Ce = G.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1294
|
+
/* @__PURE__ */ e(Bs, { className: "w-6 h-6" }),
|
|
1293
1295
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1294
1296
|
] }) }));
|
|
1295
|
-
|
|
1296
|
-
const
|
|
1297
|
+
Ce.displayName = "LoadingState";
|
|
1298
|
+
const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Gs = ({
|
|
1297
1299
|
onBack: t,
|
|
1298
1300
|
showBackButton: s,
|
|
1299
1301
|
onShowInfo: n,
|
|
1300
1302
|
canShowInfo: o,
|
|
1301
1303
|
showStarButton: l = !1
|
|
1302
1304
|
}) => {
|
|
1303
|
-
var
|
|
1304
|
-
const { channel: d } = Te(),
|
|
1305
|
+
var g, p, a, w, _;
|
|
1306
|
+
const { channel: d } = Te(), r = G.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1305
1307
|
(M) => {
|
|
1306
1308
|
var E;
|
|
1307
1309
|
return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== d._client.userID;
|
|
1308
1310
|
}
|
|
1309
|
-
), [d._client.userID, d.state.members]), c = ((
|
|
1311
|
+
), [d._client.userID, d.state.members]), c = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((p = r == null ? void 0 : r.user) == null ? void 0 : p.id) || "Unknown member", f = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, h = Ye(d), x = async () => {
|
|
1310
1312
|
try {
|
|
1311
1313
|
h ? await d.unpin() : await d.pin();
|
|
1312
|
-
} catch (
|
|
1314
|
+
} catch (b) {
|
|
1313
1315
|
console.error(
|
|
1314
1316
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1315
|
-
|
|
1317
|
+
b
|
|
1316
1318
|
);
|
|
1317
1319
|
}
|
|
1318
1320
|
};
|
|
@@ -1321,22 +1323,22 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1321
1323
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1322
1324
|
"button",
|
|
1323
1325
|
{
|
|
1324
|
-
className:
|
|
1326
|
+
className: ce,
|
|
1325
1327
|
onClick: t || (() => {
|
|
1326
1328
|
}),
|
|
1327
1329
|
type: "button",
|
|
1328
1330
|
"aria-label": "Back to conversations",
|
|
1329
|
-
children: /* @__PURE__ */ e(
|
|
1331
|
+
children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
|
|
1330
1332
|
}
|
|
1331
1333
|
) }),
|
|
1332
1334
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1333
1335
|
/* @__PURE__ */ e(
|
|
1334
|
-
|
|
1336
|
+
ae,
|
|
1335
1337
|
{
|
|
1336
|
-
id: ((w =
|
|
1338
|
+
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || d.id || "unknown",
|
|
1337
1339
|
name: c,
|
|
1338
|
-
image:
|
|
1339
|
-
starred: h,
|
|
1340
|
+
image: f,
|
|
1341
|
+
starred: l && h,
|
|
1340
1342
|
size: 40
|
|
1341
1343
|
}
|
|
1342
1344
|
),
|
|
@@ -1346,14 +1348,14 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1346
1348
|
l && /* @__PURE__ */ e(
|
|
1347
1349
|
"button",
|
|
1348
1350
|
{
|
|
1349
|
-
className:
|
|
1350
|
-
onClick:
|
|
1351
|
+
className: ce,
|
|
1352
|
+
onClick: x,
|
|
1351
1353
|
type: "button",
|
|
1352
1354
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1353
1355
|
children: /* @__PURE__ */ e(
|
|
1354
1356
|
Ie,
|
|
1355
1357
|
{
|
|
1356
|
-
className:
|
|
1358
|
+
className: D("size-5", {
|
|
1357
1359
|
"text-yellow-600": h,
|
|
1358
1360
|
"text-black/90": !h
|
|
1359
1361
|
}),
|
|
@@ -1365,11 +1367,11 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1365
1367
|
/* @__PURE__ */ e(
|
|
1366
1368
|
"button",
|
|
1367
1369
|
{
|
|
1368
|
-
className:
|
|
1370
|
+
className: ce,
|
|
1369
1371
|
onClick: n,
|
|
1370
1372
|
type: "button",
|
|
1371
1373
|
"aria-label": "Show info",
|
|
1372
|
-
children: /* @__PURE__ */ e(
|
|
1374
|
+
children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
|
|
1373
1375
|
}
|
|
1374
1376
|
)
|
|
1375
1377
|
] })
|
|
@@ -1381,18 +1383,18 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1381
1383
|
{
|
|
1382
1384
|
type: "button",
|
|
1383
1385
|
onClick: t,
|
|
1384
|
-
className:
|
|
1386
|
+
className: ce,
|
|
1385
1387
|
"aria-label": "Back to conversations",
|
|
1386
|
-
children: /* @__PURE__ */ e(
|
|
1388
|
+
children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
|
|
1387
1389
|
}
|
|
1388
1390
|
),
|
|
1389
1391
|
/* @__PURE__ */ e(
|
|
1390
|
-
|
|
1392
|
+
ae,
|
|
1391
1393
|
{
|
|
1392
|
-
id: ((_ =
|
|
1394
|
+
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) || d.id || "unknown",
|
|
1393
1395
|
name: c,
|
|
1394
|
-
image:
|
|
1395
|
-
starred: h,
|
|
1396
|
+
image: f,
|
|
1397
|
+
starred: l && h,
|
|
1396
1398
|
size: 40
|
|
1397
1399
|
}
|
|
1398
1400
|
),
|
|
@@ -1402,14 +1404,14 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1402
1404
|
l && /* @__PURE__ */ e(
|
|
1403
1405
|
"button",
|
|
1404
1406
|
{
|
|
1405
|
-
className:
|
|
1406
|
-
onClick:
|
|
1407
|
+
className: ce,
|
|
1408
|
+
onClick: x,
|
|
1407
1409
|
type: "button",
|
|
1408
1410
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1409
1411
|
children: /* @__PURE__ */ e(
|
|
1410
1412
|
Ie,
|
|
1411
1413
|
{
|
|
1412
|
-
className:
|
|
1414
|
+
className: D("size-5", {
|
|
1413
1415
|
"text-yellow-600": h,
|
|
1414
1416
|
"text-black/90": !h
|
|
1415
1417
|
}),
|
|
@@ -1421,118 +1423,118 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1421
1423
|
o && n && /* @__PURE__ */ e(
|
|
1422
1424
|
"button",
|
|
1423
1425
|
{
|
|
1424
|
-
className:
|
|
1426
|
+
className: ce,
|
|
1425
1427
|
onClick: n,
|
|
1426
1428
|
type: "button",
|
|
1427
1429
|
"aria-label": "Show info",
|
|
1428
|
-
children: /* @__PURE__ */ e(
|
|
1430
|
+
children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
|
|
1429
1431
|
}
|
|
1430
1432
|
)
|
|
1431
1433
|
] })
|
|
1432
1434
|
] })
|
|
1433
1435
|
] });
|
|
1434
|
-
},
|
|
1436
|
+
}, $s = ({
|
|
1435
1437
|
onBack: t,
|
|
1436
1438
|
showBackButton: s,
|
|
1437
1439
|
renderMessageInputActions: n,
|
|
1438
1440
|
renderConversationFooter: o,
|
|
1439
1441
|
onLeaveConversation: l,
|
|
1440
1442
|
onBlockParticipant: d,
|
|
1441
|
-
showDeleteConversation:
|
|
1443
|
+
showDeleteConversation: r = !0,
|
|
1442
1444
|
onDeleteConversationClick: c,
|
|
1443
|
-
onBlockParticipantClick:
|
|
1445
|
+
onBlockParticipantClick: f,
|
|
1444
1446
|
onReportParticipantClick: h,
|
|
1445
|
-
showStarButton:
|
|
1446
|
-
chatbotVotingEnabled:
|
|
1447
|
+
showStarButton: x = !1,
|
|
1448
|
+
chatbotVotingEnabled: g = !1,
|
|
1447
1449
|
renderChannelBanner: p,
|
|
1448
|
-
customProfileContent:
|
|
1450
|
+
customProfileContent: a,
|
|
1449
1451
|
customChannelActions: w,
|
|
1450
1452
|
renderMessage: _
|
|
1451
1453
|
}) => {
|
|
1452
|
-
const { channel:
|
|
1454
|
+
const { channel: b } = Te(), M = X(null), E = G.useMemo(() => Object.values(b.state.members || {}).find(
|
|
1453
1455
|
(u) => {
|
|
1454
|
-
var
|
|
1455
|
-
return ((
|
|
1456
|
+
var C;
|
|
1457
|
+
return ((C = u.user) == null ? void 0 : C.id) && u.user.id !== b._client.userID;
|
|
1456
1458
|
}
|
|
1457
|
-
), [
|
|
1458
|
-
const m =
|
|
1459
|
+
), [b._client.userID, b.state.members]), y = G.useMemo(() => {
|
|
1460
|
+
const m = b.data ?? {};
|
|
1459
1461
|
if (m.followerStatus)
|
|
1460
1462
|
return String(m.followerStatus);
|
|
1461
1463
|
if (m.isFollower !== void 0)
|
|
1462
1464
|
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1463
|
-
}, [
|
|
1465
|
+
}, [b.data]), S = A(() => {
|
|
1464
1466
|
var m;
|
|
1465
1467
|
(m = M.current) == null || m.showModal();
|
|
1466
|
-
}, []),
|
|
1468
|
+
}, []), R = A(() => {
|
|
1467
1469
|
var m;
|
|
1468
1470
|
(m = M.current) == null || m.close();
|
|
1469
1471
|
}, []);
|
|
1470
|
-
return /* @__PURE__ */ i(
|
|
1472
|
+
return /* @__PURE__ */ i(de, { children: [
|
|
1471
1473
|
/* @__PURE__ */ e(
|
|
1472
|
-
|
|
1474
|
+
Yt,
|
|
1473
1475
|
{
|
|
1474
1476
|
overrides: {
|
|
1475
1477
|
Message: (m) => {
|
|
1476
|
-
const { message: u } =
|
|
1477
|
-
|
|
1478
|
+
const { message: u } = ze("ChannelView"), C = /* @__PURE__ */ e(
|
|
1479
|
+
ws,
|
|
1478
1480
|
{
|
|
1479
1481
|
...m,
|
|
1480
|
-
chatbotVotingEnabled:
|
|
1482
|
+
chatbotVotingEnabled: g
|
|
1481
1483
|
}
|
|
1482
1484
|
);
|
|
1483
|
-
return !_ || !u ?
|
|
1485
|
+
return !_ || !u ? C : _(C, u);
|
|
1484
1486
|
}
|
|
1485
1487
|
},
|
|
1486
|
-
children: /* @__PURE__ */ i(
|
|
1488
|
+
children: /* @__PURE__ */ i(Wt, { children: [
|
|
1487
1489
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1488
|
-
|
|
1490
|
+
Gs,
|
|
1489
1491
|
{
|
|
1490
1492
|
onBack: t,
|
|
1491
1493
|
showBackButton: s,
|
|
1492
1494
|
onShowInfo: S,
|
|
1493
1495
|
canShowInfo: !!E,
|
|
1494
|
-
showStarButton:
|
|
1496
|
+
showStarButton: x
|
|
1495
1497
|
}
|
|
1496
1498
|
) }),
|
|
1497
1499
|
p == null ? void 0 : p(),
|
|
1498
1500
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1499
|
-
|
|
1501
|
+
qt,
|
|
1500
1502
|
{
|
|
1501
1503
|
hideDeletedMessages: !0,
|
|
1502
1504
|
hideNewMessageSeparator: !1,
|
|
1503
1505
|
messageActions: void 0
|
|
1504
1506
|
}
|
|
1505
1507
|
) }),
|
|
1506
|
-
o == null ? void 0 : o(
|
|
1508
|
+
o == null ? void 0 : o(b),
|
|
1507
1509
|
/* @__PURE__ */ e(
|
|
1508
|
-
|
|
1510
|
+
Ms,
|
|
1509
1511
|
{
|
|
1510
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1512
|
+
renderActions: () => n == null ? void 0 : n(b)
|
|
1511
1513
|
}
|
|
1512
1514
|
)
|
|
1513
1515
|
] })
|
|
1514
1516
|
}
|
|
1515
1517
|
),
|
|
1516
1518
|
/* @__PURE__ */ e(
|
|
1517
|
-
|
|
1519
|
+
fs,
|
|
1518
1520
|
{
|
|
1519
1521
|
dialogRef: M,
|
|
1520
|
-
onClose:
|
|
1522
|
+
onClose: R,
|
|
1521
1523
|
participant: E,
|
|
1522
|
-
channel:
|
|
1524
|
+
channel: b,
|
|
1523
1525
|
followerStatusLabel: y,
|
|
1524
1526
|
onLeaveConversation: l,
|
|
1525
1527
|
onBlockParticipant: d,
|
|
1526
|
-
showDeleteConversation:
|
|
1528
|
+
showDeleteConversation: r,
|
|
1527
1529
|
onDeleteConversationClick: c,
|
|
1528
|
-
onBlockParticipantClick:
|
|
1530
|
+
onBlockParticipantClick: f,
|
|
1529
1531
|
onReportParticipantClick: h,
|
|
1530
|
-
customProfileContent:
|
|
1532
|
+
customProfileContent: a,
|
|
1531
1533
|
customChannelActions: w
|
|
1532
1534
|
}
|
|
1533
1535
|
)
|
|
1534
1536
|
] });
|
|
1535
|
-
},
|
|
1537
|
+
}, Ke = G.memo(
|
|
1536
1538
|
({
|
|
1537
1539
|
channel: t,
|
|
1538
1540
|
onBack: s,
|
|
@@ -1540,79 +1542,79 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1540
1542
|
renderMessageInputActions: o,
|
|
1541
1543
|
renderConversationFooter: l,
|
|
1542
1544
|
onLeaveConversation: d,
|
|
1543
|
-
onBlockParticipant:
|
|
1545
|
+
onBlockParticipant: r,
|
|
1544
1546
|
className: c,
|
|
1545
|
-
CustomChannelEmptyState:
|
|
1547
|
+
CustomChannelEmptyState: f = Us,
|
|
1546
1548
|
showDeleteConversation: h = !0,
|
|
1547
|
-
onDeleteConversationClick:
|
|
1548
|
-
onBlockParticipantClick:
|
|
1549
|
+
onDeleteConversationClick: x,
|
|
1550
|
+
onBlockParticipantClick: g,
|
|
1549
1551
|
onReportParticipantClick: p,
|
|
1550
|
-
dmAgentEnabled:
|
|
1552
|
+
dmAgentEnabled: a,
|
|
1551
1553
|
messageMetadata: w,
|
|
1552
1554
|
onMessageSent: _,
|
|
1553
|
-
showStarButton:
|
|
1555
|
+
showStarButton: b = !1,
|
|
1554
1556
|
chatbotVotingEnabled: M = !1,
|
|
1555
1557
|
renderChannelBanner: E,
|
|
1556
1558
|
customProfileContent: y,
|
|
1557
1559
|
customChannelActions: S,
|
|
1558
|
-
renderMessage:
|
|
1560
|
+
renderMessage: R
|
|
1559
1561
|
}) => {
|
|
1560
1562
|
const m = A(
|
|
1561
|
-
async (u,
|
|
1562
|
-
var
|
|
1563
|
-
const
|
|
1564
|
-
...
|
|
1565
|
-
...
|
|
1563
|
+
async (u, C, T) => {
|
|
1564
|
+
var Z;
|
|
1565
|
+
const v = ((Z = t.data) == null ? void 0 : Z.chatbot_paused) === !0, N = a && !v, F = {
|
|
1566
|
+
...C,
|
|
1567
|
+
...N && { silent: !0 },
|
|
1566
1568
|
...w && {
|
|
1567
1569
|
metadata: {
|
|
1568
|
-
...
|
|
1570
|
+
...C.metadata ?? {},
|
|
1569
1571
|
...w
|
|
1570
1572
|
}
|
|
1571
1573
|
}
|
|
1572
|
-
},
|
|
1573
|
-
...
|
|
1574
|
-
...
|
|
1575
|
-
},
|
|
1576
|
-
return _ == null || _(
|
|
1574
|
+
}, Q = {
|
|
1575
|
+
...T,
|
|
1576
|
+
...N && { skip_push: !0 }
|
|
1577
|
+
}, Y = await t.sendMessage(F, Q);
|
|
1578
|
+
return _ == null || _(Y), Y;
|
|
1577
1579
|
},
|
|
1578
|
-
[t,
|
|
1580
|
+
[t, a, w, _]
|
|
1579
1581
|
);
|
|
1580
1582
|
return /* @__PURE__ */ e(
|
|
1581
1583
|
"div",
|
|
1582
1584
|
{
|
|
1583
|
-
className:
|
|
1585
|
+
className: D(
|
|
1584
1586
|
"messaging-channel-view h-full flex flex-col",
|
|
1585
1587
|
c
|
|
1586
1588
|
),
|
|
1587
1589
|
children: /* @__PURE__ */ e(
|
|
1588
|
-
|
|
1590
|
+
Vt,
|
|
1589
1591
|
{
|
|
1590
1592
|
channel: t,
|
|
1591
|
-
MessageSystem:
|
|
1592
|
-
EmptyStateIndicator:
|
|
1593
|
-
LoadingIndicator:
|
|
1594
|
-
DateSeparator:
|
|
1593
|
+
MessageSystem: Os,
|
|
1594
|
+
EmptyStateIndicator: f,
|
|
1595
|
+
LoadingIndicator: Ce,
|
|
1596
|
+
DateSeparator: gs,
|
|
1595
1597
|
doSendMessageRequest: m,
|
|
1596
1598
|
children: /* @__PURE__ */ e(
|
|
1597
|
-
|
|
1599
|
+
$s,
|
|
1598
1600
|
{
|
|
1599
1601
|
onBack: s,
|
|
1600
1602
|
showBackButton: n,
|
|
1601
1603
|
renderMessageInputActions: o,
|
|
1602
1604
|
renderConversationFooter: l,
|
|
1603
1605
|
onLeaveConversation: d,
|
|
1604
|
-
onBlockParticipant:
|
|
1605
|
-
CustomChannelEmptyState:
|
|
1606
|
+
onBlockParticipant: r,
|
|
1607
|
+
CustomChannelEmptyState: f,
|
|
1606
1608
|
showDeleteConversation: h,
|
|
1607
|
-
onDeleteConversationClick:
|
|
1608
|
-
onBlockParticipantClick:
|
|
1609
|
+
onDeleteConversationClick: x,
|
|
1610
|
+
onBlockParticipantClick: g,
|
|
1609
1611
|
onReportParticipantClick: p,
|
|
1610
|
-
showStarButton:
|
|
1612
|
+
showStarButton: b,
|
|
1611
1613
|
chatbotVotingEnabled: M,
|
|
1612
1614
|
renderChannelBanner: E,
|
|
1613
1615
|
customProfileContent: y,
|
|
1614
1616
|
customChannelActions: S,
|
|
1615
|
-
renderMessage:
|
|
1617
|
+
renderMessage: R
|
|
1616
1618
|
}
|
|
1617
1619
|
)
|
|
1618
1620
|
}
|
|
@@ -1621,8 +1623,8 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1621
1623
|
);
|
|
1622
1624
|
}
|
|
1623
1625
|
);
|
|
1624
|
-
|
|
1625
|
-
function
|
|
1626
|
+
Ke.displayName = "ChannelView";
|
|
1627
|
+
function js({
|
|
1626
1628
|
searchQuery: t,
|
|
1627
1629
|
setSearchQuery: s,
|
|
1628
1630
|
placeholder: n
|
|
@@ -1630,7 +1632,7 @@ function $s({
|
|
|
1630
1632
|
const o = X(null);
|
|
1631
1633
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1632
1634
|
/* @__PURE__ */ e(
|
|
1633
|
-
|
|
1635
|
+
ts,
|
|
1634
1636
|
{
|
|
1635
1637
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1636
1638
|
weight: "bold"
|
|
@@ -1648,7 +1650,7 @@ function $s({
|
|
|
1648
1650
|
}
|
|
1649
1651
|
),
|
|
1650
1652
|
t && /* @__PURE__ */ e(
|
|
1651
|
-
|
|
1653
|
+
Je,
|
|
1652
1654
|
{
|
|
1653
1655
|
label: "Clear search",
|
|
1654
1656
|
onClick: () => {
|
|
@@ -1661,16 +1663,16 @@ function $s({
|
|
|
1661
1663
|
)
|
|
1662
1664
|
] });
|
|
1663
1665
|
}
|
|
1664
|
-
const
|
|
1666
|
+
const zs = ({
|
|
1665
1667
|
participantSource: t,
|
|
1666
1668
|
onSelectParticipant: s,
|
|
1667
1669
|
onClose: n,
|
|
1668
1670
|
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1669
1671
|
participantLabel: l = "participants",
|
|
1670
1672
|
searchPlaceholder: d = "Search participants...",
|
|
1671
|
-
className:
|
|
1673
|
+
className: r
|
|
1672
1674
|
}) => {
|
|
1673
|
-
const { debug: c } =
|
|
1675
|
+
const { debug: c } = Ne(), [f, h] = k(""), [x, g] = k([]), [p, a] = k(!1), [w, _] = k(null), [b, M] = k(
|
|
1674
1676
|
null
|
|
1675
1677
|
), E = X(!1);
|
|
1676
1678
|
K(() => {
|
|
@@ -1682,33 +1684,33 @@ const js = ({
|
|
|
1682
1684
|
}
|
|
1683
1685
|
if (E.current) return;
|
|
1684
1686
|
(async () => {
|
|
1685
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1687
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), _(null);
|
|
1686
1688
|
try {
|
|
1687
1689
|
const u = await t.loadParticipants({
|
|
1688
1690
|
search: "",
|
|
1689
1691
|
// Load all participants initially
|
|
1690
1692
|
limit: 100
|
|
1691
1693
|
});
|
|
1692
|
-
|
|
1694
|
+
g(u.participants), E.current = !0, c && console.log(
|
|
1693
1695
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1694
1696
|
u.participants.length
|
|
1695
1697
|
);
|
|
1696
1698
|
} catch (u) {
|
|
1697
|
-
const
|
|
1698
|
-
_(
|
|
1699
|
+
const C = u instanceof Error ? u.message : "Failed to load participants";
|
|
1700
|
+
_(C), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1699
1701
|
} finally {
|
|
1700
|
-
|
|
1702
|
+
a(!1);
|
|
1701
1703
|
}
|
|
1702
1704
|
})();
|
|
1703
1705
|
}, [t.loading, c]);
|
|
1704
|
-
const y =
|
|
1705
|
-
var
|
|
1706
|
-
if (!
|
|
1707
|
-
const u =
|
|
1708
|
-
return m.name.toLowerCase().includes(u) || ((
|
|
1706
|
+
const y = x.filter((m) => !o.has(m.id)).filter((m) => {
|
|
1707
|
+
var C;
|
|
1708
|
+
if (!f) return !0;
|
|
1709
|
+
const u = f.toLowerCase();
|
|
1710
|
+
return m.name.toLowerCase().includes(u) || ((C = m.email) == null ? void 0 : C.toLowerCase().includes(u)) || !1;
|
|
1709
1711
|
}), S = A(
|
|
1710
1712
|
async (m) => {
|
|
1711
|
-
if (!
|
|
1713
|
+
if (!b) {
|
|
1712
1714
|
M(m.id);
|
|
1713
1715
|
try {
|
|
1714
1716
|
await s(m);
|
|
@@ -1717,15 +1719,15 @@ const js = ({
|
|
|
1717
1719
|
}
|
|
1718
1720
|
}
|
|
1719
1721
|
},
|
|
1720
|
-
[s,
|
|
1721
|
-
),
|
|
1722
|
+
[s, b]
|
|
1723
|
+
), R = (m, u) => {
|
|
1722
1724
|
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), S(u));
|
|
1723
1725
|
};
|
|
1724
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1726
|
+
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
|
|
1725
1727
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1726
1728
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1727
1729
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1728
|
-
/* @__PURE__ */ e(
|
|
1730
|
+
/* @__PURE__ */ e(Xe, { onClick: n })
|
|
1729
1731
|
] }),
|
|
1730
1732
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1731
1733
|
"Select a ",
|
|
@@ -1736,9 +1738,9 @@ const js = ({
|
|
|
1736
1738
|
t.totalCount !== void 0 && ` โข ${t.totalCount} ${l} total`
|
|
1737
1739
|
] }),
|
|
1738
1740
|
/* @__PURE__ */ e(
|
|
1739
|
-
|
|
1741
|
+
js,
|
|
1740
1742
|
{
|
|
1741
|
-
searchQuery:
|
|
1743
|
+
searchQuery: f,
|
|
1742
1744
|
setSearchQuery: h,
|
|
1743
1745
|
placeholder: d
|
|
1744
1746
|
}
|
|
@@ -1758,23 +1760,23 @@ const js = ({
|
|
|
1758
1760
|
"..."
|
|
1759
1761
|
] })
|
|
1760
1762
|
] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1761
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1762
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1763
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1763
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ue, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1764
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : x.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1765
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1764
1766
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1765
1767
|
y.map((m) => {
|
|
1766
|
-
const u = m.name || m.email || m.id,
|
|
1768
|
+
const u = m.name || m.email || m.id, C = m.email && m.name ? m.email : m.phone;
|
|
1767
1769
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1768
1770
|
"button",
|
|
1769
1771
|
{
|
|
1770
1772
|
type: "button",
|
|
1771
1773
|
onClick: () => S(m),
|
|
1772
|
-
onKeyDown: (
|
|
1774
|
+
onKeyDown: (T) => R(T, m),
|
|
1773
1775
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1774
1776
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1775
1777
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1776
1778
|
/* @__PURE__ */ e(
|
|
1777
|
-
|
|
1779
|
+
ae,
|
|
1778
1780
|
{
|
|
1779
1781
|
id: m.id,
|
|
1780
1782
|
name: u,
|
|
@@ -1784,10 +1786,10 @@ const js = ({
|
|
|
1784
1786
|
),
|
|
1785
1787
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1786
1788
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
|
|
1787
|
-
|
|
1789
|
+
C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
|
|
1788
1790
|
] })
|
|
1789
1791
|
] }),
|
|
1790
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1792
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: b === m.id ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5 text-stone" }) })
|
|
1791
1793
|
] })
|
|
1792
1794
|
}
|
|
1793
1795
|
) }, m.id);
|
|
@@ -1798,7 +1800,7 @@ const js = ({
|
|
|
1798
1800
|
] }) })
|
|
1799
1801
|
] }) })
|
|
1800
1802
|
] });
|
|
1801
|
-
},
|
|
1803
|
+
}, Hs = ({ className: t }) => /* @__PURE__ */ i(
|
|
1802
1804
|
"svg",
|
|
1803
1805
|
{
|
|
1804
1806
|
width: "140",
|
|
@@ -1932,17 +1934,17 @@ const js = ({
|
|
|
1932
1934
|
] })
|
|
1933
1935
|
]
|
|
1934
1936
|
}
|
|
1935
|
-
),
|
|
1937
|
+
), Qe = G.memo(
|
|
1936
1938
|
({ 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: [
|
|
1937
|
-
/* @__PURE__ */ e(
|
|
1939
|
+
/* @__PURE__ */ e(Hs, {}),
|
|
1938
1940
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1939
1941
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1940
1942
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1941
1943
|
] })
|
|
1942
1944
|
] }) })
|
|
1943
1945
|
);
|
|
1944
|
-
|
|
1945
|
-
const
|
|
1946
|
+
Qe.displayName = "EmptyState";
|
|
1947
|
+
const be = G.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: [
|
|
1946
1948
|
/* @__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: "โ ๏ธ" }) }),
|
|
1947
1949
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1948
1950
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1956,48 +1958,49 @@ const Ce = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1956
1958
|
}
|
|
1957
1959
|
)
|
|
1958
1960
|
] }) }));
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
+
be.displayName = "ErrorState";
|
|
1962
|
+
const en = ({
|
|
1961
1963
|
capabilities: t = {},
|
|
1962
1964
|
className: s,
|
|
1963
1965
|
renderMessageInputActions: n,
|
|
1964
1966
|
renderConversationFooter: o,
|
|
1965
1967
|
onChannelSelect: l,
|
|
1966
1968
|
onParticipantSelect: d,
|
|
1967
|
-
initialParticipantFilter:
|
|
1969
|
+
initialParticipantFilter: r,
|
|
1968
1970
|
initialParticipantData: c,
|
|
1969
|
-
CustomChannelEmptyState:
|
|
1971
|
+
CustomChannelEmptyState: f,
|
|
1970
1972
|
showChannelList: h = !0,
|
|
1971
|
-
filters:
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1973
|
+
filters: x,
|
|
1974
|
+
channelRenderFilterFn: g,
|
|
1975
|
+
channelListCustomEmptyStateIndicator: p,
|
|
1976
|
+
onDeleteConversationClick: a,
|
|
1977
|
+
onBlockParticipantClick: w,
|
|
1978
|
+
onReportParticipantClick: _,
|
|
1979
|
+
dmAgentEnabled: b,
|
|
1980
|
+
messageMetadata: M,
|
|
1981
|
+
onMessageSent: E,
|
|
1982
|
+
showStarButton: y = !1,
|
|
1983
|
+
chatbotVotingEnabled: S = !1,
|
|
1984
|
+
renderMessagePreview: R,
|
|
1985
|
+
renderChannelBanner: m,
|
|
1986
|
+
customProfileContent: u,
|
|
1987
|
+
customChannelActions: C,
|
|
1988
|
+
renderMessage: T
|
|
1986
1989
|
}) => {
|
|
1987
1990
|
const {
|
|
1988
1991
|
service: v,
|
|
1989
|
-
client:
|
|
1990
|
-
isConnected:
|
|
1991
|
-
isLoading:
|
|
1992
|
-
error:
|
|
1993
|
-
refreshConnection:
|
|
1994
|
-
debug:
|
|
1995
|
-
} =
|
|
1992
|
+
client: N,
|
|
1993
|
+
isConnected: F,
|
|
1994
|
+
isLoading: Q,
|
|
1995
|
+
error: Y,
|
|
1996
|
+
refreshConnection: Z,
|
|
1997
|
+
debug: L
|
|
1998
|
+
} = ss(), [W, j] = k(null), [re, z] = k(!1), [te, se] = k(!1), [O, P] = k(!1), [B, H] = k(/* @__PURE__ */ new Set()), [oe, ve] = k(0), [q, J] = k(!1), [le, ee] = k(null), ne = X(null), {
|
|
1996
1999
|
participantSource: me,
|
|
1997
|
-
participantLabel:
|
|
1998
|
-
showDeleteConversation:
|
|
1999
|
-
} = t,
|
|
2000
|
-
const I =
|
|
2000
|
+
participantLabel: Le = "participants",
|
|
2001
|
+
showDeleteConversation: et = !0
|
|
2002
|
+
} = t, tt = G.useMemo(() => {
|
|
2003
|
+
const I = N == null ? void 0 : N.userID;
|
|
2001
2004
|
return {
|
|
2002
2005
|
...{
|
|
2003
2006
|
type: "messaging",
|
|
@@ -2007,171 +2010,171 @@ const Qs = ({
|
|
|
2007
2010
|
hidden: !1
|
|
2008
2011
|
}
|
|
2009
2012
|
},
|
|
2010
|
-
...
|
|
2013
|
+
...x
|
|
2011
2014
|
};
|
|
2012
|
-
}, [
|
|
2013
|
-
if (!
|
|
2014
|
-
const I =
|
|
2015
|
+
}, [x, N == null ? void 0 : N.userID]), ue = X(null), ie = A(async () => {
|
|
2016
|
+
if (!N || !F) return;
|
|
2017
|
+
const I = N.userID;
|
|
2015
2018
|
if (I)
|
|
2016
2019
|
try {
|
|
2017
|
-
|
|
2018
|
-
const
|
|
2020
|
+
L && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
2021
|
+
const V = await N.queryChannels(
|
|
2019
2022
|
{
|
|
2020
2023
|
type: "messaging",
|
|
2021
2024
|
members: { $in: [I] }
|
|
2022
2025
|
},
|
|
2023
2026
|
{},
|
|
2024
2027
|
{ limit: 100 }
|
|
2025
|
-
),
|
|
2026
|
-
|
|
2027
|
-
const pe =
|
|
2028
|
-
Object.values(pe).forEach((
|
|
2029
|
-
var
|
|
2030
|
-
const ye = (
|
|
2031
|
-
ye && ye !== I &&
|
|
2028
|
+
), U = /* @__PURE__ */ new Set();
|
|
2029
|
+
V.forEach(($) => {
|
|
2030
|
+
const pe = $.state.members;
|
|
2031
|
+
Object.values(pe).forEach((it) => {
|
|
2032
|
+
var Ae;
|
|
2033
|
+
const ye = (Ae = it.user) == null ? void 0 : Ae.id;
|
|
2034
|
+
ye && ye !== I && U.add(ye);
|
|
2032
2035
|
});
|
|
2033
|
-
}),
|
|
2034
|
-
channelCount:
|
|
2035
|
-
memberCount:
|
|
2036
|
+
}), H(($) => $.size === U.size && [...$].every((pe) => U.has(pe)) ? $ : U), z(V.length > 0), se(!0), ue.current = I, L && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2037
|
+
channelCount: V.length,
|
|
2038
|
+
memberCount: U.size
|
|
2036
2039
|
});
|
|
2037
|
-
} catch (
|
|
2038
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
2040
|
+
} catch (V) {
|
|
2041
|
+
console.error("[MessagingShell] Failed to sync channels:", V);
|
|
2039
2042
|
}
|
|
2040
|
-
}, [
|
|
2043
|
+
}, [N, F, L]);
|
|
2041
2044
|
K(() => {
|
|
2042
|
-
if (!
|
|
2043
|
-
const I =
|
|
2044
|
-
I &&
|
|
2045
|
-
}, [
|
|
2046
|
-
if (!
|
|
2045
|
+
if (!N || !F) return;
|
|
2046
|
+
const I = N.userID;
|
|
2047
|
+
I && ue.current !== I && ie();
|
|
2048
|
+
}, [N, F, ie]), K(() => {
|
|
2049
|
+
if (!r || !N || !F) return;
|
|
2047
2050
|
(async () => {
|
|
2048
|
-
const
|
|
2049
|
-
if (
|
|
2051
|
+
const V = N.userID;
|
|
2052
|
+
if (V)
|
|
2050
2053
|
try {
|
|
2051
|
-
|
|
2054
|
+
L && console.log(
|
|
2052
2055
|
"[MessagingShell] Loading initial conversation with:",
|
|
2053
|
-
|
|
2056
|
+
r
|
|
2054
2057
|
);
|
|
2055
|
-
const
|
|
2058
|
+
const U = await N.queryChannels(
|
|
2056
2059
|
{
|
|
2057
2060
|
type: "messaging",
|
|
2058
|
-
members: { $eq: [
|
|
2061
|
+
members: { $eq: [V, r] }
|
|
2059
2062
|
},
|
|
2060
2063
|
{},
|
|
2061
2064
|
{ limit: 1 }
|
|
2062
2065
|
);
|
|
2063
|
-
if (
|
|
2064
|
-
|
|
2066
|
+
if (U.length > 0)
|
|
2067
|
+
j(U[0]), J(!0), ee(null), l && l(U[0]), L && console.log(
|
|
2065
2068
|
"[MessagingShell] Initial conversation loaded:",
|
|
2066
|
-
|
|
2069
|
+
U[0].id
|
|
2067
2070
|
);
|
|
2068
2071
|
else if (c && v) {
|
|
2069
|
-
|
|
2072
|
+
L && console.log(
|
|
2070
2073
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2071
2074
|
c
|
|
2072
2075
|
);
|
|
2073
2076
|
try {
|
|
2074
|
-
const
|
|
2077
|
+
const $ = await v.startChannelWithParticipant({
|
|
2075
2078
|
id: c.id,
|
|
2076
2079
|
name: c.name,
|
|
2077
2080
|
email: c.email,
|
|
2078
2081
|
phone: c.phone
|
|
2079
2082
|
});
|
|
2080
|
-
$
|
|
2083
|
+
j($), J(!0), ee(null), l && l($), L && console.log(
|
|
2081
2084
|
"[MessagingShell] Channel created and loaded:",
|
|
2082
|
-
|
|
2085
|
+
$.id
|
|
2083
2086
|
);
|
|
2084
|
-
} catch (
|
|
2087
|
+
} catch ($) {
|
|
2085
2088
|
console.error(
|
|
2086
2089
|
"[MessagingShell] Failed to create conversation:",
|
|
2087
|
-
|
|
2088
|
-
),
|
|
2090
|
+
$
|
|
2091
|
+
), ee("Failed to create conversation");
|
|
2089
2092
|
}
|
|
2090
2093
|
} else
|
|
2091
|
-
|
|
2094
|
+
ee(
|
|
2092
2095
|
"No conversation found with this account"
|
|
2093
|
-
),
|
|
2096
|
+
), L && console.log(
|
|
2094
2097
|
"[MessagingShell] No conversation found for:",
|
|
2095
|
-
|
|
2098
|
+
r
|
|
2096
2099
|
);
|
|
2097
|
-
} catch (
|
|
2100
|
+
} catch (U) {
|
|
2098
2101
|
console.error(
|
|
2099
2102
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2100
|
-
|
|
2101
|
-
),
|
|
2103
|
+
U
|
|
2104
|
+
), ee("Failed to load conversation");
|
|
2102
2105
|
}
|
|
2103
2106
|
})();
|
|
2104
2107
|
}, [
|
|
2105
|
-
|
|
2108
|
+
r,
|
|
2106
2109
|
c,
|
|
2107
|
-
|
|
2108
|
-
|
|
2110
|
+
N,
|
|
2111
|
+
F,
|
|
2109
2112
|
v,
|
|
2110
|
-
|
|
2113
|
+
L,
|
|
2111
2114
|
l
|
|
2112
2115
|
]);
|
|
2113
|
-
const
|
|
2116
|
+
const st = A(
|
|
2114
2117
|
(I) => {
|
|
2115
|
-
|
|
2118
|
+
j(I), l == null || l(I);
|
|
2116
2119
|
},
|
|
2117
2120
|
[l]
|
|
2118
|
-
),
|
|
2119
|
-
|
|
2120
|
-
}, [
|
|
2121
|
+
), nt = A(() => {
|
|
2122
|
+
q || j(null);
|
|
2123
|
+
}, [q]), at = A(
|
|
2121
2124
|
async (I) => {
|
|
2122
|
-
var
|
|
2125
|
+
var V;
|
|
2123
2126
|
if (v)
|
|
2124
2127
|
try {
|
|
2125
|
-
|
|
2128
|
+
L && console.log(
|
|
2126
2129
|
"[MessagingShell] Starting conversation with:",
|
|
2127
2130
|
I.id
|
|
2128
2131
|
);
|
|
2129
|
-
const
|
|
2132
|
+
const U = await v.startChannelWithParticipant({
|
|
2130
2133
|
id: I.id,
|
|
2131
2134
|
name: I.name,
|
|
2132
2135
|
email: I.email,
|
|
2133
2136
|
phone: I.phone
|
|
2134
2137
|
});
|
|
2135
2138
|
try {
|
|
2136
|
-
await
|
|
2137
|
-
} catch (
|
|
2138
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
2139
|
+
await U.show();
|
|
2140
|
+
} catch ($) {
|
|
2141
|
+
console.warn("[MessagingShell] Failed to unhide channel:", $);
|
|
2139
2142
|
}
|
|
2140
|
-
|
|
2141
|
-
} catch (
|
|
2142
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2143
|
+
j(U), P(!1), (V = ne.current) == null || V.close(), d == null || d(I);
|
|
2144
|
+
} catch (U) {
|
|
2145
|
+
console.error("[MessagingShell] Failed to start conversation:", U);
|
|
2143
2146
|
}
|
|
2144
2147
|
},
|
|
2145
|
-
[v, d,
|
|
2146
|
-
),
|
|
2148
|
+
[v, d, L]
|
|
2149
|
+
), he = A(() => {
|
|
2147
2150
|
var I;
|
|
2148
|
-
P(!1), (I =
|
|
2149
|
-
}, []),
|
|
2151
|
+
P(!1), (I = ne.current) == null || I.close();
|
|
2152
|
+
}, []), rt = A(
|
|
2150
2153
|
(I) => {
|
|
2151
|
-
I.target ===
|
|
2154
|
+
I.target === ne.current && he();
|
|
2152
2155
|
},
|
|
2153
|
-
[
|
|
2154
|
-
),
|
|
2156
|
+
[he]
|
|
2157
|
+
), ot = A(
|
|
2155
2158
|
async (I) => {
|
|
2156
|
-
|
|
2159
|
+
L && console.log("[MessagingShell] Leaving conversation:", I.id), j(null), J(!1), ue.current = null, await ie();
|
|
2157
2160
|
},
|
|
2158
|
-
[
|
|
2159
|
-
),
|
|
2161
|
+
[ie, L]
|
|
2162
|
+
), lt = A(
|
|
2160
2163
|
async (I) => {
|
|
2161
|
-
|
|
2164
|
+
L && console.log("[MessagingShell] Blocking participant:", I), j(null), J(!1), ue.current = null, await ie();
|
|
2162
2165
|
},
|
|
2163
|
-
[
|
|
2164
|
-
),
|
|
2165
|
-
return
|
|
2166
|
-
|
|
2166
|
+
[ie, L]
|
|
2167
|
+
), fe = !!W;
|
|
2168
|
+
return Q ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ce, {}) }) : Y ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(be, { message: Y, onBack: Z }) }) : !F || !N ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
2169
|
+
be,
|
|
2167
2170
|
{
|
|
2168
2171
|
message: "Not connected to messaging service",
|
|
2169
|
-
onBack:
|
|
2172
|
+
onBack: Z
|
|
2170
2173
|
}
|
|
2171
|
-
) }) :
|
|
2174
|
+
) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(be, { message: le }) }) : /* @__PURE__ */ i(
|
|
2172
2175
|
"div",
|
|
2173
2176
|
{
|
|
2174
|
-
className:
|
|
2177
|
+
className: D(
|
|
2175
2178
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2176
2179
|
s
|
|
2177
2180
|
),
|
|
@@ -2180,24 +2183,25 @@ const Qs = ({
|
|
|
2180
2183
|
/* @__PURE__ */ e(
|
|
2181
2184
|
"div",
|
|
2182
2185
|
{
|
|
2183
|
-
className:
|
|
2186
|
+
className: D(
|
|
2184
2187
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2185
2188
|
{
|
|
2186
|
-
"!hidden": h === !1 ||
|
|
2189
|
+
"!hidden": h === !1 || q,
|
|
2187
2190
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2188
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !
|
|
2191
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && fe,
|
|
2189
2192
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2190
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !
|
|
2193
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !fe
|
|
2191
2194
|
}
|
|
2192
2195
|
),
|
|
2193
2196
|
children: /* @__PURE__ */ e(
|
|
2194
|
-
|
|
2197
|
+
Ze,
|
|
2195
2198
|
{
|
|
2196
|
-
onChannelSelect:
|
|
2197
|
-
selectedChannel:
|
|
2198
|
-
filters:
|
|
2199
|
-
|
|
2200
|
-
|
|
2199
|
+
onChannelSelect: st,
|
|
2200
|
+
selectedChannel: W || void 0,
|
|
2201
|
+
filters: tt,
|
|
2202
|
+
channelRenderFilterFn: g,
|
|
2203
|
+
customEmptyStateIndicator: p,
|
|
2204
|
+
renderMessagePreview: R
|
|
2201
2205
|
}
|
|
2202
2206
|
)
|
|
2203
2207
|
}
|
|
@@ -2205,49 +2209,49 @@ const Qs = ({
|
|
|
2205
2209
|
/* @__PURE__ */ e(
|
|
2206
2210
|
"div",
|
|
2207
2211
|
{
|
|
2208
|
-
className:
|
|
2212
|
+
className: D(
|
|
2209
2213
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2210
2214
|
{
|
|
2211
2215
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2212
|
-
flex:
|
|
2216
|
+
flex: q || fe || r,
|
|
2213
2217
|
// Normal mode: hide on mobile when no channel selected
|
|
2214
|
-
"hidden lg:flex": !
|
|
2218
|
+
"hidden lg:flex": !q && !fe && !r
|
|
2215
2219
|
}
|
|
2216
2220
|
),
|
|
2217
|
-
children:
|
|
2218
|
-
|
|
2221
|
+
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2222
|
+
Ke,
|
|
2219
2223
|
{
|
|
2220
|
-
channel:
|
|
2221
|
-
onBack:
|
|
2222
|
-
showBackButton: !
|
|
2224
|
+
channel: W,
|
|
2225
|
+
onBack: nt,
|
|
2226
|
+
showBackButton: !q,
|
|
2223
2227
|
renderMessageInputActions: n,
|
|
2224
2228
|
renderConversationFooter: o,
|
|
2225
|
-
renderChannelBanner:
|
|
2226
|
-
onLeaveConversation:
|
|
2227
|
-
onBlockParticipant:
|
|
2228
|
-
CustomChannelEmptyState:
|
|
2229
|
-
showDeleteConversation:
|
|
2230
|
-
onDeleteConversationClick:
|
|
2231
|
-
onBlockParticipantClick:
|
|
2232
|
-
onReportParticipantClick:
|
|
2233
|
-
dmAgentEnabled:
|
|
2234
|
-
messageMetadata:
|
|
2235
|
-
onMessageSent:
|
|
2236
|
-
showStarButton:
|
|
2237
|
-
chatbotVotingEnabled:
|
|
2238
|
-
customProfileContent:
|
|
2239
|
-
customChannelActions:
|
|
2240
|
-
renderMessage:
|
|
2229
|
+
renderChannelBanner: m,
|
|
2230
|
+
onLeaveConversation: ot,
|
|
2231
|
+
onBlockParticipant: lt,
|
|
2232
|
+
CustomChannelEmptyState: f,
|
|
2233
|
+
showDeleteConversation: et,
|
|
2234
|
+
onDeleteConversationClick: a,
|
|
2235
|
+
onBlockParticipantClick: w,
|
|
2236
|
+
onReportParticipantClick: _,
|
|
2237
|
+
dmAgentEnabled: b,
|
|
2238
|
+
messageMetadata: M,
|
|
2239
|
+
onMessageSent: E,
|
|
2240
|
+
showStarButton: y,
|
|
2241
|
+
chatbotVotingEnabled: S,
|
|
2242
|
+
customProfileContent: u,
|
|
2243
|
+
customChannelActions: C,
|
|
2244
|
+
renderMessage: T
|
|
2241
2245
|
},
|
|
2242
|
-
|
|
2243
|
-
) }) :
|
|
2246
|
+
W.id
|
|
2247
|
+
) }) : r ? (
|
|
2244
2248
|
// Show loading while creating/loading direct conversation channel
|
|
2245
|
-
/* @__PURE__ */ e(
|
|
2249
|
+
/* @__PURE__ */ e(Ce, {})
|
|
2246
2250
|
) : /* @__PURE__ */ e(
|
|
2247
|
-
|
|
2251
|
+
Qe,
|
|
2248
2252
|
{
|
|
2249
|
-
hasChannels:
|
|
2250
|
-
channelsLoaded:
|
|
2253
|
+
hasChannels: re,
|
|
2254
|
+
channelsLoaded: te
|
|
2251
2255
|
}
|
|
2252
2256
|
)
|
|
2253
2257
|
}
|
|
@@ -2257,28 +2261,28 @@ const Qs = ({
|
|
|
2257
2261
|
/* @__PURE__ */ e(
|
|
2258
2262
|
"dialog",
|
|
2259
2263
|
{
|
|
2260
|
-
ref:
|
|
2264
|
+
ref: ne,
|
|
2261
2265
|
className: "mes-dialog",
|
|
2262
|
-
onClick:
|
|
2263
|
-
onClose:
|
|
2266
|
+
onClick: rt,
|
|
2267
|
+
onClose: he,
|
|
2264
2268
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2265
|
-
|
|
2269
|
+
zs,
|
|
2266
2270
|
{
|
|
2267
2271
|
participantSource: me,
|
|
2268
|
-
onSelectParticipant:
|
|
2269
|
-
onClose:
|
|
2270
|
-
existingParticipantIds:
|
|
2271
|
-
participantLabel:
|
|
2272
|
-
searchPlaceholder: `Search ${
|
|
2272
|
+
onSelectParticipant: at,
|
|
2273
|
+
onClose: he,
|
|
2274
|
+
existingParticipantIds: B,
|
|
2275
|
+
participantLabel: Le,
|
|
2276
|
+
searchPlaceholder: `Search ${Le}...`
|
|
2273
2277
|
},
|
|
2274
|
-
|
|
2278
|
+
oe
|
|
2275
2279
|
) })
|
|
2276
2280
|
}
|
|
2277
2281
|
)
|
|
2278
2282
|
]
|
|
2279
2283
|
}
|
|
2280
2284
|
);
|
|
2281
|
-
},
|
|
2285
|
+
}, Vs = ({
|
|
2282
2286
|
question: t,
|
|
2283
2287
|
onClick: s,
|
|
2284
2288
|
loading: n = !1,
|
|
@@ -2290,7 +2294,7 @@ const Qs = ({
|
|
|
2290
2294
|
onClick: s,
|
|
2291
2295
|
disabled: n,
|
|
2292
2296
|
style: { backgroundColor: "#E6E5E3" },
|
|
2293
|
-
className:
|
|
2297
|
+
className: D(
|
|
2294
2298
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2295
2299
|
{
|
|
2296
2300
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2300,22 +2304,22 @@ const Qs = ({
|
|
|
2300
2304
|
),
|
|
2301
2305
|
children: t
|
|
2302
2306
|
}
|
|
2303
|
-
),
|
|
2307
|
+
), tn = ({
|
|
2304
2308
|
faqs: t,
|
|
2305
2309
|
onFaqClick: s,
|
|
2306
2310
|
loadingFaqId: n,
|
|
2307
2311
|
headerText: o,
|
|
2308
2312
|
className: l,
|
|
2309
2313
|
avatarImage: d,
|
|
2310
|
-
avatarName:
|
|
2314
|
+
avatarName: r
|
|
2311
2315
|
}) => {
|
|
2312
|
-
const c = t.filter((
|
|
2316
|
+
const c = t.filter((f) => f.enabled).sort((f, h) => (f.order ?? 0) - (h.order ?? 0));
|
|
2313
2317
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2314
|
-
(d ||
|
|
2315
|
-
|
|
2318
|
+
(d || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2319
|
+
ae,
|
|
2316
2320
|
{
|
|
2317
|
-
id:
|
|
2318
|
-
name:
|
|
2321
|
+
id: r || "account",
|
|
2322
|
+
name: r || "Account",
|
|
2319
2323
|
image: d,
|
|
2320
2324
|
size: 24,
|
|
2321
2325
|
shape: "circle"
|
|
@@ -2328,23 +2332,23 @@ const Qs = ({
|
|
|
2328
2332
|
style: { backgroundColor: "#F1F0EE" },
|
|
2329
2333
|
children: [
|
|
2330
2334
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2331
|
-
c.map((
|
|
2332
|
-
|
|
2335
|
+
c.map((f) => /* @__PURE__ */ e(
|
|
2336
|
+
Vs,
|
|
2333
2337
|
{
|
|
2334
|
-
question:
|
|
2335
|
-
onClick: () => s(
|
|
2336
|
-
loading: n ===
|
|
2338
|
+
question: f.question,
|
|
2339
|
+
onClick: () => s(f.id),
|
|
2340
|
+
loading: n === f.id
|
|
2337
2341
|
},
|
|
2338
|
-
|
|
2342
|
+
f.id
|
|
2339
2343
|
))
|
|
2340
2344
|
]
|
|
2341
2345
|
}
|
|
2342
2346
|
)
|
|
2343
2347
|
] }) });
|
|
2344
|
-
},
|
|
2345
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] =
|
|
2346
|
-
if (
|
|
2347
|
-
const m =
|
|
2348
|
+
}, sn = (t, s = {}) => {
|
|
2349
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = k([]), [r, c] = k(!1), [f, h] = k(null), [x, g] = k(n), [p, a] = k(!0), [w, _] = k(), b = A(async (S = !1, R) => {
|
|
2350
|
+
if (r) return;
|
|
2351
|
+
const m = R !== void 0 ? R : x;
|
|
2348
2352
|
c(!0), h(null);
|
|
2349
2353
|
try {
|
|
2350
2354
|
const u = await t.loadParticipants({
|
|
@@ -2353,28 +2357,28 @@ const Qs = ({
|
|
|
2353
2357
|
cursor: S ? void 0 : w
|
|
2354
2358
|
});
|
|
2355
2359
|
d(
|
|
2356
|
-
(
|
|
2357
|
-
),
|
|
2360
|
+
(C) => S ? u.participants : [...C, ...u.participants]
|
|
2361
|
+
), a(u.hasMore), _(u.nextCursor);
|
|
2358
2362
|
} catch (u) {
|
|
2359
|
-
const
|
|
2360
|
-
h(
|
|
2363
|
+
const C = u instanceof Error ? u.message : "Failed to load participants";
|
|
2364
|
+
h(C), console.error("[useParticipants] Load error:", u);
|
|
2361
2365
|
} finally {
|
|
2362
2366
|
c(!1);
|
|
2363
2367
|
}
|
|
2364
|
-
}, [t,
|
|
2365
|
-
p && !
|
|
2366
|
-
}, [p,
|
|
2367
|
-
|
|
2368
|
-
}, [
|
|
2369
|
-
_(void 0),
|
|
2370
|
-
}, [
|
|
2368
|
+
}, [t, x, w, o, r]), M = A(() => {
|
|
2369
|
+
p && !r && b(!1);
|
|
2370
|
+
}, [p, r, b]), E = A((S) => {
|
|
2371
|
+
g(S), _(void 0), b(!0, S);
|
|
2372
|
+
}, [b]), y = A(() => {
|
|
2373
|
+
_(void 0), b(!0);
|
|
2374
|
+
}, [b]);
|
|
2371
2375
|
return K(() => {
|
|
2372
|
-
|
|
2376
|
+
b(!0);
|
|
2373
2377
|
}, [t.loadParticipants]), {
|
|
2374
2378
|
participants: l,
|
|
2375
|
-
loading:
|
|
2376
|
-
error:
|
|
2377
|
-
searchQuery:
|
|
2379
|
+
loading: r,
|
|
2380
|
+
error: f,
|
|
2381
|
+
searchQuery: x,
|
|
2378
2382
|
hasMore: p,
|
|
2379
2383
|
totalCount: t.totalCount,
|
|
2380
2384
|
loadMore: M,
|
|
@@ -2383,20 +2387,20 @@ const Qs = ({
|
|
|
2383
2387
|
};
|
|
2384
2388
|
};
|
|
2385
2389
|
export {
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2390
|
+
ge as ActionButton,
|
|
2391
|
+
ae as Avatar,
|
|
2392
|
+
Us as ChannelEmptyState,
|
|
2393
|
+
Ze as ChannelList,
|
|
2394
|
+
Ke as ChannelView,
|
|
2395
|
+
tn as FaqList,
|
|
2396
|
+
Vs as FaqListItem,
|
|
2397
|
+
vs as MessageVoteButtons,
|
|
2398
|
+
Qs as MessagingProvider,
|
|
2399
|
+
en as MessagingShell,
|
|
2400
|
+
zs as ParticipantPicker,
|
|
2401
|
+
os as formatRelativeTime,
|
|
2402
|
+
bs as useMessageVote,
|
|
2403
|
+
ss as useMessaging,
|
|
2404
|
+
sn as useParticipants
|
|
2401
2405
|
};
|
|
2402
2406
|
//# sourceMappingURL=index.js.map
|