@linktr.ee/messaging-react 1.21.2 → 1.22.0-rc-1771556455

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