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