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