@linktr.ee/messaging-react 1.16.1 → 1.17.0-rc-1769690110

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,76 +35,76 @@ 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), [N, v] = I(null), b = 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
104
  isConnecting: b.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
  }
@@ -112,7 +112,7 @@ const Fe = Ge({
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 }), b.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), b.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: !!N,
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: N,
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
+ N,
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 b, 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
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);
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)) : "", N = 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
+ N && "✨ ",
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: N,
540
+ threadList: v
541
+ } = t, { client: b } = 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 && b.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: N
652
652
  }
653
- ) : /* @__PURE__ */ e(Ns, { message: o, renderText: g }),
654
- /* @__PURE__ */ e(vs, {})
653
+ ) : /* @__PURE__ */ e(ws, { message: o, renderText: N }),
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,26 +829,26 @@ 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, N, 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 b = (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
854
  return l.on("member.updated", b), () => {
@@ -865,13 +865,13 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
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: ((N = d == null ? void 0 : d.user) == null ? void 0 : N.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), [N, v] = I(!1), [b, 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 (!N) {
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;
1029
+ }, R = async () => {
1030
+ var k, F, P;
1031
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);
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;
1041
+ }, x = async () => {
1042
+ var k, F, P;
1043
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);
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: N,
1122
+ "aria-busy": N,
1123
1123
  children: [
1124
- g ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Bs, { className: "h-5 w-5" }),
1124
+ N ? /* @__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,
1132
+ onClick: x,
1133
1133
  disabled: b,
1134
1134
  "aria-busy": b,
1135
1135
  children: [
1136
- b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5" }),
1136
+ b ? /* @__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,
1143
+ onClick: R,
1144
1144
  disabled: b,
1145
1145
  "aria-busy": b,
1146
1146
  children: [
1147
- b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5" }),
1147
+ b ? /* @__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) => {
1173
+ const { channel: g } = Le(), p = V(null), f = B.useMemo(() => Object.values(g.state.members || {}).find(
1174
+ (v) => {
1175
1175
  var b;
1176
- return ((b = m.user) == null ? void 0 : b.id) && m.user.id !== x._client.userID;
1176
+ return ((b = v.user) == null ? void 0 : b.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 N = g.data ?? {};
1180
+ if (N.followerStatus)
1181
+ return String(N.followerStatus);
1182
+ if (N.isFollower !== void 0)
1183
+ return N.isFollower ? "Subscribed to you" : "Not subscribed";
1184
+ }, [g.data]), S = D(() => {
1185
+ var N;
1186
+ (N = p.current) == null || N.showModal();
1187
+ }, []), E = D(() => {
1188
+ var N;
1189
+ (N = p.current) == null || N.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: (N) => /* @__PURE__ */ e(st, { ...N })
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,96 @@ 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 N = D(
1261
+ async (v, b, u) => {
1262
+ var C;
1263
+ const w = ((C = t.data) == null ? void 0 : C.chatbot_paused) === !0, _ = o && !w, R = {
1264
+ ...b,
1265
+ ..._ && { silent: !0 },
1266
+ ...S && {
1267
+ metadata: {
1268
+ ...b.metadata ?? {},
1269
+ ...S
1270
+ }
1271
+ }
1272
+ }, x = {
1273
+ ...u,
1274
+ ..._ && { skip_push: !0 }
1275
+ }, i = await t.sendMessage(R, x);
1276
+ return E == null || E(i), i;
1266
1277
  },
1267
- [t, o]
1278
+ [t, o, S, E]
1268
1279
  );
1269
1280
  return /* @__PURE__ */ e(
1270
1281
  "div",
1271
1282
  {
1272
- className: R(
1283
+ className: M(
1273
1284
  "messaging-channel-view h-full flex flex-col",
1274
1285
  a
1275
1286
  ),
1276
1287
  children: /* @__PURE__ */ e(
1277
- Ds,
1288
+ Ls,
1278
1289
  {
1279
1290
  channel: t,
1280
- MessageSystem: at,
1281
- EmptyStateIndicator: u,
1282
- LoadingIndicator: fe,
1283
- DateSeparator: Js,
1284
- doSendMessageRequest: M,
1291
+ MessageSystem: ot,
1292
+ EmptyStateIndicator: m,
1293
+ LoadingIndicator: ge,
1294
+ DateSeparator: Xs,
1295
+ doSendMessageRequest: N,
1285
1296
  children: /* @__PURE__ */ e(
1286
- dt,
1297
+ ut,
1287
1298
  {
1288
1299
  onBack: s,
1289
1300
  showBackButton: n,
1290
1301
  renderMessageInputActions: r,
1291
1302
  onLeaveConversation: l,
1292
- onBlockParticipant: c,
1293
- CustomChannelEmptyState: u,
1303
+ onBlockParticipant: d,
1304
+ CustomChannelEmptyState: m,
1294
1305
  showDeleteConversation: h,
1295
- onDeleteConversationClick: x,
1306
+ onDeleteConversationClick: g,
1296
1307
  onBlockParticipantClick: p,
1297
1308
  onReportParticipantClick: f
1298
1309
  }
@@ -1303,16 +1314,16 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1303
1314
  );
1304
1315
  }
1305
1316
  );
1306
- je.displayName = "ChannelView";
1307
- function mt({
1317
+ ze.displayName = "ChannelView";
1318
+ function ht({
1308
1319
  searchQuery: t,
1309
1320
  setSearchQuery: s,
1310
1321
  placeholder: n
1311
1322
  }) {
1312
- const r = W(null);
1313
- return /* @__PURE__ */ i("div", { className: "relative", children: [
1323
+ const r = V(null);
1324
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
1314
1325
  /* @__PURE__ */ e(
1315
- js,
1326
+ zs,
1316
1327
  {
1317
1328
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1318
1329
  weight: "bold"
@@ -1330,7 +1341,7 @@ function mt({
1330
1341
  }
1331
1342
  ),
1332
1343
  t && /* @__PURE__ */ e(
1333
- Be,
1344
+ je,
1334
1345
  {
1335
1346
  label: "Clear search",
1336
1347
  onClick: () => {
@@ -1338,149 +1349,149 @@ function mt({
1338
1349
  s(""), (l = r.current) == null || l.focus();
1339
1350
  },
1340
1351
  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" })
1352
+ children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
1342
1353
  }
1343
1354
  )
1344
1355
  ] });
1345
1356
  }
1346
- const ut = ({
1357
+ const ft = ({
1347
1358
  participantSource: t,
1348
1359
  onSelectParticipant: s,
1349
1360
  onClose: n,
1350
1361
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
1351
1362
  participantLabel: l = "participants",
1352
- searchPlaceholder: c = "Search participants...",
1363
+ searchPlaceholder: d = "Search participants...",
1353
1364
  className: a
1354
1365
  }) => {
1355
- const { debug: u } = ge(), [h, x] = I(""), [p, f] = I([]), [o, M] = I(!1), [S, g] = I(null), [m, b] = I(
1366
+ const { debug: m } = xe(), [h, g] = I(""), [p, f] = I([]), [o, S] = I(!1), [E, N] = I(null), [v, b] = I(
1356
1367
  null
1357
- ), v = W(!1);
1358
- q(() => {
1368
+ ), u = V(!1);
1369
+ W(() => {
1359
1370
  if (t.loading) {
1360
- u && console.log(
1371
+ m && console.log(
1361
1372
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1362
1373
  );
1363
1374
  return;
1364
1375
  }
1365
- if (v.current) return;
1376
+ if (u.current) return;
1366
1377
  (async () => {
1367
- u && console.log("[ParticipantPicker] Loading initial participants..."), M(!0), g(null);
1378
+ m && console.log("[ParticipantPicker] Loading initial participants..."), S(!0), N(null);
1368
1379
  try {
1369
- const d = await t.loadParticipants({
1380
+ const i = await t.loadParticipants({
1370
1381
  search: "",
1371
1382
  // Load all participants initially
1372
1383
  limit: 100
1373
1384
  });
1374
- f(d.participants), v.current = !0, u && console.log(
1385
+ f(i.participants), u.current = !0, m && console.log(
1375
1386
  "[ParticipantPicker] Participants loaded successfully:",
1376
- d.participants.length
1387
+ i.participants.length
1377
1388
  );
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);
1389
+ } catch (i) {
1390
+ const C = i instanceof Error ? i.message : "Failed to load participants";
1391
+ N(C), console.error("[ParticipantPicker] Failed to load participants:", i);
1381
1392
  } finally {
1382
- M(!1);
1393
+ S(!1);
1383
1394
  }
1384
1395
  })();
1385
- }, [t.loading, u]);
1386
- const y = p.filter((C) => !r.has(C.id)).filter((C) => {
1387
- var N;
1396
+ }, [t.loading, m]);
1397
+ const w = p.filter((x) => !r.has(x.id)).filter((x) => {
1398
+ var C;
1388
1399
  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;
1400
+ const i = h.toLowerCase();
1401
+ return x.name.toLowerCase().includes(i) || ((C = x.email) == null ? void 0 : C.toLowerCase().includes(i)) || !1;
1391
1402
  }), _ = D(
1392
- async (C) => {
1393
- if (!m) {
1394
- b(C.id);
1403
+ async (x) => {
1404
+ if (!v) {
1405
+ b(x.id);
1395
1406
  try {
1396
- await s(C);
1397
- } catch (d) {
1398
- console.error("[ParticipantPicker] Failed to start chat:", d), b(null);
1407
+ await s(x);
1408
+ } catch (i) {
1409
+ console.error("[ParticipantPicker] Failed to start chat:", i), b(null);
1399
1410
  }
1400
1411
  }
1401
1412
  },
1402
- [s, m]
1403
- ), E = (C, d) => {
1404
- (C.key === "Enter" || C.key === " ") && (C.preventDefault(), _(d));
1413
+ [s, v]
1414
+ ), R = (x, i) => {
1415
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), _(i));
1405
1416
  };
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: [
1417
+ return /* @__PURE__ */ c("div", { className: M("flex flex-col h-full", a), children: [
1418
+ /* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1419
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
1409
1420
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1410
- /* @__PURE__ */ e(Ae, { onClick: n })
1421
+ /* @__PURE__ */ e($e, { onClick: n })
1411
1422
  ] }),
1412
- /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1423
+ /* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
1413
1424
  "Select a ",
1414
1425
  l.slice(0, -1),
1415
1426
  " to start messaging (",
1416
- y.length,
1427
+ w.length,
1417
1428
  " available)",
1418
1429
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1419
1430
  ] }),
1420
1431
  /* @__PURE__ */ e(
1421
- mt,
1432
+ ht,
1422
1433
  {
1423
1434
  searchQuery: h,
1424
- setSearchQuery: x,
1425
- placeholder: c
1435
+ setSearchQuery: g,
1436
+ placeholder: d
1426
1437
  }
1427
1438
  )
1428
1439
  ] }),
1429
- S && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1440
+ E && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1430
1441
  "Error loading ",
1431
1442
  l,
1432
1443
  ": ",
1433
- S
1444
+ E
1434
1445
  ] }),
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: [
1446
+ /* @__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
1447
  /* @__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: [
1448
+ /* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
1438
1449
  "Loading ",
1439
1450
  l,
1440
1451
  "..."
1441
1452
  ] })
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" }) }),
1453
+ ] }) }) : w.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
1454
+ /* @__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
1455
  /* @__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
1456
  /* @__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;
1457
+ ] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
1458
+ w.map((x) => {
1459
+ const i = x.name || x.email || x.id, C = x.email && x.name ? x.email : x.phone;
1449
1460
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1450
1461
  "button",
1451
1462
  {
1452
1463
  type: "button",
1453
- onClick: () => _(C),
1454
- onKeyDown: (P) => E(P, C),
1464
+ onClick: () => _(x),
1465
+ onKeyDown: (T) => R(T, x),
1455
1466
  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: [
1467
+ children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1468
+ /* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1458
1469
  /* @__PURE__ */ e(
1459
- ne,
1470
+ se,
1460
1471
  {
1461
- id: C.id,
1462
- name: d,
1463
- image: C.image,
1472
+ id: x.id,
1473
+ name: i,
1474
+ image: x.image,
1464
1475
  size: 40
1465
1476
  }
1466
1477
  ),
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 })
1478
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
1479
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: i }),
1480
+ C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1470
1481
  ] })
1471
1482
  ] }),
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" }) })
1483
+ /* @__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
1484
  ] })
1474
1485
  }
1475
- ) }, C.id);
1486
+ ) }, x.id);
1476
1487
  }),
1477
- o && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1488
+ o && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1478
1489
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1479
1490
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1480
1491
  ] }) })
1481
1492
  ] }) })
1482
1493
  ] });
1483
- }, ht = ({ className: t }) => /* @__PURE__ */ i(
1494
+ }, gt = ({ className: t }) => /* @__PURE__ */ c(
1484
1495
  "svg",
1485
1496
  {
1486
1497
  width: "140",
@@ -1490,7 +1501,7 @@ const ut = ({
1490
1501
  xmlns: "http://www.w3.org/2000/svg",
1491
1502
  className: t,
1492
1503
  children: [
1493
- /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1504
+ /* @__PURE__ */ c("g", { clipPath: "url(#clip0_empty_state)", children: [
1494
1505
  /* @__PURE__ */ e(
1495
1506
  "path",
1496
1507
  {
@@ -1519,7 +1530,7 @@ const ut = ({
1519
1530
  fill: "white"
1520
1531
  }
1521
1532
  ),
1522
- /* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
1533
+ /* @__PURE__ */ c("g", { filter: "url(#filter0_empty_state)", children: [
1523
1534
  /* @__PURE__ */ e(
1524
1535
  "path",
1525
1536
  {
@@ -1559,8 +1570,8 @@ const ut = ({
1559
1570
  }
1560
1571
  )
1561
1572
  ] }),
1562
- /* @__PURE__ */ i("defs", { children: [
1563
- /* @__PURE__ */ i(
1573
+ /* @__PURE__ */ c("defs", { children: [
1574
+ /* @__PURE__ */ c(
1564
1575
  "filter",
1565
1576
  {
1566
1577
  id: "filter0_empty_state",
@@ -1614,17 +1625,17 @@ const ut = ({
1614
1625
  ] })
1615
1626
  ]
1616
1627
  }
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: [
1628
+ ), Ge = B.memo(
1629
+ ({ 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: [
1630
+ /* @__PURE__ */ e(gt, {}),
1631
+ s && !t && /* @__PURE__ */ c("div", { className: "mt-8", children: [
1621
1632
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1622
1633
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1623
1634
  ] })
1624
1635
  ] }) })
1625
1636
  );
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: [
1637
+ Ge.displayName = "EmptyState";
1638
+ 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
1639
  /* @__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
1640
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1630
1641
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1638,118 +1649,120 @@ const he = L.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1638
1649
  }
1639
1650
  )
1640
1651
  ] }) }));
1641
- he.displayName = "ErrorState";
1642
- const yt = ({
1652
+ fe.displayName = "ErrorState";
1653
+ const It = ({
1643
1654
  capabilities: t = {},
1644
1655
  className: s,
1645
1656
  renderMessageInputActions: n,
1646
1657
  onChannelSelect: r,
1647
1658
  onParticipantSelect: l,
1648
- initialParticipantFilter: c,
1659
+ initialParticipantFilter: d,
1649
1660
  initialParticipantData: a,
1650
- CustomChannelEmptyState: u,
1661
+ CustomChannelEmptyState: m,
1651
1662
  showChannelList: h = !0,
1652
- filters: x,
1663
+ filters: g,
1653
1664
  channelListCustomEmptyStateIndicator: p,
1654
1665
  onDeleteConversationClick: f,
1655
1666
  onBlockParticipantClick: o,
1656
- onReportParticipantClick: M,
1657
- dmAgentEnabled: S
1667
+ onReportParticipantClick: S,
1668
+ dmAgentEnabled: E,
1669
+ messageMetadata: N,
1670
+ onMessageSent: v
1658
1671
  }) => {
1659
1672
  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;
1673
+ service: b,
1674
+ client: u,
1675
+ isConnected: w,
1676
+ isLoading: _,
1677
+ error: R,
1678
+ refreshConnection: x,
1679
+ debug: i
1680
+ } = 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), {
1681
+ participantSource: Z,
1682
+ participantLabel: ae = "participants",
1683
+ showDeleteConversation: le = !0
1684
+ } = t, oe = B.useMemo(() => {
1685
+ const y = u == null ? void 0 : u.userID;
1673
1686
  return {
1674
1687
  ...{
1675
1688
  type: "messaging",
1676
1689
  last_message_at: { $exists: !0 },
1677
- ...w && {
1678
- members: { $in: [w] },
1690
+ ...y && {
1691
+ members: { $in: [y] },
1679
1692
  hidden: !1
1680
1693
  }
1681
1694
  },
1682
- ...x
1695
+ ...g
1683
1696
  };
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)
1697
+ }, [g, u == null ? void 0 : u.userID]), Y = V(null), z = D(async () => {
1698
+ if (!u || !w) return;
1699
+ const y = u.userID;
1700
+ if (y)
1688
1701
  try {
1689
- E && console.log("[MessagingShell] Syncing channels for user:", w);
1690
- const $ = await m.queryChannels(
1702
+ i && console.log("[MessagingShell] Syncing channels for user:", y);
1703
+ const $ = await u.queryChannels(
1691
1704
  {
1692
1705
  type: "messaging",
1693
- members: { $in: [w] }
1706
+ members: { $in: [y] }
1694
1707
  },
1695
1708
  {},
1696
1709
  { limit: 100 }
1697
- ), F = /* @__PURE__ */ new Set();
1710
+ ), L = /* @__PURE__ */ new Set();
1698
1711
  $.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);
1712
+ const Ne = A.state.members;
1713
+ Object.values(Ne).forEach((He) => {
1714
+ var ye;
1715
+ const ve = (ye = He.user) == null ? void 0 : ye.id;
1716
+ ve && ve !== y && L.add(ve);
1704
1717
  });
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:", {
1718
+ }), 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
1719
  channelCount: $.length,
1707
- memberCount: F.size
1720
+ memberCount: L.size
1708
1721
  });
1709
1722
  } catch ($) {
1710
1723
  console.error("[MessagingShell] Failed to sync channels:", $);
1711
1724
  }
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;
1725
+ }, [u, w, i]);
1726
+ W(() => {
1727
+ if (!u || !w) return;
1728
+ const y = u.userID;
1729
+ y && Y.current !== y && z();
1730
+ }, [u, w, z]), W(() => {
1731
+ if (!d || !u || !w) return;
1719
1732
  (async () => {
1720
- const $ = m.userID;
1733
+ const $ = u.userID;
1721
1734
  if ($)
1722
1735
  try {
1723
- E && console.log(
1736
+ i && console.log(
1724
1737
  "[MessagingShell] Loading initial conversation with:",
1725
- c
1738
+ d
1726
1739
  );
1727
- const F = await m.queryChannels(
1740
+ const L = await u.queryChannels(
1728
1741
  {
1729
1742
  type: "messaging",
1730
- members: { $eq: [$, c] }
1743
+ members: { $eq: [$, d] }
1731
1744
  },
1732
1745
  {},
1733
1746
  { limit: 1 }
1734
1747
  );
1735
- if (F.length > 0)
1736
- d(F[0]), G(!0), k(null), r && r(F[0]), E && console.log(
1748
+ if (L.length > 0)
1749
+ T(L[0]), k(!0), P(null), r && r(L[0]), i && console.log(
1737
1750
  "[MessagingShell] Initial conversation loaded:",
1738
- F[0].id
1751
+ L[0].id
1739
1752
  );
1740
- else if (a && g) {
1741
- E && console.log(
1753
+ else if (a && b) {
1754
+ i && console.log(
1742
1755
  "[MessagingShell] No conversation found, creating one for:",
1743
1756
  a
1744
1757
  );
1745
1758
  try {
1746
- const A = await g.startChannelWithParticipant({
1759
+ const A = await b.startChannelWithParticipant({
1747
1760
  id: a.id,
1748
1761
  name: a.name,
1749
1762
  email: a.email,
1750
1763
  phone: a.phone
1751
1764
  });
1752
- d(A), G(!0), k(null), r && r(A), E && console.log(
1765
+ T(A), k(!0), P(null), r && r(A), i && console.log(
1753
1766
  "[MessagingShell] Channel created and loaded:",
1754
1767
  A.id
1755
1768
  );
@@ -1757,115 +1770,115 @@ const yt = ({
1757
1770
  console.error(
1758
1771
  "[MessagingShell] Failed to create conversation:",
1759
1772
  A
1760
- ), k("Failed to create conversation");
1773
+ ), P("Failed to create conversation");
1761
1774
  }
1762
1775
  } else
1763
- k(
1776
+ P(
1764
1777
  "No conversation found with this account"
1765
- ), E && console.log(
1778
+ ), i && console.log(
1766
1779
  "[MessagingShell] No conversation found for:",
1767
- c
1780
+ d
1768
1781
  );
1769
- } catch (F) {
1782
+ } catch (L) {
1770
1783
  console.error(
1771
1784
  "[MessagingShell] Failed to load initial conversation:",
1772
- F
1773
- ), k("Failed to load conversation");
1785
+ L
1786
+ ), P("Failed to load conversation");
1774
1787
  }
1775
1788
  })();
1776
1789
  }, [
1777
- c,
1790
+ d,
1778
1791
  a,
1779
- m,
1792
+ u,
1793
+ w,
1780
1794
  b,
1781
- g,
1782
- E,
1795
+ i,
1783
1796
  r
1784
1797
  ]);
1785
- const ie = D(
1786
- (w) => {
1787
- d(w), r == null || r(w);
1798
+ const H = D(
1799
+ (y) => {
1800
+ T(y), r == null || r(y);
1788
1801
  },
1789
1802
  [r]
1790
- ), le = D(() => {
1791
- O || d(null);
1792
- }, [O]), V = D(
1793
- async (w) => {
1803
+ ), Ce = D(() => {
1804
+ U || T(null);
1805
+ }, [U]), ie = D(
1806
+ async (y) => {
1794
1807
  var $;
1795
- if (g)
1808
+ if (b)
1796
1809
  try {
1797
- E && console.log(
1810
+ i && console.log(
1798
1811
  "[MessagingShell] Starting conversation with:",
1799
- w.id
1812
+ y.id
1800
1813
  );
1801
- const F = await g.startChannelWithParticipant({
1802
- id: w.id,
1803
- name: w.name,
1804
- email: w.email,
1805
- phone: w.phone
1814
+ const L = await b.startChannelWithParticipant({
1815
+ id: y.id,
1816
+ name: y.name,
1817
+ email: y.email,
1818
+ phone: y.phone
1806
1819
  });
1807
1820
  try {
1808
- await F.show();
1821
+ await L.show();
1809
1822
  } catch (A) {
1810
1823
  console.warn("[MessagingShell] Failed to unhide channel:", A);
1811
1824
  }
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);
1825
+ T(L), q(!1), ($ = O.current) == null || $.close(), l == null || l(y);
1826
+ } catch (L) {
1827
+ console.error("[MessagingShell] Failed to start conversation:", L);
1815
1828
  }
1816
1829
  },
1817
- [g, l, E]
1818
- ), te = D(() => {
1819
- var w;
1820
- Q(!1), (w = T.current) == null || w.close();
1830
+ [b, l, i]
1831
+ ), ee = D(() => {
1832
+ var y;
1833
+ q(!1), (y = O.current) == null || y.close();
1821
1834
  }, []), ce = D(
1822
- (w) => {
1823
- w.target === T.current && te();
1835
+ (y) => {
1836
+ y.target === O.current && ee();
1824
1837
  },
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();
1829
- },
1830
- [H, E]
1838
+ [ee]
1831
1839
  ), de = D(
1832
- async (w) => {
1833
- E && console.log("[MessagingShell] Blocking participant:", w), d(null), G(!1), Y.current = null, await H();
1840
+ async (y) => {
1841
+ i && console.log("[MessagingShell] Leaving conversation:", y.id), T(null), k(!1), Y.current = null, await z();
1842
+ },
1843
+ [z, i]
1844
+ ), be = D(
1845
+ async (y) => {
1846
+ i && console.log("[MessagingShell] Blocking participant:", y), T(null), k(!1), Y.current = null, await z();
1834
1847
  },
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,
1848
+ [z, i]
1849
+ ), me = !!C;
1850
+ 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(
1851
+ fe,
1839
1852
  {
1840
1853
  message: "Not connected to messaging service",
1841
- onBack: _
1854
+ onBack: x
1842
1855
  }
1843
- ) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, { message: Z }) }) : /* @__PURE__ */ i(
1856
+ ) }) : F ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(fe, { message: F }) }) : /* @__PURE__ */ c(
1844
1857
  "div",
1845
1858
  {
1846
- className: R(
1859
+ className: M(
1847
1860
  "messaging-shell h-full bg-background-primary overflow-hidden",
1848
1861
  s
1849
1862
  ),
1850
1863
  children: [
1851
- /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1864
+ /* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
1852
1865
  /* @__PURE__ */ e(
1853
1866
  "div",
1854
1867
  {
1855
- className: R(
1868
+ className: M(
1856
1869
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1857
1870
  {
1858
- "!hidden": h === !1 || O,
1871
+ "!hidden": h === !1 || U,
1859
1872
  // 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,
1873
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !U && me,
1861
1874
  // 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
1875
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !U && !me
1863
1876
  }
1864
1877
  ),
1865
1878
  children: /* @__PURE__ */ e(
1866
- Ue,
1879
+ Ae,
1867
1880
  {
1868
- onChannelSelect: ie,
1881
+ onChannelSelect: H,
1869
1882
  selectedChannel: C || void 0,
1870
1883
  filters: oe,
1871
1884
  customEmptyStateIndicator: p
@@ -1876,71 +1889,73 @@ const yt = ({
1876
1889
  /* @__PURE__ */ e(
1877
1890
  "div",
1878
1891
  {
1879
- className: R(
1892
+ className: M(
1880
1893
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1881
1894
  {
1882
1895
  // In direct conversation mode (or waiting for it), always show (full width)
1883
- flex: O || J || c,
1896
+ flex: U || me || d,
1884
1897
  // Normal mode: hide on mobile when no channel selected
1885
- "hidden lg:flex": !O && !J && !c
1898
+ "hidden lg:flex": !U && !me && !d
1886
1899
  }
1887
1900
  ),
1888
1901
  children: C ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1889
- je,
1902
+ ze,
1890
1903
  {
1891
1904
  channel: C,
1892
- onBack: le,
1893
- showBackButton: !O,
1905
+ onBack: Ce,
1906
+ showBackButton: !U,
1894
1907
  renderMessageInputActions: n,
1895
- onLeaveConversation: xe,
1896
- onBlockParticipant: de,
1897
- CustomChannelEmptyState: u,
1898
- showDeleteConversation: se,
1908
+ onLeaveConversation: de,
1909
+ onBlockParticipant: be,
1910
+ CustomChannelEmptyState: m,
1911
+ showDeleteConversation: le,
1899
1912
  onDeleteConversationClick: f,
1900
1913
  onBlockParticipantClick: o,
1901
- onReportParticipantClick: M,
1902
- dmAgentEnabled: S
1914
+ onReportParticipantClick: S,
1915
+ dmAgentEnabled: E,
1916
+ messageMetadata: N,
1917
+ onMessageSent: v
1903
1918
  },
1904
1919
  C.id
1905
- ) }) : c ? (
1920
+ ) }) : d ? (
1906
1921
  // Show loading while creating/loading direct conversation channel
1907
- /* @__PURE__ */ e(fe, {})
1922
+ /* @__PURE__ */ e(ge, {})
1908
1923
  ) : /* @__PURE__ */ e(
1909
- $e,
1924
+ Ge,
1910
1925
  {
1911
- hasChannels: N,
1912
- channelsLoaded: j
1926
+ hasChannels: j,
1927
+ channelsLoaded: J
1913
1928
  }
1914
1929
  )
1915
1930
  }
1916
1931
  )
1917
1932
  ] }),
1918
- U && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1933
+ Z && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1919
1934
  /* @__PURE__ */ e(
1920
1935
  "dialog",
1921
1936
  {
1922
- ref: T,
1937
+ ref: O,
1923
1938
  className: "mes-dialog",
1924
1939
  onClick: ce,
1925
- onClose: te,
1940
+ onClose: ee,
1926
1941
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1927
- ut,
1942
+ ft,
1928
1943
  {
1929
- participantSource: U,
1930
- onSelectParticipant: V,
1931
- onClose: te,
1932
- existingParticipantIds: X,
1933
- participantLabel: B,
1934
- searchPlaceholder: `Search ${B}...`
1944
+ participantSource: Z,
1945
+ onSelectParticipant: ie,
1946
+ onClose: ee,
1947
+ existingParticipantIds: Q,
1948
+ participantLabel: ae,
1949
+ searchPlaceholder: `Search ${ae}...`
1935
1950
  },
1936
- ee
1951
+ K
1937
1952
  ) })
1938
1953
  }
1939
1954
  )
1940
1955
  ]
1941
1956
  }
1942
1957
  );
1943
- }, ft = ({
1958
+ }, xt = ({
1944
1959
  question: t,
1945
1960
  onClick: s,
1946
1961
  loading: n = !1,
@@ -1952,7 +1967,7 @@ const yt = ({
1952
1967
  onClick: s,
1953
1968
  disabled: n,
1954
1969
  style: { backgroundColor: "#E6E5E3" },
1955
- className: R(
1970
+ className: M(
1956
1971
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1957
1972
  {
1958
1973
  "hover:brightness-95 active:brightness-90": !n,
@@ -1962,36 +1977,36 @@ const yt = ({
1962
1977
  ),
1963
1978
  children: t
1964
1979
  }
1965
- ), Et = ({
1980
+ ), _t = ({
1966
1981
  faqs: t,
1967
1982
  onFaqClick: s,
1968
1983
  loadingFaqId: n,
1969
1984
  headerText: r,
1970
1985
  className: l,
1971
- avatarImage: c,
1986
+ avatarImage: d,
1972
1987
  avatarName: a
1973
1988
  }) => {
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,
1989
+ const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
1990
+ return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
1991
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1992
+ se,
1978
1993
  {
1979
1994
  id: a || "account",
1980
1995
  name: a || "Account",
1981
- image: c,
1996
+ image: d,
1982
1997
  size: 24,
1983
1998
  shape: "circle"
1984
1999
  }
1985
2000
  ) }),
1986
- /* @__PURE__ */ i(
2001
+ /* @__PURE__ */ c(
1987
2002
  "div",
1988
2003
  {
1989
2004
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1990
2005
  style: { backgroundColor: "#F1F0EE" },
1991
2006
  children: [
1992
2007
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1993
- u.map((h) => /* @__PURE__ */ e(
1994
- ft,
2008
+ m.map((h) => /* @__PURE__ */ e(
2009
+ xt,
1995
2010
  {
1996
2011
  question: h.question,
1997
2012
  onClick: () => s(h.id),
@@ -2003,35 +2018,35 @@ const yt = ({
2003
2018
  }
2004
2019
  )
2005
2020
  ] }) });
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) => {
2021
+ }, St = (t, s = {}) => {
2022
+ 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, N] = I(), v = D(async (_ = !1, R) => {
2008
2023
  if (a) return;
2009
- const C = E !== void 0 ? E : p;
2010
- u(!0), x(null);
2024
+ const x = R !== void 0 ? R : p;
2025
+ m(!0), g(null);
2011
2026
  try {
2012
- const d = await t.loadParticipants({
2013
- search: C || void 0,
2027
+ const i = await t.loadParticipants({
2028
+ search: x || void 0,
2014
2029
  limit: r,
2015
- cursor: _ ? void 0 : S
2030
+ cursor: _ ? void 0 : E
2016
2031
  });
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);
2032
+ d(
2033
+ (C) => _ ? i.participants : [...C, ...i.participants]
2034
+ ), S(i.hasMore), N(i.nextCursor);
2035
+ } catch (i) {
2036
+ const C = i instanceof Error ? i.message : "Failed to load participants";
2037
+ g(C), console.error("[useParticipants] Load error:", i);
2023
2038
  } finally {
2024
- u(!1);
2039
+ m(!1);
2025
2040
  }
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);
2041
+ }, [t, p, E, r, a]), b = D(() => {
2042
+ o && !a && v(!1);
2043
+ }, [o, a, v]), u = D((_) => {
2044
+ f(_), N(void 0), v(!0, _);
2045
+ }, [v]), w = D(() => {
2046
+ N(void 0), v(!0);
2047
+ }, [v]);
2048
+ return W(() => {
2049
+ v(!0);
2035
2050
  }, [t.loadParticipants]), {
2036
2051
  participants: l,
2037
2052
  loading: a,
@@ -2040,22 +2055,22 @@ const yt = ({
2040
2055
  hasMore: o,
2041
2056
  totalCount: t.totalCount,
2042
2057
  loadMore: b,
2043
- search: v,
2044
- refresh: y
2058
+ search: u,
2059
+ refresh: w
2045
2060
  };
2046
2061
  };
2047
2062
  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
2063
+ se as Avatar,
2064
+ it as ChannelEmptyState,
2065
+ Ae as ChannelList,
2066
+ ze as ChannelView,
2067
+ _t as FaqList,
2068
+ xt as FaqListItem,
2069
+ Et as MessagingProvider,
2070
+ It as MessagingShell,
2071
+ ft as ParticipantPicker,
2072
+ Vs as formatRelativeTime,
2073
+ Gs as useMessaging,
2074
+ St as useParticipants
2060
2075
  };
2061
2076
  //# sourceMappingURL=index.js.map