@linktr.ee/messaging-react 1.26.1 → 1.28.0-rc-1776225927

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.
Files changed (58) hide show
  1. package/dist/Creator-D38dWn2X.js +318 -0
  2. package/dist/Creator-D38dWn2X.js.map +1 -0
  3. package/dist/MediaPlayer-DE9MC6k6.js +599 -0
  4. package/dist/MediaPlayer-DE9MC6k6.js.map +1 -0
  5. package/dist/Preview-DqAv16NS.js +87 -0
  6. package/dist/Preview-DqAv16NS.js.map +1 -0
  7. package/dist/Visitor-BG-9-3HU.js +199 -0
  8. package/dist/Visitor-BG-9-3HU.js.map +1 -0
  9. package/dist/dash.all.min-Duv4lvGS.js +18858 -0
  10. package/dist/dash.all.min-Duv4lvGS.js.map +1 -0
  11. package/dist/hls-Bogc7CBn.js +21710 -0
  12. package/dist/hls-Bogc7CBn.js.map +1 -0
  13. package/dist/index-Da-xN4Yq.js +16142 -0
  14. package/dist/index-Da-xN4Yq.js.map +1 -0
  15. package/dist/index-Dj9rqWcU.js +69 -0
  16. package/dist/index-Dj9rqWcU.js.map +1 -0
  17. package/dist/index.d.ts +74 -10
  18. package/dist/index.js +979 -934
  19. package/dist/index.js.map +1 -1
  20. package/dist/mixin-B6jYfIcp.js +808 -0
  21. package/dist/mixin-B6jYfIcp.js.map +1 -0
  22. package/dist/react-BxlQMOfz.js +419 -0
  23. package/dist/react-BxlQMOfz.js.map +1 -0
  24. package/dist/react-COAP-MIW.js +377 -0
  25. package/dist/react-COAP-MIW.js.map +1 -0
  26. package/dist/react-Cn4WlMcl.js +3108 -0
  27. package/dist/react-Cn4WlMcl.js.map +1 -0
  28. package/dist/react-CwTJArKY.js +459 -0
  29. package/dist/react-CwTJArKY.js.map +1 -0
  30. package/dist/react-DkfS_atT.js +373 -0
  31. package/dist/react-DkfS_atT.js.map +1 -0
  32. package/dist/react-Pea5fum1.js +286 -0
  33. package/dist/react-Pea5fum1.js.map +1 -0
  34. package/dist/react-RiBbsUDd.js +534 -0
  35. package/dist/react-RiBbsUDd.js.map +1 -0
  36. package/dist/react-dS1WBxxz.js +238 -0
  37. package/dist/react-dS1WBxxz.js.map +1 -0
  38. package/package.json +2 -1
  39. package/src/components/ChannelView.tsx +12 -2
  40. package/src/components/CustomMessage/CustomMessage.stories.tsx +173 -41
  41. package/src/components/CustomMessage/MessageTag.tsx +5 -0
  42. package/src/components/CustomMessage/index.tsx +43 -4
  43. package/src/components/LockedAttachment/LockedAttachment.stories.tsx +343 -0
  44. package/src/components/LockedAttachment/components/Creator.tsx +469 -0
  45. package/src/components/LockedAttachment/components/MediaPlayer.tsx +359 -0
  46. package/src/components/LockedAttachment/components/Visitor.tsx +356 -0
  47. package/src/components/LockedAttachment/index.tsx +39 -0
  48. package/src/components/LockedAttachment/types.ts +17 -0
  49. package/src/components/LockedAttachment/utils/icons.ts +53 -0
  50. package/src/components/LockedAttachment/utils/mimeType.test.ts +119 -0
  51. package/src/components/LockedAttachment/utils/mimeType.ts +37 -0
  52. package/src/components/ParticipantPicker/index.tsx +8 -1
  53. package/src/hooks/useParticipants.ts +3 -2
  54. package/src/index.ts +4 -0
  55. package/src/stories/decorators/storyUser.tsx +37 -0
  56. package/src/stream-custom-data.ts +9 -3
  57. package/src/types.ts +20 -1
  58. package/src/utils/isDevBuild.ts +10 -0
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as i, Fragment as de } from "react/jsx-runtime";
2
- import D from "classnames";
3
- import G, { createContext as ct, useContext as dt, useCallback as A, useState as k, useRef as X, useEffect as K, useMemo as Se } from "react";
4
- import { StreamChatService as mt } from "@linktr.ee/messaging-core";
5
- import { Chat as ut, ChannelList as ht, DateSeparator as ft, useChannelStateContext as Te, useChatContext as je, areMessageUIPropsEqual as gt, useMessageReminder as xt, useComponentContext as bt, Attachment as Ct, EditMessageModal as Nt, MessageBlocked as vt, MessageBouncePrompt as pt, MessageDeleted as yt, MessageIsThreadReplyInChannelButtonIndicator as wt, MessageRepliesCountButton as _t, ReminderNotification as Et, StreamedMessageText as St, messageHasAttachments as It, messageHasReactions as Mt, isDateSeparatorMessage as kt, isMessageBlocked as Tt, isMessageBounced as Dt, MessageBounceModal as Rt, Poll as Lt, MessageText as At, MessageErrorIcon as Pt, useMessageContext as ze, useMessageComposer as Ft, useStateStore as Ot, MessageInput as Ut, useMessageInputContext as Bt, useMessageComposerHasSendableData as Gt, SimpleAttachmentSelector as $t, QuotedMessagePreview as jt, AttachmentPreviewList as zt, TextareaComposer as Ht, MessageTimestamp as we, Channel as Vt, WithComponents as Yt, Window as Wt, MessageList as qt } from "stream-chat-react";
6
- import { StarIcon as Ie, GiftIcon as Zt, XIcon as De, SpinnerGapIcon as xe, SignOutIcon as Jt, ProhibitInsetIcon as Pe, FlagIcon as Xt, ArrowUpIcon as Kt, SparkleIcon as Qt, ProhibitIcon as es, ArrowLeftIcon as Fe, DotsThreeIcon as Oe, MagnifyingGlassIcon as ts, ChatCircleDotsIcon as Ue } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as Be } from "stream-chat";
8
- const He = ct({
1
+ import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
2
+ import L from "classnames";
3
+ import F, { createContext as ut, useContext as ht, useCallback as U, useState as T, useRef as K, useEffect as W, useMemo as Le, Suspense as $e } from "react";
4
+ import { StreamChatService as ft } from "@linktr.ee/messaging-core";
5
+ import { Chat as gt, ChannelList as xt, DateSeparator as bt, useChannelStateContext as Ie, useChatContext as Xe, areMessageUIPropsEqual as Ct, useMessageReminder as Nt, useComponentContext as pt, Attachment as yt, EditMessageModal as vt, MessageBlocked as wt, MessageBouncePrompt as _t, MessageDeleted as Et, MessageIsThreadReplyInChannelButtonIndicator as St, MessageRepliesCountButton as It, ReminderNotification as Mt, StreamedMessageText as kt, messageHasAttachments as Tt, messageHasReactions as Dt, isDateSeparatorMessage as Rt, isMessageBlocked as At, isMessageBounced as Lt, MessageBounceModal as Ut, MessageText as je, Poll as Pt, MessageErrorIcon as Ft, useMessageContext as Ke, useMessageComposer as Ot, useStateStore as Bt, MessageInput as Gt, useMessageInputContext as $t, useMessageComposerHasSendableData as jt, SimpleAttachmentSelector as zt, QuotedMessagePreview as Ht, AttachmentPreviewList as Vt, TextareaComposer as Yt, MessageTimestamp as De, Channel as Wt, WithComponents as qt, Window as Zt, MessageList as Jt } from "stream-chat-react";
6
+ import { StarIcon as Ue, GiftIcon as Xt, XIcon as Oe, SpinnerGapIcon as _e, SignOutIcon as Kt, ProhibitInsetIcon as ze, FlagIcon as Qt, ArrowUpIcon as es, SparkleIcon as ts, ProhibitIcon as ss, ArrowLeftIcon as He, DotsThreeIcon as Ve, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as Ye } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as We } from "stream-chat";
8
+ const Qe = ut({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,199 +15,199 @@ const He = ct({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), Ne = () => dt(He), Qs = ({
18
+ }), Me = () => ht(Qe), rn = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
- apiKey: o,
22
+ apiKey: r,
23
23
  capabilities: l = {},
24
24
  debug: d = !1
25
25
  }) => {
26
- const r = A(
27
- (u, ...C) => {
28
- d && console.log(`🔥 [MessagingProvider] ${u}`, ...C);
26
+ const a = U(
27
+ (u, ...f) => {
28
+ d && console.log(`🔥 [MessagingProvider] ${u}`, ...f);
29
29
  },
30
30
  [d]
31
31
  );
32
- r("🔄 RENDER START", {
32
+ a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
- apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
34
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, f] = k(null), [h, x] = k(null), [g, p] = k(!1), [a, w] = k(!1), [_, b] = k(null), M = X(!1), E = X({
38
+ const [c, g] = T(null), [h, b] = T(null), [N, S] = T(!1), [m, I] = T(!1), [o, v] = T(null), k = K(!1), y = K({
39
39
  userId: s == null ? void 0 : s.id,
40
- apiKey: o,
40
+ apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), y = X(0);
44
- y.current++, r("📊 RENDER INFO", {
45
- renderCount: y.current,
46
- currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
43
+ }), w = K(0);
44
+ w.current++, a("📊 RENDER INFO", {
45
+ renderCount: w.current,
46
+ currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: E.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: E.current.apiKey !== o,
50
- serviceConfigChanged: E.current.serviceConfig !== n,
51
- capabilitiesChanged: E.current.capabilities !== l
48
+ userChanged: y.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: y.current.apiKey !== r,
50
+ serviceConfigChanged: y.current.serviceConfig !== n,
51
+ capabilitiesChanged: y.current.capabilities !== l
52
52
  }
53
- }), E.current = {
53
+ }), y.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
- apiKey: o,
55
+ apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
- }, K(() => {
59
- const u = y.current;
60
- if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
58
+ }, W(() => {
59
+ const u = w.current;
60
+ if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
62
- apiKey: !!o,
62
+ apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
- apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
65
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: E.current.serviceConfig === n,
68
- apiKeyStable: E.current.apiKey === o
67
+ serviceConfigStable: y.current.serviceConfig === n,
68
+ apiKeyStable: y.current.apiKey === r
69
69
  }
70
- }), !o || !n) {
71
- r("⚠️ SERVICE INIT SKIPPED", {
70
+ }), !r || !n) {
71
+ a("⚠️ 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
+ a("🚀 CREATING NEW SERVICE", {
78
78
  renderCount: u,
79
- apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
- serviceConfigChanged: E.current.serviceConfig !== n
79
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
+ serviceConfigChanged: y.current.serviceConfig !== n
81
81
  });
82
- const C = new mt({
82
+ const f = new ft({
83
83
  ...n,
84
- apiKey: o,
84
+ apiKey: r,
85
85
  debug: d
86
86
  });
87
- return f(C), r("✅ SERVICE SET", {
87
+ return g(f), a("✅ SERVICE SET", {
88
88
  renderCount: u,
89
- serviceInstance: !!C
89
+ serviceInstance: !!f
90
90
  }), () => {
91
- r("🧹 SERVICE CLEANUP", {
91
+ a("🧹 SERVICE CLEANUP", {
92
92
  renderCount: u,
93
93
  reason: "Effect cleanup"
94
- }), C.disconnectUser().catch(console.error);
94
+ }), f.disconnectUser().catch(console.error);
95
95
  };
96
- }, [o, n, d, r]);
97
- const S = X(null);
98
- K(() => {
99
- var C, T;
100
- if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
96
+ }, [r, n, d, a]);
97
+ const _ = K(null);
98
+ W(() => {
99
+ var f, E;
100
+ if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: M.current,
105
- isConnected: g,
104
+ isConnecting: k.current,
105
+ isConnected: N,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
- r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
108
+ a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (M.current) {
112
- r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
111
+ if (k.current) {
112
+ a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((C = S.current) == null ? void 0 : C.serviceId) === c && ((T = S.current) == null ? void 0 : T.userId) === s.id) {
116
- r(
115
+ if (((f = _.current) == null ? void 0 : f.serviceId) === c && ((E = _.current) == null ? void 0 : E.userId) === s.id) {
116
+ a(
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 }), M.current = !0, w(!0), b(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), k.current = !0, I(!0), v(null);
124
124
  try {
125
- r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const v = await c.connectUser(s);
127
- x(v), p(!0), S.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
125
+ a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
+ const C = await c.connectUser(s);
127
+ b(C), S(!0), _.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: v.userID
129
+ clientId: C.userID
130
130
  });
131
- } catch (v) {
132
- const N = v instanceof Error ? v.message : "Connection failed";
133
- b(N), r("❌ USER CONNECTION ERROR", {
131
+ } catch (C) {
132
+ const p = C instanceof Error ? C.message : "Connection failed";
133
+ v(p), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: N
135
+ error: p
136
136
  });
137
137
  } finally {
138
- w(!1), M.current = !1, r("🔄 USER CONNECTION FINISHED", {
138
+ I(!1), k.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: g
140
+ isConnected: N
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, r, g]), K(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, a, N]), W(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
- isConnected: g
146
+ isConnected: N
147
147
  }), () => {
148
- c && g ? (r(
148
+ c && N ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), S.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
151
+ ), _.current = null, c.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!c,
153
- isConnected: g
153
+ isConnected: N
154
154
  });
155
- }), [c, g, r]);
156
- const R = A(async () => {
157
- if (r("🔄 REFRESH CONNECTION CALLED", {
155
+ }), [c, N, a]);
156
+ const R = U(async () => {
157
+ if (a("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
160
160
  }), !c || !s) {
161
- r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
161
+ a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), I(!0);
165
165
  try {
166
- r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
166
+ a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
167
  const u = await c.connectUser(s);
168
- x(u), p(!0), b(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ b(u), S(!0), v(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
- const C = u instanceof Error ? u.message : "Refresh failed";
171
- b(C), r("❌ CONNECTION REFRESH ERROR", {
170
+ const f = u instanceof Error ? u.message : "Refresh failed";
171
+ v(f), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: C
173
+ error: f
174
174
  });
175
175
  } finally {
176
- w(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ I(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, r]), m = G.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, a]), x = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
180
  hasClient: !!h,
181
- isConnected: g,
182
- isLoading: a,
183
- hasError: !!_,
181
+ isConnected: N,
182
+ isLoading: m,
183
+ hasError: !!o,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: c,
187
187
  client: h,
188
- isConnected: g,
189
- isLoading: a,
190
- error: _,
188
+ isConnected: N,
189
+ isLoading: m,
190
+ error: o,
191
191
  capabilities: l,
192
192
  refreshConnection: R,
193
193
  debug: d
194
194
  }), [
195
195
  c,
196
196
  h,
197
- g,
198
- a,
199
- _,
197
+ N,
198
+ m,
199
+ o,
200
200
  l,
201
201
  R,
202
202
  d,
203
- r
203
+ a
204
204
  ]);
205
- return r("🔄 RENDER END", {
206
- renderCount: y.current,
207
- willRenderChat: !!(h && g),
208
- contextValueReady: !!m
209
- }), /* @__PURE__ */ e(He.Provider, { value: m, children: h && g ? /* @__PURE__ */ e(
210
- ut,
205
+ return a("🔄 RENDER END", {
206
+ renderCount: w.current,
207
+ willRenderChat: !!(h && N),
208
+ contextValueReady: !!x
209
+ }), /* @__PURE__ */ e(Qe.Provider, { value: x, children: h && N ? /* @__PURE__ */ e(
210
+ gt,
211
211
  {
212
212
  client: h,
213
213
  customClasses: {
@@ -216,56 +216,56 @@ const He = ct({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, ss = () => Ne(), Ve = G.createContext({
219
+ }, as = () => Me(), et = F.createContext({
220
220
  selectedChannel: void 0,
221
221
  onChannelSelect: () => {
222
222
  },
223
223
  debug: !1,
224
224
  renderMessagePreview: void 0
225
- }), ns = Ve.Provider, as = () => G.useContext(Ve), Ye = (t) => {
226
- var o, l;
227
- const [s, n] = k(
228
- !!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
225
+ }), rs = et.Provider, os = () => F.useContext(et), tt = (t) => {
226
+ var r, l;
227
+ const [s, n] = T(
228
+ !!((l = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && l.pinned_at)
229
229
  );
230
- return K(() => {
231
- var r;
230
+ return W(() => {
231
+ var a;
232
232
  if (!t) {
233
233
  n(!1);
234
234
  return;
235
235
  }
236
- n(!!((r = t.state.membership) != null && r.pinned_at));
236
+ n(!!((a = t.state.membership) != null && a.pinned_at));
237
237
  const d = (c) => {
238
- var f;
238
+ var g;
239
239
  n(
240
- c != null && c.member ? !!c.member.pinned_at : !!((f = t.state.membership) != null && f.pinned_at)
240
+ c != null && c.member ? !!c.member.pinned_at : !!((g = t.state.membership) != null && g.pinned_at)
241
241
  );
242
242
  };
243
243
  return t.on("member.updated", d), () => {
244
244
  t.off("member.updated", d);
245
245
  };
246
246
  }, [t]), s;
247
- }, rs = (t, s) => {
247
+ }, ls = (t, s) => {
248
248
  const n = new Date(
249
249
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
250
250
  ), l = new Date(
251
251
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
252
252
  ).getTime() - n.getTime();
253
253
  return Math.floor(l / (1e3 * 60 * 60 * 24));
254
- }, os = (t) => {
254
+ }, is = (t) => {
255
255
  const s = /* @__PURE__ */ new Date();
256
256
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
257
257
  return "Just now";
258
- const o = rs(t, s);
259
- return o === 0 ? t.toLocaleTimeString([], {
258
+ const r = ls(t, s);
259
+ return r === 0 ? t.toLocaleTimeString([], {
260
260
  hour: "numeric",
261
261
  minute: "2-digit",
262
262
  hour12: !0
263
- }) : o === 1 ? "Yesterday" : o < 7 ? `${o}d` : o < 28 ? `${Math.floor(o / 7)}w` : t.toLocaleDateString("en-US", {
263
+ }) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : t.toLocaleDateString("en-US", {
264
264
  month: "numeric",
265
265
  day: "numeric",
266
266
  year: "2-digit"
267
267
  });
268
- }, Ge = [
268
+ }, qe = [
269
269
  "🍎",
270
270
  // Apple
271
271
  "🍌",
@@ -293,34 +293,34 @@ const He = ct({
293
293
  "🍈"
294
294
  // Melon
295
295
  ];
296
- function ls(t) {
296
+ function cs(t) {
297
297
  let s = 0;
298
298
  for (let n = 0; n < t.length; n++) {
299
- const o = t.charCodeAt(n);
300
- s = (s << 5) - s + o, s = s & s;
299
+ const r = t.charCodeAt(n);
300
+ s = (s << 5) - s + r, s = s & s;
301
301
  }
302
302
  return Math.abs(s);
303
303
  }
304
- function is(t) {
305
- const n = ls(t) % Ge.length;
306
- return Ge[n];
304
+ function ds(t) {
305
+ const n = cs(t) % qe.length;
306
+ return qe[n];
307
307
  }
308
- const ae = ({
308
+ const oe = ({
309
309
  id: t,
310
310
  image: s,
311
311
  size: n = 40,
312
- className: o,
312
+ className: r,
313
313
  starred: l = !1,
314
314
  shape: d = "squircle"
315
315
  }) => {
316
- const r = is(t), f = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
316
+ const a = ds(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
317
317
  borderRadius: "33%",
318
318
  "corner-shape": "superellipse(1.3)"
319
319
  };
320
320
  return /* @__PURE__ */ i(
321
321
  "div",
322
322
  {
323
- className: D("relative flex-shrink-0", o),
323
+ className: L("relative flex-shrink-0", r),
324
324
  style: {
325
325
  width: `${n}px`,
326
326
  height: `${n}px`
@@ -331,7 +331,7 @@ const ae = ({
331
331
  {
332
332
  "aria-hidden": "true",
333
333
  className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
334
- children: /* @__PURE__ */ e(Ie, { className: "size-3 text-yellow-600", weight: "duotone" })
334
+ children: /* @__PURE__ */ e(Ue, { className: "size-3 text-yellow-600", weight: "duotone" })
335
335
  }
336
336
  ),
337
337
  /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
@@ -345,17 +345,17 @@ const ae = ({
345
345
  "div",
346
346
  {
347
347
  "aria-hidden": "true",
348
- className: D(
348
+ className: L(
349
349
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
350
- f
350
+ g
351
351
  ),
352
- children: r
352
+ children: a
353
353
  }
354
354
  ) })
355
355
  ]
356
356
  }
357
357
  );
358
- }, cs = ({ size: t = 15 }) => /* @__PURE__ */ e(
358
+ }, ms = ({ size: t = 15 }) => /* @__PURE__ */ e(
359
359
  "svg",
360
360
  {
361
361
  width: t,
@@ -372,105 +372,108 @@ const ae = ({
372
372
  }
373
373
  )
374
374
  }
375
- ), ds = (t) => {
375
+ ), us = (t) => {
376
376
  var s;
377
377
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
378
- }, ms = (t) => {
378
+ }, hs = (t) => {
379
379
  var s;
380
380
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
381
- }, Re = (t) => {
381
+ }, Be = (t) => {
382
382
  var s;
383
383
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
384
- }, We = (t) => ds(t) || ms(t), us = (t) => {
384
+ }, fs = (t) => {
385
385
  var s;
386
- return We(t) && !((s = t.text) != null && s.trim());
387
- }, _e = ({
386
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
387
+ }, st = (t) => us(t) || hs(t), gs = (t) => {
388
+ var s;
389
+ return st(t) && !((s = t.text) != null && s.trim());
390
+ }, Re = ({
388
391
  message: t,
389
392
  standalone: s = !1,
390
393
  isMyMessage: n = !1,
391
- hasAttachment: o = !1
394
+ hasAttachment: r = !1
392
395
  }) => {
393
- var g;
394
- const l = We(t), d = Re(t);
396
+ var N;
397
+ const l = st(t), d = Be(t);
395
398
  if (!l && !d)
396
399
  return null;
397
400
  if (l) {
398
- const p = (g = t.metadata) == null ? void 0 : g.amount_text;
399
- if (!p) return null;
400
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", w = s ? `${p} tip` : `Delivered with ${p} tip`;
401
- return /* @__PURE__ */ i("div", { className: a, children: [
402
- /* @__PURE__ */ e(Zt, { size: s ? 14 : 12 }),
403
- /* @__PURE__ */ e("span", { children: w })
401
+ const S = (N = t.metadata) == null ? void 0 : N.amount_text;
402
+ if (!S) return null;
403
+ const m = s ? "message-tip-standalone" : "message-tag message-tag--tip", I = s ? `${S} tip` : `Delivered with ${S} tip`;
404
+ return /* @__PURE__ */ i("div", { className: m, children: [
405
+ /* @__PURE__ */ e(Xt, { size: s ? 14 : 12 }),
406
+ /* @__PURE__ */ e("span", { children: I })
404
407
  ] });
405
408
  }
406
- const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", f = [
409
+ const a = n && r, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
407
410
  "message-chatbot-indicator",
408
411
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
409
- r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
410
- ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(cs, { size: r ? 12 : 15 }) });
411
- return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(de, { children: [
412
+ a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
413
+ ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(ms, { size: a ? 12 : 15 }) });
414
+ return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
412
415
  h,
413
- x
414
- ] }) : /* @__PURE__ */ i(de, { children: [
415
- x,
416
+ b
417
+ ] }) : /* @__PURE__ */ i(he, { children: [
418
+ b,
416
419
  h
417
420
  ] }) });
418
- }, qe = G.memo(
421
+ }, nt = F.memo(
419
422
  ({ channel: t, unread: s }) => {
420
- var R, m, u, C;
421
- const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = as(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
422
- t && o(t);
423
- }, f = (T) => {
424
- const v = T.key === "Enter" || T.key === " ", N = T.repeat;
425
- !v || N || (T.preventDefault(), c());
426
- }, x = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
427
- (T) => {
428
- var v, N;
429
- return ((v = T.user) == null ? void 0 : v.id) && T.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
423
+ var R, x, u, f;
424
+ const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: d } = os(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
425
+ t && r(t);
426
+ }, g = (E) => {
427
+ const C = E.key === "Enter" || E.key === " ", p = E.repeat;
428
+ !C || p || (E.preventDefault(), c());
429
+ }, b = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
430
+ (E) => {
431
+ var C, p;
432
+ return ((C = E.user) == null ? void 0 : C.id) && E.user.id !== ((p = t == null ? void 0 : t._client) == null ? void 0 : p.userID);
430
433
  }
431
- ), g = ((m = x == null ? void 0 : x.user) == null ? void 0 : m.name) || "Conversation", p = (u = x == null ? void 0 : x.user) == null ? void 0 : u.image, a = (() => {
432
- var v;
433
- const T = (v = t == null ? void 0 : t.state) == null ? void 0 : v.messages;
434
- if (T != null && T.length) {
435
- for (let N = T.length - 1; N >= 0; N--)
436
- if (T[N].type !== "system") return T[N];
434
+ ), N = ((x = b == null ? void 0 : b.user) == null ? void 0 : x.name) || "Conversation", S = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, m = (() => {
435
+ var C;
436
+ const E = (C = t == null ? void 0 : t.state) == null ? void 0 : C.messages;
437
+ if (E != null && E.length) {
438
+ for (let p = E.length - 1; p >= 0; p--)
439
+ if (E[p].type !== "system") return E[p];
437
440
  }
438
- })(), _ = (() => {
439
- var N, F;
440
- if (a != null && a.text) return a.text;
441
- if (((N = a == null ? void 0 : a.metadata) == null ? void 0 : N.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
442
- const v = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
443
- return v ? v.og_scrape_url ? v.og_scrape_url : v.type === "image" ? "📷 Sent an image" : v.type === "video" ? "🎥 Sent a video" : v.type === "audio" ? "🎵 Sent audio" : v.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
444
- })(), b = a != null && a.created_at ? os(new Date(a.created_at)) : "", M = a ? Re(a) : !1, E = d ? d(a, _) : `${M ? "✨ " : ""}${_}`, y = Ye(t), S = s ?? 0;
441
+ })(), o = (() => {
442
+ var p, O;
443
+ if (m != null && m.text) return m.text;
444
+ if (((p = m == null ? void 0 : m.metadata) == null ? void 0 : p.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
445
+ const C = (O = m == null ? void 0 : m.attachments) == null ? void 0 : O[0];
446
+ 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";
447
+ })(), v = m != null && m.created_at ? is(new Date(m.created_at)) : "", k = m ? Be(m) : !1, y = d ? d(m, o) : `${k ? "✨ " : ""}${o}`, w = tt(t), _ = s ?? 0;
445
448
  return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
446
449
  channelId: t == null ? void 0 : t.id,
447
- isSelected: r,
448
- participantName: g,
449
- unreadCount: S,
450
- hasTimestamp: !!b
450
+ isSelected: a,
451
+ participantName: N,
452
+ unreadCount: _,
453
+ hasTimestamp: !!v
451
454
  }), /* @__PURE__ */ e(
452
455
  "div",
453
456
  {
454
457
  role: "button",
455
458
  tabIndex: 0,
456
459
  onClick: c,
457
- onKeyDown: f,
458
- className: D(
460
+ onKeyDown: g,
461
+ className: L(
459
462
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
460
463
  {
461
- "bg-primary-alt/10 border-l-4 border-l-primary": r,
462
- "hover:bg-sand": !r
464
+ "bg-primary-alt/10 border-l-4 border-l-primary": a,
465
+ "hover:bg-sand": !a
463
466
  }
464
467
  ),
465
468
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
466
469
  /* @__PURE__ */ e(
467
- ae,
470
+ oe,
468
471
  {
469
- id: ((C = x == null ? void 0 : x.user) == null ? void 0 : C.id) || t.id || "unknown",
470
- name: g,
471
- image: p,
472
+ id: ((f = b == null ? void 0 : b.user) == null ? void 0 : f.id) || t.id || "unknown",
473
+ name: N,
474
+ image: S,
472
475
  size: 44,
473
- starred: y,
476
+ starred: w,
474
477
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
475
478
  }
476
479
  ),
@@ -479,21 +482,21 @@ const ae = ({
479
482
  /* @__PURE__ */ i(
480
483
  "h3",
481
484
  {
482
- className: D(
485
+ className: L(
483
486
  "text-sm font-medium truncate",
484
- r ? "text-primary" : "text-charcoal"
487
+ a ? "text-primary" : "text-charcoal"
485
488
  ),
486
489
  children: [
487
- y && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
488
- g
490
+ w && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
491
+ N
489
492
  ]
490
493
  }
491
494
  ),
492
- b && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: b })
495
+ v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
493
496
  ] }),
494
497
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
495
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: E }),
496
- S > 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: S > 99 ? "99+" : S })
498
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: y }),
499
+ _ > 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: _ > 99 ? "99+" : _ })
497
500
  ] })
498
501
  ] })
499
502
  ] })
@@ -501,56 +504,56 @@ const ae = ({
501
504
  );
502
505
  }
503
506
  );
504
- qe.displayName = "CustomChannelPreview";
505
- const hs = { last_message_at: -1 }, Ze = G.memo(
507
+ nt.displayName = "CustomChannelPreview";
508
+ const xs = { last_message_at: -1 }, at = F.memo(
506
509
  ({
507
510
  onChannelSelect: t,
508
511
  selectedChannel: s,
509
512
  filters: n,
510
- allowNewMessagesFromUnfilteredChannels: o = !1,
513
+ allowNewMessagesFromUnfilteredChannels: r = !1,
511
514
  onMessageNew: l,
512
515
  onAddedToChannel: d,
513
- channelRenderFilterFn: r,
514
- sort: c = hs,
515
- className: f,
516
+ channelRenderFilterFn: a,
517
+ sort: c = xs,
518
+ className: g,
516
519
  customEmptyStateIndicator: h,
517
- renderMessagePreview: x
520
+ renderMessagePreview: b
518
521
  }) => {
519
- const g = G.useRef(0);
520
- g.current++;
521
- const { debug: p = !1 } = Ne();
522
- p && console.log("📺 [ChannelList] 🔄 RENDER START", {
523
- renderCount: g.current,
522
+ const N = F.useRef(0);
523
+ N.current++;
524
+ const { debug: S = !1 } = Me();
525
+ S && console.log("📺 [ChannelList] 🔄 RENDER START", {
526
+ renderCount: N.current,
524
527
  selectedChannelId: s == null ? void 0 : s.id,
525
528
  filters: n
526
529
  });
527
- const a = G.useMemo(
530
+ const m = F.useMemo(
528
531
  () => ({
529
532
  selectedChannel: s,
530
533
  onChannelSelect: t,
531
- debug: p,
532
- renderMessagePreview: x
534
+ debug: S,
535
+ renderMessagePreview: b
533
536
  }),
534
- [s, t, p, x]
537
+ [s, t, S, b]
535
538
  );
536
539
  return /* @__PURE__ */ e(
537
540
  "div",
538
541
  {
539
- className: D(
542
+ className: L(
540
543
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
541
- f
544
+ g
542
545
  ),
543
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(ns, { value: a, children: /* @__PURE__ */ e(
544
- ht,
546
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(rs, { value: m, children: /* @__PURE__ */ e(
547
+ xt,
545
548
  {
546
549
  filters: n,
547
550
  sort: c,
548
551
  options: { limit: 30 },
549
- allowNewMessagesFromUnfilteredChannels: o,
552
+ allowNewMessagesFromUnfilteredChannels: r,
550
553
  onMessageNew: l,
551
554
  onAddedToChannel: d,
552
- channelRenderFilterFn: r,
553
- Preview: qe,
555
+ channelRenderFilterFn: a,
556
+ Preview: nt,
554
557
  EmptyStateIndicator: h
555
558
  },
556
559
  `${JSON.stringify(n)}:${JSON.stringify(c)}`
@@ -559,39 +562,39 @@ const hs = { last_message_at: -1 }, Ze = G.memo(
559
562
  );
560
563
  }
561
564
  );
562
- Ze.displayName = "ChannelList";
563
- const ge = ({
565
+ at.displayName = "ChannelList";
566
+ const we = ({
564
567
  variant: t = "default",
565
568
  className: s,
566
569
  children: n,
567
- ...o
570
+ ...r
568
571
  }) => /* @__PURE__ */ e(
569
572
  "button",
570
573
  {
571
574
  type: "button",
572
- className: D(
575
+ className: L(
573
576
  "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",
574
577
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
575
578
  s
576
579
  ),
577
- ...o,
580
+ ...r,
578
581
  children: n
579
582
  }
580
583
  );
581
- function Je({ label: t, className: s, children: n, ...o }) {
584
+ function rt({ label: t, className: s, children: n, ...r }) {
582
585
  return /* @__PURE__ */ i(
583
586
  "button",
584
587
  {
585
588
  type: "button",
586
- className: D(
589
+ className: L(
587
590
  "rounded-full p-2 transition-colors focus-ring",
588
591
  {
589
- "cursor-not-allowed opacity-50": o.disabled,
590
- "hover:bg-sand": !o.disabled
592
+ "cursor-not-allowed opacity-50": r.disabled,
593
+ "hover:bg-sand": !r.disabled
591
594
  },
592
595
  s
593
596
  ),
594
- ...o,
597
+ ...r,
595
598
  children: [
596
599
  /* @__PURE__ */ e("span", { className: "sr-only", children: t }),
597
600
  n
@@ -599,92 +602,92 @@ function Je({ label: t, className: s, children: n, ...o }) {
599
602
  }
600
603
  );
601
604
  }
602
- function Xe({ onClick: t }) {
603
- return /* @__PURE__ */ e(Je, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(De, { className: "h-5 w-5 text-stone", weight: "bold" }) });
605
+ function ot({ onClick: t }) {
606
+ return /* @__PURE__ */ e(rt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
604
607
  }
605
- const fs = ({
608
+ const bs = ({
606
609
  dialogRef: t,
607
610
  onClose: s,
608
611
  participant: n,
609
- channel: o,
612
+ channel: r,
610
613
  followerStatusLabel: l,
611
614
  onLeaveConversation: d,
612
- onBlockParticipant: r,
615
+ onBlockParticipant: a,
613
616
  showDeleteConversation: c = !0,
614
- onDeleteConversationClick: f,
617
+ onDeleteConversationClick: g,
615
618
  onBlockParticipantClick: h,
616
- onReportParticipantClick: x,
617
- customProfileContent: g,
618
- customChannelActions: p
619
+ onReportParticipantClick: b,
620
+ customProfileContent: N,
621
+ customChannelActions: S
619
622
  }) => {
620
- var L, W, j, re, z, te, se;
621
- const { service: a, debug: w } = Ne(), [_, b] = k(!1), [M, E] = k(!1), [y, S] = k(!1), R = A(async () => {
622
- var O;
623
- if (!(!a || !((O = n == null ? void 0 : n.user) != null && O.id)))
623
+ var D, $, z, ee, le, ie, ce;
624
+ const { service: m, debug: I } = Me(), [o, v] = T(!1), [k, y] = T(!1), [w, _] = T(!1), R = U(async () => {
625
+ var A;
626
+ if (!(!m || !((A = n == null ? void 0 : n.user) != null && A.id)))
624
627
  try {
625
- const B = (await a.getBlockedUsers()).some(
626
- (H) => {
627
- var oe;
628
- return H.blocked_user_id === ((oe = n == null ? void 0 : n.user) == null ? void 0 : oe.id);
628
+ const H = (await m.getBlockedUsers()).some(
629
+ (Y) => {
630
+ var te;
631
+ return Y.blocked_user_id === ((te = n == null ? void 0 : n.user) == null ? void 0 : te.id);
629
632
  }
630
633
  );
631
- b(B);
634
+ v(H);
632
635
  } catch (P) {
633
636
  console.error(
634
637
  "[ChannelInfoDialog] Failed to check blocked status:",
635
638
  P
636
639
  );
637
640
  }
638
- }, [a, (L = n == null ? void 0 : n.user) == null ? void 0 : L.id]);
639
- K(() => {
641
+ }, [m, (D = n == null ? void 0 : n.user) == null ? void 0 : D.id]);
642
+ W(() => {
640
643
  R();
641
644
  }, [R]);
642
- const m = async () => {
643
- var O;
644
- if (!M) {
645
- f == null || f(), w && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
645
+ const x = async () => {
646
+ var A;
647
+ if (!k) {
648
+ g == null || g(), I && console.log("[ChannelInfoDialog] Leave conversation", r.cid), y(!0);
646
649
  try {
647
- const P = ((O = o._client) == null ? void 0 : O.userID) ?? null;
648
- await o.hide(P, !1), d && await d(o), s();
650
+ const P = ((A = r._client) == null ? void 0 : A.userID) ?? null;
651
+ await r.hide(P, !1), d && await d(r), s();
649
652
  } catch (P) {
650
653
  console.error("[ChannelInfoDialog] Failed to leave conversation", P);
651
654
  } finally {
652
- E(!1);
655
+ y(!1);
653
656
  }
654
657
  }
655
658
  }, u = async () => {
656
- var O, P, B;
657
- if (!(y || !a)) {
658
- h == null || h(), w && console.log("[ChannelInfoDialog] Block member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), S(!0);
659
+ var A, P, H;
660
+ if (!(w || !m)) {
661
+ h == null || h(), I && console.log("[ChannelInfoDialog] Block member", (A = n == null ? void 0 : n.user) == null ? void 0 : A.id), _(!0);
659
662
  try {
660
- await a.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
661
- } catch (H) {
662
- console.error("[ChannelInfoDialog] Failed to block member", H);
663
+ await m.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
664
+ } catch (Y) {
665
+ console.error("[ChannelInfoDialog] Failed to block member", Y);
663
666
  } finally {
664
- S(!1);
667
+ _(!1);
665
668
  }
666
669
  }
667
- }, C = async () => {
668
- var O, P, B;
669
- if (!(y || !a)) {
670
- h == null || h(), w && console.log("[ChannelInfoDialog] Unblock member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), S(!0);
670
+ }, f = async () => {
671
+ var A, P, H;
672
+ if (!(w || !m)) {
673
+ h == null || h(), I && console.log("[ChannelInfoDialog] Unblock member", (A = n == null ? void 0 : n.user) == null ? void 0 : A.id), _(!0);
671
674
  try {
672
- await a.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
673
- } catch (H) {
674
- console.error("[ChannelInfoDialog] Failed to unblock member", H);
675
+ await m.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
676
+ } catch (Y) {
677
+ console.error("[ChannelInfoDialog] Failed to unblock member", Y);
675
678
  } finally {
676
- S(!1);
679
+ _(!1);
677
680
  }
678
681
  }
679
- }, T = () => {
680
- x == null || x(), s(), window.open(
682
+ }, E = () => {
683
+ b == null || b(), s(), window.open(
681
684
  "https://linktr.ee/s/about/trust-center/report",
682
685
  "_blank",
683
686
  "noopener,noreferrer"
684
687
  );
685
688
  };
686
689
  if (!n) return null;
687
- const v = ((W = n.user) == null ? void 0 : W.name) || ((j = n.user) == null ? void 0 : j.id) || "Unknown member", N = (re = n.user) == null ? void 0 : re.image, F = (z = n.user) == null ? void 0 : z.email, Q = (te = n.user) == null ? void 0 : te.username, Y = F || (Q ? `linktr.ee/${Q}` : void 0), Z = ((se = n.user) == null ? void 0 : se.id) || "unknown";
690
+ const C = (($ = n.user) == null ? void 0 : $.name) || ((z = n.user) == null ? void 0 : z.id) || "Unknown member", p = (ee = n.user) == null ? void 0 : ee.image, O = (le = n.user) == null ? void 0 : le.email, q = (ie = n.user) == null ? void 0 : ie.username, Z = O || (q ? `linktr.ee/${q}` : void 0), Q = ((ce = n.user) == null ? void 0 : ce.id) || "unknown";
688
691
  return (
689
692
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
690
693
  /* @__PURE__ */ e(
@@ -693,13 +696,13 @@ const fs = ({
693
696
  ref: t,
694
697
  className: "mes-dialog group",
695
698
  onClose: s,
696
- onClick: (O) => {
697
- O.target === t.current && s();
699
+ onClick: (A) => {
700
+ A.target === t.current && s();
698
701
  },
699
702
  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: [
700
703
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
701
704
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
702
- /* @__PURE__ */ e(Xe, { onClick: s })
705
+ /* @__PURE__ */ e(ot, { onClick: s })
703
706
  ] }),
704
707
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
705
708
  /* @__PURE__ */ e(
@@ -709,19 +712,19 @@ const fs = ({
709
712
  style: { backgroundColor: "#FBFAF9" },
710
713
  children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
711
714
  /* @__PURE__ */ e(
712
- ae,
715
+ oe,
713
716
  {
714
- id: Z,
715
- name: v,
716
- image: N,
717
+ id: Q,
718
+ name: C,
719
+ image: p,
717
720
  size: 88,
718
721
  shape: "circle"
719
722
  }
720
723
  ),
721
724
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
722
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
723
- Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
724
- l && !g && /* @__PURE__ */ e(
725
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
726
+ Z && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Z }),
727
+ l && !N && /* @__PURE__ */ e(
725
728
  "span",
726
729
  {
727
730
  className: "mt-1 rounded-full text-xs font-normal w-fit",
@@ -735,90 +738,103 @@ const fs = ({
735
738
  children: l
736
739
  }
737
740
  ),
738
- g
741
+ N
739
742
  ] })
740
743
  ] })
741
744
  }
742
745
  ),
743
746
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
744
747
  c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
745
- ge,
748
+ we,
746
749
  {
747
- onClick: m,
748
- disabled: M,
749
- "aria-busy": M,
750
+ onClick: x,
751
+ disabled: k,
752
+ "aria-busy": k,
750
753
  children: [
751
- M ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Jt, { className: "h-5 w-5" }),
754
+ k ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Kt, { className: "h-5 w-5" }),
752
755
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
753
756
  ]
754
757
  }
755
758
  ) }),
756
- /* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ i(
757
- ge,
759
+ /* @__PURE__ */ e("li", { children: o ? /* @__PURE__ */ i(
760
+ we,
758
761
  {
759
- onClick: C,
760
- disabled: y,
761
- "aria-busy": y,
762
+ onClick: f,
763
+ disabled: w,
764
+ "aria-busy": w,
762
765
  children: [
763
- y ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
766
+ w ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ze, { className: "h-5 w-5" }),
764
767
  /* @__PURE__ */ e("span", { children: "Unblock" })
765
768
  ]
766
769
  }
767
770
  ) : /* @__PURE__ */ i(
768
- ge,
771
+ we,
769
772
  {
770
773
  onClick: u,
771
- disabled: y,
772
- "aria-busy": y,
774
+ disabled: w,
775
+ "aria-busy": w,
773
776
  children: [
774
- y ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
777
+ w ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ze, { className: "h-5 w-5" }),
775
778
  /* @__PURE__ */ e("span", { children: "Block" })
776
779
  ]
777
780
  }
778
781
  ) }),
779
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ge, { variant: "danger", onClick: T, children: [
780
- /* @__PURE__ */ e(Xt, { className: "h-5 w-5" }),
782
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(we, { variant: "danger", onClick: E, children: [
783
+ /* @__PURE__ */ e(Qt, { className: "h-5 w-5" }),
781
784
  /* @__PURE__ */ e("span", { children: "Report" })
782
785
  ] }) }),
783
- p
786
+ S
784
787
  ] })
785
788
  ] })
786
789
  ] })
787
790
  }
788
791
  )
789
792
  );
790
- }, gs = (t) => /* @__PURE__ */ e(ft, { ...t, position: "center" }), Me = "vote_up", ke = "vote_down";
791
- function xs(t) {
792
- return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Me) ? "up" : null : null;
793
+ }, Cs = (t) => /* @__PURE__ */ e(bt, { ...t, position: "center" }), Pe = "vote_up", Fe = "vote_down";
794
+ function Ns(t) {
795
+ return t != null && t.length ? t.some((s) => s.type === Fe) ? "down" : t.some((s) => s.type === Pe) ? "up" : null : null;
793
796
  }
794
- function bs(t) {
795
- const { channel: s } = Te(), { client: n } = je("useMessageVote"), o = Se(
796
- () => xs(t.own_reactions),
797
+ function ps(t) {
798
+ const { channel: s } = Ie(), { client: n } = Xe("useMessageVote"), r = Le(
799
+ () => Ns(t.own_reactions),
797
800
  [t.own_reactions]
798
- ), l = A(async () => {
801
+ ), l = U(async () => {
799
802
  if (n != null && n.userID)
800
803
  try {
801
- o === "up" ? await s.deleteReaction(t.id, Me) : await s.sendReaction(
804
+ r === "up" ? await s.deleteReaction(t.id, Pe) : await s.sendReaction(
802
805
  t.id,
803
- { type: Me },
806
+ { type: Pe },
804
807
  { enforce_unique: !0, skip_push: !0 }
805
808
  );
806
809
  } catch {
807
810
  }
808
- }, [s, n == null ? void 0 : n.userID, t.id, o]), d = A(async () => {
811
+ }, [s, n == null ? void 0 : n.userID, t.id, r]), d = U(async () => {
809
812
  if (n != null && n.userID)
810
813
  try {
811
- o === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
814
+ r === "down" ? await s.deleteReaction(t.id, Fe) : await s.sendReaction(
812
815
  t.id,
813
- { type: ke },
816
+ { type: Fe },
814
817
  { enforce_unique: !0, skip_push: !0 }
815
818
  );
816
819
  } catch {
817
820
  }
818
- }, [s, n == null ? void 0 : n.userID, t.id, o]);
819
- return { selected: o, voteUp: l, voteDown: d };
821
+ }, [s, n == null ? void 0 : n.userID, t.id, r]);
822
+ return { selected: r, voteUp: l, voteDown: d };
820
823
  }
821
- const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
824
+ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => import("./Visitor-BG-9-3HU.js")), Ze = () => /* @__PURE__ */ e(
825
+ "div",
826
+ {
827
+ className: "w-[280px] min-h-[200px] animate-pulse rounded-3xl bg-black/[0.06] shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04)]",
828
+ "aria-hidden": !0
829
+ }
830
+ ), ws = (t) => {
831
+ if (t.isCreator) {
832
+ const { isCreator: r, ...l } = t;
833
+ return /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Ze, {}), children: /* @__PURE__ */ e(ys, { ...l }) });
834
+ }
835
+ const { isCreator: s, ...n } = t;
836
+ return /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Ze, {}), children: /* @__PURE__ */ e(vs, { ...n }) });
837
+ }, _s = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
822
838
  "path",
823
839
  {
824
840
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -828,7 +844,7 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
828
844
  strokeLinejoin: "round",
829
845
  fill: t ? "currentColor" : "none"
830
846
  }
831
- ) }), Ns = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
847
+ ) }), Es = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
832
848
  "path",
833
849
  {
834
850
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -838,7 +854,7 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
838
854
  strokeLinejoin: "round",
839
855
  fill: t ? "currentColor" : "none"
840
856
  }
841
- ) }), vs = ({
857
+ ) }), Ss = ({
842
858
  selected: t,
843
859
  onVoteUp: s,
844
860
  onVoteDown: n
@@ -851,7 +867,7 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
851
867
  onClick: s,
852
868
  "aria-label": "Helpful",
853
869
  "aria-pressed": t === "up",
854
- children: /* @__PURE__ */ e(Cs, { filled: t === "up" })
870
+ children: /* @__PURE__ */ e(_s, { filled: t === "up" })
855
871
  }
856
872
  ),
857
873
  /* @__PURE__ */ e(
@@ -862,190 +878,208 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
862
878
  onClick: n,
863
879
  "aria-label": "Not helpful",
864
880
  "aria-pressed": t === "down",
865
- children: /* @__PURE__ */ e(Ns, { filled: t === "down" })
881
+ children: /* @__PURE__ */ e(Es, { filled: t === "down" })
866
882
  }
867
883
  )
868
- ] }), ps = (t) => {
869
- var ne, me;
884
+ ] }), Is = (t) => {
885
+ var be, ae, X, Ce, Ne, pe, re, ye;
870
886
  const {
871
887
  additionalMessageInputProps: s,
872
888
  chatbotVotingEnabled: n,
873
- editing: o,
874
- endOfGroup: l,
875
- firstOfGroup: d,
876
- groupedByUser: r,
877
- handleAction: c,
878
- handleOpenThread: f,
879
- handleRetry: h,
880
- highlighted: x,
881
- isMessageAIGenerated: g,
882
- isMyMessage: p,
883
- message: a,
884
- renderText: w,
885
- threadList: _
886
- } = t, { client: b } = je("CustomMessage"), [M, E] = k(!1), y = xt(a.id), { selected: S, voteUp: R, voteDown: m } = bs(a), {
887
- Attachment: u = Ct,
888
- EditMessageModal: C = Nt,
889
- MessageBlocked: T = vt,
890
- MessageBouncePrompt: v = pt,
891
- MessageDeleted: N = yt,
892
- MessageIsThreadReplyInChannelButtonIndicator: F = wt,
893
- MessageRepliesCountButton: Q = _t,
894
- ReminderNotification: Y = Et,
895
- StreamedMessageText: Z = St,
896
- PinIndicator: L
897
- } = bt("CustomMessage"), W = It(a), j = Mt(a), re = Se(
898
- () => g == null ? void 0 : g(a),
899
- [g, a]
900
- ), z = Se(
901
- () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
902
- [a]
889
+ onAttachmentUnlock: r,
890
+ onAttachmentDownload: l,
891
+ editing: d,
892
+ endOfGroup: a,
893
+ firstOfGroup: c,
894
+ groupedByUser: g,
895
+ handleAction: h,
896
+ handleOpenThread: b,
897
+ handleRetry: N,
898
+ highlighted: S,
899
+ isMessageAIGenerated: m,
900
+ isMyMessage: I,
901
+ message: o,
902
+ renderText: v,
903
+ threadList: k
904
+ } = t, { client: y } = Xe("CustomMessage"), { channel: w } = Ie("CustomMessage"), [_, R] = T(!1), x = Nt(o.id), { selected: u, voteUp: f, voteDown: E } = ps(o), {
905
+ Attachment: C = yt,
906
+ EditMessageModal: p = vt,
907
+ MessageBlocked: O = wt,
908
+ MessageBouncePrompt: q = _t,
909
+ MessageDeleted: Z = Et,
910
+ MessageIsThreadReplyInChannelButtonIndicator: Q = St,
911
+ MessageRepliesCountButton: D = It,
912
+ ReminderNotification: $ = Mt,
913
+ StreamedMessageText: z = kt,
914
+ PinIndicator: ee
915
+ } = pt("CustomMessage"), le = Tt(o), ie = Dt(o), ce = Le(
916
+ () => m == null ? void 0 : m(o),
917
+ [m, o]
918
+ ), A = Le(
919
+ () => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
920
+ [o]
903
921
  );
904
- if (kt(a))
922
+ if (Rt(o))
905
923
  return null;
906
- if (a.deleted_at || a.type === "deleted")
907
- return /* @__PURE__ */ e(N, { message: a });
908
- if (Tt(a))
909
- return /* @__PURE__ */ e(T, {});
910
- const te = !_ && !!a.reply_count, se = !_ && a.show_in_channel && a.parent_id, O = a.status === "failed" && ((ne = a.error) == null ? void 0 : ne.status) !== 403, P = Dt(a);
911
- let B;
912
- O ? B = () => h(a) : P && (B = () => E(!0));
913
- const H = p(), oe = D(
924
+ if (o.deleted_at || o.type === "deleted")
925
+ return /* @__PURE__ */ e(Z, { message: o });
926
+ if (At(o))
927
+ return /* @__PURE__ */ e(O, {});
928
+ const P = !k && !!o.reply_count, H = !k && o.show_in_channel && o.parent_id, Y = o.status === "failed" && ((be = o.error) == null ? void 0 : be.status) !== 403, te = Lt(o);
929
+ let se;
930
+ Y ? se = () => N(o) : te && (se = () => R(!0));
931
+ const G = I(), de = L(
914
932
  "str-chat__message str-chat__message-simple",
915
- `str-chat__message--${a.type}`,
916
- `str-chat__message--${a.status}`,
917
- H ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
918
- a.text ? "str-chat__message--has-text" : "has-no-text",
933
+ `str-chat__message--${o.type}`,
934
+ `str-chat__message--${o.status}`,
935
+ G ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
936
+ o.text ? "str-chat__message--has-text" : "has-no-text",
919
937
  {
920
- "str-chat__message--has-attachment": W,
921
- "str-chat__message--highlighted": x,
922
- "str-chat__message--pinned pinned-message": a.pinned,
923
- "str-chat__message--with-reactions": j,
924
- "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((me = a == null ? void 0 : a.error) == null ? void 0 : me.status) !== 403,
925
- "str-chat__message-with-thread-link": te || se,
926
- "str-chat__virtual-message__wrapper--end": l,
927
- "str-chat__virtual-message__wrapper--first": d,
928
- "str-chat__virtual-message__wrapper--group": r
938
+ "str-chat__message--has-attachment": le,
939
+ "str-chat__message--highlighted": S,
940
+ "str-chat__message--pinned pinned-message": o.pinned,
941
+ "str-chat__message--with-reactions": ie,
942
+ "str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((ae = o == null ? void 0 : o.error) == null ? void 0 : ae.status) !== 403,
943
+ "str-chat__message-with-thread-link": P || H,
944
+ "str-chat__virtual-message__wrapper--end": a,
945
+ "str-chat__virtual-message__wrapper--first": c,
946
+ "str-chat__virtual-message__wrapper--group": g
929
947
  }
930
- ), ve = a.poll_id && b.polls.fromState(a.poll_id), q = us(a), J = Re(a), le = !!(z != null && z.length && !a.quoted_message), ee = J && H && le;
931
- return /* @__PURE__ */ i(de, { children: [
932
- o && /* @__PURE__ */ e(
933
- C,
948
+ ), fe = o.poll_id && y.polls.fromState(o.poll_id), ne = gs(o), J = Be(o), ge = fs(o), me = !!(A != null && A.length && !o.quoted_message), xe = J && G && me;
949
+ return /* @__PURE__ */ i(he, { children: [
950
+ d && /* @__PURE__ */ e(
951
+ p,
934
952
  {
935
953
  additionalMessageInputProps: s
936
954
  }
937
955
  ),
938
- M && /* @__PURE__ */ e(
939
- Rt,
956
+ _ && /* @__PURE__ */ e(
957
+ Ut,
940
958
  {
941
- MessageBouncePrompt: v,
942
- onClose: () => E(!1),
943
- open: M
959
+ MessageBouncePrompt: q,
960
+ onClose: () => R(!1),
961
+ open: _
944
962
  }
945
963
  ),
946
- /* @__PURE__ */ i("div", { className: oe, children: [
947
- L && /* @__PURE__ */ e(L, {}),
948
- !!y && /* @__PURE__ */ e(Y, { reminder: y }),
949
- a.user && /* @__PURE__ */ e(
950
- ae,
964
+ /* @__PURE__ */ i("div", { className: de, children: [
965
+ ee && /* @__PURE__ */ e(ee, {}),
966
+ !!x && /* @__PURE__ */ e($, { reminder: x }),
967
+ o.user && /* @__PURE__ */ e(
968
+ oe,
951
969
  {
952
970
  className: "str-chat__avatar str-chat__message-sender-avatar",
953
- id: a.user.id,
954
- image: a.user.image,
955
- name: a.user.name || a.user.id
971
+ id: o.user.id,
972
+ image: o.user.image,
973
+ name: o.user.name || o.user.id
956
974
  }
957
975
  ),
958
976
  /* @__PURE__ */ e(
959
977
  "div",
960
978
  {
961
- className: D("str-chat__message-inner", {
962
- "str-chat__simple-message--error-failed": O || P
979
+ className: L("str-chat__message-inner", {
980
+ "str-chat__simple-message--error-failed": Y || te
963
981
  }),
964
982
  "data-testid": "message-inner",
965
- onClick: B,
966
- onKeyDown: B,
967
- role: B ? "button" : void 0,
968
- tabIndex: B ? 0 : void 0,
983
+ onClick: se,
984
+ onKeyDown: se,
985
+ role: se ? "button" : void 0,
986
+ tabIndex: se ? 0 : void 0,
969
987
  style: {
970
988
  // Force margins to 0 to prevent hover layout shift
971
989
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
972
990
  marginInlineEnd: 0,
973
991
  marginInlineStart: 0
974
992
  },
975
- children: q ? (
993
+ children: ge ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
994
+ /* @__PURE__ */ e(
995
+ ws,
996
+ {
997
+ isCreator: G,
998
+ title: (X = o.metadata) == null ? void 0 : X.attachment_title,
999
+ mimeType: (Ce = o.metadata) == null ? void 0 : Ce.attachment_mime_type,
1000
+ thumbnail: (Ne = o.metadata) == null ? void 0 : Ne.attachment_thumbnail,
1001
+ amountText: (pe = o.metadata) == null ? void 0 : pe.amount_text,
1002
+ detail: (re = o.metadata) == null ? void 0 : re.attachment_detail,
1003
+ paymentStatus: (ye = o.metadata) == null ? void 0 : ye.payment_status,
1004
+ onUnlock: r ? () => r(o, w) : void 0,
1005
+ onDownload: l ? () => l(o, w) : void 0
1006
+ }
1007
+ ),
1008
+ o.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(je, { message: o, renderText: v }) }) })
1009
+ ] }) : ne ? (
976
1010
  /* Tip-only messages render as a standalone bubble */
977
- /* @__PURE__ */ e(_e, { message: a, standalone: !0 })
1011
+ /* @__PURE__ */ e(Re, { message: o, standalone: !0 })
978
1012
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
979
1013
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
980
- J && !ee && /* @__PURE__ */ e(
981
- _e,
1014
+ J && !xe && /* @__PURE__ */ e(
1015
+ Re,
982
1016
  {
983
- message: a,
984
- hasAttachment: le,
985
- isMyMessage: H
1017
+ message: o,
1018
+ hasAttachment: me,
1019
+ isMyMessage: G
986
1020
  }
987
1021
  ),
988
- ve && /* @__PURE__ */ e(Lt, { poll: ve }),
989
- z != null && z.length && !a.quoted_message ? /* @__PURE__ */ e(
990
- u,
1022
+ fe && /* @__PURE__ */ e(Pt, { poll: fe }),
1023
+ A != null && A.length && !o.quoted_message ? /* @__PURE__ */ e(
1024
+ C,
991
1025
  {
992
- actionHandler: c,
993
- attachments: z
1026
+ actionHandler: h,
1027
+ attachments: A
994
1028
  }
995
1029
  ) : null,
996
- re ? /* @__PURE__ */ e(
997
- Z,
1030
+ ce ? /* @__PURE__ */ e(
1031
+ z,
998
1032
  {
999
- message: a,
1000
- renderText: w
1033
+ message: o,
1034
+ renderText: v
1001
1035
  }
1002
- ) : /* @__PURE__ */ e(At, { message: a, renderText: w }),
1003
- /* @__PURE__ */ e(Pt, {})
1036
+ ) : /* @__PURE__ */ e(je, { message: o, renderText: v }),
1037
+ /* @__PURE__ */ e(Ft, {})
1004
1038
  ] }),
1005
- (!J || ee) && /* @__PURE__ */ e(
1006
- _e,
1039
+ (!J || xe) && /* @__PURE__ */ e(
1040
+ Re,
1007
1041
  {
1008
- message: a,
1009
- hasAttachment: le,
1010
- isMyMessage: H
1042
+ message: o,
1043
+ hasAttachment: me,
1044
+ isMyMessage: G
1011
1045
  }
1012
1046
  ),
1013
1047
  n && J && /* @__PURE__ */ e(
1014
- vs,
1048
+ Ss,
1015
1049
  {
1016
- selected: S,
1017
- onVoteUp: R,
1018
- onVoteDown: m
1050
+ selected: u,
1051
+ onVoteUp: f,
1052
+ onVoteDown: E
1019
1053
  }
1020
1054
  )
1021
1055
  ] })
1022
1056
  }
1023
1057
  ),
1024
- te && /* @__PURE__ */ e(
1025
- Q,
1058
+ P && /* @__PURE__ */ e(
1059
+ D,
1026
1060
  {
1027
- onClick: f,
1028
- reply_count: a.reply_count
1061
+ onClick: b,
1062
+ reply_count: o.reply_count
1029
1063
  }
1030
1064
  ),
1031
- se && /* @__PURE__ */ e(F, {})
1032
- ] }, a.id)
1065
+ H && /* @__PURE__ */ e(Q, {})
1066
+ ] }, o.id)
1033
1067
  ] });
1034
- }, ys = G.memo(
1035
- ps,
1036
- gt
1037
- ), ws = (t) => {
1038
- const s = ze("CustomMessage");
1039
- return /* @__PURE__ */ e(ys, { ...s, ...t });
1040
- }, _s = (t) => ({
1068
+ }, Ms = F.memo(
1069
+ Is,
1070
+ (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlock !== s.onAttachmentUnlock || t.onAttachmentDownload !== s.onAttachmentDownload ? !1 : Ct(t, s)
1071
+ ), ks = (t) => {
1072
+ const s = Ke("CustomMessage");
1073
+ return /* @__PURE__ */ e(Ms, { ...s, ...t });
1074
+ }, Ts = (t) => ({
1041
1075
  linkPreviews: Array.from(t.previews.values()).filter(
1042
- (s) => Be.previewIsLoaded(s) || Be.previewIsLoading(s)
1076
+ (s) => We.previewIsLoaded(s) || We.previewIsLoading(s)
1043
1077
  )
1044
- }), Es = ({
1078
+ }), Ds = ({
1045
1079
  link: t,
1046
1080
  onDismiss: s
1047
1081
  }) => {
1048
- const { og_scrape_url: n, title: o, image_url: l } = t;
1082
+ const { og_scrape_url: n, title: r, image_url: l } = t;
1049
1083
  return /* @__PURE__ */ i(
1050
1084
  "a",
1051
1085
  {
@@ -1058,7 +1092,7 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1058
1092
  "img",
1059
1093
  {
1060
1094
  src: l,
1061
- alt: o || "",
1095
+ alt: r || "",
1062
1096
  className: "h-[148px] w-full rounded-[20px] object-cover"
1063
1097
  }
1064
1098
  ),
@@ -1066,47 +1100,47 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1066
1100
  "button",
1067
1101
  {
1068
1102
  type: "button",
1069
- onClick: (r) => {
1070
- r.preventDefault(), s(n);
1103
+ onClick: (a) => {
1104
+ a.preventDefault(), s(n);
1071
1105
  },
1072
1106
  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 focus-ring",
1073
1107
  "aria-label": "Close link preview",
1074
- children: /* @__PURE__ */ e(De, { className: "size-4 text-black/90" })
1108
+ children: /* @__PURE__ */ e(Oe, { className: "size-4 text-black/90" })
1075
1109
  }
1076
1110
  ),
1077
1111
  /* @__PURE__ */ i("div", { className: "p-2", children: [
1078
- o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
1112
+ r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
1079
1113
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
1080
1114
  ] })
1081
1115
  ]
1082
1116
  }
1083
1117
  );
1084
- }, Ss = () => {
1085
- const { linkPreviewsManager: t } = Ft(), { linkPreviews: s } = Ot(
1118
+ }, Rs = () => {
1119
+ const { linkPreviewsManager: t } = Ot(), { linkPreviews: s } = Bt(
1086
1120
  t.state,
1087
- _s
1121
+ Ts
1088
1122
  ), n = (l) => {
1089
1123
  t.dismissPreview(l);
1090
1124
  };
1091
1125
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
1092
- Es,
1126
+ Ds,
1093
1127
  {
1094
1128
  link: l,
1095
1129
  onDismiss: n
1096
1130
  },
1097
1131
  l.og_scrape_url
1098
1132
  )) }) : null;
1099
- }, Is = () => {
1100
- const { handleSubmit: t } = Bt(), s = Gt();
1101
- return /* @__PURE__ */ i(de, { children: [
1102
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e($t, {}) }),
1133
+ }, As = () => {
1134
+ const { handleSubmit: t } = $t(), s = jt();
1135
+ return /* @__PURE__ */ i(he, { children: [
1136
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(zt, {}) }),
1103
1137
  /* @__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: [
1104
- /* @__PURE__ */ e(jt, {}),
1105
- /* @__PURE__ */ e(Ss, {}),
1106
- /* @__PURE__ */ e(zt, {}),
1138
+ /* @__PURE__ */ e(Ht, {}),
1139
+ /* @__PURE__ */ e(Rs, {}),
1140
+ /* @__PURE__ */ e(Vt, {}),
1107
1141
  /* @__PURE__ */ i("div", { className: "flex", children: [
1108
1142
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1109
- Ht,
1143
+ Yt,
1110
1144
  {
1111
1145
  className: "w-full resize-none outline-none leading-6",
1112
1146
  autoFocus: !0,
@@ -1122,72 +1156,72 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1122
1156
  disabled: !s,
1123
1157
  onClick: t,
1124
1158
  type: "button",
1125
- children: /* @__PURE__ */ e(Kt, { className: "size-4" })
1159
+ children: /* @__PURE__ */ e(es, { className: "size-4" })
1126
1160
  }
1127
1161
  )
1128
1162
  ] })
1129
1163
  ] })
1130
1164
  ] });
1131
- }, Ms = ({
1165
+ }, Ls = ({
1132
1166
  renderActions: t
1133
1167
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
1134
1168
  t && (t == null ? void 0 : t()),
1135
- /* @__PURE__ */ e(Ut, { Input: Is })
1136
- ] }), ks = [
1169
+ /* @__PURE__ */ e(Gt, { Input: As })
1170
+ ] }), Us = [
1137
1171
  "SYSTEM_DM_AGENT_PAUSED",
1138
1172
  "SYSTEM_DM_AGENT_RESUMED"
1139
- ], Ts = {
1173
+ ], Ps = {
1140
1174
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1141
1175
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1142
- }, Ds = [
1176
+ }, Fs = [
1143
1177
  "SYSTEM_AGE_SAFETY_BLOCKED"
1144
- ], Rs = {
1178
+ ], Os = {
1145
1179
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1146
- }, Ee = "age safety guidelines.", Ls = "https://linktr.ee/s/about/contact", $e = (t) => ks.includes(t), As = (t) => Ds.includes(t), Ps = (t) => {
1147
- var o;
1148
- const s = (o = t.metadata) == null ? void 0 : o.custom_type;
1149
- if ($e(s))
1180
+ }, Ae = "age safety guidelines.", Bs = "https://linktr.ee/s/about/contact", Je = (t) => Us.includes(t), Gs = (t) => Fs.includes(t), $s = (t) => {
1181
+ var r;
1182
+ const s = (r = t.metadata) == null ? void 0 : r.custom_type;
1183
+ if (Je(s))
1150
1184
  return {
1151
1185
  kind: "dm-agent",
1152
1186
  type: s
1153
1187
  };
1154
- if (As(s))
1188
+ if (Gs(s))
1155
1189
  return {
1156
1190
  kind: "age-safety",
1157
1191
  type: s
1158
1192
  };
1159
1193
  const n = t.dm_agent_system_type;
1160
- if ($e(n))
1194
+ if (Je(n))
1161
1195
  return {
1162
1196
  kind: "dm-agent",
1163
1197
  type: n
1164
1198
  };
1165
- }, Fs = (t) => {
1166
- const s = t.indexOf(Ee);
1199
+ }, js = (t) => {
1200
+ const s = t.indexOf(Ae);
1167
1201
  if (s === -1)
1168
1202
  return t;
1169
- const n = s + Ee.length;
1170
- return /* @__PURE__ */ i(de, { children: [
1203
+ const n = s + Ae.length;
1204
+ return /* @__PURE__ */ i(he, { children: [
1171
1205
  t.slice(0, s),
1172
1206
  /* @__PURE__ */ e(
1173
1207
  "a",
1174
1208
  {
1175
- href: Ls,
1209
+ href: Bs,
1176
1210
  target: "_blank",
1177
1211
  rel: "noopener noreferrer",
1178
1212
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1179
- children: Ee
1213
+ children: Ae
1180
1214
  }
1181
1215
  ),
1182
1216
  t.slice(n)
1183
1217
  ] });
1184
- }, Os = (t) => {
1185
- var o, l;
1186
- const s = t.message.hide_date === !0, n = Ps(
1218
+ }, zs = (t) => {
1219
+ var r, l;
1220
+ const s = t.message.hide_date === !0, n = $s(
1187
1221
  t.message
1188
1222
  );
1189
1223
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
1190
- const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Ts[n.type];
1224
+ const d = ((r = t.message.text) == null ? void 0 : r.trim()) || Ps[n.type];
1191
1225
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1192
1226
  /* @__PURE__ */ i(
1193
1227
  "div",
@@ -1197,7 +1231,7 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1197
1231
  "data-dm-agent-system-type": n.type,
1198
1232
  children: [
1199
1233
  /* @__PURE__ */ e(
1200
- Qt,
1234
+ ts,
1201
1235
  {
1202
1236
  size: 16,
1203
1237
  weight: "regular",
@@ -1209,11 +1243,11 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1209
1243
  ]
1210
1244
  }
1211
1245
  ),
1212
- !s && /* @__PURE__ */ e(we, { message: t.message })
1246
+ !s && /* @__PURE__ */ e(De, { message: t.message })
1213
1247
  ] });
1214
1248
  }
1215
1249
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1216
- const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Rs[n.type];
1250
+ const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Os[n.type];
1217
1251
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1218
1252
  /* @__PURE__ */ i(
1219
1253
  "div",
@@ -1223,7 +1257,7 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1223
1257
  "data-age-safety-system-type": n.type,
1224
1258
  children: [
1225
1259
  /* @__PURE__ */ e(
1226
- es,
1260
+ ss,
1227
1261
  {
1228
1262
  size: 24,
1229
1263
  weight: "duotone",
@@ -1232,11 +1266,11 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1232
1266
  "data-testid": "age-safety-system-message-icon"
1233
1267
  }
1234
1268
  ),
1235
- /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Fs(d) }) })
1269
+ /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: js(d) }) })
1236
1270
  ]
1237
1271
  }
1238
1272
  ),
1239
- !s && /* @__PURE__ */ e(we, { message: t.message })
1273
+ !s && /* @__PURE__ */ e(De, { message: t.message })
1240
1274
  ] });
1241
1275
  }
1242
1276
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1245,12 +1279,12 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1245
1279
  /* @__PURE__ */ e("p", { children: t.message.text }),
1246
1280
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1247
1281
  ] }),
1248
- !s && /* @__PURE__ */ e(we, { message: t.message })
1282
+ !s && /* @__PURE__ */ e(De, { message: t.message })
1249
1283
  ] });
1250
- }, Us = () => null, Bs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1284
+ }, Hs = () => null, Vs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1251
1285
  "div",
1252
1286
  {
1253
- className: D("flex items-center justify-center h-full", t),
1287
+ className: L("flex items-center justify-center h-full", t),
1254
1288
  children: [
1255
1289
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1256
1290
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1290,31 +1324,31 @@ const Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1290
1324
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1291
1325
  ]
1292
1326
  }
1293
- ), Ce = G.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1294
- /* @__PURE__ */ e(Bs, { className: "w-6 h-6" }),
1327
+ ), Se = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1328
+ /* @__PURE__ */ e(Vs, { className: "w-6 h-6" }),
1295
1329
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1296
1330
  ] }) }));
1297
- Ce.displayName = "LoadingState";
1298
- const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Gs = ({
1331
+ Se.displayName = "LoadingState";
1332
+ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ys = ({
1299
1333
  onBack: t,
1300
1334
  showBackButton: s,
1301
1335
  onShowInfo: n,
1302
- canShowInfo: o,
1336
+ canShowInfo: r,
1303
1337
  showStarButton: l = !1
1304
1338
  }) => {
1305
- var g, p, a, w, _;
1306
- const { channel: d } = Te(), r = G.useMemo(() => Object.values(d.state.members || {}).find(
1307
- (M) => {
1308
- var E;
1309
- return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== d._client.userID;
1339
+ var N, S, m, I, o;
1340
+ const { channel: d } = Ie(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
1341
+ (k) => {
1342
+ var y;
1343
+ return ((y = k.user) == null ? void 0 : y.id) && k.user.id !== d._client.userID;
1310
1344
  }
1311
- ), [d._client.userID, d.state.members]), c = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((p = r == null ? void 0 : r.user) == null ? void 0 : p.id) || "Unknown member", f = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, h = Ye(d), x = async () => {
1345
+ ), [d._client.userID, d.state.members]), c = ((N = a == null ? void 0 : a.user) == null ? void 0 : N.name) || ((S = a == null ? void 0 : a.user) == null ? void 0 : S.id) || "Unknown member", g = (m = a == null ? void 0 : a.user) == null ? void 0 : m.image, h = tt(d), b = async () => {
1312
1346
  try {
1313
1347
  h ? await d.unpin() : await d.pin();
1314
- } catch (b) {
1348
+ } catch (v) {
1315
1349
  console.error(
1316
1350
  "[CustomChannelHeader] Failed to update pinned status:",
1317
- b
1351
+ v
1318
1352
  );
1319
1353
  }
1320
1354
  };
@@ -1323,21 +1357,21 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1323
1357
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
1324
1358
  "button",
1325
1359
  {
1326
- className: ce,
1360
+ className: ue,
1327
1361
  onClick: t || (() => {
1328
1362
  }),
1329
1363
  type: "button",
1330
1364
  "aria-label": "Back to conversations",
1331
- children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
1365
+ children: /* @__PURE__ */ e(He, { className: "size-5 text-black/90" })
1332
1366
  }
1333
1367
  ) }),
1334
1368
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
1335
1369
  /* @__PURE__ */ e(
1336
- ae,
1370
+ oe,
1337
1371
  {
1338
- id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || d.id || "unknown",
1372
+ id: ((I = a == null ? void 0 : a.user) == null ? void 0 : I.id) || d.id || "unknown",
1339
1373
  name: c,
1340
- image: f,
1374
+ image: g,
1341
1375
  starred: l && h,
1342
1376
  size: 40
1343
1377
  }
@@ -1348,14 +1382,14 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1348
1382
  l && /* @__PURE__ */ e(
1349
1383
  "button",
1350
1384
  {
1351
- className: ce,
1352
- onClick: x,
1385
+ className: ue,
1386
+ onClick: b,
1353
1387
  type: "button",
1354
1388
  "aria-label": h ? "Unstar conversation" : "Star conversation",
1355
1389
  children: /* @__PURE__ */ e(
1356
- Ie,
1390
+ Ue,
1357
1391
  {
1358
- className: D("size-5", {
1392
+ className: L("size-5", {
1359
1393
  "text-yellow-600": h,
1360
1394
  "text-black/90": !h
1361
1395
  }),
@@ -1367,11 +1401,11 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1367
1401
  /* @__PURE__ */ e(
1368
1402
  "button",
1369
1403
  {
1370
- className: ce,
1404
+ className: ue,
1371
1405
  onClick: n,
1372
1406
  type: "button",
1373
1407
  "aria-label": "Show info",
1374
- children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
1408
+ children: /* @__PURE__ */ e(Ve, { className: "size-5 text-black/90" })
1375
1409
  }
1376
1410
  )
1377
1411
  ] })
@@ -1383,17 +1417,17 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1383
1417
  {
1384
1418
  type: "button",
1385
1419
  onClick: t,
1386
- className: ce,
1420
+ className: ue,
1387
1421
  "aria-label": "Back to conversations",
1388
- children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
1422
+ children: /* @__PURE__ */ e(He, { className: "size-5 text-black/90" })
1389
1423
  }
1390
1424
  ),
1391
1425
  /* @__PURE__ */ e(
1392
- ae,
1426
+ oe,
1393
1427
  {
1394
- id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) || d.id || "unknown",
1428
+ id: ((o = a == null ? void 0 : a.user) == null ? void 0 : o.id) || d.id || "unknown",
1395
1429
  name: c,
1396
- image: f,
1430
+ image: g,
1397
1431
  starred: l && h,
1398
1432
  size: 40
1399
1433
  }
@@ -1404,14 +1438,14 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1404
1438
  l && /* @__PURE__ */ e(
1405
1439
  "button",
1406
1440
  {
1407
- className: ce,
1408
- onClick: x,
1441
+ className: ue,
1442
+ onClick: b,
1409
1443
  type: "button",
1410
1444
  "aria-label": h ? "Unstar conversation" : "Star conversation",
1411
1445
  children: /* @__PURE__ */ e(
1412
- Ie,
1446
+ Ue,
1413
1447
  {
1414
- className: D("size-5", {
1448
+ className: L("size-5", {
1415
1449
  "text-yellow-600": h,
1416
1450
  "text-black/90": !h
1417
1451
  }),
@@ -1420,201 +1454,209 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1420
1454
  )
1421
1455
  }
1422
1456
  ),
1423
- o && n && /* @__PURE__ */ e(
1457
+ r && n && /* @__PURE__ */ e(
1424
1458
  "button",
1425
1459
  {
1426
- className: ce,
1460
+ className: ue,
1427
1461
  onClick: n,
1428
1462
  type: "button",
1429
1463
  "aria-label": "Show info",
1430
- children: /* @__PURE__ */ e(Oe, { className: "size-5 text-black/90" })
1464
+ children: /* @__PURE__ */ e(Ve, { className: "size-5 text-black/90" })
1431
1465
  }
1432
1466
  )
1433
1467
  ] })
1434
1468
  ] })
1435
1469
  ] });
1436
- }, $s = ({
1470
+ }, Ws = ({
1437
1471
  onBack: t,
1438
1472
  showBackButton: s,
1439
1473
  renderMessageInputActions: n,
1440
- renderConversationFooter: o,
1474
+ renderConversationFooter: r,
1441
1475
  onLeaveConversation: l,
1442
1476
  onBlockParticipant: d,
1443
- showDeleteConversation: r = !0,
1477
+ showDeleteConversation: a = !0,
1444
1478
  onDeleteConversationClick: c,
1445
- onBlockParticipantClick: f,
1479
+ onBlockParticipantClick: g,
1446
1480
  onReportParticipantClick: h,
1447
- showStarButton: x = !1,
1448
- chatbotVotingEnabled: g = !1,
1449
- renderChannelBanner: p,
1450
- customProfileContent: a,
1451
- customChannelActions: w,
1452
- renderMessage: _
1481
+ showStarButton: b = !1,
1482
+ chatbotVotingEnabled: N = !1,
1483
+ onAttachmentUnlock: S,
1484
+ onAttachmentDownload: m,
1485
+ renderChannelBanner: I,
1486
+ customProfileContent: o,
1487
+ customChannelActions: v,
1488
+ renderMessage: k
1453
1489
  }) => {
1454
- const { channel: b } = Te(), M = X(null), E = G.useMemo(() => Object.values(b.state.members || {}).find(
1455
- (u) => {
1490
+ const { channel: y } = Ie(), w = K(null), _ = F.useMemo(() => Object.values(y.state.members || {}).find(
1491
+ (E) => {
1456
1492
  var C;
1457
- return ((C = u.user) == null ? void 0 : C.id) && u.user.id !== b._client.userID;
1493
+ return ((C = E.user) == null ? void 0 : C.id) && E.user.id !== y._client.userID;
1458
1494
  }
1459
- ), [b._client.userID, b.state.members]), y = G.useMemo(() => {
1460
- const m = b.data ?? {};
1461
- if (m.followerStatus)
1462
- return String(m.followerStatus);
1463
- if (m.isFollower !== void 0)
1464
- return m.isFollower ? "Subscribed to you" : "Not subscribed";
1465
- }, [b.data]), S = A(() => {
1466
- var m;
1467
- (m = M.current) == null || m.showModal();
1468
- }, []), R = A(() => {
1469
- var m;
1470
- (m = M.current) == null || m.close();
1495
+ ), [y._client.userID, y.state.members]), R = F.useMemo(() => {
1496
+ const f = y.data ?? {};
1497
+ if (f.followerStatus)
1498
+ return String(f.followerStatus);
1499
+ if (f.isFollower !== void 0)
1500
+ return f.isFollower ? "Subscribed to you" : "Not subscribed";
1501
+ }, [y.data]), x = U(() => {
1502
+ var f;
1503
+ (f = w.current) == null || f.showModal();
1504
+ }, []), u = U(() => {
1505
+ var f;
1506
+ (f = w.current) == null || f.close();
1471
1507
  }, []);
1472
- return /* @__PURE__ */ i(de, { children: [
1508
+ return /* @__PURE__ */ i(he, { children: [
1473
1509
  /* @__PURE__ */ e(
1474
- Yt,
1510
+ qt,
1475
1511
  {
1476
1512
  overrides: {
1477
- Message: (m) => {
1478
- const { message: u } = ze("ChannelView"), C = /* @__PURE__ */ e(
1479
- ws,
1513
+ Message: (f) => {
1514
+ const { message: E } = Ke("ChannelView"), C = /* @__PURE__ */ e(
1515
+ ks,
1480
1516
  {
1481
- ...m,
1482
- chatbotVotingEnabled: g
1517
+ ...f,
1518
+ chatbotVotingEnabled: N,
1519
+ onAttachmentUnlock: S,
1520
+ onAttachmentDownload: m
1483
1521
  }
1484
1522
  );
1485
- return !_ || !u ? C : _(C, u);
1523
+ return !k || !E ? C : k(C, E);
1486
1524
  }
1487
1525
  },
1488
- children: /* @__PURE__ */ i(Wt, { children: [
1526
+ children: /* @__PURE__ */ i(Zt, { children: [
1489
1527
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1490
- Gs,
1528
+ Ys,
1491
1529
  {
1492
1530
  onBack: t,
1493
1531
  showBackButton: s,
1494
- onShowInfo: S,
1495
- canShowInfo: !!E,
1496
- showStarButton: x
1532
+ onShowInfo: x,
1533
+ canShowInfo: !!_,
1534
+ showStarButton: b
1497
1535
  }
1498
1536
  ) }),
1499
- p == null ? void 0 : p(),
1537
+ I == null ? void 0 : I(),
1500
1538
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1501
- qt,
1539
+ Jt,
1502
1540
  {
1503
1541
  hideDeletedMessages: !0,
1504
1542
  hideNewMessageSeparator: !1,
1505
1543
  messageActions: void 0
1506
1544
  }
1507
1545
  ) }),
1508
- o == null ? void 0 : o(b),
1546
+ r == null ? void 0 : r(y),
1509
1547
  /* @__PURE__ */ e(
1510
- Ms,
1548
+ Ls,
1511
1549
  {
1512
- renderActions: () => n == null ? void 0 : n(b)
1550
+ renderActions: () => n == null ? void 0 : n(y)
1513
1551
  }
1514
1552
  )
1515
1553
  ] })
1516
1554
  }
1517
1555
  ),
1518
1556
  /* @__PURE__ */ e(
1519
- fs,
1557
+ bs,
1520
1558
  {
1521
- dialogRef: M,
1522
- onClose: R,
1523
- participant: E,
1524
- channel: b,
1525
- followerStatusLabel: y,
1559
+ dialogRef: w,
1560
+ onClose: u,
1561
+ participant: _,
1562
+ channel: y,
1563
+ followerStatusLabel: R,
1526
1564
  onLeaveConversation: l,
1527
1565
  onBlockParticipant: d,
1528
- showDeleteConversation: r,
1566
+ showDeleteConversation: a,
1529
1567
  onDeleteConversationClick: c,
1530
- onBlockParticipantClick: f,
1568
+ onBlockParticipantClick: g,
1531
1569
  onReportParticipantClick: h,
1532
- customProfileContent: a,
1533
- customChannelActions: w
1570
+ customProfileContent: o,
1571
+ customChannelActions: v
1534
1572
  }
1535
1573
  )
1536
1574
  ] });
1537
- }, Ke = G.memo(
1575
+ }, lt = F.memo(
1538
1576
  ({
1539
1577
  channel: t,
1540
1578
  onBack: s,
1541
1579
  showBackButton: n = !1,
1542
- renderMessageInputActions: o,
1580
+ renderMessageInputActions: r,
1543
1581
  renderConversationFooter: l,
1544
1582
  onLeaveConversation: d,
1545
- onBlockParticipant: r,
1583
+ onBlockParticipant: a,
1546
1584
  className: c,
1547
- CustomChannelEmptyState: f = Us,
1585
+ CustomChannelEmptyState: g = Hs,
1548
1586
  showDeleteConversation: h = !0,
1549
- onDeleteConversationClick: x,
1550
- onBlockParticipantClick: g,
1551
- onReportParticipantClick: p,
1552
- dmAgentEnabled: a,
1553
- messageMetadata: w,
1554
- onMessageSent: _,
1555
- showStarButton: b = !1,
1556
- chatbotVotingEnabled: M = !1,
1557
- renderChannelBanner: E,
1558
- customProfileContent: y,
1559
- customChannelActions: S,
1560
- renderMessage: R
1587
+ onDeleteConversationClick: b,
1588
+ onBlockParticipantClick: N,
1589
+ onReportParticipantClick: S,
1590
+ dmAgentEnabled: m,
1591
+ messageMetadata: I,
1592
+ onMessageSent: o,
1593
+ showStarButton: v = !1,
1594
+ chatbotVotingEnabled: k = !1,
1595
+ onAttachmentUnlock: y,
1596
+ onAttachmentDownload: w,
1597
+ renderChannelBanner: _,
1598
+ customProfileContent: R,
1599
+ customChannelActions: x,
1600
+ renderMessage: u
1561
1601
  }) => {
1562
- const m = A(
1563
- async (u, C, T) => {
1564
- var Z;
1565
- const v = ((Z = t.data) == null ? void 0 : Z.chatbot_paused) === !0, N = a && !v, F = {
1602
+ const f = U(
1603
+ async (E, C, p) => {
1604
+ var $;
1605
+ const O = (($ = t.data) == null ? void 0 : $.chatbot_paused) === !0, q = m && !O, Z = {
1566
1606
  ...C,
1567
- ...N && { silent: !0 },
1568
- ...w && {
1607
+ ...q && { silent: !0 },
1608
+ ...I && {
1569
1609
  metadata: {
1570
1610
  ...C.metadata ?? {},
1571
- ...w
1611
+ ...I
1572
1612
  }
1573
1613
  }
1574
1614
  }, Q = {
1575
- ...T,
1576
- ...N && { skip_push: !0 }
1577
- }, Y = await t.sendMessage(F, Q);
1578
- return _ == null || _(Y), Y;
1615
+ ...p,
1616
+ ...q && { skip_push: !0 }
1617
+ }, D = await t.sendMessage(Z, Q);
1618
+ return o == null || o(D), D;
1579
1619
  },
1580
- [t, a, w, _]
1620
+ [t, m, I, o]
1581
1621
  );
1582
1622
  return /* @__PURE__ */ e(
1583
1623
  "div",
1584
1624
  {
1585
- className: D(
1625
+ className: L(
1586
1626
  "messaging-channel-view h-full flex flex-col",
1587
1627
  c
1588
1628
  ),
1589
1629
  children: /* @__PURE__ */ e(
1590
- Vt,
1630
+ Wt,
1591
1631
  {
1592
1632
  channel: t,
1593
- MessageSystem: Os,
1594
- EmptyStateIndicator: f,
1595
- LoadingIndicator: Ce,
1596
- DateSeparator: gs,
1597
- doSendMessageRequest: m,
1633
+ MessageSystem: zs,
1634
+ EmptyStateIndicator: g,
1635
+ LoadingIndicator: Se,
1636
+ DateSeparator: Cs,
1637
+ doSendMessageRequest: f,
1598
1638
  children: /* @__PURE__ */ e(
1599
- $s,
1639
+ Ws,
1600
1640
  {
1601
1641
  onBack: s,
1602
1642
  showBackButton: n,
1603
- renderMessageInputActions: o,
1643
+ renderMessageInputActions: r,
1604
1644
  renderConversationFooter: l,
1605
1645
  onLeaveConversation: d,
1606
- onBlockParticipant: r,
1607
- CustomChannelEmptyState: f,
1646
+ onBlockParticipant: a,
1647
+ CustomChannelEmptyState: g,
1608
1648
  showDeleteConversation: h,
1609
- onDeleteConversationClick: x,
1610
- onBlockParticipantClick: g,
1611
- onReportParticipantClick: p,
1612
- showStarButton: b,
1613
- chatbotVotingEnabled: M,
1614
- renderChannelBanner: E,
1615
- customProfileContent: y,
1616
- customChannelActions: S,
1617
- renderMessage: R
1649
+ onDeleteConversationClick: b,
1650
+ onBlockParticipantClick: N,
1651
+ onReportParticipantClick: S,
1652
+ showStarButton: v,
1653
+ chatbotVotingEnabled: k,
1654
+ onAttachmentUnlock: y,
1655
+ onAttachmentDownload: w,
1656
+ renderChannelBanner: _,
1657
+ customProfileContent: R,
1658
+ customChannelActions: x,
1659
+ renderMessage: u
1618
1660
  }
1619
1661
  )
1620
1662
  }
@@ -1623,16 +1665,16 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1623
1665
  );
1624
1666
  }
1625
1667
  );
1626
- Ke.displayName = "ChannelView";
1627
- function js({
1668
+ lt.displayName = "ChannelView";
1669
+ function qs({
1628
1670
  searchQuery: t,
1629
1671
  setSearchQuery: s,
1630
1672
  placeholder: n
1631
1673
  }) {
1632
- const o = X(null);
1674
+ const r = K(null);
1633
1675
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1634
1676
  /* @__PURE__ */ e(
1635
- ts,
1677
+ ns,
1636
1678
  {
1637
1679
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1638
1680
  weight: "bold"
@@ -1641,7 +1683,7 @@ function js({
1641
1683
  /* @__PURE__ */ e(
1642
1684
  "input",
1643
1685
  {
1644
- ref: o,
1686
+ ref: r,
1645
1687
  type: "text",
1646
1688
  placeholder: n,
1647
1689
  value: t,
@@ -1650,157 +1692,159 @@ function js({
1650
1692
  }
1651
1693
  ),
1652
1694
  t && /* @__PURE__ */ e(
1653
- Je,
1695
+ rt,
1654
1696
  {
1655
1697
  label: "Clear search",
1656
1698
  onClick: () => {
1657
1699
  var l;
1658
- s(""), (l = o.current) == null || l.focus();
1700
+ s(""), (l = r.current) == null || l.focus();
1659
1701
  },
1660
1702
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1661
- children: /* @__PURE__ */ e(De, { className: "h-4 w-4", weight: "bold" })
1703
+ children: /* @__PURE__ */ e(Oe, { className: "h-4 w-4", weight: "bold" })
1662
1704
  }
1663
1705
  )
1664
1706
  ] });
1665
1707
  }
1666
- const zs = ({
1708
+ const Zs = ({
1667
1709
  participantSource: t,
1668
1710
  onSelectParticipant: s,
1669
1711
  onClose: n,
1670
- existingParticipantIds: o = /* @__PURE__ */ new Set(),
1712
+ existingParticipantIds: r = /* @__PURE__ */ new Set(),
1671
1713
  participantLabel: l = "participants",
1672
1714
  searchPlaceholder: d = "Search participants...",
1673
- className: r
1715
+ className: a
1674
1716
  }) => {
1675
- const { debug: c } = Ne(), [f, h] = k(""), [x, g] = k([]), [p, a] = k(!1), [w, _] = k(null), [b, M] = k(
1717
+ const { debug: c } = Me(), [g, h] = T(""), [b, N] = T([]), [S, m] = T(!1), [I, o] = T(null), [v, k] = T(
1676
1718
  null
1677
- ), E = X(!1);
1678
- K(() => {
1719
+ ), y = K(!1);
1720
+ W(() => {
1721
+ y.current = !1;
1722
+ }, [t]), W(() => {
1679
1723
  if (t.loading) {
1680
1724
  c && console.log(
1681
1725
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1682
1726
  );
1683
1727
  return;
1684
1728
  }
1685
- if (E.current) return;
1729
+ if (y.current) return;
1686
1730
  (async () => {
1687
- c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), _(null);
1731
+ c && console.log("[ParticipantPicker] Loading initial participants..."), m(!0), o(null);
1688
1732
  try {
1689
1733
  const u = await t.loadParticipants({
1690
1734
  search: "",
1691
1735
  // Load all participants initially
1692
1736
  limit: 100
1693
1737
  });
1694
- g(u.participants), E.current = !0, c && console.log(
1738
+ N(u.participants), y.current = !0, c && console.log(
1695
1739
  "[ParticipantPicker] Participants loaded successfully:",
1696
1740
  u.participants.length
1697
1741
  );
1698
1742
  } catch (u) {
1699
- const C = u instanceof Error ? u.message : "Failed to load participants";
1700
- _(C), console.error("[ParticipantPicker] Failed to load participants:", u);
1743
+ const f = u instanceof Error ? u.message : "Failed to load participants";
1744
+ o(f), console.error("[ParticipantPicker] Failed to load participants:", u);
1701
1745
  } finally {
1702
- a(!1);
1746
+ m(!1);
1703
1747
  }
1704
1748
  })();
1705
- }, [t.loading, c]);
1706
- const y = x.filter((m) => !o.has(m.id)).filter((m) => {
1707
- var C;
1708
- if (!f) return !0;
1709
- const u = f.toLowerCase();
1710
- return m.name.toLowerCase().includes(u) || ((C = m.email) == null ? void 0 : C.toLowerCase().includes(u)) || !1;
1711
- }), S = A(
1712
- async (m) => {
1713
- if (!b) {
1714
- M(m.id);
1749
+ }, [t, c]);
1750
+ const w = b.filter((x) => !r.has(x.id)).filter((x) => {
1751
+ var f;
1752
+ if (!g) return !0;
1753
+ const u = g.toLowerCase();
1754
+ return x.name.toLowerCase().includes(u) || ((f = x.email) == null ? void 0 : f.toLowerCase().includes(u)) || !1;
1755
+ }), _ = U(
1756
+ async (x) => {
1757
+ if (!v) {
1758
+ k(x.id);
1715
1759
  try {
1716
- await s(m);
1760
+ await s(x);
1717
1761
  } catch (u) {
1718
- console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
1762
+ console.error("[ParticipantPicker] Failed to start chat:", u), k(null);
1719
1763
  }
1720
1764
  }
1721
1765
  },
1722
- [s, b]
1723
- ), R = (m, u) => {
1724
- (m.key === "Enter" || m.key === " ") && (m.preventDefault(), S(u));
1766
+ [s, v]
1767
+ ), R = (x, u) => {
1768
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), _(u));
1725
1769
  };
1726
- return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1770
+ return /* @__PURE__ */ i("div", { className: L("flex flex-col h-full", a), children: [
1727
1771
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1728
1772
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1729
1773
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1730
- /* @__PURE__ */ e(Xe, { onClick: n })
1774
+ /* @__PURE__ */ e(ot, { onClick: n })
1731
1775
  ] }),
1732
1776
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1733
1777
  "Select a ",
1734
1778
  l.slice(0, -1),
1735
1779
  " to start messaging (",
1736
- y.length,
1780
+ w.length,
1737
1781
  " available)",
1738
1782
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1739
1783
  ] }),
1740
1784
  /* @__PURE__ */ e(
1741
- js,
1785
+ qs,
1742
1786
  {
1743
- searchQuery: f,
1787
+ searchQuery: g,
1744
1788
  setSearchQuery: h,
1745
1789
  placeholder: d
1746
1790
  }
1747
1791
  )
1748
1792
  ] }),
1749
- w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1793
+ I && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1750
1794
  "Error loading ",
1751
1795
  l,
1752
1796
  ": ",
1753
- w
1797
+ I
1754
1798
  ] }),
1755
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: p && y.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: [
1799
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && w.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: [
1756
1800
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1757
1801
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1758
1802
  "Loading ",
1759
1803
  l,
1760
1804
  "..."
1761
1805
  ] })
1762
- ] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1763
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ue, { className: "h-8 w-8 text-charcoal" }) }),
1764
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : x.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1765
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1806
+ ] }) }) : w.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1807
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ye, { className: "h-8 w-8 text-charcoal" }) }),
1808
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1809
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1766
1810
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1767
- y.map((m) => {
1768
- const u = m.name || m.email || m.id, C = m.email && m.name ? m.email : m.phone;
1811
+ w.map((x) => {
1812
+ const u = x.name || x.email || x.id, f = x.email && x.name ? x.email : x.phone;
1769
1813
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1770
1814
  "button",
1771
1815
  {
1772
1816
  type: "button",
1773
- onClick: () => S(m),
1774
- onKeyDown: (T) => R(T, m),
1817
+ onClick: () => _(x),
1818
+ onKeyDown: (E) => R(E, x),
1775
1819
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1776
1820
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1777
1821
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1778
1822
  /* @__PURE__ */ e(
1779
- ae,
1823
+ oe,
1780
1824
  {
1781
- id: m.id,
1825
+ id: x.id,
1782
1826
  name: u,
1783
- image: m.image,
1827
+ image: x.image,
1784
1828
  size: 40
1785
1829
  }
1786
1830
  ),
1787
1831
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1788
1832
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1789
- C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1833
+ f && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: f })
1790
1834
  ] })
1791
1835
  ] }),
1792
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: b === m.id ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5 text-stone" }) })
1836
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === x.id ? /* @__PURE__ */ e(_e, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ye, { className: "h-5 w-5 text-stone" }) })
1793
1837
  ] })
1794
1838
  }
1795
- ) }, m.id);
1839
+ ) }, x.id);
1796
1840
  }),
1797
- p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1841
+ S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1798
1842
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1799
1843
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1800
1844
  ] }) })
1801
1845
  ] }) })
1802
1846
  ] });
1803
- }, Hs = ({ className: t }) => /* @__PURE__ */ i(
1847
+ }, Js = ({ className: t }) => /* @__PURE__ */ i(
1804
1848
  "svg",
1805
1849
  {
1806
1850
  width: "140",
@@ -1934,17 +1978,17 @@ const zs = ({
1934
1978
  ] })
1935
1979
  ]
1936
1980
  }
1937
- ), Qe = G.memo(
1981
+ ), it = F.memo(
1938
1982
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1939
- /* @__PURE__ */ e(Hs, {}),
1983
+ /* @__PURE__ */ e(Js, {}),
1940
1984
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1941
1985
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1942
1986
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1943
1987
  ] })
1944
1988
  ] }) })
1945
1989
  );
1946
- Qe.displayName = "EmptyState";
1947
- const be = G.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1990
+ it.displayName = "EmptyState";
1991
+ const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1948
1992
  /* @__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: "⚠️" }) }),
1949
1993
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1950
1994
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1958,223 +2002,223 @@ const be = G.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1958
2002
  }
1959
2003
  )
1960
2004
  ] }) }));
1961
- be.displayName = "ErrorState";
1962
- const en = ({
2005
+ Ee.displayName = "ErrorState";
2006
+ const on = ({
1963
2007
  capabilities: t = {},
1964
2008
  className: s,
1965
2009
  renderMessageInputActions: n,
1966
- renderConversationFooter: o,
2010
+ renderConversationFooter: r,
1967
2011
  onChannelSelect: l,
1968
2012
  onParticipantSelect: d,
1969
- initialParticipantFilter: r,
2013
+ initialParticipantFilter: a,
1970
2014
  initialParticipantData: c,
1971
- CustomChannelEmptyState: f,
2015
+ CustomChannelEmptyState: g,
1972
2016
  showChannelList: h = !0,
1973
- filters: x,
1974
- channelRenderFilterFn: g,
1975
- channelListCustomEmptyStateIndicator: p,
1976
- onDeleteConversationClick: a,
1977
- onBlockParticipantClick: w,
1978
- onReportParticipantClick: _,
1979
- dmAgentEnabled: b,
1980
- messageMetadata: M,
1981
- onMessageSent: E,
1982
- showStarButton: y = !1,
1983
- chatbotVotingEnabled: S = !1,
2017
+ filters: b,
2018
+ channelRenderFilterFn: N,
2019
+ channelListCustomEmptyStateIndicator: S,
2020
+ onDeleteConversationClick: m,
2021
+ onBlockParticipantClick: I,
2022
+ onReportParticipantClick: o,
2023
+ dmAgentEnabled: v,
2024
+ messageMetadata: k,
2025
+ onMessageSent: y,
2026
+ showStarButton: w = !1,
2027
+ chatbotVotingEnabled: _ = !1,
1984
2028
  renderMessagePreview: R,
1985
- renderChannelBanner: m,
2029
+ renderChannelBanner: x,
1986
2030
  customProfileContent: u,
1987
- customChannelActions: C,
1988
- renderMessage: T
2031
+ customChannelActions: f,
2032
+ renderMessage: E
1989
2033
  }) => {
1990
2034
  const {
1991
- service: v,
1992
- client: N,
1993
- isConnected: F,
1994
- isLoading: Q,
1995
- error: Y,
1996
- refreshConnection: Z,
1997
- debug: L
1998
- } = ss(), [W, j] = k(null), [re, z] = k(!1), [te, se] = k(!1), [O, P] = k(!1), [B, H] = k(/* @__PURE__ */ new Set()), [oe, ve] = k(0), [q, J] = k(!1), [le, ee] = k(null), ne = X(null), {
1999
- participantSource: me,
2000
- participantLabel: Le = "participants",
2001
- showDeleteConversation: et = !0
2002
- } = t, tt = G.useMemo(() => {
2003
- const I = N == null ? void 0 : N.userID;
2035
+ service: C,
2036
+ client: p,
2037
+ isConnected: O,
2038
+ isLoading: q,
2039
+ error: Z,
2040
+ refreshConnection: Q,
2041
+ debug: D
2042
+ } = as(), [$, z] = T(null), [ee, le] = T(!1), [ie, ce] = T(!1), [A, P] = T(!1), [H, Y] = T(/* @__PURE__ */ new Set()), [te, se] = T(0), [G, de] = T(!1), [fe, ne] = T(null), J = K(null), {
2043
+ participantSource: ge,
2044
+ participantLabel: me = "participants",
2045
+ showDeleteConversation: xe = !0
2046
+ } = t, be = F.useMemo(() => {
2047
+ const M = p == null ? void 0 : p.userID;
2004
2048
  return {
2005
2049
  ...{
2006
2050
  type: "messaging",
2007
2051
  last_message_at: { $exists: !0 },
2008
- ...I && {
2009
- members: { $in: [I] },
2052
+ ...M && {
2053
+ members: { $in: [M] },
2010
2054
  hidden: !1
2011
2055
  }
2012
2056
  },
2013
- ...x
2057
+ ...b
2014
2058
  };
2015
- }, [x, N == null ? void 0 : N.userID]), ue = X(null), ie = A(async () => {
2016
- if (!N || !F) return;
2017
- const I = N.userID;
2018
- if (I)
2059
+ }, [b, p == null ? void 0 : p.userID]), ae = K(null), X = U(async () => {
2060
+ if (!p || !O) return;
2061
+ const M = p.userID;
2062
+ if (M)
2019
2063
  try {
2020
- L && console.log("[MessagingShell] Syncing channels for user:", I);
2021
- const V = await N.queryChannels(
2064
+ D && console.log("[MessagingShell] Syncing channels for user:", M);
2065
+ const V = await p.queryChannels(
2022
2066
  {
2023
2067
  type: "messaging",
2024
- members: { $in: [I] }
2068
+ members: { $in: [M] }
2025
2069
  },
2026
2070
  {},
2027
2071
  { limit: 100 }
2028
- ), U = /* @__PURE__ */ new Set();
2029
- V.forEach(($) => {
2030
- const pe = $.state.members;
2031
- Object.values(pe).forEach((it) => {
2032
- var Ae;
2033
- const ye = (Ae = it.user) == null ? void 0 : Ae.id;
2034
- ye && ye !== I && U.add(ye);
2072
+ ), B = /* @__PURE__ */ new Set();
2073
+ V.forEach((j) => {
2074
+ const ke = j.state.members;
2075
+ Object.values(ke).forEach((mt) => {
2076
+ var Ge;
2077
+ const Te = (Ge = mt.user) == null ? void 0 : Ge.id;
2078
+ Te && Te !== M && B.add(Te);
2035
2079
  });
2036
- }), H(($) => $.size === U.size && [...$].every((pe) => U.has(pe)) ? $ : U), z(V.length > 0), se(!0), ue.current = I, L && console.log("[MessagingShell] Channels synced successfully:", {
2080
+ }), Y((j) => j.size === B.size && [...j].every((ke) => B.has(ke)) ? j : B), le(V.length > 0), ce(!0), ae.current = M, D && console.log("[MessagingShell] Channels synced successfully:", {
2037
2081
  channelCount: V.length,
2038
- memberCount: U.size
2082
+ memberCount: B.size
2039
2083
  });
2040
2084
  } catch (V) {
2041
2085
  console.error("[MessagingShell] Failed to sync channels:", V);
2042
2086
  }
2043
- }, [N, F, L]);
2044
- K(() => {
2045
- if (!N || !F) return;
2046
- const I = N.userID;
2047
- I && ue.current !== I && ie();
2048
- }, [N, F, ie]), K(() => {
2049
- if (!r || !N || !F) return;
2087
+ }, [p, O, D]);
2088
+ W(() => {
2089
+ if (!p || !O) return;
2090
+ const M = p.userID;
2091
+ M && ae.current !== M && X();
2092
+ }, [p, O, X]), W(() => {
2093
+ if (!a || !p || !O) return;
2050
2094
  (async () => {
2051
- const V = N.userID;
2095
+ const V = p.userID;
2052
2096
  if (V)
2053
2097
  try {
2054
- L && console.log(
2098
+ D && console.log(
2055
2099
  "[MessagingShell] Loading initial conversation with:",
2056
- r
2100
+ a
2057
2101
  );
2058
- const U = await N.queryChannels(
2102
+ const B = await p.queryChannels(
2059
2103
  {
2060
2104
  type: "messaging",
2061
- members: { $eq: [V, r] }
2105
+ members: { $eq: [V, a] }
2062
2106
  },
2063
2107
  {},
2064
2108
  { limit: 1 }
2065
2109
  );
2066
- if (U.length > 0)
2067
- j(U[0]), J(!0), ee(null), l && l(U[0]), L && console.log(
2110
+ if (B.length > 0)
2111
+ z(B[0]), de(!0), ne(null), l && l(B[0]), D && console.log(
2068
2112
  "[MessagingShell] Initial conversation loaded:",
2069
- U[0].id
2113
+ B[0].id
2070
2114
  );
2071
- else if (c && v) {
2072
- L && console.log(
2115
+ else if (c && C) {
2116
+ D && console.log(
2073
2117
  "[MessagingShell] No conversation found, creating one for:",
2074
2118
  c
2075
2119
  );
2076
2120
  try {
2077
- const $ = await v.startChannelWithParticipant({
2121
+ const j = await C.startChannelWithParticipant({
2078
2122
  id: c.id,
2079
2123
  name: c.name,
2080
2124
  email: c.email,
2081
2125
  phone: c.phone
2082
2126
  });
2083
- j($), J(!0), ee(null), l && l($), L && console.log(
2127
+ z(j), de(!0), ne(null), l && l(j), D && console.log(
2084
2128
  "[MessagingShell] Channel created and loaded:",
2085
- $.id
2129
+ j.id
2086
2130
  );
2087
- } catch ($) {
2131
+ } catch (j) {
2088
2132
  console.error(
2089
2133
  "[MessagingShell] Failed to create conversation:",
2090
- $
2091
- ), ee("Failed to create conversation");
2134
+ j
2135
+ ), ne("Failed to create conversation");
2092
2136
  }
2093
2137
  } else
2094
- ee(
2138
+ ne(
2095
2139
  "No conversation found with this account"
2096
- ), L && console.log(
2140
+ ), D && console.log(
2097
2141
  "[MessagingShell] No conversation found for:",
2098
- r
2142
+ a
2099
2143
  );
2100
- } catch (U) {
2144
+ } catch (B) {
2101
2145
  console.error(
2102
2146
  "[MessagingShell] Failed to load initial conversation:",
2103
- U
2104
- ), ee("Failed to load conversation");
2147
+ B
2148
+ ), ne("Failed to load conversation");
2105
2149
  }
2106
2150
  })();
2107
2151
  }, [
2108
- r,
2152
+ a,
2109
2153
  c,
2110
- N,
2111
- F,
2112
- v,
2113
- L,
2154
+ p,
2155
+ O,
2156
+ C,
2157
+ D,
2114
2158
  l
2115
2159
  ]);
2116
- const st = A(
2117
- (I) => {
2118
- j(I), l == null || l(I);
2160
+ const Ce = U(
2161
+ (M) => {
2162
+ z(M), l == null || l(M);
2119
2163
  },
2120
2164
  [l]
2121
- ), nt = A(() => {
2122
- q || j(null);
2123
- }, [q]), at = A(
2124
- async (I) => {
2165
+ ), Ne = U(() => {
2166
+ G || z(null);
2167
+ }, [G]), pe = U(
2168
+ async (M) => {
2125
2169
  var V;
2126
- if (v)
2170
+ if (C)
2127
2171
  try {
2128
- L && console.log(
2172
+ D && console.log(
2129
2173
  "[MessagingShell] Starting conversation with:",
2130
- I.id
2174
+ M.id
2131
2175
  );
2132
- const U = await v.startChannelWithParticipant({
2133
- id: I.id,
2134
- name: I.name,
2135
- email: I.email,
2136
- phone: I.phone
2176
+ const B = await C.startChannelWithParticipant({
2177
+ id: M.id,
2178
+ name: M.name,
2179
+ email: M.email,
2180
+ phone: M.phone
2137
2181
  });
2138
2182
  try {
2139
- await U.show();
2140
- } catch ($) {
2141
- console.warn("[MessagingShell] Failed to unhide channel:", $);
2183
+ await B.show();
2184
+ } catch (j) {
2185
+ console.warn("[MessagingShell] Failed to unhide channel:", j);
2142
2186
  }
2143
- j(U), P(!1), (V = ne.current) == null || V.close(), d == null || d(I);
2144
- } catch (U) {
2145
- console.error("[MessagingShell] Failed to start conversation:", U);
2187
+ z(B), P(!1), (V = J.current) == null || V.close(), d == null || d(M);
2188
+ } catch (B) {
2189
+ console.error("[MessagingShell] Failed to start conversation:", B);
2146
2190
  }
2147
2191
  },
2148
- [v, d, L]
2149
- ), he = A(() => {
2150
- var I;
2151
- P(!1), (I = ne.current) == null || I.close();
2152
- }, []), rt = A(
2153
- (I) => {
2154
- I.target === ne.current && he();
2192
+ [C, d, D]
2193
+ ), re = U(() => {
2194
+ var M;
2195
+ P(!1), (M = J.current) == null || M.close();
2196
+ }, []), ye = U(
2197
+ (M) => {
2198
+ M.target === J.current && re();
2155
2199
  },
2156
- [he]
2157
- ), ot = A(
2158
- async (I) => {
2159
- L && console.log("[MessagingShell] Leaving conversation:", I.id), j(null), J(!1), ue.current = null, await ie();
2200
+ [re]
2201
+ ), ct = U(
2202
+ async (M) => {
2203
+ D && console.log("[MessagingShell] Leaving conversation:", M.id), z(null), de(!1), ae.current = null, await X();
2160
2204
  },
2161
- [ie, L]
2162
- ), lt = A(
2163
- async (I) => {
2164
- L && console.log("[MessagingShell] Blocking participant:", I), j(null), J(!1), ue.current = null, await ie();
2205
+ [X, D]
2206
+ ), dt = U(
2207
+ async (M) => {
2208
+ D && console.log("[MessagingShell] Blocking participant:", M), z(null), de(!1), ae.current = null, await X();
2165
2209
  },
2166
- [ie, L]
2167
- ), fe = !!W;
2168
- return Q ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ce, {}) }) : Y ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(be, { message: Y, onBack: Z }) }) : !F || !N ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
2169
- be,
2210
+ [X, D]
2211
+ ), ve = !!$;
2212
+ return q ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : Z ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: Z, onBack: Q }) }) : !O || !p ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
2213
+ Ee,
2170
2214
  {
2171
2215
  message: "Not connected to messaging service",
2172
- onBack: Z
2216
+ onBack: Q
2173
2217
  }
2174
- ) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(be, { message: le }) }) : /* @__PURE__ */ i(
2218
+ ) }) : fe ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: fe }) }) : /* @__PURE__ */ i(
2175
2219
  "div",
2176
2220
  {
2177
- className: D(
2221
+ className: L(
2178
2222
  "messaging-shell h-full bg-background-primary overflow-hidden",
2179
2223
  s
2180
2224
  ),
@@ -2183,24 +2227,24 @@ const en = ({
2183
2227
  /* @__PURE__ */ e(
2184
2228
  "div",
2185
2229
  {
2186
- className: D(
2230
+ className: L(
2187
2231
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2188
2232
  {
2189
- "!hidden": h === !1 || q,
2233
+ "!hidden": h === !1 || G,
2190
2234
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2191
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && fe,
2235
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !G && ve,
2192
2236
  // Show on mobile when no channel selected, use same wide width on desktop
2193
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !fe
2237
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !G && !ve
2194
2238
  }
2195
2239
  ),
2196
2240
  children: /* @__PURE__ */ e(
2197
- Ze,
2241
+ at,
2198
2242
  {
2199
- onChannelSelect: st,
2200
- selectedChannel: W || void 0,
2201
- filters: tt,
2202
- channelRenderFilterFn: g,
2203
- customEmptyStateIndicator: p,
2243
+ onChannelSelect: Ce,
2244
+ selectedChannel: $ || void 0,
2245
+ filters: be,
2246
+ channelRenderFilterFn: N,
2247
+ customEmptyStateIndicator: S,
2204
2248
  renderMessagePreview: R
2205
2249
  }
2206
2250
  )
@@ -2209,84 +2253,84 @@ const en = ({
2209
2253
  /* @__PURE__ */ e(
2210
2254
  "div",
2211
2255
  {
2212
- className: D(
2256
+ className: L(
2213
2257
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2214
2258
  {
2215
2259
  // In direct conversation mode (or waiting for it), always show (full width)
2216
- flex: q || fe || r,
2260
+ flex: G || ve || a,
2217
2261
  // Normal mode: hide on mobile when no channel selected
2218
- "hidden lg:flex": !q && !fe && !r
2262
+ "hidden lg:flex": !G && !ve && !a
2219
2263
  }
2220
2264
  ),
2221
- children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2222
- Ke,
2265
+ children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2266
+ lt,
2223
2267
  {
2224
- channel: W,
2225
- onBack: nt,
2226
- showBackButton: !q,
2268
+ channel: $,
2269
+ onBack: Ne,
2270
+ showBackButton: !G,
2227
2271
  renderMessageInputActions: n,
2228
- renderConversationFooter: o,
2229
- renderChannelBanner: m,
2230
- onLeaveConversation: ot,
2231
- onBlockParticipant: lt,
2232
- CustomChannelEmptyState: f,
2233
- showDeleteConversation: et,
2234
- onDeleteConversationClick: a,
2235
- onBlockParticipantClick: w,
2236
- onReportParticipantClick: _,
2237
- dmAgentEnabled: b,
2238
- messageMetadata: M,
2239
- onMessageSent: E,
2240
- showStarButton: y,
2241
- chatbotVotingEnabled: S,
2272
+ renderConversationFooter: r,
2273
+ renderChannelBanner: x,
2274
+ onLeaveConversation: ct,
2275
+ onBlockParticipant: dt,
2276
+ CustomChannelEmptyState: g,
2277
+ showDeleteConversation: xe,
2278
+ onDeleteConversationClick: m,
2279
+ onBlockParticipantClick: I,
2280
+ onReportParticipantClick: o,
2281
+ dmAgentEnabled: v,
2282
+ messageMetadata: k,
2283
+ onMessageSent: y,
2284
+ showStarButton: w,
2285
+ chatbotVotingEnabled: _,
2242
2286
  customProfileContent: u,
2243
- customChannelActions: C,
2244
- renderMessage: T
2287
+ customChannelActions: f,
2288
+ renderMessage: E
2245
2289
  },
2246
- W.id
2247
- ) }) : r ? (
2290
+ $.id
2291
+ ) }) : a ? (
2248
2292
  // Show loading while creating/loading direct conversation channel
2249
- /* @__PURE__ */ e(Ce, {})
2293
+ /* @__PURE__ */ e(Se, {})
2250
2294
  ) : /* @__PURE__ */ e(
2251
- Qe,
2295
+ it,
2252
2296
  {
2253
- hasChannels: re,
2254
- channelsLoaded: te
2297
+ hasChannels: ee,
2298
+ channelsLoaded: ie
2255
2299
  }
2256
2300
  )
2257
2301
  }
2258
2302
  )
2259
2303
  ] }),
2260
- me && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2304
+ ge && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2261
2305
  /* @__PURE__ */ e(
2262
2306
  "dialog",
2263
2307
  {
2264
- ref: ne,
2308
+ ref: J,
2265
2309
  className: "mes-dialog",
2266
- onClick: rt,
2267
- onClose: he,
2310
+ onClick: ye,
2311
+ onClose: re,
2268
2312
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2269
- zs,
2313
+ Zs,
2270
2314
  {
2271
- participantSource: me,
2272
- onSelectParticipant: at,
2273
- onClose: he,
2274
- existingParticipantIds: B,
2275
- participantLabel: Le,
2276
- searchPlaceholder: `Search ${Le}...`
2315
+ participantSource: ge,
2316
+ onSelectParticipant: pe,
2317
+ onClose: re,
2318
+ existingParticipantIds: H,
2319
+ participantLabel: me,
2320
+ searchPlaceholder: `Search ${me}...`
2277
2321
  },
2278
- oe
2322
+ te
2279
2323
  ) })
2280
2324
  }
2281
2325
  )
2282
2326
  ]
2283
2327
  }
2284
2328
  );
2285
- }, Vs = ({
2329
+ }, Xs = ({
2286
2330
  question: t,
2287
2331
  onClick: s,
2288
2332
  loading: n = !1,
2289
- className: o
2333
+ className: r
2290
2334
  }) => /* @__PURE__ */ e(
2291
2335
  "button",
2292
2336
  {
@@ -2294,32 +2338,32 @@ const en = ({
2294
2338
  onClick: s,
2295
2339
  disabled: n,
2296
2340
  style: { backgroundColor: "#E6E5E3" },
2297
- className: D(
2341
+ className: L(
2298
2342
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
2299
2343
  {
2300
2344
  "hover:brightness-95 active:brightness-90": !n,
2301
2345
  "opacity-50 cursor-not-allowed": n
2302
2346
  },
2303
- o
2347
+ r
2304
2348
  ),
2305
2349
  children: t
2306
2350
  }
2307
- ), tn = ({
2351
+ ), ln = ({
2308
2352
  faqs: t,
2309
2353
  onFaqClick: s,
2310
2354
  loadingFaqId: n,
2311
- headerText: o,
2355
+ headerText: r,
2312
2356
  className: l,
2313
2357
  avatarImage: d,
2314
- avatarName: r
2358
+ avatarName: a
2315
2359
  }) => {
2316
- const c = t.filter((f) => f.enabled).sort((f, h) => (f.order ?? 0) - (h.order ?? 0));
2360
+ const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
2317
2361
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2318
- (d || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2319
- ae,
2362
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2363
+ oe,
2320
2364
  {
2321
- id: r || "account",
2322
- name: r || "Account",
2365
+ id: a || "account",
2366
+ name: a || "Account",
2323
2367
  image: d,
2324
2368
  size: 24,
2325
2369
  shape: "circle"
@@ -2331,76 +2375,77 @@ const en = ({
2331
2375
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
2332
2376
  style: { backgroundColor: "#F1F0EE" },
2333
2377
  children: [
2334
- o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2335
- c.map((f) => /* @__PURE__ */ e(
2336
- Vs,
2378
+ r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2379
+ c.map((g) => /* @__PURE__ */ e(
2380
+ Xs,
2337
2381
  {
2338
- question: f.question,
2339
- onClick: () => s(f.id),
2340
- loading: n === f.id
2382
+ question: g.question,
2383
+ onClick: () => s(g.id),
2384
+ loading: n === g.id
2341
2385
  },
2342
- f.id
2386
+ g.id
2343
2387
  ))
2344
2388
  ]
2345
2389
  }
2346
2390
  )
2347
2391
  ] }) });
2348
- }, sn = (t, s = {}) => {
2349
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = k([]), [r, c] = k(!1), [f, h] = k(null), [x, g] = k(n), [p, a] = k(!0), [w, _] = k(), b = A(async (S = !1, R) => {
2350
- if (r) return;
2351
- const m = R !== void 0 ? R : x;
2392
+ }, cn = (t, s = {}) => {
2393
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = T([]), [a, c] = T(!1), [g, h] = T(null), [b, N] = T(n), [S, m] = T(!0), [I, o] = T(), v = U(async (_ = !1, R) => {
2394
+ if (a) return;
2395
+ const x = R !== void 0 ? R : b;
2352
2396
  c(!0), h(null);
2353
2397
  try {
2354
2398
  const u = await t.loadParticipants({
2355
- search: m || void 0,
2356
- limit: o,
2357
- cursor: S ? void 0 : w
2399
+ search: x || void 0,
2400
+ limit: r,
2401
+ cursor: _ ? void 0 : I
2358
2402
  });
2359
2403
  d(
2360
- (C) => S ? u.participants : [...C, ...u.participants]
2361
- ), a(u.hasMore), _(u.nextCursor);
2404
+ (f) => _ ? u.participants : [...f, ...u.participants]
2405
+ ), m(u.hasMore), o(u.nextCursor);
2362
2406
  } catch (u) {
2363
- const C = u instanceof Error ? u.message : "Failed to load participants";
2364
- h(C), console.error("[useParticipants] Load error:", u);
2407
+ const f = u instanceof Error ? u.message : "Failed to load participants";
2408
+ h(f), console.error("[useParticipants] Load error:", u);
2365
2409
  } finally {
2366
2410
  c(!1);
2367
2411
  }
2368
- }, [t, x, w, o, r]), M = A(() => {
2369
- p && !r && b(!1);
2370
- }, [p, r, b]), E = A((S) => {
2371
- g(S), _(void 0), b(!0, S);
2372
- }, [b]), y = A(() => {
2373
- _(void 0), b(!0);
2374
- }, [b]);
2375
- return K(() => {
2376
- b(!0);
2412
+ }, [t, b, I, r, a]), k = U(() => {
2413
+ S && !a && v(!1);
2414
+ }, [S, a, v]), y = U((_) => {
2415
+ N(_), o(void 0), v(!0, _);
2416
+ }, [v]), w = U(() => {
2417
+ o(void 0), v(!0);
2418
+ }, [v]);
2419
+ return W(() => {
2420
+ v(!0);
2377
2421
  }, [t.loadParticipants]), {
2378
2422
  participants: l,
2379
- loading: r,
2380
- error: f,
2381
- searchQuery: x,
2382
- hasMore: p,
2423
+ loading: a,
2424
+ error: g,
2425
+ searchQuery: b,
2426
+ hasMore: S,
2383
2427
  totalCount: t.totalCount,
2384
- loadMore: M,
2385
- search: E,
2386
- refresh: y
2428
+ loadMore: k,
2429
+ search: y,
2430
+ refresh: w
2387
2431
  };
2388
2432
  };
2389
2433
  export {
2390
- ge as ActionButton,
2391
- ae as Avatar,
2392
- Us as ChannelEmptyState,
2393
- Ze as ChannelList,
2394
- Ke as ChannelView,
2395
- tn as FaqList,
2396
- Vs as FaqListItem,
2397
- vs as MessageVoteButtons,
2398
- Qs as MessagingProvider,
2399
- en as MessagingShell,
2400
- zs as ParticipantPicker,
2401
- os as formatRelativeTime,
2402
- bs as useMessageVote,
2403
- ss as useMessaging,
2404
- sn as useParticipants
2434
+ we as ActionButton,
2435
+ oe as Avatar,
2436
+ Hs as ChannelEmptyState,
2437
+ at as ChannelList,
2438
+ lt as ChannelView,
2439
+ ln as FaqList,
2440
+ Xs as FaqListItem,
2441
+ ws as LockedAttachment,
2442
+ Ss as MessageVoteButtons,
2443
+ rn as MessagingProvider,
2444
+ on as MessagingShell,
2445
+ Zs as ParticipantPicker,
2446
+ is as formatRelativeTime,
2447
+ ps as useMessageVote,
2448
+ as as useMessaging,
2449
+ cn as useParticipants
2405
2450
  };
2406
2451
  //# sourceMappingURL=index.js.map