@linktr.ee/messaging-react 1.20.0 โ†’ 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
- (m, ...v) => {
28
- c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...v);
26
+ const r = F(
27
+ (m, ...C) => {
28
+ c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...C);
29
29
  },
30
30
  [c]
31
31
  );
@@ -35,27 +35,27 @@ const Le = Je({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [d, b] = k(null), [u, S] = k(null), [f, x] = k(!1), [l, M] = k(!1), [I, E] = k(null), g = V(!1), C = 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
- }), N = V(0);
43
+ }), N = W(0);
44
44
  N.current++, r("๐Ÿ“Š RENDER INFO", {
45
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: C.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: C.current.apiKey !== a,
50
- serviceConfigChanged: C.current.serviceConfig !== n,
51
- capabilitiesChanged: C.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
- }), C.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(() => {
58
+ }, q(() => {
59
59
  const m = N.current;
60
60
  if (r("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: m,
@@ -64,8 +64,8 @@ const Le = Je({
64
64
  dependencies: {
65
65
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: C.current.serviceConfig === n,
68
- apiKeyStable: C.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", {
@@ -77,42 +77,42 @@ const Le = Je({
77
77
  r("๐Ÿš€ CREATING NEW SERVICE", {
78
78
  renderCount: m,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
80
- serviceConfigChanged: C.current.serviceConfig !== n
80
+ serviceConfigChanged: f.current.serviceConfig !== n
81
81
  });
82
- const v = new Xe({
82
+ const C = new Ke({
83
83
  ...n,
84
84
  apiKey: a,
85
85
  debug: c
86
86
  });
87
- return b(v), r("โœ… SERVICE SET", {
87
+ return b(C), r("โœ… SERVICE SET", {
88
88
  renderCount: m,
89
- serviceInstance: !!v
89
+ serviceInstance: !!C
90
90
  }), () => {
91
91
  r("๐Ÿงน SERVICE CLEANUP", {
92
92
  renderCount: m,
93
93
  reason: "Effect cleanup"
94
- }), v.disconnectUser().catch(console.error);
94
+ }), C.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [a, n, c, r]);
97
- const w = V(null);
98
- W(() => {
99
- var v, 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: g.current,
105
- isConnected: f,
106
- dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
107
- }), !d || !s) {
104
+ isConnecting: p.current,
105
+ isConnected: x,
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 (g.current) {
111
+ if (p.current) {
112
112
  r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((v = w.current) == null ? void 0 : v.serviceId) === d && ((R = w.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 }), g.current = !0, M(!0), E(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 y = await d.connectUser(s);
127
- S(y), x(!0), w.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: y.userID
129
+ clientId: T.userID
130
130
  });
131
- } catch (y) {
132
- const O = y instanceof Error ? y.message : "Connection failed";
133
- E(O), 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: O
135
+ error: S
136
136
  });
137
137
  } finally {
138
- M(!1), g.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ y(!1), p.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: f
140
+ isConnected: x
141
141
  });
142
142
  }
143
143
  })();
144
- }, [d, s, r, f]), W(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
- hasService: !!d,
146
- isConnected: f
144
+ }, [u, s, r, x]), q(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!u,
146
+ isConnected: x
147
147
  }), () => {
148
- d && f ? (r(
148
+ u && x ? (r(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), w.current = null, d.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
- hasService: !!d,
153
- isConnected: f
151
+ ), v.current = null, u.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!u,
153
+ isConnected: x
154
154
  });
155
- }), [d, f, r]);
156
- const p = 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 }), M(!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 m = await d.connectUser(s);
168
- S(m), x(!0), E(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
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
169
  } catch (m) {
170
- const v = m instanceof Error ? m.message : "Refresh failed";
171
- E(v), r("โŒ CONNECTION REFRESH ERROR", {
170
+ const C = m instanceof Error ? m.message : "Refresh failed";
171
+ w(C), r("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: v
173
+ error: C
174
174
  });
175
175
  } finally {
176
- M(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ y(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [d, s, r]), h = B.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!d,
180
- hasClient: !!u,
181
- isConnected: f,
178
+ }, [u, s, r]), d = j.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!u,
180
+ hasClient: !!h,
181
+ isConnected: x,
182
182
  isLoading: l,
183
- hasError: !!I,
183
+ hasError: !!E,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
- service: d,
187
- client: u,
188
- isConnected: f,
186
+ service: u,
187
+ client: h,
188
+ isConnected: x,
189
189
  isLoading: l,
190
- error: I,
190
+ error: E,
191
191
  capabilities: o,
192
- refreshConnection: p,
192
+ refreshConnection: R,
193
193
  debug: c
194
194
  }), [
195
- d,
196
195
  u,
197
- f,
196
+ h,
197
+ x,
198
198
  l,
199
- I,
199
+ E,
200
200
  o,
201
- p,
201
+ R,
202
202
  c,
203
203
  r
204
204
  ]);
205
205
  return r("๐Ÿ”„ RENDER END", {
206
206
  renderCount: N.current,
207
- willRenderChat: !!(u && f),
208
- contextValueReady: !!h
209
- }), /* @__PURE__ */ e(Le.Provider, { value: h, children: u && f ? /* @__PURE__ */ e(
210
- Ke,
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: u,
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 N, w, p, h, m, v;
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
- }, u = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
372
- (R) => {
373
- var y, O;
374
- return ((y = R.user) == null ? void 0 : y.id) && R.user.id !== ((O = t == null ? void 0 : t._client) == null ? void 0 : O.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
- ), S = ((w = u == null ? void 0 : u.user) == null ? void 0 : w.name) || "Conversation", f = (p = u == null ? void 0 : u.user) == null ? void 0 : p.image, x = (m = (h = t == null ? void 0 : t.state) == null ? void 0 : h.messages) == null ? void 0 : m[t.state.messages.length - 1], M = (() => {
377
- var y;
378
- if (x != null && x.text) return x.text;
379
- const R = (y = x == null ? void 0 : x.attachments) == null ? void 0 : y[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
- })(), I = x != null && x.created_at ? Vs(new Date(x.created_at)) : "", E = x ? ye(x) : !1, g = c ? c(x, M) : `${E ? "โœจ " : ""}${M}`, C = o ?? 0;
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
+ if (g != null && g.text) return g.text;
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: S,
386
- unreadCount: C,
387
- hasTimestamp: !!I
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,9 +401,9 @@ const Q = ({
401
401
  /* @__PURE__ */ e(
402
402
  Q,
403
403
  {
404
- id: ((v = u == null ? void 0 : u.user) == null ? void 0 : v.id) || t.id || "unknown",
405
- name: S,
406
- image: f,
404
+ id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
405
+ name: _,
406
+ image: x,
407
407
  size: 44,
408
408
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
409
409
  }
@@ -417,14 +417,14 @@ const Q = ({
417
417
  "text-sm font-medium truncate",
418
418
  r ? "text-primary" : "text-charcoal"
419
419
  ),
420
- children: S
420
+ children: _
421
421
  }
422
422
  ),
423
- I && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: I })
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: g }),
427
- C > 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: C > 99 ? "99+" : C })
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(() => (S) => /* @__PURE__ */ e(
453
+ const b = j.useMemo(() => (_) => /* @__PURE__ */ e(
454
454
  Oe,
455
455
  {
456
- ...S,
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,77 +612,77 @@ 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: u,
618
- highlighted: S,
619
- isMessageAIGenerated: f,
620
- isMyMessage: x,
617
+ handleRetry: h,
618
+ highlighted: _,
619
+ isMessageAIGenerated: x,
620
+ isMyMessage: g,
621
621
  message: l,
622
- renderText: M,
623
- threadList: I
624
- } = t, { client: E } = Fe("CustomMessage"), [g, C] = k(!1), N = ns(l.id), { selected: w, voteUp: p, voteDown: h } = et(l), {
625
- Attachment: m = as,
626
- EditMessageModal: v = ls,
627
- MessageBlocked: R = os,
628
- MessageBouncePrompt: y = is,
629
- MessageDeleted: O = 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(
636
- () => f == null ? void 0 : f(l),
637
- [f, l]
638
- ), G = 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
+ () => x == null ? void 0 : x(l),
637
+ [x, l]
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(O, { message: l });
646
- if (bs(l))
647
- return /* @__PURE__ */ e(R, {});
648
- const L = !I && !!l.reply_count, U = !I && l.show_in_channel && l.parent_id, F = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, j = Cs(l);
649
- let z;
650
- F ? z = () => u(l) : j && (z = () => C(!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
- x() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
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": S,
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": L || 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 && E.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
- v,
671
+ C,
672
672
  {
673
673
  additionalMessageInputProps: s
674
674
  }
675
675
  ),
676
- g && /* @__PURE__ */ e(
677
- Ns,
676
+ p && /* @__PURE__ */ e(
677
+ vs,
678
678
  {
679
- MessageBouncePrompt: y,
680
- onClose: () => C(!1),
681
- open: g
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, {}),
684
+ /* @__PURE__ */ i("div", { className: le, children: [
685
+ Y && /* @__PURE__ */ e(Y, {}),
686
686
  !!N && /* @__PURE__ */ e(X, { reminder: N }),
687
687
  l.user && /* @__PURE__ */ e(
688
688
  Q,
@@ -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": F || 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(
718
+ Z && /* @__PURE__ */ e(ws, { poll: Z }),
719
+ V != null && V.length && !l.quoted_message ? /* @__PURE__ */ e(
720
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: M
730
+ renderText: y
731
731
  }
732
- ) : /* @__PURE__ */ e(ws, { message: l, renderText: M }),
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: w,
740
- onVoteUp: p,
741
- onVoteDown: h
739
+ selected: v,
740
+ onVoteUp: R,
741
+ onVoteDown: d
742
742
  }
743
743
  )
744
744
  ] })
745
745
  }
746
746
  ),
747
747
  L && /* @__PURE__ */ e(
748
- te,
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 x, l, M, I, E, g;
925
- const { channel: c } = we(), r = B.useMemo(() => Object.values(c.state.members || {}).find(
924
+ var g, l, y, E, w, p;
925
+ const { channel: c } = we(), r = j.useMemo(() => Object.values(c.state.members || {}).find(
926
926
  (N) => {
927
- var w;
928
- return ((w = N.user) == null ? void 0 : w.id) && N.user.id !== c._client.userID;
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 = ((x = r == null ? void 0 : r.user) == null ? void 0 : x.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (M = r == null ? void 0 : r.user) == null ? void 0 : M.image, [u, S] = k(
931
- !!((I = c.state.membership) != null && I.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 C = (N) => {
935
- var w;
936
- S(
937
- N != null && N.member ? !!N.member.pinned_at : !!((w = c.state.membership) != null && w.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", C), () => {
941
- c.off("member.updated", C);
940
+ return c.on("member.updated", f), () => {
941
+ c.off("member.updated", f);
942
942
  };
943
943
  }, [c]);
944
- const f = async () => {
944
+ const x = async () => {
945
945
  try {
946
- u ? await c.unpin() : await c.pin();
947
- } catch (C) {
946
+ h ? await c.unpin() : await c.pin();
947
+ } catch (f) {
948
948
  console.error(
949
949
  "[CustomChannelHeader] Failed to update pinned status:",
950
- C
950
+ f
951
951
  );
952
952
  }
953
953
  };
@@ -970,30 +970,30 @@ const gt = ({
970
970
  /* @__PURE__ */ e(
971
971
  Q,
972
972
  {
973
- id: ((E = r == null ? void 0 : r.user) == null ? void 0 : E.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(
983
983
  "button",
984
984
  {
985
985
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
986
- onClick: f,
986
+ onClick: x,
987
987
  type: "button",
988
- "aria-label": u ? "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": u,
994
- "text-black/90": !u
993
+ "text-yellow-600": h,
994
+ "text-black/90": !h
995
995
  }),
996
- weight: u ? "duotone" : "regular"
996
+ weight: h ? "duotone" : "regular"
997
997
  }
998
998
  )
999
999
  }
@@ -1025,30 +1025,30 @@ const gt = ({
1025
1025
  /* @__PURE__ */ e(
1026
1026
  Q,
1027
1027
  {
1028
- id: ((g = r == null ? void 0 : r.user) == null ? void 0 : g.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(
1038
1038
  "button",
1039
1039
  {
1040
1040
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1041
- onClick: f,
1041
+ onClick: x,
1042
1042
  type: "button",
1043
- "aria-label": u ? "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": u,
1049
- "text-black/90": !u
1048
+ "text-yellow-600": h,
1049
+ "text-black/90": !h
1050
1050
  }),
1051
- weight: u ? "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: u,
1080
- onReportParticipantClick: S
1079
+ onBlockParticipantClick: h,
1080
+ onReportParticipantClick: _
1081
1081
  }) => {
1082
- var X, K, q, ne, Z, ee, G;
1083
- const { service: f, debug: x } = fe(), [l, M] = k(!1), [I, E] = k(!1), [g, C] = k(!1), N = T(async () => {
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
1084
  var L;
1085
- if (!(!f || !((L = n == null ? void 0 : n.user) != null && L.id)))
1085
+ if (!(!x || !((L = n == null ? void 0 : n.user) != null && L.id)))
1086
1086
  try {
1087
- const F = (await f.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
- M(F);
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
- }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1101
- W(() => {
1100
+ }, [x, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1101
+ q(() => {
1102
1102
  N();
1103
1103
  }, [N]);
1104
- const w = async () => {
1104
+ const v = async () => {
1105
1105
  var L;
1106
- if (!I) {
1107
- b == null || b(), x && console.log("[ChannelInfoDialog] Leave conversation", a.cid), E(!0);
1106
+ if (!E) {
1107
+ b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
1108
1108
  try {
1109
- const U = ((L = a._client) == null ? void 0 : L.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
- E(!1);
1114
+ w(!1);
1115
1115
  }
1116
1116
  }
1117
- }, p = async () => {
1118
- var L, U, F;
1119
- if (!(g || !f)) {
1120
- u == null || u(), x && console.log("[ChannelInfoDialog] Block member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), C(!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 f.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((F = n == null ? void 0 : n.user) == null ? void 0 : F.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
- C(!1);
1126
+ f(!1);
1127
1127
  }
1128
1128
  }
1129
- }, h = async () => {
1130
- var L, U, F;
1131
- if (!(g || !f)) {
1132
- u == null || u(), x && console.log("[ChannelInfoDialog] Unblock member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), C(!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 f.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((F = n == null ? void 0 : n.user) == null ? void 0 : F.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
- C(!1);
1138
+ f(!1);
1139
1139
  }
1140
1140
  }
1141
1141
  }, m = () => {
1142
- S == null || S(), s(), window.open(
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 v = ((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, y = (Z = n.user) == null ? void 0 : Z.email, O = (ee = n.user) == null ? void 0 : ee.username, $ = y || (O ? `linktr.ee/${O}` : 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(
@@ -1173,16 +1173,16 @@ const gt = ({
1173
1173
  /* @__PURE__ */ e(
1174
1174
  Q,
1175
1175
  {
1176
- id: te,
1177
- name: v,
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: v }),
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: w,
1209
- disabled: I,
1210
- "aria-busy": I,
1208
+ onClick: v,
1209
+ disabled: E,
1210
+ "aria-busy": E,
1211
1211
  children: [
1212
- I ? /* @__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: h,
1221
- disabled: g,
1222
- "aria-busy": g,
1220
+ onClick: d,
1221
+ disabled: p,
1222
+ "aria-busy": p,
1223
1223
  children: [
1224
- g ? /* @__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: p,
1232
- disabled: g,
1233
- "aria-busy": g,
1231
+ onClick: R,
1232
+ disabled: p,
1233
+ "aria-busy": p,
1234
1234
  children: [
1235
- g ? /* @__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
1240
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
1241
- /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
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,49 +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: u = !1,
1261
- chatbotVotingEnabled: S = !1
1260
+ showStarButton: h = !1,
1261
+ chatbotVotingEnabled: _ = !1,
1262
+ renderChannelBanner: x
1262
1263
  }) => {
1263
- const { channel: f } = we(), x = V(null), l = B.useMemo(() => Object.values(f.state.members || {}).find(
1264
- (C) => {
1265
- var N;
1266
- return ((N = C.user) == null ? void 0 : N.id) && C.user.id !== f._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;
1267
1268
  }
1268
- ), [f._client.userID, f.state.members]), M = B.useMemo(() => {
1269
- const g = f.data ?? {};
1270
- if (g.followerStatus)
1271
- return String(g.followerStatus);
1272
- if (g.isFollower !== void 0)
1273
- return g.isFollower ? "Subscribed to you" : "Not subscribed";
1274
- }, [f.data]), I = T(() => {
1275
- var g;
1276
- (g = x.current) == null || g.showModal();
1277
- }, []), E = T(() => {
1278
- var g;
1279
- (g = x.current) == null || g.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();
1280
1281
  }, []);
1281
1282
  return /* @__PURE__ */ i(ve, { children: [
1282
1283
  /* @__PURE__ */ e(
1283
- Ps,
1284
+ Os,
1284
1285
  {
1285
1286
  overrides: {
1286
- Message: (g) => /* @__PURE__ */ e(lt, { ...g, chatbotVotingEnabled: S })
1287
+ Message: (f) => /* @__PURE__ */ e(ot, { ...f, chatbotVotingEnabled: _ })
1287
1288
  },
1288
- children: /* @__PURE__ */ i(Os, { children: [
1289
+ children: /* @__PURE__ */ i(Us, { children: [
1289
1290
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1290
- gt,
1291
+ xt,
1291
1292
  {
1292
1293
  onBack: t,
1293
1294
  showBackButton: s,
1294
- onShowInfo: I,
1295
- canShowInfo: !!l,
1296
- showStarButton: u
1295
+ onShowInfo: w,
1296
+ canShowInfo: !!y,
1297
+ showStarButton: h
1297
1298
  }
1298
1299
  ) }),
1300
+ x == null ? void 0 : x(),
1299
1301
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1300
- Us,
1302
+ Bs,
1301
1303
  {
1302
1304
  hideDeletedMessages: !0,
1303
1305
  hideNewMessageSeparator: !1,
@@ -1305,32 +1307,32 @@ const gt = ({
1305
1307
  }
1306
1308
  ) }),
1307
1309
  /* @__PURE__ */ e(
1308
- ut,
1310
+ mt,
1309
1311
  {
1310
- renderActions: () => n == null ? void 0 : n(f)
1312
+ renderActions: () => n == null ? void 0 : n(g)
1311
1313
  }
1312
1314
  )
1313
1315
  ] })
1314
1316
  }
1315
1317
  ),
1316
1318
  /* @__PURE__ */ e(
1317
- xt,
1319
+ bt,
1318
1320
  {
1319
- dialogRef: x,
1320
- onClose: E,
1321
- participant: l,
1322
- channel: f,
1323
- followerStatusLabel: M,
1321
+ dialogRef: l,
1322
+ onClose: p,
1323
+ participant: y,
1324
+ channel: g,
1325
+ followerStatusLabel: E,
1324
1326
  onLeaveConversation: a,
1325
1327
  onBlockParticipant: o,
1326
1328
  showDeleteConversation: c,
1327
1329
  onDeleteConversationClick: r,
1328
- onBlockParticipantClick: d,
1330
+ onBlockParticipantClick: u,
1329
1331
  onReportParticipantClick: b
1330
1332
  }
1331
1333
  )
1332
1334
  ] });
1333
- }, Ae = B.memo(
1335
+ }, Ae = j.memo(
1334
1336
  ({
1335
1337
  channel: t,
1336
1338
  onBack: s,
@@ -1339,36 +1341,37 @@ const gt = ({
1339
1341
  onLeaveConversation: o,
1340
1342
  onBlockParticipant: c,
1341
1343
  className: r,
1342
- CustomChannelEmptyState: d = ht,
1344
+ CustomChannelEmptyState: u = ft,
1343
1345
  showDeleteConversation: b = !0,
1344
- onDeleteConversationClick: u,
1345
- onBlockParticipantClick: S,
1346
- onReportParticipantClick: f,
1347
- dmAgentEnabled: x,
1346
+ onDeleteConversationClick: h,
1347
+ onBlockParticipantClick: _,
1348
+ onReportParticipantClick: x,
1349
+ dmAgentEnabled: g,
1348
1350
  messageMetadata: l,
1349
- onMessageSent: M,
1350
- showStarButton: I = !1,
1351
- chatbotVotingEnabled: E = !1
1351
+ onMessageSent: y,
1352
+ showStarButton: E = !1,
1353
+ chatbotVotingEnabled: w = !1,
1354
+ renderChannelBanner: p
1352
1355
  }) => {
1353
- const g = T(
1354
- async (C, N, w) => {
1355
- var y;
1356
- const p = ((y = t.data) == null ? void 0 : y.chatbot_paused) === !0, h = x && !p, m = {
1357
- ...N,
1358
- ...h && { 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 },
1359
1362
  ...l && {
1360
1363
  metadata: {
1361
- ...N.metadata ?? {},
1364
+ ...v.metadata ?? {},
1362
1365
  ...l
1363
1366
  }
1364
1367
  }
1365
- }, v = {
1366
- ...w,
1367
- ...h && { skip_push: !0 }
1368
- }, R = await t.sendMessage(m, v);
1369
- return M == null || M(R), R;
1368
+ }, k = {
1369
+ ...R,
1370
+ ...m && { skip_push: !0 }
1371
+ }, T = await t.sendMessage(C, k);
1372
+ return y == null || y(T), T;
1370
1373
  },
1371
- [t, x, l, M]
1374
+ [t, g, l, y]
1372
1375
  );
1373
1376
  return /* @__PURE__ */ e(
1374
1377
  "div",
@@ -1378,29 +1381,30 @@ const gt = ({
1378
1381
  r
1379
1382
  ),
1380
1383
  children: /* @__PURE__ */ e(
1381
- Ls,
1384
+ Ps,
1382
1385
  {
1383
1386
  channel: t,
1384
- MessageSystem: mt,
1385
- EmptyStateIndicator: d,
1387
+ MessageSystem: ht,
1388
+ EmptyStateIndicator: u,
1386
1389
  LoadingIndicator: he,
1387
- DateSeparator: Xs,
1388
- doSendMessageRequest: g,
1390
+ DateSeparator: Ks,
1391
+ doSendMessageRequest: f,
1389
1392
  children: /* @__PURE__ */ e(
1390
- bt,
1393
+ Ct,
1391
1394
  {
1392
1395
  onBack: s,
1393
1396
  showBackButton: n,
1394
1397
  renderMessageInputActions: a,
1395
1398
  onLeaveConversation: o,
1396
1399
  onBlockParticipant: c,
1397
- CustomChannelEmptyState: d,
1400
+ CustomChannelEmptyState: u,
1398
1401
  showDeleteConversation: b,
1399
- onDeleteConversationClick: u,
1400
- onBlockParticipantClick: S,
1401
- onReportParticipantClick: f,
1402
- showStarButton: I,
1403
- chatbotVotingEnabled: E
1402
+ onDeleteConversationClick: h,
1403
+ onBlockParticipantClick: _,
1404
+ onReportParticipantClick: x,
1405
+ showStarButton: E,
1406
+ chatbotVotingEnabled: w,
1407
+ renderChannelBanner: p
1404
1408
  }
1405
1409
  )
1406
1410
  }
@@ -1410,15 +1414,15 @@ const gt = ({
1410
1414
  }
1411
1415
  );
1412
1416
  Ae.displayName = "ChannelView";
1413
- function Ct({
1417
+ function Nt({
1414
1418
  searchQuery: t,
1415
1419
  setSearchQuery: s,
1416
1420
  placeholder: n
1417
1421
  }) {
1418
- const a = V(null);
1422
+ const a = W(null);
1419
1423
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1420
1424
  /* @__PURE__ */ e(
1421
- zs,
1425
+ Hs,
1422
1426
  {
1423
1427
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1424
1428
  weight: "bold"
@@ -1449,7 +1453,7 @@ function Ct({
1449
1453
  )
1450
1454
  ] });
1451
1455
  }
1452
- const Nt = ({
1456
+ const vt = ({
1453
1457
  participantSource: t,
1454
1458
  onSelectParticipant: s,
1455
1459
  onClose: n,
@@ -1458,56 +1462,56 @@ const Nt = ({
1458
1462
  searchPlaceholder: c = "Search participants...",
1459
1463
  className: r
1460
1464
  }) => {
1461
- const { debug: d } = fe(), [b, u] = k(""), [S, f] = k([]), [x, l] = k(!1), [M, I] = k(null), [E, g] = k(
1465
+ const { debug: u } = fe(), [b, h] = M(""), [_, x] = M([]), [g, l] = M(!1), [y, E] = M(null), [w, p] = M(
1462
1466
  null
1463
- ), C = V(!1);
1464
- W(() => {
1467
+ ), f = W(!1);
1468
+ q(() => {
1465
1469
  if (t.loading) {
1466
- d && console.log(
1470
+ u && console.log(
1467
1471
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1468
1472
  );
1469
1473
  return;
1470
1474
  }
1471
- if (C.current) return;
1475
+ if (f.current) return;
1472
1476
  (async () => {
1473
- d && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), I(null);
1477
+ u && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), E(null);
1474
1478
  try {
1475
1479
  const m = await t.loadParticipants({
1476
1480
  search: "",
1477
1481
  // Load all participants initially
1478
1482
  limit: 100
1479
1483
  });
1480
- f(m.participants), C.current = !0, d && console.log(
1484
+ x(m.participants), f.current = !0, u && console.log(
1481
1485
  "[ParticipantPicker] Participants loaded successfully:",
1482
1486
  m.participants.length
1483
1487
  );
1484
1488
  } catch (m) {
1485
- const v = m instanceof Error ? m.message : "Failed to load participants";
1486
- I(v), console.error("[ParticipantPicker] Failed to load participants:", m);
1489
+ const C = m instanceof Error ? m.message : "Failed to load participants";
1490
+ E(C), console.error("[ParticipantPicker] Failed to load participants:", m);
1487
1491
  } finally {
1488
1492
  l(!1);
1489
1493
  }
1490
1494
  })();
1491
- }, [t.loading, d]);
1492
- const N = S.filter((h) => !a.has(h.id)).filter((h) => {
1493
- var v;
1495
+ }, [t.loading, u]);
1496
+ const N = _.filter((d) => !a.has(d.id)).filter((d) => {
1497
+ var C;
1494
1498
  if (!b) return !0;
1495
1499
  const m = b.toLowerCase();
1496
- return h.name.toLowerCase().includes(m) || ((v = h.email) == null ? void 0 : v.toLowerCase().includes(m)) || !1;
1497
- }), w = T(
1498
- async (h) => {
1499
- if (!E) {
1500
- g(h.id);
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);
1501
1505
  try {
1502
- await s(h);
1506
+ await s(d);
1503
1507
  } catch (m) {
1504
- console.error("[ParticipantPicker] Failed to start chat:", m), g(null);
1508
+ console.error("[ParticipantPicker] Failed to start chat:", m), p(null);
1505
1509
  }
1506
1510
  }
1507
1511
  },
1508
- [s, E]
1509
- ), p = (h, m) => {
1510
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(m));
1512
+ [s, w]
1513
+ ), R = (d, m) => {
1514
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), v(m));
1511
1515
  };
1512
1516
  return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1513
1517
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
@@ -1524,21 +1528,21 @@ const Nt = ({
1524
1528
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${o} total`
1525
1529
  ] }),
1526
1530
  /* @__PURE__ */ e(
1527
- Ct,
1531
+ Nt,
1528
1532
  {
1529
1533
  searchQuery: b,
1530
- setSearchQuery: u,
1534
+ setSearchQuery: h,
1531
1535
  placeholder: c
1532
1536
  }
1533
1537
  )
1534
1538
  ] }),
1535
- M && /* @__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: [
1536
1540
  "Error loading ",
1537
1541
  o,
1538
1542
  ": ",
1539
- M
1543
+ y
1540
1544
  ] }),
1541
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: x && 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: [
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: [
1542
1546
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1543
1547
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1544
1548
  "Loading ",
@@ -1547,46 +1551,46 @@ const Nt = ({
1547
1551
  ] })
1548
1552
  ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1549
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" }) }),
1550
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : S.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1551
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : S.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` })
1552
1556
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1553
- N.map((h) => {
1554
- const m = h.name || h.email || h.id, v = h.email && h.name ? h.email : h.phone;
1557
+ N.map((d) => {
1558
+ const m = d.name || d.email || d.id, C = d.email && d.name ? d.email : d.phone;
1555
1559
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1556
1560
  "button",
1557
1561
  {
1558
1562
  type: "button",
1559
- onClick: () => w(h),
1560
- onKeyDown: (R) => p(R, h),
1563
+ onClick: () => v(d),
1564
+ onKeyDown: (k) => R(k, d),
1561
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",
1562
1566
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1563
1567
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1564
1568
  /* @__PURE__ */ e(
1565
1569
  Q,
1566
1570
  {
1567
- id: h.id,
1571
+ id: d.id,
1568
1572
  name: m,
1569
- image: h.image,
1573
+ image: d.image,
1570
1574
  size: 40
1571
1575
  }
1572
1576
  ),
1573
1577
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1574
1578
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1575
- v && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: v })
1579
+ C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1576
1580
  ] })
1577
1581
  ] }),
1578
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: E === h.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" }) })
1579
1583
  ] })
1580
1584
  }
1581
- ) }, h.id);
1585
+ ) }, d.id);
1582
1586
  }),
1583
- x && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1587
+ g && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1584
1588
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1585
1589
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1586
1590
  ] }) })
1587
1591
  ] }) })
1588
1592
  ] });
1589
- }, vt = ({ className: t }) => /* @__PURE__ */ i(
1593
+ }, wt = ({ className: t }) => /* @__PURE__ */ i(
1590
1594
  "svg",
1591
1595
  {
1592
1596
  width: "140",
@@ -1720,9 +1724,9 @@ const Nt = ({
1720
1724
  ] })
1721
1725
  ]
1722
1726
  }
1723
- ), $e = B.memo(
1727
+ ), $e = j.memo(
1724
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: [
1725
- /* @__PURE__ */ e(vt, {}),
1729
+ /* @__PURE__ */ e(wt, {}),
1726
1730
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1727
1731
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1728
1732
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
@@ -1730,7 +1734,7 @@ const Nt = ({
1730
1734
  ] }) })
1731
1735
  );
1732
1736
  $e.displayName = "EmptyState";
1733
- 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: [
1734
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: "โš ๏ธ" }) }),
1735
1739
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1736
1740
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1745,7 +1749,7 @@ const me = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1745
1749
  )
1746
1750
  ] }) }));
1747
1751
  me.displayName = "ErrorState";
1748
- const Rt = ({
1752
+ const Dt = ({
1749
1753
  capabilities: t = {},
1750
1754
  className: s,
1751
1755
  renderMessageInputActions: n,
@@ -1753,114 +1757,115 @@ const Rt = ({
1753
1757
  onParticipantSelect: o,
1754
1758
  initialParticipantFilter: c,
1755
1759
  initialParticipantData: r,
1756
- CustomChannelEmptyState: d,
1760
+ CustomChannelEmptyState: u,
1757
1761
  showChannelList: b = !0,
1758
- filters: u,
1759
- channelListCustomEmptyStateIndicator: S,
1760
- onDeleteConversationClick: f,
1761
- onBlockParticipantClick: x,
1762
+ filters: h,
1763
+ channelListCustomEmptyStateIndicator: _,
1764
+ onDeleteConversationClick: x,
1765
+ onBlockParticipantClick: g,
1762
1766
  onReportParticipantClick: l,
1763
- dmAgentEnabled: M,
1764
- messageMetadata: I,
1765
- onMessageSent: E,
1766
- showStarButton: g = !1,
1767
- chatbotVotingEnabled: C = !1,
1768
- renderMessagePreview: N
1767
+ dmAgentEnabled: y,
1768
+ messageMetadata: E,
1769
+ onMessageSent: w,
1770
+ showStarButton: p = !1,
1771
+ chatbotVotingEnabled: f = !1,
1772
+ renderMessagePreview: N,
1773
+ renderChannelBanner: v
1769
1774
  }) => {
1770
1775
  const {
1771
- service: w,
1772
- client: p,
1773
- isConnected: h,
1774
- isLoading: m,
1775
- error: v,
1776
- refreshConnection: R,
1777
- debug: y
1778
- } = Hs(), [O, $] = k(null), [te, X] = k(!1), [K, q] = k(!1), [ne, Z] = k(!1), [ee, G] = k(/* @__PURE__ */ new Set()), [L, U] = k(0), [F, j] = k(!1), [z, Y] = k(null), J = V(null), {
1779
- participantSource: ae,
1780
- participantLabel: re = "participants",
1781
- showDeleteConversation: le = !0
1782
- } = t, ze = B.useMemo(() => {
1783
- const _ = p == null ? void 0 : p.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;
1784
1789
  return {
1785
1790
  ...{
1786
1791
  type: "messaging",
1787
1792
  last_message_at: { $exists: !0 },
1788
- ..._ && {
1789
- members: { $in: [_] },
1793
+ ...I && {
1794
+ members: { $in: [I] },
1790
1795
  hidden: !1
1791
1796
  }
1792
1797
  },
1793
- ...u
1798
+ ...h
1794
1799
  };
1795
- }, [u, p == null ? void 0 : p.userID]), oe = V(null), se = T(async () => {
1796
- if (!p || !h) return;
1797
- const _ = p.userID;
1798
- if (_)
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)
1799
1804
  try {
1800
- y && console.log("[MessagingShell] Syncing channels for user:", _);
1801
- const H = await p.queryChannels(
1805
+ S && console.log("[MessagingShell] Syncing channels for user:", I);
1806
+ const $ = await d.queryChannels(
1802
1807
  {
1803
1808
  type: "messaging",
1804
- members: { $in: [_] }
1809
+ members: { $in: [I] }
1805
1810
  },
1806
1811
  {},
1807
1812
  { limit: 100 }
1808
- ), P = /* @__PURE__ */ new Set();
1809
- H.forEach((A) => {
1813
+ ), U = /* @__PURE__ */ new Set();
1814
+ $.forEach((A) => {
1810
1815
  const ge = A.state.members;
1811
- Object.values(ge).forEach((Ye) => {
1816
+ Object.values(ge).forEach((Je) => {
1812
1817
  var Ee;
1813
- const xe = (Ee = Ye.user) == null ? void 0 : Ee.id;
1814
- xe && xe !== _ && P.add(xe);
1818
+ const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
1819
+ xe && xe !== I && U.add(xe);
1815
1820
  });
1816
- }), G((A) => A.size === P.size && [...A].every((ge) => P.has(ge)) ? A : P), X(H.length > 0), q(!0), oe.current = _, y && console.log("[MessagingShell] Channels synced successfully:", {
1817
- channelCount: H.length,
1818
- memberCount: P.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
1819
1824
  });
1820
- } catch (H) {
1821
- console.error("[MessagingShell] Failed to sync channels:", H);
1825
+ } catch ($) {
1826
+ console.error("[MessagingShell] Failed to sync channels:", $);
1822
1827
  }
1823
- }, [p, h, y]);
1824
- W(() => {
1825
- if (!p || !h) return;
1826
- const _ = p.userID;
1827
- _ && oe.current !== _ && se();
1828
- }, [p, h, se]), W(() => {
1829
- if (!c || !p || !h) 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;
1830
1835
  (async () => {
1831
- const H = p.userID;
1832
- if (H)
1836
+ const $ = d.userID;
1837
+ if ($)
1833
1838
  try {
1834
- y && console.log(
1839
+ S && console.log(
1835
1840
  "[MessagingShell] Loading initial conversation with:",
1836
1841
  c
1837
1842
  );
1838
- const P = await p.queryChannels(
1843
+ const U = await d.queryChannels(
1839
1844
  {
1840
1845
  type: "messaging",
1841
- members: { $eq: [H, c] }
1846
+ members: { $eq: [$, c] }
1842
1847
  },
1843
1848
  {},
1844
1849
  { limit: 1 }
1845
1850
  );
1846
- if (P.length > 0)
1847
- $(P[0]), j(!0), Y(null), a && a(P[0]), y && console.log(
1851
+ if (U.length > 0)
1852
+ z(U[0]), B(!0), Z(null), a && a(U[0]), S && console.log(
1848
1853
  "[MessagingShell] Initial conversation loaded:",
1849
- P[0].id
1854
+ U[0].id
1850
1855
  );
1851
- else if (r && w) {
1852
- y && console.log(
1856
+ else if (r && R) {
1857
+ S && console.log(
1853
1858
  "[MessagingShell] No conversation found, creating one for:",
1854
1859
  r
1855
1860
  );
1856
1861
  try {
1857
- const A = await w.startChannelWithParticipant({
1862
+ const A = await R.startChannelWithParticipant({
1858
1863
  id: r.id,
1859
1864
  name: r.name,
1860
1865
  email: r.email,
1861
1866
  phone: r.phone
1862
1867
  });
1863
- $(A), j(!0), Y(null), a && a(A), y && console.log(
1868
+ z(A), B(!0), Z(null), a && a(A), S && console.log(
1864
1869
  "[MessagingShell] Channel created and loaded:",
1865
1870
  A.id
1866
1871
  );
@@ -1868,90 +1873,90 @@ const Rt = ({
1868
1873
  console.error(
1869
1874
  "[MessagingShell] Failed to create conversation:",
1870
1875
  A
1871
- ), Y("Failed to create conversation");
1876
+ ), Z("Failed to create conversation");
1872
1877
  }
1873
1878
  } else
1874
- Y(
1879
+ Z(
1875
1880
  "No conversation found with this account"
1876
- ), y && console.log(
1881
+ ), S && console.log(
1877
1882
  "[MessagingShell] No conversation found for:",
1878
1883
  c
1879
1884
  );
1880
- } catch (P) {
1885
+ } catch (U) {
1881
1886
  console.error(
1882
1887
  "[MessagingShell] Failed to load initial conversation:",
1883
- P
1884
- ), Y("Failed to load conversation");
1888
+ U
1889
+ ), Z("Failed to load conversation");
1885
1890
  }
1886
1891
  })();
1887
1892
  }, [
1888
1893
  c,
1889
1894
  r,
1890
- p,
1891
- h,
1892
- w,
1893
- y,
1895
+ d,
1896
+ m,
1897
+ R,
1898
+ S,
1894
1899
  a
1895
1900
  ]);
1896
- const He = T(
1897
- (_) => {
1898
- $(_), a == null || a(_);
1901
+ const Ge = F(
1902
+ (I) => {
1903
+ z(I), a == null || a(I);
1899
1904
  },
1900
1905
  [a]
1901
- ), Ge = T(() => {
1902
- F || $(null);
1903
- }, [F]), Ve = T(
1904
- async (_) => {
1905
- var H;
1906
- if (w)
1906
+ ), Ve = F(() => {
1907
+ O || z(null);
1908
+ }, [O]), We = F(
1909
+ async (I) => {
1910
+ var $;
1911
+ if (R)
1907
1912
  try {
1908
- y && console.log(
1913
+ S && console.log(
1909
1914
  "[MessagingShell] Starting conversation with:",
1910
- _.id
1915
+ I.id
1911
1916
  );
1912
- const P = await w.startChannelWithParticipant({
1913
- id: _.id,
1914
- name: _.name,
1915
- email: _.email,
1916
- phone: _.phone
1917
+ const U = await R.startChannelWithParticipant({
1918
+ id: I.id,
1919
+ name: I.name,
1920
+ email: I.email,
1921
+ phone: I.phone
1917
1922
  });
1918
1923
  try {
1919
- await P.show();
1924
+ await U.show();
1920
1925
  } catch (A) {
1921
1926
  console.warn("[MessagingShell] Failed to unhide channel:", A);
1922
1927
  }
1923
- $(P), Z(!1), (H = J.current) == null || H.close(), o == null || o(_);
1924
- } catch (P) {
1925
- console.error("[MessagingShell] Failed to start conversation:", P);
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);
1926
1931
  }
1927
1932
  },
1928
- [w, o, y]
1929
- ), ie = T(() => {
1930
- var _;
1931
- Z(!1), (_ = J.current) == null || _.close();
1932
- }, []), We = T(
1933
- (_) => {
1934
- _.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();
1935
1940
  },
1936
1941
  [ie]
1937
- ), qe = T(
1938
- async (_) => {
1939
- y && console.log("[MessagingShell] Leaving conversation:", _.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();
1940
1945
  },
1941
- [se, y]
1942
- ), Ze = T(
1943
- async (_) => {
1944
- y && console.log("[MessagingShell] Blocking participant:", _), $(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();
1945
1950
  },
1946
- [se, y]
1947
- ), ce = !!O;
1948
- return m ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : v ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: v, onBack: R }) }) : !h || !p ? /* @__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(
1949
1954
  me,
1950
1955
  {
1951
1956
  message: "Not connected to messaging service",
1952
- onBack: R
1957
+ onBack: T
1953
1958
  }
1954
- ) }) : 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(
1955
1960
  "div",
1956
1961
  {
1957
1962
  className: D(
@@ -1966,20 +1971,20 @@ const Rt = ({
1966
1971
  className: D(
1967
1972
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1968
1973
  {
1969
- "!hidden": b === !1 || F,
1974
+ "!hidden": b === !1 || O,
1970
1975
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1971
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !F && ce,
1976
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !O && ce,
1972
1977
  // Show on mobile when no channel selected, use same wide width on desktop
1973
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !F && !ce
1978
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !O && !ce
1974
1979
  }
1975
1980
  ),
1976
1981
  children: /* @__PURE__ */ e(
1977
1982
  Ue,
1978
1983
  {
1979
- onChannelSelect: He,
1980
- selectedChannel: O || void 0,
1981
- filters: ze,
1982
- customEmptyStateIndicator: S,
1984
+ onChannelSelect: Ge,
1985
+ selectedChannel: G || void 0,
1986
+ filters: He,
1987
+ customEmptyStateIndicator: _,
1983
1988
  renderMessagePreview: N
1984
1989
  }
1985
1990
  )
@@ -1992,71 +1997,72 @@ const Rt = ({
1992
1997
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1993
1998
  {
1994
1999
  // In direct conversation mode (or waiting for it), always show (full width)
1995
- flex: F || ce || c,
2000
+ flex: O || ce || c,
1996
2001
  // Normal mode: hide on mobile when no channel selected
1997
- "hidden lg:flex": !F && !ce && !c
2002
+ "hidden lg:flex": !O && !ce && !c
1998
2003
  }
1999
2004
  ),
2000
- children: O ? /* @__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(
2001
2006
  Ae,
2002
2007
  {
2003
- channel: O,
2004
- onBack: Ge,
2005
- showBackButton: !F,
2008
+ channel: G,
2009
+ onBack: Ve,
2010
+ showBackButton: !O,
2006
2011
  renderMessageInputActions: n,
2007
- onLeaveConversation: qe,
2008
- onBlockParticipant: Ze,
2009
- CustomChannelEmptyState: d,
2010
- showDeleteConversation: le,
2011
- onDeleteConversationClick: f,
2012
- onBlockParticipantClick: x,
2012
+ renderChannelBanner: v,
2013
+ onLeaveConversation: Ze,
2014
+ onBlockParticipant: Ye,
2015
+ CustomChannelEmptyState: u,
2016
+ showDeleteConversation: ze,
2017
+ onDeleteConversationClick: x,
2018
+ onBlockParticipantClick: g,
2013
2019
  onReportParticipantClick: l,
2014
- dmAgentEnabled: M,
2015
- messageMetadata: I,
2016
- onMessageSent: E,
2017
- showStarButton: g,
2018
- chatbotVotingEnabled: C
2020
+ dmAgentEnabled: y,
2021
+ messageMetadata: E,
2022
+ onMessageSent: w,
2023
+ showStarButton: p,
2024
+ chatbotVotingEnabled: f
2019
2025
  },
2020
- O.id
2026
+ G.id
2021
2027
  ) }) : c ? (
2022
2028
  // Show loading while creating/loading direct conversation channel
2023
2029
  /* @__PURE__ */ e(he, {})
2024
2030
  ) : /* @__PURE__ */ e(
2025
2031
  $e,
2026
2032
  {
2027
- hasChannels: te,
2028
- channelsLoaded: K
2033
+ hasChannels: X,
2034
+ channelsLoaded: Y
2029
2035
  }
2030
2036
  )
2031
2037
  }
2032
2038
  )
2033
2039
  ] }),
2034
- 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
2035
2041
  /* @__PURE__ */ e(
2036
2042
  "dialog",
2037
2043
  {
2038
- ref: J,
2044
+ ref: se,
2039
2045
  className: "mes-dialog",
2040
- onClick: We,
2046
+ onClick: qe,
2041
2047
  onClose: ie,
2042
2048
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2043
- Nt,
2049
+ vt,
2044
2050
  {
2045
- participantSource: ae,
2046
- onSelectParticipant: Ve,
2051
+ participantSource: re,
2052
+ onSelectParticipant: We,
2047
2053
  onClose: ie,
2048
- existingParticipantIds: ee,
2049
- participantLabel: re,
2050
- searchPlaceholder: `Search ${re}...`
2054
+ existingParticipantIds: V,
2055
+ participantLabel: ae,
2056
+ searchPlaceholder: `Search ${ae}...`
2051
2057
  },
2052
- L
2058
+ P
2053
2059
  ) })
2054
2060
  }
2055
2061
  )
2056
2062
  ]
2057
2063
  }
2058
2064
  );
2059
- }, wt = ({
2065
+ }, pt = ({
2060
2066
  question: t,
2061
2067
  onClick: s,
2062
2068
  loading: n = !1,
@@ -2078,7 +2084,7 @@ const Rt = ({
2078
2084
  ),
2079
2085
  children: t
2080
2086
  }
2081
- ), Dt = ({
2087
+ ), Tt = ({
2082
2088
  faqs: t,
2083
2089
  onFaqClick: s,
2084
2090
  loadingFaqId: n,
@@ -2087,8 +2093,8 @@ const Rt = ({
2087
2093
  avatarImage: c,
2088
2094
  avatarName: r
2089
2095
  }) => {
2090
- const d = t.filter((b) => b.enabled).sort((b, u) => (b.order ?? 0) - (u.order ?? 0));
2091
- 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: [
2092
2098
  (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2093
2099
  Q,
2094
2100
  {
@@ -2106,8 +2112,8 @@ const Rt = ({
2106
2112
  style: { backgroundColor: "#F1F0EE" },
2107
2113
  children: [
2108
2114
  a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
2109
- d.map((b) => /* @__PURE__ */ e(
2110
- wt,
2115
+ u.map((b) => /* @__PURE__ */ e(
2116
+ pt,
2111
2117
  {
2112
2118
  question: b.question,
2113
2119
  onClick: () => s(b.id),
@@ -2119,61 +2125,61 @@ const Rt = ({
2119
2125
  }
2120
2126
  )
2121
2127
  ] }) });
2122
- }, Tt = (t, s = {}) => {
2123
- const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = k([]), [r, d] = k(!1), [b, u] = k(null), [S, f] = k(n), [x, l] = k(!0), [M, I] = k(), E = T(async (w = !1, p) => {
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) => {
2124
2130
  if (r) return;
2125
- const h = p !== void 0 ? p : S;
2126
- d(!0), u(null);
2131
+ const d = R !== void 0 ? R : _;
2132
+ u(!0), h(null);
2127
2133
  try {
2128
2134
  const m = await t.loadParticipants({
2129
- search: h || void 0,
2135
+ search: d || void 0,
2130
2136
  limit: a,
2131
- cursor: w ? void 0 : M
2137
+ cursor: v ? void 0 : y
2132
2138
  });
2133
2139
  c(
2134
- (v) => w ? m.participants : [...v, ...m.participants]
2135
- ), l(m.hasMore), I(m.nextCursor);
2140
+ (C) => v ? m.participants : [...C, ...m.participants]
2141
+ ), l(m.hasMore), E(m.nextCursor);
2136
2142
  } catch (m) {
2137
- const v = m instanceof Error ? m.message : "Failed to load participants";
2138
- u(v), console.error("[useParticipants] Load error:", m);
2143
+ const C = m instanceof Error ? m.message : "Failed to load participants";
2144
+ h(C), console.error("[useParticipants] Load error:", m);
2139
2145
  } finally {
2140
- d(!1);
2146
+ u(!1);
2141
2147
  }
2142
- }, [t, S, M, a, r]), g = T(() => {
2143
- x && !r && E(!1);
2144
- }, [x, r, E]), C = T((w) => {
2145
- f(w), I(void 0), E(!0, w);
2146
- }, [E]), N = T(() => {
2147
- I(void 0), E(!0);
2148
- }, [E]);
2149
- return W(() => {
2150
- E(!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);
2151
2157
  }, [t.loadParticipants]), {
2152
2158
  participants: o,
2153
2159
  loading: r,
2154
2160
  error: b,
2155
- searchQuery: S,
2156
- hasMore: x,
2161
+ searchQuery: _,
2162
+ hasMore: g,
2157
2163
  totalCount: t.totalCount,
2158
- loadMore: g,
2159
- search: C,
2164
+ loadMore: p,
2165
+ search: f,
2160
2166
  refresh: N
2161
2167
  };
2162
2168
  };
2163
2169
  export {
2164
2170
  Q as Avatar,
2165
- ht as ChannelEmptyState,
2171
+ ft as ChannelEmptyState,
2166
2172
  Ue as ChannelList,
2167
2173
  Ae as ChannelView,
2168
- Dt as FaqList,
2169
- wt as FaqListItem,
2170
- nt as MessageVoteButtons,
2171
- kt as MessagingProvider,
2172
- Rt as MessagingShell,
2173
- Nt as ParticipantPicker,
2174
- Vs as formatRelativeTime,
2175
- et as useMessageVote,
2176
- Hs as useMessaging,
2177
- 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
2178
2184
  };
2179
2185
  //# sourceMappingURL=index.js.map