@linktr.ee/messaging-react 1.21.0-rc-1771294922 โ†’ 1.21.0-rc-1771296053

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
2
2
  import D from "classnames";
3
- import B, { createContext as Je, useContext as Qe, useCallback as T, useState as k, useRef as V, useEffect as W, useMemo as be } from "react";
4
- import { StreamChatService as Xe } from "@linktr.ee/messaging-core";
5
- import { Chat as Ke, ChannelList as es, DateSeparator as ss, useChannelStateContext as we, useChatContext as Fe, areMessageUIPropsEqual as ts, useMessageReminder as ns, useComponentContext as rs, Attachment as as, EditMessageModal as ls, MessageBlocked as os, MessageBouncePrompt as is, MessageDeleted as cs, MessageIsThreadReplyInChannelButtonIndicator as ds, MessageRepliesCountButton as us, ReminderNotification as ms, StreamedMessageText as hs, messageHasAttachments as fs, messageHasReactions as gs, isDateSeparatorMessage as xs, isMessageBlocked as bs, isMessageBounced as Cs, MessageBounceModal as Ns, Poll as vs, MessageText as ws, MessageErrorIcon as ps, useMessageContext as ys, useMessageComposer as Es, useStateStore as Is, MessageInput as _s, useMessageInputContext as Ss, useMessageComposerHasSendableData as Ms, SimpleAttachmentSelector as ks, QuotedMessagePreview as Rs, AttachmentPreviewList as Ds, TextareaComposer as Ts, MessageTimestamp as Fs, Channel as Ls, WithComponents as Ps, Window as Os, MessageList as Us } from "stream-chat-react";
6
- import { GiftIcon as Bs, XIcon as pe, ArrowUpIcon as js, ArrowLeftIcon as Ie, StarIcon as _e, DotsThreeIcon as Se, SpinnerGapIcon as ue, SignOutIcon as As, ProhibitInsetIcon as Me, FlagIcon as $s, MagnifyingGlassIcon as zs, ChatCircleDotsIcon as ke } from "@phosphor-icons/react";
3
+ import j, { createContext as Qe, useContext as Xe, useCallback as F, useState as M, useRef as W, useEffect as q, useMemo as be } from "react";
4
+ import { StreamChatService as Ke } from "@linktr.ee/messaging-core";
5
+ import { Chat as es, ChannelList as ss, DateSeparator as ts, useChannelStateContext as we, useChatContext as Fe, areMessageUIPropsEqual as ns, useMessageReminder as rs, useComponentContext as as, Attachment as ls, EditMessageModal as os, MessageBlocked as is, MessageBouncePrompt as cs, MessageDeleted as ds, MessageIsThreadReplyInChannelButtonIndicator as us, MessageRepliesCountButton as ms, ReminderNotification as hs, StreamedMessageText as fs, messageHasAttachments as gs, messageHasReactions as xs, isDateSeparatorMessage as bs, isMessageBlocked as Cs, isMessageBounced as Ns, MessageBounceModal as vs, Poll as ws, MessageText as ps, MessageErrorIcon 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 Ds, AttachmentPreviewList as Ts, TextareaComposer as Fs, MessageTimestamp as Ls, Channel as Ps, WithComponents as Os, Window as Us, MessageList as Bs } from "stream-chat-react";
6
+ import { GiftIcon as js, XIcon as pe, ArrowUpIcon as As, ArrowLeftIcon as Ie, StarIcon as _e, DotsThreeIcon as Se, SpinnerGapIcon as ue, SignOutIcon as $s, ProhibitInsetIcon as Me, FlagIcon as zs, MagnifyingGlassIcon as Hs, ChatCircleDotsIcon as ke } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as Re } from "stream-chat";
8
- const Le = Je({
8
+ const Le = Qe({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const Le = Je({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), fe = () => Qe(Le), kt = ({
18
+ }), fe = () => Xe(Le), Rt = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -23,9 +23,9 @@ const Le = Je({
23
23
  capabilities: o = {},
24
24
  debug: c = !1
25
25
  }) => {
26
- const r = T(
27
- (u, ...N) => {
28
- c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...N);
26
+ const r = F(
27
+ (m, ...C) => {
28
+ c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...C);
29
29
  },
30
30
  [c]
31
31
  );
@@ -35,84 +35,84 @@ const Le = Je({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [d, b] = k(null), [m, M] = k(null), [x, g] = k(!1), [l, I] = k(!1), [_, y] = k(null), E = V(!1), h = V({
38
+ const [u, b] = M(null), [h, _] = M(null), [x, g] = M(!1), [l, y] = M(!1), [E, w] = M(null), p = W(!1), f = W({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: a,
41
41
  serviceConfig: n,
42
42
  capabilities: o
43
- }), p = V(0);
44
- p.current++, r("๐Ÿ“Š RENDER INFO", {
45
- renderCount: p.current,
43
+ }), N = W(0);
44
+ N.current++, r("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: N.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: h.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: h.current.apiKey !== a,
50
- serviceConfigChanged: h.current.serviceConfig !== n,
51
- capabilitiesChanged: h.current.capabilities !== o
48
+ userChanged: f.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: f.current.apiKey !== a,
50
+ serviceConfigChanged: f.current.serviceConfig !== n,
51
+ capabilitiesChanged: f.current.capabilities !== o
52
52
  }
53
- }), h.current = {
53
+ }), f.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: a,
56
56
  serviceConfig: n,
57
57
  capabilities: o
58
- }, W(() => {
59
- const u = p.current;
58
+ }, q(() => {
59
+ const m = N.current;
60
60
  if (r("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: u,
61
+ renderCount: m,
62
62
  apiKey: !!a,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: h.current.serviceConfig === n,
68
- apiKeyStable: h.current.apiKey === a
67
+ serviceConfigStable: f.current.serviceConfig === n,
68
+ apiKeyStable: f.current.apiKey === a
69
69
  }
70
70
  }), !a || !n) {
71
71
  r("โš ๏ธ SERVICE INIT SKIPPED", {
72
- renderCount: u,
72
+ renderCount: m,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  r("๐Ÿš€ CREATING NEW SERVICE", {
78
- renderCount: u,
78
+ renderCount: m,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
80
- serviceConfigChanged: h.current.serviceConfig !== n
80
+ serviceConfigChanged: f.current.serviceConfig !== n
81
81
  });
82
- const N = new Xe({
82
+ const C = new Ke({
83
83
  ...n,
84
84
  apiKey: a,
85
85
  debug: c
86
86
  });
87
- return b(N), r("โœ… SERVICE SET", {
88
- renderCount: u,
89
- serviceInstance: !!N
87
+ return b(C), r("โœ… SERVICE SET", {
88
+ renderCount: m,
89
+ serviceInstance: !!C
90
90
  }), () => {
91
91
  r("๐Ÿงน SERVICE CLEANUP", {
92
- renderCount: u,
92
+ renderCount: m,
93
93
  reason: "Effect cleanup"
94
- }), N.disconnectUser().catch(console.error);
94
+ }), C.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [a, n, c, r]);
97
- const C = V(null);
98
- W(() => {
99
- var N, R;
97
+ const v = W(null);
98
+ q(() => {
99
+ var C, k;
100
100
  if (r("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!d,
101
+ hasService: !!u,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: E.current,
104
+ isConnecting: p.current,
105
105
  isConnected: x,
106
- dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
107
- }), !d || !s) {
106
+ dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
+ }), !u || !s) {
108
108
  r("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (E.current) {
111
+ if (p.current) {
112
112
  r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = C.current) == null ? void 0 : N.serviceId) === d && ((R = C.current) == null ? void 0 : R.userId) === s.id) {
115
+ if (((C = v.current) == null ? void 0 : C.serviceId) === u && ((k = v.current) == null ? void 0 : k.userId) === s.id) {
116
116
  r(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,114 +120,114 @@ const Le = Je({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), E.current = !0, I(!0), y(null);
123
+ r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), p.current = !0, y(!0), w(null);
124
124
  try {
125
125
  r("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const w = await d.connectUser(s);
127
- M(w), g(!0), C.current = { serviceId: d, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
126
+ const T = await u.connectUser(s);
127
+ _(T), g(!0), v.current = { serviceId: u, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: w.userID
129
+ clientId: T.userID
130
130
  });
131
- } catch (w) {
132
- const F = w instanceof Error ? w.message : "Connection failed";
133
- y(F), r("โŒ USER CONNECTION ERROR", {
131
+ } catch (T) {
132
+ const S = T instanceof Error ? T.message : "Connection failed";
133
+ w(S), r("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: F
135
+ error: S
136
136
  });
137
137
  } finally {
138
- I(!1), E.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ y(!1), p.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: x
141
141
  });
142
142
  }
143
143
  })();
144
- }, [d, s, r, x]), W(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
- hasService: !!d,
144
+ }, [u, s, r, x]), q(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!u,
146
146
  isConnected: x
147
147
  }), () => {
148
- d && x ? (r(
148
+ u && x ? (r(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), C.current = null, d.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
- hasService: !!d,
151
+ ), v.current = null, u.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!u,
153
153
  isConnected: x
154
154
  });
155
- }), [d, x, r]);
156
- const v = T(async () => {
155
+ }), [u, x, r]);
156
+ const R = F(async () => {
157
157
  if (r("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
- hasService: !!d,
158
+ hasService: !!u,
159
159
  hasUser: !!s
160
- }), !d || !s) {
160
+ }), !u || !s) {
161
161
  r("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), I(!0);
164
+ r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
165
165
  try {
166
- r("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await d.disconnectUser(), r("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
- const u = await d.connectUser(s);
168
- M(u), g(!0), y(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (u) {
170
- const N = u instanceof Error ? u.message : "Refresh failed";
171
- y(N), r("โŒ CONNECTION REFRESH ERROR", {
166
+ r("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), r("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
+ const m = await u.connectUser(s);
168
+ _(m), g(!0), w(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (m) {
170
+ const C = m instanceof Error ? m.message : "Refresh failed";
171
+ w(C), r("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: N
173
+ error: C
174
174
  });
175
175
  } finally {
176
- I(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ y(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [d, s, r]), f = B.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!d,
180
- hasClient: !!m,
178
+ }, [u, s, r]), d = j.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!u,
180
+ hasClient: !!h,
181
181
  isConnected: x,
182
182
  isLoading: l,
183
- hasError: !!_,
183
+ hasError: !!E,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
- service: d,
187
- client: m,
186
+ service: u,
187
+ client: h,
188
188
  isConnected: x,
189
189
  isLoading: l,
190
- error: _,
190
+ error: E,
191
191
  capabilities: o,
192
- refreshConnection: v,
192
+ refreshConnection: R,
193
193
  debug: c
194
194
  }), [
195
- d,
196
- m,
195
+ u,
196
+ h,
197
197
  x,
198
198
  l,
199
- _,
199
+ E,
200
200
  o,
201
- v,
201
+ R,
202
202
  c,
203
203
  r
204
204
  ]);
205
205
  return r("๐Ÿ”„ RENDER END", {
206
- renderCount: p.current,
207
- willRenderChat: !!(m && x),
208
- contextValueReady: !!f
209
- }), /* @__PURE__ */ e(Le.Provider, { value: f, children: m && x ? /* @__PURE__ */ e(
210
- Ke,
206
+ renderCount: N.current,
207
+ willRenderChat: !!(h && x),
208
+ contextValueReady: !!d
209
+ }), /* @__PURE__ */ e(Le.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
210
+ es,
211
211
  {
212
- client: m,
212
+ client: h,
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
- }, Hs = () => fe(), Gs = (t, s) => {
219
+ }, Gs = () => fe(), Vs = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
222
  ), o = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
225
  return Math.floor(o / (1e3 * 60 * 60 * 24));
226
- }, Vs = (t) => {
226
+ }, Ws = (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 a = Gs(t, s);
230
+ const a = Vs(t, s);
231
231
  return a === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
@@ -265,7 +265,7 @@ const Le = Je({
265
265
  "๐Ÿˆ"
266
266
  // Melon
267
267
  ];
268
- function Ws(t) {
268
+ function qs(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
271
  const a = t.charCodeAt(n);
@@ -273,8 +273,8 @@ function Ws(t) {
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
276
- function qs(t) {
277
- const n = Ws(t) % De.length;
276
+ function Zs(t) {
277
+ const n = qs(t) % De.length;
278
278
  return De[n];
279
279
  }
280
280
  const Q = ({
@@ -284,7 +284,7 @@ const Q = ({
284
284
  className: a,
285
285
  shape: o = "squircle"
286
286
  }) => {
287
- const c = qs(t), d = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", b = o === "circle" ? { borderRadius: "50%" } : {
287
+ const c = Zs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", b = o === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
@@ -310,29 +310,29 @@ const Q = ({
310
310
  "aria-hidden": "true",
311
311
  className: D(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- d
313
+ u
314
314
  ),
315
315
  children: c
316
316
  }
317
317
  )
318
318
  }
319
319
  );
320
- }, Zs = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
320
+ }, Ys = () => /* @__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
- ) }), Ys = (t) => {
326
+ ) }), Js = (t) => {
327
327
  var s;
328
328
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
329
- }, Js = (t) => {
329
+ }, Qs = (t) => {
330
330
  var s;
331
331
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
332
332
  }, ye = (t) => {
333
333
  var s;
334
334
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
335
- }, Pe = (t) => Ys(t) || Js(t), Qs = (t) => {
335
+ }, Pe = (t) => Js(t) || Qs(t), Xs = (t) => {
336
336
  var s;
337
337
  return Pe(t) && !((s = t.text) != null && s.trim());
338
338
  }, Te = ({
@@ -346,17 +346,17 @@ const Q = ({
346
346
  if (n) {
347
347
  const c = (o = t.metadata) == null ? void 0 : o.amount_text;
348
348
  if (!c) return null;
349
- const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", d = s ? `${c} tip` : `Delivered with ${c} tip`;
349
+ const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
350
350
  return /* @__PURE__ */ i("div", { className: r, children: [
351
- /* @__PURE__ */ e(Bs, { size: s ? 14 : 12 }),
352
- /* @__PURE__ */ e("span", { children: d })
351
+ /* @__PURE__ */ e(js, { size: s ? 14 : 12 }),
352
+ /* @__PURE__ */ e("span", { children: u })
353
353
  ] });
354
354
  }
355
355
  return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
356
- /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Zs, {}) }),
356
+ /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Ys, {}) }),
357
357
  /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
358
358
  ] });
359
- }, Oe = B.memo(
359
+ }, Oe = j.memo(
360
360
  ({
361
361
  channel: t,
362
362
  selectedChannel: s,
@@ -365,31 +365,31 @@ const Q = ({
365
365
  unread: o,
366
366
  renderMessagePreview: c
367
367
  }) => {
368
- var p, C, v, f, u, N;
369
- const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), d = () => {
368
+ var N, v, R, d, m, C;
369
+ const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
370
370
  t && n(t);
371
- }, m = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
372
- (R) => {
373
- var w, F;
374
- return ((w = R.user) == null ? void 0 : w.id) && R.user.id !== ((F = t == null ? void 0 : t._client) == null ? void 0 : F.userID);
371
+ }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
372
+ (k) => {
373
+ var T, S;
374
+ return ((T = k.user) == null ? void 0 : T.id) && k.user.id !== ((S = t == null ? void 0 : t._client) == null ? void 0 : S.userID);
375
375
  }
376
- ), M = ((C = m == null ? void 0 : m.user) == null ? void 0 : C.name) || "Conversation", x = (v = m == null ? void 0 : m.user) == null ? void 0 : v.image, g = (u = (f = t == null ? void 0 : t.state) == null ? void 0 : f.messages) == null ? void 0 : u[t.state.messages.length - 1], I = (() => {
377
- var w;
376
+ ), _ = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", x = (R = h == null ? void 0 : h.user) == null ? void 0 : R.image, g = (m = (d = t == null ? void 0 : t.state) == null ? void 0 : d.messages) == null ? void 0 : m[t.state.messages.length - 1], y = (() => {
377
+ var T;
378
378
  if (g != null && g.text) return g.text;
379
- const R = (w = g == null ? void 0 : g.attachments) == null ? void 0 : w[0];
380
- return R ? R.og_scrape_url ? R.og_scrape_url : R.type === "image" ? "๐Ÿ“ท Sent an image" : R.type === "video" ? "๐ŸŽฅ Sent a video" : R.type === "audio" ? "๐ŸŽต Sent audio" : R.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
381
- })(), _ = g != null && g.created_at ? Vs(new Date(g.created_at)) : "", y = g ? ye(g) : !1, E = c ? c(g, I) : `${y ? "โœจ " : ""}${I}`, h = o ?? 0;
379
+ const k = (T = g == null ? void 0 : g.attachments) == null ? void 0 : T[0];
380
+ return k ? k.og_scrape_url ? k.og_scrape_url : k.type === "image" ? "๐Ÿ“ท Sent an image" : k.type === "video" ? "๐ŸŽฅ Sent a video" : k.type === "audio" ? "๐ŸŽต Sent audio" : k.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
381
+ })(), E = g != null && g.created_at ? Ws(new Date(g.created_at)) : "", w = g ? ye(g) : !1, p = c ? c(g, y) : `${w ? "โœจ " : ""}${y}`, f = o ?? 0;
382
382
  return a && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
383
383
  channelId: t == null ? void 0 : t.id,
384
384
  isSelected: r,
385
- participantName: M,
386
- unreadCount: h,
387
- hasTimestamp: !!_
385
+ participantName: _,
386
+ unreadCount: f,
387
+ hasTimestamp: !!E
388
388
  }), /* @__PURE__ */ e(
389
389
  "button",
390
390
  {
391
391
  type: "button",
392
- onClick: d,
392
+ onClick: u,
393
393
  className: D(
394
394
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
395
395
  {
@@ -401,8 +401,8 @@ const Q = ({
401
401
  /* @__PURE__ */ e(
402
402
  Q,
403
403
  {
404
- id: ((N = m == null ? void 0 : m.user) == null ? void 0 : N.id) || t.id || "unknown",
405
- name: M,
404
+ id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
405
+ name: _,
406
406
  image: x,
407
407
  size: 44,
408
408
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
@@ -417,14 +417,14 @@ const Q = ({
417
417
  "text-sm font-medium truncate",
418
418
  r ? "text-primary" : "text-charcoal"
419
419
  ),
420
- children: M
420
+ children: _
421
421
  }
422
422
  ),
423
- _ && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: _ })
423
+ E && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: E })
424
424
  ] }),
425
425
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
426
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: E }),
427
- h > 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: h > 99 ? "99+" : h })
426
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: p }),
427
+ f > 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: f > 99 ? "99+" : f })
428
428
  ] })
429
429
  ] })
430
430
  ] })
@@ -433,7 +433,7 @@ const Q = ({
433
433
  }
434
434
  );
435
435
  Oe.displayName = "CustomChannelPreview";
436
- const Ue = B.memo(
436
+ const Ue = j.memo(
437
437
  ({
438
438
  onChannelSelect: t,
439
439
  selectedChannel: s,
@@ -442,24 +442,24 @@ const Ue = B.memo(
442
442
  customEmptyStateIndicator: o,
443
443
  renderMessagePreview: c
444
444
  }) => {
445
- const r = B.useRef(0);
445
+ const r = j.useRef(0);
446
446
  r.current++;
447
- const { debug: d = !1 } = fe();
448
- d && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
447
+ const { debug: u = !1 } = fe();
448
+ u && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
449
449
  renderCount: r.current,
450
450
  selectedChannelId: s == null ? void 0 : s.id,
451
451
  filters: n
452
452
  });
453
- const b = B.useMemo(() => (M) => /* @__PURE__ */ e(
453
+ const b = j.useMemo(() => (_) => /* @__PURE__ */ e(
454
454
  Oe,
455
455
  {
456
- ...M,
456
+ ..._,
457
457
  selectedChannel: s,
458
458
  onChannelSelect: t,
459
- debug: d,
459
+ debug: u,
460
460
  renderMessagePreview: c
461
461
  }
462
- ), [s, t, d, c]);
462
+ ), [s, t, u, c]);
463
463
  return /* @__PURE__ */ e(
464
464
  "div",
465
465
  {
@@ -468,7 +468,7 @@ const Ue = B.memo(
468
468
  a
469
469
  ),
470
470
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
471
- es,
471
+ ss,
472
472
  {
473
473
  filters: n,
474
474
  sort: { last_message_at: -1 },
@@ -525,15 +525,15 @@ function Be({ label: t, className: s, children: n, ...a }) {
525
525
  function je({ onClick: t }) {
526
526
  return /* @__PURE__ */ e(Be, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
527
527
  }
528
- const Xs = (t) => /* @__PURE__ */ e(ss, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
529
- function Ks(t) {
528
+ const Ks = (t) => /* @__PURE__ */ e(ts, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
529
+ function et(t) {
530
530
  return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
531
531
  }
532
- function et(t) {
532
+ function st(t) {
533
533
  const { channel: s } = we(), { client: n } = Fe("useMessageVote"), a = be(
534
- () => Ks(t.own_reactions),
534
+ () => et(t.own_reactions),
535
535
  [t.own_reactions]
536
- ), o = T(async () => {
536
+ ), o = F(async () => {
537
537
  if (n != null && n.userID)
538
538
  try {
539
539
  a === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
@@ -543,7 +543,7 @@ function et(t) {
543
543
  );
544
544
  } catch {
545
545
  }
546
- }, [s, n == null ? void 0 : n.userID, t.id, a]), c = T(async () => {
546
+ }, [s, n == null ? void 0 : n.userID, t.id, a]), c = F(async () => {
547
547
  if (n != null && n.userID)
548
548
  try {
549
549
  a === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
@@ -556,7 +556,7 @@ function et(t) {
556
556
  }, [s, n == null ? void 0 : n.userID, t.id, a]);
557
557
  return { selected: a, voteUp: o, voteDown: c };
558
558
  }
559
- const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
559
+ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
560
560
  "path",
561
561
  {
562
562
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -566,7 +566,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
566
566
  strokeLinejoin: "round",
567
567
  fill: t ? "currentColor" : "none"
568
568
  }
569
- ) }), tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
569
+ ) }), nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
570
570
  "path",
571
571
  {
572
572
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -576,7 +576,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
576
576
  strokeLinejoin: "round",
577
577
  fill: t ? "currentColor" : "none"
578
578
  }
579
- ) }), nt = ({
579
+ ) }), rt = ({
580
580
  selected: t,
581
581
  onVoteUp: s,
582
582
  onVoteDown: n
@@ -589,7 +589,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
589
589
  onClick: s,
590
590
  "aria-label": "Helpful",
591
591
  "aria-pressed": t === "up",
592
- children: /* @__PURE__ */ e(st, { filled: t === "up" })
592
+ children: /* @__PURE__ */ e(tt, { filled: t === "up" })
593
593
  }
594
594
  ),
595
595
  /* @__PURE__ */ e(
@@ -600,11 +600,11 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
600
600
  onClick: n,
601
601
  "aria-label": "Not helpful",
602
602
  "aria-pressed": t === "down",
603
- children: /* @__PURE__ */ e(tt, { filled: t === "down" })
603
+ children: /* @__PURE__ */ e(nt, { filled: t === "down" })
604
604
  }
605
605
  )
606
- ] }), rt = (t) => {
607
- var re, le;
606
+ ] }), at = (t) => {
607
+ var re, ae;
608
608
  const {
609
609
  additionalMessageInputProps: s,
610
610
  chatbotVotingEnabled: n,
@@ -612,78 +612,78 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
612
612
  endOfGroup: o,
613
613
  firstOfGroup: c,
614
614
  groupedByUser: r,
615
- handleAction: d,
615
+ handleAction: u,
616
616
  handleOpenThread: b,
617
- handleRetry: m,
618
- highlighted: M,
617
+ handleRetry: h,
618
+ highlighted: _,
619
619
  isMessageAIGenerated: x,
620
620
  isMyMessage: g,
621
621
  message: l,
622
- renderText: I,
623
- threadList: _
624
- } = t, { client: y } = Fe("CustomMessage"), [E, h] = k(!1), p = ns(l.id), { selected: C, voteUp: v, voteDown: f } = et(l), {
625
- Attachment: u = as,
626
- EditMessageModal: N = ls,
627
- MessageBlocked: R = os,
628
- MessageBouncePrompt: w = is,
629
- MessageDeleted: F = cs,
630
- MessageIsThreadReplyInChannelButtonIndicator: $ = ds,
631
- MessageRepliesCountButton: te = us,
632
- ReminderNotification: X = ms,
633
- StreamedMessageText: K = hs,
634
- PinIndicator: q
635
- } = rs("CustomMessage"), ne = fs(l), Z = gs(l), ee = be(
622
+ renderText: y,
623
+ threadList: E
624
+ } = t, { client: w } = Fe("CustomMessage"), [p, f] = M(!1), N = rs(l.id), { selected: v, voteUp: R, voteDown: d } = st(l), {
625
+ Attachment: m = ls,
626
+ EditMessageModal: C = os,
627
+ MessageBlocked: k = is,
628
+ MessageBouncePrompt: T = cs,
629
+ MessageDeleted: S = ds,
630
+ MessageIsThreadReplyInChannelButtonIndicator: G = us,
631
+ MessageRepliesCountButton: z = ms,
632
+ ReminderNotification: X = hs,
633
+ StreamedMessageText: K = fs,
634
+ PinIndicator: Y
635
+ } = as("CustomMessage"), ee = gs(l), ne = xs(l), J = be(
636
636
  () => x == null ? void 0 : x(l),
637
637
  [x, l]
638
- ), G = be(
638
+ ), V = be(
639
639
  () => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
640
640
  [l]
641
641
  );
642
- if (xs(l))
642
+ if (bs(l))
643
643
  return null;
644
644
  if (l.deleted_at || l.type === "deleted")
645
- return /* @__PURE__ */ e(F, { message: l });
646
- if (bs(l))
647
- return /* @__PURE__ */ e(R, {});
648
- const P = !_ && !!l.reply_count, U = !_ && l.show_in_channel && l.parent_id, L = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, j = Cs(l);
649
- let z;
650
- L ? z = () => m(l) : j && (z = () => h(!0));
651
- const Y = D(
645
+ return /* @__PURE__ */ e(S, { message: l });
646
+ if (Cs(l))
647
+ return /* @__PURE__ */ e(k, {});
648
+ const L = !E && !!l.reply_count, P = !E && l.show_in_channel && l.parent_id, H = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, O = Ns(l);
649
+ let B;
650
+ H ? B = () => h(l) : O && (B = () => f(!0));
651
+ const le = D(
652
652
  "str-chat__message str-chat__message-simple",
653
653
  `str-chat__message--${l.type}`,
654
654
  `str-chat__message--${l.status}`,
655
655
  g() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
656
656
  l.text ? "str-chat__message--has-text" : "has-no-text",
657
657
  {
658
- "str-chat__message--has-attachment": ne,
659
- "str-chat__message--highlighted": M,
658
+ "str-chat__message--has-attachment": ee,
659
+ "str-chat__message--highlighted": _,
660
660
  "str-chat__message--pinned pinned-message": l.pinned,
661
- "str-chat__message--with-reactions": Z,
662
- "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((le = l == null ? void 0 : l.error) == null ? void 0 : le.status) !== 403,
663
- "str-chat__message-with-thread-link": P || U,
661
+ "str-chat__message--with-reactions": ne,
662
+ "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((ae = l == null ? void 0 : l.error) == null ? void 0 : ae.status) !== 403,
663
+ "str-chat__message-with-thread-link": L || P,
664
664
  "str-chat__virtual-message__wrapper--end": o,
665
665
  "str-chat__virtual-message__wrapper--first": c,
666
666
  "str-chat__virtual-message__wrapper--group": r
667
667
  }
668
- ), J = l.poll_id && y.polls.fromState(l.poll_id), ae = Qs(l);
668
+ ), Z = l.poll_id && w.polls.fromState(l.poll_id), se = Xs(l);
669
669
  return /* @__PURE__ */ i(ve, { children: [
670
670
  a && /* @__PURE__ */ e(
671
- N,
671
+ C,
672
672
  {
673
673
  additionalMessageInputProps: s
674
674
  }
675
675
  ),
676
- E && /* @__PURE__ */ e(
677
- Ns,
676
+ p && /* @__PURE__ */ e(
677
+ vs,
678
678
  {
679
- MessageBouncePrompt: w,
680
- onClose: () => h(!1),
681
- open: E
679
+ MessageBouncePrompt: T,
680
+ onClose: () => f(!1),
681
+ open: p
682
682
  }
683
683
  ),
684
- /* @__PURE__ */ i("div", { className: Y, children: [
685
- q && /* @__PURE__ */ e(q, {}),
686
- !!p && /* @__PURE__ */ e(X, { reminder: p }),
684
+ /* @__PURE__ */ i("div", { className: le, children: [
685
+ Y && /* @__PURE__ */ e(Y, {}),
686
+ !!N && /* @__PURE__ */ e(X, { reminder: N }),
687
687
  l.user && /* @__PURE__ */ e(
688
688
  Q,
689
689
  {
@@ -697,74 +697,74 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
697
697
  "div",
698
698
  {
699
699
  className: D("str-chat__message-inner", {
700
- "str-chat__simple-message--error-failed": L || j
700
+ "str-chat__simple-message--error-failed": H || O
701
701
  }),
702
702
  "data-testid": "message-inner",
703
- onClick: z,
704
- onKeyDown: z,
705
- role: z ? "button" : void 0,
706
- tabIndex: z ? 0 : void 0,
703
+ onClick: B,
704
+ onKeyDown: B,
705
+ role: B ? "button" : void 0,
706
+ tabIndex: B ? 0 : void 0,
707
707
  style: {
708
708
  // Force margins to 0 to prevent hover layout shift
709
709
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
710
710
  marginInlineEnd: 0,
711
711
  marginInlineStart: 0
712
712
  },
713
- children: ae ? (
713
+ children: se ? (
714
714
  /* Tip-only messages render as a standalone bubble */
715
715
  /* @__PURE__ */ e(Te, { message: l, standalone: !0 })
716
716
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
717
717
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
718
- J && /* @__PURE__ */ e(vs, { poll: J }),
719
- G != null && G.length && !l.quoted_message ? /* @__PURE__ */ e(
720
- u,
718
+ Z && /* @__PURE__ */ e(ws, { poll: Z }),
719
+ V != null && V.length && !l.quoted_message ? /* @__PURE__ */ e(
720
+ m,
721
721
  {
722
- actionHandler: d,
723
- attachments: G
722
+ actionHandler: u,
723
+ attachments: V
724
724
  }
725
725
  ) : null,
726
- ee ? /* @__PURE__ */ e(
726
+ J ? /* @__PURE__ */ e(
727
727
  K,
728
728
  {
729
729
  message: l,
730
- renderText: I
730
+ renderText: y
731
731
  }
732
- ) : /* @__PURE__ */ e(ws, { message: l, renderText: I }),
733
- /* @__PURE__ */ e(ps, {})
732
+ ) : /* @__PURE__ */ e(ps, { message: l, renderText: y }),
733
+ /* @__PURE__ */ e(ys, {})
734
734
  ] }),
735
735
  /* @__PURE__ */ e(Te, { message: l }),
736
736
  n && ye(l) && /* @__PURE__ */ e(
737
- nt,
737
+ rt,
738
738
  {
739
- selected: C,
740
- onVoteUp: v,
741
- onVoteDown: f
739
+ selected: v,
740
+ onVoteUp: R,
741
+ onVoteDown: d
742
742
  }
743
743
  )
744
744
  ] })
745
745
  }
746
746
  ),
747
- P && /* @__PURE__ */ e(
748
- te,
747
+ L && /* @__PURE__ */ e(
748
+ z,
749
749
  {
750
750
  onClick: b,
751
751
  reply_count: l.reply_count
752
752
  }
753
753
  ),
754
- U && /* @__PURE__ */ e($, {})
754
+ P && /* @__PURE__ */ e(G, {})
755
755
  ] }, l.id)
756
756
  ] });
757
- }, at = B.memo(
758
- rt,
759
- ts
760
- ), lt = (t) => {
761
- const s = ys("CustomMessage");
762
- return /* @__PURE__ */ e(at, { ...s, ...t });
763
- }, ot = (t) => ({
757
+ }, lt = j.memo(
758
+ at,
759
+ ns
760
+ ), ot = (t) => {
761
+ const s = Es("CustomMessage");
762
+ return /* @__PURE__ */ e(lt, { ...s, ...t });
763
+ }, it = (t) => ({
764
764
  linkPreviews: Array.from(t.previews.values()).filter(
765
765
  (s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
766
766
  )
767
- }), it = ({
767
+ }), ct = ({
768
768
  link: t,
769
769
  onDismiss: s
770
770
  }) => {
@@ -804,32 +804,32 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
804
804
  ]
805
805
  }
806
806
  );
807
- }, ct = () => {
808
- const { linkPreviewsManager: t } = Es(), { linkPreviews: s } = Is(
807
+ }, dt = () => {
808
+ const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
809
809
  t.state,
810
- ot
810
+ it
811
811
  ), n = (o) => {
812
812
  t.dismissPreview(o);
813
813
  };
814
814
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
815
- it,
815
+ ct,
816
816
  {
817
817
  link: o,
818
818
  onDismiss: n
819
819
  },
820
820
  o.og_scrape_url
821
821
  )) }) : null;
822
- }, dt = () => {
823
- const { handleSubmit: t } = Ss(), s = Ms();
822
+ }, ut = () => {
823
+ const { handleSubmit: t } = Ms(), s = ks();
824
824
  return /* @__PURE__ */ i(ve, { children: [
825
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(ks, {}) }),
825
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Rs, {}) }),
826
826
  /* @__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: [
827
- /* @__PURE__ */ e(Rs, {}),
828
- /* @__PURE__ */ e(ct, {}),
829
827
  /* @__PURE__ */ e(Ds, {}),
828
+ /* @__PURE__ */ e(dt, {}),
829
+ /* @__PURE__ */ e(Ts, {}),
830
830
  /* @__PURE__ */ i("div", { className: "flex", children: [
831
831
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
832
- Ts,
832
+ Fs,
833
833
  {
834
834
  className: "w-full resize-none outline-none leading-6",
835
835
  autoFocus: !0,
@@ -845,18 +845,18 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
845
845
  disabled: !s,
846
846
  onClick: t,
847
847
  type: "button",
848
- children: /* @__PURE__ */ e(js, { className: "size-4" })
848
+ children: /* @__PURE__ */ e(As, { className: "size-4" })
849
849
  }
850
850
  )
851
851
  ] })
852
852
  ] })
853
853
  ] });
854
- }, ut = ({
854
+ }, mt = ({
855
855
  renderActions: t
856
856
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
857
857
  t && (t == null ? void 0 : t()),
858
- /* @__PURE__ */ e(_s, { Input: dt })
859
- ] }), mt = (t) => {
858
+ /* @__PURE__ */ e(Ss, { Input: ut })
859
+ ] }), ht = (t) => {
860
860
  const s = t.message.hide_date === !0;
861
861
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
862
862
  /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
@@ -864,9 +864,9 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
864
864
  /* @__PURE__ */ e("p", { children: t.message.text }),
865
865
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
866
866
  ] }),
867
- !s && /* @__PURE__ */ e(Fs, { message: t.message })
867
+ !s && /* @__PURE__ */ e(Ls, { message: t.message })
868
868
  ] });
869
- }, ht = () => null, ft = ({ className: t, message: s }) => /* @__PURE__ */ i(
869
+ }, ft = () => null, gt = ({ className: t, message: s }) => /* @__PURE__ */ i(
870
870
  "div",
871
871
  {
872
872
  className: D("flex items-center justify-center h-full", t),
@@ -909,45 +909,45 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
909
909
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
910
910
  ]
911
911
  }
912
- ), he = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
913
- /* @__PURE__ */ e(ft, { className: "w-6 h-6" }),
912
+ ), he = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
913
+ /* @__PURE__ */ e(gt, { className: "w-6 h-6" }),
914
914
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
915
915
  ] }) }));
916
916
  he.displayName = "LoadingState";
917
- const gt = ({
917
+ const xt = ({
918
918
  onBack: t,
919
919
  showBackButton: s,
920
920
  onShowInfo: n,
921
921
  canShowInfo: a,
922
922
  showStarButton: o = !1
923
923
  }) => {
924
- var g, l, I, _, y, E;
925
- const { channel: c } = we(), r = B.useMemo(() => Object.values(c.state.members || {}).find(
926
- (p) => {
927
- var C;
928
- return ((C = p.user) == null ? void 0 : C.id) && p.user.id !== c._client.userID;
924
+ var g, l, y, E, w, p;
925
+ const { channel: c } = we(), r = j.useMemo(() => Object.values(c.state.members || {}).find(
926
+ (N) => {
927
+ var v;
928
+ return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== c._client.userID;
929
929
  }
930
- ), [c._client.userID, c.state.members]), d = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (I = r == null ? void 0 : r.user) == null ? void 0 : I.image, [m, M] = k(
931
- !!((_ = c.state.membership) != null && _.pinned_at)
930
+ ), [c._client.userID, c.state.members]), u = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (y = r == null ? void 0 : r.user) == null ? void 0 : y.image, [h, _] = M(
931
+ !!((E = c.state.membership) != null && E.pinned_at)
932
932
  );
933
- W(() => {
934
- const h = (p) => {
935
- var C;
936
- M(
937
- p != null && p.member ? !!p.member.pinned_at : !!((C = c.state.membership) != null && C.pinned_at)
933
+ q(() => {
934
+ const f = (N) => {
935
+ var v;
936
+ _(
937
+ N != null && N.member ? !!N.member.pinned_at : !!((v = c.state.membership) != null && v.pinned_at)
938
938
  );
939
939
  };
940
- return c.on("member.updated", h), () => {
941
- c.off("member.updated", h);
940
+ return c.on("member.updated", f), () => {
941
+ c.off("member.updated", f);
942
942
  };
943
943
  }, [c]);
944
944
  const x = async () => {
945
945
  try {
946
- m ? await c.unpin() : await c.pin();
947
- } catch (h) {
946
+ h ? await c.unpin() : await c.pin();
947
+ } catch (f) {
948
948
  console.error(
949
949
  "[CustomChannelHeader] Failed to update pinned status:",
950
- h
950
+ f
951
951
  );
952
952
  }
953
953
  };
@@ -970,13 +970,13 @@ const gt = ({
970
970
  /* @__PURE__ */ e(
971
971
  Q,
972
972
  {
973
- id: ((y = r == null ? void 0 : r.user) == null ? void 0 : y.id) || c.id || "unknown",
974
- name: d,
973
+ id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || c.id || "unknown",
974
+ name: u,
975
975
  image: b,
976
976
  size: 40
977
977
  }
978
978
  ),
979
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: d })
979
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
980
980
  ] }),
981
981
  /* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
982
982
  o && /* @__PURE__ */ e(
@@ -985,15 +985,15 @@ const gt = ({
985
985
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
986
986
  onClick: x,
987
987
  type: "button",
988
- "aria-label": m ? "Unstar conversation" : "Star conversation",
988
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
989
989
  children: /* @__PURE__ */ e(
990
990
  _e,
991
991
  {
992
992
  className: D("size-5", {
993
- "text-yellow-600": m,
994
- "text-black/90": !m
993
+ "text-yellow-600": h,
994
+ "text-black/90": !h
995
995
  }),
996
- weight: m ? "duotone" : "regular"
996
+ weight: h ? "duotone" : "regular"
997
997
  }
998
998
  )
999
999
  }
@@ -1025,13 +1025,13 @@ const gt = ({
1025
1025
  /* @__PURE__ */ e(
1026
1026
  Q,
1027
1027
  {
1028
- id: ((E = r == null ? void 0 : r.user) == null ? void 0 : E.id) || c.id || "unknown",
1029
- name: d,
1028
+ id: ((p = r == null ? void 0 : r.user) == null ? void 0 : p.id) || c.id || "unknown",
1029
+ name: u,
1030
1030
  image: b,
1031
1031
  size: 40
1032
1032
  }
1033
1033
  ),
1034
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: d }) })
1034
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
1035
1035
  ] }),
1036
1036
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
1037
1037
  o && /* @__PURE__ */ e(
@@ -1040,15 +1040,15 @@ const gt = ({
1040
1040
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1041
1041
  onClick: x,
1042
1042
  type: "button",
1043
- "aria-label": m ? "Unstar conversation" : "Star conversation",
1043
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1044
1044
  children: /* @__PURE__ */ e(
1045
1045
  _e,
1046
1046
  {
1047
1047
  className: D("size-5", {
1048
- "text-yellow-600": m,
1049
- "text-black/90": !m
1048
+ "text-yellow-600": h,
1049
+ "text-black/90": !h
1050
1050
  }),
1051
- weight: m ? "duotone" : "regular"
1051
+ weight: h ? "duotone" : "regular"
1052
1052
  }
1053
1053
  )
1054
1054
  }
@@ -1066,7 +1066,7 @@ const gt = ({
1066
1066
  ] })
1067
1067
  ] })
1068
1068
  ] });
1069
- }, xt = ({
1069
+ }, bt = ({
1070
1070
  dialogRef: t,
1071
1071
  onClose: s,
1072
1072
  participant: n,
@@ -1074,79 +1074,79 @@ const gt = ({
1074
1074
  followerStatusLabel: o,
1075
1075
  onLeaveConversation: c,
1076
1076
  onBlockParticipant: r,
1077
- showDeleteConversation: d = !0,
1077
+ showDeleteConversation: u = !0,
1078
1078
  onDeleteConversationClick: b,
1079
- onBlockParticipantClick: m,
1080
- onReportParticipantClick: M
1079
+ onBlockParticipantClick: h,
1080
+ onReportParticipantClick: _
1081
1081
  }) => {
1082
- var X, K, q, ne, Z, ee, G;
1083
- const { service: x, debug: g } = fe(), [l, I] = k(!1), [_, y] = k(!1), [E, h] = k(!1), p = T(async () => {
1084
- var P;
1085
- if (!(!x || !((P = n == null ? void 0 : n.user) != null && P.id)))
1082
+ var X, K, Y, ee, ne, J, V;
1083
+ const { service: x, debug: g } = fe(), [l, y] = M(!1), [E, w] = M(!1), [p, f] = M(!1), N = F(async () => {
1084
+ var L;
1085
+ if (!(!x || !((L = n == null ? void 0 : n.user) != null && L.id)))
1086
1086
  try {
1087
- const L = (await x.getBlockedUsers()).some(
1088
- (j) => {
1089
- var z;
1090
- return j.blocked_user_id === ((z = n == null ? void 0 : n.user) == null ? void 0 : z.id);
1087
+ const H = (await x.getBlockedUsers()).some(
1088
+ (O) => {
1089
+ var B;
1090
+ return O.blocked_user_id === ((B = n == null ? void 0 : n.user) == null ? void 0 : B.id);
1091
1091
  }
1092
1092
  );
1093
- I(L);
1094
- } catch (U) {
1093
+ y(H);
1094
+ } catch (P) {
1095
1095
  console.error(
1096
1096
  "[ChannelInfoDialog] Failed to check blocked status:",
1097
- U
1097
+ P
1098
1098
  );
1099
1099
  }
1100
1100
  }, [x, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1101
- W(() => {
1102
- p();
1103
- }, [p]);
1104
- const C = async () => {
1105
- var P;
1106
- if (!_) {
1107
- b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), y(!0);
1101
+ q(() => {
1102
+ N();
1103
+ }, [N]);
1104
+ const v = async () => {
1105
+ var L;
1106
+ if (!E) {
1107
+ b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
1108
1108
  try {
1109
- const U = ((P = a._client) == null ? void 0 : P.userID) ?? null;
1110
- await a.hide(U, !1), c && await c(a), s();
1111
- } catch (U) {
1112
- console.error("[ChannelInfoDialog] Failed to leave conversation", U);
1109
+ const P = ((L = a._client) == null ? void 0 : L.userID) ?? null;
1110
+ await a.hide(P, !1), c && await c(a), s();
1111
+ } catch (P) {
1112
+ console.error("[ChannelInfoDialog] Failed to leave conversation", P);
1113
1113
  } finally {
1114
- y(!1);
1114
+ w(!1);
1115
1115
  }
1116
1116
  }
1117
- }, v = async () => {
1118
- var P, U, L;
1119
- if (!(E || !x)) {
1120
- m == null || m(), g && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), h(!0);
1117
+ }, R = async () => {
1118
+ var L, P, H;
1119
+ if (!(p || !x)) {
1120
+ h == null || h(), g && console.log("[ChannelInfoDialog] Block member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
1121
1121
  try {
1122
- await x.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), s();
1123
- } catch (j) {
1124
- console.error("[ChannelInfoDialog] Failed to block member", j);
1122
+ await x.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
1123
+ } catch (O) {
1124
+ console.error("[ChannelInfoDialog] Failed to block member", O);
1125
1125
  } finally {
1126
- h(!1);
1126
+ f(!1);
1127
1127
  }
1128
1128
  }
1129
- }, f = async () => {
1130
- var P, U, L;
1131
- if (!(E || !x)) {
1132
- m == null || m(), g && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), h(!0);
1129
+ }, d = async () => {
1130
+ var L, P, H;
1131
+ if (!(p || !x)) {
1132
+ h == null || h(), g && console.log("[ChannelInfoDialog] Unblock member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
1133
1133
  try {
1134
- await x.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), s();
1135
- } catch (j) {
1136
- console.error("[ChannelInfoDialog] Failed to unblock member", j);
1134
+ await x.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
1135
+ } catch (O) {
1136
+ console.error("[ChannelInfoDialog] Failed to unblock member", O);
1137
1137
  } finally {
1138
- h(!1);
1138
+ f(!1);
1139
1139
  }
1140
1140
  }
1141
- }, u = () => {
1142
- M == null || M(), s(), window.open(
1141
+ }, m = () => {
1142
+ _ == null || _(), s(), window.open(
1143
1143
  "https://linktr.ee/s/about/trust-center/report",
1144
1144
  "_blank",
1145
1145
  "noopener,noreferrer"
1146
1146
  );
1147
1147
  };
1148
1148
  if (!n) return null;
1149
- const N = ((K = n.user) == null ? void 0 : K.name) || ((q = n.user) == null ? void 0 : q.id) || "Unknown member", R = (ne = n.user) == null ? void 0 : ne.image, w = (Z = n.user) == null ? void 0 : Z.email, F = (ee = n.user) == null ? void 0 : ee.username, $ = w || (F ? `linktr.ee/${F}` : void 0), te = ((G = n.user) == null ? void 0 : G.id) || "unknown";
1149
+ const C = ((K = n.user) == null ? void 0 : K.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", k = (ee = n.user) == null ? void 0 : ee.image, T = (ne = n.user) == null ? void 0 : ne.email, S = (J = n.user) == null ? void 0 : J.username, G = T || (S ? `linktr.ee/${S}` : void 0), z = ((V = n.user) == null ? void 0 : V.id) || "unknown";
1150
1150
  return (
1151
1151
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1152
1152
  /* @__PURE__ */ e(
@@ -1155,8 +1155,8 @@ const gt = ({
1155
1155
  ref: t,
1156
1156
  className: "mes-dialog group",
1157
1157
  onClose: s,
1158
- onClick: (P) => {
1159
- P.target === t.current && s();
1158
+ onClick: (L) => {
1159
+ L.target === t.current && s();
1160
1160
  },
1161
1161
  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: [
1162
1162
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
@@ -1173,16 +1173,16 @@ const gt = ({
1173
1173
  /* @__PURE__ */ e(
1174
1174
  Q,
1175
1175
  {
1176
- id: te,
1177
- name: N,
1178
- image: R,
1176
+ id: z,
1177
+ name: C,
1178
+ image: k,
1179
1179
  size: 88,
1180
1180
  shape: "circle"
1181
1181
  }
1182
1182
  ),
1183
1183
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1184
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: N }),
1185
- $ && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: $ }),
1184
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
1185
+ G && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: G }),
1186
1186
  o && /* @__PURE__ */ e(
1187
1187
  "span",
1188
1188
  {
@@ -1202,14 +1202,14 @@ const gt = ({
1202
1202
  }
1203
1203
  ),
1204
1204
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
1205
- d && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1205
+ u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1206
1206
  de,
1207
1207
  {
1208
- onClick: C,
1209
- disabled: _,
1210
- "aria-busy": _,
1208
+ onClick: v,
1209
+ disabled: E,
1210
+ "aria-busy": E,
1211
1211
  children: [
1212
- _ ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(As, { className: "h-5 w-5" }),
1212
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1213
1213
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1214
1214
  ]
1215
1215
  }
@@ -1217,28 +1217,28 @@ const gt = ({
1217
1217
  /* @__PURE__ */ e("li", { children: l ? /* @__PURE__ */ i(
1218
1218
  de,
1219
1219
  {
1220
- onClick: f,
1221
- disabled: E,
1222
- "aria-busy": E,
1220
+ onClick: d,
1221
+ disabled: p,
1222
+ "aria-busy": p,
1223
1223
  children: [
1224
- E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1224
+ p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1225
1225
  /* @__PURE__ */ e("span", { children: "Unblock" })
1226
1226
  ]
1227
1227
  }
1228
1228
  ) : /* @__PURE__ */ i(
1229
1229
  de,
1230
1230
  {
1231
- onClick: v,
1232
- disabled: E,
1233
- "aria-busy": E,
1231
+ onClick: R,
1232
+ disabled: p,
1233
+ "aria-busy": p,
1234
1234
  children: [
1235
- E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1235
+ p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1236
1236
  /* @__PURE__ */ e("span", { children: "Block" })
1237
1237
  ]
1238
1238
  }
1239
1239
  ) }),
1240
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: u, children: [
1241
- /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1240
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
1241
+ /* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
1242
1242
  /* @__PURE__ */ e("span", { children: "Report" })
1243
1243
  ] }) })
1244
1244
  ] })
@@ -1247,7 +1247,7 @@ const gt = ({
1247
1247
  }
1248
1248
  )
1249
1249
  );
1250
- }, bt = ({
1250
+ }, Ct = ({
1251
1251
  onBack: t,
1252
1252
  showBackButton: s,
1253
1253
  renderMessageInputActions: n,
@@ -1255,51 +1255,51 @@ const gt = ({
1255
1255
  onBlockParticipant: o,
1256
1256
  showDeleteConversation: c = !0,
1257
1257
  onDeleteConversationClick: r,
1258
- onBlockParticipantClick: d,
1258
+ onBlockParticipantClick: u,
1259
1259
  onReportParticipantClick: b,
1260
- showStarButton: m = !1,
1261
- chatbotVotingEnabled: M = !1,
1260
+ showStarButton: h = !1,
1261
+ chatbotVotingEnabled: _ = !1,
1262
1262
  renderChannelBanner: x
1263
1263
  }) => {
1264
- const { channel: g } = we(), l = V(null), I = B.useMemo(() => Object.values(g.state.members || {}).find(
1265
- (p) => {
1266
- var C;
1267
- return ((C = p.user) == null ? void 0 : C.id) && p.user.id !== g._client.userID;
1264
+ const { channel: g } = we(), l = W(null), y = j.useMemo(() => Object.values(g.state.members || {}).find(
1265
+ (N) => {
1266
+ var v;
1267
+ return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== g._client.userID;
1268
1268
  }
1269
- ), [g._client.userID, g.state.members]), _ = B.useMemo(() => {
1270
- const h = g.data ?? {};
1271
- if (h.followerStatus)
1272
- return String(h.followerStatus);
1273
- if (h.isFollower !== void 0)
1274
- return h.isFollower ? "Subscribed to you" : "Not subscribed";
1275
- }, [g.data]), y = T(() => {
1276
- var h;
1277
- (h = l.current) == null || h.showModal();
1278
- }, []), E = T(() => {
1279
- var h;
1280
- (h = l.current) == null || h.close();
1269
+ ), [g._client.userID, g.state.members]), E = j.useMemo(() => {
1270
+ const f = g.data ?? {};
1271
+ if (f.followerStatus)
1272
+ return String(f.followerStatus);
1273
+ if (f.isFollower !== void 0)
1274
+ return f.isFollower ? "Subscribed to you" : "Not subscribed";
1275
+ }, [g.data]), w = F(() => {
1276
+ var f;
1277
+ (f = l.current) == null || f.showModal();
1278
+ }, []), p = F(() => {
1279
+ var f;
1280
+ (f = l.current) == null || f.close();
1281
1281
  }, []);
1282
1282
  return /* @__PURE__ */ i(ve, { children: [
1283
1283
  /* @__PURE__ */ e(
1284
- Ps,
1284
+ Os,
1285
1285
  {
1286
1286
  overrides: {
1287
- Message: (h) => /* @__PURE__ */ e(lt, { ...h, chatbotVotingEnabled: M })
1287
+ Message: (f) => /* @__PURE__ */ e(ot, { ...f, chatbotVotingEnabled: _ })
1288
1288
  },
1289
- children: /* @__PURE__ */ i(Os, { children: [
1289
+ children: /* @__PURE__ */ i(Us, { children: [
1290
1290
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1291
- gt,
1291
+ xt,
1292
1292
  {
1293
1293
  onBack: t,
1294
1294
  showBackButton: s,
1295
- onShowInfo: y,
1296
- canShowInfo: !!I,
1297
- showStarButton: m
1295
+ onShowInfo: w,
1296
+ canShowInfo: !!y,
1297
+ showStarButton: h
1298
1298
  }
1299
1299
  ) }),
1300
1300
  x == null ? void 0 : x(),
1301
1301
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1302
- Us,
1302
+ Bs,
1303
1303
  {
1304
1304
  hideDeletedMessages: !0,
1305
1305
  hideNewMessageSeparator: !1,
@@ -1307,7 +1307,7 @@ const gt = ({
1307
1307
  }
1308
1308
  ) }),
1309
1309
  /* @__PURE__ */ e(
1310
- ut,
1310
+ mt,
1311
1311
  {
1312
1312
  renderActions: () => n == null ? void 0 : n(g)
1313
1313
  }
@@ -1316,23 +1316,23 @@ const gt = ({
1316
1316
  }
1317
1317
  ),
1318
1318
  /* @__PURE__ */ e(
1319
- xt,
1319
+ bt,
1320
1320
  {
1321
1321
  dialogRef: l,
1322
- onClose: E,
1323
- participant: I,
1322
+ onClose: p,
1323
+ participant: y,
1324
1324
  channel: g,
1325
- followerStatusLabel: _,
1325
+ followerStatusLabel: E,
1326
1326
  onLeaveConversation: a,
1327
1327
  onBlockParticipant: o,
1328
1328
  showDeleteConversation: c,
1329
1329
  onDeleteConversationClick: r,
1330
- onBlockParticipantClick: d,
1330
+ onBlockParticipantClick: u,
1331
1331
  onReportParticipantClick: b
1332
1332
  }
1333
1333
  )
1334
1334
  ] });
1335
- }, Ae = B.memo(
1335
+ }, Ae = j.memo(
1336
1336
  ({
1337
1337
  channel: t,
1338
1338
  onBack: s,
@@ -1341,37 +1341,37 @@ const gt = ({
1341
1341
  onLeaveConversation: o,
1342
1342
  onBlockParticipant: c,
1343
1343
  className: r,
1344
- CustomChannelEmptyState: d = ht,
1344
+ CustomChannelEmptyState: u = ft,
1345
1345
  showDeleteConversation: b = !0,
1346
- onDeleteConversationClick: m,
1347
- onBlockParticipantClick: M,
1346
+ onDeleteConversationClick: h,
1347
+ onBlockParticipantClick: _,
1348
1348
  onReportParticipantClick: x,
1349
1349
  dmAgentEnabled: g,
1350
1350
  messageMetadata: l,
1351
- onMessageSent: I,
1352
- showStarButton: _ = !1,
1353
- chatbotVotingEnabled: y = !1,
1354
- renderChannelBanner: E
1351
+ onMessageSent: y,
1352
+ showStarButton: E = !1,
1353
+ chatbotVotingEnabled: w = !1,
1354
+ renderChannelBanner: p
1355
1355
  }) => {
1356
- const h = T(
1357
- async (p, C, v) => {
1358
- var F;
1359
- const f = ((F = t.data) == null ? void 0 : F.chatbot_paused) === !0, u = g && !f, N = {
1360
- ...C,
1361
- ...u && { silent: !0 },
1356
+ const f = F(
1357
+ async (N, v, R) => {
1358
+ var S;
1359
+ const d = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, m = g && !d, C = {
1360
+ ...v,
1361
+ ...m && { silent: !0 },
1362
1362
  ...l && {
1363
1363
  metadata: {
1364
- ...C.metadata ?? {},
1364
+ ...v.metadata ?? {},
1365
1365
  ...l
1366
1366
  }
1367
1367
  }
1368
- }, R = {
1369
- ...v,
1370
- ...u && { skip_push: !0 }
1371
- }, w = await t.sendMessage(N, R);
1372
- return I == null || I(w), w;
1368
+ }, k = {
1369
+ ...R,
1370
+ ...m && { skip_push: !0 }
1371
+ }, T = await t.sendMessage(C, k);
1372
+ return y == null || y(T), T;
1373
1373
  },
1374
- [t, g, l, I]
1374
+ [t, g, l, y]
1375
1375
  );
1376
1376
  return /* @__PURE__ */ e(
1377
1377
  "div",
@@ -1381,30 +1381,30 @@ const gt = ({
1381
1381
  r
1382
1382
  ),
1383
1383
  children: /* @__PURE__ */ e(
1384
- Ls,
1384
+ Ps,
1385
1385
  {
1386
1386
  channel: t,
1387
- MessageSystem: mt,
1388
- EmptyStateIndicator: d,
1387
+ MessageSystem: ht,
1388
+ EmptyStateIndicator: u,
1389
1389
  LoadingIndicator: he,
1390
- DateSeparator: Xs,
1391
- doSendMessageRequest: h,
1390
+ DateSeparator: Ks,
1391
+ doSendMessageRequest: f,
1392
1392
  children: /* @__PURE__ */ e(
1393
- bt,
1393
+ Ct,
1394
1394
  {
1395
1395
  onBack: s,
1396
1396
  showBackButton: n,
1397
1397
  renderMessageInputActions: a,
1398
1398
  onLeaveConversation: o,
1399
1399
  onBlockParticipant: c,
1400
- CustomChannelEmptyState: d,
1400
+ CustomChannelEmptyState: u,
1401
1401
  showDeleteConversation: b,
1402
- onDeleteConversationClick: m,
1403
- onBlockParticipantClick: M,
1402
+ onDeleteConversationClick: h,
1403
+ onBlockParticipantClick: _,
1404
1404
  onReportParticipantClick: x,
1405
- showStarButton: _,
1406
- chatbotVotingEnabled: y,
1407
- renderChannelBanner: E
1405
+ showStarButton: E,
1406
+ chatbotVotingEnabled: w,
1407
+ renderChannelBanner: p
1408
1408
  }
1409
1409
  )
1410
1410
  }
@@ -1414,15 +1414,15 @@ const gt = ({
1414
1414
  }
1415
1415
  );
1416
1416
  Ae.displayName = "ChannelView";
1417
- function Ct({
1417
+ function Nt({
1418
1418
  searchQuery: t,
1419
1419
  setSearchQuery: s,
1420
1420
  placeholder: n
1421
1421
  }) {
1422
- const a = V(null);
1422
+ const a = W(null);
1423
1423
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1424
1424
  /* @__PURE__ */ e(
1425
- zs,
1425
+ Hs,
1426
1426
  {
1427
1427
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1428
1428
  weight: "bold"
@@ -1453,7 +1453,7 @@ function Ct({
1453
1453
  )
1454
1454
  ] });
1455
1455
  }
1456
- const Nt = ({
1456
+ const vt = ({
1457
1457
  participantSource: t,
1458
1458
  onSelectParticipant: s,
1459
1459
  onClose: n,
@@ -1462,56 +1462,56 @@ const Nt = ({
1462
1462
  searchPlaceholder: c = "Search participants...",
1463
1463
  className: r
1464
1464
  }) => {
1465
- const { debug: d } = fe(), [b, m] = k(""), [M, x] = k([]), [g, l] = k(!1), [I, _] = k(null), [y, E] = k(
1465
+ const { debug: u } = fe(), [b, h] = M(""), [_, x] = M([]), [g, l] = M(!1), [y, E] = M(null), [w, p] = M(
1466
1466
  null
1467
- ), h = V(!1);
1468
- W(() => {
1467
+ ), f = W(!1);
1468
+ q(() => {
1469
1469
  if (t.loading) {
1470
- d && console.log(
1470
+ u && console.log(
1471
1471
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1472
1472
  );
1473
1473
  return;
1474
1474
  }
1475
- if (h.current) return;
1475
+ if (f.current) return;
1476
1476
  (async () => {
1477
- d && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), _(null);
1477
+ u && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), E(null);
1478
1478
  try {
1479
- const u = await t.loadParticipants({
1479
+ const m = await t.loadParticipants({
1480
1480
  search: "",
1481
1481
  // Load all participants initially
1482
1482
  limit: 100
1483
1483
  });
1484
- x(u.participants), h.current = !0, d && console.log(
1484
+ x(m.participants), f.current = !0, u && console.log(
1485
1485
  "[ParticipantPicker] Participants loaded successfully:",
1486
- u.participants.length
1486
+ m.participants.length
1487
1487
  );
1488
- } catch (u) {
1489
- const N = u instanceof Error ? u.message : "Failed to load participants";
1490
- _(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1488
+ } catch (m) {
1489
+ const C = m instanceof Error ? m.message : "Failed to load participants";
1490
+ E(C), console.error("[ParticipantPicker] Failed to load participants:", m);
1491
1491
  } finally {
1492
1492
  l(!1);
1493
1493
  }
1494
1494
  })();
1495
- }, [t.loading, d]);
1496
- const p = M.filter((f) => !a.has(f.id)).filter((f) => {
1497
- var N;
1495
+ }, [t.loading, u]);
1496
+ const N = _.filter((d) => !a.has(d.id)).filter((d) => {
1497
+ var C;
1498
1498
  if (!b) return !0;
1499
- const u = b.toLowerCase();
1500
- return f.name.toLowerCase().includes(u) || ((N = f.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1501
- }), C = T(
1502
- async (f) => {
1503
- if (!y) {
1504
- E(f.id);
1499
+ const m = b.toLowerCase();
1500
+ return d.name.toLowerCase().includes(m) || ((C = d.email) == null ? void 0 : C.toLowerCase().includes(m)) || !1;
1501
+ }), v = F(
1502
+ async (d) => {
1503
+ if (!w) {
1504
+ p(d.id);
1505
1505
  try {
1506
- await s(f);
1507
- } catch (u) {
1508
- console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
1506
+ await s(d);
1507
+ } catch (m) {
1508
+ console.error("[ParticipantPicker] Failed to start chat:", m), p(null);
1509
1509
  }
1510
1510
  }
1511
1511
  },
1512
- [s, y]
1513
- ), v = (f, u) => {
1514
- (f.key === "Enter" || f.key === " ") && (f.preventDefault(), C(u));
1512
+ [s, w]
1513
+ ), R = (d, m) => {
1514
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), v(m));
1515
1515
  };
1516
1516
  return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1517
1517
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
@@ -1523,66 +1523,66 @@ const Nt = ({
1523
1523
  "Select a ",
1524
1524
  o.slice(0, -1),
1525
1525
  " to start messaging (",
1526
- p.length,
1526
+ N.length,
1527
1527
  " available)",
1528
1528
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${o} total`
1529
1529
  ] }),
1530
1530
  /* @__PURE__ */ e(
1531
- Ct,
1531
+ Nt,
1532
1532
  {
1533
1533
  searchQuery: b,
1534
- setSearchQuery: m,
1534
+ setSearchQuery: h,
1535
1535
  placeholder: c
1536
1536
  }
1537
1537
  )
1538
1538
  ] }),
1539
- I && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1539
+ y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1540
1540
  "Error loading ",
1541
1541
  o,
1542
1542
  ": ",
1543
- I
1543
+ y
1544
1544
  ] }),
1545
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g && p.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: [
1545
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g && N.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: [
1546
1546
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1547
1547
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1548
1548
  "Loading ",
1549
1549
  o,
1550
1550
  "..."
1551
1551
  ] })
1552
- ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1552
+ ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1553
1553
  /* @__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" }) }),
1554
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : M.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1555
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : M.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1554
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : _.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1555
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : _.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1556
1556
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1557
- p.map((f) => {
1558
- const u = f.name || f.email || f.id, N = f.email && f.name ? f.email : f.phone;
1557
+ N.map((d) => {
1558
+ const m = d.name || d.email || d.id, C = d.email && d.name ? d.email : d.phone;
1559
1559
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1560
1560
  "button",
1561
1561
  {
1562
1562
  type: "button",
1563
- onClick: () => C(f),
1564
- onKeyDown: (R) => v(R, f),
1563
+ onClick: () => v(d),
1564
+ onKeyDown: (k) => R(k, d),
1565
1565
  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",
1566
1566
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1567
1567
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1568
1568
  /* @__PURE__ */ e(
1569
1569
  Q,
1570
1570
  {
1571
- id: f.id,
1572
- name: u,
1573
- image: f.image,
1571
+ id: d.id,
1572
+ name: m,
1573
+ image: d.image,
1574
1574
  size: 40
1575
1575
  }
1576
1576
  ),
1577
1577
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1578
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1579
- N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1578
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1579
+ C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1580
1580
  ] })
1581
1581
  ] }),
1582
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === f.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
1582
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === d.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
1583
1583
  ] })
1584
1584
  }
1585
- ) }, f.id);
1585
+ ) }, d.id);
1586
1586
  }),
1587
1587
  g && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1588
1588
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
@@ -1590,7 +1590,7 @@ const Nt = ({
1590
1590
  ] }) })
1591
1591
  ] }) })
1592
1592
  ] });
1593
- }, vt = ({ className: t }) => /* @__PURE__ */ i(
1593
+ }, wt = ({ className: t }) => /* @__PURE__ */ i(
1594
1594
  "svg",
1595
1595
  {
1596
1596
  width: "140",
@@ -1724,9 +1724,9 @@ const Nt = ({
1724
1724
  ] })
1725
1725
  ]
1726
1726
  }
1727
- ), $e = B.memo(
1727
+ ), $e = j.memo(
1728
1728
  ({ 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: [
1729
- /* @__PURE__ */ e(vt, {}),
1729
+ /* @__PURE__ */ e(wt, {}),
1730
1730
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1731
1731
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1732
1732
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
@@ -1734,7 +1734,7 @@ const Nt = ({
1734
1734
  ] }) })
1735
1735
  );
1736
1736
  $e.displayName = "EmptyState";
1737
- const me = B.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: [
1737
+ const me = j.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1738
1738
  /* @__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: "โš ๏ธ" }) }),
1739
1739
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1740
1740
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1749,7 +1749,7 @@ const me = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1749
1749
  )
1750
1750
  ] }) }));
1751
1751
  me.displayName = "ErrorState";
1752
- const Rt = ({
1752
+ const Dt = ({
1753
1753
  capabilities: t = {},
1754
1754
  className: s,
1755
1755
  renderMessageInputActions: n,
@@ -1757,114 +1757,115 @@ const Rt = ({
1757
1757
  onParticipantSelect: o,
1758
1758
  initialParticipantFilter: c,
1759
1759
  initialParticipantData: r,
1760
- CustomChannelEmptyState: d,
1760
+ CustomChannelEmptyState: u,
1761
1761
  showChannelList: b = !0,
1762
- filters: m,
1763
- channelListCustomEmptyStateIndicator: M,
1762
+ filters: h,
1763
+ channelListCustomEmptyStateIndicator: _,
1764
1764
  onDeleteConversationClick: x,
1765
1765
  onBlockParticipantClick: g,
1766
1766
  onReportParticipantClick: l,
1767
- dmAgentEnabled: I,
1768
- messageMetadata: _,
1769
- onMessageSent: y,
1770
- showStarButton: E = !1,
1771
- chatbotVotingEnabled: h = !1,
1772
- renderMessagePreview: p
1767
+ dmAgentEnabled: y,
1768
+ messageMetadata: E,
1769
+ onMessageSent: w,
1770
+ showStarButton: p = !1,
1771
+ chatbotVotingEnabled: f = !1,
1772
+ renderMessagePreview: N,
1773
+ renderChannelBanner: v
1773
1774
  }) => {
1774
1775
  const {
1775
- service: C,
1776
- client: v,
1777
- isConnected: f,
1778
- isLoading: u,
1779
- error: N,
1780
- refreshConnection: R,
1781
- debug: w
1782
- } = Hs(), [F, $] = k(null), [te, X] = k(!1), [K, q] = k(!1), [ne, Z] = k(!1), [ee, G] = k(/* @__PURE__ */ new Set()), [P, U] = k(0), [L, j] = k(!1), [z, Y] = k(null), J = V(null), {
1783
- participantSource: ae,
1784
- participantLabel: re = "participants",
1785
- showDeleteConversation: le = !0
1786
- } = t, ze = B.useMemo(() => {
1787
- const S = v == null ? void 0 : v.userID;
1776
+ service: R,
1777
+ client: d,
1778
+ isConnected: m,
1779
+ isLoading: C,
1780
+ error: k,
1781
+ refreshConnection: T,
1782
+ debug: S
1783
+ } = Gs(), [G, z] = M(null), [X, K] = M(!1), [Y, ee] = M(!1), [ne, J] = M(!1), [V, L] = M(/* @__PURE__ */ new Set()), [P, H] = M(0), [O, B] = M(!1), [le, Z] = M(null), se = W(null), {
1784
+ participantSource: re,
1785
+ participantLabel: ae = "participants",
1786
+ showDeleteConversation: ze = !0
1787
+ } = t, He = j.useMemo(() => {
1788
+ const I = d == null ? void 0 : d.userID;
1788
1789
  return {
1789
1790
  ...{
1790
1791
  type: "messaging",
1791
1792
  last_message_at: { $exists: !0 },
1792
- ...S && {
1793
- members: { $in: [S] },
1793
+ ...I && {
1794
+ members: { $in: [I] },
1794
1795
  hidden: !1
1795
1796
  }
1796
1797
  },
1797
- ...m
1798
+ ...h
1798
1799
  };
1799
- }, [m, v == null ? void 0 : v.userID]), oe = V(null), se = T(async () => {
1800
- if (!v || !f) return;
1801
- const S = v.userID;
1802
- if (S)
1800
+ }, [h, d == null ? void 0 : d.userID]), oe = W(null), te = F(async () => {
1801
+ if (!d || !m) return;
1802
+ const I = d.userID;
1803
+ if (I)
1803
1804
  try {
1804
- w && console.log("[MessagingShell] Syncing channels for user:", S);
1805
- const H = await v.queryChannels(
1805
+ S && console.log("[MessagingShell] Syncing channels for user:", I);
1806
+ const $ = await d.queryChannels(
1806
1807
  {
1807
1808
  type: "messaging",
1808
- members: { $in: [S] }
1809
+ members: { $in: [I] }
1809
1810
  },
1810
1811
  {},
1811
1812
  { limit: 100 }
1812
- ), O = /* @__PURE__ */ new Set();
1813
- H.forEach((A) => {
1813
+ ), U = /* @__PURE__ */ new Set();
1814
+ $.forEach((A) => {
1814
1815
  const ge = A.state.members;
1815
- Object.values(ge).forEach((Ye) => {
1816
+ Object.values(ge).forEach((Je) => {
1816
1817
  var Ee;
1817
- const xe = (Ee = Ye.user) == null ? void 0 : Ee.id;
1818
- xe && xe !== S && O.add(xe);
1818
+ const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
1819
+ xe && xe !== I && U.add(xe);
1819
1820
  });
1820
- }), G((A) => A.size === O.size && [...A].every((ge) => O.has(ge)) ? A : O), X(H.length > 0), q(!0), oe.current = S, w && console.log("[MessagingShell] Channels synced successfully:", {
1821
- channelCount: H.length,
1822
- memberCount: O.size
1821
+ }), L((A) => A.size === U.size && [...A].every((ge) => U.has(ge)) ? A : U), K($.length > 0), ee(!0), oe.current = I, S && console.log("[MessagingShell] Channels synced successfully:", {
1822
+ channelCount: $.length,
1823
+ memberCount: U.size
1823
1824
  });
1824
- } catch (H) {
1825
- console.error("[MessagingShell] Failed to sync channels:", H);
1825
+ } catch ($) {
1826
+ console.error("[MessagingShell] Failed to sync channels:", $);
1826
1827
  }
1827
- }, [v, f, w]);
1828
- W(() => {
1829
- if (!v || !f) return;
1830
- const S = v.userID;
1831
- S && oe.current !== S && se();
1832
- }, [v, f, se]), W(() => {
1833
- if (!c || !v || !f) return;
1828
+ }, [d, m, S]);
1829
+ q(() => {
1830
+ if (!d || !m) return;
1831
+ const I = d.userID;
1832
+ I && oe.current !== I && te();
1833
+ }, [d, m, te]), q(() => {
1834
+ if (!c || !d || !m) return;
1834
1835
  (async () => {
1835
- const H = v.userID;
1836
- if (H)
1836
+ const $ = d.userID;
1837
+ if ($)
1837
1838
  try {
1838
- w && console.log(
1839
+ S && console.log(
1839
1840
  "[MessagingShell] Loading initial conversation with:",
1840
1841
  c
1841
1842
  );
1842
- const O = await v.queryChannels(
1843
+ const U = await d.queryChannels(
1843
1844
  {
1844
1845
  type: "messaging",
1845
- members: { $eq: [H, c] }
1846
+ members: { $eq: [$, c] }
1846
1847
  },
1847
1848
  {},
1848
1849
  { limit: 1 }
1849
1850
  );
1850
- if (O.length > 0)
1851
- $(O[0]), j(!0), Y(null), a && a(O[0]), w && console.log(
1851
+ if (U.length > 0)
1852
+ z(U[0]), B(!0), Z(null), a && a(U[0]), S && console.log(
1852
1853
  "[MessagingShell] Initial conversation loaded:",
1853
- O[0].id
1854
+ U[0].id
1854
1855
  );
1855
- else if (r && C) {
1856
- w && console.log(
1856
+ else if (r && R) {
1857
+ S && console.log(
1857
1858
  "[MessagingShell] No conversation found, creating one for:",
1858
1859
  r
1859
1860
  );
1860
1861
  try {
1861
- const A = await C.startChannelWithParticipant({
1862
+ const A = await R.startChannelWithParticipant({
1862
1863
  id: r.id,
1863
1864
  name: r.name,
1864
1865
  email: r.email,
1865
1866
  phone: r.phone
1866
1867
  });
1867
- $(A), j(!0), Y(null), a && a(A), w && console.log(
1868
+ z(A), B(!0), Z(null), a && a(A), S && console.log(
1868
1869
  "[MessagingShell] Channel created and loaded:",
1869
1870
  A.id
1870
1871
  );
@@ -1872,90 +1873,90 @@ const Rt = ({
1872
1873
  console.error(
1873
1874
  "[MessagingShell] Failed to create conversation:",
1874
1875
  A
1875
- ), Y("Failed to create conversation");
1876
+ ), Z("Failed to create conversation");
1876
1877
  }
1877
1878
  } else
1878
- Y(
1879
+ Z(
1879
1880
  "No conversation found with this account"
1880
- ), w && console.log(
1881
+ ), S && console.log(
1881
1882
  "[MessagingShell] No conversation found for:",
1882
1883
  c
1883
1884
  );
1884
- } catch (O) {
1885
+ } catch (U) {
1885
1886
  console.error(
1886
1887
  "[MessagingShell] Failed to load initial conversation:",
1887
- O
1888
- ), Y("Failed to load conversation");
1888
+ U
1889
+ ), Z("Failed to load conversation");
1889
1890
  }
1890
1891
  })();
1891
1892
  }, [
1892
1893
  c,
1893
1894
  r,
1894
- v,
1895
- f,
1896
- C,
1897
- w,
1895
+ d,
1896
+ m,
1897
+ R,
1898
+ S,
1898
1899
  a
1899
1900
  ]);
1900
- const He = T(
1901
- (S) => {
1902
- $(S), a == null || a(S);
1901
+ const Ge = F(
1902
+ (I) => {
1903
+ z(I), a == null || a(I);
1903
1904
  },
1904
1905
  [a]
1905
- ), Ge = T(() => {
1906
- L || $(null);
1907
- }, [L]), Ve = T(
1908
- async (S) => {
1909
- var H;
1910
- if (C)
1906
+ ), Ve = F(() => {
1907
+ O || z(null);
1908
+ }, [O]), We = F(
1909
+ async (I) => {
1910
+ var $;
1911
+ if (R)
1911
1912
  try {
1912
- w && console.log(
1913
+ S && console.log(
1913
1914
  "[MessagingShell] Starting conversation with:",
1914
- S.id
1915
+ I.id
1915
1916
  );
1916
- const O = await C.startChannelWithParticipant({
1917
- id: S.id,
1918
- name: S.name,
1919
- email: S.email,
1920
- phone: S.phone
1917
+ const U = await R.startChannelWithParticipant({
1918
+ id: I.id,
1919
+ name: I.name,
1920
+ email: I.email,
1921
+ phone: I.phone
1921
1922
  });
1922
1923
  try {
1923
- await O.show();
1924
+ await U.show();
1924
1925
  } catch (A) {
1925
1926
  console.warn("[MessagingShell] Failed to unhide channel:", A);
1926
1927
  }
1927
- $(O), Z(!1), (H = J.current) == null || H.close(), o == null || o(S);
1928
- } catch (O) {
1929
- console.error("[MessagingShell] Failed to start conversation:", O);
1928
+ z(U), J(!1), ($ = se.current) == null || $.close(), o == null || o(I);
1929
+ } catch (U) {
1930
+ console.error("[MessagingShell] Failed to start conversation:", U);
1930
1931
  }
1931
1932
  },
1932
- [C, o, w]
1933
- ), ie = T(() => {
1934
- var S;
1935
- Z(!1), (S = J.current) == null || S.close();
1936
- }, []), We = T(
1937
- (S) => {
1938
- S.target === J.current && ie();
1933
+ [R, o, S]
1934
+ ), ie = F(() => {
1935
+ var I;
1936
+ J(!1), (I = se.current) == null || I.close();
1937
+ }, []), qe = F(
1938
+ (I) => {
1939
+ I.target === se.current && ie();
1939
1940
  },
1940
1941
  [ie]
1941
- ), qe = T(
1942
- async (S) => {
1943
- w && console.log("[MessagingShell] Leaving conversation:", S.id), $(null), j(!1), oe.current = null, await se();
1942
+ ), Ze = F(
1943
+ async (I) => {
1944
+ S && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), B(!1), oe.current = null, await te();
1944
1945
  },
1945
- [se, w]
1946
- ), Ze = T(
1947
- async (S) => {
1948
- w && console.log("[MessagingShell] Blocking participant:", S), $(null), j(!1), oe.current = null, await se();
1946
+ [te, S]
1947
+ ), Ye = F(
1948
+ async (I) => {
1949
+ S && console.log("[MessagingShell] Blocking participant:", I), z(null), B(!1), oe.current = null, await te();
1949
1950
  },
1950
- [se, w]
1951
- ), ce = !!F;
1952
- return u ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : N ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: N, onBack: R }) }) : !f || !v ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1951
+ [te, S]
1952
+ ), ce = !!G;
1953
+ return C ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : k ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: k, onBack: T }) }) : !m || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1953
1954
  me,
1954
1955
  {
1955
1956
  message: "Not connected to messaging service",
1956
- onBack: R
1957
+ onBack: T
1957
1958
  }
1958
- ) }) : z ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: z }) }) : /* @__PURE__ */ i(
1959
+ ) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: le }) }) : /* @__PURE__ */ i(
1959
1960
  "div",
1960
1961
  {
1961
1962
  className: D(
@@ -1970,21 +1971,21 @@ const Rt = ({
1970
1971
  className: D(
1971
1972
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1972
1973
  {
1973
- "!hidden": b === !1 || L,
1974
+ "!hidden": b === !1 || O,
1974
1975
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1975
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !L && ce,
1976
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !O && ce,
1976
1977
  // Show on mobile when no channel selected, use same wide width on desktop
1977
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !L && !ce
1978
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !O && !ce
1978
1979
  }
1979
1980
  ),
1980
1981
  children: /* @__PURE__ */ e(
1981
1982
  Ue,
1982
1983
  {
1983
- onChannelSelect: He,
1984
- selectedChannel: F || void 0,
1985
- filters: ze,
1986
- customEmptyStateIndicator: M,
1987
- renderMessagePreview: p
1984
+ onChannelSelect: Ge,
1985
+ selectedChannel: G || void 0,
1986
+ filters: He,
1987
+ customEmptyStateIndicator: _,
1988
+ renderMessagePreview: N
1988
1989
  }
1989
1990
  )
1990
1991
  }
@@ -1996,62 +1997,63 @@ const Rt = ({
1996
1997
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1997
1998
  {
1998
1999
  // In direct conversation mode (or waiting for it), always show (full width)
1999
- flex: L || ce || c,
2000
+ flex: O || ce || c,
2000
2001
  // Normal mode: hide on mobile when no channel selected
2001
- "hidden lg:flex": !L && !ce && !c
2002
+ "hidden lg:flex": !O && !ce && !c
2002
2003
  }
2003
2004
  ),
2004
- children: F ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2005
+ children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2005
2006
  Ae,
2006
2007
  {
2007
- channel: F,
2008
- onBack: Ge,
2009
- showBackButton: !L,
2008
+ channel: G,
2009
+ onBack: Ve,
2010
+ showBackButton: !O,
2010
2011
  renderMessageInputActions: n,
2011
- onLeaveConversation: qe,
2012
- onBlockParticipant: Ze,
2013
- CustomChannelEmptyState: d,
2014
- showDeleteConversation: le,
2012
+ renderChannelBanner: v,
2013
+ onLeaveConversation: Ze,
2014
+ onBlockParticipant: Ye,
2015
+ CustomChannelEmptyState: u,
2016
+ showDeleteConversation: ze,
2015
2017
  onDeleteConversationClick: x,
2016
2018
  onBlockParticipantClick: g,
2017
2019
  onReportParticipantClick: l,
2018
- dmAgentEnabled: I,
2019
- messageMetadata: _,
2020
- onMessageSent: y,
2021
- showStarButton: E,
2022
- chatbotVotingEnabled: h
2020
+ dmAgentEnabled: y,
2021
+ messageMetadata: E,
2022
+ onMessageSent: w,
2023
+ showStarButton: p,
2024
+ chatbotVotingEnabled: f
2023
2025
  },
2024
- F.id
2026
+ G.id
2025
2027
  ) }) : c ? (
2026
2028
  // Show loading while creating/loading direct conversation channel
2027
2029
  /* @__PURE__ */ e(he, {})
2028
2030
  ) : /* @__PURE__ */ e(
2029
2031
  $e,
2030
2032
  {
2031
- hasChannels: te,
2032
- channelsLoaded: K
2033
+ hasChannels: X,
2034
+ channelsLoaded: Y
2033
2035
  }
2034
2036
  )
2035
2037
  }
2036
2038
  )
2037
2039
  ] }),
2038
- ae && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2040
+ re && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2039
2041
  /* @__PURE__ */ e(
2040
2042
  "dialog",
2041
2043
  {
2042
- ref: J,
2044
+ ref: se,
2043
2045
  className: "mes-dialog",
2044
- onClick: We,
2046
+ onClick: qe,
2045
2047
  onClose: ie,
2046
2048
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2047
- Nt,
2049
+ vt,
2048
2050
  {
2049
- participantSource: ae,
2050
- onSelectParticipant: Ve,
2051
+ participantSource: re,
2052
+ onSelectParticipant: We,
2051
2053
  onClose: ie,
2052
- existingParticipantIds: ee,
2053
- participantLabel: re,
2054
- searchPlaceholder: `Search ${re}...`
2054
+ existingParticipantIds: V,
2055
+ participantLabel: ae,
2056
+ searchPlaceholder: `Search ${ae}...`
2055
2057
  },
2056
2058
  P
2057
2059
  ) })
@@ -2060,7 +2062,7 @@ const Rt = ({
2060
2062
  ]
2061
2063
  }
2062
2064
  );
2063
- }, wt = ({
2065
+ }, pt = ({
2064
2066
  question: t,
2065
2067
  onClick: s,
2066
2068
  loading: n = !1,
@@ -2082,7 +2084,7 @@ const Rt = ({
2082
2084
  ),
2083
2085
  children: t
2084
2086
  }
2085
- ), Dt = ({
2087
+ ), Tt = ({
2086
2088
  faqs: t,
2087
2089
  onFaqClick: s,
2088
2090
  loadingFaqId: n,
@@ -2091,8 +2093,8 @@ const Rt = ({
2091
2093
  avatarImage: c,
2092
2094
  avatarName: r
2093
2095
  }) => {
2094
- const d = t.filter((b) => b.enabled).sort((b, m) => (b.order ?? 0) - (m.order ?? 0));
2095
- return d.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2096
+ const u = t.filter((b) => b.enabled).sort((b, h) => (b.order ?? 0) - (h.order ?? 0));
2097
+ return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2096
2098
  (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2097
2099
  Q,
2098
2100
  {
@@ -2110,8 +2112,8 @@ const Rt = ({
2110
2112
  style: { backgroundColor: "#F1F0EE" },
2111
2113
  children: [
2112
2114
  a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
2113
- d.map((b) => /* @__PURE__ */ e(
2114
- wt,
2115
+ u.map((b) => /* @__PURE__ */ e(
2116
+ pt,
2115
2117
  {
2116
2118
  question: b.question,
2117
2119
  onClick: () => s(b.id),
@@ -2123,61 +2125,61 @@ const Rt = ({
2123
2125
  }
2124
2126
  )
2125
2127
  ] }) });
2126
- }, Tt = (t, s = {}) => {
2127
- const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = k([]), [r, d] = k(!1), [b, m] = k(null), [M, x] = k(n), [g, l] = k(!0), [I, _] = k(), y = T(async (C = !1, v) => {
2128
+ }, Ft = (t, s = {}) => {
2129
+ const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = M([]), [r, u] = M(!1), [b, h] = M(null), [_, x] = M(n), [g, l] = M(!0), [y, E] = M(), w = F(async (v = !1, R) => {
2128
2130
  if (r) return;
2129
- const f = v !== void 0 ? v : M;
2130
- d(!0), m(null);
2131
+ const d = R !== void 0 ? R : _;
2132
+ u(!0), h(null);
2131
2133
  try {
2132
- const u = await t.loadParticipants({
2133
- search: f || void 0,
2134
+ const m = await t.loadParticipants({
2135
+ search: d || void 0,
2134
2136
  limit: a,
2135
- cursor: C ? void 0 : I
2137
+ cursor: v ? void 0 : y
2136
2138
  });
2137
2139
  c(
2138
- (N) => C ? u.participants : [...N, ...u.participants]
2139
- ), l(u.hasMore), _(u.nextCursor);
2140
- } catch (u) {
2141
- const N = u instanceof Error ? u.message : "Failed to load participants";
2142
- m(N), console.error("[useParticipants] Load error:", u);
2140
+ (C) => v ? m.participants : [...C, ...m.participants]
2141
+ ), l(m.hasMore), E(m.nextCursor);
2142
+ } catch (m) {
2143
+ const C = m instanceof Error ? m.message : "Failed to load participants";
2144
+ h(C), console.error("[useParticipants] Load error:", m);
2143
2145
  } finally {
2144
- d(!1);
2146
+ u(!1);
2145
2147
  }
2146
- }, [t, M, I, a, r]), E = T(() => {
2147
- g && !r && y(!1);
2148
- }, [g, r, y]), h = T((C) => {
2149
- x(C), _(void 0), y(!0, C);
2150
- }, [y]), p = T(() => {
2151
- _(void 0), y(!0);
2152
- }, [y]);
2153
- return W(() => {
2154
- y(!0);
2148
+ }, [t, _, y, a, r]), p = F(() => {
2149
+ g && !r && w(!1);
2150
+ }, [g, r, w]), f = F((v) => {
2151
+ x(v), E(void 0), w(!0, v);
2152
+ }, [w]), N = F(() => {
2153
+ E(void 0), w(!0);
2154
+ }, [w]);
2155
+ return q(() => {
2156
+ w(!0);
2155
2157
  }, [t.loadParticipants]), {
2156
2158
  participants: o,
2157
2159
  loading: r,
2158
2160
  error: b,
2159
- searchQuery: M,
2161
+ searchQuery: _,
2160
2162
  hasMore: g,
2161
2163
  totalCount: t.totalCount,
2162
- loadMore: E,
2163
- search: h,
2164
- refresh: p
2164
+ loadMore: p,
2165
+ search: f,
2166
+ refresh: N
2165
2167
  };
2166
2168
  };
2167
2169
  export {
2168
2170
  Q as Avatar,
2169
- ht as ChannelEmptyState,
2171
+ ft as ChannelEmptyState,
2170
2172
  Ue as ChannelList,
2171
2173
  Ae as ChannelView,
2172
- Dt as FaqList,
2173
- wt as FaqListItem,
2174
- nt as MessageVoteButtons,
2175
- kt as MessagingProvider,
2176
- Rt as MessagingShell,
2177
- Nt as ParticipantPicker,
2178
- Vs as formatRelativeTime,
2179
- et as useMessageVote,
2180
- Hs as useMessaging,
2181
- Tt as useParticipants
2174
+ Tt as FaqList,
2175
+ pt as FaqListItem,
2176
+ rt as MessageVoteButtons,
2177
+ Rt as MessagingProvider,
2178
+ Dt as MessagingShell,
2179
+ vt as ParticipantPicker,
2180
+ Ws as formatRelativeTime,
2181
+ st as useMessageVote,
2182
+ Gs as useMessaging,
2183
+ Ft as useParticipants
2182
2184
  };
2183
2185
  //# sourceMappingURL=index.js.map