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