@linktr.ee/messaging-react 1.20.0 โ†’ 1.21.0-rc-1771294922

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -24,8 +24,8 @@ const Le = Je({
24
24
  debug: c = !1
25
25
  }) => {
26
26
  const r = T(
27
- (m, ...v) => {
28
- c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...v);
27
+ (u, ...N) => {
28
+ c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...N);
29
29
  },
30
30
  [c]
31
31
  );
@@ -35,84 +35,84 @@ const Le = Je({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [d, b] = k(null), [u, S] = k(null), [f, x] = k(!1), [l, M] = k(!1), [I, E] = k(null), g = V(!1), C = V({
38
+ const [d, b] = k(null), [m, M] = k(null), [x, g] = k(!1), [l, I] = k(!1), [_, y] = k(null), E = V(!1), h = V({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: a,
41
41
  serviceConfig: n,
42
42
  capabilities: o
43
- }), N = V(0);
44
- N.current++, r("๐Ÿ“Š RENDER INFO", {
45
- renderCount: N.current,
43
+ }), p = V(0);
44
+ p.current++, r("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: p.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: C.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: C.current.apiKey !== a,
50
- serviceConfigChanged: C.current.serviceConfig !== n,
51
- capabilitiesChanged: C.current.capabilities !== o
48
+ userChanged: h.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: h.current.apiKey !== a,
50
+ serviceConfigChanged: h.current.serviceConfig !== n,
51
+ capabilitiesChanged: h.current.capabilities !== o
52
52
  }
53
- }), C.current = {
53
+ }), h.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: a,
56
56
  serviceConfig: n,
57
57
  capabilities: o
58
58
  }, W(() => {
59
- const m = N.current;
59
+ const u = p.current;
60
60
  if (r("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: m,
61
+ renderCount: u,
62
62
  apiKey: !!a,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: C.current.serviceConfig === n,
68
- apiKeyStable: C.current.apiKey === a
67
+ serviceConfigStable: h.current.serviceConfig === n,
68
+ apiKeyStable: h.current.apiKey === a
69
69
  }
70
70
  }), !a || !n) {
71
71
  r("โš ๏ธ SERVICE INIT SKIPPED", {
72
- renderCount: m,
72
+ renderCount: u,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  r("๐Ÿš€ CREATING NEW SERVICE", {
78
- renderCount: m,
78
+ renderCount: u,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
80
- serviceConfigChanged: C.current.serviceConfig !== n
80
+ serviceConfigChanged: h.current.serviceConfig !== n
81
81
  });
82
- const v = new Xe({
82
+ const N = new Xe({
83
83
  ...n,
84
84
  apiKey: a,
85
85
  debug: c
86
86
  });
87
- return b(v), r("โœ… SERVICE SET", {
88
- renderCount: m,
89
- serviceInstance: !!v
87
+ return b(N), r("โœ… SERVICE SET", {
88
+ renderCount: u,
89
+ serviceInstance: !!N
90
90
  }), () => {
91
91
  r("๐Ÿงน SERVICE CLEANUP", {
92
- renderCount: m,
92
+ renderCount: u,
93
93
  reason: "Effect cleanup"
94
- }), v.disconnectUser().catch(console.error);
94
+ }), N.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [a, n, c, r]);
97
- const w = V(null);
97
+ const C = V(null);
98
98
  W(() => {
99
- var v, R;
99
+ var N, R;
100
100
  if (r("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!d,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: g.current,
105
- isConnected: f,
104
+ isConnecting: E.current,
105
+ isConnected: x,
106
106
  dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
107
107
  }), !d || !s) {
108
108
  r("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (g.current) {
111
+ if (E.current) {
112
112
  r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((v = w.current) == null ? void 0 : v.serviceId) === d && ((R = w.current) == null ? void 0 : R.userId) === s.id) {
115
+ if (((N = C.current) == null ? void 0 : N.serviceId) === d && ((R = C.current) == null ? void 0 : R.userId) === s.id) {
116
116
  r(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,40 +120,40 @@ const Le = Je({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), g.current = !0, M(!0), E(null);
123
+ r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), E.current = !0, I(!0), y(null);
124
124
  try {
125
125
  r("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const y = await d.connectUser(s);
127
- S(y), x(!0), w.current = { serviceId: d, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
126
+ const w = await d.connectUser(s);
127
+ M(w), g(!0), C.current = { serviceId: d, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: y.userID
129
+ clientId: w.userID
130
130
  });
131
- } catch (y) {
132
- const O = y instanceof Error ? y.message : "Connection failed";
133
- E(O), r("โŒ USER CONNECTION ERROR", {
131
+ } catch (w) {
132
+ const F = w instanceof Error ? w.message : "Connection failed";
133
+ y(F), r("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: O
135
+ error: F
136
136
  });
137
137
  } finally {
138
- M(!1), g.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ I(!1), E.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: f
140
+ isConnected: x
141
141
  });
142
142
  }
143
143
  })();
144
- }, [d, s, r, f]), W(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
144
+ }, [d, s, r, x]), W(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!d,
146
- isConnected: f
146
+ isConnected: x
147
147
  }), () => {
148
- d && f ? (r(
148
+ d && x ? (r(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), w.current = null, d.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
151
+ ), C.current = null, d.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!d,
153
- isConnected: f
153
+ isConnected: x
154
154
  });
155
- }), [d, f, r]);
156
- const p = T(async () => {
155
+ }), [d, x, r]);
156
+ const v = T(async () => {
157
157
  if (r("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
158
  hasService: !!d,
159
159
  hasUser: !!s
@@ -161,55 +161,55 @@ const Le = Je({
161
161
  r("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), M(!0);
164
+ r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), I(!0);
165
165
  try {
166
166
  r("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await d.disconnectUser(), r("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
- const m = await d.connectUser(s);
168
- S(m), x(!0), E(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (m) {
170
- const v = m instanceof Error ? m.message : "Refresh failed";
171
- E(v), r("โŒ CONNECTION REFRESH ERROR", {
167
+ const u = await d.connectUser(s);
168
+ M(u), g(!0), y(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (u) {
170
+ const N = u instanceof Error ? u.message : "Refresh failed";
171
+ y(N), r("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: v
173
+ error: N
174
174
  });
175
175
  } finally {
176
- M(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ I(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [d, s, r]), h = B.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
178
+ }, [d, s, r]), f = B.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!d,
180
- hasClient: !!u,
181
- isConnected: f,
180
+ hasClient: !!m,
181
+ isConnected: x,
182
182
  isLoading: l,
183
- hasError: !!I,
183
+ hasError: !!_,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
186
  service: d,
187
- client: u,
188
- isConnected: f,
187
+ client: m,
188
+ isConnected: x,
189
189
  isLoading: l,
190
- error: I,
190
+ error: _,
191
191
  capabilities: o,
192
- refreshConnection: p,
192
+ refreshConnection: v,
193
193
  debug: c
194
194
  }), [
195
195
  d,
196
- u,
197
- f,
196
+ m,
197
+ x,
198
198
  l,
199
- I,
199
+ _,
200
200
  o,
201
- p,
201
+ v,
202
202
  c,
203
203
  r
204
204
  ]);
205
205
  return r("๐Ÿ”„ RENDER END", {
206
- renderCount: N.current,
207
- willRenderChat: !!(u && f),
208
- contextValueReady: !!h
209
- }), /* @__PURE__ */ e(Le.Provider, { value: h, children: u && f ? /* @__PURE__ */ e(
206
+ renderCount: p.current,
207
+ willRenderChat: !!(m && x),
208
+ contextValueReady: !!f
209
+ }), /* @__PURE__ */ e(Le.Provider, { value: f, children: m && x ? /* @__PURE__ */ e(
210
210
  Ke,
211
211
  {
212
- client: u,
212
+ client: m,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
@@ -365,26 +365,26 @@ const Q = ({
365
365
  unread: o,
366
366
  renderMessagePreview: c
367
367
  }) => {
368
- var N, w, p, h, m, v;
368
+ var p, C, v, f, u, N;
369
369
  const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), d = () => {
370
370
  t && n(t);
371
- }, u = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
371
+ }, m = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
372
372
  (R) => {
373
- var y, O;
374
- return ((y = R.user) == null ? void 0 : y.id) && R.user.id !== ((O = t == null ? void 0 : t._client) == null ? void 0 : O.userID);
373
+ var w, F;
374
+ return ((w = R.user) == null ? void 0 : w.id) && R.user.id !== ((F = t == null ? void 0 : t._client) == null ? void 0 : F.userID);
375
375
  }
376
- ), S = ((w = u == null ? void 0 : u.user) == null ? void 0 : w.name) || "Conversation", f = (p = u == null ? void 0 : u.user) == null ? void 0 : p.image, x = (m = (h = t == null ? void 0 : t.state) == null ? void 0 : h.messages) == null ? void 0 : m[t.state.messages.length - 1], M = (() => {
377
- var y;
378
- if (x != null && x.text) return x.text;
379
- const R = (y = x == null ? void 0 : x.attachments) == null ? void 0 : y[0];
376
+ ), M = ((C = m == null ? void 0 : m.user) == null ? void 0 : C.name) || "Conversation", x = (v = m == null ? void 0 : m.user) == null ? void 0 : v.image, g = (u = (f = t == null ? void 0 : t.state) == null ? void 0 : f.messages) == null ? void 0 : u[t.state.messages.length - 1], I = (() => {
377
+ var w;
378
+ if (g != null && g.text) return g.text;
379
+ const R = (w = g == null ? void 0 : g.attachments) == null ? void 0 : w[0];
380
380
  return R ? R.og_scrape_url ? R.og_scrape_url : R.type === "image" ? "๐Ÿ“ท Sent an image" : R.type === "video" ? "๐ŸŽฅ Sent a video" : R.type === "audio" ? "๐ŸŽต Sent audio" : R.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
381
- })(), I = x != null && x.created_at ? Vs(new Date(x.created_at)) : "", E = x ? ye(x) : !1, g = c ? c(x, M) : `${E ? "โœจ " : ""}${M}`, C = o ?? 0;
381
+ })(), _ = g != null && g.created_at ? Vs(new Date(g.created_at)) : "", y = g ? ye(g) : !1, E = c ? c(g, I) : `${y ? "โœจ " : ""}${I}`, h = o ?? 0;
382
382
  return a && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
383
383
  channelId: t == null ? void 0 : t.id,
384
384
  isSelected: r,
385
- participantName: S,
386
- unreadCount: C,
387
- hasTimestamp: !!I
385
+ participantName: M,
386
+ unreadCount: h,
387
+ hasTimestamp: !!_
388
388
  }), /* @__PURE__ */ e(
389
389
  "button",
390
390
  {
@@ -401,9 +401,9 @@ const Q = ({
401
401
  /* @__PURE__ */ e(
402
402
  Q,
403
403
  {
404
- id: ((v = u == null ? void 0 : u.user) == null ? void 0 : v.id) || t.id || "unknown",
405
- name: S,
406
- image: f,
404
+ id: ((N = m == null ? void 0 : m.user) == null ? void 0 : N.id) || t.id || "unknown",
405
+ name: M,
406
+ image: x,
407
407
  size: 44,
408
408
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
409
409
  }
@@ -417,14 +417,14 @@ const Q = ({
417
417
  "text-sm font-medium truncate",
418
418
  r ? "text-primary" : "text-charcoal"
419
419
  ),
420
- children: S
420
+ children: M
421
421
  }
422
422
  ),
423
- I && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: I })
423
+ _ && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: _ })
424
424
  ] }),
425
425
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
426
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: g }),
427
- C > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: C > 99 ? "99+" : C })
426
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: E }),
427
+ h > 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: h > 99 ? "99+" : h })
428
428
  ] })
429
429
  ] })
430
430
  ] })
@@ -450,10 +450,10 @@ const Ue = B.memo(
450
450
  selectedChannelId: s == null ? void 0 : s.id,
451
451
  filters: n
452
452
  });
453
- const b = B.useMemo(() => (S) => /* @__PURE__ */ e(
453
+ const b = B.useMemo(() => (M) => /* @__PURE__ */ e(
454
454
  Oe,
455
455
  {
456
- ...S,
456
+ ...M,
457
457
  selectedChannel: s,
458
458
  onChannelSelect: t,
459
459
  debug: d,
@@ -614,27 +614,27 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
614
614
  groupedByUser: r,
615
615
  handleAction: d,
616
616
  handleOpenThread: b,
617
- handleRetry: u,
618
- highlighted: S,
619
- isMessageAIGenerated: f,
620
- isMyMessage: x,
617
+ handleRetry: m,
618
+ highlighted: M,
619
+ isMessageAIGenerated: x,
620
+ isMyMessage: g,
621
621
  message: l,
622
- renderText: M,
623
- threadList: I
624
- } = t, { client: E } = Fe("CustomMessage"), [g, C] = k(!1), N = ns(l.id), { selected: w, voteUp: p, voteDown: h } = et(l), {
625
- Attachment: m = as,
626
- EditMessageModal: v = ls,
622
+ renderText: I,
623
+ threadList: _
624
+ } = t, { client: y } = Fe("CustomMessage"), [E, h] = k(!1), p = ns(l.id), { selected: C, voteUp: v, voteDown: f } = et(l), {
625
+ Attachment: u = as,
626
+ EditMessageModal: N = ls,
627
627
  MessageBlocked: R = os,
628
- MessageBouncePrompt: y = is,
629
- MessageDeleted: O = cs,
628
+ MessageBouncePrompt: w = is,
629
+ MessageDeleted: F = cs,
630
630
  MessageIsThreadReplyInChannelButtonIndicator: $ = ds,
631
631
  MessageRepliesCountButton: te = us,
632
632
  ReminderNotification: X = ms,
633
633
  StreamedMessageText: K = hs,
634
634
  PinIndicator: q
635
635
  } = rs("CustomMessage"), ne = fs(l), Z = gs(l), ee = be(
636
- () => f == null ? void 0 : f(l),
637
- [f, l]
636
+ () => x == null ? void 0 : x(l),
637
+ [x, l]
638
638
  ), G = be(
639
639
  () => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
640
640
  [l]
@@ -642,48 +642,48 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
642
642
  if (xs(l))
643
643
  return null;
644
644
  if (l.deleted_at || l.type === "deleted")
645
- return /* @__PURE__ */ e(O, { message: l });
645
+ return /* @__PURE__ */ e(F, { message: l });
646
646
  if (bs(l))
647
647
  return /* @__PURE__ */ e(R, {});
648
- const L = !I && !!l.reply_count, U = !I && l.show_in_channel && l.parent_id, F = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, j = Cs(l);
648
+ const P = !_ && !!l.reply_count, U = !_ && l.show_in_channel && l.parent_id, L = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, j = Cs(l);
649
649
  let z;
650
- F ? z = () => u(l) : j && (z = () => C(!0));
650
+ L ? z = () => m(l) : j && (z = () => h(!0));
651
651
  const Y = D(
652
652
  "str-chat__message str-chat__message-simple",
653
653
  `str-chat__message--${l.type}`,
654
654
  `str-chat__message--${l.status}`,
655
- x() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
655
+ g() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
656
656
  l.text ? "str-chat__message--has-text" : "has-no-text",
657
657
  {
658
658
  "str-chat__message--has-attachment": ne,
659
- "str-chat__message--highlighted": S,
659
+ "str-chat__message--highlighted": M,
660
660
  "str-chat__message--pinned pinned-message": l.pinned,
661
661
  "str-chat__message--with-reactions": Z,
662
662
  "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((le = l == null ? void 0 : l.error) == null ? void 0 : le.status) !== 403,
663
- "str-chat__message-with-thread-link": L || U,
663
+ "str-chat__message-with-thread-link": P || U,
664
664
  "str-chat__virtual-message__wrapper--end": o,
665
665
  "str-chat__virtual-message__wrapper--first": c,
666
666
  "str-chat__virtual-message__wrapper--group": r
667
667
  }
668
- ), J = l.poll_id && E.polls.fromState(l.poll_id), ae = Qs(l);
668
+ ), J = l.poll_id && y.polls.fromState(l.poll_id), ae = Qs(l);
669
669
  return /* @__PURE__ */ i(ve, { children: [
670
670
  a && /* @__PURE__ */ e(
671
- v,
671
+ N,
672
672
  {
673
673
  additionalMessageInputProps: s
674
674
  }
675
675
  ),
676
- g && /* @__PURE__ */ e(
676
+ E && /* @__PURE__ */ e(
677
677
  Ns,
678
678
  {
679
- MessageBouncePrompt: y,
680
- onClose: () => C(!1),
681
- open: g
679
+ MessageBouncePrompt: w,
680
+ onClose: () => h(!1),
681
+ open: E
682
682
  }
683
683
  ),
684
684
  /* @__PURE__ */ i("div", { className: Y, children: [
685
685
  q && /* @__PURE__ */ e(q, {}),
686
- !!N && /* @__PURE__ */ e(X, { reminder: N }),
686
+ !!p && /* @__PURE__ */ e(X, { reminder: p }),
687
687
  l.user && /* @__PURE__ */ e(
688
688
  Q,
689
689
  {
@@ -697,7 +697,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
697
697
  "div",
698
698
  {
699
699
  className: D("str-chat__message-inner", {
700
- "str-chat__simple-message--error-failed": F || j
700
+ "str-chat__simple-message--error-failed": L || j
701
701
  }),
702
702
  "data-testid": "message-inner",
703
703
  onClick: z,
@@ -717,7 +717,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
717
717
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
718
718
  J && /* @__PURE__ */ e(vs, { poll: J }),
719
719
  G != null && G.length && !l.quoted_message ? /* @__PURE__ */ e(
720
- m,
720
+ u,
721
721
  {
722
722
  actionHandler: d,
723
723
  attachments: G
@@ -727,24 +727,24 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
727
727
  K,
728
728
  {
729
729
  message: l,
730
- renderText: M
730
+ renderText: I
731
731
  }
732
- ) : /* @__PURE__ */ e(ws, { message: l, renderText: M }),
732
+ ) : /* @__PURE__ */ e(ws, { message: l, renderText: I }),
733
733
  /* @__PURE__ */ e(ps, {})
734
734
  ] }),
735
735
  /* @__PURE__ */ e(Te, { message: l }),
736
736
  n && ye(l) && /* @__PURE__ */ e(
737
737
  nt,
738
738
  {
739
- selected: w,
740
- onVoteUp: p,
741
- onVoteDown: h
739
+ selected: C,
740
+ onVoteUp: v,
741
+ onVoteDown: f
742
742
  }
743
743
  )
744
744
  ] })
745
745
  }
746
746
  ),
747
- L && /* @__PURE__ */ e(
747
+ P && /* @__PURE__ */ e(
748
748
  te,
749
749
  {
750
750
  onClick: b,
@@ -921,33 +921,33 @@ const gt = ({
921
921
  canShowInfo: a,
922
922
  showStarButton: o = !1
923
923
  }) => {
924
- var x, l, M, I, E, g;
924
+ var g, l, I, _, y, E;
925
925
  const { channel: c } = we(), r = B.useMemo(() => Object.values(c.state.members || {}).find(
926
- (N) => {
927
- var w;
928
- return ((w = N.user) == null ? void 0 : w.id) && N.user.id !== c._client.userID;
926
+ (p) => {
927
+ var C;
928
+ return ((C = p.user) == null ? void 0 : C.id) && p.user.id !== c._client.userID;
929
929
  }
930
- ), [c._client.userID, c.state.members]), d = ((x = r == null ? void 0 : r.user) == null ? void 0 : x.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (M = r == null ? void 0 : r.user) == null ? void 0 : M.image, [u, S] = k(
931
- !!((I = c.state.membership) != null && I.pinned_at)
930
+ ), [c._client.userID, c.state.members]), d = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (I = r == null ? void 0 : r.user) == null ? void 0 : I.image, [m, M] = k(
931
+ !!((_ = c.state.membership) != null && _.pinned_at)
932
932
  );
933
933
  W(() => {
934
- const C = (N) => {
935
- var w;
936
- S(
937
- N != null && N.member ? !!N.member.pinned_at : !!((w = c.state.membership) != null && w.pinned_at)
934
+ const h = (p) => {
935
+ var C;
936
+ M(
937
+ p != null && p.member ? !!p.member.pinned_at : !!((C = c.state.membership) != null && C.pinned_at)
938
938
  );
939
939
  };
940
- return c.on("member.updated", C), () => {
941
- c.off("member.updated", C);
940
+ return c.on("member.updated", h), () => {
941
+ c.off("member.updated", h);
942
942
  };
943
943
  }, [c]);
944
- const f = async () => {
944
+ const x = async () => {
945
945
  try {
946
- u ? await c.unpin() : await c.pin();
947
- } catch (C) {
946
+ m ? await c.unpin() : await c.pin();
947
+ } catch (h) {
948
948
  console.error(
949
949
  "[CustomChannelHeader] Failed to update pinned status:",
950
- C
950
+ h
951
951
  );
952
952
  }
953
953
  };
@@ -970,7 +970,7 @@ const gt = ({
970
970
  /* @__PURE__ */ e(
971
971
  Q,
972
972
  {
973
- id: ((E = r == null ? void 0 : r.user) == null ? void 0 : E.id) || c.id || "unknown",
973
+ id: ((y = r == null ? void 0 : r.user) == null ? void 0 : y.id) || c.id || "unknown",
974
974
  name: d,
975
975
  image: b,
976
976
  size: 40
@@ -983,17 +983,17 @@ const gt = ({
983
983
  "button",
984
984
  {
985
985
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
986
- onClick: f,
986
+ onClick: x,
987
987
  type: "button",
988
- "aria-label": u ? "Unstar conversation" : "Star conversation",
988
+ "aria-label": m ? "Unstar conversation" : "Star conversation",
989
989
  children: /* @__PURE__ */ e(
990
990
  _e,
991
991
  {
992
992
  className: D("size-5", {
993
- "text-yellow-600": u,
994
- "text-black/90": !u
993
+ "text-yellow-600": m,
994
+ "text-black/90": !m
995
995
  }),
996
- weight: u ? "duotone" : "regular"
996
+ weight: m ? "duotone" : "regular"
997
997
  }
998
998
  )
999
999
  }
@@ -1025,7 +1025,7 @@ const gt = ({
1025
1025
  /* @__PURE__ */ e(
1026
1026
  Q,
1027
1027
  {
1028
- id: ((g = r == null ? void 0 : r.user) == null ? void 0 : g.id) || c.id || "unknown",
1028
+ id: ((E = r == null ? void 0 : r.user) == null ? void 0 : E.id) || c.id || "unknown",
1029
1029
  name: d,
1030
1030
  image: b,
1031
1031
  size: 40
@@ -1038,17 +1038,17 @@ const gt = ({
1038
1038
  "button",
1039
1039
  {
1040
1040
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1041
- onClick: f,
1041
+ onClick: x,
1042
1042
  type: "button",
1043
- "aria-label": u ? "Unstar conversation" : "Star conversation",
1043
+ "aria-label": m ? "Unstar conversation" : "Star conversation",
1044
1044
  children: /* @__PURE__ */ e(
1045
1045
  _e,
1046
1046
  {
1047
1047
  className: D("size-5", {
1048
- "text-yellow-600": u,
1049
- "text-black/90": !u
1048
+ "text-yellow-600": m,
1049
+ "text-black/90": !m
1050
1050
  }),
1051
- weight: u ? "duotone" : "regular"
1051
+ weight: m ? "duotone" : "regular"
1052
1052
  }
1053
1053
  )
1054
1054
  }
@@ -1076,77 +1076,77 @@ const gt = ({
1076
1076
  onBlockParticipant: r,
1077
1077
  showDeleteConversation: d = !0,
1078
1078
  onDeleteConversationClick: b,
1079
- onBlockParticipantClick: u,
1080
- onReportParticipantClick: S
1079
+ onBlockParticipantClick: m,
1080
+ onReportParticipantClick: M
1081
1081
  }) => {
1082
1082
  var X, K, q, ne, Z, ee, G;
1083
- const { service: f, debug: x } = fe(), [l, M] = k(!1), [I, E] = k(!1), [g, C] = k(!1), N = T(async () => {
1084
- var L;
1085
- if (!(!f || !((L = n == null ? void 0 : n.user) != null && L.id)))
1083
+ const { service: x, debug: g } = fe(), [l, I] = k(!1), [_, y] = k(!1), [E, h] = k(!1), p = T(async () => {
1084
+ var P;
1085
+ if (!(!x || !((P = n == null ? void 0 : n.user) != null && P.id)))
1086
1086
  try {
1087
- const F = (await f.getBlockedUsers()).some(
1087
+ const L = (await x.getBlockedUsers()).some(
1088
1088
  (j) => {
1089
1089
  var z;
1090
1090
  return j.blocked_user_id === ((z = n == null ? void 0 : n.user) == null ? void 0 : z.id);
1091
1091
  }
1092
1092
  );
1093
- M(F);
1093
+ I(L);
1094
1094
  } catch (U) {
1095
1095
  console.error(
1096
1096
  "[ChannelInfoDialog] Failed to check blocked status:",
1097
1097
  U
1098
1098
  );
1099
1099
  }
1100
- }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1100
+ }, [x, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1101
1101
  W(() => {
1102
- N();
1103
- }, [N]);
1104
- const w = async () => {
1105
- var L;
1106
- if (!I) {
1107
- b == null || b(), x && console.log("[ChannelInfoDialog] Leave conversation", a.cid), E(!0);
1102
+ p();
1103
+ }, [p]);
1104
+ const C = async () => {
1105
+ var P;
1106
+ if (!_) {
1107
+ b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), y(!0);
1108
1108
  try {
1109
- const U = ((L = a._client) == null ? void 0 : L.userID) ?? null;
1109
+ const U = ((P = a._client) == null ? void 0 : P.userID) ?? null;
1110
1110
  await a.hide(U, !1), c && await c(a), s();
1111
1111
  } catch (U) {
1112
1112
  console.error("[ChannelInfoDialog] Failed to leave conversation", U);
1113
1113
  } finally {
1114
- E(!1);
1114
+ y(!1);
1115
1115
  }
1116
1116
  }
1117
- }, p = async () => {
1118
- var L, U, F;
1119
- if (!(g || !f)) {
1120
- u == null || u(), x && console.log("[ChannelInfoDialog] Block member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), C(!0);
1117
+ }, v = async () => {
1118
+ var P, U, L;
1119
+ if (!(E || !x)) {
1120
+ m == null || m(), g && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), h(!0);
1121
1121
  try {
1122
- await f.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), s();
1122
+ await x.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), s();
1123
1123
  } catch (j) {
1124
1124
  console.error("[ChannelInfoDialog] Failed to block member", j);
1125
1125
  } finally {
1126
- C(!1);
1126
+ h(!1);
1127
1127
  }
1128
1128
  }
1129
- }, h = async () => {
1130
- var L, U, F;
1131
- if (!(g || !f)) {
1132
- u == null || u(), x && console.log("[ChannelInfoDialog] Unblock member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), C(!0);
1129
+ }, f = async () => {
1130
+ var P, U, L;
1131
+ if (!(E || !x)) {
1132
+ m == null || m(), g && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), h(!0);
1133
1133
  try {
1134
- await f.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), s();
1134
+ await x.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), s();
1135
1135
  } catch (j) {
1136
1136
  console.error("[ChannelInfoDialog] Failed to unblock member", j);
1137
1137
  } finally {
1138
- C(!1);
1138
+ h(!1);
1139
1139
  }
1140
1140
  }
1141
- }, m = () => {
1142
- S == null || S(), s(), window.open(
1141
+ }, u = () => {
1142
+ M == null || M(), s(), window.open(
1143
1143
  "https://linktr.ee/s/about/trust-center/report",
1144
1144
  "_blank",
1145
1145
  "noopener,noreferrer"
1146
1146
  );
1147
1147
  };
1148
1148
  if (!n) return null;
1149
- const v = ((K = n.user) == null ? void 0 : K.name) || ((q = n.user) == null ? void 0 : q.id) || "Unknown member", R = (ne = n.user) == null ? void 0 : ne.image, y = (Z = n.user) == null ? void 0 : Z.email, O = (ee = n.user) == null ? void 0 : ee.username, $ = y || (O ? `linktr.ee/${O}` : void 0), te = ((G = n.user) == null ? void 0 : G.id) || "unknown";
1149
+ const N = ((K = n.user) == null ? void 0 : K.name) || ((q = n.user) == null ? void 0 : q.id) || "Unknown member", R = (ne = n.user) == null ? void 0 : ne.image, w = (Z = n.user) == null ? void 0 : Z.email, F = (ee = n.user) == null ? void 0 : ee.username, $ = w || (F ? `linktr.ee/${F}` : void 0), te = ((G = n.user) == null ? void 0 : G.id) || "unknown";
1150
1150
  return (
1151
1151
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1152
1152
  /* @__PURE__ */ e(
@@ -1155,8 +1155,8 @@ const gt = ({
1155
1155
  ref: t,
1156
1156
  className: "mes-dialog group",
1157
1157
  onClose: s,
1158
- onClick: (L) => {
1159
- L.target === t.current && s();
1158
+ onClick: (P) => {
1159
+ P.target === t.current && s();
1160
1160
  },
1161
1161
  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: [
1162
1162
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
@@ -1174,14 +1174,14 @@ const gt = ({
1174
1174
  Q,
1175
1175
  {
1176
1176
  id: te,
1177
- name: v,
1177
+ name: N,
1178
1178
  image: R,
1179
1179
  size: 88,
1180
1180
  shape: "circle"
1181
1181
  }
1182
1182
  ),
1183
1183
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1184
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
1184
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: N }),
1185
1185
  $ && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: $ }),
1186
1186
  o && /* @__PURE__ */ e(
1187
1187
  "span",
@@ -1205,11 +1205,11 @@ const gt = ({
1205
1205
  d && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1206
1206
  de,
1207
1207
  {
1208
- onClick: w,
1209
- disabled: I,
1210
- "aria-busy": I,
1208
+ onClick: C,
1209
+ disabled: _,
1210
+ "aria-busy": _,
1211
1211
  children: [
1212
- I ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(As, { className: "h-5 w-5" }),
1212
+ _ ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(As, { className: "h-5 w-5" }),
1213
1213
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1214
1214
  ]
1215
1215
  }
@@ -1217,27 +1217,27 @@ const gt = ({
1217
1217
  /* @__PURE__ */ e("li", { children: l ? /* @__PURE__ */ i(
1218
1218
  de,
1219
1219
  {
1220
- onClick: h,
1221
- disabled: g,
1222
- "aria-busy": g,
1220
+ onClick: f,
1221
+ disabled: E,
1222
+ "aria-busy": E,
1223
1223
  children: [
1224
- g ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1224
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1225
1225
  /* @__PURE__ */ e("span", { children: "Unblock" })
1226
1226
  ]
1227
1227
  }
1228
1228
  ) : /* @__PURE__ */ i(
1229
1229
  de,
1230
1230
  {
1231
- onClick: p,
1232
- disabled: g,
1233
- "aria-busy": g,
1231
+ onClick: v,
1232
+ disabled: E,
1233
+ "aria-busy": E,
1234
1234
  children: [
1235
- g ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1235
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1236
1236
  /* @__PURE__ */ e("span", { children: "Block" })
1237
1237
  ]
1238
1238
  }
1239
1239
  ) }),
1240
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
1240
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: u, children: [
1241
1241
  /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1242
1242
  /* @__PURE__ */ e("span", { children: "Report" })
1243
1243
  ] }) })
@@ -1257,33 +1257,34 @@ const gt = ({
1257
1257
  onDeleteConversationClick: r,
1258
1258
  onBlockParticipantClick: d,
1259
1259
  onReportParticipantClick: b,
1260
- showStarButton: u = !1,
1261
- chatbotVotingEnabled: S = !1
1260
+ showStarButton: m = !1,
1261
+ chatbotVotingEnabled: M = !1,
1262
+ renderChannelBanner: x
1262
1263
  }) => {
1263
- const { channel: f } = we(), x = V(null), l = B.useMemo(() => Object.values(f.state.members || {}).find(
1264
- (C) => {
1265
- var N;
1266
- return ((N = C.user) == null ? void 0 : N.id) && C.user.id !== f._client.userID;
1264
+ const { channel: g } = we(), l = V(null), I = B.useMemo(() => Object.values(g.state.members || {}).find(
1265
+ (p) => {
1266
+ var C;
1267
+ return ((C = p.user) == null ? void 0 : C.id) && p.user.id !== g._client.userID;
1267
1268
  }
1268
- ), [f._client.userID, f.state.members]), M = B.useMemo(() => {
1269
- const g = f.data ?? {};
1270
- if (g.followerStatus)
1271
- return String(g.followerStatus);
1272
- if (g.isFollower !== void 0)
1273
- return g.isFollower ? "Subscribed to you" : "Not subscribed";
1274
- }, [f.data]), I = T(() => {
1275
- var g;
1276
- (g = x.current) == null || g.showModal();
1269
+ ), [g._client.userID, g.state.members]), _ = B.useMemo(() => {
1270
+ const h = g.data ?? {};
1271
+ if (h.followerStatus)
1272
+ return String(h.followerStatus);
1273
+ if (h.isFollower !== void 0)
1274
+ return h.isFollower ? "Subscribed to you" : "Not subscribed";
1275
+ }, [g.data]), y = T(() => {
1276
+ var h;
1277
+ (h = l.current) == null || h.showModal();
1277
1278
  }, []), E = T(() => {
1278
- var g;
1279
- (g = x.current) == null || g.close();
1279
+ var h;
1280
+ (h = l.current) == null || h.close();
1280
1281
  }, []);
1281
1282
  return /* @__PURE__ */ i(ve, { children: [
1282
1283
  /* @__PURE__ */ e(
1283
1284
  Ps,
1284
1285
  {
1285
1286
  overrides: {
1286
- Message: (g) => /* @__PURE__ */ e(lt, { ...g, chatbotVotingEnabled: S })
1287
+ Message: (h) => /* @__PURE__ */ e(lt, { ...h, chatbotVotingEnabled: M })
1287
1288
  },
1288
1289
  children: /* @__PURE__ */ i(Os, { children: [
1289
1290
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
@@ -1291,11 +1292,12 @@ const gt = ({
1291
1292
  {
1292
1293
  onBack: t,
1293
1294
  showBackButton: s,
1294
- onShowInfo: I,
1295
- canShowInfo: !!l,
1296
- showStarButton: u
1295
+ onShowInfo: y,
1296
+ canShowInfo: !!I,
1297
+ showStarButton: m
1297
1298
  }
1298
1299
  ) }),
1300
+ x == null ? void 0 : x(),
1299
1301
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1300
1302
  Us,
1301
1303
  {
@@ -1307,7 +1309,7 @@ const gt = ({
1307
1309
  /* @__PURE__ */ e(
1308
1310
  ut,
1309
1311
  {
1310
- renderActions: () => n == null ? void 0 : n(f)
1312
+ renderActions: () => n == null ? void 0 : n(g)
1311
1313
  }
1312
1314
  )
1313
1315
  ] })
@@ -1316,11 +1318,11 @@ const gt = ({
1316
1318
  /* @__PURE__ */ e(
1317
1319
  xt,
1318
1320
  {
1319
- dialogRef: x,
1321
+ dialogRef: l,
1320
1322
  onClose: E,
1321
- participant: l,
1322
- channel: f,
1323
- followerStatusLabel: M,
1323
+ participant: I,
1324
+ channel: g,
1325
+ followerStatusLabel: _,
1324
1326
  onLeaveConversation: a,
1325
1327
  onBlockParticipant: o,
1326
1328
  showDeleteConversation: c,
@@ -1341,34 +1343,35 @@ const gt = ({
1341
1343
  className: r,
1342
1344
  CustomChannelEmptyState: d = ht,
1343
1345
  showDeleteConversation: b = !0,
1344
- onDeleteConversationClick: u,
1345
- onBlockParticipantClick: S,
1346
- onReportParticipantClick: f,
1347
- dmAgentEnabled: x,
1346
+ onDeleteConversationClick: m,
1347
+ onBlockParticipantClick: M,
1348
+ onReportParticipantClick: x,
1349
+ dmAgentEnabled: g,
1348
1350
  messageMetadata: l,
1349
- onMessageSent: M,
1350
- showStarButton: I = !1,
1351
- chatbotVotingEnabled: E = !1
1351
+ onMessageSent: I,
1352
+ showStarButton: _ = !1,
1353
+ chatbotVotingEnabled: y = !1,
1354
+ renderChannelBanner: E
1352
1355
  }) => {
1353
- const g = T(
1354
- async (C, N, w) => {
1355
- var y;
1356
- const p = ((y = t.data) == null ? void 0 : y.chatbot_paused) === !0, h = x && !p, m = {
1357
- ...N,
1358
- ...h && { silent: !0 },
1356
+ const h = T(
1357
+ async (p, C, v) => {
1358
+ var F;
1359
+ const f = ((F = t.data) == null ? void 0 : F.chatbot_paused) === !0, u = g && !f, N = {
1360
+ ...C,
1361
+ ...u && { silent: !0 },
1359
1362
  ...l && {
1360
1363
  metadata: {
1361
- ...N.metadata ?? {},
1364
+ ...C.metadata ?? {},
1362
1365
  ...l
1363
1366
  }
1364
1367
  }
1365
- }, v = {
1366
- ...w,
1367
- ...h && { skip_push: !0 }
1368
- }, R = await t.sendMessage(m, v);
1369
- return M == null || M(R), R;
1368
+ }, R = {
1369
+ ...v,
1370
+ ...u && { skip_push: !0 }
1371
+ }, w = await t.sendMessage(N, R);
1372
+ return I == null || I(w), w;
1370
1373
  },
1371
- [t, x, l, M]
1374
+ [t, g, l, I]
1372
1375
  );
1373
1376
  return /* @__PURE__ */ e(
1374
1377
  "div",
@@ -1385,7 +1388,7 @@ const gt = ({
1385
1388
  EmptyStateIndicator: d,
1386
1389
  LoadingIndicator: he,
1387
1390
  DateSeparator: Xs,
1388
- doSendMessageRequest: g,
1391
+ doSendMessageRequest: h,
1389
1392
  children: /* @__PURE__ */ e(
1390
1393
  bt,
1391
1394
  {
@@ -1396,11 +1399,12 @@ const gt = ({
1396
1399
  onBlockParticipant: c,
1397
1400
  CustomChannelEmptyState: d,
1398
1401
  showDeleteConversation: b,
1399
- onDeleteConversationClick: u,
1400
- onBlockParticipantClick: S,
1401
- onReportParticipantClick: f,
1402
- showStarButton: I,
1403
- chatbotVotingEnabled: E
1402
+ onDeleteConversationClick: m,
1403
+ onBlockParticipantClick: M,
1404
+ onReportParticipantClick: x,
1405
+ showStarButton: _,
1406
+ chatbotVotingEnabled: y,
1407
+ renderChannelBanner: E
1404
1408
  }
1405
1409
  )
1406
1410
  }
@@ -1458,9 +1462,9 @@ const Nt = ({
1458
1462
  searchPlaceholder: c = "Search participants...",
1459
1463
  className: r
1460
1464
  }) => {
1461
- const { debug: d } = fe(), [b, u] = k(""), [S, f] = k([]), [x, l] = k(!1), [M, I] = k(null), [E, g] = k(
1465
+ const { debug: d } = fe(), [b, m] = k(""), [M, x] = k([]), [g, l] = k(!1), [I, _] = k(null), [y, E] = k(
1462
1466
  null
1463
- ), C = V(!1);
1467
+ ), h = V(!1);
1464
1468
  W(() => {
1465
1469
  if (t.loading) {
1466
1470
  d && console.log(
@@ -1468,46 +1472,46 @@ const Nt = ({
1468
1472
  );
1469
1473
  return;
1470
1474
  }
1471
- if (C.current) return;
1475
+ if (h.current) return;
1472
1476
  (async () => {
1473
- d && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), I(null);
1477
+ d && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), _(null);
1474
1478
  try {
1475
- const m = await t.loadParticipants({
1479
+ const u = await t.loadParticipants({
1476
1480
  search: "",
1477
1481
  // Load all participants initially
1478
1482
  limit: 100
1479
1483
  });
1480
- f(m.participants), C.current = !0, d && console.log(
1484
+ x(u.participants), h.current = !0, d && console.log(
1481
1485
  "[ParticipantPicker] Participants loaded successfully:",
1482
- m.participants.length
1486
+ u.participants.length
1483
1487
  );
1484
- } catch (m) {
1485
- const v = m instanceof Error ? m.message : "Failed to load participants";
1486
- I(v), console.error("[ParticipantPicker] Failed to load participants:", m);
1488
+ } catch (u) {
1489
+ const N = u instanceof Error ? u.message : "Failed to load participants";
1490
+ _(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1487
1491
  } finally {
1488
1492
  l(!1);
1489
1493
  }
1490
1494
  })();
1491
1495
  }, [t.loading, d]);
1492
- const N = S.filter((h) => !a.has(h.id)).filter((h) => {
1493
- var v;
1496
+ const p = M.filter((f) => !a.has(f.id)).filter((f) => {
1497
+ var N;
1494
1498
  if (!b) return !0;
1495
- const m = b.toLowerCase();
1496
- return h.name.toLowerCase().includes(m) || ((v = h.email) == null ? void 0 : v.toLowerCase().includes(m)) || !1;
1497
- }), w = T(
1498
- async (h) => {
1499
- if (!E) {
1500
- g(h.id);
1499
+ const u = b.toLowerCase();
1500
+ return f.name.toLowerCase().includes(u) || ((N = f.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1501
+ }), C = T(
1502
+ async (f) => {
1503
+ if (!y) {
1504
+ E(f.id);
1501
1505
  try {
1502
- await s(h);
1503
- } catch (m) {
1504
- console.error("[ParticipantPicker] Failed to start chat:", m), g(null);
1506
+ await s(f);
1507
+ } catch (u) {
1508
+ console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
1505
1509
  }
1506
1510
  }
1507
1511
  },
1508
- [s, E]
1509
- ), p = (h, m) => {
1510
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(m));
1512
+ [s, y]
1513
+ ), v = (f, u) => {
1514
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), C(u));
1511
1515
  };
1512
1516
  return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1513
1517
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
@@ -1519,7 +1523,7 @@ const Nt = ({
1519
1523
  "Select a ",
1520
1524
  o.slice(0, -1),
1521
1525
  " to start messaging (",
1522
- N.length,
1526
+ p.length,
1523
1527
  " available)",
1524
1528
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${o} total`
1525
1529
  ] }),
@@ -1527,60 +1531,60 @@ const Nt = ({
1527
1531
  Ct,
1528
1532
  {
1529
1533
  searchQuery: b,
1530
- setSearchQuery: u,
1534
+ setSearchQuery: m,
1531
1535
  placeholder: c
1532
1536
  }
1533
1537
  )
1534
1538
  ] }),
1535
- M && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1539
+ I && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1536
1540
  "Error loading ",
1537
1541
  o,
1538
1542
  ": ",
1539
- M
1543
+ I
1540
1544
  ] }),
1541
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: x && N.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: [
1545
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g && p.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1542
1546
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1543
1547
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1544
1548
  "Loading ",
1545
1549
  o,
1546
1550
  "..."
1547
1551
  ] })
1548
- ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1552
+ ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1549
1553
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ke, { className: "h-8 w-8 text-charcoal" }) }),
1550
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : S.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1551
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : S.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1554
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : M.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1555
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : M.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1552
1556
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1553
- N.map((h) => {
1554
- const m = h.name || h.email || h.id, v = h.email && h.name ? h.email : h.phone;
1557
+ p.map((f) => {
1558
+ const u = f.name || f.email || f.id, N = f.email && f.name ? f.email : f.phone;
1555
1559
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1556
1560
  "button",
1557
1561
  {
1558
1562
  type: "button",
1559
- onClick: () => w(h),
1560
- onKeyDown: (R) => p(R, h),
1563
+ onClick: () => C(f),
1564
+ onKeyDown: (R) => v(R, f),
1561
1565
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
1562
1566
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1563
1567
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1564
1568
  /* @__PURE__ */ e(
1565
1569
  Q,
1566
1570
  {
1567
- id: h.id,
1568
- name: m,
1569
- image: h.image,
1571
+ id: f.id,
1572
+ name: u,
1573
+ image: f.image,
1570
1574
  size: 40
1571
1575
  }
1572
1576
  ),
1573
1577
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1574
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1575
- v && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: v })
1578
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1579
+ N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1576
1580
  ] })
1577
1581
  ] }),
1578
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: E === h.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
1582
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === f.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
1579
1583
  ] })
1580
1584
  }
1581
- ) }, h.id);
1585
+ ) }, f.id);
1582
1586
  }),
1583
- x && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1587
+ g && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1584
1588
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1585
1589
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1586
1590
  ] }) })
@@ -1755,87 +1759,87 @@ const Rt = ({
1755
1759
  initialParticipantData: r,
1756
1760
  CustomChannelEmptyState: d,
1757
1761
  showChannelList: b = !0,
1758
- filters: u,
1759
- channelListCustomEmptyStateIndicator: S,
1760
- onDeleteConversationClick: f,
1761
- onBlockParticipantClick: x,
1762
+ filters: m,
1763
+ channelListCustomEmptyStateIndicator: M,
1764
+ onDeleteConversationClick: x,
1765
+ onBlockParticipantClick: g,
1762
1766
  onReportParticipantClick: l,
1763
- dmAgentEnabled: M,
1764
- messageMetadata: I,
1765
- onMessageSent: E,
1766
- showStarButton: g = !1,
1767
- chatbotVotingEnabled: C = !1,
1768
- renderMessagePreview: N
1767
+ dmAgentEnabled: I,
1768
+ messageMetadata: _,
1769
+ onMessageSent: y,
1770
+ showStarButton: E = !1,
1771
+ chatbotVotingEnabled: h = !1,
1772
+ renderMessagePreview: p
1769
1773
  }) => {
1770
1774
  const {
1771
- service: w,
1772
- client: p,
1773
- isConnected: h,
1774
- isLoading: m,
1775
- error: v,
1775
+ service: C,
1776
+ client: v,
1777
+ isConnected: f,
1778
+ isLoading: u,
1779
+ error: N,
1776
1780
  refreshConnection: R,
1777
- debug: y
1778
- } = Hs(), [O, $] = k(null), [te, X] = k(!1), [K, q] = k(!1), [ne, Z] = k(!1), [ee, G] = k(/* @__PURE__ */ new Set()), [L, U] = k(0), [F, j] = k(!1), [z, Y] = k(null), J = V(null), {
1781
+ debug: w
1782
+ } = Hs(), [F, $] = k(null), [te, X] = k(!1), [K, q] = k(!1), [ne, Z] = k(!1), [ee, G] = k(/* @__PURE__ */ new Set()), [P, U] = k(0), [L, j] = k(!1), [z, Y] = k(null), J = V(null), {
1779
1783
  participantSource: ae,
1780
1784
  participantLabel: re = "participants",
1781
1785
  showDeleteConversation: le = !0
1782
1786
  } = t, ze = B.useMemo(() => {
1783
- const _ = p == null ? void 0 : p.userID;
1787
+ const S = v == null ? void 0 : v.userID;
1784
1788
  return {
1785
1789
  ...{
1786
1790
  type: "messaging",
1787
1791
  last_message_at: { $exists: !0 },
1788
- ..._ && {
1789
- members: { $in: [_] },
1792
+ ...S && {
1793
+ members: { $in: [S] },
1790
1794
  hidden: !1
1791
1795
  }
1792
1796
  },
1793
- ...u
1797
+ ...m
1794
1798
  };
1795
- }, [u, p == null ? void 0 : p.userID]), oe = V(null), se = T(async () => {
1796
- if (!p || !h) return;
1797
- const _ = p.userID;
1798
- if (_)
1799
+ }, [m, v == null ? void 0 : v.userID]), oe = V(null), se = T(async () => {
1800
+ if (!v || !f) return;
1801
+ const S = v.userID;
1802
+ if (S)
1799
1803
  try {
1800
- y && console.log("[MessagingShell] Syncing channels for user:", _);
1801
- const H = await p.queryChannels(
1804
+ w && console.log("[MessagingShell] Syncing channels for user:", S);
1805
+ const H = await v.queryChannels(
1802
1806
  {
1803
1807
  type: "messaging",
1804
- members: { $in: [_] }
1808
+ members: { $in: [S] }
1805
1809
  },
1806
1810
  {},
1807
1811
  { limit: 100 }
1808
- ), P = /* @__PURE__ */ new Set();
1812
+ ), O = /* @__PURE__ */ new Set();
1809
1813
  H.forEach((A) => {
1810
1814
  const ge = A.state.members;
1811
1815
  Object.values(ge).forEach((Ye) => {
1812
1816
  var Ee;
1813
1817
  const xe = (Ee = Ye.user) == null ? void 0 : Ee.id;
1814
- xe && xe !== _ && P.add(xe);
1818
+ xe && xe !== S && O.add(xe);
1815
1819
  });
1816
- }), G((A) => A.size === P.size && [...A].every((ge) => P.has(ge)) ? A : P), X(H.length > 0), q(!0), oe.current = _, y && console.log("[MessagingShell] Channels synced successfully:", {
1820
+ }), G((A) => A.size === O.size && [...A].every((ge) => O.has(ge)) ? A : O), X(H.length > 0), q(!0), oe.current = S, w && console.log("[MessagingShell] Channels synced successfully:", {
1817
1821
  channelCount: H.length,
1818
- memberCount: P.size
1822
+ memberCount: O.size
1819
1823
  });
1820
1824
  } catch (H) {
1821
1825
  console.error("[MessagingShell] Failed to sync channels:", H);
1822
1826
  }
1823
- }, [p, h, y]);
1827
+ }, [v, f, w]);
1824
1828
  W(() => {
1825
- if (!p || !h) return;
1826
- const _ = p.userID;
1827
- _ && oe.current !== _ && se();
1828
- }, [p, h, se]), W(() => {
1829
- if (!c || !p || !h) return;
1829
+ if (!v || !f) return;
1830
+ const S = v.userID;
1831
+ S && oe.current !== S && se();
1832
+ }, [v, f, se]), W(() => {
1833
+ if (!c || !v || !f) return;
1830
1834
  (async () => {
1831
- const H = p.userID;
1835
+ const H = v.userID;
1832
1836
  if (H)
1833
1837
  try {
1834
- y && console.log(
1838
+ w && console.log(
1835
1839
  "[MessagingShell] Loading initial conversation with:",
1836
1840
  c
1837
1841
  );
1838
- const P = await p.queryChannels(
1842
+ const O = await v.queryChannels(
1839
1843
  {
1840
1844
  type: "messaging",
1841
1845
  members: { $eq: [H, c] }
@@ -1843,24 +1847,24 @@ const Rt = ({
1843
1847
  {},
1844
1848
  { limit: 1 }
1845
1849
  );
1846
- if (P.length > 0)
1847
- $(P[0]), j(!0), Y(null), a && a(P[0]), y && console.log(
1850
+ if (O.length > 0)
1851
+ $(O[0]), j(!0), Y(null), a && a(O[0]), w && console.log(
1848
1852
  "[MessagingShell] Initial conversation loaded:",
1849
- P[0].id
1853
+ O[0].id
1850
1854
  );
1851
- else if (r && w) {
1852
- y && console.log(
1855
+ else if (r && C) {
1856
+ w && console.log(
1853
1857
  "[MessagingShell] No conversation found, creating one for:",
1854
1858
  r
1855
1859
  );
1856
1860
  try {
1857
- const A = await w.startChannelWithParticipant({
1861
+ const A = await C.startChannelWithParticipant({
1858
1862
  id: r.id,
1859
1863
  name: r.name,
1860
1864
  email: r.email,
1861
1865
  phone: r.phone
1862
1866
  });
1863
- $(A), j(!0), Y(null), a && a(A), y && console.log(
1867
+ $(A), j(!0), Y(null), a && a(A), w && console.log(
1864
1868
  "[MessagingShell] Channel created and loaded:",
1865
1869
  A.id
1866
1870
  );
@@ -1873,79 +1877,79 @@ const Rt = ({
1873
1877
  } else
1874
1878
  Y(
1875
1879
  "No conversation found with this account"
1876
- ), y && console.log(
1880
+ ), w && console.log(
1877
1881
  "[MessagingShell] No conversation found for:",
1878
1882
  c
1879
1883
  );
1880
- } catch (P) {
1884
+ } catch (O) {
1881
1885
  console.error(
1882
1886
  "[MessagingShell] Failed to load initial conversation:",
1883
- P
1887
+ O
1884
1888
  ), Y("Failed to load conversation");
1885
1889
  }
1886
1890
  })();
1887
1891
  }, [
1888
1892
  c,
1889
1893
  r,
1890
- p,
1891
- h,
1894
+ v,
1895
+ f,
1896
+ C,
1892
1897
  w,
1893
- y,
1894
1898
  a
1895
1899
  ]);
1896
1900
  const He = T(
1897
- (_) => {
1898
- $(_), a == null || a(_);
1901
+ (S) => {
1902
+ $(S), a == null || a(S);
1899
1903
  },
1900
1904
  [a]
1901
1905
  ), Ge = T(() => {
1902
- F || $(null);
1903
- }, [F]), Ve = T(
1904
- async (_) => {
1906
+ L || $(null);
1907
+ }, [L]), Ve = T(
1908
+ async (S) => {
1905
1909
  var H;
1906
- if (w)
1910
+ if (C)
1907
1911
  try {
1908
- y && console.log(
1912
+ w && console.log(
1909
1913
  "[MessagingShell] Starting conversation with:",
1910
- _.id
1914
+ S.id
1911
1915
  );
1912
- const P = await w.startChannelWithParticipant({
1913
- id: _.id,
1914
- name: _.name,
1915
- email: _.email,
1916
- phone: _.phone
1916
+ const O = await C.startChannelWithParticipant({
1917
+ id: S.id,
1918
+ name: S.name,
1919
+ email: S.email,
1920
+ phone: S.phone
1917
1921
  });
1918
1922
  try {
1919
- await P.show();
1923
+ await O.show();
1920
1924
  } catch (A) {
1921
1925
  console.warn("[MessagingShell] Failed to unhide channel:", A);
1922
1926
  }
1923
- $(P), Z(!1), (H = J.current) == null || H.close(), o == null || o(_);
1924
- } catch (P) {
1925
- console.error("[MessagingShell] Failed to start conversation:", P);
1927
+ $(O), Z(!1), (H = J.current) == null || H.close(), o == null || o(S);
1928
+ } catch (O) {
1929
+ console.error("[MessagingShell] Failed to start conversation:", O);
1926
1930
  }
1927
1931
  },
1928
- [w, o, y]
1932
+ [C, o, w]
1929
1933
  ), ie = T(() => {
1930
- var _;
1931
- Z(!1), (_ = J.current) == null || _.close();
1934
+ var S;
1935
+ Z(!1), (S = J.current) == null || S.close();
1932
1936
  }, []), We = T(
1933
- (_) => {
1934
- _.target === J.current && ie();
1937
+ (S) => {
1938
+ S.target === J.current && ie();
1935
1939
  },
1936
1940
  [ie]
1937
1941
  ), qe = T(
1938
- async (_) => {
1939
- y && console.log("[MessagingShell] Leaving conversation:", _.id), $(null), j(!1), oe.current = null, await se();
1942
+ async (S) => {
1943
+ w && console.log("[MessagingShell] Leaving conversation:", S.id), $(null), j(!1), oe.current = null, await se();
1940
1944
  },
1941
- [se, y]
1945
+ [se, w]
1942
1946
  ), Ze = T(
1943
- async (_) => {
1944
- y && console.log("[MessagingShell] Blocking participant:", _), $(null), j(!1), oe.current = null, await se();
1947
+ async (S) => {
1948
+ w && console.log("[MessagingShell] Blocking participant:", S), $(null), j(!1), oe.current = null, await se();
1945
1949
  },
1946
- [se, y]
1947
- ), ce = !!O;
1948
- return m ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : v ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: v, onBack: R }) }) : !h || !p ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1950
+ [se, w]
1951
+ ), ce = !!F;
1952
+ return u ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : N ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: N, onBack: R }) }) : !f || !v ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1949
1953
  me,
1950
1954
  {
1951
1955
  message: "Not connected to messaging service",
@@ -1966,21 +1970,21 @@ const Rt = ({
1966
1970
  className: D(
1967
1971
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1968
1972
  {
1969
- "!hidden": b === !1 || F,
1973
+ "!hidden": b === !1 || L,
1970
1974
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1971
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !F && ce,
1975
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !L && ce,
1972
1976
  // Show on mobile when no channel selected, use same wide width on desktop
1973
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !F && !ce
1977
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !L && !ce
1974
1978
  }
1975
1979
  ),
1976
1980
  children: /* @__PURE__ */ e(
1977
1981
  Ue,
1978
1982
  {
1979
1983
  onChannelSelect: He,
1980
- selectedChannel: O || void 0,
1984
+ selectedChannel: F || void 0,
1981
1985
  filters: ze,
1982
- customEmptyStateIndicator: S,
1983
- renderMessagePreview: N
1986
+ customEmptyStateIndicator: M,
1987
+ renderMessagePreview: p
1984
1988
  }
1985
1989
  )
1986
1990
  }
@@ -1992,32 +1996,32 @@ const Rt = ({
1992
1996
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1993
1997
  {
1994
1998
  // In direct conversation mode (or waiting for it), always show (full width)
1995
- flex: F || ce || c,
1999
+ flex: L || ce || c,
1996
2000
  // Normal mode: hide on mobile when no channel selected
1997
- "hidden lg:flex": !F && !ce && !c
2001
+ "hidden lg:flex": !L && !ce && !c
1998
2002
  }
1999
2003
  ),
2000
- children: O ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2004
+ children: F ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2001
2005
  Ae,
2002
2006
  {
2003
- channel: O,
2007
+ channel: F,
2004
2008
  onBack: Ge,
2005
- showBackButton: !F,
2009
+ showBackButton: !L,
2006
2010
  renderMessageInputActions: n,
2007
2011
  onLeaveConversation: qe,
2008
2012
  onBlockParticipant: Ze,
2009
2013
  CustomChannelEmptyState: d,
2010
2014
  showDeleteConversation: le,
2011
- onDeleteConversationClick: f,
2012
- onBlockParticipantClick: x,
2015
+ onDeleteConversationClick: x,
2016
+ onBlockParticipantClick: g,
2013
2017
  onReportParticipantClick: l,
2014
- dmAgentEnabled: M,
2015
- messageMetadata: I,
2016
- onMessageSent: E,
2017
- showStarButton: g,
2018
- chatbotVotingEnabled: C
2018
+ dmAgentEnabled: I,
2019
+ messageMetadata: _,
2020
+ onMessageSent: y,
2021
+ showStarButton: E,
2022
+ chatbotVotingEnabled: h
2019
2023
  },
2020
- O.id
2024
+ F.id
2021
2025
  ) }) : c ? (
2022
2026
  // Show loading while creating/loading direct conversation channel
2023
2027
  /* @__PURE__ */ e(he, {})
@@ -2049,7 +2053,7 @@ const Rt = ({
2049
2053
  participantLabel: re,
2050
2054
  searchPlaceholder: `Search ${re}...`
2051
2055
  },
2052
- L
2056
+ P
2053
2057
  ) })
2054
2058
  }
2055
2059
  )
@@ -2087,7 +2091,7 @@ const Rt = ({
2087
2091
  avatarImage: c,
2088
2092
  avatarName: r
2089
2093
  }) => {
2090
- const d = t.filter((b) => b.enabled).sort((b, u) => (b.order ?? 0) - (u.order ?? 0));
2094
+ const d = t.filter((b) => b.enabled).sort((b, m) => (b.order ?? 0) - (m.order ?? 0));
2091
2095
  return d.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2092
2096
  (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2093
2097
  Q,
@@ -2120,44 +2124,44 @@ const Rt = ({
2120
2124
  )
2121
2125
  ] }) });
2122
2126
  }, Tt = (t, s = {}) => {
2123
- const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = k([]), [r, d] = k(!1), [b, u] = k(null), [S, f] = k(n), [x, l] = k(!0), [M, I] = k(), E = T(async (w = !1, p) => {
2127
+ const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = k([]), [r, d] = k(!1), [b, m] = k(null), [M, x] = k(n), [g, l] = k(!0), [I, _] = k(), y = T(async (C = !1, v) => {
2124
2128
  if (r) return;
2125
- const h = p !== void 0 ? p : S;
2126
- d(!0), u(null);
2129
+ const f = v !== void 0 ? v : M;
2130
+ d(!0), m(null);
2127
2131
  try {
2128
- const m = await t.loadParticipants({
2129
- search: h || void 0,
2132
+ const u = await t.loadParticipants({
2133
+ search: f || void 0,
2130
2134
  limit: a,
2131
- cursor: w ? void 0 : M
2135
+ cursor: C ? void 0 : I
2132
2136
  });
2133
2137
  c(
2134
- (v) => w ? m.participants : [...v, ...m.participants]
2135
- ), l(m.hasMore), I(m.nextCursor);
2136
- } catch (m) {
2137
- const v = m instanceof Error ? m.message : "Failed to load participants";
2138
- u(v), console.error("[useParticipants] Load error:", m);
2138
+ (N) => C ? u.participants : [...N, ...u.participants]
2139
+ ), l(u.hasMore), _(u.nextCursor);
2140
+ } catch (u) {
2141
+ const N = u instanceof Error ? u.message : "Failed to load participants";
2142
+ m(N), console.error("[useParticipants] Load error:", u);
2139
2143
  } finally {
2140
2144
  d(!1);
2141
2145
  }
2142
- }, [t, S, M, a, r]), g = T(() => {
2143
- x && !r && E(!1);
2144
- }, [x, r, E]), C = T((w) => {
2145
- f(w), I(void 0), E(!0, w);
2146
- }, [E]), N = T(() => {
2147
- I(void 0), E(!0);
2148
- }, [E]);
2146
+ }, [t, M, I, a, r]), E = T(() => {
2147
+ g && !r && y(!1);
2148
+ }, [g, r, y]), h = T((C) => {
2149
+ x(C), _(void 0), y(!0, C);
2150
+ }, [y]), p = T(() => {
2151
+ _(void 0), y(!0);
2152
+ }, [y]);
2149
2153
  return W(() => {
2150
- E(!0);
2154
+ y(!0);
2151
2155
  }, [t.loadParticipants]), {
2152
2156
  participants: o,
2153
2157
  loading: r,
2154
2158
  error: b,
2155
- searchQuery: S,
2156
- hasMore: x,
2159
+ searchQuery: M,
2160
+ hasMore: g,
2157
2161
  totalCount: t.totalCount,
2158
- loadMore: g,
2159
- search: C,
2160
- refresh: N
2162
+ loadMore: E,
2163
+ search: h,
2164
+ refresh: p
2161
2165
  };
2162
2166
  };
2163
2167
  export {