@linktr.ee/messaging-react 1.28.1 → 1.29.0-rc-1776325810
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +395 -381
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/index.test.tsx +14 -4
- package/src/components/ChannelList/index.tsx +17 -1
- package/src/components/ChannelView.tsx +5 -6
- package/src/hooks/useRestorePendingMessages.test.ts +104 -0
- package/src/hooks/useRestorePendingMessages.ts +19 -0
package/dist/index.js
CHANGED
|
@@ -15,11 +15,11 @@ const et = ft({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), Me = () => gt(et),
|
|
18
|
+
}), Me = () => gt(et), cn = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: o,
|
|
23
23
|
capabilities: l = {},
|
|
24
24
|
debug: d = !1
|
|
25
25
|
}) => {
|
|
@@ -31,43 +31,43 @@ const et = ft({
|
|
|
31
31
|
);
|
|
32
32
|
a("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c, g] = k(null), [h, b] = k(null), [C,
|
|
38
|
+
const [c, g] = k(null), [h, b] = k(null), [C, S] = k(!1), [m, v] = k(!1), [r, p] = k(null), M = Q(!1), N = Q({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
43
|
+
}), w = Q(0);
|
|
44
|
+
w.current++, a("📊 RENDER INFO", {
|
|
45
|
+
renderCount: w.current,
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
48
|
userChanged: N.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
-
apiKeyChanged: N.current.apiKey !==
|
|
49
|
+
apiKeyChanged: N.current.apiKey !== o,
|
|
50
50
|
serviceConfigChanged: N.current.serviceConfig !== n,
|
|
51
51
|
capabilitiesChanged: N.current.capabilities !== l
|
|
52
52
|
}
|
|
53
53
|
}), N.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
58
|
}, X(() => {
|
|
59
|
-
const u =
|
|
59
|
+
const u = w.current;
|
|
60
60
|
if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
|
-
apiKey: !!
|
|
62
|
+
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
67
|
serviceConfigStable: N.current.serviceConfig === n,
|
|
68
|
-
apiKeyStable: N.current.apiKey ===
|
|
68
|
+
apiKeyStable: N.current.apiKey === o
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
70
|
+
}), !o || !n) {
|
|
71
71
|
a("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: u,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
@@ -76,12 +76,12 @@ const et = ft({
|
|
|
76
76
|
}
|
|
77
77
|
a("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: u,
|
|
79
|
-
apiKey: (
|
|
79
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: N.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
82
|
const f = new xt({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
84
|
+
apiKey: o,
|
|
85
85
|
debug: d
|
|
86
86
|
});
|
|
87
87
|
return g(f), a("✅ SERVICE SET", {
|
|
@@ -93,10 +93,10 @@ const et = ft({
|
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
94
|
}), f.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
96
|
+
}, [o, n, d, a]);
|
|
97
|
+
const _ = Q(null);
|
|
98
98
|
X(() => {
|
|
99
|
-
var f,
|
|
99
|
+
var f, E;
|
|
100
100
|
if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
@@ -112,7 +112,7 @@ const et = ft({
|
|
|
112
112
|
a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((f =
|
|
115
|
+
if (((f = _.current) == null ? void 0 : f.serviceId) === c && ((E = _.current) == null ? void 0 : E.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,22 +120,22 @@ const et = ft({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0,
|
|
123
|
+
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, v(!0), p(null);
|
|
124
124
|
try {
|
|
125
125
|
a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
b(
|
|
126
|
+
const y = await c.connectUser(s);
|
|
127
|
+
b(y), S(!0), _.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: y.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const D =
|
|
133
|
-
|
|
131
|
+
} catch (y) {
|
|
132
|
+
const D = y instanceof Error ? y.message : "Connection failed";
|
|
133
|
+
p(D), a("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
135
|
error: D
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
v(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: C
|
|
141
141
|
});
|
|
@@ -148,7 +148,7 @@ const et = ft({
|
|
|
148
148
|
c && C ? (a(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), _.current = null, c.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
153
|
isConnected: C
|
|
154
154
|
});
|
|
@@ -161,33 +161,33 @@ const et = ft({
|
|
|
161
161
|
a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
|
|
165
165
|
try {
|
|
166
166
|
a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await c.connectUser(s);
|
|
168
|
-
b(u),
|
|
168
|
+
b(u), S(!0), p(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
170
|
const f = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
-
|
|
171
|
+
p(f), a("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
173
|
error: f
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
v(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
178
|
}, [c, s, a]), x = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!h,
|
|
181
181
|
isConnected: C,
|
|
182
182
|
isLoading: m,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!r,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
187
|
client: h,
|
|
188
188
|
isConnected: C,
|
|
189
189
|
isLoading: m,
|
|
190
|
-
error:
|
|
190
|
+
error: r,
|
|
191
191
|
capabilities: l,
|
|
192
192
|
refreshConnection: L,
|
|
193
193
|
debug: d
|
|
@@ -196,14 +196,14 @@ const et = ft({
|
|
|
196
196
|
h,
|
|
197
197
|
C,
|
|
198
198
|
m,
|
|
199
|
-
|
|
199
|
+
r,
|
|
200
200
|
l,
|
|
201
201
|
L,
|
|
202
202
|
d,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
206
|
+
renderCount: w.current,
|
|
207
207
|
willRenderChat: !!(h && C),
|
|
208
208
|
contextValueReady: !!x
|
|
209
209
|
}), /* @__PURE__ */ e(et.Provider, { value: x, children: h && C ? /* @__PURE__ */ e(
|
|
@@ -216,16 +216,23 @@ const et = ft({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
}, os = () => Me()
|
|
219
|
+
}, os = () => Me();
|
|
220
|
+
function ls(t) {
|
|
221
|
+
const s = t.state.pending_messages;
|
|
222
|
+
if (s != null && s.length)
|
|
223
|
+
for (const n of s)
|
|
224
|
+
t.state.addMessageSorted(n.message);
|
|
225
|
+
}
|
|
226
|
+
const tt = F.createContext({
|
|
220
227
|
selectedChannel: void 0,
|
|
221
228
|
onChannelSelect: () => {
|
|
222
229
|
},
|
|
223
230
|
debug: !1,
|
|
224
231
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
226
|
-
var
|
|
232
|
+
}), is = tt.Provider, cs = () => F.useContext(tt), st = (t) => {
|
|
233
|
+
var o, l;
|
|
227
234
|
const [s, n] = k(
|
|
228
|
-
!!((l = (
|
|
235
|
+
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
229
236
|
);
|
|
230
237
|
return X(() => {
|
|
231
238
|
var a;
|
|
@@ -244,23 +251,23 @@ const et = ft({
|
|
|
244
251
|
t.off("member.updated", d);
|
|
245
252
|
};
|
|
246
253
|
}, [t]), s;
|
|
247
|
-
},
|
|
254
|
+
}, ds = (t, s) => {
|
|
248
255
|
const n = new Date(
|
|
249
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
250
257
|
), l = new Date(
|
|
251
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
252
259
|
).getTime() - n.getTime();
|
|
253
260
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
254
|
-
},
|
|
261
|
+
}, ms = (t) => {
|
|
255
262
|
const s = /* @__PURE__ */ new Date();
|
|
256
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
257
264
|
return "Just now";
|
|
258
|
-
const
|
|
259
|
-
return
|
|
265
|
+
const o = ds(t, s);
|
|
266
|
+
return o === 0 ? t.toLocaleTimeString([], {
|
|
260
267
|
hour: "numeric",
|
|
261
268
|
minute: "2-digit",
|
|
262
269
|
hour12: !0
|
|
263
|
-
}) :
|
|
270
|
+
}) : o === 1 ? "Yesterday" : o < 7 ? `${o}d` : o < 28 ? `${Math.floor(o / 7)}w` : t.toLocaleDateString("en-US", {
|
|
264
271
|
month: "numeric",
|
|
265
272
|
day: "numeric",
|
|
266
273
|
year: "2-digit"
|
|
@@ -293,34 +300,34 @@ const et = ft({
|
|
|
293
300
|
"🍈"
|
|
294
301
|
// Melon
|
|
295
302
|
];
|
|
296
|
-
function
|
|
303
|
+
function us(t) {
|
|
297
304
|
let s = 0;
|
|
298
305
|
for (let n = 0; n < t.length; n++) {
|
|
299
|
-
const
|
|
300
|
-
s = (s << 5) - s +
|
|
306
|
+
const o = t.charCodeAt(n);
|
|
307
|
+
s = (s << 5) - s + o, s = s & s;
|
|
301
308
|
}
|
|
302
309
|
return Math.abs(s);
|
|
303
310
|
}
|
|
304
|
-
function
|
|
305
|
-
const n =
|
|
311
|
+
function hs(t) {
|
|
312
|
+
const n = us(t) % Ze.length;
|
|
306
313
|
return Ze[n];
|
|
307
314
|
}
|
|
308
315
|
const ie = ({
|
|
309
316
|
id: t,
|
|
310
317
|
image: s,
|
|
311
318
|
size: n = 40,
|
|
312
|
-
className:
|
|
319
|
+
className: o,
|
|
313
320
|
starred: l = !1,
|
|
314
321
|
shape: d = "squircle"
|
|
315
322
|
}) => {
|
|
316
|
-
const a =
|
|
323
|
+
const a = hs(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
|
|
317
324
|
borderRadius: "33%",
|
|
318
325
|
"corner-shape": "superellipse(1.3)"
|
|
319
326
|
};
|
|
320
327
|
return /* @__PURE__ */ i(
|
|
321
328
|
"div",
|
|
322
329
|
{
|
|
323
|
-
className: A("relative flex-shrink-0",
|
|
330
|
+
className: A("relative flex-shrink-0", o),
|
|
324
331
|
style: {
|
|
325
332
|
width: `${n}px`,
|
|
326
333
|
height: `${n}px`
|
|
@@ -355,7 +362,7 @@ const ie = ({
|
|
|
355
362
|
]
|
|
356
363
|
}
|
|
357
364
|
);
|
|
358
|
-
},
|
|
365
|
+
}, fs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
359
366
|
"svg",
|
|
360
367
|
{
|
|
361
368
|
width: t,
|
|
@@ -372,45 +379,45 @@ const ie = ({
|
|
|
372
379
|
}
|
|
373
380
|
)
|
|
374
381
|
}
|
|
375
|
-
),
|
|
382
|
+
), gs = (t) => {
|
|
376
383
|
var s;
|
|
377
384
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
378
|
-
},
|
|
385
|
+
}, xs = (t) => {
|
|
379
386
|
var s;
|
|
380
387
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
381
388
|
}, Be = (t) => {
|
|
382
389
|
var s;
|
|
383
390
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
384
|
-
},
|
|
391
|
+
}, bs = (t) => {
|
|
385
392
|
var s;
|
|
386
393
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
387
|
-
}, nt = (t) =>
|
|
394
|
+
}, nt = (t) => gs(t) || xs(t), Cs = (t) => {
|
|
388
395
|
var s;
|
|
389
396
|
return nt(t) && !((s = t.text) != null && s.trim());
|
|
390
397
|
}, Re = ({
|
|
391
398
|
message: t,
|
|
392
399
|
standalone: s = !1,
|
|
393
400
|
isMyMessage: n = !1,
|
|
394
|
-
hasAttachment:
|
|
401
|
+
hasAttachment: o = !1
|
|
395
402
|
}) => {
|
|
396
403
|
var C;
|
|
397
404
|
const l = nt(t), d = Be(t);
|
|
398
405
|
if (!l && !d)
|
|
399
406
|
return null;
|
|
400
407
|
if (l) {
|
|
401
|
-
const
|
|
402
|
-
if (!
|
|
403
|
-
const m = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
408
|
+
const S = (C = t.metadata) == null ? void 0 : C.amount_text;
|
|
409
|
+
if (!S) return null;
|
|
410
|
+
const m = s ? "message-tip-standalone" : "message-tag message-tag--tip", v = s ? `${S} tip` : `Delivered with ${S} tip`;
|
|
404
411
|
return /* @__PURE__ */ i("div", { className: m, children: [
|
|
405
412
|
/* @__PURE__ */ e(Qt, { size: s ? 14 : 12 }),
|
|
406
|
-
/* @__PURE__ */ e("span", { children:
|
|
413
|
+
/* @__PURE__ */ e("span", { children: v })
|
|
407
414
|
] });
|
|
408
415
|
}
|
|
409
|
-
const a = n &&
|
|
416
|
+
const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
|
|
410
417
|
"message-chatbot-indicator",
|
|
411
418
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
412
419
|
a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
413
|
-
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
420
|
+
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(fs, { size: a ? 12 : 15 }) });
|
|
414
421
|
return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
|
|
415
422
|
h,
|
|
416
423
|
b
|
|
@@ -421,36 +428,36 @@ const ie = ({
|
|
|
421
428
|
}, at = F.memo(
|
|
422
429
|
({ channel: t, unread: s }) => {
|
|
423
430
|
var L, x, u, f;
|
|
424
|
-
const { selectedChannel: n, onChannelSelect:
|
|
425
|
-
t &&
|
|
426
|
-
}, g = (
|
|
427
|
-
const
|
|
428
|
-
!
|
|
431
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = cs(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
432
|
+
t && o(t);
|
|
433
|
+
}, g = (E) => {
|
|
434
|
+
const y = E.key === "Enter" || E.key === " ", D = E.repeat;
|
|
435
|
+
!y || D || (E.preventDefault(), c());
|
|
429
436
|
}, b = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
430
|
-
(
|
|
431
|
-
var
|
|
432
|
-
return ((
|
|
437
|
+
(E) => {
|
|
438
|
+
var y, D;
|
|
439
|
+
return ((y = E.user) == null ? void 0 : y.id) && E.user.id !== ((D = t == null ? void 0 : t._client) == null ? void 0 : D.userID);
|
|
433
440
|
}
|
|
434
|
-
), C = ((x = b == null ? void 0 : b.user) == null ? void 0 : x.name) || "Conversation",
|
|
435
|
-
var
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
for (let D =
|
|
439
|
-
if (
|
|
441
|
+
), C = ((x = b == null ? void 0 : b.user) == null ? void 0 : x.name) || "Conversation", S = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, m = (() => {
|
|
442
|
+
var y;
|
|
443
|
+
const E = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
|
|
444
|
+
if (E != null && E.length) {
|
|
445
|
+
for (let D = E.length - 1; D >= 0; D--)
|
|
446
|
+
if (E[D].type !== "system") return E[D];
|
|
440
447
|
}
|
|
441
|
-
})(),
|
|
448
|
+
})(), r = (() => {
|
|
442
449
|
var D, G;
|
|
443
450
|
if (m != null && m.text) return m.text;
|
|
444
451
|
if (((D = m == null ? void 0 : m.metadata) == null ? void 0 : D.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
445
|
-
const
|
|
446
|
-
return
|
|
447
|
-
})(),
|
|
452
|
+
const y = (G = m == null ? void 0 : m.attachments) == null ? void 0 : G[0];
|
|
453
|
+
return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
454
|
+
})(), p = m != null && m.created_at ? ms(new Date(m.created_at)) : "", M = m ? Be(m) : !1, N = d ? d(m, r) : `${M ? "✨ " : ""}${r}`, w = st(t), _ = s ?? 0;
|
|
448
455
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
449
456
|
channelId: t == null ? void 0 : t.id,
|
|
450
457
|
isSelected: a,
|
|
451
458
|
participantName: C,
|
|
452
|
-
unreadCount:
|
|
453
|
-
hasTimestamp: !!
|
|
459
|
+
unreadCount: _,
|
|
460
|
+
hasTimestamp: !!p
|
|
454
461
|
}), /* @__PURE__ */ e(
|
|
455
462
|
"div",
|
|
456
463
|
{
|
|
@@ -471,9 +478,9 @@ const ie = ({
|
|
|
471
478
|
{
|
|
472
479
|
id: ((f = b == null ? void 0 : b.user) == null ? void 0 : f.id) || t.id || "unknown",
|
|
473
480
|
name: C,
|
|
474
|
-
image:
|
|
481
|
+
image: S,
|
|
475
482
|
size: 44,
|
|
476
|
-
starred:
|
|
483
|
+
starred: w,
|
|
477
484
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
478
485
|
}
|
|
479
486
|
),
|
|
@@ -487,16 +494,16 @@ const ie = ({
|
|
|
487
494
|
a ? "text-primary" : "text-charcoal"
|
|
488
495
|
),
|
|
489
496
|
children: [
|
|
490
|
-
|
|
497
|
+
w && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
491
498
|
C
|
|
492
499
|
]
|
|
493
500
|
}
|
|
494
501
|
),
|
|
495
|
-
|
|
502
|
+
p && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: p })
|
|
496
503
|
] }),
|
|
497
504
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
498
505
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
|
|
499
|
-
|
|
506
|
+
_ > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: _ > 99 ? "99+" : _ })
|
|
500
507
|
] })
|
|
501
508
|
] })
|
|
502
509
|
] })
|
|
@@ -505,36 +512,43 @@ const ie = ({
|
|
|
505
512
|
}
|
|
506
513
|
);
|
|
507
514
|
at.displayName = "CustomChannelPreview";
|
|
508
|
-
const
|
|
515
|
+
const Ns = { last_message_at: -1 }, rt = F.memo(
|
|
509
516
|
({
|
|
510
517
|
onChannelSelect: t,
|
|
511
518
|
selectedChannel: s,
|
|
512
519
|
filters: n,
|
|
513
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
520
|
+
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
514
521
|
onMessageNew: l,
|
|
515
522
|
onAddedToChannel: d,
|
|
516
523
|
channelRenderFilterFn: a,
|
|
517
|
-
sort: c =
|
|
524
|
+
sort: c = Ns,
|
|
518
525
|
className: g,
|
|
519
526
|
customEmptyStateIndicator: h,
|
|
520
527
|
renderMessagePreview: b
|
|
521
528
|
}) => {
|
|
522
529
|
const C = F.useRef(0);
|
|
523
530
|
C.current++;
|
|
524
|
-
const { debug:
|
|
525
|
-
|
|
531
|
+
const { debug: S = !1 } = Me(), m = F.useCallback(
|
|
532
|
+
(r) => {
|
|
533
|
+
for (const p of r)
|
|
534
|
+
ls(p);
|
|
535
|
+
return a ? a(r) : r;
|
|
536
|
+
},
|
|
537
|
+
[a]
|
|
538
|
+
);
|
|
539
|
+
S && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
526
540
|
renderCount: C.current,
|
|
527
541
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
528
542
|
filters: n
|
|
529
543
|
});
|
|
530
|
-
const
|
|
544
|
+
const v = F.useMemo(
|
|
531
545
|
() => ({
|
|
532
546
|
selectedChannel: s,
|
|
533
547
|
onChannelSelect: t,
|
|
534
|
-
debug:
|
|
548
|
+
debug: S,
|
|
535
549
|
renderMessagePreview: b
|
|
536
550
|
}),
|
|
537
|
-
[s, t,
|
|
551
|
+
[s, t, S, b]
|
|
538
552
|
);
|
|
539
553
|
return /* @__PURE__ */ e(
|
|
540
554
|
"div",
|
|
@@ -543,16 +557,16 @@ const Cs = { last_message_at: -1 }, rt = F.memo(
|
|
|
543
557
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
544
558
|
g
|
|
545
559
|
),
|
|
546
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
560
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(is, { value: v, children: /* @__PURE__ */ e(
|
|
547
561
|
Ct,
|
|
548
562
|
{
|
|
549
563
|
filters: n,
|
|
550
564
|
sort: c,
|
|
551
565
|
options: { limit: 30 },
|
|
552
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
566
|
+
allowNewMessagesFromUnfilteredChannels: o,
|
|
553
567
|
onMessageNew: l,
|
|
554
568
|
onAddedToChannel: d,
|
|
555
|
-
channelRenderFilterFn:
|
|
569
|
+
channelRenderFilterFn: m,
|
|
556
570
|
Preview: at,
|
|
557
571
|
EmptyStateIndicator: h
|
|
558
572
|
},
|
|
@@ -567,7 +581,7 @@ const we = ({
|
|
|
567
581
|
variant: t = "default",
|
|
568
582
|
className: s,
|
|
569
583
|
children: n,
|
|
570
|
-
...
|
|
584
|
+
...o
|
|
571
585
|
}) => /* @__PURE__ */ e(
|
|
572
586
|
"button",
|
|
573
587
|
{
|
|
@@ -577,11 +591,11 @@ const we = ({
|
|
|
577
591
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
578
592
|
s
|
|
579
593
|
),
|
|
580
|
-
...
|
|
594
|
+
...o,
|
|
581
595
|
children: n
|
|
582
596
|
}
|
|
583
597
|
);
|
|
584
|
-
function ot({ label: t, className: s, children: n, ...
|
|
598
|
+
function ot({ label: t, className: s, children: n, ...o }) {
|
|
585
599
|
return /* @__PURE__ */ i(
|
|
586
600
|
"button",
|
|
587
601
|
{
|
|
@@ -589,12 +603,12 @@ function ot({ label: t, className: s, children: n, ...r }) {
|
|
|
589
603
|
className: A(
|
|
590
604
|
"rounded-full p-2 transition-colors focus-ring",
|
|
591
605
|
{
|
|
592
|
-
"cursor-not-allowed opacity-50":
|
|
593
|
-
"hover:bg-sand": !
|
|
606
|
+
"cursor-not-allowed opacity-50": o.disabled,
|
|
607
|
+
"hover:bg-sand": !o.disabled
|
|
594
608
|
},
|
|
595
609
|
s
|
|
596
610
|
),
|
|
597
|
-
...
|
|
611
|
+
...o,
|
|
598
612
|
children: [
|
|
599
613
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
600
614
|
n
|
|
@@ -605,11 +619,11 @@ function ot({ label: t, className: s, children: n, ...r }) {
|
|
|
605
619
|
function lt({ onClick: t }) {
|
|
606
620
|
return /* @__PURE__ */ e(ot, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
607
621
|
}
|
|
608
|
-
const
|
|
622
|
+
const ps = ({
|
|
609
623
|
dialogRef: t,
|
|
610
624
|
onClose: s,
|
|
611
625
|
participant: n,
|
|
612
|
-
channel:
|
|
626
|
+
channel: o,
|
|
613
627
|
followerStatusLabel: l,
|
|
614
628
|
onLeaveConversation: d,
|
|
615
629
|
onBlockParticipant: a,
|
|
@@ -618,10 +632,10 @@ const Ns = ({
|
|
|
618
632
|
onBlockParticipantClick: h,
|
|
619
633
|
onReportParticipantClick: b,
|
|
620
634
|
customProfileContent: C,
|
|
621
|
-
customChannelActions:
|
|
635
|
+
customChannelActions: S
|
|
622
636
|
}) => {
|
|
623
637
|
var Z, J, P, V, z, ce, de;
|
|
624
|
-
const { service: m, debug:
|
|
638
|
+
const { service: m, debug: v } = Me(), [r, p] = k(!1), [M, N] = k(!1), [w, _] = k(!1), L = U(async () => {
|
|
625
639
|
var R;
|
|
626
640
|
if (!(!m || !((R = n == null ? void 0 : n.user) != null && R.id)))
|
|
627
641
|
try {
|
|
@@ -631,7 +645,7 @@ const Ns = ({
|
|
|
631
645
|
return W.blocked_user_id === ((ne = n == null ? void 0 : n.user) == null ? void 0 : ne.id);
|
|
632
646
|
}
|
|
633
647
|
);
|
|
634
|
-
|
|
648
|
+
p(Y);
|
|
635
649
|
} catch (O) {
|
|
636
650
|
console.error(
|
|
637
651
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
@@ -645,10 +659,10 @@ const Ns = ({
|
|
|
645
659
|
const x = async () => {
|
|
646
660
|
var R;
|
|
647
661
|
if (!M) {
|
|
648
|
-
g == null || g(),
|
|
662
|
+
g == null || g(), v && console.log("[ChannelInfoDialog] Leave conversation", o.cid), N(!0);
|
|
649
663
|
try {
|
|
650
|
-
const O = ((R =
|
|
651
|
-
await
|
|
664
|
+
const O = ((R = o._client) == null ? void 0 : R.userID) ?? null;
|
|
665
|
+
await o.hide(O, !1), d && await d(o), s();
|
|
652
666
|
} catch (O) {
|
|
653
667
|
console.error("[ChannelInfoDialog] Failed to leave conversation", O);
|
|
654
668
|
} finally {
|
|
@@ -657,29 +671,29 @@ const Ns = ({
|
|
|
657
671
|
}
|
|
658
672
|
}, u = async () => {
|
|
659
673
|
var R, O, Y;
|
|
660
|
-
if (!(
|
|
661
|
-
h == null || h(),
|
|
674
|
+
if (!(w || !m)) {
|
|
675
|
+
h == null || h(), v && console.log("[ChannelInfoDialog] Block member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), _(!0);
|
|
662
676
|
try {
|
|
663
677
|
await m.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id), s();
|
|
664
678
|
} catch (W) {
|
|
665
679
|
console.error("[ChannelInfoDialog] Failed to block member", W);
|
|
666
680
|
} finally {
|
|
667
|
-
|
|
681
|
+
_(!1);
|
|
668
682
|
}
|
|
669
683
|
}
|
|
670
684
|
}, f = async () => {
|
|
671
685
|
var R, O, Y;
|
|
672
|
-
if (!(
|
|
673
|
-
h == null || h(),
|
|
686
|
+
if (!(w || !m)) {
|
|
687
|
+
h == null || h(), v && console.log("[ChannelInfoDialog] Unblock member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), _(!0);
|
|
674
688
|
try {
|
|
675
689
|
await m.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id), s();
|
|
676
690
|
} catch (W) {
|
|
677
691
|
console.error("[ChannelInfoDialog] Failed to unblock member", W);
|
|
678
692
|
} finally {
|
|
679
|
-
|
|
693
|
+
_(!1);
|
|
680
694
|
}
|
|
681
695
|
}
|
|
682
|
-
},
|
|
696
|
+
}, E = () => {
|
|
683
697
|
b == null || b(), s(), window.open(
|
|
684
698
|
"https://linktr.ee/s/about/trust-center/report",
|
|
685
699
|
"_blank",
|
|
@@ -687,7 +701,7 @@ const Ns = ({
|
|
|
687
701
|
);
|
|
688
702
|
};
|
|
689
703
|
if (!n) return null;
|
|
690
|
-
const
|
|
704
|
+
const y = ((J = n.user) == null ? void 0 : J.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (ce = n.user) == null ? void 0 : ce.username, $ = G || (T ? `linktr.ee/${T}` : void 0), se = ((de = n.user) == null ? void 0 : de.id) || "unknown";
|
|
691
705
|
return (
|
|
692
706
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
693
707
|
/* @__PURE__ */ e(
|
|
@@ -715,14 +729,14 @@ const Ns = ({
|
|
|
715
729
|
ie,
|
|
716
730
|
{
|
|
717
731
|
id: se,
|
|
718
|
-
name:
|
|
732
|
+
name: y,
|
|
719
733
|
image: D,
|
|
720
734
|
size: 88,
|
|
721
735
|
shape: "circle"
|
|
722
736
|
}
|
|
723
737
|
),
|
|
724
738
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
725
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
739
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
|
|
726
740
|
$ && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: $ }),
|
|
727
741
|
l && !C && /* @__PURE__ */ e(
|
|
728
742
|
"span",
|
|
@@ -756,14 +770,14 @@ const Ns = ({
|
|
|
756
770
|
]
|
|
757
771
|
}
|
|
758
772
|
) }),
|
|
759
|
-
/* @__PURE__ */ e("li", { children:
|
|
773
|
+
/* @__PURE__ */ e("li", { children: r ? /* @__PURE__ */ i(
|
|
760
774
|
we,
|
|
761
775
|
{
|
|
762
776
|
onClick: f,
|
|
763
|
-
disabled:
|
|
764
|
-
"aria-busy":
|
|
777
|
+
disabled: w,
|
|
778
|
+
"aria-busy": w,
|
|
765
779
|
children: [
|
|
766
|
-
|
|
780
|
+
w ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
|
|
767
781
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
768
782
|
]
|
|
769
783
|
}
|
|
@@ -771,63 +785,63 @@ const Ns = ({
|
|
|
771
785
|
we,
|
|
772
786
|
{
|
|
773
787
|
onClick: u,
|
|
774
|
-
disabled:
|
|
775
|
-
"aria-busy":
|
|
788
|
+
disabled: w,
|
|
789
|
+
"aria-busy": w,
|
|
776
790
|
children: [
|
|
777
|
-
|
|
791
|
+
w ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
|
|
778
792
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
779
793
|
]
|
|
780
794
|
}
|
|
781
795
|
) }),
|
|
782
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(we, { variant: "danger", onClick:
|
|
796
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(we, { variant: "danger", onClick: E, children: [
|
|
783
797
|
/* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
|
|
784
798
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
785
799
|
] }) }),
|
|
786
|
-
|
|
800
|
+
S
|
|
787
801
|
] })
|
|
788
802
|
] })
|
|
789
803
|
] })
|
|
790
804
|
}
|
|
791
805
|
)
|
|
792
806
|
);
|
|
793
|
-
},
|
|
794
|
-
function
|
|
807
|
+
}, ys = (t) => /* @__PURE__ */ e(Nt, { ...t, position: "center" }), Pe = "vote_up", Fe = "vote_down";
|
|
808
|
+
function vs(t) {
|
|
795
809
|
return t != null && t.length ? t.some((s) => s.type === Fe) ? "down" : t.some((s) => s.type === Pe) ? "up" : null : null;
|
|
796
810
|
}
|
|
797
|
-
function
|
|
798
|
-
const { channel: s } = Ie(), { client: n } = Ke("useMessageVote"),
|
|
799
|
-
() =>
|
|
811
|
+
function ws(t) {
|
|
812
|
+
const { channel: s } = Ie(), { client: n } = Ke("useMessageVote"), o = Le(
|
|
813
|
+
() => vs(t.own_reactions),
|
|
800
814
|
[t.own_reactions]
|
|
801
815
|
), l = U(async () => {
|
|
802
816
|
if (n != null && n.userID)
|
|
803
817
|
try {
|
|
804
|
-
|
|
818
|
+
o === "up" ? await s.deleteReaction(t.id, Pe) : await s.sendReaction(
|
|
805
819
|
t.id,
|
|
806
820
|
{ type: Pe },
|
|
807
821
|
{ enforce_unique: !0, skip_push: !0 }
|
|
808
822
|
);
|
|
809
823
|
} catch {
|
|
810
824
|
}
|
|
811
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
825
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = U(async () => {
|
|
812
826
|
if (n != null && n.userID)
|
|
813
827
|
try {
|
|
814
|
-
|
|
828
|
+
o === "down" ? await s.deleteReaction(t.id, Fe) : await s.sendReaction(
|
|
815
829
|
t.id,
|
|
816
830
|
{ type: Fe },
|
|
817
831
|
{ enforce_unique: !0, skip_push: !0 }
|
|
818
832
|
);
|
|
819
833
|
} catch {
|
|
820
834
|
}
|
|
821
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
822
|
-
return { selected:
|
|
835
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
836
|
+
return { selected: o, voteUp: l, voteDown: d };
|
|
823
837
|
}
|
|
824
|
-
const
|
|
838
|
+
const _s = F.lazy(() => import("./Creator-VyMyIk2b.js")), Es = F.lazy(() => import("./Visitor-C4WqnN8H.js")), Je = () => /* @__PURE__ */ e(
|
|
825
839
|
"div",
|
|
826
840
|
{
|
|
827
841
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-3xl bg-black/[0.06] shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04)]",
|
|
828
842
|
"aria-hidden": !0
|
|
829
843
|
}
|
|
830
|
-
),
|
|
844
|
+
), Ss = (t) => t.onUnlock != null || t.onDownload != null ? /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(Es, { ...t }) }) : /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(_s, { ...t }) }), Is = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
831
845
|
"path",
|
|
832
846
|
{
|
|
833
847
|
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",
|
|
@@ -837,7 +851,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
837
851
|
strokeLinejoin: "round",
|
|
838
852
|
fill: t ? "currentColor" : "none"
|
|
839
853
|
}
|
|
840
|
-
) }),
|
|
854
|
+
) }), Ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
841
855
|
"path",
|
|
842
856
|
{
|
|
843
857
|
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",
|
|
@@ -847,7 +861,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
847
861
|
strokeLinejoin: "round",
|
|
848
862
|
fill: t ? "currentColor" : "none"
|
|
849
863
|
}
|
|
850
|
-
) }),
|
|
864
|
+
) }), ks = ({
|
|
851
865
|
selected: t,
|
|
852
866
|
onVoteUp: s,
|
|
853
867
|
onVoteDown: n
|
|
@@ -860,7 +874,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
860
874
|
onClick: s,
|
|
861
875
|
"aria-label": "Helpful",
|
|
862
876
|
"aria-pressed": t === "up",
|
|
863
|
-
children: /* @__PURE__ */ e(
|
|
877
|
+
children: /* @__PURE__ */ e(Is, { filled: t === "up" })
|
|
864
878
|
}
|
|
865
879
|
),
|
|
866
880
|
/* @__PURE__ */ e(
|
|
@@ -871,15 +885,15 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
871
885
|
onClick: n,
|
|
872
886
|
"aria-label": "Not helpful",
|
|
873
887
|
"aria-pressed": t === "down",
|
|
874
|
-
children: /* @__PURE__ */ e(
|
|
888
|
+
children: /* @__PURE__ */ e(Ms, { filled: t === "down" })
|
|
875
889
|
}
|
|
876
890
|
)
|
|
877
|
-
] }),
|
|
891
|
+
] }), Ts = (t) => {
|
|
878
892
|
var ge, xe, be, le, K, Ce, Ne, pe;
|
|
879
893
|
const {
|
|
880
894
|
additionalMessageInputProps: s,
|
|
881
895
|
chatbotVotingEnabled: n,
|
|
882
|
-
onAttachmentUnlock:
|
|
896
|
+
onAttachmentUnlock: o,
|
|
883
897
|
onAttachmentDownload: l,
|
|
884
898
|
editing: d,
|
|
885
899
|
endOfGroup: a,
|
|
@@ -888,14 +902,14 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
888
902
|
handleAction: h,
|
|
889
903
|
handleOpenThread: b,
|
|
890
904
|
handleRetry: C,
|
|
891
|
-
highlighted:
|
|
905
|
+
highlighted: S,
|
|
892
906
|
isMessageAIGenerated: m,
|
|
893
|
-
isMyMessage:
|
|
894
|
-
message:
|
|
895
|
-
renderText:
|
|
907
|
+
isMyMessage: v,
|
|
908
|
+
message: r,
|
|
909
|
+
renderText: p,
|
|
896
910
|
threadList: M
|
|
897
|
-
} = t, { client: N } = Ke("CustomMessage"), { channel:
|
|
898
|
-
Attachment:
|
|
911
|
+
} = t, { client: N } = Ke("CustomMessage"), { channel: w } = Ie("CustomMessage"), [_, L] = k(!1), x = yt(r.id), { selected: u, voteUp: f, voteDown: E } = ws(r), {
|
|
912
|
+
Attachment: y = wt,
|
|
899
913
|
EditMessageModal: D = _t,
|
|
900
914
|
MessageBlocked: G = Et,
|
|
901
915
|
MessageBouncePrompt: T = St,
|
|
@@ -905,40 +919,40 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
905
919
|
ReminderNotification: J = Tt,
|
|
906
920
|
StreamedMessageText: P = Dt,
|
|
907
921
|
PinIndicator: V
|
|
908
|
-
} = vt("CustomMessage"), z = Rt(
|
|
909
|
-
() => m == null ? void 0 : m(
|
|
910
|
-
[m,
|
|
922
|
+
} = vt("CustomMessage"), z = Rt(r), ce = At(r), de = Le(
|
|
923
|
+
() => m == null ? void 0 : m(r),
|
|
924
|
+
[m, r]
|
|
911
925
|
), R = Le(
|
|
912
|
-
() => !
|
|
913
|
-
[
|
|
926
|
+
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
927
|
+
[r]
|
|
914
928
|
);
|
|
915
|
-
if (Lt(
|
|
929
|
+
if (Lt(r))
|
|
916
930
|
return null;
|
|
917
|
-
if (
|
|
918
|
-
return /* @__PURE__ */ e($, { message:
|
|
919
|
-
if (Ut(
|
|
931
|
+
if (r.deleted_at || r.type === "deleted")
|
|
932
|
+
return /* @__PURE__ */ e($, { message: r });
|
|
933
|
+
if (Ut(r))
|
|
920
934
|
return /* @__PURE__ */ e(G, {});
|
|
921
|
-
const O = !M && !!
|
|
935
|
+
const O = !M && !!r.reply_count, Y = !M && r.show_in_channel && r.parent_id, W = r.status === "failed" && ((ge = r.error) == null ? void 0 : ge.status) !== 403, ne = Pt(r);
|
|
922
936
|
let ee;
|
|
923
|
-
W ? ee = () => C(
|
|
924
|
-
const ae =
|
|
937
|
+
W ? ee = () => C(r) : ne && (ee = () => L(!0));
|
|
938
|
+
const ae = v(), Ge = A(
|
|
925
939
|
"str-chat__message str-chat__message-simple",
|
|
926
|
-
`str-chat__message--${
|
|
927
|
-
`str-chat__message--${
|
|
940
|
+
`str-chat__message--${r.type}`,
|
|
941
|
+
`str-chat__message--${r.status}`,
|
|
928
942
|
ae ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
929
|
-
|
|
943
|
+
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
930
944
|
{
|
|
931
945
|
"str-chat__message--has-attachment": z,
|
|
932
|
-
"str-chat__message--highlighted":
|
|
933
|
-
"str-chat__message--pinned pinned-message":
|
|
946
|
+
"str-chat__message--highlighted": S,
|
|
947
|
+
"str-chat__message--pinned pinned-message": r.pinned,
|
|
934
948
|
"str-chat__message--with-reactions": ce,
|
|
935
|
-
"str-chat__message-send-can-be-retried": (
|
|
949
|
+
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((xe = r == null ? void 0 : r.error) == null ? void 0 : xe.status) !== 403,
|
|
936
950
|
"str-chat__message-with-thread-link": O || Y,
|
|
937
951
|
"str-chat__virtual-message__wrapper--end": a,
|
|
938
952
|
"str-chat__virtual-message__wrapper--first": c,
|
|
939
953
|
"str-chat__virtual-message__wrapper--group": g
|
|
940
954
|
}
|
|
941
|
-
), q =
|
|
955
|
+
), q = r.poll_id && N.polls.fromState(r.poll_id), me = Cs(r), re = Be(r), oe = bs(r), te = !!(R != null && R.length && !r.quoted_message), fe = re && ae && te;
|
|
942
956
|
return /* @__PURE__ */ i(he, { children: [
|
|
943
957
|
d && /* @__PURE__ */ e(
|
|
944
958
|
D,
|
|
@@ -946,24 +960,24 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
946
960
|
additionalMessageInputProps: s
|
|
947
961
|
}
|
|
948
962
|
),
|
|
949
|
-
|
|
963
|
+
_ && /* @__PURE__ */ e(
|
|
950
964
|
Ft,
|
|
951
965
|
{
|
|
952
966
|
MessageBouncePrompt: T,
|
|
953
967
|
onClose: () => L(!1),
|
|
954
|
-
open:
|
|
968
|
+
open: _
|
|
955
969
|
}
|
|
956
970
|
),
|
|
957
971
|
/* @__PURE__ */ i("div", { className: Ge, children: [
|
|
958
972
|
V && /* @__PURE__ */ e(V, {}),
|
|
959
973
|
!!x && /* @__PURE__ */ e(J, { reminder: x }),
|
|
960
|
-
|
|
974
|
+
r.user && /* @__PURE__ */ e(
|
|
961
975
|
ie,
|
|
962
976
|
{
|
|
963
977
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
964
|
-
id:
|
|
965
|
-
image:
|
|
966
|
-
name:
|
|
978
|
+
id: r.user.id,
|
|
979
|
+
image: r.user.image,
|
|
980
|
+
name: r.user.name || r.user.id
|
|
967
981
|
}
|
|
968
982
|
),
|
|
969
983
|
/* @__PURE__ */ e(
|
|
@@ -985,35 +999,35 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
985
999
|
},
|
|
986
1000
|
children: oe ? /* @__PURE__ */ i("div", { className: A("flex flex-col gap-1", ae ? "items-end" : "items-start"), children: [
|
|
987
1001
|
/* @__PURE__ */ e(
|
|
988
|
-
|
|
1002
|
+
Ss,
|
|
989
1003
|
{
|
|
990
|
-
title: (be =
|
|
991
|
-
mimeType: (le =
|
|
992
|
-
thumbnail: (K =
|
|
993
|
-
amountText: (Ce =
|
|
994
|
-
detail: (Ne =
|
|
995
|
-
paymentStatus: (pe =
|
|
996
|
-
onUnlock:
|
|
997
|
-
onDownload: l ? () => l(
|
|
1004
|
+
title: (be = r.metadata) == null ? void 0 : be.attachment_title,
|
|
1005
|
+
mimeType: (le = r.metadata) == null ? void 0 : le.attachment_mime_type,
|
|
1006
|
+
thumbnail: (K = r.metadata) == null ? void 0 : K.attachment_thumbnail,
|
|
1007
|
+
amountText: (Ce = r.metadata) == null ? void 0 : Ce.amount_text,
|
|
1008
|
+
detail: (Ne = r.metadata) == null ? void 0 : Ne.attachment_detail,
|
|
1009
|
+
paymentStatus: (pe = r.metadata) == null ? void 0 : pe.payment_status,
|
|
1010
|
+
onUnlock: o ? () => o(r, w) : void 0,
|
|
1011
|
+
onDownload: l ? () => l(r, w) : void 0
|
|
998
1012
|
}
|
|
999
1013
|
),
|
|
1000
|
-
|
|
1014
|
+
r.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(ze, { message: r, renderText: p }) }) })
|
|
1001
1015
|
] }) : me ? (
|
|
1002
1016
|
/* Tip-only messages render as a standalone bubble */
|
|
1003
|
-
/* @__PURE__ */ e(Re, { message:
|
|
1017
|
+
/* @__PURE__ */ e(Re, { message: r, standalone: !0 })
|
|
1004
1018
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1005
1019
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
1006
1020
|
re && !fe && /* @__PURE__ */ e(
|
|
1007
1021
|
Re,
|
|
1008
1022
|
{
|
|
1009
|
-
message:
|
|
1023
|
+
message: r,
|
|
1010
1024
|
hasAttachment: te,
|
|
1011
1025
|
isMyMessage: ae
|
|
1012
1026
|
}
|
|
1013
1027
|
),
|
|
1014
1028
|
q && /* @__PURE__ */ e(Ot, { poll: q }),
|
|
1015
|
-
R != null && R.length && !
|
|
1016
|
-
|
|
1029
|
+
R != null && R.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
1030
|
+
y,
|
|
1017
1031
|
{
|
|
1018
1032
|
actionHandler: h,
|
|
1019
1033
|
attachments: R
|
|
@@ -1022,26 +1036,26 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1022
1036
|
de ? /* @__PURE__ */ e(
|
|
1023
1037
|
P,
|
|
1024
1038
|
{
|
|
1025
|
-
message:
|
|
1026
|
-
renderText:
|
|
1039
|
+
message: r,
|
|
1040
|
+
renderText: p
|
|
1027
1041
|
}
|
|
1028
|
-
) : /* @__PURE__ */ e(ze, { message:
|
|
1042
|
+
) : /* @__PURE__ */ e(ze, { message: r, renderText: p }),
|
|
1029
1043
|
/* @__PURE__ */ e(Bt, {})
|
|
1030
1044
|
] }),
|
|
1031
1045
|
(!re || fe) && /* @__PURE__ */ e(
|
|
1032
1046
|
Re,
|
|
1033
1047
|
{
|
|
1034
|
-
message:
|
|
1048
|
+
message: r,
|
|
1035
1049
|
hasAttachment: te,
|
|
1036
1050
|
isMyMessage: ae
|
|
1037
1051
|
}
|
|
1038
1052
|
),
|
|
1039
1053
|
n && re && /* @__PURE__ */ e(
|
|
1040
|
-
|
|
1054
|
+
ks,
|
|
1041
1055
|
{
|
|
1042
1056
|
selected: u,
|
|
1043
1057
|
onVoteUp: f,
|
|
1044
|
-
onVoteDown:
|
|
1058
|
+
onVoteDown: E
|
|
1045
1059
|
}
|
|
1046
1060
|
)
|
|
1047
1061
|
] })
|
|
@@ -1051,27 +1065,27 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1051
1065
|
Z,
|
|
1052
1066
|
{
|
|
1053
1067
|
onClick: b,
|
|
1054
|
-
reply_count:
|
|
1068
|
+
reply_count: r.reply_count
|
|
1055
1069
|
}
|
|
1056
1070
|
),
|
|
1057
1071
|
Y && /* @__PURE__ */ e(se, {})
|
|
1058
|
-
] },
|
|
1072
|
+
] }, r.id)
|
|
1059
1073
|
] });
|
|
1060
|
-
},
|
|
1061
|
-
|
|
1074
|
+
}, Ds = F.memo(
|
|
1075
|
+
Ts,
|
|
1062
1076
|
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlock !== s.onAttachmentUnlock || t.onAttachmentDownload !== s.onAttachmentDownload ? !1 : pt(t, s)
|
|
1063
|
-
),
|
|
1077
|
+
), Rs = (t) => {
|
|
1064
1078
|
const s = Qe("CustomMessage");
|
|
1065
|
-
return /* @__PURE__ */ e(
|
|
1066
|
-
},
|
|
1079
|
+
return /* @__PURE__ */ e(Ds, { ...s, ...t });
|
|
1080
|
+
}, As = (t) => ({
|
|
1067
1081
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1068
1082
|
(s) => qe.previewIsLoaded(s) || qe.previewIsLoading(s)
|
|
1069
1083
|
)
|
|
1070
|
-
}),
|
|
1084
|
+
}), Ls = ({
|
|
1071
1085
|
link: t,
|
|
1072
1086
|
onDismiss: s
|
|
1073
1087
|
}) => {
|
|
1074
|
-
const { og_scrape_url: n, title:
|
|
1088
|
+
const { og_scrape_url: n, title: o, image_url: l } = t;
|
|
1075
1089
|
return /* @__PURE__ */ i(
|
|
1076
1090
|
"a",
|
|
1077
1091
|
{
|
|
@@ -1084,7 +1098,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1084
1098
|
"img",
|
|
1085
1099
|
{
|
|
1086
1100
|
src: l,
|
|
1087
|
-
alt:
|
|
1101
|
+
alt: o || "",
|
|
1088
1102
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1089
1103
|
}
|
|
1090
1104
|
),
|
|
@@ -1101,34 +1115,34 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1101
1115
|
}
|
|
1102
1116
|
),
|
|
1103
1117
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
1104
|
-
|
|
1118
|
+
o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
|
|
1105
1119
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1106
1120
|
] })
|
|
1107
1121
|
]
|
|
1108
1122
|
}
|
|
1109
1123
|
);
|
|
1110
|
-
},
|
|
1124
|
+
}, Us = () => {
|
|
1111
1125
|
const { linkPreviewsManager: t } = Gt(), { linkPreviews: s } = $t(
|
|
1112
1126
|
t.state,
|
|
1113
|
-
|
|
1127
|
+
As
|
|
1114
1128
|
), n = (l) => {
|
|
1115
1129
|
t.dismissPreview(l);
|
|
1116
1130
|
};
|
|
1117
1131
|
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
|
|
1118
|
-
|
|
1132
|
+
Ls,
|
|
1119
1133
|
{
|
|
1120
1134
|
link: l,
|
|
1121
1135
|
onDismiss: n
|
|
1122
1136
|
},
|
|
1123
1137
|
l.og_scrape_url
|
|
1124
1138
|
)) }) : null;
|
|
1125
|
-
},
|
|
1139
|
+
}, Ps = () => {
|
|
1126
1140
|
const { handleSubmit: t } = zt(), s = Ht();
|
|
1127
1141
|
return /* @__PURE__ */ i(he, { children: [
|
|
1128
1142
|
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Vt, {}) }),
|
|
1129
1143
|
/* @__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: [
|
|
1130
1144
|
/* @__PURE__ */ e(Yt, {}),
|
|
1131
|
-
/* @__PURE__ */ e(
|
|
1145
|
+
/* @__PURE__ */ e(Us, {}),
|
|
1132
1146
|
/* @__PURE__ */ e(Wt, {}),
|
|
1133
1147
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1134
1148
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
@@ -1154,30 +1168,30 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1154
1168
|
] })
|
|
1155
1169
|
] })
|
|
1156
1170
|
] });
|
|
1157
|
-
},
|
|
1171
|
+
}, Fs = ({
|
|
1158
1172
|
renderActions: t
|
|
1159
1173
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
1160
1174
|
t && (t == null ? void 0 : t()),
|
|
1161
|
-
/* @__PURE__ */ e(jt, { Input:
|
|
1162
|
-
] }),
|
|
1175
|
+
/* @__PURE__ */ e(jt, { Input: Ps })
|
|
1176
|
+
] }), Os = [
|
|
1163
1177
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1164
1178
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1165
|
-
],
|
|
1179
|
+
], Bs = {
|
|
1166
1180
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1167
1181
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1168
|
-
},
|
|
1182
|
+
}, Gs = [
|
|
1169
1183
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1170
|
-
],
|
|
1184
|
+
], $s = {
|
|
1171
1185
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1172
|
-
}, Ae = "age safety guidelines.",
|
|
1173
|
-
var
|
|
1174
|
-
const s = (
|
|
1186
|
+
}, Ae = "age safety guidelines.", js = "https://linktr.ee/s/about/contact", Xe = (t) => Os.includes(t), zs = (t) => Gs.includes(t), Hs = (t) => {
|
|
1187
|
+
var o;
|
|
1188
|
+
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1175
1189
|
if (Xe(s))
|
|
1176
1190
|
return {
|
|
1177
1191
|
kind: "dm-agent",
|
|
1178
1192
|
type: s
|
|
1179
1193
|
};
|
|
1180
|
-
if (
|
|
1194
|
+
if (zs(s))
|
|
1181
1195
|
return {
|
|
1182
1196
|
kind: "age-safety",
|
|
1183
1197
|
type: s
|
|
@@ -1188,7 +1202,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1188
1202
|
kind: "dm-agent",
|
|
1189
1203
|
type: n
|
|
1190
1204
|
};
|
|
1191
|
-
},
|
|
1205
|
+
}, Vs = (t) => {
|
|
1192
1206
|
const s = t.indexOf(Ae);
|
|
1193
1207
|
if (s === -1)
|
|
1194
1208
|
return t;
|
|
@@ -1198,7 +1212,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1198
1212
|
/* @__PURE__ */ e(
|
|
1199
1213
|
"a",
|
|
1200
1214
|
{
|
|
1201
|
-
href:
|
|
1215
|
+
href: js,
|
|
1202
1216
|
target: "_blank",
|
|
1203
1217
|
rel: "noopener noreferrer",
|
|
1204
1218
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1207,13 +1221,13 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1207
1221
|
),
|
|
1208
1222
|
t.slice(n)
|
|
1209
1223
|
] });
|
|
1210
|
-
},
|
|
1211
|
-
var
|
|
1212
|
-
const s = t.message.hide_date === !0, n =
|
|
1224
|
+
}, Ys = (t) => {
|
|
1225
|
+
var o, l;
|
|
1226
|
+
const s = t.message.hide_date === !0, n = Hs(
|
|
1213
1227
|
t.message
|
|
1214
1228
|
);
|
|
1215
1229
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1216
|
-
const d = ((
|
|
1230
|
+
const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Bs[n.type];
|
|
1217
1231
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1218
1232
|
/* @__PURE__ */ i(
|
|
1219
1233
|
"div",
|
|
@@ -1239,7 +1253,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1239
1253
|
] });
|
|
1240
1254
|
}
|
|
1241
1255
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1242
|
-
const d = ((l = t.message.text) == null ? void 0 : l.trim()) ||
|
|
1256
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || $s[n.type];
|
|
1243
1257
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1244
1258
|
/* @__PURE__ */ i(
|
|
1245
1259
|
"div",
|
|
@@ -1258,7 +1272,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1258
1272
|
"data-testid": "age-safety-system-message-icon"
|
|
1259
1273
|
}
|
|
1260
1274
|
),
|
|
1261
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1275
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Vs(d) }) })
|
|
1262
1276
|
]
|
|
1263
1277
|
}
|
|
1264
1278
|
),
|
|
@@ -1273,7 +1287,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1273
1287
|
] }),
|
|
1274
1288
|
!s && /* @__PURE__ */ e(De, { message: t.message })
|
|
1275
1289
|
] });
|
|
1276
|
-
},
|
|
1290
|
+
}, Ws = () => null, qs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1277
1291
|
"div",
|
|
1278
1292
|
{
|
|
1279
1293
|
className: A("flex items-center justify-center h-full", t),
|
|
@@ -1317,30 +1331,30 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1317
1331
|
]
|
|
1318
1332
|
}
|
|
1319
1333
|
), Se = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1320
|
-
/* @__PURE__ */ e(
|
|
1334
|
+
/* @__PURE__ */ e(qs, { className: "w-6 h-6" }),
|
|
1321
1335
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1322
1336
|
] }) }));
|
|
1323
1337
|
Se.displayName = "LoadingState";
|
|
1324
|
-
const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
1338
|
+
const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Zs = ({
|
|
1325
1339
|
onBack: t,
|
|
1326
1340
|
showBackButton: s,
|
|
1327
1341
|
onShowInfo: n,
|
|
1328
|
-
canShowInfo:
|
|
1342
|
+
canShowInfo: o,
|
|
1329
1343
|
showStarButton: l = !1
|
|
1330
1344
|
}) => {
|
|
1331
|
-
var C,
|
|
1345
|
+
var C, S, m, v, r;
|
|
1332
1346
|
const { channel: d } = Ie(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1333
1347
|
(M) => {
|
|
1334
1348
|
var N;
|
|
1335
1349
|
return ((N = M.user) == null ? void 0 : N.id) && M.user.id !== d._client.userID;
|
|
1336
1350
|
}
|
|
1337
|
-
), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((
|
|
1351
|
+
), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((S = a == null ? void 0 : a.user) == null ? void 0 : S.id) || "Unknown member", g = (m = a == null ? void 0 : a.user) == null ? void 0 : m.image, h = st(d), b = async () => {
|
|
1338
1352
|
try {
|
|
1339
1353
|
h ? await d.unpin() : await d.pin();
|
|
1340
|
-
} catch (
|
|
1354
|
+
} catch (p) {
|
|
1341
1355
|
console.error(
|
|
1342
1356
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1343
|
-
|
|
1357
|
+
p
|
|
1344
1358
|
);
|
|
1345
1359
|
}
|
|
1346
1360
|
};
|
|
@@ -1361,7 +1375,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1361
1375
|
/* @__PURE__ */ e(
|
|
1362
1376
|
ie,
|
|
1363
1377
|
{
|
|
1364
|
-
id: ((
|
|
1378
|
+
id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
|
|
1365
1379
|
name: c,
|
|
1366
1380
|
image: g,
|
|
1367
1381
|
starred: l && h,
|
|
@@ -1417,7 +1431,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1417
1431
|
/* @__PURE__ */ e(
|
|
1418
1432
|
ie,
|
|
1419
1433
|
{
|
|
1420
|
-
id: ((
|
|
1434
|
+
id: ((r = a == null ? void 0 : a.user) == null ? void 0 : r.id) || d.id || "unknown",
|
|
1421
1435
|
name: c,
|
|
1422
1436
|
image: g,
|
|
1423
1437
|
starred: l && h,
|
|
@@ -1446,7 +1460,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1446
1460
|
)
|
|
1447
1461
|
}
|
|
1448
1462
|
),
|
|
1449
|
-
|
|
1463
|
+
o && n && /* @__PURE__ */ e(
|
|
1450
1464
|
"button",
|
|
1451
1465
|
{
|
|
1452
1466
|
className: ue,
|
|
@@ -1459,11 +1473,11 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1459
1473
|
] })
|
|
1460
1474
|
] })
|
|
1461
1475
|
] });
|
|
1462
|
-
},
|
|
1476
|
+
}, Js = ({
|
|
1463
1477
|
onBack: t,
|
|
1464
1478
|
showBackButton: s,
|
|
1465
1479
|
renderMessageInputActions: n,
|
|
1466
|
-
renderConversationFooter:
|
|
1480
|
+
renderConversationFooter: o,
|
|
1467
1481
|
onLeaveConversation: l,
|
|
1468
1482
|
onBlockParticipant: d,
|
|
1469
1483
|
showDeleteConversation: a = !0,
|
|
@@ -1472,17 +1486,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1472
1486
|
onReportParticipantClick: h,
|
|
1473
1487
|
showStarButton: b = !1,
|
|
1474
1488
|
chatbotVotingEnabled: C = !1,
|
|
1475
|
-
onAttachmentUnlock:
|
|
1489
|
+
onAttachmentUnlock: S,
|
|
1476
1490
|
onAttachmentDownload: m,
|
|
1477
|
-
renderChannelBanner:
|
|
1478
|
-
customProfileContent:
|
|
1479
|
-
customChannelActions:
|
|
1491
|
+
renderChannelBanner: v,
|
|
1492
|
+
customProfileContent: r,
|
|
1493
|
+
customChannelActions: p,
|
|
1480
1494
|
renderMessage: M
|
|
1481
1495
|
}) => {
|
|
1482
|
-
const { channel: N } = Ie(),
|
|
1483
|
-
(
|
|
1484
|
-
var
|
|
1485
|
-
return ((
|
|
1496
|
+
const { channel: N } = Ie(), w = Q(null), _ = F.useMemo(() => Object.values(N.state.members || {}).find(
|
|
1497
|
+
(E) => {
|
|
1498
|
+
var y;
|
|
1499
|
+
return ((y = E.user) == null ? void 0 : y.id) && E.user.id !== N._client.userID;
|
|
1486
1500
|
}
|
|
1487
1501
|
), [N._client.userID, N.state.members]), L = F.useMemo(() => {
|
|
1488
1502
|
const f = N.data ?? {};
|
|
@@ -1492,10 +1506,10 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1492
1506
|
return f.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1493
1507
|
}, [N.data]), x = U(() => {
|
|
1494
1508
|
var f;
|
|
1495
|
-
(f =
|
|
1509
|
+
(f = w.current) == null || f.showModal();
|
|
1496
1510
|
}, []), u = U(() => {
|
|
1497
1511
|
var f;
|
|
1498
|
-
(f =
|
|
1512
|
+
(f = w.current) == null || f.close();
|
|
1499
1513
|
}, []);
|
|
1500
1514
|
return /* @__PURE__ */ i(he, { children: [
|
|
1501
1515
|
/* @__PURE__ */ e(
|
|
@@ -1503,30 +1517,30 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1503
1517
|
{
|
|
1504
1518
|
overrides: {
|
|
1505
1519
|
Message: (f) => {
|
|
1506
|
-
const { message:
|
|
1507
|
-
|
|
1520
|
+
const { message: E } = Qe("ChannelView"), y = /* @__PURE__ */ e(
|
|
1521
|
+
Rs,
|
|
1508
1522
|
{
|
|
1509
1523
|
...f,
|
|
1510
1524
|
chatbotVotingEnabled: C,
|
|
1511
|
-
onAttachmentUnlock:
|
|
1525
|
+
onAttachmentUnlock: S,
|
|
1512
1526
|
onAttachmentDownload: m
|
|
1513
1527
|
}
|
|
1514
1528
|
);
|
|
1515
|
-
return !M || !
|
|
1529
|
+
return !M || !E ? y : M(y, E);
|
|
1516
1530
|
}
|
|
1517
1531
|
},
|
|
1518
1532
|
children: /* @__PURE__ */ i(Xt, { children: [
|
|
1519
1533
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1520
|
-
|
|
1534
|
+
Zs,
|
|
1521
1535
|
{
|
|
1522
1536
|
onBack: t,
|
|
1523
1537
|
showBackButton: s,
|
|
1524
1538
|
onShowInfo: x,
|
|
1525
|
-
canShowInfo: !!
|
|
1539
|
+
canShowInfo: !!_,
|
|
1526
1540
|
showStarButton: b
|
|
1527
1541
|
}
|
|
1528
1542
|
) }),
|
|
1529
|
-
|
|
1543
|
+
v == null ? void 0 : v(),
|
|
1530
1544
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1531
1545
|
Kt,
|
|
1532
1546
|
{
|
|
@@ -1535,9 +1549,9 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1535
1549
|
messageActions: void 0
|
|
1536
1550
|
}
|
|
1537
1551
|
) }),
|
|
1538
|
-
|
|
1552
|
+
o == null ? void 0 : o(N),
|
|
1539
1553
|
/* @__PURE__ */ e(
|
|
1540
|
-
|
|
1554
|
+
Fs,
|
|
1541
1555
|
{
|
|
1542
1556
|
renderActions: () => n == null ? void 0 : n(N)
|
|
1543
1557
|
}
|
|
@@ -1546,11 +1560,11 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1546
1560
|
}
|
|
1547
1561
|
),
|
|
1548
1562
|
/* @__PURE__ */ e(
|
|
1549
|
-
|
|
1563
|
+
ps,
|
|
1550
1564
|
{
|
|
1551
|
-
dialogRef:
|
|
1565
|
+
dialogRef: w,
|
|
1552
1566
|
onClose: u,
|
|
1553
|
-
participant:
|
|
1567
|
+
participant: _,
|
|
1554
1568
|
channel: N,
|
|
1555
1569
|
followerStatusLabel: L,
|
|
1556
1570
|
onLeaveConversation: l,
|
|
@@ -1559,8 +1573,8 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1559
1573
|
onDeleteConversationClick: c,
|
|
1560
1574
|
onBlockParticipantClick: g,
|
|
1561
1575
|
onReportParticipantClick: h,
|
|
1562
|
-
customProfileContent:
|
|
1563
|
-
customChannelActions:
|
|
1576
|
+
customProfileContent: r,
|
|
1577
|
+
customChannelActions: p
|
|
1564
1578
|
}
|
|
1565
1579
|
)
|
|
1566
1580
|
] });
|
|
@@ -1569,47 +1583,47 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1569
1583
|
channel: t,
|
|
1570
1584
|
onBack: s,
|
|
1571
1585
|
showBackButton: n = !1,
|
|
1572
|
-
renderMessageInputActions:
|
|
1586
|
+
renderMessageInputActions: o,
|
|
1573
1587
|
renderConversationFooter: l,
|
|
1574
1588
|
onLeaveConversation: d,
|
|
1575
1589
|
onBlockParticipant: a,
|
|
1576
1590
|
className: c,
|
|
1577
|
-
CustomChannelEmptyState: g =
|
|
1591
|
+
CustomChannelEmptyState: g = Ws,
|
|
1578
1592
|
showDeleteConversation: h = !0,
|
|
1579
1593
|
onDeleteConversationClick: b,
|
|
1580
1594
|
onBlockParticipantClick: C,
|
|
1581
|
-
onReportParticipantClick:
|
|
1595
|
+
onReportParticipantClick: S,
|
|
1582
1596
|
dmAgentEnabled: m,
|
|
1583
|
-
messageMetadata:
|
|
1584
|
-
onMessageSent:
|
|
1585
|
-
showStarButton:
|
|
1597
|
+
messageMetadata: v,
|
|
1598
|
+
onMessageSent: r,
|
|
1599
|
+
showStarButton: p = !1,
|
|
1586
1600
|
chatbotVotingEnabled: M = !1,
|
|
1587
1601
|
onAttachmentUnlock: N,
|
|
1588
|
-
onAttachmentDownload:
|
|
1589
|
-
renderChannelBanner:
|
|
1602
|
+
onAttachmentDownload: w,
|
|
1603
|
+
renderChannelBanner: _,
|
|
1590
1604
|
customProfileContent: L,
|
|
1591
1605
|
customChannelActions: x,
|
|
1592
1606
|
renderMessage: u
|
|
1593
1607
|
}) => {
|
|
1594
1608
|
const f = U(
|
|
1595
|
-
async (
|
|
1609
|
+
async (E, y, D) => {
|
|
1596
1610
|
var J;
|
|
1597
1611
|
const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, T = m && !G, $ = {
|
|
1598
|
-
...
|
|
1612
|
+
...y,
|
|
1599
1613
|
...T && { silent: !0 },
|
|
1600
|
-
...
|
|
1614
|
+
...v && {
|
|
1601
1615
|
metadata: {
|
|
1602
|
-
...
|
|
1603
|
-
...
|
|
1616
|
+
...y.metadata ?? {},
|
|
1617
|
+
...v
|
|
1604
1618
|
}
|
|
1605
1619
|
}
|
|
1606
1620
|
}, se = {
|
|
1607
1621
|
...D,
|
|
1608
1622
|
...T && { skip_push: !0 }
|
|
1609
1623
|
}, Z = await t.sendMessage($, se);
|
|
1610
|
-
return
|
|
1624
|
+
return r == null || r(Z), Z;
|
|
1611
1625
|
},
|
|
1612
|
-
[t, m,
|
|
1626
|
+
[t, m, v, r]
|
|
1613
1627
|
);
|
|
1614
1628
|
return /* @__PURE__ */ e(
|
|
1615
1629
|
"div",
|
|
@@ -1622,17 +1636,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1622
1636
|
Zt,
|
|
1623
1637
|
{
|
|
1624
1638
|
channel: t,
|
|
1625
|
-
MessageSystem:
|
|
1639
|
+
MessageSystem: Ys,
|
|
1626
1640
|
EmptyStateIndicator: g,
|
|
1627
1641
|
LoadingIndicator: Se,
|
|
1628
|
-
DateSeparator:
|
|
1642
|
+
DateSeparator: ys,
|
|
1629
1643
|
doSendMessageRequest: f,
|
|
1630
1644
|
children: /* @__PURE__ */ e(
|
|
1631
|
-
|
|
1645
|
+
Js,
|
|
1632
1646
|
{
|
|
1633
1647
|
onBack: s,
|
|
1634
1648
|
showBackButton: n,
|
|
1635
|
-
renderMessageInputActions:
|
|
1649
|
+
renderMessageInputActions: o,
|
|
1636
1650
|
renderConversationFooter: l,
|
|
1637
1651
|
onLeaveConversation: d,
|
|
1638
1652
|
onBlockParticipant: a,
|
|
@@ -1640,12 +1654,12 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1640
1654
|
showDeleteConversation: h,
|
|
1641
1655
|
onDeleteConversationClick: b,
|
|
1642
1656
|
onBlockParticipantClick: C,
|
|
1643
|
-
onReportParticipantClick:
|
|
1644
|
-
showStarButton:
|
|
1657
|
+
onReportParticipantClick: S,
|
|
1658
|
+
showStarButton: p,
|
|
1645
1659
|
chatbotVotingEnabled: M,
|
|
1646
1660
|
onAttachmentUnlock: N,
|
|
1647
|
-
onAttachmentDownload:
|
|
1648
|
-
renderChannelBanner:
|
|
1661
|
+
onAttachmentDownload: w,
|
|
1662
|
+
renderChannelBanner: _,
|
|
1649
1663
|
customProfileContent: L,
|
|
1650
1664
|
customChannelActions: x,
|
|
1651
1665
|
renderMessage: u
|
|
@@ -1658,12 +1672,12 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1658
1672
|
}
|
|
1659
1673
|
);
|
|
1660
1674
|
it.displayName = "ChannelView";
|
|
1661
|
-
function
|
|
1675
|
+
function Xs({
|
|
1662
1676
|
searchQuery: t,
|
|
1663
1677
|
setSearchQuery: s,
|
|
1664
1678
|
placeholder: n
|
|
1665
1679
|
}) {
|
|
1666
|
-
const
|
|
1680
|
+
const o = Q(null);
|
|
1667
1681
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1668
1682
|
/* @__PURE__ */ e(
|
|
1669
1683
|
rs,
|
|
@@ -1675,7 +1689,7 @@ function Js({
|
|
|
1675
1689
|
/* @__PURE__ */ e(
|
|
1676
1690
|
"input",
|
|
1677
1691
|
{
|
|
1678
|
-
ref:
|
|
1692
|
+
ref: o,
|
|
1679
1693
|
type: "text",
|
|
1680
1694
|
placeholder: n,
|
|
1681
1695
|
value: t,
|
|
@@ -1689,7 +1703,7 @@ function Js({
|
|
|
1689
1703
|
label: "Clear search",
|
|
1690
1704
|
onClick: () => {
|
|
1691
1705
|
var l;
|
|
1692
|
-
s(""), (l =
|
|
1706
|
+
s(""), (l = o.current) == null || l.focus();
|
|
1693
1707
|
},
|
|
1694
1708
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1695
1709
|
children: /* @__PURE__ */ e(Oe, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -1697,16 +1711,16 @@ function Js({
|
|
|
1697
1711
|
)
|
|
1698
1712
|
] });
|
|
1699
1713
|
}
|
|
1700
|
-
const
|
|
1714
|
+
const Ks = ({
|
|
1701
1715
|
participantSource: t,
|
|
1702
1716
|
onSelectParticipant: s,
|
|
1703
1717
|
onClose: n,
|
|
1704
|
-
existingParticipantIds:
|
|
1718
|
+
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1705
1719
|
participantLabel: l = "participants",
|
|
1706
1720
|
searchPlaceholder: d = "Search participants...",
|
|
1707
1721
|
className: a
|
|
1708
1722
|
}) => {
|
|
1709
|
-
const { debug: c } = Me(), [g, h] = k(""), [b, C] = k([]), [
|
|
1723
|
+
const { debug: c } = Me(), [g, h] = k(""), [b, C] = k([]), [S, m] = k(!1), [v, r] = k(null), [p, M] = k(
|
|
1710
1724
|
null
|
|
1711
1725
|
), N = Q(!1);
|
|
1712
1726
|
X(() => {
|
|
@@ -1720,7 +1734,7 @@ const Xs = ({
|
|
|
1720
1734
|
}
|
|
1721
1735
|
if (N.current) return;
|
|
1722
1736
|
(async () => {
|
|
1723
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."), m(!0),
|
|
1737
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), m(!0), r(null);
|
|
1724
1738
|
try {
|
|
1725
1739
|
const u = await t.loadParticipants({
|
|
1726
1740
|
search: "",
|
|
@@ -1733,20 +1747,20 @@ const Xs = ({
|
|
|
1733
1747
|
);
|
|
1734
1748
|
} catch (u) {
|
|
1735
1749
|
const f = u instanceof Error ? u.message : "Failed to load participants";
|
|
1736
|
-
|
|
1750
|
+
r(f), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1737
1751
|
} finally {
|
|
1738
1752
|
m(!1);
|
|
1739
1753
|
}
|
|
1740
1754
|
})();
|
|
1741
1755
|
}, [t, c]);
|
|
1742
|
-
const
|
|
1756
|
+
const w = b.filter((x) => !o.has(x.id)).filter((x) => {
|
|
1743
1757
|
var f;
|
|
1744
1758
|
if (!g) return !0;
|
|
1745
1759
|
const u = g.toLowerCase();
|
|
1746
1760
|
return x.name.toLowerCase().includes(u) || ((f = x.email) == null ? void 0 : f.toLowerCase().includes(u)) || !1;
|
|
1747
|
-
}),
|
|
1761
|
+
}), _ = U(
|
|
1748
1762
|
async (x) => {
|
|
1749
|
-
if (!
|
|
1763
|
+
if (!p) {
|
|
1750
1764
|
M(x.id);
|
|
1751
1765
|
try {
|
|
1752
1766
|
await s(x);
|
|
@@ -1755,9 +1769,9 @@ const Xs = ({
|
|
|
1755
1769
|
}
|
|
1756
1770
|
}
|
|
1757
1771
|
},
|
|
1758
|
-
[s,
|
|
1772
|
+
[s, p]
|
|
1759
1773
|
), L = (x, u) => {
|
|
1760
|
-
(x.key === "Enter" || x.key === " ") && (x.preventDefault(),
|
|
1774
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), _(u));
|
|
1761
1775
|
};
|
|
1762
1776
|
return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", a), children: [
|
|
1763
1777
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
@@ -1769,12 +1783,12 @@ const Xs = ({
|
|
|
1769
1783
|
"Select a ",
|
|
1770
1784
|
l.slice(0, -1),
|
|
1771
1785
|
" to start messaging (",
|
|
1772
|
-
|
|
1786
|
+
w.length,
|
|
1773
1787
|
" available)",
|
|
1774
1788
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1775
1789
|
] }),
|
|
1776
1790
|
/* @__PURE__ */ e(
|
|
1777
|
-
|
|
1791
|
+
Xs,
|
|
1778
1792
|
{
|
|
1779
1793
|
searchQuery: g,
|
|
1780
1794
|
setSearchQuery: h,
|
|
@@ -1782,32 +1796,32 @@ const Xs = ({
|
|
|
1782
1796
|
}
|
|
1783
1797
|
)
|
|
1784
1798
|
] }),
|
|
1785
|
-
|
|
1799
|
+
v && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1786
1800
|
"Error loading ",
|
|
1787
1801
|
l,
|
|
1788
1802
|
": ",
|
|
1789
|
-
|
|
1803
|
+
v
|
|
1790
1804
|
] }),
|
|
1791
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1805
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && w.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: [
|
|
1792
1806
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1793
1807
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1794
1808
|
"Loading ",
|
|
1795
1809
|
l,
|
|
1796
1810
|
"..."
|
|
1797
1811
|
] })
|
|
1798
|
-
] }) }) :
|
|
1812
|
+
] }) }) : w.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1799
1813
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(We, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1800
1814
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1801
1815
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1802
1816
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1803
|
-
|
|
1817
|
+
w.map((x) => {
|
|
1804
1818
|
const u = x.name || x.email || x.id, f = x.email && x.name ? x.email : x.phone;
|
|
1805
1819
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1806
1820
|
"button",
|
|
1807
1821
|
{
|
|
1808
1822
|
type: "button",
|
|
1809
|
-
onClick: () =>
|
|
1810
|
-
onKeyDown: (
|
|
1823
|
+
onClick: () => _(x),
|
|
1824
|
+
onKeyDown: (E) => L(E, x),
|
|
1811
1825
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1812
1826
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1813
1827
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
@@ -1825,18 +1839,18 @@ const Xs = ({
|
|
|
1825
1839
|
f && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: f })
|
|
1826
1840
|
] })
|
|
1827
1841
|
] }),
|
|
1828
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1842
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: p === x.id ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(We, { className: "h-5 w-5 text-stone" }) })
|
|
1829
1843
|
] })
|
|
1830
1844
|
}
|
|
1831
1845
|
) }, x.id);
|
|
1832
1846
|
}),
|
|
1833
|
-
|
|
1847
|
+
S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1834
1848
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1835
1849
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1836
1850
|
] }) })
|
|
1837
1851
|
] }) })
|
|
1838
1852
|
] });
|
|
1839
|
-
},
|
|
1853
|
+
}, Qs = ({ className: t }) => /* @__PURE__ */ i(
|
|
1840
1854
|
"svg",
|
|
1841
1855
|
{
|
|
1842
1856
|
width: "140",
|
|
@@ -1972,7 +1986,7 @@ const Xs = ({
|
|
|
1972
1986
|
}
|
|
1973
1987
|
), ct = F.memo(
|
|
1974
1988
|
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
1975
|
-
/* @__PURE__ */ e(
|
|
1989
|
+
/* @__PURE__ */ e(Qs, {}),
|
|
1976
1990
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1977
1991
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1978
1992
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
@@ -1995,11 +2009,11 @@ const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1995
2009
|
)
|
|
1996
2010
|
] }) }));
|
|
1997
2011
|
Ee.displayName = "ErrorState";
|
|
1998
|
-
const
|
|
2012
|
+
const dn = ({
|
|
1999
2013
|
capabilities: t = {},
|
|
2000
2014
|
className: s,
|
|
2001
2015
|
renderMessageInputActions: n,
|
|
2002
|
-
renderConversationFooter:
|
|
2016
|
+
renderConversationFooter: o,
|
|
2003
2017
|
onChannelSelect: l,
|
|
2004
2018
|
onParticipantSelect: d,
|
|
2005
2019
|
initialParticipantFilter: a,
|
|
@@ -2008,21 +2022,21 @@ const cn = ({
|
|
|
2008
2022
|
showChannelList: h = !0,
|
|
2009
2023
|
filters: b,
|
|
2010
2024
|
channelRenderFilterFn: C,
|
|
2011
|
-
channelListCustomEmptyStateIndicator:
|
|
2025
|
+
channelListCustomEmptyStateIndicator: S,
|
|
2012
2026
|
onDeleteConversationClick: m,
|
|
2013
|
-
onBlockParticipantClick:
|
|
2014
|
-
onReportParticipantClick:
|
|
2015
|
-
dmAgentEnabled:
|
|
2027
|
+
onBlockParticipantClick: v,
|
|
2028
|
+
onReportParticipantClick: r,
|
|
2029
|
+
dmAgentEnabled: p,
|
|
2016
2030
|
messageMetadata: M,
|
|
2017
2031
|
onMessageSent: N,
|
|
2018
|
-
showStarButton:
|
|
2019
|
-
chatbotVotingEnabled:
|
|
2032
|
+
showStarButton: w = !1,
|
|
2033
|
+
chatbotVotingEnabled: _ = !1,
|
|
2020
2034
|
renderMessagePreview: L,
|
|
2021
2035
|
renderChannelBanner: x,
|
|
2022
2036
|
customProfileContent: u,
|
|
2023
2037
|
customChannelActions: f,
|
|
2024
|
-
renderMessage:
|
|
2025
|
-
onAttachmentUnlock:
|
|
2038
|
+
renderMessage: E,
|
|
2039
|
+
onAttachmentUnlock: y,
|
|
2026
2040
|
onAttachmentDownload: D
|
|
2027
2041
|
}) => {
|
|
2028
2042
|
const {
|
|
@@ -2238,7 +2252,7 @@ const cn = ({
|
|
|
2238
2252
|
selectedChannel: V || void 0,
|
|
2239
2253
|
filters: be,
|
|
2240
2254
|
channelRenderFilterFn: C,
|
|
2241
|
-
customEmptyStateIndicator:
|
|
2255
|
+
customEmptyStateIndicator: S,
|
|
2242
2256
|
renderMessagePreview: L
|
|
2243
2257
|
}
|
|
2244
2258
|
)
|
|
@@ -2263,24 +2277,24 @@ const cn = ({
|
|
|
2263
2277
|
onBack: Ne,
|
|
2264
2278
|
showBackButton: !q,
|
|
2265
2279
|
renderMessageInputActions: n,
|
|
2266
|
-
renderConversationFooter:
|
|
2280
|
+
renderConversationFooter: o,
|
|
2267
2281
|
renderChannelBanner: x,
|
|
2268
2282
|
onLeaveConversation: mt,
|
|
2269
2283
|
onBlockParticipant: ut,
|
|
2270
2284
|
CustomChannelEmptyState: g,
|
|
2271
2285
|
showDeleteConversation: xe,
|
|
2272
2286
|
onDeleteConversationClick: m,
|
|
2273
|
-
onBlockParticipantClick:
|
|
2274
|
-
onReportParticipantClick:
|
|
2275
|
-
dmAgentEnabled:
|
|
2287
|
+
onBlockParticipantClick: v,
|
|
2288
|
+
onReportParticipantClick: r,
|
|
2289
|
+
dmAgentEnabled: p,
|
|
2276
2290
|
messageMetadata: M,
|
|
2277
2291
|
onMessageSent: N,
|
|
2278
|
-
showStarButton:
|
|
2279
|
-
chatbotVotingEnabled:
|
|
2292
|
+
showStarButton: w,
|
|
2293
|
+
chatbotVotingEnabled: _,
|
|
2280
2294
|
customProfileContent: u,
|
|
2281
2295
|
customChannelActions: f,
|
|
2282
|
-
renderMessage:
|
|
2283
|
-
onAttachmentUnlock:
|
|
2296
|
+
renderMessage: E,
|
|
2297
|
+
onAttachmentUnlock: y,
|
|
2284
2298
|
onAttachmentDownload: D
|
|
2285
2299
|
},
|
|
2286
2300
|
V.id
|
|
@@ -2306,7 +2320,7 @@ const cn = ({
|
|
|
2306
2320
|
onClick: dt,
|
|
2307
2321
|
onClose: ye,
|
|
2308
2322
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2309
|
-
|
|
2323
|
+
Ks,
|
|
2310
2324
|
{
|
|
2311
2325
|
participantSource: fe,
|
|
2312
2326
|
onSelectParticipant: pe,
|
|
@@ -2322,11 +2336,11 @@ const cn = ({
|
|
|
2322
2336
|
]
|
|
2323
2337
|
}
|
|
2324
2338
|
);
|
|
2325
|
-
},
|
|
2339
|
+
}, en = ({
|
|
2326
2340
|
question: t,
|
|
2327
2341
|
onClick: s,
|
|
2328
2342
|
loading: n = !1,
|
|
2329
|
-
className:
|
|
2343
|
+
className: o
|
|
2330
2344
|
}) => /* @__PURE__ */ e(
|
|
2331
2345
|
"button",
|
|
2332
2346
|
{
|
|
@@ -2340,15 +2354,15 @@ const cn = ({
|
|
|
2340
2354
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2341
2355
|
"opacity-50 cursor-not-allowed": n
|
|
2342
2356
|
},
|
|
2343
|
-
|
|
2357
|
+
o
|
|
2344
2358
|
),
|
|
2345
2359
|
children: t
|
|
2346
2360
|
}
|
|
2347
|
-
),
|
|
2361
|
+
), mn = ({
|
|
2348
2362
|
faqs: t,
|
|
2349
2363
|
onFaqClick: s,
|
|
2350
2364
|
loadingFaqId: n,
|
|
2351
|
-
headerText:
|
|
2365
|
+
headerText: o,
|
|
2352
2366
|
className: l,
|
|
2353
2367
|
avatarImage: d,
|
|
2354
2368
|
avatarName: a
|
|
@@ -2371,9 +2385,9 @@ const cn = ({
|
|
|
2371
2385
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2372
2386
|
style: { backgroundColor: "#F1F0EE" },
|
|
2373
2387
|
children: [
|
|
2374
|
-
|
|
2388
|
+
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2375
2389
|
c.map((g) => /* @__PURE__ */ e(
|
|
2376
|
-
|
|
2390
|
+
en,
|
|
2377
2391
|
{
|
|
2378
2392
|
question: g.question,
|
|
2379
2393
|
onClick: () => s(g.id),
|
|
@@ -2385,63 +2399,63 @@ const cn = ({
|
|
|
2385
2399
|
}
|
|
2386
2400
|
)
|
|
2387
2401
|
] }) });
|
|
2388
|
-
},
|
|
2389
|
-
const { initialSearch: n = "", pageSize:
|
|
2402
|
+
}, un = (t, s = {}) => {
|
|
2403
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = k([]), [a, c] = k(!1), [g, h] = k(null), [b, C] = k(n), [S, m] = k(!0), [v, r] = k(), p = U(async (_ = !1, L) => {
|
|
2390
2404
|
if (a) return;
|
|
2391
2405
|
const x = L !== void 0 ? L : b;
|
|
2392
2406
|
c(!0), h(null);
|
|
2393
2407
|
try {
|
|
2394
2408
|
const u = await t.loadParticipants({
|
|
2395
2409
|
search: x || void 0,
|
|
2396
|
-
limit:
|
|
2397
|
-
cursor:
|
|
2410
|
+
limit: o,
|
|
2411
|
+
cursor: _ ? void 0 : v
|
|
2398
2412
|
});
|
|
2399
2413
|
d(
|
|
2400
|
-
(f) =>
|
|
2401
|
-
), m(u.hasMore),
|
|
2414
|
+
(f) => _ ? u.participants : [...f, ...u.participants]
|
|
2415
|
+
), m(u.hasMore), r(u.nextCursor);
|
|
2402
2416
|
} catch (u) {
|
|
2403
2417
|
const f = u instanceof Error ? u.message : "Failed to load participants";
|
|
2404
2418
|
h(f), console.error("[useParticipants] Load error:", u);
|
|
2405
2419
|
} finally {
|
|
2406
2420
|
c(!1);
|
|
2407
2421
|
}
|
|
2408
|
-
}, [t, b,
|
|
2409
|
-
|
|
2410
|
-
}, [
|
|
2411
|
-
C(
|
|
2412
|
-
}, [
|
|
2413
|
-
|
|
2414
|
-
}, [
|
|
2422
|
+
}, [t, b, v, o, a]), M = U(() => {
|
|
2423
|
+
S && !a && p(!1);
|
|
2424
|
+
}, [S, a, p]), N = U((_) => {
|
|
2425
|
+
C(_), r(void 0), p(!0, _);
|
|
2426
|
+
}, [p]), w = U(() => {
|
|
2427
|
+
r(void 0), p(!0);
|
|
2428
|
+
}, [p]);
|
|
2415
2429
|
return X(() => {
|
|
2416
|
-
|
|
2430
|
+
p(!0);
|
|
2417
2431
|
}, [t.loadParticipants]), {
|
|
2418
2432
|
participants: l,
|
|
2419
2433
|
loading: a,
|
|
2420
2434
|
error: g,
|
|
2421
2435
|
searchQuery: b,
|
|
2422
|
-
hasMore:
|
|
2436
|
+
hasMore: S,
|
|
2423
2437
|
totalCount: t.totalCount,
|
|
2424
2438
|
loadMore: M,
|
|
2425
2439
|
search: N,
|
|
2426
|
-
refresh:
|
|
2440
|
+
refresh: w
|
|
2427
2441
|
};
|
|
2428
2442
|
};
|
|
2429
2443
|
export {
|
|
2430
2444
|
we as ActionButton,
|
|
2431
2445
|
ie as Avatar,
|
|
2432
|
-
|
|
2446
|
+
Ws as ChannelEmptyState,
|
|
2433
2447
|
rt as ChannelList,
|
|
2434
2448
|
it as ChannelView,
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2449
|
+
mn as FaqList,
|
|
2450
|
+
en as FaqListItem,
|
|
2451
|
+
Ss as LockedAttachment,
|
|
2452
|
+
ks as MessageVoteButtons,
|
|
2453
|
+
cn as MessagingProvider,
|
|
2454
|
+
dn as MessagingShell,
|
|
2455
|
+
Ks as ParticipantPicker,
|
|
2456
|
+
ms as formatRelativeTime,
|
|
2457
|
+
ws as useMessageVote,
|
|
2444
2458
|
os as useMessaging,
|
|
2445
|
-
|
|
2459
|
+
un as useParticipants
|
|
2446
2460
|
};
|
|
2447
2461
|
//# sourceMappingURL=index.js.map
|