@linktr.ee/messaging-react 1.22.2 → 1.22.3

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as e, jsxs as i, Fragment as ce } from "react/jsx-runtime";
2
2
  import R from "classnames";
3
- import A, { createContext as tt, useContext as st, useCallback as P, useState as _, useRef as q, useEffect as Y, useMemo as ye } from "react";
4
- import { StreamChatService as nt } from "@linktr.ee/messaging-core";
5
- import { Chat as at, ChannelList as rt, DateSeparator as ot, useChannelStateContext as Ie, useChatContext as Be, areMessageUIPropsEqual as lt, useMessageReminder as it, useComponentContext as ct, Attachment as dt, EditMessageModal as ut, MessageBlocked as mt, MessageBouncePrompt as ht, MessageDeleted as ft, MessageIsThreadReplyInChannelButtonIndicator as gt, MessageRepliesCountButton as xt, ReminderNotification as bt, StreamedMessageText as Ct, messageHasAttachments as Nt, messageHasReactions as vt, isDateSeparatorMessage as wt, isMessageBlocked as pt, isMessageBounced as yt, MessageBounceModal as Et, Poll as _t, MessageText as It, MessageErrorIcon as St, useMessageContext as Mt, useMessageComposer as kt, useStateStore as Dt, MessageInput as Tt, useMessageInputContext as Rt, useMessageComposerHasSendableData as Lt, SimpleAttachmentSelector as Pt, QuotedMessagePreview as Ut, AttachmentPreviewList as Ft, TextareaComposer as Ot, MessageTimestamp as De, Channel as At, WithComponents as Bt, Window as $t, MessageList as jt } from "stream-chat-react";
6
- import { GiftIcon as Gt, XIcon as Se, ArrowUpIcon as Ht, SparkleIcon as zt, ArrowLeftIcon as Te, StarIcon as Re, DotsThreeIcon as Le, SpinnerGapIcon as xe, SignOutIcon as Vt, ProhibitInsetIcon as Pe, FlagIcon as Wt, MagnifyingGlassIcon as qt, ChatCircleDotsIcon as Ue } from "@phosphor-icons/react";
3
+ import A, { createContext as st, useContext as nt, useCallback as P, useState as _, useRef as q, useEffect as Y, useMemo as ye } from "react";
4
+ import { StreamChatService as at } from "@linktr.ee/messaging-core";
5
+ import { Chat as rt, ChannelList as ot, DateSeparator as lt, useChannelStateContext as Ie, useChatContext as Be, areMessageUIPropsEqual as it, useMessageReminder as ct, useComponentContext as dt, Attachment as ut, EditMessageModal as mt, MessageBlocked as ht, MessageBouncePrompt as ft, MessageDeleted as gt, MessageIsThreadReplyInChannelButtonIndicator as xt, MessageRepliesCountButton as bt, ReminderNotification as Ct, StreamedMessageText as Nt, messageHasAttachments as vt, messageHasReactions as wt, isDateSeparatorMessage as pt, isMessageBlocked as yt, isMessageBounced as Et, MessageBounceModal as _t, Poll as It, MessageText as St, MessageErrorIcon as Mt, useMessageContext as kt, useMessageComposer as Dt, useStateStore as Tt, MessageInput as Rt, useMessageInputContext as Lt, useMessageComposerHasSendableData as Pt, SimpleAttachmentSelector as Ut, QuotedMessagePreview as Ft, AttachmentPreviewList as Ot, TextareaComposer as At, MessageTimestamp as De, Channel as Bt, WithComponents as $t, Window as jt, MessageList as Gt } from "stream-chat-react";
6
+ import { GiftIcon as Ht, XIcon as Se, ArrowUpIcon as Vt, SparkleIcon as zt, ArrowLeftIcon as Te, StarIcon as Re, DotsThreeIcon as Le, SpinnerGapIcon as xe, SignOutIcon as Wt, ProhibitInsetIcon as Pe, FlagIcon as qt, MagnifyingGlassIcon as Yt, ChatCircleDotsIcon as Ue } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as Fe } from "stream-chat";
8
- const $e = tt({
8
+ const $e = st({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const $e = tt({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), Ne = () => st($e), Os = ({
18
+ }), Ne = () => nt($e), $s = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -35,7 +35,7 @@ const $e = tt({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [m, x] = _(null), [g, C] = _(null), [b, w] = _(!1), [a, y] = _(!1), [I, v] = _(null), S = q(!1), N = q({
38
+ const [m, g] = _(null), [x, N] = _(null), [b, w] = _(!1), [a, y] = _(!1), [I, v] = _(null), S = q(!1), C = q({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
@@ -45,12 +45,12 @@ const $e = tt({
45
45
  renderCount: h.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: N.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: N.current.apiKey !== r,
50
- serviceConfigChanged: N.current.serviceConfig !== n,
51
- capabilitiesChanged: N.current.capabilities !== l
48
+ userChanged: C.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: C.current.apiKey !== r,
50
+ serviceConfigChanged: C.current.serviceConfig !== n,
51
+ capabilitiesChanged: C.current.capabilities !== l
52
52
  }
53
- }), N.current = {
53
+ }), C.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
@@ -64,8 +64,8 @@ const $e = tt({
64
64
  dependencies: {
65
65
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: N.current.serviceConfig === n,
68
- apiKeyStable: N.current.apiKey === r
67
+ serviceConfigStable: C.current.serviceConfig === n,
68
+ apiKeyStable: C.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
71
  o("⚠️ SERVICE INIT SKIPPED", {
@@ -77,14 +77,14 @@ const $e = tt({
77
77
  o("🚀 CREATING NEW SERVICE", {
78
78
  renderCount: c,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
- serviceConfigChanged: N.current.serviceConfig !== n
80
+ serviceConfigChanged: C.current.serviceConfig !== n
81
81
  });
82
- const d = new nt({
82
+ const d = new at({
83
83
  ...n,
84
84
  apiKey: r,
85
85
  debug: u
86
86
  });
87
- return x(d), o("✅ SERVICE SET", {
87
+ return g(d), o("✅ SERVICE SET", {
88
88
  renderCount: c,
89
89
  serviceInstance: !!d
90
90
  }), () => {
@@ -124,7 +124,7 @@ const $e = tt({
124
124
  try {
125
125
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
126
  const k = await m.connectUser(s);
127
- C(k), w(!0), p.current = { serviceId: m, userId: s.id }, o("✅ USER CONNECTION SUCCESS", {
127
+ N(k), w(!0), p.current = { serviceId: m, userId: s.id }, o("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: k.userID
130
130
  });
@@ -165,7 +165,7 @@ const $e = tt({
165
165
  try {
166
166
  o("🔌 DISCONNECTING FOR REFRESH"), await m.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
167
167
  const c = await m.connectUser(s);
168
- C(c), w(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ N(c), w(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (c) {
170
170
  const d = c instanceof Error ? c.message : "Refresh failed";
171
171
  v(d), o("❌ CONNECTION REFRESH ERROR", {
@@ -177,14 +177,14 @@ const $e = tt({
177
177
  }
178
178
  }, [m, s, o]), f = A.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!m,
180
- hasClient: !!g,
180
+ hasClient: !!x,
181
181
  isConnected: b,
182
182
  isLoading: a,
183
183
  hasError: !!I,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: m,
187
- client: g,
187
+ client: x,
188
188
  isConnected: b,
189
189
  isLoading: a,
190
190
  error: I,
@@ -193,7 +193,7 @@ const $e = tt({
193
193
  debug: u
194
194
  }), [
195
195
  m,
196
- g,
196
+ x,
197
197
  b,
198
198
  a,
199
199
  I,
@@ -204,30 +204,36 @@ const $e = tt({
204
204
  ]);
205
205
  return o("🔄 RENDER END", {
206
206
  renderCount: h.current,
207
- willRenderChat: !!(g && b),
207
+ willRenderChat: !!(x && b),
208
208
  contextValueReady: !!f
209
- }), /* @__PURE__ */ e($e.Provider, { value: f, children: g && b ? /* @__PURE__ */ e(
210
- at,
209
+ }), /* @__PURE__ */ e($e.Provider, { value: f, children: x && b ? /* @__PURE__ */ e(
210
+ rt,
211
211
  {
212
- client: g,
212
+ client: x,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, Yt = () => Ne(), Zt = (t, s) => {
219
+ }, Zt = () => Ne(), je = A.createContext({
220
+ selectedChannel: void 0,
221
+ onChannelSelect: () => {
222
+ },
223
+ debug: !1,
224
+ renderMessagePreview: void 0
225
+ }), Jt = je.Provider, Qt = () => A.useContext(je), Xt = (t, s) => {
220
226
  const n = new Date(
221
227
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
228
  ), l = new Date(
223
229
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
230
  ).getTime() - n.getTime();
225
231
  return Math.floor(l / (1e3 * 60 * 60 * 24));
226
- }, Jt = (t) => {
232
+ }, Kt = (t) => {
227
233
  const s = /* @__PURE__ */ new Date();
228
234
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
235
  return "Just now";
230
- const r = Zt(t, s);
236
+ const r = Xt(t, s);
231
237
  return r === 0 ? t.toLocaleTimeString([], {
232
238
  hour: "numeric",
233
239
  minute: "2-digit",
@@ -265,7 +271,7 @@ const $e = tt({
265
271
  "🍈"
266
272
  // Melon
267
273
  ];
268
- function Qt(t) {
274
+ function es(t) {
269
275
  let s = 0;
270
276
  for (let n = 0; n < t.length; n++) {
271
277
  const r = t.charCodeAt(n);
@@ -273,8 +279,8 @@ function Qt(t) {
273
279
  }
274
280
  return Math.abs(s);
275
281
  }
276
- function Xt(t) {
277
- const n = Qt(t) % Oe.length;
282
+ function ts(t) {
283
+ const n = es(t) % Oe.length;
278
284
  return Oe[n];
279
285
  }
280
286
  const ee = ({
@@ -284,7 +290,7 @@ const ee = ({
284
290
  className: r,
285
291
  shape: l = "squircle"
286
292
  }) => {
287
- const u = Xt(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", x = l === "circle" ? { borderRadius: "50%" } : {
293
+ const u = ts(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", g = l === "circle" ? { borderRadius: "50%" } : {
288
294
  borderRadius: "33%",
289
295
  "corner-shape": "superellipse(1.3)"
290
296
  };
@@ -295,7 +301,7 @@ const ee = ({
295
301
  style: {
296
302
  width: `${n}px`,
297
303
  height: `${n}px`,
298
- ...x
304
+ ...g
299
305
  },
300
306
  children: s ? /* @__PURE__ */ e(
301
307
  "img",
@@ -317,7 +323,7 @@ const ee = ({
317
323
  )
318
324
  }
319
325
  );
320
- }, Kt = ({ size: t = 15 }) => /* @__PURE__ */ e(
326
+ }, ss = ({ size: t = 15 }) => /* @__PURE__ */ e(
321
327
  "svg",
322
328
  {
323
329
  width: t,
@@ -334,18 +340,18 @@ const ee = ({
334
340
  }
335
341
  )
336
342
  }
337
- ), es = (t) => {
343
+ ), ns = (t) => {
338
344
  var s;
339
345
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
340
- }, ts = (t) => {
346
+ }, as = (t) => {
341
347
  var s;
342
348
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
343
349
  }, Me = (t) => {
344
350
  var s;
345
351
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
346
- }, je = (t) => es(t) || ts(t), ss = (t) => {
352
+ }, Ge = (t) => ns(t) || as(t), rs = (t) => {
347
353
  var s;
348
- return je(t) && !((s = t.text) != null && s.trim());
354
+ return Ge(t) && !((s = t.text) != null && s.trim());
349
355
  }, pe = ({
350
356
  message: t,
351
357
  standalone: s = !1,
@@ -353,7 +359,7 @@ const ee = ({
353
359
  hasAttachment: r = !1
354
360
  }) => {
355
361
  var b;
356
- const l = je(t), u = Me(t);
362
+ const l = Ge(t), u = Me(t);
357
363
  if (!l && !u)
358
364
  return null;
359
365
  if (l) {
@@ -361,43 +367,36 @@ const ee = ({
361
367
  if (!w) return null;
362
368
  const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${w} tip` : `Delivered with ${w} tip`;
363
369
  return /* @__PURE__ */ i("div", { className: a, children: [
364
- /* @__PURE__ */ e(Gt, { size: s ? 14 : 12 }),
370
+ /* @__PURE__ */ e(Ht, { size: s ? 14 : 12 }),
365
371
  /* @__PURE__ */ e("span", { children: y })
366
372
  ] });
367
373
  }
368
- const o = n && r, m = o ? "Sent with AI" : "Sent with DM Agent", x = [
374
+ const o = n && r, m = o ? "Sent with AI" : "Sent with DM Agent", g = [
369
375
  "message-chatbot-indicator",
370
376
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
371
377
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
372
- ].join(" "), g = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: m }), C = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Kt, { size: o ? 12 : 15 }) });
373
- return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ i(ce, { children: [
374
- g,
375
- C
378
+ ].join(" "), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: m }), N = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(ss, { size: o ? 12 : 15 }) });
379
+ return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ i(ce, { children: [
380
+ x,
381
+ N
376
382
  ] }) : /* @__PURE__ */ i(ce, { children: [
377
- C,
378
- g
383
+ N,
384
+ x
379
385
  ] }) });
380
- }, Ge = A.memo(
381
- ({
382
- channel: t,
383
- selectedChannel: s,
384
- onChannelSelect: n,
385
- debug: r = !1,
386
- unread: l,
387
- renderMessagePreview: u
388
- }) => {
386
+ }, He = A.memo(
387
+ ({ channel: t, unread: s }) => {
389
388
  var p, T, f, c;
390
- const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), m = () => {
391
- t && n(t);
392
- }, x = (d) => {
389
+ const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: u } = Qt(), o = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), m = () => {
390
+ t && r(t);
391
+ }, g = (d) => {
393
392
  const M = d.key === "Enter" || d.key === " ", k = d.repeat;
394
393
  !M || k || (d.preventDefault(), m());
395
- }, C = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
394
+ }, N = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
396
395
  (d) => {
397
396
  var M, k;
398
397
  return ((M = d.user) == null ? void 0 : M.id) && d.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
399
398
  }
400
- ), b = ((T = C == null ? void 0 : C.user) == null ? void 0 : T.name) || "Conversation", w = (f = C == null ? void 0 : C.user) == null ? void 0 : f.image, a = (() => {
399
+ ), b = ((T = N == null ? void 0 : N.user) == null ? void 0 : T.name) || "Conversation", w = (f = N == null ? void 0 : N.user) == null ? void 0 : f.image, a = (() => {
401
400
  var M;
402
401
  const d = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
403
402
  if (d != null && d.length) {
@@ -409,8 +408,8 @@ const ee = ({
409
408
  if (a != null && a.text) return a.text;
410
409
  const d = (M = a == null ? void 0 : a.attachments) == null ? void 0 : M[0];
411
410
  return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "📷 Sent an image" : d.type === "video" ? "🎥 Sent a video" : d.type === "audio" ? "🎵 Sent audio" : d.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
412
- })(), v = a != null && a.created_at ? Jt(new Date(a.created_at)) : "", S = a ? Me(a) : !1, N = u ? u(a, I) : `${S ? "✨ " : ""}${I}`, h = l ?? 0;
413
- return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
411
+ })(), v = a != null && a.created_at ? Kt(new Date(a.created_at)) : "", S = a ? Me(a) : !1, C = u ? u(a, I) : `${S ? "✨ " : ""}${I}`, h = s ?? 0;
412
+ return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
414
413
  channelId: t == null ? void 0 : t.id,
415
414
  isSelected: o,
416
415
  participantName: b,
@@ -422,7 +421,7 @@ const ee = ({
422
421
  role: "button",
423
422
  tabIndex: 0,
424
423
  onClick: m,
425
- onKeyDown: x,
424
+ onKeyDown: g,
426
425
  className: R(
427
426
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
428
427
  {
@@ -434,7 +433,7 @@ const ee = ({
434
433
  /* @__PURE__ */ e(
435
434
  ee,
436
435
  {
437
- id: ((c = C == null ? void 0 : C.user) == null ? void 0 : c.id) || t.id || "unknown",
436
+ id: ((c = N == null ? void 0 : N.user) == null ? void 0 : c.id) || t.id || "unknown",
438
437
  name: b,
439
438
  image: w,
440
439
  size: 44,
@@ -456,7 +455,7 @@ const ee = ({
456
455
  v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
457
456
  ] }),
458
457
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
459
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
458
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: C }),
460
459
  h > 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: h > 99 ? "99+" : h })
461
460
  ] })
462
461
  ] })
@@ -465,8 +464,8 @@ const ee = ({
465
464
  );
466
465
  }
467
466
  );
468
- Ge.displayName = "CustomChannelPreview";
469
- const He = A.memo(
467
+ He.displayName = "CustomChannelPreview";
468
+ const Ve = A.memo(
470
469
  ({
471
470
  onChannelSelect: t,
472
471
  selectedChannel: s,
@@ -483,16 +482,15 @@ const He = A.memo(
483
482
  selectedChannelId: s == null ? void 0 : s.id,
484
483
  filters: n
485
484
  });
486
- const x = A.useMemo(() => (C) => /* @__PURE__ */ e(
487
- Ge,
488
- {
489
- ...C,
485
+ const g = A.useMemo(
486
+ () => ({
490
487
  selectedChannel: s,
491
488
  onChannelSelect: t,
492
489
  debug: m,
493
490
  renderMessagePreview: u
494
- }
495
- ), [s, t, m, u]);
491
+ }),
492
+ [s, t, m, u]
493
+ );
496
494
  return /* @__PURE__ */ e(
497
495
  "div",
498
496
  {
@@ -500,22 +498,22 @@ const He = A.memo(
500
498
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
501
499
  r
502
500
  ),
503
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
504
- rt,
501
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Jt, { value: g, children: /* @__PURE__ */ e(
502
+ ot,
505
503
  {
506
504
  filters: n,
507
505
  sort: { last_message_at: -1 },
508
506
  options: { limit: 30 },
509
- Preview: x,
507
+ Preview: He,
510
508
  EmptyStateIndicator: l
511
509
  },
512
510
  JSON.stringify(n)
513
- ) })
511
+ ) }) })
514
512
  }
515
513
  );
516
514
  }
517
515
  );
518
- He.displayName = "ChannelList";
516
+ Ve.displayName = "ChannelList";
519
517
  const ge = ({
520
518
  variant: t = "default",
521
519
  className: s,
@@ -555,16 +553,16 @@ function ze({ label: t, className: s, children: n, ...r }) {
555
553
  }
556
554
  );
557
555
  }
558
- function Ve({ onClick: t }) {
556
+ function We({ onClick: t }) {
559
557
  return /* @__PURE__ */ e(ze, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-stone", weight: "bold" }) });
560
558
  }
561
- const ns = (t) => /* @__PURE__ */ e(ot, { ...t, position: "center" }), Ee = "vote_up", _e = "vote_down";
562
- function as(t) {
559
+ const os = (t) => /* @__PURE__ */ e(lt, { ...t, position: "center" }), Ee = "vote_up", _e = "vote_down";
560
+ function ls(t) {
563
561
  return t != null && t.length ? t.some((s) => s.type === _e) ? "down" : t.some((s) => s.type === Ee) ? "up" : null : null;
564
562
  }
565
- function rs(t) {
563
+ function is(t) {
566
564
  const { channel: s } = Ie(), { client: n } = Be("useMessageVote"), r = ye(
567
- () => as(t.own_reactions),
565
+ () => ls(t.own_reactions),
568
566
  [t.own_reactions]
569
567
  ), l = P(async () => {
570
568
  if (n != null && n.userID)
@@ -589,7 +587,7 @@ function rs(t) {
589
587
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
590
588
  return { selected: r, voteUp: l, voteDown: u };
591
589
  }
592
- const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
590
+ const cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
593
591
  "path",
594
592
  {
595
593
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -599,7 +597,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
599
597
  strokeLinejoin: "round",
600
598
  fill: t ? "currentColor" : "none"
601
599
  }
602
- ) }), ls = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
600
+ ) }), ds = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
603
601
  "path",
604
602
  {
605
603
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -609,7 +607,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
609
607
  strokeLinejoin: "round",
610
608
  fill: t ? "currentColor" : "none"
611
609
  }
612
- ) }), is = ({
610
+ ) }), us = ({
613
611
  selected: t,
614
612
  onVoteUp: s,
615
613
  onVoteDown: n
@@ -622,7 +620,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
622
620
  onClick: s,
623
621
  "aria-label": "Helpful",
624
622
  "aria-pressed": t === "up",
625
- children: /* @__PURE__ */ e(os, { filled: t === "up" })
623
+ children: /* @__PURE__ */ e(cs, { filled: t === "up" })
626
624
  }
627
625
  ),
628
626
  /* @__PURE__ */ e(
@@ -633,10 +631,10 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
633
631
  onClick: n,
634
632
  "aria-label": "Not helpful",
635
633
  "aria-pressed": t === "down",
636
- children: /* @__PURE__ */ e(ls, { filled: t === "down" })
634
+ children: /* @__PURE__ */ e(ds, { filled: t === "down" })
637
635
  }
638
636
  )
639
- ] }), cs = (t) => {
637
+ ] }), ms = (t) => {
640
638
  var me, K;
641
639
  const {
642
640
  additionalMessageInputProps: s,
@@ -646,41 +644,41 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
646
644
  firstOfGroup: u,
647
645
  groupedByUser: o,
648
646
  handleAction: m,
649
- handleOpenThread: x,
650
- handleRetry: g,
651
- highlighted: C,
647
+ handleOpenThread: g,
648
+ handleRetry: x,
649
+ highlighted: N,
652
650
  isMessageAIGenerated: b,
653
651
  isMyMessage: w,
654
652
  message: a,
655
653
  renderText: y,
656
654
  threadList: I
657
- } = t, { client: v } = Be("CustomMessage"), [S, N] = _(!1), h = it(a.id), { selected: p, voteUp: T, voteDown: f } = rs(a), {
658
- Attachment: c = dt,
659
- EditMessageModal: d = ut,
660
- MessageBlocked: M = mt,
661
- MessageBouncePrompt: k = ht,
662
- MessageDeleted: B = ft,
663
- MessageIsThreadReplyInChannelButtonIndicator: D = gt,
664
- MessageRepliesCountButton: W = xt,
665
- ReminderNotification: z = bt,
666
- StreamedMessageText: te = Ct,
655
+ } = t, { client: v } = Be("CustomMessage"), [S, C] = _(!1), h = ct(a.id), { selected: p, voteUp: T, voteDown: f } = is(a), {
656
+ Attachment: c = ut,
657
+ EditMessageModal: d = mt,
658
+ MessageBlocked: M = ht,
659
+ MessageBouncePrompt: k = ft,
660
+ MessageDeleted: B = gt,
661
+ MessageIsThreadReplyInChannelButtonIndicator: D = xt,
662
+ MessageRepliesCountButton: W = bt,
663
+ ReminderNotification: V = Ct,
664
+ StreamedMessageText: te = Nt,
667
665
  PinIndicator: J
668
- } = ct("CustomMessage"), se = Nt(a), ne = vt(a), ie = ye(
666
+ } = dt("CustomMessage"), se = vt(a), ne = wt(a), ie = ye(
669
667
  () => b == null ? void 0 : b(a),
670
668
  [b, a]
671
669
  ), $ = ye(
672
670
  () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
673
671
  [a]
674
672
  );
675
- if (wt(a))
673
+ if (pt(a))
676
674
  return null;
677
675
  if (a.deleted_at || a.type === "deleted")
678
676
  return /* @__PURE__ */ e(B, { message: a });
679
- if (pt(a))
677
+ if (yt(a))
680
678
  return /* @__PURE__ */ e(M, {});
681
- const Q = !I && !!a.reply_count, U = !I && a.show_in_channel && a.parent_id, F = a.status === "failed" && ((me = a.error) == null ? void 0 : me.status) !== 403, V = yt(a);
679
+ const Q = !I && !!a.reply_count, U = !I && a.show_in_channel && a.parent_id, F = a.status === "failed" && ((me = a.error) == null ? void 0 : me.status) !== 403, z = Et(a);
682
680
  let L;
683
- F ? L = () => g(a) : V && (L = () => N(!0));
681
+ F ? L = () => x(a) : z && (L = () => C(!0));
684
682
  const G = w(), de = R(
685
683
  "str-chat__message str-chat__message-simple",
686
684
  `str-chat__message--${a.type}`,
@@ -689,7 +687,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
689
687
  a.text ? "str-chat__message--has-text" : "has-no-text",
690
688
  {
691
689
  "str-chat__message--has-attachment": se,
692
- "str-chat__message--highlighted": C,
690
+ "str-chat__message--highlighted": N,
693
691
  "str-chat__message--pinned pinned-message": a.pinned,
694
692
  "str-chat__message--with-reactions": ne,
695
693
  "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((K = a == null ? void 0 : a.error) == null ? void 0 : K.status) !== 403,
@@ -698,7 +696,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
698
696
  "str-chat__virtual-message__wrapper--first": u,
699
697
  "str-chat__virtual-message__wrapper--group": o
700
698
  }
701
- ), Z = a.poll_id && v.polls.fromState(a.poll_id), ae = ss(a), X = Me(a), re = !!($ != null && $.length && !a.quoted_message), ue = X && G && re;
699
+ ), Z = a.poll_id && v.polls.fromState(a.poll_id), ae = rs(a), X = Me(a), re = !!($ != null && $.length && !a.quoted_message), ue = X && G && re;
702
700
  return /* @__PURE__ */ i(ce, { children: [
703
701
  r && /* @__PURE__ */ e(
704
702
  d,
@@ -707,16 +705,16 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
707
705
  }
708
706
  ),
709
707
  S && /* @__PURE__ */ e(
710
- Et,
708
+ _t,
711
709
  {
712
710
  MessageBouncePrompt: k,
713
- onClose: () => N(!1),
711
+ onClose: () => C(!1),
714
712
  open: S
715
713
  }
716
714
  ),
717
715
  /* @__PURE__ */ i("div", { className: de, children: [
718
716
  J && /* @__PURE__ */ e(J, {}),
719
- !!h && /* @__PURE__ */ e(z, { reminder: h }),
717
+ !!h && /* @__PURE__ */ e(V, { reminder: h }),
720
718
  a.user && /* @__PURE__ */ e(
721
719
  ee,
722
720
  {
@@ -730,7 +728,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
730
728
  "div",
731
729
  {
732
730
  className: R("str-chat__message-inner", {
733
- "str-chat__simple-message--error-failed": F || V
731
+ "str-chat__simple-message--error-failed": F || z
734
732
  }),
735
733
  "data-testid": "message-inner",
736
734
  onClick: L,
@@ -756,7 +754,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
756
754
  isMyMessage: G
757
755
  }
758
756
  ),
759
- Z && /* @__PURE__ */ e(_t, { poll: Z }),
757
+ Z && /* @__PURE__ */ e(It, { poll: Z }),
760
758
  $ != null && $.length && !a.quoted_message ? /* @__PURE__ */ e(
761
759
  c,
762
760
  {
@@ -770,8 +768,8 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
770
768
  message: a,
771
769
  renderText: y
772
770
  }
773
- ) : /* @__PURE__ */ e(It, { message: a, renderText: y }),
774
- /* @__PURE__ */ e(St, {})
771
+ ) : /* @__PURE__ */ e(St, { message: a, renderText: y }),
772
+ /* @__PURE__ */ e(Mt, {})
775
773
  ] }),
776
774
  (!X || ue) && /* @__PURE__ */ e(
777
775
  pe,
@@ -782,7 +780,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
782
780
  }
783
781
  ),
784
782
  n && X && /* @__PURE__ */ e(
785
- is,
783
+ us,
786
784
  {
787
785
  selected: p,
788
786
  onVoteUp: T,
@@ -795,24 +793,24 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
795
793
  Q && /* @__PURE__ */ e(
796
794
  W,
797
795
  {
798
- onClick: x,
796
+ onClick: g,
799
797
  reply_count: a.reply_count
800
798
  }
801
799
  ),
802
800
  U && /* @__PURE__ */ e(D, {})
803
801
  ] }, a.id)
804
802
  ] });
805
- }, ds = A.memo(
806
- cs,
807
- lt
808
- ), us = (t) => {
809
- const s = Mt("CustomMessage");
810
- return /* @__PURE__ */ e(ds, { ...s, ...t });
811
- }, ms = (t) => ({
803
+ }, hs = A.memo(
804
+ ms,
805
+ it
806
+ ), fs = (t) => {
807
+ const s = kt("CustomMessage");
808
+ return /* @__PURE__ */ e(hs, { ...s, ...t });
809
+ }, gs = (t) => ({
812
810
  linkPreviews: Array.from(t.previews.values()).filter(
813
811
  (s) => Fe.previewIsLoaded(s) || Fe.previewIsLoading(s)
814
812
  )
815
- }), hs = ({
813
+ }), xs = ({
816
814
  link: t,
817
815
  onDismiss: s
818
816
  }) => {
@@ -852,32 +850,32 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
852
850
  ]
853
851
  }
854
852
  );
855
- }, fs = () => {
856
- const { linkPreviewsManager: t } = kt(), { linkPreviews: s } = Dt(
853
+ }, bs = () => {
854
+ const { linkPreviewsManager: t } = Dt(), { linkPreviews: s } = Tt(
857
855
  t.state,
858
- ms
856
+ gs
859
857
  ), n = (l) => {
860
858
  t.dismissPreview(l);
861
859
  };
862
860
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
863
- hs,
861
+ xs,
864
862
  {
865
863
  link: l,
866
864
  onDismiss: n
867
865
  },
868
866
  l.og_scrape_url
869
867
  )) }) : null;
870
- }, gs = () => {
871
- const { handleSubmit: t } = Rt(), s = Lt();
868
+ }, Cs = () => {
869
+ const { handleSubmit: t } = Lt(), s = Pt();
872
870
  return /* @__PURE__ */ i(ce, { children: [
873
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Pt, {}) }),
871
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ut, {}) }),
874
872
  /* @__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: [
875
- /* @__PURE__ */ e(Ut, {}),
876
- /* @__PURE__ */ e(fs, {}),
877
873
  /* @__PURE__ */ e(Ft, {}),
874
+ /* @__PURE__ */ e(bs, {}),
875
+ /* @__PURE__ */ e(Ot, {}),
878
876
  /* @__PURE__ */ i("div", { className: "flex", children: [
879
877
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
880
- Ot,
878
+ At,
881
879
  {
882
880
  className: "w-full resize-none outline-none leading-6",
883
881
  autoFocus: !0,
@@ -893,24 +891,24 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
893
891
  disabled: !s,
894
892
  onClick: t,
895
893
  type: "button",
896
- children: /* @__PURE__ */ e(Ht, { className: "size-4" })
894
+ children: /* @__PURE__ */ e(Vt, { className: "size-4" })
897
895
  }
898
896
  )
899
897
  ] })
900
898
  ] })
901
899
  ] });
902
- }, xs = ({
900
+ }, Ns = ({
903
901
  renderActions: t
904
902
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
905
903
  t && (t == null ? void 0 : t()),
906
- /* @__PURE__ */ e(Tt, { Input: gs })
907
- ] }), bs = [
904
+ /* @__PURE__ */ e(Rt, { Input: Cs })
905
+ ] }), vs = [
908
906
  "SYSTEM_DM_AGENT_PAUSED",
909
907
  "SYSTEM_DM_AGENT_RESUMED"
910
- ], Cs = {
908
+ ], ws = {
911
909
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
912
910
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
913
- }, Ae = (t) => bs.includes(t), Ns = (t) => {
911
+ }, Ae = (t) => vs.includes(t), ps = (t) => {
914
912
  var r;
915
913
  const s = (r = t.metadata) == null ? void 0 : r.custom_type;
916
914
  if (Ae(s))
@@ -918,11 +916,11 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
918
916
  const n = t.dm_agent_system_type;
919
917
  if (Ae(n))
920
918
  return n;
921
- }, vs = (t) => {
919
+ }, ys = (t) => {
922
920
  var r;
923
- const s = t.message.hide_date === !0, n = Ns(t.message);
921
+ const s = t.message.hide_date === !0, n = ps(t.message);
924
922
  if (n) {
925
- const l = ((r = t.message.text) == null ? void 0 : r.trim()) || Cs[n];
923
+ const l = ((r = t.message.text) == null ? void 0 : r.trim()) || ws[n];
926
924
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
927
925
  /* @__PURE__ */ i(
928
926
  "div",
@@ -955,7 +953,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
955
953
  ] }),
956
954
  !s && /* @__PURE__ */ e(De, { message: t.message })
957
955
  ] });
958
- }, ws = () => null, ps = ({ className: t, message: s }) => /* @__PURE__ */ i(
956
+ }, Es = () => null, _s = ({ className: t, message: s }) => /* @__PURE__ */ i(
959
957
  "div",
960
958
  {
961
959
  className: R("flex items-center justify-center h-full", t),
@@ -999,11 +997,11 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
999
997
  ]
1000
998
  }
1001
999
  ), Ce = A.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1002
- /* @__PURE__ */ e(ps, { className: "w-6 h-6" }),
1000
+ /* @__PURE__ */ e(_s, { className: "w-6 h-6" }),
1003
1001
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1004
1002
  ] }) }));
1005
1003
  Ce.displayName = "LoadingState";
1006
- const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150", ys = ({
1004
+ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150", Is = ({
1007
1005
  onBack: t,
1008
1006
  showBackButton: s,
1009
1007
  onShowInfo: n,
@@ -1016,27 +1014,27 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1016
1014
  var p;
1017
1015
  return ((p = h.user) == null ? void 0 : p.id) && h.user.id !== u._client.userID;
1018
1016
  }
1019
- ), [u._client.userID, u.state.members]), m = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member", x = (y = o == null ? void 0 : o.user) == null ? void 0 : y.image, [g, C] = _(
1017
+ ), [u._client.userID, u.state.members]), m = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member", g = (y = o == null ? void 0 : o.user) == null ? void 0 : y.image, [x, N] = _(
1020
1018
  !!((I = u.state.membership) != null && I.pinned_at)
1021
1019
  );
1022
1020
  Y(() => {
1023
- const N = (h) => {
1021
+ const C = (h) => {
1024
1022
  var p;
1025
- C(
1023
+ N(
1026
1024
  h != null && h.member ? !!h.member.pinned_at : !!((p = u.state.membership) != null && p.pinned_at)
1027
1025
  );
1028
1026
  };
1029
- return u.on("member.updated", N), () => {
1030
- u.off("member.updated", N);
1027
+ return u.on("member.updated", C), () => {
1028
+ u.off("member.updated", C);
1031
1029
  };
1032
1030
  }, [u]);
1033
1031
  const b = async () => {
1034
1032
  try {
1035
- g ? await u.unpin() : await u.pin();
1036
- } catch (N) {
1033
+ x ? await u.unpin() : await u.pin();
1034
+ } catch (C) {
1037
1035
  console.error(
1038
1036
  "[CustomChannelHeader] Failed to update pinned status:",
1039
- N
1037
+ C
1040
1038
  );
1041
1039
  }
1042
1040
  };
@@ -1059,7 +1057,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1059
1057
  {
1060
1058
  id: ((v = o == null ? void 0 : o.user) == null ? void 0 : v.id) || u.id || "unknown",
1061
1059
  name: m,
1062
- image: x,
1060
+ image: g,
1063
1061
  size: 40
1064
1062
  }
1065
1063
  ),
@@ -1072,15 +1070,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1072
1070
  className: le,
1073
1071
  onClick: b,
1074
1072
  type: "button",
1075
- "aria-label": g ? "Unstar conversation" : "Star conversation",
1073
+ "aria-label": x ? "Unstar conversation" : "Star conversation",
1076
1074
  children: /* @__PURE__ */ e(
1077
1075
  Re,
1078
1076
  {
1079
1077
  className: R("size-5", {
1080
- "text-yellow-600": g,
1081
- "text-black/90": !g
1078
+ "text-yellow-600": x,
1079
+ "text-black/90": !x
1082
1080
  }),
1083
- weight: g ? "duotone" : "regular"
1081
+ weight: x ? "duotone" : "regular"
1084
1082
  }
1085
1083
  )
1086
1084
  }
@@ -1114,7 +1112,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1114
1112
  {
1115
1113
  id: ((S = o == null ? void 0 : o.user) == null ? void 0 : S.id) || u.id || "unknown",
1116
1114
  name: m,
1117
- image: x,
1115
+ image: g,
1118
1116
  size: 40
1119
1117
  }
1120
1118
  ),
@@ -1127,15 +1125,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1127
1125
  className: le,
1128
1126
  onClick: b,
1129
1127
  type: "button",
1130
- "aria-label": g ? "Unstar conversation" : "Star conversation",
1128
+ "aria-label": x ? "Unstar conversation" : "Star conversation",
1131
1129
  children: /* @__PURE__ */ e(
1132
1130
  Re,
1133
1131
  {
1134
1132
  className: R("size-5", {
1135
- "text-yellow-600": g,
1136
- "text-black/90": !g
1133
+ "text-yellow-600": x,
1134
+ "text-black/90": !x
1137
1135
  }),
1138
- weight: g ? "duotone" : "regular"
1136
+ weight: x ? "duotone" : "regular"
1139
1137
  }
1140
1138
  )
1141
1139
  }
@@ -1153,7 +1151,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1153
1151
  ] })
1154
1152
  ] })
1155
1153
  ] });
1156
- }, Es = ({
1154
+ }, Ss = ({
1157
1155
  dialogRef: t,
1158
1156
  onClose: s,
1159
1157
  participant: n,
@@ -1162,23 +1160,23 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1162
1160
  onLeaveConversation: u,
1163
1161
  onBlockParticipant: o,
1164
1162
  showDeleteConversation: m = !0,
1165
- onDeleteConversationClick: x,
1166
- onBlockParticipantClick: g,
1167
- onReportParticipantClick: C,
1163
+ onDeleteConversationClick: g,
1164
+ onBlockParticipantClick: x,
1165
+ onReportParticipantClick: N,
1168
1166
  customChannelActions: b
1169
1167
  }) => {
1170
1168
  var te, J, se, ne, ie, $, Q;
1171
- const { service: w, debug: a } = Ne(), [y, I] = _(!1), [v, S] = _(!1), [N, h] = _(!1), p = P(async () => {
1169
+ const { service: w, debug: a } = Ne(), [y, I] = _(!1), [v, S] = _(!1), [C, h] = _(!1), p = P(async () => {
1172
1170
  var U;
1173
1171
  if (!(!w || !((U = n == null ? void 0 : n.user) != null && U.id)))
1174
1172
  try {
1175
- const V = (await w.getBlockedUsers()).some(
1173
+ const z = (await w.getBlockedUsers()).some(
1176
1174
  (L) => {
1177
1175
  var G;
1178
1176
  return L.blocked_user_id === ((G = n == null ? void 0 : n.user) == null ? void 0 : G.id);
1179
1177
  }
1180
1178
  );
1181
- I(V);
1179
+ I(z);
1182
1180
  } catch (F) {
1183
1181
  console.error(
1184
1182
  "[ChannelInfoDialog] Failed to check blocked status:",
@@ -1192,7 +1190,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1192
1190
  const T = async () => {
1193
1191
  var U;
1194
1192
  if (!v) {
1195
- x == null || x(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
1193
+ g == null || g(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
1196
1194
  try {
1197
1195
  const F = ((U = r._client) == null ? void 0 : U.userID) ?? null;
1198
1196
  await r.hide(F, !1), u && await u(r), s();
@@ -1203,11 +1201,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1203
1201
  }
1204
1202
  }
1205
1203
  }, f = async () => {
1206
- var U, F, V;
1207
- if (!(N || !w)) {
1208
- g == null || g(), a && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
1204
+ var U, F, z;
1205
+ if (!(C || !w)) {
1206
+ x == null || x(), a && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
1209
1207
  try {
1210
- await w.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
1208
+ await w.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), s();
1211
1209
  } catch (L) {
1212
1210
  console.error("[ChannelInfoDialog] Failed to block member", L);
1213
1211
  } finally {
@@ -1215,11 +1213,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1215
1213
  }
1216
1214
  }
1217
1215
  }, c = async () => {
1218
- var U, F, V;
1219
- if (!(N || !w)) {
1220
- g == null || g(), a && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
1216
+ var U, F, z;
1217
+ if (!(C || !w)) {
1218
+ x == null || x(), a && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
1221
1219
  try {
1222
- await w.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
1220
+ await w.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), s();
1223
1221
  } catch (L) {
1224
1222
  console.error("[ChannelInfoDialog] Failed to unblock member", L);
1225
1223
  } finally {
@@ -1227,14 +1225,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1227
1225
  }
1228
1226
  }
1229
1227
  }, d = () => {
1230
- C == null || C(), s(), window.open(
1228
+ N == null || N(), s(), window.open(
1231
1229
  "https://linktr.ee/s/about/trust-center/report",
1232
1230
  "_blank",
1233
1231
  "noopener,noreferrer"
1234
1232
  );
1235
1233
  };
1236
1234
  if (!n) return null;
1237
- const M = ((J = n.user) == null ? void 0 : J.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", k = (ne = n.user) == null ? void 0 : ne.image, B = (ie = n.user) == null ? void 0 : ie.email, D = ($ = n.user) == null ? void 0 : $.username, W = B || (D ? `linktr.ee/${D}` : void 0), z = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
1235
+ const M = ((J = n.user) == null ? void 0 : J.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", k = (ne = n.user) == null ? void 0 : ne.image, B = (ie = n.user) == null ? void 0 : ie.email, D = ($ = n.user) == null ? void 0 : $.username, W = B || (D ? `linktr.ee/${D}` : void 0), V = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
1238
1236
  return (
1239
1237
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1240
1238
  /* @__PURE__ */ e(
@@ -1249,7 +1247,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1249
1247
  children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
1250
1248
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1251
1249
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
1252
- /* @__PURE__ */ e(Ve, { onClick: s })
1250
+ /* @__PURE__ */ e(We, { onClick: s })
1253
1251
  ] }),
1254
1252
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1255
1253
  /* @__PURE__ */ e(
@@ -1261,7 +1259,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1261
1259
  /* @__PURE__ */ e(
1262
1260
  ee,
1263
1261
  {
1264
- id: z,
1262
+ id: V,
1265
1263
  name: M,
1266
1264
  image: k,
1267
1265
  size: 88,
@@ -1297,7 +1295,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1297
1295
  disabled: v,
1298
1296
  "aria-busy": v,
1299
1297
  children: [
1300
- v ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Vt, { className: "h-5 w-5" }),
1298
+ v ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Wt, { className: "h-5 w-5" }),
1301
1299
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1302
1300
  ]
1303
1301
  }
@@ -1306,10 +1304,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1306
1304
  ge,
1307
1305
  {
1308
1306
  onClick: c,
1309
- disabled: N,
1310
- "aria-busy": N,
1307
+ disabled: C,
1308
+ "aria-busy": C,
1311
1309
  children: [
1312
- N ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
1310
+ C ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
1313
1311
  /* @__PURE__ */ e("span", { children: "Unblock" })
1314
1312
  ]
1315
1313
  }
@@ -1317,16 +1315,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1317
1315
  ge,
1318
1316
  {
1319
1317
  onClick: f,
1320
- disabled: N,
1321
- "aria-busy": N,
1318
+ disabled: C,
1319
+ "aria-busy": C,
1322
1320
  children: [
1323
- N ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
1321
+ C ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
1324
1322
  /* @__PURE__ */ e("span", { children: "Block" })
1325
1323
  ]
1326
1324
  }
1327
1325
  ) }),
1328
1326
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ge, { variant: "danger", onClick: d, children: [
1329
- /* @__PURE__ */ e(Wt, { className: "h-5 w-5" }),
1327
+ /* @__PURE__ */ e(qt, { className: "h-5 w-5" }),
1330
1328
  /* @__PURE__ */ e("span", { children: "Report" })
1331
1329
  ] }) }),
1332
1330
  b
@@ -1336,7 +1334,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1336
1334
  }
1337
1335
  )
1338
1336
  );
1339
- }, _s = ({
1337
+ }, Ms = ({
1340
1338
  onBack: t,
1341
1339
  showBackButton: s,
1342
1340
  renderMessageInputActions: n,
@@ -1345,9 +1343,9 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1345
1343
  showDeleteConversation: u = !0,
1346
1344
  onDeleteConversationClick: o,
1347
1345
  onBlockParticipantClick: m,
1348
- onReportParticipantClick: x,
1349
- showStarButton: g = !1,
1350
- chatbotVotingEnabled: C = !1,
1346
+ onReportParticipantClick: g,
1347
+ showStarButton: x = !1,
1348
+ chatbotVotingEnabled: N = !1,
1351
1349
  renderChannelBanner: b,
1352
1350
  customChannelActions: w
1353
1351
  }) => {
@@ -1365,31 +1363,31 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1365
1363
  }, [a.data]), S = P(() => {
1366
1364
  var h;
1367
1365
  (h = y.current) == null || h.showModal();
1368
- }, []), N = P(() => {
1366
+ }, []), C = P(() => {
1369
1367
  var h;
1370
1368
  (h = y.current) == null || h.close();
1371
1369
  }, []);
1372
1370
  return /* @__PURE__ */ i(ce, { children: [
1373
1371
  /* @__PURE__ */ e(
1374
- Bt,
1372
+ $t,
1375
1373
  {
1376
1374
  overrides: {
1377
- Message: (h) => /* @__PURE__ */ e(us, { ...h, chatbotVotingEnabled: C })
1375
+ Message: (h) => /* @__PURE__ */ e(fs, { ...h, chatbotVotingEnabled: N })
1378
1376
  },
1379
- children: /* @__PURE__ */ i($t, { children: [
1377
+ children: /* @__PURE__ */ i(jt, { children: [
1380
1378
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1381
- ys,
1379
+ Is,
1382
1380
  {
1383
1381
  onBack: t,
1384
1382
  showBackButton: s,
1385
1383
  onShowInfo: S,
1386
1384
  canShowInfo: !!I,
1387
- showStarButton: g
1385
+ showStarButton: x
1388
1386
  }
1389
1387
  ) }),
1390
1388
  b == null ? void 0 : b(),
1391
1389
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1392
- jt,
1390
+ Gt,
1393
1391
  {
1394
1392
  hideDeletedMessages: !0,
1395
1393
  hideNewMessageSeparator: !1,
@@ -1397,7 +1395,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1397
1395
  }
1398
1396
  ) }),
1399
1397
  /* @__PURE__ */ e(
1400
- xs,
1398
+ Ns,
1401
1399
  {
1402
1400
  renderActions: () => n == null ? void 0 : n(a)
1403
1401
  }
@@ -1406,10 +1404,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1406
1404
  }
1407
1405
  ),
1408
1406
  /* @__PURE__ */ e(
1409
- Es,
1407
+ Ss,
1410
1408
  {
1411
1409
  dialogRef: y,
1412
- onClose: N,
1410
+ onClose: C,
1413
1411
  participant: I,
1414
1412
  channel: a,
1415
1413
  followerStatusLabel: v,
@@ -1418,12 +1416,12 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1418
1416
  showDeleteConversation: u,
1419
1417
  onDeleteConversationClick: o,
1420
1418
  onBlockParticipantClick: m,
1421
- onReportParticipantClick: x,
1419
+ onReportParticipantClick: g,
1422
1420
  customChannelActions: w
1423
1421
  }
1424
1422
  )
1425
1423
  ] });
1426
- }, We = A.memo(
1424
+ }, qe = A.memo(
1427
1425
  ({
1428
1426
  channel: t,
1429
1427
  onBack: s,
@@ -1432,10 +1430,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1432
1430
  onLeaveConversation: l,
1433
1431
  onBlockParticipant: u,
1434
1432
  className: o,
1435
- CustomChannelEmptyState: m = ws,
1436
- showDeleteConversation: x = !0,
1437
- onDeleteConversationClick: g,
1438
- onBlockParticipantClick: C,
1433
+ CustomChannelEmptyState: m = Es,
1434
+ showDeleteConversation: g = !0,
1435
+ onDeleteConversationClick: x,
1436
+ onBlockParticipantClick: N,
1439
1437
  onReportParticipantClick: b,
1440
1438
  dmAgentEnabled: w,
1441
1439
  messageMetadata: a,
@@ -1443,7 +1441,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1443
1441
  showStarButton: I = !1,
1444
1442
  chatbotVotingEnabled: v = !1,
1445
1443
  renderChannelBanner: S,
1446
- customChannelActions: N
1444
+ customChannelActions: C
1447
1445
  }) => {
1448
1446
  const h = P(
1449
1447
  async (p, T, f) => {
@@ -1473,16 +1471,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1473
1471
  o
1474
1472
  ),
1475
1473
  children: /* @__PURE__ */ e(
1476
- At,
1474
+ Bt,
1477
1475
  {
1478
1476
  channel: t,
1479
- MessageSystem: vs,
1477
+ MessageSystem: ys,
1480
1478
  EmptyStateIndicator: m,
1481
1479
  LoadingIndicator: Ce,
1482
- DateSeparator: ns,
1480
+ DateSeparator: os,
1483
1481
  doSendMessageRequest: h,
1484
1482
  children: /* @__PURE__ */ e(
1485
- _s,
1483
+ Ms,
1486
1484
  {
1487
1485
  onBack: s,
1488
1486
  showBackButton: n,
@@ -1490,14 +1488,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1490
1488
  onLeaveConversation: l,
1491
1489
  onBlockParticipant: u,
1492
1490
  CustomChannelEmptyState: m,
1493
- showDeleteConversation: x,
1494
- onDeleteConversationClick: g,
1495
- onBlockParticipantClick: C,
1491
+ showDeleteConversation: g,
1492
+ onDeleteConversationClick: x,
1493
+ onBlockParticipantClick: N,
1496
1494
  onReportParticipantClick: b,
1497
1495
  showStarButton: I,
1498
1496
  chatbotVotingEnabled: v,
1499
1497
  renderChannelBanner: S,
1500
- customChannelActions: N
1498
+ customChannelActions: C
1501
1499
  }
1502
1500
  )
1503
1501
  }
@@ -1506,8 +1504,8 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1506
1504
  );
1507
1505
  }
1508
1506
  );
1509
- We.displayName = "ChannelView";
1510
- function Is({
1507
+ qe.displayName = "ChannelView";
1508
+ function ks({
1511
1509
  searchQuery: t,
1512
1510
  setSearchQuery: s,
1513
1511
  placeholder: n
@@ -1515,7 +1513,7 @@ function Is({
1515
1513
  const r = q(null);
1516
1514
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1517
1515
  /* @__PURE__ */ e(
1518
- qt,
1516
+ Yt,
1519
1517
  {
1520
1518
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1521
1519
  weight: "bold"
@@ -1546,7 +1544,7 @@ function Is({
1546
1544
  )
1547
1545
  ] });
1548
1546
  }
1549
- const Ss = ({
1547
+ const Ds = ({
1550
1548
  participantSource: t,
1551
1549
  onSelectParticipant: s,
1552
1550
  onClose: n,
@@ -1555,9 +1553,9 @@ const Ss = ({
1555
1553
  searchPlaceholder: u = "Search participants...",
1556
1554
  className: o
1557
1555
  }) => {
1558
- const { debug: m } = Ne(), [x, g] = _(""), [C, b] = _([]), [w, a] = _(!1), [y, I] = _(null), [v, S] = _(
1556
+ const { debug: m } = Ne(), [g, x] = _(""), [N, b] = _([]), [w, a] = _(!1), [y, I] = _(null), [v, S] = _(
1559
1557
  null
1560
- ), N = q(!1);
1558
+ ), C = q(!1);
1561
1559
  Y(() => {
1562
1560
  if (t.loading) {
1563
1561
  m && console.log(
@@ -1565,7 +1563,7 @@ const Ss = ({
1565
1563
  );
1566
1564
  return;
1567
1565
  }
1568
- if (N.current) return;
1566
+ if (C.current) return;
1569
1567
  (async () => {
1570
1568
  m && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), I(null);
1571
1569
  try {
@@ -1574,7 +1572,7 @@ const Ss = ({
1574
1572
  // Load all participants initially
1575
1573
  limit: 100
1576
1574
  });
1577
- b(c.participants), N.current = !0, m && console.log(
1575
+ b(c.participants), C.current = !0, m && console.log(
1578
1576
  "[ParticipantPicker] Participants loaded successfully:",
1579
1577
  c.participants.length
1580
1578
  );
@@ -1586,10 +1584,10 @@ const Ss = ({
1586
1584
  }
1587
1585
  })();
1588
1586
  }, [t.loading, m]);
1589
- const h = C.filter((f) => !r.has(f.id)).filter((f) => {
1587
+ const h = N.filter((f) => !r.has(f.id)).filter((f) => {
1590
1588
  var d;
1591
- if (!x) return !0;
1592
- const c = x.toLowerCase();
1589
+ if (!g) return !0;
1590
+ const c = g.toLowerCase();
1593
1591
  return f.name.toLowerCase().includes(c) || ((d = f.email) == null ? void 0 : d.toLowerCase().includes(c)) || !1;
1594
1592
  }), p = P(
1595
1593
  async (f) => {
@@ -1610,7 +1608,7 @@ const Ss = ({
1610
1608
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1611
1609
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1612
1610
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1613
- /* @__PURE__ */ e(Ve, { onClick: n })
1611
+ /* @__PURE__ */ e(We, { onClick: n })
1614
1612
  ] }),
1615
1613
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1616
1614
  "Select a ",
@@ -1621,10 +1619,10 @@ const Ss = ({
1621
1619
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1622
1620
  ] }),
1623
1621
  /* @__PURE__ */ e(
1624
- Is,
1622
+ ks,
1625
1623
  {
1626
- searchQuery: x,
1627
- setSearchQuery: g,
1624
+ searchQuery: g,
1625
+ setSearchQuery: x,
1628
1626
  placeholder: u
1629
1627
  }
1630
1628
  )
@@ -1644,8 +1642,8 @@ const Ss = ({
1644
1642
  ] })
1645
1643
  ] }) }) : h.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1646
1644
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ue, { className: "h-8 w-8 text-charcoal" }) }),
1647
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : C.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1648
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : C.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1645
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : N.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1646
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1649
1647
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1650
1648
  h.map((f) => {
1651
1649
  const c = f.name || f.email || f.id, d = f.email && f.name ? f.email : f.phone;
@@ -1683,7 +1681,7 @@ const Ss = ({
1683
1681
  ] }) })
1684
1682
  ] }) })
1685
1683
  ] });
1686
- }, Ms = ({ className: t }) => /* @__PURE__ */ i(
1684
+ }, Ts = ({ className: t }) => /* @__PURE__ */ i(
1687
1685
  "svg",
1688
1686
  {
1689
1687
  width: "140",
@@ -1817,16 +1815,16 @@ const Ss = ({
1817
1815
  ] })
1818
1816
  ]
1819
1817
  }
1820
- ), qe = A.memo(
1818
+ ), Ye = A.memo(
1821
1819
  ({ 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: [
1822
- /* @__PURE__ */ e(Ms, {}),
1820
+ /* @__PURE__ */ e(Ts, {}),
1823
1821
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1824
1822
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1825
1823
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1826
1824
  ] })
1827
1825
  ] }) })
1828
1826
  );
1829
- qe.displayName = "EmptyState";
1827
+ Ye.displayName = "EmptyState";
1830
1828
  const be = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1831
1829
  /* @__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: "⚠️" }) }),
1832
1830
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
@@ -1842,7 +1840,7 @@ const be = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1842
1840
  )
1843
1841
  ] }) }));
1844
1842
  be.displayName = "ErrorState";
1845
- const As = ({
1843
+ const js = ({
1846
1844
  capabilities: t = {},
1847
1845
  className: s,
1848
1846
  renderMessageInputActions: n,
@@ -1851,9 +1849,9 @@ const As = ({
1851
1849
  initialParticipantFilter: u,
1852
1850
  initialParticipantData: o,
1853
1851
  CustomChannelEmptyState: m,
1854
- showChannelList: x = !0,
1855
- filters: g,
1856
- channelListCustomEmptyStateIndicator: C,
1852
+ showChannelList: g = !0,
1853
+ filters: x,
1854
+ channelListCustomEmptyStateIndicator: N,
1857
1855
  onDeleteConversationClick: b,
1858
1856
  onBlockParticipantClick: w,
1859
1857
  onReportParticipantClick: a,
@@ -1861,7 +1859,7 @@ const As = ({
1861
1859
  messageMetadata: I,
1862
1860
  onMessageSent: v,
1863
1861
  showStarButton: S = !1,
1864
- chatbotVotingEnabled: N = !1,
1862
+ chatbotVotingEnabled: C = !1,
1865
1863
  renderMessagePreview: h,
1866
1864
  renderChannelBanner: p,
1867
1865
  customChannelActions: T
@@ -1874,7 +1872,7 @@ const As = ({
1874
1872
  error: k,
1875
1873
  refreshConnection: B,
1876
1874
  debug: D
1877
- } = Yt(), [W, z] = _(null), [te, J] = _(!1), [se, ne] = _(!1), [ie, $] = _(!1), [Q, U] = _(/* @__PURE__ */ new Set()), [F, V] = _(0), [L, G] = _(!1), [de, Z] = _(null), ae = q(null), {
1875
+ } = Zt(), [W, V] = _(null), [te, J] = _(!1), [se, ne] = _(!1), [ie, $] = _(!1), [Q, U] = _(/* @__PURE__ */ new Set()), [F, z] = _(0), [L, G] = _(!1), [de, Z] = _(null), ae = q(null), {
1878
1876
  participantSource: X,
1879
1877
  participantLabel: re = "participants",
1880
1878
  showDeleteConversation: ue = !0
@@ -1889,9 +1887,9 @@ const As = ({
1889
1887
  hidden: !1
1890
1888
  }
1891
1889
  },
1892
- ...g
1890
+ ...x
1893
1891
  };
1894
- }, [g, c == null ? void 0 : c.userID]), K = q(null), oe = P(async () => {
1892
+ }, [x, c == null ? void 0 : c.userID]), K = q(null), oe = P(async () => {
1895
1893
  if (!c || !d) return;
1896
1894
  const E = c.userID;
1897
1895
  if (E)
@@ -1907,9 +1905,9 @@ const As = ({
1907
1905
  ), O = /* @__PURE__ */ new Set();
1908
1906
  H.forEach((j) => {
1909
1907
  const ve = j.state.members;
1910
- Object.values(ve).forEach((et) => {
1908
+ Object.values(ve).forEach((tt) => {
1911
1909
  var ke;
1912
- const we = (ke = et.user) == null ? void 0 : ke.id;
1910
+ const we = (ke = tt.user) == null ? void 0 : ke.id;
1913
1911
  we && we !== E && O.add(we);
1914
1912
  });
1915
1913
  }), U((j) => j.size === O.size && [...j].every((ve) => O.has(ve)) ? j : O), J(H.length > 0), ne(!0), K.current = E, D && console.log("[MessagingShell] Channels synced successfully:", {
@@ -1943,7 +1941,7 @@ const As = ({
1943
1941
  { limit: 1 }
1944
1942
  );
1945
1943
  if (O.length > 0)
1946
- z(O[0]), G(!0), Z(null), r && r(O[0]), D && console.log(
1944
+ V(O[0]), G(!0), Z(null), r && r(O[0]), D && console.log(
1947
1945
  "[MessagingShell] Initial conversation loaded:",
1948
1946
  O[0].id
1949
1947
  );
@@ -1959,7 +1957,7 @@ const As = ({
1959
1957
  email: o.email,
1960
1958
  phone: o.phone
1961
1959
  });
1962
- z(j), G(!0), Z(null), r && r(j), D && console.log(
1960
+ V(j), G(!0), Z(null), r && r(j), D && console.log(
1963
1961
  "[MessagingShell] Channel created and loaded:",
1964
1962
  j.id
1965
1963
  );
@@ -1992,14 +1990,14 @@ const As = ({
1992
1990
  D,
1993
1991
  r
1994
1992
  ]);
1995
- const Ye = P(
1993
+ const Ze = P(
1996
1994
  (E) => {
1997
- z(E), r == null || r(E);
1995
+ V(E), r == null || r(E);
1998
1996
  },
1999
1997
  [r]
2000
- ), Ze = P(() => {
2001
- L || z(null);
2002
- }, [L]), Je = P(
1998
+ ), Je = P(() => {
1999
+ L || V(null);
2000
+ }, [L]), Qe = P(
2003
2001
  async (E) => {
2004
2002
  var H;
2005
2003
  if (f)
@@ -2019,7 +2017,7 @@ const As = ({
2019
2017
  } catch (j) {
2020
2018
  console.warn("[MessagingShell] Failed to unhide channel:", j);
2021
2019
  }
2022
- z(O), $(!1), (H = ae.current) == null || H.close(), l == null || l(E);
2020
+ V(O), $(!1), (H = ae.current) == null || H.close(), l == null || l(E);
2023
2021
  } catch (O) {
2024
2022
  console.error("[MessagingShell] Failed to start conversation:", O);
2025
2023
  }
@@ -2028,19 +2026,19 @@ const As = ({
2028
2026
  ), he = P(() => {
2029
2027
  var E;
2030
2028
  $(!1), (E = ae.current) == null || E.close();
2031
- }, []), Qe = P(
2029
+ }, []), Xe = P(
2032
2030
  (E) => {
2033
2031
  E.target === ae.current && he();
2034
2032
  },
2035
2033
  [he]
2036
- ), Xe = P(
2034
+ ), Ke = P(
2037
2035
  async (E) => {
2038
- D && console.log("[MessagingShell] Leaving conversation:", E.id), z(null), G(!1), K.current = null, await oe();
2036
+ D && console.log("[MessagingShell] Leaving conversation:", E.id), V(null), G(!1), K.current = null, await oe();
2039
2037
  },
2040
2038
  [oe, D]
2041
- ), Ke = P(
2039
+ ), et = P(
2042
2040
  async (E) => {
2043
- D && console.log("[MessagingShell] Blocking participant:", E), z(null), G(!1), K.current = null, await oe();
2041
+ D && console.log("[MessagingShell] Blocking participant:", E), V(null), G(!1), K.current = null, await oe();
2044
2042
  },
2045
2043
  [oe, D]
2046
2044
  ), fe = !!W;
@@ -2065,20 +2063,20 @@ const As = ({
2065
2063
  className: R(
2066
2064
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2067
2065
  {
2068
- "!hidden": x === !1 || L,
2066
+ "!hidden": g === !1 || L,
2069
2067
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2070
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": x !== !1 && !L && fe,
2068
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !L && fe,
2071
2069
  // Show on mobile when no channel selected, use same wide width on desktop
2072
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": x !== !1 && !L && !fe
2070
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !L && !fe
2073
2071
  }
2074
2072
  ),
2075
2073
  children: /* @__PURE__ */ e(
2076
- He,
2074
+ Ve,
2077
2075
  {
2078
- onChannelSelect: Ye,
2076
+ onChannelSelect: Ze,
2079
2077
  selectedChannel: W || void 0,
2080
2078
  filters: me,
2081
- customEmptyStateIndicator: C,
2079
+ customEmptyStateIndicator: N,
2082
2080
  renderMessagePreview: h
2083
2081
  }
2084
2082
  )
@@ -2097,15 +2095,15 @@ const As = ({
2097
2095
  }
2098
2096
  ),
2099
2097
  children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2100
- We,
2098
+ qe,
2101
2099
  {
2102
2100
  channel: W,
2103
- onBack: Ze,
2101
+ onBack: Je,
2104
2102
  showBackButton: !L,
2105
2103
  renderMessageInputActions: n,
2106
2104
  renderChannelBanner: p,
2107
- onLeaveConversation: Xe,
2108
- onBlockParticipant: Ke,
2105
+ onLeaveConversation: Ke,
2106
+ onBlockParticipant: et,
2109
2107
  CustomChannelEmptyState: m,
2110
2108
  showDeleteConversation: ue,
2111
2109
  onDeleteConversationClick: b,
@@ -2115,7 +2113,7 @@ const As = ({
2115
2113
  messageMetadata: I,
2116
2114
  onMessageSent: v,
2117
2115
  showStarButton: S,
2118
- chatbotVotingEnabled: N,
2116
+ chatbotVotingEnabled: C,
2119
2117
  customChannelActions: T
2120
2118
  },
2121
2119
  W.id
@@ -2123,7 +2121,7 @@ const As = ({
2123
2121
  // Show loading while creating/loading direct conversation channel
2124
2122
  /* @__PURE__ */ e(Ce, {})
2125
2123
  ) : /* @__PURE__ */ e(
2126
- qe,
2124
+ Ye,
2127
2125
  {
2128
2126
  hasChannels: te,
2129
2127
  channelsLoaded: se
@@ -2138,13 +2136,13 @@ const As = ({
2138
2136
  {
2139
2137
  ref: ae,
2140
2138
  className: "mes-dialog",
2141
- onClick: Qe,
2139
+ onClick: Xe,
2142
2140
  onClose: he,
2143
2141
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2144
- Ss,
2142
+ Ds,
2145
2143
  {
2146
2144
  participantSource: X,
2147
- onSelectParticipant: Je,
2145
+ onSelectParticipant: Qe,
2148
2146
  onClose: he,
2149
2147
  existingParticipantIds: Q,
2150
2148
  participantLabel: re,
@@ -2157,7 +2155,7 @@ const As = ({
2157
2155
  ]
2158
2156
  }
2159
2157
  );
2160
- }, ks = ({
2158
+ }, Rs = ({
2161
2159
  question: t,
2162
2160
  onClick: s,
2163
2161
  loading: n = !1,
@@ -2179,7 +2177,7 @@ const As = ({
2179
2177
  ),
2180
2178
  children: t
2181
2179
  }
2182
- ), Bs = ({
2180
+ ), Gs = ({
2183
2181
  faqs: t,
2184
2182
  onFaqClick: s,
2185
2183
  loadingFaqId: n,
@@ -2188,7 +2186,7 @@ const As = ({
2188
2186
  avatarImage: u,
2189
2187
  avatarName: o
2190
2188
  }) => {
2191
- const m = t.filter((x) => x.enabled).sort((x, g) => (x.order ?? 0) - (g.order ?? 0));
2189
+ const m = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
2192
2190
  return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2193
2191
  (u || o) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2194
2192
  ee,
@@ -2207,24 +2205,24 @@ const As = ({
2207
2205
  style: { backgroundColor: "#F1F0EE" },
2208
2206
  children: [
2209
2207
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2210
- m.map((x) => /* @__PURE__ */ e(
2211
- ks,
2208
+ m.map((g) => /* @__PURE__ */ e(
2209
+ Rs,
2212
2210
  {
2213
- question: x.question,
2214
- onClick: () => s(x.id),
2215
- loading: n === x.id
2211
+ question: g.question,
2212
+ onClick: () => s(g.id),
2213
+ loading: n === g.id
2216
2214
  },
2217
- x.id
2215
+ g.id
2218
2216
  ))
2219
2217
  ]
2220
2218
  }
2221
2219
  )
2222
2220
  ] }) });
2223
- }, $s = (t, s = {}) => {
2224
- const { initialSearch: n = "", pageSize: r = 20 } = s, [l, u] = _([]), [o, m] = _(!1), [x, g] = _(null), [C, b] = _(n), [w, a] = _(!0), [y, I] = _(), v = P(async (p = !1, T) => {
2221
+ }, Hs = (t, s = {}) => {
2222
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [l, u] = _([]), [o, m] = _(!1), [g, x] = _(null), [N, b] = _(n), [w, a] = _(!0), [y, I] = _(), v = P(async (p = !1, T) => {
2225
2223
  if (o) return;
2226
- const f = T !== void 0 ? T : C;
2227
- m(!0), g(null);
2224
+ const f = T !== void 0 ? T : N;
2225
+ m(!0), x(null);
2228
2226
  try {
2229
2227
  const c = await t.loadParticipants({
2230
2228
  search: f || void 0,
@@ -2236,13 +2234,13 @@ const As = ({
2236
2234
  ), a(c.hasMore), I(c.nextCursor);
2237
2235
  } catch (c) {
2238
2236
  const d = c instanceof Error ? c.message : "Failed to load participants";
2239
- g(d), console.error("[useParticipants] Load error:", c);
2237
+ x(d), console.error("[useParticipants] Load error:", c);
2240
2238
  } finally {
2241
2239
  m(!1);
2242
2240
  }
2243
- }, [t, C, y, r, o]), S = P(() => {
2241
+ }, [t, N, y, r, o]), S = P(() => {
2244
2242
  w && !o && v(!1);
2245
- }, [w, o, v]), N = P((p) => {
2243
+ }, [w, o, v]), C = P((p) => {
2246
2244
  b(p), I(void 0), v(!0, p);
2247
2245
  }, [v]), h = P(() => {
2248
2246
  I(void 0), v(!0);
@@ -2252,30 +2250,30 @@ const As = ({
2252
2250
  }, [t.loadParticipants]), {
2253
2251
  participants: l,
2254
2252
  loading: o,
2255
- error: x,
2256
- searchQuery: C,
2253
+ error: g,
2254
+ searchQuery: N,
2257
2255
  hasMore: w,
2258
2256
  totalCount: t.totalCount,
2259
2257
  loadMore: S,
2260
- search: N,
2258
+ search: C,
2261
2259
  refresh: h
2262
2260
  };
2263
2261
  };
2264
2262
  export {
2265
2263
  ge as ActionButton,
2266
2264
  ee as Avatar,
2267
- ws as ChannelEmptyState,
2268
- He as ChannelList,
2269
- We as ChannelView,
2270
- Bs as FaqList,
2271
- ks as FaqListItem,
2272
- is as MessageVoteButtons,
2273
- Os as MessagingProvider,
2274
- As as MessagingShell,
2275
- Ss as ParticipantPicker,
2276
- Jt as formatRelativeTime,
2277
- rs as useMessageVote,
2278
- Yt as useMessaging,
2279
- $s as useParticipants
2265
+ Es as ChannelEmptyState,
2266
+ Ve as ChannelList,
2267
+ qe as ChannelView,
2268
+ Gs as FaqList,
2269
+ Rs as FaqListItem,
2270
+ us as MessageVoteButtons,
2271
+ $s as MessagingProvider,
2272
+ js as MessagingShell,
2273
+ Ds as ParticipantPicker,
2274
+ Kt as formatRelativeTime,
2275
+ is as useMessageVote,
2276
+ Zt as useMessaging,
2277
+ Hs as useParticipants
2280
2278
  };
2281
2279
  //# sourceMappingURL=index.js.map