@linktr.ee/messaging-react 1.25.0 โ 1.26.0
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/assets/index.css +1 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +891 -824
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +31 -0
- package/src/components/ChannelList/index.test.tsx +18 -0
- package/src/components/ChannelList/index.tsx +2 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.stories.tsx +8 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.test.tsx +48 -2
- package/src/components/CustomSystemMessage/index.tsx +119 -13
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/stream-custom-data.ts +3 -0
- package/src/styles.css +0 -30
- 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
|
|
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,34 +15,34 @@ const Ge = lt({
|
|
|
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,
|
|
22
22
|
apiKey: o,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(u, ...
|
|
28
|
-
|
|
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
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), y = X(0);
|
|
44
|
+
y.current++, r("๐ RENDER INFO", {
|
|
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: {
|
|
48
48
|
userChanged: E.current.userId !== (s == null ? void 0 : s.id),
|
|
@@ -55,9 +55,9 @@ const Ge = lt({
|
|
|
55
55
|
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const u =
|
|
60
|
-
if (
|
|
58
|
+
}, K(() => {
|
|
59
|
+
const u = y.current;
|
|
60
|
+
if (r("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
@@ -68,146 +68,146 @@ const Ge = lt({
|
|
|
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
|
-
debug:
|
|
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,
|
|
97
|
-
const S =
|
|
98
|
-
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
96
|
+
}, [o, n, d, r]);
|
|
97
|
+
const S = X(null);
|
|
98
|
+
K(() => {
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: R,
|
|
193
|
+
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
h,
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
g,
|
|
198
|
+
a,
|
|
199
199
|
_,
|
|
200
200
|
l,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
R,
|
|
202
|
+
d,
|
|
203
|
+
r
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(h &&
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
205
|
+
return r("๐ RENDER END", {
|
|
206
|
+
renderCount: y.current,
|
|
207
|
+
willRenderChat: !!(h && g),
|
|
208
|
+
contextValueReady: !!m
|
|
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 Ge = lt({
|
|
|
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
|
-
return
|
|
231
|
-
var
|
|
230
|
+
return K(() => {
|
|
231
|
+
var r;
|
|
232
232
|
if (!t) {
|
|
233
233
|
n(!1);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
n(!!((
|
|
237
|
-
const
|
|
238
|
-
var
|
|
236
|
+
n(!!((r = t.state.membership) != null && r.pinned_at));
|
|
237
|
+
const d = (c) => {
|
|
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
|
-
return t.on("member.updated",
|
|
244
|
-
t.off("member.updated",
|
|
243
|
+
return t.on("member.updated", d), () => {
|
|
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 Ge = lt({
|
|
|
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 Ge = lt({
|
|
|
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,26 +301,26 @@ function as(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,
|
|
312
312
|
className: o,
|
|
313
313
|
starred: l = !1,
|
|
314
|
-
shape:
|
|
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`
|
|
@@ -331,7 +331,7 @@ const se = ({
|
|
|
331
331
|
{
|
|
332
332
|
"aria-hidden": "true",
|
|
333
333
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
334
|
-
children: /* @__PURE__ */ e(
|
|
334
|
+
children: /* @__PURE__ */ e(Ie, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
335
335
|
}
|
|
336
336
|
),
|
|
337
337
|
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
|
|
@@ -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,105 +372,105 @@ 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
|
|
387
|
-
},
|
|
386
|
+
return We(t) && !((s = t.text) != null && s.trim());
|
|
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 =
|
|
395
|
-
if (!l && !
|
|
393
|
+
var g;
|
|
394
|
+
const l = We(t), d = Re(t);
|
|
395
|
+
if (!l && !d)
|
|
396
396
|
return null;
|
|
397
397
|
if (l) {
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
400
|
-
const
|
|
401
|
-
return /* @__PURE__ */ i("div", { className:
|
|
402
|
-
/* @__PURE__ */ e(
|
|
403
|
-
/* @__PURE__ */ e("span", { children:
|
|
398
|
+
const p = (g = t.metadata) == null ? void 0 : g.amount_text;
|
|
399
|
+
if (!p) return null;
|
|
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
|
+
/* @__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:
|
|
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:
|
|
471
|
-
image:
|
|
469
|
+
id: ((C = x == null ? void 0 : x.user) == null ? void 0 : C.id) || t.id || "unknown",
|
|
470
|
+
name: g,
|
|
471
|
+
image: p,
|
|
472
472
|
size: 44,
|
|
473
|
-
starred:
|
|
473
|
+
starred: y,
|
|
474
474
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
475
475
|
}
|
|
476
476
|
),
|
|
@@ -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
|
-
|
|
488
|
-
|
|
487
|
+
y && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
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,64 +501,66 @@ 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,
|
|
509
509
|
filters: n,
|
|
510
510
|
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
511
511
|
onMessageNew: l,
|
|
512
|
-
onAddedToChannel:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
512
|
+
onAddedToChannel: d,
|
|
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
|
-
onAddedToChannel:
|
|
551
|
-
|
|
552
|
-
|
|
551
|
+
onAddedToChannel: d,
|
|
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 Ye({ 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
|
-
onLeaveConversation:
|
|
610
|
-
onBlockParticipant:
|
|
611
|
+
onLeaveConversation: d,
|
|
612
|
+
onBlockParticipant: r,
|
|
611
613
|
showDeleteConversation: c = !0,
|
|
612
|
-
onDeleteConversationClick:
|
|
614
|
+
onDeleteConversationClick: f,
|
|
613
615
|
onBlockParticipantClick: h,
|
|
614
|
-
onReportParticipantClick:
|
|
615
|
-
customProfileContent:
|
|
616
|
-
customChannelActions:
|
|
616
|
+
onReportParticipantClick: x,
|
|
617
|
+
customProfileContent: g,
|
|
618
|
+
customChannelActions: p
|
|
617
619
|
}) => {
|
|
618
|
-
var W, j,
|
|
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
|
-
}, [
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}, [
|
|
640
|
-
const
|
|
641
|
-
var
|
|
638
|
+
}, [a, (L = n == null ? void 0 : n.user) == null ? void 0 : L.id]);
|
|
639
|
+
K(() => {
|
|
640
|
+
R();
|
|
641
|
+
}, [R]);
|
|
642
|
+
const m = async () => {
|
|
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 (!(
|
|
656
|
-
h == null || h(),
|
|
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 (!(
|
|
668
|
-
h == null || h(),
|
|
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 us = ({
|
|
|
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 us = ({
|
|
|
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:
|
|
722
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
|
|
721
723
|
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
722
|
-
l && !
|
|
724
|
+
l && !g && /* @__PURE__ */ e(
|
|
723
725
|
"span",
|
|
724
726
|
{
|
|
725
727
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -733,90 +735,90 @@ const us = ({
|
|
|
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
|
-
onClick:
|
|
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:
|
|
758
|
-
disabled:
|
|
759
|
-
"aria-busy":
|
|
759
|
+
onClick: C,
|
|
760
|
+
disabled: y,
|
|
761
|
+
"aria-busy": y,
|
|
760
762
|
children: [
|
|
761
|
-
|
|
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
|
-
disabled:
|
|
770
|
-
"aria-busy":
|
|
771
|
+
disabled: y,
|
|
772
|
+
"aria-busy": y,
|
|
771
773
|
children: [
|
|
772
|
-
|
|
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
|
|
782
784
|
] })
|
|
783
785
|
] })
|
|
784
786
|
] })
|
|
785
787
|
}
|
|
786
788
|
)
|
|
787
789
|
);
|
|
788
|
-
},
|
|
789
|
-
function
|
|
790
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
790
|
+
}, gs = (t) => /* @__PURE__ */ e(ft, { ...t, position: "center" }), Me = "vote_up", ke = "vote_down";
|
|
791
|
+
function xs(t) {
|
|
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 } =
|
|
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
|
-
), l =
|
|
798
|
+
), l = A(async () => {
|
|
797
799
|
if (n != null && n.userID)
|
|
798
800
|
try {
|
|
799
|
-
o === "up" ? await s.deleteReaction(t.id,
|
|
801
|
+
o === "up" ? await s.deleteReaction(t.id, Me) : await s.sendReaction(
|
|
800
802
|
t.id,
|
|
801
|
-
{ type:
|
|
803
|
+
{ type: Me },
|
|
802
804
|
{ enforce_unique: !0, skip_push: !0 }
|
|
803
805
|
);
|
|
804
806
|
} catch {
|
|
805
807
|
}
|
|
806
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]),
|
|
808
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = A(async () => {
|
|
807
809
|
if (n != null && n.userID)
|
|
808
810
|
try {
|
|
809
|
-
o === "down" ? await s.deleteReaction(t.id,
|
|
811
|
+
o === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
|
|
810
812
|
t.id,
|
|
811
|
-
{ type:
|
|
813
|
+
{ type: ke },
|
|
812
814
|
{ enforce_unique: !0, skip_push: !0 }
|
|
813
815
|
);
|
|
814
816
|
} catch {
|
|
815
817
|
}
|
|
816
818
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
817
|
-
return { selected: o, voteUp: l, voteDown:
|
|
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 gs = ({ 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 gs = ({ 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 gs = ({ 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 gs = ({ 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
|
-
firstOfGroup:
|
|
874
|
-
groupedByUser:
|
|
875
|
+
firstOfGroup: d,
|
|
876
|
+
groupedByUser: r,
|
|
875
877
|
handleAction: c,
|
|
876
|
-
handleOpenThread:
|
|
878
|
+
handleOpenThread: f,
|
|
877
879
|
handleRetry: h,
|
|
878
|
-
highlighted:
|
|
879
|
-
isMessageAIGenerated:
|
|
880
|
-
isMyMessage:
|
|
881
|
-
message:
|
|
882
|
-
renderText:
|
|
880
|
+
highlighted: x,
|
|
881
|
+
isMessageAIGenerated: g,
|
|
882
|
+
isMyMessage: p,
|
|
883
|
+
message: a,
|
|
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: Y =
|
|
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
|
-
"str-chat__virtual-message__wrapper--first":
|
|
926
|
-
"str-chat__virtual-message__wrapper--group":
|
|
927
|
+
"str-chat__virtual-message__wrapper--first": d,
|
|
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
|
-
!!
|
|
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(
|
|
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
|
-
|
|
979
|
-
|
|
980
|
+
J && !ee && /* @__PURE__ */ e(
|
|
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:
|
|
998
|
-
renderText:
|
|
999
|
+
message: a,
|
|
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
|
-
(!
|
|
1004
|
-
|
|
1005
|
+
(!J || ee) && /* @__PURE__ */ e(
|
|
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:
|
|
1016
|
-
onVoteDown:
|
|
1017
|
+
onVoteUp: R,
|
|
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,12 +1066,12 @@ const gs = ({ 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",
|
|
1072
|
-
children: /* @__PURE__ */ e(
|
|
1074
|
+
children: /* @__PURE__ */ e(De, { className: "size-4 text-black/90" })
|
|
1073
1075
|
}
|
|
1074
1076
|
),
|
|
1075
1077
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -1079,32 +1081,32 @@ const gs = ({ 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(ys, {}),
|
|
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,43 +1122,79 @@ const gs = ({ 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 = [
|
|
1143
|
+
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1144
|
+
], Rs = {
|
|
1145
|
+
SYSTEM_AGE_SAFETY_BLOCKED: "This user isnโt able to reply because they donโt meet our 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) => {
|
|
1141
1147
|
var o;
|
|
1142
1148
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1143
|
-
if (
|
|
1144
|
-
return
|
|
1149
|
+
if ($e(s))
|
|
1150
|
+
return {
|
|
1151
|
+
kind: "dm-agent",
|
|
1152
|
+
type: s
|
|
1153
|
+
};
|
|
1154
|
+
if (As(s))
|
|
1155
|
+
return {
|
|
1156
|
+
kind: "age-safety",
|
|
1157
|
+
type: s
|
|
1158
|
+
};
|
|
1145
1159
|
const n = t.dm_agent_system_type;
|
|
1146
|
-
if (
|
|
1147
|
-
return
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1160
|
+
if ($e(n))
|
|
1161
|
+
return {
|
|
1162
|
+
kind: "dm-agent",
|
|
1163
|
+
type: n
|
|
1164
|
+
};
|
|
1165
|
+
}, Fs = (t) => {
|
|
1166
|
+
const s = t.indexOf(Ee);
|
|
1167
|
+
if (s === -1)
|
|
1168
|
+
return t;
|
|
1169
|
+
const n = s + Ee.length;
|
|
1170
|
+
return /* @__PURE__ */ i(de, { children: [
|
|
1171
|
+
t.slice(0, s),
|
|
1172
|
+
/* @__PURE__ */ e(
|
|
1173
|
+
"a",
|
|
1174
|
+
{
|
|
1175
|
+
href: Ls,
|
|
1176
|
+
target: "_blank",
|
|
1177
|
+
rel: "noopener noreferrer",
|
|
1178
|
+
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1179
|
+
children: Ee
|
|
1180
|
+
}
|
|
1181
|
+
),
|
|
1182
|
+
t.slice(n)
|
|
1183
|
+
] });
|
|
1184
|
+
}, Os = (t) => {
|
|
1185
|
+
var o, l;
|
|
1186
|
+
const s = t.message.hide_date === !0, n = Ps(
|
|
1187
|
+
t.message
|
|
1188
|
+
);
|
|
1189
|
+
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1190
|
+
const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Ts[n.type];
|
|
1153
1191
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1154
1192
|
/* @__PURE__ */ i(
|
|
1155
1193
|
"div",
|
|
1156
1194
|
{
|
|
1157
|
-
className: "mes-dm-agent-system-message",
|
|
1195
|
+
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
1158
1196
|
"data-testid": "dm-agent-system-message",
|
|
1159
|
-
"data-dm-agent-system-type": n,
|
|
1197
|
+
"data-dm-agent-system-type": n.type,
|
|
1160
1198
|
children: [
|
|
1161
1199
|
/* @__PURE__ */ e(
|
|
1162
1200
|
Qt,
|
|
@@ -1164,14 +1202,41 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1164
1202
|
size: 16,
|
|
1165
1203
|
weight: "regular",
|
|
1166
1204
|
"aria-hidden": !0,
|
|
1167
|
-
className: "mes-dm-agent-system-message__sparkle"
|
|
1205
|
+
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1168
1206
|
}
|
|
1169
1207
|
),
|
|
1170
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text", children:
|
|
1208
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: d })
|
|
1171
1209
|
]
|
|
1172
1210
|
}
|
|
1173
1211
|
),
|
|
1174
|
-
!s && /* @__PURE__ */ e(
|
|
1212
|
+
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1213
|
+
] });
|
|
1214
|
+
}
|
|
1215
|
+
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1216
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Rs[n.type];
|
|
1217
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1218
|
+
/* @__PURE__ */ i(
|
|
1219
|
+
"div",
|
|
1220
|
+
{
|
|
1221
|
+
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1222
|
+
"data-testid": "age-safety-system-message",
|
|
1223
|
+
"data-age-safety-system-type": n.type,
|
|
1224
|
+
children: [
|
|
1225
|
+
/* @__PURE__ */ e(
|
|
1226
|
+
es,
|
|
1227
|
+
{
|
|
1228
|
+
size: 24,
|
|
1229
|
+
weight: "duotone",
|
|
1230
|
+
"aria-hidden": !0,
|
|
1231
|
+
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1232
|
+
"data-testid": "age-safety-system-message-icon"
|
|
1233
|
+
}
|
|
1234
|
+
),
|
|
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) }) })
|
|
1236
|
+
]
|
|
1237
|
+
}
|
|
1238
|
+
),
|
|
1239
|
+
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1175
1240
|
] });
|
|
1176
1241
|
}
|
|
1177
1242
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1180,12 +1245,12 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1180
1245
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1181
1246
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1182
1247
|
] }),
|
|
1183
|
-
!s && /* @__PURE__ */ e(
|
|
1248
|
+
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1184
1249
|
] });
|
|
1185
|
-
},
|
|
1250
|
+
}, Us = () => null, Bs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1186
1251
|
"div",
|
|
1187
1252
|
{
|
|
1188
|
-
className:
|
|
1253
|
+
className: D("flex items-center justify-center h-full", t),
|
|
1189
1254
|
children: [
|
|
1190
1255
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1191
1256
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -1225,31 +1290,31 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1225
1290
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1226
1291
|
]
|
|
1227
1292
|
}
|
|
1228
|
-
),
|
|
1229
|
-
/* @__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" }),
|
|
1230
1295
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1231
1296
|
] }) }));
|
|
1232
|
-
|
|
1233
|
-
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 = ({
|
|
1234
1299
|
onBack: t,
|
|
1235
1300
|
showBackButton: s,
|
|
1236
1301
|
onShowInfo: n,
|
|
1237
1302
|
canShowInfo: o,
|
|
1238
1303
|
showStarButton: l = !1
|
|
1239
1304
|
}) => {
|
|
1240
|
-
var
|
|
1241
|
-
const { channel:
|
|
1305
|
+
var g, p, a, w, _;
|
|
1306
|
+
const { channel: d } = Te(), r = G.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1242
1307
|
(M) => {
|
|
1243
1308
|
var E;
|
|
1244
|
-
return ((E = M.user) == null ? void 0 : E.id) && M.user.id !==
|
|
1309
|
+
return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== d._client.userID;
|
|
1245
1310
|
}
|
|
1246
|
-
), [
|
|
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 () => {
|
|
1247
1312
|
try {
|
|
1248
|
-
h ? await
|
|
1249
|
-
} catch (
|
|
1313
|
+
h ? await d.unpin() : await d.pin();
|
|
1314
|
+
} catch (b) {
|
|
1250
1315
|
console.error(
|
|
1251
1316
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1252
|
-
|
|
1317
|
+
b
|
|
1253
1318
|
);
|
|
1254
1319
|
}
|
|
1255
1320
|
};
|
|
@@ -1258,21 +1323,21 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1258
1323
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1259
1324
|
"button",
|
|
1260
1325
|
{
|
|
1261
|
-
className:
|
|
1326
|
+
className: ce,
|
|
1262
1327
|
onClick: t || (() => {
|
|
1263
1328
|
}),
|
|
1264
1329
|
type: "button",
|
|
1265
1330
|
"aria-label": "Back to conversations",
|
|
1266
|
-
children: /* @__PURE__ */ e(
|
|
1331
|
+
children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
|
|
1267
1332
|
}
|
|
1268
1333
|
) }),
|
|
1269
1334
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1270
1335
|
/* @__PURE__ */ e(
|
|
1271
|
-
|
|
1336
|
+
ae,
|
|
1272
1337
|
{
|
|
1273
|
-
id: ((
|
|
1338
|
+
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || d.id || "unknown",
|
|
1274
1339
|
name: c,
|
|
1275
|
-
image:
|
|
1340
|
+
image: f,
|
|
1276
1341
|
starred: h,
|
|
1277
1342
|
size: 40
|
|
1278
1343
|
}
|
|
@@ -1283,14 +1348,14 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1283
1348
|
l && /* @__PURE__ */ e(
|
|
1284
1349
|
"button",
|
|
1285
1350
|
{
|
|
1286
|
-
className:
|
|
1287
|
-
onClick:
|
|
1351
|
+
className: ce,
|
|
1352
|
+
onClick: x,
|
|
1288
1353
|
type: "button",
|
|
1289
1354
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1290
1355
|
children: /* @__PURE__ */ e(
|
|
1291
|
-
|
|
1356
|
+
Ie,
|
|
1292
1357
|
{
|
|
1293
|
-
className:
|
|
1358
|
+
className: D("size-5", {
|
|
1294
1359
|
"text-yellow-600": h,
|
|
1295
1360
|
"text-black/90": !h
|
|
1296
1361
|
}),
|
|
@@ -1302,11 +1367,11 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1302
1367
|
/* @__PURE__ */ e(
|
|
1303
1368
|
"button",
|
|
1304
1369
|
{
|
|
1305
|
-
className:
|
|
1370
|
+
className: ce,
|
|
1306
1371
|
onClick: n,
|
|
1307
1372
|
type: "button",
|
|
1308
1373
|
"aria-label": "Show info",
|
|
1309
|
-
children: /* @__PURE__ */ e(
|
|
1374
|
+
children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
|
|
1310
1375
|
}
|
|
1311
1376
|
)
|
|
1312
1377
|
] })
|
|
@@ -1318,17 +1383,17 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1318
1383
|
{
|
|
1319
1384
|
type: "button",
|
|
1320
1385
|
onClick: t,
|
|
1321
|
-
className:
|
|
1386
|
+
className: ce,
|
|
1322
1387
|
"aria-label": "Back to conversations",
|
|
1323
|
-
children: /* @__PURE__ */ e(
|
|
1388
|
+
children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
|
|
1324
1389
|
}
|
|
1325
1390
|
),
|
|
1326
1391
|
/* @__PURE__ */ e(
|
|
1327
|
-
|
|
1392
|
+
ae,
|
|
1328
1393
|
{
|
|
1329
|
-
id: ((_ =
|
|
1394
|
+
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) || d.id || "unknown",
|
|
1330
1395
|
name: c,
|
|
1331
|
-
image:
|
|
1396
|
+
image: f,
|
|
1332
1397
|
starred: h,
|
|
1333
1398
|
size: 40
|
|
1334
1399
|
}
|
|
@@ -1339,14 +1404,14 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1339
1404
|
l && /* @__PURE__ */ e(
|
|
1340
1405
|
"button",
|
|
1341
1406
|
{
|
|
1342
|
-
className:
|
|
1343
|
-
onClick:
|
|
1407
|
+
className: ce,
|
|
1408
|
+
onClick: x,
|
|
1344
1409
|
type: "button",
|
|
1345
1410
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1346
1411
|
children: /* @__PURE__ */ e(
|
|
1347
|
-
|
|
1412
|
+
Ie,
|
|
1348
1413
|
{
|
|
1349
|
-
className:
|
|
1414
|
+
className: D("size-5", {
|
|
1350
1415
|
"text-yellow-600": h,
|
|
1351
1416
|
"text-black/90": !h
|
|
1352
1417
|
}),
|
|
@@ -1358,198 +1423,198 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1358
1423
|
o && n && /* @__PURE__ */ e(
|
|
1359
1424
|
"button",
|
|
1360
1425
|
{
|
|
1361
|
-
className:
|
|
1426
|
+
className: ce,
|
|
1362
1427
|
onClick: n,
|
|
1363
1428
|
type: "button",
|
|
1364
1429
|
"aria-label": "Show info",
|
|
1365
|
-
children: /* @__PURE__ */ e(
|
|
1430
|
+
children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
|
|
1366
1431
|
}
|
|
1367
1432
|
)
|
|
1368
1433
|
] })
|
|
1369
1434
|
] })
|
|
1370
1435
|
] });
|
|
1371
|
-
},
|
|
1436
|
+
}, $s = ({
|
|
1372
1437
|
onBack: t,
|
|
1373
1438
|
showBackButton: s,
|
|
1374
1439
|
renderMessageInputActions: n,
|
|
1375
1440
|
renderConversationFooter: o,
|
|
1376
1441
|
onLeaveConversation: l,
|
|
1377
|
-
onBlockParticipant:
|
|
1378
|
-
showDeleteConversation:
|
|
1442
|
+
onBlockParticipant: d,
|
|
1443
|
+
showDeleteConversation: r = !0,
|
|
1379
1444
|
onDeleteConversationClick: c,
|
|
1380
|
-
onBlockParticipantClick:
|
|
1445
|
+
onBlockParticipantClick: f,
|
|
1381
1446
|
onReportParticipantClick: h,
|
|
1382
|
-
showStarButton:
|
|
1383
|
-
chatbotVotingEnabled:
|
|
1384
|
-
renderChannelBanner:
|
|
1385
|
-
customProfileContent:
|
|
1386
|
-
customChannelActions:
|
|
1447
|
+
showStarButton: x = !1,
|
|
1448
|
+
chatbotVotingEnabled: g = !1,
|
|
1449
|
+
renderChannelBanner: p,
|
|
1450
|
+
customProfileContent: a,
|
|
1451
|
+
customChannelActions: w,
|
|
1387
1452
|
renderMessage: _
|
|
1388
1453
|
}) => {
|
|
1389
|
-
const { channel:
|
|
1454
|
+
const { channel: b } = Te(), M = X(null), E = G.useMemo(() => Object.values(b.state.members || {}).find(
|
|
1390
1455
|
(u) => {
|
|
1391
|
-
var
|
|
1392
|
-
return ((
|
|
1456
|
+
var C;
|
|
1457
|
+
return ((C = u.user) == null ? void 0 : C.id) && u.user.id !== b._client.userID;
|
|
1393
1458
|
}
|
|
1394
|
-
), [
|
|
1395
|
-
const
|
|
1396
|
-
if (
|
|
1397
|
-
return String(
|
|
1398
|
-
if (
|
|
1399
|
-
return
|
|
1400
|
-
}, [
|
|
1401
|
-
var
|
|
1402
|
-
(
|
|
1403
|
-
}, []),
|
|
1404
|
-
var
|
|
1405
|
-
(
|
|
1459
|
+
), [b._client.userID, b.state.members]), y = G.useMemo(() => {
|
|
1460
|
+
const m = b.data ?? {};
|
|
1461
|
+
if (m.followerStatus)
|
|
1462
|
+
return String(m.followerStatus);
|
|
1463
|
+
if (m.isFollower !== void 0)
|
|
1464
|
+
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1465
|
+
}, [b.data]), S = A(() => {
|
|
1466
|
+
var m;
|
|
1467
|
+
(m = M.current) == null || m.showModal();
|
|
1468
|
+
}, []), R = A(() => {
|
|
1469
|
+
var m;
|
|
1470
|
+
(m = M.current) == null || m.close();
|
|
1406
1471
|
}, []);
|
|
1407
|
-
return /* @__PURE__ */ i(
|
|
1472
|
+
return /* @__PURE__ */ i(de, { children: [
|
|
1408
1473
|
/* @__PURE__ */ e(
|
|
1409
|
-
|
|
1474
|
+
Yt,
|
|
1410
1475
|
{
|
|
1411
1476
|
overrides: {
|
|
1412
|
-
Message: (
|
|
1413
|
-
const { message: u } =
|
|
1414
|
-
|
|
1477
|
+
Message: (m) => {
|
|
1478
|
+
const { message: u } = ze("ChannelView"), C = /* @__PURE__ */ e(
|
|
1479
|
+
ws,
|
|
1415
1480
|
{
|
|
1416
|
-
...
|
|
1417
|
-
chatbotVotingEnabled:
|
|
1481
|
+
...m,
|
|
1482
|
+
chatbotVotingEnabled: g
|
|
1418
1483
|
}
|
|
1419
1484
|
);
|
|
1420
|
-
return !_ || !u ?
|
|
1485
|
+
return !_ || !u ? C : _(C, u);
|
|
1421
1486
|
}
|
|
1422
1487
|
},
|
|
1423
|
-
children: /* @__PURE__ */ i(
|
|
1488
|
+
children: /* @__PURE__ */ i(Wt, { children: [
|
|
1424
1489
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1425
|
-
|
|
1490
|
+
Gs,
|
|
1426
1491
|
{
|
|
1427
1492
|
onBack: t,
|
|
1428
1493
|
showBackButton: s,
|
|
1429
1494
|
onShowInfo: S,
|
|
1430
1495
|
canShowInfo: !!E,
|
|
1431
|
-
showStarButton:
|
|
1496
|
+
showStarButton: x
|
|
1432
1497
|
}
|
|
1433
1498
|
) }),
|
|
1434
|
-
|
|
1499
|
+
p == null ? void 0 : p(),
|
|
1435
1500
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1436
|
-
|
|
1501
|
+
qt,
|
|
1437
1502
|
{
|
|
1438
1503
|
hideDeletedMessages: !0,
|
|
1439
1504
|
hideNewMessageSeparator: !1,
|
|
1440
1505
|
messageActions: void 0
|
|
1441
1506
|
}
|
|
1442
1507
|
) }),
|
|
1443
|
-
o == null ? void 0 : o(
|
|
1508
|
+
o == null ? void 0 : o(b),
|
|
1444
1509
|
/* @__PURE__ */ e(
|
|
1445
|
-
|
|
1510
|
+
Ms,
|
|
1446
1511
|
{
|
|
1447
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1512
|
+
renderActions: () => n == null ? void 0 : n(b)
|
|
1448
1513
|
}
|
|
1449
1514
|
)
|
|
1450
1515
|
] })
|
|
1451
1516
|
}
|
|
1452
1517
|
),
|
|
1453
1518
|
/* @__PURE__ */ e(
|
|
1454
|
-
|
|
1519
|
+
fs,
|
|
1455
1520
|
{
|
|
1456
1521
|
dialogRef: M,
|
|
1457
|
-
onClose:
|
|
1522
|
+
onClose: R,
|
|
1458
1523
|
participant: E,
|
|
1459
|
-
channel:
|
|
1460
|
-
followerStatusLabel:
|
|
1524
|
+
channel: b,
|
|
1525
|
+
followerStatusLabel: y,
|
|
1461
1526
|
onLeaveConversation: l,
|
|
1462
|
-
onBlockParticipant:
|
|
1463
|
-
showDeleteConversation:
|
|
1527
|
+
onBlockParticipant: d,
|
|
1528
|
+
showDeleteConversation: r,
|
|
1464
1529
|
onDeleteConversationClick: c,
|
|
1465
|
-
onBlockParticipantClick:
|
|
1530
|
+
onBlockParticipantClick: f,
|
|
1466
1531
|
onReportParticipantClick: h,
|
|
1467
|
-
customProfileContent:
|
|
1468
|
-
customChannelActions:
|
|
1532
|
+
customProfileContent: a,
|
|
1533
|
+
customChannelActions: w
|
|
1469
1534
|
}
|
|
1470
1535
|
)
|
|
1471
1536
|
] });
|
|
1472
|
-
},
|
|
1537
|
+
}, Ke = G.memo(
|
|
1473
1538
|
({
|
|
1474
1539
|
channel: t,
|
|
1475
1540
|
onBack: s,
|
|
1476
1541
|
showBackButton: n = !1,
|
|
1477
1542
|
renderMessageInputActions: o,
|
|
1478
1543
|
renderConversationFooter: l,
|
|
1479
|
-
onLeaveConversation:
|
|
1480
|
-
onBlockParticipant:
|
|
1544
|
+
onLeaveConversation: d,
|
|
1545
|
+
onBlockParticipant: r,
|
|
1481
1546
|
className: c,
|
|
1482
|
-
CustomChannelEmptyState:
|
|
1547
|
+
CustomChannelEmptyState: f = Us,
|
|
1483
1548
|
showDeleteConversation: h = !0,
|
|
1484
|
-
onDeleteConversationClick:
|
|
1485
|
-
onBlockParticipantClick:
|
|
1486
|
-
onReportParticipantClick:
|
|
1487
|
-
dmAgentEnabled:
|
|
1488
|
-
messageMetadata:
|
|
1549
|
+
onDeleteConversationClick: x,
|
|
1550
|
+
onBlockParticipantClick: g,
|
|
1551
|
+
onReportParticipantClick: p,
|
|
1552
|
+
dmAgentEnabled: a,
|
|
1553
|
+
messageMetadata: w,
|
|
1489
1554
|
onMessageSent: _,
|
|
1490
|
-
showStarButton:
|
|
1555
|
+
showStarButton: b = !1,
|
|
1491
1556
|
chatbotVotingEnabled: M = !1,
|
|
1492
1557
|
renderChannelBanner: E,
|
|
1493
|
-
customProfileContent:
|
|
1558
|
+
customProfileContent: y,
|
|
1494
1559
|
customChannelActions: S,
|
|
1495
|
-
renderMessage:
|
|
1560
|
+
renderMessage: R
|
|
1496
1561
|
}) => {
|
|
1497
|
-
const
|
|
1498
|
-
async (u,
|
|
1499
|
-
var
|
|
1500
|
-
const
|
|
1501
|
-
...
|
|
1502
|
-
...
|
|
1503
|
-
...
|
|
1562
|
+
const m = A(
|
|
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 },
|
|
1568
|
+
...w && {
|
|
1504
1569
|
metadata: {
|
|
1505
|
-
...
|
|
1506
|
-
...
|
|
1570
|
+
...C.metadata ?? {},
|
|
1571
|
+
...w
|
|
1507
1572
|
}
|
|
1508
1573
|
}
|
|
1509
|
-
},
|
|
1510
|
-
...
|
|
1511
|
-
...
|
|
1512
|
-
}, Y = await t.sendMessage(
|
|
1574
|
+
}, Q = {
|
|
1575
|
+
...T,
|
|
1576
|
+
...N && { skip_push: !0 }
|
|
1577
|
+
}, Y = await t.sendMessage(F, Q);
|
|
1513
1578
|
return _ == null || _(Y), Y;
|
|
1514
1579
|
},
|
|
1515
|
-
[t,
|
|
1580
|
+
[t, a, w, _]
|
|
1516
1581
|
);
|
|
1517
1582
|
return /* @__PURE__ */ e(
|
|
1518
1583
|
"div",
|
|
1519
1584
|
{
|
|
1520
|
-
className:
|
|
1585
|
+
className: D(
|
|
1521
1586
|
"messaging-channel-view h-full flex flex-col",
|
|
1522
1587
|
c
|
|
1523
1588
|
),
|
|
1524
1589
|
children: /* @__PURE__ */ e(
|
|
1525
|
-
|
|
1590
|
+
Vt,
|
|
1526
1591
|
{
|
|
1527
1592
|
channel: t,
|
|
1528
|
-
MessageSystem:
|
|
1529
|
-
EmptyStateIndicator:
|
|
1530
|
-
LoadingIndicator:
|
|
1531
|
-
DateSeparator:
|
|
1532
|
-
doSendMessageRequest:
|
|
1593
|
+
MessageSystem: Os,
|
|
1594
|
+
EmptyStateIndicator: f,
|
|
1595
|
+
LoadingIndicator: Ce,
|
|
1596
|
+
DateSeparator: gs,
|
|
1597
|
+
doSendMessageRequest: m,
|
|
1533
1598
|
children: /* @__PURE__ */ e(
|
|
1534
|
-
|
|
1599
|
+
$s,
|
|
1535
1600
|
{
|
|
1536
1601
|
onBack: s,
|
|
1537
1602
|
showBackButton: n,
|
|
1538
1603
|
renderMessageInputActions: o,
|
|
1539
1604
|
renderConversationFooter: l,
|
|
1540
|
-
onLeaveConversation:
|
|
1541
|
-
onBlockParticipant:
|
|
1542
|
-
CustomChannelEmptyState:
|
|
1605
|
+
onLeaveConversation: d,
|
|
1606
|
+
onBlockParticipant: r,
|
|
1607
|
+
CustomChannelEmptyState: f,
|
|
1543
1608
|
showDeleteConversation: h,
|
|
1544
|
-
onDeleteConversationClick:
|
|
1545
|
-
onBlockParticipantClick:
|
|
1546
|
-
onReportParticipantClick:
|
|
1547
|
-
showStarButton:
|
|
1609
|
+
onDeleteConversationClick: x,
|
|
1610
|
+
onBlockParticipantClick: g,
|
|
1611
|
+
onReportParticipantClick: p,
|
|
1612
|
+
showStarButton: b,
|
|
1548
1613
|
chatbotVotingEnabled: M,
|
|
1549
1614
|
renderChannelBanner: E,
|
|
1550
|
-
customProfileContent:
|
|
1615
|
+
customProfileContent: y,
|
|
1551
1616
|
customChannelActions: S,
|
|
1552
|
-
renderMessage:
|
|
1617
|
+
renderMessage: R
|
|
1553
1618
|
}
|
|
1554
1619
|
)
|
|
1555
1620
|
}
|
|
@@ -1558,16 +1623,16 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1558
1623
|
);
|
|
1559
1624
|
}
|
|
1560
1625
|
);
|
|
1561
|
-
|
|
1562
|
-
function
|
|
1626
|
+
Ke.displayName = "ChannelView";
|
|
1627
|
+
function js({
|
|
1563
1628
|
searchQuery: t,
|
|
1564
1629
|
setSearchQuery: s,
|
|
1565
1630
|
placeholder: n
|
|
1566
1631
|
}) {
|
|
1567
|
-
const o =
|
|
1632
|
+
const o = X(null);
|
|
1568
1633
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1569
1634
|
/* @__PURE__ */ e(
|
|
1570
|
-
|
|
1635
|
+
ts,
|
|
1571
1636
|
{
|
|
1572
1637
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1573
1638
|
weight: "bold"
|
|
@@ -1585,7 +1650,7 @@ function Ps({
|
|
|
1585
1650
|
}
|
|
1586
1651
|
),
|
|
1587
1652
|
t && /* @__PURE__ */ e(
|
|
1588
|
-
|
|
1653
|
+
Je,
|
|
1589
1654
|
{
|
|
1590
1655
|
label: "Clear search",
|
|
1591
1656
|
onClick: () => {
|
|
@@ -1593,24 +1658,24 @@ function Ps({
|
|
|
1593
1658
|
s(""), (l = o.current) == null || l.focus();
|
|
1594
1659
|
},
|
|
1595
1660
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1596
|
-
children: /* @__PURE__ */ e(
|
|
1661
|
+
children: /* @__PURE__ */ e(De, { className: "h-4 w-4", weight: "bold" })
|
|
1597
1662
|
}
|
|
1598
1663
|
)
|
|
1599
1664
|
] });
|
|
1600
1665
|
}
|
|
1601
|
-
const
|
|
1666
|
+
const zs = ({
|
|
1602
1667
|
participantSource: t,
|
|
1603
1668
|
onSelectParticipant: s,
|
|
1604
1669
|
onClose: n,
|
|
1605
1670
|
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1606
1671
|
participantLabel: l = "participants",
|
|
1607
|
-
searchPlaceholder:
|
|
1608
|
-
className:
|
|
1672
|
+
searchPlaceholder: d = "Search participants...",
|
|
1673
|
+
className: r
|
|
1609
1674
|
}) => {
|
|
1610
|
-
const { debug: c } =
|
|
1675
|
+
const { debug: c } = Ne(), [f, h] = k(""), [x, g] = k([]), [p, a] = k(!1), [w, _] = k(null), [b, M] = k(
|
|
1611
1676
|
null
|
|
1612
|
-
), E =
|
|
1613
|
-
|
|
1677
|
+
), E = X(!1);
|
|
1678
|
+
K(() => {
|
|
1614
1679
|
if (t.loading) {
|
|
1615
1680
|
c && console.log(
|
|
1616
1681
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
@@ -1619,123 +1684,123 @@ const Us = ({
|
|
|
1619
1684
|
}
|
|
1620
1685
|
if (E.current) return;
|
|
1621
1686
|
(async () => {
|
|
1622
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1687
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), _(null);
|
|
1623
1688
|
try {
|
|
1624
1689
|
const u = await t.loadParticipants({
|
|
1625
1690
|
search: "",
|
|
1626
1691
|
// Load all participants initially
|
|
1627
1692
|
limit: 100
|
|
1628
1693
|
});
|
|
1629
|
-
|
|
1694
|
+
g(u.participants), E.current = !0, c && console.log(
|
|
1630
1695
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1631
1696
|
u.participants.length
|
|
1632
1697
|
);
|
|
1633
1698
|
} catch (u) {
|
|
1634
|
-
const
|
|
1635
|
-
_(
|
|
1699
|
+
const C = u instanceof Error ? u.message : "Failed to load participants";
|
|
1700
|
+
_(C), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1636
1701
|
} finally {
|
|
1637
|
-
|
|
1702
|
+
a(!1);
|
|
1638
1703
|
}
|
|
1639
1704
|
})();
|
|
1640
1705
|
}, [t.loading, c]);
|
|
1641
|
-
const
|
|
1642
|
-
var
|
|
1643
|
-
if (!
|
|
1644
|
-
const u =
|
|
1645
|
-
return
|
|
1646
|
-
}), S =
|
|
1647
|
-
async (
|
|
1648
|
-
if (!
|
|
1649
|
-
M(
|
|
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;
|
|
1711
|
+
}), S = A(
|
|
1712
|
+
async (m) => {
|
|
1713
|
+
if (!b) {
|
|
1714
|
+
M(m.id);
|
|
1650
1715
|
try {
|
|
1651
|
-
await s(
|
|
1716
|
+
await s(m);
|
|
1652
1717
|
} catch (u) {
|
|
1653
1718
|
console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
|
|
1654
1719
|
}
|
|
1655
1720
|
}
|
|
1656
1721
|
},
|
|
1657
|
-
[s,
|
|
1658
|
-
),
|
|
1659
|
-
(
|
|
1722
|
+
[s, b]
|
|
1723
|
+
), R = (m, u) => {
|
|
1724
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), S(u));
|
|
1660
1725
|
};
|
|
1661
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1726
|
+
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
|
|
1662
1727
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1663
1728
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1664
1729
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1665
|
-
/* @__PURE__ */ e(
|
|
1730
|
+
/* @__PURE__ */ e(Xe, { onClick: n })
|
|
1666
1731
|
] }),
|
|
1667
1732
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1668
1733
|
"Select a ",
|
|
1669
1734
|
l.slice(0, -1),
|
|
1670
1735
|
" to start messaging (",
|
|
1671
|
-
|
|
1736
|
+
y.length,
|
|
1672
1737
|
" available)",
|
|
1673
1738
|
t.totalCount !== void 0 && ` โข ${t.totalCount} ${l} total`
|
|
1674
1739
|
] }),
|
|
1675
1740
|
/* @__PURE__ */ e(
|
|
1676
|
-
|
|
1741
|
+
js,
|
|
1677
1742
|
{
|
|
1678
|
-
searchQuery:
|
|
1743
|
+
searchQuery: f,
|
|
1679
1744
|
setSearchQuery: h,
|
|
1680
|
-
placeholder:
|
|
1745
|
+
placeholder: d
|
|
1681
1746
|
}
|
|
1682
1747
|
)
|
|
1683
1748
|
] }),
|
|
1684
|
-
|
|
1749
|
+
w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1685
1750
|
"Error loading ",
|
|
1686
1751
|
l,
|
|
1687
1752
|
": ",
|
|
1688
|
-
|
|
1753
|
+
w
|
|
1689
1754
|
] }),
|
|
1690
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1755
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: p && 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: [
|
|
1691
1756
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1692
1757
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1693
1758
|
"Loading ",
|
|
1694
1759
|
l,
|
|
1695
1760
|
"..."
|
|
1696
1761
|
] })
|
|
1697
|
-
] }) }) :
|
|
1698
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1699
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1700
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1762
|
+
] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", 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` })
|
|
1701
1766
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1702
|
-
|
|
1703
|
-
const u =
|
|
1767
|
+
y.map((m) => {
|
|
1768
|
+
const u = m.name || m.email || m.id, C = m.email && m.name ? m.email : m.phone;
|
|
1704
1769
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1705
1770
|
"button",
|
|
1706
1771
|
{
|
|
1707
1772
|
type: "button",
|
|
1708
|
-
onClick: () => S(
|
|
1709
|
-
onKeyDown: (
|
|
1773
|
+
onClick: () => S(m),
|
|
1774
|
+
onKeyDown: (T) => R(T, m),
|
|
1710
1775
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1711
1776
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1712
1777
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1713
1778
|
/* @__PURE__ */ e(
|
|
1714
|
-
|
|
1779
|
+
ae,
|
|
1715
1780
|
{
|
|
1716
|
-
id:
|
|
1781
|
+
id: m.id,
|
|
1717
1782
|
name: u,
|
|
1718
|
-
image:
|
|
1783
|
+
image: m.image,
|
|
1719
1784
|
size: 40
|
|
1720
1785
|
}
|
|
1721
1786
|
),
|
|
1722
1787
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1723
1788
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
|
|
1724
|
-
|
|
1789
|
+
C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
|
|
1725
1790
|
] })
|
|
1726
1791
|
] }),
|
|
1727
|
-
/* @__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" }) })
|
|
1728
1793
|
] })
|
|
1729
1794
|
}
|
|
1730
|
-
) },
|
|
1795
|
+
) }, m.id);
|
|
1731
1796
|
}),
|
|
1732
|
-
|
|
1797
|
+
p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1733
1798
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1734
1799
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1735
1800
|
] }) })
|
|
1736
1801
|
] }) })
|
|
1737
1802
|
] });
|
|
1738
|
-
},
|
|
1803
|
+
}, Hs = ({ className: t }) => /* @__PURE__ */ i(
|
|
1739
1804
|
"svg",
|
|
1740
1805
|
{
|
|
1741
1806
|
width: "140",
|
|
@@ -1869,9 +1934,9 @@ const Us = ({
|
|
|
1869
1934
|
] })
|
|
1870
1935
|
]
|
|
1871
1936
|
}
|
|
1872
|
-
), Qe =
|
|
1937
|
+
), Qe = G.memo(
|
|
1873
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: [
|
|
1874
|
-
/* @__PURE__ */ e(
|
|
1939
|
+
/* @__PURE__ */ e(Hs, {}),
|
|
1875
1940
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1876
1941
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1877
1942
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
@@ -1879,7 +1944,7 @@ const Us = ({
|
|
|
1879
1944
|
] }) })
|
|
1880
1945
|
);
|
|
1881
1946
|
Qe.displayName = "EmptyState";
|
|
1882
|
-
const
|
|
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: [
|
|
1883
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: "โ ๏ธ" }) }),
|
|
1884
1949
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1885
1950
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1893,48 +1958,49 @@ const Ce = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1893
1958
|
}
|
|
1894
1959
|
)
|
|
1895
1960
|
] }) }));
|
|
1896
|
-
|
|
1897
|
-
const
|
|
1961
|
+
be.displayName = "ErrorState";
|
|
1962
|
+
const en = ({
|
|
1898
1963
|
capabilities: t = {},
|
|
1899
1964
|
className: s,
|
|
1900
1965
|
renderMessageInputActions: n,
|
|
1901
1966
|
renderConversationFooter: o,
|
|
1902
1967
|
onChannelSelect: l,
|
|
1903
|
-
onParticipantSelect:
|
|
1904
|
-
initialParticipantFilter:
|
|
1968
|
+
onParticipantSelect: d,
|
|
1969
|
+
initialParticipantFilter: r,
|
|
1905
1970
|
initialParticipantData: c,
|
|
1906
|
-
CustomChannelEmptyState:
|
|
1971
|
+
CustomChannelEmptyState: f,
|
|
1907
1972
|
showChannelList: h = !0,
|
|
1908
|
-
filters:
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
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
|
|
1923
1989
|
}) => {
|
|
1924
1990
|
const {
|
|
1925
1991
|
service: v,
|
|
1926
|
-
client:
|
|
1927
|
-
isConnected:
|
|
1928
|
-
isLoading:
|
|
1929
|
-
error:
|
|
1930
|
-
refreshConnection:
|
|
1931
|
-
debug:
|
|
1932
|
-
} =
|
|
1933
|
-
participantSource:
|
|
1934
|
-
participantLabel:
|
|
1935
|
-
showDeleteConversation:
|
|
1936
|
-
} = t,
|
|
1937
|
-
const I =
|
|
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), {
|
|
1999
|
+
participantSource: me,
|
|
2000
|
+
participantLabel: Le = "participants",
|
|
2001
|
+
showDeleteConversation: et = !0
|
|
2002
|
+
} = t, tt = G.useMemo(() => {
|
|
2003
|
+
const I = N == null ? void 0 : N.userID;
|
|
1938
2004
|
return {
|
|
1939
2005
|
...{
|
|
1940
2006
|
type: "messaging",
|
|
@@ -1944,66 +2010,66 @@ const Ws = ({
|
|
|
1944
2010
|
hidden: !1
|
|
1945
2011
|
}
|
|
1946
2012
|
},
|
|
1947
|
-
...
|
|
2013
|
+
...x
|
|
1948
2014
|
};
|
|
1949
|
-
}, [
|
|
1950
|
-
if (!
|
|
1951
|
-
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;
|
|
1952
2018
|
if (I)
|
|
1953
2019
|
try {
|
|
1954
|
-
|
|
1955
|
-
const V = await
|
|
2020
|
+
L && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
2021
|
+
const V = await N.queryChannels(
|
|
1956
2022
|
{
|
|
1957
2023
|
type: "messaging",
|
|
1958
2024
|
members: { $in: [I] }
|
|
1959
2025
|
},
|
|
1960
2026
|
{},
|
|
1961
2027
|
{ limit: 100 }
|
|
1962
|
-
),
|
|
2028
|
+
), U = /* @__PURE__ */ new Set();
|
|
1963
2029
|
V.forEach(($) => {
|
|
1964
|
-
const
|
|
1965
|
-
Object.values(
|
|
1966
|
-
var
|
|
1967
|
-
const
|
|
1968
|
-
|
|
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);
|
|
1969
2035
|
});
|
|
1970
|
-
}),
|
|
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:", {
|
|
1971
2037
|
channelCount: V.length,
|
|
1972
|
-
memberCount:
|
|
2038
|
+
memberCount: U.size
|
|
1973
2039
|
});
|
|
1974
2040
|
} catch (V) {
|
|
1975
2041
|
console.error("[MessagingShell] Failed to sync channels:", V);
|
|
1976
2042
|
}
|
|
1977
|
-
}, [
|
|
1978
|
-
|
|
1979
|
-
if (!
|
|
1980
|
-
const I =
|
|
1981
|
-
I &&
|
|
1982
|
-
}, [
|
|
1983
|
-
if (!
|
|
2043
|
+
}, [N, F, L]);
|
|
2044
|
+
K(() => {
|
|
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;
|
|
1984
2050
|
(async () => {
|
|
1985
|
-
const V =
|
|
2051
|
+
const V = N.userID;
|
|
1986
2052
|
if (V)
|
|
1987
2053
|
try {
|
|
1988
|
-
|
|
2054
|
+
L && console.log(
|
|
1989
2055
|
"[MessagingShell] Loading initial conversation with:",
|
|
1990
|
-
|
|
2056
|
+
r
|
|
1991
2057
|
);
|
|
1992
|
-
const
|
|
2058
|
+
const U = await N.queryChannels(
|
|
1993
2059
|
{
|
|
1994
2060
|
type: "messaging",
|
|
1995
|
-
members: { $eq: [V,
|
|
2061
|
+
members: { $eq: [V, r] }
|
|
1996
2062
|
},
|
|
1997
2063
|
{},
|
|
1998
2064
|
{ limit: 1 }
|
|
1999
2065
|
);
|
|
2000
|
-
if (
|
|
2001
|
-
j(
|
|
2066
|
+
if (U.length > 0)
|
|
2067
|
+
j(U[0]), J(!0), ee(null), l && l(U[0]), L && console.log(
|
|
2002
2068
|
"[MessagingShell] Initial conversation loaded:",
|
|
2003
|
-
|
|
2069
|
+
U[0].id
|
|
2004
2070
|
);
|
|
2005
2071
|
else if (c && v) {
|
|
2006
|
-
|
|
2072
|
+
L && console.log(
|
|
2007
2073
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2008
2074
|
c
|
|
2009
2075
|
);
|
|
@@ -2014,7 +2080,7 @@ const Ws = ({
|
|
|
2014
2080
|
email: c.email,
|
|
2015
2081
|
phone: c.phone
|
|
2016
2082
|
});
|
|
2017
|
-
j($),
|
|
2083
|
+
j($), J(!0), ee(null), l && l($), L && console.log(
|
|
2018
2084
|
"[MessagingShell] Channel created and loaded:",
|
|
2019
2085
|
$.id
|
|
2020
2086
|
);
|
|
@@ -2022,93 +2088,93 @@ const Ws = ({
|
|
|
2022
2088
|
console.error(
|
|
2023
2089
|
"[MessagingShell] Failed to create conversation:",
|
|
2024
2090
|
$
|
|
2025
|
-
),
|
|
2091
|
+
), ee("Failed to create conversation");
|
|
2026
2092
|
}
|
|
2027
2093
|
} else
|
|
2028
|
-
|
|
2094
|
+
ee(
|
|
2029
2095
|
"No conversation found with this account"
|
|
2030
|
-
),
|
|
2096
|
+
), L && console.log(
|
|
2031
2097
|
"[MessagingShell] No conversation found for:",
|
|
2032
|
-
|
|
2098
|
+
r
|
|
2033
2099
|
);
|
|
2034
|
-
} catch (
|
|
2100
|
+
} catch (U) {
|
|
2035
2101
|
console.error(
|
|
2036
2102
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2037
|
-
|
|
2038
|
-
),
|
|
2103
|
+
U
|
|
2104
|
+
), ee("Failed to load conversation");
|
|
2039
2105
|
}
|
|
2040
2106
|
})();
|
|
2041
2107
|
}, [
|
|
2042
|
-
|
|
2108
|
+
r,
|
|
2043
2109
|
c,
|
|
2044
|
-
|
|
2045
|
-
|
|
2110
|
+
N,
|
|
2111
|
+
F,
|
|
2046
2112
|
v,
|
|
2047
|
-
|
|
2113
|
+
L,
|
|
2048
2114
|
l
|
|
2049
2115
|
]);
|
|
2050
|
-
const
|
|
2116
|
+
const st = A(
|
|
2051
2117
|
(I) => {
|
|
2052
2118
|
j(I), l == null || l(I);
|
|
2053
2119
|
},
|
|
2054
2120
|
[l]
|
|
2055
|
-
),
|
|
2121
|
+
), nt = A(() => {
|
|
2056
2122
|
q || j(null);
|
|
2057
|
-
}, [q]),
|
|
2123
|
+
}, [q]), at = A(
|
|
2058
2124
|
async (I) => {
|
|
2059
2125
|
var V;
|
|
2060
2126
|
if (v)
|
|
2061
2127
|
try {
|
|
2062
|
-
|
|
2128
|
+
L && console.log(
|
|
2063
2129
|
"[MessagingShell] Starting conversation with:",
|
|
2064
2130
|
I.id
|
|
2065
2131
|
);
|
|
2066
|
-
const
|
|
2132
|
+
const U = await v.startChannelWithParticipant({
|
|
2067
2133
|
id: I.id,
|
|
2068
2134
|
name: I.name,
|
|
2069
2135
|
email: I.email,
|
|
2070
2136
|
phone: I.phone
|
|
2071
2137
|
});
|
|
2072
2138
|
try {
|
|
2073
|
-
await
|
|
2139
|
+
await U.show();
|
|
2074
2140
|
} catch ($) {
|
|
2075
2141
|
console.warn("[MessagingShell] Failed to unhide channel:", $);
|
|
2076
2142
|
}
|
|
2077
|
-
j(
|
|
2078
|
-
} catch (
|
|
2079
|
-
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);
|
|
2080
2146
|
}
|
|
2081
2147
|
},
|
|
2082
|
-
[v,
|
|
2083
|
-
),
|
|
2148
|
+
[v, d, L]
|
|
2149
|
+
), he = A(() => {
|
|
2084
2150
|
var I;
|
|
2085
|
-
|
|
2086
|
-
}, []),
|
|
2151
|
+
P(!1), (I = ne.current) == null || I.close();
|
|
2152
|
+
}, []), rt = A(
|
|
2087
2153
|
(I) => {
|
|
2088
|
-
I.target ===
|
|
2154
|
+
I.target === ne.current && he();
|
|
2089
2155
|
},
|
|
2090
|
-
[
|
|
2091
|
-
),
|
|
2156
|
+
[he]
|
|
2157
|
+
), ot = A(
|
|
2092
2158
|
async (I) => {
|
|
2093
|
-
|
|
2159
|
+
L && console.log("[MessagingShell] Leaving conversation:", I.id), j(null), J(!1), ue.current = null, await ie();
|
|
2094
2160
|
},
|
|
2095
|
-
[
|
|
2096
|
-
),
|
|
2161
|
+
[ie, L]
|
|
2162
|
+
), lt = A(
|
|
2097
2163
|
async (I) => {
|
|
2098
|
-
|
|
2164
|
+
L && console.log("[MessagingShell] Blocking participant:", I), j(null), J(!1), ue.current = null, await ie();
|
|
2099
2165
|
},
|
|
2100
|
-
[
|
|
2101
|
-
),
|
|
2102
|
-
return
|
|
2103
|
-
|
|
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,
|
|
2104
2170
|
{
|
|
2105
2171
|
message: "Not connected to messaging service",
|
|
2106
|
-
onBack:
|
|
2172
|
+
onBack: Z
|
|
2107
2173
|
}
|
|
2108
|
-
) }) :
|
|
2174
|
+
) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(be, { message: le }) }) : /* @__PURE__ */ i(
|
|
2109
2175
|
"div",
|
|
2110
2176
|
{
|
|
2111
|
-
className:
|
|
2177
|
+
className: D(
|
|
2112
2178
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2113
2179
|
s
|
|
2114
2180
|
),
|
|
@@ -2117,24 +2183,25 @@ const Ws = ({
|
|
|
2117
2183
|
/* @__PURE__ */ e(
|
|
2118
2184
|
"div",
|
|
2119
2185
|
{
|
|
2120
|
-
className:
|
|
2186
|
+
className: D(
|
|
2121
2187
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2122
2188
|
{
|
|
2123
2189
|
"!hidden": h === !1 || q,
|
|
2124
2190
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2125
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q &&
|
|
2191
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && fe,
|
|
2126
2192
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2127
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !
|
|
2193
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !fe
|
|
2128
2194
|
}
|
|
2129
2195
|
),
|
|
2130
2196
|
children: /* @__PURE__ */ e(
|
|
2131
|
-
|
|
2197
|
+
Ze,
|
|
2132
2198
|
{
|
|
2133
|
-
onChannelSelect:
|
|
2199
|
+
onChannelSelect: st,
|
|
2134
2200
|
selectedChannel: W || void 0,
|
|
2135
|
-
filters:
|
|
2136
|
-
|
|
2137
|
-
|
|
2201
|
+
filters: tt,
|
|
2202
|
+
channelRenderFilterFn: g,
|
|
2203
|
+
customEmptyStateIndicator: p,
|
|
2204
|
+
renderMessagePreview: R
|
|
2138
2205
|
}
|
|
2139
2206
|
)
|
|
2140
2207
|
}
|
|
@@ -2142,80 +2209,80 @@ const Ws = ({
|
|
|
2142
2209
|
/* @__PURE__ */ e(
|
|
2143
2210
|
"div",
|
|
2144
2211
|
{
|
|
2145
|
-
className:
|
|
2212
|
+
className: D(
|
|
2146
2213
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2147
2214
|
{
|
|
2148
2215
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2149
|
-
flex: q ||
|
|
2216
|
+
flex: q || fe || r,
|
|
2150
2217
|
// Normal mode: hide on mobile when no channel selected
|
|
2151
|
-
"hidden lg:flex": !q && !
|
|
2218
|
+
"hidden lg:flex": !q && !fe && !r
|
|
2152
2219
|
}
|
|
2153
2220
|
),
|
|
2154
2221
|
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2155
|
-
|
|
2222
|
+
Ke,
|
|
2156
2223
|
{
|
|
2157
2224
|
channel: W,
|
|
2158
|
-
onBack:
|
|
2225
|
+
onBack: nt,
|
|
2159
2226
|
showBackButton: !q,
|
|
2160
2227
|
renderMessageInputActions: n,
|
|
2161
2228
|
renderConversationFooter: o,
|
|
2162
|
-
renderChannelBanner:
|
|
2163
|
-
onLeaveConversation:
|
|
2164
|
-
onBlockParticipant:
|
|
2165
|
-
CustomChannelEmptyState:
|
|
2166
|
-
showDeleteConversation:
|
|
2167
|
-
onDeleteConversationClick:
|
|
2168
|
-
onBlockParticipantClick:
|
|
2169
|
-
onReportParticipantClick:
|
|
2170
|
-
dmAgentEnabled:
|
|
2171
|
-
messageMetadata:
|
|
2172
|
-
onMessageSent:
|
|
2173
|
-
showStarButton:
|
|
2174
|
-
chatbotVotingEnabled:
|
|
2175
|
-
customProfileContent:
|
|
2176
|
-
customChannelActions:
|
|
2177
|
-
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
|
|
2178
2245
|
},
|
|
2179
2246
|
W.id
|
|
2180
|
-
) }) :
|
|
2247
|
+
) }) : r ? (
|
|
2181
2248
|
// Show loading while creating/loading direct conversation channel
|
|
2182
|
-
/* @__PURE__ */ e(
|
|
2249
|
+
/* @__PURE__ */ e(Ce, {})
|
|
2183
2250
|
) : /* @__PURE__ */ e(
|
|
2184
2251
|
Qe,
|
|
2185
2252
|
{
|
|
2186
|
-
hasChannels:
|
|
2187
|
-
channelsLoaded:
|
|
2253
|
+
hasChannels: re,
|
|
2254
|
+
channelsLoaded: te
|
|
2188
2255
|
}
|
|
2189
2256
|
)
|
|
2190
2257
|
}
|
|
2191
2258
|
)
|
|
2192
2259
|
] }),
|
|
2193
|
-
|
|
2260
|
+
me && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2194
2261
|
/* @__PURE__ */ e(
|
|
2195
2262
|
"dialog",
|
|
2196
2263
|
{
|
|
2197
|
-
ref:
|
|
2264
|
+
ref: ne,
|
|
2198
2265
|
className: "mes-dialog",
|
|
2199
|
-
onClick:
|
|
2200
|
-
onClose:
|
|
2266
|
+
onClick: rt,
|
|
2267
|
+
onClose: he,
|
|
2201
2268
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2202
|
-
|
|
2269
|
+
zs,
|
|
2203
2270
|
{
|
|
2204
|
-
participantSource:
|
|
2205
|
-
onSelectParticipant:
|
|
2206
|
-
onClose:
|
|
2207
|
-
existingParticipantIds:
|
|
2208
|
-
participantLabel:
|
|
2209
|
-
searchPlaceholder: `Search ${
|
|
2271
|
+
participantSource: me,
|
|
2272
|
+
onSelectParticipant: at,
|
|
2273
|
+
onClose: he,
|
|
2274
|
+
existingParticipantIds: B,
|
|
2275
|
+
participantLabel: Le,
|
|
2276
|
+
searchPlaceholder: `Search ${Le}...`
|
|
2210
2277
|
},
|
|
2211
|
-
|
|
2278
|
+
oe
|
|
2212
2279
|
) })
|
|
2213
2280
|
}
|
|
2214
2281
|
)
|
|
2215
2282
|
]
|
|
2216
2283
|
}
|
|
2217
2284
|
);
|
|
2218
|
-
},
|
|
2285
|
+
}, Vs = ({
|
|
2219
2286
|
question: t,
|
|
2220
2287
|
onClick: s,
|
|
2221
2288
|
loading: n = !1,
|
|
@@ -2227,7 +2294,7 @@ const Ws = ({
|
|
|
2227
2294
|
onClick: s,
|
|
2228
2295
|
disabled: n,
|
|
2229
2296
|
style: { backgroundColor: "#E6E5E3" },
|
|
2230
|
-
className:
|
|
2297
|
+
className: D(
|
|
2231
2298
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2232
2299
|
{
|
|
2233
2300
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2237,23 +2304,23 @@ const Ws = ({
|
|
|
2237
2304
|
),
|
|
2238
2305
|
children: t
|
|
2239
2306
|
}
|
|
2240
|
-
),
|
|
2307
|
+
), tn = ({
|
|
2241
2308
|
faqs: t,
|
|
2242
2309
|
onFaqClick: s,
|
|
2243
2310
|
loadingFaqId: n,
|
|
2244
2311
|
headerText: o,
|
|
2245
2312
|
className: l,
|
|
2246
|
-
avatarImage:
|
|
2247
|
-
avatarName:
|
|
2313
|
+
avatarImage: d,
|
|
2314
|
+
avatarName: r
|
|
2248
2315
|
}) => {
|
|
2249
|
-
const c = t.filter((
|
|
2316
|
+
const c = t.filter((f) => f.enabled).sort((f, h) => (f.order ?? 0) - (h.order ?? 0));
|
|
2250
2317
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2251
|
-
(
|
|
2252
|
-
|
|
2318
|
+
(d || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2319
|
+
ae,
|
|
2253
2320
|
{
|
|
2254
|
-
id:
|
|
2255
|
-
name:
|
|
2256
|
-
image:
|
|
2321
|
+
id: r || "account",
|
|
2322
|
+
name: r || "Account",
|
|
2323
|
+
image: d,
|
|
2257
2324
|
size: 24,
|
|
2258
2325
|
shape: "circle"
|
|
2259
2326
|
}
|
|
@@ -2265,75 +2332,75 @@ const Ws = ({
|
|
|
2265
2332
|
style: { backgroundColor: "#F1F0EE" },
|
|
2266
2333
|
children: [
|
|
2267
2334
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2268
|
-
c.map((
|
|
2269
|
-
|
|
2335
|
+
c.map((f) => /* @__PURE__ */ e(
|
|
2336
|
+
Vs,
|
|
2270
2337
|
{
|
|
2271
|
-
question:
|
|
2272
|
-
onClick: () => s(
|
|
2273
|
-
loading: n ===
|
|
2338
|
+
question: f.question,
|
|
2339
|
+
onClick: () => s(f.id),
|
|
2340
|
+
loading: n === f.id
|
|
2274
2341
|
},
|
|
2275
|
-
|
|
2342
|
+
f.id
|
|
2276
2343
|
))
|
|
2277
2344
|
]
|
|
2278
2345
|
}
|
|
2279
2346
|
)
|
|
2280
2347
|
] }) });
|
|
2281
|
-
},
|
|
2282
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l,
|
|
2283
|
-
if (
|
|
2284
|
-
const
|
|
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;
|
|
2285
2352
|
c(!0), h(null);
|
|
2286
2353
|
try {
|
|
2287
2354
|
const u = await t.loadParticipants({
|
|
2288
|
-
search:
|
|
2355
|
+
search: m || void 0,
|
|
2289
2356
|
limit: o,
|
|
2290
|
-
cursor: S ? void 0 :
|
|
2357
|
+
cursor: S ? void 0 : w
|
|
2291
2358
|
});
|
|
2292
|
-
|
|
2293
|
-
(
|
|
2294
|
-
),
|
|
2359
|
+
d(
|
|
2360
|
+
(C) => S ? u.participants : [...C, ...u.participants]
|
|
2361
|
+
), a(u.hasMore), _(u.nextCursor);
|
|
2295
2362
|
} catch (u) {
|
|
2296
|
-
const
|
|
2297
|
-
h(
|
|
2363
|
+
const C = u instanceof Error ? u.message : "Failed to load participants";
|
|
2364
|
+
h(C), console.error("[useParticipants] Load error:", u);
|
|
2298
2365
|
} finally {
|
|
2299
2366
|
c(!1);
|
|
2300
2367
|
}
|
|
2301
|
-
}, [t,
|
|
2302
|
-
|
|
2303
|
-
}, [
|
|
2304
|
-
|
|
2305
|
-
}, [
|
|
2306
|
-
_(void 0),
|
|
2307
|
-
}, [
|
|
2308
|
-
return
|
|
2309
|
-
|
|
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]);
|
|
2375
|
+
return K(() => {
|
|
2376
|
+
b(!0);
|
|
2310
2377
|
}, [t.loadParticipants]), {
|
|
2311
2378
|
participants: l,
|
|
2312
|
-
loading:
|
|
2313
|
-
error:
|
|
2314
|
-
searchQuery:
|
|
2315
|
-
hasMore:
|
|
2379
|
+
loading: r,
|
|
2380
|
+
error: f,
|
|
2381
|
+
searchQuery: x,
|
|
2382
|
+
hasMore: p,
|
|
2316
2383
|
totalCount: t.totalCount,
|
|
2317
2384
|
loadMore: M,
|
|
2318
2385
|
search: E,
|
|
2319
|
-
refresh:
|
|
2386
|
+
refresh: y
|
|
2320
2387
|
};
|
|
2321
2388
|
};
|
|
2322
2389
|
export {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
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
|
|
2338
2405
|
};
|
|
2339
2406
|
//# sourceMappingURL=index.js.map
|