@linktr.ee/messaging-react 1.34.0 → 1.35.0-rc-1777516745

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