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