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