@linktr.ee/messaging-react 1.22.3 → 1.23.0

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