@linktr.ee/messaging-react 1.22.0-rc-1771907607 → 1.22.0-rc-1771993226

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