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