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