@linktr.ee/messaging-react 1.38.0 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as d, Fragment as fe } from "react/jsx-runtime";
2
- import A from "classnames";
3
- import z, { createContext as mt, useContext as ht, useCallback as U, useState as M, useRef as Q, useEffect as K, useMemo as ze, Suspense as ft } from "react";
4
- import { StreamChatService as Ot } from "@linktr.ee/messaging-core";
5
- import { Chat as Ut, ChannelList as $t, DateSeparator as zt, useChannelStateContext as ue, useChatContext as He, areMessageUIPropsEqual as jt, useMessageReminder as Bt, useComponentContext as gt, Attachment as Gt, EditMessageModal as Vt, MessageBlocked as Ht, MessageBouncePrompt as Yt, MessageDeleted as Wt, MessageIsThreadReplyInChannelButtonIndicator as qt, MessageRepliesCountButton as Xt, ReminderNotification as Zt, StreamedMessageText as Kt, messageHasAttachments as Jt, messageHasReactions as Qt, isDateSeparatorMessage as es, isMessageBlocked as ts, isMessageBounced as ss, MessageBounceModal as ns, MessageText as Qe, Poll as as, MessageErrorIcon as rs, useMessageContext as bt, useMessageComposer as is, useStateStore as os, MessageInput as ls, useMessageInputContext as cs, useMessageComposerHasSendableData as ds, SimpleAttachmentSelector as us, QuotedMessagePreview as ms, AttachmentPreviewList as hs, TextareaComposer as fs, MessageTimestamp as Fe, useTypingContext as gs, Channel as bs, WithComponents as xs, Window as ps, MessageList as vs } from "stream-chat-react";
6
- import { StarIcon as je, GiftIcon as ws, XIcon as Ye, SpinnerGapIcon as Se, SignOutIcon as ys, ProhibitInsetIcon as et, FlagIcon as Ns, ArrowUpIcon as Cs, SparkleIcon as Be, ProhibitIcon as _s, ArrowLeftIcon as tt, CaretRightIcon as st, DotsThreeIcon as nt, MagnifyingGlassIcon as Es, ChatCircleDotsIcon as at, FileIcon as xt, ImageIcon as ks, SpeakerHighIcon as Ss, VideoCameraIcon as Is, FileMdIcon as Ms, FileTextIcon as Ts, FileZipIcon as Ds, FilePptIcon as Rs, FileCsvIcon as Ls, FileXlsIcon as Ps, FileDocIcon as As, FilePdfIcon as Fs, CircleNotchIcon as pt, PlayIcon as rt, PauseIcon as Os, LinkIcon as Us, DownloadSimpleIcon as $s } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as it } from "stream-chat";
8
- const vt = mt({
1
+ import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
2
+ import D from "classnames";
3
+ import O, { createContext as ot, useContext as lt, useCallback as G, useState as A, useRef as J, useEffect as Z, useMemo as Ce, Suspense as ct } from "react";
4
+ import { StreamChatService as Tt } from "@linktr.ee/messaging-core";
5
+ import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as zt, MessageDeleted as Bt, MessageIsThreadReplyInChannelButtonIndicator as $t, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as qt, isMessageBlocked as Wt, isMessageBounced as Xt, MessageBounceModal as Zt, MessageText as Xe, Poll as Jt, MessageErrorIcon as Kt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as is, TextareaComposer as os, MessageTimestamp as ve, useTypingContext as ls, Channel as cs, WithComponents as ds, Window as us, MessageList as ms } from "stream-chat-react";
6
+ import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs, ThumbsUpIcon as bs, ThumbsDownIcon as ps, ArrowUpIcon as xs, SparkleIcon as Se, ProhibitIcon as vs, ArrowLeftIcon as Je, CaretRightIcon as Ke, DotsThreeIcon as Qe, FileIcon as ht, ImageIcon as ws, SpeakerHighIcon as _s, VideoCameraIcon as ys, FileMdIcon as Ns, FileTextIcon as Cs, FileZipIcon as Es, FilePptIcon as Ss, FileCsvIcon as Is, FileXlsIcon as ks, FileDocIcon as Ms, FilePdfIcon as Ts, CircleNotchIcon as ft, PlayIcon as et, PauseIcon as Ds, LinkIcon as Rs, DownloadSimpleIcon as Ls } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as tt } from "stream-chat";
8
+ const gt = ot({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const vt = mt({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), De = () => ht(vt), ha = ({
18
+ }), Te = () => lt(gt), ra = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -23,9 +23,9 @@ const vt = mt({
23
23
  capabilities: o = {},
24
24
  debug: l = !1
25
25
  }) => {
26
- const i = U(
27
- (b, ...k) => {
28
- l && console.log(`🔥 [MessagingProvider] ${b}`, ...k);
26
+ const i = G(
27
+ (k, ...T) => {
28
+ l && console.log(`🔥 [MessagingProvider] ${k}`, ...T);
29
29
  },
30
30
  [l]
31
31
  );
@@ -35,84 +35,84 @@ const vt = mt({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [c, h] = M(null), [u, m] = M(null), [f, v] = M(!1), [a, C] = M(!1), [g, y] = M(null), p = Q(!1), S = Q({
38
+ const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, N] = A(!1), [b, C] = A(null), x = J(!1), I = J({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: o
43
- }), w = Q(0);
43
+ }), w = J(0);
44
44
  w.current++, i("📊 RENDER INFO", {
45
45
  renderCount: w.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: S.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: S.current.apiKey !== r,
50
- serviceConfigChanged: S.current.serviceConfig !== n,
51
- capabilitiesChanged: S.current.capabilities !== o
48
+ userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: I.current.apiKey !== r,
50
+ serviceConfigChanged: I.current.serviceConfig !== n,
51
+ capabilitiesChanged: I.current.capabilities !== o
52
52
  }
53
- }), S.current = {
53
+ }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: o
58
- }, K(() => {
59
- const b = w.current;
58
+ }, Z(() => {
59
+ const k = w.current;
60
60
  if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: b,
61
+ renderCount: k,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: S.current.serviceConfig === n,
68
- apiKeyStable: S.current.apiKey === r
67
+ serviceConfigStable: I.current.serviceConfig === n,
68
+ apiKeyStable: I.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
71
  i("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: b,
72
+ renderCount: k,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  i("🚀 CREATING NEW SERVICE", {
78
- renderCount: b,
78
+ renderCount: k,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
- serviceConfigChanged: S.current.serviceConfig !== n
80
+ serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const k = new Ot({
82
+ const T = new Tt({
83
83
  ...n,
84
84
  apiKey: r,
85
85
  debug: l
86
86
  });
87
- return h(k), i("✅ SERVICE SET", {
88
- renderCount: b,
89
- serviceInstance: !!k
87
+ return m(T), i("✅ SERVICE SET", {
88
+ renderCount: k,
89
+ serviceInstance: !!T
90
90
  }), () => {
91
91
  i("🧹 SERVICE CLEANUP", {
92
- renderCount: b,
92
+ renderCount: k,
93
93
  reason: "Effect cleanup"
94
- }), k.disconnectUser().catch(console.error);
94
+ }), T.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [r, n, l, i]);
97
- const E = Q(null);
98
- K(() => {
99
- var k, R;
97
+ const E = J(null);
98
+ Z(() => {
99
+ var T, M;
100
100
  if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: p.current,
104
+ isConnecting: x.current,
105
105
  isConnected: f,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
108
  i("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (p.current) {
111
+ if (x.current) {
112
112
  i("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((k = E.current) == null ? void 0 : k.serviceId) === c && ((R = E.current) == null ? void 0 : R.userId) === s.id) {
115
+ if (((T = E.current) == null ? void 0 : T.serviceId) === c && ((M = E.current) == null ? void 0 : M.userId) === s.id) {
116
116
  i(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,28 +120,28 @@ const vt = mt({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- i("🚀 STARTING USER CONNECTION", { userId: s.id }), p.current = !0, C(!0), y(null);
123
+ i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0, N(!0), C(null);
124
124
  try {
125
125
  i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const I = await c.connectUser(s);
127
- m(I), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
126
+ const y = await c.connectUser(s);
127
+ h(y), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: I.userID
129
+ clientId: y.userID
130
130
  });
131
- } catch (I) {
132
- const L = I instanceof Error ? I.message : "Connection failed";
133
- y(L), i("❌ USER CONNECTION ERROR", {
131
+ } catch (y) {
132
+ const _ = y instanceof Error ? y.message : "Connection failed";
133
+ C(_), i("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: L
135
+ error: _
136
136
  });
137
137
  } finally {
138
- C(!1), p.current = !1, i("🔄 USER CONNECTION FINISHED", {
138
+ N(!1), x.current = !1, i("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, i, f]), K(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, i, f]), Z(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
146
  isConnected: f
147
147
  }), () => {
@@ -153,7 +153,7 @@ const vt = mt({
153
153
  isConnected: f
154
154
  });
155
155
  }), [c, f, i]);
156
- const F = U(async () => {
156
+ const P = G(async () => {
157
157
  if (i("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
@@ -161,53 +161,53 @@ const vt = mt({
161
161
  i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), C(!0);
164
+ i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), N(!0);
165
165
  try {
166
166
  i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
167
- const b = await c.connectUser(s);
168
- m(b), v(!0), y(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (b) {
170
- const k = b instanceof Error ? b.message : "Refresh failed";
171
- y(k), i("❌ CONNECTION REFRESH ERROR", {
167
+ const k = await c.connectUser(s);
168
+ h(k), v(!0), C(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (k) {
170
+ const T = k instanceof Error ? k.message : "Refresh failed";
171
+ C(T), i("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: k
173
+ error: T
174
174
  });
175
175
  } finally {
176
- C(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ N(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, i]), N = z.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, i]), U = O.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
180
  hasClient: !!u,
181
181
  isConnected: f,
182
182
  isLoading: a,
183
- hasError: !!g,
183
+ hasError: !!b,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
186
  service: c,
187
187
  client: u,
188
188
  isConnected: f,
189
189
  isLoading: a,
190
- error: g,
190
+ error: b,
191
191
  capabilities: o,
192
- refreshConnection: F,
192
+ refreshConnection: P,
193
193
  debug: l
194
194
  }), [
195
195
  c,
196
196
  u,
197
197
  f,
198
198
  a,
199
- g,
199
+ b,
200
200
  o,
201
- F,
201
+ P,
202
202
  l,
203
203
  i
204
204
  ]);
205
205
  return i("🔄 RENDER END", {
206
206
  renderCount: w.current,
207
207
  willRenderChat: !!(u && f),
208
- contextValueReady: !!N
209
- }), /* @__PURE__ */ e(vt.Provider, { value: N, children: u && f ? /* @__PURE__ */ e(
210
- Ut,
208
+ contextValueReady: !!U
209
+ }), /* @__PURE__ */ e(gt.Provider, { value: U, children: u && f ? /* @__PURE__ */ e(
210
+ Dt,
211
211
  {
212
212
  client: u,
213
213
  customClasses: {
@@ -216,25 +216,25 @@ const vt = mt({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, zs = () => De();
220
- function js(t) {
219
+ }, As = () => Te();
220
+ function Fs(t) {
221
221
  const s = t.state.pending_messages;
222
222
  if (s != null && s.length)
223
223
  for (const n of s)
224
224
  t.state.addMessageSorted(n.message);
225
225
  }
226
- const wt = z.createContext({
226
+ const bt = O.createContext({
227
227
  selectedChannel: void 0,
228
228
  onChannelSelect: () => {
229
229
  },
230
230
  debug: !1,
231
231
  renderMessagePreview: void 0
232
- }), Bs = wt.Provider, Gs = () => z.useContext(wt), yt = (t) => {
232
+ }), Os = bt.Provider, Ps = () => O.useContext(bt), pt = (t) => {
233
233
  var r, o;
234
- const [s, n] = M(
234
+ const [s, n] = A(
235
235
  !!((o = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && o.pinned_at)
236
236
  );
237
- return K(() => {
237
+ return Z(() => {
238
238
  var i;
239
239
  if (!t) {
240
240
  n(!1);
@@ -242,27 +242,27 @@ const wt = z.createContext({
242
242
  }
243
243
  n(!!((i = t.state.membership) != null && i.pinned_at));
244
244
  const l = (c) => {
245
- var h;
245
+ var m;
246
246
  n(
247
- c != null && c.member ? !!c.member.pinned_at : !!((h = t.state.membership) != null && h.pinned_at)
247
+ c != null && c.member ? !!c.member.pinned_at : !!((m = t.state.membership) != null && m.pinned_at)
248
248
  );
249
249
  };
250
250
  return t.on("member.updated", l), () => {
251
251
  t.off("member.updated", l);
252
252
  };
253
253
  }, [t]), s;
254
- }, Vs = (t, s) => {
254
+ }, Us = (t, s) => {
255
255
  const n = new Date(
256
256
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
257
257
  ), o = new Date(
258
258
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
259
259
  ).getTime() - n.getTime();
260
260
  return Math.floor(o / (1e3 * 60 * 60 * 24));
261
- }, Hs = (t) => {
261
+ }, zs = (t) => {
262
262
  const s = /* @__PURE__ */ new Date();
263
263
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
264
264
  return "Just now";
265
- const r = Vs(t, s);
265
+ const r = Us(t, s);
266
266
  return r === 0 ? t.toLocaleTimeString([], {
267
267
  hour: "numeric",
268
268
  minute: "2-digit",
@@ -272,7 +272,7 @@ const wt = z.createContext({
272
272
  day: "numeric",
273
273
  year: "2-digit"
274
274
  });
275
- }, ot = [
275
+ }, st = [
276
276
  "🍎",
277
277
  // Apple
278
278
  "🍌",
@@ -300,7 +300,7 @@ const wt = z.createContext({
300
300
  "🍈"
301
301
  // Melon
302
302
  ];
303
- function Ys(t) {
303
+ function Bs(t) {
304
304
  let s = 0;
305
305
  for (let n = 0; n < t.length; n++) {
306
306
  const r = t.charCodeAt(n);
@@ -308,9 +308,9 @@ function Ys(t) {
308
308
  }
309
309
  return Math.abs(s);
310
310
  }
311
- function Ws(t) {
312
- const n = Ys(t) % ot.length;
313
- return ot[n];
311
+ function $s(t) {
312
+ const n = Bs(t) % st.length;
313
+ return st[n];
314
314
  }
315
315
  const ne = ({
316
316
  id: t,
@@ -321,7 +321,7 @@ const ne = ({
321
321
  shape: l = "squircle",
322
322
  dmAgentEnabled: i = !1
323
323
  }) => {
324
- const c = Ws(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", m = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
324
+ const c = $s(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
325
325
  borderRadius: "33%",
326
326
  cornerShape: "superellipse(1.3)"
327
327
  }, v = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
@@ -335,7 +335,7 @@ const ne = ({
335
335
  "div",
336
336
  {
337
337
  "aria-hidden": "true",
338
- className: A(
338
+ className: D(
339
339
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
340
340
  u
341
341
  ),
@@ -345,7 +345,7 @@ const ne = ({
345
345
  return /* @__PURE__ */ d(
346
346
  "div",
347
347
  {
348
- className: A(
348
+ className: D(
349
349
  "relative flex-shrink-0 !bg-transparent",
350
350
  r
351
351
  ),
@@ -359,21 +359,21 @@ const ne = ({
359
359
  {
360
360
  "aria-hidden": "true",
361
361
  className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
362
- children: /* @__PURE__ */ e(je, { className: "size-3 text-yellow-600", weight: "duotone" })
362
+ children: /* @__PURE__ */ e(Ee, { className: "size-3 text-yellow-600", weight: "duotone" })
363
363
  }
364
364
  ),
365
365
  /* @__PURE__ */ e(
366
366
  "div",
367
367
  {
368
368
  "data-testid": "avatar-ring",
369
- className: A(
369
+ className: D(
370
370
  "h-full w-full",
371
371
  "bg-transparent"
372
372
  ),
373
373
  style: {
374
374
  ...f,
375
375
  ...i && {
376
- borderWidth: `${m}px`,
376
+ borderWidth: `${h}px`,
377
377
  borderStyle: "solid",
378
378
  borderColor: "var(--AI-Gradient, #7F22FE)",
379
379
  boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
@@ -385,7 +385,7 @@ const ne = ({
385
385
  ]
386
386
  }
387
387
  );
388
- }, qs = ({ size: t = 15 }) => /* @__PURE__ */ e(
388
+ }, js = ({ size: t = 15 }) => /* @__PURE__ */ e(
389
389
  "svg",
390
390
  {
391
391
  width: t,
@@ -402,93 +402,93 @@ const ne = ({
402
402
  }
403
403
  )
404
404
  }
405
- ), Xs = (t) => {
405
+ ), Gs = (t) => {
406
406
  var s;
407
407
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
408
- }, Zs = (t) => {
408
+ }, Vs = (t) => {
409
409
  var s;
410
410
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
411
- }, We = (t) => {
411
+ }, De = (t) => {
412
412
  var s;
413
413
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
414
- }, Ks = (t) => {
414
+ }, Hs = (t) => {
415
415
  var s;
416
416
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
417
- }, Nt = (t) => Xs(t) || Zs(t), Js = (t) => {
417
+ }, xt = (t) => Gs(t) || Vs(t), Ys = (t) => {
418
418
  var s;
419
- return Nt(t) && !((s = t.text) != null && s.trim());
420
- }, Oe = ({
419
+ return xt(t) && !((s = t.text) != null && s.trim());
420
+ }, _e = ({
421
421
  message: t,
422
422
  standalone: s = !1,
423
423
  isMyMessage: n = !1,
424
424
  hasAttachment: r = !1
425
425
  }) => {
426
426
  var f;
427
- const o = Nt(t), l = We(t);
427
+ const o = xt(t), l = De(t);
428
428
  if (!o && !l)
429
429
  return null;
430
430
  if (o) {
431
431
  const v = (f = t.metadata) == null ? void 0 : f.amount_text;
432
432
  if (!v) return null;
433
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", C = s ? `${v} tip` : `Delivered with ${v} tip`;
433
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", N = s ? `${v} tip` : `Delivered with ${v} tip`;
434
434
  return /* @__PURE__ */ d("div", { className: a, children: [
435
- /* @__PURE__ */ e(ws, { size: s ? 14 : 12 }),
436
- /* @__PURE__ */ e("span", { children: C })
435
+ /* @__PURE__ */ e(hs, { size: s ? 14 : 12 }),
436
+ /* @__PURE__ */ e("span", { children: N })
437
437
  ] });
438
438
  }
439
- const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", h = [
439
+ const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", m = [
440
440
  "message-chatbot-indicator",
441
441
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
442
442
  i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
443
- ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), m = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(qs, { size: i ? 12 : 15 }) });
444
- return /* @__PURE__ */ e("div", { className: h, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(fe, { children: [
443
+ ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(js, { size: i ? 12 : 15 }) });
444
+ return /* @__PURE__ */ e("div", { className: m, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(ce, { children: [
445
445
  u,
446
- m
447
- ] }) : /* @__PURE__ */ d(fe, { children: [
448
- m,
446
+ h
447
+ ] }) : /* @__PURE__ */ d(ce, { children: [
448
+ h,
449
449
  u
450
450
  ] }) });
451
- }, Ct = z.memo(
451
+ }, vt = O.memo(
452
452
  ({ channel: t, unread: s }) => {
453
- var F, N, b, k;
454
- const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Gs(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
453
+ var P, U, k, T;
454
+ const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Ps(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
455
455
  t && r(t);
456
- }, h = (R) => {
457
- const I = R.key === "Enter" || R.key === " ", L = R.repeat;
458
- !I || L || (R.preventDefault(), c());
459
- }, m = Object.values(((F = t == null ? void 0 : t.state) == null ? void 0 : F.members) || {}).find(
460
- (R) => {
461
- var I, L;
462
- return ((I = R.user) == null ? void 0 : I.id) && R.user.id !== ((L = t == null ? void 0 : t._client) == null ? void 0 : L.userID);
456
+ }, m = (M) => {
457
+ const y = M.key === "Enter" || M.key === " ", _ = M.repeat;
458
+ !y || _ || (M.preventDefault(), c());
459
+ }, h = Object.values(((P = t == null ? void 0 : t.state) == null ? void 0 : P.members) || {}).find(
460
+ (M) => {
461
+ var y, _;
462
+ return ((y = M.user) == null ? void 0 : y.id) && M.user.id !== ((_ = t == null ? void 0 : t._client) == null ? void 0 : _.userID);
463
463
  }
464
- ), f = ((N = m == null ? void 0 : m.user) == null ? void 0 : N.name) || "Conversation", v = (b = m == null ? void 0 : m.user) == null ? void 0 : b.image, a = (() => {
465
- var I;
466
- const R = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
467
- if (R != null && R.length) {
468
- for (let L = R.length - 1; L >= 0; L--)
469
- if (R[L].type !== "system") return R[L];
464
+ ), f = ((U = h == null ? void 0 : h.user) == null ? void 0 : U.name) || "Conversation", v = (k = h == null ? void 0 : h.user) == null ? void 0 : k.image, a = (() => {
465
+ var y;
466
+ const M = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
467
+ if (M != null && M.length) {
468
+ for (let _ = M.length - 1; _ >= 0; _--)
469
+ if (M[_].type !== "system") return M[_];
470
470
  }
471
- })(), g = (() => {
472
- var L, T;
471
+ })(), b = (() => {
472
+ var _, F;
473
473
  if (a != null && a.text) return a.text;
474
- if (((L = a == null ? void 0 : a.metadata) == null ? void 0 : L.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
475
- const I = (T = a == null ? void 0 : a.attachments) == null ? void 0 : T[0];
476
- return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
477
- })(), y = a != null && a.created_at ? Hs(new Date(a.created_at)) : "", p = a ? We(a) : !1, S = l ? l(a, g) : `${p ? "✨ " : ""}${g}`, w = yt(t), E = s ?? 0;
474
+ if (((_ = a == null ? void 0 : a.metadata) == null ? void 0 : _.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
475
+ const y = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
476
+ return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
477
+ })(), C = a != null && a.created_at ? zs(new Date(a.created_at)) : "", x = a ? De(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = pt(t), E = s ?? 0;
478
478
  return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
479
479
  channelId: t == null ? void 0 : t.id,
480
480
  isSelected: i,
481
481
  participantName: f,
482
482
  unreadCount: E,
483
- hasTimestamp: !!y
483
+ hasTimestamp: !!C
484
484
  }), /* @__PURE__ */ e(
485
485
  "div",
486
486
  {
487
487
  role: "button",
488
488
  tabIndex: 0,
489
489
  onClick: c,
490
- onKeyDown: h,
491
- className: A(
490
+ onKeyDown: m,
491
+ className: D(
492
492
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
493
493
  {
494
494
  "bg-primary-alt/10 border-l-4 border-l-primary": i,
@@ -499,7 +499,7 @@ const ne = ({
499
499
  /* @__PURE__ */ e(
500
500
  ne,
501
501
  {
502
- id: ((k = m == null ? void 0 : m.user) == null ? void 0 : k.id) || t.id || "unknown",
502
+ id: ((T = h == null ? void 0 : h.user) == null ? void 0 : T.id) || t.id || "unknown",
503
503
  name: f,
504
504
  image: v,
505
505
  size: 44,
@@ -512,7 +512,7 @@ const ne = ({
512
512
  /* @__PURE__ */ d(
513
513
  "h3",
514
514
  {
515
- className: A(
515
+ className: D(
516
516
  "text-sm font-medium truncate",
517
517
  i ? "text-primary" : "text-charcoal"
518
518
  ),
@@ -522,10 +522,10 @@ const ne = ({
522
522
  ]
523
523
  }
524
524
  ),
525
- y && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: y })
525
+ C && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: C })
526
526
  ] }),
527
527
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
528
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
528
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
529
529
  E > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: E > 99 ? "99+" : E })
530
530
  ] })
531
531
  ] })
@@ -534,8 +534,8 @@ const ne = ({
534
534
  );
535
535
  }
536
536
  );
537
- Ct.displayName = "CustomChannelPreview";
538
- const Qs = { last_message_at: -1 }, _t = z.memo(
537
+ vt.displayName = "CustomChannelPreview";
538
+ const qs = { last_message_at: -1 }, wt = O.memo(
539
539
  ({
540
540
  onChannelSelect: t,
541
541
  selectedChannel: s,
@@ -544,18 +544,18 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
544
544
  onMessageNew: o,
545
545
  onAddedToChannel: l,
546
546
  channelRenderFilterFn: i,
547
- sort: c = Qs,
548
- className: h,
547
+ sort: c = qs,
548
+ className: m,
549
549
  customEmptyStateIndicator: u,
550
- renderMessagePreview: m
550
+ renderMessagePreview: h
551
551
  }) => {
552
- const f = z.useRef(0);
552
+ const f = O.useRef(0);
553
553
  f.current++;
554
- const { debug: v = !1 } = De(), a = z.useCallback(
555
- (g) => {
556
- for (const y of g)
557
- js(y);
558
- return i ? i(g) : g;
554
+ const { debug: v = !1 } = Te(), a = O.useCallback(
555
+ (b) => {
556
+ for (const C of b)
557
+ Fs(C);
558
+ return i ? i(b) : b;
559
559
  },
560
560
  [i]
561
561
  );
@@ -564,24 +564,24 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
564
564
  selectedChannelId: s == null ? void 0 : s.id,
565
565
  filters: n
566
566
  });
567
- const C = z.useMemo(
567
+ const N = O.useMemo(
568
568
  () => ({
569
569
  selectedChannel: s,
570
570
  onChannelSelect: t,
571
571
  debug: v,
572
- renderMessagePreview: m
572
+ renderMessagePreview: h
573
573
  }),
574
- [s, t, v, m]
574
+ [s, t, v, h]
575
575
  );
576
576
  return /* @__PURE__ */ e(
577
577
  "div",
578
578
  {
579
- className: A(
579
+ className: D(
580
580
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
581
- h
581
+ m
582
582
  ),
583
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Bs, { value: C, children: /* @__PURE__ */ e(
584
- $t,
583
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Os, { value: N, children: /* @__PURE__ */ e(
584
+ Rt,
585
585
  {
586
586
  filters: n,
587
587
  sort: c,
@@ -590,7 +590,7 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
590
590
  onMessageNew: o,
591
591
  onAddedToChannel: l,
592
592
  channelRenderFilterFn: a,
593
- Preview: Ct,
593
+ Preview: vt,
594
594
  EmptyStateIndicator: u
595
595
  },
596
596
  `${JSON.stringify(n)}:${JSON.stringify(c)}`
@@ -599,8 +599,8 @@ const Qs = { last_message_at: -1 }, _t = z.memo(
599
599
  );
600
600
  }
601
601
  );
602
- _t.displayName = "ChannelList";
603
- const ke = ({
602
+ wt.displayName = "ChannelList";
603
+ const me = ({
604
604
  variant: t = "default",
605
605
  className: s,
606
606
  children: n,
@@ -609,7 +609,7 @@ const ke = ({
609
609
  "button",
610
610
  {
611
611
  type: "button",
612
- className: A(
612
+ className: D(
613
613
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
614
614
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
615
615
  s
@@ -618,12 +618,12 @@ const ke = ({
618
618
  children: n
619
619
  }
620
620
  );
621
- function Et({ label: t, className: s, children: n, ...r }) {
621
+ function Ws({ label: t, className: s, children: n, ...r }) {
622
622
  return /* @__PURE__ */ d(
623
623
  "button",
624
624
  {
625
625
  type: "button",
626
- className: A(
626
+ className: D(
627
627
  "inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
628
628
  {
629
629
  "cursor-not-allowed opacity-50": r.disabled,
@@ -639,10 +639,10 @@ function Et({ label: t, className: s, children: n, ...r }) {
639
639
  }
640
640
  );
641
641
  }
642
- function kt({ onClick: t }) {
643
- return /* @__PURE__ */ e(Et, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Ye, { className: "h-5 w-5 text-stone", weight: "bold" }) });
642
+ function Xs({ onClick: t }) {
643
+ return /* @__PURE__ */ e(Ws, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
644
644
  }
645
- const en = ({
645
+ const Zs = ({
646
646
  dialogRef: t,
647
647
  onClose: s,
648
648
  participant: n,
@@ -651,80 +651,80 @@ const en = ({
651
651
  onLeaveConversation: l,
652
652
  onBlockParticipant: i,
653
653
  showDeleteConversation: c = !0,
654
- onDeleteConversationClick: h,
654
+ onDeleteConversationClick: m,
655
655
  onBlockParticipantClick: u,
656
- onReportParticipantClick: m,
656
+ onReportParticipantClick: h,
657
657
  customProfileContent: f,
658
658
  customChannelActions: v
659
659
  }) => {
660
- var $, P, W, Z, ae, J, x;
661
- const { service: a, debug: C } = De(), [g, y] = M(!1), [p, S] = M(!1), [w, E] = M(!1), F = U(async () => {
662
- var _;
663
- if (!(!a || !((_ = n == null ? void 0 : n.user) != null && _.id)))
660
+ var S, $, V, ee, te, q, g;
661
+ const { service: a, debug: N } = Te(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
662
+ var p;
663
+ if (!(!a || !((p = n == null ? void 0 : n.user) != null && p.id)))
664
664
  try {
665
- const H = (await a.getBlockedUsers()).some(
666
- (ee) => {
667
- var ie;
668
- return ee.blocked_user_id === ((ie = n == null ? void 0 : n.user) == null ? void 0 : ie.id);
665
+ const j = (await a.getBlockedUsers()).some(
666
+ (Y) => {
667
+ var ae;
668
+ return Y.blocked_user_id === ((ae = n == null ? void 0 : n.user) == null ? void 0 : ae.id);
669
669
  }
670
670
  );
671
- y(H);
672
- } catch (j) {
671
+ C(j);
672
+ } catch (L) {
673
673
  console.error(
674
674
  "[ChannelInfoDialog] Failed to check blocked status:",
675
- j
675
+ L
676
676
  );
677
677
  }
678
- }, [a, ($ = n == null ? void 0 : n.user) == null ? void 0 : $.id]);
679
- K(() => {
680
- F();
681
- }, [F]);
682
- const N = async () => {
683
- var _;
684
- if (!p) {
685
- h == null || h(), C && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
678
+ }, [a, (S = n == null ? void 0 : n.user) == null ? void 0 : S.id]);
679
+ Z(() => {
680
+ P();
681
+ }, [P]);
682
+ const U = async () => {
683
+ var p;
684
+ if (!x) {
685
+ m == null || m(), N && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
686
686
  try {
687
- const j = ((_ = r._client) == null ? void 0 : _.userID) ?? null;
688
- await r.hide(j, !1), l && await l(r), s();
689
- } catch (j) {
690
- console.error("[ChannelInfoDialog] Failed to leave conversation", j);
687
+ const L = ((p = r._client) == null ? void 0 : p.userID) ?? null;
688
+ await r.hide(L, !1), l && await l(r), s();
689
+ } catch (L) {
690
+ console.error("[ChannelInfoDialog] Failed to leave conversation", L);
691
691
  } finally {
692
- S(!1);
692
+ I(!1);
693
693
  }
694
694
  }
695
- }, b = async () => {
696
- var _, j, H;
695
+ }, k = async () => {
696
+ var p, L, j;
697
697
  if (!(w || !a)) {
698
- u == null || u(), C && console.log("[ChannelInfoDialog] Block member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), E(!0);
698
+ u == null || u(), N && console.log("[ChannelInfoDialog] Block member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
699
699
  try {
700
- await a.blockUser((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), i && await i((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
701
- } catch (ee) {
702
- console.error("[ChannelInfoDialog] Failed to block member", ee);
700
+ await a.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
701
+ } catch (Y) {
702
+ console.error("[ChannelInfoDialog] Failed to block member", Y);
703
703
  } finally {
704
704
  E(!1);
705
705
  }
706
706
  }
707
- }, k = async () => {
708
- var _, j, H;
707
+ }, T = async () => {
708
+ var p, L, j;
709
709
  if (!(w || !a)) {
710
- u == null || u(), C && console.log("[ChannelInfoDialog] Unblock member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), E(!0);
710
+ u == null || u(), N && console.log("[ChannelInfoDialog] Unblock member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
711
711
  try {
712
- await a.unBlockUser((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), i && await i((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
713
- } catch (ee) {
714
- console.error("[ChannelInfoDialog] Failed to unblock member", ee);
712
+ await a.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
713
+ } catch (Y) {
714
+ console.error("[ChannelInfoDialog] Failed to unblock member", Y);
715
715
  } finally {
716
716
  E(!1);
717
717
  }
718
718
  }
719
- }, R = () => {
720
- m == null || m(), s(), window.open(
719
+ }, M = () => {
720
+ h == null || h(), s(), window.open(
721
721
  "https://linktr.ee/s/about/trust-center/report",
722
722
  "_blank",
723
723
  "noopener,noreferrer"
724
724
  );
725
725
  };
726
726
  if (!n) return null;
727
- const I = ((P = n.user) == null ? void 0 : P.name) || ((W = n.user) == null ? void 0 : W.id) || "Unknown member", L = (Z = n.user) == null ? void 0 : Z.image, T = (ae = n.user) == null ? void 0 : ae.email, B = (J = n.user) == null ? void 0 : J.username, O = T || (B ? `linktr.ee/${B}` : void 0), G = ((x = n.user) == null ? void 0 : x.id) || "unknown";
727
+ const y = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", _ = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (q = n.user) == null ? void 0 : q.username, R = F || (H ? `linktr.ee/${H}` : void 0), z = ((g = n.user) == null ? void 0 : g.id) || "unknown";
728
728
  return (
729
729
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
730
730
  /* @__PURE__ */ e(
@@ -733,13 +733,13 @@ const en = ({
733
733
  ref: t,
734
734
  className: "mes-dialog group",
735
735
  onClose: s,
736
- onClick: (_) => {
737
- _.target === t.current && s();
736
+ onClick: (p) => {
737
+ p.target === t.current && s();
738
738
  },
739
739
  children: /* @__PURE__ */ d("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: [
740
740
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
741
741
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
742
- /* @__PURE__ */ e(kt, { onClick: s })
742
+ /* @__PURE__ */ e(Xs, { onClick: s })
743
743
  ] }),
744
744
  /* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
745
745
  /* @__PURE__ */ d(
@@ -752,16 +752,16 @@ const en = ({
752
752
  /* @__PURE__ */ e(
753
753
  ne,
754
754
  {
755
- id: G,
756
- name: I,
757
- image: L,
755
+ id: z,
756
+ name: y,
757
+ image: _,
758
758
  size: 88,
759
759
  shape: "circle"
760
760
  }
761
761
  ),
762
762
  /* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 flex-1", children: [
763
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: I }),
764
- O && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: O }),
763
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
764
+ R && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: R }),
765
765
  o && !f && /* @__PURE__ */ e(
766
766
  "span",
767
767
  {
@@ -784,42 +784,42 @@ const en = ({
784
784
  ),
785
785
  /* @__PURE__ */ d("ul", { className: "flex flex-col gap-2 mt-2", children: [
786
786
  c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
787
- ke,
787
+ me,
788
788
  {
789
- onClick: N,
790
- disabled: p,
791
- "aria-busy": p,
789
+ onClick: U,
790
+ disabled: x,
791
+ "aria-busy": x,
792
792
  children: [
793
- p ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ys, { className: "h-5 w-5" }),
793
+ x ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(fs, { className: "h-5 w-5" }),
794
794
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
795
795
  ]
796
796
  }
797
797
  ) }),
798
- /* @__PURE__ */ e("li", { children: g ? /* @__PURE__ */ d(
799
- ke,
798
+ /* @__PURE__ */ e("li", { children: b ? /* @__PURE__ */ d(
799
+ me,
800
800
  {
801
- onClick: k,
801
+ onClick: T,
802
802
  disabled: w,
803
803
  "aria-busy": w,
804
804
  children: [
805
- w ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5" }),
805
+ w ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
806
806
  /* @__PURE__ */ e("span", { children: "Unblock" })
807
807
  ]
808
808
  }
809
809
  ) : /* @__PURE__ */ d(
810
- ke,
810
+ me,
811
811
  {
812
- onClick: b,
812
+ onClick: k,
813
813
  disabled: w,
814
814
  "aria-busy": w,
815
815
  children: [
816
- w ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5" }),
816
+ w ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
817
817
  /* @__PURE__ */ e("span", { children: "Block" })
818
818
  ]
819
819
  }
820
820
  ) }),
821
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(ke, { variant: "danger", onClick: R, children: [
822
- /* @__PURE__ */ e(Ns, { className: "h-5 w-5" }),
821
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(me, { variant: "danger", onClick: M, children: [
822
+ /* @__PURE__ */ e(gs, { className: "h-5 w-5" }),
823
823
  /* @__PURE__ */ e("span", { children: "Report" })
824
824
  ] }) }),
825
825
  v
@@ -829,30 +829,30 @@ const en = ({
829
829
  }
830
830
  )
831
831
  );
832
- }, tn = (t) => /* @__PURE__ */ e(zt, { ...t, position: "center" }), Ge = "vote_up", Ve = "vote_down";
833
- function sn(t) {
834
- return t != null && t.length ? t.some((s) => s.type === Ve) ? "down" : t.some((s) => s.type === Ge) ? "up" : null : null;
832
+ }, Js = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ie = "vote_up", ke = "vote_down";
833
+ function Ks(t) {
834
+ return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Ie) ? "up" : null : null;
835
835
  }
836
- function nn(t) {
837
- const { channel: s } = ue(), { client: n } = He("useMessageVote"), r = ze(
838
- () => sn(t.own_reactions),
836
+ function Qs(t) {
837
+ const { channel: s } = oe(), { client: n } = Me("useMessageVote"), r = Ce(
838
+ () => Ks(t.own_reactions),
839
839
  [t.own_reactions]
840
- ), o = U(async () => {
840
+ ), o = G(async () => {
841
841
  if (n != null && n.userID)
842
842
  try {
843
- r === "up" ? await s.deleteReaction(t.id, Ge) : await s.sendReaction(
843
+ r === "up" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
844
844
  t.id,
845
- { type: Ge },
845
+ { type: Ie },
846
846
  { enforce_unique: !0, skip_push: !0 }
847
847
  );
848
848
  } catch {
849
849
  }
850
- }, [s, n == null ? void 0 : n.userID, t.id, r]), l = U(async () => {
850
+ }, [s, n == null ? void 0 : n.userID, t.id, r]), l = G(async () => {
851
851
  if (n != null && n.userID)
852
852
  try {
853
- r === "down" ? await s.deleteReaction(t.id, Ve) : await s.sendReaction(
853
+ r === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
854
854
  t.id,
855
- { type: Ve },
855
+ { type: ke },
856
856
  { enforce_unique: !0, skip_push: !0 }
857
857
  );
858
858
  } catch {
@@ -860,41 +860,21 @@ function nn(t) {
860
860
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
861
861
  return { selected: r, voteUp: o, voteDown: l };
862
862
  }
863
- const an = z.lazy(() => import("./Card-RgHsp9x1.js")), rn = z.lazy(() => import("./Card-DwgUtqsA.js")), St = () => /* @__PURE__ */ e(
863
+ const en = O.lazy(() => import("./Card-CuiPAb_A.js")), tn = O.lazy(() => import("./Card-RBVM8Gy3.js")), _t = () => /* @__PURE__ */ e(
864
864
  "div",
865
865
  {
866
866
  className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
867
867
  "aria-hidden": !0
868
868
  }
869
- ), on = (t) => /* @__PURE__ */ e(ft, { fallback: /* @__PURE__ */ e(St, {}), children: /* @__PURE__ */ e(an, { ...t }) }), ln = (t) => /* @__PURE__ */ e(ft, { fallback: /* @__PURE__ */ e(St, {}), children: /* @__PURE__ */ e(rn, { ...t }) }), lt = { Creator: on, Visitor: ln }, cn = {
869
+ ), sn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(_t, {}), children: /* @__PURE__ */ e(en, { ...t }) }), nn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(_t, {}), children: /* @__PURE__ */ e(tn, { ...t }) }), nt = { Creator: sn, Visitor: nn }, an = {
870
870
  isUnlocking: () => !1
871
- }, dn = {
872
- LockedAttachment: cn
873
- }, It = mt({}), fa = It.Provider;
874
- function un(t) {
875
- return ht(It)[t] ?? dn[t];
871
+ }, rn = {
872
+ LockedAttachment: an
873
+ }, yt = ot({}), ia = yt.Provider;
874
+ function on(t) {
875
+ return lt(yt)[t] ?? rn[t];
876
876
  }
877
- const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
878
- "path",
879
- {
880
- 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",
881
- stroke: "currentColor",
882
- strokeWidth: "1.33",
883
- strokeLinecap: "round",
884
- strokeLinejoin: "round",
885
- fill: t ? "currentColor" : "none"
886
- }
887
- ) }), hn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
888
- "path",
889
- {
890
- 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",
891
- stroke: "currentColor",
892
- strokeWidth: "1.33",
893
- strokeLinecap: "round",
894
- strokeLinejoin: "round",
895
- fill: t ? "currentColor" : "none"
896
- }
897
- ) }), fn = ({
877
+ const ln = ({
898
878
  selected: t,
899
879
  onVoteUp: s,
900
880
  onVoteDown: n
@@ -903,26 +883,32 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
903
883
  "button",
904
884
  {
905
885
  type: "button",
906
- className: `message-vote-button${t === "up" ? " message-vote-button--selected" : ""} focus-ring`,
886
+ className: D("message-vote-button focus-ring", {
887
+ "message-vote-button--selected": t === "up"
888
+ }),
907
889
  onClick: s,
908
- "aria-label": "Helpful",
890
+ "aria-label": "Good response",
909
891
  "aria-pressed": t === "up",
910
- children: /* @__PURE__ */ e(mn, { filled: t === "up" })
892
+ "data-tooltip": "Good response",
893
+ children: /* @__PURE__ */ e(bs, { size: 16, weight: t === "up" ? "fill" : "regular" })
911
894
  }
912
895
  ),
913
896
  /* @__PURE__ */ e(
914
897
  "button",
915
898
  {
916
899
  type: "button",
917
- className: `message-vote-button${t === "down" ? " message-vote-button--selected" : ""} focus-ring`,
900
+ className: D("message-vote-button focus-ring", {
901
+ "message-vote-button--selected": t === "down"
902
+ }),
918
903
  onClick: n,
919
- "aria-label": "Not helpful",
904
+ "aria-label": "Bad response",
920
905
  "aria-pressed": t === "down",
921
- children: /* @__PURE__ */ e(hn, { filled: t === "down" })
906
+ "data-tooltip": "Bad response",
907
+ children: /* @__PURE__ */ e(ps, { size: 16, weight: t === "down" ? "fill" : "regular" })
922
908
  }
923
909
  )
924
- ] }), gn = (t) => {
925
- var le, se, we, ye, Ne, ce, Ce, _e, Ee, de, D, X, V, Y;
910
+ ] }), cn = (t) => {
911
+ var se, Oe, Pe, Ue, ze, Be, $e, je, Ge, Ve, He, Ye, qe, We;
926
912
  const {
927
913
  additionalMessageInputProps: s,
928
914
  chatbotVotingEnabled: n,
@@ -931,77 +917,77 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
931
917
  firstOfGroup: l,
932
918
  groupedByUser: i,
933
919
  handleAction: c,
934
- handleOpenThread: h,
920
+ handleOpenThread: m,
935
921
  handleRetry: u,
936
- highlighted: m,
922
+ highlighted: h,
937
923
  isMessageAIGenerated: f,
938
924
  isMyMessage: v,
939
925
  message: a,
940
- renderText: C,
941
- threadList: g
942
- } = t, { client: y } = He("CustomMessage"), { channel: p } = ue("CustomMessage"), { isUnlocking: S, onUnlockClick: w, onFetchSource: E, onDownloadClick: F } = un("LockedAttachment"), [N, b] = M(!1), k = Bt(a.id), { selected: R, voteUp: I, voteDown: L } = nn(a), {
943
- Attachment: T = Gt,
944
- EditMessageModal: B = Vt,
945
- MessageBlocked: O = Ht,
946
- MessageBouncePrompt: G = Yt,
947
- MessageDeleted: $ = Wt,
948
- MessageIsThreadReplyInChannelButtonIndicator: P = qt,
949
- MessageRepliesCountButton: W = Xt,
950
- ReminderNotification: Z = Zt,
951
- StreamedMessageText: ae = Kt,
952
- PinIndicator: J
953
- } = gt("CustomMessage"), x = Jt(a), _ = Qt(a), j = ze(
926
+ renderText: N,
927
+ threadList: b
928
+ } = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = on("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: y, voteDown: _ } = Qs(a), {
929
+ Attachment: F = Ot,
930
+ EditMessageModal: H = Pt,
931
+ MessageBlocked: R = Ut,
932
+ MessageBouncePrompt: z = zt,
933
+ MessageDeleted: S = Bt,
934
+ MessageIsThreadReplyInChannelButtonIndicator: $ = $t,
935
+ MessageRepliesCountButton: V = jt,
936
+ ReminderNotification: ee = Gt,
937
+ StreamedMessageText: te = Vt,
938
+ PinIndicator: q
939
+ } = dt("CustomMessage"), g = Ht(a), p = Yt(a), L = Ce(
954
940
  () => f == null ? void 0 : f(a),
955
941
  [f, a]
956
- ), H = ze(
942
+ ), j = Ce(
957
943
  () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
958
944
  [a]
959
945
  );
960
- if (es(a))
946
+ if (qt(a))
961
947
  return null;
962
948
  if (a.deleted_at || a.type === "deleted")
963
- return /* @__PURE__ */ e($, { message: a });
964
- if (ts(a))
965
- return /* @__PURE__ */ e(O, {});
966
- const ee = !g && !!a.reply_count, ie = !g && a.show_in_channel && a.parent_id, be = a.status === "failed" && ((le = a.error) == null ? void 0 : le.status) !== 403, Le = ss(a);
967
- let q;
968
- be ? q = () => u(a) : Le && (q = () => b(!0));
969
- const te = v(), xe = A(
949
+ return /* @__PURE__ */ e(S, { message: a });
950
+ if (Wt(a))
951
+ return /* @__PURE__ */ e(R, {});
952
+ const Y = !b && !!a.reply_count, ae = !b && a.show_in_channel && a.parent_id, de = a.status === "failed" && ((se = a.error) == null ? void 0 : se.status) !== 403, re = Xt(a);
953
+ let W;
954
+ de ? W = () => u(a) : re && (W = () => k(!0));
955
+ const ie = v(), pe = D(
970
956
  "str-chat__message str-chat__message-simple",
971
957
  `str-chat__message--${a.type}`,
972
958
  `str-chat__message--${a.status}`,
973
- te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
959
+ ie ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
974
960
  a.text ? "str-chat__message--has-text" : "has-no-text",
975
961
  {
976
- "str-chat__message--has-attachment": x,
977
- "str-chat__message--highlighted": m,
962
+ "str-chat__message--has-attachment": g,
963
+ "str-chat__message--highlighted": h,
978
964
  "str-chat__message--pinned pinned-message": a.pinned,
979
- "str-chat__message--with-reactions": _,
980
- "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((se = a == null ? void 0 : a.error) == null ? void 0 : se.status) !== 403,
981
- "str-chat__message-with-thread-link": ee || ie,
965
+ "str-chat__message--with-reactions": p,
966
+ "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((Oe = a == null ? void 0 : a.error) == null ? void 0 : Oe.status) !== 403,
967
+ "str-chat__message-with-thread-link": Y || ae,
982
968
  "str-chat__virtual-message__wrapper--end": o,
983
969
  "str-chat__virtual-message__wrapper--first": l,
984
970
  "str-chat__virtual-message__wrapper--group": i
985
971
  }
986
- ), re = a.poll_id && y.polls.fromState(a.poll_id), me = Js(a), oe = We(a), pe = Ks(a), ge = !!(H != null && H.length && !a.quoted_message), ve = oe && te && ge;
987
- return /* @__PURE__ */ d(fe, { children: [
972
+ ), ue = a.poll_id && C.polls.fromState(a.poll_id), xe = Ys(a), K = De(a), B = Hs(a), X = !!(j != null && j.length && !a.quoted_message), Q = K && ie && X;
973
+ return /* @__PURE__ */ d(ce, { children: [
988
974
  r && /* @__PURE__ */ e(
989
- B,
975
+ H,
990
976
  {
991
977
  additionalMessageInputProps: s
992
978
  }
993
979
  ),
994
- N && /* @__PURE__ */ e(
995
- ns,
980
+ U && /* @__PURE__ */ e(
981
+ Zt,
996
982
  {
997
- MessageBouncePrompt: G,
998
- onClose: () => b(!1),
999
- open: N
983
+ MessageBouncePrompt: z,
984
+ onClose: () => k(!1),
985
+ open: U
1000
986
  }
1001
987
  ),
1002
- /* @__PURE__ */ d("div", { className: xe, children: [
1003
- J && /* @__PURE__ */ e(J, {}),
1004
- !!k && /* @__PURE__ */ e(Z, { reminder: k }),
988
+ /* @__PURE__ */ d("div", { className: pe, children: [
989
+ q && /* @__PURE__ */ e(q, {}),
990
+ !!T && /* @__PURE__ */ e(ee, { reminder: T }),
1005
991
  a.user && /* @__PURE__ */ e(
1006
992
  ne,
1007
993
  {
@@ -1014,120 +1000,120 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1014
1000
  /* @__PURE__ */ e(
1015
1001
  "div",
1016
1002
  {
1017
- className: A("str-chat__message-inner", {
1018
- "str-chat__simple-message--error-failed": be || Le
1003
+ className: D("str-chat__message-inner", {
1004
+ "str-chat__simple-message--error-failed": de || re
1019
1005
  }),
1020
1006
  "data-testid": "message-inner",
1021
- onClick: q,
1022
- onKeyDown: q,
1023
- role: q ? "button" : void 0,
1024
- tabIndex: q ? 0 : void 0,
1007
+ onClick: W,
1008
+ onKeyDown: W,
1009
+ role: W ? "button" : void 0,
1010
+ tabIndex: W ? 0 : void 0,
1025
1011
  style: {
1026
1012
  // Force margins to 0 to prevent hover layout shift
1027
1013
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
1028
1014
  marginInlineEnd: 0,
1029
1015
  marginInlineStart: 0
1030
1016
  },
1031
- children: pe ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1032
- te ? /* @__PURE__ */ e(
1033
- lt.Creator,
1017
+ children: B ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1018
+ ie ? /* @__PURE__ */ e(
1019
+ nt.Creator,
1034
1020
  {
1035
- title: (we = a.metadata) == null ? void 0 : we.attachment_title,
1036
- mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
1037
- thumbnailUrl: (Ne = a.metadata) == null ? void 0 : Ne.attachment_thumbnail,
1038
- amountText: (ce = a.metadata) == null ? void 0 : ce.amount_text,
1039
- detail: (Ce = a.metadata) == null ? void 0 : Ce.attachment_detail,
1040
- paymentStatus: (_e = a.metadata) == null ? void 0 : _e.payment_status,
1041
- isUnlocking: S(a.id),
1042
- onPreviewClick: () => w == null ? void 0 : w(a, p),
1043
- onFetchSource: async () => await (E == null ? void 0 : E(a, p))
1021
+ title: (Pe = a.metadata) == null ? void 0 : Pe.attachment_title,
1022
+ mimeType: (Ue = a.metadata) == null ? void 0 : Ue.attachment_mime_type,
1023
+ thumbnailUrl: (ze = a.metadata) == null ? void 0 : ze.attachment_thumbnail,
1024
+ amountText: (Be = a.metadata) == null ? void 0 : Be.amount_text,
1025
+ detail: ($e = a.metadata) == null ? void 0 : $e.attachment_detail,
1026
+ paymentStatus: (je = a.metadata) == null ? void 0 : je.payment_status,
1027
+ isUnlocking: I(a.id),
1028
+ onPreviewClick: () => w == null ? void 0 : w(a, x),
1029
+ onFetchSource: async () => await (E == null ? void 0 : E(a, x))
1044
1030
  }
1045
1031
  ) : /* @__PURE__ */ e(
1046
- lt.Visitor,
1032
+ nt.Visitor,
1047
1033
  {
1048
- title: (Ee = a.metadata) == null ? void 0 : Ee.attachment_title,
1049
- mimeType: (de = a.metadata) == null ? void 0 : de.attachment_mime_type,
1050
- thumbnailUrl: (D = a.metadata) == null ? void 0 : D.attachment_thumbnail,
1051
- amountText: (X = a.metadata) == null ? void 0 : X.amount_text,
1052
- detail: (V = a.metadata) == null ? void 0 : V.attachment_detail,
1053
- paymentStatus: (Y = a.metadata) == null ? void 0 : Y.payment_status,
1054
- isUnlocking: S(a.id),
1055
- onUnlockClick: () => w == null ? void 0 : w(a, p),
1056
- onFetchSource: async () => await (E == null ? void 0 : E(a, p)),
1057
- onDownloadClick: () => F == null ? void 0 : F(a, p)
1034
+ title: (Ge = a.metadata) == null ? void 0 : Ge.attachment_title,
1035
+ mimeType: (Ve = a.metadata) == null ? void 0 : Ve.attachment_mime_type,
1036
+ thumbnailUrl: (He = a.metadata) == null ? void 0 : He.attachment_thumbnail,
1037
+ amountText: (Ye = a.metadata) == null ? void 0 : Ye.amount_text,
1038
+ detail: (qe = a.metadata) == null ? void 0 : qe.attachment_detail,
1039
+ paymentStatus: (We = a.metadata) == null ? void 0 : We.payment_status,
1040
+ isUnlocking: I(a.id),
1041
+ onUnlockClick: () => w == null ? void 0 : w(a, x),
1042
+ onFetchSource: async () => await (E == null ? void 0 : E(a, x)),
1043
+ onDownloadClick: () => P == null ? void 0 : P(a, x)
1058
1044
  }
1059
1045
  ),
1060
- a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Qe, { message: a, renderText: C }) })
1061
- ] }) : me ? (
1046
+ a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: N }) })
1047
+ ] }) : xe ? (
1062
1048
  /* Tip-only messages render as a standalone bubble */
1063
- /* @__PURE__ */ e(Oe, { message: a, standalone: !0 })
1049
+ /* @__PURE__ */ e(_e, { message: a, standalone: !0 })
1064
1050
  ) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1065
1051
  /* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
1066
- oe && !ve && /* @__PURE__ */ e(
1067
- Oe,
1052
+ K && !Q && /* @__PURE__ */ e(
1053
+ _e,
1068
1054
  {
1069
1055
  message: a,
1070
- hasAttachment: ge,
1071
- isMyMessage: te
1056
+ hasAttachment: X,
1057
+ isMyMessage: ie
1072
1058
  }
1073
1059
  ),
1074
- re && /* @__PURE__ */ e(as, { poll: re }),
1075
- H != null && H.length && !a.quoted_message ? /* @__PURE__ */ e(
1076
- T,
1060
+ ue && /* @__PURE__ */ e(Jt, { poll: ue }),
1061
+ j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
1062
+ F,
1077
1063
  {
1078
1064
  actionHandler: c,
1079
- attachments: H
1065
+ attachments: j
1080
1066
  }
1081
1067
  ) : null,
1082
- j ? /* @__PURE__ */ e(
1083
- ae,
1068
+ L ? /* @__PURE__ */ e(
1069
+ te,
1084
1070
  {
1085
1071
  message: a,
1086
- renderText: C
1072
+ renderText: N
1087
1073
  }
1088
- ) : /* @__PURE__ */ e(Qe, { message: a, renderText: C }),
1089
- /* @__PURE__ */ e(rs, {})
1074
+ ) : /* @__PURE__ */ e(Xe, { message: a, renderText: N }),
1075
+ /* @__PURE__ */ e(Kt, {})
1090
1076
  ] }),
1091
- (!oe || ve) && /* @__PURE__ */ e(
1092
- Oe,
1077
+ (!K || Q) && /* @__PURE__ */ e(
1078
+ _e,
1093
1079
  {
1094
1080
  message: a,
1095
- hasAttachment: ge,
1096
- isMyMessage: te
1081
+ hasAttachment: X,
1082
+ isMyMessage: ie
1097
1083
  }
1098
1084
  ),
1099
- n && oe && /* @__PURE__ */ e(
1100
- fn,
1085
+ n && K && /* @__PURE__ */ e(
1086
+ ln,
1101
1087
  {
1102
- selected: R,
1103
- onVoteUp: I,
1104
- onVoteDown: L
1088
+ selected: M,
1089
+ onVoteUp: y,
1090
+ onVoteDown: _
1105
1091
  }
1106
1092
  )
1107
1093
  ] })
1108
1094
  }
1109
1095
  ),
1110
- ee && /* @__PURE__ */ e(
1111
- W,
1096
+ Y && /* @__PURE__ */ e(
1097
+ V,
1112
1098
  {
1113
- onClick: h,
1099
+ onClick: m,
1114
1100
  reply_count: a.reply_count
1115
1101
  }
1116
1102
  ),
1117
- ie && /* @__PURE__ */ e(P, {})
1103
+ ae && /* @__PURE__ */ e($, {})
1118
1104
  ] }, a.id)
1119
1105
  ] });
1120
- }, bn = z.memo(
1121
- gn,
1122
- (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : jt(t, s)
1123
- ), xn = (t) => {
1124
- const s = bt("CustomMessage");
1125
- return /* @__PURE__ */ e(bn, { ...s, ...t });
1126
- }, pn = (t) => ({
1106
+ }, dn = O.memo(
1107
+ cn,
1108
+ (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : At(t, s)
1109
+ ), un = (t) => {
1110
+ const s = ut("CustomMessage");
1111
+ return /* @__PURE__ */ e(dn, { ...s, ...t });
1112
+ }, mn = (t) => ({
1127
1113
  linkPreviews: Array.from(t.previews.values()).filter(
1128
- (s) => it.previewIsLoaded(s) || it.previewIsLoading(s)
1114
+ (s) => tt.previewIsLoaded(s) || tt.previewIsLoading(s)
1129
1115
  )
1130
- }), vn = ({
1116
+ }), hn = ({
1131
1117
  link: t,
1132
1118
  onDismiss: s
1133
1119
  }) => {
@@ -1157,7 +1143,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1157
1143
  },
1158
1144
  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 focus-ring",
1159
1145
  "aria-label": "Close link preview",
1160
- children: /* @__PURE__ */ e(Ye, { className: "size-4 text-black/90" })
1146
+ children: /* @__PURE__ */ e(mt, { className: "size-4 text-black/90" })
1161
1147
  }
1162
1148
  ),
1163
1149
  /* @__PURE__ */ d("div", { className: "p-2", children: [
@@ -1167,22 +1153,22 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1167
1153
  ]
1168
1154
  }
1169
1155
  );
1170
- }, wn = () => {
1171
- const { linkPreviewsManager: t } = is(), { linkPreviews: s } = os(
1156
+ }, fn = () => {
1157
+ const { linkPreviewsManager: t } = Qt(), { linkPreviews: s } = es(
1172
1158
  t.state,
1173
- pn
1159
+ mn
1174
1160
  ), n = (o) => {
1175
1161
  t.dismissPreview(o);
1176
1162
  };
1177
1163
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
1178
- vn,
1164
+ hn,
1179
1165
  {
1180
1166
  link: o,
1181
1167
  onDismiss: n
1182
1168
  },
1183
1169
  o.og_scrape_url
1184
1170
  )) }) : null;
1185
- }, yn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
1171
+ }, gn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
1186
1172
  "button",
1187
1173
  {
1188
1174
  ...n,
@@ -1190,22 +1176,22 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1190
1176
  "aria-label": "Send",
1191
1177
  disabled: s,
1192
1178
  onClick: t,
1193
- children: /* @__PURE__ */ e(Cs, { weight: "bold", className: "size-4" })
1179
+ children: /* @__PURE__ */ e(xs, { weight: "bold", className: "size-4" })
1194
1180
  }
1195
- ), Nn = () => {
1181
+ ), bn = () => {
1196
1182
  var c;
1197
- const { channel: t } = ue(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = cs(), { SendButton: r } = gt(
1183
+ const { channel: t } = oe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = ss(), { SendButton: r } = dt(
1198
1184
  "CustomMessageInput"
1199
- ), o = r ?? yn, l = ds();
1200
- return /* @__PURE__ */ d(fe, { children: [
1201
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(us, {}) }),
1185
+ ), o = r ?? gn, l = ns();
1186
+ return /* @__PURE__ */ d(ce, { children: [
1187
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(as, {}) }),
1202
1188
  /* @__PURE__ */ d("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: [
1203
- /* @__PURE__ */ e(ms, {}),
1204
- /* @__PURE__ */ e(wn, {}),
1205
- /* @__PURE__ */ e(hs, {}),
1189
+ /* @__PURE__ */ e(rs, {}),
1190
+ /* @__PURE__ */ e(fn, {}),
1191
+ /* @__PURE__ */ e(is, {}),
1206
1192
  /* @__PURE__ */ d("div", { className: "flex", children: [
1207
1193
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1208
- fs,
1194
+ os,
1209
1195
  {
1210
1196
  "aria-disabled": s || void 0,
1211
1197
  className: "w-full resize-none outline-none leading-6",
@@ -1229,11 +1215,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1229
1215
  ] })
1230
1216
  ] })
1231
1217
  ] });
1232
- }, Cn = ({
1218
+ }, pn = ({
1233
1219
  renderActions: t
1234
1220
  }) => {
1235
1221
  var r;
1236
- const { channel: s } = ue(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
1222
+ const { channel: s } = oe(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
1237
1223
  return /* @__PURE__ */ d(
1238
1224
  "div",
1239
1225
  {
@@ -1242,65 +1228,65 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1242
1228
  className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
1243
1229
  children: [
1244
1230
  t == null ? void 0 : t(),
1245
- /* @__PURE__ */ e(ls, { Input: Nn })
1231
+ /* @__PURE__ */ e(ts, { Input: bn })
1246
1232
  ]
1247
1233
  }
1248
1234
  );
1249
- }, _n = [
1235
+ }, xn = [
1250
1236
  "SYSTEM_DM_AGENT_PAUSED",
1251
1237
  "SYSTEM_DM_AGENT_RESUMED"
1252
- ], En = {
1238
+ ], vn = {
1253
1239
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1254
1240
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1255
- }, kn = [
1241
+ }, wn = [
1256
1242
  "SYSTEM_AGE_SAFETY_BLOCKED"
1257
- ], Sn = {
1243
+ ], _n = {
1258
1244
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1259
- }, Ue = "age safety guidelines.", In = "https://linktr.ee/s/about/contact", ct = (t) => _n.includes(t), Mn = (t) => kn.includes(t), Tn = (t) => {
1245
+ }, ye = "age safety guidelines.", yn = "https://linktr.ee/s/about/contact", at = (t) => xn.includes(t), Nn = (t) => wn.includes(t), Cn = (t) => {
1260
1246
  var r;
1261
1247
  const s = (r = t.metadata) == null ? void 0 : r.custom_type;
1262
- if (ct(s))
1248
+ if (at(s))
1263
1249
  return {
1264
1250
  kind: "dm-agent",
1265
1251
  type: s
1266
1252
  };
1267
- if (Mn(s))
1253
+ if (Nn(s))
1268
1254
  return {
1269
1255
  kind: "age-safety",
1270
1256
  type: s
1271
1257
  };
1272
1258
  const n = t.dm_agent_system_type;
1273
- if (ct(n))
1259
+ if (at(n))
1274
1260
  return {
1275
1261
  kind: "dm-agent",
1276
1262
  type: n
1277
1263
  };
1278
- }, Dn = (t) => {
1279
- const s = t.indexOf(Ue);
1264
+ }, En = (t) => {
1265
+ const s = t.indexOf(ye);
1280
1266
  if (s === -1)
1281
1267
  return t;
1282
- const n = s + Ue.length;
1283
- return /* @__PURE__ */ d(fe, { children: [
1268
+ const n = s + ye.length;
1269
+ return /* @__PURE__ */ d(ce, { children: [
1284
1270
  t.slice(0, s),
1285
1271
  /* @__PURE__ */ e(
1286
1272
  "a",
1287
1273
  {
1288
- href: In,
1274
+ href: yn,
1289
1275
  target: "_blank",
1290
1276
  rel: "noopener noreferrer",
1291
1277
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1292
- children: Ue
1278
+ children: ye
1293
1279
  }
1294
1280
  ),
1295
1281
  t.slice(n)
1296
1282
  ] });
1297
- }, Rn = (t) => {
1283
+ }, Sn = (t) => {
1298
1284
  var r, o;
1299
- const s = t.message.hide_date === !0, n = Tn(
1285
+ const s = t.message.hide_date === !0, n = Cn(
1300
1286
  t.message
1301
1287
  );
1302
1288
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
1303
- const l = ((r = t.message.text) == null ? void 0 : r.trim()) || En[n.type];
1289
+ const l = ((r = t.message.text) == null ? void 0 : r.trim()) || vn[n.type];
1304
1290
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1305
1291
  /* @__PURE__ */ d(
1306
1292
  "div",
@@ -1310,7 +1296,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1310
1296
  "data-dm-agent-system-type": n.type,
1311
1297
  children: [
1312
1298
  /* @__PURE__ */ e(
1313
- Be,
1299
+ Se,
1314
1300
  {
1315
1301
  size: 16,
1316
1302
  weight: "regular",
@@ -1322,11 +1308,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1322
1308
  ]
1323
1309
  }
1324
1310
  ),
1325
- !s && /* @__PURE__ */ e(Fe, { message: t.message })
1311
+ !s && /* @__PURE__ */ e(ve, { message: t.message })
1326
1312
  ] });
1327
1313
  }
1328
1314
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1329
- const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Sn[n.type];
1315
+ const l = ((o = t.message.text) == null ? void 0 : o.trim()) || _n[n.type];
1330
1316
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1331
1317
  /* @__PURE__ */ d(
1332
1318
  "div",
@@ -1336,7 +1322,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1336
1322
  "data-age-safety-system-type": n.type,
1337
1323
  children: [
1338
1324
  /* @__PURE__ */ e(
1339
- _s,
1325
+ vs,
1340
1326
  {
1341
1327
  size: 24,
1342
1328
  weight: "duotone",
@@ -1345,11 +1331,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1345
1331
  "data-testid": "age-safety-system-message-icon"
1346
1332
  }
1347
1333
  ),
1348
- /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Dn(l) }) })
1334
+ /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: En(l) }) })
1349
1335
  ]
1350
1336
  }
1351
1337
  ),
1352
- !s && /* @__PURE__ */ e(Fe, { message: t.message })
1338
+ !s && /* @__PURE__ */ e(ve, { message: t.message })
1353
1339
  ] });
1354
1340
  }
1355
1341
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1358,9 +1344,9 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1358
1344
  /* @__PURE__ */ e("p", { children: t.message.text }),
1359
1345
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1360
1346
  ] }),
1361
- !s && /* @__PURE__ */ e(Fe, { message: t.message })
1347
+ !s && /* @__PURE__ */ e(ve, { message: t.message })
1362
1348
  ] });
1363
- }, $e = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
1349
+ }, Ne = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
1364
1350
  "animateTransform",
1365
1351
  {
1366
1352
  attributeName: "transform",
@@ -1370,25 +1356,25 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1370
1356
  begin: `${120 * s}ms`,
1371
1357
  repeatCount: "indefinite"
1372
1358
  }
1373
- ) }), Ln = ({ threadList: t }) => {
1374
- var C;
1375
- const { channel: s, channelConfig: n, thread: r } = ue(), { client: o } = He(), { typing: l = {} } = gs();
1359
+ ) }), In = ({ threadList: t }) => {
1360
+ var N;
1361
+ const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = Me(), { typing: l = {} } = ls();
1376
1362
  if ((n == null ? void 0 : n.typing_events) === !1)
1377
1363
  return null;
1378
1364
  const i = t ? [] : Object.values(l).filter(
1379
- ({ parent_id: g, user: y }) => {
1380
- var p;
1381
- return (y == null ? void 0 : y.id) !== ((p = o.user) == null ? void 0 : p.id) && !g;
1365
+ ({ parent_id: b, user: C }) => {
1366
+ var x;
1367
+ return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && !b;
1382
1368
  }
1383
1369
  ), c = t ? Object.values(l).filter(
1384
- ({ parent_id: g, user: y }) => {
1385
- var p;
1386
- return (y == null ? void 0 : y.id) !== ((p = o.user) == null ? void 0 : p.id) && g === (r == null ? void 0 : r.id);
1370
+ ({ parent_id: b, user: C }) => {
1371
+ var x;
1372
+ return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && b === (r == null ? void 0 : r.id);
1387
1373
  }
1388
- ) : [], h = t ? c : i;
1389
- if (!h.length)
1374
+ ) : [], m = t ? c : i;
1375
+ if (!m.length)
1390
1376
  return null;
1391
- const u = (C = h[0]) == null ? void 0 : C.user, m = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (m == null ? void 0 : m.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (m == null ? void 0 : m.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (m == null ? void 0 : m.image);
1377
+ const u = (N = m[0]) == null ? void 0 : N.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
1392
1378
  return /* @__PURE__ */ d(
1393
1379
  "div",
1394
1380
  {
@@ -1416,19 +1402,19 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1416
1402
  height: "8",
1417
1403
  overflow: "visible",
1418
1404
  children: [
1419
- /* @__PURE__ */ e($e, { cx: "4", index: 0 }),
1420
- /* @__PURE__ */ e($e, { cx: "16", index: 1 }),
1421
- /* @__PURE__ */ e($e, { cx: "28", index: 2 })
1405
+ /* @__PURE__ */ e(Ne, { cx: "4", index: 0 }),
1406
+ /* @__PURE__ */ e(Ne, { cx: "16", index: 1 }),
1407
+ /* @__PURE__ */ e(Ne, { cx: "28", index: 2 })
1422
1408
  ]
1423
1409
  }
1424
1410
  ) })
1425
1411
  ]
1426
1412
  }
1427
1413
  );
1428
- }, Pn = () => null, An = ({ className: t, message: s }) => /* @__PURE__ */ d(
1414
+ }, kn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ d(
1429
1415
  "div",
1430
1416
  {
1431
- className: A("flex items-center justify-center h-full", t),
1417
+ className: D("flex items-center justify-center h-full", t),
1432
1418
  children: [
1433
1419
  /* @__PURE__ */ d("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1434
1420
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1468,12 +1454,12 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1468
1454
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1469
1455
  ]
1470
1456
  }
1471
- ), Me = z.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1472
- /* @__PURE__ */ e(An, { className: "w-6 h-6" }),
1457
+ ), fe = O.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1458
+ /* @__PURE__ */ e(Mn, { className: "w-6 h-6" }),
1473
1459
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1474
1460
  ] }) }));
1475
- Me.displayName = "LoadingState";
1476
- const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", dt = "Replies instantly with AI assistant", Fn = ({
1461
+ fe.displayName = "LoadingState";
1462
+ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", rt = "Replies instantly with AI assistant", Tn = ({
1477
1463
  onBack: t,
1478
1464
  showBackButton: s,
1479
1465
  onShowInfo: n,
@@ -1481,19 +1467,19 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1481
1467
  showStarButton: o = !1,
1482
1468
  dmAgentEnabled: l = !1
1483
1469
  }) => {
1484
- var v, a, C, g, y;
1485
- const { channel: i } = ue(), c = z.useMemo(() => Object.values(i.state.members || {}).find(
1486
- (S) => {
1470
+ var v, a, N, b, C;
1471
+ const { channel: i } = oe(), c = O.useMemo(() => Object.values(i.state.members || {}).find(
1472
+ (I) => {
1487
1473
  var w;
1488
- return ((w = S.user) == null ? void 0 : w.id) && S.user.id !== i._client.userID;
1474
+ return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== i._client.userID;
1489
1475
  }
1490
- ), [i._client.userID, i.state.members]), h = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (C = c == null ? void 0 : c.user) == null ? void 0 : C.image, m = yt(i), f = async () => {
1476
+ ), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (N = c == null ? void 0 : c.user) == null ? void 0 : N.image, h = pt(i), f = async () => {
1491
1477
  try {
1492
- m ? await i.unpin() : await i.pin();
1493
- } catch (p) {
1478
+ h ? await i.unpin() : await i.pin();
1479
+ } catch (x) {
1494
1480
  console.error(
1495
1481
  "[CustomChannelHeader] Failed to update pinned status:",
1496
- p
1482
+ x
1497
1483
  );
1498
1484
  }
1499
1485
  };
@@ -1502,22 +1488,22 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1502
1488
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
1503
1489
  "button",
1504
1490
  {
1505
- className: he,
1491
+ className: le,
1506
1492
  onClick: t || (() => {
1507
1493
  }),
1508
1494
  type: "button",
1509
1495
  "aria-label": "Back to conversations",
1510
- children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
1496
+ children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
1511
1497
  }
1512
1498
  ) }),
1513
1499
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 items-center", children: [
1514
1500
  /* @__PURE__ */ e(
1515
1501
  ne,
1516
1502
  {
1517
- id: ((g = c == null ? void 0 : c.user) == null ? void 0 : g.id) || i.id || "unknown",
1518
- name: h,
1503
+ id: ((b = c == null ? void 0 : c.user) == null ? void 0 : b.id) || i.id || "unknown",
1504
+ name: m,
1519
1505
  image: u,
1520
- starred: o && m,
1506
+ starred: o && h,
1521
1507
  dmAgentEnabled: l,
1522
1508
  size: 40
1523
1509
  }
@@ -1528,34 +1514,34 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1528
1514
  type: "button",
1529
1515
  onClick: n,
1530
1516
  className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
1531
- "aria-label": `View info for ${h}`,
1517
+ "aria-label": `View info for ${m}`,
1532
1518
  children: [
1533
- h,
1534
- /* @__PURE__ */ e(st, { className: "size-3 shrink-0" })
1519
+ m,
1520
+ /* @__PURE__ */ e(Ke, { className: "size-3 shrink-0" })
1535
1521
  ]
1536
1522
  }
1537
1523
  ),
1538
1524
  l && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
1539
- /* @__PURE__ */ e(Be, { className: "size-3 shrink-0 text-black/55" }),
1540
- /* @__PURE__ */ e("span", { children: dt })
1525
+ /* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
1526
+ /* @__PURE__ */ e("span", { children: rt })
1541
1527
  ] })
1542
1528
  ] }),
1543
1529
  /* @__PURE__ */ d("div", { className: "flex justify-end items-center gap-2", children: [
1544
1530
  o && /* @__PURE__ */ e(
1545
1531
  "button",
1546
1532
  {
1547
- className: he,
1533
+ className: le,
1548
1534
  onClick: f,
1549
1535
  type: "button",
1550
- "aria-label": m ? "Unstar conversation" : "Star conversation",
1536
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1551
1537
  children: /* @__PURE__ */ e(
1552
- je,
1538
+ Ee,
1553
1539
  {
1554
- className: A("size-5", {
1555
- "text-yellow-600": m,
1556
- "text-black/90": !m
1540
+ className: D("size-5", {
1541
+ "text-yellow-600": h,
1542
+ "text-black/90": !h
1557
1543
  }),
1558
- weight: m ? "duotone" : "regular"
1544
+ weight: h ? "duotone" : "regular"
1559
1545
  }
1560
1546
  )
1561
1547
  }
@@ -1563,11 +1549,11 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1563
1549
  /* @__PURE__ */ e(
1564
1550
  "button",
1565
1551
  {
1566
- className: he,
1552
+ className: le,
1567
1553
  onClick: n,
1568
1554
  type: "button",
1569
1555
  "aria-label": "Show info",
1570
- children: /* @__PURE__ */ e(nt, { className: "size-5 text-black/90" })
1556
+ children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
1571
1557
  }
1572
1558
  )
1573
1559
  ] })
@@ -1579,18 +1565,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1579
1565
  {
1580
1566
  type: "button",
1581
1567
  onClick: t,
1582
- className: he,
1568
+ className: le,
1583
1569
  "aria-label": "Back to conversations",
1584
- children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
1570
+ children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
1585
1571
  }
1586
1572
  ),
1587
1573
  /* @__PURE__ */ e(
1588
1574
  ne,
1589
1575
  {
1590
- id: ((y = c == null ? void 0 : c.user) == null ? void 0 : y.id) || i.id || "unknown",
1591
- name: h,
1576
+ id: ((C = c == null ? void 0 : c.user) == null ? void 0 : C.id) || i.id || "unknown",
1577
+ name: m,
1592
1578
  image: u,
1593
- starred: o && m,
1579
+ starred: o && h,
1594
1580
  dmAgentEnabled: l,
1595
1581
  size: 40
1596
1582
  }
@@ -1602,16 +1588,16 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1602
1588
  type: "button",
1603
1589
  onClick: n,
1604
1590
  className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
1605
- "aria-label": `View info for ${h}`,
1591
+ "aria-label": `View info for ${m}`,
1606
1592
  children: [
1607
- /* @__PURE__ */ e("span", { className: "truncate", children: h }),
1608
- /* @__PURE__ */ e(st, { className: "size-4 shrink-0" })
1593
+ /* @__PURE__ */ e("span", { className: "truncate", children: m }),
1594
+ /* @__PURE__ */ e(Ke, { className: "size-4 shrink-0" })
1609
1595
  ]
1610
1596
  }
1611
- ) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: h }),
1597
+ ) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: m }),
1612
1598
  l && /* @__PURE__ */ d("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
1613
- /* @__PURE__ */ e(Be, { className: "size-3 shrink-0 text-black/55" }),
1614
- /* @__PURE__ */ e("span", { className: "truncate", children: dt })
1599
+ /* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
1600
+ /* @__PURE__ */ e("span", { className: "truncate", children: rt })
1615
1601
  ] })
1616
1602
  ] })
1617
1603
  ] }),
@@ -1619,18 +1605,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1619
1605
  o && /* @__PURE__ */ e(
1620
1606
  "button",
1621
1607
  {
1622
- className: he,
1608
+ className: le,
1623
1609
  onClick: f,
1624
1610
  type: "button",
1625
- "aria-label": m ? "Unstar conversation" : "Star conversation",
1611
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1626
1612
  children: /* @__PURE__ */ e(
1627
- je,
1613
+ Ee,
1628
1614
  {
1629
- className: A("size-5", {
1630
- "text-yellow-600": m,
1631
- "text-black/90": !m
1615
+ className: D("size-5", {
1616
+ "text-yellow-600": h,
1617
+ "text-black/90": !h
1632
1618
  }),
1633
- weight: m ? "duotone" : "regular"
1619
+ weight: h ? "duotone" : "regular"
1634
1620
  }
1635
1621
  )
1636
1622
  }
@@ -1638,17 +1624,17 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1638
1624
  r && n && /* @__PURE__ */ e(
1639
1625
  "button",
1640
1626
  {
1641
- className: he,
1627
+ className: le,
1642
1628
  onClick: n,
1643
1629
  type: "button",
1644
1630
  "aria-label": "Show info",
1645
- children: /* @__PURE__ */ e(nt, { className: "size-5 text-black/90" })
1631
+ children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
1646
1632
  }
1647
1633
  )
1648
1634
  ] })
1649
1635
  ] })
1650
1636
  ] });
1651
- }, On = ({
1637
+ }, Dn = ({
1652
1638
  onBack: t,
1653
1639
  showBackButton: s,
1654
1640
  renderMessageInputActions: n,
@@ -1657,94 +1643,94 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1657
1643
  onBlockParticipant: l,
1658
1644
  showDeleteConversation: i = !0,
1659
1645
  onDeleteConversationClick: c,
1660
- onBlockParticipantClick: h,
1646
+ onBlockParticipantClick: m,
1661
1647
  onReportParticipantClick: u,
1662
- showStarButton: m = !1,
1648
+ showStarButton: h = !1,
1663
1649
  chatbotVotingEnabled: f = !1,
1664
1650
  renderChannelBanner: v,
1665
1651
  customProfileContent: a,
1666
- customChannelActions: C,
1667
- renderMessage: g,
1668
- dmAgentEnabled: y = !1
1652
+ customChannelActions: N,
1653
+ renderMessage: b,
1654
+ dmAgentEnabled: C = !1
1669
1655
  }) => {
1670
- var T, B;
1671
- const { channel: p } = ue(), S = Q(null), w = z.useMemo(() => Object.values(p.state.members || {}).find(
1672
- (G) => {
1673
- var $;
1674
- return (($ = G.user) == null ? void 0 : $.id) && G.user.id !== p._client.userID;
1656
+ var F, H;
1657
+ const { channel: x } = oe(), I = J(null), w = O.useMemo(() => Object.values(x.state.members || {}).find(
1658
+ (z) => {
1659
+ var S;
1660
+ return ((S = z.user) == null ? void 0 : S.id) && z.user.id !== x._client.userID;
1675
1661
  }
1676
- ), [p._client.userID, p.state.members]), E = z.useMemo(() => Object.values(p.state.members || {}).find((G) => {
1677
- var $;
1678
- return (($ = G.user) == null ? void 0 : $.id) === p._client.userID;
1679
- }), [p._client.userID, p.state.members]), F = ((T = E == null ? void 0 : E.user) == null ? void 0 : T.is_account) ?? (E == null ? void 0 : E.is_account), N = ((B = w == null ? void 0 : w.user) == null ? void 0 : B.is_account) ?? (w == null ? void 0 : w.is_account), b = y && F === !1 && N === !0, k = z.useMemo(() => {
1680
- const O = p.data ?? {};
1681
- if (O.followerStatus)
1682
- return String(O.followerStatus);
1683
- if (O.isFollower !== void 0)
1684
- return O.isFollower ? "Subscribed to you" : "Not subscribed";
1685
- }, [p.data]), R = U(() => {
1686
- var O;
1687
- (O = S.current) == null || O.showModal();
1688
- }, []), I = U(() => {
1689
- var O;
1690
- (O = S.current) == null || O.close();
1691
- }, []), L = U(
1692
- (O) => {
1693
- const { message: G } = bt("ChannelView"), $ = /* @__PURE__ */ e(xn, { ...O, chatbotVotingEnabled: f });
1694
- return !g || !G ? $ : g($, G);
1662
+ ), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((z) => {
1663
+ var S;
1664
+ return ((S = z.user) == null ? void 0 : S.id) === x._client.userID;
1665
+ }), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
1666
+ const R = x.data ?? {};
1667
+ if (R.followerStatus)
1668
+ return String(R.followerStatus);
1669
+ if (R.isFollower !== void 0)
1670
+ return R.isFollower ? "Subscribed to you" : "Not subscribed";
1671
+ }, [x.data]), M = G(() => {
1672
+ var R;
1673
+ (R = I.current) == null || R.showModal();
1674
+ }, []), y = G(() => {
1675
+ var R;
1676
+ (R = I.current) == null || R.close();
1677
+ }, []), _ = G(
1678
+ (R) => {
1679
+ const { message: z } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...R, chatbotVotingEnabled: f });
1680
+ return !b || !z ? S : b(S, z);
1695
1681
  },
1696
- [f, g]
1682
+ [f, b]
1697
1683
  );
1698
- return /* @__PURE__ */ d(fe, { children: [
1699
- /* @__PURE__ */ e(xs, { overrides: { Message: L }, children: /* @__PURE__ */ d(ps, { children: [
1684
+ return /* @__PURE__ */ d(ce, { children: [
1685
+ /* @__PURE__ */ e(ds, { overrides: { Message: _ }, children: /* @__PURE__ */ d(us, { children: [
1700
1686
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1701
- Fn,
1687
+ Tn,
1702
1688
  {
1703
1689
  onBack: t,
1704
1690
  showBackButton: s,
1705
- onShowInfo: R,
1691
+ onShowInfo: M,
1706
1692
  canShowInfo: !!w,
1707
- showStarButton: m,
1708
- dmAgentEnabled: b
1693
+ showStarButton: h,
1694
+ dmAgentEnabled: k
1709
1695
  }
1710
1696
  ) }),
1711
1697
  v == null ? void 0 : v(),
1712
1698
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1713
- vs,
1699
+ ms,
1714
1700
  {
1715
1701
  hideDeletedMessages: !0,
1716
1702
  hideNewMessageSeparator: !1,
1717
1703
  messageActions: void 0
1718
1704
  }
1719
1705
  ) }),
1720
- r == null ? void 0 : r(p),
1706
+ r == null ? void 0 : r(x),
1721
1707
  /* @__PURE__ */ e(
1722
- Cn,
1708
+ pn,
1723
1709
  {
1724
- renderActions: () => n == null ? void 0 : n(p)
1710
+ renderActions: () => n == null ? void 0 : n(x)
1725
1711
  }
1726
1712
  )
1727
1713
  ] }) }),
1728
1714
  /* @__PURE__ */ e(
1729
- en,
1715
+ Zs,
1730
1716
  {
1731
- dialogRef: S,
1732
- onClose: I,
1717
+ dialogRef: I,
1718
+ onClose: y,
1733
1719
  participant: w,
1734
- channel: p,
1735
- followerStatusLabel: k,
1720
+ channel: x,
1721
+ followerStatusLabel: T,
1736
1722
  onLeaveConversation: o,
1737
1723
  onBlockParticipant: l,
1738
1724
  showDeleteConversation: i,
1739
1725
  onDeleteConversationClick: c,
1740
- onBlockParticipantClick: h,
1726
+ onBlockParticipantClick: m,
1741
1727
  onReportParticipantClick: u,
1742
1728
  customProfileContent: a,
1743
- customChannelActions: C
1729
+ customChannelActions: N
1744
1730
  }
1745
1731
  )
1746
1732
  ] });
1747
- }, Mt = z.memo(
1733
+ }, Nt = O.memo(
1748
1734
  ({
1749
1735
  channel: t,
1750
1736
  onBack: s,
@@ -1754,62 +1740,62 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1754
1740
  onLeaveConversation: l,
1755
1741
  onBlockParticipant: i,
1756
1742
  className: c,
1757
- CustomChannelEmptyState: h = Pn,
1743
+ CustomChannelEmptyState: m = kn,
1758
1744
  showDeleteConversation: u = !0,
1759
- onDeleteConversationClick: m,
1745
+ onDeleteConversationClick: h,
1760
1746
  onBlockParticipantClick: f,
1761
1747
  onReportParticipantClick: v,
1762
1748
  dmAgentEnabled: a,
1763
- messageMetadata: C,
1764
- onMessageSent: g,
1765
- showStarButton: y = !1,
1766
- chatbotVotingEnabled: p = !1,
1767
- renderChannelBanner: S,
1749
+ messageMetadata: N,
1750
+ onMessageSent: b,
1751
+ showStarButton: C = !1,
1752
+ chatbotVotingEnabled: x = !1,
1753
+ renderChannelBanner: I,
1768
1754
  customProfileContent: w,
1769
1755
  customChannelActions: E,
1770
- renderMessage: F,
1771
- sendButton: N
1756
+ renderMessage: P,
1757
+ sendButton: U
1772
1758
  }) => {
1773
- const b = U(
1774
- async (k, R, I) => {
1775
- var $;
1776
- const L = (($ = t.data) == null ? void 0 : $.chatbot_paused) === !0, T = a && !L, B = {
1777
- ...R,
1778
- ...T && { silent: !0 },
1779
- ...C && {
1759
+ const k = G(
1760
+ async (T, M, y) => {
1761
+ var S;
1762
+ const _ = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !_, H = {
1763
+ ...M,
1764
+ ...F && { silent: !0 },
1765
+ ...N && {
1780
1766
  metadata: {
1781
- ...R.metadata ?? {},
1782
- ...C
1767
+ ...M.metadata ?? {},
1768
+ ...N
1783
1769
  }
1784
1770
  }
1785
- }, O = {
1786
- ...I,
1787
- ...T && { skip_push: !0 }
1788
- }, G = await t.sendMessage(B, O);
1789
- return g == null || g(G), G;
1771
+ }, R = {
1772
+ ...y,
1773
+ ...F && { skip_push: !0 }
1774
+ }, z = await t.sendMessage(H, R);
1775
+ return b == null || b(z), z;
1790
1776
  },
1791
- [t, a, C, g]
1777
+ [t, a, N, b]
1792
1778
  );
1793
1779
  return /* @__PURE__ */ e(
1794
1780
  "div",
1795
1781
  {
1796
- className: A(
1782
+ className: D(
1797
1783
  "messaging-channel-view h-full flex flex-col",
1798
1784
  c
1799
1785
  ),
1800
1786
  children: /* @__PURE__ */ e(
1801
- bs,
1787
+ cs,
1802
1788
  {
1803
1789
  channel: t,
1804
- MessageSystem: Rn,
1805
- EmptyStateIndicator: h,
1806
- LoadingIndicator: Me,
1807
- DateSeparator: tn,
1808
- TypingIndicator: Ln,
1809
- doSendMessageRequest: b,
1810
- ...N ? { SendButton: N } : {},
1790
+ MessageSystem: Sn,
1791
+ EmptyStateIndicator: m,
1792
+ LoadingIndicator: fe,
1793
+ DateSeparator: Js,
1794
+ TypingIndicator: In,
1795
+ doSendMessageRequest: k,
1796
+ ...U ? { SendButton: U } : {},
1811
1797
  children: /* @__PURE__ */ e(
1812
- On,
1798
+ Dn,
1813
1799
  {
1814
1800
  onBack: s,
1815
1801
  showBackButton: n,
@@ -1817,18 +1803,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1817
1803
  renderConversationFooter: o,
1818
1804
  onLeaveConversation: l,
1819
1805
  onBlockParticipant: i,
1820
- CustomChannelEmptyState: h,
1806
+ CustomChannelEmptyState: m,
1821
1807
  showDeleteConversation: u,
1822
- onDeleteConversationClick: m,
1808
+ onDeleteConversationClick: h,
1823
1809
  onBlockParticipantClick: f,
1824
1810
  onReportParticipantClick: v,
1825
- showStarButton: y,
1811
+ showStarButton: C,
1826
1812
  dmAgentEnabled: a,
1827
- chatbotVotingEnabled: p,
1828
- renderChannelBanner: S,
1813
+ chatbotVotingEnabled: x,
1814
+ renderChannelBanner: I,
1829
1815
  customProfileContent: w,
1830
1816
  customChannelActions: E,
1831
- renderMessage: F
1817
+ renderMessage: P
1832
1818
  }
1833
1819
  )
1834
1820
  }
@@ -1837,186 +1823,8 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1837
1823
  );
1838
1824
  }
1839
1825
  );
1840
- Mt.displayName = "ChannelView";
1841
- function Un({
1842
- searchQuery: t,
1843
- setSearchQuery: s,
1844
- placeholder: n
1845
- }) {
1846
- const r = Q(null);
1847
- return /* @__PURE__ */ d("div", { className: "relative", children: [
1848
- /* @__PURE__ */ e(
1849
- Es,
1850
- {
1851
- className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1852
- weight: "bold"
1853
- }
1854
- ),
1855
- /* @__PURE__ */ e(
1856
- "input",
1857
- {
1858
- ref: r,
1859
- type: "text",
1860
- placeholder: n,
1861
- value: t,
1862
- onChange: (o) => s(o.target.value),
1863
- className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
1864
- }
1865
- ),
1866
- t && /* @__PURE__ */ e(
1867
- Et,
1868
- {
1869
- label: "Clear search",
1870
- onClick: () => {
1871
- var o;
1872
- s(""), (o = r.current) == null || o.focus();
1873
- },
1874
- className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1875
- children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4", weight: "bold" })
1876
- }
1877
- )
1878
- ] });
1879
- }
1880
- const $n = ({
1881
- participantSource: t,
1882
- onSelectParticipant: s,
1883
- onClose: n,
1884
- existingParticipantIds: r = /* @__PURE__ */ new Set(),
1885
- participantLabel: o = "participants",
1886
- searchPlaceholder: l = "Search participants...",
1887
- className: i
1888
- }) => {
1889
- const { debug: c } = De(), [h, u] = M(""), [m, f] = M([]), [v, a] = M(!1), [C, g] = M(null), [y, p] = M(
1890
- null
1891
- ), S = Q(!1);
1892
- K(() => {
1893
- S.current = !1;
1894
- }, [t]), K(() => {
1895
- if (t.loading) {
1896
- c && console.log(
1897
- "[ParticipantPicker] Waiting for participant source to finish loading..."
1898
- );
1899
- return;
1900
- }
1901
- if (S.current) return;
1902
- (async () => {
1903
- c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), g(null);
1904
- try {
1905
- const b = await t.loadParticipants({
1906
- search: "",
1907
- // Load all participants initially
1908
- limit: 100
1909
- });
1910
- f(b.participants), S.current = !0, c && console.log(
1911
- "[ParticipantPicker] Participants loaded successfully:",
1912
- b.participants.length
1913
- );
1914
- } catch (b) {
1915
- const k = b instanceof Error ? b.message : "Failed to load participants";
1916
- g(k), console.error("[ParticipantPicker] Failed to load participants:", b);
1917
- } finally {
1918
- a(!1);
1919
- }
1920
- })();
1921
- }, [t, c]);
1922
- const w = m.filter((N) => !r.has(N.id)).filter((N) => {
1923
- var k;
1924
- if (!h) return !0;
1925
- const b = h.toLowerCase();
1926
- return N.name.toLowerCase().includes(b) || ((k = N.email) == null ? void 0 : k.toLowerCase().includes(b)) || !1;
1927
- }), E = U(
1928
- async (N) => {
1929
- if (!y) {
1930
- p(N.id);
1931
- try {
1932
- await s(N);
1933
- } catch (b) {
1934
- console.error("[ParticipantPicker] Failed to start chat:", b), p(null);
1935
- }
1936
- }
1937
- },
1938
- [s, y]
1939
- ), F = (N, b) => {
1940
- (N.key === "Enter" || N.key === " ") && (N.preventDefault(), E(b));
1941
- };
1942
- return /* @__PURE__ */ d("div", { className: A("flex flex-col h-full", i), children: [
1943
- /* @__PURE__ */ d("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1944
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-3", children: [
1945
- /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1946
- /* @__PURE__ */ e(kt, { onClick: n })
1947
- ] }),
1948
- /* @__PURE__ */ d("p", { className: "text-xs text-stone mb-3", children: [
1949
- "Select a ",
1950
- o.slice(0, -1),
1951
- " to start messaging (",
1952
- w.length,
1953
- " available)",
1954
- t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
1955
- ] }),
1956
- /* @__PURE__ */ e(
1957
- Un,
1958
- {
1959
- searchQuery: h,
1960
- setSearchQuery: u,
1961
- placeholder: l
1962
- }
1963
- )
1964
- ] }),
1965
- C && /* @__PURE__ */ d("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1966
- "Error loading ",
1967
- o,
1968
- ": ",
1969
- C
1970
- ] }),
1971
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && w.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1972
- /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1973
- /* @__PURE__ */ d("span", { className: "text-sm text-stone", children: [
1974
- "Loading ",
1975
- o,
1976
- "..."
1977
- ] })
1978
- ] }) }) : w.length === 0 ? /* @__PURE__ */ d("div", { className: "p-6 text-center", children: [
1979
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(at, { className: "h-8 w-8 text-charcoal" }) }),
1980
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${o} found` : m.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1981
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : m.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1982
- ] }) : /* @__PURE__ */ d("ul", { className: "space-y-0", children: [
1983
- w.map((N) => {
1984
- const b = N.name || N.email || N.id, k = N.email && N.name ? N.email : N.phone;
1985
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1986
- "button",
1987
- {
1988
- type: "button",
1989
- onClick: () => E(N),
1990
- onKeyDown: (R) => F(R, N),
1991
- className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1992
- children: /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
1993
- /* @__PURE__ */ d("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1994
- /* @__PURE__ */ e(
1995
- ne,
1996
- {
1997
- id: N.id,
1998
- name: b,
1999
- image: N.image,
2000
- size: 40
2001
- }
2002
- ),
2003
- /* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
2004
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: b }),
2005
- k && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: k })
2006
- ] })
2007
- ] }),
2008
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === N.id ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(at, { className: "h-5 w-5 text-stone" }) })
2009
- ] })
2010
- }
2011
- ) }, N.id);
2012
- }),
2013
- v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
2014
- /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
2015
- /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
2016
- ] }) })
2017
- ] }) })
2018
- ] });
2019
- }, zn = ({ className: t }) => /* @__PURE__ */ d(
1826
+ Nt.displayName = "ChannelView";
1827
+ const Rn = ({ className: t }) => /* @__PURE__ */ d(
2020
1828
  "svg",
2021
1829
  {
2022
1830
  width: "140",
@@ -2150,17 +1958,17 @@ const $n = ({
2150
1958
  ] })
2151
1959
  ]
2152
1960
  }
2153
- ), Tt = z.memo(
1961
+ ), Ct = O.memo(
2154
1962
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
2155
- /* @__PURE__ */ e(zn, {}),
1963
+ /* @__PURE__ */ e(Rn, {}),
2156
1964
  s && !t && /* @__PURE__ */ d("div", { className: "mt-8", children: [
2157
1965
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
2158
1966
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
2159
1967
  ] })
2160
1968
  ] }) })
2161
1969
  );
2162
- Tt.displayName = "EmptyState";
2163
- const Ie = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
1970
+ Ct.displayName = "EmptyState";
1971
+ const he = O.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
2164
1972
  /* @__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: "⚠️" }) }),
2165
1973
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2166
1974
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -2174,333 +1982,264 @@ const Ie = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
2174
1982
  }
2175
1983
  )
2176
1984
  ] }) }));
2177
- Ie.displayName = "ErrorState";
2178
- const ga = ({
1985
+ he.displayName = "ErrorState";
1986
+ const oa = ({
2179
1987
  capabilities: t = {},
2180
1988
  className: s,
2181
1989
  renderMessageInputActions: n,
2182
1990
  renderConversationFooter: r,
2183
1991
  onChannelSelect: o,
2184
- onParticipantSelect: l,
2185
- initialParticipantFilter: i,
2186
- initialParticipantData: c,
2187
- CustomChannelEmptyState: h,
2188
- showChannelList: u = !0,
2189
- filters: m,
2190
- channelRenderFilterFn: f,
2191
- channelListCustomEmptyStateIndicator: v,
2192
- onDeleteConversationClick: a,
2193
- onBlockParticipantClick: C,
2194
- onReportParticipantClick: g,
2195
- dmAgentEnabled: y,
2196
- messageMetadata: p,
2197
- onMessageSent: S,
2198
- showStarButton: w = !1,
2199
- chatbotVotingEnabled: E = !1,
2200
- renderMessagePreview: F,
2201
- renderChannelBanner: N,
2202
- customProfileContent: b,
1992
+ initialParticipantFilter: l,
1993
+ initialParticipantData: i,
1994
+ CustomChannelEmptyState: c,
1995
+ showChannelList: m = !0,
1996
+ filters: u,
1997
+ channelRenderFilterFn: h,
1998
+ channelListCustomEmptyStateIndicator: f,
1999
+ onDeleteConversationClick: v,
2000
+ onBlockParticipantClick: a,
2001
+ onReportParticipantClick: N,
2002
+ dmAgentEnabled: b,
2003
+ messageMetadata: C,
2004
+ onMessageSent: x,
2005
+ showStarButton: I = !1,
2006
+ chatbotVotingEnabled: w = !1,
2007
+ renderMessagePreview: E,
2008
+ renderChannelBanner: P,
2009
+ customProfileContent: U,
2203
2010
  customChannelActions: k,
2204
- renderMessage: R,
2205
- sendButton: I
2011
+ renderMessage: T,
2012
+ sendButton: M
2206
2013
  }) => {
2207
2014
  const {
2208
- service: L,
2209
- client: T,
2210
- isConnected: B,
2211
- isLoading: O,
2212
- error: G,
2213
- refreshConnection: $,
2214
- debug: P
2215
- } = zs(), [W, Z] = M(null), [ae, J] = M(!1), [x, _] = M(!1), [j, H] = M(!1), [ee, ie] = M(/* @__PURE__ */ new Set()), [be, Le] = M(0), [q, te] = M(!1), [xe, re] = M(null), me = Q(null), {
2216
- participantSource: oe,
2217
- participantLabel: pe = "participants",
2218
- showDeleteConversation: ge = !0
2219
- } = t, ve = z.useMemo(() => {
2220
- const D = T == null ? void 0 : T.userID;
2015
+ service: y,
2016
+ client: _,
2017
+ isConnected: F,
2018
+ isLoading: H,
2019
+ error: R,
2020
+ refreshConnection: z,
2021
+ debug: S
2022
+ } = As(), [$, V] = A(null), [ee, te] = A(!1), [q, g] = A(!1), [p, L] = A(!1), [j, Y] = A(null), {
2023
+ showDeleteConversation: ae = !0
2024
+ } = t, de = O.useMemo(() => {
2025
+ const B = _ == null ? void 0 : _.userID;
2221
2026
  return {
2222
2027
  ...{
2223
2028
  type: "messaging",
2224
2029
  last_message_at: { $exists: !0 },
2225
- ...D && {
2226
- members: { $in: [D] },
2030
+ ...B && {
2031
+ members: { $in: [B] },
2227
2032
  hidden: !1
2228
2033
  }
2229
2034
  },
2230
- ...m
2035
+ ...u
2231
2036
  };
2232
- }, [m, T == null ? void 0 : T.userID]), le = Q(null), se = U(async () => {
2233
- if (!T || !B) return;
2234
- const D = T.userID;
2235
- if (D)
2037
+ }, [u, _ == null ? void 0 : _.userID]), re = J(null), W = G(async () => {
2038
+ if (!_ || !F) return;
2039
+ const B = _.userID;
2040
+ if (B)
2236
2041
  try {
2237
- P && console.log("[MessagingShell] Syncing channels for user:", D);
2238
- const X = await T.queryChannels(
2042
+ S && console.log("[MessagingShell] Syncing channels for user:", B);
2043
+ const X = await _.queryChannels(
2239
2044
  {
2240
2045
  type: "messaging",
2241
- members: { $in: [D] }
2046
+ members: { $in: [B] }
2242
2047
  },
2243
2048
  {},
2244
2049
  { limit: 100 }
2245
- ), V = /* @__PURE__ */ new Set();
2246
- X.forEach((Y) => {
2247
- const Pe = Y.state.members;
2248
- Object.values(Pe).forEach((Ft) => {
2249
- var Je;
2250
- const Ae = (Je = Ft.user) == null ? void 0 : Je.id;
2251
- Ae && Ae !== D && V.add(Ae);
2252
- });
2253
- }), ie((Y) => Y.size === V.size && [...Y].every((Pe) => V.has(Pe)) ? Y : V), J(X.length > 0), _(!0), le.current = D, P && console.log("[MessagingShell] Channels synced successfully:", {
2254
- channelCount: X.length,
2255
- memberCount: V.size
2050
+ );
2051
+ te(X.length > 0), g(!0), re.current = B, S && console.log("[MessagingShell] Channels synced successfully:", {
2052
+ channelCount: X.length
2256
2053
  });
2257
2054
  } catch (X) {
2258
2055
  console.error("[MessagingShell] Failed to sync channels:", X);
2259
2056
  }
2260
- }, [T, B, P]);
2261
- K(() => {
2262
- if (!T || !B) return;
2263
- const D = T.userID;
2264
- D && le.current !== D && se();
2265
- }, [T, B, se]), K(() => {
2266
- if (!i || !T || !B) return;
2057
+ }, [_, F, S]);
2058
+ Z(() => {
2059
+ if (!_ || !F) return;
2060
+ const B = _.userID;
2061
+ B && re.current !== B && W();
2062
+ }, [_, F, W]), Z(() => {
2063
+ if (!l || !_ || !F) return;
2267
2064
  (async () => {
2268
- const X = T.userID;
2065
+ const X = _.userID;
2269
2066
  if (X)
2270
2067
  try {
2271
- P && console.log(
2068
+ S && console.log(
2272
2069
  "[MessagingShell] Loading initial conversation with:",
2273
- i
2070
+ l
2274
2071
  );
2275
- const V = await T.queryChannels(
2072
+ const Q = await _.queryChannels(
2276
2073
  {
2277
2074
  type: "messaging",
2278
- members: { $eq: [X, i] }
2075
+ members: { $eq: [X, l] }
2279
2076
  },
2280
2077
  {},
2281
2078
  { limit: 1 }
2282
2079
  );
2283
- if (V.length > 0)
2284
- Z(V[0]), te(!0), re(null), o && o(V[0]), P && console.log(
2080
+ if (Q.length > 0)
2081
+ V(Q[0]), L(!0), Y(null), o && o(Q[0]), S && console.log(
2285
2082
  "[MessagingShell] Initial conversation loaded:",
2286
- V[0].id
2083
+ Q[0].id
2287
2084
  );
2288
- else if (c && L) {
2289
- P && console.log(
2085
+ else if (i && y) {
2086
+ S && console.log(
2290
2087
  "[MessagingShell] No conversation found, creating one for:",
2291
- c
2088
+ i
2292
2089
  );
2293
2090
  try {
2294
- const Y = await L.startChannelWithParticipant({
2295
- id: c.id,
2296
- name: c.name,
2297
- email: c.email,
2298
- phone: c.phone
2091
+ const se = await y.startChannelWithParticipant({
2092
+ id: i.id,
2093
+ name: i.name,
2094
+ email: i.email,
2095
+ phone: i.phone
2299
2096
  });
2300
- Z(Y), te(!0), re(null), o && o(Y), P && console.log(
2097
+ V(se), L(!0), Y(null), o && o(se), S && console.log(
2301
2098
  "[MessagingShell] Channel created and loaded:",
2302
- Y.id
2099
+ se.id
2303
2100
  );
2304
- } catch (Y) {
2101
+ } catch (se) {
2305
2102
  console.error(
2306
2103
  "[MessagingShell] Failed to create conversation:",
2307
- Y
2308
- ), re("Failed to create conversation");
2104
+ se
2105
+ ), Y("Failed to create conversation");
2309
2106
  }
2310
2107
  } else
2311
- re(
2108
+ Y(
2312
2109
  "No conversation found with this account"
2313
- ), P && console.log(
2110
+ ), S && console.log(
2314
2111
  "[MessagingShell] No conversation found for:",
2315
- i
2112
+ l
2316
2113
  );
2317
- } catch (V) {
2114
+ } catch (Q) {
2318
2115
  console.error(
2319
2116
  "[MessagingShell] Failed to load initial conversation:",
2320
- V
2321
- ), re("Failed to load conversation");
2117
+ Q
2118
+ ), Y("Failed to load conversation");
2322
2119
  }
2323
2120
  })();
2324
2121
  }, [
2122
+ l,
2325
2123
  i,
2326
- c,
2327
- T,
2328
- B,
2329
- L,
2330
- P,
2124
+ _,
2125
+ F,
2126
+ y,
2127
+ S,
2331
2128
  o
2332
2129
  ]);
2333
- const we = U(
2334
- (D) => {
2335
- Z(D), o == null || o(D);
2130
+ const ie = G(
2131
+ (B) => {
2132
+ V(B), o == null || o(B);
2336
2133
  },
2337
2134
  [o]
2338
- ), ye = U(() => {
2339
- q || Z(null);
2340
- }, [q]), Ne = U(
2341
- async (D) => {
2342
- var X;
2343
- if (L)
2344
- try {
2345
- P && console.log(
2346
- "[MessagingShell] Starting conversation with:",
2347
- D.id
2348
- );
2349
- const V = await L.startChannelWithParticipant({
2350
- id: D.id,
2351
- name: D.name,
2352
- email: D.email,
2353
- phone: D.phone
2354
- });
2355
- try {
2356
- await V.show();
2357
- } catch (Y) {
2358
- console.warn("[MessagingShell] Failed to unhide channel:", Y);
2359
- }
2360
- Z(V), H(!1), (X = me.current) == null || X.close(), l == null || l(D);
2361
- } catch (V) {
2362
- console.error("[MessagingShell] Failed to start conversation:", V);
2363
- }
2364
- },
2365
- [L, l, P]
2366
- ), ce = U(() => {
2367
- var D;
2368
- H(!1), (D = me.current) == null || D.close();
2369
- }, []), Ce = U(
2370
- (D) => {
2371
- D.target === me.current && ce();
2372
- },
2373
- [ce]
2374
- ), _e = U(
2375
- async (D) => {
2376
- P && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), te(!1), le.current = null, await se();
2135
+ ), pe = G(() => {
2136
+ p || V(null);
2137
+ }, [p]), ue = G(
2138
+ async (B) => {
2139
+ S && console.log("[MessagingShell] Leaving conversation:", B.id), V(null), L(!1), re.current = null, await W();
2377
2140
  },
2378
- [se, P]
2379
- ), Ee = U(
2380
- async (D) => {
2381
- P && console.log("[MessagingShell] Blocking participant:", D), Z(null), te(!1), le.current = null, await se();
2141
+ [W, S]
2142
+ ), xe = G(
2143
+ async (B) => {
2144
+ S && console.log("[MessagingShell] Blocking participant:", B), V(null), L(!1), re.current = null, await W();
2382
2145
  },
2383
- [se, P]
2384
- ), de = !!W;
2385
- return O ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Me, {}) }) : G ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: G, onBack: $ }) }) : !B || !T ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
2386
- Ie,
2146
+ [W, S]
2147
+ ), K = !!$;
2148
+ return H ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : R ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: R, onBack: z }) }) : !F || !_ ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
2149
+ he,
2387
2150
  {
2388
2151
  message: "Not connected to messaging service",
2389
- onBack: $
2152
+ onBack: z
2390
2153
  }
2391
- ) }) : xe ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: xe }) }) : /* @__PURE__ */ d(
2154
+ ) }) : j ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
2392
2155
  "div",
2393
2156
  {
2394
- className: A(
2157
+ className: D(
2395
2158
  "messaging-shell h-full bg-background-primary overflow-hidden",
2396
2159
  s
2397
2160
  ),
2398
- children: [
2399
- /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
2400
- /* @__PURE__ */ e(
2401
- "div",
2402
- {
2403
- className: A(
2404
- "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2405
- {
2406
- "!hidden": u === !1 || q,
2407
- // Hide on mobile when channel selected, show on desktop with consistent wide width
2408
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !q && de,
2409
- // Show on mobile when no channel selected, use same wide width on desktop
2410
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !q && !de
2411
- }
2412
- ),
2413
- children: /* @__PURE__ */ e(
2414
- _t,
2415
- {
2416
- onChannelSelect: we,
2417
- selectedChannel: W || void 0,
2418
- filters: ve,
2419
- channelRenderFilterFn: f,
2420
- customEmptyStateIndicator: v,
2421
- renderMessagePreview: F
2422
- }
2423
- )
2424
- }
2425
- ),
2426
- /* @__PURE__ */ e(
2427
- "div",
2428
- {
2429
- className: A(
2430
- "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2431
- {
2432
- // In direct conversation mode (or waiting for it), always show (full width)
2433
- flex: q || de || i,
2434
- // Normal mode: hide on mobile when no channel selected
2435
- "hidden lg:flex": !q && !de && !i
2436
- }
2437
- ),
2438
- children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2439
- Mt,
2440
- {
2441
- channel: W,
2442
- onBack: ye,
2443
- showBackButton: !q,
2444
- renderMessageInputActions: n,
2445
- renderConversationFooter: r,
2446
- renderChannelBanner: N,
2447
- onLeaveConversation: _e,
2448
- onBlockParticipant: Ee,
2449
- CustomChannelEmptyState: h,
2450
- showDeleteConversation: ge,
2451
- onDeleteConversationClick: a,
2452
- onBlockParticipantClick: C,
2453
- onReportParticipantClick: g,
2454
- dmAgentEnabled: y,
2455
- messageMetadata: p,
2456
- onMessageSent: S,
2457
- showStarButton: w,
2458
- chatbotVotingEnabled: E,
2459
- customProfileContent: b,
2460
- customChannelActions: k,
2461
- renderMessage: R,
2462
- sendButton: I
2463
- },
2464
- W.id
2465
- ) }) : i ? (
2466
- // Show loading while creating/loading direct conversation channel
2467
- /* @__PURE__ */ e(Me, {})
2468
- ) : /* @__PURE__ */ e(
2469
- Tt,
2470
- {
2471
- hasChannels: ae,
2472
- channelsLoaded: x
2473
- }
2474
- )
2475
- }
2476
- )
2477
- ] }),
2478
- oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2161
+ children: /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
2479
2162
  /* @__PURE__ */ e(
2480
- "dialog",
2163
+ "div",
2481
2164
  {
2482
- ref: me,
2483
- className: "mes-dialog",
2484
- onClick: Ce,
2485
- onClose: ce,
2486
- children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2487
- $n,
2165
+ className: D(
2166
+ "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2488
2167
  {
2489
- participantSource: oe,
2490
- onSelectParticipant: Ne,
2491
- onClose: ce,
2492
- existingParticipantIds: ee,
2493
- participantLabel: pe,
2494
- searchPlaceholder: `Search ${pe}...`
2168
+ "!hidden": m === !1 || p,
2169
+ // Hide on mobile when channel selected, show on desktop with consistent wide width
2170
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p && K,
2171
+ // Show on mobile when no channel selected, use same wide width on desktop
2172
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !K
2173
+ }
2174
+ ),
2175
+ children: /* @__PURE__ */ e(
2176
+ wt,
2177
+ {
2178
+ onChannelSelect: ie,
2179
+ selectedChannel: $ || void 0,
2180
+ filters: de,
2181
+ channelRenderFilterFn: h,
2182
+ customEmptyStateIndicator: f,
2183
+ renderMessagePreview: E
2184
+ }
2185
+ )
2186
+ }
2187
+ ),
2188
+ /* @__PURE__ */ e(
2189
+ "div",
2190
+ {
2191
+ className: D(
2192
+ "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2193
+ {
2194
+ // In direct conversation mode (or waiting for it), always show (full width)
2195
+ flex: p || K || l,
2196
+ // Normal mode: hide on mobile when no channel selected
2197
+ "hidden lg:flex": !p && !K && !l
2198
+ }
2199
+ ),
2200
+ children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2201
+ Nt,
2202
+ {
2203
+ channel: $,
2204
+ onBack: pe,
2205
+ showBackButton: !p,
2206
+ renderMessageInputActions: n,
2207
+ renderConversationFooter: r,
2208
+ renderChannelBanner: P,
2209
+ onLeaveConversation: ue,
2210
+ onBlockParticipant: xe,
2211
+ CustomChannelEmptyState: c,
2212
+ showDeleteConversation: ae,
2213
+ onDeleteConversationClick: v,
2214
+ onBlockParticipantClick: a,
2215
+ onReportParticipantClick: N,
2216
+ dmAgentEnabled: b,
2217
+ messageMetadata: C,
2218
+ onMessageSent: x,
2219
+ showStarButton: I,
2220
+ chatbotVotingEnabled: w,
2221
+ customProfileContent: U,
2222
+ customChannelActions: k,
2223
+ renderMessage: T,
2224
+ sendButton: M
2495
2225
  },
2496
- be
2497
- ) })
2226
+ $.id
2227
+ ) }) : l ? (
2228
+ // Show loading while creating/loading direct conversation channel
2229
+ /* @__PURE__ */ e(fe, {})
2230
+ ) : /* @__PURE__ */ e(
2231
+ Ct,
2232
+ {
2233
+ hasChannels: ee,
2234
+ channelsLoaded: q
2235
+ }
2236
+ )
2498
2237
  }
2499
2238
  )
2500
- ]
2239
+ ] })
2501
2240
  }
2502
2241
  );
2503
- }, jn = ({
2242
+ }, Ln = ({
2504
2243
  question: t,
2505
2244
  onClick: s,
2506
2245
  loading: n = !1,
@@ -2512,7 +2251,7 @@ const ga = ({
2512
2251
  onClick: s,
2513
2252
  disabled: n,
2514
2253
  style: { backgroundColor: "#E6E5E3" },
2515
- className: A(
2254
+ className: D(
2516
2255
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
2517
2256
  {
2518
2257
  "hover:brightness-95 active:brightness-90": !n,
@@ -2522,7 +2261,7 @@ const ga = ({
2522
2261
  ),
2523
2262
  children: t
2524
2263
  }
2525
- ), ba = ({
2264
+ ), la = ({
2526
2265
  faqs: t,
2527
2266
  onFaqClick: s,
2528
2267
  loadingFaqId: n,
@@ -2531,7 +2270,7 @@ const ga = ({
2531
2270
  avatarImage: l,
2532
2271
  avatarName: i
2533
2272
  }) => {
2534
- const c = t.filter((h) => h.enabled).sort((h, u) => (h.order ?? 0) - (u.order ?? 0));
2273
+ const c = t.filter((m) => m.enabled).sort((m, u) => (m.order ?? 0) - (u.order ?? 0));
2535
2274
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ d("div", { className: "flex gap-3 items-end", children: [
2536
2275
  (l || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2537
2276
  ne,
@@ -2550,20 +2289,20 @@ const ga = ({
2550
2289
  style: { backgroundColor: "#F1F0EE" },
2551
2290
  children: [
2552
2291
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2553
- c.map((h) => /* @__PURE__ */ e(
2554
- jn,
2292
+ c.map((m) => /* @__PURE__ */ e(
2293
+ Ln,
2555
2294
  {
2556
- question: h.question,
2557
- onClick: () => s(h.id),
2558
- loading: n === h.id
2295
+ question: m.question,
2296
+ onClick: () => s(m.id),
2297
+ loading: n === m.id
2559
2298
  },
2560
- h.id
2299
+ m.id
2561
2300
  ))
2562
2301
  ]
2563
2302
  }
2564
2303
  )
2565
2304
  ] }) });
2566
- }, Bn = [
2305
+ }, An = [
2567
2306
  [/pdf/, "pdf"],
2568
2307
  [/wordprocessingml|msword|\.doc/, "doc"],
2569
2308
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -2573,42 +2312,42 @@ const ga = ({
2573
2312
  [/plain|rtf/, "text"],
2574
2313
  [/markdown/, "markdown"]
2575
2314
  ];
2576
- function Re(t) {
2315
+ function be(t) {
2577
2316
  return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
2578
2317
  }
2579
- function Gn(t) {
2580
- const s = Bn.find(
2318
+ function Fn(t) {
2319
+ const s = An.find(
2581
2320
  ([n]) => n.test(t)
2582
2321
  );
2583
2322
  return s ? s[1] : "generic";
2584
2323
  }
2585
- const Vn = {
2586
- video: Is,
2587
- audio: Ss,
2588
- image: ks,
2589
- document: xt
2590
- }, Hn = {
2591
- pdf: Fs,
2592
- doc: As,
2593
- xls: Ps,
2594
- csv: Ls,
2595
- ppt: Rs,
2596
- zip: Ds,
2597
- text: Ts,
2598
- markdown: Ms,
2599
- generic: xt
2324
+ const On = {
2325
+ video: ys,
2326
+ audio: _s,
2327
+ image: ws,
2328
+ document: ht
2329
+ }, Pn = {
2330
+ pdf: Ts,
2331
+ doc: Ms,
2332
+ xls: ks,
2333
+ csv: Is,
2334
+ ppt: Ss,
2335
+ zip: Es,
2336
+ text: Cs,
2337
+ markdown: Ns,
2338
+ generic: ht
2600
2339
  };
2601
- function Yn(t) {
2602
- const s = Re(t);
2603
- return s !== "document" ? Vn[s] : Hn[Gn(t)];
2340
+ function Un(t) {
2341
+ const s = be(t);
2342
+ return s !== "document" ? On[s] : Pn[Fn(t)];
2604
2343
  }
2605
- function Te(t, s) {
2606
- return z.createElement(Yn(t), s);
2344
+ function ge(t, s) {
2345
+ return O.createElement(Un(t), s);
2607
2346
  }
2608
- const Wn = (t) => {
2347
+ const zn = (t) => {
2609
2348
  var s, n;
2610
2349
  return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
2611
- }, qn = ({
2350
+ }, Bn = ({
2612
2351
  source: t,
2613
2352
  mimeType: s,
2614
2353
  poster: n,
@@ -2617,81 +2356,81 @@ const Wn = (t) => {
2617
2356
  loop: l = !1,
2618
2357
  controls: i = !0,
2619
2358
  showProgress: c = !1,
2620
- muted: h = !1,
2359
+ muted: m = !1,
2621
2360
  onContainerClick: u
2622
2361
  }) => {
2623
- const m = Re(s), f = Q(null), v = Q(null), a = Q(null), C = Q(o), [g, y] = M(r), [p, S] = M(0), [w, E] = M(!1), [F, N] = M(!1), [b, k] = M(!1), [R, I] = M(!1), [L, T] = M(!0), [B, O] = M(null), G = U(() => {
2624
- k(!1), y(!0);
2625
- }, []), $ = U((x) => {
2626
- const _ = v.current;
2627
- if (!_) return 0;
2628
- const j = _.getBoundingClientRect();
2362
+ const h = be(s), f = J(null), v = J(null), a = J(null), N = J(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, y] = A(!1), [_, F] = A(!0), [H, R] = A(null), z = G(() => {
2363
+ T(!1), C(!0);
2364
+ }, []), S = G((g) => {
2365
+ const p = v.current;
2366
+ if (!p) return 0;
2367
+ const L = p.getBoundingClientRect();
2629
2368
  return Math.max(
2630
2369
  0,
2631
- Math.min(1, (Wn(x) - j.left) / j.width)
2370
+ Math.min(1, (zn(g) - L.left) / L.width)
2632
2371
  );
2633
- }, []), P = U((x) => {
2634
- const _ = f.current;
2635
- _ && _.duration && (_.currentTime = x * _.duration);
2636
- }, []), W = (x) => {
2637
- x.stopPropagation(), E(!0);
2638
- const _ = $(x);
2639
- S(_), P(_);
2372
+ }, []), $ = G((g) => {
2373
+ const p = f.current;
2374
+ p && p.duration && (p.currentTime = g * p.duration);
2375
+ }, []), V = (g) => {
2376
+ g.stopPropagation(), E(!0);
2377
+ const p = S(g);
2378
+ I(p), $(p);
2640
2379
  };
2641
- K(() => {
2642
- o !== void 0 && o !== C.current && (C.current = o, y(o));
2643
- }, [o]), K(() => {
2644
- if (!g) {
2380
+ Z(() => {
2381
+ o !== void 0 && o !== N.current && (N.current = o, C(o));
2382
+ }, [o]), Z(() => {
2383
+ if (!b) {
2645
2384
  a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
2646
2385
  return;
2647
2386
  }
2648
- const x = () => {
2649
- const _ = f.current;
2650
- _ && _.duration && !w && S(_.currentTime / _.duration), a.current = requestAnimationFrame(x);
2387
+ const g = () => {
2388
+ const p = f.current;
2389
+ p && p.duration && !w && I(p.currentTime / p.duration), a.current = requestAnimationFrame(g);
2651
2390
  };
2652
- return a.current = requestAnimationFrame(x), () => {
2391
+ return a.current = requestAnimationFrame(g), () => {
2653
2392
  a.current !== null && cancelAnimationFrame(a.current);
2654
2393
  };
2655
- }, [g, w]), K(() => {
2656
- const x = f.current;
2657
- x && (g ? x.play().catch((_) => {
2658
- y(!1), k(!0);
2659
- }) : x.pause());
2660
- }, [g]), K(() => {
2394
+ }, [b, w]), Z(() => {
2395
+ const g = f.current;
2396
+ g && (b ? g.play().catch((p) => {
2397
+ C(!1), T(!0);
2398
+ }) : g.pause());
2399
+ }, [b]), Z(() => {
2661
2400
  if (!w) return;
2662
- const x = (j) => S($(j)), _ = (j) => {
2663
- E(!1), P($(j));
2401
+ const g = (L) => I(S(L)), p = (L) => {
2402
+ E(!1), $(S(L));
2664
2403
  };
2665
- return window.addEventListener("mousemove", x), window.addEventListener("mouseup", _), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", _), () => {
2666
- window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", _), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", _);
2404
+ return window.addEventListener("mousemove", g), window.addEventListener("mouseup", p), window.addEventListener("touchmove", g, { passive: !0 }), window.addEventListener("touchend", p), () => {
2405
+ window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", p), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", p);
2667
2406
  };
2668
- }, [w, $, P]);
2669
- const Z = B ? { aspectRatio: String(B) } : void 0, ae = B ? "" : " aspect-video", J = Math.round(p * 100);
2407
+ }, [w, S, $]);
2408
+ const ee = H ? { aspectRatio: String(H) } : void 0, te = H ? "" : " aspect-video", q = Math.round(x * 100);
2670
2409
  return /* @__PURE__ */ d(
2671
2410
  "div",
2672
2411
  {
2673
2412
  role: "button",
2674
2413
  tabIndex: 0,
2675
- className: `relative cursor-pointer overflow-hidden bg-black ${ae}`,
2676
- style: Z,
2677
- onClick: (x) => {
2414
+ className: `relative cursor-pointer overflow-hidden bg-black ${te}`,
2415
+ style: ee,
2416
+ onClick: (g) => {
2678
2417
  if (u) {
2679
- u(x);
2418
+ u(g);
2680
2419
  return;
2681
2420
  }
2682
- b || i && y((_) => !_);
2421
+ k || i && C((p) => !p);
2683
2422
  },
2684
- onKeyDown: (x) => {
2685
- if (!(x.key !== "Enter" && x.key !== " ")) {
2686
- if (x.preventDefault(), u) {
2687
- u(x);
2423
+ onKeyDown: (g) => {
2424
+ if (!(g.key !== "Enter" && g.key !== " ")) {
2425
+ if (g.preventDefault(), u) {
2426
+ u(g);
2688
2427
  return;
2689
2428
  }
2690
- b || i && y((_) => !_);
2429
+ k || i && C((p) => !p);
2691
2430
  }
2692
2431
  },
2693
2432
  children: [
2694
- n && (m === "audio" || L) && /* @__PURE__ */ e(
2433
+ n && (h === "audio" || _) && /* @__PURE__ */ e(
2695
2434
  "img",
2696
2435
  {
2697
2436
  src: n,
@@ -2699,26 +2438,26 @@ const Wn = (t) => {
2699
2438
  className: "absolute inset-0 h-full w-full object-cover"
2700
2439
  }
2701
2440
  ),
2702
- !n && (m === "audio" || L) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: Te(s, {
2441
+ !n && (h === "audio" || _) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(s, {
2703
2442
  className: "size-12 text-black/20",
2704
2443
  weight: "regular"
2705
2444
  }) }),
2706
- /* @__PURE__ */ e("div", { className: "absolute inset-0", children: m === "audio" ? /* @__PURE__ */ e(
2445
+ /* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
2707
2446
  "audio",
2708
2447
  {
2709
2448
  ref: f,
2710
2449
  src: t,
2711
2450
  loop: l,
2712
- muted: h,
2451
+ muted: m,
2713
2452
  style: { width: "100%", height: "100%" },
2714
- onLoadStart: () => I(!0),
2453
+ onLoadStart: () => y(!0),
2715
2454
  onCanPlay: () => {
2716
- I(!1), T(!1);
2455
+ y(!1), F(!1);
2717
2456
  },
2718
- onWaiting: () => I(!0),
2719
- onPlay: () => k(!1),
2457
+ onWaiting: () => y(!0),
2458
+ onPlay: () => T(!1),
2720
2459
  onEnded: () => {
2721
- l || (y(!1), S(0));
2460
+ l || (C(!1), I(0));
2722
2461
  },
2723
2462
  children: /* @__PURE__ */ e("track", { kind: "captions" })
2724
2463
  }
@@ -2728,46 +2467,46 @@ const Wn = (t) => {
2728
2467
  ref: f,
2729
2468
  src: t,
2730
2469
  loop: l,
2731
- muted: h,
2470
+ muted: m,
2732
2471
  playsInline: !0,
2733
2472
  style: { width: "100%", height: "100%" },
2734
- onLoadStart: () => I(!0),
2473
+ onLoadStart: () => y(!0),
2735
2474
  onCanPlay: () => {
2736
- I(!1), T(!1);
2475
+ y(!1), F(!1);
2737
2476
  },
2738
- onWaiting: () => I(!0),
2739
- onPlay: () => k(!1),
2477
+ onWaiting: () => y(!0),
2478
+ onPlay: () => T(!1),
2740
2479
  onLoadedMetadata: () => {
2741
- const x = f.current;
2742
- x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && O(x.videoWidth / x.videoHeight);
2480
+ const g = f.current;
2481
+ g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && R(g.videoWidth / g.videoHeight);
2743
2482
  },
2744
2483
  onEnded: () => {
2745
- l || (y(!1), S(0));
2484
+ l || (C(!1), I(0));
2746
2485
  },
2747
2486
  children: /* @__PURE__ */ e("track", { kind: "captions" })
2748
2487
  }
2749
2488
  ) }),
2750
- R && !b && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
2751
- pt,
2489
+ M && !k && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
2490
+ ft,
2752
2491
  {
2753
2492
  className: "size-8 animate-spin text-white/80",
2754
2493
  weight: "bold"
2755
2494
  }
2756
2495
  ) }),
2757
- b && !i && /* @__PURE__ */ e(
2496
+ k && !i && /* @__PURE__ */ e(
2758
2497
  "div",
2759
2498
  {
2760
2499
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
2761
2500
  role: "button",
2762
2501
  tabIndex: 0,
2763
2502
  "aria-label": "Play preview",
2764
- onClick: (x) => {
2765
- x.stopPropagation(), G();
2503
+ onClick: (g) => {
2504
+ g.stopPropagation(), z();
2766
2505
  },
2767
- onKeyDown: (x) => {
2768
- x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), G());
2506
+ onKeyDown: (g) => {
2507
+ g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), z());
2769
2508
  },
2770
- children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(rt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
2509
+ children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
2771
2510
  }
2772
2511
  ),
2773
2512
  c && !i && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ e(
@@ -2775,23 +2514,23 @@ const Wn = (t) => {
2775
2514
  {
2776
2515
  role: "slider",
2777
2516
  "aria-label": "Playback position",
2778
- "aria-valuenow": J,
2517
+ "aria-valuenow": q,
2779
2518
  "aria-valuemin": 0,
2780
2519
  "aria-valuemax": 100,
2781
2520
  tabIndex: 0,
2782
2521
  ref: v,
2783
2522
  className: "relative flex h-4 w-full cursor-pointer items-center",
2784
- onMouseDown: W,
2785
- onTouchStart: W,
2786
- onClick: (x) => x.stopPropagation(),
2787
- onKeyDown: (x) => {
2788
- x.key === "ArrowRight" && P(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, p - 0.05));
2523
+ onMouseDown: V,
2524
+ onTouchStart: V,
2525
+ onClick: (g) => g.stopPropagation(),
2526
+ onKeyDown: (g) => {
2527
+ g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
2789
2528
  },
2790
2529
  children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
2791
2530
  "div",
2792
2531
  {
2793
2532
  className: "h-full rounded-full bg-white",
2794
- style: { width: `${J}%` }
2533
+ style: { width: `${q}%` }
2795
2534
  }
2796
2535
  ) })
2797
2536
  }
@@ -2801,12 +2540,12 @@ const Wn = (t) => {
2801
2540
  "button",
2802
2541
  {
2803
2542
  type: "button",
2804
- onClick: (x) => {
2805
- x.stopPropagation(), y((_) => !_);
2543
+ onClick: (g) => {
2544
+ g.stopPropagation(), C((p) => !p);
2806
2545
  },
2807
2546
  className: "shrink-0 text-white",
2808
- "aria-label": g ? "Pause" : "Play",
2809
- children: g ? /* @__PURE__ */ e(Os, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(rt, { className: "size-5 translate-x-px", weight: "fill" })
2547
+ "aria-label": b ? "Pause" : "Play",
2548
+ children: b ? /* @__PURE__ */ e(Ds, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
2810
2549
  }
2811
2550
  ),
2812
2551
  /* @__PURE__ */ d(
@@ -2814,30 +2553,30 @@ const Wn = (t) => {
2814
2553
  {
2815
2554
  role: "slider",
2816
2555
  "aria-label": "Playback position",
2817
- "aria-valuenow": J,
2556
+ "aria-valuenow": q,
2818
2557
  "aria-valuemin": 0,
2819
2558
  "aria-valuemax": 100,
2820
2559
  tabIndex: 0,
2821
2560
  ref: v,
2822
2561
  className: "relative flex h-4 w-full cursor-pointer items-center",
2823
- onMouseDown: W,
2824
- onTouchStart: W,
2825
- onClick: (x) => x.stopPropagation(),
2826
- onMouseEnter: () => N(!0),
2827
- onMouseLeave: () => N(!1),
2828
- onKeyDown: (x) => {
2829
- x.key === "ArrowRight" && P(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, p - 0.05));
2562
+ onMouseDown: V,
2563
+ onTouchStart: V,
2564
+ onClick: (g) => g.stopPropagation(),
2565
+ onMouseEnter: () => U(!0),
2566
+ onMouseLeave: () => U(!1),
2567
+ onKeyDown: (g) => {
2568
+ g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
2830
2569
  },
2831
2570
  children: [
2832
2571
  /* @__PURE__ */ e(
2833
2572
  "div",
2834
2573
  {
2835
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${F || w ? "h-1.5" : "h-1"}`,
2574
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || w ? "h-1.5" : "h-1"}`,
2836
2575
  children: /* @__PURE__ */ e(
2837
2576
  "div",
2838
2577
  {
2839
2578
  className: "h-full rounded-full bg-white",
2840
- style: { width: `${J}%` }
2579
+ style: { width: `${q}%` }
2841
2580
  }
2842
2581
  )
2843
2582
  }
@@ -2845,8 +2584,8 @@ const Wn = (t) => {
2845
2584
  /* @__PURE__ */ e(
2846
2585
  "div",
2847
2586
  {
2848
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${F || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2849
- style: { left: `${J}%` }
2587
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2588
+ style: { left: `${q}%` }
2850
2589
  }
2851
2590
  )
2852
2591
  ]
@@ -2856,7 +2595,7 @@ const Wn = (t) => {
2856
2595
  ]
2857
2596
  }
2858
2597
  );
2859
- }, ut = (t) => t === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Xn = (t) => t === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Dt = ({
2598
+ }, it = (t) => t === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", $n = (t) => t === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Et = ({
2860
2599
  mimeType: t,
2861
2600
  sourceUrl: s,
2862
2601
  thumbnailUrl: n,
@@ -2865,9 +2604,9 @@ const Wn = (t) => {
2865
2604
  mediaPlayerProps: l,
2866
2605
  containedImage: i = !1
2867
2606
  }) => {
2868
- const c = Re(t), [h, u] = M(!1);
2607
+ const c = be(t), [m, u] = A(!1);
2869
2608
  return s && (c === "video" || c === "audio") ? /* @__PURE__ */ e(
2870
- qn,
2609
+ Bn,
2871
2610
  {
2872
2611
  source: s,
2873
2612
  mimeType: t,
@@ -2880,7 +2619,7 @@ const Wn = (t) => {
2880
2619
  {
2881
2620
  src: s,
2882
2621
  alt: r ?? "",
2883
- className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${h ? "opacity-100" : "opacity-0"}`,
2622
+ className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
2884
2623
  draggable: !1,
2885
2624
  onLoad: () => u(!0)
2886
2625
  }
@@ -2897,7 +2636,7 @@ const Wn = (t) => {
2897
2636
  {
2898
2637
  src: n,
2899
2638
  alt: r ?? "",
2900
- className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${h ? "opacity-100" : "opacity-0"}`,
2639
+ className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
2901
2640
  draggable: !1,
2902
2641
  onLoad: () => u(!0)
2903
2642
  }
@@ -2913,12 +2652,12 @@ const Wn = (t) => {
2913
2652
  "div",
2914
2653
  {
2915
2654
  className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
2916
- children: Te(t, {
2917
- className: ut(o),
2655
+ children: ge(t, {
2656
+ className: it(o),
2918
2657
  weight: "regular"
2919
2658
  })
2920
2659
  }
2921
- ) : n ? /* @__PURE__ */ e("div", { className: `relative ${Xn(o)}`, children: /* @__PURE__ */ e(
2660
+ ) : n ? /* @__PURE__ */ e("div", { className: `relative ${$n(o)}`, children: /* @__PURE__ */ e(
2922
2661
  "img",
2923
2662
  {
2924
2663
  src: n,
@@ -2930,13 +2669,13 @@ const Wn = (t) => {
2930
2669
  "div",
2931
2670
  {
2932
2671
  className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
2933
- children: Te(t, {
2934
- className: ut(o),
2672
+ children: ge(t, {
2673
+ className: it(o),
2935
2674
  weight: "regular"
2936
2675
  })
2937
2676
  }
2938
2677
  );
2939
- }, Rt = ({
2678
+ }, St = ({
2940
2679
  variant: t,
2941
2680
  thumbnail: s,
2942
2681
  title: n,
@@ -2945,40 +2684,40 @@ const Wn = (t) => {
2945
2684
  detail: l,
2946
2685
  statusBadge: i,
2947
2686
  action: c,
2948
- topLeft: h,
2687
+ topLeft: m,
2949
2688
  topRight: u,
2950
- rootRef: m,
2689
+ rootRef: h,
2951
2690
  "data-testid": f
2952
2691
  }) => {
2953
- const v = t === "dark", a = v ? n ?? r : n ?? "", C = v && !n;
2692
+ const v = t === "dark", a = v ? n ?? r : n ?? "", N = v && !n;
2954
2693
  return /* @__PURE__ */ d(
2955
2694
  "div",
2956
2695
  {
2957
- ref: m,
2696
+ ref: h,
2958
2697
  "data-testid": f,
2959
- className: A(
2698
+ className: D(
2960
2699
  "relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
2961
2700
  v ? "bg-[#121110]" : "bg-white"
2962
2701
  ),
2963
2702
  children: [
2964
- h ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: h }) : null,
2703
+ m ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: m }) : null,
2965
2704
  u ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
2966
2705
  s,
2967
2706
  /* @__PURE__ */ d("div", { className: "px-4 pb-3 pt-3", children: [
2968
2707
  a.trim() !== "" && /* @__PURE__ */ e(
2969
2708
  "p",
2970
2709
  {
2971
- className: A("mb-0.5 truncate text-base font-medium", {
2710
+ className: D("mb-0.5 truncate text-base font-medium", {
2972
2711
  "text-black": !v,
2973
- "text-white/30": v && C,
2974
- "text-white": v && !C
2712
+ "text-white/30": v && N,
2713
+ "text-white": v && !N
2975
2714
  }),
2976
2715
  children: a
2977
2716
  }
2978
2717
  ),
2979
2718
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
2980
- Te(o, {
2981
- className: A(
2719
+ ge(o, {
2720
+ className: D(
2982
2721
  "size-5 shrink-0",
2983
2722
  v ? "text-white/55" : "text-black/55"
2984
2723
  ),
@@ -2987,7 +2726,7 @@ const Wn = (t) => {
2987
2726
  l != null && l !== "" && /* @__PURE__ */ e(
2988
2727
  "span",
2989
2728
  {
2990
- className: A(
2729
+ className: D(
2991
2730
  "text-xs font-medium",
2992
2731
  v ? "text-white/55" : "text-black/55"
2993
2732
  ),
@@ -3002,29 +2741,29 @@ const Wn = (t) => {
3002
2741
  }
3003
2742
  );
3004
2743
  };
3005
- function Lt(t) {
2744
+ function It(t) {
3006
2745
  return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
3007
2746
  }
3008
- function qe(t) {
2747
+ function Re(t) {
3009
2748
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
3010
2749
  }
3011
- function Zn(t) {
2750
+ function jn(t) {
3012
2751
  return t ? "bg-white/10" : "bg-black/5";
3013
2752
  }
3014
- function Kn(t) {
2753
+ function Gn(t) {
3015
2754
  return t ? "text-white" : "text-black";
3016
2755
  }
3017
- function Jn(t) {
2756
+ function Vn(t) {
3018
2757
  return t ? "text-white/55" : "text-black/55";
3019
2758
  }
3020
- function Qn(t) {
2759
+ function Hn(t) {
3021
2760
  return t ? "text-white/40" : "text-black/40";
3022
2761
  }
3023
- function ea(t) {
2762
+ function Yn(t) {
3024
2763
  return t ? "text-white/20" : "text-black/20";
3025
2764
  }
3026
- const Xe = ({ attachment: t, isMyMessage: s }) => {
3027
- const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i, h = typeof c == "string" && c.trim() !== "" ? c : void 0, u = /* @__PURE__ */ d(z.Fragment, { children: [
2765
+ const Le = ({ attachment: t, isMyMessage: s }) => {
2766
+ const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i, m = typeof c == "string" && c.trim() !== "" ? c : void 0, u = /* @__PURE__ */ d(O.Fragment, { children: [
3028
2767
  /* @__PURE__ */ e("div", { className: "p-2", children: o ? /* @__PURE__ */ e(
3029
2768
  "img",
3030
2769
  {
@@ -3035,25 +2774,25 @@ const Xe = ({ attachment: t, isMyMessage: s }) => {
3035
2774
  ) : /* @__PURE__ */ e(
3036
2775
  "div",
3037
2776
  {
3038
- className: `aspect-video w-full rounded-[20px] ${Zn(s)} flex items-center justify-center`,
3039
- children: /* @__PURE__ */ e(Us, { className: `size-12 ${ea(s)}` })
2777
+ className: `aspect-video w-full rounded-[20px] ${jn(s)} flex items-center justify-center`,
2778
+ children: /* @__PURE__ */ e(Rs, { className: `size-12 ${Yn(s)}` })
3040
2779
  }
3041
2780
  ) }),
3042
2781
  /* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
3043
- n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Kn(s)}`, children: n }),
3044
- r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${Jn(s)}`, children: r }),
3045
- h && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Qn(s)}`, children: h })
2782
+ n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Gn(s)}`, children: n }),
2783
+ r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${Vn(s)}`, children: r }),
2784
+ m && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Hn(s)}`, children: m })
3046
2785
  ] })
3047
2786
  ] });
3048
- return h ? /* @__PURE__ */ e("a", { href: h, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ e("div", { className: "block", children: u });
2787
+ return m ? /* @__PURE__ */ e("a", { href: m, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ e("div", { className: "block", children: u });
3049
2788
  };
3050
- function Ze(t) {
2789
+ function Ae(t) {
3051
2790
  var s;
3052
2791
  return (s = t.attachments) == null ? void 0 : s.find(
3053
2792
  (n) => n.type === "link" || !!n.og_scrape_url && !n.asset_url
3054
2793
  );
3055
2794
  }
3056
- async function ta(t, s) {
2795
+ async function qn(t, s) {
3057
2796
  let n;
3058
2797
  try {
3059
2798
  n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
@@ -3065,11 +2804,11 @@ async function ta(t, s) {
3065
2804
  const o = await r.blob(), l = URL.createObjectURL(o), i = document.createElement("a");
3066
2805
  i.href = l, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(l);
3067
2806
  }
3068
- const sa = ({
2807
+ const Wn = ({
3069
2808
  url: t,
3070
2809
  filename: s
3071
2810
  }) => {
3072
- const [n, r] = M(!1);
2811
+ const [n, r] = A(!1);
3073
2812
  return /* @__PURE__ */ e(
3074
2813
  "button",
3075
2814
  {
@@ -3077,7 +2816,7 @@ const sa = ({
3077
2816
  onClick: (l) => {
3078
2817
  l.stopPropagation();
3079
2818
  const i = window.open("", "_blank", "noopener,noreferrer");
3080
- r(!0), ta(t, s).then(() => {
2819
+ r(!0), qn(t, s).then(() => {
3081
2820
  i == null || i.close();
3082
2821
  }).catch(() => {
3083
2822
  i && (i.location.href = t);
@@ -3085,44 +2824,44 @@ const sa = ({
3085
2824
  },
3086
2825
  disabled: n,
3087
2826
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
3088
- children: n ? /* @__PURE__ */ e(pt, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(z.Fragment, { children: [
3089
- /* @__PURE__ */ e($s, { className: "size-4 text-white", weight: "bold" }),
2827
+ children: n ? /* @__PURE__ */ e(ft, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
2828
+ /* @__PURE__ */ e(Ls, { className: "size-4 text-white", weight: "bold" }),
3090
2829
  "Download"
3091
2830
  ] })
3092
2831
  }
3093
2832
  );
3094
2833
  };
3095
- function Ke(t) {
3096
- var f, v, a, C;
2834
+ function Fe(t) {
2835
+ var f, v, a, N;
3097
2836
  const s = (f = t.attachments) == null ? void 0 : f.find(
3098
- (g) => g.type === "video" && g.asset_url
2837
+ (b) => b.type === "video" && b.asset_url
3099
2838
  ), n = (v = t.attachments) == null ? void 0 : v.find(
3100
- (g) => g.type === "image" && g.image_url
2839
+ (b) => b.type === "image" && b.image_url
3101
2840
  ), r = (a = t.attachments) == null ? void 0 : a.find(
3102
- (g) => g.type === "audio" && g.asset_url
3103
- ), o = (C = t.attachments) == null ? void 0 : C.find(
3104
- (g) => g.type === "file" && g.asset_url
2841
+ (b) => b.type === "audio" && b.asset_url
2842
+ ), o = (N = t.attachments) == null ? void 0 : N.find(
2843
+ (b) => b.type === "file" && b.asset_url
3105
2844
  ), l = s ?? n ?? r ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (r == null ? void 0 : r.asset_url) ?? (o == null ? void 0 : o.asset_url);
3106
2845
  if (!i) return null;
3107
- const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), h = l == null ? void 0 : l.title, u = l == null ? void 0 : l.file_size, m = s == null ? void 0 : s.thumb_url;
2846
+ const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), m = l == null ? void 0 : l.title, u = l == null ? void 0 : l.file_size, h = s == null ? void 0 : s.thumb_url;
3108
2847
  return {
3109
2848
  resolvedUrl: i,
3110
2849
  resolvedType: c,
3111
- title: h,
2850
+ title: m,
3112
2851
  fileSize: u,
3113
- thumbnailUrl: m
2852
+ thumbnailUrl: h
3114
2853
  };
3115
2854
  }
3116
- const Pt = ({
2855
+ const kt = ({
3117
2856
  resolvedUrl: t,
3118
2857
  resolvedType: s,
3119
2858
  title: n,
3120
2859
  fileSize: r,
3121
2860
  thumbnailUrl: o
3122
2861
  }) => {
3123
- const l = r !== void 0 ? Lt(r) : void 0;
2862
+ const l = r !== void 0 ? It(r) : void 0;
3124
2863
  return /* @__PURE__ */ e(
3125
- Rt,
2864
+ St,
3126
2865
  {
3127
2866
  variant: "dark",
3128
2867
  title: n,
@@ -3130,7 +2869,7 @@ const Pt = ({
3130
2869
  mimeType: s,
3131
2870
  detail: l,
3132
2871
  thumbnail: /* @__PURE__ */ e(
3133
- Dt,
2872
+ Et,
3134
2873
  {
3135
2874
  mimeType: s,
3136
2875
  sourceUrl: t,
@@ -3141,23 +2880,23 @@ const Pt = ({
3141
2880
  )
3142
2881
  }
3143
2882
  );
3144
- }, At = ({
2883
+ }, Mt = ({
3145
2884
  resolvedUrl: t,
3146
2885
  resolvedType: s,
3147
2886
  title: n,
3148
2887
  fileSize: r,
3149
2888
  thumbnailUrl: o
3150
2889
  }) => {
3151
- const l = Re(s), i = r !== void 0 ? Lt(r) : void 0;
2890
+ const l = be(s), i = r !== void 0 ? It(r) : void 0;
3152
2891
  return /* @__PURE__ */ e(
3153
- Rt,
2892
+ St,
3154
2893
  {
3155
2894
  variant: "light",
3156
2895
  title: n,
3157
2896
  mimeType: s,
3158
2897
  detail: i,
3159
2898
  thumbnail: /* @__PURE__ */ e(
3160
- Dt,
2899
+ Et,
3161
2900
  {
3162
2901
  mimeType: s,
3163
2902
  sourceUrl: t,
@@ -3167,14 +2906,14 @@ const Pt = ({
3167
2906
  containedImage: l === "image" || l === "document"
3168
2907
  }
3169
2908
  ),
3170
- action: /* @__PURE__ */ e(sa, { url: t, filename: n })
2909
+ action: /* @__PURE__ */ e(Wn, { url: t, filename: n })
3171
2910
  }
3172
2911
  );
3173
- }, na = ({
2912
+ }, Xn = ({
3174
2913
  message: t,
3175
2914
  isMyMessage: s = !1
3176
2915
  }) => {
3177
- const n = Ze(t), r = Ke(t);
2916
+ const n = Ae(t), r = Fe(t);
3178
2917
  return !n && !r ? null : /* @__PURE__ */ d("div", { className: s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
3179
2918
  !s && t.user && /* @__PURE__ */ e(
3180
2919
  ne,
@@ -3195,95 +2934,53 @@ const Pt = ({
3195
2934
  {
3196
2935
  className: "str-chat__message-bubble",
3197
2936
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
3198
- children: n ? /* @__PURE__ */ e("div", { className: qe(s), children: /* @__PURE__ */ e(Xe, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ e(Pt, { ...r }) : /* @__PURE__ */ e(At, { ...r })
2937
+ children: n ? /* @__PURE__ */ e("div", { className: Re(s), children: /* @__PURE__ */ e(Le, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ e(kt, { ...r }) : /* @__PURE__ */ e(Mt, { ...r })
3199
2938
  }
3200
2939
  ) })
3201
2940
  }
3202
2941
  )
3203
2942
  ] });
3204
- }, aa = ({
2943
+ }, Zn = ({
3205
2944
  message: t
3206
2945
  }) => {
3207
- const s = Ze(t);
2946
+ const s = Ae(t);
3208
2947
  if (s)
3209
- return /* @__PURE__ */ e("div", { className: qe(!0), children: /* @__PURE__ */ e(Xe, { attachment: s, isMyMessage: !0 }) });
3210
- const n = Ke(t);
3211
- return n ? /* @__PURE__ */ e(Pt, { ...n }) : null;
3212
- }, ra = ({
2948
+ return /* @__PURE__ */ e("div", { className: Re(!0), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !0 }) });
2949
+ const n = Fe(t);
2950
+ return n ? /* @__PURE__ */ e(kt, { ...n }) : null;
2951
+ }, Jn = ({
3213
2952
  message: t
3214
2953
  }) => {
3215
- const s = Ze(t);
2954
+ const s = Ae(t);
3216
2955
  if (s)
3217
- return /* @__PURE__ */ e("div", { className: qe(!1), children: /* @__PURE__ */ e(Xe, { attachment: s, isMyMessage: !1 }) });
3218
- const n = Ke(t);
3219
- return n ? /* @__PURE__ */ e(At, { ...n }) : null;
3220
- }, xa = Object.assign(na, {
3221
- Creator: aa,
3222
- Visitor: ra
3223
- }), pa = (t, s = {}) => {
3224
- const { initialSearch: n = "", pageSize: r = 20 } = s, [o, l] = M([]), [i, c] = M(!1), [h, u] = M(null), [m, f] = M(n), [v, a] = M(!0), [C, g] = M(), y = U(async (E = !1, F) => {
3225
- if (i) return;
3226
- const N = F !== void 0 ? F : m;
3227
- c(!0), u(null);
3228
- try {
3229
- const b = await t.loadParticipants({
3230
- search: N || void 0,
3231
- limit: r,
3232
- cursor: E ? void 0 : C
3233
- });
3234
- l(
3235
- (k) => E ? b.participants : [...k, ...b.participants]
3236
- ), a(b.hasMore), g(b.nextCursor);
3237
- } catch (b) {
3238
- const k = b instanceof Error ? b.message : "Failed to load participants";
3239
- u(k), console.error("[useParticipants] Load error:", b);
3240
- } finally {
3241
- c(!1);
3242
- }
3243
- }, [t, m, C, r, i]), p = U(() => {
3244
- v && !i && y(!1);
3245
- }, [v, i, y]), S = U((E) => {
3246
- f(E), g(void 0), y(!0, E);
3247
- }, [y]), w = U(() => {
3248
- g(void 0), y(!0);
3249
- }, [y]);
3250
- return K(() => {
3251
- y(!0);
3252
- }, [t.loadParticipants]), {
3253
- participants: o,
3254
- loading: i,
3255
- error: h,
3256
- searchQuery: m,
3257
- hasMore: v,
3258
- totalCount: t.totalCount,
3259
- loadMore: p,
3260
- search: S,
3261
- refresh: w
3262
- };
3263
- };
2956
+ return /* @__PURE__ */ e("div", { className: Re(!1), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !1 }) });
2957
+ const n = Fe(t);
2958
+ return n ? /* @__PURE__ */ e(Mt, { ...n }) : null;
2959
+ }, ca = Object.assign(Xn, {
2960
+ Creator: Zn,
2961
+ Visitor: Jn
2962
+ });
3264
2963
  export {
3265
- Rt as A,
3266
- Pn as C,
3267
- ba as F,
3268
- lt as L,
3269
- xa as M,
3270
- $n as P,
3271
- Dt as a,
3272
- ke as b,
2964
+ St as A,
2965
+ kn as C,
2966
+ la as F,
2967
+ nt as L,
2968
+ ca as M,
2969
+ Et as a,
2970
+ me as b,
3273
2971
  ne as c,
3274
- _t as d,
3275
- Mt as e,
3276
- fa as f,
3277
- jn as g,
3278
- fn as h,
3279
- ha as i,
3280
- ga as j,
3281
- Hs as k,
3282
- Ke as l,
3283
- nn as m,
3284
- zs as n,
3285
- pa as o,
3286
- Ze as r,
3287
- un as u
2972
+ wt as d,
2973
+ Nt as e,
2974
+ ia as f,
2975
+ Ln as g,
2976
+ ln as h,
2977
+ ra as i,
2978
+ oa as j,
2979
+ zs as k,
2980
+ Fe as l,
2981
+ Qs as m,
2982
+ As as n,
2983
+ Ae as r,
2984
+ on as u
3288
2985
  };
3289
- //# sourceMappingURL=index-B_4pciGp.js.map
2986
+ //# sourceMappingURL=index-DY-3-rt4.js.map