@linktr.ee/messaging-react 1.8.7 → 1.8.8

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,10 +1,10 @@
1
- import { jsx as e, jsxs as u, Fragment as se } from "react/jsx-runtime";
2
- import S from "classnames";
3
- import q, { createContext as ke, useContext as Re, useCallback as P, useState as w, useRef as z, useEffect as $ } from "react";
4
- import { StreamChatService as Fe } from "@linktr.ee/messaging-core";
5
- import { Chat as Te, ChannelList as De, MessageInput as pe, useMessageInputContext as Me, useMessageComposerHasSendableData as Pe, SimpleAttachmentSelector as Ue, QuotedMessagePreview as Oe, LinkPreviewList as Le, AttachmentPreviewList as _e, TextareaComposer as je, Channel as Ae, useChannelStateContext as fe, Window as Be, MessageList as ze } from "stream-chat-react";
6
- import { XIcon as he, ArrowUpIcon as $e, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as He, ProhibitInsetIcon as ce, FlagIcon as Ge, MagnifyingGlassIcon as Ve, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
7
- const ge = ke({
1
+ import { jsx as e, jsxs as c, Fragment as se } from "react/jsx-runtime";
2
+ import R from "classnames";
3
+ import Y, { createContext as Re, useContext as Fe, useCallback as P, useState as y, useRef as $, useEffect as H } from "react";
4
+ import { StreamChatService as Te } from "@linktr.ee/messaging-core";
5
+ import { Chat as De, ChannelList as pe, MessageInput as Me, useMessageInputContext as Pe, useMessageComposerHasSendableData as Ue, SimpleAttachmentSelector as Oe, QuotedMessagePreview as Le, LinkPreviewList as _e, AttachmentPreviewList as je, TextareaComposer as Ae, Channel as Be, useChannelStateContext as fe, Window as ze, MessageList as $e } from "stream-chat-react";
6
+ import { XIcon as he, ArrowUpIcon as He, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as Ge, ProhibitInsetIcon as ce, FlagIcon as Ve, MagnifyingGlassIcon as We, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
7
+ const ge = Re({
8
8
  service: null,
9
9
  client: null,
10
10
  isConnected: !1,
@@ -15,109 +15,109 @@ const ge = ke({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ne = () => Re(ge), Ns = ({
18
+ }), ne = () => Fe(ge), bs = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
- capabilities: a = {},
23
+ capabilities: i = {},
24
24
  customization: d = {},
25
- debug: i = !1
25
+ debug: a = !1
26
26
  }) => {
27
27
  const l = P(
28
- (b, ...D) => {
29
- i && console.log(`🔥 [MessagingProvider] ${b}`, ...D);
28
+ (x, ...D) => {
29
+ a && console.log(`🔥 [MessagingProvider] ${x}`, ...D);
30
30
  },
31
- [i]
31
+ [a]
32
32
  );
33
33
  l("🔄 RENDER START", {
34
34
  userId: s == null ? void 0 : s.id,
35
35
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
36
36
  serviceConfig: !!n,
37
- capabilities: Object.keys(a),
37
+ capabilities: Object.keys(i),
38
38
  customization: Object.keys(d)
39
39
  });
40
- const [o, E] = w(null), [v, m] = w(null), [h, T] = w(!1), [x, C] = w(!1), [f, R] = w(null), I = z(!1), y = z({
40
+ const [o, w] = y(null), [I, N] = y(null), [m, S] = y(!1), [g, b] = y(!1), [E, v] = y(null), F = $(!1), C = $({
41
41
  userId: s == null ? void 0 : s.id,
42
42
  apiKey: r,
43
43
  serviceConfig: n,
44
- capabilities: a,
44
+ capabilities: i,
45
45
  customization: d
46
- }), F = z(0);
47
- F.current++, l("📊 RENDER INFO", {
48
- renderCount: F.current,
46
+ }), T = $(0);
47
+ T.current++, l("📊 RENDER INFO", {
48
+ renderCount: T.current,
49
49
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
50
50
  propChanges: {
51
- userChanged: y.current.userId !== (s == null ? void 0 : s.id),
52
- apiKeyChanged: y.current.apiKey !== r,
53
- serviceConfigChanged: y.current.serviceConfig !== n,
54
- capabilitiesChanged: y.current.capabilities !== a,
55
- customizationChanged: y.current.customization !== d
51
+ userChanged: C.current.userId !== (s == null ? void 0 : s.id),
52
+ apiKeyChanged: C.current.apiKey !== r,
53
+ serviceConfigChanged: C.current.serviceConfig !== n,
54
+ capabilitiesChanged: C.current.capabilities !== i,
55
+ customizationChanged: C.current.customization !== d
56
56
  }
57
- }), y.current = {
57
+ }), C.current = {
58
58
  userId: s == null ? void 0 : s.id,
59
59
  apiKey: r,
60
60
  serviceConfig: n,
61
- capabilities: a,
61
+ capabilities: i,
62
62
  customization: d
63
- }, $(() => {
64
- const b = F.current;
63
+ }, H(() => {
64
+ const x = T.current;
65
65
  if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
66
- renderCount: b,
66
+ renderCount: x,
67
67
  apiKey: !!r,
68
68
  serviceConfig: !!n,
69
69
  dependencies: {
70
70
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
71
71
  serviceConfigRef: n,
72
- serviceConfigStable: y.current.serviceConfig === n,
73
- apiKeyStable: y.current.apiKey === r
72
+ serviceConfigStable: C.current.serviceConfig === n,
73
+ apiKeyStable: C.current.apiKey === r
74
74
  }
75
75
  }), !r || !n) {
76
76
  l("⚠️ SERVICE INIT SKIPPED", {
77
- renderCount: b,
77
+ renderCount: x,
78
78
  reason: "Missing apiKey or serviceConfig"
79
79
  });
80
80
  return;
81
81
  }
82
82
  l("🚀 CREATING NEW SERVICE", {
83
- renderCount: b,
83
+ renderCount: x,
84
84
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
85
- serviceConfigChanged: y.current.serviceConfig !== n
85
+ serviceConfigChanged: C.current.serviceConfig !== n
86
86
  });
87
- const D = new Fe({
87
+ const D = new Te({
88
88
  ...n,
89
89
  apiKey: r,
90
- debug: i
90
+ debug: a
91
91
  });
92
- return E(D), l("✅ SERVICE SET", {
93
- renderCount: b,
92
+ return w(D), l("✅ SERVICE SET", {
93
+ renderCount: x,
94
94
  serviceInstance: !!D
95
95
  }), () => {
96
96
  l("🧹 SERVICE CLEANUP", {
97
- renderCount: b,
97
+ renderCount: x,
98
98
  reason: "Effect cleanup"
99
99
  }), D.disconnectUser().catch(console.error);
100
100
  };
101
- }, [r, n, i, l]);
102
- const M = z(null);
103
- $(() => {
104
- var D, W;
101
+ }, [r, n, a, l]);
102
+ const p = $(null);
103
+ H(() => {
104
+ var D, q;
105
105
  if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
106
106
  hasService: !!o,
107
107
  hasUser: !!s,
108
108
  userId: s == null ? void 0 : s.id,
109
- isConnecting: I.current,
110
- isConnected: h,
109
+ isConnecting: F.current,
110
+ isConnected: m,
111
111
  dependencies: { service: !!o, userId: s == null ? void 0 : s.id }
112
112
  }), !o || !s) {
113
113
  l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
114
114
  return;
115
115
  }
116
- if (I.current) {
116
+ if (F.current) {
117
117
  l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
118
118
  return;
119
119
  }
120
- if (((D = M.current) == null ? void 0 : D.serviceId) === o && ((W = M.current) == null ? void 0 : W.userId) === s.id) {
120
+ if (((D = p.current) == null ? void 0 : D.serviceId) === o && ((q = p.current) == null ? void 0 : q.userId) === s.id) {
121
121
  l(
122
122
  "⚠️ USER CONNECTION SKIPPED",
123
123
  "Already connected this user with this service"
@@ -125,40 +125,40 @@ const ge = ke({
125
125
  return;
126
126
  }
127
127
  (async () => {
128
- l("🚀 STARTING USER CONNECTION", { userId: s.id }), I.current = !0, C(!0), R(null);
128
+ l("🚀 STARTING USER CONNECTION", { userId: s.id }), F.current = !0, b(!0), v(null);
129
129
  try {
130
130
  l("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
131
- const p = await o.connectUser(s);
132
- m(p), T(!0), M.current = { serviceId: o, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
131
+ const _ = await o.connectUser(s);
132
+ N(_), S(!0), p.current = { serviceId: o, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
133
133
  userId: s.id,
134
- clientId: p.userID
134
+ clientId: _.userID
135
135
  });
136
- } catch (p) {
137
- const A = p instanceof Error ? p.message : "Connection failed";
138
- R(A), l("❌ USER CONNECTION ERROR", {
136
+ } catch (_) {
137
+ const O = _ instanceof Error ? _.message : "Connection failed";
138
+ v(O), l("❌ USER CONNECTION ERROR", {
139
139
  userId: s.id,
140
- error: A
140
+ error: O
141
141
  });
142
142
  } finally {
143
- C(!1), I.current = !1, l("🔄 USER CONNECTION FINISHED", {
143
+ b(!1), F.current = !1, l("🔄 USER CONNECTION FINISHED", {
144
144
  userId: s.id,
145
- isConnected: h
145
+ isConnected: m
146
146
  });
147
147
  }
148
148
  })();
149
- }, [o, s, l, h]), $(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
149
+ }, [o, s, l, m]), H(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
150
150
  hasService: !!o,
151
- isConnected: h
151
+ isConnected: m
152
152
  }), () => {
153
- o && h ? (l(
153
+ o && m ? (l(
154
154
  "🧹 CLEANUP EFFECT TRIGGERED",
155
155
  "Cleaning up connection on unmount"
156
- ), M.current = null, o.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
156
+ ), p.current = null, o.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
157
157
  hasService: !!o,
158
- isConnected: h
158
+ isConnected: m
159
159
  });
160
- }), [o, h, l]);
161
- const c = P(async () => {
160
+ }), [o, m, l]);
161
+ const u = P(async () => {
162
162
  if (l("🔄 REFRESH CONNECTION CALLED", {
163
163
  hasService: !!o,
164
164
  hasUser: !!s
@@ -166,67 +166,67 @@ const ge = ke({
166
166
  l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
167
167
  return;
168
168
  }
169
- l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), C(!0);
169
+ l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), b(!0);
170
170
  try {
171
171
  l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
172
- const b = await o.connectUser(s);
173
- m(b), T(!0), R(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
174
- } catch (b) {
175
- const D = b instanceof Error ? b.message : "Refresh failed";
176
- R(D), l("❌ CONNECTION REFRESH ERROR", {
172
+ const x = await o.connectUser(s);
173
+ N(x), S(!0), v(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
174
+ } catch (x) {
175
+ const D = x instanceof Error ? x.message : "Refresh failed";
176
+ v(D), l("❌ CONNECTION REFRESH ERROR", {
177
177
  userId: s.id,
178
178
  error: D
179
179
  });
180
180
  } finally {
181
- C(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
181
+ b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
182
182
  }
183
- }, [o, s, l]), g = q.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
183
+ }, [o, s, l]), f = Y.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
184
184
  hasService: !!o,
185
- hasClient: !!v,
186
- isConnected: h,
187
- isLoading: x,
188
- hasError: !!f,
189
- capabilitiesKeys: Object.keys(a),
185
+ hasClient: !!I,
186
+ isConnected: m,
187
+ isLoading: g,
188
+ hasError: !!E,
189
+ capabilitiesKeys: Object.keys(i),
190
190
  customizationKeys: Object.keys(d)
191
191
  }), {
192
192
  service: o,
193
- client: v,
194
- isConnected: h,
195
- isLoading: x,
196
- error: f,
197
- capabilities: a,
193
+ client: I,
194
+ isConnected: m,
195
+ isLoading: g,
196
+ error: E,
197
+ capabilities: i,
198
198
  customization: d,
199
- refreshConnection: c,
200
- debug: i
199
+ refreshConnection: u,
200
+ debug: a
201
201
  }), [
202
202
  o,
203
- v,
204
- h,
205
- x,
206
- f,
207
- a,
208
- d,
209
- c,
203
+ I,
204
+ m,
205
+ g,
206
+ E,
210
207
  i,
208
+ d,
209
+ u,
210
+ a,
211
211
  l
212
212
  ]);
213
213
  return l("🔄 RENDER END", {
214
- renderCount: F.current,
215
- willRenderChat: !!(v && h),
216
- contextValueReady: !!g
217
- }), /* @__PURE__ */ e(ge.Provider, { value: g, children: v && h ? /* @__PURE__ */ e(Te, { client: v, children: t }) : t });
218
- }, We = () => ne(), qe = (t, s) => {
214
+ renderCount: T.current,
215
+ willRenderChat: !!(I && m),
216
+ contextValueReady: !!f
217
+ }), /* @__PURE__ */ e(ge.Provider, { value: f, children: I && m ? /* @__PURE__ */ e(De, { client: I, children: t }) : t });
218
+ }, qe = () => ne(), Ye = (t, s) => {
219
219
  const n = new Date(
220
220
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
221
- ), a = new Date(
221
+ ), i = new Date(
222
222
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
223
223
  ).getTime() - n.getTime();
224
- return Math.floor(a / (1e3 * 60 * 60 * 24));
225
- }, Ye = (t) => {
224
+ return Math.floor(i / (1e3 * 60 * 60 * 24));
225
+ }, Je = (t) => {
226
226
  const s = /* @__PURE__ */ new Date();
227
227
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
228
228
  return "Just now";
229
- const r = qe(t, s);
229
+ const r = Ye(t, s);
230
230
  return r === 0 ? t.toLocaleTimeString([], {
231
231
  hour: "numeric",
232
232
  minute: "2-digit"
@@ -263,7 +263,7 @@ const ge = ke({
263
263
  "🍈"
264
264
  // Melon
265
265
  ];
266
- function Je(t) {
266
+ function Qe(t) {
267
267
  let s = 0;
268
268
  for (let n = 0; n < t.length; n++) {
269
269
  const r = t.charCodeAt(n);
@@ -271,21 +271,21 @@ function Je(t) {
271
271
  }
272
272
  return Math.abs(s);
273
273
  }
274
- function Qe(t) {
275
- const n = Je(t) % ue.length;
274
+ function Xe(t) {
275
+ const n = Qe(t) % ue.length;
276
276
  return ue[n];
277
277
  }
278
- const Y = ({
278
+ const J = ({
279
279
  id: t,
280
280
  image: s,
281
281
  size: n = 40,
282
282
  className: r
283
283
  }) => {
284
- const a = Qe(t), i = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg";
284
+ const i = Xe(t), a = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg";
285
285
  return /* @__PURE__ */ e(
286
286
  "div",
287
287
  {
288
- className: S("flex-shrink-0 overflow-hidden", r),
288
+ className: R("flex-shrink-0 overflow-hidden", r),
289
289
  style: {
290
290
  width: `${n}px`,
291
291
  height: `${n}px`,
@@ -304,126 +304,128 @@ const Y = ({
304
304
  "div",
305
305
  {
306
306
  "aria-hidden": "true",
307
- className: S(
307
+ className: R(
308
308
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
309
- i
309
+ a
310
310
  ),
311
- children: a
311
+ children: i
312
312
  }
313
313
  )
314
314
  }
315
315
  );
316
- }, Xe = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
317
- var f, R, I, y, F, M;
318
- const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), i = () => {
316
+ }, Ze = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: i }) => {
317
+ var E, v, F, C, T, p;
318
+ const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
319
319
  t && n(t);
320
- }, o = Object.values(((f = t == null ? void 0 : t.state) == null ? void 0 : f.members) || {}).find(
321
- (c) => {
322
- var g, b;
323
- return ((g = c.user) == null ? void 0 : g.id) && c.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
320
+ }, o = Object.values(((E = t == null ? void 0 : t.state) == null ? void 0 : E.members) || {}).find(
321
+ (u) => {
322
+ var f, x;
323
+ return ((f = u.user) == null ? void 0 : f.id) && u.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
324
324
  }
325
- ), E = ((R = o == null ? void 0 : o.user) == null ? void 0 : R.name) || "Conversation", v = (I = o == null ? void 0 : o.user) == null ? void 0 : I.image, m = (F = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages) == null ? void 0 : F[t.state.messages.length - 1], T = (() => {
326
- var g;
327
- if (m != null && m.text) return m.text;
328
- const c = (g = m == null ? void 0 : m.attachments) == null ? void 0 : g[0];
329
- return c != null && c.asset_url ? c.asset_url : c != null && c.image_url ? c.image_url : c != null && c.og_scrape_url ? c.og_scrape_url : c != null && c.thumb_url ? c.thumb_url : "No messages yet";
330
- })(), x = m != null && m.created_at ? Ye(new Date(m.created_at)) : "", C = a ?? 0;
325
+ ), w = ((v = o == null ? void 0 : o.user) == null ? void 0 : v.name) || "Conversation", I = (F = o == null ? void 0 : o.user) == null ? void 0 : F.image, N = (T = (C = t == null ? void 0 : t.state) == null ? void 0 : C.messages) == null ? void 0 : T[t.state.messages.length - 1], S = (() => {
326
+ var f;
327
+ if (N != null && N.text) return N.text;
328
+ const u = (f = N == null ? void 0 : N.attachments) == null ? void 0 : f[0];
329
+ return u != null && u.asset_url ? u.asset_url : u != null && u.image_url ? u.image_url : u != null && u.og_scrape_url ? u.og_scrape_url : u != null && u.thumb_url ? u.thumb_url : "No messages yet";
330
+ })(), g = N != null && N.created_at ? Je(new Date(N.created_at)) : "", b = i ?? 0;
331
331
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
332
332
  channelId: t == null ? void 0 : t.id,
333
333
  isSelected: d,
334
- participantName: E,
335
- unreadCount: C,
336
- hasTimestamp: !!x
334
+ participantName: w,
335
+ unreadCount: b,
336
+ hasTimestamp: !!g
337
337
  }), /* @__PURE__ */ e(
338
338
  "button",
339
339
  {
340
340
  type: "button",
341
- onClick: i,
342
- className: S(
341
+ onClick: a,
342
+ className: R(
343
343
  "group w-full px-4 py-3 transition-colors border-b border-sand text-left max-w-full overflow-hidden focus-ring",
344
344
  {
345
345
  "bg-primary-alt/10 border-l-4 border-l-primary": d,
346
346
  "hover:bg-sand": !d
347
347
  }
348
348
  ),
349
- children: /* @__PURE__ */ u("div", { className: "flex items-start gap-3", children: [
349
+ children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
350
350
  /* @__PURE__ */ e(
351
- Y,
351
+ J,
352
352
  {
353
- id: ((M = o == null ? void 0 : o.user) == null ? void 0 : M.id) || t.id || "unknown",
354
- name: E,
355
- image: v,
353
+ id: ((p = o == null ? void 0 : o.user) == null ? void 0 : p.id) || t.id || "unknown",
354
+ name: w,
355
+ image: I,
356
356
  size: 44,
357
357
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
358
358
  }
359
359
  ),
360
- /* @__PURE__ */ u("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
361
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2", children: [
360
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
361
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
362
362
  /* @__PURE__ */ e(
363
363
  "h3",
364
364
  {
365
- className: S(
365
+ className: R(
366
366
  "text-sm font-medium truncate",
367
367
  d ? "text-primary" : "text-charcoal"
368
368
  ),
369
- children: E
369
+ children: w
370
370
  }
371
371
  ),
372
- x && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: x })
372
+ g && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: g })
373
373
  ] }),
374
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
375
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: T }),
376
- C > 0 && /* @__PURE__ */ e("span", { className: "bg-primary text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: C > 99 ? "99+" : C })
374
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
375
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: S }),
376
+ b > 0 && /* @__PURE__ */ e("span", { className: "bg-primary text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: b > 99 ? "99+" : b })
377
377
  ] })
378
378
  ] })
379
379
  ] })
380
380
  }
381
381
  );
382
- }, Ze = ({
382
+ }, Ke = ({
383
383
  onChannelSelect: t,
384
384
  selectedChannel: s,
385
385
  filters: n,
386
- className: r
386
+ className: r,
387
+ customEmptyStateIndicator: i
387
388
  }) => {
388
- const a = q.useRef(0);
389
- a.current++;
390
- const { debug: d = !1 } = ne();
391
- return d && console.log("📺 [ChannelList] 🔄 RENDER START", {
392
- renderCount: a.current,
389
+ const d = Y.useRef(0);
390
+ d.current++;
391
+ const { debug: a = !1 } = ne();
392
+ return a && console.log("📺 [ChannelList] 🔄 RENDER START", {
393
+ renderCount: d.current,
393
394
  selectedChannelId: s == null ? void 0 : s.id,
394
395
  filters: n
395
396
  }), /* @__PURE__ */ e(
396
397
  "div",
397
398
  {
398
- className: S(
399
+ className: R(
399
400
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
400
401
  r
401
402
  ),
402
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (d && console.log("📺 [ChannelList] 🎬 RENDERING STREAM CHANNEL LIST", {
403
- renderCount: a.current,
403
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (a && console.log("📺 [ChannelList] 🎬 RENDERING STREAM CHANNEL LIST", {
404
+ renderCount: d.current,
404
405
  filters: n
405
406
  }), /* @__PURE__ */ e(
406
- De,
407
+ pe,
407
408
  {
408
409
  filters: n,
409
410
  sort: { last_message_at: -1 },
410
411
  options: { limit: 30 },
411
- Preview: (i) => {
412
- var l, o;
413
- return d && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
414
- channelId: (l = i.channel) == null ? void 0 : l.id,
412
+ Preview: (l) => {
413
+ var o, w;
414
+ return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
415
+ channelId: (o = l.channel) == null ? void 0 : o.id,
415
416
  selectedChannelId: s == null ? void 0 : s.id,
416
- isSelected: (s == null ? void 0 : s.id) === ((o = i.channel) == null ? void 0 : o.id)
417
+ isSelected: (s == null ? void 0 : s.id) === ((w = l.channel) == null ? void 0 : w.id)
417
418
  }), /* @__PURE__ */ e(
418
- Xe,
419
+ Ze,
419
420
  {
420
- ...i,
421
+ ...l,
421
422
  selectedChannel: s,
422
423
  onChannelSelect: t,
423
- debug: d
424
+ debug: a
424
425
  }
425
426
  );
426
- }
427
+ },
428
+ EmptyStateIndicator: i
427
429
  },
428
430
  JSON.stringify(n)
429
431
  )) })
@@ -438,7 +440,7 @@ const Y = ({
438
440
  "button",
439
441
  {
440
442
  type: "button",
441
- className: S(
443
+ className: R(
442
444
  "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",
443
445
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
444
446
  s
@@ -448,11 +450,11 @@ const Y = ({
448
450
  }
449
451
  );
450
452
  function xe({ label: t, className: s, children: n, ...r }) {
451
- return /* @__PURE__ */ u(
453
+ return /* @__PURE__ */ c(
452
454
  "button",
453
455
  {
454
456
  type: "button",
455
- className: S(
457
+ className: R(
456
458
  "rounded-full p-2 transition-colors focus-ring",
457
459
  {
458
460
  "cursor-not-allowed opacity-50": r.disabled,
@@ -471,17 +473,17 @@ function xe({ label: t, className: s, children: n, ...r }) {
471
473
  function Ne({ onClick: t }) {
472
474
  return /* @__PURE__ */ e(xe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(he, { className: "h-5 w-5 text-stone", weight: "bold" }) });
473
475
  }
474
- const Ke = () => {
475
- const { handleSubmit: t } = Me(), s = Pe();
476
- return /* @__PURE__ */ u(se, { children: [
477
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ue, {}) }),
478
- /* @__PURE__ */ u("div", { className: "central-container w-full p-2 bg-white rounded-lg 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: [
479
- /* @__PURE__ */ e(Oe, {}),
476
+ const es = () => {
477
+ const { handleSubmit: t } = Pe(), s = Ue();
478
+ return /* @__PURE__ */ c(se, { children: [
479
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Oe, {}) }),
480
+ /* @__PURE__ */ c("div", { className: "central-container w-full p-2 bg-white rounded-lg 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: [
480
481
  /* @__PURE__ */ e(Le, {}),
481
482
  /* @__PURE__ */ e(_e, {}),
482
- /* @__PURE__ */ u("div", { className: "flex", children: [
483
+ /* @__PURE__ */ e(je, {}),
484
+ /* @__PURE__ */ c("div", { className: "flex", children: [
483
485
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4", children: /* @__PURE__ */ e(
484
- je,
486
+ Ae,
485
487
  {
486
488
  className: "align-middle w-full resize-none outline-none",
487
489
  maxRows: 4
@@ -496,34 +498,34 @@ const Ke = () => {
496
498
  disabled: !s,
497
499
  onClick: t,
498
500
  type: "button",
499
- children: /* @__PURE__ */ e($e, { className: "size-4" })
501
+ children: /* @__PURE__ */ e(He, { className: "size-4" })
500
502
  }
501
503
  )
502
504
  ] })
503
505
  ] })
504
506
  ] });
505
- }, es = ({
507
+ }, ss = ({
506
508
  renderActions: t
507
- }) => /* @__PURE__ */ u("div", { className: "message-input flex items-center gap-2 p-4", children: [
509
+ }) => /* @__PURE__ */ c("div", { className: "message-input flex items-center gap-2 p-4", children: [
508
510
  t && (t == null ? void 0 : t()),
509
- /* @__PURE__ */ e(pe, { Input: Ke })
510
- ] }), be = () => /* @__PURE__ */ e("div", { className: "messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
511
+ /* @__PURE__ */ e(Me, { Input: es })
512
+ ] }), be = () => /* @__PURE__ */ e("div", { className: "messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
511
513
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "No messages yet 👀" }),
512
514
  /* @__PURE__ */ e("p", { className: "text-stone text-xs", children: "Share to social media to generate more conversations" })
513
- ] }) }), ss = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
514
- var o, E, v, m, h;
515
- const { channel: a } = fe(), d = q.useMemo(() => Object.values(a.state.members || {}).find(
516
- (x) => {
517
- var C;
518
- return ((C = x.user) == null ? void 0 : C.id) && x.user.id !== a._client.userID;
515
+ ] }) }), ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
516
+ var o, w, I, N, m;
517
+ const { channel: i } = fe(), d = Y.useMemo(() => Object.values(i.state.members || {}).find(
518
+ (g) => {
519
+ var b;
520
+ return ((b = g.user) == null ? void 0 : b.id) && g.user.id !== i._client.userID;
519
521
  }
520
- ), [a._client.userID, a.state.members]), i = ((o = d == null ? void 0 : d.user) == null ? void 0 : o.name) || ((E = d == null ? void 0 : d.user) == null ? void 0 : E.id) || "Unknown member", l = (v = d == null ? void 0 : d.user) == null ? void 0 : v.image;
521
- return /* @__PURE__ */ u("div", { className: "@container", children: [
522
- /* @__PURE__ */ u("div", { className: "flex justify-between items-center @md:hidden", children: [
522
+ ), [i._client.userID, i.state.members]), a = ((o = d == null ? void 0 : d.user) == null ? void 0 : o.name) || ((w = d == null ? void 0 : d.user) == null ? void 0 : w.id) || "Unknown member", l = (I = d == null ? void 0 : d.user) == null ? void 0 : I.image;
523
+ return /* @__PURE__ */ c("div", { className: "@container", children: [
524
+ /* @__PURE__ */ c("div", { className: "flex justify-between items-center @md:hidden", children: [
523
525
  /* @__PURE__ */ e(
524
526
  "button",
525
527
  {
526
- className: S(
528
+ className: R(
527
529
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
528
530
  !s && "invisible"
529
531
  ),
@@ -532,22 +534,22 @@ const Ke = () => {
532
534
  children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
533
535
  }
534
536
  ),
535
- /* @__PURE__ */ u("div", { className: "flex flex-col gap-1 items-center", children: [
537
+ /* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
536
538
  /* @__PURE__ */ e(
537
- Y,
539
+ J,
538
540
  {
539
- id: ((m = d == null ? void 0 : d.user) == null ? void 0 : m.id) || a.id || "unknown",
540
- name: i,
541
+ id: ((N = d == null ? void 0 : d.user) == null ? void 0 : N.id) || i.id || "unknown",
542
+ name: a,
541
543
  image: l,
542
544
  size: 40
543
545
  }
544
546
  ),
545
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: i })
547
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
546
548
  ] }),
547
549
  /* @__PURE__ */ e(
548
550
  "button",
549
551
  {
550
- className: S(
552
+ className: R(
551
553
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
552
554
  ),
553
555
  onClick: n || (() => {
@@ -556,8 +558,8 @@ const Ke = () => {
556
558
  }
557
559
  )
558
560
  ] }),
559
- /* @__PURE__ */ u("div", { className: "hidden @md:flex items-center justify-between gap-3 min-h-12", children: [
560
- /* @__PURE__ */ u("div", { className: "flex items-center gap-4 min-w-0", children: [
561
+ /* @__PURE__ */ c("div", { className: "hidden @md:flex items-center justify-between gap-3 min-h-12", children: [
562
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
561
563
  s && t && /* @__PURE__ */ e(
562
564
  "button",
563
565
  {
@@ -569,20 +571,20 @@ const Ke = () => {
569
571
  }
570
572
  ),
571
573
  /* @__PURE__ */ e(
572
- Y,
574
+ J,
573
575
  {
574
- id: ((h = d == null ? void 0 : d.user) == null ? void 0 : h.id) || a.id || "unknown",
575
- name: i,
576
+ id: ((m = d == null ? void 0 : d.user) == null ? void 0 : m.id) || i.id || "unknown",
577
+ name: a,
576
578
  image: l,
577
579
  size: 40
578
580
  }
579
581
  ),
580
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: i }) })
582
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
581
583
  ] }),
582
584
  r && n && /* @__PURE__ */ e(
583
585
  "button",
584
586
  {
585
- className: S(
587
+ className: R(
586
588
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
587
589
  ),
588
590
  onClick: n,
@@ -591,80 +593,80 @@ const Ke = () => {
591
593
  )
592
594
  ] })
593
595
  ] });
594
- }, ns = ({
596
+ }, ts = ({
595
597
  isOpen: t,
596
598
  onClose: s,
597
599
  participant: n,
598
600
  channel: r,
599
- followerStatusLabel: a,
601
+ followerStatusLabel: i,
600
602
  onLeaveConversation: d,
601
- onBlockParticipant: i
603
+ onBlockParticipant: a
602
604
  }) => {
603
- var p, A, J, H, G, Q, V;
604
- const { service: l, debug: o } = ne(), E = z(null), [v, m] = w(!1), [h, T] = w(!1), [x, C] = w(!1);
605
- $(() => {
606
- const k = E.current;
605
+ var _, O, W, Q, G, V, X;
606
+ const { service: l, debug: o } = ne(), w = $(null), [I, N] = y(!1), [m, S] = y(!1), [g, b] = y(!1);
607
+ H(() => {
608
+ const k = w.current;
607
609
  k && (t ? k.showModal() : k.close());
608
610
  }, [t]);
609
- const f = P(async () => {
611
+ const E = P(async () => {
610
612
  var k;
611
613
  if (!(!l || !((k = n == null ? void 0 : n.user) != null && k.id)))
612
614
  try {
613
- const _ = (await l.getBlockedUsers()).some(
615
+ const A = (await l.getBlockedUsers()).some(
614
616
  (j) => {
615
- var X;
616
- return j.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
617
+ var B;
618
+ return j.blocked_user_id === ((B = n == null ? void 0 : n.user) == null ? void 0 : B.id);
617
619
  }
618
620
  );
619
- m(_);
620
- } catch (O) {
621
+ N(A);
622
+ } catch (M) {
621
623
  console.error(
622
624
  "[ChannelInfoDialog] Failed to check blocked status:",
623
- O
625
+ M
624
626
  );
625
627
  }
626
- }, [l, (p = n == null ? void 0 : n.user) == null ? void 0 : p.id]);
627
- $(() => {
628
- t && f();
629
- }, [t, f]);
630
- const R = async () => {
628
+ }, [l, (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id]);
629
+ H(() => {
630
+ t && E();
631
+ }, [t, E]);
632
+ const v = async () => {
631
633
  var k;
632
- if (!h) {
633
- o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), T(!0);
634
+ if (!m) {
635
+ o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
634
636
  try {
635
- const O = ((k = r._client) == null ? void 0 : k.userID) ?? null;
636
- await r.hide(O, !1), d && await d(r), s();
637
- } catch (O) {
638
- console.error("[ChannelInfoDialog] Failed to leave conversation", O);
637
+ const M = ((k = r._client) == null ? void 0 : k.userID) ?? null;
638
+ await r.hide(M, !1), d && await d(r), s();
639
+ } catch (M) {
640
+ console.error("[ChannelInfoDialog] Failed to leave conversation", M);
639
641
  } finally {
640
- T(!1);
642
+ S(!1);
641
643
  }
642
644
  }
643
- }, I = async () => {
644
- var k, O, _;
645
- if (!(x || !l)) {
646
- o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), C(!0);
645
+ }, F = async () => {
646
+ var k, M, A;
647
+ if (!(g || !l)) {
648
+ o && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), b(!0);
647
649
  try {
648
- await l.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), i && await i((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), s();
650
+ await l.blockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
649
651
  } catch (j) {
650
652
  console.error("[ChannelInfoDialog] Failed to block member", j);
651
653
  } finally {
652
- C(!1);
654
+ b(!1);
653
655
  }
654
656
  }
655
- }, y = async () => {
656
- var k, O, _;
657
- if (!(x || !l)) {
658
- o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), C(!0);
657
+ }, C = async () => {
658
+ var k, M, A;
659
+ if (!(g || !l)) {
660
+ o && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), b(!0);
659
661
  try {
660
- await l.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), i && await i((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), s();
662
+ await l.unBlockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
661
663
  } catch (j) {
662
664
  console.error("[ChannelInfoDialog] Failed to unblock member", j);
663
665
  } finally {
664
- C(!1);
666
+ b(!1);
665
667
  }
666
668
  }
667
- }, F = () => {
669
+ }, T = () => {
668
670
  s(), window.open(
669
671
  "https://linktr.ee/s/about/trust-center/report",
670
672
  "_blank",
@@ -672,99 +674,99 @@ const Ke = () => {
672
674
  );
673
675
  };
674
676
  if (!n) return null;
675
- const M = ((A = n.user) == null ? void 0 : A.name) || ((J = n.user) == null ? void 0 : J.id) || "Unknown member", c = (H = n.user) == null ? void 0 : H.image, g = (G = n.user) == null ? void 0 : G.email, b = (Q = n.user) == null ? void 0 : Q.username, D = g || (b ? `linktr.ee/${b}` : void 0), W = ((V = n.user) == null ? void 0 : V.id) || "unknown";
677
+ const p = ((O = n.user) == null ? void 0 : O.name) || ((W = n.user) == null ? void 0 : W.id) || "Unknown member", u = (Q = n.user) == null ? void 0 : Q.image, f = (G = n.user) == null ? void 0 : G.email, x = (V = n.user) == null ? void 0 : V.username, D = f || (x ? `linktr.ee/${x}` : void 0), q = ((X = n.user) == null ? void 0 : X.id) || "unknown";
676
678
  return (
677
679
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
678
680
  /* @__PURE__ */ e(
679
681
  "dialog",
680
682
  {
681
- ref: E,
683
+ ref: w,
682
684
  className: "mes-dialog",
683
685
  onClose: s,
684
686
  onClick: (k) => {
685
- k.target === E.current && s();
687
+ k.target === w.current && s();
686
688
  },
687
- children: /* @__PURE__ */ u("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
688
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
689
+ children: /* @__PURE__ */ c("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
690
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
689
691
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
690
692
  /* @__PURE__ */ e(Ne, { onClick: s })
691
693
  ] }),
692
- /* @__PURE__ */ u("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
694
+ /* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
693
695
  /* @__PURE__ */ e(
694
696
  "div",
695
697
  {
696
698
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
697
699
  style: { backgroundColor: "#FBFAF9" },
698
- children: /* @__PURE__ */ u("div", { className: "flex items-center gap-3 w-full", children: [
700
+ children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
699
701
  /* @__PURE__ */ e(
700
- Y,
702
+ J,
701
703
  {
702
- id: W,
703
- name: M,
704
- image: c,
704
+ id: q,
705
+ name: p,
706
+ image: u,
705
707
  size: 88,
706
708
  className: "!rounded-full"
707
709
  }
708
710
  ),
709
- /* @__PURE__ */ u("div", { className: "flex flex-col min-w-0 flex-1", children: [
710
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
711
+ /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
712
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: p }),
711
713
  D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
712
- a && /* @__PURE__ */ e(
714
+ i && /* @__PURE__ */ e(
713
715
  "span",
714
716
  {
715
717
  className: "mt-1 rounded-full text-xs font-normal w-fit",
716
718
  style: {
717
719
  padding: "4px 8px",
718
- backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
719
- color: a === "Subscribed to you" ? "#008236" : "#78716C",
720
+ backgroundColor: i === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
721
+ color: i === "Subscribed to you" ? "#008236" : "#78716C",
720
722
  lineHeight: "133.333%",
721
723
  letterSpacing: "0.21px"
722
724
  },
723
- children: a
725
+ children: i
724
726
  }
725
727
  )
726
728
  ] })
727
729
  ] })
728
730
  }
729
731
  ),
730
- /* @__PURE__ */ u("ul", { className: "flex flex-col gap-2 mt-2", children: [
731
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(
732
+ /* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
733
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
732
734
  K,
733
735
  {
734
- onClick: R,
735
- disabled: h,
736
- "aria-busy": h,
736
+ onClick: v,
737
+ disabled: m,
738
+ "aria-busy": m,
737
739
  children: [
738
- h ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
740
+ m ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ge, { className: "h-5 w-5" }),
739
741
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
740
742
  ]
741
743
  }
742
744
  ) }),
743
- /* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ u(
745
+ /* @__PURE__ */ e("li", { children: I ? /* @__PURE__ */ c(
744
746
  K,
745
747
  {
746
- onClick: y,
747
- disabled: x,
748
- "aria-busy": x,
748
+ onClick: C,
749
+ disabled: g,
750
+ "aria-busy": g,
749
751
  children: [
750
- x ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
752
+ g ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
751
753
  /* @__PURE__ */ e("span", { children: "Unblock" })
752
754
  ]
753
755
  }
754
- ) : /* @__PURE__ */ u(
756
+ ) : /* @__PURE__ */ c(
755
757
  K,
756
758
  {
757
- onClick: I,
758
- disabled: x,
759
- "aria-busy": x,
759
+ onClick: F,
760
+ disabled: g,
761
+ "aria-busy": g,
760
762
  children: [
761
- x ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
763
+ g ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
762
764
  /* @__PURE__ */ e("span", { children: "Block" })
763
765
  ]
764
766
  }
765
767
  ) }),
766
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ u(K, { variant: "danger", onClick: F, children: [
767
- /* @__PURE__ */ e(Ge, { className: "h-5 w-5" }),
768
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(K, { variant: "danger", onClick: T, children: [
769
+ /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
768
770
  /* @__PURE__ */ e("span", { children: "Report" })
769
771
  ] }) })
770
772
  ] })
@@ -773,107 +775,107 @@ const Ke = () => {
773
775
  }
774
776
  )
775
777
  );
776
- }, ts = ({
778
+ }, rs = ({
777
779
  onBack: t,
778
780
  showBackButton: s,
779
781
  renderMessageInputActions: n,
780
782
  onLeaveConversation: r,
781
- onBlockParticipant: a,
783
+ onBlockParticipant: i,
782
784
  CustomChannelEmptyState: d = be
783
785
  }) => {
784
- var h, T;
785
- const { channel: i } = fe(), [l, o] = w(!1), E = (((T = (h = i == null ? void 0 : i.state) == null ? void 0 : h.messages) == null ? void 0 : T.length) ?? 0) > 0, v = q.useMemo(() => Object.values(i.state.members || {}).find(
786
- (C) => {
787
- var f;
788
- return ((f = C.user) == null ? void 0 : f.id) && C.user.id !== i._client.userID;
786
+ var m, S;
787
+ const { channel: a } = fe(), [l, o] = y(!1), w = (((S = (m = a == null ? void 0 : a.state) == null ? void 0 : m.messages) == null ? void 0 : S.length) ?? 0) > 0, I = Y.useMemo(() => Object.values(a.state.members || {}).find(
788
+ (b) => {
789
+ var E;
790
+ return ((E = b.user) == null ? void 0 : E.id) && b.user.id !== a._client.userID;
789
791
  }
790
- ), [i._client.userID, i.state.members]), m = q.useMemo(() => {
791
- const x = i.data ?? {};
792
- if (x.followerStatus)
793
- return String(x.followerStatus);
794
- if (x.isFollower !== void 0)
795
- return x.isFollower ? "Subscribed to you" : "Not subscribed";
796
- }, [i.data]);
797
- return /* @__PURE__ */ u(se, { children: [
798
- /* @__PURE__ */ u(Be, { children: [
792
+ ), [a._client.userID, a.state.members]), N = Y.useMemo(() => {
793
+ const g = a.data ?? {};
794
+ if (g.followerStatus)
795
+ return String(g.followerStatus);
796
+ if (g.isFollower !== void 0)
797
+ return g.isFollower ? "Subscribed to you" : "Not subscribed";
798
+ }, [a.data]);
799
+ return /* @__PURE__ */ c(se, { children: [
800
+ /* @__PURE__ */ c(ze, { children: [
799
801
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
800
- ss,
802
+ ns,
801
803
  {
802
804
  onBack: t,
803
805
  showBackButton: s,
804
806
  onShowInfo: () => o(!0),
805
- canShowInfo: !!v
807
+ canShowInfo: !!I
806
808
  }
807
809
  ) }),
808
- /* @__PURE__ */ u("div", { className: "flex-1 overflow-hidden relative", children: [
810
+ /* @__PURE__ */ c("div", { className: "flex-1 overflow-hidden relative", children: [
809
811
  /* @__PURE__ */ e(
810
- ze,
812
+ $e,
811
813
  {
812
814
  hideDeletedMessages: !0,
813
815
  hideNewMessageSeparator: !1,
814
816
  messageActions: []
815
817
  }
816
818
  ),
817
- !E && d && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(d, {}) })
819
+ !w && d && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(d, {}) })
818
820
  ] }),
819
821
  /* @__PURE__ */ e(
820
- es,
822
+ ss,
821
823
  {
822
- renderActions: () => n == null ? void 0 : n(i)
824
+ renderActions: () => n == null ? void 0 : n(a)
823
825
  }
824
826
  )
825
827
  ] }),
826
828
  /* @__PURE__ */ e(
827
- ns,
829
+ ts,
828
830
  {
829
831
  isOpen: l,
830
832
  onClose: () => o(!1),
831
- participant: v,
832
- channel: i,
833
- followerStatusLabel: m,
833
+ participant: I,
834
+ channel: a,
835
+ followerStatusLabel: N,
834
836
  onLeaveConversation: r,
835
- onBlockParticipant: a
837
+ onBlockParticipant: i
836
838
  }
837
839
  )
838
840
  ] });
839
- }, rs = ({
841
+ }, ls = ({
840
842
  channel: t,
841
843
  onBack: s,
842
844
  showBackButton: n = !1,
843
845
  renderMessageInputActions: r,
844
- onLeaveConversation: a,
846
+ onLeaveConversation: i,
845
847
  onBlockParticipant: d,
846
- className: i,
848
+ className: a,
847
849
  CustomChannelEmptyState: l = be
848
850
  }) => /* @__PURE__ */ e(
849
851
  "div",
850
852
  {
851
- className: S(
853
+ className: R(
852
854
  "messaging-channel-view h-full flex flex-col bg-[#FBFAF9]",
853
- i
855
+ a
854
856
  ),
855
- children: /* @__PURE__ */ e(Ae, { channel: t, children: /* @__PURE__ */ e(
856
- ts,
857
+ children: /* @__PURE__ */ e(Be, { channel: t, children: /* @__PURE__ */ e(
858
+ rs,
857
859
  {
858
860
  onBack: s,
859
861
  showBackButton: n,
860
862
  renderMessageInputActions: r,
861
- onLeaveConversation: a,
863
+ onLeaveConversation: i,
862
864
  onBlockParticipant: d,
863
865
  CustomChannelEmptyState: l
864
866
  }
865
867
  ) })
866
868
  }
867
869
  );
868
- function ls({
870
+ function os({
869
871
  searchQuery: t,
870
872
  setSearchQuery: s,
871
873
  placeholder: n
872
874
  }) {
873
- const r = z(null);
874
- return /* @__PURE__ */ u("div", { className: "relative", children: [
875
+ const r = $(null);
876
+ return /* @__PURE__ */ c("div", { className: "relative", children: [
875
877
  /* @__PURE__ */ e(
876
- Ve,
878
+ We,
877
879
  {
878
880
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
879
881
  weight: "bold"
@@ -886,7 +888,7 @@ function ls({
886
888
  type: "text",
887
889
  placeholder: n,
888
890
  value: t,
889
- onChange: (a) => s(a.target.value),
891
+ onChange: (i) => s(i.target.value),
890
892
  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"
891
893
  }
892
894
  ),
@@ -895,8 +897,8 @@ function ls({
895
897
  {
896
898
  label: "Clear search",
897
899
  onClick: () => {
898
- var a;
899
- s(""), (a = r.current) == null || a.focus();
900
+ var i;
901
+ s(""), (i = r.current) == null || i.focus();
900
902
  },
901
903
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
902
904
  children: /* @__PURE__ */ e(he, { className: "h-4 w-4", weight: "bold" })
@@ -904,156 +906,156 @@ function ls({
904
906
  )
905
907
  ] });
906
908
  }
907
- const os = ({
909
+ const as = ({
908
910
  participantSource: t,
909
911
  onSelectParticipant: s,
910
912
  onClose: n,
911
913
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
912
- participantLabel: a = "participants",
914
+ participantLabel: i = "participants",
913
915
  searchPlaceholder: d = "Search participants...",
914
- className: i
916
+ className: a
915
917
  }) => {
916
- const { debug: l } = ne(), [o, E] = w(""), [v, m] = w([]), [h, T] = w(!1), [x, C] = w(null), [f, R] = w(
918
+ const { debug: l } = ne(), [o, w] = y(""), [I, N] = y([]), [m, S] = y(!1), [g, b] = y(null), [E, v] = y(
917
919
  null
918
- ), I = z(!1);
919
- $(() => {
920
+ ), F = $(!1);
921
+ H(() => {
920
922
  if (t.loading) {
921
923
  l && console.log(
922
924
  "[ParticipantPicker] Waiting for participant source to finish loading..."
923
925
  );
924
926
  return;
925
927
  }
926
- if (I.current) return;
928
+ if (F.current) return;
927
929
  (async () => {
928
- l && console.log("[ParticipantPicker] Loading initial participants..."), T(!0), C(null);
930
+ l && console.log("[ParticipantPicker] Loading initial participants..."), S(!0), b(null);
929
931
  try {
930
- const g = await t.loadParticipants({
932
+ const f = await t.loadParticipants({
931
933
  search: "",
932
934
  // Load all participants initially
933
935
  limit: 100
934
936
  });
935
- m(g.participants), I.current = !0, l && console.log(
937
+ N(f.participants), F.current = !0, l && console.log(
936
938
  "[ParticipantPicker] Participants loaded successfully:",
937
- g.participants.length
939
+ f.participants.length
938
940
  );
939
- } catch (g) {
940
- const b = g instanceof Error ? g.message : "Failed to load participants";
941
- C(b), console.error("[ParticipantPicker] Failed to load participants:", g);
941
+ } catch (f) {
942
+ const x = f instanceof Error ? f.message : "Failed to load participants";
943
+ b(x), console.error("[ParticipantPicker] Failed to load participants:", f);
942
944
  } finally {
943
- T(!1);
945
+ S(!1);
944
946
  }
945
947
  })();
946
948
  }, [t.loading, l]);
947
- const y = v.filter((c) => !r.has(c.id)).filter((c) => {
948
- var b;
949
+ const C = I.filter((u) => !r.has(u.id)).filter((u) => {
950
+ var x;
949
951
  if (!o) return !0;
950
- const g = o.toLowerCase();
951
- return c.name.toLowerCase().includes(g) || ((b = c.email) == null ? void 0 : b.toLowerCase().includes(g)) || !1;
952
- }), F = P(
953
- async (c) => {
954
- if (!f) {
955
- R(c.id);
952
+ const f = o.toLowerCase();
953
+ return u.name.toLowerCase().includes(f) || ((x = u.email) == null ? void 0 : x.toLowerCase().includes(f)) || !1;
954
+ }), T = P(
955
+ async (u) => {
956
+ if (!E) {
957
+ v(u.id);
956
958
  try {
957
- await s(c);
958
- } catch (g) {
959
- console.error("[ParticipantPicker] Failed to start chat:", g), R(null);
959
+ await s(u);
960
+ } catch (f) {
961
+ console.error("[ParticipantPicker] Failed to start chat:", f), v(null);
960
962
  }
961
963
  }
962
964
  },
963
- [s, f]
964
- ), M = (c, g) => {
965
- (c.key === "Enter" || c.key === " ") && (c.preventDefault(), F(g));
965
+ [s, E]
966
+ ), p = (u, f) => {
967
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), T(f));
966
968
  };
967
- return /* @__PURE__ */ u("div", { className: S("flex flex-col h-full", i), children: [
968
- /* @__PURE__ */ u("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
969
- /* @__PURE__ */ u("div", { className: "flex items-center justify-between mb-3", children: [
969
+ return /* @__PURE__ */ c("div", { className: R("flex flex-col h-full", a), children: [
970
+ /* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
971
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
970
972
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
971
973
  /* @__PURE__ */ e(Ne, { onClick: n })
972
974
  ] }),
973
- /* @__PURE__ */ u("p", { className: "text-xs text-stone mb-3", children: [
975
+ /* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
974
976
  "Select a ",
975
- a.slice(0, -1),
977
+ i.slice(0, -1),
976
978
  " to start messaging (",
977
- y.length,
979
+ C.length,
978
980
  " available)",
979
- t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
981
+ t.totalCount !== void 0 && ` • ${t.totalCount} ${i} total`
980
982
  ] }),
981
983
  /* @__PURE__ */ e(
982
- ls,
984
+ os,
983
985
  {
984
986
  searchQuery: o,
985
- setSearchQuery: E,
987
+ setSearchQuery: w,
986
988
  placeholder: d
987
989
  }
988
990
  )
989
991
  ] }),
990
- x && /* @__PURE__ */ u("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
992
+ g && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
991
993
  "Error loading ",
992
- a,
994
+ i,
993
995
  ": ",
994
- x
996
+ g
995
997
  ] }),
996
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: h && y.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
998
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: m && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
997
999
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
998
- /* @__PURE__ */ u("span", { className: "text-sm text-stone", children: [
1000
+ /* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
999
1001
  "Loading ",
1000
- a,
1002
+ i,
1001
1003
  "..."
1002
1004
  ] })
1003
- ] }) }) : y.length === 0 ? /* @__PURE__ */ u("div", { className: "p-6 text-center", children: [
1005
+ ] }) }) : C.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
1004
1006
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(de, { className: "h-8 w-8 text-charcoal" }) }),
1005
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: o ? `No ${a} found` : v.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1006
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: o ? "Try a different search term" : v.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1007
- ] }) : /* @__PURE__ */ u("ul", { className: "space-y-0", children: [
1008
- y.map((c) => {
1009
- const g = c.name || c.email || c.id, b = c.email && c.name ? c.email : c.phone;
1007
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: o ? `No ${i} found` : I.length > 0 ? `Already chatting with all ${i}` : `No ${i} yet` }),
1008
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: o ? "Try a different search term" : I.length > 0 ? `You have existing conversations with all your ${i}` : `${i.charAt(0).toUpperCase() + i.slice(1)} will appear here` })
1009
+ ] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
1010
+ C.map((u) => {
1011
+ const f = u.name || u.email || u.id, x = u.email && u.name ? u.email : u.phone;
1010
1012
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1011
1013
  "button",
1012
1014
  {
1013
1015
  type: "button",
1014
- onClick: () => F(c),
1015
- onKeyDown: (D) => M(D, c),
1016
+ onClick: () => T(u),
1017
+ onKeyDown: (D) => p(D, u),
1016
1018
  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",
1017
- children: /* @__PURE__ */ u("div", { className: "flex items-center justify-between", children: [
1018
- /* @__PURE__ */ u("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1019
+ children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1020
+ /* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1019
1021
  /* @__PURE__ */ e(
1020
- Y,
1022
+ J,
1021
1023
  {
1022
- id: c.id,
1023
- name: g,
1024
- image: c.image,
1024
+ id: u.id,
1025
+ name: f,
1026
+ image: u.image,
1025
1027
  size: 40
1026
1028
  }
1027
1029
  ),
1028
- /* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
1029
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: g }),
1030
- b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1030
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
1031
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: f }),
1032
+ x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
1031
1033
  ] })
1032
1034
  ] }),
1033
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: f === c.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
1035
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: E === u.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
1034
1036
  ] })
1035
1037
  }
1036
- ) }, c.id);
1038
+ ) }, u.id);
1037
1039
  }),
1038
- h && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ u("div", { className: "flex items-center space-x-2", children: [
1040
+ m && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1039
1041
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1040
1042
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1041
1043
  ] }) })
1042
1044
  ] }) })
1043
1045
  ] });
1044
- }, as = ({ hasChannels: t, onStartConversation: s, participantLabel: n }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
1046
+ }, is = ({ hasChannels: t, onStartConversation: s, participantLabel: n }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1045
1047
  /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-primary-alt/10 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "💬" }) }),
1046
1048
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal", children: "Welcome to Messages" }),
1047
- /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t ? /* @__PURE__ */ u(se, { children: [
1049
+ /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t ? /* @__PURE__ */ c(se, { children: [
1048
1050
  "Choose a conversation from the list or",
1049
1051
  " ",
1050
- s && /* @__PURE__ */ u(me, { onClick: s, children: [
1052
+ s && /* @__PURE__ */ c(me, { onClick: s, children: [
1051
1053
  "start a new conversation with a ",
1052
1054
  n.slice(0, -1),
1053
1055
  "."
1054
1056
  ] })
1055
- ] }) : s && /* @__PURE__ */ u(se, { children: [
1056
- /* @__PURE__ */ u(me, { onClick: s, children: [
1057
+ ] }) : s && /* @__PURE__ */ c(se, { children: [
1058
+ /* @__PURE__ */ c(me, { onClick: s, children: [
1057
1059
  "Start a new conversation with one of your ",
1058
1060
  n
1059
1061
  ] }),
@@ -1071,7 +1073,7 @@ const os = ({
1071
1073
  className: "inline-flex items-center gap-1 text-sm font-medium text-primary hover:text-primary-alt focus:outline-none focus:ring-2 focus:ring-primary",
1072
1074
  children: s
1073
1075
  }
1074
- ), le = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
1076
+ ), le = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1075
1077
  /* @__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: "⚠️" }) }),
1076
1078
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1077
1079
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1084,12 +1086,12 @@ const os = ({
1084
1086
  children: "Go Back"
1085
1087
  }
1086
1088
  )
1087
- ] }) }), is = ({ className: t, message: s }) => /* @__PURE__ */ u(
1089
+ ] }) }), cs = ({ className: t, message: s }) => /* @__PURE__ */ c(
1088
1090
  "div",
1089
1091
  {
1090
- className: S("flex items-center justify-center h-full", t),
1092
+ className: R("flex items-center justify-center h-full", t),
1091
1093
  children: [
1092
- /* @__PURE__ */ u("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1094
+ /* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1093
1095
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
1094
1096
  "animateTransform",
1095
1097
  {
@@ -1127,86 +1129,87 @@ const os = ({
1127
1129
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1128
1130
  ]
1129
1131
  }
1130
- ), cs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ u("div", { className: "flex items-center", children: [
1131
- /* @__PURE__ */ e(is, { className: "w-6 h-6" }),
1132
+ ), ds = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1133
+ /* @__PURE__ */ e(cs, { className: "w-6 h-6" }),
1132
1134
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1133
- ] }) }), bs = ({
1135
+ ] }) }), vs = ({
1134
1136
  capabilities: t = {},
1135
1137
  className: s,
1136
1138
  renderMessageInputActions: n,
1137
1139
  onChannelSelect: r,
1138
- onParticipantSelect: a,
1140
+ onParticipantSelect: i,
1139
1141
  initialParticipantFilter: d,
1140
- initialParticipantData: i,
1142
+ initialParticipantData: a,
1141
1143
  CustomChannelEmptyState: l,
1142
1144
  showChannelList: o = !0,
1143
- filters: E
1145
+ filters: w,
1146
+ channelListCustomEmptyStateIndicator: I
1144
1147
  }) => {
1145
1148
  const {
1146
- service: v,
1149
+ service: N,
1147
1150
  client: m,
1148
- isConnected: h,
1149
- isLoading: T,
1150
- error: x,
1151
- refreshConnection: C,
1152
- debug: f
1153
- } = We(), [R, I] = w(null), [y, F] = w(!1), [M, c] = w(!1), [g, b] = w(/* @__PURE__ */ new Set()), [D, W] = w(0), [p, A] = w(!1), [J, H] = w(null), G = z(null), {
1154
- showStartConversation: Q = !1,
1155
- participantSource: V,
1156
- participantLabel: k = "participants"
1157
- } = t, O = q.useMemo(() => {
1158
- const N = m == null ? void 0 : m.userID;
1151
+ isConnected: S,
1152
+ isLoading: g,
1153
+ error: b,
1154
+ refreshConnection: E,
1155
+ debug: v
1156
+ } = qe(), [F, C] = y(null), [T, p] = y(!1), [u, f] = y(!1), [x, D] = y(/* @__PURE__ */ new Set()), [q, _] = y(0), [O, W] = y(!1), [Q, G] = y(null), V = $(null), {
1157
+ showStartConversation: X = !1,
1158
+ participantSource: k,
1159
+ participantLabel: M = "participants"
1160
+ } = t, A = Y.useMemo(() => {
1161
+ const h = m == null ? void 0 : m.userID;
1159
1162
  return {
1160
1163
  ...{
1161
1164
  type: "messaging",
1162
1165
  last_message_at: { $exists: !0 },
1163
- ...N && {
1164
- members: { $in: [N] },
1166
+ ...h && {
1167
+ members: { $in: [h] },
1165
1168
  hidden: !1
1166
1169
  }
1167
1170
  },
1168
- ...E
1171
+ ...w
1169
1172
  };
1170
- }, [E, m == null ? void 0 : m.userID]), _ = z(null), j = P(async () => {
1171
- if (!m || !h) return;
1172
- const N = m.userID;
1173
- if (N)
1173
+ }, [w, m == null ? void 0 : m.userID]), j = $(null), B = P(async () => {
1174
+ if (!m || !S) return;
1175
+ const h = m.userID;
1176
+ if (h)
1174
1177
  try {
1175
- f && console.log("[MessagingShell] Syncing channels for user:", N);
1178
+ v && console.log("[MessagingShell] Syncing channels for user:", h);
1176
1179
  const L = await m.queryChannels(
1177
1180
  {
1178
1181
  type: "messaging",
1179
- members: { $in: [N] }
1182
+ members: { $in: [h] }
1180
1183
  },
1181
1184
  {},
1182
1185
  { limit: 100 }
1183
1186
  ), U = /* @__PURE__ */ new Set();
1184
- L.forEach((B) => {
1185
- const Ie = B.state.members;
1186
- Object.values(Ie).forEach((Se) => {
1187
+ L.forEach((z) => {
1188
+ const Se = z.state.members;
1189
+ Object.values(Se).forEach((ke) => {
1187
1190
  var oe;
1188
- const re = (oe = Se.user) == null ? void 0 : oe.id;
1189
- re && re !== N && U.add(re);
1191
+ const re = (oe = ke.user) == null ? void 0 : oe.id;
1192
+ re && re !== h && U.add(re);
1190
1193
  });
1191
- }), b(U), F(L.length > 0), _.current = N, f && console.log("[MessagingShell] Channels synced successfully:", {
1194
+ }), D(U), p(L.length > 0), j.current = h, v && console.log("[MessagingShell] Channels synced successfully:", {
1192
1195
  channelCount: L.length,
1193
1196
  memberCount: U.size
1194
1197
  });
1195
1198
  } catch (L) {
1196
1199
  console.error("[MessagingShell] Failed to sync channels:", L);
1197
1200
  }
1198
- }, [m, h, f]);
1199
- $(() => {
1200
- if (!m || !h) return;
1201
- const N = m.userID;
1202
- N && _.current !== N && j();
1203
- }, [m, h, j]), $(() => {
1204
- if (!d || !m || !h) return;
1201
+ }, [m, S, v]);
1202
+ H(() => {
1203
+ if (!m || !S) return;
1204
+ const h = m.userID;
1205
+ h && j.current !== h && B();
1206
+ }, [m, S, B]), H(() => {
1207
+ if (!d || !m || !S) return;
1205
1208
  (async () => {
1206
1209
  const L = m.userID;
1207
1210
  if (L)
1208
1211
  try {
1209
- f && console.log(
1212
+ v && console.log(
1210
1213
  "[MessagingShell] Loading initial conversation with:",
1211
1214
  d
1212
1215
  );
@@ -1219,36 +1222,36 @@ const os = ({
1219
1222
  { limit: 1 }
1220
1223
  );
1221
1224
  if (U.length > 0)
1222
- I(U[0]), A(!0), H(null), r && r(U[0]), f && console.log(
1225
+ C(U[0]), W(!0), G(null), r && r(U[0]), v && console.log(
1223
1226
  "[MessagingShell] Initial conversation loaded:",
1224
1227
  U[0].id
1225
1228
  );
1226
- else if (i && v) {
1227
- f && console.log(
1229
+ else if (a && N) {
1230
+ v && console.log(
1228
1231
  "[MessagingShell] No conversation found, creating one for:",
1229
- i
1232
+ a
1230
1233
  );
1231
1234
  try {
1232
- const B = await v.startChannelWithParticipant({
1233
- id: i.id,
1234
- name: i.name,
1235
- email: i.email,
1236
- phone: i.phone
1235
+ const z = await N.startChannelWithParticipant({
1236
+ id: a.id,
1237
+ name: a.name,
1238
+ email: a.email,
1239
+ phone: a.phone
1237
1240
  });
1238
- I(B), A(!0), H(null), r && r(B), f && console.log(
1241
+ C(z), W(!0), G(null), r && r(z), v && console.log(
1239
1242
  "[MessagingShell] Channel created and loaded:",
1240
- B.id
1243
+ z.id
1241
1244
  );
1242
- } catch (B) {
1245
+ } catch (z) {
1243
1246
  console.error(
1244
1247
  "[MessagingShell] Failed to create conversation:",
1245
- B
1246
- ), H("Failed to create conversation");
1248
+ z
1249
+ ), G("Failed to create conversation");
1247
1250
  }
1248
1251
  } else
1249
- H(
1252
+ G(
1250
1253
  "No conversation found with this account"
1251
- ), f && console.log(
1254
+ ), v && console.log(
1252
1255
  "[MessagingShell] No conversation found for:",
1253
1256
  d
1254
1257
  );
@@ -1256,103 +1259,104 @@ const os = ({
1256
1259
  console.error(
1257
1260
  "[MessagingShell] Failed to load initial conversation:",
1258
1261
  U
1259
- ), H("Failed to load conversation");
1262
+ ), G("Failed to load conversation");
1260
1263
  }
1261
1264
  })();
1262
1265
  }, [
1263
1266
  d,
1264
- i,
1267
+ a,
1265
1268
  m,
1266
- h,
1269
+ S,
1270
+ N,
1267
1271
  v,
1268
- f,
1269
1272
  r
1270
1273
  ]);
1271
- const X = P(
1272
- (N) => {
1273
- I(N), r == null || r(N);
1274
+ const ve = P(
1275
+ (h) => {
1276
+ C(h), r == null || r(h);
1274
1277
  },
1275
1278
  [r]
1276
- ), ve = P(() => {
1277
- p || I(null);
1278
- }, [p]), Ce = P(() => {
1279
- var N;
1280
- V && (W((L) => L + 1), c(!0), (N = G.current) == null || N.showModal());
1281
- }, [V]), we = P(
1282
- async (N) => {
1279
+ ), Ce = P(() => {
1280
+ O || C(null);
1281
+ }, [O]), we = P(() => {
1282
+ var h;
1283
+ k && (_((L) => L + 1), f(!0), (h = V.current) == null || h.showModal());
1284
+ }, [k]), Ee = P(
1285
+ async (h) => {
1283
1286
  var L;
1284
- if (v)
1287
+ if (N)
1285
1288
  try {
1286
- f && console.log(
1289
+ v && console.log(
1287
1290
  "[MessagingShell] Starting conversation with:",
1288
- N.id
1291
+ h.id
1289
1292
  );
1290
- const U = await v.startChannelWithParticipant({
1291
- id: N.id,
1292
- name: N.name,
1293
- email: N.email,
1294
- phone: N.phone
1293
+ const U = await N.startChannelWithParticipant({
1294
+ id: h.id,
1295
+ name: h.name,
1296
+ email: h.email,
1297
+ phone: h.phone
1295
1298
  });
1296
1299
  try {
1297
1300
  await U.show();
1298
- } catch (B) {
1299
- console.warn("[MessagingShell] Failed to unhide channel:", B);
1301
+ } catch (z) {
1302
+ console.warn("[MessagingShell] Failed to unhide channel:", z);
1300
1303
  }
1301
- I(U), c(!1), (L = G.current) == null || L.close(), a == null || a(N);
1304
+ C(U), f(!1), (L = V.current) == null || L.close(), i == null || i(h);
1302
1305
  } catch (U) {
1303
1306
  console.error("[MessagingShell] Failed to start conversation:", U);
1304
1307
  }
1305
1308
  },
1306
- [v, a, f]
1309
+ [N, i, v]
1307
1310
  ), te = P(() => {
1308
- var N;
1309
- c(!1), (N = G.current) == null || N.close();
1310
- }, []), Ee = P(
1311
- async (N) => {
1312
- f && console.log("[MessagingShell] Leaving conversation:", N.id), I(null), A(!1), _.current = null, await j();
1311
+ var h;
1312
+ f(!1), (h = V.current) == null || h.close();
1313
+ }, []), ye = P(
1314
+ async (h) => {
1315
+ v && console.log("[MessagingShell] Leaving conversation:", h.id), C(null), W(!1), j.current = null, await B();
1313
1316
  },
1314
- [j, f]
1315
- ), ye = P(
1316
- async (N) => {
1317
- f && console.log("[MessagingShell] Blocking participant:", N), I(null), A(!1), _.current = null, await j();
1317
+ [B, v]
1318
+ ), Ie = P(
1319
+ async (h) => {
1320
+ v && console.log("[MessagingShell] Blocking participant:", h), C(null), W(!1), j.current = null, await B();
1318
1321
  },
1319
- [j, f]
1320
- ), Z = !!R;
1321
- return T ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(cs, {}) }) : x ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(le, { message: x, onBack: C }) }) : !h || !m ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(
1322
+ [B, v]
1323
+ ), Z = !!F;
1324
+ return g ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(ds, {}) }) : b ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(le, { message: b, onBack: E }) }) : !S || !m ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1322
1325
  le,
1323
1326
  {
1324
1327
  message: "Not connected to messaging service",
1325
- onBack: C
1328
+ onBack: E
1326
1329
  }
1327
- ) }) : J ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ u(
1330
+ ) }) : Q ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(le, { message: Q }) }) : /* @__PURE__ */ c(
1328
1331
  "div",
1329
1332
  {
1330
- className: S(
1333
+ className: R(
1331
1334
  "messaging-shell h-full bg-white overflow-hidden",
1332
1335
  s
1333
1336
  ),
1334
1337
  children: [
1335
- /* @__PURE__ */ u("div", { className: "flex h-full min-h-0", children: [
1338
+ /* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
1336
1339
  /* @__PURE__ */ e(
1337
1340
  "div",
1338
1341
  {
1339
- className: S(
1342
+ className: R(
1340
1343
  "messaging-channel-list-sidebar min-h-0 min-w-0 bg-white lg:bg-chalk lg:flex lg:flex-col lg:border-r lg:border-sand",
1341
1344
  {
1342
1345
  // Explicitly hidden via prop or in direct conversation mode
1343
- "!hidden": o === !1 || p,
1346
+ "!hidden": o === !1 || O,
1344
1347
  // Normal mode: hide on mobile when channel selected, show on desktop
1345
- "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": o !== !1 && !p && Z,
1348
+ "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": o !== !1 && !O && Z,
1346
1349
  // Normal mode: show when no channel selected
1347
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": o !== !1 && !p && !Z
1350
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": o !== !1 && !O && !Z
1348
1351
  }
1349
1352
  ),
1350
1353
  children: /* @__PURE__ */ e(
1351
- Ze,
1354
+ Ke,
1352
1355
  {
1353
- onChannelSelect: X,
1354
- selectedChannel: R || void 0,
1355
- filters: O
1356
+ onChannelSelect: ve,
1357
+ selectedChannel: F || void 0,
1358
+ filters: A,
1359
+ customEmptyStateIndicator: I
1356
1360
  }
1357
1361
  )
1358
1362
  }
@@ -1360,66 +1364,66 @@ const os = ({
1360
1364
  /* @__PURE__ */ e(
1361
1365
  "div",
1362
1366
  {
1363
- className: S(
1367
+ className: R(
1364
1368
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1365
1369
  {
1366
1370
  // In direct conversation mode, always show (full width)
1367
- flex: p || Z,
1371
+ flex: O || Z,
1368
1372
  // Normal mode: hide on mobile when no channel selected
1369
- "hidden lg:flex": !p && !Z
1373
+ "hidden lg:flex": !O && !Z
1370
1374
  }
1371
1375
  ),
1372
- children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1373
- rs,
1376
+ children: F ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1377
+ ls,
1374
1378
  {
1375
- channel: R,
1376
- onBack: ve,
1377
- showBackButton: !p,
1379
+ channel: F,
1380
+ onBack: Ce,
1381
+ showBackButton: !O,
1378
1382
  renderMessageInputActions: n,
1379
- onLeaveConversation: Ee,
1380
- onBlockParticipant: ye,
1383
+ onLeaveConversation: ye,
1384
+ onBlockParticipant: Ie,
1381
1385
  CustomChannelEmptyState: l
1382
1386
  },
1383
- R.id
1387
+ F.id
1384
1388
  ) }) : /* @__PURE__ */ e(
1385
- as,
1389
+ is,
1386
1390
  {
1387
- hasChannels: y,
1388
- onStartConversation: Q ? Ce : void 0,
1389
- participantLabel: k
1391
+ hasChannels: T,
1392
+ onStartConversation: X ? we : void 0,
1393
+ participantLabel: M
1390
1394
  }
1391
1395
  )
1392
1396
  }
1393
1397
  )
1394
1398
  ] }),
1395
- V && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1399
+ k && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1396
1400
  /* @__PURE__ */ e(
1397
1401
  "dialog",
1398
1402
  {
1399
- ref: G,
1403
+ ref: V,
1400
1404
  className: "mes-dialog",
1401
- onClick: (N) => {
1402
- N.target === G.current && te();
1405
+ onClick: (h) => {
1406
+ h.target === V.current && te();
1403
1407
  },
1404
1408
  onClose: te,
1405
1409
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1406
- os,
1410
+ as,
1407
1411
  {
1408
- participantSource: V,
1409
- onSelectParticipant: we,
1412
+ participantSource: k,
1413
+ onSelectParticipant: Ee,
1410
1414
  onClose: te,
1411
- existingParticipantIds: g,
1412
- participantLabel: k,
1413
- searchPlaceholder: `Search ${k}...`
1415
+ existingParticipantIds: x,
1416
+ participantLabel: M,
1417
+ searchPlaceholder: `Search ${M}...`
1414
1418
  },
1415
- D
1419
+ q
1416
1420
  ) })
1417
1421
  }
1418
1422
  )
1419
1423
  ]
1420
1424
  }
1421
1425
  );
1422
- }, ds = ({
1426
+ }, us = ({
1423
1427
  question: t,
1424
1428
  onClick: s,
1425
1429
  loading: n = !1,
@@ -1431,7 +1435,7 @@ const os = ({
1431
1435
  onClick: s,
1432
1436
  disabled: n,
1433
1437
  style: { backgroundColor: "#E6E5E3" },
1434
- className: S(
1438
+ className: R(
1435
1439
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1436
1440
  {
1437
1441
  "hover:brightness-95 active:brightness-90": !n,
@@ -1441,27 +1445,27 @@ const os = ({
1441
1445
  ),
1442
1446
  children: t
1443
1447
  }
1444
- ), vs = ({
1448
+ ), Cs = ({
1445
1449
  faqs: t,
1446
1450
  onFaqClick: s,
1447
1451
  loadingFaqId: n,
1448
1452
  headerText: r,
1449
- className: a,
1453
+ className: i,
1450
1454
  avatarImage: d,
1451
- avatarName: i
1455
+ avatarName: a
1452
1456
  }) => {
1453
- const l = t.filter((o) => o.enabled).sort((o, E) => (o.order ?? 0) - (E.order ?? 0));
1454
- return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: S("px-4 py-6", a), children: /* @__PURE__ */ u("div", { className: "flex gap-3 items-end", children: [
1455
- (d || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1456
- Y,
1457
+ const l = t.filter((o) => o.enabled).sort((o, w) => (o.order ?? 0) - (w.order ?? 0));
1458
+ return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: R("px-4 py-6", i), children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
1459
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1460
+ J,
1457
1461
  {
1458
- id: i || "account",
1459
- name: i || "Account",
1462
+ id: a || "account",
1463
+ name: a || "Account",
1460
1464
  image: d,
1461
1465
  size: 24
1462
1466
  }
1463
1467
  ) }),
1464
- /* @__PURE__ */ u(
1468
+ /* @__PURE__ */ c(
1465
1469
  "div",
1466
1470
  {
1467
1471
  className: "flex-1 rounded-lg p-4 space-y-3",
@@ -1469,7 +1473,7 @@ const os = ({
1469
1473
  children: [
1470
1474
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1471
1475
  l.map((o) => /* @__PURE__ */ e(
1472
- ds,
1476
+ us,
1473
1477
  {
1474
1478
  question: o.question,
1475
1479
  onClick: () => s(o.id),
@@ -1481,59 +1485,59 @@ const os = ({
1481
1485
  }
1482
1486
  )
1483
1487
  ] }) });
1484
- }, Cs = (t, s = {}) => {
1485
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, d] = w([]), [i, l] = w(!1), [o, E] = w(null), [v, m] = w(n), [h, T] = w(!0), [x, C] = w(), f = P(async (F = !1, M) => {
1486
- if (i) return;
1487
- const c = M !== void 0 ? M : v;
1488
- l(!0), E(null);
1488
+ }, ws = (t, s = {}) => {
1489
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [i, d] = y([]), [a, l] = y(!1), [o, w] = y(null), [I, N] = y(n), [m, S] = y(!0), [g, b] = y(), E = P(async (T = !1, p) => {
1490
+ if (a) return;
1491
+ const u = p !== void 0 ? p : I;
1492
+ l(!0), w(null);
1489
1493
  try {
1490
- const g = await t.loadParticipants({
1491
- search: c || void 0,
1494
+ const f = await t.loadParticipants({
1495
+ search: u || void 0,
1492
1496
  limit: r,
1493
- cursor: F ? void 0 : x
1497
+ cursor: T ? void 0 : g
1494
1498
  });
1495
1499
  d(
1496
- (b) => F ? g.participants : [...b, ...g.participants]
1497
- ), T(g.hasMore), C(g.nextCursor);
1498
- } catch (g) {
1499
- const b = g instanceof Error ? g.message : "Failed to load participants";
1500
- E(b), console.error("[useParticipants] Load error:", g);
1500
+ (x) => T ? f.participants : [...x, ...f.participants]
1501
+ ), S(f.hasMore), b(f.nextCursor);
1502
+ } catch (f) {
1503
+ const x = f instanceof Error ? f.message : "Failed to load participants";
1504
+ w(x), console.error("[useParticipants] Load error:", f);
1501
1505
  } finally {
1502
1506
  l(!1);
1503
1507
  }
1504
- }, [t, v, x, r, i]), R = P(() => {
1505
- h && !i && f(!1);
1506
- }, [h, i, f]), I = P((F) => {
1507
- m(F), C(void 0), f(!0, F);
1508
- }, [f]), y = P(() => {
1509
- C(void 0), f(!0);
1510
- }, [f]);
1511
- return $(() => {
1512
- f(!0);
1508
+ }, [t, I, g, r, a]), v = P(() => {
1509
+ m && !a && E(!1);
1510
+ }, [m, a, E]), F = P((T) => {
1511
+ N(T), b(void 0), E(!0, T);
1512
+ }, [E]), C = P(() => {
1513
+ b(void 0), E(!0);
1514
+ }, [E]);
1515
+ return H(() => {
1516
+ E(!0);
1513
1517
  }, [t.loadParticipants]), {
1514
- participants: a,
1515
- loading: i,
1518
+ participants: i,
1519
+ loading: a,
1516
1520
  error: o,
1517
- searchQuery: v,
1518
- hasMore: h,
1521
+ searchQuery: I,
1522
+ hasMore: m,
1519
1523
  totalCount: t.totalCount,
1520
- loadMore: R,
1521
- search: I,
1522
- refresh: y
1524
+ loadMore: v,
1525
+ search: F,
1526
+ refresh: C
1523
1527
  };
1524
1528
  };
1525
1529
  export {
1526
- Y as Avatar,
1530
+ J as Avatar,
1527
1531
  be as ChannelEmptyState,
1528
- Ze as ChannelList,
1529
- rs as ChannelView,
1530
- vs as FaqList,
1531
- ds as FaqListItem,
1532
- Ns as MessagingProvider,
1533
- bs as MessagingShell,
1534
- os as ParticipantPicker,
1535
- Ye as formatRelativeTime,
1536
- We as useMessaging,
1537
- Cs as useParticipants
1532
+ Ke as ChannelList,
1533
+ ls as ChannelView,
1534
+ Cs as FaqList,
1535
+ us as FaqListItem,
1536
+ bs as MessagingProvider,
1537
+ vs as MessagingShell,
1538
+ as as ParticipantPicker,
1539
+ Je as formatRelativeTime,
1540
+ qe as useMessaging,
1541
+ ws as useParticipants
1538
1542
  };
1539
1543
  //# sourceMappingURL=index.js.map