@linktr.ee/messaging-react 1.16.0 → 1.17.0-rc-1769666674

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
- import { jsx as e, jsxs as i, Fragment as Ne } from "react/jsx-runtime";
2
- import R from "classnames";
3
- import L, { createContext as Ge, useContext as He, useCallback as D, useState as I, useRef as W, useEffect as q, useMemo as pe } from "react";
4
- import { StreamChatService as Ve } from "@linktr.ee/messaging-core";
5
- import { Chat as We, ChannelList as qe, DateSeparator as Ze, areMessageUIPropsEqual as Ye, useChatContext as Je, useTranslationContext as Qe, useMessageReminder as Xe, useComponentContext as Ke, Attachment as es, Avatar as ss, EditMessageModal as ts, MessageBlocked as ns, MessageBouncePrompt as rs, MessageDeleted as as, MessageIsThreadReplyInChannelButtonIndicator as ls, MessageRepliesCountButton as os, MessageStatus as is, MessageTimestamp as Te, ReminderNotification as cs, StreamedMessageText as ds, messageHasAttachments as ms, messageHasReactions as us, isDateSeparatorMessage as hs, isMessageBlocked as fs, isMessageBounced as gs, isMessageEdited as xs, MessageBounceModal as Cs, Poll as bs, MessageText as Ns, MessageErrorIcon as vs, MessageEditedTimestamp as ws, useMessageContext as ps, useMessageComposer as ys, useStateStore as Es, MessageInput as Is, useMessageInputContext as Ss, useMessageComposerHasSendableData as _s, SimpleAttachmentSelector as Ms, QuotedMessagePreview as ks, AttachmentPreviewList as Rs, TextareaComposer as Ts, Channel as Ds, useChannelStateContext as De, WithComponents as Fs, Window as Ls, MessageList as Ps } from "stream-chat-react";
6
- import { GiftIcon as Os, XIcon as ve, ArrowUpIcon as Us, ArrowLeftIcon as ye, StarIcon as Ee, DotsThreeIcon as Ie, SpinnerGapIcon as ue, SignOutIcon as Bs, ProhibitInsetIcon as Se, FlagIcon as As, MagnifyingGlassIcon as js, ChatCircleDotsIcon as _e } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as Me } from "stream-chat";
8
- const Fe = Ge({
1
+ import { jsx as e, jsxs as c, Fragment as we } from "react/jsx-runtime";
2
+ import M from "classnames";
3
+ import B, { createContext as Ve, useContext as We, useCallback as D, useState as I, useRef as V, useEffect as W, useMemo as Ee } from "react";
4
+ import { StreamChatService as qe } from "@linktr.ee/messaging-core";
5
+ import { Chat as Ze, ChannelList as Ye, DateSeparator as Je, areMessageUIPropsEqual as Qe, useChatContext as Xe, useTranslationContext as Ke, useMessageReminder as es, useComponentContext as ss, Attachment as ts, Avatar as ns, EditMessageModal as rs, MessageBlocked as as, MessageBouncePrompt as ls, MessageDeleted as os, MessageIsThreadReplyInChannelButtonIndicator as is, MessageRepliesCountButton as cs, MessageStatus as ds, MessageTimestamp as Fe, ReminderNotification as ms, StreamedMessageText as us, messageHasAttachments as hs, messageHasReactions as fs, isDateSeparatorMessage as gs, isMessageBlocked as xs, isMessageBounced as Cs, isMessageEdited as bs, MessageBounceModal as Ns, Poll as vs, MessageText as ws, MessageErrorIcon as ps, MessageEditedTimestamp as ys, useMessageContext as Es, useMessageComposer as Is, useStateStore as _s, MessageInput as Ss, useMessageInputContext as Ms, useMessageComposerHasSendableData as ks, SimpleAttachmentSelector as Rs, QuotedMessagePreview as Ts, AttachmentPreviewList as Ds, TextareaComposer as Fs, Channel as Ls, useChannelStateContext as Le, WithComponents as Ps, Window as Os, MessageList as Us } from "stream-chat-react";
6
+ import { GiftIcon as Bs, XIcon as pe, ArrowUpIcon as As, ArrowLeftIcon as Ie, StarIcon as _e, DotsThreeIcon as Se, SpinnerGapIcon as he, SignOutIcon as js, ProhibitInsetIcon as Me, FlagIcon as $s, MagnifyingGlassIcon as zs, ChatCircleDotsIcon as ke } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as Re } from "stream-chat";
8
+ const Pe = Ve({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,19 +15,19 @@ const Fe = Ge({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ge = () => He(Fe), pt = ({
18
+ }), xe = () => We(Pe), Et = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
23
  capabilities: l = {},
24
- debug: c = !1
24
+ debug: d = !1
25
25
  }) => {
26
26
  const a = D(
27
- (d, ...N) => {
28
- c && console.log(`🔥 [MessagingProvider] ${d}`, ...N);
27
+ (i, ...C) => {
28
+ d && console.log(`🔥 [MessagingProvider] ${i}`, ...C);
29
29
  },
30
- [c]
30
+ [d]
31
31
  );
32
32
  a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
@@ -35,84 +35,84 @@ const Fe = Ge({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [u, h] = I(null), [x, p] = I(null), [f, o] = I(!1), [M, S] = I(!1), [g, m] = I(null), b = W(!1), v = W({
38
+ const [m, h] = I(null), [g, p] = I(null), [f, o] = I(!1), [S, E] = I(!1), [b, v] = I(null), N = V(!1), u = V({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), y = W(0);
44
- y.current++, a("📊 RENDER INFO", {
45
- renderCount: y.current,
43
+ }), w = V(0);
44
+ w.current++, a("📊 RENDER INFO", {
45
+ renderCount: w.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: v.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: v.current.apiKey !== r,
50
- serviceConfigChanged: v.current.serviceConfig !== n,
51
- capabilitiesChanged: v.current.capabilities !== l
48
+ userChanged: u.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: u.current.apiKey !== r,
50
+ serviceConfigChanged: u.current.serviceConfig !== n,
51
+ capabilitiesChanged: u.current.capabilities !== l
52
52
  }
53
- }), v.current = {
53
+ }), u.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
- }, q(() => {
59
- const d = y.current;
58
+ }, W(() => {
59
+ const i = w.current;
60
60
  if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: d,
61
+ renderCount: i,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: v.current.serviceConfig === n,
68
- apiKeyStable: v.current.apiKey === r
67
+ serviceConfigStable: u.current.serviceConfig === n,
68
+ apiKeyStable: u.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
71
  a("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: d,
72
+ renderCount: i,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  a("🚀 CREATING NEW SERVICE", {
78
- renderCount: d,
78
+ renderCount: i,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
- serviceConfigChanged: v.current.serviceConfig !== n
80
+ serviceConfigChanged: u.current.serviceConfig !== n
81
81
  });
82
- const N = new Ve({
82
+ const C = new qe({
83
83
  ...n,
84
84
  apiKey: r,
85
- debug: c
85
+ debug: d
86
86
  });
87
- return h(N), a("✅ SERVICE SET", {
88
- renderCount: d,
89
- serviceInstance: !!N
87
+ return h(C), a("✅ SERVICE SET", {
88
+ renderCount: i,
89
+ serviceInstance: !!C
90
90
  }), () => {
91
91
  a("🧹 SERVICE CLEANUP", {
92
- renderCount: d,
92
+ renderCount: i,
93
93
  reason: "Effect cleanup"
94
- }), N.disconnectUser().catch(console.error);
94
+ }), C.disconnectUser().catch(console.error);
95
95
  };
96
- }, [r, n, c, a]);
97
- const _ = W(null);
98
- q(() => {
99
- var N, P;
96
+ }, [r, n, d, a]);
97
+ const _ = V(null);
98
+ W(() => {
99
+ var C, T;
100
100
  if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!u,
101
+ hasService: !!m,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: b.current,
104
+ isConnecting: N.current,
105
105
  isConnected: f,
106
- dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
- }), !u || !s) {
106
+ dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
+ }), !m || !s) {
108
108
  a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (b.current) {
111
+ if (N.current) {
112
112
  a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = _.current) == null ? void 0 : N.serviceId) === u && ((P = _.current) == null ? void 0 : P.userId) === s.id) {
115
+ if (((C = _.current) == null ? void 0 : C.serviceId) === m && ((T = _.current) == null ? void 0 : T.userId) === s.id) {
116
116
  a(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,114 +120,114 @@ const Fe = Ge({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- a("🚀 STARTING USER CONNECTION", { userId: s.id }), b.current = !0, S(!0), m(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), N.current = !0, E(!0), v(null);
124
124
  try {
125
125
  a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const j = await u.connectUser(s);
127
- p(j), o(!0), _.current = { serviceId: u, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
126
+ const j = await m.connectUser(s);
127
+ p(j), o(!0), _.current = { serviceId: m, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: j.userID
130
130
  });
131
131
  } catch (j) {
132
- const z = j instanceof Error ? j.message : "Connection failed";
133
- m(z), a("❌ USER CONNECTION ERROR", {
132
+ const G = j instanceof Error ? j.message : "Connection failed";
133
+ v(G), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: z
135
+ error: G
136
136
  });
137
137
  } finally {
138
- S(!1), b.current = !1, a("🔄 USER CONNECTION FINISHED", {
138
+ E(!1), N.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [u, s, a, f]), q(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
- hasService: !!u,
144
+ }, [m, s, a, f]), W(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!m,
146
146
  isConnected: f
147
147
  }), () => {
148
- u && f ? (a(
148
+ m && f ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), _.current = null, u.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
- hasService: !!u,
151
+ ), _.current = null, m.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!m,
153
153
  isConnected: f
154
154
  });
155
- }), [u, f, a]);
156
- const E = D(async () => {
155
+ }), [m, f, a]);
156
+ const R = D(async () => {
157
157
  if (a("🔄 REFRESH CONNECTION CALLED", {
158
- hasService: !!u,
158
+ hasService: !!m,
159
159
  hasUser: !!s
160
- }), !u || !s) {
160
+ }), !m || !s) {
161
161
  a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), S(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
165
165
  try {
166
- a("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
- const d = await u.connectUser(s);
168
- p(d), o(!0), m(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (d) {
170
- const N = d instanceof Error ? d.message : "Refresh failed";
171
- m(N), a("❌ CONNECTION REFRESH ERROR", {
166
+ a("🔌 DISCONNECTING FOR REFRESH"), await m.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
+ const i = await m.connectUser(s);
168
+ p(i), o(!0), v(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (i) {
170
+ const C = i instanceof Error ? i.message : "Refresh failed";
171
+ v(C), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: N
173
+ error: C
174
174
  });
175
175
  } finally {
176
- S(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ E(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [u, s, a]), C = L.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!u,
180
- hasClient: !!x,
178
+ }, [m, s, a]), x = B.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!m,
180
+ hasClient: !!g,
181
181
  isConnected: f,
182
- isLoading: M,
183
- hasError: !!g,
182
+ isLoading: S,
183
+ hasError: !!b,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
- service: u,
187
- client: x,
186
+ service: m,
187
+ client: g,
188
188
  isConnected: f,
189
- isLoading: M,
190
- error: g,
189
+ isLoading: S,
190
+ error: b,
191
191
  capabilities: l,
192
- refreshConnection: E,
193
- debug: c
192
+ refreshConnection: R,
193
+ debug: d
194
194
  }), [
195
- u,
196
- x,
197
- f,
198
- M,
195
+ m,
199
196
  g,
197
+ f,
198
+ S,
199
+ b,
200
200
  l,
201
- E,
202
- c,
201
+ R,
202
+ d,
203
203
  a
204
204
  ]);
205
205
  return a("🔄 RENDER END", {
206
- renderCount: y.current,
207
- willRenderChat: !!(x && f),
208
- contextValueReady: !!C
209
- }), /* @__PURE__ */ e(Fe.Provider, { value: C, children: x && f ? /* @__PURE__ */ e(
210
- We,
206
+ renderCount: w.current,
207
+ willRenderChat: !!(g && f),
208
+ contextValueReady: !!x
209
+ }), /* @__PURE__ */ e(Pe.Provider, { value: x, children: g && f ? /* @__PURE__ */ e(
210
+ Ze,
211
211
  {
212
- client: x,
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
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, $s = () => ge(), zs = (t, s) => {
219
+ }, Gs = () => xe(), Hs = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
222
  ), l = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
225
  return Math.floor(l / (1e3 * 60 * 60 * 24));
226
- }, Gs = (t) => {
226
+ }, Vs = (t) => {
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
229
  return "Just now";
230
- const r = zs(t, s);
230
+ const r = Hs(t, s);
231
231
  return r === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
@@ -237,7 +237,7 @@ const Fe = Ge({
237
237
  day: "numeric",
238
238
  year: "2-digit"
239
239
  });
240
- }, ke = [
240
+ }, Te = [
241
241
  "🍎",
242
242
  // Apple
243
243
  "🍌",
@@ -265,7 +265,7 @@ const Fe = Ge({
265
265
  "🍈"
266
266
  // Melon
267
267
  ];
268
- function Hs(t) {
268
+ function Ws(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
271
  const r = t.charCodeAt(n);
@@ -273,25 +273,25 @@ function Hs(t) {
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
276
- function Vs(t) {
277
- const n = Hs(t) % ke.length;
278
- return ke[n];
276
+ function qs(t) {
277
+ const n = Ws(t) % Te.length;
278
+ return Te[n];
279
279
  }
280
- const ne = ({
280
+ const se = ({
281
281
  id: t,
282
282
  image: s,
283
283
  size: n = 40,
284
284
  className: r,
285
285
  shape: l = "squircle"
286
286
  }) => {
287
- const c = Vs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = l === "circle" ? { borderRadius: "50%" } : {
287
+ const d = qs(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = l === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: R("flex-shrink-0 overflow-hidden", r),
294
+ className: M("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
@@ -308,119 +308,119 @@ const ne = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: R(
311
+ className: M(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- u
313
+ m
314
314
  ),
315
- children: c
315
+ children: d
316
316
  }
317
317
  )
318
318
  }
319
319
  );
320
- }, Ws = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
320
+ }, Zs = () => /* @__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) => {
326
+ ) }), Ys = (t) => {
327
327
  var s;
328
328
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
329
- }, Zs = (t) => {
329
+ }, Js = (t) => {
330
330
  var s;
331
331
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
332
- }, Le = (t) => {
332
+ }, Oe = (t) => {
333
333
  var s;
334
334
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
335
- }, Pe = (t) => qs(t) || Zs(t), Ys = (t) => {
335
+ }, Ue = (t) => Ys(t) || Js(t), Qs = (t) => {
336
336
  var s;
337
- return Pe(t) && !((s = t.text) != null && s.trim());
338
- }, Re = ({
337
+ return Ue(t) && !((s = t.text) != null && s.trim());
338
+ }, De = ({
339
339
  message: t,
340
340
  standalone: s = !1
341
341
  }) => {
342
342
  var l;
343
- const n = Pe(t), r = Le(t);
343
+ const n = Ue(t), r = Oe(t);
344
344
  if (!n && !r)
345
345
  return null;
346
346
  if (n) {
347
- const c = (l = t.metadata) == null ? void 0 : l.amount_text;
348
- if (!c) return null;
349
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
350
- return /* @__PURE__ */ i("div", { className: a, children: [
351
- /* @__PURE__ */ e(Os, { size: s ? 14 : 12 }),
352
- /* @__PURE__ */ e("span", { children: u })
347
+ const d = (l = t.metadata) == null ? void 0 : l.amount_text;
348
+ if (!d) return null;
349
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", m = s ? `${d} tip` : `Delivered with ${d} tip`;
350
+ return /* @__PURE__ */ c("div", { className: a, children: [
351
+ /* @__PURE__ */ e(Bs, { size: s ? 14 : 12 }),
352
+ /* @__PURE__ */ e("span", { children: m })
353
353
  ] });
354
354
  }
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(Ws, {}) }),
355
+ return /* @__PURE__ */ c("div", { className: "message-tag message-tag--chatbot", children: [
356
+ /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Zs, {}) }),
357
357
  /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
358
358
  ] });
359
- }, Oe = L.memo(
359
+ }, Be = B.memo(
360
360
  ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: l }) => {
361
- var b, v, y, _, E, C;
362
- const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
361
+ var N, u, w, _, R, x;
362
+ const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
363
363
  t && n(t);
364
- }, h = Object.values(((b = t == null ? void 0 : t.state) == null ? void 0 : b.members) || {}).find(
365
- (d) => {
366
- var N, P;
367
- return ((N = d.user) == null ? void 0 : N.id) && d.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
364
+ }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
365
+ (i) => {
366
+ var C, T;
367
+ return ((C = i.user) == null ? void 0 : C.id) && i.user.id !== ((T = t == null ? void 0 : t._client) == null ? void 0 : T.userID);
368
368
  }
369
- ), x = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", p = (y = h == null ? void 0 : h.user) == null ? void 0 : y.image, f = (E = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages) == null ? void 0 : E[t.state.messages.length - 1], M = (() => {
370
- var N;
369
+ ), g = ((u = h == null ? void 0 : h.user) == null ? void 0 : u.name) || "Conversation", p = (w = h == null ? void 0 : h.user) == null ? void 0 : w.image, f = (R = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages) == null ? void 0 : R[t.state.messages.length - 1], S = (() => {
370
+ var C;
371
371
  if (f != null && f.text) return f.text;
372
- const d = (N = f == null ? void 0 : f.attachments) == null ? void 0 : N[0];
373
- return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "📷 Sent an image" : d.type === "video" ? "🎥 Sent a video" : d.type === "audio" ? "🎵 Sent audio" : d.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
374
- })(), S = f != null && f.created_at ? Gs(new Date(f.created_at)) : "", g = f ? Le(f) : !1, m = l ?? 0;
372
+ const i = (C = f == null ? void 0 : f.attachments) == null ? void 0 : C[0];
373
+ 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";
374
+ })(), E = f != null && f.created_at ? Vs(new Date(f.created_at)) : "", b = f ? Oe(f) : !1, v = l ?? 0;
375
375
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
376
376
  channelId: t == null ? void 0 : t.id,
377
- isSelected: c,
378
- participantName: x,
379
- unreadCount: m,
380
- hasTimestamp: !!S
377
+ isSelected: d,
378
+ participantName: g,
379
+ unreadCount: v,
380
+ hasTimestamp: !!E
381
381
  }), /* @__PURE__ */ e(
382
382
  "button",
383
383
  {
384
384
  type: "button",
385
385
  onClick: a,
386
- className: R(
386
+ className: M(
387
387
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
388
388
  {
389
- "bg-primary-alt/10 border-l-4 border-l-primary": c,
390
- "hover:bg-sand": !c
389
+ "bg-primary-alt/10 border-l-4 border-l-primary": d,
390
+ "hover:bg-sand": !d
391
391
  }
392
392
  ),
393
- children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
393
+ children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
394
394
  /* @__PURE__ */ e(
395
- ne,
395
+ se,
396
396
  {
397
- id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
398
- name: x,
397
+ id: ((x = h == null ? void 0 : h.user) == null ? void 0 : x.id) || t.id || "unknown",
398
+ name: g,
399
399
  image: p,
400
400
  size: 44,
401
401
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
402
402
  }
403
403
  ),
404
- /* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
405
- /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
404
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
405
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
406
406
  /* @__PURE__ */ e(
407
407
  "h3",
408
408
  {
409
- className: R(
409
+ className: M(
410
410
  "text-sm font-medium truncate",
411
- c ? "text-primary" : "text-charcoal"
411
+ d ? "text-primary" : "text-charcoal"
412
412
  ),
413
- children: x
413
+ children: g
414
414
  }
415
415
  ),
416
- S && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: S })
416
+ E && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: E })
417
417
  ] }),
418
- /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
419
- /* @__PURE__ */ i("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: [
420
- g && "✨ ",
421
- M
418
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
419
+ /* @__PURE__ */ c("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: [
420
+ b && "✨ ",
421
+ S
422
422
  ] }),
423
- m > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: m > 99 ? "99+" : m })
423
+ v > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: v > 99 ? "99+" : v })
424
424
  ] })
425
425
  ] })
426
426
  ] })
@@ -428,8 +428,8 @@ const ne = ({
428
428
  );
429
429
  }
430
430
  );
431
- Oe.displayName = "CustomChannelPreview";
432
- const Ue = L.memo(
431
+ Be.displayName = "CustomChannelPreview";
432
+ const Ae = B.memo(
433
433
  ({
434
434
  onChannelSelect: t,
435
435
  selectedChannel: s,
@@ -437,18 +437,18 @@ const Ue = L.memo(
437
437
  className: r,
438
438
  customEmptyStateIndicator: l
439
439
  }) => {
440
- const c = L.useRef(0);
441
- c.current++;
442
- const { debug: a = !1 } = ge();
440
+ const d = B.useRef(0);
441
+ d.current++;
442
+ const { debug: a = !1 } = xe();
443
443
  a && console.log("📺 [ChannelList] 🔄 RENDER START", {
444
- renderCount: c.current,
444
+ renderCount: d.current,
445
445
  selectedChannelId: s == null ? void 0 : s.id,
446
446
  filters: n
447
447
  });
448
- const u = L.useMemo(() => (x) => /* @__PURE__ */ e(
449
- Oe,
448
+ const m = B.useMemo(() => (g) => /* @__PURE__ */ e(
449
+ Be,
450
450
  {
451
- ...x,
451
+ ...g,
452
452
  selectedChannel: s,
453
453
  onChannelSelect: t,
454
454
  debug: a
@@ -457,17 +457,17 @@ const Ue = L.memo(
457
457
  return /* @__PURE__ */ e(
458
458
  "div",
459
459
  {
460
- className: R(
460
+ className: M(
461
461
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
462
462
  r
463
463
  ),
464
464
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
465
- qe,
465
+ Ye,
466
466
  {
467
467
  filters: n,
468
468
  sort: { last_message_at: -1 },
469
469
  options: { limit: 30 },
470
- Preview: u,
470
+ Preview: m,
471
471
  EmptyStateIndicator: l
472
472
  },
473
473
  JSON.stringify(n)
@@ -476,8 +476,8 @@ const Ue = L.memo(
476
476
  );
477
477
  }
478
478
  );
479
- Ue.displayName = "ChannelList";
480
- const me = ({
479
+ Ae.displayName = "ChannelList";
480
+ const ue = ({
481
481
  variant: t = "default",
482
482
  className: s,
483
483
  children: n,
@@ -486,7 +486,7 @@ const me = ({
486
486
  "button",
487
487
  {
488
488
  type: "button",
489
- className: R(
489
+ className: M(
490
490
  "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",
491
491
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
492
492
  s
@@ -495,12 +495,12 @@ const me = ({
495
495
  children: n
496
496
  }
497
497
  );
498
- function Be({ label: t, className: s, children: n, ...r }) {
499
- return /* @__PURE__ */ i(
498
+ function je({ label: t, className: s, children: n, ...r }) {
499
+ return /* @__PURE__ */ c(
500
500
  "button",
501
501
  {
502
502
  type: "button",
503
- className: R(
503
+ className: M(
504
504
  "rounded-full p-2 transition-colors focus-ring",
505
505
  {
506
506
  "cursor-not-allowed opacity-50": r.disabled,
@@ -516,59 +516,59 @@ function Be({ label: t, className: s, children: n, ...r }) {
516
516
  }
517
517
  );
518
518
  }
519
- function Ae({ onClick: t }) {
520
- return /* @__PURE__ */ e(Be, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ve, { className: "h-5 w-5 text-stone", weight: "bold" }) });
519
+ function $e({ onClick: t }) {
520
+ return /* @__PURE__ */ e(je, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
521
521
  }
522
- const Js = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Qs = (t) => {
523
- var de, J;
522
+ const Xs = (t) => /* @__PURE__ */ e(Je, { ...t, position: "center" }), Ks = (t) => {
523
+ var ce, de;
524
524
  const {
525
525
  additionalMessageInputProps: s,
526
526
  editing: n,
527
527
  endOfGroup: r,
528
528
  firstOfGroup: l,
529
- groupedByUser: c,
529
+ groupedByUser: d,
530
530
  handleAction: a,
531
- handleOpenThread: u,
531
+ handleOpenThread: m,
532
532
  handleRetry: h,
533
- highlighted: x,
533
+ highlighted: g,
534
534
  isMessageAIGenerated: p,
535
535
  isMyMessage: f,
536
536
  message: o,
537
- onUserClick: M,
538
- onUserHover: S,
539
- renderText: g,
540
- threadList: m
541
- } = t, { client: b } = Je("CustomMessage"), { t: v } = Qe("CustomMessage"), [y, _] = I(!1), [E, C] = I(!1), d = Xe(o.id), {
542
- Attachment: N = es,
543
- Avatar: P = ss,
544
- EditMessageModal: j = ts,
545
- MessageBlocked: z = ns,
546
- MessageBouncePrompt: re = rs,
547
- MessageDeleted: Q = as,
548
- MessageIsThreadReplyInChannelButtonIndicator: X = ls,
549
- MessageRepliesCountButton: K = os,
550
- MessageStatus: ee = is,
551
- MessageTimestamp: ae = Te,
552
- ReminderNotification: O = cs,
553
- StreamedMessageText: G = ds,
554
- PinIndicator: Z
555
- } = Ke("CustomMessage"), k = ms(o), T = us(o), U = pe(
537
+ onUserClick: S,
538
+ onUserHover: E,
539
+ renderText: b,
540
+ threadList: v
541
+ } = t, { client: N } = Xe("CustomMessage"), { t: u } = Ke("CustomMessage"), [w, _] = I(!1), [R, x] = I(!1), i = es(o.id), {
542
+ Attachment: C = ts,
543
+ Avatar: T = ns,
544
+ EditMessageModal: j = rs,
545
+ MessageBlocked: G = as,
546
+ MessageBouncePrompt: J = ls,
547
+ MessageDeleted: te = os,
548
+ MessageIsThreadReplyInChannelButtonIndicator: ne = is,
549
+ MessageRepliesCountButton: q = cs,
550
+ MessageStatus: Q = ds,
551
+ MessageTimestamp: X = Fe,
552
+ ReminderNotification: K = ms,
553
+ StreamedMessageText: re = us,
554
+ PinIndicator: U
555
+ } = ss("CustomMessage"), k = hs(o), F = fs(o), P = Ee(
556
556
  () => p == null ? void 0 : p(o),
557
557
  [p, o]
558
- ), B = pe(
558
+ ), O = Ee(
559
559
  () => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
560
560
  [o]
561
561
  );
562
- if (hs(o))
562
+ if (gs(o))
563
563
  return null;
564
564
  if (o.deleted_at || o.type === "deleted")
565
- return /* @__PURE__ */ e(Q, { message: o });
566
- if (fs(o))
567
- return /* @__PURE__ */ e(z, {});
568
- const se = !c || r, oe = !m && !!o.reply_count, Y = !m && o.show_in_channel && o.parent_id, H = o.status === "failed" && ((de = o.error) == null ? void 0 : de.status) !== 403, ie = gs(o), le = xs(o) && !U;
569
- let V;
570
- H ? V = () => h(o) : ie ? V = () => _(!0) : le && (V = () => C((w) => !w));
571
- const te = R(
565
+ return /* @__PURE__ */ e(te, { message: o });
566
+ if (xs(o))
567
+ return /* @__PURE__ */ e(G, {});
568
+ const Z = !d || r, ae = !v && !!o.reply_count, le = !v && o.show_in_channel && o.parent_id, oe = o.status === "failed" && ((ce = o.error) == null ? void 0 : ce.status) !== 403, Y = Cs(o), z = bs(o) && !P;
569
+ let H;
570
+ oe ? H = () => h(o) : Y ? H = () => _(!0) : z && (H = () => x((be) => !be));
571
+ const Ce = M(
572
572
  "str-chat__message str-chat__message-simple",
573
573
  `str-chat__message--${o.type}`,
574
574
  `str-chat__message--${o.status}`,
@@ -576,120 +576,120 @@ const Js = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Qs = (t)
576
576
  o.text ? "str-chat__message--has-text" : "has-no-text",
577
577
  {
578
578
  "str-chat__message--has-attachment": k,
579
- "str-chat__message--highlighted": x,
579
+ "str-chat__message--highlighted": g,
580
580
  "str-chat__message--pinned pinned-message": o.pinned,
581
- "str-chat__message--with-reactions": T,
582
- "str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((J = o == null ? void 0 : o.error) == null ? void 0 : J.status) !== 403,
583
- "str-chat__message-with-thread-link": oe || Y,
581
+ "str-chat__message--with-reactions": F,
582
+ "str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((de = o == null ? void 0 : o.error) == null ? void 0 : de.status) !== 403,
583
+ "str-chat__message-with-thread-link": ae || le,
584
584
  "str-chat__virtual-message__wrapper--end": r,
585
585
  "str-chat__virtual-message__wrapper--first": l,
586
- "str-chat__virtual-message__wrapper--group": c
586
+ "str-chat__virtual-message__wrapper--group": d
587
587
  }
588
- ), ce = o.poll_id && b.polls.fromState(o.poll_id), xe = Ys(o);
589
- return /* @__PURE__ */ i(Ne, { children: [
588
+ ), ie = o.poll_id && N.polls.fromState(o.poll_id), ee = Qs(o);
589
+ return /* @__PURE__ */ c(we, { children: [
590
590
  n && /* @__PURE__ */ e(
591
591
  j,
592
592
  {
593
593
  additionalMessageInputProps: s
594
594
  }
595
595
  ),
596
- y && /* @__PURE__ */ e(
597
- Cs,
596
+ w && /* @__PURE__ */ e(
597
+ Ns,
598
598
  {
599
- MessageBouncePrompt: re,
599
+ MessageBouncePrompt: J,
600
600
  onClose: () => _(!1),
601
- open: y
601
+ open: w
602
602
  }
603
603
  ),
604
- /* @__PURE__ */ i("div", { className: te, children: [
605
- Z && /* @__PURE__ */ e(Z, {}),
606
- !!d && /* @__PURE__ */ e(O, { reminder: d }),
604
+ /* @__PURE__ */ c("div", { className: Ce, children: [
605
+ U && /* @__PURE__ */ e(U, {}),
606
+ !!i && /* @__PURE__ */ e(K, { reminder: i }),
607
607
  o.user && /* @__PURE__ */ e(
608
- P,
608
+ T,
609
609
  {
610
610
  image: o.user.image,
611
611
  name: o.user.name || o.user.id,
612
- onClick: M,
613
- onMouseOver: S,
612
+ onClick: S,
613
+ onMouseOver: E,
614
614
  user: o.user
615
615
  }
616
616
  ),
617
617
  /* @__PURE__ */ e(
618
618
  "div",
619
619
  {
620
- className: R("str-chat__message-inner", {
621
- "str-chat__simple-message--error-failed": H || ie
620
+ className: M("str-chat__message-inner", {
621
+ "str-chat__simple-message--error-failed": oe || Y
622
622
  }),
623
623
  "data-testid": "message-inner",
624
- onClick: V,
625
- onKeyDown: V,
626
- role: V ? "button" : void 0,
627
- tabIndex: V ? 0 : void 0,
624
+ onClick: H,
625
+ onKeyDown: H,
626
+ role: H ? "button" : void 0,
627
+ tabIndex: H ? 0 : void 0,
628
628
  style: {
629
629
  // Force margins to 0 to prevent hover layout shift
630
630
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
631
631
  marginInlineEnd: 0,
632
632
  marginInlineStart: 0
633
633
  },
634
- children: xe ? (
634
+ children: ee ? (
635
635
  /* Tip-only messages render as a standalone bubble */
636
- /* @__PURE__ */ e(Re, { message: o, standalone: !0 })
637
- ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
638
- /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
639
- ce && /* @__PURE__ */ e(bs, { poll: ce }),
640
- B != null && B.length && !o.quoted_message ? /* @__PURE__ */ e(
641
- N,
636
+ /* @__PURE__ */ e(De, { message: o, standalone: !0 })
637
+ ) : /* @__PURE__ */ c("div", { className: "str-chat__message-bubble-wrapper", children: [
638
+ /* @__PURE__ */ c("div", { className: "str-chat__message-bubble", children: [
639
+ ie && /* @__PURE__ */ e(vs, { poll: ie }),
640
+ O != null && O.length && !o.quoted_message ? /* @__PURE__ */ e(
641
+ C,
642
642
  {
643
643
  actionHandler: a,
644
- attachments: B
644
+ attachments: O
645
645
  }
646
646
  ) : null,
647
- U ? /* @__PURE__ */ e(
648
- G,
647
+ P ? /* @__PURE__ */ e(
648
+ re,
649
649
  {
650
650
  message: o,
651
- renderText: g
651
+ renderText: b
652
652
  }
653
- ) : /* @__PURE__ */ e(Ns, { message: o, renderText: g }),
654
- /* @__PURE__ */ e(vs, {})
653
+ ) : /* @__PURE__ */ e(ws, { message: o, renderText: b }),
654
+ /* @__PURE__ */ e(ps, {})
655
655
  ] }),
656
- /* @__PURE__ */ e(Re, { message: o })
656
+ /* @__PURE__ */ e(De, { message: o })
657
657
  ] })
658
658
  }
659
659
  ),
660
- oe && /* @__PURE__ */ e(
661
- K,
660
+ ae && /* @__PURE__ */ e(
661
+ q,
662
662
  {
663
- onClick: u,
663
+ onClick: m,
664
664
  reply_count: o.reply_count
665
665
  }
666
666
  ),
667
- Y && /* @__PURE__ */ e(X, {}),
668
- se && /* @__PURE__ */ i("div", { className: "str-chat__message-metadata", children: [
669
- /* @__PURE__ */ e(ee, {}),
667
+ le && /* @__PURE__ */ e(ne, {}),
668
+ Z && /* @__PURE__ */ c("div", { className: "str-chat__message-metadata", children: [
669
+ /* @__PURE__ */ e(Q, {}),
670
670
  !f() && !!o.user && /* @__PURE__ */ e("span", { className: "str-chat__message-simple-name", children: o.user.name || o.user.id }),
671
- /* @__PURE__ */ e(ae, { customClass: "str-chat__message-simple-timestamp" }),
672
- le && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: v("Edited") }),
673
- le && /* @__PURE__ */ e(ws, { calendar: !0, open: E })
671
+ /* @__PURE__ */ e(X, { customClass: "str-chat__message-simple-timestamp" }),
672
+ z && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: u("Edited") }),
673
+ z && /* @__PURE__ */ e(ys, { calendar: !0, open: R })
674
674
  ] })
675
675
  ] }, o.id)
676
676
  ] });
677
- }, Xs = L.memo(
678
- Qs,
679
- Ye
680
- ), Ks = (t) => {
681
- const s = ps("CustomMessage");
682
- return /* @__PURE__ */ e(Xs, { ...s, ...t });
683
- }, et = (t) => ({
677
+ }, et = B.memo(
678
+ Ks,
679
+ Qe
680
+ ), st = (t) => {
681
+ const s = Es("CustomMessage");
682
+ return /* @__PURE__ */ e(et, { ...s, ...t });
683
+ }, tt = (t) => ({
684
684
  linkPreviews: Array.from(t.previews.values()).filter(
685
- (s) => Me.previewIsLoaded(s) || Me.previewIsLoading(s)
685
+ (s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
686
686
  )
687
- }), st = ({
687
+ }), nt = ({
688
688
  link: t,
689
689
  onDismiss: s
690
690
  }) => {
691
691
  const { og_scrape_url: n, title: r, image_url: l } = t;
692
- return /* @__PURE__ */ i(
692
+ return /* @__PURE__ */ c(
693
693
  "a",
694
694
  {
695
695
  href: n,
@@ -714,42 +714,42 @@ const Js = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Qs = (t)
714
714
  },
715
715
  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",
716
716
  "aria-label": "Close link preview",
717
- children: /* @__PURE__ */ e(ve, { className: "size-4 text-black/90" })
717
+ children: /* @__PURE__ */ e(pe, { className: "size-4 text-black/90" })
718
718
  }
719
719
  ),
720
- /* @__PURE__ */ i("div", { className: "p-2", children: [
720
+ /* @__PURE__ */ c("div", { className: "p-2", children: [
721
721
  r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
722
722
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
723
723
  ] })
724
724
  ]
725
725
  }
726
726
  );
727
- }, tt = () => {
728
- const { linkPreviewsManager: t } = ys(), { linkPreviews: s } = Es(
727
+ }, rt = () => {
728
+ const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
729
729
  t.state,
730
- et
730
+ tt
731
731
  ), n = (l) => {
732
732
  t.dismissPreview(l);
733
733
  };
734
734
  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(
735
- st,
735
+ nt,
736
736
  {
737
737
  link: l,
738
738
  onDismiss: n
739
739
  },
740
740
  l.og_scrape_url
741
741
  )) }) : null;
742
- }, nt = () => {
743
- const { handleSubmit: t } = Ss(), s = _s();
744
- return /* @__PURE__ */ i(Ne, { children: [
745
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ms, {}) }),
746
- /* @__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: [
747
- /* @__PURE__ */ e(ks, {}),
748
- /* @__PURE__ */ e(tt, {}),
749
- /* @__PURE__ */ e(Rs, {}),
750
- /* @__PURE__ */ i("div", { className: "flex", children: [
742
+ }, at = () => {
743
+ const { handleSubmit: t } = Ms(), s = ks();
744
+ return /* @__PURE__ */ c(we, { children: [
745
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Rs, {}) }),
746
+ /* @__PURE__ */ c("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
747
+ /* @__PURE__ */ e(Ts, {}),
748
+ /* @__PURE__ */ e(rt, {}),
749
+ /* @__PURE__ */ e(Ds, {}),
750
+ /* @__PURE__ */ c("div", { className: "flex", children: [
751
751
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
752
- Ts,
752
+ Fs,
753
753
  {
754
754
  className: "w-full resize-none outline-none leading-6",
755
755
  autoFocus: !0,
@@ -765,33 +765,33 @@ const Js = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Qs = (t)
765
765
  disabled: !s,
766
766
  onClick: t,
767
767
  type: "button",
768
- children: /* @__PURE__ */ e(Us, { className: "size-4" })
768
+ children: /* @__PURE__ */ e(As, { className: "size-4" })
769
769
  }
770
770
  )
771
771
  ] })
772
772
  ] })
773
773
  ] });
774
- }, rt = ({
774
+ }, lt = ({
775
775
  renderActions: t
776
- }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
776
+ }) => /* @__PURE__ */ c("div", { className: "message-input flex items-center gap-2 p-4", children: [
777
777
  t && (t == null ? void 0 : t()),
778
- /* @__PURE__ */ e(Is, { Input: nt })
779
- ] }), at = (t) => {
778
+ /* @__PURE__ */ e(Ss, { Input: at })
779
+ ] }), ot = (t) => {
780
780
  const s = t.message.hide_date === !0;
781
- return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
782
- /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
781
+ return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
782
+ /* @__PURE__ */ c("div", { className: "str-chat__message--system__text", children: [
783
783
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
784
784
  /* @__PURE__ */ e("p", { children: t.message.text }),
785
785
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
786
786
  ] }),
787
- !s && /* @__PURE__ */ e(Te, { message: t.message })
787
+ !s && /* @__PURE__ */ e(Fe, { message: t.message })
788
788
  ] });
789
- }, lt = () => null, ot = ({ className: t, message: s }) => /* @__PURE__ */ i(
789
+ }, it = () => null, ct = ({ className: t, message: s }) => /* @__PURE__ */ c(
790
790
  "div",
791
791
  {
792
- className: R("flex items-center justify-center h-full", t),
792
+ className: M("flex items-center justify-center h-full", t),
793
793
  children: [
794
- /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
794
+ /* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
795
795
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
796
796
  "animateTransform",
797
797
  {
@@ -829,49 +829,49 @@ const Js = (t) => /* @__PURE__ */ e(Ze, { ...t, position: "center" }), Qs = (t)
829
829
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
830
830
  ]
831
831
  }
832
- ), fe = L.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
833
- /* @__PURE__ */ e(ot, { className: "w-6 h-6" }),
832
+ ), ge = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
833
+ /* @__PURE__ */ e(ct, { className: "w-6 h-6" }),
834
834
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
835
835
  ] }) }));
836
- fe.displayName = "LoadingState";
837
- const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
838
- var f, o, M, S, g, m;
839
- const { channel: l } = De(), c = L.useMemo(() => Object.values(l.state.members || {}).find(
840
- (v) => {
841
- var y;
842
- return ((y = v.user) == null ? void 0 : y.id) && v.user.id !== l._client.userID;
836
+ ge.displayName = "LoadingState";
837
+ const dt = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
838
+ var f, o, S, E, b, v;
839
+ const { channel: l } = Le(), d = B.useMemo(() => Object.values(l.state.members || {}).find(
840
+ (u) => {
841
+ var w;
842
+ return ((w = u.user) == null ? void 0 : w.id) && u.user.id !== l._client.userID;
843
843
  }
844
- ), [l._client.userID, l.state.members]), a = ((f = c == null ? void 0 : c.user) == null ? void 0 : f.name) || ((o = c == null ? void 0 : c.user) == null ? void 0 : o.id) || "Unknown member", u = (M = c == null ? void 0 : c.user) == null ? void 0 : M.image, [h, x] = I(
845
- !!((S = l.state.membership) != null && S.pinned_at)
844
+ ), [l._client.userID, l.state.members]), a = ((f = d == null ? void 0 : d.user) == null ? void 0 : f.name) || ((o = d == null ? void 0 : d.user) == null ? void 0 : o.id) || "Unknown member", m = (S = d == null ? void 0 : d.user) == null ? void 0 : S.image, [h, g] = I(
845
+ !!((E = l.state.membership) != null && E.pinned_at)
846
846
  );
847
- q(() => {
848
- const b = (v) => {
849
- var y;
850
- x(
851
- v != null && v.member ? !!v.member.pinned_at : !!((y = l.state.membership) != null && y.pinned_at)
847
+ W(() => {
848
+ const N = (u) => {
849
+ var w;
850
+ g(
851
+ u != null && u.member ? !!u.member.pinned_at : !!((w = l.state.membership) != null && w.pinned_at)
852
852
  );
853
853
  };
854
- return l.on("member.updated", b), () => {
855
- l.off("member.updated", b);
854
+ return l.on("member.updated", N), () => {
855
+ l.off("member.updated", N);
856
856
  };
857
857
  }, [l]);
858
858
  const p = async () => {
859
859
  try {
860
860
  h ? await l.unpin() : await l.pin();
861
- } catch (b) {
861
+ } catch (N) {
862
862
  console.error(
863
863
  "[CustomChannelHeader] Failed to update pinned status:",
864
- b
864
+ N
865
865
  );
866
866
  }
867
867
  };
868
- return /* @__PURE__ */ i("div", { className: "@container", children: [
869
- /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
870
- /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
868
+ return /* @__PURE__ */ c("div", { className: "@container", children: [
869
+ /* @__PURE__ */ c("div", { className: "flex justify-between items-center @lg:hidden", children: [
870
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
871
871
  /* @__PURE__ */ e(
872
872
  "button",
873
873
  {
874
- className: R(
874
+ className: M(
875
875
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
876
876
  !s && "invisible"
877
877
  ),
@@ -879,24 +879,24 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
879
879
  }),
880
880
  type: "button",
881
881
  "aria-label": "Back to conversations",
882
- children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
882
+ children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
883
883
  }
884
884
  ),
885
885
  /* @__PURE__ */ e("div", { className: "size-10" })
886
886
  ] }),
887
- /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
887
+ /* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
888
888
  /* @__PURE__ */ e(
889
- ne,
889
+ se,
890
890
  {
891
- id: ((g = c == null ? void 0 : c.user) == null ? void 0 : g.id) || l.id || "unknown",
891
+ id: ((b = d == null ? void 0 : d.user) == null ? void 0 : b.id) || l.id || "unknown",
892
892
  name: a,
893
- image: u,
893
+ image: m,
894
894
  size: 40
895
895
  }
896
896
  ),
897
897
  /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
898
898
  ] }),
899
- /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
899
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
900
900
  /* @__PURE__ */ e(
901
901
  "button",
902
902
  {
@@ -905,7 +905,7 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
905
905
  type: "button",
906
906
  "aria-label": h ? "Unstar conversation" : "Star conversation",
907
907
  children: /* @__PURE__ */ e(
908
- Ee,
908
+ _e,
909
909
  {
910
910
  className: "size-5 text-black/90",
911
911
  weight: h ? "fill" : "regular"
@@ -920,13 +920,13 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
920
920
  onClick: n,
921
921
  type: "button",
922
922
  "aria-label": "Show info",
923
- children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
923
+ children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
924
924
  }
925
925
  )
926
926
  ] })
927
927
  ] }),
928
- /* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
929
- /* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
928
+ /* @__PURE__ */ c("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
929
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
930
930
  s && t && /* @__PURE__ */ e(
931
931
  "button",
932
932
  {
@@ -934,21 +934,21 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
934
934
  onClick: t,
935
935
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
936
936
  "aria-label": "Back to conversations",
937
- children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
937
+ children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
938
938
  }
939
939
  ),
940
940
  /* @__PURE__ */ e(
941
- ne,
941
+ se,
942
942
  {
943
- id: ((m = c == null ? void 0 : c.user) == null ? void 0 : m.id) || l.id || "unknown",
943
+ id: ((v = d == null ? void 0 : d.user) == null ? void 0 : v.id) || l.id || "unknown",
944
944
  name: a,
945
- image: u,
945
+ image: m,
946
946
  size: 40
947
947
  }
948
948
  ),
949
949
  /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
950
950
  ] }),
951
- /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
951
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
952
952
  /* @__PURE__ */ e(
953
953
  "button",
954
954
  {
@@ -957,7 +957,7 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
957
957
  type: "button",
958
958
  "aria-label": h ? "Unstar conversation" : "Star conversation",
959
959
  children: /* @__PURE__ */ e(
960
- Ee,
960
+ _e,
961
961
  {
962
962
  className: "size-5 text-black/90",
963
963
  weight: h ? "fill" : "regular"
@@ -972,85 +972,85 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
972
972
  onClick: n,
973
973
  type: "button",
974
974
  "aria-label": "Show info",
975
- children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
975
+ children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
976
976
  }
977
977
  )
978
978
  ] })
979
979
  ] })
980
980
  ] });
981
- }, ct = ({
981
+ }, mt = ({
982
982
  dialogRef: t,
983
983
  onClose: s,
984
984
  participant: n,
985
985
  channel: r,
986
986
  followerStatusLabel: l,
987
- onLeaveConversation: c,
987
+ onLeaveConversation: d,
988
988
  onBlockParticipant: a,
989
- showDeleteConversation: u = !0,
989
+ showDeleteConversation: m = !0,
990
990
  onDeleteConversationClick: h,
991
- onBlockParticipantClick: x,
991
+ onBlockParticipantClick: g,
992
992
  onReportParticipantClick: p
993
993
  }) => {
994
- var X, K, ee, ae, O, G, Z;
995
- const { service: f, debug: o } = ge(), [M, S] = I(!1), [g, m] = I(!1), [b, v] = I(!1), y = D(async () => {
994
+ var ne, q, Q, X, K, re, U;
995
+ const { service: f, debug: o } = xe(), [S, E] = I(!1), [b, v] = I(!1), [N, u] = I(!1), w = D(async () => {
996
996
  var k;
997
997
  if (!(!f || !((k = n == null ? void 0 : n.user) != null && k.id)))
998
998
  try {
999
- const U = (await f.getBlockedUsers()).some(
1000
- (B) => {
1001
- var se;
1002
- return B.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
999
+ const P = (await f.getBlockedUsers()).some(
1000
+ (O) => {
1001
+ var Z;
1002
+ return O.blocked_user_id === ((Z = n == null ? void 0 : n.user) == null ? void 0 : Z.id);
1003
1003
  }
1004
1004
  );
1005
- S(U);
1006
- } catch (T) {
1005
+ E(P);
1006
+ } catch (F) {
1007
1007
  console.error(
1008
1008
  "[ChannelInfoDialog] Failed to check blocked status:",
1009
- T
1009
+ F
1010
1010
  );
1011
1011
  }
1012
- }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1013
- q(() => {
1014
- y();
1015
- }, [y]);
1012
+ }, [f, (ne = n == null ? void 0 : n.user) == null ? void 0 : ne.id]);
1013
+ W(() => {
1014
+ w();
1015
+ }, [w]);
1016
1016
  const _ = async () => {
1017
1017
  var k;
1018
- if (!g) {
1019
- h == null || h(), o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), m(!0);
1018
+ if (!b) {
1019
+ h == null || h(), o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), v(!0);
1020
1020
  try {
1021
- const T = ((k = r._client) == null ? void 0 : k.userID) ?? null;
1022
- await r.hide(T, !1), c && await c(r), s();
1023
- } catch (T) {
1024
- console.error("[ChannelInfoDialog] Failed to leave conversation", T);
1021
+ const F = ((k = r._client) == null ? void 0 : k.userID) ?? null;
1022
+ await r.hide(F, !1), d && await d(r), s();
1023
+ } catch (F) {
1024
+ console.error("[ChannelInfoDialog] Failed to leave conversation", F);
1025
1025
  } finally {
1026
- m(!1);
1026
+ v(!1);
1027
1027
  }
1028
1028
  }
1029
- }, E = async () => {
1030
- var k, T, U;
1031
- if (!(b || !f)) {
1032
- x == null || x(), o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), v(!0);
1029
+ }, R = async () => {
1030
+ var k, F, P;
1031
+ if (!(N || !f)) {
1032
+ g == null || g(), o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), u(!0);
1033
1033
  try {
1034
- await f.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
1035
- } catch (B) {
1036
- console.error("[ChannelInfoDialog] Failed to block member", B);
1034
+ await f.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
1035
+ } catch (O) {
1036
+ console.error("[ChannelInfoDialog] Failed to block member", O);
1037
1037
  } finally {
1038
- v(!1);
1038
+ u(!1);
1039
1039
  }
1040
1040
  }
1041
- }, C = async () => {
1042
- var k, T, U;
1043
- if (!(b || !f)) {
1044
- x == null || x(), o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), v(!0);
1041
+ }, x = async () => {
1042
+ var k, F, P;
1043
+ if (!(N || !f)) {
1044
+ g == null || g(), o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), u(!0);
1045
1045
  try {
1046
- await f.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
1047
- } catch (B) {
1048
- console.error("[ChannelInfoDialog] Failed to unblock member", B);
1046
+ await f.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
1047
+ } catch (O) {
1048
+ console.error("[ChannelInfoDialog] Failed to unblock member", O);
1049
1049
  } finally {
1050
- v(!1);
1050
+ u(!1);
1051
1051
  }
1052
1052
  }
1053
- }, d = () => {
1053
+ }, i = () => {
1054
1054
  p == null || p(), s(), window.open(
1055
1055
  "https://linktr.ee/s/about/trust-center/report",
1056
1056
  "_blank",
@@ -1058,7 +1058,7 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1058
1058
  );
1059
1059
  };
1060
1060
  if (!n) return null;
1061
- const N = ((K = n.user) == null ? void 0 : K.name) || ((ee = n.user) == null ? void 0 : ee.id) || "Unknown member", P = (ae = n.user) == null ? void 0 : ae.image, j = (O = n.user) == null ? void 0 : O.email, z = (G = n.user) == null ? void 0 : G.username, re = j || (z ? `linktr.ee/${z}` : void 0), Q = ((Z = n.user) == null ? void 0 : Z.id) || "unknown";
1061
+ const C = ((q = n.user) == null ? void 0 : q.name) || ((Q = n.user) == null ? void 0 : Q.id) || "Unknown member", T = (X = n.user) == null ? void 0 : X.image, j = (K = n.user) == null ? void 0 : K.email, G = (re = n.user) == null ? void 0 : re.username, J = j || (G ? `linktr.ee/${G}` : void 0), te = ((U = n.user) == null ? void 0 : U.id) || "unknown";
1062
1062
  return (
1063
1063
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1064
1064
  /* @__PURE__ */ e(
@@ -1070,31 +1070,31 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1070
1070
  onClick: (k) => {
1071
1071
  k.target === t.current && s();
1072
1072
  },
1073
- 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: [
1074
- /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1073
+ children: /* @__PURE__ */ c("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
1074
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1075
1075
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
1076
- /* @__PURE__ */ e(Ae, { onClick: s })
1076
+ /* @__PURE__ */ e($e, { onClick: s })
1077
1077
  ] }),
1078
- /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1078
+ /* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1079
1079
  /* @__PURE__ */ e(
1080
1080
  "div",
1081
1081
  {
1082
1082
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
1083
1083
  style: { backgroundColor: "#FBFAF9" },
1084
- children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
1084
+ children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
1085
1085
  /* @__PURE__ */ e(
1086
- ne,
1086
+ se,
1087
1087
  {
1088
- id: Q,
1089
- name: N,
1090
- image: P,
1088
+ id: te,
1089
+ name: C,
1090
+ image: T,
1091
1091
  size: 88,
1092
1092
  shape: "circle"
1093
1093
  }
1094
1094
  ),
1095
- /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1096
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: N }),
1097
- re && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: re }),
1095
+ /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
1096
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
1097
+ J && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: J }),
1098
1098
  l && /* @__PURE__ */ e(
1099
1099
  "span",
1100
1100
  {
@@ -1113,44 +1113,44 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1113
1113
  ] })
1114
1114
  }
1115
1115
  ),
1116
- /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
1117
- u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1118
- me,
1116
+ /* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
1117
+ m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
1118
+ ue,
1119
1119
  {
1120
1120
  onClick: _,
1121
- disabled: g,
1122
- "aria-busy": g,
1121
+ disabled: b,
1122
+ "aria-busy": b,
1123
1123
  children: [
1124
- g ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Bs, { className: "h-5 w-5" }),
1124
+ b ? /* @__PURE__ */ e(he, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(js, { className: "h-5 w-5" }),
1125
1125
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1126
1126
  ]
1127
1127
  }
1128
1128
  ) }),
1129
- /* @__PURE__ */ e("li", { children: M ? /* @__PURE__ */ i(
1130
- me,
1129
+ /* @__PURE__ */ e("li", { children: S ? /* @__PURE__ */ c(
1130
+ ue,
1131
1131
  {
1132
- onClick: C,
1133
- disabled: b,
1134
- "aria-busy": b,
1132
+ onClick: x,
1133
+ disabled: N,
1134
+ "aria-busy": N,
1135
1135
  children: [
1136
- b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5" }),
1136
+ N ? /* @__PURE__ */ e(he, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1137
1137
  /* @__PURE__ */ e("span", { children: "Unblock" })
1138
1138
  ]
1139
1139
  }
1140
- ) : /* @__PURE__ */ i(
1141
- me,
1140
+ ) : /* @__PURE__ */ c(
1141
+ ue,
1142
1142
  {
1143
- onClick: E,
1144
- disabled: b,
1145
- "aria-busy": b,
1143
+ onClick: R,
1144
+ disabled: N,
1145
+ "aria-busy": N,
1146
1146
  children: [
1147
- b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5" }),
1147
+ N ? /* @__PURE__ */ e(he, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1148
1148
  /* @__PURE__ */ e("span", { children: "Block" })
1149
1149
  ]
1150
1150
  }
1151
1151
  ) }),
1152
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(me, { variant: "danger", onClick: d, children: [
1153
- /* @__PURE__ */ e(As, { className: "h-5 w-5" }),
1152
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(ue, { variant: "danger", onClick: i, children: [
1153
+ /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1154
1154
  /* @__PURE__ */ e("span", { children: "Report" })
1155
1155
  ] }) })
1156
1156
  ] })
@@ -1159,54 +1159,54 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1159
1159
  }
1160
1160
  )
1161
1161
  );
1162
- }, dt = ({
1162
+ }, ut = ({
1163
1163
  onBack: t,
1164
1164
  showBackButton: s,
1165
1165
  renderMessageInputActions: n,
1166
1166
  onLeaveConversation: r,
1167
1167
  onBlockParticipant: l,
1168
- showDeleteConversation: c = !0,
1168
+ showDeleteConversation: d = !0,
1169
1169
  onDeleteConversationClick: a,
1170
- onBlockParticipantClick: u,
1170
+ onBlockParticipantClick: m,
1171
1171
  onReportParticipantClick: h
1172
1172
  }) => {
1173
- const { channel: x } = De(), p = W(null), f = L.useMemo(() => Object.values(x.state.members || {}).find(
1174
- (m) => {
1175
- var b;
1176
- return ((b = m.user) == null ? void 0 : b.id) && m.user.id !== x._client.userID;
1173
+ const { channel: g } = Le(), p = V(null), f = B.useMemo(() => Object.values(g.state.members || {}).find(
1174
+ (v) => {
1175
+ var N;
1176
+ return ((N = v.user) == null ? void 0 : N.id) && v.user.id !== g._client.userID;
1177
1177
  }
1178
- ), [x._client.userID, x.state.members]), o = L.useMemo(() => {
1179
- const g = x.data ?? {};
1180
- if (g.followerStatus)
1181
- return String(g.followerStatus);
1182
- if (g.isFollower !== void 0)
1183
- return g.isFollower ? "Subscribed to you" : "Not subscribed";
1184
- }, [x.data]), M = D(() => {
1185
- var g;
1186
- (g = p.current) == null || g.showModal();
1187
- }, []), S = D(() => {
1188
- var g;
1189
- (g = p.current) == null || g.close();
1178
+ ), [g._client.userID, g.state.members]), o = B.useMemo(() => {
1179
+ const b = g.data ?? {};
1180
+ if (b.followerStatus)
1181
+ return String(b.followerStatus);
1182
+ if (b.isFollower !== void 0)
1183
+ return b.isFollower ? "Subscribed to you" : "Not subscribed";
1184
+ }, [g.data]), S = D(() => {
1185
+ var b;
1186
+ (b = p.current) == null || b.showModal();
1187
+ }, []), E = D(() => {
1188
+ var b;
1189
+ (b = p.current) == null || b.close();
1190
1190
  }, []);
1191
- return /* @__PURE__ */ i(Ne, { children: [
1191
+ return /* @__PURE__ */ c(we, { children: [
1192
1192
  /* @__PURE__ */ e(
1193
- Fs,
1193
+ Ps,
1194
1194
  {
1195
1195
  overrides: {
1196
- Message: (g) => /* @__PURE__ */ e(Ks, { ...g })
1196
+ Message: (b) => /* @__PURE__ */ e(st, { ...b })
1197
1197
  },
1198
- children: /* @__PURE__ */ i(Ls, { children: [
1198
+ children: /* @__PURE__ */ c(Os, { children: [
1199
1199
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1200
- it,
1200
+ dt,
1201
1201
  {
1202
1202
  onBack: t,
1203
1203
  showBackButton: s,
1204
- onShowInfo: M,
1204
+ onShowInfo: S,
1205
1205
  canShowInfo: !!f
1206
1206
  }
1207
1207
  ) }),
1208
1208
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1209
- Ps,
1209
+ Us,
1210
1210
  {
1211
1211
  hideDeletedMessages: !0,
1212
1212
  hideNewMessageSeparator: !1,
@@ -1214,85 +1214,91 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1214
1214
  }
1215
1215
  ) }),
1216
1216
  /* @__PURE__ */ e(
1217
- rt,
1217
+ lt,
1218
1218
  {
1219
- renderActions: () => n == null ? void 0 : n(x)
1219
+ renderActions: () => n == null ? void 0 : n(g)
1220
1220
  }
1221
1221
  )
1222
1222
  ] })
1223
1223
  }
1224
1224
  ),
1225
1225
  /* @__PURE__ */ e(
1226
- ct,
1226
+ mt,
1227
1227
  {
1228
1228
  dialogRef: p,
1229
- onClose: S,
1229
+ onClose: E,
1230
1230
  participant: f,
1231
- channel: x,
1231
+ channel: g,
1232
1232
  followerStatusLabel: o,
1233
1233
  onLeaveConversation: r,
1234
1234
  onBlockParticipant: l,
1235
- showDeleteConversation: c,
1235
+ showDeleteConversation: d,
1236
1236
  onDeleteConversationClick: a,
1237
- onBlockParticipantClick: u,
1237
+ onBlockParticipantClick: m,
1238
1238
  onReportParticipantClick: h
1239
1239
  }
1240
1240
  )
1241
1241
  ] });
1242
- }, je = L.memo(
1242
+ }, ze = B.memo(
1243
1243
  ({
1244
1244
  channel: t,
1245
1245
  onBack: s,
1246
1246
  showBackButton: n = !1,
1247
1247
  renderMessageInputActions: r,
1248
1248
  onLeaveConversation: l,
1249
- onBlockParticipant: c,
1249
+ onBlockParticipant: d,
1250
1250
  className: a,
1251
- CustomChannelEmptyState: u = lt,
1251
+ CustomChannelEmptyState: m = it,
1252
1252
  showDeleteConversation: h = !0,
1253
- onDeleteConversationClick: x,
1253
+ onDeleteConversationClick: g,
1254
1254
  onBlockParticipantClick: p,
1255
1255
  onReportParticipantClick: f,
1256
- dmAgentEnabled: o
1256
+ dmAgentEnabled: o,
1257
+ messageMetadata: S,
1258
+ onMessageSent: E
1257
1259
  }) => {
1258
- const M = D(
1259
- async (S, g, m) => {
1260
- var y;
1261
- const b = ((y = t.data) == null ? void 0 : y.chatbot_paused) === !0;
1262
- return o && !b ? t.sendMessage(
1263
- { ...g, silent: !0 },
1264
- { ...m, skip_push: !0 }
1265
- ) : t.sendMessage(g, m);
1260
+ const b = D(
1261
+ async (v, N, u) => {
1262
+ var C;
1263
+ const w = ((C = t.data) == null ? void 0 : C.chatbot_paused) === !0, _ = o && !w, R = {
1264
+ ...N,
1265
+ ..._ && { silent: !0 },
1266
+ ...S && S
1267
+ }, x = {
1268
+ ...u,
1269
+ ..._ && { skip_push: !0 }
1270
+ }, i = await t.sendMessage(R, x);
1271
+ return E == null || E(i), i;
1266
1272
  },
1267
- [t, o]
1273
+ [t, o, S, E]
1268
1274
  );
1269
1275
  return /* @__PURE__ */ e(
1270
1276
  "div",
1271
1277
  {
1272
- className: R(
1278
+ className: M(
1273
1279
  "messaging-channel-view h-full flex flex-col",
1274
1280
  a
1275
1281
  ),
1276
1282
  children: /* @__PURE__ */ e(
1277
- Ds,
1283
+ Ls,
1278
1284
  {
1279
1285
  channel: t,
1280
- MessageSystem: at,
1281
- EmptyStateIndicator: u,
1282
- LoadingIndicator: fe,
1283
- DateSeparator: Js,
1284
- doSendMessageRequest: M,
1286
+ MessageSystem: ot,
1287
+ EmptyStateIndicator: m,
1288
+ LoadingIndicator: ge,
1289
+ DateSeparator: Xs,
1290
+ doSendMessageRequest: b,
1285
1291
  children: /* @__PURE__ */ e(
1286
- dt,
1292
+ ut,
1287
1293
  {
1288
1294
  onBack: s,
1289
1295
  showBackButton: n,
1290
1296
  renderMessageInputActions: r,
1291
1297
  onLeaveConversation: l,
1292
- onBlockParticipant: c,
1293
- CustomChannelEmptyState: u,
1298
+ onBlockParticipant: d,
1299
+ CustomChannelEmptyState: m,
1294
1300
  showDeleteConversation: h,
1295
- onDeleteConversationClick: x,
1301
+ onDeleteConversationClick: g,
1296
1302
  onBlockParticipantClick: p,
1297
1303
  onReportParticipantClick: f
1298
1304
  }
@@ -1303,16 +1309,16 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1303
1309
  );
1304
1310
  }
1305
1311
  );
1306
- je.displayName = "ChannelView";
1307
- function mt({
1312
+ ze.displayName = "ChannelView";
1313
+ function ht({
1308
1314
  searchQuery: t,
1309
1315
  setSearchQuery: s,
1310
1316
  placeholder: n
1311
1317
  }) {
1312
- const r = W(null);
1313
- return /* @__PURE__ */ i("div", { className: "relative", children: [
1318
+ const r = V(null);
1319
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
1314
1320
  /* @__PURE__ */ e(
1315
- js,
1321
+ zs,
1316
1322
  {
1317
1323
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1318
1324
  weight: "bold"
@@ -1330,7 +1336,7 @@ function mt({
1330
1336
  }
1331
1337
  ),
1332
1338
  t && /* @__PURE__ */ e(
1333
- Be,
1339
+ je,
1334
1340
  {
1335
1341
  label: "Clear search",
1336
1342
  onClick: () => {
@@ -1338,149 +1344,149 @@ function mt({
1338
1344
  s(""), (l = r.current) == null || l.focus();
1339
1345
  },
1340
1346
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1341
- children: /* @__PURE__ */ e(ve, { className: "h-4 w-4", weight: "bold" })
1347
+ children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
1342
1348
  }
1343
1349
  )
1344
1350
  ] });
1345
1351
  }
1346
- const ut = ({
1352
+ const ft = ({
1347
1353
  participantSource: t,
1348
1354
  onSelectParticipant: s,
1349
1355
  onClose: n,
1350
1356
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
1351
1357
  participantLabel: l = "participants",
1352
- searchPlaceholder: c = "Search participants...",
1358
+ searchPlaceholder: d = "Search participants...",
1353
1359
  className: a
1354
1360
  }) => {
1355
- const { debug: u } = ge(), [h, x] = I(""), [p, f] = I([]), [o, M] = I(!1), [S, g] = I(null), [m, b] = I(
1361
+ const { debug: m } = xe(), [h, g] = I(""), [p, f] = I([]), [o, S] = I(!1), [E, b] = I(null), [v, N] = I(
1356
1362
  null
1357
- ), v = W(!1);
1358
- q(() => {
1363
+ ), u = V(!1);
1364
+ W(() => {
1359
1365
  if (t.loading) {
1360
- u && console.log(
1366
+ m && console.log(
1361
1367
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1362
1368
  );
1363
1369
  return;
1364
1370
  }
1365
- if (v.current) return;
1371
+ if (u.current) return;
1366
1372
  (async () => {
1367
- u && console.log("[ParticipantPicker] Loading initial participants..."), M(!0), g(null);
1373
+ m && console.log("[ParticipantPicker] Loading initial participants..."), S(!0), b(null);
1368
1374
  try {
1369
- const d = await t.loadParticipants({
1375
+ const i = await t.loadParticipants({
1370
1376
  search: "",
1371
1377
  // Load all participants initially
1372
1378
  limit: 100
1373
1379
  });
1374
- f(d.participants), v.current = !0, u && console.log(
1380
+ f(i.participants), u.current = !0, m && console.log(
1375
1381
  "[ParticipantPicker] Participants loaded successfully:",
1376
- d.participants.length
1382
+ i.participants.length
1377
1383
  );
1378
- } catch (d) {
1379
- const N = d instanceof Error ? d.message : "Failed to load participants";
1380
- g(N), console.error("[ParticipantPicker] Failed to load participants:", d);
1384
+ } catch (i) {
1385
+ const C = i instanceof Error ? i.message : "Failed to load participants";
1386
+ b(C), console.error("[ParticipantPicker] Failed to load participants:", i);
1381
1387
  } finally {
1382
- M(!1);
1388
+ S(!1);
1383
1389
  }
1384
1390
  })();
1385
- }, [t.loading, u]);
1386
- const y = p.filter((C) => !r.has(C.id)).filter((C) => {
1387
- var N;
1391
+ }, [t.loading, m]);
1392
+ const w = p.filter((x) => !r.has(x.id)).filter((x) => {
1393
+ var C;
1388
1394
  if (!h) return !0;
1389
- const d = h.toLowerCase();
1390
- return C.name.toLowerCase().includes(d) || ((N = C.email) == null ? void 0 : N.toLowerCase().includes(d)) || !1;
1395
+ const i = h.toLowerCase();
1396
+ return x.name.toLowerCase().includes(i) || ((C = x.email) == null ? void 0 : C.toLowerCase().includes(i)) || !1;
1391
1397
  }), _ = D(
1392
- async (C) => {
1393
- if (!m) {
1394
- b(C.id);
1398
+ async (x) => {
1399
+ if (!v) {
1400
+ N(x.id);
1395
1401
  try {
1396
- await s(C);
1397
- } catch (d) {
1398
- console.error("[ParticipantPicker] Failed to start chat:", d), b(null);
1402
+ await s(x);
1403
+ } catch (i) {
1404
+ console.error("[ParticipantPicker] Failed to start chat:", i), N(null);
1399
1405
  }
1400
1406
  }
1401
1407
  },
1402
- [s, m]
1403
- ), E = (C, d) => {
1404
- (C.key === "Enter" || C.key === " ") && (C.preventDefault(), _(d));
1408
+ [s, v]
1409
+ ), R = (x, i) => {
1410
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), _(i));
1405
1411
  };
1406
- return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
1407
- /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1408
- /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1412
+ return /* @__PURE__ */ c("div", { className: M("flex flex-col h-full", a), children: [
1413
+ /* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1414
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
1409
1415
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1410
- /* @__PURE__ */ e(Ae, { onClick: n })
1416
+ /* @__PURE__ */ e($e, { onClick: n })
1411
1417
  ] }),
1412
- /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1418
+ /* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
1413
1419
  "Select a ",
1414
1420
  l.slice(0, -1),
1415
1421
  " to start messaging (",
1416
- y.length,
1422
+ w.length,
1417
1423
  " available)",
1418
1424
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1419
1425
  ] }),
1420
1426
  /* @__PURE__ */ e(
1421
- mt,
1427
+ ht,
1422
1428
  {
1423
1429
  searchQuery: h,
1424
- setSearchQuery: x,
1425
- placeholder: c
1430
+ setSearchQuery: g,
1431
+ placeholder: d
1426
1432
  }
1427
1433
  )
1428
1434
  ] }),
1429
- S && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1435
+ E && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1430
1436
  "Error loading ",
1431
1437
  l,
1432
1438
  ": ",
1433
- S
1439
+ E
1434
1440
  ] }),
1435
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: o && y.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: [
1441
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: o && w.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1436
1442
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1437
- /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1443
+ /* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
1438
1444
  "Loading ",
1439
1445
  l,
1440
1446
  "..."
1441
1447
  ] })
1442
- ] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1443
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(_e, { className: "h-8 w-8 text-charcoal" }) }),
1448
+ ] }) }) : w.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
1449
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ke, { className: "h-8 w-8 text-charcoal" }) }),
1444
1450
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${l} found` : p.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1445
1451
  /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : p.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1446
- ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1447
- y.map((C) => {
1448
- const d = C.name || C.email || C.id, N = C.email && C.name ? C.email : C.phone;
1452
+ ] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
1453
+ w.map((x) => {
1454
+ const i = x.name || x.email || x.id, C = x.email && x.name ? x.email : x.phone;
1449
1455
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1450
1456
  "button",
1451
1457
  {
1452
1458
  type: "button",
1453
- onClick: () => _(C),
1454
- onKeyDown: (P) => E(P, C),
1459
+ onClick: () => _(x),
1460
+ onKeyDown: (T) => R(T, x),
1455
1461
  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",
1456
- children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1457
- /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1462
+ children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1463
+ /* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1458
1464
  /* @__PURE__ */ e(
1459
- ne,
1465
+ se,
1460
1466
  {
1461
- id: C.id,
1462
- name: d,
1463
- image: C.image,
1467
+ id: x.id,
1468
+ name: i,
1469
+ image: x.image,
1464
1470
  size: 40
1465
1471
  }
1466
1472
  ),
1467
- /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1468
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: d }),
1469
- N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1473
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
1474
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: i }),
1475
+ C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1470
1476
  ] })
1471
1477
  ] }),
1472
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: m === C.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(_e, { className: "h-5 w-5 text-stone" }) })
1478
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === x.id ? /* @__PURE__ */ e(he, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
1473
1479
  ] })
1474
1480
  }
1475
- ) }, C.id);
1481
+ ) }, x.id);
1476
1482
  }),
1477
- o && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1483
+ o && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1478
1484
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1479
1485
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1480
1486
  ] }) })
1481
1487
  ] }) })
1482
1488
  ] });
1483
- }, ht = ({ className: t }) => /* @__PURE__ */ i(
1489
+ }, gt = ({ className: t }) => /* @__PURE__ */ c(
1484
1490
  "svg",
1485
1491
  {
1486
1492
  width: "140",
@@ -1490,7 +1496,7 @@ const ut = ({
1490
1496
  xmlns: "http://www.w3.org/2000/svg",
1491
1497
  className: t,
1492
1498
  children: [
1493
- /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1499
+ /* @__PURE__ */ c("g", { clipPath: "url(#clip0_empty_state)", children: [
1494
1500
  /* @__PURE__ */ e(
1495
1501
  "path",
1496
1502
  {
@@ -1519,7 +1525,7 @@ const ut = ({
1519
1525
  fill: "white"
1520
1526
  }
1521
1527
  ),
1522
- /* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
1528
+ /* @__PURE__ */ c("g", { filter: "url(#filter0_empty_state)", children: [
1523
1529
  /* @__PURE__ */ e(
1524
1530
  "path",
1525
1531
  {
@@ -1559,8 +1565,8 @@ const ut = ({
1559
1565
  }
1560
1566
  )
1561
1567
  ] }),
1562
- /* @__PURE__ */ i("defs", { children: [
1563
- /* @__PURE__ */ i(
1568
+ /* @__PURE__ */ c("defs", { children: [
1569
+ /* @__PURE__ */ c(
1564
1570
  "filter",
1565
1571
  {
1566
1572
  id: "filter0_empty_state",
@@ -1614,17 +1620,17 @@ const ut = ({
1614
1620
  ] })
1615
1621
  ]
1616
1622
  }
1617
- ), $e = L.memo(
1618
- ({ 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: [
1619
- /* @__PURE__ */ e(ht, {}),
1620
- s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1623
+ ), Ge = B.memo(
1624
+ ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1625
+ /* @__PURE__ */ e(gt, {}),
1626
+ s && !t && /* @__PURE__ */ c("div", { className: "mt-8", children: [
1621
1627
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1622
1628
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1623
1629
  ] })
1624
1630
  ] }) })
1625
1631
  );
1626
- $e.displayName = "EmptyState";
1627
- const he = L.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: [
1632
+ Ge.displayName = "EmptyState";
1633
+ const fe = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1628
1634
  /* @__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: "⚠️" }) }),
1629
1635
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1630
1636
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1638,118 +1644,120 @@ const he = L.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1638
1644
  }
1639
1645
  )
1640
1646
  ] }) }));
1641
- he.displayName = "ErrorState";
1642
- const yt = ({
1647
+ fe.displayName = "ErrorState";
1648
+ const It = ({
1643
1649
  capabilities: t = {},
1644
1650
  className: s,
1645
1651
  renderMessageInputActions: n,
1646
1652
  onChannelSelect: r,
1647
1653
  onParticipantSelect: l,
1648
- initialParticipantFilter: c,
1654
+ initialParticipantFilter: d,
1649
1655
  initialParticipantData: a,
1650
- CustomChannelEmptyState: u,
1656
+ CustomChannelEmptyState: m,
1651
1657
  showChannelList: h = !0,
1652
- filters: x,
1658
+ filters: g,
1653
1659
  channelListCustomEmptyStateIndicator: p,
1654
1660
  onDeleteConversationClick: f,
1655
1661
  onBlockParticipantClick: o,
1656
- onReportParticipantClick: M,
1657
- dmAgentEnabled: S
1662
+ onReportParticipantClick: S,
1663
+ dmAgentEnabled: E,
1664
+ messageMetadata: b,
1665
+ onMessageSent: v
1658
1666
  }) => {
1659
1667
  const {
1660
- service: g,
1661
- client: m,
1662
- isConnected: b,
1663
- isLoading: v,
1664
- error: y,
1665
- refreshConnection: _,
1666
- debug: E
1667
- } = $s(), [C, d] = I(null), [N, P] = I(!1), [j, z] = I(!1), [re, Q] = I(!1), [X, K] = I(/* @__PURE__ */ new Set()), [ee, ae] = I(0), [O, G] = I(!1), [Z, k] = I(null), T = W(null), {
1668
- participantSource: U,
1669
- participantLabel: B = "participants",
1670
- showDeleteConversation: se = !0
1671
- } = t, oe = L.useMemo(() => {
1672
- const w = m == null ? void 0 : m.userID;
1668
+ service: N,
1669
+ client: u,
1670
+ isConnected: w,
1671
+ isLoading: _,
1672
+ error: R,
1673
+ refreshConnection: x,
1674
+ debug: i
1675
+ } = Gs(), [C, T] = I(null), [j, G] = I(!1), [J, te] = I(!1), [ne, q] = I(!1), [Q, X] = I(/* @__PURE__ */ new Set()), [K, re] = I(0), [U, k] = I(!1), [F, P] = I(null), O = V(null), {
1676
+ participantSource: Z,
1677
+ participantLabel: ae = "participants",
1678
+ showDeleteConversation: le = !0
1679
+ } = t, oe = B.useMemo(() => {
1680
+ const y = u == null ? void 0 : u.userID;
1673
1681
  return {
1674
1682
  ...{
1675
1683
  type: "messaging",
1676
1684
  last_message_at: { $exists: !0 },
1677
- ...w && {
1678
- members: { $in: [w] },
1685
+ ...y && {
1686
+ members: { $in: [y] },
1679
1687
  hidden: !1
1680
1688
  }
1681
1689
  },
1682
- ...x
1690
+ ...g
1683
1691
  };
1684
- }, [x, m == null ? void 0 : m.userID]), Y = W(null), H = D(async () => {
1685
- if (!m || !b) return;
1686
- const w = m.userID;
1687
- if (w)
1692
+ }, [g, u == null ? void 0 : u.userID]), Y = V(null), z = D(async () => {
1693
+ if (!u || !w) return;
1694
+ const y = u.userID;
1695
+ if (y)
1688
1696
  try {
1689
- E && console.log("[MessagingShell] Syncing channels for user:", w);
1690
- const $ = await m.queryChannels(
1697
+ i && console.log("[MessagingShell] Syncing channels for user:", y);
1698
+ const $ = await u.queryChannels(
1691
1699
  {
1692
1700
  type: "messaging",
1693
- members: { $in: [w] }
1701
+ members: { $in: [y] }
1694
1702
  },
1695
1703
  {},
1696
1704
  { limit: 100 }
1697
- ), F = /* @__PURE__ */ new Set();
1705
+ ), L = /* @__PURE__ */ new Set();
1698
1706
  $.forEach((A) => {
1699
- const Ce = A.state.members;
1700
- Object.values(Ce).forEach((ze) => {
1701
- var we;
1702
- const be = (we = ze.user) == null ? void 0 : we.id;
1703
- be && be !== w && F.add(be);
1707
+ const Ne = A.state.members;
1708
+ Object.values(Ne).forEach((He) => {
1709
+ var ye;
1710
+ const ve = (ye = He.user) == null ? void 0 : ye.id;
1711
+ ve && ve !== y && L.add(ve);
1704
1712
  });
1705
- }), K((A) => A.size === F.size && [...A].every((Ce) => F.has(Ce)) ? A : F), P($.length > 0), z(!0), Y.current = w, E && console.log("[MessagingShell] Channels synced successfully:", {
1713
+ }), X((A) => A.size === L.size && [...A].every((Ne) => L.has(Ne)) ? A : L), G($.length > 0), te(!0), Y.current = y, i && console.log("[MessagingShell] Channels synced successfully:", {
1706
1714
  channelCount: $.length,
1707
- memberCount: F.size
1715
+ memberCount: L.size
1708
1716
  });
1709
1717
  } catch ($) {
1710
1718
  console.error("[MessagingShell] Failed to sync channels:", $);
1711
1719
  }
1712
- }, [m, b, E]);
1713
- q(() => {
1714
- if (!m || !b) return;
1715
- const w = m.userID;
1716
- w && Y.current !== w && H();
1717
- }, [m, b, H]), q(() => {
1718
- if (!c || !m || !b) return;
1720
+ }, [u, w, i]);
1721
+ W(() => {
1722
+ if (!u || !w) return;
1723
+ const y = u.userID;
1724
+ y && Y.current !== y && z();
1725
+ }, [u, w, z]), W(() => {
1726
+ if (!d || !u || !w) return;
1719
1727
  (async () => {
1720
- const $ = m.userID;
1728
+ const $ = u.userID;
1721
1729
  if ($)
1722
1730
  try {
1723
- E && console.log(
1731
+ i && console.log(
1724
1732
  "[MessagingShell] Loading initial conversation with:",
1725
- c
1733
+ d
1726
1734
  );
1727
- const F = await m.queryChannels(
1735
+ const L = await u.queryChannels(
1728
1736
  {
1729
1737
  type: "messaging",
1730
- members: { $eq: [$, c] }
1738
+ members: { $eq: [$, d] }
1731
1739
  },
1732
1740
  {},
1733
1741
  { limit: 1 }
1734
1742
  );
1735
- if (F.length > 0)
1736
- d(F[0]), G(!0), k(null), r && r(F[0]), E && console.log(
1743
+ if (L.length > 0)
1744
+ T(L[0]), k(!0), P(null), r && r(L[0]), i && console.log(
1737
1745
  "[MessagingShell] Initial conversation loaded:",
1738
- F[0].id
1746
+ L[0].id
1739
1747
  );
1740
- else if (a && g) {
1741
- E && console.log(
1748
+ else if (a && N) {
1749
+ i && console.log(
1742
1750
  "[MessagingShell] No conversation found, creating one for:",
1743
1751
  a
1744
1752
  );
1745
1753
  try {
1746
- const A = await g.startChannelWithParticipant({
1754
+ const A = await N.startChannelWithParticipant({
1747
1755
  id: a.id,
1748
1756
  name: a.name,
1749
1757
  email: a.email,
1750
1758
  phone: a.phone
1751
1759
  });
1752
- d(A), G(!0), k(null), r && r(A), E && console.log(
1760
+ T(A), k(!0), P(null), r && r(A), i && console.log(
1753
1761
  "[MessagingShell] Channel created and loaded:",
1754
1762
  A.id
1755
1763
  );
@@ -1757,115 +1765,115 @@ const yt = ({
1757
1765
  console.error(
1758
1766
  "[MessagingShell] Failed to create conversation:",
1759
1767
  A
1760
- ), k("Failed to create conversation");
1768
+ ), P("Failed to create conversation");
1761
1769
  }
1762
1770
  } else
1763
- k(
1771
+ P(
1764
1772
  "No conversation found with this account"
1765
- ), E && console.log(
1773
+ ), i && console.log(
1766
1774
  "[MessagingShell] No conversation found for:",
1767
- c
1775
+ d
1768
1776
  );
1769
- } catch (F) {
1777
+ } catch (L) {
1770
1778
  console.error(
1771
1779
  "[MessagingShell] Failed to load initial conversation:",
1772
- F
1773
- ), k("Failed to load conversation");
1780
+ L
1781
+ ), P("Failed to load conversation");
1774
1782
  }
1775
1783
  })();
1776
1784
  }, [
1777
- c,
1785
+ d,
1778
1786
  a,
1779
- m,
1780
- b,
1781
- g,
1782
- E,
1787
+ u,
1788
+ w,
1789
+ N,
1790
+ i,
1783
1791
  r
1784
1792
  ]);
1785
- const ie = D(
1786
- (w) => {
1787
- d(w), r == null || r(w);
1793
+ const H = D(
1794
+ (y) => {
1795
+ T(y), r == null || r(y);
1788
1796
  },
1789
1797
  [r]
1790
- ), le = D(() => {
1791
- O || d(null);
1792
- }, [O]), V = D(
1793
- async (w) => {
1798
+ ), Ce = D(() => {
1799
+ U || T(null);
1800
+ }, [U]), ie = D(
1801
+ async (y) => {
1794
1802
  var $;
1795
- if (g)
1803
+ if (N)
1796
1804
  try {
1797
- E && console.log(
1805
+ i && console.log(
1798
1806
  "[MessagingShell] Starting conversation with:",
1799
- w.id
1807
+ y.id
1800
1808
  );
1801
- const F = await g.startChannelWithParticipant({
1802
- id: w.id,
1803
- name: w.name,
1804
- email: w.email,
1805
- phone: w.phone
1809
+ const L = await N.startChannelWithParticipant({
1810
+ id: y.id,
1811
+ name: y.name,
1812
+ email: y.email,
1813
+ phone: y.phone
1806
1814
  });
1807
1815
  try {
1808
- await F.show();
1816
+ await L.show();
1809
1817
  } catch (A) {
1810
1818
  console.warn("[MessagingShell] Failed to unhide channel:", A);
1811
1819
  }
1812
- d(F), Q(!1), ($ = T.current) == null || $.close(), l == null || l(w);
1813
- } catch (F) {
1814
- console.error("[MessagingShell] Failed to start conversation:", F);
1820
+ T(L), q(!1), ($ = O.current) == null || $.close(), l == null || l(y);
1821
+ } catch (L) {
1822
+ console.error("[MessagingShell] Failed to start conversation:", L);
1815
1823
  }
1816
1824
  },
1817
- [g, l, E]
1818
- ), te = D(() => {
1819
- var w;
1820
- Q(!1), (w = T.current) == null || w.close();
1825
+ [N, l, i]
1826
+ ), ee = D(() => {
1827
+ var y;
1828
+ q(!1), (y = O.current) == null || y.close();
1821
1829
  }, []), ce = D(
1822
- (w) => {
1823
- w.target === T.current && te();
1824
- },
1825
- [te]
1826
- ), xe = D(
1827
- async (w) => {
1828
- E && console.log("[MessagingShell] Leaving conversation:", w.id), d(null), G(!1), Y.current = null, await H();
1830
+ (y) => {
1831
+ y.target === O.current && ee();
1829
1832
  },
1830
- [H, E]
1833
+ [ee]
1831
1834
  ), de = D(
1832
- async (w) => {
1833
- E && console.log("[MessagingShell] Blocking participant:", w), d(null), G(!1), Y.current = null, await H();
1835
+ async (y) => {
1836
+ i && console.log("[MessagingShell] Leaving conversation:", y.id), T(null), k(!1), Y.current = null, await z();
1834
1837
  },
1835
- [H, E]
1836
- ), J = !!C;
1837
- return v ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : y ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, { message: y, onBack: _ }) }) : !b || !m ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1838
- he,
1838
+ [z, i]
1839
+ ), be = D(
1840
+ async (y) => {
1841
+ i && console.log("[MessagingShell] Blocking participant:", y), T(null), k(!1), Y.current = null, await z();
1842
+ },
1843
+ [z, i]
1844
+ ), me = !!C;
1845
+ return _ ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(ge, {}) }) : R ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(fe, { message: R, onBack: x }) }) : !w || !u ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(
1846
+ fe,
1839
1847
  {
1840
1848
  message: "Not connected to messaging service",
1841
- onBack: _
1849
+ onBack: x
1842
1850
  }
1843
- ) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, { message: Z }) }) : /* @__PURE__ */ i(
1851
+ ) }) : F ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(fe, { message: F }) }) : /* @__PURE__ */ c(
1844
1852
  "div",
1845
1853
  {
1846
- className: R(
1854
+ className: M(
1847
1855
  "messaging-shell h-full bg-background-primary overflow-hidden",
1848
1856
  s
1849
1857
  ),
1850
1858
  children: [
1851
- /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1859
+ /* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
1852
1860
  /* @__PURE__ */ e(
1853
1861
  "div",
1854
1862
  {
1855
- className: R(
1863
+ className: M(
1856
1864
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1857
1865
  {
1858
- "!hidden": h === !1 || O,
1866
+ "!hidden": h === !1 || U,
1859
1867
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1860
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !O && J,
1868
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !U && me,
1861
1869
  // Show on mobile when no channel selected, use same wide width on desktop
1862
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !J
1870
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !U && !me
1863
1871
  }
1864
1872
  ),
1865
1873
  children: /* @__PURE__ */ e(
1866
- Ue,
1874
+ Ae,
1867
1875
  {
1868
- onChannelSelect: ie,
1876
+ onChannelSelect: H,
1869
1877
  selectedChannel: C || void 0,
1870
1878
  filters: oe,
1871
1879
  customEmptyStateIndicator: p
@@ -1876,71 +1884,73 @@ const yt = ({
1876
1884
  /* @__PURE__ */ e(
1877
1885
  "div",
1878
1886
  {
1879
- className: R(
1887
+ className: M(
1880
1888
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1881
1889
  {
1882
1890
  // In direct conversation mode (or waiting for it), always show (full width)
1883
- flex: O || J || c,
1891
+ flex: U || me || d,
1884
1892
  // Normal mode: hide on mobile when no channel selected
1885
- "hidden lg:flex": !O && !J && !c
1893
+ "hidden lg:flex": !U && !me && !d
1886
1894
  }
1887
1895
  ),
1888
1896
  children: C ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1889
- je,
1897
+ ze,
1890
1898
  {
1891
1899
  channel: C,
1892
- onBack: le,
1893
- showBackButton: !O,
1900
+ onBack: Ce,
1901
+ showBackButton: !U,
1894
1902
  renderMessageInputActions: n,
1895
- onLeaveConversation: xe,
1896
- onBlockParticipant: de,
1897
- CustomChannelEmptyState: u,
1898
- showDeleteConversation: se,
1903
+ onLeaveConversation: de,
1904
+ onBlockParticipant: be,
1905
+ CustomChannelEmptyState: m,
1906
+ showDeleteConversation: le,
1899
1907
  onDeleteConversationClick: f,
1900
1908
  onBlockParticipantClick: o,
1901
- onReportParticipantClick: M,
1902
- dmAgentEnabled: S
1909
+ onReportParticipantClick: S,
1910
+ dmAgentEnabled: E,
1911
+ messageMetadata: b,
1912
+ onMessageSent: v
1903
1913
  },
1904
1914
  C.id
1905
- ) }) : c ? (
1915
+ ) }) : d ? (
1906
1916
  // Show loading while creating/loading direct conversation channel
1907
- /* @__PURE__ */ e(fe, {})
1917
+ /* @__PURE__ */ e(ge, {})
1908
1918
  ) : /* @__PURE__ */ e(
1909
- $e,
1919
+ Ge,
1910
1920
  {
1911
- hasChannels: N,
1912
- channelsLoaded: j
1921
+ hasChannels: j,
1922
+ channelsLoaded: J
1913
1923
  }
1914
1924
  )
1915
1925
  }
1916
1926
  )
1917
1927
  ] }),
1918
- U && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1928
+ Z && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1919
1929
  /* @__PURE__ */ e(
1920
1930
  "dialog",
1921
1931
  {
1922
- ref: T,
1932
+ ref: O,
1923
1933
  className: "mes-dialog",
1924
1934
  onClick: ce,
1925
- onClose: te,
1935
+ onClose: ee,
1926
1936
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1927
- ut,
1937
+ ft,
1928
1938
  {
1929
- participantSource: U,
1930
- onSelectParticipant: V,
1931
- onClose: te,
1932
- existingParticipantIds: X,
1933
- participantLabel: B,
1934
- searchPlaceholder: `Search ${B}...`
1939
+ participantSource: Z,
1940
+ onSelectParticipant: ie,
1941
+ onClose: ee,
1942
+ existingParticipantIds: Q,
1943
+ participantLabel: ae,
1944
+ searchPlaceholder: `Search ${ae}...`
1935
1945
  },
1936
- ee
1946
+ K
1937
1947
  ) })
1938
1948
  }
1939
1949
  )
1940
1950
  ]
1941
1951
  }
1942
1952
  );
1943
- }, ft = ({
1953
+ }, xt = ({
1944
1954
  question: t,
1945
1955
  onClick: s,
1946
1956
  loading: n = !1,
@@ -1952,7 +1962,7 @@ const yt = ({
1952
1962
  onClick: s,
1953
1963
  disabled: n,
1954
1964
  style: { backgroundColor: "#E6E5E3" },
1955
- className: R(
1965
+ className: M(
1956
1966
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1957
1967
  {
1958
1968
  "hover:brightness-95 active:brightness-90": !n,
@@ -1962,36 +1972,36 @@ const yt = ({
1962
1972
  ),
1963
1973
  children: t
1964
1974
  }
1965
- ), Et = ({
1975
+ ), _t = ({
1966
1976
  faqs: t,
1967
1977
  onFaqClick: s,
1968
1978
  loadingFaqId: n,
1969
1979
  headerText: r,
1970
1980
  className: l,
1971
- avatarImage: c,
1981
+ avatarImage: d,
1972
1982
  avatarName: a
1973
1983
  }) => {
1974
- const u = t.filter((h) => h.enabled).sort((h, x) => (h.order ?? 0) - (x.order ?? 0));
1975
- return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1976
- (c || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1977
- ne,
1984
+ const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
1985
+ return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
1986
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1987
+ se,
1978
1988
  {
1979
1989
  id: a || "account",
1980
1990
  name: a || "Account",
1981
- image: c,
1991
+ image: d,
1982
1992
  size: 24,
1983
1993
  shape: "circle"
1984
1994
  }
1985
1995
  ) }),
1986
- /* @__PURE__ */ i(
1996
+ /* @__PURE__ */ c(
1987
1997
  "div",
1988
1998
  {
1989
1999
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1990
2000
  style: { backgroundColor: "#F1F0EE" },
1991
2001
  children: [
1992
2002
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1993
- u.map((h) => /* @__PURE__ */ e(
1994
- ft,
2003
+ m.map((h) => /* @__PURE__ */ e(
2004
+ xt,
1995
2005
  {
1996
2006
  question: h.question,
1997
2007
  onClick: () => s(h.id),
@@ -2003,35 +2013,35 @@ const yt = ({
2003
2013
  }
2004
2014
  )
2005
2015
  ] }) });
2006
- }, It = (t, s = {}) => {
2007
- const { initialSearch: n = "", pageSize: r = 20 } = s, [l, c] = I([]), [a, u] = I(!1), [h, x] = I(null), [p, f] = I(n), [o, M] = I(!0), [S, g] = I(), m = D(async (_ = !1, E) => {
2016
+ }, St = (t, s = {}) => {
2017
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = I([]), [a, m] = I(!1), [h, g] = I(null), [p, f] = I(n), [o, S] = I(!0), [E, b] = I(), v = D(async (_ = !1, R) => {
2008
2018
  if (a) return;
2009
- const C = E !== void 0 ? E : p;
2010
- u(!0), x(null);
2019
+ const x = R !== void 0 ? R : p;
2020
+ m(!0), g(null);
2011
2021
  try {
2012
- const d = await t.loadParticipants({
2013
- search: C || void 0,
2022
+ const i = await t.loadParticipants({
2023
+ search: x || void 0,
2014
2024
  limit: r,
2015
- cursor: _ ? void 0 : S
2025
+ cursor: _ ? void 0 : E
2016
2026
  });
2017
- c(
2018
- (N) => _ ? d.participants : [...N, ...d.participants]
2019
- ), M(d.hasMore), g(d.nextCursor);
2020
- } catch (d) {
2021
- const N = d instanceof Error ? d.message : "Failed to load participants";
2022
- x(N), console.error("[useParticipants] Load error:", d);
2027
+ d(
2028
+ (C) => _ ? i.participants : [...C, ...i.participants]
2029
+ ), S(i.hasMore), b(i.nextCursor);
2030
+ } catch (i) {
2031
+ const C = i instanceof Error ? i.message : "Failed to load participants";
2032
+ g(C), console.error("[useParticipants] Load error:", i);
2023
2033
  } finally {
2024
- u(!1);
2034
+ m(!1);
2025
2035
  }
2026
- }, [t, p, S, r, a]), b = D(() => {
2027
- o && !a && m(!1);
2028
- }, [o, a, m]), v = D((_) => {
2029
- f(_), g(void 0), m(!0, _);
2030
- }, [m]), y = D(() => {
2031
- g(void 0), m(!0);
2032
- }, [m]);
2033
- return q(() => {
2034
- m(!0);
2036
+ }, [t, p, E, r, a]), N = D(() => {
2037
+ o && !a && v(!1);
2038
+ }, [o, a, v]), u = D((_) => {
2039
+ f(_), b(void 0), v(!0, _);
2040
+ }, [v]), w = D(() => {
2041
+ b(void 0), v(!0);
2042
+ }, [v]);
2043
+ return W(() => {
2044
+ v(!0);
2035
2045
  }, [t.loadParticipants]), {
2036
2046
  participants: l,
2037
2047
  loading: a,
@@ -2039,23 +2049,23 @@ const yt = ({
2039
2049
  searchQuery: p,
2040
2050
  hasMore: o,
2041
2051
  totalCount: t.totalCount,
2042
- loadMore: b,
2043
- search: v,
2044
- refresh: y
2052
+ loadMore: N,
2053
+ search: u,
2054
+ refresh: w
2045
2055
  };
2046
2056
  };
2047
2057
  export {
2048
- ne as Avatar,
2049
- lt as ChannelEmptyState,
2050
- Ue as ChannelList,
2051
- je as ChannelView,
2052
- Et as FaqList,
2053
- ft as FaqListItem,
2054
- pt as MessagingProvider,
2055
- yt as MessagingShell,
2056
- ut as ParticipantPicker,
2057
- Gs as formatRelativeTime,
2058
- $s as useMessaging,
2059
- It as useParticipants
2058
+ se as Avatar,
2059
+ it as ChannelEmptyState,
2060
+ Ae as ChannelList,
2061
+ ze as ChannelView,
2062
+ _t as FaqList,
2063
+ xt as FaqListItem,
2064
+ Et as MessagingProvider,
2065
+ It as MessagingShell,
2066
+ ft as ParticipantPicker,
2067
+ Vs as formatRelativeTime,
2068
+ Gs as useMessaging,
2069
+ St as useParticipants
2060
2070
  };
2061
2071
  //# sourceMappingURL=index.js.map