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