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

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 D from "classnames";
3
+ import B, { createContext as es, useContext as ss, useCallback as L, useState as I, useRef as Y, 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 Ue, areMessageUIPropsEqual as ls, useMessageReminder as os, 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 Ds, useMessageInputContext as Ts, useMessageComposerHasSendableData as Rs, SimpleAttachmentSelector as Fs, QuotedMessagePreview as Ls, AttachmentPreviewList as Ps, TextareaComposer as Us, 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 zs, Sparkle as Gs, X as Hs, ArrowLeftIcon as Se, StarIcon as Me, DotsThreeIcon as ke, SpinnerGapIcon as ue, SignOutIcon as Vs, ProhibitInsetIcon as De, FlagIcon as Ws, MagnifyingGlassIcon as Ys, ChatCircleDotsIcon as Te } 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,229 +15,229 @@ 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,
23
- capabilities: l = {},
22
+ apiKey: r,
23
+ capabilities: o = {},
24
24
  debug: d = !1
25
25
  }) => {
26
- const a = L(
26
+ const l = 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
+ l("🔄 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
- capabilities: Object.keys(l)
36
+ capabilities: Object.keys(o)
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 = Y(!1), b = Y({
39
+ userId: t == null ? void 0 : t.id,
40
+ apiKey: r,
41
41
  serviceConfig: n,
42
- capabilities: l
43
- }), m = q(0);
44
- m.current++, a("📊 RENDER INFO", {
42
+ capabilities: o
43
+ }), m = Y(0);
44
+ m.current++, l("📊 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
- capabilitiesChanged: b.current.capabilities !== l
51
+ capabilitiesChanged: b.current.capabilities !== o
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
- capabilities: l
58
- }, Z(() => {
57
+ capabilities: o
58
+ }, q(() => {
59
59
  const c = m.current;
60
- if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
60
+ if (l("🔧 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
+ l("⚠️ 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
+ l("🚀 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), l("✅ SERVICE SET", {
88
88
  renderCount: c,
89
89
  serviceInstance: !!x
90
90
  }), () => {
91
- a("🧹 SERVICE CLEANUP", {
91
+ l("🧹 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, l]);
97
+ const w = Y(null);
98
+ q(() => {
99
+ var x, A;
100
+ if (l("🔗 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
+ l("⚠️ 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
+ l("⚠️ 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
+ l(
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
+ l("🚀 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
+ l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
126
+ const _ = await u.connectUser(t);
127
+ C(_), y(!0), w.current = { serviceId: u, userId: t.id }, l("✅ 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), l("❌ 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, l("🔄 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, l, N]), q(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!u,
146
- isConnected: C
146
+ isConnected: N
147
147
  }), () => {
148
- u && C ? (a(
148
+ u && N ? (l(
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)) : l("🔇 CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!u,
153
- isConnected: C
153
+ isConnected: N
154
154
  });
155
- }), [u, C, a]);
156
- const D = L(async () => {
157
- if (a("🔄 REFRESH CONNECTION CALLED", {
155
+ }), [u, N, l]);
156
+ const T = L(async () => {
157
+ if (l("🔄 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
+ l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
164
+ l("🚀 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
+ l("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
167
+ const c = await u.connectUser(t);
168
+ C(c), y(!0), v(null), l("✅ 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), l("❌ 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), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
177
177
  }
178
- }, [u, s, a]), h = j.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [u, t, l]), h = B.useMemo(() => (l("💫 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
- capabilitiesKeys: Object.keys(l)
184
+ capabilitiesKeys: Object.keys(o)
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
- capabilities: l,
192
- refreshConnection: D,
191
+ capabilities: o,
192
+ refreshConnection: T,
193
193
  debug: d
194
194
  }), [
195
195
  u,
196
196
  g,
197
- C,
198
- r,
197
+ N,
198
+ a,
199
199
  S,
200
- l,
201
- D,
200
+ o,
201
+ T,
202
202
  d,
203
- a
203
+ l
204
204
  ]);
205
- return a("🔄 RENDER END", {
205
+ return l("🔄 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
+ }, qs = () => fe(), Zs = (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
+ ), o = new Date(
223
+ Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
224
224
  ).getTime() - n.getTime();
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)
225
+ return Math.floor(o / (1e3 * 60 * 60 * 24));
226
+ }, Xs = (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 = Zs(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,
285
- shape: l = "squircle"
284
+ className: r,
285
+ shape: o = "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 = o === "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: D("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: D(
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
+ }, Ks = () => /* @__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
+ ) }), et = (s) => {
327
+ var t;
328
+ return ((t = s.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
329
+ }, st = (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) => et(s) || st(s), tt = (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
- var l;
343
- const n = Oe(t), o = ye(t);
344
- if (!n && !o)
342
+ var 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 = (o = s.metadata) == null ? void 0 : o.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 l = t ? "message-tip-standalone" : "message-tag message-tag--tip", u = t ? `${d} tip` : `Delivered with ${d} tip`;
350
+ return /* @__PURE__ */ i("div", { className: l, 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(Ks, {}) }),
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,
365
- unread: l,
364
+ debug: r = !1,
365
+ unread: o,
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, T, h, c, x, A;
369
+ const l = (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 = ((T = C == null ? void 0 : C.user) == null ? void 0 : T.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 ? Xs(new Date(a.created_at)) : "", k = a ? pe(a) : !1, b = d ? d(a, S) : `${k ? "✨ " : ""}${S}`, m = o ?? 0;
385
+ return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
386
+ channelId: s == null ? void 0 : s.id,
387
+ isSelected: l,
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: D(
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": l,
402
+ "hover:bg-sand": !l
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: D(
422
422
  "text-sm font-medium truncate",
423
- a ? "text-primary" : "text-charcoal"
423
+ l ? "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,49 +437,49 @@ 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,
447
- customEmptyStateIndicator: l,
446
+ className: r,
447
+ customEmptyStateIndicator: o,
448
448
  renderMessagePreview: d
449
449
  }) => {
450
- const a = j.useRef(0);
451
- a.current++;
450
+ const l = B.useRef(0);
451
+ l.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: l.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: D(
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 },
480
480
  options: { limit: 30 },
481
481
  Preview: f,
482
- EmptyStateIndicator: l
482
+ EmptyStateIndicator: o
483
483
  },
484
484
  JSON.stringify(n)
485
485
  ) })
@@ -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: D(
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: D(
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 ze({ 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 nt = (s) => /* @__PURE__ */ e(as, { ...s, position: "center" }), Ne = "vote_up", Ce = "vote_down";
534
+ function rt(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]
541
- ), l = L(async () => {
537
+ function at(s) {
538
+ const { channel: t } = we(), { client: n } = Ue("useMessageVote"), r = be(
539
+ () => rt(s.own_reactions),
540
+ [s.own_reactions]
541
+ ), o = 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: o, 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 lt = ({ 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
+ ) }), it = ({
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(lt, { 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) => {
612
- var X, oe;
611
+ ] }), ct = (s) => {
612
+ var Q, le;
613
613
  const {
614
- additionalMessageInputProps: s,
614
+ additionalMessageInputProps: t,
615
615
  chatbotVotingEnabled: n,
616
- editing: o,
617
- endOfGroup: l,
616
+ editing: r,
617
+ endOfGroup: o,
618
618
  firstOfGroup: d,
619
- groupedByUser: a,
619
+ groupedByUser: l,
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 } = Ue("CustomMessage"), [k, b] = I(!1), m = os(a.id), { selected: w, voteUp: T, voteDown: h } = at(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: z = 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 X = !S && !!a.reply_count, P = !S && a.show_in_channel && a.parent_id, U = a.status === "failed" && ((Q = a.error) == null ? void 0 : Q.status) !== 403, G = ys(a);
654
654
  let F;
655
- O ? F = () => g(r) : H && (F = () => b(!0));
656
- const W = R(
655
+ U ? F = () => g(a) : G && (F = () => b(!0));
656
+ const W = D(
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,
669
- "str-chat__virtual-message__wrapper--end": l,
667
+ "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((le = a == null ? void 0 : a.error) == null ? void 0 : le.status) !== 403,
668
+ "str-chat__message-with-thread-link": X || P,
669
+ "str-chat__virtual-message__wrapper--end": o,
670
670
  "str-chat__virtual-message__wrapper--first": d,
671
- "str-chat__virtual-message__wrapper--group": a
671
+ "str-chat__virtual-message__wrapper--group": l
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), J = tt(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
689
  /* @__PURE__ */ i("div", { className: W, children: [
690
- Y && /* @__PURE__ */ e(Y, {}),
690
+ Z && /* @__PURE__ */ e(Z, {}),
691
691
  !!m && /* @__PURE__ */ e(z, { reminder: m }),
692
- r.user && /* @__PURE__ */ e(
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: D("str-chat__message-inner", {
705
+ "str-chat__simple-message--error-failed": U || G
706
706
  }),
707
707
  "data-testid": "message-inner",
708
708
  onClick: F,
@@ -715,13 +715,13 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
715
715
  marginInlineEnd: 0,
716
716
  marginInlineStart: 0
717
717
  },
718
- children: Q ? (
718
+ children: J ? (
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,49 +731,49 @@ 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
+ it,
743
743
  {
744
744
  selected: w,
745
- onVoteUp: D,
745
+ onVoteUp: T,
746
746
  onVoteDown: h
747
747
  }
748
748
  )
749
749
  ] })
750
750
  }
751
751
  ),
752
- J && /* @__PURE__ */ e(
753
- G,
752
+ X && /* @__PURE__ */ e(
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
759
  P && /* @__PURE__ */ e(M, {})
760
- ] }, r.id)
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
+ }, dt = B.memo(
763
+ ct,
764
+ ls
765
+ ), ut = (s) => {
766
+ const t = Ss("CustomMessage");
767
+ return /* @__PURE__ */ e(dt, { ...t, ...s });
768
+ }, mt = (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
+ }), ht = ({
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: o } = s;
777
777
  return /* @__PURE__ */ i(
778
778
  "a",
779
779
  {
@@ -782,11 +782,11 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
782
782
  rel: "noopener noreferrer",
783
783
  className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
784
784
  children: [
785
- l && /* @__PURE__ */ e(
785
+ o && /* @__PURE__ */ e(
786
786
  "img",
787
787
  {
788
- src: l,
789
- alt: o || "",
788
+ src: 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: (l) => {
798
+ l.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
816
- ), n = (l) => {
817
- t.dismissPreview(l);
812
+ }, ft = () => {
813
+ const { linkPreviewsManager: s } = Ms(), { linkPreviews: t } = ks(
814
+ s.state,
815
+ mt
816
+ ), n = (o) => {
817
+ s.dismissPreview(o);
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((o) => /* @__PURE__ */ e(
820
+ ht,
821
821
  {
822
- link: l,
822
+ link: o,
823
823
  onDismiss: n
824
824
  },
825
- l.og_scrape_url
825
+ o.og_scrape_url
826
826
  )) }) : null;
827
- }, mt = () => {
828
- const { handleSubmit: t } = ks(), s = Rs();
827
+ }, gt = () => {
828
+ const { handleSubmit: s } = Ts(), 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(ft, {}),
834
+ /* @__PURE__ */ e(Ps, {}),
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
+ Us,
838
838
  {
839
839
  className: "w-full resize-none outline-none leading-6",
840
840
  autoFocus: !0,
@@ -847,34 +847,84 @@ 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(zs, { className: "size-4" })
854
854
  }
855
855
  )
856
856
  ] })
857
857
  ] })
858
858
  ] });
859
- }, ht = ({
860
- renderActions: t
859
+ }, xt = ({
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(Ds, { Input: gt })
864
+ ] }), bt = [
865
+ "SYSTEM_DM_AGENT_PAUSED",
866
+ "SYSTEM_DM_AGENT_RESUMED"
867
+ ], Nt = {
868
+ SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
869
+ SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
870
+ }, Pe = (s) => bt.includes(s), Ct = (s) => {
871
+ var r;
872
+ const t = (r = s.metadata) == null ? void 0 : r.custom_type;
873
+ if (Pe(t))
874
+ return t;
875
+ const n = s.dm_agent_system_type;
876
+ if (Pe(n))
877
+ return n;
878
+ }, vt = (s) => {
879
+ var r;
880
+ const t = s.message.hide_date === !0, n = Ct(s.message);
881
+ if (n) {
882
+ const o = ((r = s.message.text) == null ? void 0 : r.trim()) || Nt[n];
883
+ return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
884
+ /* @__PURE__ */ i(
885
+ "div",
886
+ {
887
+ className: "mes-dm-agent-system-message",
888
+ "data-testid": "dm-agent-system-message",
889
+ "data-dm-agent-system-type": n,
890
+ children: [
891
+ /* @__PURE__ */ e(
892
+ Gs,
893
+ {
894
+ size: 16,
895
+ weight: "regular",
896
+ "aria-hidden": !0,
897
+ className: "mes-dm-agent-system-message__sparkle"
898
+ }
899
+ ),
900
+ /* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text", children: o }),
901
+ /* @__PURE__ */ e(
902
+ "span",
903
+ {
904
+ className: "mes-dm-agent-system-message__close",
905
+ "aria-hidden": !0,
906
+ "data-testid": "dm-agent-system-message-close",
907
+ children: /* @__PURE__ */ e(Hs, { size: 14, weight: "regular", "aria-hidden": !0 })
908
+ }
909
+ )
910
+ ]
911
+ }
912
+ ),
913
+ !t && /* @__PURE__ */ e(Ie, { message: s.message })
914
+ ] });
915
+ }
866
916
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
867
917
  /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
868
918
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
869
- /* @__PURE__ */ e("p", { children: t.message.text }),
919
+ /* @__PURE__ */ e("p", { children: s.message.text }),
870
920
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
871
921
  ] }),
872
- !s && /* @__PURE__ */ e(Ps, { message: t.message })
922
+ !t && /* @__PURE__ */ e(Ie, { message: s.message })
873
923
  ] });
874
- }, gt = () => null, xt = ({ className: t, message: s }) => /* @__PURE__ */ i(
924
+ }, wt = () => null, yt = ({ className: s, message: t }) => /* @__PURE__ */ i(
875
925
  "div",
876
926
  {
877
- className: R("flex items-center justify-center h-full", t),
927
+ className: D("flex items-center justify-center h-full", s),
878
928
  children: [
879
929
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
880
930
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -911,34 +961,34 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
911
961
  }
912
962
  ) })
913
963
  ] }),
914
- s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
964
+ t && /* @__PURE__ */ e("span", { className: "text-stone", children: t })
915
965
  ]
916
966
  }
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" }),
967
+ ), 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: [
968
+ /* @__PURE__ */ e(yt, { className: "w-6 h-6" }),
919
969
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
920
970
  ] }) }));
921
971
  he.displayName = "LoadingState";
922
- const bt = ({
923
- onBack: t,
924
- showBackButton: s,
972
+ const pt = ({
973
+ onBack: s,
974
+ showBackButton: t,
925
975
  onShowInfo: n,
926
- canShowInfo: o,
927
- showStarButton: l = !1
976
+ canShowInfo: r,
977
+ showStarButton: o = !1
928
978
  }) => {
929
- var p, r, E, S, v, k;
930
- const { channel: d } = we(), a = j.useMemo(() => Object.values(d.state.members || {}).find(
979
+ var y, a, E, S, v, k;
980
+ const { channel: d } = we(), l = B.useMemo(() => Object.values(d.state.members || {}).find(
931
981
  (m) => {
932
982
  var w;
933
983
  return ((w = m.user) == null ? void 0 : w.id) && m.user.id !== d._client.userID;
934
984
  }
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] = _(
985
+ ), [d._client.userID, d.state.members]), u = ((y = l == null ? void 0 : l.user) == null ? void 0 : y.name) || ((a = l == null ? void 0 : l.user) == null ? void 0 : a.id) || "Unknown member", f = (E = l == null ? void 0 : l.user) == null ? void 0 : E.image, [g, C] = I(
936
986
  !!((S = d.state.membership) != null && S.pinned_at)
937
987
  );
938
- Z(() => {
988
+ q(() => {
939
989
  const b = (m) => {
940
990
  var w;
941
- N(
991
+ C(
942
992
  m != null && m.member ? !!m.member.pinned_at : !!((w = d.state.membership) != null && w.pinned_at)
943
993
  );
944
994
  };
@@ -946,7 +996,7 @@ const bt = ({
946
996
  d.off("member.updated", b);
947
997
  };
948
998
  }, [d]);
949
- const C = async () => {
999
+ const N = async () => {
950
1000
  try {
951
1001
  g ? await d.unpin() : await d.pin();
952
1002
  } catch (b) {
@@ -958,24 +1008,24 @@ const bt = ({
958
1008
  };
959
1009
  return /* @__PURE__ */ i("div", { className: "@container", children: [
960
1010
  /* @__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(
1011
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ e(
962
1012
  "button",
963
1013
  {
964
- className: R(
1014
+ className: D(
965
1015
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
966
1016
  ),
967
- onClick: t || (() => {
1017
+ onClick: s || (() => {
968
1018
  }),
969
1019
  type: "button",
970
1020
  "aria-label": "Back to conversations",
971
- children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
1021
+ children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
972
1022
  }
973
1023
  ) }),
974
1024
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
975
1025
  /* @__PURE__ */ e(
976
1026
  K,
977
1027
  {
978
- id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
1028
+ id: ((v = l == null ? void 0 : l.user) == null ? void 0 : v.id) || d.id || "unknown",
979
1029
  name: u,
980
1030
  image: f,
981
1031
  size: 40
@@ -984,17 +1034,17 @@ const bt = ({
984
1034
  /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
985
1035
  ] }),
986
1036
  /* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
987
- l && /* @__PURE__ */ e(
1037
+ o && /* @__PURE__ */ e(
988
1038
  "button",
989
1039
  {
990
1040
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
991
- onClick: C,
1041
+ onClick: N,
992
1042
  type: "button",
993
1043
  "aria-label": g ? "Unstar conversation" : "Star conversation",
994
1044
  children: /* @__PURE__ */ e(
995
- Se,
1045
+ Me,
996
1046
  {
997
- className: R("size-5", {
1047
+ className: D("size-5", {
998
1048
  "text-yellow-600": g,
999
1049
  "text-black/90": !g
1000
1050
  }),
@@ -1010,27 +1060,27 @@ const bt = ({
1010
1060
  onClick: n,
1011
1061
  type: "button",
1012
1062
  "aria-label": "Show info",
1013
- children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
1063
+ children: /* @__PURE__ */ e(ke, { className: "size-5 text-black/90" })
1014
1064
  }
1015
1065
  )
1016
1066
  ] })
1017
1067
  ] }),
1018
1068
  /* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
1019
1069
  /* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
1020
- s && t && /* @__PURE__ */ e(
1070
+ t && s && /* @__PURE__ */ e(
1021
1071
  "button",
1022
1072
  {
1023
1073
  type: "button",
1024
- onClick: t,
1074
+ onClick: s,
1025
1075
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1026
1076
  "aria-label": "Back to conversations",
1027
- children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
1077
+ children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
1028
1078
  }
1029
1079
  ),
1030
1080
  /* @__PURE__ */ e(
1031
1081
  K,
1032
1082
  {
1033
- id: ((k = a == null ? void 0 : a.user) == null ? void 0 : k.id) || d.id || "unknown",
1083
+ id: ((k = l == null ? void 0 : l.user) == null ? void 0 : k.id) || d.id || "unknown",
1034
1084
  name: u,
1035
1085
  image: f,
1036
1086
  size: 40
@@ -1039,17 +1089,17 @@ const bt = ({
1039
1089
  /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
1040
1090
  ] }),
1041
1091
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
1042
- l && /* @__PURE__ */ e(
1092
+ o && /* @__PURE__ */ e(
1043
1093
  "button",
1044
1094
  {
1045
1095
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1046
- onClick: C,
1096
+ onClick: N,
1047
1097
  type: "button",
1048
1098
  "aria-label": g ? "Unstar conversation" : "Star conversation",
1049
1099
  children: /* @__PURE__ */ e(
1050
- Se,
1100
+ Me,
1051
1101
  {
1052
- className: R("size-5", {
1102
+ className: D("size-5", {
1053
1103
  "text-yellow-600": g,
1054
1104
  "text-black/90": !g
1055
1105
  }),
@@ -1058,74 +1108,74 @@ const bt = ({
1058
1108
  )
1059
1109
  }
1060
1110
  ),
1061
- o && n && /* @__PURE__ */ e(
1111
+ r && n && /* @__PURE__ */ e(
1062
1112
  "button",
1063
1113
  {
1064
1114
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1065
1115
  onClick: n,
1066
1116
  type: "button",
1067
1117
  "aria-label": "Show info",
1068
- children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
1118
+ children: /* @__PURE__ */ e(ke, { className: "size-5 text-black/90" })
1069
1119
  }
1070
1120
  )
1071
1121
  ] })
1072
1122
  ] })
1073
1123
  ] });
1074
- }, Ct = ({
1075
- dialogRef: t,
1076
- onClose: s,
1124
+ }, Et = ({
1125
+ dialogRef: s,
1126
+ onClose: t,
1077
1127
  participant: n,
1078
- channel: o,
1079
- followerStatusLabel: l,
1128
+ channel: r,
1129
+ followerStatusLabel: o,
1080
1130
  onLeaveConversation: d,
1081
- onBlockParticipant: a,
1131
+ onBlockParticipant: l,
1082
1132
  showDeleteConversation: u = !0,
1083
1133
  onDeleteConversationClick: f,
1084
1134
  onBlockParticipantClick: g,
1085
- onReportParticipantClick: N,
1086
- customChannelActions: C
1135
+ onReportParticipantClick: C,
1136
+ customChannelActions: N
1087
1137
  }) => {
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 () => {
1138
+ var ee, Z, se, te, re, V, X;
1139
+ const { service: y, debug: a } = fe(), [E, S] = I(!1), [v, k] = I(!1), [b, m] = I(!1), w = L(async () => {
1090
1140
  var P;
1091
- if (!(!p || !((P = n == null ? void 0 : n.user) != null && P.id)))
1141
+ if (!(!y || !((P = n == null ? void 0 : n.user) != null && P.id)))
1092
1142
  try {
1093
- const H = (await p.getBlockedUsers()).some(
1143
+ const G = (await y.getBlockedUsers()).some(
1094
1144
  (F) => {
1095
1145
  var W;
1096
1146
  return F.blocked_user_id === ((W = n == null ? void 0 : n.user) == null ? void 0 : W.id);
1097
1147
  }
1098
1148
  );
1099
- S(H);
1100
- } catch (O) {
1149
+ S(G);
1150
+ } catch (U) {
1101
1151
  console.error(
1102
1152
  "[ChannelInfoDialog] Failed to check blocked status:",
1103
- O
1153
+ U
1104
1154
  );
1105
1155
  }
1106
- }, [p, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
1107
- Z(() => {
1156
+ }, [y, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
1157
+ q(() => {
1108
1158
  w();
1109
1159
  }, [w]);
1110
- const D = async () => {
1160
+ const T = async () => {
1111
1161
  var P;
1112
1162
  if (!v) {
1113
- f == null || f(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), k(!0);
1163
+ f == null || f(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), k(!0);
1114
1164
  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);
1165
+ const U = ((P = r._client) == null ? void 0 : P.userID) ?? null;
1166
+ await r.hide(U, !1), d && await d(r), t();
1167
+ } catch (U) {
1168
+ console.error("[ChannelInfoDialog] Failed to leave conversation", U);
1119
1169
  } finally {
1120
1170
  k(!1);
1121
1171
  }
1122
1172
  }
1123
1173
  }, 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);
1174
+ var P, U, G;
1175
+ if (!(b || !y)) {
1176
+ g == null || g(), a && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1127
1177
  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();
1178
+ await y.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), l && await l((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), t();
1129
1179
  } catch (F) {
1130
1180
  console.error("[ChannelInfoDialog] Failed to block member", F);
1131
1181
  } finally {
@@ -1133,11 +1183,11 @@ const bt = ({
1133
1183
  }
1134
1184
  }
1135
1185
  }, 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);
1186
+ var P, U, G;
1187
+ if (!(b || !y)) {
1188
+ g == null || g(), a && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1139
1189
  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();
1190
+ await y.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), l && await l((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), t();
1141
1191
  } catch (F) {
1142
1192
  console.error("[ChannelInfoDialog] Failed to unblock member", F);
1143
1193
  } finally {
@@ -1145,29 +1195,29 @@ const bt = ({
1145
1195
  }
1146
1196
  }
1147
1197
  }, x = () => {
1148
- N == null || N(), s(), window.open(
1198
+ C == null || C(), t(), window.open(
1149
1199
  "https://linktr.ee/s/about/trust-center/report",
1150
1200
  "_blank",
1151
1201
  "noopener,noreferrer"
1152
1202
  );
1153
1203
  };
1154
1204
  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";
1205
+ 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), z = ((X = n.user) == null ? void 0 : X.id) || "unknown";
1156
1206
  return (
1157
1207
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1158
1208
  /* @__PURE__ */ e(
1159
1209
  "dialog",
1160
1210
  {
1161
- ref: t,
1211
+ ref: s,
1162
1212
  className: "mes-dialog group",
1163
- onClose: s,
1213
+ onClose: t,
1164
1214
  onClick: (P) => {
1165
- P.target === t.current && s();
1215
+ P.target === s.current && t();
1166
1216
  },
1167
1217
  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
1218
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1169
1219
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
1170
- /* @__PURE__ */ e(Ae, { onClick: s })
1220
+ /* @__PURE__ */ e(ze, { onClick: t })
1171
1221
  ] }),
1172
1222
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1173
1223
  /* @__PURE__ */ e(
@@ -1180,27 +1230,27 @@ const bt = ({
1180
1230
  K,
1181
1231
  {
1182
1232
  id: z,
1183
- name: B,
1184
- image: I,
1233
+ name: A,
1234
+ image: _,
1185
1235
  size: 88,
1186
1236
  shape: "circle"
1187
1237
  }
1188
1238
  ),
1189
1239
  /* @__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 }),
1192
- l && /* @__PURE__ */ e(
1240
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: A }),
1241
+ H && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: H }),
1242
+ o && /* @__PURE__ */ e(
1193
1243
  "span",
1194
1244
  {
1195
1245
  className: "mt-1 rounded-full text-xs font-normal w-fit",
1196
1246
  style: {
1197
1247
  padding: "4px 8px",
1198
- backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1199
- color: l === "Subscribed to you" ? "#008236" : "#78716C",
1248
+ backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1249
+ color: o === "Subscribed to you" ? "#008236" : "#78716C",
1200
1250
  lineHeight: "133.333%",
1201
1251
  letterSpacing: "0.21px"
1202
1252
  },
1203
- children: l
1253
+ children: o
1204
1254
  }
1205
1255
  )
1206
1256
  ] })
@@ -1211,11 +1261,11 @@ const bt = ({
1211
1261
  u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1212
1262
  de,
1213
1263
  {
1214
- onClick: D,
1264
+ onClick: T,
1215
1265
  disabled: v,
1216
1266
  "aria-busy": v,
1217
1267
  children: [
1218
- v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
1268
+ v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Vs, { className: "h-5 w-5" }),
1219
1269
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1220
1270
  ]
1221
1271
  }
@@ -1227,7 +1277,7 @@ const bt = ({
1227
1277
  disabled: b,
1228
1278
  "aria-busy": b,
1229
1279
  children: [
1230
- b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
1280
+ b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "h-5 w-5" }),
1231
1281
  /* @__PURE__ */ e("span", { children: "Unblock" })
1232
1282
  ]
1233
1283
  }
@@ -1238,49 +1288,49 @@ const bt = ({
1238
1288
  disabled: b,
1239
1289
  "aria-busy": b,
1240
1290
  children: [
1241
- b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
1291
+ b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "h-5 w-5" }),
1242
1292
  /* @__PURE__ */ e("span", { children: "Block" })
1243
1293
  ]
1244
1294
  }
1245
1295
  ) }),
1246
1296
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: x, children: [
1247
- /* @__PURE__ */ e(Hs, { className: "h-5 w-5" }),
1297
+ /* @__PURE__ */ e(Ws, { className: "h-5 w-5" }),
1248
1298
  /* @__PURE__ */ e("span", { children: "Report" })
1249
1299
  ] }) }),
1250
- C
1300
+ N
1251
1301
  ] })
1252
1302
  ] })
1253
1303
  ] })
1254
1304
  }
1255
1305
  )
1256
1306
  );
1257
- }, Nt = ({
1258
- onBack: t,
1259
- showBackButton: s,
1307
+ }, _t = ({
1308
+ onBack: s,
1309
+ showBackButton: t,
1260
1310
  renderMessageInputActions: n,
1261
- onLeaveConversation: o,
1262
- onBlockParticipant: l,
1311
+ onLeaveConversation: r,
1312
+ onBlockParticipant: o,
1263
1313
  showDeleteConversation: d = !0,
1264
- onDeleteConversationClick: a,
1314
+ onDeleteConversationClick: l,
1265
1315
  onBlockParticipantClick: u,
1266
1316
  onReportParticipantClick: f,
1267
1317
  showStarButton: g = !1,
1268
- chatbotVotingEnabled: N = !1,
1269
- renderChannelBanner: C,
1270
- customChannelActions: p
1318
+ chatbotVotingEnabled: C = !1,
1319
+ renderChannelBanner: N,
1320
+ customChannelActions: y
1271
1321
  }) => {
1272
- const { channel: r } = we(), E = q(null), S = j.useMemo(() => Object.values(r.state.members || {}).find(
1322
+ const { channel: a } = we(), E = Y(null), S = B.useMemo(() => Object.values(a.state.members || {}).find(
1273
1323
  (w) => {
1274
- var D;
1275
- return ((D = w.user) == null ? void 0 : D.id) && w.user.id !== r._client.userID;
1324
+ var T;
1325
+ return ((T = w.user) == null ? void 0 : T.id) && w.user.id !== a._client.userID;
1276
1326
  }
1277
- ), [r._client.userID, r.state.members]), v = j.useMemo(() => {
1278
- const m = r.data ?? {};
1327
+ ), [a._client.userID, a.state.members]), v = B.useMemo(() => {
1328
+ const m = a.data ?? {};
1279
1329
  if (m.followerStatus)
1280
1330
  return String(m.followerStatus);
1281
1331
  if (m.isFollower !== void 0)
1282
1332
  return m.isFollower ? "Subscribed to you" : "Not subscribed";
1283
- }, [r.data]), k = L(() => {
1333
+ }, [a.data]), k = L(() => {
1284
1334
  var m;
1285
1335
  (m = E.current) == null || m.showModal();
1286
1336
  }, []), b = L(() => {
@@ -1289,23 +1339,23 @@ const bt = ({
1289
1339
  }, []);
1290
1340
  return /* @__PURE__ */ i(ve, { children: [
1291
1341
  /* @__PURE__ */ e(
1292
- Us,
1342
+ As,
1293
1343
  {
1294
1344
  overrides: {
1295
- Message: (m) => /* @__PURE__ */ e(it, { ...m, chatbotVotingEnabled: N })
1345
+ Message: (m) => /* @__PURE__ */ e(ut, { ...m, chatbotVotingEnabled: C })
1296
1346
  },
1297
1347
  children: /* @__PURE__ */ i(Bs, { children: [
1298
1348
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1299
- bt,
1349
+ pt,
1300
1350
  {
1301
- onBack: t,
1302
- showBackButton: s,
1351
+ onBack: s,
1352
+ showBackButton: t,
1303
1353
  onShowInfo: k,
1304
1354
  canShowInfo: !!S,
1305
1355
  showStarButton: g
1306
1356
  }
1307
1357
  ) }),
1308
- C == null ? void 0 : C(),
1358
+ N == null ? void 0 : N(),
1309
1359
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1310
1360
  js,
1311
1361
  {
@@ -1315,48 +1365,48 @@ const bt = ({
1315
1365
  }
1316
1366
  ) }),
1317
1367
  /* @__PURE__ */ e(
1318
- ht,
1368
+ xt,
1319
1369
  {
1320
- renderActions: () => n == null ? void 0 : n(r)
1370
+ renderActions: () => n == null ? void 0 : n(a)
1321
1371
  }
1322
1372
  )
1323
1373
  ] })
1324
1374
  }
1325
1375
  ),
1326
1376
  /* @__PURE__ */ e(
1327
- Ct,
1377
+ Et,
1328
1378
  {
1329
1379
  dialogRef: E,
1330
1380
  onClose: b,
1331
1381
  participant: S,
1332
- channel: r,
1382
+ channel: a,
1333
1383
  followerStatusLabel: v,
1334
- onLeaveConversation: o,
1335
- onBlockParticipant: l,
1384
+ onLeaveConversation: r,
1385
+ onBlockParticipant: o,
1336
1386
  showDeleteConversation: d,
1337
- onDeleteConversationClick: a,
1387
+ onDeleteConversationClick: l,
1338
1388
  onBlockParticipantClick: u,
1339
1389
  onReportParticipantClick: f,
1340
- customChannelActions: p
1390
+ customChannelActions: y
1341
1391
  }
1342
1392
  )
1343
1393
  ] });
1344
- }, $e = j.memo(
1394
+ }, Ge = B.memo(
1345
1395
  ({
1346
- channel: t,
1347
- onBack: s,
1396
+ channel: s,
1397
+ onBack: t,
1348
1398
  showBackButton: n = !1,
1349
- renderMessageInputActions: o,
1350
- onLeaveConversation: l,
1399
+ renderMessageInputActions: r,
1400
+ onLeaveConversation: o,
1351
1401
  onBlockParticipant: d,
1352
- className: a,
1353
- CustomChannelEmptyState: u = gt,
1402
+ className: l,
1403
+ CustomChannelEmptyState: u = wt,
1354
1404
  showDeleteConversation: f = !0,
1355
1405
  onDeleteConversationClick: g,
1356
- onBlockParticipantClick: N,
1357
- onReportParticipantClick: C,
1358
- dmAgentEnabled: p,
1359
- messageMetadata: r,
1406
+ onBlockParticipantClick: C,
1407
+ onReportParticipantClick: N,
1408
+ dmAgentEnabled: y,
1409
+ messageMetadata: a,
1360
1410
  onMessageSent: E,
1361
1411
  showStarButton: S = !1,
1362
1412
  chatbotVotingEnabled: v = !1,
@@ -1364,54 +1414,54 @@ const bt = ({
1364
1414
  customChannelActions: b
1365
1415
  }) => {
1366
1416
  const m = L(
1367
- async (w, D, h) => {
1417
+ async (w, T, h) => {
1368
1418
  var M;
1369
- const c = ((M = t.data) == null ? void 0 : M.chatbot_paused) === !0, x = p && !c, B = {
1370
- ...D,
1419
+ const c = ((M = s.data) == null ? void 0 : M.chatbot_paused) === !0, x = y && !c, A = {
1420
+ ...T,
1371
1421
  ...x && { silent: !0 },
1372
- ...r && {
1422
+ ...a && {
1373
1423
  metadata: {
1374
- ...D.metadata ?? {},
1375
- ...r
1424
+ ...T.metadata ?? {},
1425
+ ...a
1376
1426
  }
1377
1427
  }
1378
- }, I = {
1428
+ }, _ = {
1379
1429
  ...h,
1380
1430
  ...x && { skip_push: !0 }
1381
- }, T = await t.sendMessage(B, I);
1382
- return E == null || E(T), T;
1431
+ }, R = await s.sendMessage(A, _);
1432
+ return E == null || E(R), R;
1383
1433
  },
1384
- [t, p, r, E]
1434
+ [s, y, a, E]
1385
1435
  );
1386
1436
  return /* @__PURE__ */ e(
1387
1437
  "div",
1388
1438
  {
1389
- className: R(
1439
+ className: D(
1390
1440
  "messaging-channel-view h-full flex flex-col",
1391
- a
1441
+ l
1392
1442
  ),
1393
1443
  children: /* @__PURE__ */ e(
1394
1444
  Os,
1395
1445
  {
1396
- channel: t,
1397
- MessageSystem: ft,
1446
+ channel: s,
1447
+ MessageSystem: vt,
1398
1448
  EmptyStateIndicator: u,
1399
1449
  LoadingIndicator: he,
1400
- DateSeparator: et,
1450
+ DateSeparator: nt,
1401
1451
  doSendMessageRequest: m,
1402
1452
  children: /* @__PURE__ */ e(
1403
- Nt,
1453
+ _t,
1404
1454
  {
1405
- onBack: s,
1455
+ onBack: t,
1406
1456
  showBackButton: n,
1407
- renderMessageInputActions: o,
1408
- onLeaveConversation: l,
1457
+ renderMessageInputActions: r,
1458
+ onLeaveConversation: o,
1409
1459
  onBlockParticipant: d,
1410
1460
  CustomChannelEmptyState: u,
1411
1461
  showDeleteConversation: f,
1412
1462
  onDeleteConversationClick: g,
1413
- onBlockParticipantClick: N,
1414
- onReportParticipantClick: C,
1463
+ onBlockParticipantClick: C,
1464
+ onReportParticipantClick: N,
1415
1465
  showStarButton: S,
1416
1466
  chatbotVotingEnabled: v,
1417
1467
  renderChannelBanner: k,
@@ -1424,16 +1474,16 @@ const bt = ({
1424
1474
  );
1425
1475
  }
1426
1476
  );
1427
- $e.displayName = "ChannelView";
1428
- function vt({
1429
- searchQuery: t,
1430
- setSearchQuery: s,
1477
+ Ge.displayName = "ChannelView";
1478
+ function It({
1479
+ searchQuery: s,
1480
+ setSearchQuery: t,
1431
1481
  placeholder: n
1432
1482
  }) {
1433
- const o = q(null);
1483
+ const r = Y(null);
1434
1484
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1435
1485
  /* @__PURE__ */ e(
1436
- Gs,
1486
+ Ys,
1437
1487
  {
1438
1488
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1439
1489
  weight: "bold"
@@ -1442,42 +1492,42 @@ function vt({
1442
1492
  /* @__PURE__ */ e(
1443
1493
  "input",
1444
1494
  {
1445
- ref: o,
1495
+ ref: r,
1446
1496
  type: "text",
1447
1497
  placeholder: n,
1448
- value: t,
1449
- onChange: (l) => s(l.target.value),
1498
+ value: s,
1499
+ onChange: (o) => t(o.target.value),
1450
1500
  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
1501
  }
1452
1502
  ),
1453
- t && /* @__PURE__ */ e(
1454
- je,
1503
+ s && /* @__PURE__ */ e(
1504
+ $e,
1455
1505
  {
1456
1506
  label: "Clear search",
1457
1507
  onClick: () => {
1458
- var l;
1459
- s(""), (l = o.current) == null || l.focus();
1508
+ var o;
1509
+ t(""), (o = r.current) == null || o.focus();
1460
1510
  },
1461
1511
  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" })
1512
+ children: /* @__PURE__ */ e(ye, { className: "h-4 w-4", weight: "bold" })
1463
1513
  }
1464
1514
  )
1465
1515
  ] });
1466
1516
  }
1467
- const wt = ({
1468
- participantSource: t,
1469
- onSelectParticipant: s,
1517
+ const St = ({
1518
+ participantSource: s,
1519
+ onSelectParticipant: t,
1470
1520
  onClose: n,
1471
- existingParticipantIds: o = /* @__PURE__ */ new Set(),
1472
- participantLabel: l = "participants",
1521
+ existingParticipantIds: r = /* @__PURE__ */ new Set(),
1522
+ participantLabel: o = "participants",
1473
1523
  searchPlaceholder: d = "Search participants...",
1474
- className: a
1524
+ className: l
1475
1525
  }) => {
1476
- const { debug: u } = fe(), [f, g] = _(""), [N, C] = _([]), [p, r] = _(!1), [E, S] = _(null), [v, k] = _(
1526
+ const { debug: u } = fe(), [f, g] = I(""), [C, N] = I([]), [y, a] = I(!1), [E, S] = I(null), [v, k] = I(
1477
1527
  null
1478
- ), b = q(!1);
1479
- Z(() => {
1480
- if (t.loading) {
1528
+ ), b = Y(!1);
1529
+ q(() => {
1530
+ if (s.loading) {
1481
1531
  u && console.log(
1482
1532
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1483
1533
  );
@@ -1485,14 +1535,14 @@ const wt = ({
1485
1535
  }
1486
1536
  if (b.current) return;
1487
1537
  (async () => {
1488
- u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), S(null);
1538
+ u && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), S(null);
1489
1539
  try {
1490
- const c = await t.loadParticipants({
1540
+ const c = await s.loadParticipants({
1491
1541
  search: "",
1492
1542
  // Load all participants initially
1493
1543
  limit: 100
1494
1544
  });
1495
- C(c.participants), b.current = !0, u && console.log(
1545
+ N(c.participants), b.current = !0, u && console.log(
1496
1546
  "[ParticipantPicker] Participants loaded successfully:",
1497
1547
  c.participants.length
1498
1548
  );
@@ -1500,11 +1550,11 @@ const wt = ({
1500
1550
  const x = c instanceof Error ? c.message : "Failed to load participants";
1501
1551
  S(x), console.error("[ParticipantPicker] Failed to load participants:", c);
1502
1552
  } finally {
1503
- r(!1);
1553
+ a(!1);
1504
1554
  }
1505
1555
  })();
1506
- }, [t.loading, u]);
1507
- const m = N.filter((h) => !o.has(h.id)).filter((h) => {
1556
+ }, [s.loading, u]);
1557
+ const m = C.filter((h) => !r.has(h.id)).filter((h) => {
1508
1558
  var x;
1509
1559
  if (!f) return !0;
1510
1560
  const c = f.toLowerCase();
@@ -1514,32 +1564,32 @@ const wt = ({
1514
1564
  if (!v) {
1515
1565
  k(h.id);
1516
1566
  try {
1517
- await s(h);
1567
+ await t(h);
1518
1568
  } catch (c) {
1519
1569
  console.error("[ParticipantPicker] Failed to start chat:", c), k(null);
1520
1570
  }
1521
1571
  }
1522
1572
  },
1523
- [s, v]
1524
- ), D = (h, c) => {
1573
+ [t, v]
1574
+ ), T = (h, c) => {
1525
1575
  (h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(c));
1526
1576
  };
1527
- return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
1577
+ return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", l), children: [
1528
1578
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1529
1579
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1530
1580
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1531
- /* @__PURE__ */ e(Ae, { onClick: n })
1581
+ /* @__PURE__ */ e(ze, { onClick: n })
1532
1582
  ] }),
1533
1583
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1534
1584
  "Select a ",
1535
- l.slice(0, -1),
1585
+ o.slice(0, -1),
1536
1586
  " to start messaging (",
1537
1587
  m.length,
1538
1588
  " available)",
1539
- t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1589
+ s.totalCount !== void 0 && ` • ${s.totalCount} ${o} total`
1540
1590
  ] }),
1541
1591
  /* @__PURE__ */ e(
1542
- vt,
1592
+ It,
1543
1593
  {
1544
1594
  searchQuery: f,
1545
1595
  setSearchQuery: g,
@@ -1549,21 +1599,21 @@ const wt = ({
1549
1599
  ] }),
1550
1600
  E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1551
1601
  "Error loading ",
1552
- l,
1602
+ o,
1553
1603
  ": ",
1554
1604
  E
1555
1605
  ] }),
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: [
1606
+ /* @__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
1607
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1558
1608
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1559
1609
  "Loading ",
1560
- l,
1610
+ o,
1561
1611
  "..."
1562
1612
  ] })
1563
1613
  ] }) }) : 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` })
1614
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Te, { className: "h-8 w-8 text-charcoal" }) }),
1615
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${o} found` : C.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1616
+ /* @__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 ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1567
1617
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1568
1618
  m.map((h) => {
1569
1619
  const c = h.name || h.email || h.id, x = h.email && h.name ? h.email : h.phone;
@@ -1572,7 +1622,7 @@ const wt = ({
1572
1622
  {
1573
1623
  type: "button",
1574
1624
  onClick: () => w(h),
1575
- onKeyDown: (B) => D(B, h),
1625
+ onKeyDown: (A) => T(A, h),
1576
1626
  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
1627
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1578
1628
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
@@ -1590,18 +1640,18 @@ const wt = ({
1590
1640
  x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
1591
1641
  ] })
1592
1642
  ] }),
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" }) })
1643
+ /* @__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(Te, { className: "h-5 w-5 text-stone" }) })
1594
1644
  ] })
1595
1645
  }
1596
1646
  ) }, h.id);
1597
1647
  }),
1598
- p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1648
+ y && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1599
1649
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1600
1650
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1601
1651
  ] }) })
1602
1652
  ] }) })
1603
1653
  ] });
1604
- }, pt = ({ className: t }) => /* @__PURE__ */ i(
1654
+ }, Mt = ({ className: s }) => /* @__PURE__ */ i(
1605
1655
  "svg",
1606
1656
  {
1607
1657
  width: "140",
@@ -1609,7 +1659,7 @@ const wt = ({
1609
1659
  viewBox: "44 -2 144 126",
1610
1660
  fill: "none",
1611
1661
  xmlns: "http://www.w3.org/2000/svg",
1612
- className: t,
1662
+ className: s,
1613
1663
  children: [
1614
1664
  /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1615
1665
  /* @__PURE__ */ e(
@@ -1735,46 +1785,46 @@ const wt = ({
1735
1785
  ] })
1736
1786
  ]
1737
1787
  }
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: [
1788
+ ), He = B.memo(
1789
+ ({ 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: [
1790
+ /* @__PURE__ */ e(Mt, {}),
1791
+ t && !s && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1742
1792
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1743
1793
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1744
1794
  ] })
1745
1795
  ] }) })
1746
1796
  );
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: [
1797
+ He.displayName = "EmptyState";
1798
+ 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
1799
  /* @__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
1800
  /* @__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(
1801
+ /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: s }),
1802
+ t && /* @__PURE__ */ e(
1753
1803
  "button",
1754
1804
  {
1755
1805
  type: "button",
1756
- onClick: s,
1806
+ onClick: t,
1757
1807
  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
1808
  children: "Go Back"
1759
1809
  }
1760
1810
  )
1761
1811
  ] }) }));
1762
1812
  me.displayName = "ErrorState";
1763
- const Tt = ({
1764
- capabilities: t = {},
1765
- className: s,
1813
+ const At = ({
1814
+ capabilities: s = {},
1815
+ className: t,
1766
1816
  renderMessageInputActions: n,
1767
- onChannelSelect: o,
1768
- onParticipantSelect: l,
1817
+ onChannelSelect: r,
1818
+ onParticipantSelect: o,
1769
1819
  initialParticipantFilter: d,
1770
- initialParticipantData: a,
1820
+ initialParticipantData: l,
1771
1821
  CustomChannelEmptyState: u,
1772
1822
  showChannelList: f = !0,
1773
1823
  filters: g,
1774
- channelListCustomEmptyStateIndicator: N,
1775
- onDeleteConversationClick: C,
1776
- onBlockParticipantClick: p,
1777
- onReportParticipantClick: r,
1824
+ channelListCustomEmptyStateIndicator: C,
1825
+ onDeleteConversationClick: N,
1826
+ onBlockParticipantClick: y,
1827
+ onReportParticipantClick: a,
1778
1828
  dmAgentEnabled: E,
1779
1829
  messageMetadata: S,
1780
1830
  onMessageSent: v,
@@ -1782,67 +1832,67 @@ const Tt = ({
1782
1832
  chatbotVotingEnabled: b = !1,
1783
1833
  renderMessagePreview: m,
1784
1834
  renderChannelBanner: w,
1785
- customChannelActions: D
1835
+ customChannelActions: T
1786
1836
  }) => {
1787
1837
  const {
1788
1838
  service: h,
1789
1839
  client: c,
1790
1840
  isConnected: x,
1791
- isLoading: B,
1792
- error: I,
1793
- refreshConnection: T,
1841
+ isLoading: A,
1842
+ error: _,
1843
+ refreshConnection: R,
1794
1844
  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), {
1796
- participantSource: oe,
1845
+ } = qs(), [H, z] = I(null), [ee, Z] = I(!1), [se, te] = I(!1), [re, V] = I(!1), [X, P] = I(/* @__PURE__ */ new Set()), [U, G] = I(0), [F, W] = I(!1), [ae, J] = I(null), Q = Y(null), {
1846
+ participantSource: le,
1797
1847
  participantLabel: Ee = "participants",
1798
- showDeleteConversation: He = !0
1799
- } = t, Ge = j.useMemo(() => {
1800
- const y = c == null ? void 0 : c.userID;
1848
+ showDeleteConversation: Ve = !0
1849
+ } = s, We = B.useMemo(() => {
1850
+ const p = c == null ? void 0 : c.userID;
1801
1851
  return {
1802
1852
  ...{
1803
1853
  type: "messaging",
1804
1854
  last_message_at: { $exists: !0 },
1805
- ...y && {
1806
- members: { $in: [y] },
1855
+ ...p && {
1856
+ members: { $in: [p] },
1807
1857
  hidden: !1
1808
1858
  }
1809
1859
  },
1810
1860
  ...g
1811
1861
  };
1812
- }, [g, c == null ? void 0 : c.userID]), le = q(null), ne = L(async () => {
1862
+ }, [g, c == null ? void 0 : c.userID]), oe = Y(null), ne = L(async () => {
1813
1863
  if (!c || !x) return;
1814
- const y = c.userID;
1815
- if (y)
1864
+ const p = c.userID;
1865
+ if (p)
1816
1866
  try {
1817
- M && console.log("[MessagingShell] Syncing channels for user:", y);
1867
+ M && console.log("[MessagingShell] Syncing channels for user:", p);
1818
1868
  const $ = await c.queryChannels(
1819
1869
  {
1820
1870
  type: "messaging",
1821
- members: { $in: [y] }
1871
+ members: { $in: [p] }
1822
1872
  },
1823
1873
  {},
1824
1874
  { 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);
1875
+ ), O = /* @__PURE__ */ new Set();
1876
+ $.forEach((j) => {
1877
+ const ge = j.state.members;
1878
+ Object.values(ge).forEach((Ke) => {
1879
+ var _e;
1880
+ const xe = (_e = Ke.user) == null ? void 0 : _e.id;
1881
+ xe && xe !== p && O.add(xe);
1832
1882
  });
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:", {
1883
+ }), P((j) => j.size === O.size && [...j].every((ge) => O.has(ge)) ? j : O), Z($.length > 0), te(!0), oe.current = p, M && console.log("[MessagingShell] Channels synced successfully:", {
1834
1884
  channelCount: $.length,
1835
- memberCount: U.size
1885
+ memberCount: O.size
1836
1886
  });
1837
1887
  } catch ($) {
1838
1888
  console.error("[MessagingShell] Failed to sync channels:", $);
1839
1889
  }
1840
1890
  }, [c, x, M]);
1841
- Z(() => {
1891
+ q(() => {
1842
1892
  if (!c || !x) return;
1843
- const y = c.userID;
1844
- y && le.current !== y && ne();
1845
- }, [c, x, ne]), Z(() => {
1893
+ const p = c.userID;
1894
+ p && oe.current !== p && ne();
1895
+ }, [c, x, ne]), q(() => {
1846
1896
  if (!d || !c || !x) return;
1847
1897
  (async () => {
1848
1898
  const $ = c.userID;
@@ -1852,7 +1902,7 @@ const Tt = ({
1852
1902
  "[MessagingShell] Loading initial conversation with:",
1853
1903
  d
1854
1904
  );
1855
- const U = await c.queryChannels(
1905
+ const O = await c.queryChannels(
1856
1906
  {
1857
1907
  type: "messaging",
1858
1908
  members: { $eq: [$, d] }
@@ -1860,127 +1910,127 @@ const Tt = ({
1860
1910
  {},
1861
1911
  { limit: 1 }
1862
1912
  );
1863
- if (U.length > 0)
1864
- z(U[0]), W(!0), Q(null), o && o(U[0]), M && console.log(
1913
+ if (O.length > 0)
1914
+ z(O[0]), W(!0), J(null), r && r(O[0]), M && console.log(
1865
1915
  "[MessagingShell] Initial conversation loaded:",
1866
- U[0].id
1916
+ O[0].id
1867
1917
  );
1868
- else if (a && h) {
1918
+ else if (l && h) {
1869
1919
  M && console.log(
1870
1920
  "[MessagingShell] No conversation found, creating one for:",
1871
- a
1921
+ l
1872
1922
  );
1873
1923
  try {
1874
- const A = await h.startChannelWithParticipant({
1875
- id: a.id,
1876
- name: a.name,
1877
- email: a.email,
1878
- phone: a.phone
1924
+ const j = await h.startChannelWithParticipant({
1925
+ id: l.id,
1926
+ name: l.name,
1927
+ email: l.email,
1928
+ phone: l.phone
1879
1929
  });
1880
- z(A), W(!0), Q(null), o && o(A), M && console.log(
1930
+ z(j), W(!0), J(null), r && r(j), M && console.log(
1881
1931
  "[MessagingShell] Channel created and loaded:",
1882
- A.id
1932
+ j.id
1883
1933
  );
1884
- } catch (A) {
1934
+ } catch (j) {
1885
1935
  console.error(
1886
1936
  "[MessagingShell] Failed to create conversation:",
1887
- A
1888
- ), Q("Failed to create conversation");
1937
+ j
1938
+ ), J("Failed to create conversation");
1889
1939
  }
1890
1940
  } else
1891
- Q(
1941
+ J(
1892
1942
  "No conversation found with this account"
1893
1943
  ), M && console.log(
1894
1944
  "[MessagingShell] No conversation found for:",
1895
1945
  d
1896
1946
  );
1897
- } catch (U) {
1947
+ } catch (O) {
1898
1948
  console.error(
1899
1949
  "[MessagingShell] Failed to load initial conversation:",
1900
- U
1901
- ), Q("Failed to load conversation");
1950
+ O
1951
+ ), J("Failed to load conversation");
1902
1952
  }
1903
1953
  })();
1904
1954
  }, [
1905
1955
  d,
1906
- a,
1956
+ l,
1907
1957
  c,
1908
1958
  x,
1909
1959
  h,
1910
1960
  M,
1911
- o
1961
+ r
1912
1962
  ]);
1913
- const Ve = L(
1914
- (y) => {
1915
- z(y), o == null || o(y);
1963
+ const Ye = L(
1964
+ (p) => {
1965
+ z(p), r == null || r(p);
1916
1966
  },
1917
- [o]
1918
- ), We = L(() => {
1967
+ [r]
1968
+ ), qe = L(() => {
1919
1969
  F || z(null);
1920
- }, [F]), qe = L(
1921
- async (y) => {
1970
+ }, [F]), Ze = L(
1971
+ async (p) => {
1922
1972
  var $;
1923
1973
  if (h)
1924
1974
  try {
1925
1975
  M && console.log(
1926
1976
  "[MessagingShell] Starting conversation with:",
1927
- y.id
1977
+ p.id
1928
1978
  );
1929
- const U = await h.startChannelWithParticipant({
1930
- id: y.id,
1931
- name: y.name,
1932
- email: y.email,
1933
- phone: y.phone
1979
+ const O = await h.startChannelWithParticipant({
1980
+ id: p.id,
1981
+ name: p.name,
1982
+ email: p.email,
1983
+ phone: p.phone
1934
1984
  });
1935
1985
  try {
1936
- await U.show();
1937
- } catch (A) {
1938
- console.warn("[MessagingShell] Failed to unhide channel:", A);
1986
+ await O.show();
1987
+ } catch (j) {
1988
+ console.warn("[MessagingShell] Failed to unhide channel:", j);
1939
1989
  }
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);
1990
+ z(O), V(!1), ($ = Q.current) == null || $.close(), o == null || o(p);
1991
+ } catch (O) {
1992
+ console.error("[MessagingShell] Failed to start conversation:", O);
1943
1993
  }
1944
1994
  },
1945
- [h, l, M]
1995
+ [h, o, M]
1946
1996
  ), 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();
1997
+ var p;
1998
+ V(!1), (p = Q.current) == null || p.close();
1999
+ }, []), Xe = L(
2000
+ (p) => {
2001
+ p.target === Q.current && ie();
1952
2002
  },
1953
2003
  [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();
2004
+ ), Je = L(
2005
+ async (p) => {
2006
+ M && console.log("[MessagingShell] Leaving conversation:", p.id), z(null), W(!1), oe.current = null, await ne();
1957
2007
  },
1958
2008
  [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();
2009
+ ), Qe = L(
2010
+ async (p) => {
2011
+ M && console.log("[MessagingShell] Blocking participant:", p), z(null), W(!1), oe.current = null, await ne();
1962
2012
  },
1963
2013
  [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(
2014
+ ), ce = !!H;
2015
+ return A ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(he, {}) }) : _ ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(me, { message: _, onBack: R }) }) : !x || !c ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(
1966
2016
  me,
1967
2017
  {
1968
2018
  message: "Not connected to messaging service",
1969
- onBack: T
2019
+ onBack: R
1970
2020
  }
1971
- ) }) : ae ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(me, { message: ae }) }) : /* @__PURE__ */ i(
2021
+ ) }) : ae ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(me, { message: ae }) }) : /* @__PURE__ */ i(
1972
2022
  "div",
1973
2023
  {
1974
- className: R(
2024
+ className: D(
1975
2025
  "messaging-shell h-full bg-background-primary overflow-hidden",
1976
- s
2026
+ t
1977
2027
  ),
1978
2028
  children: [
1979
2029
  /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1980
2030
  /* @__PURE__ */ e(
1981
2031
  "div",
1982
2032
  {
1983
- className: R(
2033
+ className: D(
1984
2034
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1985
2035
  {
1986
2036
  "!hidden": f === !1 || F,
@@ -1991,12 +2041,12 @@ const Tt = ({
1991
2041
  }
1992
2042
  ),
1993
2043
  children: /* @__PURE__ */ e(
1994
- Be,
2044
+ je,
1995
2045
  {
1996
- onChannelSelect: Ve,
1997
- selectedChannel: G || void 0,
1998
- filters: Ge,
1999
- customEmptyStateIndicator: N,
2046
+ onChannelSelect: Ye,
2047
+ selectedChannel: H || void 0,
2048
+ filters: We,
2049
+ customEmptyStateIndicator: C,
2000
2050
  renderMessagePreview: m
2001
2051
  }
2002
2052
  )
@@ -2005,7 +2055,7 @@ const Tt = ({
2005
2055
  /* @__PURE__ */ e(
2006
2056
  "div",
2007
2057
  {
2008
- className: R(
2058
+ className: D(
2009
2059
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2010
2060
  {
2011
2061
  // In direct conversation mode (or waiting for it), always show (full width)
@@ -2014,34 +2064,34 @@ const Tt = ({
2014
2064
  "hidden lg:flex": !F && !ce && !d
2015
2065
  }
2016
2066
  ),
2017
- children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2018
- $e,
2067
+ children: H ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2068
+ Ge,
2019
2069
  {
2020
- channel: G,
2021
- onBack: We,
2070
+ channel: H,
2071
+ onBack: qe,
2022
2072
  showBackButton: !F,
2023
2073
  renderMessageInputActions: n,
2024
2074
  renderChannelBanner: w,
2025
- onLeaveConversation: Ye,
2026
- onBlockParticipant: Je,
2075
+ onLeaveConversation: Je,
2076
+ onBlockParticipant: Qe,
2027
2077
  CustomChannelEmptyState: u,
2028
- showDeleteConversation: He,
2029
- onDeleteConversationClick: C,
2030
- onBlockParticipantClick: p,
2031
- onReportParticipantClick: r,
2078
+ showDeleteConversation: Ve,
2079
+ onDeleteConversationClick: N,
2080
+ onBlockParticipantClick: y,
2081
+ onReportParticipantClick: a,
2032
2082
  dmAgentEnabled: E,
2033
2083
  messageMetadata: S,
2034
2084
  onMessageSent: v,
2035
2085
  showStarButton: k,
2036
2086
  chatbotVotingEnabled: b,
2037
- customChannelActions: D
2087
+ customChannelActions: T
2038
2088
  },
2039
- G.id
2089
+ H.id
2040
2090
  ) }) : d ? (
2041
2091
  // Show loading while creating/loading direct conversation channel
2042
2092
  /* @__PURE__ */ e(he, {})
2043
2093
  ) : /* @__PURE__ */ e(
2044
- ze,
2094
+ He,
2045
2095
  {
2046
2096
  hasChannels: ee,
2047
2097
  channelsLoaded: se
@@ -2050,69 +2100,69 @@ const Tt = ({
2050
2100
  }
2051
2101
  )
2052
2102
  ] }),
2053
- oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2103
+ le && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2054
2104
  /* @__PURE__ */ e(
2055
2105
  "dialog",
2056
2106
  {
2057
- ref: X,
2107
+ ref: Q,
2058
2108
  className: "mes-dialog",
2059
- onClick: Ze,
2109
+ onClick: Xe,
2060
2110
  onClose: ie,
2061
2111
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2062
- wt,
2112
+ St,
2063
2113
  {
2064
- participantSource: oe,
2065
- onSelectParticipant: qe,
2114
+ participantSource: le,
2115
+ onSelectParticipant: Ze,
2066
2116
  onClose: ie,
2067
- existingParticipantIds: J,
2117
+ existingParticipantIds: X,
2068
2118
  participantLabel: Ee,
2069
2119
  searchPlaceholder: `Search ${Ee}...`
2070
2120
  },
2071
- O
2121
+ U
2072
2122
  ) })
2073
2123
  }
2074
2124
  )
2075
2125
  ]
2076
2126
  }
2077
2127
  );
2078
- }, yt = ({
2079
- question: t,
2080
- onClick: s,
2128
+ }, kt = ({
2129
+ question: s,
2130
+ onClick: t,
2081
2131
  loading: n = !1,
2082
- className: o
2132
+ className: r
2083
2133
  }) => /* @__PURE__ */ e(
2084
2134
  "button",
2085
2135
  {
2086
2136
  type: "button",
2087
- onClick: s,
2137
+ onClick: t,
2088
2138
  disabled: n,
2089
2139
  style: { backgroundColor: "#E6E5E3" },
2090
- className: R(
2140
+ className: D(
2091
2141
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
2092
2142
  {
2093
2143
  "hover:brightness-95 active:brightness-90": !n,
2094
2144
  "opacity-50 cursor-not-allowed": n
2095
2145
  },
2096
- o
2146
+ r
2097
2147
  ),
2098
- children: t
2148
+ children: s
2099
2149
  }
2100
- ), Ft = ({
2101
- faqs: t,
2102
- onFaqClick: s,
2150
+ ), Bt = ({
2151
+ faqs: s,
2152
+ onFaqClick: t,
2103
2153
  loadingFaqId: n,
2104
- headerText: o,
2105
- className: l,
2154
+ headerText: r,
2155
+ className: o,
2106
2156
  avatarImage: d,
2107
- avatarName: a
2157
+ avatarName: l
2108
2158
  }) => {
2109
- const u = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
2110
- 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(
2159
+ const u = s.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
2160
+ return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2161
+ (d || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2112
2162
  K,
2113
2163
  {
2114
- id: a || "account",
2115
- name: a || "Account",
2164
+ id: l || "account",
2165
+ name: l || "Account",
2116
2166
  image: d,
2117
2167
  size: 24,
2118
2168
  shape: "circle"
@@ -2124,12 +2174,12 @@ const Tt = ({
2124
2174
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
2125
2175
  style: { backgroundColor: "#F1F0EE" },
2126
2176
  children: [
2127
- o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2177
+ r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2128
2178
  u.map((f) => /* @__PURE__ */ e(
2129
- yt,
2179
+ kt,
2130
2180
  {
2131
2181
  question: f.question,
2132
- onClick: () => s(f.id),
2182
+ onClick: () => t(f.id),
2133
2183
  loading: n === f.id
2134
2184
  },
2135
2185
  f.id
@@ -2138,42 +2188,42 @@ const Tt = ({
2138
2188
  }
2139
2189
  )
2140
2190
  ] }) });
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;
2191
+ }, jt = (s, t = {}) => {
2192
+ const { initialSearch: n = "", pageSize: r = 20 } = t, [o, d] = I([]), [l, u] = I(!1), [f, g] = I(null), [C, N] = I(n), [y, a] = I(!0), [E, S] = I(), v = L(async (w = !1, T) => {
2193
+ if (l) return;
2194
+ const h = T !== void 0 ? T : C;
2145
2195
  u(!0), g(null);
2146
2196
  try {
2147
- const c = await t.loadParticipants({
2197
+ const c = await s.loadParticipants({
2148
2198
  search: h || void 0,
2149
- limit: o,
2199
+ limit: r,
2150
2200
  cursor: w ? void 0 : E
2151
2201
  });
2152
2202
  d(
2153
2203
  (x) => w ? c.participants : [...x, ...c.participants]
2154
- ), r(c.hasMore), S(c.nextCursor);
2204
+ ), a(c.hasMore), S(c.nextCursor);
2155
2205
  } catch (c) {
2156
2206
  const x = c instanceof Error ? c.message : "Failed to load participants";
2157
2207
  g(x), console.error("[useParticipants] Load error:", c);
2158
2208
  } finally {
2159
2209
  u(!1);
2160
2210
  }
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);
2211
+ }, [s, C, E, r, l]), k = L(() => {
2212
+ y && !l && v(!1);
2213
+ }, [y, l, v]), b = L((w) => {
2214
+ N(w), S(void 0), v(!0, w);
2165
2215
  }, [v]), m = L(() => {
2166
2216
  S(void 0), v(!0);
2167
2217
  }, [v]);
2168
- return Z(() => {
2218
+ return q(() => {
2169
2219
  v(!0);
2170
- }, [t.loadParticipants]), {
2171
- participants: l,
2172
- loading: a,
2220
+ }, [s.loadParticipants]), {
2221
+ participants: o,
2222
+ loading: l,
2173
2223
  error: f,
2174
- searchQuery: N,
2175
- hasMore: p,
2176
- totalCount: t.totalCount,
2224
+ searchQuery: C,
2225
+ hasMore: y,
2226
+ totalCount: s.totalCount,
2177
2227
  loadMore: k,
2178
2228
  search: b,
2179
2229
  refresh: m
@@ -2182,18 +2232,18 @@ const Tt = ({
2182
2232
  export {
2183
2233
  de as ActionButton,
2184
2234
  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
2235
+ wt as ChannelEmptyState,
2236
+ je as ChannelList,
2237
+ Ge as ChannelView,
2238
+ Bt as FaqList,
2239
+ kt as FaqListItem,
2240
+ it as MessageVoteButtons,
2241
+ Ot as MessagingProvider,
2242
+ At as MessagingShell,
2243
+ St as ParticipantPicker,
2244
+ Xs as formatRelativeTime,
2245
+ at as useMessageVote,
2246
+ qs as useMessaging,
2247
+ jt as useParticipants
2198
2248
  };
2199
2249
  //# sourceMappingURL=index.js.map