@linktr.ee/messaging-react 1.14.0 โ†’ 1.15.0

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