@linktr.ee/messaging-react 1.15.2 โ 1.16.0-rc-1769569754
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 +14 -22
- package/dist/index.js +634 -613
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +42 -4
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/types.ts +68 -71
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 { GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import R from "classnames";
|
|
3
|
+
import L, { createContext as Ge, useContext as He, useCallback as D, useState as I, useRef as W, useEffect as q, useMemo as pe } from "react";
|
|
4
|
+
import { StreamChatService as Ve } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as We, ChannelList as qe, DateSeparator as Ze, areMessageUIPropsEqual as Ye, useChatContext as Je, useTranslationContext as Qe, useMessageReminder as Xe, useComponentContext as Ke, Attachment as es, Avatar as ss, EditMessageModal as ts, MessageBlocked as ns, MessageBouncePrompt as rs, MessageDeleted as as, MessageIsThreadReplyInChannelButtonIndicator as ls, MessageRepliesCountButton as os, MessageStatus as is, MessageTimestamp as Te, ReminderNotification as cs, StreamedMessageText as ds, messageHasAttachments as ms, messageHasReactions as us, isDateSeparatorMessage as hs, isMessageBlocked as fs, isMessageBounced as gs, isMessageEdited as xs, MessageBounceModal as Cs, Poll as bs, MessageText as Ns, MessageErrorIcon as vs, MessageEditedTimestamp as ws, useMessageContext as ps, useMessageComposer as ys, useStateStore as Es, MessageInput as Is, useMessageInputContext as Ss, useMessageComposerHasSendableData as _s, SimpleAttachmentSelector as Ms, QuotedMessagePreview as ks, AttachmentPreviewList as Rs, TextareaComposer as Ts, Channel as Ds, useChannelStateContext as De, WithComponents as Fs, Window as Ls, MessageList as Ps } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as Os, XIcon as ve, ArrowUpIcon as Us, ArrowLeftIcon as ye, StarIcon as Ee, DotsThreeIcon as Ie, SpinnerGapIcon as ue, SignOutIcon as Bs, ProhibitInsetIcon as Se, FlagIcon as As, MagnifyingGlassIcon as js, ChatCircleDotsIcon as _e } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as Me } from "stream-chat";
|
|
8
|
+
const Fe = Ge({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const De = ze({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), ge = () => He(Fe), pt = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -23,9 +23,9 @@ const De = ze({
|
|
|
23
23
|
capabilities: l = {},
|
|
24
24
|
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const a =
|
|
27
|
-
(d, ...
|
|
28
|
-
c && console.log(`๐ฅ [MessagingProvider] ${d}`, ...
|
|
26
|
+
const a = D(
|
|
27
|
+
(d, ...v) => {
|
|
28
|
+
c && console.log(`๐ฅ [MessagingProvider] ${d}`, ...v);
|
|
29
29
|
},
|
|
30
30
|
[c]
|
|
31
31
|
);
|
|
@@ -35,28 +35,28 @@ const De = ze({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [u, h] = I(null), [x,
|
|
38
|
+
const [u, h] = I(null), [x, p] = I(null), [f, o] = I(!1), [M, S] = I(!1), [g, m] = I(null), b = W(!1), N = W({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), y = W(0);
|
|
44
|
+
y.current++, a("๐ RENDER INFO", {
|
|
45
|
+
renderCount: y.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: N.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: N.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: N.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: N.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), N.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const d =
|
|
58
|
+
}, q(() => {
|
|
59
|
+
const d = y.current;
|
|
60
60
|
if (a("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: d,
|
|
62
62
|
apiKey: !!r,
|
|
@@ -64,8 +64,8 @@ const De = ze({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: N.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: N.current.apiKey === r
|
|
69
69
|
}
|
|
70
70
|
}), !r || !n) {
|
|
71
71
|
a("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
@@ -77,42 +77,42 @@ const De = ze({
|
|
|
77
77
|
a("๐ CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: d,
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: N.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const v = new Ve({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
85
|
debug: c
|
|
86
86
|
});
|
|
87
|
-
return h(
|
|
87
|
+
return h(v), a("โ
SERVICE SET", {
|
|
88
88
|
renderCount: d,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!v
|
|
90
90
|
}), () => {
|
|
91
91
|
a("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: d,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), v.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [r, n, c, a]);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
97
|
+
const _ = W(null);
|
|
98
|
+
q(() => {
|
|
99
|
+
var v, P;
|
|
100
100
|
if (a("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!u,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
104
|
+
isConnecting: b.current,
|
|
105
105
|
isConnected: f,
|
|
106
106
|
dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !u || !s) {
|
|
108
108
|
a("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (b.current) {
|
|
112
112
|
a("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((v = _.current) == null ? void 0 : v.serviceId) === u && ((P = _.current) == null ? void 0 : P.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,40 +120,40 @@ const De = ze({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
a("๐ STARTING USER CONNECTION", { userId: s.id }), b.current = !0, S(!0), m(null);
|
|
124
124
|
try {
|
|
125
125
|
a("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const j = await u.connectUser(s);
|
|
127
|
-
|
|
127
|
+
p(j), o(!0), _.current = { serviceId: u, userId: s.id }, a("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: j.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (j) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const z = j instanceof Error ? j.message : "Connection failed";
|
|
133
|
+
m(z), a("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: z
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
S(!1), b.current = !1, a("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: f
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [u, s, a, f]),
|
|
144
|
+
}, [u, s, a, f]), q(() => (a("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!u,
|
|
146
146
|
isConnected: f
|
|
147
147
|
}), () => {
|
|
148
148
|
u && f ? (a(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), _.current = null, u.disconnectUser().catch(console.error)) : a("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!u,
|
|
153
153
|
isConnected: f
|
|
154
154
|
});
|
|
155
155
|
}), [u, f, a]);
|
|
156
|
-
const
|
|
156
|
+
const E = D(async () => {
|
|
157
157
|
if (a("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!u,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,53 +161,53 @@ const De = ze({
|
|
|
161
161
|
a("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
a("๐ STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
a("๐ STARTING CONNECTION REFRESH", { userId: s.id }), S(!0);
|
|
165
165
|
try {
|
|
166
166
|
a("๐ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("๐ RECONNECTING FOR REFRESH");
|
|
167
167
|
const d = await u.connectUser(s);
|
|
168
|
-
|
|
168
|
+
p(d), o(!0), m(null), a("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (d) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const v = d instanceof Error ? d.message : "Refresh failed";
|
|
171
|
+
m(v), a("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: v
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
S(!1), a("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [u, s, a]),
|
|
178
|
+
}, [u, s, a]), C = L.useMemo(() => (a("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!u,
|
|
180
180
|
hasClient: !!x,
|
|
181
181
|
isConnected: f,
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
182
|
+
isLoading: M,
|
|
183
|
+
hasError: !!g,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: u,
|
|
187
187
|
client: x,
|
|
188
188
|
isConnected: f,
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
189
|
+
isLoading: M,
|
|
190
|
+
error: g,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: E,
|
|
193
193
|
debug: c
|
|
194
194
|
}), [
|
|
195
195
|
u,
|
|
196
196
|
x,
|
|
197
197
|
f,
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
M,
|
|
199
|
+
g,
|
|
200
200
|
l,
|
|
201
|
-
|
|
201
|
+
E,
|
|
202
202
|
c,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("๐ RENDER END", {
|
|
206
|
-
renderCount:
|
|
206
|
+
renderCount: y.current,
|
|
207
207
|
willRenderChat: !!(x && f),
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
208
|
+
contextValueReady: !!C
|
|
209
|
+
}), /* @__PURE__ */ e(Fe.Provider, { value: C, children: x && f ? /* @__PURE__ */ e(
|
|
210
|
+
We,
|
|
211
211
|
{
|
|
212
212
|
client: x,
|
|
213
213
|
customClasses: {
|
|
@@ -216,18 +216,18 @@ const De = ze({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, $s = () => ge(), zs = (t, s) => {
|
|
220
220
|
const n = new Date(
|
|
221
221
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
222
|
), l = new Date(
|
|
223
223
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
225
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
226
|
-
},
|
|
226
|
+
}, Gs = (t) => {
|
|
227
227
|
const s = /* @__PURE__ */ new Date();
|
|
228
228
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
230
|
-
const r =
|
|
230
|
+
const r = zs(t, s);
|
|
231
231
|
return r === 0 ? t.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit",
|
|
@@ -237,7 +237,7 @@ const De = ze({
|
|
|
237
237
|
day: "numeric",
|
|
238
238
|
year: "2-digit"
|
|
239
239
|
});
|
|
240
|
-
},
|
|
240
|
+
}, ke = [
|
|
241
241
|
"๐",
|
|
242
242
|
// Apple
|
|
243
243
|
"๐",
|
|
@@ -265,7 +265,7 @@ const De = ze({
|
|
|
265
265
|
"๐"
|
|
266
266
|
// Melon
|
|
267
267
|
];
|
|
268
|
-
function
|
|
268
|
+
function Hs(t) {
|
|
269
269
|
let s = 0;
|
|
270
270
|
for (let n = 0; n < t.length; n++) {
|
|
271
271
|
const r = t.charCodeAt(n);
|
|
@@ -273,25 +273,25 @@ function Gs(t) {
|
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
278
|
-
return
|
|
276
|
+
function Vs(t) {
|
|
277
|
+
const n = Hs(t) % ke.length;
|
|
278
|
+
return ke[n];
|
|
279
279
|
}
|
|
280
|
-
const
|
|
280
|
+
const ne = ({
|
|
281
281
|
id: t,
|
|
282
282
|
image: s,
|
|
283
283
|
size: n = 40,
|
|
284
284
|
className: r,
|
|
285
285
|
shape: l = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const c =
|
|
287
|
+
const c = Vs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = l === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
291
291
|
return /* @__PURE__ */ e(
|
|
292
292
|
"div",
|
|
293
293
|
{
|
|
294
|
-
className:
|
|
294
|
+
className: R("flex-shrink-0 overflow-hidden", r),
|
|
295
295
|
style: {
|
|
296
296
|
width: `${n}px`,
|
|
297
297
|
height: `${n}px`,
|
|
@@ -308,7 +308,7 @@ const te = ({
|
|
|
308
308
|
"div",
|
|
309
309
|
{
|
|
310
310
|
"aria-hidden": "true",
|
|
311
|
-
className:
|
|
311
|
+
className: R(
|
|
312
312
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
313
313
|
u
|
|
314
314
|
),
|
|
@@ -317,30 +317,30 @@ const te = ({
|
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, Ws = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
|
|
321
321
|
"path",
|
|
322
322
|
{
|
|
323
323
|
d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
|
|
324
324
|
fill: "currentColor"
|
|
325
325
|
}
|
|
326
|
-
) }),
|
|
326
|
+
) }), qs = (t) => {
|
|
327
327
|
var s;
|
|
328
328
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
329
329
|
}, Zs = (t) => {
|
|
330
330
|
var s;
|
|
331
331
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
332
|
-
},
|
|
332
|
+
}, Le = (t) => {
|
|
333
333
|
var s;
|
|
334
334
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
335
|
-
},
|
|
335
|
+
}, Pe = (t) => qs(t) || Zs(t), Ys = (t) => {
|
|
336
336
|
var s;
|
|
337
|
-
return
|
|
338
|
-
},
|
|
337
|
+
return Pe(t) && !((s = t.text) != null && s.trim());
|
|
338
|
+
}, Re = ({
|
|
339
339
|
message: t,
|
|
340
340
|
standalone: s = !1
|
|
341
341
|
}) => {
|
|
342
342
|
var l;
|
|
343
|
-
const n =
|
|
343
|
+
const n = Pe(t), r = Le(t);
|
|
344
344
|
if (!n && !r)
|
|
345
345
|
return null;
|
|
346
346
|
if (n) {
|
|
@@ -348,42 +348,42 @@ const te = ({
|
|
|
348
348
|
if (!c) return null;
|
|
349
349
|
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
|
|
350
350
|
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
351
|
-
/* @__PURE__ */ e(
|
|
351
|
+
/* @__PURE__ */ e(Os, { size: s ? 14 : 12 }),
|
|
352
352
|
/* @__PURE__ */ e("span", { children: u })
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
|
|
356
|
-
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(
|
|
356
|
+
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Ws, {}) }),
|
|
357
357
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
358
358
|
] });
|
|
359
|
-
},
|
|
359
|
+
}, Oe = L.memo(
|
|
360
360
|
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: l }) => {
|
|
361
|
-
var
|
|
361
|
+
var b, N, y, _, E, C;
|
|
362
362
|
const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
|
|
363
363
|
t && n(t);
|
|
364
|
-
}, h = Object.values(((
|
|
364
|
+
}, h = Object.values(((b = t == null ? void 0 : t.state) == null ? void 0 : b.members) || {}).find(
|
|
365
365
|
(d) => {
|
|
366
|
-
var
|
|
367
|
-
return ((
|
|
366
|
+
var v, P;
|
|
367
|
+
return ((v = d.user) == null ? void 0 : v.id) && d.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
|
|
368
368
|
}
|
|
369
|
-
), x = ((
|
|
370
|
-
var
|
|
369
|
+
), x = ((N = h == null ? void 0 : h.user) == null ? void 0 : N.name) || "Conversation", p = (y = h == null ? void 0 : h.user) == null ? void 0 : y.image, f = (E = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages) == null ? void 0 : E[t.state.messages.length - 1], M = (() => {
|
|
370
|
+
var v;
|
|
371
371
|
if (f != null && f.text) return f.text;
|
|
372
|
-
const d = (
|
|
372
|
+
const d = (v = f == null ? void 0 : f.attachments) == null ? void 0 : v[0];
|
|
373
373
|
return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "๐ท Sent an image" : d.type === "video" ? "๐ฅ Sent a video" : d.type === "audio" ? "๐ต Sent audio" : d.type === "file" ? "๐ Sent a file" : "๐ Sent an attachment" : "No messages yet";
|
|
374
|
-
})(),
|
|
374
|
+
})(), S = f != null && f.created_at ? Gs(new Date(f.created_at)) : "", g = f ? Le(f) : !1, m = l ?? 0;
|
|
375
375
|
return r && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
376
376
|
channelId: t == null ? void 0 : t.id,
|
|
377
377
|
isSelected: c,
|
|
378
378
|
participantName: x,
|
|
379
|
-
unreadCount:
|
|
380
|
-
hasTimestamp: !!
|
|
379
|
+
unreadCount: m,
|
|
380
|
+
hasTimestamp: !!S
|
|
381
381
|
}), /* @__PURE__ */ e(
|
|
382
382
|
"button",
|
|
383
383
|
{
|
|
384
384
|
type: "button",
|
|
385
385
|
onClick: a,
|
|
386
|
-
className:
|
|
386
|
+
className: R(
|
|
387
387
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
388
388
|
{
|
|
389
389
|
"bg-primary-alt/10 border-l-4 border-l-primary": c,
|
|
@@ -392,11 +392,11 @@ const te = ({
|
|
|
392
392
|
),
|
|
393
393
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
394
394
|
/* @__PURE__ */ e(
|
|
395
|
-
|
|
395
|
+
ne,
|
|
396
396
|
{
|
|
397
|
-
id: ((
|
|
397
|
+
id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
|
|
398
398
|
name: x,
|
|
399
|
-
image:
|
|
399
|
+
image: p,
|
|
400
400
|
size: 44,
|
|
401
401
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
402
402
|
}
|
|
@@ -406,21 +406,21 @@ const te = ({
|
|
|
406
406
|
/* @__PURE__ */ e(
|
|
407
407
|
"h3",
|
|
408
408
|
{
|
|
409
|
-
className:
|
|
409
|
+
className: R(
|
|
410
410
|
"text-sm font-medium truncate",
|
|
411
411
|
c ? "text-primary" : "text-charcoal"
|
|
412
412
|
),
|
|
413
413
|
children: x
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
|
-
|
|
416
|
+
S && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: S })
|
|
417
417
|
] }),
|
|
418
418
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
419
419
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: [
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
g && "โจ ",
|
|
421
|
+
M
|
|
422
422
|
] }),
|
|
423
|
-
|
|
423
|
+
m > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: m > 99 ? "99+" : m })
|
|
424
424
|
] })
|
|
425
425
|
] })
|
|
426
426
|
] })
|
|
@@ -428,8 +428,8 @@ const te = ({
|
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
430
|
);
|
|
431
|
-
|
|
432
|
-
const
|
|
431
|
+
Oe.displayName = "CustomChannelPreview";
|
|
432
|
+
const Ue = L.memo(
|
|
433
433
|
({
|
|
434
434
|
onChannelSelect: t,
|
|
435
435
|
selectedChannel: s,
|
|
@@ -437,16 +437,16 @@ const Oe = P.memo(
|
|
|
437
437
|
className: r,
|
|
438
438
|
customEmptyStateIndicator: l
|
|
439
439
|
}) => {
|
|
440
|
-
const c =
|
|
440
|
+
const c = L.useRef(0);
|
|
441
441
|
c.current++;
|
|
442
|
-
const { debug: a = !1 } =
|
|
442
|
+
const { debug: a = !1 } = ge();
|
|
443
443
|
a && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
444
444
|
renderCount: c.current,
|
|
445
445
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
446
446
|
filters: n
|
|
447
447
|
});
|
|
448
|
-
const u =
|
|
449
|
-
|
|
448
|
+
const u = L.useMemo(() => (x) => /* @__PURE__ */ e(
|
|
449
|
+
Oe,
|
|
450
450
|
{
|
|
451
451
|
...x,
|
|
452
452
|
selectedChannel: s,
|
|
@@ -457,12 +457,12 @@ const Oe = P.memo(
|
|
|
457
457
|
return /* @__PURE__ */ e(
|
|
458
458
|
"div",
|
|
459
459
|
{
|
|
460
|
-
className:
|
|
460
|
+
className: R(
|
|
461
461
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
462
462
|
r
|
|
463
463
|
),
|
|
464
464
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
465
|
-
|
|
465
|
+
qe,
|
|
466
466
|
{
|
|
467
467
|
filters: n,
|
|
468
468
|
sort: { last_message_at: -1 },
|
|
@@ -476,8 +476,8 @@ const Oe = P.memo(
|
|
|
476
476
|
);
|
|
477
477
|
}
|
|
478
478
|
);
|
|
479
|
-
|
|
480
|
-
const
|
|
479
|
+
Ue.displayName = "ChannelList";
|
|
480
|
+
const me = ({
|
|
481
481
|
variant: t = "default",
|
|
482
482
|
className: s,
|
|
483
483
|
children: n,
|
|
@@ -486,7 +486,7 @@ const ce = ({
|
|
|
486
486
|
"button",
|
|
487
487
|
{
|
|
488
488
|
type: "button",
|
|
489
|
-
className:
|
|
489
|
+
className: R(
|
|
490
490
|
"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",
|
|
491
491
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
492
492
|
s
|
|
@@ -495,12 +495,12 @@ const ce = ({
|
|
|
495
495
|
children: n
|
|
496
496
|
}
|
|
497
497
|
);
|
|
498
|
-
function
|
|
498
|
+
function Be({ label: t, className: s, children: n, ...r }) {
|
|
499
499
|
return /* @__PURE__ */ i(
|
|
500
500
|
"button",
|
|
501
501
|
{
|
|
502
502
|
type: "button",
|
|
503
|
-
className:
|
|
503
|
+
className: R(
|
|
504
504
|
"rounded-full p-2 transition-colors focus-ring",
|
|
505
505
|
{
|
|
506
506
|
"cursor-not-allowed opacity-50": r.disabled,
|
|
@@ -516,11 +516,11 @@ function Ue({ label: t, className: s, children: n, ...r }) {
|
|
|
516
516
|
}
|
|
517
517
|
);
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return /* @__PURE__ */ e(
|
|
519
|
+
function Ae({ onClick: t }) {
|
|
520
|
+
return /* @__PURE__ */ e(Be, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ve, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
521
521
|
}
|
|
522
|
-
const
|
|
523
|
-
var
|
|
522
|
+
const Js = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Qs = (t) => {
|
|
523
|
+
var de, J;
|
|
524
524
|
const {
|
|
525
525
|
additionalMessageInputProps: s,
|
|
526
526
|
editing: n,
|
|
@@ -531,160 +531,160 @@ const Ys = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Js = (t)
|
|
|
531
531
|
handleOpenThread: u,
|
|
532
532
|
handleRetry: h,
|
|
533
533
|
highlighted: x,
|
|
534
|
-
isMessageAIGenerated:
|
|
534
|
+
isMessageAIGenerated: p,
|
|
535
535
|
isMyMessage: f,
|
|
536
536
|
message: o,
|
|
537
|
-
onUserClick:
|
|
538
|
-
onUserHover:
|
|
539
|
-
renderText:
|
|
540
|
-
threadList:
|
|
541
|
-
} = t, { client:
|
|
542
|
-
Attachment:
|
|
543
|
-
Avatar:
|
|
544
|
-
EditMessageModal: j =
|
|
545
|
-
MessageBlocked:
|
|
546
|
-
MessageBouncePrompt:
|
|
547
|
-
MessageDeleted:
|
|
548
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
549
|
-
MessageRepliesCountButton:
|
|
550
|
-
MessageStatus:
|
|
551
|
-
MessageTimestamp:
|
|
552
|
-
ReminderNotification:
|
|
553
|
-
StreamedMessageText:
|
|
554
|
-
PinIndicator:
|
|
555
|
-
} =
|
|
556
|
-
() =>
|
|
557
|
-
[
|
|
558
|
-
),
|
|
537
|
+
onUserClick: M,
|
|
538
|
+
onUserHover: S,
|
|
539
|
+
renderText: g,
|
|
540
|
+
threadList: m
|
|
541
|
+
} = t, { client: b } = Je("CustomMessage"), { t: N } = Qe("CustomMessage"), [y, _] = I(!1), [E, C] = I(!1), d = Xe(o.id), {
|
|
542
|
+
Attachment: v = es,
|
|
543
|
+
Avatar: P = ss,
|
|
544
|
+
EditMessageModal: j = ts,
|
|
545
|
+
MessageBlocked: z = ns,
|
|
546
|
+
MessageBouncePrompt: re = rs,
|
|
547
|
+
MessageDeleted: Q = as,
|
|
548
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = ls,
|
|
549
|
+
MessageRepliesCountButton: K = os,
|
|
550
|
+
MessageStatus: ee = is,
|
|
551
|
+
MessageTimestamp: ae = Te,
|
|
552
|
+
ReminderNotification: O = cs,
|
|
553
|
+
StreamedMessageText: G = ds,
|
|
554
|
+
PinIndicator: Z
|
|
555
|
+
} = Ke("CustomMessage"), k = ms(o), T = us(o), U = pe(
|
|
556
|
+
() => p == null ? void 0 : p(o),
|
|
557
|
+
[p, o]
|
|
558
|
+
), B = pe(
|
|
559
559
|
() => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
|
|
560
560
|
[o]
|
|
561
561
|
);
|
|
562
|
-
if (
|
|
562
|
+
if (hs(o))
|
|
563
563
|
return null;
|
|
564
564
|
if (o.deleted_at || o.type === "deleted")
|
|
565
|
-
return /* @__PURE__ */ e(
|
|
566
|
-
if (
|
|
567
|
-
return /* @__PURE__ */ e(
|
|
568
|
-
const se = !c || r,
|
|
569
|
-
let
|
|
570
|
-
|
|
571
|
-
const
|
|
565
|
+
return /* @__PURE__ */ e(Q, { message: o });
|
|
566
|
+
if (fs(o))
|
|
567
|
+
return /* @__PURE__ */ e(z, {});
|
|
568
|
+
const se = !c || r, oe = !m && !!o.reply_count, Y = !m && o.show_in_channel && o.parent_id, H = o.status === "failed" && ((de = o.error) == null ? void 0 : de.status) !== 403, ie = gs(o), le = xs(o) && !U;
|
|
569
|
+
let V;
|
|
570
|
+
H ? V = () => h(o) : ie ? V = () => _(!0) : le && (V = () => C((w) => !w));
|
|
571
|
+
const te = R(
|
|
572
572
|
"str-chat__message str-chat__message-simple",
|
|
573
573
|
`str-chat__message--${o.type}`,
|
|
574
574
|
`str-chat__message--${o.status}`,
|
|
575
575
|
f() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
576
576
|
o.text ? "str-chat__message--has-text" : "has-no-text",
|
|
577
577
|
{
|
|
578
|
-
"str-chat__message--has-attachment":
|
|
578
|
+
"str-chat__message--has-attachment": k,
|
|
579
579
|
"str-chat__message--highlighted": x,
|
|
580
580
|
"str-chat__message--pinned pinned-message": o.pinned,
|
|
581
|
-
"str-chat__message--with-reactions":
|
|
582
|
-
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((
|
|
583
|
-
"str-chat__message-with-thread-link":
|
|
581
|
+
"str-chat__message--with-reactions": T,
|
|
582
|
+
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((J = o == null ? void 0 : o.error) == null ? void 0 : J.status) !== 403,
|
|
583
|
+
"str-chat__message-with-thread-link": oe || Y,
|
|
584
584
|
"str-chat__virtual-message__wrapper--end": r,
|
|
585
585
|
"str-chat__virtual-message__wrapper--first": l,
|
|
586
586
|
"str-chat__virtual-message__wrapper--group": c
|
|
587
587
|
}
|
|
588
|
-
),
|
|
589
|
-
return /* @__PURE__ */ i(
|
|
588
|
+
), ce = o.poll_id && b.polls.fromState(o.poll_id), xe = Ys(o);
|
|
589
|
+
return /* @__PURE__ */ i(Ne, { children: [
|
|
590
590
|
n && /* @__PURE__ */ e(
|
|
591
591
|
j,
|
|
592
592
|
{
|
|
593
593
|
additionalMessageInputProps: s
|
|
594
594
|
}
|
|
595
595
|
),
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
y && /* @__PURE__ */ e(
|
|
597
|
+
Cs,
|
|
598
598
|
{
|
|
599
|
-
MessageBouncePrompt:
|
|
600
|
-
onClose: () =>
|
|
601
|
-
open:
|
|
599
|
+
MessageBouncePrompt: re,
|
|
600
|
+
onClose: () => _(!1),
|
|
601
|
+
open: y
|
|
602
602
|
}
|
|
603
603
|
),
|
|
604
|
-
/* @__PURE__ */ i("div", { className:
|
|
605
|
-
|
|
606
|
-
!!d && /* @__PURE__ */ e(
|
|
604
|
+
/* @__PURE__ */ i("div", { className: te, children: [
|
|
605
|
+
Z && /* @__PURE__ */ e(Z, {}),
|
|
606
|
+
!!d && /* @__PURE__ */ e(O, { reminder: d }),
|
|
607
607
|
o.user && /* @__PURE__ */ e(
|
|
608
|
-
|
|
608
|
+
P,
|
|
609
609
|
{
|
|
610
610
|
image: o.user.image,
|
|
611
611
|
name: o.user.name || o.user.id,
|
|
612
|
-
onClick:
|
|
613
|
-
onMouseOver:
|
|
612
|
+
onClick: M,
|
|
613
|
+
onMouseOver: S,
|
|
614
614
|
user: o.user
|
|
615
615
|
}
|
|
616
616
|
),
|
|
617
617
|
/* @__PURE__ */ e(
|
|
618
618
|
"div",
|
|
619
619
|
{
|
|
620
|
-
className:
|
|
621
|
-
"str-chat__simple-message--error-failed":
|
|
620
|
+
className: R("str-chat__message-inner", {
|
|
621
|
+
"str-chat__simple-message--error-failed": H || ie
|
|
622
622
|
}),
|
|
623
623
|
"data-testid": "message-inner",
|
|
624
|
-
onClick:
|
|
625
|
-
onKeyDown:
|
|
626
|
-
role:
|
|
627
|
-
tabIndex:
|
|
624
|
+
onClick: V,
|
|
625
|
+
onKeyDown: V,
|
|
626
|
+
role: V ? "button" : void 0,
|
|
627
|
+
tabIndex: V ? 0 : void 0,
|
|
628
628
|
style: {
|
|
629
629
|
// Force margins to 0 to prevent hover layout shift
|
|
630
630
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
631
631
|
marginInlineEnd: 0,
|
|
632
632
|
marginInlineStart: 0
|
|
633
633
|
},
|
|
634
|
-
children:
|
|
634
|
+
children: xe ? (
|
|
635
635
|
/* Tip-only messages render as a standalone bubble */
|
|
636
|
-
/* @__PURE__ */ e(
|
|
636
|
+
/* @__PURE__ */ e(Re, { message: o, standalone: !0 })
|
|
637
637
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
638
638
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
639
|
+
ce && /* @__PURE__ */ e(bs, { poll: ce }),
|
|
640
|
+
B != null && B.length && !o.quoted_message ? /* @__PURE__ */ e(
|
|
641
|
+
v,
|
|
642
642
|
{
|
|
643
643
|
actionHandler: a,
|
|
644
|
-
attachments:
|
|
644
|
+
attachments: B
|
|
645
645
|
}
|
|
646
646
|
) : null,
|
|
647
|
-
|
|
648
|
-
|
|
647
|
+
U ? /* @__PURE__ */ e(
|
|
648
|
+
G,
|
|
649
649
|
{
|
|
650
650
|
message: o,
|
|
651
|
-
renderText:
|
|
651
|
+
renderText: g
|
|
652
652
|
}
|
|
653
|
-
) : /* @__PURE__ */ e(
|
|
654
|
-
/* @__PURE__ */ e(
|
|
653
|
+
) : /* @__PURE__ */ e(Ns, { message: o, renderText: g }),
|
|
654
|
+
/* @__PURE__ */ e(vs, {})
|
|
655
655
|
] }),
|
|
656
|
-
/* @__PURE__ */ e(
|
|
656
|
+
/* @__PURE__ */ e(Re, { message: o })
|
|
657
657
|
] })
|
|
658
658
|
}
|
|
659
659
|
),
|
|
660
|
-
|
|
661
|
-
|
|
660
|
+
oe && /* @__PURE__ */ e(
|
|
661
|
+
K,
|
|
662
662
|
{
|
|
663
663
|
onClick: u,
|
|
664
664
|
reply_count: o.reply_count
|
|
665
665
|
}
|
|
666
666
|
),
|
|
667
|
-
|
|
667
|
+
Y && /* @__PURE__ */ e(X, {}),
|
|
668
668
|
se && /* @__PURE__ */ i("div", { className: "str-chat__message-metadata", children: [
|
|
669
|
-
/* @__PURE__ */ e(
|
|
669
|
+
/* @__PURE__ */ e(ee, {}),
|
|
670
670
|
!f() && !!o.user && /* @__PURE__ */ e("span", { className: "str-chat__message-simple-name", children: o.user.name || o.user.id }),
|
|
671
|
-
/* @__PURE__ */ e(
|
|
672
|
-
|
|
673
|
-
|
|
671
|
+
/* @__PURE__ */ e(ae, { customClass: "str-chat__message-simple-timestamp" }),
|
|
672
|
+
le && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: N("Edited") }),
|
|
673
|
+
le && /* @__PURE__ */ e(ws, { calendar: !0, open: E })
|
|
674
674
|
] })
|
|
675
675
|
] }, o.id)
|
|
676
676
|
] });
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
),
|
|
681
|
-
const s =
|
|
682
|
-
return /* @__PURE__ */ e(
|
|
683
|
-
},
|
|
677
|
+
}, Xs = L.memo(
|
|
678
|
+
Qs,
|
|
679
|
+
Ye
|
|
680
|
+
), Ks = (t) => {
|
|
681
|
+
const s = ps("CustomMessage");
|
|
682
|
+
return /* @__PURE__ */ e(Xs, { ...s, ...t });
|
|
683
|
+
}, et = (t) => ({
|
|
684
684
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
685
|
-
(s) =>
|
|
685
|
+
(s) => Me.previewIsLoaded(s) || Me.previewIsLoading(s)
|
|
686
686
|
)
|
|
687
|
-
}),
|
|
687
|
+
}), st = ({
|
|
688
688
|
link: t,
|
|
689
689
|
onDismiss: s
|
|
690
690
|
}) => {
|
|
@@ -714,7 +714,7 @@ const Ys = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Js = (t)
|
|
|
714
714
|
},
|
|
715
715
|
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",
|
|
716
716
|
"aria-label": "Close link preview",
|
|
717
|
-
children: /* @__PURE__ */ e(
|
|
717
|
+
children: /* @__PURE__ */ e(ve, { className: "size-4 text-black/90" })
|
|
718
718
|
}
|
|
719
719
|
),
|
|
720
720
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -724,32 +724,32 @@ const Ys = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Js = (t)
|
|
|
724
724
|
]
|
|
725
725
|
}
|
|
726
726
|
);
|
|
727
|
-
},
|
|
728
|
-
const { linkPreviewsManager: t } =
|
|
727
|
+
}, tt = () => {
|
|
728
|
+
const { linkPreviewsManager: t } = ys(), { linkPreviews: s } = Es(
|
|
729
729
|
t.state,
|
|
730
|
-
|
|
730
|
+
et
|
|
731
731
|
), n = (l) => {
|
|
732
732
|
t.dismissPreview(l);
|
|
733
733
|
};
|
|
734
734
|
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(
|
|
735
|
-
|
|
735
|
+
st,
|
|
736
736
|
{
|
|
737
737
|
link: l,
|
|
738
738
|
onDismiss: n
|
|
739
739
|
},
|
|
740
740
|
l.og_scrape_url
|
|
741
741
|
)) }) : null;
|
|
742
|
-
},
|
|
743
|
-
const { handleSubmit: t } =
|
|
744
|
-
return /* @__PURE__ */ i(
|
|
745
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
742
|
+
}, nt = () => {
|
|
743
|
+
const { handleSubmit: t } = Ss(), s = _s();
|
|
744
|
+
return /* @__PURE__ */ i(Ne, { children: [
|
|
745
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ms, {}) }),
|
|
746
746
|
/* @__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: [
|
|
747
|
-
/* @__PURE__ */ e(Ms, {}),
|
|
748
|
-
/* @__PURE__ */ e(st, {}),
|
|
749
747
|
/* @__PURE__ */ e(ks, {}),
|
|
748
|
+
/* @__PURE__ */ e(tt, {}),
|
|
749
|
+
/* @__PURE__ */ e(Rs, {}),
|
|
750
750
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
751
751
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
752
|
-
|
|
752
|
+
Ts,
|
|
753
753
|
{
|
|
754
754
|
className: "w-full resize-none outline-none leading-6",
|
|
755
755
|
autoFocus: !0,
|
|
@@ -765,18 +765,18 @@ const Ys = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Js = (t)
|
|
|
765
765
|
disabled: !s,
|
|
766
766
|
onClick: t,
|
|
767
767
|
type: "button",
|
|
768
|
-
children: /* @__PURE__ */ e(
|
|
768
|
+
children: /* @__PURE__ */ e(Us, { className: "size-4" })
|
|
769
769
|
}
|
|
770
770
|
)
|
|
771
771
|
] })
|
|
772
772
|
] })
|
|
773
773
|
] });
|
|
774
|
-
},
|
|
774
|
+
}, rt = ({
|
|
775
775
|
renderActions: t
|
|
776
776
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
777
777
|
t && (t == null ? void 0 : t()),
|
|
778
|
-
/* @__PURE__ */ e(
|
|
779
|
-
] }),
|
|
778
|
+
/* @__PURE__ */ e(Is, { Input: nt })
|
|
779
|
+
] }), at = (t) => {
|
|
780
780
|
const s = t.message.hide_date === !0;
|
|
781
781
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
782
782
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
@@ -784,12 +784,12 @@ const Ys = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Js = (t)
|
|
|
784
784
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
785
785
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
786
786
|
] }),
|
|
787
|
-
!s && /* @__PURE__ */ e(
|
|
787
|
+
!s && /* @__PURE__ */ e(Te, { message: t.message })
|
|
788
788
|
] });
|
|
789
|
-
},
|
|
789
|
+
}, lt = () => null, ot = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
790
790
|
"div",
|
|
791
791
|
{
|
|
792
|
-
className:
|
|
792
|
+
className: R("flex items-center justify-center h-full", t),
|
|
793
793
|
children: [
|
|
794
794
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
795
795
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -829,33 +829,40 @@ const Ys = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Js = (t)
|
|
|
829
829
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
830
830
|
]
|
|
831
831
|
}
|
|
832
|
-
),
|
|
833
|
-
/* @__PURE__ */ e(
|
|
832
|
+
), fe = L.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
833
|
+
/* @__PURE__ */ e(ot, { className: "w-6 h-6" }),
|
|
834
834
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
835
835
|
] }) }));
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
var f, o,
|
|
839
|
-
const { channel: l } =
|
|
840
|
-
(
|
|
841
|
-
var
|
|
842
|
-
return ((
|
|
836
|
+
fe.displayName = "LoadingState";
|
|
837
|
+
const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
|
|
838
|
+
var f, o, M, S, g, m;
|
|
839
|
+
const { channel: l } = De(), c = L.useMemo(() => Object.values(l.state.members || {}).find(
|
|
840
|
+
(N) => {
|
|
841
|
+
var y;
|
|
842
|
+
return ((y = N.user) == null ? void 0 : y.id) && N.user.id !== l._client.userID;
|
|
843
843
|
}
|
|
844
|
-
), [l._client.userID, l.state.members]), a = ((f = c == null ? void 0 : c.user) == null ? void 0 : f.name) || ((o = c == null ? void 0 : c.user) == null ? void 0 : o.id) || "Unknown member", u = (
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
844
|
+
), [l._client.userID, l.state.members]), a = ((f = c == null ? void 0 : c.user) == null ? void 0 : f.name) || ((o = c == null ? void 0 : c.user) == null ? void 0 : o.id) || "Unknown member", u = (M = c == null ? void 0 : c.user) == null ? void 0 : M.image, [h, x] = I(
|
|
845
|
+
!!((S = l.state.membership) != null && S.pinned_at)
|
|
846
|
+
);
|
|
847
|
+
q(() => {
|
|
848
|
+
const b = (N) => {
|
|
849
|
+
var y;
|
|
850
|
+
x(
|
|
851
|
+
N != null && N.member ? !!N.member.pinned_at : !!((y = l.state.membership) != null && y.pinned_at)
|
|
852
|
+
);
|
|
849
853
|
};
|
|
850
|
-
return l.on("member.updated",
|
|
851
|
-
l.off("member.updated",
|
|
854
|
+
return l.on("member.updated", b), () => {
|
|
855
|
+
l.off("member.updated", b);
|
|
852
856
|
};
|
|
853
857
|
}, [l]);
|
|
854
|
-
const
|
|
858
|
+
const p = async () => {
|
|
855
859
|
try {
|
|
856
860
|
h ? await l.unpin() : await l.pin();
|
|
857
|
-
} catch (
|
|
858
|
-
console.error(
|
|
861
|
+
} catch (b) {
|
|
862
|
+
console.error(
|
|
863
|
+
"[CustomChannelHeader] Failed to update pinned status:",
|
|
864
|
+
b
|
|
865
|
+
);
|
|
859
866
|
}
|
|
860
867
|
};
|
|
861
868
|
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
@@ -864,7 +871,7 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
864
871
|
/* @__PURE__ */ e(
|
|
865
872
|
"button",
|
|
866
873
|
{
|
|
867
|
-
className:
|
|
874
|
+
className: R(
|
|
868
875
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
869
876
|
!s && "invisible"
|
|
870
877
|
),
|
|
@@ -872,16 +879,16 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
872
879
|
}),
|
|
873
880
|
type: "button",
|
|
874
881
|
"aria-label": "Back to conversations",
|
|
875
|
-
children: /* @__PURE__ */ e(
|
|
882
|
+
children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
|
|
876
883
|
}
|
|
877
884
|
),
|
|
878
885
|
/* @__PURE__ */ e("div", { className: "size-10" })
|
|
879
886
|
] }),
|
|
880
887
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
881
888
|
/* @__PURE__ */ e(
|
|
882
|
-
|
|
889
|
+
ne,
|
|
883
890
|
{
|
|
884
|
-
id: ((
|
|
891
|
+
id: ((g = c == null ? void 0 : c.user) == null ? void 0 : g.id) || l.id || "unknown",
|
|
885
892
|
name: a,
|
|
886
893
|
image: u,
|
|
887
894
|
size: 40
|
|
@@ -894,11 +901,11 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
894
901
|
"button",
|
|
895
902
|
{
|
|
896
903
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
897
|
-
onClick:
|
|
904
|
+
onClick: p,
|
|
898
905
|
type: "button",
|
|
899
906
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
900
907
|
children: /* @__PURE__ */ e(
|
|
901
|
-
|
|
908
|
+
Ee,
|
|
902
909
|
{
|
|
903
910
|
className: "size-5 text-black/90",
|
|
904
911
|
weight: h ? "fill" : "regular"
|
|
@@ -913,7 +920,7 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
913
920
|
onClick: n,
|
|
914
921
|
type: "button",
|
|
915
922
|
"aria-label": "Show info",
|
|
916
|
-
children: /* @__PURE__ */ e(
|
|
923
|
+
children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
|
|
917
924
|
}
|
|
918
925
|
)
|
|
919
926
|
] })
|
|
@@ -927,13 +934,13 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
927
934
|
onClick: t,
|
|
928
935
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
929
936
|
"aria-label": "Back to conversations",
|
|
930
|
-
children: /* @__PURE__ */ e(
|
|
937
|
+
children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
|
|
931
938
|
}
|
|
932
939
|
),
|
|
933
940
|
/* @__PURE__ */ e(
|
|
934
|
-
|
|
941
|
+
ne,
|
|
935
942
|
{
|
|
936
|
-
id: ((
|
|
943
|
+
id: ((m = c == null ? void 0 : c.user) == null ? void 0 : m.id) || l.id || "unknown",
|
|
937
944
|
name: a,
|
|
938
945
|
image: u,
|
|
939
946
|
size: 40
|
|
@@ -946,11 +953,11 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
946
953
|
"button",
|
|
947
954
|
{
|
|
948
955
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
949
|
-
onClick:
|
|
956
|
+
onClick: p,
|
|
950
957
|
type: "button",
|
|
951
958
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
952
959
|
children: /* @__PURE__ */ e(
|
|
953
|
-
|
|
960
|
+
Ee,
|
|
954
961
|
{
|
|
955
962
|
className: "size-5 text-black/90",
|
|
956
963
|
weight: h ? "fill" : "regular"
|
|
@@ -965,13 +972,13 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
965
972
|
onClick: n,
|
|
966
973
|
type: "button",
|
|
967
974
|
"aria-label": "Show info",
|
|
968
|
-
children: /* @__PURE__ */ e(
|
|
975
|
+
children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
|
|
969
976
|
}
|
|
970
977
|
)
|
|
971
978
|
] })
|
|
972
979
|
] })
|
|
973
980
|
] });
|
|
974
|
-
},
|
|
981
|
+
}, ct = ({
|
|
975
982
|
dialogRef: t,
|
|
976
983
|
onClose: s,
|
|
977
984
|
participant: n,
|
|
@@ -982,76 +989,76 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
982
989
|
showDeleteConversation: u = !0,
|
|
983
990
|
onDeleteConversationClick: h,
|
|
984
991
|
onBlockParticipantClick: x,
|
|
985
|
-
onReportParticipantClick:
|
|
992
|
+
onReportParticipantClick: p
|
|
986
993
|
}) => {
|
|
987
|
-
var K, ee,
|
|
988
|
-
const { service: f, debug: o } =
|
|
989
|
-
var
|
|
990
|
-
if (!(!f || !((
|
|
994
|
+
var X, K, ee, ae, O, G, Z;
|
|
995
|
+
const { service: f, debug: o } = ge(), [M, S] = I(!1), [g, m] = I(!1), [b, N] = I(!1), y = D(async () => {
|
|
996
|
+
var k;
|
|
997
|
+
if (!(!f || !((k = n == null ? void 0 : n.user) != null && k.id)))
|
|
991
998
|
try {
|
|
992
|
-
const
|
|
993
|
-
(
|
|
999
|
+
const U = (await f.getBlockedUsers()).some(
|
|
1000
|
+
(B) => {
|
|
994
1001
|
var se;
|
|
995
|
-
return
|
|
1002
|
+
return B.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
|
|
996
1003
|
}
|
|
997
1004
|
);
|
|
998
|
-
|
|
999
|
-
} catch (
|
|
1005
|
+
S(U);
|
|
1006
|
+
} catch (T) {
|
|
1000
1007
|
console.error(
|
|
1001
1008
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1002
|
-
|
|
1009
|
+
T
|
|
1003
1010
|
);
|
|
1004
1011
|
}
|
|
1005
|
-
}, [f, (
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
}, [
|
|
1009
|
-
const
|
|
1010
|
-
var
|
|
1011
|
-
if (!
|
|
1012
|
-
h == null || h(), o && console.log("[ChannelInfoDialog] Leave conversation", r.cid),
|
|
1012
|
+
}, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
|
|
1013
|
+
q(() => {
|
|
1014
|
+
y();
|
|
1015
|
+
}, [y]);
|
|
1016
|
+
const _ = async () => {
|
|
1017
|
+
var k;
|
|
1018
|
+
if (!g) {
|
|
1019
|
+
h == null || h(), o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), m(!0);
|
|
1013
1020
|
try {
|
|
1014
|
-
const
|
|
1015
|
-
await r.hide(
|
|
1016
|
-
} catch (
|
|
1017
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
1021
|
+
const T = ((k = r._client) == null ? void 0 : k.userID) ?? null;
|
|
1022
|
+
await r.hide(T, !1), c && await c(r), s();
|
|
1023
|
+
} catch (T) {
|
|
1024
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", T);
|
|
1018
1025
|
} finally {
|
|
1019
|
-
|
|
1026
|
+
m(!1);
|
|
1020
1027
|
}
|
|
1021
1028
|
}
|
|
1022
|
-
},
|
|
1023
|
-
var
|
|
1024
|
-
if (!(
|
|
1025
|
-
x == null || x(), o && console.log("[ChannelInfoDialog] Block member", (
|
|
1029
|
+
}, E = async () => {
|
|
1030
|
+
var k, T, U;
|
|
1031
|
+
if (!(b || !f)) {
|
|
1032
|
+
x == null || x(), o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), N(!0);
|
|
1026
1033
|
try {
|
|
1027
|
-
await f.blockUser((
|
|
1028
|
-
} catch (
|
|
1029
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
1034
|
+
await f.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
|
|
1035
|
+
} catch (B) {
|
|
1036
|
+
console.error("[ChannelInfoDialog] Failed to block member", B);
|
|
1030
1037
|
} finally {
|
|
1031
|
-
|
|
1038
|
+
N(!1);
|
|
1032
1039
|
}
|
|
1033
1040
|
}
|
|
1034
|
-
},
|
|
1035
|
-
var
|
|
1036
|
-
if (!(
|
|
1037
|
-
x == null || x(), o && console.log("[ChannelInfoDialog] Unblock member", (
|
|
1041
|
+
}, C = async () => {
|
|
1042
|
+
var k, T, U;
|
|
1043
|
+
if (!(b || !f)) {
|
|
1044
|
+
x == null || x(), o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), N(!0);
|
|
1038
1045
|
try {
|
|
1039
|
-
await f.unBlockUser((
|
|
1040
|
-
} catch (
|
|
1041
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
1046
|
+
await f.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
|
|
1047
|
+
} catch (B) {
|
|
1048
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", B);
|
|
1042
1049
|
} finally {
|
|
1043
|
-
|
|
1050
|
+
N(!1);
|
|
1044
1051
|
}
|
|
1045
1052
|
}
|
|
1046
1053
|
}, d = () => {
|
|
1047
|
-
|
|
1054
|
+
p == null || p(), s(), window.open(
|
|
1048
1055
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1049
1056
|
"_blank",
|
|
1050
1057
|
"noopener,noreferrer"
|
|
1051
1058
|
);
|
|
1052
1059
|
};
|
|
1053
1060
|
if (!n) return null;
|
|
1054
|
-
const
|
|
1061
|
+
const v = ((K = n.user) == null ? void 0 : K.name) || ((ee = n.user) == null ? void 0 : ee.id) || "Unknown member", P = (ae = n.user) == null ? void 0 : ae.image, j = (O = n.user) == null ? void 0 : O.email, z = (G = n.user) == null ? void 0 : G.username, re = j || (z ? `linktr.ee/${z}` : void 0), Q = ((Z = n.user) == null ? void 0 : Z.id) || "unknown";
|
|
1055
1062
|
return (
|
|
1056
1063
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1057
1064
|
/* @__PURE__ */ e(
|
|
@@ -1060,13 +1067,13 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1060
1067
|
ref: t,
|
|
1061
1068
|
className: "mes-dialog group",
|
|
1062
1069
|
onClose: s,
|
|
1063
|
-
onClick: (
|
|
1064
|
-
|
|
1070
|
+
onClick: (k) => {
|
|
1071
|
+
k.target === t.current && s();
|
|
1065
1072
|
},
|
|
1066
1073
|
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: [
|
|
1067
1074
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1068
1075
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1069
|
-
/* @__PURE__ */ e(
|
|
1076
|
+
/* @__PURE__ */ e(Ae, { onClick: s })
|
|
1070
1077
|
] }),
|
|
1071
1078
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1072
1079
|
/* @__PURE__ */ e(
|
|
@@ -1076,18 +1083,18 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1076
1083
|
style: { backgroundColor: "#FBFAF9" },
|
|
1077
1084
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1078
1085
|
/* @__PURE__ */ e(
|
|
1079
|
-
|
|
1086
|
+
ne,
|
|
1080
1087
|
{
|
|
1081
|
-
id:
|
|
1082
|
-
name:
|
|
1083
|
-
image:
|
|
1088
|
+
id: Q,
|
|
1089
|
+
name: v,
|
|
1090
|
+
image: P,
|
|
1084
1091
|
size: 88,
|
|
1085
1092
|
shape: "circle"
|
|
1086
1093
|
}
|
|
1087
1094
|
),
|
|
1088
1095
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1089
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1090
|
-
|
|
1096
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
|
|
1097
|
+
re && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: re }),
|
|
1091
1098
|
l && /* @__PURE__ */ e(
|
|
1092
1099
|
"span",
|
|
1093
1100
|
{
|
|
@@ -1108,42 +1115,42 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1108
1115
|
),
|
|
1109
1116
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1110
1117
|
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1111
|
-
|
|
1118
|
+
me,
|
|
1112
1119
|
{
|
|
1113
|
-
onClick:
|
|
1114
|
-
disabled:
|
|
1115
|
-
"aria-busy":
|
|
1120
|
+
onClick: _,
|
|
1121
|
+
disabled: g,
|
|
1122
|
+
"aria-busy": g,
|
|
1116
1123
|
children: [
|
|
1117
|
-
|
|
1124
|
+
g ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Bs, { className: "h-5 w-5" }),
|
|
1118
1125
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1119
1126
|
]
|
|
1120
1127
|
}
|
|
1121
1128
|
) }),
|
|
1122
|
-
/* @__PURE__ */ e("li", { children:
|
|
1123
|
-
|
|
1129
|
+
/* @__PURE__ */ e("li", { children: M ? /* @__PURE__ */ i(
|
|
1130
|
+
me,
|
|
1124
1131
|
{
|
|
1125
|
-
onClick:
|
|
1126
|
-
disabled:
|
|
1127
|
-
"aria-busy":
|
|
1132
|
+
onClick: C,
|
|
1133
|
+
disabled: b,
|
|
1134
|
+
"aria-busy": b,
|
|
1128
1135
|
children: [
|
|
1129
|
-
|
|
1136
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5" }),
|
|
1130
1137
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1131
1138
|
]
|
|
1132
1139
|
}
|
|
1133
1140
|
) : /* @__PURE__ */ i(
|
|
1134
|
-
|
|
1141
|
+
me,
|
|
1135
1142
|
{
|
|
1136
|
-
onClick:
|
|
1137
|
-
disabled:
|
|
1138
|
-
"aria-busy":
|
|
1143
|
+
onClick: E,
|
|
1144
|
+
disabled: b,
|
|
1145
|
+
"aria-busy": b,
|
|
1139
1146
|
children: [
|
|
1140
|
-
|
|
1147
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5" }),
|
|
1141
1148
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1142
1149
|
]
|
|
1143
1150
|
}
|
|
1144
1151
|
) }),
|
|
1145
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1146
|
-
/* @__PURE__ */ e(
|
|
1152
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(me, { variant: "danger", onClick: d, children: [
|
|
1153
|
+
/* @__PURE__ */ e(As, { className: "h-5 w-5" }),
|
|
1147
1154
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1148
1155
|
] }) })
|
|
1149
1156
|
] })
|
|
@@ -1152,7 +1159,7 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1152
1159
|
}
|
|
1153
1160
|
)
|
|
1154
1161
|
);
|
|
1155
|
-
},
|
|
1162
|
+
}, dt = ({
|
|
1156
1163
|
onBack: t,
|
|
1157
1164
|
showBackButton: s,
|
|
1158
1165
|
renderMessageInputActions: n,
|
|
@@ -1163,43 +1170,43 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1163
1170
|
onBlockParticipantClick: u,
|
|
1164
1171
|
onReportParticipantClick: h
|
|
1165
1172
|
}) => {
|
|
1166
|
-
const { channel: x } =
|
|
1167
|
-
(
|
|
1168
|
-
var
|
|
1169
|
-
return ((
|
|
1173
|
+
const { channel: x } = De(), p = W(null), f = L.useMemo(() => Object.values(x.state.members || {}).find(
|
|
1174
|
+
(m) => {
|
|
1175
|
+
var b;
|
|
1176
|
+
return ((b = m.user) == null ? void 0 : b.id) && m.user.id !== x._client.userID;
|
|
1170
1177
|
}
|
|
1171
|
-
), [x._client.userID, x.state.members]), o =
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1174
|
-
return String(
|
|
1175
|
-
if (
|
|
1176
|
-
return
|
|
1177
|
-
}, [x.data]),
|
|
1178
|
-
var
|
|
1179
|
-
(
|
|
1180
|
-
}, []),
|
|
1181
|
-
var
|
|
1182
|
-
(
|
|
1178
|
+
), [x._client.userID, x.state.members]), o = L.useMemo(() => {
|
|
1179
|
+
const g = x.data ?? {};
|
|
1180
|
+
if (g.followerStatus)
|
|
1181
|
+
return String(g.followerStatus);
|
|
1182
|
+
if (g.isFollower !== void 0)
|
|
1183
|
+
return g.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1184
|
+
}, [x.data]), M = D(() => {
|
|
1185
|
+
var g;
|
|
1186
|
+
(g = p.current) == null || g.showModal();
|
|
1187
|
+
}, []), S = D(() => {
|
|
1188
|
+
var g;
|
|
1189
|
+
(g = p.current) == null || g.close();
|
|
1183
1190
|
}, []);
|
|
1184
|
-
return /* @__PURE__ */ i(
|
|
1191
|
+
return /* @__PURE__ */ i(Ne, { children: [
|
|
1185
1192
|
/* @__PURE__ */ e(
|
|
1186
|
-
|
|
1193
|
+
Fs,
|
|
1187
1194
|
{
|
|
1188
1195
|
overrides: {
|
|
1189
|
-
Message: (
|
|
1196
|
+
Message: (g) => /* @__PURE__ */ e(Ks, { ...g })
|
|
1190
1197
|
},
|
|
1191
|
-
children: /* @__PURE__ */ i(
|
|
1198
|
+
children: /* @__PURE__ */ i(Ls, { children: [
|
|
1192
1199
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1193
|
-
|
|
1200
|
+
it,
|
|
1194
1201
|
{
|
|
1195
1202
|
onBack: t,
|
|
1196
1203
|
showBackButton: s,
|
|
1197
|
-
onShowInfo:
|
|
1204
|
+
onShowInfo: M,
|
|
1198
1205
|
canShowInfo: !!f
|
|
1199
1206
|
}
|
|
1200
1207
|
) }),
|
|
1201
1208
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1202
|
-
|
|
1209
|
+
Ps,
|
|
1203
1210
|
{
|
|
1204
1211
|
hideDeletedMessages: !0,
|
|
1205
1212
|
hideNewMessageSeparator: !1,
|
|
@@ -1207,7 +1214,7 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1207
1214
|
}
|
|
1208
1215
|
) }),
|
|
1209
1216
|
/* @__PURE__ */ e(
|
|
1210
|
-
|
|
1217
|
+
rt,
|
|
1211
1218
|
{
|
|
1212
1219
|
renderActions: () => n == null ? void 0 : n(x)
|
|
1213
1220
|
}
|
|
@@ -1216,10 +1223,10 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1216
1223
|
}
|
|
1217
1224
|
),
|
|
1218
1225
|
/* @__PURE__ */ e(
|
|
1219
|
-
|
|
1226
|
+
ct,
|
|
1220
1227
|
{
|
|
1221
|
-
dialogRef:
|
|
1222
|
-
onClose:
|
|
1228
|
+
dialogRef: p,
|
|
1229
|
+
onClose: S,
|
|
1223
1230
|
participant: f,
|
|
1224
1231
|
channel: x,
|
|
1225
1232
|
followerStatusLabel: o,
|
|
@@ -1232,7 +1239,7 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1232
1239
|
}
|
|
1233
1240
|
)
|
|
1234
1241
|
] });
|
|
1235
|
-
},
|
|
1242
|
+
}, je = L.memo(
|
|
1236
1243
|
({
|
|
1237
1244
|
channel: t,
|
|
1238
1245
|
onBack: s,
|
|
@@ -1241,48 +1248,60 @@ const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1241
1248
|
onLeaveConversation: l,
|
|
1242
1249
|
onBlockParticipant: c,
|
|
1243
1250
|
className: a,
|
|
1244
|
-
CustomChannelEmptyState: u =
|
|
1251
|
+
CustomChannelEmptyState: u = lt,
|
|
1245
1252
|
showDeleteConversation: h = !0,
|
|
1246
1253
|
onDeleteConversationClick: x,
|
|
1247
|
-
onBlockParticipantClick:
|
|
1248
|
-
onReportParticipantClick: f
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1254
|
+
onBlockParticipantClick: p,
|
|
1255
|
+
onReportParticipantClick: f,
|
|
1256
|
+
dmAgentEnabled: o
|
|
1257
|
+
}) => {
|
|
1258
|
+
var m;
|
|
1259
|
+
const M = ((m = t.data) == null ? void 0 : m.chatbot_paused) === !0, S = o && !M, g = D(
|
|
1260
|
+
async (b, N, y) => S ? t.sendMessage(
|
|
1261
|
+
{ ...N, silent: !0 },
|
|
1262
|
+
{ ...y, skip_push: !0 }
|
|
1263
|
+
) : t.sendMessage(N, y),
|
|
1264
|
+
[t, S]
|
|
1265
|
+
);
|
|
1266
|
+
return /* @__PURE__ */ e(
|
|
1267
|
+
"div",
|
|
1268
|
+
{
|
|
1269
|
+
className: R(
|
|
1270
|
+
"messaging-channel-view h-full flex flex-col",
|
|
1271
|
+
a
|
|
1272
|
+
),
|
|
1273
|
+
children: /* @__PURE__ */ e(
|
|
1274
|
+
Ds,
|
|
1275
|
+
{
|
|
1276
|
+
channel: t,
|
|
1277
|
+
MessageSystem: at,
|
|
1278
|
+
EmptyStateIndicator: u,
|
|
1279
|
+
LoadingIndicator: fe,
|
|
1280
|
+
DateSeparator: Js,
|
|
1281
|
+
doSendMessageRequest: g,
|
|
1282
|
+
children: /* @__PURE__ */ e(
|
|
1283
|
+
dt,
|
|
1284
|
+
{
|
|
1285
|
+
onBack: s,
|
|
1286
|
+
showBackButton: n,
|
|
1287
|
+
renderMessageInputActions: r,
|
|
1288
|
+
onLeaveConversation: l,
|
|
1289
|
+
onBlockParticipant: c,
|
|
1290
|
+
CustomChannelEmptyState: u,
|
|
1291
|
+
showDeleteConversation: h,
|
|
1292
|
+
onDeleteConversationClick: x,
|
|
1293
|
+
onBlockParticipantClick: p,
|
|
1294
|
+
onReportParticipantClick: f
|
|
1295
|
+
}
|
|
1296
|
+
)
|
|
1297
|
+
}
|
|
1298
|
+
)
|
|
1299
|
+
}
|
|
1300
|
+
);
|
|
1301
|
+
}
|
|
1283
1302
|
);
|
|
1284
|
-
|
|
1285
|
-
function
|
|
1303
|
+
je.displayName = "ChannelView";
|
|
1304
|
+
function mt({
|
|
1286
1305
|
searchQuery: t,
|
|
1287
1306
|
setSearchQuery: s,
|
|
1288
1307
|
placeholder: n
|
|
@@ -1290,7 +1309,7 @@ function dt({
|
|
|
1290
1309
|
const r = W(null);
|
|
1291
1310
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1292
1311
|
/* @__PURE__ */ e(
|
|
1293
|
-
|
|
1312
|
+
js,
|
|
1294
1313
|
{
|
|
1295
1314
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1296
1315
|
weight: "bold"
|
|
@@ -1308,7 +1327,7 @@ function dt({
|
|
|
1308
1327
|
}
|
|
1309
1328
|
),
|
|
1310
1329
|
t && /* @__PURE__ */ e(
|
|
1311
|
-
|
|
1330
|
+
Be,
|
|
1312
1331
|
{
|
|
1313
1332
|
label: "Clear search",
|
|
1314
1333
|
onClick: () => {
|
|
@@ -1316,12 +1335,12 @@ function dt({
|
|
|
1316
1335
|
s(""), (l = r.current) == null || l.focus();
|
|
1317
1336
|
},
|
|
1318
1337
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1319
|
-
children: /* @__PURE__ */ e(
|
|
1338
|
+
children: /* @__PURE__ */ e(ve, { className: "h-4 w-4", weight: "bold" })
|
|
1320
1339
|
}
|
|
1321
1340
|
)
|
|
1322
1341
|
] });
|
|
1323
1342
|
}
|
|
1324
|
-
const
|
|
1343
|
+
const ut = ({
|
|
1325
1344
|
participantSource: t,
|
|
1326
1345
|
onSelectParticipant: s,
|
|
1327
1346
|
onClose: n,
|
|
@@ -1330,73 +1349,73 @@ const mt = ({
|
|
|
1330
1349
|
searchPlaceholder: c = "Search participants...",
|
|
1331
1350
|
className: a
|
|
1332
1351
|
}) => {
|
|
1333
|
-
const { debug: u } =
|
|
1352
|
+
const { debug: u } = ge(), [h, x] = I(""), [p, f] = I([]), [o, M] = I(!1), [S, g] = I(null), [m, b] = I(
|
|
1334
1353
|
null
|
|
1335
|
-
),
|
|
1336
|
-
|
|
1354
|
+
), N = W(!1);
|
|
1355
|
+
q(() => {
|
|
1337
1356
|
if (t.loading) {
|
|
1338
1357
|
u && console.log(
|
|
1339
1358
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1340
1359
|
);
|
|
1341
1360
|
return;
|
|
1342
1361
|
}
|
|
1343
|
-
if (
|
|
1362
|
+
if (N.current) return;
|
|
1344
1363
|
(async () => {
|
|
1345
|
-
u && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1364
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), M(!0), g(null);
|
|
1346
1365
|
try {
|
|
1347
1366
|
const d = await t.loadParticipants({
|
|
1348
1367
|
search: "",
|
|
1349
1368
|
// Load all participants initially
|
|
1350
1369
|
limit: 100
|
|
1351
1370
|
});
|
|
1352
|
-
f(d.participants),
|
|
1371
|
+
f(d.participants), N.current = !0, u && console.log(
|
|
1353
1372
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1354
1373
|
d.participants.length
|
|
1355
1374
|
);
|
|
1356
1375
|
} catch (d) {
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1376
|
+
const v = d instanceof Error ? d.message : "Failed to load participants";
|
|
1377
|
+
g(v), console.error("[ParticipantPicker] Failed to load participants:", d);
|
|
1359
1378
|
} finally {
|
|
1360
|
-
|
|
1379
|
+
M(!1);
|
|
1361
1380
|
}
|
|
1362
1381
|
})();
|
|
1363
1382
|
}, [t.loading, u]);
|
|
1364
|
-
const
|
|
1365
|
-
var
|
|
1383
|
+
const y = p.filter((C) => !r.has(C.id)).filter((C) => {
|
|
1384
|
+
var v;
|
|
1366
1385
|
if (!h) return !0;
|
|
1367
1386
|
const d = h.toLowerCase();
|
|
1368
|
-
return
|
|
1369
|
-
}),
|
|
1370
|
-
async (
|
|
1371
|
-
if (!
|
|
1372
|
-
|
|
1387
|
+
return C.name.toLowerCase().includes(d) || ((v = C.email) == null ? void 0 : v.toLowerCase().includes(d)) || !1;
|
|
1388
|
+
}), _ = D(
|
|
1389
|
+
async (C) => {
|
|
1390
|
+
if (!m) {
|
|
1391
|
+
b(C.id);
|
|
1373
1392
|
try {
|
|
1374
|
-
await s(
|
|
1393
|
+
await s(C);
|
|
1375
1394
|
} catch (d) {
|
|
1376
|
-
console.error("[ParticipantPicker] Failed to start chat:", d),
|
|
1395
|
+
console.error("[ParticipantPicker] Failed to start chat:", d), b(null);
|
|
1377
1396
|
}
|
|
1378
1397
|
}
|
|
1379
1398
|
},
|
|
1380
|
-
[s,
|
|
1381
|
-
),
|
|
1382
|
-
(
|
|
1399
|
+
[s, m]
|
|
1400
|
+
), E = (C, d) => {
|
|
1401
|
+
(C.key === "Enter" || C.key === " ") && (C.preventDefault(), _(d));
|
|
1383
1402
|
};
|
|
1384
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1403
|
+
return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
|
|
1385
1404
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1386
1405
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1387
1406
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1388
|
-
/* @__PURE__ */ e(
|
|
1407
|
+
/* @__PURE__ */ e(Ae, { onClick: n })
|
|
1389
1408
|
] }),
|
|
1390
1409
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1391
1410
|
"Select a ",
|
|
1392
1411
|
l.slice(0, -1),
|
|
1393
1412
|
" to start messaging (",
|
|
1394
|
-
|
|
1413
|
+
y.length,
|
|
1395
1414
|
" available)",
|
|
1396
1415
|
t.totalCount !== void 0 && ` โข ${t.totalCount} ${l} total`
|
|
1397
1416
|
] }),
|
|
1398
1417
|
/* @__PURE__ */ e(
|
|
1399
|
-
|
|
1418
|
+
mt,
|
|
1400
1419
|
{
|
|
1401
1420
|
searchQuery: h,
|
|
1402
1421
|
setSearchQuery: x,
|
|
@@ -1404,53 +1423,53 @@ const mt = ({
|
|
|
1404
1423
|
}
|
|
1405
1424
|
)
|
|
1406
1425
|
] }),
|
|
1407
|
-
|
|
1426
|
+
S && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1408
1427
|
"Error loading ",
|
|
1409
1428
|
l,
|
|
1410
1429
|
": ",
|
|
1411
|
-
|
|
1430
|
+
S
|
|
1412
1431
|
] }),
|
|
1413
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: o &&
|
|
1432
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: o && y.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1414
1433
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1415
1434
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1416
1435
|
"Loading ",
|
|
1417
1436
|
l,
|
|
1418
1437
|
"..."
|
|
1419
1438
|
] })
|
|
1420
|
-
] }) }) :
|
|
1421
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1422
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${l} found` :
|
|
1423
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" :
|
|
1439
|
+
] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1440
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(_e, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1441
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${l} found` : p.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1442
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : p.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1424
1443
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1425
|
-
|
|
1426
|
-
const d =
|
|
1444
|
+
y.map((C) => {
|
|
1445
|
+
const d = C.name || C.email || C.id, v = C.email && C.name ? C.email : C.phone;
|
|
1427
1446
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1428
1447
|
"button",
|
|
1429
1448
|
{
|
|
1430
1449
|
type: "button",
|
|
1431
|
-
onClick: () =>
|
|
1432
|
-
onKeyDown: (
|
|
1450
|
+
onClick: () => _(C),
|
|
1451
|
+
onKeyDown: (P) => E(P, C),
|
|
1433
1452
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
|
|
1434
1453
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1435
1454
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1436
1455
|
/* @__PURE__ */ e(
|
|
1437
|
-
|
|
1456
|
+
ne,
|
|
1438
1457
|
{
|
|
1439
|
-
id:
|
|
1458
|
+
id: C.id,
|
|
1440
1459
|
name: d,
|
|
1441
|
-
image:
|
|
1460
|
+
image: C.image,
|
|
1442
1461
|
size: 40
|
|
1443
1462
|
}
|
|
1444
1463
|
),
|
|
1445
1464
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1446
1465
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: d }),
|
|
1447
|
-
|
|
1466
|
+
v && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: v })
|
|
1448
1467
|
] })
|
|
1449
1468
|
] }),
|
|
1450
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1469
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: m === C.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(_e, { className: "h-5 w-5 text-stone" }) })
|
|
1451
1470
|
] })
|
|
1452
1471
|
}
|
|
1453
|
-
) },
|
|
1472
|
+
) }, C.id);
|
|
1454
1473
|
}),
|
|
1455
1474
|
o && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1456
1475
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
@@ -1458,7 +1477,7 @@ const mt = ({
|
|
|
1458
1477
|
] }) })
|
|
1459
1478
|
] }) })
|
|
1460
1479
|
] });
|
|
1461
|
-
},
|
|
1480
|
+
}, ht = ({ className: t }) => /* @__PURE__ */ i(
|
|
1462
1481
|
"svg",
|
|
1463
1482
|
{
|
|
1464
1483
|
width: "140",
|
|
@@ -1592,17 +1611,17 @@ const mt = ({
|
|
|
1592
1611
|
] })
|
|
1593
1612
|
]
|
|
1594
1613
|
}
|
|
1595
|
-
),
|
|
1614
|
+
), $e = L.memo(
|
|
1596
1615
|
({ 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: [
|
|
1597
|
-
/* @__PURE__ */ e(
|
|
1616
|
+
/* @__PURE__ */ e(ht, {}),
|
|
1598
1617
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1599
1618
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1600
1619
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1601
1620
|
] })
|
|
1602
1621
|
] }) })
|
|
1603
1622
|
);
|
|
1604
|
-
|
|
1605
|
-
const
|
|
1623
|
+
$e.displayName = "EmptyState";
|
|
1624
|
+
const he = L.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: [
|
|
1606
1625
|
/* @__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: "โ ๏ธ" }) }),
|
|
1607
1626
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1608
1627
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1616,8 +1635,8 @@ const me = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1616
1635
|
}
|
|
1617
1636
|
)
|
|
1618
1637
|
] }) }));
|
|
1619
|
-
|
|
1620
|
-
const
|
|
1638
|
+
he.displayName = "ErrorState";
|
|
1639
|
+
const yt = ({
|
|
1621
1640
|
capabilities: t = {},
|
|
1622
1641
|
className: s,
|
|
1623
1642
|
renderMessageInputActions: n,
|
|
@@ -1628,105 +1647,106 @@ const pt = ({
|
|
|
1628
1647
|
CustomChannelEmptyState: u,
|
|
1629
1648
|
showChannelList: h = !0,
|
|
1630
1649
|
filters: x,
|
|
1631
|
-
channelListCustomEmptyStateIndicator:
|
|
1650
|
+
channelListCustomEmptyStateIndicator: p,
|
|
1632
1651
|
onDeleteConversationClick: f,
|
|
1633
1652
|
onBlockParticipantClick: o,
|
|
1634
|
-
onReportParticipantClick:
|
|
1653
|
+
onReportParticipantClick: M,
|
|
1654
|
+
dmAgentEnabled: S
|
|
1635
1655
|
}) => {
|
|
1636
1656
|
const {
|
|
1637
|
-
service:
|
|
1657
|
+
service: g,
|
|
1638
1658
|
client: m,
|
|
1639
|
-
isConnected:
|
|
1640
|
-
isLoading:
|
|
1641
|
-
error:
|
|
1642
|
-
refreshConnection:
|
|
1643
|
-
debug:
|
|
1644
|
-
} =
|
|
1645
|
-
participantSource:
|
|
1659
|
+
isConnected: b,
|
|
1660
|
+
isLoading: N,
|
|
1661
|
+
error: y,
|
|
1662
|
+
refreshConnection: _,
|
|
1663
|
+
debug: E
|
|
1664
|
+
} = $s(), [C, d] = I(null), [v, P] = I(!1), [j, z] = I(!1), [re, Q] = I(!1), [X, K] = I(/* @__PURE__ */ new Set()), [ee, ae] = I(0), [O, G] = I(!1), [Z, k] = I(null), T = W(null), {
|
|
1665
|
+
participantSource: U,
|
|
1646
1666
|
participantLabel: B = "participants",
|
|
1647
|
-
showDeleteConversation:
|
|
1648
|
-
} = t,
|
|
1649
|
-
const
|
|
1667
|
+
showDeleteConversation: se = !0
|
|
1668
|
+
} = t, oe = L.useMemo(() => {
|
|
1669
|
+
const w = m == null ? void 0 : m.userID;
|
|
1650
1670
|
return {
|
|
1651
1671
|
...{
|
|
1652
1672
|
type: "messaging",
|
|
1653
1673
|
last_message_at: { $exists: !0 },
|
|
1654
|
-
...
|
|
1655
|
-
members: { $in: [
|
|
1674
|
+
...w && {
|
|
1675
|
+
members: { $in: [w] },
|
|
1656
1676
|
hidden: !1
|
|
1657
1677
|
}
|
|
1658
1678
|
},
|
|
1659
1679
|
...x
|
|
1660
1680
|
};
|
|
1661
|
-
}, [x, m == null ? void 0 : m.userID]),
|
|
1662
|
-
if (!m || !
|
|
1663
|
-
const
|
|
1664
|
-
if (
|
|
1681
|
+
}, [x, m == null ? void 0 : m.userID]), Y = W(null), H = D(async () => {
|
|
1682
|
+
if (!m || !b) return;
|
|
1683
|
+
const w = m.userID;
|
|
1684
|
+
if (w)
|
|
1665
1685
|
try {
|
|
1666
|
-
|
|
1667
|
-
const
|
|
1686
|
+
E && console.log("[MessagingShell] Syncing channels for user:", w);
|
|
1687
|
+
const $ = await m.queryChannels(
|
|
1668
1688
|
{
|
|
1669
1689
|
type: "messaging",
|
|
1670
|
-
members: { $in: [
|
|
1690
|
+
members: { $in: [w] }
|
|
1671
1691
|
},
|
|
1672
1692
|
{},
|
|
1673
1693
|
{ limit: 100 }
|
|
1674
1694
|
), F = /* @__PURE__ */ new Set();
|
|
1675
|
-
|
|
1676
|
-
const
|
|
1677
|
-
Object.values(
|
|
1678
|
-
var
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1695
|
+
$.forEach((A) => {
|
|
1696
|
+
const Ce = A.state.members;
|
|
1697
|
+
Object.values(Ce).forEach((ze) => {
|
|
1698
|
+
var we;
|
|
1699
|
+
const be = (we = ze.user) == null ? void 0 : we.id;
|
|
1700
|
+
be && be !== w && F.add(be);
|
|
1681
1701
|
});
|
|
1682
|
-
}), K((A) => A.size === F.size && [...A].every((
|
|
1683
|
-
channelCount:
|
|
1702
|
+
}), K((A) => A.size === F.size && [...A].every((Ce) => F.has(Ce)) ? A : F), P($.length > 0), z(!0), Y.current = w, E && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1703
|
+
channelCount: $.length,
|
|
1684
1704
|
memberCount: F.size
|
|
1685
1705
|
});
|
|
1686
|
-
} catch (
|
|
1687
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1706
|
+
} catch ($) {
|
|
1707
|
+
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
1688
1708
|
}
|
|
1689
|
-
}, [m,
|
|
1690
|
-
|
|
1691
|
-
if (!m || !
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1694
|
-
}, [m,
|
|
1695
|
-
if (!c || !m || !
|
|
1709
|
+
}, [m, b, E]);
|
|
1710
|
+
q(() => {
|
|
1711
|
+
if (!m || !b) return;
|
|
1712
|
+
const w = m.userID;
|
|
1713
|
+
w && Y.current !== w && H();
|
|
1714
|
+
}, [m, b, H]), q(() => {
|
|
1715
|
+
if (!c || !m || !b) return;
|
|
1696
1716
|
(async () => {
|
|
1697
|
-
const
|
|
1698
|
-
if (
|
|
1717
|
+
const $ = m.userID;
|
|
1718
|
+
if ($)
|
|
1699
1719
|
try {
|
|
1700
|
-
|
|
1720
|
+
E && console.log(
|
|
1701
1721
|
"[MessagingShell] Loading initial conversation with:",
|
|
1702
1722
|
c
|
|
1703
1723
|
);
|
|
1704
1724
|
const F = await m.queryChannels(
|
|
1705
1725
|
{
|
|
1706
1726
|
type: "messaging",
|
|
1707
|
-
members: { $eq: [
|
|
1727
|
+
members: { $eq: [$, c] }
|
|
1708
1728
|
},
|
|
1709
1729
|
{},
|
|
1710
1730
|
{ limit: 1 }
|
|
1711
1731
|
);
|
|
1712
1732
|
if (F.length > 0)
|
|
1713
|
-
|
|
1733
|
+
d(F[0]), G(!0), k(null), r && r(F[0]), E && console.log(
|
|
1714
1734
|
"[MessagingShell] Initial conversation loaded:",
|
|
1715
1735
|
F[0].id
|
|
1716
1736
|
);
|
|
1717
|
-
else if (a &&
|
|
1718
|
-
|
|
1737
|
+
else if (a && g) {
|
|
1738
|
+
E && console.log(
|
|
1719
1739
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1720
1740
|
a
|
|
1721
1741
|
);
|
|
1722
1742
|
try {
|
|
1723
|
-
const A = await
|
|
1743
|
+
const A = await g.startChannelWithParticipant({
|
|
1724
1744
|
id: a.id,
|
|
1725
1745
|
name: a.name,
|
|
1726
1746
|
email: a.email,
|
|
1727
1747
|
phone: a.phone
|
|
1728
1748
|
});
|
|
1729
|
-
|
|
1749
|
+
d(A), G(!0), k(null), r && r(A), E && console.log(
|
|
1730
1750
|
"[MessagingShell] Channel created and loaded:",
|
|
1731
1751
|
A.id
|
|
1732
1752
|
);
|
|
@@ -1734,12 +1754,12 @@ const pt = ({
|
|
|
1734
1754
|
console.error(
|
|
1735
1755
|
"[MessagingShell] Failed to create conversation:",
|
|
1736
1756
|
A
|
|
1737
|
-
),
|
|
1757
|
+
), k("Failed to create conversation");
|
|
1738
1758
|
}
|
|
1739
1759
|
} else
|
|
1740
|
-
|
|
1760
|
+
k(
|
|
1741
1761
|
"No conversation found with this account"
|
|
1742
|
-
),
|
|
1762
|
+
), E && console.log(
|
|
1743
1763
|
"[MessagingShell] No conversation found for:",
|
|
1744
1764
|
c
|
|
1745
1765
|
);
|
|
@@ -1747,80 +1767,80 @@ const pt = ({
|
|
|
1747
1767
|
console.error(
|
|
1748
1768
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1749
1769
|
F
|
|
1750
|
-
),
|
|
1770
|
+
), k("Failed to load conversation");
|
|
1751
1771
|
}
|
|
1752
1772
|
})();
|
|
1753
1773
|
}, [
|
|
1754
1774
|
c,
|
|
1755
1775
|
a,
|
|
1756
1776
|
m,
|
|
1757
|
-
C,
|
|
1758
|
-
E,
|
|
1759
1777
|
b,
|
|
1778
|
+
g,
|
|
1779
|
+
E,
|
|
1760
1780
|
r
|
|
1761
1781
|
]);
|
|
1762
|
-
const
|
|
1763
|
-
(
|
|
1764
|
-
|
|
1782
|
+
const ie = D(
|
|
1783
|
+
(w) => {
|
|
1784
|
+
d(w), r == null || r(w);
|
|
1765
1785
|
},
|
|
1766
1786
|
[r]
|
|
1767
|
-
),
|
|
1768
|
-
|
|
1769
|
-
}, [
|
|
1770
|
-
async (
|
|
1771
|
-
var
|
|
1772
|
-
if (
|
|
1787
|
+
), le = D(() => {
|
|
1788
|
+
O || d(null);
|
|
1789
|
+
}, [O]), V = D(
|
|
1790
|
+
async (w) => {
|
|
1791
|
+
var $;
|
|
1792
|
+
if (g)
|
|
1773
1793
|
try {
|
|
1774
|
-
|
|
1794
|
+
E && console.log(
|
|
1775
1795
|
"[MessagingShell] Starting conversation with:",
|
|
1776
|
-
|
|
1796
|
+
w.id
|
|
1777
1797
|
);
|
|
1778
|
-
const F = await
|
|
1779
|
-
id:
|
|
1780
|
-
name:
|
|
1781
|
-
email:
|
|
1782
|
-
phone:
|
|
1798
|
+
const F = await g.startChannelWithParticipant({
|
|
1799
|
+
id: w.id,
|
|
1800
|
+
name: w.name,
|
|
1801
|
+
email: w.email,
|
|
1802
|
+
phone: w.phone
|
|
1783
1803
|
});
|
|
1784
1804
|
try {
|
|
1785
1805
|
await F.show();
|
|
1786
1806
|
} catch (A) {
|
|
1787
1807
|
console.warn("[MessagingShell] Failed to unhide channel:", A);
|
|
1788
1808
|
}
|
|
1789
|
-
|
|
1809
|
+
d(F), Q(!1), ($ = T.current) == null || $.close(), l == null || l(w);
|
|
1790
1810
|
} catch (F) {
|
|
1791
1811
|
console.error("[MessagingShell] Failed to start conversation:", F);
|
|
1792
1812
|
}
|
|
1793
1813
|
},
|
|
1794
|
-
[
|
|
1795
|
-
),
|
|
1796
|
-
var
|
|
1797
|
-
|
|
1798
|
-
}, []),
|
|
1799
|
-
(
|
|
1800
|
-
|
|
1814
|
+
[g, l, E]
|
|
1815
|
+
), te = D(() => {
|
|
1816
|
+
var w;
|
|
1817
|
+
Q(!1), (w = T.current) == null || w.close();
|
|
1818
|
+
}, []), ce = D(
|
|
1819
|
+
(w) => {
|
|
1820
|
+
w.target === T.current && te();
|
|
1801
1821
|
},
|
|
1802
|
-
[
|
|
1803
|
-
),
|
|
1804
|
-
async (
|
|
1805
|
-
|
|
1822
|
+
[te]
|
|
1823
|
+
), xe = D(
|
|
1824
|
+
async (w) => {
|
|
1825
|
+
E && console.log("[MessagingShell] Leaving conversation:", w.id), d(null), G(!1), Y.current = null, await H();
|
|
1806
1826
|
},
|
|
1807
|
-
[
|
|
1808
|
-
),
|
|
1809
|
-
async (
|
|
1810
|
-
|
|
1827
|
+
[H, E]
|
|
1828
|
+
), de = D(
|
|
1829
|
+
async (w) => {
|
|
1830
|
+
E && console.log("[MessagingShell] Blocking participant:", w), d(null), G(!1), Y.current = null, await H();
|
|
1811
1831
|
},
|
|
1812
|
-
[
|
|
1813
|
-
),
|
|
1814
|
-
return
|
|
1815
|
-
|
|
1832
|
+
[H, E]
|
|
1833
|
+
), J = !!C;
|
|
1834
|
+
return N ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : y ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, { message: y, onBack: _ }) }) : !b || !m ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
|
|
1835
|
+
he,
|
|
1816
1836
|
{
|
|
1817
1837
|
message: "Not connected to messaging service",
|
|
1818
|
-
onBack:
|
|
1838
|
+
onBack: _
|
|
1819
1839
|
}
|
|
1820
|
-
) }) :
|
|
1840
|
+
) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, { message: Z }) }) : /* @__PURE__ */ i(
|
|
1821
1841
|
"div",
|
|
1822
1842
|
{
|
|
1823
|
-
className:
|
|
1843
|
+
className: R(
|
|
1824
1844
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
1825
1845
|
s
|
|
1826
1846
|
),
|
|
@@ -1829,23 +1849,23 @@ const pt = ({
|
|
|
1829
1849
|
/* @__PURE__ */ e(
|
|
1830
1850
|
"div",
|
|
1831
1851
|
{
|
|
1832
|
-
className:
|
|
1852
|
+
className: R(
|
|
1833
1853
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1834
1854
|
{
|
|
1835
|
-
"!hidden": h === !1 ||
|
|
1855
|
+
"!hidden": h === !1 || O,
|
|
1836
1856
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
1837
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !
|
|
1857
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !O && J,
|
|
1838
1858
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
1839
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !
|
|
1859
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !J
|
|
1840
1860
|
}
|
|
1841
1861
|
),
|
|
1842
1862
|
children: /* @__PURE__ */ e(
|
|
1843
|
-
|
|
1863
|
+
Ue,
|
|
1844
1864
|
{
|
|
1845
|
-
onChannelSelect:
|
|
1846
|
-
selectedChannel:
|
|
1847
|
-
filters:
|
|
1848
|
-
customEmptyStateIndicator:
|
|
1865
|
+
onChannelSelect: ie,
|
|
1866
|
+
selectedChannel: C || void 0,
|
|
1867
|
+
filters: oe,
|
|
1868
|
+
customEmptyStateIndicator: p
|
|
1849
1869
|
}
|
|
1850
1870
|
)
|
|
1851
1871
|
}
|
|
@@ -1853,59 +1873,60 @@ const pt = ({
|
|
|
1853
1873
|
/* @__PURE__ */ e(
|
|
1854
1874
|
"div",
|
|
1855
1875
|
{
|
|
1856
|
-
className:
|
|
1876
|
+
className: R(
|
|
1857
1877
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1858
1878
|
{
|
|
1859
1879
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
1860
|
-
flex:
|
|
1880
|
+
flex: O || J || c,
|
|
1861
1881
|
// Normal mode: hide on mobile when no channel selected
|
|
1862
|
-
"hidden lg:flex": !
|
|
1882
|
+
"hidden lg:flex": !O && !J && !c
|
|
1863
1883
|
}
|
|
1864
1884
|
),
|
|
1865
|
-
children:
|
|
1866
|
-
|
|
1885
|
+
children: C ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
1886
|
+
je,
|
|
1867
1887
|
{
|
|
1868
|
-
channel:
|
|
1869
|
-
onBack:
|
|
1870
|
-
showBackButton: !
|
|
1888
|
+
channel: C,
|
|
1889
|
+
onBack: le,
|
|
1890
|
+
showBackButton: !O,
|
|
1871
1891
|
renderMessageInputActions: n,
|
|
1872
|
-
onLeaveConversation:
|
|
1873
|
-
onBlockParticipant:
|
|
1892
|
+
onLeaveConversation: xe,
|
|
1893
|
+
onBlockParticipant: de,
|
|
1874
1894
|
CustomChannelEmptyState: u,
|
|
1875
|
-
showDeleteConversation:
|
|
1895
|
+
showDeleteConversation: se,
|
|
1876
1896
|
onDeleteConversationClick: f,
|
|
1877
1897
|
onBlockParticipantClick: o,
|
|
1878
|
-
onReportParticipantClick:
|
|
1898
|
+
onReportParticipantClick: M,
|
|
1899
|
+
dmAgentEnabled: S
|
|
1879
1900
|
},
|
|
1880
|
-
|
|
1901
|
+
C.id
|
|
1881
1902
|
) }) : c ? (
|
|
1882
1903
|
// Show loading while creating/loading direct conversation channel
|
|
1883
|
-
/* @__PURE__ */ e(
|
|
1904
|
+
/* @__PURE__ */ e(fe, {})
|
|
1884
1905
|
) : /* @__PURE__ */ e(
|
|
1885
|
-
|
|
1906
|
+
$e,
|
|
1886
1907
|
{
|
|
1887
|
-
hasChannels:
|
|
1888
|
-
channelsLoaded:
|
|
1908
|
+
hasChannels: v,
|
|
1909
|
+
channelsLoaded: j
|
|
1889
1910
|
}
|
|
1890
1911
|
)
|
|
1891
1912
|
}
|
|
1892
1913
|
)
|
|
1893
1914
|
] }),
|
|
1894
|
-
|
|
1915
|
+
U && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1895
1916
|
/* @__PURE__ */ e(
|
|
1896
1917
|
"dialog",
|
|
1897
1918
|
{
|
|
1898
|
-
ref:
|
|
1919
|
+
ref: T,
|
|
1899
1920
|
className: "mes-dialog",
|
|
1900
|
-
onClick:
|
|
1901
|
-
onClose:
|
|
1921
|
+
onClick: ce,
|
|
1922
|
+
onClose: te,
|
|
1902
1923
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1903
|
-
|
|
1924
|
+
ut,
|
|
1904
1925
|
{
|
|
1905
|
-
participantSource:
|
|
1906
|
-
onSelectParticipant:
|
|
1907
|
-
onClose:
|
|
1908
|
-
existingParticipantIds:
|
|
1926
|
+
participantSource: U,
|
|
1927
|
+
onSelectParticipant: V,
|
|
1928
|
+
onClose: te,
|
|
1929
|
+
existingParticipantIds: X,
|
|
1909
1930
|
participantLabel: B,
|
|
1910
1931
|
searchPlaceholder: `Search ${B}...`
|
|
1911
1932
|
},
|
|
@@ -1916,7 +1937,7 @@ const pt = ({
|
|
|
1916
1937
|
]
|
|
1917
1938
|
}
|
|
1918
1939
|
);
|
|
1919
|
-
},
|
|
1940
|
+
}, ft = ({
|
|
1920
1941
|
question: t,
|
|
1921
1942
|
onClick: s,
|
|
1922
1943
|
loading: n = !1,
|
|
@@ -1928,7 +1949,7 @@ const pt = ({
|
|
|
1928
1949
|
onClick: s,
|
|
1929
1950
|
disabled: n,
|
|
1930
1951
|
style: { backgroundColor: "#E6E5E3" },
|
|
1931
|
-
className:
|
|
1952
|
+
className: R(
|
|
1932
1953
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
|
|
1933
1954
|
{
|
|
1934
1955
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -1938,7 +1959,7 @@ const pt = ({
|
|
|
1938
1959
|
),
|
|
1939
1960
|
children: t
|
|
1940
1961
|
}
|
|
1941
|
-
),
|
|
1962
|
+
), Et = ({
|
|
1942
1963
|
faqs: t,
|
|
1943
1964
|
onFaqClick: s,
|
|
1944
1965
|
loadingFaqId: n,
|
|
@@ -1950,7 +1971,7 @@ const pt = ({
|
|
|
1950
1971
|
const u = t.filter((h) => h.enabled).sort((h, x) => (h.order ?? 0) - (x.order ?? 0));
|
|
1951
1972
|
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
1952
1973
|
(c || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
1953
|
-
|
|
1974
|
+
ne,
|
|
1954
1975
|
{
|
|
1955
1976
|
id: a || "account",
|
|
1956
1977
|
name: a || "Account",
|
|
@@ -1967,7 +1988,7 @@ const pt = ({
|
|
|
1967
1988
|
children: [
|
|
1968
1989
|
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
1969
1990
|
u.map((h) => /* @__PURE__ */ e(
|
|
1970
|
-
|
|
1991
|
+
ft,
|
|
1971
1992
|
{
|
|
1972
1993
|
question: h.question,
|
|
1973
1994
|
onClick: () => s(h.id),
|
|
@@ -1979,59 +2000,59 @@ const pt = ({
|
|
|
1979
2000
|
}
|
|
1980
2001
|
)
|
|
1981
2002
|
] }) });
|
|
1982
|
-
},
|
|
1983
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, c] = I([]), [a, u] = I(!1), [h, x] = I(null), [
|
|
2003
|
+
}, It = (t, s = {}) => {
|
|
2004
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, c] = I([]), [a, u] = I(!1), [h, x] = I(null), [p, f] = I(n), [o, M] = I(!0), [S, g] = I(), m = D(async (_ = !1, E) => {
|
|
1984
2005
|
if (a) return;
|
|
1985
|
-
const
|
|
2006
|
+
const C = E !== void 0 ? E : p;
|
|
1986
2007
|
u(!0), x(null);
|
|
1987
2008
|
try {
|
|
1988
2009
|
const d = await t.loadParticipants({
|
|
1989
|
-
search:
|
|
2010
|
+
search: C || void 0,
|
|
1990
2011
|
limit: r,
|
|
1991
|
-
cursor:
|
|
2012
|
+
cursor: _ ? void 0 : S
|
|
1992
2013
|
});
|
|
1993
2014
|
c(
|
|
1994
|
-
(
|
|
1995
|
-
),
|
|
2015
|
+
(v) => _ ? d.participants : [...v, ...d.participants]
|
|
2016
|
+
), M(d.hasMore), g(d.nextCursor);
|
|
1996
2017
|
} catch (d) {
|
|
1997
|
-
const
|
|
1998
|
-
x(
|
|
2018
|
+
const v = d instanceof Error ? d.message : "Failed to load participants";
|
|
2019
|
+
x(v), console.error("[useParticipants] Load error:", d);
|
|
1999
2020
|
} finally {
|
|
2000
2021
|
u(!1);
|
|
2001
2022
|
}
|
|
2002
|
-
}, [t,
|
|
2003
|
-
o && !a &&
|
|
2004
|
-
}, [o, a,
|
|
2005
|
-
f(
|
|
2006
|
-
}, [
|
|
2007
|
-
|
|
2008
|
-
}, [
|
|
2009
|
-
return
|
|
2010
|
-
|
|
2023
|
+
}, [t, p, S, r, a]), b = D(() => {
|
|
2024
|
+
o && !a && m(!1);
|
|
2025
|
+
}, [o, a, m]), N = D((_) => {
|
|
2026
|
+
f(_), g(void 0), m(!0, _);
|
|
2027
|
+
}, [m]), y = D(() => {
|
|
2028
|
+
g(void 0), m(!0);
|
|
2029
|
+
}, [m]);
|
|
2030
|
+
return q(() => {
|
|
2031
|
+
m(!0);
|
|
2011
2032
|
}, [t.loadParticipants]), {
|
|
2012
2033
|
participants: l,
|
|
2013
2034
|
loading: a,
|
|
2014
2035
|
error: h,
|
|
2015
|
-
searchQuery:
|
|
2036
|
+
searchQuery: p,
|
|
2016
2037
|
hasMore: o,
|
|
2017
2038
|
totalCount: t.totalCount,
|
|
2018
|
-
loadMore:
|
|
2019
|
-
search:
|
|
2020
|
-
refresh:
|
|
2039
|
+
loadMore: b,
|
|
2040
|
+
search: N,
|
|
2041
|
+
refresh: y
|
|
2021
2042
|
};
|
|
2022
2043
|
};
|
|
2023
2044
|
export {
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2045
|
+
ne as Avatar,
|
|
2046
|
+
lt as ChannelEmptyState,
|
|
2047
|
+
Ue as ChannelList,
|
|
2048
|
+
je as ChannelView,
|
|
2049
|
+
Et as FaqList,
|
|
2050
|
+
ft as FaqListItem,
|
|
2051
|
+
pt as MessagingProvider,
|
|
2052
|
+
yt as MessagingShell,
|
|
2053
|
+
ut as ParticipantPicker,
|
|
2054
|
+
Gs as formatRelativeTime,
|
|
2055
|
+
$s as useMessaging,
|
|
2056
|
+
It as useParticipants
|
|
2036
2057
|
};
|
|
2037
2058
|
//# sourceMappingURL=index.js.map
|