@linktr.ee/messaging-react 1.33.1 → 1.33.2-rc-1777444067

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