@linktr.ee/messaging-react 1.22.0-rc-1771906339 โ†’ 1.22.0-rc-1771993226

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