@linktr.ee/messaging-react 1.12.8-rc-1766045447 โ†’ 1.12.8-rc-1766058614

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,5 +1,5 @@
1
1
  import { jsx as e, jsxs as i, Fragment as we } from "react/jsx-runtime";
2
- import k from "classnames";
2
+ import R from "classnames";
3
3
  import U, { createContext as ye, useContext as Ee, useCallback as D, useState as y, useRef as z, useEffect as G } from "react";
4
4
  import { StreamChatService as $e } from "@linktr.ee/messaging-core";
5
5
  import { Chat as Ge, ChannelList as He, useMessageComposer as Ie, useStateStore as Ve, MessageInput as We, useMessageInputContext as Ze, useMessageComposerHasSendableData as qe, useChannelStateContext as ue, SimpleAttachmentSelector as Ye, QuotedMessagePreview as Je, AttachmentPreviewList as Qe, TextareaComposer as Xe, MessageTimestamp as Ke, Channel as es, Window as ss, MessageList as ts } from "stream-chat-react";
@@ -24,8 +24,8 @@ const Se = ye({
24
24
  debug: o = !1
25
25
  }) => {
26
26
  const l = D(
27
- (m, ...x) => {
28
- o && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...x);
27
+ (u, ...x) => {
28
+ o && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...x);
29
29
  },
30
30
  [o]
31
31
  );
@@ -35,14 +35,14 @@ const Se = ye({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(a)
37
37
  });
38
- const [h, f] = y(null), [g, N] = y(null), [c, E] = y(!1), [R, I] = y(!1), [w, C] = y(null), u = z(!1), b = z({
38
+ const [m, f] = y(null), [g, E] = y(null), [d, N] = y(!1), [w, S] = y(!1), [I, C] = y(null), h = z(!1), b = z({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: a
43
- }), S = z(0);
44
- S.current++, l("๐Ÿ“Š RENDER INFO", {
45
- renderCount: S.current,
43
+ }), p = z(0);
44
+ p.current++, l("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: p.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: b.current.userId !== (s == null ? void 0 : s.id),
@@ -56,9 +56,9 @@ const Se = ye({
56
56
  serviceConfig: n,
57
57
  capabilities: a
58
58
  }, G(() => {
59
- const m = S.current;
59
+ const u = p.current;
60
60
  if (l("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: m,
61
+ renderCount: u,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
@@ -69,13 +69,13 @@ const Se = ye({
69
69
  }
70
70
  }), !r || !n) {
71
71
  l("โš ๏ธ SERVICE INIT SKIPPED", {
72
- renderCount: m,
72
+ renderCount: u,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  l("๐Ÿš€ CREATING NEW SERVICE", {
78
- renderCount: m,
78
+ renderCount: u,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: b.current.serviceConfig !== n
81
81
  });
@@ -85,34 +85,34 @@ const Se = ye({
85
85
  debug: o
86
86
  });
87
87
  return f(x), l("โœ… SERVICE SET", {
88
- renderCount: m,
88
+ renderCount: u,
89
89
  serviceInstance: !!x
90
90
  }), () => {
91
91
  l("๐Ÿงน SERVICE CLEANUP", {
92
- renderCount: m,
92
+ renderCount: u,
93
93
  reason: "Effect cleanup"
94
94
  }), x.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [r, n, o, l]);
97
- const p = z(null);
97
+ const k = z(null);
98
98
  G(() => {
99
99
  var x, B;
100
100
  if (l("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!h,
101
+ hasService: !!m,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: u.current,
105
- isConnected: c,
106
- dependencies: { service: !!h, userId: s == null ? void 0 : s.id }
107
- }), !h || !s) {
104
+ isConnecting: h.current,
105
+ isConnected: d,
106
+ dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
+ }), !m || !s) {
108
108
  l("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (u.current) {
111
+ if (h.current) {
112
112
  l("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((x = p.current) == null ? void 0 : x.serviceId) === h && ((B = p.current) == null ? void 0 : B.userId) === s.id) {
115
+ if (((x = k.current) == null ? void 0 : x.serviceId) === m && ((B = k.current) == null ? void 0 : B.userId) === s.id) {
116
116
  l(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,11 +120,11 @@ const Se = ye({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- l("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), u.current = !0, I(!0), C(null);
123
+ l("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), h.current = !0, S(!0), C(null);
124
124
  try {
125
125
  l("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const A = await h.connectUser(s);
127
- N(A), E(!0), p.current = { serviceId: h, userId: s.id }, l("โœ… USER CONNECTION SUCCESS", {
126
+ const A = await m.connectUser(s);
127
+ E(A), N(!0), k.current = { serviceId: m, userId: s.id }, l("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: A.userID
130
130
  });
@@ -135,78 +135,78 @@ const Se = ye({
135
135
  error: H
136
136
  });
137
137
  } finally {
138
- I(!1), u.current = !1, l("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ S(!1), h.current = !1, l("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: c
140
+ isConnected: d
141
141
  });
142
142
  }
143
143
  })();
144
- }, [h, s, l, c]), G(() => (l("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
- hasService: !!h,
146
- isConnected: c
144
+ }, [m, s, l, d]), G(() => (l("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!m,
146
+ isConnected: d
147
147
  }), () => {
148
- h && c ? (l(
148
+ m && d ? (l(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), p.current = null, h.disconnectUser().catch(console.error)) : l("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
- hasService: !!h,
153
- isConnected: c
151
+ ), k.current = null, m.disconnectUser().catch(console.error)) : l("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!m,
153
+ isConnected: d
154
154
  });
155
- }), [h, c, l]);
155
+ }), [m, d, l]);
156
156
  const T = D(async () => {
157
157
  if (l("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
- hasService: !!h,
158
+ hasService: !!m,
159
159
  hasUser: !!s
160
- }), !h || !s) {
160
+ }), !m || !s) {
161
161
  l("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- l("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), I(!0);
164
+ l("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), S(!0);
165
165
  try {
166
- l("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await h.disconnectUser(), l("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
- const m = await h.connectUser(s);
168
- N(m), E(!0), C(null), l("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (m) {
170
- const x = m instanceof Error ? m.message : "Refresh failed";
166
+ l("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await m.disconnectUser(), l("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
+ const u = await m.connectUser(s);
168
+ E(u), N(!0), C(null), l("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (u) {
170
+ const x = u instanceof Error ? u.message : "Refresh failed";
171
171
  C(x), l("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
173
  error: x
174
174
  });
175
175
  } finally {
176
- I(!1), l("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ S(!1), l("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [h, s, l]), d = U.useMemo(() => (l("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!h,
178
+ }, [m, s, l]), c = U.useMemo(() => (l("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!m,
180
180
  hasClient: !!g,
181
- isConnected: c,
182
- isLoading: R,
183
- hasError: !!w,
181
+ isConnected: d,
182
+ isLoading: w,
183
+ hasError: !!I,
184
184
  capabilitiesKeys: Object.keys(a)
185
185
  }), {
186
- service: h,
186
+ service: m,
187
187
  client: g,
188
- isConnected: c,
189
- isLoading: R,
190
- error: w,
188
+ isConnected: d,
189
+ isLoading: w,
190
+ error: I,
191
191
  capabilities: a,
192
192
  refreshConnection: T,
193
193
  debug: o
194
194
  }), [
195
- h,
195
+ m,
196
196
  g,
197
- c,
198
- R,
197
+ d,
199
198
  w,
199
+ I,
200
200
  a,
201
201
  T,
202
202
  o,
203
203
  l
204
204
  ]);
205
205
  return l("๐Ÿ”„ RENDER END", {
206
- renderCount: S.current,
207
- willRenderChat: !!(g && c),
208
- contextValueReady: !!d
209
- }), /* @__PURE__ */ e(Se.Provider, { value: d, children: g && c ? /* @__PURE__ */ e(
206
+ renderCount: p.current,
207
+ willRenderChat: !!(g && d),
208
+ contextValueReady: !!c
209
+ }), /* @__PURE__ */ e(Se.Provider, { value: c, children: g && d ? /* @__PURE__ */ e(
210
210
  Ge,
211
211
  {
212
212
  client: g,
@@ -284,14 +284,14 @@ const Z = ({
284
284
  className: r,
285
285
  shape: a = "squircle"
286
286
  }) => {
287
- const o = ms(t), h = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", f = a === "circle" ? { borderRadius: "50%" } : {
287
+ const o = ms(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", f = a === "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: k("flex-shrink-0 overflow-hidden", r),
294
+ className: R("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
@@ -308,9 +308,9 @@ const Z = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: k(
311
+ className: R(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- h
313
+ m
314
314
  ),
315
315
  children: o
316
316
  }
@@ -319,32 +319,32 @@ const Z = ({
319
319
  );
320
320
  }, pe = U.memo(
321
321
  ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
322
- var C, u, b, S, p, T;
322
+ var C, h, b, p, k, T;
323
323
  const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
324
324
  t && n(t);
325
325
  }, f = Object.values(((C = t == null ? void 0 : t.state) == null ? void 0 : C.members) || {}).find(
326
- (d) => {
327
- var m, x;
328
- return ((m = d.user) == null ? void 0 : m.id) && d.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
326
+ (c) => {
327
+ var u, x;
328
+ return ((u = c.user) == null ? void 0 : u.id) && c.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
329
329
  }
330
- ), g = ((u = f == null ? void 0 : f.user) == null ? void 0 : u.name) || "Conversation", N = (b = f == null ? void 0 : f.user) == null ? void 0 : b.image, c = (p = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : p[t.state.messages.length - 1], R = (() => {
331
- var m;
332
- if (c != null && c.text) return c.text;
333
- const d = (m = c == null ? void 0 : c.attachments) == null ? void 0 : m[0];
334
- return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "๐Ÿ“ท Sent an image" : d.type === "video" ? "๐ŸŽฅ Sent a video" : d.type === "audio" ? "๐ŸŽต Sent audio" : d.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
335
- })(), I = c != null && c.created_at ? cs(new Date(c.created_at)) : "", w = a ?? 0;
330
+ ), g = ((h = f == null ? void 0 : f.user) == null ? void 0 : h.name) || "Conversation", E = (b = f == null ? void 0 : f.user) == null ? void 0 : b.image, d = (k = (p = t == null ? void 0 : t.state) == null ? void 0 : p.messages) == null ? void 0 : k[t.state.messages.length - 1], w = (() => {
331
+ var u;
332
+ if (d != null && d.text) return d.text;
333
+ const c = (u = d == null ? void 0 : d.attachments) == null ? void 0 : u[0];
334
+ return c ? c.og_scrape_url ? c.og_scrape_url : c.type === "image" ? "๐Ÿ“ท Sent an image" : c.type === "video" ? "๐ŸŽฅ Sent a video" : c.type === "audio" ? "๐ŸŽต Sent audio" : c.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
335
+ })(), S = d != null && d.created_at ? cs(new Date(d.created_at)) : "", I = a ?? 0;
336
336
  return r && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
337
337
  channelId: t == null ? void 0 : t.id,
338
338
  isSelected: o,
339
339
  participantName: g,
340
- unreadCount: w,
341
- hasTimestamp: !!I
340
+ unreadCount: I,
341
+ hasTimestamp: !!S
342
342
  }), /* @__PURE__ */ e(
343
343
  "button",
344
344
  {
345
345
  type: "button",
346
346
  onClick: l,
347
- className: k(
347
+ className: R(
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": o,
@@ -357,7 +357,7 @@ const Z = ({
357
357
  {
358
358
  id: ((T = f == null ? void 0 : f.user) == null ? void 0 : T.id) || t.id || "unknown",
359
359
  name: g,
360
- image: N,
360
+ image: E,
361
361
  size: 44,
362
362
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
363
363
  }
@@ -367,18 +367,18 @@ const Z = ({
367
367
  /* @__PURE__ */ e(
368
368
  "h3",
369
369
  {
370
- className: k(
370
+ className: R(
371
371
  "text-sm font-medium truncate",
372
372
  o ? "text-primary" : "text-charcoal"
373
373
  ),
374
374
  children: g
375
375
  }
376
376
  ),
377
- I && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: I })
377
+ S && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: S })
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: R }),
381
- w > 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: w > 99 ? "99+" : w })
380
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: w }),
381
+ I > 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: I > 99 ? "99+" : I })
382
382
  ] })
383
383
  ] })
384
384
  ] })
@@ -403,7 +403,7 @@ const ke = U.memo(
403
403
  selectedChannelId: s == null ? void 0 : s.id,
404
404
  filters: n
405
405
  });
406
- const h = U.useMemo(() => (g) => /* @__PURE__ */ e(
406
+ const m = U.useMemo(() => (g) => /* @__PURE__ */ e(
407
407
  pe,
408
408
  {
409
409
  ...g,
@@ -415,7 +415,7 @@ const ke = U.memo(
415
415
  return /* @__PURE__ */ e(
416
416
  "div",
417
417
  {
418
- className: k(
418
+ className: R(
419
419
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
420
420
  r
421
421
  ),
@@ -425,7 +425,7 @@ const ke = U.memo(
425
425
  filters: n,
426
426
  sort: { last_message_at: -1 },
427
427
  options: { limit: 30 },
428
- Preview: h,
428
+ Preview: m,
429
429
  EmptyStateIndicator: a
430
430
  },
431
431
  JSON.stringify(n)
@@ -444,7 +444,7 @@ const ne = ({
444
444
  "button",
445
445
  {
446
446
  type: "button",
447
- className: k(
447
+ className: R(
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
@@ -458,7 +458,7 @@ function Re({ label: t, className: s, children: n, ...r }) {
458
458
  "button",
459
459
  {
460
460
  type: "button",
461
- className: k(
461
+ className: R(
462
462
  "rounded-full p-2 transition-colors focus-ring",
463
463
  {
464
464
  "cursor-not-allowed opacity-50": r.disabled,
@@ -564,47 +564,60 @@ const us = (t) => ({
564
564
  ] }), xs = () => {
565
565
  const { handleSubmit: t } = Ze(), s = qe(), { channel: n } = ue(), r = Ie(), { pendingAttachment: a, onClearPendingAttachment: o } = Ee(
566
566
  _e
567
- ), l = s || !!a, h = D(
568
- (g) => {
569
- g.key === "Enter" && !g.shiftKey && a && (g.preventDefault(), g.stopPropagation(), (async () => {
570
- var N;
571
- if (a && n)
572
- try {
573
- const c = ((N = r.textComposer.text) == null ? void 0 : N.trim()) || "";
574
- await n.sendMessage({
575
- text: c,
576
- attachments: [a]
577
- }), r.textComposer.setText(""), o == null || o();
578
- } catch (c) {
579
- console.error("Failed to send message with attachment:", c);
567
+ ), [l, m] = y(!1), f = (s || !!a) && !l, g = D(
568
+ (d) => {
569
+ if (d.key === "Enter" && !d.shiftKey && a) {
570
+ if (d.preventDefault(), d.stopPropagation(), l) return;
571
+ (async () => {
572
+ var N;
573
+ if (a && n) {
574
+ m(!0);
575
+ try {
576
+ const w = ((N = r.textComposer.text) == null ? void 0 : N.trim()) || "";
577
+ await n.sendMessage({
578
+ text: w,
579
+ attachments: [a]
580
+ }), r.textComposer.setText(""), o == null || o();
581
+ } catch (w) {
582
+ console.error("Failed to send message with attachment:", w);
583
+ } finally {
584
+ m(!1);
585
+ }
580
586
  }
581
- })());
587
+ })();
588
+ }
582
589
  },
583
590
  [
584
591
  n,
592
+ l,
585
593
  r.textComposer,
586
594
  o,
587
595
  a
588
596
  ]
589
- ), f = D(
590
- async (g) => {
597
+ ), E = D(
598
+ async (d) => {
591
599
  var N;
592
- if (a && n)
593
- try {
594
- const c = ((N = r.textComposer.text) == null ? void 0 : N.trim()) || "";
595
- await n.sendMessage({
596
- text: c,
597
- attachments: [a]
598
- }), r.textComposer.setText(""), o == null || o();
599
- } catch (c) {
600
- console.error("Failed to send message with attachment:", c);
601
- }
602
- else
603
- await t(g);
600
+ if (!l)
601
+ if (a && n) {
602
+ m(!0);
603
+ try {
604
+ const w = ((N = r.textComposer.text) == null ? void 0 : N.trim()) || "";
605
+ await n.sendMessage({
606
+ text: w,
607
+ attachments: [a]
608
+ }), r.textComposer.setText(""), o == null || o();
609
+ } catch (w) {
610
+ console.error("Failed to send message with attachment:", w);
611
+ } finally {
612
+ m(!1);
613
+ }
614
+ } else
615
+ await t(d);
604
616
  },
605
617
  [
606
618
  n,
607
619
  t,
620
+ l,
608
621
  r.textComposer,
609
622
  o,
610
623
  a
@@ -623,7 +636,7 @@ const us = (t) => ({
623
636
  onRemove: o
624
637
  }
625
638
  ),
626
- /* @__PURE__ */ i("div", { className: "flex", onKeyDown: h, children: [
639
+ /* @__PURE__ */ i("div", { className: "flex", onKeyDownCapture: g, children: [
627
640
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
628
641
  Xe,
629
642
  {
@@ -637,8 +650,8 @@ const us = (t) => ({
637
650
  "aria-label": "Send",
638
651
  className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white",
639
652
  "data-testid": "send-button",
640
- disabled: !l,
641
- onClick: f,
653
+ disabled: !f,
654
+ onClick: E,
642
655
  type: "button",
643
656
  children: /* @__PURE__ */ e(ns, { className: "size-4" })
644
657
  }
@@ -672,7 +685,7 @@ const us = (t) => ({
672
685
  }, Cs = () => null, vs = ({ className: t, message: s }) => /* @__PURE__ */ i(
673
686
  "div",
674
687
  {
675
- className: k("flex items-center justify-center h-full", t),
688
+ className: R("flex items-center justify-center h-full", t),
676
689
  children: [
677
690
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
678
691
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -718,19 +731,19 @@ const us = (t) => ({
718
731
  ] }) }));
719
732
  ae.displayName = "LoadingState";
720
733
  const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
721
- var f, g, N, c, E;
734
+ var f, g, E, d, N;
722
735
  const { channel: a } = ue(), o = U.useMemo(() => Object.values(a.state.members || {}).find(
723
- (I) => {
724
- var w;
725
- return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== a._client.userID;
736
+ (S) => {
737
+ var I;
738
+ return ((I = S.user) == null ? void 0 : I.id) && S.user.id !== a._client.userID;
726
739
  }
727
- ), [a._client.userID, a.state.members]), l = ((f = o == null ? void 0 : o.user) == null ? void 0 : f.name) || ((g = o == null ? void 0 : o.user) == null ? void 0 : g.id) || "Unknown member", h = (N = o == null ? void 0 : o.user) == null ? void 0 : N.image;
740
+ ), [a._client.userID, a.state.members]), l = ((f = o == null ? void 0 : o.user) == null ? void 0 : f.name) || ((g = o == null ? void 0 : o.user) == null ? void 0 : g.id) || "Unknown member", m = (E = o == null ? void 0 : o.user) == null ? void 0 : E.image;
728
741
  return /* @__PURE__ */ i("div", { className: "@container", children: [
729
742
  /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
730
743
  /* @__PURE__ */ e(
731
744
  "button",
732
745
  {
733
- className: k(
746
+ className: R(
734
747
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
735
748
  !s && "invisible"
736
749
  ),
@@ -745,9 +758,9 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
745
758
  /* @__PURE__ */ e(
746
759
  Z,
747
760
  {
748
- id: ((c = o == null ? void 0 : o.user) == null ? void 0 : c.id) || a.id || "unknown",
761
+ id: ((d = o == null ? void 0 : o.user) == null ? void 0 : d.id) || a.id || "unknown",
749
762
  name: l,
750
- image: h,
763
+ image: m,
751
764
  size: 40
752
765
  }
753
766
  ),
@@ -756,7 +769,7 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
756
769
  /* @__PURE__ */ e(
757
770
  "button",
758
771
  {
759
- className: k(
772
+ className: R(
760
773
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
761
774
  ),
762
775
  onClick: n,
@@ -781,9 +794,9 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
781
794
  /* @__PURE__ */ e(
782
795
  Z,
783
796
  {
784
- id: ((E = o == null ? void 0 : o.user) == null ? void 0 : E.id) || a.id || "unknown",
797
+ id: ((N = o == null ? void 0 : o.user) == null ? void 0 : N.id) || a.id || "unknown",
785
798
  name: l,
786
- image: h,
799
+ image: m,
787
800
  size: 40
788
801
  }
789
802
  ),
@@ -792,7 +805,7 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
792
805
  r && n && /* @__PURE__ */ e(
793
806
  "button",
794
807
  {
795
- className: k(
808
+ className: R(
796
809
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
797
810
  ),
798
811
  onClick: n,
@@ -809,37 +822,37 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
809
822
  followerStatusLabel: a,
810
823
  onLeaveConversation: o,
811
824
  onBlockParticipant: l,
812
- showDeleteConversation: h = !0,
825
+ showDeleteConversation: m = !0,
813
826
  onDeleteConversationClick: f,
814
827
  onBlockParticipantClick: g,
815
- onReportParticipantClick: N
828
+ onReportParticipantClick: E
816
829
  }) => {
817
830
  var q, Q, X, K, ce, j, V;
818
- const { service: c, debug: E } = ie(), [R, I] = y(!1), [w, C] = y(!1), [u, b] = y(!1), S = D(async () => {
831
+ const { service: d, debug: N } = ie(), [w, S] = y(!1), [I, C] = y(!1), [h, b] = y(!1), p = D(async () => {
819
832
  var F;
820
- if (!(!c || !((F = n == null ? void 0 : n.user) != null && F.id)))
833
+ if (!(!d || !((F = n == null ? void 0 : n.user) != null && F.id)))
821
834
  try {
822
- const P = (await c.getBlockedUsers()).some(
835
+ const P = (await d.getBlockedUsers()).some(
823
836
  ($) => {
824
837
  var Y;
825
838
  return $.blocked_user_id === ((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id);
826
839
  }
827
840
  );
828
- I(P);
841
+ S(P);
829
842
  } catch (_) {
830
843
  console.error(
831
844
  "[ChannelInfoDialog] Failed to check blocked status:",
832
845
  _
833
846
  );
834
847
  }
835
- }, [c, (q = n == null ? void 0 : n.user) == null ? void 0 : q.id]);
848
+ }, [d, (q = n == null ? void 0 : n.user) == null ? void 0 : q.id]);
836
849
  G(() => {
837
- S();
838
- }, [S]);
839
- const p = async () => {
850
+ p();
851
+ }, [p]);
852
+ const k = async () => {
840
853
  var F;
841
- if (!w) {
842
- f == null || f(), E && console.log("[ChannelInfoDialog] Leave conversation", r.cid), C(!0);
854
+ if (!I) {
855
+ f == null || f(), N && console.log("[ChannelInfoDialog] Leave conversation", r.cid), C(!0);
843
856
  try {
844
857
  const _ = ((F = r._client) == null ? void 0 : F.userID) ?? null;
845
858
  await r.hide(_, !1), o && await o(r), s();
@@ -851,30 +864,30 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
851
864
  }
852
865
  }, T = async () => {
853
866
  var F, _, P;
854
- if (!(u || !c)) {
855
- g == null || g(), E && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
867
+ if (!(h || !d)) {
868
+ g == null || g(), N && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
856
869
  try {
857
- await c.blockUser((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
870
+ await d.blockUser((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
858
871
  } catch ($) {
859
872
  console.error("[ChannelInfoDialog] Failed to block member", $);
860
873
  } finally {
861
874
  b(!1);
862
875
  }
863
876
  }
864
- }, d = async () => {
877
+ }, c = async () => {
865
878
  var F, _, P;
866
- if (!(u || !c)) {
867
- g == null || g(), E && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
879
+ if (!(h || !d)) {
880
+ g == null || g(), N && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
868
881
  try {
869
- await c.unBlockUser((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
882
+ await d.unBlockUser((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
870
883
  } catch ($) {
871
884
  console.error("[ChannelInfoDialog] Failed to unblock member", $);
872
885
  } finally {
873
886
  b(!1);
874
887
  }
875
888
  }
876
- }, m = () => {
877
- N == null || N(), s(), window.open(
889
+ }, u = () => {
890
+ E == null || E(), s(), window.open(
878
891
  "https://linktr.ee/s/about/trust-center/report",
879
892
  "_blank",
880
893
  "noopener,noreferrer"
@@ -937,26 +950,26 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
937
950
  }
938
951
  ),
939
952
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
940
- h && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
953
+ m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
941
954
  ne,
942
955
  {
943
- onClick: p,
944
- disabled: w,
945
- "aria-busy": w,
956
+ onClick: k,
957
+ disabled: I,
958
+ "aria-busy": I,
946
959
  children: [
947
- w ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(rs, { className: "h-5 w-5" }),
960
+ I ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(rs, { className: "h-5 w-5" }),
948
961
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
949
962
  ]
950
963
  }
951
964
  ) }),
952
- /* @__PURE__ */ e("li", { children: R ? /* @__PURE__ */ i(
965
+ /* @__PURE__ */ e("li", { children: w ? /* @__PURE__ */ i(
953
966
  ne,
954
967
  {
955
- onClick: d,
956
- disabled: u,
957
- "aria-busy": u,
968
+ onClick: c,
969
+ disabled: h,
970
+ "aria-busy": h,
958
971
  children: [
959
- u ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(be, { className: "h-5 w-5" }),
972
+ h ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(be, { className: "h-5 w-5" }),
960
973
  /* @__PURE__ */ e("span", { children: "Unblock" })
961
974
  ]
962
975
  }
@@ -964,15 +977,15 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
964
977
  ne,
965
978
  {
966
979
  onClick: T,
967
- disabled: u,
968
- "aria-busy": u,
980
+ disabled: h,
981
+ "aria-busy": h,
969
982
  children: [
970
- u ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(be, { className: "h-5 w-5" }),
983
+ h ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(be, { className: "h-5 w-5" }),
971
984
  /* @__PURE__ */ e("span", { children: "Block" })
972
985
  ]
973
986
  }
974
987
  ) }),
975
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ne, { variant: "danger", onClick: m, children: [
988
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ne, { variant: "danger", onClick: u, children: [
976
989
  /* @__PURE__ */ e(ls, { className: "h-5 w-5" }),
977
990
  /* @__PURE__ */ e("span", { children: "Report" })
978
991
  ] }) })
@@ -990,28 +1003,28 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
990
1003
  onBlockParticipant: a,
991
1004
  showDeleteConversation: o = !0,
992
1005
  onDeleteConversationClick: l,
993
- onBlockParticipantClick: h,
1006
+ onBlockParticipantClick: m,
994
1007
  onReportParticipantClick: f,
995
1008
  pendingAttachment: g,
996
- onClearPendingAttachment: N
1009
+ onClearPendingAttachment: E
997
1010
  }) => {
998
- const { channel: c } = ue(), E = z(null), R = U.useMemo(() => Object.values(c.state.members || {}).find(
1011
+ const { channel: d } = ue(), N = z(null), w = U.useMemo(() => Object.values(d.state.members || {}).find(
999
1012
  (b) => {
1000
- var S;
1001
- return ((S = b.user) == null ? void 0 : S.id) && b.user.id !== c._client.userID;
1013
+ var p;
1014
+ return ((p = b.user) == null ? void 0 : p.id) && b.user.id !== d._client.userID;
1002
1015
  }
1003
- ), [c._client.userID, c.state.members]), I = U.useMemo(() => {
1004
- const u = c.data ?? {};
1005
- if (u.followerStatus)
1006
- return String(u.followerStatus);
1007
- if (u.isFollower !== void 0)
1008
- return u.isFollower ? "Subscribed to you" : "Not subscribed";
1009
- }, [c.data]), w = D(() => {
1010
- var u;
1011
- (u = E.current) == null || u.showModal();
1016
+ ), [d._client.userID, d.state.members]), S = U.useMemo(() => {
1017
+ const h = d.data ?? {};
1018
+ if (h.followerStatus)
1019
+ return String(h.followerStatus);
1020
+ if (h.isFollower !== void 0)
1021
+ return h.isFollower ? "Subscribed to you" : "Not subscribed";
1022
+ }, [d.data]), I = D(() => {
1023
+ var h;
1024
+ (h = N.current) == null || h.showModal();
1012
1025
  }, []), C = D(() => {
1013
- var u;
1014
- (u = E.current) == null || u.close();
1026
+ var h;
1027
+ (h = N.current) == null || h.close();
1015
1028
  }, []);
1016
1029
  return /* @__PURE__ */ i(we, { children: [
1017
1030
  /* @__PURE__ */ i(ss, { children: [
@@ -1020,8 +1033,8 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1020
1033
  {
1021
1034
  onBack: t,
1022
1035
  showBackButton: s,
1023
- onShowInfo: w,
1024
- canShowInfo: !!R
1036
+ onShowInfo: I,
1037
+ canShowInfo: !!w
1025
1038
  }
1026
1039
  ) }),
1027
1040
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
@@ -1035,25 +1048,25 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1035
1048
  /* @__PURE__ */ e(
1036
1049
  bs,
1037
1050
  {
1038
- renderActions: () => n == null ? void 0 : n(c),
1051
+ renderActions: () => n == null ? void 0 : n(d),
1039
1052
  pendingAttachment: g,
1040
- onClearPendingAttachment: N
1053
+ onClearPendingAttachment: E
1041
1054
  }
1042
1055
  )
1043
1056
  ] }),
1044
1057
  /* @__PURE__ */ e(
1045
1058
  ys,
1046
1059
  {
1047
- dialogRef: E,
1060
+ dialogRef: N,
1048
1061
  onClose: C,
1049
- participant: R,
1050
- channel: c,
1051
- followerStatusLabel: I,
1062
+ participant: w,
1063
+ channel: d,
1064
+ followerStatusLabel: S,
1052
1065
  onLeaveConversation: r,
1053
1066
  onBlockParticipant: a,
1054
1067
  showDeleteConversation: o,
1055
1068
  onDeleteConversationClick: l,
1056
- onBlockParticipantClick: h,
1069
+ onBlockParticipantClick: m,
1057
1070
  onReportParticipantClick: f
1058
1071
  }
1059
1072
  )
@@ -1067,17 +1080,17 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1067
1080
  onLeaveConversation: a,
1068
1081
  onBlockParticipant: o,
1069
1082
  className: l,
1070
- CustomChannelEmptyState: h = Cs,
1083
+ CustomChannelEmptyState: m = Cs,
1071
1084
  showDeleteConversation: f = !0,
1072
1085
  onDeleteConversationClick: g,
1073
- onBlockParticipantClick: N,
1074
- onReportParticipantClick: c,
1075
- pendingAttachment: E,
1076
- onClearPendingAttachment: R
1086
+ onBlockParticipantClick: E,
1087
+ onReportParticipantClick: d,
1088
+ pendingAttachment: N,
1089
+ onClearPendingAttachment: w
1077
1090
  }) => /* @__PURE__ */ e(
1078
1091
  "div",
1079
1092
  {
1080
- className: k(
1093
+ className: R(
1081
1094
  "messaging-channel-view h-full flex flex-col",
1082
1095
  l
1083
1096
  ),
@@ -1086,7 +1099,7 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1086
1099
  {
1087
1100
  channel: t,
1088
1101
  MessageSystem: Ns,
1089
- EmptyStateIndicator: h,
1102
+ EmptyStateIndicator: m,
1090
1103
  LoadingIndicator: ae,
1091
1104
  children: /* @__PURE__ */ e(
1092
1105
  Es,
@@ -1096,13 +1109,13 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1096
1109
  renderMessageInputActions: r,
1097
1110
  onLeaveConversation: a,
1098
1111
  onBlockParticipant: o,
1099
- CustomChannelEmptyState: h,
1112
+ CustomChannelEmptyState: m,
1100
1113
  showDeleteConversation: f,
1101
1114
  onDeleteConversationClick: g,
1102
- onBlockParticipantClick: N,
1103
- onReportParticipantClick: c,
1104
- pendingAttachment: E,
1105
- onClearPendingAttachment: R
1115
+ onBlockParticipantClick: E,
1116
+ onReportParticipantClick: d,
1117
+ pendingAttachment: N,
1118
+ onClearPendingAttachment: w
1106
1119
  }
1107
1120
  )
1108
1121
  }
@@ -1159,58 +1172,58 @@ const Ss = ({
1159
1172
  searchPlaceholder: o = "Search participants...",
1160
1173
  className: l
1161
1174
  }) => {
1162
- const { debug: h } = ie(), [f, g] = y(""), [N, c] = y([]), [E, R] = y(!1), [I, w] = y(null), [C, u] = y(
1175
+ const { debug: m } = ie(), [f, g] = y(""), [E, d] = y([]), [N, w] = y(!1), [S, I] = y(null), [C, h] = y(
1163
1176
  null
1164
1177
  ), b = z(!1);
1165
1178
  G(() => {
1166
1179
  if (t.loading) {
1167
- h && console.log(
1180
+ m && console.log(
1168
1181
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1169
1182
  );
1170
1183
  return;
1171
1184
  }
1172
1185
  if (b.current) return;
1173
1186
  (async () => {
1174
- h && console.log("[ParticipantPicker] Loading initial participants..."), R(!0), w(null);
1187
+ m && console.log("[ParticipantPicker] Loading initial participants..."), w(!0), I(null);
1175
1188
  try {
1176
- const m = await t.loadParticipants({
1189
+ const u = await t.loadParticipants({
1177
1190
  search: "",
1178
1191
  // Load all participants initially
1179
1192
  limit: 100
1180
1193
  });
1181
- c(m.participants), b.current = !0, h && console.log(
1194
+ d(u.participants), b.current = !0, m && console.log(
1182
1195
  "[ParticipantPicker] Participants loaded successfully:",
1183
- m.participants.length
1196
+ u.participants.length
1184
1197
  );
1185
- } catch (m) {
1186
- const x = m instanceof Error ? m.message : "Failed to load participants";
1187
- w(x), console.error("[ParticipantPicker] Failed to load participants:", m);
1198
+ } catch (u) {
1199
+ const x = u instanceof Error ? u.message : "Failed to load participants";
1200
+ I(x), console.error("[ParticipantPicker] Failed to load participants:", u);
1188
1201
  } finally {
1189
- R(!1);
1202
+ w(!1);
1190
1203
  }
1191
1204
  })();
1192
- }, [t.loading, h]);
1193
- const S = N.filter((d) => !r.has(d.id)).filter((d) => {
1205
+ }, [t.loading, m]);
1206
+ const p = E.filter((c) => !r.has(c.id)).filter((c) => {
1194
1207
  var x;
1195
1208
  if (!f) return !0;
1196
- const m = f.toLowerCase();
1197
- return d.name.toLowerCase().includes(m) || ((x = d.email) == null ? void 0 : x.toLowerCase().includes(m)) || !1;
1198
- }), p = D(
1199
- async (d) => {
1209
+ const u = f.toLowerCase();
1210
+ return c.name.toLowerCase().includes(u) || ((x = c.email) == null ? void 0 : x.toLowerCase().includes(u)) || !1;
1211
+ }), k = D(
1212
+ async (c) => {
1200
1213
  if (!C) {
1201
- u(d.id);
1214
+ h(c.id);
1202
1215
  try {
1203
- await s(d);
1204
- } catch (m) {
1205
- console.error("[ParticipantPicker] Failed to start chat:", m), u(null);
1216
+ await s(c);
1217
+ } catch (u) {
1218
+ console.error("[ParticipantPicker] Failed to start chat:", u), h(null);
1206
1219
  }
1207
1220
  }
1208
1221
  },
1209
1222
  [s, C]
1210
- ), T = (d, m) => {
1211
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), p(m));
1223
+ ), T = (c, u) => {
1224
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), k(u));
1212
1225
  };
1213
- return /* @__PURE__ */ i("div", { className: k("flex flex-col h-full", l), children: [
1226
+ return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", l), children: [
1214
1227
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1215
1228
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1216
1229
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
@@ -1220,7 +1233,7 @@ const Ss = ({
1220
1233
  "Select a ",
1221
1234
  a.slice(0, -1),
1222
1235
  " to start messaging (",
1223
- S.length,
1236
+ p.length,
1224
1237
  " available)",
1225
1238
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${a} total`
1226
1239
  ] }),
@@ -1233,55 +1246,55 @@ const Ss = ({
1233
1246
  }
1234
1247
  )
1235
1248
  ] }),
1236
- I && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1249
+ S && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1237
1250
  "Error loading ",
1238
1251
  a,
1239
1252
  ": ",
1240
- I
1253
+ S
1241
1254
  ] }),
1242
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && 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: [
1255
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N && p.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1243
1256
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1244
1257
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1245
1258
  "Loading ",
1246
1259
  a,
1247
1260
  "..."
1248
1261
  ] })
1249
- ] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1262
+ ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1250
1263
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
1251
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${a} found` : N.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1252
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1264
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${a} found` : E.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1265
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : E.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1253
1266
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1254
- S.map((d) => {
1255
- const m = d.name || d.email || d.id, x = d.email && d.name ? d.email : d.phone;
1267
+ p.map((c) => {
1268
+ const u = c.name || c.email || c.id, x = c.email && c.name ? c.email : c.phone;
1256
1269
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1257
1270
  "button",
1258
1271
  {
1259
1272
  type: "button",
1260
- onClick: () => p(d),
1261
- onKeyDown: (B) => T(B, d),
1273
+ onClick: () => k(c),
1274
+ onKeyDown: (B) => T(B, c),
1262
1275
  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",
1263
1276
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1264
1277
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1265
1278
  /* @__PURE__ */ e(
1266
1279
  Z,
1267
1280
  {
1268
- id: d.id,
1269
- name: m,
1270
- image: d.image,
1281
+ id: c.id,
1282
+ name: u,
1283
+ image: c.image,
1271
1284
  size: 40
1272
1285
  }
1273
1286
  ),
1274
1287
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1275
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1288
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1276
1289
  x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
1277
1290
  ] })
1278
1291
  ] }),
1279
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === d.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
1292
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === c.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
1280
1293
  ] })
1281
1294
  }
1282
- ) }, d.id);
1295
+ ) }, c.id);
1283
1296
  }),
1284
- E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1297
+ N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1285
1298
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1286
1299
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1287
1300
  ] }) })
@@ -1454,30 +1467,30 @@ const Ps = ({
1454
1467
  onParticipantSelect: a,
1455
1468
  initialParticipantFilter: o,
1456
1469
  initialParticipantData: l,
1457
- CustomChannelEmptyState: h,
1470
+ CustomChannelEmptyState: m,
1458
1471
  showChannelList: f = !0,
1459
1472
  filters: g,
1460
- channelListCustomEmptyStateIndicator: N,
1461
- onDeleteConversationClick: c,
1462
- onBlockParticipantClick: E,
1463
- onReportParticipantClick: R,
1464
- pendingAttachment: I,
1465
- onClearPendingAttachment: w
1473
+ channelListCustomEmptyStateIndicator: E,
1474
+ onDeleteConversationClick: d,
1475
+ onBlockParticipantClick: N,
1476
+ onReportParticipantClick: w,
1477
+ pendingAttachment: S,
1478
+ onClearPendingAttachment: I
1466
1479
  }) => {
1467
1480
  const {
1468
1481
  service: C,
1469
- client: u,
1482
+ client: h,
1470
1483
  isConnected: b,
1471
- isLoading: S,
1472
- error: p,
1484
+ isLoading: p,
1485
+ error: k,
1473
1486
  refreshConnection: T,
1474
- debug: d
1475
- } = os(), [m, x] = y(null), [B, A] = y(!1), [H, J] = y(!1), [he, q] = y(!1), [Q, X] = y(/* @__PURE__ */ new Set()), [K, ce] = y(0), [j, V] = y(!1), [F, _] = y(null), P = z(null), {
1487
+ debug: c
1488
+ } = os(), [u, x] = y(null), [B, A] = y(!1), [H, J] = y(!1), [he, q] = y(!1), [Q, X] = y(/* @__PURE__ */ new Set()), [K, ce] = y(0), [j, V] = y(!1), [F, _] = y(null), P = z(null), {
1476
1489
  participantSource: $,
1477
1490
  participantLabel: Y = "participants",
1478
1491
  showDeleteConversation: Te = !0
1479
1492
  } = t, Le = U.useMemo(() => {
1480
- const v = u == null ? void 0 : u.userID;
1493
+ const v = h == null ? void 0 : h.userID;
1481
1494
  return {
1482
1495
  ...{
1483
1496
  type: "messaging",
@@ -1489,13 +1502,13 @@ const Ps = ({
1489
1502
  },
1490
1503
  ...g
1491
1504
  };
1492
- }, [g, u == null ? void 0 : u.userID]), ee = z(null), W = D(async () => {
1493
- if (!u || !b) return;
1494
- const v = u.userID;
1505
+ }, [g, h == null ? void 0 : h.userID]), ee = z(null), W = D(async () => {
1506
+ if (!h || !b) return;
1507
+ const v = h.userID;
1495
1508
  if (v)
1496
1509
  try {
1497
- d && console.log("[MessagingShell] Syncing channels for user:", v);
1498
- const O = await u.queryChannels(
1510
+ c && console.log("[MessagingShell] Syncing channels for user:", v);
1511
+ const O = await h.queryChannels(
1499
1512
  {
1500
1513
  type: "messaging",
1501
1514
  members: { $in: [v] }
@@ -1510,29 +1523,29 @@ const Ps = ({
1510
1523
  const me = (fe = Be.user) == null ? void 0 : fe.id;
1511
1524
  me && me !== v && M.add(me);
1512
1525
  });
1513
- }), X((L) => L.size === M.size && [...L].every((de) => M.has(de)) ? L : M), A(O.length > 0), J(!0), ee.current = v, d && console.log("[MessagingShell] Channels synced successfully:", {
1526
+ }), X((L) => L.size === M.size && [...L].every((de) => M.has(de)) ? L : M), A(O.length > 0), J(!0), ee.current = v, c && console.log("[MessagingShell] Channels synced successfully:", {
1514
1527
  channelCount: O.length,
1515
1528
  memberCount: M.size
1516
1529
  });
1517
1530
  } catch (O) {
1518
1531
  console.error("[MessagingShell] Failed to sync channels:", O);
1519
1532
  }
1520
- }, [u, b, d]);
1533
+ }, [h, b, c]);
1521
1534
  G(() => {
1522
- if (!u || !b) return;
1523
- const v = u.userID;
1535
+ if (!h || !b) return;
1536
+ const v = h.userID;
1524
1537
  v && ee.current !== v && W();
1525
- }, [u, b, W]), G(() => {
1526
- if (!o || !u || !b) return;
1538
+ }, [h, b, W]), G(() => {
1539
+ if (!o || !h || !b) return;
1527
1540
  (async () => {
1528
- const O = u.userID;
1541
+ const O = h.userID;
1529
1542
  if (O)
1530
1543
  try {
1531
- d && console.log(
1544
+ c && console.log(
1532
1545
  "[MessagingShell] Loading initial conversation with:",
1533
1546
  o
1534
1547
  );
1535
- const M = await u.queryChannels(
1548
+ const M = await h.queryChannels(
1536
1549
  {
1537
1550
  type: "messaging",
1538
1551
  members: { $eq: [O, o] }
@@ -1541,12 +1554,12 @@ const Ps = ({
1541
1554
  { limit: 1 }
1542
1555
  );
1543
1556
  if (M.length > 0)
1544
- x(M[0]), V(!0), _(null), r && r(M[0]), d && console.log(
1557
+ x(M[0]), V(!0), _(null), r && r(M[0]), c && console.log(
1545
1558
  "[MessagingShell] Initial conversation loaded:",
1546
1559
  M[0].id
1547
1560
  );
1548
1561
  else if (l && C) {
1549
- d && console.log(
1562
+ c && console.log(
1550
1563
  "[MessagingShell] No conversation found, creating one for:",
1551
1564
  l
1552
1565
  );
@@ -1557,7 +1570,7 @@ const Ps = ({
1557
1570
  email: l.email,
1558
1571
  phone: l.phone
1559
1572
  });
1560
- x(L), V(!0), _(null), r && r(L), d && console.log(
1573
+ x(L), V(!0), _(null), r && r(L), c && console.log(
1561
1574
  "[MessagingShell] Channel created and loaded:",
1562
1575
  L.id
1563
1576
  );
@@ -1570,7 +1583,7 @@ const Ps = ({
1570
1583
  } else
1571
1584
  _(
1572
1585
  "No conversation found with this account"
1573
- ), d && console.log(
1586
+ ), c && console.log(
1574
1587
  "[MessagingShell] No conversation found for:",
1575
1588
  o
1576
1589
  );
@@ -1584,10 +1597,10 @@ const Ps = ({
1584
1597
  }, [
1585
1598
  o,
1586
1599
  l,
1587
- u,
1600
+ h,
1588
1601
  b,
1589
1602
  C,
1590
- d,
1603
+ c,
1591
1604
  r
1592
1605
  ]);
1593
1606
  const Ue = D(
@@ -1602,7 +1615,7 @@ const Ps = ({
1602
1615
  var O;
1603
1616
  if (C)
1604
1617
  try {
1605
- d && console.log(
1618
+ c && console.log(
1606
1619
  "[MessagingShell] Starting conversation with:",
1607
1620
  v.id
1608
1621
  );
@@ -1622,7 +1635,7 @@ const Ps = ({
1622
1635
  console.error("[MessagingShell] Failed to start conversation:", M);
1623
1636
  }
1624
1637
  },
1625
- [C, a, d]
1638
+ [C, a, c]
1626
1639
  ), se = D(() => {
1627
1640
  var v;
1628
1641
  q(!1), (v = P.current) == null || v.close();
@@ -1633,25 +1646,25 @@ const Ps = ({
1633
1646
  [se]
1634
1647
  ), Ae = D(
1635
1648
  async (v) => {
1636
- d && console.log("[MessagingShell] Leaving conversation:", v.id), x(null), V(!1), ee.current = null, await W();
1649
+ c && console.log("[MessagingShell] Leaving conversation:", v.id), x(null), V(!1), ee.current = null, await W();
1637
1650
  },
1638
- [W, d]
1651
+ [W, c]
1639
1652
  ), ze = D(
1640
1653
  async (v) => {
1641
- d && console.log("[MessagingShell] Blocking participant:", v), x(null), V(!1), ee.current = null, await W();
1654
+ c && console.log("[MessagingShell] Blocking participant:", v), x(null), V(!1), ee.current = null, await W();
1642
1655
  },
1643
- [W, d]
1644
- ), te = !!m;
1645
- return S ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : p ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: p, onBack: T }) }) : !b || !u ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(
1656
+ [W, c]
1657
+ ), te = !!u;
1658
+ return p ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : k ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(le, { message: k, onBack: T }) }) : !b || !h ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1646
1659
  le,
1647
1660
  {
1648
1661
  message: "Not connected to messaging service",
1649
1662
  onBack: T
1650
1663
  }
1651
- ) }) : F ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: F }) }) : /* @__PURE__ */ i(
1664
+ ) }) : F ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(le, { message: F }) }) : /* @__PURE__ */ i(
1652
1665
  "div",
1653
1666
  {
1654
- className: k(
1667
+ className: R(
1655
1668
  "messaging-shell h-full bg-background-primary overflow-hidden",
1656
1669
  s
1657
1670
  ),
@@ -1660,7 +1673,7 @@ const Ps = ({
1660
1673
  /* @__PURE__ */ e(
1661
1674
  "div",
1662
1675
  {
1663
- className: k(
1676
+ className: R(
1664
1677
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1665
1678
  {
1666
1679
  "!hidden": f === !1 || j,
@@ -1674,9 +1687,9 @@ const Ps = ({
1674
1687
  ke,
1675
1688
  {
1676
1689
  onChannelSelect: Ue,
1677
- selectedChannel: m || void 0,
1690
+ selectedChannel: u || void 0,
1678
1691
  filters: Le,
1679
- customEmptyStateIndicator: N
1692
+ customEmptyStateIndicator: E
1680
1693
  }
1681
1694
  )
1682
1695
  }
@@ -1684,7 +1697,7 @@ const Ps = ({
1684
1697
  /* @__PURE__ */ e(
1685
1698
  "div",
1686
1699
  {
1687
- className: k(
1700
+ className: R(
1688
1701
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1689
1702
  {
1690
1703
  // In direct conversation mode (or waiting for it), always show (full width)
@@ -1693,24 +1706,24 @@ const Ps = ({
1693
1706
  "hidden lg:flex": !j && !te && !o
1694
1707
  }
1695
1708
  ),
1696
- children: m ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1709
+ children: u ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1697
1710
  Me,
1698
1711
  {
1699
- channel: m,
1712
+ channel: u,
1700
1713
  onBack: Pe,
1701
1714
  showBackButton: !j,
1702
1715
  renderMessageInputActions: n,
1703
1716
  onLeaveConversation: Ae,
1704
1717
  onBlockParticipant: ze,
1705
- CustomChannelEmptyState: h,
1718
+ CustomChannelEmptyState: m,
1706
1719
  showDeleteConversation: Te,
1707
- onDeleteConversationClick: c,
1708
- onBlockParticipantClick: E,
1709
- onReportParticipantClick: R,
1710
- pendingAttachment: I,
1711
- onClearPendingAttachment: w
1720
+ onDeleteConversationClick: d,
1721
+ onBlockParticipantClick: N,
1722
+ onReportParticipantClick: w,
1723
+ pendingAttachment: S,
1724
+ onClearPendingAttachment: I
1712
1725
  },
1713
- m.id
1726
+ u.id
1714
1727
  ) }) : o ? (
1715
1728
  // Show loading while creating/loading direct conversation channel
1716
1729
  /* @__PURE__ */ e(ae, {})
@@ -1761,7 +1774,7 @@ const Ps = ({
1761
1774
  onClick: s,
1762
1775
  disabled: n,
1763
1776
  style: { backgroundColor: "#E6E5E3" },
1764
- className: k(
1777
+ className: R(
1765
1778
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1766
1779
  {
1767
1780
  "hover:brightness-95 active:brightness-90": !n,
@@ -1780,8 +1793,8 @@ const Ps = ({
1780
1793
  avatarImage: o,
1781
1794
  avatarName: l
1782
1795
  }) => {
1783
- const h = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
1784
- return h.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1796
+ const m = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
1797
+ return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1785
1798
  (o || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1786
1799
  Z,
1787
1800
  {
@@ -1799,7 +1812,7 @@ const Ps = ({
1799
1812
  style: { backgroundColor: "#F1F0EE" },
1800
1813
  children: [
1801
1814
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1802
- h.map((f) => /* @__PURE__ */ e(
1815
+ m.map((f) => /* @__PURE__ */ e(
1803
1816
  ks,
1804
1817
  {
1805
1818
  question: f.question,
@@ -1813,31 +1826,31 @@ const Ps = ({
1813
1826
  )
1814
1827
  ] }) });
1815
1828
  }, js = (t, s = {}) => {
1816
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, o] = y([]), [l, h] = y(!1), [f, g] = y(null), [N, c] = y(n), [E, R] = y(!0), [I, w] = y(), C = D(async (p = !1, T) => {
1829
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [a, o] = y([]), [l, m] = y(!1), [f, g] = y(null), [E, d] = y(n), [N, w] = y(!0), [S, I] = y(), C = D(async (k = !1, T) => {
1817
1830
  if (l) return;
1818
- const d = T !== void 0 ? T : N;
1819
- h(!0), g(null);
1831
+ const c = T !== void 0 ? T : E;
1832
+ m(!0), g(null);
1820
1833
  try {
1821
- const m = await t.loadParticipants({
1822
- search: d || void 0,
1834
+ const u = await t.loadParticipants({
1835
+ search: c || void 0,
1823
1836
  limit: r,
1824
- cursor: p ? void 0 : I
1837
+ cursor: k ? void 0 : S
1825
1838
  });
1826
1839
  o(
1827
- (x) => p ? m.participants : [...x, ...m.participants]
1828
- ), R(m.hasMore), w(m.nextCursor);
1829
- } catch (m) {
1830
- const x = m instanceof Error ? m.message : "Failed to load participants";
1831
- g(x), console.error("[useParticipants] Load error:", m);
1840
+ (x) => k ? u.participants : [...x, ...u.participants]
1841
+ ), w(u.hasMore), I(u.nextCursor);
1842
+ } catch (u) {
1843
+ const x = u instanceof Error ? u.message : "Failed to load participants";
1844
+ g(x), console.error("[useParticipants] Load error:", u);
1832
1845
  } finally {
1833
- h(!1);
1846
+ m(!1);
1834
1847
  }
1835
- }, [t, N, I, r, l]), u = D(() => {
1836
- E && !l && C(!1);
1837
- }, [E, l, C]), b = D((p) => {
1838
- c(p), w(void 0), C(!0, p);
1839
- }, [C]), S = D(() => {
1840
- w(void 0), C(!0);
1848
+ }, [t, E, S, r, l]), h = D(() => {
1849
+ N && !l && C(!1);
1850
+ }, [N, l, C]), b = D((k) => {
1851
+ d(k), I(void 0), C(!0, k);
1852
+ }, [C]), p = D(() => {
1853
+ I(void 0), C(!0);
1841
1854
  }, [C]);
1842
1855
  return G(() => {
1843
1856
  C(!0);
@@ -1845,12 +1858,12 @@ const Ps = ({
1845
1858
  participants: a,
1846
1859
  loading: l,
1847
1860
  error: f,
1848
- searchQuery: N,
1849
- hasMore: E,
1861
+ searchQuery: E,
1862
+ hasMore: N,
1850
1863
  totalCount: t.totalCount,
1851
- loadMore: u,
1864
+ loadMore: h,
1852
1865
  search: b,
1853
- refresh: S
1866
+ refresh: p
1854
1867
  };
1855
1868
  };
1856
1869
  export {