@linktr.ee/messaging-react 1.11.2 โ†’ 1.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as c, Fragment as he } from "react/jsx-runtime";
2
- import R from "classnames";
3
- import q, { createContext as Se, useContext as ke, useCallback as _, useState as E, useRef as B, useEffect as H } from "react";
4
- import { StreamChatService as Re } from "@linktr.ee/messaging-core";
5
- import { Chat as pe, ChannelList as Fe, useMessageComposer as Te, useStateStore as De, MessageInput as _e, useMessageInputContext as Me, useMessageComposerHasSendableData as Pe, SimpleAttachmentSelector as Le, QuotedMessagePreview as Ue, AttachmentPreviewList as Oe, TextareaComposer as je, MessageTimestamp as Ae, Channel as ze, useChannelStateContext as fe, Window as Be, MessageList as He } from "stream-chat-react";
6
- import { XIcon as le, ArrowUpIcon as $e, 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";
1
+ import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
2
+ import p from "classnames";
3
+ import Z, { createContext as Ie, useContext as Se, useCallback as F, useState as v, useRef as z, useEffect as G } from "react";
4
+ import { StreamChatService as ke } from "@linktr.ee/messaging-core";
5
+ import { Chat as pe, ChannelList as Re, useMessageComposer as De, useStateStore as _e, MessageInput as Me, useMessageInputContext as Fe, useMessageComposerHasSendableData as Te, SimpleAttachmentSelector as Pe, QuotedMessagePreview as Le, AttachmentPreviewList as Ue, TextareaComposer as Oe, MessageTimestamp as je, Channel as Ae, useChannelStateContext as fe, Window as Be, MessageList as ze } from "stream-chat-react";
6
+ import { XIcon as le, ArrowUpIcon as Ge, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as He, ProhibitInsetIcon as ce, FlagIcon as $e, MagnifyingGlassIcon as Ve, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as ue } from "stream-chat";
8
- const ge = Se({
8
+ const ge = Ie({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,214 +15,223 @@ const ge = Se({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), se = () => ke(ge), ys = ({
18
+ }), se = () => Se(ge), Is = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
- apiKey: l,
22
+ apiKey: r,
23
23
  capabilities: o = {},
24
24
  debug: a = !1
25
25
  }) => {
26
- const r = _(
27
- (u, ...N) => {
28
- a && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...N);
26
+ const l = F(
27
+ (u, ...x) => {
28
+ a && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...x);
29
29
  },
30
30
  [a]
31
31
  );
32
- r("๐Ÿ”„ RENDER START", {
32
+ l("๐Ÿ”„ RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
- apiKey: (l == null ? void 0 : l.substring(0, 8)) + "...",
34
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [i, m] = E(null), [x, k] = E(null), [h, f] = E(!1), [y, g] = E(!1), [C, w] = E(null), v = B(!1), I = B({
38
+ const [c, m] = v(null), [g, E] = v(null), [h, f] = v(!1), [k, b] = v(!1), [w, y] = v(null), N = z(!1), I = z({
39
39
  userId: s == null ? void 0 : s.id,
40
- apiKey: l,
40
+ apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: o
43
- }), S = B(0);
44
- S.current++, r("๐Ÿ“Š RENDER INFO", {
43
+ }), S = z(0);
44
+ S.current++, l("๐Ÿ“Š RENDER INFO", {
45
45
  renderCount: S.current,
46
- currentProps: { userId: s == null ? void 0 : s.id, apiKey: (l == null ? void 0 : l.substring(0, 8)) + "..." },
46
+ currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: I.current.apiKey !== l,
49
+ apiKeyChanged: I.current.apiKey !== r,
50
50
  serviceConfigChanged: I.current.serviceConfig !== n,
51
51
  capabilitiesChanged: I.current.capabilities !== o
52
52
  }
53
53
  }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
- apiKey: l,
55
+ apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: o
58
- }, H(() => {
58
+ }, G(() => {
59
59
  const u = S.current;
60
- if (r("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
60
+ if (l("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
62
- apiKey: !!l,
62
+ apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
- apiKey: (l == null ? void 0 : l.substring(0, 8)) + "...",
65
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
67
  serviceConfigStable: I.current.serviceConfig === n,
68
- apiKeyStable: I.current.apiKey === l
68
+ apiKeyStable: I.current.apiKey === r
69
69
  }
70
- }), !l || !n) {
71
- r("โš ๏ธ SERVICE INIT SKIPPED", {
70
+ }), !r || !n) {
71
+ l("โš ๏ธ SERVICE INIT SKIPPED", {
72
72
  renderCount: u,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- r("๐Ÿš€ CREATING NEW SERVICE", {
77
+ l("๐Ÿš€ CREATING NEW SERVICE", {
78
78
  renderCount: u,
79
- apiKey: (l == null ? void 0 : l.substring(0, 8)) + "...",
79
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const N = new Re({
82
+ const x = new ke({
83
83
  ...n,
84
- apiKey: l,
84
+ apiKey: r,
85
85
  debug: a
86
86
  });
87
- return m(N), r("โœ… SERVICE SET", {
87
+ return m(x), l("โœ… SERVICE SET", {
88
88
  renderCount: u,
89
- serviceInstance: !!N
89
+ serviceInstance: !!x
90
90
  }), () => {
91
- r("๐Ÿงน SERVICE CLEANUP", {
91
+ l("๐Ÿงน SERVICE CLEANUP", {
92
92
  renderCount: u,
93
93
  reason: "Effect cleanup"
94
- }), N.disconnectUser().catch(console.error);
94
+ }), x.disconnectUser().catch(console.error);
95
95
  };
96
- }, [l, n, a, r]);
97
- const p = B(null);
98
- H(() => {
99
- var N, j;
100
- if (r("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!i,
96
+ }, [r, n, a, l]);
97
+ const R = z(null);
98
+ G(() => {
99
+ var x, j;
100
+ if (l("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
+ hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: v.current,
104
+ isConnecting: N.current,
105
105
  isConnected: h,
106
- dependencies: { service: !!i, userId: s == null ? void 0 : s.id }
107
- }), !i || !s) {
108
- r("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
106
+ dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
+ }), !c || !s) {
108
+ l("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (v.current) {
112
- r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
111
+ if (N.current) {
112
+ l("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = p.current) == null ? void 0 : N.serviceId) === i && ((j = p.current) == null ? void 0 : j.userId) === s.id) {
116
- r(
115
+ if (((x = R.current) == null ? void 0 : x.serviceId) === c && ((j = R.current) == null ? void 0 : j.userId) === s.id) {
116
+ l(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
119
119
  );
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), v.current = !0, g(!0), w(null);
123
+ l("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), N.current = !0, b(!0), y(null);
124
124
  try {
125
- r("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const A = await i.connectUser(s);
127
- k(A), f(!0), p.current = { serviceId: i, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
125
+ l("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
+ const A = await c.connectUser(s);
127
+ E(A), f(!0), R.current = { serviceId: c, userId: s.id }, l("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: A.userID
130
130
  });
131
131
  } catch (A) {
132
132
  const W = A instanceof Error ? A.message : "Connection failed";
133
- w(W), r("โŒ USER CONNECTION ERROR", {
133
+ y(W), l("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
135
  error: W
136
136
  });
137
137
  } finally {
138
- g(!1), v.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ b(!1), N.current = !1, l("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: h
141
141
  });
142
142
  }
143
143
  })();
144
- }, [i, s, r, h]), H(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
- hasService: !!i,
144
+ }, [c, s, l, h]), G(() => (l("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!c,
146
146
  isConnected: h
147
147
  }), () => {
148
- i && h ? (r(
148
+ c && h ? (l(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), p.current = null, i.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
- hasService: !!i,
151
+ ), R.current = null, c.disconnectUser().catch(console.error)) : l("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!c,
153
153
  isConnected: h
154
154
  });
155
- }), [i, h, r]);
156
- const T = _(async () => {
157
- if (r("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
- hasService: !!i,
155
+ }), [c, h, l]);
156
+ const _ = F(async () => {
157
+ if (l("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
+ hasService: !!c,
159
159
  hasUser: !!s
160
- }), !i || !s) {
161
- r("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
160
+ }), !c || !s) {
161
+ l("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), g(!0);
164
+ l("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), b(!0);
165
165
  try {
166
- r("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await i.disconnectUser(), r("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
- const u = await i.connectUser(s);
168
- k(u), f(!0), w(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
166
+ l("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await c.disconnectUser(), l("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
+ const u = await c.connectUser(s);
168
+ E(u), f(!0), y(null), l("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
- const N = u instanceof Error ? u.message : "Refresh failed";
171
- w(N), r("โŒ CONNECTION REFRESH ERROR", {
170
+ const x = u instanceof Error ? u.message : "Refresh failed";
171
+ y(x), l("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: N
173
+ error: x
174
174
  });
175
175
  } finally {
176
- g(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ b(!1), l("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [i, s, r]), d = q.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!i,
180
- hasClient: !!x,
178
+ }, [c, s, l]), d = Z.useMemo(() => (l("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!c,
180
+ hasClient: !!g,
181
181
  isConnected: h,
182
- isLoading: y,
183
- hasError: !!C,
182
+ isLoading: k,
183
+ hasError: !!w,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
- service: i,
187
- client: x,
186
+ service: c,
187
+ client: g,
188
188
  isConnected: h,
189
- isLoading: y,
190
- error: C,
189
+ isLoading: k,
190
+ error: w,
191
191
  capabilities: o,
192
- refreshConnection: T,
192
+ refreshConnection: _,
193
193
  debug: a
194
194
  }), [
195
- i,
196
- x,
195
+ c,
196
+ g,
197
197
  h,
198
- y,
199
- C,
198
+ k,
199
+ w,
200
200
  o,
201
- T,
201
+ _,
202
202
  a,
203
- r
203
+ l
204
204
  ]);
205
- return r("๐Ÿ”„ RENDER END", {
205
+ return l("๐Ÿ”„ RENDER END", {
206
206
  renderCount: S.current,
207
- willRenderChat: !!(x && h),
207
+ willRenderChat: !!(g && h),
208
208
  contextValueReady: !!d
209
- }), /* @__PURE__ */ e(ge.Provider, { value: d, children: x && h ? /* @__PURE__ */ e(pe, { client: x, children: t }) : t });
210
- }, qe = () => se(), Ye = (t, s) => {
209
+ }), /* @__PURE__ */ e(ge.Provider, { value: d, children: g && h ? /* @__PURE__ */ e(
210
+ pe,
211
+ {
212
+ client: g,
213
+ customClasses: {
214
+ channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
+ },
216
+ children: t
217
+ }
218
+ ) : t });
219
+ }, We = () => se(), Ze = (t, s) => {
211
220
  const n = new Date(
212
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
213
222
  ), o = new Date(
214
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
215
224
  ).getTime() - n.getTime();
216
225
  return Math.floor(o / (1e3 * 60 * 60 * 24));
217
- }, Je = (t) => {
226
+ }, qe = (t) => {
218
227
  const s = /* @__PURE__ */ new Date();
219
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
220
229
  return "Just now";
221
- const l = Ye(t, s);
222
- return l === 0 ? t.toLocaleTimeString([], {
230
+ const r = Ze(t, s);
231
+ return r === 0 ? t.toLocaleTimeString([], {
223
232
  hour: "numeric",
224
233
  minute: "2-digit"
225
- }) : l === 1 ? "Yesterday" : l < 7 ? `${l}d` : l < 28 ? `${Math.floor(l / 7)}w` : t.toLocaleDateString("en-US", {
234
+ }) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : t.toLocaleDateString("en-US", {
226
235
  month: "numeric",
227
236
  day: "numeric",
228
237
  year: "2-digit"
@@ -255,33 +264,33 @@ const ge = Se({
255
264
  "๐Ÿˆ"
256
265
  // Melon
257
266
  ];
258
- function Qe(t) {
267
+ function Ye(t) {
259
268
  let s = 0;
260
269
  for (let n = 0; n < t.length; n++) {
261
- const l = t.charCodeAt(n);
262
- s = (s << 5) - s + l, s = s & s;
270
+ const r = t.charCodeAt(n);
271
+ s = (s << 5) - s + r, s = s & s;
263
272
  }
264
273
  return Math.abs(s);
265
274
  }
266
- function Xe(t) {
267
- const n = Qe(t) % me.length;
275
+ function Je(t) {
276
+ const n = Ye(t) % me.length;
268
277
  return me[n];
269
278
  }
270
- const Y = ({
279
+ const q = ({
271
280
  id: t,
272
281
  image: s,
273
282
  size: n = 40,
274
- className: l,
283
+ className: r,
275
284
  shape: o = "squircle"
276
285
  }) => {
277
- const a = Xe(t), i = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", m = o === "circle" ? { borderRadius: "50%" } : {
286
+ const a = Je(t), c = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", m = o === "circle" ? { borderRadius: "50%" } : {
278
287
  borderRadius: "33%",
279
288
  "corner-shape": "superellipse(1.3)"
280
289
  };
281
290
  return /* @__PURE__ */ e(
282
291
  "div",
283
292
  {
284
- className: R("flex-shrink-0 overflow-hidden", l),
293
+ className: p("flex-shrink-0 overflow-hidden", r),
285
294
  style: {
286
295
  width: `${n}px`,
287
296
  height: `${n}px`,
@@ -298,124 +307,124 @@ const Y = ({
298
307
  "div",
299
308
  {
300
309
  "aria-hidden": "true",
301
- className: R(
310
+ className: p(
302
311
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
303
- i
312
+ c
304
313
  ),
305
314
  children: a
306
315
  }
307
316
  )
308
317
  }
309
318
  );
310
- }, Ze = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: l = !1, unread: o }) => {
311
- var w, v, I, S, p, T;
312
- const a = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), r = () => {
319
+ }, Qe = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: o }) => {
320
+ var y, N, I, S, R, _;
321
+ const a = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
313
322
  t && n(t);
314
- }, m = Object.values(((w = t == null ? void 0 : t.state) == null ? void 0 : w.members) || {}).find(
323
+ }, m = Object.values(((y = t == null ? void 0 : t.state) == null ? void 0 : y.members) || {}).find(
315
324
  (d) => {
316
- var u, N;
317
- return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
325
+ var u, x;
326
+ return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
318
327
  }
319
- ), x = ((v = m == null ? void 0 : m.user) == null ? void 0 : v.name) || "Conversation", k = (I = m == null ? void 0 : m.user) == null ? void 0 : I.image, h = (p = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : p[t.state.messages.length - 1], y = (() => {
328
+ ), g = ((N = m == null ? void 0 : m.user) == null ? void 0 : N.name) || "Conversation", E = (I = m == null ? void 0 : m.user) == null ? void 0 : I.image, h = (R = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : R[t.state.messages.length - 1], k = (() => {
320
329
  var u;
321
330
  if (h != null && h.text) return h.text;
322
331
  const d = (u = h == null ? void 0 : h.attachments) == null ? void 0 : u[0];
323
332
  return d != null && d.asset_url ? d.asset_url : d != null && d.image_url ? d.image_url : d != null && d.og_scrape_url ? d.og_scrape_url : d != null && d.thumb_url ? d.thumb_url : "No messages yet";
324
- })(), g = h != null && h.created_at ? Je(new Date(h.created_at)) : "", C = o ?? 0;
325
- return l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
333
+ })(), b = h != null && h.created_at ? qe(new Date(h.created_at)) : "", w = o ?? 0;
334
+ return r && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
326
335
  channelId: t == null ? void 0 : t.id,
327
336
  isSelected: a,
328
- participantName: x,
329
- unreadCount: C,
330
- hasTimestamp: !!g
337
+ participantName: g,
338
+ unreadCount: w,
339
+ hasTimestamp: !!b
331
340
  }), /* @__PURE__ */ e(
332
341
  "button",
333
342
  {
334
343
  type: "button",
335
- onClick: r,
336
- className: R(
337
- "group w-full px-4 py-3 transition-colors border-b border-sand text-left max-w-full overflow-hidden focus-ring",
344
+ onClick: l,
345
+ className: p(
346
+ "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
338
347
  {
339
348
  "bg-primary-alt/10 border-l-4 border-l-primary": a,
340
349
  "hover:bg-sand": !a
341
350
  }
342
351
  ),
343
- children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
352
+ children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
344
353
  /* @__PURE__ */ e(
345
- Y,
354
+ q,
346
355
  {
347
- id: ((T = m == null ? void 0 : m.user) == null ? void 0 : T.id) || t.id || "unknown",
348
- name: x,
349
- image: k,
356
+ id: ((_ = m == null ? void 0 : m.user) == null ? void 0 : _.id) || t.id || "unknown",
357
+ name: g,
358
+ image: E,
350
359
  size: 44,
351
360
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
352
361
  }
353
362
  ),
354
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
355
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
363
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
364
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
356
365
  /* @__PURE__ */ e(
357
366
  "h3",
358
367
  {
359
- className: R(
368
+ className: p(
360
369
  "text-sm font-medium truncate",
361
370
  a ? "text-primary" : "text-charcoal"
362
371
  ),
363
- children: x
372
+ children: g
364
373
  }
365
374
  ),
366
- g && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: g })
375
+ b && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: b })
367
376
  ] }),
368
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
369
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: y }),
370
- C > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: C > 99 ? "99+" : C })
377
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
378
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: k }),
379
+ 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 })
371
380
  ] })
372
381
  ] })
373
382
  ] })
374
383
  }
375
384
  );
376
- }, Ke = ({
385
+ }, Xe = ({
377
386
  onChannelSelect: t,
378
387
  selectedChannel: s,
379
388
  filters: n,
380
- className: l,
389
+ className: r,
381
390
  customEmptyStateIndicator: o
382
391
  }) => {
383
- const a = q.useRef(0);
392
+ const a = Z.useRef(0);
384
393
  a.current++;
385
- const { debug: r = !1 } = se();
386
- return r && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
394
+ const { debug: l = !1 } = se();
395
+ return l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
387
396
  renderCount: a.current,
388
397
  selectedChannelId: s == null ? void 0 : s.id,
389
398
  filters: n
390
399
  }), /* @__PURE__ */ e(
391
400
  "div",
392
401
  {
393
- className: R(
402
+ className: p(
394
403
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
395
- l
404
+ r
396
405
  ),
397
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (r && console.log("๐Ÿ“บ [ChannelList] ๐ŸŽฌ RENDERING STREAM CHANNEL LIST", {
406
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (l && console.log("๐Ÿ“บ [ChannelList] ๐ŸŽฌ RENDERING STREAM CHANNEL LIST", {
398
407
  renderCount: a.current,
399
408
  filters: n
400
409
  }), /* @__PURE__ */ e(
401
- Fe,
410
+ Re,
402
411
  {
403
412
  filters: n,
404
413
  sort: { last_message_at: -1 },
405
414
  options: { limit: 30 },
406
- Preview: (i) => {
407
- var m, x;
408
- return r && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
409
- channelId: (m = i.channel) == null ? void 0 : m.id,
415
+ Preview: (c) => {
416
+ var m, g;
417
+ return l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
418
+ channelId: (m = c.channel) == null ? void 0 : m.id,
410
419
  selectedChannelId: s == null ? void 0 : s.id,
411
- isSelected: (s == null ? void 0 : s.id) === ((x = i.channel) == null ? void 0 : x.id)
420
+ isSelected: (s == null ? void 0 : s.id) === ((g = c.channel) == null ? void 0 : g.id)
412
421
  }), /* @__PURE__ */ e(
413
- Ze,
422
+ Qe,
414
423
  {
415
- ...i,
424
+ ...c,
416
425
  selectedChannel: s,
417
426
  onChannelSelect: t,
418
- debug: r
427
+ debug: l
419
428
  }
420
429
  );
421
430
  },
@@ -429,34 +438,34 @@ const Y = ({
429
438
  variant: t = "default",
430
439
  className: s,
431
440
  children: n,
432
- ...l
441
+ ...r
433
442
  }) => /* @__PURE__ */ e(
434
443
  "button",
435
444
  {
436
445
  type: "button",
437
- className: R(
446
+ className: p(
438
447
  "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",
439
448
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
440
449
  s
441
450
  ),
442
- ...l,
451
+ ...r,
443
452
  children: n
444
453
  }
445
454
  );
446
- function xe({ label: t, className: s, children: n, ...l }) {
447
- return /* @__PURE__ */ c(
455
+ function xe({ label: t, className: s, children: n, ...r }) {
456
+ return /* @__PURE__ */ i(
448
457
  "button",
449
458
  {
450
459
  type: "button",
451
- className: R(
460
+ className: p(
452
461
  "rounded-full p-2 transition-colors focus-ring",
453
462
  {
454
- "cursor-not-allowed opacity-50": l.disabled,
455
- "hover:bg-sand": !l.disabled
463
+ "cursor-not-allowed opacity-50": r.disabled,
464
+ "hover:bg-sand": !r.disabled
456
465
  },
457
466
  s
458
467
  ),
459
- ...l,
468
+ ...r,
460
469
  children: [
461
470
  /* @__PURE__ */ e("span", { className: "sr-only", children: t }),
462
471
  n
@@ -464,19 +473,19 @@ function xe({ label: t, className: s, children: n, ...l }) {
464
473
  }
465
474
  );
466
475
  }
467
- function Ne({ onClick: t }) {
476
+ function Ce({ onClick: t }) {
468
477
  return /* @__PURE__ */ e(xe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(le, { className: "h-5 w-5 text-stone", weight: "bold" }) });
469
478
  }
470
- const es = (t) => ({
479
+ const Ke = (t) => ({
471
480
  linkPreviews: Array.from(t.previews.values()).filter(
472
481
  (s) => ue.previewIsLoaded(s) || ue.previewIsLoading(s)
473
482
  )
474
- }), ss = ({
483
+ }), es = ({
475
484
  link: t,
476
485
  onDismiss: s
477
486
  }) => {
478
- const { og_scrape_url: n, title: l, image_url: o } = t;
479
- return /* @__PURE__ */ c(
487
+ const { og_scrape_url: n, title: r, image_url: o } = t;
488
+ return /* @__PURE__ */ i(
480
489
  "a",
481
490
  {
482
491
  href: n,
@@ -488,7 +497,7 @@ const es = (t) => ({
488
497
  "img",
489
498
  {
490
499
  src: o,
491
- alt: l || "",
500
+ alt: r || "",
492
501
  className: "h-[148px] w-full rounded-[20px] object-cover"
493
502
  }
494
503
  ),
@@ -496,47 +505,47 @@ const es = (t) => ({
496
505
  "button",
497
506
  {
498
507
  type: "button",
499
- onClick: (r) => {
500
- r.preventDefault(), s(n);
508
+ onClick: (l) => {
509
+ l.preventDefault(), s(n);
501
510
  },
502
511
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl",
503
512
  "aria-label": "Close link preview",
504
513
  children: /* @__PURE__ */ e(le, { className: "size-4 text-black/90" })
505
514
  }
506
515
  ),
507
- /* @__PURE__ */ c("div", { className: "p-2", children: [
508
- l && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: l }),
516
+ /* @__PURE__ */ i("div", { className: "p-2", children: [
517
+ r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
509
518
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
510
519
  ] })
511
520
  ]
512
521
  }
513
522
  );
514
- }, ts = () => {
515
- const { linkPreviewsManager: t } = Te(), { linkPreviews: s } = De(
523
+ }, ss = () => {
524
+ const { linkPreviewsManager: t } = De(), { linkPreviews: s } = _e(
516
525
  t.state,
517
- es
526
+ Ke
518
527
  ), n = (o) => {
519
528
  t.dismissPreview(o);
520
529
  };
521
530
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
522
- ss,
531
+ es,
523
532
  {
524
533
  link: o,
525
534
  onDismiss: n
526
535
  },
527
536
  o.og_scrape_url
528
537
  )) }) : null;
529
- }, ns = () => {
530
- const { handleSubmit: t } = Me(), s = Pe();
531
- return /* @__PURE__ */ c(he, { children: [
532
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Le, {}) }),
533
- /* @__PURE__ */ c("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
538
+ }, ts = () => {
539
+ const { handleSubmit: t } = Fe(), s = Te();
540
+ return /* @__PURE__ */ i(he, { children: [
541
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Pe, {}) }),
542
+ /* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
543
+ /* @__PURE__ */ e(Le, {}),
544
+ /* @__PURE__ */ e(ss, {}),
534
545
  /* @__PURE__ */ e(Ue, {}),
535
- /* @__PURE__ */ e(ts, {}),
536
- /* @__PURE__ */ e(Oe, {}),
537
- /* @__PURE__ */ c("div", { className: "flex", children: [
546
+ /* @__PURE__ */ i("div", { className: "flex", children: [
538
547
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
539
- je,
548
+ Oe,
540
549
  {
541
550
  className: "w-full resize-none outline-none leading-6",
542
551
  maxRows: 4
@@ -551,44 +560,41 @@ const es = (t) => ({
551
560
  disabled: !s,
552
561
  onClick: t,
553
562
  type: "button",
554
- children: /* @__PURE__ */ e($e, { className: "size-4" })
563
+ children: /* @__PURE__ */ e(Ge, { className: "size-4" })
555
564
  }
556
565
  )
557
566
  ] })
558
567
  ] })
559
568
  ] });
560
- }, rs = ({
569
+ }, ns = ({
561
570
  renderActions: t
562
- }) => /* @__PURE__ */ c("div", { className: "message-input flex items-center gap-2 p-4", children: [
571
+ }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
563
572
  t && (t == null ? void 0 : t()),
564
- /* @__PURE__ */ e(_e, { Input: ns })
565
- ] }), ls = (t) => {
573
+ /* @__PURE__ */ e(Me, { Input: ts })
574
+ ] }), rs = (t) => {
566
575
  const s = t.message.hide_date === !0;
567
- return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
568
- /* @__PURE__ */ c("div", { className: "str-chat__message--system__text", children: [
576
+ return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
577
+ /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
569
578
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
570
579
  /* @__PURE__ */ e("p", { children: t.message.text }),
571
580
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
572
581
  ] }),
573
- !s && /* @__PURE__ */ e(Ae, { message: t.message })
582
+ !s && /* @__PURE__ */ e(je, { message: t.message })
574
583
  ] });
575
- }, 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: [
576
- /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "No messages yet ๐Ÿ‘€" }),
577
- /* @__PURE__ */ e("p", { className: "text-stone text-xs", children: "Share to social media to generate more conversations" })
578
- ] }) }), os = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: l }) => {
579
- var m, x, k, h, f;
580
- const { channel: o } = fe(), a = q.useMemo(() => Object.values(o.state.members || {}).find(
581
- (g) => {
582
- var C;
583
- return ((C = g.user) == null ? void 0 : C.id) && g.user.id !== o._client.userID;
584
+ }, ls = () => null, os = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
585
+ var m, g, E, h, f;
586
+ const { channel: o } = fe(), a = Z.useMemo(() => Object.values(o.state.members || {}).find(
587
+ (b) => {
588
+ var w;
589
+ return ((w = b.user) == null ? void 0 : w.id) && b.user.id !== o._client.userID;
584
590
  }
585
- ), [o._client.userID, o.state.members]), r = ((m = a == null ? void 0 : a.user) == null ? void 0 : m.name) || ((x = a == null ? void 0 : a.user) == null ? void 0 : x.id) || "Unknown member", i = (k = a == null ? void 0 : a.user) == null ? void 0 : k.image;
586
- return /* @__PURE__ */ c("div", { className: "@container", children: [
587
- /* @__PURE__ */ c("div", { className: "flex justify-between items-center @lg:hidden", children: [
591
+ ), [o._client.userID, o.state.members]), l = ((m = a == null ? void 0 : a.user) == null ? void 0 : m.name) || ((g = a == null ? void 0 : a.user) == null ? void 0 : g.id) || "Unknown member", c = (E = a == null ? void 0 : a.user) == null ? void 0 : E.image;
592
+ return /* @__PURE__ */ i("div", { className: "@container", children: [
593
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
588
594
  /* @__PURE__ */ e(
589
595
  "button",
590
596
  {
591
- className: R(
597
+ className: p(
592
598
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
593
599
  !s && "invisible"
594
600
  ),
@@ -597,22 +603,22 @@ const es = (t) => ({
597
603
  children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
598
604
  }
599
605
  ),
600
- /* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
606
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
601
607
  /* @__PURE__ */ e(
602
- Y,
608
+ q,
603
609
  {
604
610
  id: ((h = a == null ? void 0 : a.user) == null ? void 0 : h.id) || o.id || "unknown",
605
- name: r,
606
- image: i,
611
+ name: l,
612
+ image: c,
607
613
  size: 40
608
614
  }
609
615
  ),
610
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: r })
616
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: l })
611
617
  ] }),
612
618
  /* @__PURE__ */ e(
613
619
  "button",
614
620
  {
615
- className: R(
621
+ className: p(
616
622
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
617
623
  ),
618
624
  onClick: n || (() => {
@@ -621,8 +627,8 @@ const es = (t) => ({
621
627
  }
622
628
  )
623
629
  ] }),
624
- /* @__PURE__ */ c("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
625
- /* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
630
+ /* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
631
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
626
632
  s && t && /* @__PURE__ */ e(
627
633
  "button",
628
634
  {
@@ -634,20 +640,20 @@ const es = (t) => ({
634
640
  }
635
641
  ),
636
642
  /* @__PURE__ */ e(
637
- Y,
643
+ q,
638
644
  {
639
645
  id: ((f = a == null ? void 0 : a.user) == null ? void 0 : f.id) || o.id || "unknown",
640
- name: r,
641
- image: i,
646
+ name: l,
647
+ image: c,
642
648
  size: 40
643
649
  }
644
650
  ),
645
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: r }) })
651
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: l }) })
646
652
  ] }),
647
- l && n && /* @__PURE__ */ e(
653
+ r && n && /* @__PURE__ */ e(
648
654
  "button",
649
655
  {
650
- className: R(
656
+ className: p(
651
657
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
652
658
  ),
653
659
  onClick: n,
@@ -660,76 +666,76 @@ const es = (t) => ({
660
666
  isOpen: t,
661
667
  onClose: s,
662
668
  participant: n,
663
- channel: l,
669
+ channel: r,
664
670
  followerStatusLabel: o,
665
671
  onLeaveConversation: a,
666
- onBlockParticipant: r
672
+ onBlockParticipant: l
667
673
  }) => {
668
- var W, O, G, J, $, V, Q;
669
- const { service: i, debug: m } = se(), x = B(null), [k, h] = E(!1), [f, y] = E(!1), [g, C] = E(!1);
670
- H(() => {
671
- const F = x.current;
672
- F && (t ? F.showModal() : F.close());
674
+ var W, O, $, Y, H, V, J;
675
+ const { service: c, debug: m } = se(), g = z(null), [E, h] = v(!1), [f, k] = v(!1), [b, w] = v(!1);
676
+ G(() => {
677
+ const D = g.current;
678
+ D && (t ? D.showModal() : D.close());
673
679
  }, [t]);
674
- const w = _(async () => {
675
- var F;
676
- if (!(!i || !((F = n == null ? void 0 : n.user) != null && F.id)))
680
+ const y = F(async () => {
681
+ var D;
682
+ if (!(!c || !((D = n == null ? void 0 : n.user) != null && D.id)))
677
683
  try {
678
- const P = (await i.getBlockedUsers()).some(
684
+ const P = (await c.getBlockedUsers()).some(
679
685
  (L) => {
680
- var X;
681
- return L.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
686
+ var Q;
687
+ return L.blocked_user_id === ((Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id);
682
688
  }
683
689
  );
684
690
  h(P);
685
- } catch (M) {
691
+ } catch (T) {
686
692
  console.error(
687
693
  "[ChannelInfoDialog] Failed to check blocked status:",
688
- M
694
+ T
689
695
  );
690
696
  }
691
- }, [i, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
692
- H(() => {
693
- t && w();
694
- }, [t, w]);
695
- const v = async () => {
696
- var F;
697
+ }, [c, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
698
+ G(() => {
699
+ t && y();
700
+ }, [t, y]);
701
+ const N = async () => {
702
+ var D;
697
703
  if (!f) {
698
- m && console.log("[ChannelInfoDialog] Leave conversation", l.cid), y(!0);
704
+ m && console.log("[ChannelInfoDialog] Leave conversation", r.cid), k(!0);
699
705
  try {
700
- const M = ((F = l._client) == null ? void 0 : F.userID) ?? null;
701
- await l.hide(M, !1), a && await a(l), s();
702
- } catch (M) {
703
- console.error("[ChannelInfoDialog] Failed to leave conversation", M);
706
+ const T = ((D = r._client) == null ? void 0 : D.userID) ?? null;
707
+ await r.hide(T, !1), a && await a(r), s();
708
+ } catch (T) {
709
+ console.error("[ChannelInfoDialog] Failed to leave conversation", T);
704
710
  } finally {
705
- y(!1);
711
+ k(!1);
706
712
  }
707
713
  }
708
714
  }, I = async () => {
709
- var F, M, P;
710
- if (!(g || !i)) {
711
- m && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), C(!0);
715
+ var D, T, P;
716
+ if (!(b || !c)) {
717
+ m && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), w(!0);
712
718
  try {
713
- await i.blockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), r && await r((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
719
+ await c.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
714
720
  } catch (L) {
715
721
  console.error("[ChannelInfoDialog] Failed to block member", L);
716
722
  } finally {
717
- C(!1);
723
+ w(!1);
718
724
  }
719
725
  }
720
726
  }, S = async () => {
721
- var F, M, P;
722
- if (!(g || !i)) {
723
- m && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), C(!0);
727
+ var D, T, P;
728
+ if (!(b || !c)) {
729
+ m && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), w(!0);
724
730
  try {
725
- await i.unBlockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), r && await r((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
731
+ await c.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
726
732
  } catch (L) {
727
733
  console.error("[ChannelInfoDialog] Failed to unblock member", L);
728
734
  } finally {
729
- C(!1);
735
+ w(!1);
730
736
  }
731
737
  }
732
- }, p = () => {
738
+ }, R = () => {
733
739
  s(), window.open(
734
740
  "https://linktr.ee/s/about/trust-center/report",
735
741
  "_blank",
@@ -737,42 +743,42 @@ const es = (t) => ({
737
743
  );
738
744
  };
739
745
  if (!n) return null;
740
- const T = ((O = n.user) == null ? void 0 : O.name) || ((G = n.user) == null ? void 0 : G.id) || "Unknown member", d = (J = n.user) == null ? void 0 : J.image, u = ($ = n.user) == null ? void 0 : $.email, N = (V = n.user) == null ? void 0 : V.username, j = u || (N ? `linktr.ee/${N}` : void 0), A = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
746
+ const _ = ((O = n.user) == null ? void 0 : O.name) || (($ = n.user) == null ? void 0 : $.id) || "Unknown member", d = (Y = n.user) == null ? void 0 : Y.image, u = (H = n.user) == null ? void 0 : H.email, x = (V = n.user) == null ? void 0 : V.username, j = u || (x ? `linktr.ee/${x}` : void 0), A = ((J = n.user) == null ? void 0 : J.id) || "unknown";
741
747
  return (
742
748
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
743
749
  /* @__PURE__ */ e(
744
750
  "dialog",
745
751
  {
746
- ref: x,
747
- className: "mes-dialog",
752
+ ref: g,
753
+ className: "mes-dialog group",
748
754
  onClose: s,
749
- onClick: (F) => {
750
- F.target === x.current && s();
755
+ onClick: (D) => {
756
+ D.target === g.current && s();
751
757
  },
752
- children: /* @__PURE__ */ c("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
753
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
758
+ children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
759
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
754
760
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
755
- /* @__PURE__ */ e(Ne, { onClick: s })
761
+ /* @__PURE__ */ e(Ce, { onClick: s })
756
762
  ] }),
757
- /* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
763
+ /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
758
764
  /* @__PURE__ */ e(
759
765
  "div",
760
766
  {
761
767
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
762
768
  style: { backgroundColor: "#FBFAF9" },
763
- children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
769
+ children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
764
770
  /* @__PURE__ */ e(
765
- Y,
771
+ q,
766
772
  {
767
773
  id: A,
768
- name: T,
774
+ name: _,
769
775
  image: d,
770
776
  size: 88,
771
777
  shape: "circle"
772
778
  }
773
779
  ),
774
- /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
775
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: T }),
780
+ /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
781
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
776
782
  j && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: j }),
777
783
  o && /* @__PURE__ */ e(
778
784
  "span",
@@ -792,44 +798,44 @@ const es = (t) => ({
792
798
  ] })
793
799
  }
794
800
  ),
795
- /* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
796
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
801
+ /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
802
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
797
803
  K,
798
804
  {
799
- onClick: v,
805
+ onClick: N,
800
806
  disabled: f,
801
807
  "aria-busy": f,
802
808
  children: [
803
- f ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ge, { className: "h-5 w-5" }),
809
+ f ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
804
810
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
805
811
  ]
806
812
  }
807
813
  ) }),
808
- /* @__PURE__ */ e("li", { children: k ? /* @__PURE__ */ c(
814
+ /* @__PURE__ */ e("li", { children: E ? /* @__PURE__ */ i(
809
815
  K,
810
816
  {
811
817
  onClick: S,
812
- disabled: g,
813
- "aria-busy": g,
818
+ disabled: b,
819
+ "aria-busy": b,
814
820
  children: [
815
- g ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
821
+ b ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
816
822
  /* @__PURE__ */ e("span", { children: "Unblock" })
817
823
  ]
818
824
  }
819
- ) : /* @__PURE__ */ c(
825
+ ) : /* @__PURE__ */ i(
820
826
  K,
821
827
  {
822
828
  onClick: I,
823
- disabled: g,
824
- "aria-busy": g,
829
+ disabled: b,
830
+ "aria-busy": b,
825
831
  children: [
826
- g ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
832
+ b ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
827
833
  /* @__PURE__ */ e("span", { children: "Block" })
828
834
  ]
829
835
  }
830
836
  ) }),
831
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(K, { variant: "danger", onClick: p, children: [
832
- /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
837
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(K, { variant: "danger", onClick: R, children: [
838
+ /* @__PURE__ */ e($e, { className: "h-5 w-5" }),
833
839
  /* @__PURE__ */ e("span", { children: "Report" })
834
840
  ] }) })
835
841
  ] })
@@ -842,61 +848,56 @@ const es = (t) => ({
842
848
  onBack: t,
843
849
  showBackButton: s,
844
850
  renderMessageInputActions: n,
845
- onLeaveConversation: l,
846
- onBlockParticipant: o,
847
- CustomChannelEmptyState: a = be
851
+ onLeaveConversation: r,
852
+ onBlockParticipant: o
848
853
  }) => {
849
- var f, y;
850
- const { channel: r } = fe(), [i, m] = E(!1), x = (((y = (f = r == null ? void 0 : r.state) == null ? void 0 : f.messages) == null ? void 0 : y.length) ?? 0) > 0, k = q.useMemo(() => Object.values(r.state.members || {}).find(
851
- (C) => {
852
- var w;
853
- return ((w = C.user) == null ? void 0 : w.id) && C.user.id !== r._client.userID;
854
+ const { channel: a } = fe(), [l, c] = v(!1), m = Z.useMemo(() => Object.values(a.state.members || {}).find(
855
+ (h) => {
856
+ var f;
857
+ return ((f = h.user) == null ? void 0 : f.id) && h.user.id !== a._client.userID;
854
858
  }
855
- ), [r._client.userID, r.state.members]), h = q.useMemo(() => {
856
- const g = r.data ?? {};
857
- if (g.followerStatus)
858
- return String(g.followerStatus);
859
- if (g.isFollower !== void 0)
860
- return g.isFollower ? "Subscribed to you" : "Not subscribed";
861
- }, [r.data]);
862
- return /* @__PURE__ */ c(he, { children: [
863
- /* @__PURE__ */ c(Be, { children: [
859
+ ), [a._client.userID, a.state.members]), g = Z.useMemo(() => {
860
+ const E = a.data ?? {};
861
+ if (E.followerStatus)
862
+ return String(E.followerStatus);
863
+ if (E.isFollower !== void 0)
864
+ return E.isFollower ? "Subscribed to you" : "Not subscribed";
865
+ }, [a.data]);
866
+ return /* @__PURE__ */ i(he, { children: [
867
+ /* @__PURE__ */ i(Be, { children: [
864
868
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
865
869
  os,
866
870
  {
867
871
  onBack: t,
868
872
  showBackButton: s,
869
- onShowInfo: () => m(!0),
870
- canShowInfo: !!k
873
+ onShowInfo: () => c(!0),
874
+ canShowInfo: !!m
875
+ }
876
+ ) }),
877
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
878
+ ze,
879
+ {
880
+ hideDeletedMessages: !0,
881
+ hideNewMessageSeparator: !1,
882
+ messageActions: []
871
883
  }
872
884
  ) }),
873
- /* @__PURE__ */ c("div", { className: "flex-1 overflow-hidden relative", children: [
874
- /* @__PURE__ */ e(
875
- He,
876
- {
877
- hideDeletedMessages: !0,
878
- hideNewMessageSeparator: !1,
879
- messageActions: []
880
- }
881
- ),
882
- !x && a && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(a, {}) })
883
- ] }),
884
885
  /* @__PURE__ */ e(
885
- rs,
886
+ ns,
886
887
  {
887
- renderActions: () => n == null ? void 0 : n(r)
888
+ renderActions: () => n == null ? void 0 : n(a)
888
889
  }
889
890
  )
890
891
  ] }),
891
892
  /* @__PURE__ */ e(
892
893
  as,
893
894
  {
894
- isOpen: i,
895
- onClose: () => m(!1),
896
- participant: k,
897
- channel: r,
898
- followerStatusLabel: h,
899
- onLeaveConversation: l,
895
+ isOpen: l,
896
+ onClose: () => c(!1),
897
+ participant: m,
898
+ channel: a,
899
+ followerStatusLabel: g,
900
+ onLeaveConversation: r,
900
901
  onBlockParticipant: o
901
902
  }
902
903
  )
@@ -905,29 +906,37 @@ const es = (t) => ({
905
906
  channel: t,
906
907
  onBack: s,
907
908
  showBackButton: n = !1,
908
- renderMessageInputActions: l,
909
+ renderMessageInputActions: r,
909
910
  onLeaveConversation: o,
910
911
  onBlockParticipant: a,
911
- className: r,
912
- CustomChannelEmptyState: i = be
912
+ className: l,
913
+ CustomChannelEmptyState: c = ls
913
914
  }) => /* @__PURE__ */ e(
914
915
  "div",
915
916
  {
916
- className: R(
917
- "messaging-channel-view h-full flex flex-col bg-[#FBFAF9]",
918
- r
917
+ className: p(
918
+ "messaging-channel-view h-full flex flex-col",
919
+ l
919
920
  ),
920
- children: /* @__PURE__ */ e(ze, { channel: t, MessageSystem: ls, children: /* @__PURE__ */ e(
921
- is,
921
+ children: /* @__PURE__ */ e(
922
+ Ae,
922
923
  {
923
- onBack: s,
924
- showBackButton: n,
925
- renderMessageInputActions: l,
926
- onLeaveConversation: o,
927
- onBlockParticipant: a,
928
- CustomChannelEmptyState: i
924
+ channel: t,
925
+ MessageSystem: rs,
926
+ EmptyStateIndicator: c,
927
+ children: /* @__PURE__ */ e(
928
+ is,
929
+ {
930
+ onBack: s,
931
+ showBackButton: n,
932
+ renderMessageInputActions: r,
933
+ onLeaveConversation: o,
934
+ onBlockParticipant: a,
935
+ CustomChannelEmptyState: c
936
+ }
937
+ )
929
938
  }
930
- ) })
939
+ )
931
940
  }
932
941
  );
933
942
  function ds({
@@ -935,10 +944,10 @@ function ds({
935
944
  setSearchQuery: s,
936
945
  placeholder: n
937
946
  }) {
938
- const l = B(null);
939
- return /* @__PURE__ */ c("div", { className: "relative", children: [
947
+ const r = z(null);
948
+ return /* @__PURE__ */ i("div", { className: "relative", children: [
940
949
  /* @__PURE__ */ e(
941
- We,
950
+ Ve,
942
951
  {
943
952
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
944
953
  weight: "bold"
@@ -947,7 +956,7 @@ function ds({
947
956
  /* @__PURE__ */ e(
948
957
  "input",
949
958
  {
950
- ref: l,
959
+ ref: r,
951
960
  type: "text",
952
961
  placeholder: n,
953
962
  value: t,
@@ -961,7 +970,7 @@ function ds({
961
970
  label: "Clear search",
962
971
  onClick: () => {
963
972
  var o;
964
- s(""), (o = l.current) == null || o.focus();
973
+ s(""), (o = r.current) == null || o.focus();
965
974
  },
966
975
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
967
976
  children: /* @__PURE__ */ e(le, { className: "h-4 w-4", weight: "bold" })
@@ -973,69 +982,69 @@ const us = ({
973
982
  participantSource: t,
974
983
  onSelectParticipant: s,
975
984
  onClose: n,
976
- existingParticipantIds: l = /* @__PURE__ */ new Set(),
985
+ existingParticipantIds: r = /* @__PURE__ */ new Set(),
977
986
  participantLabel: o = "participants",
978
987
  searchPlaceholder: a = "Search participants...",
979
- className: r
988
+ className: l
980
989
  }) => {
981
- const { debug: i } = se(), [m, x] = E(""), [k, h] = E([]), [f, y] = E(!1), [g, C] = E(null), [w, v] = E(
990
+ const { debug: c } = se(), [m, g] = v(""), [E, h] = v([]), [f, k] = v(!1), [b, w] = v(null), [y, N] = v(
982
991
  null
983
- ), I = B(!1);
984
- H(() => {
992
+ ), I = z(!1);
993
+ G(() => {
985
994
  if (t.loading) {
986
- i && console.log(
995
+ c && console.log(
987
996
  "[ParticipantPicker] Waiting for participant source to finish loading..."
988
997
  );
989
998
  return;
990
999
  }
991
1000
  if (I.current) return;
992
1001
  (async () => {
993
- i && console.log("[ParticipantPicker] Loading initial participants..."), y(!0), C(null);
1002
+ c && console.log("[ParticipantPicker] Loading initial participants..."), k(!0), w(null);
994
1003
  try {
995
1004
  const u = await t.loadParticipants({
996
1005
  search: "",
997
1006
  // Load all participants initially
998
1007
  limit: 100
999
1008
  });
1000
- h(u.participants), I.current = !0, i && console.log(
1009
+ h(u.participants), I.current = !0, c && console.log(
1001
1010
  "[ParticipantPicker] Participants loaded successfully:",
1002
1011
  u.participants.length
1003
1012
  );
1004
1013
  } catch (u) {
1005
- const N = u instanceof Error ? u.message : "Failed to load participants";
1006
- C(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1014
+ const x = u instanceof Error ? u.message : "Failed to load participants";
1015
+ w(x), console.error("[ParticipantPicker] Failed to load participants:", u);
1007
1016
  } finally {
1008
- y(!1);
1017
+ k(!1);
1009
1018
  }
1010
1019
  })();
1011
- }, [t.loading, i]);
1012
- const S = k.filter((d) => !l.has(d.id)).filter((d) => {
1013
- var N;
1020
+ }, [t.loading, c]);
1021
+ const S = E.filter((d) => !r.has(d.id)).filter((d) => {
1022
+ var x;
1014
1023
  if (!m) return !0;
1015
1024
  const u = m.toLowerCase();
1016
- return d.name.toLowerCase().includes(u) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1017
- }), p = _(
1025
+ return d.name.toLowerCase().includes(u) || ((x = d.email) == null ? void 0 : x.toLowerCase().includes(u)) || !1;
1026
+ }), R = F(
1018
1027
  async (d) => {
1019
- if (!w) {
1020
- v(d.id);
1028
+ if (!y) {
1029
+ N(d.id);
1021
1030
  try {
1022
1031
  await s(d);
1023
1032
  } catch (u) {
1024
- console.error("[ParticipantPicker] Failed to start chat:", u), v(null);
1033
+ console.error("[ParticipantPicker] Failed to start chat:", u), N(null);
1025
1034
  }
1026
1035
  }
1027
1036
  },
1028
- [s, w]
1029
- ), T = (d, u) => {
1030
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), p(u));
1037
+ [s, y]
1038
+ ), _ = (d, u) => {
1039
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), R(u));
1031
1040
  };
1032
- return /* @__PURE__ */ c("div", { className: R("flex flex-col h-full", r), children: [
1033
- /* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1034
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
1041
+ return /* @__PURE__ */ i("div", { className: p("flex flex-col h-full", l), children: [
1042
+ /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1043
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1035
1044
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1036
- /* @__PURE__ */ e(Ne, { onClick: n })
1045
+ /* @__PURE__ */ e(Ce, { onClick: n })
1037
1046
  ] }),
1038
- /* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
1047
+ /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1039
1048
  "Select a ",
1040
1049
  o.slice(0, -1),
1041
1050
  " to start messaging (",
@@ -1047,42 +1056,42 @@ const us = ({
1047
1056
  ds,
1048
1057
  {
1049
1058
  searchQuery: m,
1050
- setSearchQuery: x,
1059
+ setSearchQuery: g,
1051
1060
  placeholder: a
1052
1061
  }
1053
1062
  )
1054
1063
  ] }),
1055
- g && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1064
+ b && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1056
1065
  "Error loading ",
1057
1066
  o,
1058
1067
  ": ",
1059
- g
1068
+ b
1060
1069
  ] }),
1061
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && S.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: [
1070
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && 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: [
1062
1071
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1063
- /* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
1072
+ /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1064
1073
  "Loading ",
1065
1074
  o,
1066
1075
  "..."
1067
1076
  ] })
1068
- ] }) }) : S.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
1077
+ ] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1069
1078
  /* @__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" }) }),
1070
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: m ? `No ${o} found` : k.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1071
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: m ? "Try a different search term" : k.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1072
- ] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
1079
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: m ? `No ${o} found` : E.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1080
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: m ? "Try a different search term" : E.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1081
+ ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1073
1082
  S.map((d) => {
1074
- const u = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
1083
+ const u = d.name || d.email || d.id, x = d.email && d.name ? d.email : d.phone;
1075
1084
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1076
1085
  "button",
1077
1086
  {
1078
1087
  type: "button",
1079
- onClick: () => p(d),
1080
- onKeyDown: (j) => T(j, d),
1088
+ onClick: () => R(d),
1089
+ onKeyDown: (j) => _(j, d),
1081
1090
  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",
1082
- children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1083
- /* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1091
+ children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1092
+ /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1084
1093
  /* @__PURE__ */ e(
1085
- Y,
1094
+ q,
1086
1095
  {
1087
1096
  id: d.id,
1088
1097
  name: u,
@@ -1090,27 +1099,163 @@ const us = ({
1090
1099
  size: 40
1091
1100
  }
1092
1101
  ),
1093
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
1102
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1094
1103
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1095
- N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1104
+ x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
1096
1105
  ] })
1097
1106
  ] }),
1098
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === d.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
1107
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === d.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
1099
1108
  ] })
1100
1109
  }
1101
1110
  ) }, d.id);
1102
1111
  }),
1103
- f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1112
+ f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1104
1113
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1105
1114
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1106
1115
  ] }) })
1107
1116
  ] }) })
1108
1117
  ] });
1109
- }, ms = ({ hasChannels: t }) => /* @__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: [
1110
- /* @__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: "๐Ÿ’ฌ" }) }),
1111
- /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal", children: "Welcome to Messages" }),
1112
- /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t ? "Choose a conversation from the list." : "No conversations yet." })
1113
- ] }) }), re = ({ 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: [
1118
+ }, ms = ({ className: t }) => /* @__PURE__ */ i(
1119
+ "svg",
1120
+ {
1121
+ width: "140",
1122
+ height: "120",
1123
+ viewBox: "44 -2 144 126",
1124
+ fill: "none",
1125
+ xmlns: "http://www.w3.org/2000/svg",
1126
+ className: t,
1127
+ children: [
1128
+ /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1129
+ /* @__PURE__ */ e(
1130
+ "path",
1131
+ {
1132
+ d: "M123.68 82.1932C123.383 103.675 105.839 121 84.2417 121C77.4724 121 71.0986 119.297 65.5327 116.299L52.5873 119.687L53.8036 106.673C48.1776 99.8701 44.7994 91.1453 44.7994 81.6356C44.7994 59.8965 62.4554 42.2754 84.2374 42.2754C89.1328 42.2754 93.8175 43.1633 98.1413 44.789",
1133
+ fill: "#D7D4CE"
1134
+ }
1135
+ ),
1136
+ /* @__PURE__ */ e(
1137
+ "path",
1138
+ {
1139
+ d: "M84.2458 86.0364C82.2851 86.0364 80.6957 84.4501 80.6957 82.4933C80.6957 80.5365 82.2851 78.9502 84.2458 78.9502C86.2065 78.9502 87.7959 80.5365 87.7959 82.4933C87.7959 84.4501 86.2065 86.0364 84.2458 86.0364Z",
1140
+ fill: "white"
1141
+ }
1142
+ ),
1143
+ /* @__PURE__ */ e(
1144
+ "path",
1145
+ {
1146
+ d: "M68.3044 86.0364C66.3437 86.0364 64.7543 84.4501 64.7543 82.4933C64.7543 80.5365 66.3437 78.9502 68.3044 78.9502C70.2651 78.9502 71.8545 80.5365 71.8545 82.4933C71.8545 84.4501 70.2651 86.0364 68.3044 86.0364Z",
1147
+ fill: "white"
1148
+ }
1149
+ ),
1150
+ /* @__PURE__ */ e(
1151
+ "path",
1152
+ {
1153
+ d: "M100.183 86.0364C98.2226 86.0364 96.6332 84.4501 96.6332 82.4933C96.6332 80.5365 98.2226 78.9502 100.183 78.9502C102.144 78.9502 103.733 80.5365 103.733 82.4933C103.733 84.4501 102.144 86.0364 100.183 86.0364Z",
1154
+ fill: "white"
1155
+ }
1156
+ ),
1157
+ /* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
1158
+ /* @__PURE__ */ e(
1159
+ "path",
1160
+ {
1161
+ d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
1162
+ fill: "white"
1163
+ }
1164
+ ),
1165
+ /* @__PURE__ */ e(
1166
+ "path",
1167
+ {
1168
+ d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
1169
+ stroke: "#D7D4CE",
1170
+ strokeWidth: "2",
1171
+ strokeMiterlimit: "10"
1172
+ }
1173
+ )
1174
+ ] }),
1175
+ /* @__PURE__ */ e(
1176
+ "path",
1177
+ {
1178
+ d: "M139.502 45.5431C137.541 45.5431 135.952 43.9568 135.952 42C135.952 40.0432 137.541 38.4569 139.502 38.4569C141.462 38.4569 143.052 40.0432 143.052 42C143.052 43.9568 141.462 45.5431 139.502 45.5431Z",
1179
+ fill: "#D7D4CE"
1180
+ }
1181
+ ),
1182
+ /* @__PURE__ */ e(
1183
+ "path",
1184
+ {
1185
+ d: "M123.561 45.5431C121.601 45.5431 120.011 43.9568 120.011 42C120.011 40.0432 121.601 38.4569 123.561 38.4569C125.522 38.4569 127.111 40.0432 127.111 42C127.111 43.9568 125.522 45.5431 123.561 45.5431Z",
1186
+ fill: "#D7D4CE"
1187
+ }
1188
+ ),
1189
+ /* @__PURE__ */ e(
1190
+ "path",
1191
+ {
1192
+ d: "M155.439 45.5431C153.478 45.5431 151.889 43.9568 151.889 42C151.889 40.0432 153.478 38.4569 155.439 38.4569C157.4 38.4569 158.989 40.0432 158.989 42C158.989 43.9568 157.4 45.5431 155.439 45.5431Z",
1193
+ fill: "#D7D4CE"
1194
+ }
1195
+ )
1196
+ ] }),
1197
+ /* @__PURE__ */ i("defs", { children: [
1198
+ /* @__PURE__ */ i(
1199
+ "filter",
1200
+ {
1201
+ id: "filter0_empty_state",
1202
+ x: "97",
1203
+ y: "-1",
1204
+ width: "89",
1205
+ height: "90",
1206
+ filterUnits: "userSpaceOnUse",
1207
+ colorInterpolationFilters: "sRGB",
1208
+ children: [
1209
+ /* @__PURE__ */ e("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1210
+ /* @__PURE__ */ e(
1211
+ "feColorMatrix",
1212
+ {
1213
+ in: "SourceAlpha",
1214
+ type: "matrix",
1215
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
1216
+ result: "hardAlpha"
1217
+ }
1218
+ ),
1219
+ /* @__PURE__ */ e("feOffset", { dx: "4", dy: "4" }),
1220
+ /* @__PURE__ */ e("feComposite", { in2: "hardAlpha", operator: "out" }),
1221
+ /* @__PURE__ */ e(
1222
+ "feColorMatrix",
1223
+ {
1224
+ type: "matrix",
1225
+ values: "0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
1226
+ }
1227
+ ),
1228
+ /* @__PURE__ */ e(
1229
+ "feBlend",
1230
+ {
1231
+ mode: "normal",
1232
+ in2: "BackgroundImageFix",
1233
+ result: "effect1_dropShadow"
1234
+ }
1235
+ ),
1236
+ /* @__PURE__ */ e(
1237
+ "feBlend",
1238
+ {
1239
+ mode: "normal",
1240
+ in: "SourceGraphic",
1241
+ in2: "effect1_dropShadow",
1242
+ result: "shape"
1243
+ }
1244
+ )
1245
+ ]
1246
+ }
1247
+ ),
1248
+ /* @__PURE__ */ e("clipPath", { id: "clip0_empty_state", children: /* @__PURE__ */ e("rect", { width: "233", height: "233", fill: "white" }) })
1249
+ ] })
1250
+ ]
1251
+ }
1252
+ ), hs = ({ hasChannels: t }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1253
+ /* @__PURE__ */ e(ms, {}),
1254
+ !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1255
+ /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1256
+ /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1257
+ ] })
1258
+ ] }) }), re = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1114
1259
  /* @__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: "โš ๏ธ" }) }),
1115
1260
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1116
1261
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1123,12 +1268,12 @@ const us = ({
1123
1268
  children: "Go Back"
1124
1269
  }
1125
1270
  )
1126
- ] }) }), hs = ({ className: t, message: s }) => /* @__PURE__ */ c(
1271
+ ] }) }), fs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1127
1272
  "div",
1128
1273
  {
1129
- className: R("flex items-center justify-center h-full", t),
1274
+ className: p("flex items-center justify-center h-full", t),
1130
1275
  children: [
1131
- /* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1276
+ /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1132
1277
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
1133
1278
  "animateTransform",
1134
1279
  {
@@ -1166,87 +1311,87 @@ const us = ({
1166
1311
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1167
1312
  ]
1168
1313
  }
1169
- ), fs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1170
- /* @__PURE__ */ e(hs, { className: "w-6 h-6" }),
1314
+ ), gs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1315
+ /* @__PURE__ */ e(fs, { className: "w-6 h-6" }),
1171
1316
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1172
- ] }) }), Is = ({
1317
+ ] }) }), Ss = ({
1173
1318
  capabilities: t = {},
1174
1319
  className: s,
1175
1320
  renderMessageInputActions: n,
1176
- onChannelSelect: l,
1321
+ onChannelSelect: r,
1177
1322
  onParticipantSelect: o,
1178
1323
  initialParticipantFilter: a,
1179
- initialParticipantData: r,
1180
- CustomChannelEmptyState: i,
1324
+ initialParticipantData: l,
1325
+ CustomChannelEmptyState: c,
1181
1326
  showChannelList: m = !0,
1182
- filters: x,
1183
- channelListCustomEmptyStateIndicator: k
1327
+ filters: g,
1328
+ channelListCustomEmptyStateIndicator: E
1184
1329
  }) => {
1185
1330
  const {
1186
1331
  service: h,
1187
1332
  client: f,
1188
- isConnected: y,
1189
- isLoading: g,
1190
- error: C,
1191
- refreshConnection: w,
1192
- debug: v
1193
- } = qe(), [I, S] = E(null), [p, T] = E(!1), [d, u] = E(!1), [N, j] = E(/* @__PURE__ */ new Set()), [A, W] = E(0), [O, G] = E(!1), [J, $] = E(null), V = B(null), { participantSource: Q, participantLabel: F = "participants" } = t, M = q.useMemo(() => {
1194
- const b = f == null ? void 0 : f.userID;
1333
+ isConnected: k,
1334
+ isLoading: b,
1335
+ error: w,
1336
+ refreshConnection: y,
1337
+ debug: N
1338
+ } = We(), [I, S] = v(null), [R, _] = v(!1), [d, u] = v(!1), [x, j] = v(/* @__PURE__ */ new Set()), [A, W] = v(0), [O, $] = v(!1), [Y, H] = v(null), V = z(null), { participantSource: J, participantLabel: D = "participants" } = t, T = Z.useMemo(() => {
1339
+ const C = f == null ? void 0 : f.userID;
1195
1340
  return {
1196
1341
  ...{
1197
1342
  type: "messaging",
1198
1343
  last_message_at: { $exists: !0 },
1199
- ...b && {
1200
- members: { $in: [b] },
1344
+ ...C && {
1345
+ members: { $in: [C] },
1201
1346
  hidden: !1
1202
1347
  }
1203
1348
  },
1204
- ...x
1349
+ ...g
1205
1350
  };
1206
- }, [x, f == null ? void 0 : f.userID]), P = B(null), L = _(async () => {
1207
- if (!f || !y) return;
1208
- const b = f.userID;
1209
- if (b)
1351
+ }, [g, f == null ? void 0 : f.userID]), P = z(null), L = F(async () => {
1352
+ if (!f || !k) return;
1353
+ const C = f.userID;
1354
+ if (C)
1210
1355
  try {
1211
- v && console.log("[MessagingShell] Syncing channels for user:", b);
1356
+ N && console.log("[MessagingShell] Syncing channels for user:", C);
1212
1357
  const U = await f.queryChannels(
1213
1358
  {
1214
1359
  type: "messaging",
1215
- members: { $in: [b] }
1360
+ members: { $in: [C] }
1216
1361
  },
1217
1362
  {},
1218
1363
  { limit: 100 }
1219
- ), D = /* @__PURE__ */ new Set();
1220
- U.forEach((z) => {
1221
- const ye = z.state.members;
1222
- Object.values(ye).forEach((Ie) => {
1364
+ ), M = /* @__PURE__ */ new Set();
1365
+ U.forEach((B) => {
1366
+ const Ee = B.state.members;
1367
+ Object.values(Ee).forEach((ye) => {
1223
1368
  var oe;
1224
- const ne = (oe = Ie.user) == null ? void 0 : oe.id;
1225
- ne && ne !== b && D.add(ne);
1369
+ const ne = (oe = ye.user) == null ? void 0 : oe.id;
1370
+ ne && ne !== C && M.add(ne);
1226
1371
  });
1227
- }), j(D), T(U.length > 0), P.current = b, v && console.log("[MessagingShell] Channels synced successfully:", {
1372
+ }), j(M), _(U.length > 0), P.current = C, N && console.log("[MessagingShell] Channels synced successfully:", {
1228
1373
  channelCount: U.length,
1229
- memberCount: D.size
1374
+ memberCount: M.size
1230
1375
  });
1231
1376
  } catch (U) {
1232
1377
  console.error("[MessagingShell] Failed to sync channels:", U);
1233
1378
  }
1234
- }, [f, y, v]);
1235
- H(() => {
1236
- if (!f || !y) return;
1237
- const b = f.userID;
1238
- b && P.current !== b && L();
1239
- }, [f, y, L]), H(() => {
1240
- if (!a || !f || !y) return;
1379
+ }, [f, k, N]);
1380
+ G(() => {
1381
+ if (!f || !k) return;
1382
+ const C = f.userID;
1383
+ C && P.current !== C && L();
1384
+ }, [f, k, L]), G(() => {
1385
+ if (!a || !f || !k) return;
1241
1386
  (async () => {
1242
1387
  const U = f.userID;
1243
1388
  if (U)
1244
1389
  try {
1245
- v && console.log(
1390
+ N && console.log(
1246
1391
  "[MessagingShell] Loading initial conversation with:",
1247
1392
  a
1248
1393
  );
1249
- const D = await f.queryChannels(
1394
+ const M = await f.queryChannels(
1250
1395
  {
1251
1396
  type: "messaging",
1252
1397
  members: { $eq: [U, a] }
@@ -1254,139 +1399,139 @@ const us = ({
1254
1399
  {},
1255
1400
  { limit: 1 }
1256
1401
  );
1257
- if (D.length > 0)
1258
- S(D[0]), G(!0), $(null), l && l(D[0]), v && console.log(
1402
+ if (M.length > 0)
1403
+ S(M[0]), $(!0), H(null), r && r(M[0]), N && console.log(
1259
1404
  "[MessagingShell] Initial conversation loaded:",
1260
- D[0].id
1405
+ M[0].id
1261
1406
  );
1262
- else if (r && h) {
1263
- v && console.log(
1407
+ else if (l && h) {
1408
+ N && console.log(
1264
1409
  "[MessagingShell] No conversation found, creating one for:",
1265
- r
1410
+ l
1266
1411
  );
1267
1412
  try {
1268
- const z = await h.startChannelWithParticipant({
1269
- id: r.id,
1270
- name: r.name,
1271
- email: r.email,
1272
- phone: r.phone
1413
+ const B = await h.startChannelWithParticipant({
1414
+ id: l.id,
1415
+ name: l.name,
1416
+ email: l.email,
1417
+ phone: l.phone
1273
1418
  });
1274
- S(z), G(!0), $(null), l && l(z), v && console.log(
1419
+ S(B), $(!0), H(null), r && r(B), N && console.log(
1275
1420
  "[MessagingShell] Channel created and loaded:",
1276
- z.id
1421
+ B.id
1277
1422
  );
1278
- } catch (z) {
1423
+ } catch (B) {
1279
1424
  console.error(
1280
1425
  "[MessagingShell] Failed to create conversation:",
1281
- z
1282
- ), $("Failed to create conversation");
1426
+ B
1427
+ ), H("Failed to create conversation");
1283
1428
  }
1284
1429
  } else
1285
- $(
1430
+ H(
1286
1431
  "No conversation found with this account"
1287
- ), v && console.log(
1432
+ ), N && console.log(
1288
1433
  "[MessagingShell] No conversation found for:",
1289
1434
  a
1290
1435
  );
1291
- } catch (D) {
1436
+ } catch (M) {
1292
1437
  console.error(
1293
1438
  "[MessagingShell] Failed to load initial conversation:",
1294
- D
1295
- ), $("Failed to load conversation");
1439
+ M
1440
+ ), H("Failed to load conversation");
1296
1441
  }
1297
1442
  })();
1298
1443
  }, [
1299
1444
  a,
1300
- r,
1445
+ l,
1301
1446
  f,
1302
- y,
1447
+ k,
1303
1448
  h,
1304
- v,
1305
- l
1449
+ N,
1450
+ r
1306
1451
  ]);
1307
- const X = _(
1308
- (b) => {
1309
- S(b), l == null || l(b);
1452
+ const Q = F(
1453
+ (C) => {
1454
+ S(C), r == null || r(C);
1310
1455
  },
1311
- [l]
1312
- ), ve = _(() => {
1456
+ [r]
1457
+ ), Ne = F(() => {
1313
1458
  O || S(null);
1314
- }, [O]), Ce = _(
1315
- async (b) => {
1459
+ }, [O]), be = F(
1460
+ async (C) => {
1316
1461
  var U;
1317
1462
  if (h)
1318
1463
  try {
1319
- v && console.log(
1464
+ N && console.log(
1320
1465
  "[MessagingShell] Starting conversation with:",
1321
- b.id
1466
+ C.id
1322
1467
  );
1323
- const D = await h.startChannelWithParticipant({
1324
- id: b.id,
1325
- name: b.name,
1326
- email: b.email,
1327
- phone: b.phone
1468
+ const M = await h.startChannelWithParticipant({
1469
+ id: C.id,
1470
+ name: C.name,
1471
+ email: C.email,
1472
+ phone: C.phone
1328
1473
  });
1329
1474
  try {
1330
- await D.show();
1331
- } catch (z) {
1332
- console.warn("[MessagingShell] Failed to unhide channel:", z);
1475
+ await M.show();
1476
+ } catch (B) {
1477
+ console.warn("[MessagingShell] Failed to unhide channel:", B);
1333
1478
  }
1334
- S(D), u(!1), (U = V.current) == null || U.close(), o == null || o(b);
1335
- } catch (D) {
1336
- console.error("[MessagingShell] Failed to start conversation:", D);
1479
+ S(M), u(!1), (U = V.current) == null || U.close(), o == null || o(C);
1480
+ } catch (M) {
1481
+ console.error("[MessagingShell] Failed to start conversation:", M);
1337
1482
  }
1338
1483
  },
1339
- [h, o, v]
1340
- ), te = _(() => {
1341
- var b;
1342
- u(!1), (b = V.current) == null || b.close();
1343
- }, []), we = _(
1344
- async (b) => {
1345
- v && console.log("[MessagingShell] Leaving conversation:", b.id), S(null), G(!1), P.current = null, await L();
1484
+ [h, o, N]
1485
+ ), te = F(() => {
1486
+ var C;
1487
+ u(!1), (C = V.current) == null || C.close();
1488
+ }, []), ve = F(
1489
+ async (C) => {
1490
+ N && console.log("[MessagingShell] Leaving conversation:", C.id), S(null), $(!1), P.current = null, await L();
1346
1491
  },
1347
- [L, v]
1348
- ), Ee = _(
1349
- async (b) => {
1350
- v && console.log("[MessagingShell] Blocking participant:", b), S(null), G(!1), P.current = null, await L();
1492
+ [L, N]
1493
+ ), we = F(
1494
+ async (C) => {
1495
+ N && console.log("[MessagingShell] Blocking participant:", C), S(null), $(!1), P.current = null, await L();
1351
1496
  },
1352
- [L, v]
1353
- ), Z = !!I;
1354
- return g ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(fs, {}) }) : C ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(re, { message: C, onBack: w }) }) : !y || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1497
+ [L, N]
1498
+ ), X = !!I;
1499
+ return b ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(gs, {}) }) : w ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: w, onBack: y }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1355
1500
  re,
1356
1501
  {
1357
1502
  message: "Not connected to messaging service",
1358
- onBack: w
1503
+ onBack: y
1359
1504
  }
1360
- ) }) : J ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(re, { message: J }) }) : /* @__PURE__ */ c(
1505
+ ) }) : Y ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: Y }) }) : /* @__PURE__ */ i(
1361
1506
  "div",
1362
1507
  {
1363
- className: R(
1364
- "messaging-shell h-full bg-white overflow-hidden",
1508
+ className: p(
1509
+ "messaging-shell h-full bg-background-secondary overflow-hidden",
1365
1510
  s
1366
1511
  ),
1367
1512
  children: [
1368
- /* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
1513
+ /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1369
1514
  /* @__PURE__ */ e(
1370
1515
  "div",
1371
1516
  {
1372
- className: R(
1373
- "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",
1517
+ className: p(
1518
+ "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1374
1519
  {
1375
1520
  // Explicitly hidden via prop or in direct conversation mode
1376
1521
  "!hidden": m === !1 || O,
1377
1522
  // Normal mode: hide on mobile when channel selected, show on desktop
1378
- "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": m !== !1 && !O && Z,
1523
+ "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": m !== !1 && !O && X,
1379
1524
  // Normal mode: show when no channel selected
1380
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !O && !Z
1525
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !O && !X
1381
1526
  }
1382
1527
  ),
1383
1528
  children: /* @__PURE__ */ e(
1384
- Ke,
1529
+ Xe,
1385
1530
  {
1386
- onChannelSelect: X,
1531
+ onChannelSelect: Q,
1387
1532
  selectedChannel: I || void 0,
1388
- filters: M,
1389
- customEmptyStateIndicator: k
1533
+ filters: T,
1534
+ customEmptyStateIndicator: E
1390
1535
  }
1391
1536
  )
1392
1537
  }
@@ -1394,50 +1539,50 @@ const us = ({
1394
1539
  /* @__PURE__ */ e(
1395
1540
  "div",
1396
1541
  {
1397
- className: R(
1542
+ className: p(
1398
1543
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1399
1544
  {
1400
1545
  // In direct conversation mode, always show (full width)
1401
- flex: O || Z,
1546
+ flex: O || X,
1402
1547
  // Normal mode: hide on mobile when no channel selected
1403
- "hidden lg:flex": !O && !Z
1548
+ "hidden lg:flex": !O && !X
1404
1549
  }
1405
1550
  ),
1406
1551
  children: I ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1407
1552
  cs,
1408
1553
  {
1409
1554
  channel: I,
1410
- onBack: ve,
1555
+ onBack: Ne,
1411
1556
  showBackButton: !O,
1412
1557
  renderMessageInputActions: n,
1413
- onLeaveConversation: we,
1414
- onBlockParticipant: Ee,
1415
- CustomChannelEmptyState: i
1558
+ onLeaveConversation: ve,
1559
+ onBlockParticipant: we,
1560
+ CustomChannelEmptyState: c
1416
1561
  },
1417
1562
  I.id
1418
- ) }) : /* @__PURE__ */ e(ms, { hasChannels: p })
1563
+ ) }) : /* @__PURE__ */ e(hs, { hasChannels: R })
1419
1564
  }
1420
1565
  )
1421
1566
  ] }),
1422
- Q && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1567
+ J && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1423
1568
  /* @__PURE__ */ e(
1424
1569
  "dialog",
1425
1570
  {
1426
1571
  ref: V,
1427
1572
  className: "mes-dialog",
1428
- onClick: (b) => {
1429
- b.target === V.current && te();
1573
+ onClick: (C) => {
1574
+ C.target === V.current && te();
1430
1575
  },
1431
1576
  onClose: te,
1432
1577
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1433
1578
  us,
1434
1579
  {
1435
- participantSource: Q,
1436
- onSelectParticipant: Ce,
1580
+ participantSource: J,
1581
+ onSelectParticipant: be,
1437
1582
  onClose: te,
1438
- existingParticipantIds: N,
1439
- participantLabel: F,
1440
- searchPlaceholder: `Search ${F}...`
1583
+ existingParticipantIds: x,
1584
+ participantLabel: D,
1585
+ searchPlaceholder: `Search ${D}...`
1441
1586
  },
1442
1587
  A
1443
1588
  ) })
@@ -1446,11 +1591,11 @@ const us = ({
1446
1591
  ]
1447
1592
  }
1448
1593
  );
1449
- }, gs = ({
1594
+ }, xs = ({
1450
1595
  question: t,
1451
1596
  onClick: s,
1452
1597
  loading: n = !1,
1453
- className: l
1598
+ className: r
1454
1599
  }) => /* @__PURE__ */ e(
1455
1600
  "button",
1456
1601
  {
@@ -1458,46 +1603,46 @@ const us = ({
1458
1603
  onClick: s,
1459
1604
  disabled: n,
1460
1605
  style: { backgroundColor: "#E6E5E3" },
1461
- className: R(
1606
+ className: p(
1462
1607
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1463
1608
  {
1464
1609
  "hover:brightness-95 active:brightness-90": !n,
1465
1610
  "opacity-50 cursor-not-allowed": n
1466
1611
  },
1467
- l
1612
+ r
1468
1613
  ),
1469
1614
  children: t
1470
1615
  }
1471
- ), Ss = ({
1616
+ ), ks = ({
1472
1617
  faqs: t,
1473
1618
  onFaqClick: s,
1474
1619
  loadingFaqId: n,
1475
- headerText: l,
1620
+ headerText: r,
1476
1621
  className: o,
1477
1622
  avatarImage: a,
1478
- avatarName: r
1623
+ avatarName: l
1479
1624
  }) => {
1480
- const i = t.filter((m) => m.enabled).sort((m, x) => (m.order ?? 0) - (x.order ?? 0));
1481
- return i.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
1482
- (a || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1483
- Y,
1625
+ const c = t.filter((m) => m.enabled).sort((m, g) => (m.order ?? 0) - (g.order ?? 0));
1626
+ return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1627
+ (a || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1628
+ q,
1484
1629
  {
1485
- id: r || "account",
1486
- name: r || "Account",
1630
+ id: l || "account",
1631
+ name: l || "Account",
1487
1632
  image: a,
1488
1633
  size: 24,
1489
1634
  shape: "circle"
1490
1635
  }
1491
1636
  ) }),
1492
- /* @__PURE__ */ c(
1637
+ /* @__PURE__ */ i(
1493
1638
  "div",
1494
1639
  {
1495
1640
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1496
1641
  style: { backgroundColor: "#F1F0EE" },
1497
1642
  children: [
1498
- l && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: l }),
1499
- i.map((m) => /* @__PURE__ */ e(
1500
- gs,
1643
+ r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1644
+ c.map((m) => /* @__PURE__ */ e(
1645
+ xs,
1501
1646
  {
1502
1647
  question: m.question,
1503
1648
  onClick: () => s(m.id),
@@ -1509,59 +1654,59 @@ const us = ({
1509
1654
  }
1510
1655
  )
1511
1656
  ] }) });
1512
- }, ks = (t, s = {}) => {
1513
- const { initialSearch: n = "", pageSize: l = 20 } = s, [o, a] = E([]), [r, i] = E(!1), [m, x] = E(null), [k, h] = E(n), [f, y] = E(!0), [g, C] = E(), w = _(async (p = !1, T) => {
1514
- if (r) return;
1515
- const d = T !== void 0 ? T : k;
1516
- i(!0), x(null);
1657
+ }, ps = (t, s = {}) => {
1658
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [o, a] = v([]), [l, c] = v(!1), [m, g] = v(null), [E, h] = v(n), [f, k] = v(!0), [b, w] = v(), y = F(async (R = !1, _) => {
1659
+ if (l) return;
1660
+ const d = _ !== void 0 ? _ : E;
1661
+ c(!0), g(null);
1517
1662
  try {
1518
1663
  const u = await t.loadParticipants({
1519
1664
  search: d || void 0,
1520
- limit: l,
1521
- cursor: p ? void 0 : g
1665
+ limit: r,
1666
+ cursor: R ? void 0 : b
1522
1667
  });
1523
1668
  a(
1524
- (N) => p ? u.participants : [...N, ...u.participants]
1525
- ), y(u.hasMore), C(u.nextCursor);
1669
+ (x) => R ? u.participants : [...x, ...u.participants]
1670
+ ), k(u.hasMore), w(u.nextCursor);
1526
1671
  } catch (u) {
1527
- const N = u instanceof Error ? u.message : "Failed to load participants";
1528
- x(N), console.error("[useParticipants] Load error:", u);
1672
+ const x = u instanceof Error ? u.message : "Failed to load participants";
1673
+ g(x), console.error("[useParticipants] Load error:", u);
1529
1674
  } finally {
1530
- i(!1);
1675
+ c(!1);
1531
1676
  }
1532
- }, [t, k, g, l, r]), v = _(() => {
1533
- f && !r && w(!1);
1534
- }, [f, r, w]), I = _((p) => {
1535
- h(p), C(void 0), w(!0, p);
1536
- }, [w]), S = _(() => {
1537
- C(void 0), w(!0);
1538
- }, [w]);
1539
- return H(() => {
1540
- w(!0);
1677
+ }, [t, E, b, r, l]), N = F(() => {
1678
+ f && !l && y(!1);
1679
+ }, [f, l, y]), I = F((R) => {
1680
+ h(R), w(void 0), y(!0, R);
1681
+ }, [y]), S = F(() => {
1682
+ w(void 0), y(!0);
1683
+ }, [y]);
1684
+ return G(() => {
1685
+ y(!0);
1541
1686
  }, [t.loadParticipants]), {
1542
1687
  participants: o,
1543
- loading: r,
1688
+ loading: l,
1544
1689
  error: m,
1545
- searchQuery: k,
1690
+ searchQuery: E,
1546
1691
  hasMore: f,
1547
1692
  totalCount: t.totalCount,
1548
- loadMore: v,
1693
+ loadMore: N,
1549
1694
  search: I,
1550
1695
  refresh: S
1551
1696
  };
1552
1697
  };
1553
1698
  export {
1554
- Y as Avatar,
1555
- be as ChannelEmptyState,
1556
- Ke as ChannelList,
1699
+ q as Avatar,
1700
+ ls as ChannelEmptyState,
1701
+ Xe as ChannelList,
1557
1702
  cs as ChannelView,
1558
- Ss as FaqList,
1559
- gs as FaqListItem,
1560
- ys as MessagingProvider,
1561
- Is as MessagingShell,
1703
+ ks as FaqList,
1704
+ xs as FaqListItem,
1705
+ Is as MessagingProvider,
1706
+ Ss as MessagingShell,
1562
1707
  us as ParticipantPicker,
1563
- Je as formatRelativeTime,
1564
- qe as useMessaging,
1565
- ks as useParticipants
1708
+ qe as formatRelativeTime,
1709
+ We as useMessaging,
1710
+ ps as useParticipants
1566
1711
  };
1567
1712
  //# sourceMappingURL=index.js.map