@linktr.ee/messaging-react 3.3.11-rc-1781859612 → 3.3.11

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.
Files changed (28) hide show
  1. package/dist/{Card-CizcvpTa.cjs → Card-BxHcN_uK.cjs} +2 -2
  2. package/dist/{Card-CizcvpTa.cjs.map → Card-BxHcN_uK.cjs.map} +1 -1
  3. package/dist/{Card-PGPY8ZRL.cjs → Card-Dx9vU_aU.cjs} +2 -2
  4. package/dist/{Card-PGPY8ZRL.cjs.map → Card-Dx9vU_aU.cjs.map} +1 -1
  5. package/dist/{Card-D-sSG334.js → Card-Likc_mEq.js} +3 -3
  6. package/dist/{Card-D-sSG334.js.map → Card-Likc_mEq.js.map} +1 -1
  7. package/dist/{Card-omzCiCc9.cjs → Card-Som2Laov.cjs} +2 -2
  8. package/dist/{Card-omzCiCc9.cjs.map → Card-Som2Laov.cjs.map} +1 -1
  9. package/dist/{Card-BmU_ztmU.js → Card-VgnjOBSF.js} +2 -2
  10. package/dist/{Card-BmU_ztmU.js.map → Card-VgnjOBSF.js.map} +1 -1
  11. package/dist/{Card-CHDQEG9i.js → Card-datOr9-K.js} +2 -2
  12. package/dist/{Card-CHDQEG9i.js.map → Card-datOr9-K.js.map} +1 -1
  13. package/dist/{LockedThumbnail-BynAff_z.js → LockedThumbnail-MW14CvSv.js} +2 -2
  14. package/dist/{LockedThumbnail-BynAff_z.js.map → LockedThumbnail-MW14CvSv.js.map} +1 -1
  15. package/dist/{LockedThumbnail-UEkCam1N.cjs → LockedThumbnail-QWGt7mcF.cjs} +2 -2
  16. package/dist/{LockedThumbnail-UEkCam1N.cjs.map → LockedThumbnail-QWGt7mcF.cjs.map} +1 -1
  17. package/dist/index-CRVJo6HP.cjs +2 -0
  18. package/dist/index-CRVJo6HP.cjs.map +1 -0
  19. package/dist/{index-CAAtAfn1.js → index-cIErdakH.js} +531 -537
  20. package/dist/index-cIErdakH.js.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +1 -1
  23. package/package.json +2 -2
  24. package/src/providers/MessagingProvider.test.tsx +46 -2
  25. package/src/providers/MessagingProvider.tsx +51 -44
  26. package/dist/index-CAAtAfn1.js.map +0 -1
  27. package/dist/index-SMjrfgpc.cjs +0 -2
  28. package/dist/index-SMjrfgpc.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
2
- import F, { createContext as Ge, useContext as Te, useCallback as W, useState as O, useRef as H, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
3
- import { StreamChatService as In } from "@linktr.ee/messaging-core";
4
- import { StreamChat as Sn, LinkPreviewsManager as Tt } from "stream-chat";
5
- import { Chat as Tn, DateSeparator as An, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as Mn, useMessageReminder as Rn, useComponentContext as Ut, Attachment as Ln, EditMessageModal as Dn, MessageBlocked as Pn, MessageBouncePrompt as On, MessageDeleted as zn, MessageIsThreadReplyInChannelButtonIndicator as $n, MessageRepliesCountButton as Fn, ReminderNotification as Bn, StreamedMessageText as Un, messageHasAttachments as jn, messageHasReactions as Vn, isDateSeparatorMessage as Gn, isMessageBlocked as Hn, isMessageBounced as Yn, MessageBounceModal as qn, MessageText as At, Poll as Wn, MessageErrorIcon as Xn, useMessageContext as pe, useMessageComposer as Jn, useStateStore as Kn, MessageInput as Zn, useMessageInputContext as Qn, useMessageComposerHasSendableData as es, AttachmentPreviewList as ts, QuotedMessagePreview as ns, TextareaComposer as ss, MessageTimestamp as Le, AIStates as De, useTypingContext as as, useAIState as rs, Channel as is, WithComponents as os, Window as ls, MessageList as cs, ChannelList as ds, InfiniteScroll as us } from "stream-chat-react";
6
- import { StarIcon as Fe, DotsThreeIcon as ms, SpinnerGapIcon as Ce, SignOutIcon as hs, ProhibitInsetIcon as Mt, FlagIcon as jt, FileIcon as Vt, ImageIcon as fs, SpeakerHighIcon as gs, VideoCameraIcon as Gt, FileMdIcon as bs, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as xs, FileCsvIcon as ws, FileXlsIcon as _s, FileDocIcon as Ns, FilePdfIcon as ys, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as Cs, LinkIcon as ks, DownloadSimpleIcon as be, GiftIcon as Es, ThumbsUpIcon as Is, ThumbsDownIcon as Ss, TrashSimpleIcon as Ts, XIcon as Ae, ArrowUpIcon as As, SparkleIcon as Ue, ProhibitIcon as Ms, ArrowLeftIcon as Rt, PencilSimpleIcon as Rs, CaretLeftIcon as Ls, CaretRightIcon as Ds } from "@phosphor-icons/react";
2
+ import j, { createContext as Ge, useContext as Te, useCallback as W, useState as z, useRef as G, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
3
+ import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
4
+ import { StreamChat as In, LinkPreviewsManager as Tt } from "stream-chat";
5
+ import { Chat as Tn, DateSeparator as An, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as Mn, useMessageReminder as Rn, useComponentContext as Ut, Attachment as Ln, EditMessageModal as Dn, MessageBlocked as Pn, MessageBouncePrompt as On, MessageDeleted as zn, MessageIsThreadReplyInChannelButtonIndicator as $n, MessageRepliesCountButton as Fn, ReminderNotification as Bn, StreamedMessageText as Un, messageHasAttachments as jn, messageHasReactions as Vn, isDateSeparatorMessage as Gn, isMessageBlocked as Hn, isMessageBounced as Yn, MessageBounceModal as qn, MessageText as At, Poll as Wn, MessageErrorIcon as Xn, useMessageContext as pe, useMessageComposer as Kn, useStateStore as Jn, MessageInput as Zn, useMessageInputContext as Qn, useMessageComposerHasSendableData as es, AttachmentPreviewList as ts, QuotedMessagePreview as ns, TextareaComposer as ss, MessageTimestamp as Le, AIStates as De, useTypingContext as as, useAIState as rs, Channel as is, WithComponents as os, Window as ls, MessageList as cs, ChannelList as ds, InfiniteScroll as us } from "stream-chat-react";
6
+ import { StarIcon as Fe, DotsThreeIcon as ms, SpinnerGapIcon as Ce, SignOutIcon as hs, ProhibitInsetIcon as Mt, FlagIcon as jt, FileIcon as Vt, ImageIcon as fs, SpeakerHighIcon as gs, VideoCameraIcon as Gt, FileMdIcon as bs, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as xs, FileCsvIcon as ws, FileXlsIcon as _s, FileDocIcon as Ns, FilePdfIcon as ys, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as Cs, LinkIcon as ks, DownloadSimpleIcon as be, GiftIcon as Es, ThumbsUpIcon as Ss, ThumbsDownIcon as Is, TrashSimpleIcon as Ts, XIcon as Ae, ArrowUpIcon as As, SparkleIcon as Ue, ProhibitIcon as Ms, ArrowLeftIcon as Rt, PencilSimpleIcon as Rs, CaretLeftIcon as Ls, CaretRightIcon as Ds } from "@phosphor-icons/react";
7
7
  import y from "classnames";
8
8
  import { MessageActions as Ps, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
9
9
  const Yt = Ge({
@@ -24,9 +24,10 @@ const Yt = Ge({
24
24
  capabilities: r = {},
25
25
  debug: i = !1
26
26
  }) => {
27
+ var B, E;
27
28
  const o = W(
28
- (w, ...C) => {
29
- i && console.log(`🔥 [MessagingProvider] ${w}`, ...C);
29
+ (k, ...A) => {
30
+ i && console.log(`🔥 [MessagingProvider] ${k}`, ...A);
30
31
  },
31
32
  [i]
32
33
  );
@@ -36,85 +37,77 @@ const Yt = Ge({
36
37
  serviceConfig: !!s,
37
38
  capabilities: Object.keys(r)
38
39
  });
39
- const [l, d] = O(null), [m, b] = O(null), [u, f] = O(!1), [c, g] = O(!1), [p, v] = O(null), N = H(!1), _ = H(null), E = H({
40
+ const [l, d] = z(null), [m, b] = z(null), [u, f] = z(!1), [c, g] = z(!1), [p, v] = z(null), _ = G(!1), w = G(null), I = G(s);
41
+ I.current = s;
42
+ const S = G(i);
43
+ S.current = i;
44
+ const M = G({
40
45
  userId: t == null ? void 0 : t.id,
41
46
  apiKey: a,
42
47
  serviceConfig: s,
43
48
  capabilities: r
44
- }), I = H(0);
45
- I.current++, o("📊 RENDER INFO", {
46
- renderCount: I.current,
49
+ }), P = G(0);
50
+ P.current++, o("📊 RENDER INFO", {
51
+ renderCount: P.current,
47
52
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
48
53
  propChanges: {
49
- userChanged: E.current.userId !== (t == null ? void 0 : t.id),
50
- apiKeyChanged: E.current.apiKey !== a,
51
- serviceConfigChanged: E.current.serviceConfig !== s,
52
- capabilitiesChanged: E.current.capabilities !== r
54
+ userChanged: M.current.userId !== (t == null ? void 0 : t.id),
55
+ apiKeyChanged: M.current.apiKey !== a,
56
+ serviceConfigChanged: M.current.serviceConfig !== s,
57
+ capabilitiesChanged: M.current.capabilities !== r
53
58
  }
54
- }), E.current = {
59
+ }), M.current = {
55
60
  userId: t == null ? void 0 : t.id,
56
61
  apiKey: a,
57
62
  serviceConfig: s,
58
63
  capabilities: r
59
64
  };
60
- const T = F.useMemo(
61
- () => a ? new Sn(a) : null,
62
- [a]
63
- );
65
+ const R = G(null);
66
+ a && ((B = R.current) == null ? void 0 : B.apiKey) !== a && (R.current = { apiKey: a, client: new In(a) });
67
+ const L = a ? ((E = R.current) == null ? void 0 : E.client) ?? null : null;
64
68
  Y(() => {
65
- const w = I.current;
66
- if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
67
- renderCount: w,
68
- apiKey: !!a,
69
- serviceConfig: !!s,
70
- dependencies: {
71
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
72
- serviceConfigRef: s,
73
- serviceConfigStable: E.current.serviceConfig === s,
74
- apiKeyStable: E.current.apiKey === a
75
- }
76
- }), !a || !s) {
69
+ const k = P.current, A = I.current;
70
+ if (!a || !L || !A) {
77
71
  o("⚠️ SERVICE INIT SKIPPED", {
78
- renderCount: w,
79
- reason: "Missing apiKey or serviceConfig"
72
+ renderCount: k,
73
+ reason: "Missing apiKey, client, or serviceConfig"
80
74
  });
81
75
  return;
82
76
  }
83
- o("🚀 CREATING NEW SERVICE", {
84
- renderCount: w,
85
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
86
- serviceConfigChanged: E.current.serviceConfig !== s
77
+ o("🚀 CREATING SERVICE", {
78
+ renderCount: k,
79
+ apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
87
80
  });
88
- const C = new In({
89
- ...s,
81
+ const $ = new Sn({
82
+ ...A,
90
83
  apiKey: a,
91
- debug: i,
92
- ...T ? { client: T } : {}
84
+ debug: S.current,
85
+ client: L
93
86
  });
94
- _.current = C, d(C), o("✅ SERVICE SET", {
95
- renderCount: w,
96
- serviceInstance: !!C
87
+ w.current = $, d($), o("✅ SERVICE SET", {
88
+ renderCount: k,
89
+ serviceInstance: !!$
97
90
  });
98
- }, [a, s, i, o, T]);
99
- const L = H(null);
91
+ }, [a, L]);
92
+ const N = G(null);
100
93
  Y(() => {
101
- var C, M;
94
+ var A, $;
102
95
  if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
103
96
  hasService: !!l,
104
97
  hasUser: !!t,
105
98
  userId: t == null ? void 0 : t.id,
106
- isConnecting: N.current,
99
+ isConnecting: _.current,
107
100
  isConnected: u,
108
101
  dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
109
102
  }), !l || !t) {
110
103
  o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
111
104
  return;
112
105
  }
113
- if (N.current) {
106
+ if (_.current) {
114
107
  o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
115
108
  return;
116
109
  }
117
- if (((C = L.current) == null ? void 0 : C.serviceId) === l && ((M = L.current) == null ? void 0 : M.userId) === t.id) {
110
+ if (((A = N.current) == null ? void 0 : A.serviceId) === l && (($ = N.current) == null ? void 0 : $.userId) === t.id) {
118
111
  o(
119
112
  "⚠️ USER CONNECTION SKIPPED",
120
113
  "Already connected this user with this service"
@@ -122,34 +115,35 @@ const Yt = Ge({
122
115
  return;
123
116
  }
124
117
  (async () => {
125
- o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0), v(null);
118
+ o("🚀 STARTING USER CONNECTION", { userId: t.id }), _.current = !0, g(!0), v(null);
126
119
  try {
127
120
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
128
- const P = await l.connectUser(t);
129
- b(P), f(!0), L.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
121
+ const O = await l.connectUser(t);
122
+ b(O), f(!0), N.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
130
123
  userId: t.id,
131
- clientId: P.userID
124
+ clientId: O.userID
132
125
  });
133
- } catch (P) {
134
- const S = P instanceof Error ? P.message : "Connection failed";
135
- v(S), o("❌ USER CONNECTION ERROR", {
126
+ } catch (O) {
127
+ const U = O instanceof Error ? O.message : "Connection failed";
128
+ v(U), o("❌ USER CONNECTION ERROR", {
136
129
  userId: t.id,
137
- error: S
130
+ error: U
138
131
  });
139
132
  } finally {
140
- g(!1), N.current = !1, o("🔄 USER CONNECTION FINISHED", {
133
+ g(!1), _.current = !1, o("🔄 USER CONNECTION FINISHED", {
141
134
  userId: t.id,
142
135
  isConnected: u
143
136
  });
144
137
  }
145
138
  })();
146
- }, [l, t, o, u]), Y(() => (o("🔌 CLIENT CLEANUP EFFECT REGISTERED", {
147
- hasClient: !!T
148
- }), () => {
149
- var w;
150
- o("🧹 CLIENT CLEANUP EFFECT TRIGGERED", "Disconnecting client"), L.current = null, (w = _.current) == null || w.disconnectUser().catch(console.error);
151
- }), [T, o]);
152
- const A = W(async () => {
139
+ }, [l, t, o, u]), Y(() => {
140
+ const k = L;
141
+ return () => {
142
+ var A;
143
+ k && (N.current = null, (A = w.current) == null || A.disconnectUser().catch(console.error));
144
+ };
145
+ }, [L]);
146
+ const T = W(async () => {
153
147
  if (o("🔄 REFRESH CONNECTION CALLED", {
154
148
  hasService: !!l,
155
149
  hasUser: !!t
@@ -160,18 +154,18 @@ const Yt = Ge({
160
154
  o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), g(!0);
161
155
  try {
162
156
  o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
163
- const w = await l.connectUser(t);
164
- b(w), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
165
- } catch (w) {
166
- const C = w instanceof Error ? w.message : "Refresh failed";
167
- v(C), o("❌ CONNECTION REFRESH ERROR", {
157
+ const k = await l.connectUser(t);
158
+ b(k), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
159
+ } catch (k) {
160
+ const A = k instanceof Error ? k.message : "Refresh failed";
161
+ v(A), o("❌ CONNECTION REFRESH ERROR", {
168
162
  userId: t.id,
169
- error: C
163
+ error: A
170
164
  });
171
165
  } finally {
172
166
  g(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
173
167
  }
174
- }, [l, t, o]), R = F.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
168
+ }, [l, t, o]), D = j.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
175
169
  hasService: !!l,
176
170
  hasClient: !!m,
177
171
  isConnected: u,
@@ -185,7 +179,7 @@ const Yt = Ge({
185
179
  isLoading: c,
186
180
  error: p,
187
181
  capabilities: r,
188
- refreshConnection: A,
182
+ refreshConnection: T,
189
183
  debug: i
190
184
  }), [
191
185
  l,
@@ -194,18 +188,18 @@ const Yt = Ge({
194
188
  c,
195
189
  p,
196
190
  r,
197
- A,
191
+ T,
198
192
  i,
199
193
  o
200
194
  ]);
201
195
  return o("🔄 RENDER END", {
202
- renderCount: I.current,
203
- willRenderChat: !!T,
204
- contextValueReady: !!R
205
- }), /* @__PURE__ */ n(Yt.Provider, { value: R, children: T ? /* @__PURE__ */ n(
196
+ renderCount: P.current,
197
+ willRenderChat: !!L,
198
+ contextValueReady: !!D
199
+ }), /* @__PURE__ */ n(Yt.Provider, { value: D, children: L ? /* @__PURE__ */ n(
206
200
  Tn,
207
201
  {
208
- client: T,
202
+ client: L,
209
203
  customClasses: {
210
204
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
211
205
  },
@@ -214,7 +208,7 @@ const Yt = Ge({
214
208
  ) : e });
215
209
  }, Os = () => qe(), qt = (e) => {
216
210
  var a, r;
217
- const [t, s] = O(
211
+ const [t, s] = z(
218
212
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
219
213
  );
220
214
  return Y(() => {
@@ -369,73 +363,73 @@ const ae = ({
369
363
  onActionComplete: m,
370
364
  logLabel: b = "useChannelModerationActions"
371
365
  }) => {
372
- var P;
373
- const { service: u, debug: f } = qe(), c = (P = t == null ? void 0 : t.user) == null ? void 0 : P.id, g = !!(a && s && u && c), [p, v] = O(!1), [N, _] = O(null), [E, I] = O(!1), [T, L] = O(!1), A = g && ((N == null ? void 0 : N.participantId) !== c || (N == null ? void 0 : N.service) !== u);
366
+ var B;
367
+ const { service: u, debug: f } = qe(), c = (B = t == null ? void 0 : t.user) == null ? void 0 : B.id, g = !!(a && s && u && c), [p, v] = z(!1), [_, w] = z(null), [I, S] = z(!1), [M, P] = z(!1), R = g && ((_ == null ? void 0 : _.participantId) !== c || (_ == null ? void 0 : _.service) !== u);
374
368
  return Y(() => {
375
369
  if (!g || !u || !c) {
376
- v(!1), _(null);
370
+ v(!1), w(null);
377
371
  return;
378
372
  }
379
- let S = !1;
373
+ let E = !1;
380
374
  return (async () => {
381
375
  try {
382
- const D = await u.getBlockedUsers();
383
- if (S) return;
376
+ const k = await u.getBlockedUsers();
377
+ if (E) return;
384
378
  v(
385
- D.some(
386
- ($) => $.blocked_user_id === c
379
+ k.some(
380
+ (A) => A.blocked_user_id === c
387
381
  )
388
382
  );
389
- } catch (D) {
390
- S || console.error(`[${b}] Failed to check blocked status:`, D);
383
+ } catch (k) {
384
+ E || console.error(`[${b}] Failed to check blocked status:`, k);
391
385
  } finally {
392
- S || _({ participantId: c, service: u });
386
+ E || w({ participantId: c, service: u });
393
387
  }
394
388
  })(), () => {
395
- S = !0;
389
+ E = !0;
396
390
  };
397
391
  }, [g, u, c, b]), {
398
392
  isParticipantBlocked: p,
399
- isCheckingBlockedStatus: A,
400
- isLeaving: E,
401
- isUpdatingBlockStatus: T,
393
+ isCheckingBlockedStatus: R,
394
+ isLeaving: I,
395
+ isUpdatingBlockStatus: M,
402
396
  handleLeaveConversation: async () => {
403
- var S;
404
- if (!E) {
405
- o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), I(!0);
397
+ var E;
398
+ if (!I) {
399
+ o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), S(!0);
406
400
  try {
407
- const D = ((S = e._client) == null ? void 0 : S.userID) ?? null;
408
- await e.hide(D, !1), r && await r(e), m == null || m();
409
- } catch (D) {
410
- console.error(`[${b}] Failed to leave conversation`, D);
401
+ const k = ((E = e._client) == null ? void 0 : E.userID) ?? null;
402
+ await e.hide(k, !1), r && await r(e), m == null || m();
403
+ } catch (k) {
404
+ console.error(`[${b}] Failed to leave conversation`, k);
411
405
  } finally {
412
- I(!1);
406
+ S(!1);
413
407
  }
414
408
  }
415
409
  },
416
410
  handleBlockUser: async () => {
417
- var S, D, $;
418
- if (!(T || !u)) {
419
- l == null || l(), f && console.log(`[${b}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
411
+ var E, k, A;
412
+ if (!(M || !u)) {
413
+ l == null || l(), f && console.log(`[${b}] Block member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), P(!0);
420
414
  try {
421
- await u.blockUser((D = t == null ? void 0 : t.user) == null ? void 0 : D.id), i && await i(($ = t == null ? void 0 : t.user) == null ? void 0 : $.id), m == null || m();
422
- } catch (V) {
423
- console.error(`[${b}] Failed to block member`, V);
415
+ await u.blockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), m == null || m();
416
+ } catch ($) {
417
+ console.error(`[${b}] Failed to block member`, $);
424
418
  } finally {
425
- L(!1);
419
+ P(!1);
426
420
  }
427
421
  }
428
422
  },
429
423
  handleUnblockUser: async () => {
430
- var S, D, $;
431
- if (!(T || !u)) {
432
- l == null || l(), f && console.log(`[${b}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
424
+ var E, k, A;
425
+ if (!(M || !u)) {
426
+ l == null || l(), f && console.log(`[${b}] Unblock member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), P(!0);
433
427
  try {
434
- await u.unBlockUser((D = t == null ? void 0 : t.user) == null ? void 0 : D.id), i && await i(($ = t == null ? void 0 : t.user) == null ? void 0 : $.id), m == null || m();
435
- } catch (V) {
436
- console.error(`[${b}] Failed to unblock member`, V);
428
+ await u.unBlockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), m == null || m();
429
+ } catch ($) {
430
+ console.error(`[${b}] Failed to unblock member`, $);
437
431
  } finally {
438
- L(!1);
432
+ P(!1);
439
433
  }
440
434
  }
441
435
  },
@@ -474,15 +468,15 @@ const ae = ({
474
468
  customChannelActions: b,
475
469
  triggerClassName: u
476
470
  }) => {
477
- const [f, c] = O(!1), g = H(null), p = En(), v = W(() => c(!1), []), {
478
- isParticipantBlocked: N,
479
- isCheckingBlockedStatus: _,
480
- isLeaving: E,
481
- isUpdatingBlockStatus: I,
482
- handleLeaveConversation: T,
483
- handleBlockUser: L,
484
- handleUnblockUser: A,
485
- handleReportUser: R
471
+ const [f, c] = z(!1), g = G(null), p = En(), v = W(() => c(!1), []), {
472
+ isParticipantBlocked: _,
473
+ isCheckingBlockedStatus: w,
474
+ isLeaving: I,
475
+ isUpdatingBlockStatus: S,
476
+ handleLeaveConversation: M,
477
+ handleBlockUser: P,
478
+ handleUnblockUser: R,
479
+ handleReportUser: L
486
480
  } = js({
487
481
  channel: e,
488
482
  participant: t,
@@ -498,13 +492,13 @@ const ae = ({
498
492
  });
499
493
  return Y(() => {
500
494
  if (!f) return;
501
- const C = (P) => {
502
- g.current && !g.current.contains(P.target) && c(!1);
503
- }, M = (P) => {
504
- P.key === "Escape" && c(!1);
495
+ const T = (B) => {
496
+ g.current && !g.current.contains(B.target) && c(!1);
497
+ }, D = (B) => {
498
+ B.key === "Escape" && c(!1);
505
499
  };
506
- return document.addEventListener("mousedown", C), document.addEventListener("keydown", M), () => {
507
- document.removeEventListener("mousedown", C), document.removeEventListener("keydown", M);
500
+ return document.addEventListener("mousedown", T), document.addEventListener("keydown", D), () => {
501
+ document.removeEventListener("mousedown", T), document.removeEventListener("keydown", D);
508
502
  };
509
503
  }, [f]), !t || !(s || a || r || !!b) ? null : /* @__PURE__ */ h("div", { ref: g, className: "relative", children: [
510
504
  /* @__PURE__ */ h(
@@ -515,7 +509,7 @@ const ae = ({
515
509
  "aria-haspopup": "true",
516
510
  "aria-expanded": f,
517
511
  "aria-controls": f ? p : void 0,
518
- onClick: () => c((C) => !C),
512
+ onClick: () => c((T) => !T),
519
513
  children: [
520
514
  /* @__PURE__ */ n(ms, { className: "size-5 text-black/90" }),
521
515
  /* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
@@ -535,46 +529,46 @@ const ae = ({
535
529
  s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
536
530
  he,
537
531
  {
538
- onClick: T,
539
- disabled: E,
540
- "aria-busy": E,
532
+ onClick: M,
533
+ disabled: I,
534
+ "aria-busy": I,
541
535
  children: [
542
- E ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(hs, { className: "h-5 w-5" }),
536
+ I ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(hs, { className: "h-5 w-5" }),
543
537
  /* @__PURE__ */ n("span", { children: "Delete Conversation" })
544
538
  ]
545
539
  }
546
540
  ) }),
547
- a && /* @__PURE__ */ n("li", { children: _ ? (
541
+ a && /* @__PURE__ */ n("li", { children: w ? (
548
542
  // Block status not yet resolved — show a disabled placeholder
549
543
  // so a premature click can't act on a stale block state.
550
544
  /* @__PURE__ */ h(he, { disabled: !0, "aria-busy": !0, children: [
551
545
  /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }),
552
546
  /* @__PURE__ */ n("span", { children: "Block" })
553
547
  ] })
554
- ) : N ? /* @__PURE__ */ h(
548
+ ) : _ ? /* @__PURE__ */ h(
555
549
  he,
556
550
  {
557
- onClick: A,
558
- disabled: I,
559
- "aria-busy": I,
551
+ onClick: R,
552
+ disabled: S,
553
+ "aria-busy": S,
560
554
  children: [
561
- I ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
555
+ S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
562
556
  /* @__PURE__ */ n("span", { children: "Unblock" })
563
557
  ]
564
558
  }
565
559
  ) : /* @__PURE__ */ h(
566
560
  he,
567
561
  {
568
- onClick: L,
569
- disabled: I,
570
- "aria-busy": I,
562
+ onClick: P,
563
+ disabled: S,
564
+ "aria-busy": S,
571
565
  children: [
572
- I ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
566
+ S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
573
567
  /* @__PURE__ */ n("span", { children: "Block" })
574
568
  ]
575
569
  }
576
570
  ) }),
577
- r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: R, children: [
571
+ r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: L, children: [
578
572
  /* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
579
573
  /* @__PURE__ */ n("span", { children: "Report" })
580
574
  ] }) }),
@@ -625,13 +619,13 @@ function Xt({
625
619
  const s = e == null ? void 0 : e.text, a = Ys(t);
626
620
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
627
621
  }
628
- const qs = F.lazy(() => import("./Card-BmU_ztmU.js")), Ws = F.lazy(() => import("./Card-CHDQEG9i.js")), Xs = F.lazy(() => import("./Card-D-sSG334.js")), We = () => /* @__PURE__ */ n(
622
+ const qs = j.lazy(() => import("./Card-VgnjOBSF.js")), Ws = j.lazy(() => import("./Card-datOr9-K.js")), Xs = j.lazy(() => import("./Card-Likc_mEq.js")), We = () => /* @__PURE__ */ n(
629
623
  "div",
630
624
  {
631
625
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
632
626
  "aria-hidden": !0
633
627
  }
634
- ), Js = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Ws, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Ks = Jt, Zs = Kt, Ot = { Composer: Js, Sent: Jt, Received: Kt, Creator: Ks, Visitor: Zs }, Qs = [
628
+ ), Ks = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Ws, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Js = Kt, Zs = Jt, Ot = { Composer: Ks, Sent: Kt, Received: Jt, Creator: Js, Visitor: Zs }, Qs = [
635
629
  [/pdf/, "pdf"],
636
630
  [/wordprocessingml|msword|\.doc/, "doc"],
637
631
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -671,7 +665,7 @@ function na(e) {
671
665
  return t !== "document" ? ea[t] : ta[Zt(e)];
672
666
  }
673
667
  function le(e, t) {
674
- return F.createElement(na(e), t);
668
+ return j.createElement(na(e), t);
675
669
  }
676
670
  const sa = (e) => {
677
671
  var t, s;
@@ -688,23 +682,23 @@ const sa = (e) => {
688
682
  muted: d = !1,
689
683
  onContainerClick: m
690
684
  }) => {
691
- const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [p, v] = O(a), [N, _] = O(0), [E, I] = O(!1), [T, L] = O(!1), [A, R] = O(!1), [w, C] = O(!1), [M, P] = O(!0), [S, D] = O(null), $ = W(() => {
692
- R(!1), v(!0);
693
- }, []), V = W((x) => {
694
- const k = f.current;
695
- if (!k) return 0;
696
- const j = k.getBoundingClientRect();
685
+ const b = ne(t), u = G(null), f = G(null), c = G(null), g = G(r), [p, v] = z(a), [_, w] = z(0), [I, S] = z(!1), [M, P] = z(!1), [R, L] = z(!1), [N, T] = z(!1), [D, B] = z(!0), [E, k] = z(null), A = W(() => {
686
+ L(!1), v(!0);
687
+ }, []), $ = W((x) => {
688
+ const C = f.current;
689
+ if (!C) return 0;
690
+ const V = C.getBoundingClientRect();
697
691
  return Math.max(
698
692
  0,
699
- Math.min(1, (sa(x) - j.left) / j.width)
693
+ Math.min(1, (sa(x) - V.left) / V.width)
700
694
  );
701
- }, []), B = W((x) => {
702
- const k = u.current;
703
- k && k.duration && (k.currentTime = x * k.duration);
695
+ }, []), O = W((x) => {
696
+ const C = u.current;
697
+ C && C.duration && (C.currentTime = x * C.duration);
704
698
  }, []), U = (x) => {
705
- x.stopPropagation(), I(!0);
706
- const k = V(x);
707
- _(k), B(k);
699
+ x.stopPropagation(), S(!0);
700
+ const C = $(x);
701
+ w(C), O(C);
708
702
  };
709
703
  Y(() => {
710
704
  r !== void 0 && r !== g.current && (g.current = r, v(r));
@@ -714,40 +708,40 @@ const sa = (e) => {
714
708
  return;
715
709
  }
716
710
  const x = () => {
717
- const k = u.current;
718
- k && k.duration && !E && _(k.currentTime / k.duration), c.current = requestAnimationFrame(x);
711
+ const C = u.current;
712
+ C && C.duration && !I && w(C.currentTime / C.duration), c.current = requestAnimationFrame(x);
719
713
  };
720
714
  return c.current = requestAnimationFrame(x), () => {
721
715
  c.current !== null && cancelAnimationFrame(c.current);
722
716
  };
723
- }, [p, E]), Y(() => {
717
+ }, [p, I]), Y(() => {
724
718
  const x = u.current;
725
- x && (p ? x.play().catch((k) => {
726
- v(!1), R(!0);
719
+ x && (p ? x.play().catch((C) => {
720
+ v(!1), L(!0);
727
721
  }) : x.pause());
728
722
  }, [p]), Y(() => {
729
- if (!E) return;
730
- const x = (j) => _(V(j)), k = (j) => {
731
- I(!1), B(V(j));
723
+ if (!I) return;
724
+ const x = (V) => w($(V)), C = (V) => {
725
+ S(!1), O($(V));
732
726
  };
733
- return window.addEventListener("mousemove", x), window.addEventListener("mouseup", k), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", k), () => {
734
- window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", k);
727
+ return window.addEventListener("mousemove", x), window.addEventListener("mouseup", C), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", C), () => {
728
+ window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", C);
735
729
  };
736
- }, [E, V, B]);
737
- const X = S ? { aspectRatio: String(S) } : void 0, G = S ? "" : " aspect-video", z = Math.round(N * 100);
730
+ }, [I, $, O]);
731
+ const X = E ? { aspectRatio: String(E) } : void 0, H = E ? "" : " aspect-video", F = Math.round(_ * 100);
738
732
  return /* @__PURE__ */ h(
739
733
  "div",
740
734
  {
741
735
  role: "button",
742
736
  tabIndex: 0,
743
- className: `relative cursor-pointer overflow-hidden bg-black ${G}`,
737
+ className: `relative cursor-pointer overflow-hidden bg-black ${H}`,
744
738
  style: X,
745
739
  onClick: (x) => {
746
740
  if (m) {
747
741
  m(x);
748
742
  return;
749
743
  }
750
- A || o && v((k) => !k);
744
+ R || o && v((C) => !C);
751
745
  },
752
746
  onKeyDown: (x) => {
753
747
  if (!(x.key !== "Enter" && x.key !== " ")) {
@@ -755,11 +749,11 @@ const sa = (e) => {
755
749
  m(x);
756
750
  return;
757
751
  }
758
- A || o && v((k) => !k);
752
+ R || o && v((C) => !C);
759
753
  }
760
754
  },
761
755
  children: [
762
- s && (b === "audio" || M) && /* @__PURE__ */ n(
756
+ s && (b === "audio" || D) && /* @__PURE__ */ n(
763
757
  "img",
764
758
  {
765
759
  src: s,
@@ -767,7 +761,7 @@ const sa = (e) => {
767
761
  className: "absolute inset-0 h-full w-full object-cover"
768
762
  }
769
763
  ),
770
- !s && (b === "audio" || M) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
764
+ !s && (b === "audio" || D) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
771
765
  className: "size-12 text-black/20",
772
766
  weight: "regular"
773
767
  }) }),
@@ -779,14 +773,14 @@ const sa = (e) => {
779
773
  loop: i,
780
774
  muted: d,
781
775
  style: { width: "100%", height: "100%" },
782
- onLoadStart: () => C(!0),
776
+ onLoadStart: () => T(!0),
783
777
  onCanPlay: () => {
784
- C(!1), P(!1);
778
+ T(!1), B(!1);
785
779
  },
786
- onWaiting: () => C(!0),
787
- onPlay: () => R(!1),
780
+ onWaiting: () => T(!0),
781
+ onPlay: () => L(!1),
788
782
  onEnded: () => {
789
- i || (v(!1), _(0));
783
+ i || (v(!1), w(0));
790
784
  },
791
785
  children: /* @__PURE__ */ n("track", { kind: "captions" })
792
786
  }
@@ -799,30 +793,30 @@ const sa = (e) => {
799
793
  muted: d,
800
794
  playsInline: !0,
801
795
  style: { width: "100%", height: "100%" },
802
- onLoadStart: () => C(!0),
796
+ onLoadStart: () => T(!0),
803
797
  onCanPlay: () => {
804
- C(!1), P(!1);
798
+ T(!1), B(!1);
805
799
  },
806
- onWaiting: () => C(!0),
807
- onPlay: () => R(!1),
800
+ onWaiting: () => T(!0),
801
+ onPlay: () => L(!1),
808
802
  onLoadedMetadata: () => {
809
803
  const x = u.current;
810
- x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && D(x.videoWidth / x.videoHeight);
804
+ x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && k(x.videoWidth / x.videoHeight);
811
805
  },
812
806
  onEnded: () => {
813
- i || (v(!1), _(0));
807
+ i || (v(!1), w(0));
814
808
  },
815
809
  children: /* @__PURE__ */ n("track", { kind: "captions" })
816
810
  }
817
811
  ) }),
818
- w && !A && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
812
+ N && !R && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
819
813
  ge,
820
814
  {
821
815
  className: "size-8 animate-spin text-white/80",
822
816
  weight: "bold"
823
817
  }
824
818
  ) }),
825
- A && !o && /* @__PURE__ */ n(
819
+ R && !o && /* @__PURE__ */ n(
826
820
  "div",
827
821
  {
828
822
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
@@ -830,10 +824,10 @@ const sa = (e) => {
830
824
  tabIndex: 0,
831
825
  "aria-label": "Play preview",
832
826
  onClick: (x) => {
833
- x.stopPropagation(), $();
827
+ x.stopPropagation(), A();
834
828
  },
835
829
  onKeyDown: (x) => {
836
- x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), $());
830
+ x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), A());
837
831
  },
838
832
  children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
839
833
  }
@@ -843,7 +837,7 @@ const sa = (e) => {
843
837
  {
844
838
  role: "slider",
845
839
  "aria-label": "Playback position",
846
- "aria-valuenow": z,
840
+ "aria-valuenow": F,
847
841
  "aria-valuemin": 0,
848
842
  "aria-valuemax": 100,
849
843
  tabIndex: 0,
@@ -853,13 +847,13 @@ const sa = (e) => {
853
847
  onTouchStart: U,
854
848
  onClick: (x) => x.stopPropagation(),
855
849
  onKeyDown: (x) => {
856
- x.key === "ArrowRight" && B(Math.min(1, N + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, N - 0.05));
850
+ x.key === "ArrowRight" && O(Math.min(1, _ + 0.05)), x.key === "ArrowLeft" && O(Math.max(0, _ - 0.05));
857
851
  },
858
852
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
859
853
  "div",
860
854
  {
861
855
  className: "h-full rounded-full bg-white",
862
- style: { width: `${z}%` }
856
+ style: { width: `${F}%` }
863
857
  }
864
858
  ) })
865
859
  }
@@ -870,7 +864,7 @@ const sa = (e) => {
870
864
  {
871
865
  type: "button",
872
866
  onClick: (x) => {
873
- x.stopPropagation(), v((k) => !k);
867
+ x.stopPropagation(), v((C) => !C);
874
868
  },
875
869
  className: "shrink-0 text-white",
876
870
  "aria-label": p ? "Pause" : "Play",
@@ -882,7 +876,7 @@ const sa = (e) => {
882
876
  {
883
877
  role: "slider",
884
878
  "aria-label": "Playback position",
885
- "aria-valuenow": z,
879
+ "aria-valuenow": F,
886
880
  "aria-valuemin": 0,
887
881
  "aria-valuemax": 100,
888
882
  tabIndex: 0,
@@ -891,21 +885,21 @@ const sa = (e) => {
891
885
  onMouseDown: U,
892
886
  onTouchStart: U,
893
887
  onClick: (x) => x.stopPropagation(),
894
- onMouseEnter: () => L(!0),
895
- onMouseLeave: () => L(!1),
888
+ onMouseEnter: () => P(!0),
889
+ onMouseLeave: () => P(!1),
896
890
  onKeyDown: (x) => {
897
- x.key === "ArrowRight" && B(Math.min(1, N + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, N - 0.05));
891
+ x.key === "ArrowRight" && O(Math.min(1, _ + 0.05)), x.key === "ArrowLeft" && O(Math.max(0, _ - 0.05));
898
892
  },
899
893
  children: [
900
894
  /* @__PURE__ */ n(
901
895
  "div",
902
896
  {
903
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || E ? "h-1.5" : "h-1"}`,
897
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${M || I ? "h-1.5" : "h-1"}`,
904
898
  children: /* @__PURE__ */ n(
905
899
  "div",
906
900
  {
907
901
  className: "h-full rounded-full bg-white",
908
- style: { width: `${z}%` }
902
+ style: { width: `${F}%` }
909
903
  }
910
904
  )
911
905
  }
@@ -913,8 +907,8 @@ const sa = (e) => {
913
907
  /* @__PURE__ */ n(
914
908
  "div",
915
909
  {
916
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || E ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
917
- style: { left: `${z}%` }
910
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${M || I ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
911
+ style: { left: `${F}%` }
918
912
  }
919
913
  )
920
914
  ]
@@ -933,7 +927,7 @@ const sa = (e) => {
933
927
  mediaPlayerProps: i,
934
928
  containedImage: o = !1
935
929
  }) => {
936
- const l = ne(e), [d, m] = O(!1);
930
+ const l = ne(e), [d, m] = z(!1);
937
931
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
938
932
  aa,
939
933
  {
@@ -1091,8 +1085,8 @@ function ca(e) {
1091
1085
  function da(e) {
1092
1086
  return e ? "text-white/20" : "text-black/20";
1093
1087
  }
1094
- const Je = ({ attachment: e, isMyMessage: t }) => {
1095
- const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(F.Fragment, { children: [
1088
+ const Ke = ({ attachment: e, isMyMessage: t }) => {
1089
+ const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(j.Fragment, { children: [
1096
1090
  /* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
1097
1091
  "img",
1098
1092
  {
@@ -1118,7 +1112,7 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
1118
1112
  function nn(e) {
1119
1113
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1120
1114
  }
1121
- function Ke(e) {
1115
+ function Je(e) {
1122
1116
  var t;
1123
1117
  return (t = e.attachments) == null ? void 0 : t.find(nn);
1124
1118
  }
@@ -1138,7 +1132,7 @@ const ma = ({
1138
1132
  url: e,
1139
1133
  filename: t
1140
1134
  }) => {
1141
- const [s, a] = O(!1);
1135
+ const [s, a] = z(!1);
1142
1136
  return /* @__PURE__ */ n(
1143
1137
  "button",
1144
1138
  {
@@ -1154,7 +1148,7 @@ const ma = ({
1154
1148
  },
1155
1149
  disabled: s,
1156
1150
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
1157
- children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(F.Fragment, { children: [
1151
+ children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
1158
1152
  /* @__PURE__ */ n(be, { className: "size-4 text-white", weight: "bold" }),
1159
1153
  "Download"
1160
1154
  ] })
@@ -1243,7 +1237,7 @@ const sn = ({
1243
1237
  message: e,
1244
1238
  isMyMessage: t = !1
1245
1239
  }) => {
1246
- const s = Ke(e), a = Ze(e);
1240
+ const s = Je(e), a = Ze(e);
1247
1241
  return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
1248
1242
  !t && e.user && /* @__PURE__ */ n(
1249
1243
  ae,
@@ -1264,7 +1258,7 @@ const sn = ({
1264
1258
  {
1265
1259
  className: "str-chat__message-bubble",
1266
1260
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1267
- children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(Je, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
1261
+ children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(Ke, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
1268
1262
  }
1269
1263
  ) })
1270
1264
  }
@@ -1273,17 +1267,17 @@ const sn = ({
1273
1267
  }, fa = ({
1274
1268
  message: e
1275
1269
  }) => {
1276
- const t = Ke(e);
1270
+ const t = Je(e);
1277
1271
  if (t)
1278
- return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !0 }) });
1272
+ return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !0 }) });
1279
1273
  const s = Ze(e);
1280
1274
  return s ? /* @__PURE__ */ n(sn, { ...s }) : null;
1281
1275
  }, ga = ({
1282
1276
  message: e
1283
1277
  }) => {
1284
- const t = Ke(e);
1278
+ const t = Je(e);
1285
1279
  if (t)
1286
- return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !1 }) });
1280
+ return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !1 }) });
1287
1281
  const s = Ze(e);
1288
1282
  return s ? /* @__PURE__ */ n(an, { ...s }) : null;
1289
1283
  }, yi = Object.assign(ha, {
@@ -1376,7 +1370,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1376
1370
  "aria-label": "Good response",
1377
1371
  "aria-pressed": e === "up",
1378
1372
  "data-tooltip": "Good response",
1379
- children: /* @__PURE__ */ n(Is, { size: 16, weight: e === "up" ? "fill" : "regular" })
1373
+ children: /* @__PURE__ */ n(Ss, { size: 16, weight: e === "up" ? "fill" : "regular" })
1380
1374
  }
1381
1375
  ),
1382
1376
  /* @__PURE__ */ n(
@@ -1390,7 +1384,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1390
1384
  "aria-label": "Bad response",
1391
1385
  "aria-pressed": e === "down",
1392
1386
  "data-tooltip": "Bad response",
1393
- children: /* @__PURE__ */ n(Ss, { size: 16, weight: e === "down" ? "fill" : "regular" })
1387
+ children: /* @__PURE__ */ n(Is, { size: 16, weight: e === "down" ? "fill" : "regular" })
1394
1388
  }
1395
1389
  )
1396
1390
  ] }), ka = (e) => {
@@ -1412,26 +1406,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1412
1406
  renderText: g,
1413
1407
  threadList: p,
1414
1408
  viewerLanguage: v
1415
- } = e, { client: N } = Ye("CustomMessage"), { channel: _ } = ce("CustomMessage"), { isUnlocking: E, onUnlockClick: I, onFetchSource: T, onDownloadClick: L } = va("LockedAttachment"), [A, R] = O(!1), w = Rn(c.id), { selected: C, voteUp: M, voteDown: P } = Hs(c), {
1416
- Attachment: S = Ln,
1417
- EditMessageModal: D = Dn,
1418
- MessageActions: $,
1419
- MessageBlocked: V = Pn,
1420
- MessageBouncePrompt: B = On,
1409
+ } = e, { client: _ } = Ye("CustomMessage"), { channel: w } = ce("CustomMessage"), { isUnlocking: I, onUnlockClick: S, onFetchSource: M, onDownloadClick: P } = va("LockedAttachment"), [R, L] = z(!1), N = Rn(c.id), { selected: T, voteUp: D, voteDown: B } = Hs(c), {
1410
+ Attachment: E = Ln,
1411
+ EditMessageModal: k = Dn,
1412
+ MessageActions: A,
1413
+ MessageBlocked: $ = Pn,
1414
+ MessageBouncePrompt: O = On,
1421
1415
  MessageDeleted: U = zn,
1422
1416
  MessageIsThreadReplyInChannelButtonIndicator: X = $n,
1423
- MessageRepliesCountButton: G = Fn,
1424
- ReminderNotification: z = Bn,
1417
+ MessageRepliesCountButton: H = Fn,
1418
+ ReminderNotification: F = Bn,
1425
1419
  StreamedMessageText: x = Un,
1426
- PinIndicator: k
1427
- } = Ut("CustomMessage"), j = jn(c), q = Vn(c), Ne = ee(
1420
+ PinIndicator: C
1421
+ } = Ut("CustomMessage"), V = jn(c), q = Vn(c), Ne = ee(
1428
1422
  () => u == null ? void 0 : u(c),
1429
1423
  [u, c]
1430
- ), J = ee(() => {
1424
+ ), K = ee(() => {
1431
1425
  const me = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...me] : me;
1432
1426
  if (!ke(c)) return ye;
1433
- const It = ye.filter((St) => !("type" in St) || !nn(St));
1434
- return It.length === ye.length ? ye : It;
1427
+ const St = ye.filter((It) => !("type" in It) || !nn(It));
1428
+ return St.length === ye.length ? ye : St;
1435
1429
  }, [c]), re = ee(() => {
1436
1430
  const me = Xt({ message: c, viewerLanguage: v });
1437
1431
  return me === c.text ? c : { ...c, text: me };
@@ -1441,10 +1435,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1441
1435
  if (c.deleted_at || c.type === "deleted")
1442
1436
  return /* @__PURE__ */ n(U, { message: c });
1443
1437
  if (Hn(c))
1444
- return /* @__PURE__ */ n(V, {});
1445
- const K = !p && !!c.reply_count, se = !p && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Yn(c);
1438
+ return /* @__PURE__ */ n($, {});
1439
+ const J = !p && !!c.reply_count, se = !p && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Yn(c);
1446
1440
  let ie;
1447
- Q ? ie = () => m(c) : lt && (ie = () => R(!0));
1441
+ Q ? ie = () => m(c) : lt && (ie = () => L(!0));
1448
1442
  const de = f(), kn = y(
1449
1443
  "str-chat__message str-chat__message-simple",
1450
1444
  `str-chat__message--${c.type}`,
@@ -1452,30 +1446,30 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1452
1446
  de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1453
1447
  c.text ? "str-chat__message--has-text" : "has-no-text",
1454
1448
  {
1455
- "str-chat__message--has-attachment": j,
1449
+ "str-chat__message--has-attachment": V,
1456
1450
  "str-chat__message--highlighted": b,
1457
1451
  "str-chat__message--pinned pinned-message": c.pinned,
1458
1452
  "str-chat__message--with-reactions": q,
1459
1453
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((ft = c == null ? void 0 : c.error) == null ? void 0 : ft.status) !== 403,
1460
- "str-chat__message-with-thread-link": K || se,
1454
+ "str-chat__message-with-thread-link": J || se,
1461
1455
  "str-chat__virtual-message__wrapper--end": r,
1462
1456
  "str-chat__virtual-message__wrapper--first": i,
1463
1457
  "str-chat__virtual-message__wrapper--group": o
1464
1458
  }
1465
- ), ct = c.poll_id && N.polls.fromState(c.poll_id), dt = ya(c), ue = ke(c), ut = Na(c), Re = !!(J != null && J.length && !c.quoted_message), mt = ue && de && Re;
1459
+ ), ct = c.poll_id && _.polls.fromState(c.poll_id), dt = ya(c), ue = ke(c), ut = Na(c), Re = !!(K != null && K.length && !c.quoted_message), mt = ue && de && Re;
1466
1460
  return /* @__PURE__ */ h(te, { children: [
1467
1461
  a && /* @__PURE__ */ n(
1468
- D,
1462
+ k,
1469
1463
  {
1470
1464
  additionalMessageInputProps: t
1471
1465
  }
1472
1466
  ),
1473
- A && /* @__PURE__ */ n(
1467
+ R && /* @__PURE__ */ n(
1474
1468
  qn,
1475
1469
  {
1476
- MessageBouncePrompt: B,
1477
- onClose: () => R(!1),
1478
- open: A
1470
+ MessageBouncePrompt: O,
1471
+ onClose: () => L(!1),
1472
+ open: R
1479
1473
  }
1480
1474
  ),
1481
1475
  /* @__PURE__ */ h(
@@ -1484,8 +1478,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1484
1478
  className: kn,
1485
1479
  "data-message-id": c.id,
1486
1480
  children: [
1487
- k && /* @__PURE__ */ n(k, {}),
1488
- !!w && /* @__PURE__ */ n(z, { reminder: w }),
1481
+ C && /* @__PURE__ */ n(C, {}),
1482
+ !!N && /* @__PURE__ */ n(F, { reminder: N }),
1489
1483
  c.user && /* @__PURE__ */ n(
1490
1484
  ae,
1491
1485
  {
@@ -1517,7 +1511,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1517
1511
  },
1518
1512
  children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1519
1513
  de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1520
- $ && /* @__PURE__ */ n($, {}),
1514
+ A && /* @__PURE__ */ n(A, {}),
1521
1515
  /* @__PURE__ */ n(
1522
1516
  Ot.Sent,
1523
1517
  {
@@ -1527,8 +1521,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1527
1521
  amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
1528
1522
  detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
1529
1523
  paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
1530
- onPreviewClick: () => I == null ? void 0 : I(c, _),
1531
- onFetchSource: async () => await (T == null ? void 0 : T(c, _))
1524
+ onPreviewClick: () => S == null ? void 0 : S(c, w),
1525
+ onFetchSource: async () => await (M == null ? void 0 : M(c, w))
1532
1526
  }
1533
1527
  )
1534
1528
  ] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
@@ -1541,13 +1535,13 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1541
1535
  amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
1542
1536
  detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
1543
1537
  paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
1544
- isUnlocking: E(c.id),
1545
- onUnlockClick: () => I == null ? void 0 : I(c, _),
1546
- onFetchSource: async () => await (T == null ? void 0 : T(c, _)),
1547
- onDownloadClick: () => L == null ? void 0 : L(c, _)
1538
+ isUnlocking: I(c.id),
1539
+ onUnlockClick: () => S == null ? void 0 : S(c, w),
1540
+ onFetchSource: async () => await (M == null ? void 0 : M(c, w)),
1541
+ onDownloadClick: () => P == null ? void 0 : P(c, w)
1548
1542
  }
1549
1543
  ),
1550
- $ && /* @__PURE__ */ n($, {})
1544
+ A && /* @__PURE__ */ n(A, {})
1551
1545
  ] }),
1552
1546
  c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
1553
1547
  At,
@@ -1569,11 +1563,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1569
1563
  }
1570
1564
  ),
1571
1565
  ct && /* @__PURE__ */ n(Wn, { poll: ct }),
1572
- J != null && J.length && !c.quoted_message ? /* @__PURE__ */ n(
1573
- S,
1566
+ K != null && K.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
+ E,
1574
1568
  {
1575
1569
  actionHandler: l,
1576
- attachments: J
1570
+ attachments: K
1577
1571
  }
1578
1572
  ) : null,
1579
1573
  Ne ? /* @__PURE__ */ n(
@@ -1605,14 +1599,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1605
1599
  s && ue && /* @__PURE__ */ n(
1606
1600
  Ca,
1607
1601
  {
1608
- selected: C,
1609
- onVoteUp: M,
1610
- onVoteDown: P
1602
+ selected: T,
1603
+ onVoteUp: D,
1604
+ onVoteDown: B
1611
1605
  }
1612
1606
  )
1613
1607
  ] }),
1614
- K && /* @__PURE__ */ n(
1615
- G,
1608
+ J && /* @__PURE__ */ n(
1609
+ H,
1616
1610
  {
1617
1611
  onClick: d,
1618
1612
  reply_count: c.reply_count
@@ -1624,13 +1618,13 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1624
1618
  c.id
1625
1619
  )
1626
1620
  ] });
1627
- }, Ea = F.memo(
1621
+ }, Ea = j.memo(
1628
1622
  ka,
1629
1623
  (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Mn(e, t)
1630
- ), Ia = (e) => {
1624
+ ), Sa = (e) => {
1631
1625
  const t = pe("CustomMessage");
1632
1626
  return /* @__PURE__ */ n(Ea, { ...t, ...e });
1633
- }, Sa = () => {
1627
+ }, Ia = () => {
1634
1628
  var s;
1635
1629
  const { handleDelete: e, message: t } = pe("CustomMessageActions");
1636
1630
  return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
@@ -1662,7 +1656,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1662
1656
  Ps,
1663
1657
  {
1664
1658
  messageActionSet: [
1665
- { Component: Sa, placement: "quick", type: "delete" },
1659
+ { Component: Ia, placement: "quick", type: "delete" },
1666
1660
  { Component: Ta, placement: "quick", type: "flag" }
1667
1661
  ]
1668
1662
  }
@@ -1712,7 +1706,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1712
1706
  (t) => Tt.previewIsLoaded(t) || Tt.previewIsLoading(t)
1713
1707
  )
1714
1708
  }), La = () => {
1715
- const { linkPreviewsManager: e } = Jn(), { linkPreviews: t } = Kn(
1709
+ const { linkPreviewsManager: e } = Kn(), { linkPreviews: t } = Jn(
1716
1710
  e.state,
1717
1711
  Ra
1718
1712
  ), s = (r) => {
@@ -1726,7 +1720,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1726
1720
  },
1727
1721
  r.og_scrape_url
1728
1722
  )) }) : null;
1729
- }, ln = F.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1723
+ }, ln = j.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1730
1724
  "button",
1731
1725
  {
1732
1726
  ...s,
@@ -1942,14 +1936,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1942
1936
  if ((s == null ? void 0 : s.typing_events) === !1)
1943
1937
  return null;
1944
1938
  const m = e ? [] : Object.values(i).filter(
1945
- ({ parent_id: v, user: N }) => {
1946
- var _;
1947
- return (N == null ? void 0 : N.id) !== ((_ = r.user) == null ? void 0 : _.id) && !v;
1939
+ ({ parent_id: v, user: _ }) => {
1940
+ var w;
1941
+ return (_ == null ? void 0 : _.id) !== ((w = r.user) == null ? void 0 : w.id) && !v;
1948
1942
  }
1949
1943
  ), b = e ? Object.values(i).filter(
1950
- ({ parent_id: v, user: N }) => {
1951
- var _;
1952
- return (N == null ? void 0 : N.id) !== ((_ = r.user) == null ? void 0 : _.id) && v === (a == null ? void 0 : a.id);
1944
+ ({ parent_id: v, user: _ }) => {
1945
+ var w;
1946
+ return (_ == null ? void 0 : _.id) !== ((w = r.user) == null ? void 0 : w.id) && v === (a == null ? void 0 : a.id);
1953
1947
  }
1954
1948
  ) : [], u = e ? b : m;
1955
1949
  if (!u.length)
@@ -2017,7 +2011,7 @@ function Wa(e, t) {
2017
2011
  return i;
2018
2012
  }
2019
2013
  }
2020
- const Xa = () => null, Ja = ({ className: e, message: t }) => /* @__PURE__ */ h(
2014
+ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
2021
2015
  "div",
2022
2016
  {
2023
2017
  className: y("flex items-center justify-center h-full", e),
@@ -2060,12 +2054,12 @@ const Xa = () => null, Ja = ({ className: e, message: t }) => /* @__PURE__ */ h(
2060
2054
  t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
2061
2055
  ]
2062
2056
  }
2063
- ), Ee = F.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2064
- /* @__PURE__ */ n(Ja, { className: "w-6 h-6" }),
2057
+ ), Ee = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2058
+ /* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
2065
2059
  /* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
2066
2060
  ] }) }));
2067
2061
  Ee.displayName = "LoadingState";
2068
- const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bt = "Replies instantly with AI assistant", Ka = ({
2062
+ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bt = "Replies instantly with AI assistant", Ja = ({
2069
2063
  onBack: e,
2070
2064
  showBackButton: t,
2071
2065
  showStarButton: s = !1,
@@ -2081,23 +2075,23 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2081
2075
  customChannelActions: f,
2082
2076
  showActionsMenu: c = !0
2083
2077
  }) => {
2084
- var I, T, L, A, R;
2085
- const { channel: g } = ce(), p = F.useMemo(() => {
2086
- var M, P;
2087
- const w = (M = g._client) == null ? void 0 : M.userID;
2088
- return w ? Object.values(((P = g.state) == null ? void 0 : P.members) || {}).find(
2089
- (S) => {
2090
- var D;
2091
- return ((D = S.user) == null ? void 0 : D.id) && S.user.id !== w;
2078
+ var S, M, P, R, L;
2079
+ const { channel: g } = ce(), p = j.useMemo(() => {
2080
+ var D, B;
2081
+ const N = (D = g._client) == null ? void 0 : D.userID;
2082
+ return N ? Object.values(((B = g.state) == null ? void 0 : B.members) || {}).find(
2083
+ (E) => {
2084
+ var k;
2085
+ return ((k = E.user) == null ? void 0 : k.id) && E.user.id !== N;
2092
2086
  }
2093
2087
  ) : void 0;
2094
- }, [(I = g._client) == null ? void 0 : I.userID, (T = g.state) == null ? void 0 : T.members]), v = Wt(p == null ? void 0 : p.user), N = (L = p == null ? void 0 : p.user) == null ? void 0 : L.image, _ = qt(g), E = async () => {
2088
+ }, [(S = g._client) == null ? void 0 : S.userID, (M = g.state) == null ? void 0 : M.members]), v = Wt(p == null ? void 0 : p.user), _ = (P = p == null ? void 0 : p.user) == null ? void 0 : P.image, w = qt(g), I = async () => {
2095
2089
  try {
2096
- _ ? await g.unpin() : await g.pin();
2097
- } catch (w) {
2090
+ w ? await g.unpin() : await g.pin();
2091
+ } catch (N) {
2098
2092
  console.error(
2099
2093
  "[CustomChannelHeader] Failed to update pinned status:",
2100
- w
2094
+ N
2101
2095
  );
2102
2096
  }
2103
2097
  };
@@ -2121,10 +2115,10 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2121
2115
  /* @__PURE__ */ n(
2122
2116
  ae,
2123
2117
  {
2124
- id: ((A = p == null ? void 0 : p.user) == null ? void 0 : A.id) || g.id || "unknown",
2118
+ id: ((R = p == null ? void 0 : p.user) == null ? void 0 : R.id) || g.id || "unknown",
2125
2119
  name: v,
2126
- image: N,
2127
- starred: s && _,
2120
+ image: _,
2121
+ starred: s && w,
2128
2122
  dmAgentEnabled: a,
2129
2123
  size: 48
2130
2124
  }
@@ -2140,17 +2134,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2140
2134
  "button",
2141
2135
  {
2142
2136
  className: oe,
2143
- onClick: E,
2137
+ onClick: I,
2144
2138
  type: "button",
2145
- "aria-label": _ ? "Unstar conversation" : "Star conversation",
2139
+ "aria-label": w ? "Unstar conversation" : "Star conversation",
2146
2140
  children: /* @__PURE__ */ n(
2147
2141
  Fe,
2148
2142
  {
2149
2143
  className: y("size-5", {
2150
- "text-yellow-600": _,
2151
- "text-black/90": !_
2144
+ "text-yellow-600": w,
2145
+ "text-black/90": !w
2152
2146
  }),
2153
- weight: _ ? "duotone" : "regular"
2147
+ weight: w ? "duotone" : "regular"
2154
2148
  }
2155
2149
  )
2156
2150
  }
@@ -2192,10 +2186,10 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2192
2186
  /* @__PURE__ */ n(
2193
2187
  ae,
2194
2188
  {
2195
- id: ((R = p == null ? void 0 : p.user) == null ? void 0 : R.id) || g.id || "unknown",
2189
+ id: ((L = p == null ? void 0 : p.user) == null ? void 0 : L.id) || g.id || "unknown",
2196
2190
  name: v,
2197
- image: N,
2198
- starred: s && _,
2191
+ image: _,
2192
+ starred: s && w,
2199
2193
  dmAgentEnabled: a,
2200
2194
  size: 48
2201
2195
  }
@@ -2213,17 +2207,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2213
2207
  "button",
2214
2208
  {
2215
2209
  className: oe,
2216
- onClick: E,
2210
+ onClick: I,
2217
2211
  type: "button",
2218
- "aria-label": _ ? "Unstar conversation" : "Star conversation",
2212
+ "aria-label": w ? "Unstar conversation" : "Star conversation",
2219
2213
  children: /* @__PURE__ */ n(
2220
2214
  Fe,
2221
2215
  {
2222
2216
  className: y("size-6", {
2223
- "text-yellow-600": _,
2224
- "text-black/90": !_
2217
+ "text-yellow-600": w,
2218
+ "text-black/90": !w
2225
2219
  }),
2226
- weight: _ ? "duotone" : "regular"
2220
+ weight: w ? "duotone" : "regular"
2227
2221
  }
2228
2222
  )
2229
2223
  }
@@ -2266,60 +2260,60 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2266
2260
  composerDisabledReason: g,
2267
2261
  showStarButton: p = !1,
2268
2262
  chatbotVotingEnabled: v = !1,
2269
- renderChannelBanner: N,
2270
- customChannelActions: _,
2271
- renderMessage: E,
2272
- dmAgentEnabled: I = !1,
2273
- viewerLanguage: T,
2274
- showChannelInfo: L = !0
2263
+ renderChannelBanner: _,
2264
+ customChannelActions: w,
2265
+ renderMessage: I,
2266
+ dmAgentEnabled: S = !1,
2267
+ viewerLanguage: M,
2268
+ showChannelInfo: P = !0
2275
2269
  }) => {
2276
- var D, $, V, B, U, X;
2277
- const { channel: A } = ce(), R = F.useMemo(() => {
2278
- var x, k;
2279
- const G = (x = A._client) == null ? void 0 : x.userID;
2280
- return G ? Object.values(((k = A.state) == null ? void 0 : k.members) || {}).find(
2281
- (j) => {
2270
+ var k, A, $, O, U, X;
2271
+ const { channel: R } = ce(), L = j.useMemo(() => {
2272
+ var x, C;
2273
+ const H = (x = R._client) == null ? void 0 : x.userID;
2274
+ return H ? Object.values(((C = R.state) == null ? void 0 : C.members) || {}).find(
2275
+ (V) => {
2282
2276
  var q;
2283
- return ((q = j.user) == null ? void 0 : q.id) && j.user.id !== G;
2277
+ return ((q = V.user) == null ? void 0 : q.id) && V.user.id !== H;
2284
2278
  }
2285
2279
  ) : void 0;
2286
- }, [(D = A._client) == null ? void 0 : D.userID, ($ = A.state) == null ? void 0 : $.members]), w = F.useMemo(() => {
2287
- var x, k;
2288
- const G = (x = A._client) == null ? void 0 : x.userID;
2289
- return G ? Object.values(((k = A.state) == null ? void 0 : k.members) || {}).find((j) => {
2280
+ }, [(k = R._client) == null ? void 0 : k.userID, (A = R.state) == null ? void 0 : A.members]), N = j.useMemo(() => {
2281
+ var x, C;
2282
+ const H = (x = R._client) == null ? void 0 : x.userID;
2283
+ return H ? Object.values(((C = R.state) == null ? void 0 : C.members) || {}).find((V) => {
2290
2284
  var q;
2291
- return ((q = j.user) == null ? void 0 : q.id) === G;
2285
+ return ((q = V.user) == null ? void 0 : q.id) === H;
2292
2286
  }) : void 0;
2293
- }, [(V = A._client) == null ? void 0 : V.userID, (B = A.state) == null ? void 0 : B.members]), C = ((U = w == null ? void 0 : w.user) == null ? void 0 : U.is_account) ?? (w == null ? void 0 : w.is_account), M = ((X = R == null ? void 0 : R.user) == null ? void 0 : X.is_account) ?? (R == null ? void 0 : R.is_account), P = I && C === !1 && M === !0, S = W(
2294
- (G) => {
2295
- const { message: z } = pe("ChannelView"), x = /* @__PURE__ */ n(
2296
- Ia,
2287
+ }, [($ = R._client) == null ? void 0 : $.userID, (O = R.state) == null ? void 0 : O.members]), T = ((U = N == null ? void 0 : N.user) == null ? void 0 : U.is_account) ?? (N == null ? void 0 : N.is_account), D = ((X = L == null ? void 0 : L.user) == null ? void 0 : X.is_account) ?? (L == null ? void 0 : L.is_account), B = S && T === !1 && D === !0, E = W(
2288
+ (H) => {
2289
+ const { message: F } = pe("ChannelView"), x = /* @__PURE__ */ n(
2290
+ Sa,
2297
2291
  {
2298
- ...G,
2292
+ ...H,
2299
2293
  chatbotVotingEnabled: v,
2300
- viewerLanguage: T
2294
+ viewerLanguage: M
2301
2295
  }
2302
2296
  );
2303
- return !E || !z ? x : E(x, z);
2297
+ return !I || !F ? x : I(x, F);
2304
2298
  },
2305
- [v, E, T]
2299
+ [v, I, M]
2306
2300
  );
2307
2301
  return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
2308
2302
  os,
2309
2303
  {
2310
2304
  overrides: {
2311
- Message: S,
2305
+ Message: E,
2312
2306
  MessageActions: Aa
2313
2307
  },
2314
2308
  children: /* @__PURE__ */ h(ls, { children: [
2315
2309
  /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
2316
- Ka,
2310
+ Ja,
2317
2311
  {
2318
2312
  onBack: e,
2319
2313
  showBackButton: t,
2320
- showActionsMenu: L,
2314
+ showActionsMenu: P,
2321
2315
  showStarButton: p,
2322
- dmAgentEnabled: P,
2316
+ dmAgentEnabled: B,
2323
2317
  onLeaveConversation: i,
2324
2318
  onBlockParticipant: o,
2325
2319
  showDeleteConversation: l,
@@ -2328,10 +2322,10 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2328
2322
  onDeleteConversationClick: d,
2329
2323
  onBlockParticipantClick: m,
2330
2324
  onReportParticipantClick: b,
2331
- customChannelActions: _
2325
+ customChannelActions: w
2332
2326
  }
2333
2327
  ) }, "lt-channel-header"),
2334
- N ? /* @__PURE__ */ n(F.Fragment, { children: N() }, "lt-channel-banner") : null,
2328
+ _ ? /* @__PURE__ */ n(j.Fragment, { children: _() }, "lt-channel-banner") : null,
2335
2329
  /* @__PURE__ */ n(
2336
2330
  "div",
2337
2331
  {
@@ -2340,14 +2334,14 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2340
2334
  },
2341
2335
  "lt-channel-message-list"
2342
2336
  ),
2343
- r ? /* @__PURE__ */ n(F.Fragment, { children: r(A) }, "lt-channel-conversation-footer") : null,
2337
+ r ? /* @__PURE__ */ n(j.Fragment, { children: r(R) }, "lt-channel-conversation-footer") : null,
2344
2338
  /* @__PURE__ */ n(
2345
2339
  Oa,
2346
2340
  {
2347
2341
  ...s && {
2348
- renderActions: () => s == null ? void 0 : s(A)
2342
+ renderActions: () => s == null ? void 0 : s(R)
2349
2343
  },
2350
- renderFooter: () => a == null ? void 0 : a(A),
2344
+ renderFooter: () => a == null ? void 0 : a(R),
2351
2345
  disabled: c,
2352
2346
  disabledReason: g
2353
2347
  },
@@ -2356,7 +2350,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2356
2350
  ] })
2357
2351
  }
2358
2352
  ) });
2359
- }, dn = F.memo(
2353
+ }, dn = j.memo(
2360
2354
  ({
2361
2355
  channel: e,
2362
2356
  onBack: t,
@@ -2375,61 +2369,61 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2375
2369
  showBlockParticipant: g = !0,
2376
2370
  showReportParticipant: p = !0,
2377
2371
  composerDisabled: v = !1,
2378
- composerDisabledReason: N,
2379
- dmAgentEnabled: _,
2380
- messageMetadata: E,
2381
- onMessageSent: I,
2382
- showStarButton: T = !1,
2383
- chatbotVotingEnabled: L = !1,
2384
- renderChannelBanner: A,
2385
- customChannelActions: R,
2386
- renderMessage: w,
2387
- onMessageLinkClick: C,
2388
- sendButton: M,
2389
- attachmentPreviewList: P,
2390
- viewerLanguage: S,
2391
- showChannelInfo: D = !0
2372
+ composerDisabledReason: _,
2373
+ dmAgentEnabled: w,
2374
+ messageMetadata: I,
2375
+ onMessageSent: S,
2376
+ showStarButton: M = !1,
2377
+ chatbotVotingEnabled: P = !1,
2378
+ renderChannelBanner: R,
2379
+ customChannelActions: L,
2380
+ renderMessage: N,
2381
+ onMessageLinkClick: T,
2382
+ sendButton: D,
2383
+ attachmentPreviewList: B,
2384
+ viewerLanguage: E,
2385
+ showChannelInfo: k = !0
2392
2386
  }) => {
2393
- const $ = W(
2394
- async (B, U, X) => {
2387
+ const A = W(
2388
+ async (O, U, X) => {
2395
2389
  var q;
2396
- const G = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, z = _ && !G, x = {
2390
+ const H = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, F = w && !H, x = {
2397
2391
  ...U,
2398
- ...z && { silent: !0 },
2399
- ...E && {
2392
+ ...F && { silent: !0 },
2393
+ ...I && {
2400
2394
  metadata: {
2401
2395
  ...U.metadata ?? {},
2402
- ...E
2396
+ ...I
2403
2397
  }
2404
2398
  }
2405
- }, k = {
2399
+ }, C = {
2406
2400
  ...X,
2407
- ...z && { skip_push: !0 }
2408
- }, j = await e.sendMessage(x, k);
2409
- return I == null || I(j), j;
2401
+ ...F && { skip_push: !0 }
2402
+ }, V = await e.sendMessage(x, C);
2403
+ return S == null || S(V), V;
2410
2404
  },
2411
- [e, _, E, I]
2412
- ), V = H(null);
2405
+ [e, w, I, S]
2406
+ ), $ = G(null);
2413
2407
  return Y(() => {
2414
- if (!C) return;
2415
- const B = V.current;
2416
- if (!B) return;
2408
+ if (!T) return;
2409
+ const O = $.current;
2410
+ if (!O) return;
2417
2411
  const U = (X) => {
2418
- const G = X.target, z = G == null ? void 0 : G.closest("a[href]"), x = z == null ? void 0 : z.getAttribute("href");
2412
+ const H = X.target, F = H == null ? void 0 : H.closest("a[href]"), x = F == null ? void 0 : F.getAttribute("href");
2419
2413
  if (!x) return;
2420
- const k = z == null ? void 0 : z.closest("[data-message-id]"), j = k == null ? void 0 : k.getAttribute("data-message-id"), q = j ? e.state.messages.find((Ne) => Ne.id === j) : void 0;
2421
- C(x, q);
2414
+ const C = F == null ? void 0 : F.closest("[data-message-id]"), V = C == null ? void 0 : C.getAttribute("data-message-id"), q = V ? e.state.messages.find((Ne) => Ne.id === V) : void 0;
2415
+ T(x, q);
2422
2416
  };
2423
- return B.addEventListener("click", U), () => B.removeEventListener("click", U);
2424
- }, [C, e]), /* @__PURE__ */ n(
2417
+ return O.addEventListener("click", U), () => O.removeEventListener("click", U);
2418
+ }, [T, e]), /* @__PURE__ */ n(
2425
2419
  "div",
2426
2420
  {
2427
- ref: V,
2421
+ ref: $,
2428
2422
  className: y(
2429
2423
  "messaging-channel-view h-full flex flex-col",
2430
2424
  d
2431
2425
  ),
2432
- children: /* @__PURE__ */ n(cn.Provider, { value: _ ?? !1, children: /* @__PURE__ */ n(
2426
+ children: /* @__PURE__ */ n(cn.Provider, { value: w ?? !1, children: /* @__PURE__ */ n(
2433
2427
  is,
2434
2428
  {
2435
2429
  channel: e,
@@ -2438,9 +2432,9 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2438
2432
  LoadingIndicator: Ee,
2439
2433
  DateSeparator: Vs,
2440
2434
  TypingIndicator: qa,
2441
- doSendMessageRequest: $,
2442
- ...M ? { SendButton: M } : {},
2443
- ...P ? { AttachmentPreviewList: P } : {},
2435
+ doSendMessageRequest: A,
2436
+ ...D ? { SendButton: D } : {},
2437
+ ...B ? { AttachmentPreviewList: B } : {},
2444
2438
  children: /* @__PURE__ */ n(
2445
2439
  Za,
2446
2440
  {
@@ -2459,15 +2453,15 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2459
2453
  showBlockParticipant: g,
2460
2454
  showReportParticipant: p,
2461
2455
  composerDisabled: v,
2462
- composerDisabledReason: N,
2463
- showStarButton: T,
2464
- dmAgentEnabled: _,
2465
- chatbotVotingEnabled: L,
2466
- renderChannelBanner: A,
2467
- customChannelActions: R,
2468
- renderMessage: w,
2469
- viewerLanguage: S,
2470
- showChannelInfo: D
2456
+ composerDisabledReason: _,
2457
+ showStarButton: M,
2458
+ dmAgentEnabled: w,
2459
+ chatbotVotingEnabled: P,
2460
+ renderChannelBanner: R,
2461
+ customChannelActions: L,
2462
+ renderMessage: N,
2463
+ viewerLanguage: E,
2464
+ showChannelInfo: k
2471
2465
  }
2472
2466
  )
2473
2467
  }
@@ -2477,7 +2471,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2477
2471
  }
2478
2472
  );
2479
2473
  dn.displayName = "ChannelView";
2480
- const fe = F.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
2474
+ const fe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
2481
2475
  /* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
2482
2476
  /* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2483
2477
  /* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
@@ -2510,71 +2504,71 @@ const ki = ({
2510
2504
  renderChannelBanner: g,
2511
2505
  customChannelActions: p,
2512
2506
  renderMessage: v,
2513
- onMessageLinkClick: N,
2514
- showChannelInfo: _
2507
+ onMessageLinkClick: _,
2508
+ showChannelInfo: w
2515
2509
  }) => {
2516
2510
  const {
2517
- client: E,
2518
- isConnected: I,
2519
- isLoading: T,
2520
- error: L,
2521
- refreshConnection: A,
2522
- service: R,
2523
- debug: w
2524
- } = Os(), [C, M] = O(null), [P, S] = O(null), [D, $] = O(!1), { showDeleteConversation: V = !0 } = e, B = H(o);
2525
- B.current = o;
2526
- const U = H(a);
2511
+ client: I,
2512
+ isConnected: S,
2513
+ isLoading: M,
2514
+ error: P,
2515
+ refreshConnection: R,
2516
+ service: L,
2517
+ debug: N
2518
+ } = Os(), [T, D] = z(null), [B, E] = z(null), [k, A] = z(!1), { showDeleteConversation: $ = !0 } = e, O = G(o);
2519
+ O.current = o;
2520
+ const U = G(a);
2527
2521
  U.current = a;
2528
- const X = H(null), G = H(null);
2522
+ const X = G(null), H = G(null);
2529
2523
  Y(() => {
2530
- G.current = C;
2531
- }, [C]), Y(() => {
2532
- if (!E || !I) return;
2533
- const k = E.userID;
2534
- if (!k) return;
2535
- const j = `${k}::${i}`;
2536
- if (X.current === j) return;
2537
- X.current = j;
2524
+ H.current = T;
2525
+ }, [T]), Y(() => {
2526
+ if (!I || !S) return;
2527
+ const C = I.userID;
2528
+ if (!C) return;
2529
+ const V = `${C}::${i}`;
2530
+ if (X.current === V) return;
2531
+ X.current = V;
2538
2532
  const q = () => {
2539
- X.current === j && (X.current = null);
2533
+ X.current === V && (X.current = null);
2540
2534
  };
2541
2535
  (async () => {
2542
- var J, re;
2536
+ var K, re;
2543
2537
  try {
2544
- w && console.log(
2538
+ N && console.log(
2545
2539
  "[MessagingShell] Loading initial conversation with:",
2546
2540
  i
2547
2541
  );
2548
- const K = await E.queryChannels(
2542
+ const J = await I.queryChannels(
2549
2543
  {
2550
2544
  type: "messaging",
2551
- members: { $eq: [k, i] }
2545
+ members: { $eq: [C, i] }
2552
2546
  },
2553
2547
  {},
2554
2548
  { limit: 1 }
2555
2549
  );
2556
- if (K.length > 0) {
2557
- M(K[0]), S(null), (J = U.current) == null || J.call(U, K[0]), w && console.log(
2550
+ if (J.length > 0) {
2551
+ D(J[0]), E(null), (K = U.current) == null || K.call(U, J[0]), N && console.log(
2558
2552
  "[MessagingShell] Initial conversation loaded:",
2559
- K[0].id
2553
+ J[0].id
2560
2554
  );
2561
2555
  return;
2562
2556
  }
2563
- const se = B.current;
2564
- if (!se || !R) {
2565
- q(), S("No conversation found with this account"), w && console.log(
2557
+ const se = O.current;
2558
+ if (!se || !L) {
2559
+ q(), E("No conversation found with this account"), N && console.log(
2566
2560
  "[MessagingShell] No conversation found for:",
2567
2561
  i
2568
2562
  );
2569
2563
  return;
2570
2564
  }
2571
2565
  try {
2572
- const Q = await R.startChannelWithParticipant({
2566
+ const Q = await L.startChannelWithParticipant({
2573
2567
  id: se.id,
2574
2568
  name: se.name,
2575
2569
  phone: se.phone
2576
2570
  });
2577
- M(Q), S(null), (re = U.current) == null || re.call(U, Q), w && console.log(
2571
+ D(Q), E(null), (re = U.current) == null || re.call(U, Q), N && console.log(
2578
2572
  "[MessagingShell] Channel created and loaded:",
2579
2573
  Q.id
2580
2574
  );
@@ -2582,39 +2576,39 @@ const ki = ({
2582
2576
  console.error(
2583
2577
  "[MessagingShell] Failed to create conversation:",
2584
2578
  Q
2585
- ), q(), S("Failed to create conversation");
2579
+ ), q(), E("Failed to create conversation");
2586
2580
  }
2587
- } catch (K) {
2581
+ } catch (J) {
2588
2582
  console.error(
2589
2583
  "[MessagingShell] Failed to load initial conversation:",
2590
- K
2591
- ), q(), G.current || S("Failed to load conversation");
2584
+ J
2585
+ ), q(), H.current || E("Failed to load conversation");
2592
2586
  }
2593
2587
  })();
2594
- }, [i, E, I, R, w]);
2595
- const z = H(r);
2596
- z.current = r;
2588
+ }, [i, I, S, L, N]);
2589
+ const F = G(r);
2590
+ F.current = r;
2597
2591
  const x = W(() => {
2598
- var k;
2599
- M(null), $(!0), (k = z.current) == null || k.call(z);
2592
+ var C;
2593
+ D(null), A(!0), (C = F.current) == null || C.call(F);
2600
2594
  }, []);
2601
- return T ? /* @__PURE__ */ n(Ee, {}) : L ? /* @__PURE__ */ n(fe, { message: L, onBack: A }) : !I || !E ? /* @__PURE__ */ n(
2595
+ return M ? /* @__PURE__ */ n(Ee, {}) : P ? /* @__PURE__ */ n(fe, { message: P, onBack: R }) : !S || !I ? /* @__PURE__ */ n(
2602
2596
  fe,
2603
2597
  {
2604
2598
  message: "Not connected to messaging service",
2605
- onBack: A
2599
+ onBack: R
2606
2600
  }
2607
- ) : P ? /* @__PURE__ */ n(fe, { message: P }) : D && !C ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
2601
+ ) : B ? /* @__PURE__ */ n(fe, { message: B }) : k && !T ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : T ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
2608
2602
  dn,
2609
2603
  {
2610
- channel: C,
2604
+ channel: T,
2611
2605
  renderMessageInputActions: t,
2612
2606
  renderConversationFooter: s,
2613
2607
  renderChannelBanner: g,
2614
2608
  onLeaveConversation: x,
2615
2609
  onBlockParticipant: x,
2616
2610
  CustomChannelEmptyState: l,
2617
- showDeleteConversation: V,
2611
+ showDeleteConversation: $,
2618
2612
  onBlockParticipantClick: d,
2619
2613
  onReportParticipantClick: m,
2620
2614
  dmAgentEnabled: b,
@@ -2623,10 +2617,10 @@ const ki = ({
2623
2617
  viewerLanguage: c,
2624
2618
  customChannelActions: p,
2625
2619
  renderMessage: v,
2626
- onMessageLinkClick: N,
2627
- showChannelInfo: _
2620
+ onMessageLinkClick: _,
2621
+ showChannelInfo: w
2628
2622
  },
2629
- C.id
2623
+ T.id
2630
2624
  ) }) }) : /* @__PURE__ */ n(Ee, {});
2631
2625
  };
2632
2626
  function Qa(e) {
@@ -2635,14 +2629,14 @@ function Qa(e) {
2635
2629
  for (const s of t)
2636
2630
  e.state.addMessageSorted(s.message);
2637
2631
  }
2638
- const un = F.createContext({
2632
+ const un = j.createContext({
2639
2633
  selectedChannel: void 0,
2640
2634
  onChannelSelect: () => {
2641
2635
  },
2642
2636
  debug: !1,
2643
2637
  renderMessagePreview: void 0,
2644
2638
  viewerLanguage: void 0
2645
- }), er = un.Provider, tr = () => F.useContext(un), nr = (e, t) => {
2639
+ }), er = un.Provider, tr = () => j.useContext(un), nr = (e, t) => {
2646
2640
  const s = new Date(
2647
2641
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
2648
2642
  ), r = new Date(
@@ -2663,9 +2657,9 @@ const un = F.createContext({
2663
2657
  day: "numeric",
2664
2658
  year: "2-digit"
2665
2659
  });
2666
- }, mn = F.memo(
2660
+ }, mn = j.memo(
2667
2661
  ({ channel: e, unread: t }) => {
2668
- var L, A, R;
2662
+ var P, R, L;
2669
2663
  const {
2670
2664
  selectedChannel: s,
2671
2665
  onChannelSelect: a,
@@ -2674,40 +2668,40 @@ const un = F.createContext({
2674
2668
  viewerLanguage: o
2675
2669
  } = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2676
2670
  e && a(e);
2677
- }, m = (w) => {
2678
- const C = w.key === "Enter" || w.key === " ", M = w.repeat;
2679
- !C || M || (w.preventDefault(), d());
2680
- }, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
2681
- (w) => {
2682
- var C, M;
2683
- return ((C = w.user) == null ? void 0 : C.id) && w.user.id !== ((M = e == null ? void 0 : e._client) == null ? void 0 : M.userID);
2671
+ }, m = (N) => {
2672
+ const T = N.key === "Enter" || N.key === " ", D = N.repeat;
2673
+ !T || D || (N.preventDefault(), d());
2674
+ }, u = Object.values(((P = e == null ? void 0 : e.state) == null ? void 0 : P.members) || {}).find(
2675
+ (N) => {
2676
+ var T, D;
2677
+ return ((T = N.user) == null ? void 0 : T.id) && N.user.id !== ((D = e == null ? void 0 : e._client) == null ? void 0 : D.userID);
2684
2678
  }
2685
- ), f = Wt(u == null ? void 0 : u.user), c = (A = u == null ? void 0 : u.user) == null ? void 0 : A.image, g = (() => {
2686
- var C;
2687
- const w = (C = e == null ? void 0 : e.state) == null ? void 0 : C.messages;
2688
- if (w != null && w.length) {
2689
- for (let M = w.length - 1; M >= 0; M--)
2690
- if (w[M].type !== "system") return w[M];
2679
+ ), f = Wt(u == null ? void 0 : u.user), c = (R = u == null ? void 0 : u.user) == null ? void 0 : R.image, g = (() => {
2680
+ var T;
2681
+ const N = (T = e == null ? void 0 : e.state) == null ? void 0 : T.messages;
2682
+ if (N != null && N.length) {
2683
+ for (let D = N.length - 1; D >= 0; D--)
2684
+ if (N[D].type !== "system") return N[D];
2691
2685
  }
2692
2686
  })(), v = (() => {
2693
- var D, $, V, B;
2694
- const w = Xt({
2687
+ var k, A, $, O;
2688
+ const N = Xt({
2695
2689
  message: g,
2696
2690
  viewerLanguage: o
2697
2691
  });
2698
- if (((D = g == null ? void 0 : g.metadata) == null ? void 0 : D.custom_type) === "MESSAGE_TIP") return w ? `💵 ${w}` : "💵 Sent a tip";
2699
- if ((($ = g == null ? void 0 : g.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_PAID") return w ? `💰 ${w}` : "💰 Sent a message";
2700
- if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_ATTACHMENT") return w ? `📎 ${w}` : "📎 Sent an attachment";
2701
- if (w) return w;
2702
- const S = (B = g == null ? void 0 : g.attachments) == null ? void 0 : B[0];
2703
- return S ? S.og_scrape_url ? S.og_scrape_url : S.type === "image" ? "📷 Sent an image" : S.type === "video" ? "🎥 Sent a video" : S.type === "audio" ? "🎵 Sent audio" : S.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2704
- })(), N = g != null && g.created_at ? sr(new Date(g.created_at)) : "", _ = g ? ke(g) : !1, E = i ? i(g, v) : `${_ ? "✨ " : ""}${v}`, I = qt(e), T = t ?? 0;
2692
+ if (((k = g == null ? void 0 : g.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
2693
+ if (((A = g == null ? void 0 : g.metadata) == null ? void 0 : A.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
2694
+ if ((($ = g == null ? void 0 : g.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
2695
+ if (N) return N;
2696
+ const E = (O = g == null ? void 0 : g.attachments) == null ? void 0 : O[0];
2697
+ return E ? E.og_scrape_url ? E.og_scrape_url : E.type === "image" ? "📷 Sent an image" : E.type === "video" ? "🎥 Sent a video" : E.type === "audio" ? "🎵 Sent audio" : E.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2698
+ })(), _ = g != null && g.created_at ? sr(new Date(g.created_at)) : "", w = g ? ke(g) : !1, I = i ? i(g, v) : `${w ? "✨ " : ""}${v}`, S = qt(e), M = t ?? 0;
2705
2699
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
2706
2700
  channelId: e == null ? void 0 : e.id,
2707
2701
  isSelected: l,
2708
2702
  participantName: f,
2709
- unreadCount: T,
2710
- hasTimestamp: !!N
2703
+ unreadCount: M,
2704
+ hasTimestamp: !!_
2711
2705
  }), /* @__PURE__ */ n(
2712
2706
  "div",
2713
2707
  {
@@ -2726,11 +2720,11 @@ const un = F.createContext({
2726
2720
  /* @__PURE__ */ n(
2727
2721
  ae,
2728
2722
  {
2729
- id: ((R = u == null ? void 0 : u.user) == null ? void 0 : R.id) || e.id || "unknown",
2723
+ id: ((L = u == null ? void 0 : u.user) == null ? void 0 : L.id) || e.id || "unknown",
2730
2724
  name: f,
2731
2725
  image: c,
2732
2726
  size: 48,
2733
- starred: I
2727
+ starred: S
2734
2728
  }
2735
2729
  ),
2736
2730
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
@@ -2742,16 +2736,16 @@ const un = F.createContext({
2742
2736
  "text-sm font-medium truncate text-[#191918]"
2743
2737
  ),
2744
2738
  children: [
2745
- I && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2739
+ S && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2746
2740
  f
2747
2741
  ]
2748
2742
  }
2749
2743
  ),
2750
- N && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
2744
+ _ && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: _ })
2751
2745
  ] }),
2752
2746
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
2753
- /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: E }),
2754
- T > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: T > 99 ? "99+" : T })
2747
+ /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: I }),
2748
+ M > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: M > 99 ? "99+" : M })
2755
2749
  ] })
2756
2750
  ] })
2757
2751
  ] })
@@ -2760,7 +2754,7 @@ const un = F.createContext({
2760
2754
  }
2761
2755
  );
2762
2756
  mn.displayName = "CustomChannelPreview";
2763
- const ar = { last_message_at: -1 }, rr = F.memo(
2757
+ const ar = { last_message_at: -1 }, rr = j.memo(
2764
2758
  ({
2765
2759
  onChannelSelect: e,
2766
2760
  selectedChannel: t,
@@ -2773,9 +2767,9 @@ const ar = { last_message_at: -1 }, rr = F.memo(
2773
2767
  renderMessagePreview: d,
2774
2768
  viewerLanguage: m
2775
2769
  }) => {
2776
- const b = F.useRef(0);
2770
+ const b = j.useRef(0);
2777
2771
  b.current++;
2778
- const { debug: u = !1 } = qe(), f = F.useCallback(
2772
+ const { debug: u = !1 } = qe(), f = j.useCallback(
2779
2773
  (g) => {
2780
2774
  for (const p of g)
2781
2775
  Qa(p);
@@ -2788,7 +2782,7 @@ const ar = { last_message_at: -1 }, rr = F.memo(
2788
2782
  selectedChannelId: t == null ? void 0 : t.id,
2789
2783
  filters: s
2790
2784
  });
2791
- const c = F.useMemo(
2785
+ const c = j.useMemo(
2792
2786
  () => ({
2793
2787
  selectedChannel: t,
2794
2788
  onChannelSelect: e,
@@ -2896,7 +2890,7 @@ const lr = {
2896
2890
  const v = y(
2897
2891
  "truncate text-base font-medium leading-6",
2898
2892
  d && !t ? ur : dr[e]
2899
- ), N = y(
2893
+ ), _ = y(
2900
2894
  "truncate text-xs leading-4",
2901
2895
  mr[e]
2902
2896
  );
@@ -2908,9 +2902,9 @@ const lr = {
2908
2902
  i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
2909
2903
  /* @__PURE__ */ n("p", { className: y("min-w-0", v), children: m })
2910
2904
  ] }),
2911
- u && /* @__PURE__ */ n("p", { className: N, children: a })
2905
+ u && /* @__PURE__ */ n("p", { className: _, children: a })
2912
2906
  ] }),
2913
- !g && c && /* @__PURE__ */ n("p", { className: N, children: f })
2907
+ !g && c && /* @__PURE__ */ n("p", { className: _, children: f })
2914
2908
  ] }),
2915
2909
  l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
2916
2910
  ] }),
@@ -2923,7 +2917,7 @@ const lr = {
2923
2917
  // treatment from the mobile spec. The drop shadow remains for depth.
2924
2918
  "border border-black/[0.08]",
2925
2919
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2926
- ), Ie = ({
2920
+ ), Se = ({
2927
2921
  variant: e,
2928
2922
  children: t,
2929
2923
  href: s,
@@ -2993,7 +2987,7 @@ const lr = {
2993
2987
  if (!t || !e) return !1;
2994
2988
  const s = ne(e);
2995
2989
  return s === "video" || s === "audio";
2996
- }, tt = "bg-[#F2F3F4]", Se = ({
2990
+ }, tt = "bg-[#F2F3F4]", Ie = ({
2997
2991
  variant: e,
2998
2992
  thumbnailUrl: t,
2999
2993
  sourceUrl: s,
@@ -3090,9 +3084,9 @@ const lr = {
3090
3084
  children: /* @__PURE__ */ n(Rs, { className: "size-5", weight: "regular" })
3091
3085
  }
3092
3086
  ) : void 0;
3093
- return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: tt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3087
+ return c ? /* @__PURE__ */ n(Se, { variant: "dark", bgClassName: tt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3094
3088
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
3095
- Se,
3089
+ Ie,
3096
3090
  {
3097
3091
  variant: "dark",
3098
3092
  sourceUrl: o,
@@ -3102,13 +3096,13 @@ const lr = {
3102
3096
  ) }),
3103
3097
  g && /* @__PURE__ */ n("div", { className: "shrink-0", children: g })
3104
3098
  ] }) }) : /* @__PURE__ */ h(
3105
- Ie,
3099
+ Se,
3106
3100
  {
3107
3101
  variant: "dark",
3108
3102
  topRight: f ? g : void 0,
3109
3103
  children: [
3110
3104
  !f && /* @__PURE__ */ n(
3111
- Se,
3105
+ Ie,
3112
3106
  {
3113
3107
  variant: "dark",
3114
3108
  thumbnailUrl: i,
@@ -3154,7 +3148,7 @@ const lr = {
3154
3148
  }
3155
3149
  } : d;
3156
3150
  return /* @__PURE__ */ h(
3157
- Ie,
3151
+ Se,
3158
3152
  {
3159
3153
  variant: "light",
3160
3154
  href: f,
@@ -3164,7 +3158,7 @@ const lr = {
3164
3158
  "data-testid": "link-attachment",
3165
3159
  children: [
3166
3160
  o === "featured" && /* @__PURE__ */ n(
3167
- Se,
3161
+ Ie,
3168
3162
  {
3169
3163
  variant: "light",
3170
3164
  thumbnailUrl: r,
@@ -3202,7 +3196,7 @@ const lr = {
3202
3196
  }) => {
3203
3197
  const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0, g = m == null && !u && c != null ? b : void 0;
3204
3198
  return /* @__PURE__ */ h(
3205
- Ie,
3199
+ Se,
3206
3200
  {
3207
3201
  variant: "dark",
3208
3202
  href: c,
@@ -3210,7 +3204,7 @@ const lr = {
3210
3204
  bgClassName: Me(r, o) ? tt : void 0,
3211
3205
  children: [
3212
3206
  l === "featured" && /* @__PURE__ */ n(
3213
- Se,
3207
+ Ie,
3214
3208
  {
3215
3209
  variant: "dark",
3216
3210
  thumbnailUrl: i,
@@ -3330,7 +3324,7 @@ const lr = {
3330
3324
  ),
3331
3325
  children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
3332
3326
  }
3333
- ), we = (e) => e === "received" ? "light" : "dark", Ii = ({
3327
+ ), we = (e) => e === "received" ? "light" : "dark", Si = ({
3334
3328
  firstOfGroup: e,
3335
3329
  endOfGroup: t,
3336
3330
  groupedByUser: s
@@ -3388,10 +3382,10 @@ const lr = {
3388
3382
  )) })
3389
3383
  }
3390
3384
  );
3391
- }, Er = (e) => /* @__PURE__ */ n(nt, { ...e, state: "composer" }), Ir = (e) => /* @__PURE__ */ n(nt, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "received" }), Tr = {
3385
+ }, Er = (e) => /* @__PURE__ */ n(nt, { ...e, state: "composer" }), Sr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "sent" }), Ir = (e) => /* @__PURE__ */ n(nt, { ...e, state: "received" }), Tr = {
3392
3386
  Composer: Er,
3393
- Sent: Ir,
3394
- Received: Sr
3387
+ Sent: Sr,
3388
+ Received: Ir
3395
3389
  };
3396
3390
  function Ar(e) {
3397
3391
  return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
@@ -3568,10 +3562,10 @@ const zr = ({
3568
3562
  items: o
3569
3563
  }), g = (v) => {
3570
3564
  if ((m == null ? void 0 : m(v)) === !1) return;
3571
- const N = c[v];
3572
- if (!N) return;
3573
- const _ = N.filename ?? Z(N.src);
3574
- gn(N.src, _);
3565
+ const _ = c[v];
3566
+ if (!_) return;
3567
+ const w = _.filename ?? Z(_.src);
3568
+ gn(_.src, w);
3575
3569
  };
3576
3570
  if (c.length === 0)
3577
3571
  return null;
@@ -3593,16 +3587,16 @@ const zr = ({
3593
3587
  text: l,
3594
3588
  groupPosition: d,
3595
3589
  "data-testid": "file-attachment",
3596
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, N) => /* @__PURE__ */ n(
3590
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, _) => /* @__PURE__ */ n(
3597
3591
  $r,
3598
3592
  {
3599
3593
  variant: u,
3600
3594
  item: v,
3601
- index: N,
3595
+ index: _,
3602
3596
  onActivate: g,
3603
- trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : p
3597
+ trailingAction: f && _ === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : p
3604
3598
  },
3605
- `${v.src}-${N}`
3599
+ `${v.src}-${_}`
3606
3600
  )) })
3607
3601
  }
3608
3602
  );
@@ -3645,7 +3639,7 @@ const zr = ({
3645
3639
  tone: i = "dark",
3646
3640
  onTriggered: o
3647
3641
  }) => {
3648
- const [l, d] = O(!1), m = W(
3642
+ const [l, d] = z(!1), m = W(
3649
3643
  (c) => {
3650
3644
  c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
3651
3645
  }).finally(() => {
@@ -3726,7 +3720,7 @@ const zr = ({
3726
3720
  initialIndex: t,
3727
3721
  open: s
3728
3722
  }) => {
3729
- const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = O(a);
3723
+ const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
3730
3724
  Y(() => {
3731
3725
  s && i($e(t, 0, Math.max(e - 1, 0)));
3732
3726
  }, [s, t, e]), Y(() => {
@@ -3755,7 +3749,7 @@ const zr = ({
3755
3749
  children: i,
3756
3750
  "data-testid": o
3757
3751
  }) => {
3758
- const l = H(null), d = H(null);
3752
+ const l = G(null), d = G(null);
3759
3753
  return Y(() => {
3760
3754
  var f;
3761
3755
  const u = l.current;
@@ -3963,7 +3957,7 @@ const zr = ({
3963
3957
  }
3964
3958
  );
3965
3959
  }, _e = (e) => {
3966
- const [t, s] = O(!1), [a, r] = O(0), i = W(
3960
+ const [t, s] = z(!1), [a, r] = z(0), i = W(
3967
3961
  (l) => {
3968
3962
  (e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
3969
3963
  },
@@ -4046,7 +4040,7 @@ const zr = ({
4046
4040
  if (m.length === 0)
4047
4041
  return null;
4048
4042
  const p = m.map(
4049
- (v, N) => Gr(v, N, m.length, l)
4043
+ (v, _) => Gr(v, _, m.length, l)
4050
4044
  );
4051
4045
  return /* @__PURE__ */ h(
4052
4046
  ve,
@@ -4069,11 +4063,11 @@ const zr = ({
4069
4063
  ]
4070
4064
  }
4071
4065
  );
4072
- }, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), Xr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), Jr = {
4066
+ }, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), Xr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), Kr = {
4073
4067
  Composer: qr,
4074
4068
  Sent: Wr,
4075
4069
  Received: Xr
4076
- }, Kr = ({
4070
+ }, Jr = ({
4077
4071
  open: e,
4078
4072
  items: t,
4079
4073
  initialIndex: s = 0,
@@ -4168,9 +4162,9 @@ const zr = ({
4168
4162
  ), v = e === "composer" && !!m;
4169
4163
  if (u.length === 0)
4170
4164
  return null;
4171
- const N = u.map((_) => ({
4172
- src: _.src,
4173
- filename: _.filename ?? Z(_.src)
4165
+ const _ = u.map((w) => ({
4166
+ src: w.src,
4167
+ filename: w.filename ?? Z(w.src)
4174
4168
  }));
4175
4169
  return /* @__PURE__ */ h(
4176
4170
  ve,
@@ -4180,14 +4174,14 @@ const zr = ({
4180
4174
  groupPosition: l,
4181
4175
  "data-testid": "pdf-attachment",
4182
4176
  children: [
4183
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_, E) => {
4184
- const I = _.filename ?? Z(_.src), T = v && E === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4177
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((w, I) => {
4178
+ const S = w.filename ?? Z(w.src), M = v && I === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4185
4179
  bn,
4186
4180
  {
4187
- url: _.src,
4188
- filename: I,
4181
+ url: w.src,
4182
+ filename: S,
4189
4183
  variant: "inline",
4190
- label: `Download ${I}`,
4184
+ label: `Download ${S}`,
4191
4185
  tone: b
4192
4186
  }
4193
4187
  );
@@ -4195,19 +4189,19 @@ const zr = ({
4195
4189
  ei,
4196
4190
  {
4197
4191
  variant: b,
4198
- item: _,
4199
- index: E,
4192
+ item: w,
4193
+ index: I,
4200
4194
  onActivate: g,
4201
- trailingAction: T
4195
+ trailingAction: M
4202
4196
  },
4203
- `${_.src}-${E}`
4197
+ `${w.src}-${I}`
4204
4198
  );
4205
4199
  }) }),
4206
4200
  /* @__PURE__ */ n(
4207
- Kr,
4201
+ Jr,
4208
4202
  {
4209
4203
  open: f,
4210
- items: N,
4204
+ items: _,
4211
4205
  initialIndex: c,
4212
4206
  onClose: p
4213
4207
  }
@@ -4354,7 +4348,7 @@ const zr = ({
4354
4348
  if (b.length === 0)
4355
4349
  return null;
4356
4350
  const v = b.map(
4357
- (N, _) => ii(N, _, b.length)
4351
+ (_, w) => ii(_, w, b.length)
4358
4352
  );
4359
4353
  return /* @__PURE__ */ h(
4360
4354
  ve,
@@ -4388,8 +4382,8 @@ const zr = ({
4388
4382
  Composer: ci,
4389
4383
  Sent: di,
4390
4384
  Received: ui
4391
- }, Si = {
4392
- Image: Jr,
4385
+ }, Ii = {
4386
+ Image: Kr,
4393
4387
  Video: mi,
4394
4388
  Audio: Tr,
4395
4389
  Pdf: ai,
@@ -4474,7 +4468,7 @@ export {
4474
4468
  hi as f,
4475
4469
  ne as g,
4476
4470
  Ot as h,
4477
- Si as i,
4471
+ Ii as i,
4478
4472
  Ca as j,
4479
4473
  Ni as k,
4480
4474
  ki as l,
@@ -4486,11 +4480,11 @@ export {
4486
4480
  le as r,
4487
4481
  nn as s,
4488
4482
  $s as t,
4489
- Ii as u,
4483
+ Si as u,
4490
4484
  Ys as v,
4491
- Ke as w,
4485
+ Je as w,
4492
4486
  Ze as x,
4493
4487
  Wt as y,
4494
4488
  va as z
4495
4489
  };
4496
- //# sourceMappingURL=index-CAAtAfn1.js.map
4490
+ //# sourceMappingURL=index-cIErdakH.js.map