@linktr.ee/messaging-react 4.3.2 → 4.4.0-rc-1787598778

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 (33) hide show
  1. package/dist/{AttachmentCard-Pc93Wcd0.js → AttachmentCard-BqwWgqvi.js} +83 -78
  2. package/dist/AttachmentCard-BqwWgqvi.js.map +1 -0
  3. package/dist/AttachmentCard-DUrgGRsq.cjs +2 -0
  4. package/dist/AttachmentCard-DUrgGRsq.cjs.map +1 -0
  5. package/dist/{Card-ByU9P9GA.cjs → Card-BIbqWagz.cjs} +2 -2
  6. package/dist/{Card-ByU9P9GA.cjs.map → Card-BIbqWagz.cjs.map} +1 -1
  7. package/dist/{Card-D__kW2E_.js → Card-f51K6V7Y.js} +20 -20
  8. package/dist/{Card-D__kW2E_.js.map → Card-f51K6V7Y.js.map} +1 -1
  9. package/dist/index.cjs +2 -2
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.ts +15 -0
  12. package/dist/index.js +1017 -969
  13. package/dist/index.js.map +1 -1
  14. package/package.json +3 -3
  15. package/src/components/AttachmentCard/MediaPlayer.tsx +2 -0
  16. package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +26 -0
  17. package/src/components/CustomMessage/StreamAttachmentMessage.tsx +31 -3
  18. package/src/components/LinkAttachment/components/_shared/CardThumbnail.tsx +2 -0
  19. package/src/components/MessageAttachment/Audio/index.tsx +2 -0
  20. package/src/components/MessageAttachment/Image/index.tsx +11 -56
  21. package/src/components/MessageAttachment/MessageAttachment.test.tsx +249 -0
  22. package/src/components/MessageAttachment/Video/VideoAttachment.stories.tsx +163 -0
  23. package/src/components/MessageAttachment/Video/index.tsx +195 -36
  24. package/src/components/MessageAttachment/_shared/MediaStackGrid.tsx +27 -3
  25. package/src/components/MessageAttachment/_shared/VideoViewer.test.tsx +68 -1
  26. package/src/components/MessageAttachment/_shared/VideoViewer.tsx +86 -25
  27. package/src/components/MessageAttachment/_shared/useSingleMediaRatio.ts +75 -0
  28. package/src/components/MessageAttachment/types.ts +9 -0
  29. package/src/utils/nativeMediaPlayers.test.ts +55 -0
  30. package/src/utils/nativeMediaPlayers.ts +41 -0
  31. package/dist/AttachmentCard-DI2chsB_.cjs +0 -2
  32. package/dist/AttachmentCard-DI2chsB_.cjs.map +0 -1
  33. package/dist/AttachmentCard-Pc93Wcd0.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
- import { a as e, i as t, n, r } from "./AttachmentCard-Pc93Wcd0.js";
2
- import i, { Suspense as a, createContext as o, useCallback as s, useContext as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
3
- import { StreamChatService as m } from "@linktr.ee/messaging-core";
4
- import { LinkPreviewsManager as h, StreamChat as g } from "stream-chat";
5
- import { AIStates as _, Attachment as v, AttachmentPreviewList as y, Channel as b, ChannelList as x, Chat as S, DateSeparator as C, EditMessageModal as w, InfiniteScroll as T, MessageBlocked as E, MessageBounceModal as D, MessageBouncePrompt as O, MessageDeleted as k, MessageErrorIcon as A, MessageInput as j, MessageIsThreadReplyInChannelButtonIndicator as M, MessageList as N, MessageRepliesCountButton as P, MessageStatus as F, MessageText as I, MessageTimestamp as L, Poll as R, QuotedMessagePreview as z, ReminderNotification as ee, StreamedMessageText as te, TextareaComposer as ne, Window as re, WithComponents as B, areMessageUIPropsEqual as V, isDateSeparatorMessage as ie, isMessageBlocked as ae, isMessageBounced as oe, messageHasAttachments as se, messageHasReactions as ce, useAIState as le, useChannelStateContext as ue, useChatContext as de, useComponentContext as fe, useMessageComposer as pe, useMessageComposerHasSendableData as me, useMessageContext as H, useMessageInputContext as he, useMessageReminder as ge, useStateStore as _e, useTypingContext as ve } from "stream-chat-react";
1
+ import { a as e, i as t, n, o as r, r as i, s as a } from "./AttachmentCard-BqwWgqvi.js";
2
+ import o, { Suspense as s, createContext as c, useCallback as l, useContext as u, useEffect as d, useId as f, useMemo as p, useRef as m, useState as h } from "react";
3
+ import { StreamChatService as g } from "@linktr.ee/messaging-core";
4
+ import { LinkPreviewsManager as _, StreamChat as v } from "stream-chat";
5
+ import { AIStates as y, Attachment as b, AttachmentPreviewList as x, Channel as S, ChannelList as C, Chat as w, DateSeparator as T, EditMessageModal as E, InfiniteScroll as D, MessageBlocked as O, MessageBounceModal as k, MessageBouncePrompt as A, MessageDeleted as j, MessageErrorIcon as M, MessageInput as N, MessageIsThreadReplyInChannelButtonIndicator as P, MessageList as F, MessageRepliesCountButton as I, MessageStatus as L, MessageText as R, MessageTimestamp as z, Poll as ee, QuotedMessagePreview as te, ReminderNotification as ne, StreamedMessageText as re, TextareaComposer as ie, Window as B, WithComponents as ae, areMessageUIPropsEqual as oe, isDateSeparatorMessage as se, isMessageBlocked as ce, isMessageBounced as le, messageHasAttachments as ue, messageHasReactions as de, useAIState as fe, useActiveAudioPlayer as pe, useChannelStateContext as V, useChatContext as me, useComponentContext as he, useMessageComposer as ge, useMessageComposerHasSendableData as _e, useMessageContext as H, useMessageInputContext as ve, useMessageReminder as ye, useStateStore as be, useTypingContext as xe } from "stream-chat-react";
6
6
  import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
7
- import { MESSAGE_CUSTOM_TYPE as K, OFFICIAL_SENDER_USER_ID as ye, isAgeSafetySystemType as be, isDmAgentSystemType as xe, isOfficialChannel as q, resolveRichCardImagePresentation as Se, selectEnabledFaqs as Ce } from "@linktr.ee/messaging-taxonomy";
8
- import J from "classnames";
9
- import { ArrowLeftIcon as we, ArrowUpIcon as Te, CaretLeftIcon as Y, CaretRightIcon as Ee, ChecksIcon as De, CircleNotchIcon as Oe, CurrencyDollarIcon as ke, DotsThreeIcon as Ae, DownloadSimpleIcon as je, FlagIcon as X, GiftIcon as Z, MegaphoneIcon as Me, PencilSimpleIcon as Ne, PlayIcon as Pe, ProhibitIcon as Fe, ProhibitInsetIcon as Ie, SignOutIcon as Le, SparkleIcon as Re, SpinnerGapIcon as ze, StarIcon as Be, TrashSimpleIcon as Ve, VideoCameraIcon as He, WarningCircleIcon as Ue, XIcon as We } from "@phosphor-icons/react";
10
- import { DefaultDropdownActionButton as Ge, MessageActions as Ke } from "stream-chat-react/experimental";
7
+ import { MESSAGE_CUSTOM_TYPE as K, OFFICIAL_SENDER_USER_ID as q, isAgeSafetySystemType as Se, isDmAgentSystemType as Ce, isOfficialChannel as we, resolveRichCardImagePresentation as Te, selectEnabledFaqs as J } from "@linktr.ee/messaging-taxonomy";
8
+ import Y from "classnames";
9
+ import { ArrowLeftIcon as Ee, ArrowUpIcon as De, CaretLeftIcon as Oe, CaretRightIcon as ke, ChecksIcon as Ae, CircleNotchIcon as je, CurrencyDollarIcon as X, DotsThreeIcon as Z, DownloadSimpleIcon as Me, FlagIcon as Ne, GiftIcon as Pe, MegaphoneIcon as Fe, PencilSimpleIcon as Ie, PlayIcon as Le, ProhibitIcon as Re, ProhibitInsetIcon as ze, SignOutIcon as Be, SparkleIcon as Ve, SpinnerGapIcon as He, StarIcon as Ue, TrashSimpleIcon as We, VideoCameraIcon as Ge, WarningCircleIcon as Ke, XIcon as qe } from "@phosphor-icons/react";
10
+ import { DefaultDropdownActionButton as Je, MessageActions as Ye } from "stream-chat-react/experimental";
11
11
  //#region src/logging/index.tsx
12
- var qe = {
12
+ var Xe = {
13
13
  debug: (e, ...t) => console.log(e, ...t),
14
14
  info: (e, ...t) => console.log(e, ...t),
15
15
  warn: (e, ...t) => console.warn(e, ...t),
16
16
  error: (e, ...t) => console.error(e, ...t)
17
- }, Je = (e) => ({
18
- debug: e?.debug ?? qe.debug,
19
- info: e?.info ?? qe.info,
20
- warn: e?.warn ?? qe.warn,
21
- error: e?.error ?? qe.error
22
- }), Ye = o(qe), Xe = ({ logger: e, children: t }) => {
23
- let n = d(() => Je(e), [e]);
24
- return /* @__PURE__ */ W(Ye.Provider, {
17
+ }, Ze = (e) => ({
18
+ debug: e?.debug ?? Xe.debug,
19
+ info: e?.info ?? Xe.info,
20
+ warn: e?.warn ?? Xe.warn,
21
+ error: e?.error ?? Xe.error
22
+ }), Qe = c(Xe), $e = ({ logger: e, children: t }) => {
23
+ let n = p(() => Ze(e), [e]);
24
+ return /* @__PURE__ */ W(Qe.Provider, {
25
25
  value: n,
26
26
  children: t
27
27
  });
28
- }, Ze = () => c(Ye), Qe = o({
28
+ }, et = () => u(Qe), tt = c({
29
29
  service: null,
30
30
  client: null,
31
31
  isConnected: !1,
@@ -34,29 +34,29 @@ var qe = {
34
34
  capabilities: {},
35
35
  refreshConnection: async () => {},
36
36
  debug: !1
37
- }), $e = () => c(Qe), et = ({ children: e, user: t, serviceConfig: n, apiKey: r, capabilities: a = {}, debug: o = !1, client: c, logger: u }) => {
38
- let d = s((e, ...t) => {
39
- o && console.log(`🔥 [MessagingProvider] ${e}`, ...t);
40
- }, [o]);
41
- d("🔄 RENDER START", {
37
+ }), nt = () => u(tt), rt = ({ children: e, user: t, serviceConfig: n, apiKey: r, capabilities: i = {}, debug: a = !1, client: s, logger: c }) => {
38
+ let u = l((e, ...t) => {
39
+ a && console.log(`🔥 [MessagingProvider] ${e}`, ...t);
40
+ }, [a]);
41
+ u("🔄 RENDER START", {
42
42
  userId: t?.id,
43
43
  apiKey: r?.substring(0, 8) + "...",
44
44
  serviceConfig: !!n,
45
- capabilities: Object.keys(a)
45
+ capabilities: Object.keys(i)
46
46
  });
47
- let [h, _] = p(null), [v, y] = p(null), [b, x] = p(!1), [C, w] = p(!1), [T, E] = p(null), D = f(!1), O = f(null), k = f(n);
47
+ let [f, p] = h(null), [_, y] = h(null), [b, x] = h(!1), [S, C] = h(!1), [T, E] = h(null), D = m(!1), O = m(null), k = m(n);
48
48
  k.current = n;
49
- let A = f(o);
50
- A.current = o;
51
- let j = f(u);
52
- j.current = u;
53
- let M = f({
49
+ let A = m(a);
50
+ A.current = a;
51
+ let j = m(c);
52
+ j.current = c;
53
+ let M = m({
54
54
  userId: t?.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
- capabilities: a
58
- }), N = f(0);
59
- N.current++, d("📊 RENDER INFO", {
57
+ capabilities: i
58
+ }), N = m(0);
59
+ N.current++, u("📊 RENDER INFO", {
60
60
  renderCount: N.current,
61
61
  currentProps: {
62
62
  userId: t?.id,
@@ -66,98 +66,98 @@ var qe = {
66
66
  userChanged: M.current.userId !== t?.id,
67
67
  apiKeyChanged: M.current.apiKey !== r,
68
68
  serviceConfigChanged: M.current.serviceConfig !== n,
69
- capabilitiesChanged: M.current.capabilities !== a
69
+ capabilitiesChanged: M.current.capabilities !== i
70
70
  }
71
71
  }), M.current = {
72
72
  userId: t?.id,
73
73
  apiKey: r,
74
74
  serviceConfig: n,
75
- capabilities: a
75
+ capabilities: i
76
76
  };
77
- let P = f(null);
78
- !c && r && P.current?.apiKey !== r && (P.current = {
77
+ let P = m(null);
78
+ !s && r && P.current?.apiKey !== r && (P.current = {
79
79
  apiKey: r,
80
- client: new g(r)
80
+ client: new v(r)
81
81
  });
82
- let F = c || (r ? P.current?.client ?? null : null);
83
- l(() => {
82
+ let F = s || (r ? P.current?.client ?? null : null);
83
+ d(() => {
84
84
  let e = N.current, t = k.current;
85
- if (c) {
86
- O.current = null, _(null), y(null), x(!1), E(null), w(!1);
85
+ if (s) {
86
+ O.current = null, p(null), y(null), x(!1), E(null), C(!1);
87
87
  return;
88
88
  }
89
89
  if (!r || !F || !t) {
90
- d("⚠️ SERVICE INIT SKIPPED", {
90
+ u("⚠️ SERVICE INIT SKIPPED", {
91
91
  renderCount: e,
92
92
  reason: "Missing apiKey, client, or serviceConfig"
93
93
  });
94
94
  return;
95
95
  }
96
- d("🚀 CREATING SERVICE", {
96
+ u("🚀 CREATING SERVICE", {
97
97
  renderCount: e,
98
98
  apiKey: r?.substring(0, 8) + "..."
99
99
  });
100
- let n = new m({
100
+ let n = new g({
101
101
  ...t,
102
102
  apiKey: r,
103
103
  debug: A.current,
104
104
  client: F,
105
- ...t.logger || !j.current ? {} : { logger: Je(j.current) }
105
+ ...t.logger || !j.current ? {} : { logger: Ze(j.current) }
106
106
  });
107
- O.current = n, _(n), d("✅ SERVICE SET", {
107
+ O.current = n, p(n), u("✅ SERVICE SET", {
108
108
  renderCount: e,
109
109
  serviceInstance: !!n
110
110
  });
111
111
  }, [
112
112
  r,
113
113
  F,
114
- c
114
+ s
115
115
  ]);
116
- let I = f(null);
117
- l(() => {
118
- if (d("🔗 USER CONNECTION EFFECT TRIGGERED", {
119
- hasService: !!h,
116
+ let I = m(null);
117
+ d(() => {
118
+ if (u("🔗 USER CONNECTION EFFECT TRIGGERED", {
119
+ hasService: !!f,
120
120
  hasUser: !!t,
121
121
  userId: t?.id,
122
122
  isConnecting: D.current,
123
123
  isConnected: b,
124
124
  dependencies: {
125
- service: !!h,
125
+ service: !!f,
126
126
  userId: t?.id
127
127
  }
128
- }), !c) {
129
- if (!h || !t) {
130
- d("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
128
+ }), !s) {
129
+ if (!f || !t) {
130
+ u("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
131
131
  return;
132
132
  }
133
133
  if (D.current) {
134
- d("⚠️ USER CONNECTION SKIPPED", "Already connecting");
134
+ u("⚠️ USER CONNECTION SKIPPED", "Already connecting");
135
135
  return;
136
136
  }
137
- if (I.current?.serviceId === h && I.current?.userId === t.id) {
138
- d("⚠️ USER CONNECTION SKIPPED", "Already connected this user with this service");
137
+ if (I.current?.serviceId === f && I.current?.userId === t.id) {
138
+ u("⚠️ USER CONNECTION SKIPPED", "Already connected this user with this service");
139
139
  return;
140
140
  }
141
141
  (async () => {
142
- d("🚀 STARTING USER CONNECTION", { userId: t.id }), D.current = !0, w(!0), E(null);
142
+ u("🚀 STARTING USER CONNECTION", { userId: t.id }), D.current = !0, C(!0), E(null);
143
143
  try {
144
- d("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
145
- let e = await h.connectUser(t);
144
+ u("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
145
+ let e = await f.connectUser(t);
146
146
  y(e), x(!0), I.current = {
147
- serviceId: h,
147
+ serviceId: f,
148
148
  userId: t.id
149
- }, d("✅ USER CONNECTION SUCCESS", {
149
+ }, u("✅ USER CONNECTION SUCCESS", {
150
150
  userId: t.id,
151
151
  clientId: e.userID
152
152
  });
153
153
  } catch (e) {
154
154
  let n = e instanceof Error ? e.message : "Connection failed";
155
- E(n), d("❌ USER CONNECTION ERROR", {
155
+ E(n), u("❌ USER CONNECTION ERROR", {
156
156
  userId: t.id,
157
157
  error: n
158
158
  });
159
159
  } finally {
160
- w(!1), D.current = !1, d("🔄 USER CONNECTION FINISHED", {
160
+ C(!1), D.current = !1, u("🔄 USER CONNECTION FINISHED", {
161
161
  userId: t.id,
162
162
  isConnected: b
163
163
  });
@@ -165,92 +165,92 @@ var qe = {
165
165
  })();
166
166
  }
167
167
  }, [
168
- h,
168
+ f,
169
169
  t,
170
- d,
170
+ u,
171
171
  b,
172
- c
173
- ]), l(() => {
172
+ s
173
+ ]), d(() => {
174
174
  let e = F;
175
175
  return () => {
176
176
  e && (I.current = null, O.current?.disconnectUser().catch(console.error));
177
177
  };
178
178
  }, [F]);
179
- let L = s(async () => {
180
- if (d("🔄 REFRESH CONNECTION CALLED", {
181
- hasService: !!h,
179
+ let L = l(async () => {
180
+ if (u("🔄 REFRESH CONNECTION CALLED", {
181
+ hasService: !!f,
182
182
  hasUser: !!t
183
- }), !c) {
184
- if (!h || !t) {
185
- d("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
183
+ }), !s) {
184
+ if (!f || !t) {
185
+ u("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
186
186
  return;
187
187
  }
188
- d("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
188
+ u("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), C(!0);
189
189
  try {
190
- d("🔌 DISCONNECTING FOR REFRESH"), await h.disconnectUser(), d("📞 RECONNECTING FOR REFRESH");
191
- let e = await h.connectUser(t);
192
- y(e), x(!0), E(null), d("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
190
+ u("🔌 DISCONNECTING FOR REFRESH"), await f.disconnectUser(), u("📞 RECONNECTING FOR REFRESH");
191
+ let e = await f.connectUser(t);
192
+ y(e), x(!0), E(null), u("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
193
193
  } catch (e) {
194
194
  let n = e instanceof Error ? e.message : "Refresh failed";
195
- E(n), d("❌ CONNECTION REFRESH ERROR", {
195
+ E(n), u("❌ CONNECTION REFRESH ERROR", {
196
196
  userId: t.id,
197
197
  error: n
198
198
  });
199
199
  } finally {
200
- w(!1), d("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
200
+ C(!1), u("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
201
201
  }
202
202
  }
203
203
  }, [
204
- h,
204
+ f,
205
205
  t,
206
- d,
207
- c
208
- ]), R = i.useMemo(() => (d("💫 CONTEXT VALUE MEMOIZATION", {
209
- hasService: !!h,
210
- hasClient: !!v,
206
+ u,
207
+ s
208
+ ]), R = o.useMemo(() => (u("💫 CONTEXT VALUE MEMOIZATION", {
209
+ hasService: !!f,
210
+ hasClient: !!_,
211
211
  isConnected: b,
212
- isLoading: C,
212
+ isLoading: S,
213
213
  hasError: !!T,
214
- capabilitiesKeys: Object.keys(a)
214
+ capabilitiesKeys: Object.keys(i)
215
215
  }), {
216
- service: c ? null : h,
217
- client: c ?? v,
218
- isConnected: c ? !0 : b,
219
- isLoading: !c && C,
220
- error: c ? null : T,
221
- capabilities: a,
216
+ service: s ? null : f,
217
+ client: s ?? _,
218
+ isConnected: s ? !0 : b,
219
+ isLoading: !s && S,
220
+ error: s ? null : T,
221
+ capabilities: i,
222
222
  refreshConnection: L,
223
- debug: o
223
+ debug: a
224
224
  }), [
225
- h,
226
- v,
227
- c,
225
+ f,
226
+ _,
227
+ s,
228
228
  b,
229
- C,
229
+ S,
230
230
  T,
231
- a,
231
+ i,
232
232
  L,
233
- o,
234
- d
233
+ a,
234
+ u
235
235
  ]);
236
- return d("🔄 RENDER END", {
236
+ return u("🔄 RENDER END", {
237
237
  renderCount: N.current,
238
238
  willRenderChat: !!F,
239
239
  contextValueReady: !!R
240
- }), /* @__PURE__ */ W(Xe, {
241
- logger: u,
242
- children: /* @__PURE__ */ W(Qe.Provider, {
240
+ }), /* @__PURE__ */ W($e, {
241
+ logger: c,
242
+ children: /* @__PURE__ */ W(tt.Provider, {
243
243
  value: R,
244
- children: F ? /* @__PURE__ */ W(S, {
244
+ children: F ? /* @__PURE__ */ W(w, {
245
245
  client: F,
246
246
  customClasses: { channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]" },
247
247
  children: e
248
248
  }) : e
249
249
  })
250
250
  });
251
- }, tt = () => $e(), nt = (e) => {
252
- let [t, n] = p(!!e?.state?.membership?.pinned_at);
253
- return l(() => {
251
+ }, it = () => nt(), at = (e) => {
252
+ let [t, n] = h(!!e?.state?.membership?.pinned_at);
253
+ return d(() => {
254
254
  if (!e) {
255
255
  n(!1);
256
256
  return;
@@ -266,30 +266,30 @@ var qe = {
266
266
  };
267
267
  //#endregion
268
268
  //#region src/utils/resolveConversationParticipant.ts
269
- function rt(e, t, n) {
269
+ function ot(e, t, n) {
270
270
  let r = Object.values(e || {});
271
- if (q(n)) {
272
- let e = r.find((e) => e.user?.id === ye);
271
+ if (we(n)) {
272
+ let e = r.find((e) => e.user?.id === q);
273
273
  if (e) return e;
274
274
  }
275
275
  return r.find((e) => e.user?.id && e.user.id !== t);
276
276
  }
277
277
  //#endregion
278
278
  //#region src/utils/resolveParticipantDisplayName.ts
279
- var it = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
280
- function at(e) {
281
- return it.test(e.trim());
279
+ var st = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
280
+ function ct(e) {
281
+ return st.test(e.trim());
282
282
  }
283
- function ot(e, t) {
283
+ function lt(e, t) {
284
284
  let n = e?.trim();
285
- return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !at(n);
285
+ return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !ct(n);
286
286
  }
287
- function st(e) {
288
- return ot(e?.name, e?.id) ? e.name.trim() : ot(e?.username, e?.id) ? e.username.trim() : "Unknown member";
287
+ function ut(e) {
288
+ return lt(e?.name, e?.id) ? e.name.trim() : lt(e?.username, e?.id) ? e.username.trim() : "Unknown member";
289
289
  }
290
290
  //#endregion
291
291
  //#region src/components/Avatar/getAvatarEmoji.ts
292
- var ct = [
292
+ var dt = [
293
293
  {
294
294
  emoji: "🍎",
295
295
  bgColor: "#FFD1DD"
@@ -343,7 +343,7 @@ var ct = [
343
343
  bgColor: "#D9F7E1"
344
344
  }
345
345
  ];
346
- function lt(e) {
346
+ function ft(e) {
347
347
  let t = 0;
348
348
  for (let n = 0; n < e.length; n++) {
349
349
  let r = e.charCodeAt(n);
@@ -351,19 +351,19 @@ function lt(e) {
351
351
  }
352
352
  return Math.abs(t);
353
353
  }
354
- function ut(e) {
355
- return ct[lt(e) % ct.length];
354
+ function pt(e) {
355
+ return dt[ft(e) % dt.length];
356
356
  }
357
- function dt(e) {
358
- return ut(e).emoji;
357
+ function mt(e) {
358
+ return pt(e).emoji;
359
359
  }
360
- function ft(e) {
361
- return ut(e).bgColor;
360
+ function ht(e) {
361
+ return pt(e).bgColor;
362
362
  }
363
363
  //#endregion
364
364
  //#region src/components/Avatar/index.tsx
365
- var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape: a = "squircle", dmAgentEnabled: o = !1 }) => {
366
- let s = dt(e), c = ft(e), l = n < 32 ? Math.round(n * .45) : n < 56 ? 14 : n < 120 ? 18 : 36, u = n >= 40 ? 2 : 1, d = a === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ W("div", {
365
+ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape: a = "squircle", dmAgentEnabled: o = !1 }) => {
366
+ let s = mt(e), c = ht(e), l = n < 32 ? Math.round(n * .45) : n < 56 ? 14 : n < 120 ? 18 : 36, u = n >= 40 ? 2 : 1, d = a === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ W("div", {
367
367
  className: "h-full w-full overflow-hidden",
368
368
  style: d,
369
369
  children: t ? /* @__PURE__ */ W("img", {
@@ -372,7 +372,7 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
372
372
  className: "h-full w-full object-cover"
373
373
  }) : /* @__PURE__ */ W("div", {
374
374
  "aria-hidden": "true",
375
- className: J("avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"),
375
+ className: Y("avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"),
376
376
  style: {
377
377
  fontSize: l,
378
378
  lineHeight: 1
@@ -381,7 +381,7 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
381
381
  })
382
382
  });
383
383
  return /* @__PURE__ */ G("div", {
384
- className: J("relative flex-shrink-0", r),
384
+ className: Y("relative flex-shrink-0", r),
385
385
  style: {
386
386
  "--str-chat__avatar-size": `${n}px`,
387
387
  width: `${n}px`,
@@ -392,13 +392,13 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
392
392
  children: [i && /* @__PURE__ */ W("div", {
393
393
  "aria-hidden": "true",
394
394
  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)]",
395
- children: /* @__PURE__ */ W(Be, {
395
+ children: /* @__PURE__ */ W(Ue, {
396
396
  className: "size-3 text-yellow-600",
397
397
  weight: "duotone"
398
398
  })
399
399
  }), /* @__PURE__ */ W("div", {
400
400
  "data-testid": "avatar-ring",
401
- className: J("h-full w-full", "bg-transparent"),
401
+ className: Y("h-full w-full", "bg-transparent"),
402
402
  style: {
403
403
  ...d,
404
404
  ...o && {
@@ -411,10 +411,10 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
411
411
  children: f
412
412
  })]
413
413
  });
414
- }, mt = "https://linktr.ee/s/about/trust-center/report", ht = ({ channel: e, participant: t, showBlockParticipant: n = !0, enabled: r = !0, onLeaveConversation: i, onBlockParticipant: a, onDeleteConversationClick: o, onBlockParticipantClick: s, onReportParticipantClick: c, onActionComplete: u, logLabel: d = "useChannelModerationActions" }) => {
415
- let { service: f, debug: m } = $e(), h = t?.user?.id, g = !!(r && n && f && h), [_, v] = p(!1), [y, b] = p(null), [x, S] = p(!1), [C, w] = p(!1), T = g && (y?.participantId !== h || y?.service !== f);
416
- return l(() => {
417
- if (!g || !f || !h) {
414
+ }, _t = "https://linktr.ee/s/about/trust-center/report", vt = ({ channel: e, participant: t, showBlockParticipant: n = !0, enabled: r = !0, onLeaveConversation: i, onBlockParticipant: a, onDeleteConversationClick: o, onBlockParticipantClick: s, onReportParticipantClick: c, onActionComplete: l, logLabel: u = "useChannelModerationActions" }) => {
415
+ let { service: f, debug: p } = nt(), m = t?.user?.id, g = !!(r && n && f && m), [_, v] = h(!1), [y, b] = h(null), [x, S] = h(!1), [C, w] = h(!1), T = g && (y?.participantId !== m || y?.service !== f);
416
+ return d(() => {
417
+ if (!g || !f || !m) {
418
418
  v(!1), b(null);
419
419
  return;
420
420
  }
@@ -423,12 +423,12 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
423
423
  try {
424
424
  let t = await f.getBlockedUsers();
425
425
  if (e) return;
426
- v(t.some((e) => e.blocked_user_id === h));
426
+ v(t.some((e) => e.blocked_user_id === m));
427
427
  } catch (t) {
428
- e || console.error(`[${d}] Failed to check blocked status:`, t);
428
+ e || console.error(`[${u}] Failed to check blocked status:`, t);
429
429
  } finally {
430
430
  e || b({
431
- participantId: h,
431
+ participantId: m,
432
432
  service: f
433
433
  });
434
434
  }
@@ -438,8 +438,8 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
438
438
  }, [
439
439
  g,
440
440
  f,
441
- h,
442
- d
441
+ m,
442
+ u
443
443
  ]), {
444
444
  isParticipantBlocked: _,
445
445
  isCheckingBlockedStatus: T,
@@ -447,12 +447,12 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
447
447
  isUpdatingBlockStatus: C,
448
448
  handleLeaveConversation: async () => {
449
449
  if (!x) {
450
- o?.(), m && console.log(`[${d}] Leave conversation`, e.cid), S(!0);
450
+ o?.(), p && console.log(`[${u}] Leave conversation`, e.cid), S(!0);
451
451
  try {
452
452
  let t = e._client?.userID ?? null;
453
- await e.hide(t, !1), i && await i(e), u?.();
453
+ await e.hide(t, !1), i && await i(e), l?.();
454
454
  } catch (e) {
455
- console.error(`[${d}] Failed to leave conversation`, e);
455
+ console.error(`[${u}] Failed to leave conversation`, e);
456
456
  } finally {
457
457
  S(!1);
458
458
  }
@@ -460,11 +460,11 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
460
460
  },
461
461
  handleBlockUser: async () => {
462
462
  if (!(C || !f)) {
463
- s?.(), m && console.log(`[${d}] Block member`, t?.user?.id), w(!0);
463
+ s?.(), p && console.log(`[${u}] Block member`, t?.user?.id), w(!0);
464
464
  try {
465
- await f.blockUser(t?.user?.id), a && await a(t?.user?.id), u?.();
465
+ await f.blockUser(t?.user?.id), a && await a(t?.user?.id), l?.();
466
466
  } catch (e) {
467
- console.error(`[${d}] Failed to block member`, e);
467
+ console.error(`[${u}] Failed to block member`, e);
468
468
  } finally {
469
469
  w(!1);
470
470
  }
@@ -472,40 +472,40 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
472
472
  },
473
473
  handleUnblockUser: async () => {
474
474
  if (!(C || !f)) {
475
- s?.(), m && console.log(`[${d}] Unblock member`, t?.user?.id), w(!0);
475
+ s?.(), p && console.log(`[${u}] Unblock member`, t?.user?.id), w(!0);
476
476
  try {
477
- await f.unBlockUser(t?.user?.id), a && await a(t?.user?.id), u?.();
477
+ await f.unBlockUser(t?.user?.id), a && await a(t?.user?.id), l?.();
478
478
  } catch (e) {
479
- console.error(`[${d}] Failed to unblock member`, e);
479
+ console.error(`[${u}] Failed to unblock member`, e);
480
480
  } finally {
481
481
  w(!1);
482
482
  }
483
483
  }
484
484
  },
485
485
  handleReportUser: () => {
486
- c?.(), u?.(), window.open(mt, "_blank", "noopener,noreferrer");
486
+ c?.(), l?.(), window.open(_t, "_blank", "noopener,noreferrer");
487
487
  }
488
488
  };
489
- }, gt = ({ variant: e = "default", className: t, children: n, ...r }) => /* @__PURE__ */ W("button", {
489
+ }, yt = ({ variant: e = "default", className: t, children: n, ...r }) => /* @__PURE__ */ W("button", {
490
490
  type: "button",
491
- className: J("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", e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand", t),
491
+ className: Y("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", e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand", t),
492
492
  ...r,
493
493
  children: n
494
- }), _t = ({ channel: e, participant: t, showDeleteConversation: n = !0, showBlockParticipant: r = !0, showReportParticipant: i = !0, onLeaveConversation: a, onBlockParticipant: o, onDeleteConversationClick: c, onBlockParticipantClick: d, onReportParticipantClick: m, customChannelActions: h, triggerClassName: g }) => {
495
- let [_, v] = p(!1), y = f(null), b = u(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } = ht({
494
+ }), bt = ({ channel: e, participant: t, showDeleteConversation: n = !0, showBlockParticipant: r = !0, showReportParticipant: i = !0, onLeaveConversation: a, onBlockParticipant: o, onDeleteConversationClick: s, onBlockParticipantClick: c, onReportParticipantClick: u, customChannelActions: p, triggerClassName: g }) => {
495
+ let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } = vt({
496
496
  channel: e,
497
497
  participant: t,
498
498
  showBlockParticipant: r,
499
499
  enabled: _,
500
500
  onLeaveConversation: a,
501
501
  onBlockParticipant: o,
502
- onDeleteConversationClick: c,
503
- onBlockParticipantClick: d,
504
- onReportParticipantClick: m,
505
- onActionComplete: s(() => v(!1), []),
502
+ onDeleteConversationClick: s,
503
+ onBlockParticipantClick: c,
504
+ onReportParticipantClick: u,
505
+ onActionComplete: l(() => v(!1), []),
506
506
  logLabel: "ChannelActionsMenu"
507
507
  });
508
- return l(() => {
508
+ return d(() => {
509
509
  if (!_) return;
510
510
  let e = (e) => {
511
511
  y.current && !y.current.contains(e.target) && v(!1);
@@ -515,7 +515,7 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
515
515
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
516
516
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
517
517
  };
518
- }, [_]), !t || !(n || r || i || h) ? null : /* @__PURE__ */ G("div", {
518
+ }, [_]), !t || !(n || r || i || p) ? null : /* @__PURE__ */ G("div", {
519
519
  ref: y,
520
520
  className: "relative",
521
521
  children: [/* @__PURE__ */ G("button", {
@@ -525,60 +525,60 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
525
525
  "aria-expanded": _,
526
526
  "aria-controls": _ ? b : void 0,
527
527
  onClick: () => v((e) => !e),
528
- children: [/* @__PURE__ */ W(Ae, { className: "size-5 text-black/90" }), /* @__PURE__ */ W("span", {
528
+ children: [/* @__PURE__ */ W(Z, { className: "size-5 text-black/90" }), /* @__PURE__ */ W("span", {
529
529
  className: "sr-only",
530
530
  children: "More options"
531
531
  })]
532
532
  }), _ && /* @__PURE__ */ W("div", {
533
533
  id: b,
534
534
  "aria-label": "Conversation options",
535
- className: J("absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden", "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"),
535
+ className: Y("absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden", "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"),
536
536
  children: /* @__PURE__ */ G("ul", {
537
537
  className: "flex flex-col gap-1",
538
538
  children: [
539
- n && /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G(gt, {
539
+ n && /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G(yt, {
540
540
  onClick: T,
541
541
  disabled: C,
542
542
  "aria-busy": C,
543
- children: [C ? /* @__PURE__ */ W(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(Le, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Delete Conversation" })]
543
+ children: [C ? /* @__PURE__ */ W(He, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(Be, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Delete Conversation" })]
544
544
  }) }),
545
- r && /* @__PURE__ */ W("li", { children: S ? /* @__PURE__ */ G(gt, {
545
+ r && /* @__PURE__ */ W("li", { children: S ? /* @__PURE__ */ G(yt, {
546
546
  disabled: !0,
547
547
  "aria-busy": !0,
548
- children: [/* @__PURE__ */ W(ze, { className: "h-5 w-5 animate-spin" }), /* @__PURE__ */ W("span", { children: "Block" })]
549
- }) : x ? /* @__PURE__ */ G(gt, {
548
+ children: [/* @__PURE__ */ W(He, { className: "h-5 w-5 animate-spin" }), /* @__PURE__ */ W("span", { children: "Block" })]
549
+ }) : x ? /* @__PURE__ */ G(yt, {
550
550
  onClick: D,
551
551
  disabled: w,
552
552
  "aria-busy": w,
553
- children: [w ? /* @__PURE__ */ W(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(Ie, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Unblock" })]
554
- }) : /* @__PURE__ */ G(gt, {
553
+ children: [w ? /* @__PURE__ */ W(He, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(ze, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Unblock" })]
554
+ }) : /* @__PURE__ */ G(yt, {
555
555
  onClick: E,
556
556
  disabled: w,
557
557
  "aria-busy": w,
558
- children: [w ? /* @__PURE__ */ W(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(Ie, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Block" })]
558
+ children: [w ? /* @__PURE__ */ W(He, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(ze, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Block" })]
559
559
  }) }),
560
- i && /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G(gt, {
560
+ i && /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G(yt, {
561
561
  variant: "danger",
562
562
  onClick: O,
563
- children: [/* @__PURE__ */ W(X, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Report" })]
563
+ children: [/* @__PURE__ */ W(Ne, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Report" })]
564
564
  }) }),
565
- h
565
+ p
566
566
  ]
567
567
  })
568
568
  })]
569
569
  });
570
- }, vt = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", yt = "CUSTOMER_PAID", bt = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === yt, xt = ({ className: e, onBack: t, showBackButton: n, showStarButton: r = !1, onLeaveConversation: a, onBlockParticipant: o, showDeleteConversation: s = !0, showBlockParticipant: c = !0, showReportParticipant: l = !0, onDeleteConversationClick: u, onBlockParticipantClick: d, onReportParticipantClick: f, customChannelActions: p, renderChannelActions: m, showChannelInfo: h = !0, onParticipantNameClick: g }) => {
571
- let { channel: _ } = ue(), { client: v } = de(), y = i.useMemo(() => rt(_.state?.members, v?.userID, _.type), [
570
+ }, xt = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", St = "CUSTOMER_PAID", Ct = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === St, wt = ({ className: e, onBack: t, showBackButton: n, showStarButton: r = !1, onLeaveConversation: i, onBlockParticipant: a, showDeleteConversation: s = !0, showBlockParticipant: c = !0, showReportParticipant: l = !0, onDeleteConversationClick: u, onBlockParticipantClick: d, onReportParticipantClick: f, customChannelActions: p, renderChannelActions: m, showChannelInfo: h = !0, onParticipantNameClick: g }) => {
571
+ let { channel: _ } = V(), { client: v } = me(), y = o.useMemo(() => ot(_.state?.members, v?.userID, _.type), [
572
572
  _.state?.members,
573
573
  v?.userID,
574
574
  _.type
575
- ]), b = st(y?.user), x = y?.user?.image, S = nt(_), C = bt(_.data?.customer_tag) && y?.is_follower === !0, w = r && S, T = C || w || !!g, E = async () => {
575
+ ]), b = ut(y?.user), x = y?.user?.image, S = at(_), C = Ct(_.data?.customer_tag) && y?.is_follower === !0, w = r && S, T = C || w || !!g, E = async () => {
576
576
  try {
577
577
  S ? await _.unpin() : await _.pin();
578
578
  } catch (e) {
579
579
  console.error("[ChannelHeaderRedesign] Failed to update pinned status:", e);
580
580
  }
581
- }, D = /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(pt, {
581
+ }, D = /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(gt, {
582
582
  id: y?.user?.id || _.id || "unknown",
583
583
  name: b,
584
584
  image: x,
@@ -586,7 +586,7 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
586
586
  size: 48,
587
587
  className: "-mb-2"
588
588
  }), /* @__PURE__ */ W("span", {
589
- className: J("relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-filter duration-150 group-hover:brightness-95", T ? "pl-3 pr-2" : "px-3"),
589
+ className: Y("relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-filter duration-150 group-hover:brightness-95", T ? "pl-3 pr-2" : "px-3"),
590
590
  children: /* @__PURE__ */ G("span", {
591
591
  className: "flex max-w-full items-center justify-center",
592
592
  children: [/* @__PURE__ */ W("span", {
@@ -598,7 +598,7 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
598
598
  C && /* @__PURE__ */ W("span", {
599
599
  "aria-label": "Paid customer",
600
600
  className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
601
- children: /* @__PURE__ */ W(ke, {
601
+ children: /* @__PURE__ */ W(X, {
602
602
  className: "size-2.5",
603
603
  weight: "bold"
604
604
  })
@@ -608,13 +608,13 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
608
608
  children: /* @__PURE__ */ W("span", {
609
609
  "aria-label": "Starred conversation",
610
610
  className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
611
- children: /* @__PURE__ */ W(Be, {
611
+ children: /* @__PURE__ */ W(Ue, {
612
612
  className: "size-2.5",
613
613
  weight: "fill"
614
614
  })
615
615
  })
616
616
  }),
617
- g && /* @__PURE__ */ W(Ee, {
617
+ g && /* @__PURE__ */ W(ke, {
618
618
  "aria-hidden": "true",
619
619
  className: "size-4 shrink-0 text-black/65",
620
620
  weight: "bold"
@@ -624,18 +624,18 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
624
624
  })
625
625
  })] });
626
626
  return /* @__PURE__ */ W("div", {
627
- className: J("@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]", e),
627
+ className: Y("@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]", e),
628
628
  children: /* @__PURE__ */ G("div", {
629
629
  className: "grid min-h-[100px] grid-cols-[minmax(40px,1fr)_auto_minmax(40px,1fr)] items-start pb-2 pt-5 @lg:min-h-[104px] @lg:pt-6",
630
630
  children: [
631
631
  /* @__PURE__ */ W("div", {
632
632
  className: "flex items-start",
633
633
  children: n && /* @__PURE__ */ W("button", {
634
- className: J(vt, "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"),
634
+ className: Y(xt, "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"),
635
635
  onClick: t || (() => {}),
636
636
  type: "button",
637
637
  "aria-label": "Back to conversations",
638
- children: /* @__PURE__ */ W(we, { className: "size-5 text-black/90" })
638
+ children: /* @__PURE__ */ W(Ee, { className: "size-5 text-black/90" })
639
639
  })
640
640
  }),
641
641
  /* @__PURE__ */ W("div", {
@@ -655,69 +655,69 @@ var pt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
655
655
  /* @__PURE__ */ G("div", {
656
656
  className: "flex items-start justify-end gap-2",
657
657
  children: [r && /* @__PURE__ */ W("button", {
658
- className: vt,
658
+ className: xt,
659
659
  onClick: E,
660
660
  type: "button",
661
661
  "aria-pressed": S,
662
662
  "aria-label": S ? "Unstar conversation" : "Star conversation",
663
- children: /* @__PURE__ */ W(Be, {
664
- className: J("size-5", {
663
+ children: /* @__PURE__ */ W(Ue, {
664
+ className: Y("size-5", {
665
665
  "text-[#FFD60A]": S,
666
666
  "text-black/90": !S
667
667
  }),
668
668
  weight: S ? "fill" : "regular"
669
669
  })
670
- }), h && (m === void 0 ? /* @__PURE__ */ W(_t, {
670
+ }), h && (m === void 0 ? /* @__PURE__ */ W(bt, {
671
671
  channel: _,
672
672
  participant: y,
673
673
  showDeleteConversation: s,
674
674
  showBlockParticipant: c,
675
675
  showReportParticipant: l,
676
- onLeaveConversation: a,
677
- onBlockParticipant: o,
676
+ onLeaveConversation: i,
677
+ onBlockParticipant: a,
678
678
  onDeleteConversationClick: u,
679
679
  onBlockParticipantClick: d,
680
680
  onReportParticipantClick: f,
681
681
  customChannelActions: p,
682
- triggerClassName: vt
682
+ triggerClassName: xt
683
683
  }) : m)]
684
684
  })
685
685
  ]
686
686
  })
687
687
  });
688
- }, St = (e) => /* @__PURE__ */ W(C, {
688
+ }, Tt = (e) => /* @__PURE__ */ W(T, {
689
689
  ...e,
690
690
  position: "center"
691
691
  });
692
692
  //#endregion
693
693
  //#region src/utils/getMessageDisplayText.ts
694
- function Ct(e) {
694
+ function Et(e) {
695
695
  return e?.trim().toLowerCase().split(/[-_]/)[0] || void 0;
696
696
  }
697
- function wt({ message: e, viewerLanguage: t }) {
698
- let n = e?.text, r = Ct(t);
697
+ function Dt({ message: e, viewerLanguage: t }) {
698
+ let n = e?.text, r = Et(t);
699
699
  return r ? e?.i18n?.[`${r}_text`] ?? n : n;
700
700
  }
701
701
  //#endregion
702
702
  //#region src/components/MediaMessage/index.tsx
703
- function Tt(e) {
703
+ function Ot(e) {
704
704
  return e.type === "link" || !!e.og_scrape_url?.trim() && !e.asset_url;
705
705
  }
706
706
  //#endregion
707
707
  //#region src/components/CustomMessage/context.tsx
708
- var Et = { LockedAttachment: { isUnlocking: () => !1 } }, Dt = o({}), Ot = Dt.Provider;
709
- function kt(e) {
710
- return c(Dt)[e] ?? Et[e];
708
+ var kt = { LockedAttachment: { isUnlocking: () => !1 } }, At = c({}), jt = At.Provider;
709
+ function Mt(e) {
710
+ return u(At)[e] ?? kt[e];
711
711
  }
712
712
  //#endregion
713
713
  //#region src/components/CustomMessage/LockedAttachment/index.tsx
714
- var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import("./Card-D__kW2E_.js")), Mt = () => /* @__PURE__ */ W("div", {
714
+ var Nt = o.lazy(() => import("./Card-C7uLQbYz.js")), Pt = o.lazy(() => import("./Card-f51K6V7Y.js")), Ft = () => /* @__PURE__ */ W("div", {
715
715
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
716
716
  "aria-hidden": !0
717
- }), Nt = (e) => /* @__PURE__ */ W(a, {
718
- fallback: /* @__PURE__ */ W(Mt, {}),
719
- children: e.contentType === "text" ? /* @__PURE__ */ W(At, { ...e }) : /* @__PURE__ */ W(jt, { ...e })
720
- }), Pt = ({ size: e = 15 }) => /* @__PURE__ */ W("svg", {
717
+ }), It = (e) => /* @__PURE__ */ W(s, {
718
+ fallback: /* @__PURE__ */ W(Ft, {}),
719
+ children: e.contentType === "text" ? /* @__PURE__ */ W(Nt, { ...e }) : /* @__PURE__ */ W(Pt, { ...e })
720
+ }), Lt = ({ size: e = 15 }) => /* @__PURE__ */ W("svg", {
721
721
  width: e,
722
722
  height: e,
723
723
  viewBox: "0 0 15 15",
@@ -728,14 +728,14 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
728
728
  fill: "currentColor",
729
729
  fillOpacity: .55
730
730
  })
731
- }), Ft = (e) => e.metadata?.custom_type === K.PAID, It = (e) => e.metadata?.custom_type === K.CHATBOT, Lt = (e) => e.metadata?.custom_type === K.ATTACHMENT, Rt = (e) => Lt(e) && e.metadata?.attachment_content_type === "text", zt = (e) => Lt(e) && e.metadata?.attachment_content_type !== "text", Bt = (e) => Ft(e) && !!e.metadata?.amount_text, Vt = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
732
- let r = Ft(e), i = It(e);
731
+ }), Rt = (e) => e.metadata?.custom_type === K.PAID, zt = (e) => e.metadata?.custom_type === K.CHATBOT, Bt = (e) => e.metadata?.custom_type === K.ATTACHMENT, Vt = (e) => Bt(e) && e.metadata?.attachment_content_type === "text", Ht = (e) => Bt(e) && e.metadata?.attachment_content_type !== "text", Ut = (e) => Rt(e) && !!e.metadata?.amount_text, Wt = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
732
+ let r = Rt(e), i = zt(e);
733
733
  if (!r && !i) return null;
734
734
  if (r) {
735
735
  let t = e.metadata?.amount_text;
736
736
  return t ? /* @__PURE__ */ G("div", {
737
737
  className: "message-tag--paid inline-flex items-center gap-1 text-[12px] font-medium leading-[2] text-[#016630]",
738
- children: [/* @__PURE__ */ W(Z, { size: 12 }), /* @__PURE__ */ G("span", { children: [
738
+ children: [/* @__PURE__ */ W(Pe, { size: 12 }), /* @__PURE__ */ G("span", { children: [
739
739
  "Delivered with ",
740
740
  t,
741
741
  " message"
@@ -747,17 +747,17 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
747
747
  children: o
748
748
  }), l = /* @__PURE__ */ W("span", {
749
749
  className: "inline-flex items-center leading-none",
750
- children: /* @__PURE__ */ W(Pt, { size: a ? 12 : 15 })
750
+ children: /* @__PURE__ */ W(Lt, { size: a ? 12 : 15 })
751
751
  });
752
752
  return /* @__PURE__ */ W("div", {
753
753
  className: `inline-flex items-center text-[10px] font-normal leading-4 tracking-[0.2px] ${s}`,
754
754
  "data-testid": "message-chatbot-indicator",
755
755
  children: t && !a ? /* @__PURE__ */ G(U, { children: [c, l] }) : /* @__PURE__ */ G(U, { children: [l, c] })
756
756
  });
757
- }, Ht = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", Ut = {
757
+ }, Gt = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", Kt = {
758
758
  me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
759
759
  other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
760
- }, Wt = ({ side: e }) => /* @__PURE__ */ W("span", {
760
+ }, qt = ({ side: e }) => /* @__PURE__ */ W("span", {
761
761
  "aria-hidden": "true",
762
762
  className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
763
763
  style: {
@@ -765,18 +765,18 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
765
765
  insetInlineStart: e === "other" ? "calc(-1 * 0.3125rem)" : void 0,
766
766
  transform: e === "other" ? "scaleX(-1)" : void 0,
767
767
  transformOrigin: "center",
768
- backgroundColor: Ut[e],
769
- WebkitMask: Ht,
770
- mask: Ht
768
+ backgroundColor: Kt[e],
769
+ WebkitMask: Gt,
770
+ mask: Gt
771
771
  }
772
- }), Gt = o(void 0), Kt = (e) => {
772
+ }), Jt = c(void 0), Yt = (e) => {
773
773
  let t = e.metadata?.outbound_id;
774
774
  return typeof t == "string" ? t : void 0;
775
- }, qt = (e, t) => {
775
+ }, Xt = (e, t) => {
776
776
  if (!t || !e?.length) return;
777
777
  let n = /* @__PURE__ */ new Set(), r;
778
778
  for (let i of e) {
779
- let e = Kt(i);
779
+ let e = Yt(i);
780
780
  if (!e || n.has(e)) continue;
781
781
  n.add(e);
782
782
  let a = t(e);
@@ -786,15 +786,15 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
786
786
  });
787
787
  }
788
788
  return r;
789
- }, Jt = (e, t) => {
789
+ }, Zt = (e, t) => {
790
790
  if (e === t) return !0;
791
791
  if (!e || !t) return !1;
792
792
  let n = Object.keys(e), r = Object.keys(t);
793
793
  return n.length === r.length && n.every((n) => e[n].id === t[n]?.id && e[n].name === t[n]?.name);
794
- }, Yt = (e, t) => {
795
- let n = qt(e, t), [r, i] = p(n);
796
- return Jt(r, n) ? r : (i(n), n);
797
- }, Xt = (e) => e.metadata?.custom_type === K.TIP, Zt = ({ message: e }) => {
794
+ }, Qt = (e, t) => {
795
+ let n = Xt(e, t), [r, i] = h(n);
796
+ return Zt(r, n) ? r : (i(n), n);
797
+ }, $t = (e) => e.metadata?.custom_type === K.TIP, en = ({ message: e }) => {
798
798
  let t = e.metadata?.amount_text;
799
799
  return t ? /* @__PURE__ */ G("div", {
800
800
  className: "message-tip-pill inline-flex items-end gap-0.5 max-w-[520px] rounded-[1.5rem] bg-[#43e660] px-4 py-3 text-white",
@@ -807,34 +807,34 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
807
807
  children: [t, " tip!"]
808
808
  })]
809
809
  }) : null;
810
- }, Qt = () => {
811
- let { message: e } = H("SentMessageDeliveryStatus"), { messages: t } = ue("SentMessageDeliveryStatus"), n = (() => {
810
+ }, tn = () => {
811
+ let { message: e } = H("SentMessageDeliveryStatus"), { messages: t } = V("SentMessageDeliveryStatus"), n = (() => {
812
812
  if (t) for (let e = t.length - 1; e >= 0; --e) {
813
813
  let n = t[e];
814
814
  if (n.type !== "system" && n.type !== "ephemeral" && n.type !== "deleted") return n.id;
815
815
  }
816
816
  })();
817
817
  return e.id === n;
818
- }, $t = () => Qt() ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(De, {
818
+ }, nn = () => tn() ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(Ae, {
819
819
  weight: "bold",
820
820
  "aria-hidden": "true"
821
821
  }), /* @__PURE__ */ W("span", {
822
822
  "data-testid": "sent-message-delivery-status",
823
823
  children: "Delivered"
824
- })] }) : null, en = () => Qt() ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(Oe, {
824
+ })] }) : null, rn = () => tn() ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(je, {
825
825
  className: "sent-message-status__spinner animate-spin",
826
826
  weight: "bold",
827
827
  "aria-hidden": "true"
828
828
  }), /* @__PURE__ */ W("span", {
829
829
  "data-testid": "sent-message-sending-status",
830
830
  children: "Sending"
831
- })] }) : null, tn = ({ outbound: e, onOutboundClick: t }) => {
831
+ })] }) : null, an = ({ outbound: e, onOutboundClick: t }) => {
832
832
  let n = e.name || "Broadcast", r = /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
833
833
  className: "sent-message-outbound-badge",
834
834
  "aria-hidden": "true",
835
- children: /* @__PURE__ */ W(Me, { weight: "fill" })
835
+ children: /* @__PURE__ */ W(Fe, { weight: "fill" })
836
836
  }), /* @__PURE__ */ W("span", {
837
- className: J("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
837
+ className: Y("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
838
838
  "data-testid": "sent-message-outbound-status",
839
839
  children: n
840
840
  })] });
@@ -845,28 +845,28 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
845
845
  onClick: () => t(e),
846
846
  children: r
847
847
  }) : r;
848
- }, nn = () => /* @__PURE__ */ G("span", {
848
+ }, on = () => /* @__PURE__ */ G("span", {
849
849
  className: "str-chat__message-status sent-message-status--failed",
850
- children: [/* @__PURE__ */ W(Ue, {
850
+ children: [/* @__PURE__ */ W(Ke, {
851
851
  weight: "bold",
852
852
  "aria-hidden": "true"
853
853
  }), /* @__PURE__ */ W("span", {
854
854
  "data-testid": "sent-message-failed-status",
855
855
  children: "Failed to send"
856
856
  })]
857
- }), rn = ({ onOutboundClick: e, resolvedOutbound: t }) => {
858
- let { isMyMessage: n, message: r, threadList: i } = H("SentMessageDeliveryStatus"), a = n(), o = Qt();
857
+ }), sn = ({ onOutboundClick: e, resolvedOutbound: t }) => {
858
+ let { isMyMessage: n, message: r, threadList: i } = H("SentMessageDeliveryStatus"), a = n(), o = tn();
859
859
  if (i) return null;
860
- if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ W(nn, {});
860
+ if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ W(on, {});
861
861
  if (!a) return null;
862
- let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ W(tn, {
862
+ let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ W(an, {
863
863
  outbound: t,
864
864
  onOutboundClick: e
865
- }) : null, l = Bt(r) ? null : /* @__PURE__ */ W(F, {
866
- MessageSentStatus: $t,
867
- MessageDeliveredStatus: $t,
868
- MessageReadStatus: $t,
869
- MessageSendingStatus: Xt(r) ? $t : en
865
+ }) : null, l = Ut(r) ? null : /* @__PURE__ */ W(L, {
866
+ MessageSentStatus: nn,
867
+ MessageDeliveredStatus: nn,
868
+ MessageReadStatus: nn,
869
+ MessageSendingStatus: $t(r) ? nn : rn
870
870
  });
871
871
  return c ? /* @__PURE__ */ G("span", {
872
872
  className: "sent-message-status-row",
@@ -880,27 +880,27 @@ var At = i.lazy(() => import("./Card-C7uLQbYz.js")), jt = i.lazy(() => import(".
880
880
  c
881
881
  ]
882
882
  }) : l;
883
- }, an = /^([a-z][a-z0-9+.-]*):/i, on = /* @__PURE__ */ new Set([
883
+ }, cn = /^([a-z][a-z0-9+.-]*):/i, ln = /* @__PURE__ */ new Set([
884
884
  "http",
885
885
  "https",
886
886
  "mailto",
887
887
  "tel",
888
888
  "sms"
889
889
  ]);
890
- function sn(e) {
890
+ function un(e) {
891
891
  if (typeof e != "string") return;
892
892
  let t = e.trim();
893
893
  if (t === "") return;
894
- let n = an.exec(t);
894
+ let n = cn.exec(t);
895
895
  if (n) {
896
896
  let e = n[1].toLowerCase();
897
- return on.has(e) ? t : void 0;
897
+ return ln.has(e) ? t : void 0;
898
898
  }
899
899
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
900
900
  }
901
901
  //#endregion
902
902
  //#region src/components/LinkAttachment/components/_shared/CardCta.tsx
903
- var cn = {
903
+ var dn = {
904
904
  dark: {
905
905
  primary: "bg-white text-[#121110] hover:bg-white/90",
906
906
  secondary: "bg-white/15 text-white hover:bg-white/25"
@@ -909,11 +909,11 @@ var cn = {
909
909
  primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
910
910
  secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
911
911
  }
912
- }, ln = ({ variant: e, cta: t, fullWidth: n = !0, standalone: r = !1 }) => {
913
- let i = t.variant ?? "primary", a = J("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2", cn[e][i]), o = n ? t.label : /* @__PURE__ */ W("span", {
912
+ }, fn = ({ variant: e, cta: t, fullWidth: n = !0, standalone: r = !1 }) => {
913
+ let i = t.variant ?? "primary", a = Y("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2", dn[e][i]), o = n ? t.label : /* @__PURE__ */ W("span", {
914
914
  className: "min-w-0 truncate",
915
915
  children: t.label
916
- }), s = sn(t.href);
916
+ }), s = un(t.href);
917
917
  return s ? /* @__PURE__ */ W("a", {
918
918
  href: s,
919
919
  target: "_blank",
@@ -931,30 +931,30 @@ var cn = {
931
931
  className: a,
932
932
  children: o
933
933
  });
934
- }, un = {
934
+ }, pn = {
935
935
  dark: "text-white",
936
936
  light: "text-black/90"
937
- }, dn = "text-white/30", fn = {
937
+ }, mn = "text-white/30", hn = {
938
938
  dark: "text-white/55",
939
939
  light: "text-black/55"
940
- }, pn = {
940
+ }, gn = {
941
941
  dark: "bg-white/25",
942
942
  light: "bg-black/15"
943
- }, mn = ({ variant: e, ctaSurface: t, chinTextColor: n, title: r, placeholderTitle: i, description: a, descriptionLines: o = 1, url: s, appIcon: c, cta: l, trailingAction: u, isLoading: d = !1 }) => {
943
+ }, _n = ({ variant: e, ctaSurface: t, chinTextColor: n, title: r, placeholderTitle: i, description: a, descriptionLines: o = 1, url: s, appIcon: c, cta: l, trailingAction: u, isLoading: d = !1 }) => {
944
944
  let f = e === "dark", p = r ?? (f ? i : void 0) ?? "", m = p.trim() !== "", h = a != null && a.trim() !== "", g = typeof s == "string" ? s.trim() : "", _ = g !== "", v = l != null;
945
945
  if (!d && !m && !h && !_ && !v) return null;
946
- let y = J("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ? dn : un[e])), b = J("truncate text-[12px] leading-4 tracking-[0.24px]", n == null && fn[e]), x = J("text-[12px] leading-4 tracking-[0.24px]", o <= 1 && "truncate", n == null && fn[e]);
946
+ let y = Y("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ? mn : pn[e])), b = Y("truncate text-[12px] leading-4 tracking-[0.24px]", n == null && hn[e]), x = Y("text-[12px] leading-4 tracking-[0.24px]", o <= 1 && "truncate", n == null && hn[e]);
947
947
  if (d) {
948
- let t = J("animate-pulse rounded", pn[e]);
948
+ let t = Y("animate-pulse rounded", gn[e]);
949
949
  return /* @__PURE__ */ W("div", {
950
950
  className: "shrink-0 px-4 py-3",
951
951
  children: /* @__PURE__ */ G("div", {
952
952
  className: "flex min-w-0 flex-col gap-[2px]",
953
953
  children: [/* @__PURE__ */ W("div", {
954
- className: J("h-5 w-3/4", t),
954
+ className: Y("h-5 w-3/4", t),
955
955
  "aria-hidden": !0
956
956
  }), /* @__PURE__ */ W("div", {
957
- className: J("h-4 w-1/2", t),
957
+ className: Y("h-4 w-1/2", t),
958
958
  "aria-hidden": !0
959
959
  })]
960
960
  })
@@ -980,7 +980,7 @@ var cn = {
980
980
  className: "shrink-0",
981
981
  children: c
982
982
  }) : null, /* @__PURE__ */ W("p", {
983
- className: J("min-w-0", y),
983
+ className: Y("min-w-0", y),
984
984
  style: S,
985
985
  children: p
986
986
  })]
@@ -1001,16 +1001,16 @@ var cn = {
1001
1001
  className: "shrink-0",
1002
1002
  children: u
1003
1003
  })]
1004
- }), l && /* @__PURE__ */ W(ln, {
1004
+ }), l && /* @__PURE__ */ W(fn, {
1005
1005
  variant: t ?? e,
1006
1006
  cta: l
1007
1007
  })]
1008
1008
  });
1009
- }, hn = "Loading link preview", gn = J("relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden", "rounded-[20px]"), _n = "flex h-[250px] flex-col", vn = ({ variant: e, children: t, href: n, onClick: r, ariaLabel: i, rootRef: a, topRight: o, bgClassName: s, accentHex: c, fixedHeight: l = !1, busy: u = !1, "data-testid": d }) => {
1010
- let f = J("messaging-link-card", gn, l ? _n : "block", s ?? (e === "dark" ? "bg-[#1e2330]" : "bg-[#f1f0ee]"), n != null || r != null ? "cursor-pointer no-underline focus-ring" : null), p = u ? {
1009
+ }, vn = "Loading link preview", yn = Y("relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden", "rounded-[20px]"), bn = "flex h-[250px] flex-col", xn = ({ variant: e, children: t, href: n, onClick: r, ariaLabel: i, rootRef: a, topRight: o, bgClassName: s, accentHex: c, fixedHeight: l = !1, busy: u = !1, "data-testid": d }) => {
1010
+ let f = Y("messaging-link-card", yn, l ? bn : "block", s ?? (e === "dark" ? "bg-[#1e2330]" : "bg-[#f1f0ee]"), n != null || r != null ? "cursor-pointer no-underline focus-ring" : null), p = u ? {
1011
1011
  role: "status",
1012
1012
  "aria-busy": !0,
1013
- "aria-label": hn
1013
+ "aria-label": vn
1014
1014
  } : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */ W("div", {
1015
1015
  className: "pointer-events-auto absolute right-3 top-3 z-10",
1016
1016
  children: o
@@ -1034,7 +1034,7 @@ var cn = {
1034
1034
  "aria-label": i,
1035
1035
  "data-testid": d,
1036
1036
  "data-variant": e,
1037
- className: J(f, "text-left"),
1037
+ className: Y(f, "text-left"),
1038
1038
  style: m,
1039
1039
  ...p,
1040
1040
  children: [t, h]
@@ -1047,93 +1047,94 @@ var cn = {
1047
1047
  ...p,
1048
1048
  children: [t, h]
1049
1049
  });
1050
- }, yn = {
1050
+ }, Sn = {
1051
1051
  dark: "bg-white/10",
1052
1052
  light: "bg-black/5"
1053
- }, bn = {
1053
+ }, Cn = {
1054
1054
  dark: "size-16 text-white/25",
1055
1055
  light: "size-16 text-black/25"
1056
- }, xn = (e, n) => !!n && !!e && t(e) === "audio", Sn = (e, n) => {
1056
+ }, wn = (e, n) => !!n && !!e && t(e) === "audio", Tn = (e, n) => {
1057
1057
  if (!n || !e) return !1;
1058
1058
  let r = t(e);
1059
1059
  return r === "video" || r === "audio";
1060
- }, Cn = "bg-[#F2F3F4]", wn = ({ variant: r, thumbnailUrl: i, sourceUrl: a, title: o, mimeType: s = "image/*", topLeft: c, topRight: l, isLoading: u = !1, onImageError: d }) => {
1061
- let f = t(s), p = !!a && f === "video", m = e(i);
1062
- return !u && xn(s, a) ? /* @__PURE__ */ W("div", {
1060
+ }, En = "bg-[#F2F3F4]", Dn = ({ variant: r, thumbnailUrl: i, sourceUrl: o, title: s, mimeType: c = "image/*", topLeft: l, topRight: u, isLoading: d = !1, onImageError: f }) => {
1061
+ let p = t(c), m = !!o && p === "video", h = a(i);
1062
+ return !d && wn(c, o) ? /* @__PURE__ */ W("div", {
1063
1063
  className: "p-3",
1064
1064
  children: /* @__PURE__ */ W("audio", {
1065
- src: a,
1065
+ ...e,
1066
+ src: o,
1066
1067
  controls: !0,
1067
1068
  preload: "metadata",
1068
1069
  className: "block w-full",
1069
1070
  children: /* @__PURE__ */ W("track", { kind: "captions" })
1070
1071
  })
1071
1072
  }) : /* @__PURE__ */ G("div", {
1072
- className: J("relative min-h-0 w-full flex-1 overflow-hidden", p && "bg-black"),
1073
+ className: Y("relative min-h-0 w-full flex-1 overflow-hidden", m && "bg-black"),
1073
1074
  children: [
1074
- u ? /* @__PURE__ */ W("div", {
1075
- className: J("h-full w-full animate-pulse", yn[r]),
1075
+ d ? /* @__PURE__ */ W("div", {
1076
+ className: Y("h-full w-full animate-pulse", Sn[r]),
1076
1077
  "aria-hidden": !0
1077
- }) : p ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("video", {
1078
- src: a,
1079
- poster: m,
1078
+ }) : m ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("video", {
1079
+ src: o,
1080
+ poster: h,
1080
1081
  controls: !0,
1081
1082
  playsInline: !0,
1082
1083
  preload: "metadata",
1083
1084
  className: "absolute inset-0 h-full w-full object-contain",
1084
1085
  children: /* @__PURE__ */ W("track", { kind: "captions" })
1085
- }), m && d ? /* @__PURE__ */ W("img", {
1086
- src: m,
1086
+ }), h && f ? /* @__PURE__ */ W("img", {
1087
+ src: h,
1087
1088
  alt: "",
1088
1089
  "aria-hidden": !0,
1089
- onError: d,
1090
+ onError: f,
1090
1091
  className: "hidden"
1091
1092
  }) : null] }) : i ? /* @__PURE__ */ W("img", {
1092
- src: m ?? i,
1093
- alt: o ?? "",
1093
+ src: h ?? i,
1094
+ alt: s ?? "",
1094
1095
  draggable: !1,
1095
1096
  loading: "lazy",
1096
1097
  decoding: "async",
1097
- onError: d,
1098
+ onError: f,
1098
1099
  className: "absolute inset-0 h-full w-full object-cover"
1099
1100
  }) : /* @__PURE__ */ W("div", {
1100
- className: J("flex h-full w-full items-center justify-center", yn[r]),
1101
- children: n(s, {
1102
- className: bn[r],
1101
+ className: Y("flex h-full w-full items-center justify-center", Sn[r]),
1102
+ children: n(c, {
1103
+ className: Cn[r],
1103
1104
  weight: "regular"
1104
1105
  })
1105
1106
  }),
1106
- c ? /* @__PURE__ */ W("div", {
1107
+ l ? /* @__PURE__ */ W("div", {
1107
1108
  className: "pointer-events-auto absolute left-3 top-3 z-10",
1108
- children: c
1109
+ children: l
1109
1110
  }) : null,
1110
- l ? /* @__PURE__ */ W("div", {
1111
+ u ? /* @__PURE__ */ W("div", {
1111
1112
  className: "pointer-events-auto absolute right-3 top-3 z-10",
1112
- children: l
1113
+ children: u
1113
1114
  }) : null
1114
1115
  ]
1115
1116
  });
1116
- }, Tn = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
1117
- function En(e) {
1117
+ }, On = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
1118
+ function kn(e) {
1118
1119
  let t = e.trim();
1119
1120
  return t.startsWith("#") ? t : `#${t}`;
1120
1121
  }
1121
1122
  //#endregion
1122
1123
  //#region src/components/LinkAttachment/components/_shared/useChinPalette.ts
1123
- var Dn = "#FFFFFF", On = "#040403", kn = {
1124
- dark: Dn,
1125
- light: On
1124
+ var An = "#FFFFFF", jn = "#040403", Mn = {
1125
+ dark: An,
1126
+ light: jn
1126
1127
  };
1127
- function An({ variant: e, accentColor: t, status: n = "ready", layout: r = "featured", thumbnailUrl: a, mimeType: o, sourceUrl: s }) {
1128
- let [c, l] = i.useState(!1);
1129
- i.useEffect(() => {
1128
+ function Nn({ variant: e, accentColor: t, status: n = "ready", layout: r = "featured", thumbnailUrl: i, mimeType: a, sourceUrl: s }) {
1129
+ let [c, l] = o.useState(!1);
1130
+ o.useEffect(() => {
1130
1131
  l(!1);
1131
- }, [a]);
1132
- let u = i.useCallback(() => {
1132
+ }, [i]);
1133
+ let u = o.useCallback(() => {
1133
1134
  l(!0);
1134
- }, []), d = xn(o, s), f = r === "featured" && a && !d && !c && n === "ready" && t != null && Tn.test(t.trim()) ? En(t) : void 0, p = d ? On : kn[e];
1135
+ }, []), d = wn(a, s), f = r === "featured" && i && !d && !c && n === "ready" && t != null && On.test(t.trim()) ? kn(t) : void 0, p = d ? jn : Mn[e];
1135
1136
  return {
1136
- thumbnailUrl: c ? void 0 : a,
1137
+ thumbnailUrl: c ? void 0 : i,
1137
1138
  accentHex: f,
1138
1139
  chinTextColor: p,
1139
1140
  surface: d ? "light" : e,
@@ -1143,8 +1144,8 @@ function An({ variant: e, accentColor: t, status: n = "ready", layout: r = "feat
1143
1144
  }
1144
1145
  //#endregion
1145
1146
  //#region src/components/LinkAttachment/components/Composer/Card.tsx
1146
- var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white focus-ring", Mn = "relative before:absolute before:-inset-[10px] before:content-['']", Nn = ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onDismiss: p, onEditClick: m, dismissLabel: h = "Dismiss attachment" }) => {
1147
- let g = c === "classic", _ = xn(a, s), v = An({
1147
+ var Pn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white focus-ring", Fn = "relative before:absolute before:-inset-[10px] before:content-['']", In = ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onDismiss: p, onEditClick: m, dismissLabel: h = "Dismiss attachment" }) => {
1148
+ let g = c === "classic", _ = wn(a, s), v = Nn({
1148
1149
  variant: "dark",
1149
1150
  accentColor: d,
1150
1151
  status: f,
@@ -1156,8 +1157,8 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1156
1157
  type: "button",
1157
1158
  onClick: p,
1158
1159
  "aria-label": h,
1159
- className: J(jn, !_ && Mn),
1160
- children: /* @__PURE__ */ W(We, {
1160
+ className: Y(Pn, !_ && Fn),
1161
+ children: /* @__PURE__ */ W(qe, {
1161
1162
  className: "size-3",
1162
1163
  weight: "bold"
1163
1164
  })
@@ -1166,19 +1167,19 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1166
1167
  onClick: m,
1167
1168
  "aria-label": "Edit attachment",
1168
1169
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
1169
- children: /* @__PURE__ */ W(Ne, {
1170
+ children: /* @__PURE__ */ W(Ie, {
1170
1171
  className: "size-5",
1171
1172
  weight: "regular"
1172
1173
  })
1173
1174
  }) : void 0;
1174
- return _ && !v.isLoading ? /* @__PURE__ */ W(vn, {
1175
+ return _ && !v.isLoading ? /* @__PURE__ */ W(xn, {
1175
1176
  variant: "dark",
1176
- bgClassName: Cn,
1177
+ bgClassName: En,
1177
1178
  children: /* @__PURE__ */ G("div", {
1178
1179
  className: "flex items-center gap-2 pr-3",
1179
1180
  children: [/* @__PURE__ */ W("div", {
1180
1181
  className: "min-w-0 flex-1",
1181
- children: /* @__PURE__ */ W(wn, {
1182
+ children: /* @__PURE__ */ W(Dn, {
1182
1183
  variant: "dark",
1183
1184
  sourceUrl: s,
1184
1185
  title: e,
@@ -1189,13 +1190,13 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1189
1190
  children: y
1190
1191
  })]
1191
1192
  })
1192
- }) : /* @__PURE__ */ G(vn, {
1193
+ }) : /* @__PURE__ */ G(xn, {
1193
1194
  variant: "dark",
1194
1195
  fixedHeight: !g,
1195
1196
  accentHex: v.accentHex,
1196
1197
  busy: v.isLoading,
1197
1198
  topRight: g ? y : void 0,
1198
- children: [!g && /* @__PURE__ */ W(wn, {
1199
+ children: [!g && /* @__PURE__ */ W(Dn, {
1199
1200
  variant: "dark",
1200
1201
  thumbnailUrl: v.thumbnailUrl,
1201
1202
  sourceUrl: s,
@@ -1204,7 +1205,7 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1204
1205
  topRight: y,
1205
1206
  isLoading: v.isLoading,
1206
1207
  onImageError: v.onImageError
1207
- }), /* @__PURE__ */ W(mn, {
1208
+ }), /* @__PURE__ */ W(_n, {
1208
1209
  chinTextColor: v.chinTextColor,
1209
1210
  variant: "dark",
1210
1211
  ctaSurface: v.surface,
@@ -1219,19 +1220,19 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1219
1220
  isLoading: v.isLoading
1220
1221
  })]
1221
1222
  });
1222
- }, Pn = ({ accentHex: e, side: t, visible: n, children: r }) => n ? /* @__PURE__ */ G("div", {
1223
+ }, Ln = ({ accentHex: e, side: t, visible: n, children: r }) => n ? /* @__PURE__ */ G("div", {
1223
1224
  className: "relative isolate w-fit",
1224
1225
  children: [r, /* @__PURE__ */ W("span", {
1225
1226
  "aria-hidden": !0,
1226
1227
  "data-testid": "link-card-tail",
1227
1228
  "data-variant": t === "sender" ? "dark" : "light",
1228
1229
  style: e ? { "--accent": e } : void 0,
1229
- className: J("messaging-link-card-tail", t === "receiver" && "messaging-link-card-tail--received")
1230
+ className: Y("messaging-link-card-tail", t === "receiver" && "messaging-link-card-tail--received")
1230
1231
  })]
1231
- }) : /* @__PURE__ */ W(U, { children: r }), Fn = {
1232
- Composer: Nn,
1232
+ }) : /* @__PURE__ */ W(U, { children: r }), Rn = {
1233
+ Composer: In,
1233
1234
  Sent: ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onClick: p, groupPosition: m = "single" }) => {
1234
- let h = Sn(a, s), g = sn(i), _ = u == null && g != null && !h ? g : void 0, v = u == null && !h && _ != null ? p : void 0, y = f !== "loading" && xn(a, s), b = An({
1235
+ let h = Tn(a, s), g = un(i), _ = u == null && g != null && !h ? g : void 0, v = u == null && !h && _ != null ? p : void 0, y = f !== "loading" && wn(a, s), b = Nn({
1235
1236
  variant: "dark",
1236
1237
  accentColor: d,
1237
1238
  status: f,
@@ -1240,19 +1241,19 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1240
1241
  mimeType: a,
1241
1242
  sourceUrl: s
1242
1243
  });
1243
- return /* @__PURE__ */ W(Pn, {
1244
+ return /* @__PURE__ */ W(Ln, {
1244
1245
  accentHex: b.accentHex,
1245
1246
  side: "sender",
1246
1247
  visible: !y && (m === "single" || m === "end"),
1247
- children: /* @__PURE__ */ G(vn, {
1248
+ children: /* @__PURE__ */ G(xn, {
1248
1249
  variant: "dark",
1249
1250
  href: _,
1250
1251
  onClick: v,
1251
1252
  fixedHeight: c === "featured" && !y,
1252
1253
  accentHex: b.accentHex,
1253
1254
  busy: b.isLoading,
1254
- bgClassName: y ? Cn : void 0,
1255
- children: [c === "featured" && /* @__PURE__ */ W(wn, {
1255
+ bgClassName: y ? En : void 0,
1256
+ children: [c === "featured" && /* @__PURE__ */ W(Dn, {
1256
1257
  variant: "dark",
1257
1258
  thumbnailUrl: b.thumbnailUrl,
1258
1259
  sourceUrl: s,
@@ -1260,7 +1261,7 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1260
1261
  mimeType: a,
1261
1262
  isLoading: b.isLoading,
1262
1263
  onImageError: b.onImageError
1263
- }), /* @__PURE__ */ W(mn, {
1264
+ }), /* @__PURE__ */ W(_n, {
1264
1265
  chinTextColor: b.chinTextColor,
1265
1266
  variant: "dark",
1266
1267
  ctaSurface: b.surface,
@@ -1277,12 +1278,12 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1277
1278
  });
1278
1279
  },
1279
1280
  Received: ({ title: e, description: t, descriptionLines: n, url: r, mimeType: i, thumbnailUrl: a, sourceUrl: o, layout: s = "featured", appIcon: c, cta: l, accentColor: u, status: d = "ready", onClick: f, groupPosition: p = "single" }) => {
1280
- let m = Sn(i, o), h = sn(r), g = l == null && h != null && !m ? h : void 0, _ = l == null && !m ? f : void 0, v = d !== "loading" && xn(i, o) ? Cn : void 0, y = l && f ? {
1281
+ let m = Tn(i, o), h = un(r), g = l == null && h != null && !m ? h : void 0, _ = l == null && !m ? f : void 0, v = d !== "loading" && wn(i, o) ? En : void 0, y = l && f ? {
1281
1282
  ...l,
1282
1283
  onClick: () => {
1283
1284
  f(), l.onClick?.();
1284
1285
  }
1285
- } : l, b = An({
1286
+ } : l, b = Nn({
1286
1287
  variant: "light",
1287
1288
  accentColor: u,
1288
1289
  status: d,
@@ -1291,11 +1292,11 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1291
1292
  mimeType: i,
1292
1293
  sourceUrl: o
1293
1294
  });
1294
- return /* @__PURE__ */ W(Pn, {
1295
+ return /* @__PURE__ */ W(Ln, {
1295
1296
  accentHex: b.accentHex,
1296
1297
  side: "receiver",
1297
1298
  visible: v == null && (p === "single" || p === "end"),
1298
- children: /* @__PURE__ */ G(vn, {
1299
+ children: /* @__PURE__ */ G(xn, {
1299
1300
  variant: "light",
1300
1301
  href: g,
1301
1302
  onClick: _,
@@ -1305,7 +1306,7 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1305
1306
  busy: b.isLoading,
1306
1307
  bgClassName: v,
1307
1308
  "data-testid": "link-attachment",
1308
- children: [s === "featured" && /* @__PURE__ */ W(wn, {
1309
+ children: [s === "featured" && /* @__PURE__ */ W(Dn, {
1309
1310
  variant: "light",
1310
1311
  thumbnailUrl: b.thumbnailUrl,
1311
1312
  sourceUrl: o,
@@ -1313,7 +1314,7 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1313
1314
  mimeType: i,
1314
1315
  isLoading: b.isLoading,
1315
1316
  onImageError: b.onImageError
1316
- }), /* @__PURE__ */ W(mn, {
1317
+ }), /* @__PURE__ */ W(_n, {
1317
1318
  chinTextColor: b.chinTextColor,
1318
1319
  variant: "light",
1319
1320
  ctaSurface: b.surface,
@@ -1328,16 +1329,16 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1328
1329
  })
1329
1330
  });
1330
1331
  }
1331
- }, In = {
1332
+ }, zn = {
1332
1333
  dark: "bg-[#1e2330]",
1333
1334
  light: "bg-[#f2f1ef]"
1334
- }, Ln = {
1335
+ }, Bn = {
1335
1336
  dark: "text-white",
1336
1337
  light: "text-[#000000]"
1337
- }, Rn = {
1338
+ }, Vn = {
1338
1339
  dark: "border-white/[0.08]",
1339
1340
  light: "border-black/[0.08]"
1340
- }, zn = (e) => e === "dark" ? "sender" : "receiver", Bn = {
1341
+ }, Hn = (e) => e === "dark" ? "sender" : "receiver", Un = {
1341
1342
  sender: {
1342
1343
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
1343
1344
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -1350,46 +1351,47 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1350
1351
  middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
1351
1352
  end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
1352
1353
  }
1353
- }, Vn = ({ variant: e, text: t, bordered: n = !0, groupPosition: r = "single", widthClassName: i = "w-[280px]", paddingClassName: a = "px-2 py-2", radiusClassName: o, className: s, children: c, "data-testid": l }) => {
1354
- let u = t != null && t !== "", d = o ?? Bn[zn(e)][r];
1354
+ }, Wn = ({ variant: e, text: t, bordered: n = !0, groupPosition: r = "single", widthClassName: i = "w-[280px]", paddingClassName: a = "px-2 py-2", radiusClassName: o, className: s, children: c, "data-testid": l }) => {
1355
+ let u = t != null && t !== "", d = o ?? Un[Hn(e)][r];
1355
1356
  return /* @__PURE__ */ G("div", {
1356
1357
  "data-testid": l,
1357
1358
  "data-group-position": r,
1358
- className: J("relative", i, "overflow-hidden", a, u && "pb-0", d, In[e], Ln[e], n && "border", n && Rn[e], s),
1359
+ className: Y("relative", i, "overflow-hidden", a, u && "pb-0", d, zn[e], Bn[e], n && "border", n && Vn[e], s),
1359
1360
  children: [c, u ? /* @__PURE__ */ W("p", {
1360
- className: J("whitespace-pre-wrap break-words leading-snug hyphens-manual", "pb-2 pt-2", "px-2"),
1361
+ className: Y("whitespace-pre-wrap break-words leading-snug hyphens-manual", "pb-2 pt-2", "px-2"),
1361
1362
  children: t
1362
1363
  }) : null]
1363
1364
  });
1364
- }, Hn = ({ onClick: e, variant: t = "overlay", ariaLabel: n = "Dismiss attachment" }) => /* @__PURE__ */ W("button", {
1365
+ }, Gn = ({ onClick: e, variant: t = "overlay", ariaLabel: n = "Dismiss attachment" }) => /* @__PURE__ */ W("button", {
1365
1366
  type: "button",
1366
1367
  onClick: (t) => {
1367
1368
  t.stopPropagation(), e();
1368
1369
  },
1369
1370
  "aria-label": n,
1370
- className: J("flex size-6 items-center justify-center rounded-full text-white", t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"),
1371
- children: /* @__PURE__ */ W(We, {
1371
+ className: Y("flex size-6 items-center justify-center rounded-full text-white", t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"),
1372
+ children: /* @__PURE__ */ W(qe, {
1372
1373
  className: "size-3",
1373
1374
  weight: "bold"
1374
1375
  })
1375
- }), Un = (e) => e === "received" ? "light" : "dark", Wn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Gn = ({ src: e, mimeType: t, filename: n, items: r }) => r && r.length > 0 ? r : e ? [{
1376
+ }), Kn = (e) => e === "received" ? "light" : "dark", qn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Jn = ({ src: e, mimeType: t, filename: n, items: r }) => r && r.length > 0 ? r : e ? [{
1376
1377
  src: e,
1377
1378
  mimeType: t,
1378
1379
  filename: n
1379
- }] : [], Kn = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ G("div", {
1380
+ }] : [], Yn = ({ item: t, preload: n, trailingAction: r }) => /* @__PURE__ */ G("div", {
1380
1381
  className: "flex items-center gap-2",
1381
1382
  children: [/* @__PURE__ */ W("audio", {
1382
- src: e.src,
1383
+ ...e,
1384
+ src: t.src,
1383
1385
  controls: !0,
1384
- preload: e.preload ?? t,
1386
+ preload: t.preload ?? n,
1385
1387
  className: "block min-w-0 flex-1",
1386
- children: e.mimeType ? /* @__PURE__ */ W("source", {
1387
- src: e.src,
1388
- type: e.mimeType
1388
+ children: t.mimeType ? /* @__PURE__ */ W("source", {
1389
+ src: t.src,
1390
+ type: t.mimeType
1389
1391
  }) : null
1390
- }), n ?? null]
1391
- }), qn = ({ state: e, src: t, mimeType: n, filename: r, items: i, text: a, groupPosition: o, preload: s, onDismiss: c }) => {
1392
- let l = Un(e), u = e === "composer" && !!c, d = Gn({
1392
+ }), r ?? null]
1393
+ }), Xn = ({ state: e, src: t, mimeType: n, filename: r, items: i, text: a, groupPosition: o, preload: s, onDismiss: c }) => {
1394
+ let l = Kn(e), u = e === "composer" && !!c, d = Jn({
1393
1395
  src: t,
1394
1396
  mimeType: n,
1395
1397
  filename: r,
@@ -1397,43 +1399,43 @@ var jn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
1397
1399
  });
1398
1400
  if (d.length === 0) return null;
1399
1401
  let f = s ?? (d.length > 1 ? "none" : "metadata");
1400
- return /* @__PURE__ */ W(Vn, {
1402
+ return /* @__PURE__ */ W(Wn, {
1401
1403
  variant: l,
1402
1404
  text: a,
1403
1405
  groupPosition: o,
1404
1406
  "data-testid": "audio-attachment",
1405
1407
  children: /* @__PURE__ */ W("div", {
1406
1408
  className: "flex flex-col gap-2",
1407
- children: d.map((e, t) => /* @__PURE__ */ W(Kn, {
1409
+ children: d.map((e, t) => /* @__PURE__ */ W(Yn, {
1408
1410
  item: e,
1409
1411
  preload: f,
1410
- trailingAction: u && t === 0 ? /* @__PURE__ */ W(Hn, {
1412
+ trailingAction: u && t === 0 ? /* @__PURE__ */ W(Gn, {
1411
1413
  onClick: c,
1412
1414
  variant: "inline"
1413
1415
  }) : void 0
1414
1416
  }, `${e.src}-${t}`))
1415
1417
  })
1416
1418
  });
1417
- }, Jn = {
1418
- Composer: (e) => /* @__PURE__ */ W(qn, {
1419
+ }, Zn = {
1420
+ Composer: (e) => /* @__PURE__ */ W(Xn, {
1419
1421
  ...e,
1420
1422
  state: "composer"
1421
1423
  }),
1422
- Sent: (e) => /* @__PURE__ */ W(qn, {
1424
+ Sent: (e) => /* @__PURE__ */ W(Xn, {
1423
1425
  ...e,
1424
1426
  state: "sent"
1425
1427
  }),
1426
- Received: (e) => /* @__PURE__ */ W(qn, {
1428
+ Received: (e) => /* @__PURE__ */ W(Xn, {
1427
1429
  ...e,
1428
1430
  state: "received"
1429
1431
  })
1430
1432
  };
1431
1433
  //#endregion
1432
1434
  //#region src/components/MessageAttachment/_shared/fileMeta.ts
1433
- function Yn(e) {
1435
+ function Qn(e) {
1434
1436
  return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(2)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
1435
1437
  }
1436
- var Xn = {
1438
+ var $n = {
1437
1439
  pdf: "PDF",
1438
1440
  doc: "DOC",
1439
1441
  xls: "XLS",
@@ -1443,7 +1445,7 @@ var Xn = {
1443
1445
  text: "TXT",
1444
1446
  markdown: "MD"
1445
1447
  };
1446
- function Zn(e, n) {
1448
+ function er(e, n) {
1447
1449
  if (n) {
1448
1450
  let e = n.lastIndexOf(".");
1449
1451
  if (e > 0 && e < n.length - 1) {
@@ -1453,15 +1455,15 @@ function Zn(e, n) {
1453
1455
  }
1454
1456
  if (!e) return;
1455
1457
  if (t(e) === "document") {
1456
- let t = Xn[r(e)];
1458
+ let t = $n[i(e)];
1457
1459
  if (t) return t;
1458
1460
  if (e === "application/octet-stream") return;
1459
1461
  }
1460
- let i = e.split("/")[1];
1461
- if (!(!i || i === "*")) return i.toUpperCase();
1462
+ let r = e.split("/")[1];
1463
+ if (!(!r || r === "*")) return r.toUpperCase();
1462
1464
  }
1463
- function Qn(e, t, n) {
1464
- return [Zn(e, t), typeof n == "number" && n > 0 ? Yn(n) : void 0].filter(Boolean).join(" · ") || void 0;
1465
+ function tr(e, t, n) {
1466
+ return [er(e, t), typeof n == "number" && n > 0 ? Qn(n) : void 0].filter(Boolean).join(" · ") || void 0;
1465
1467
  }
1466
1468
  function Q(e) {
1467
1469
  try {
@@ -1473,21 +1475,21 @@ function Q(e) {
1473
1475
  }
1474
1476
  //#endregion
1475
1477
  //#region src/components/MessageAttachment/_shared/CompactDocumentRow.tsx
1476
- var $n = {
1478
+ var nr = {
1477
1479
  dark: "text-white/55",
1478
1480
  light: "text-black/65"
1479
- }, er = {
1481
+ }, rr = {
1480
1482
  dark: "bg-white/10",
1481
1483
  light: "bg-black/5"
1482
- }, tr = {
1484
+ }, ir = {
1483
1485
  dark: "text-white/85",
1484
1486
  light: "text-black/85"
1485
- }, nr = ({ variant: e, filename: t, title: r, mimeType: i = "application/octet-stream", fileSize: a, onActivate: o, activateLabel: s, trailingAction: c }) => {
1486
- let l = r ?? t ?? "File", u = Qn(i, t, a), d = /* @__PURE__ */ W("div", {
1487
- className: J("flex size-10 shrink-0 items-center justify-center rounded-sm", er[e]),
1487
+ }, ar = ({ variant: e, filename: t, title: r, mimeType: i = "application/octet-stream", fileSize: a, onActivate: o, activateLabel: s, trailingAction: c }) => {
1488
+ let l = r ?? t ?? "File", u = tr(i, t, a), d = /* @__PURE__ */ W("div", {
1489
+ className: Y("flex size-10 shrink-0 items-center justify-center rounded-sm", rr[e]),
1488
1490
  "aria-hidden": !0,
1489
1491
  children: n(i, {
1490
- className: J("size-6", tr[e]),
1492
+ className: Y("size-6", ir[e]),
1491
1493
  weight: "regular"
1492
1494
  })
1493
1495
  }), f = /* @__PURE__ */ G("div", {
@@ -1496,14 +1498,14 @@ var $n = {
1496
1498
  className: "truncate font-medium leading-snug",
1497
1499
  children: l
1498
1500
  }), u ? /* @__PURE__ */ W("p", {
1499
- className: J("truncate text-xs leading-4", $n[e]),
1501
+ className: Y("truncate text-xs leading-4", nr[e]),
1500
1502
  children: u
1501
1503
  }) : null]
1502
1504
  }), p = o ? /* @__PURE__ */ G("button", {
1503
1505
  type: "button",
1504
1506
  onClick: o,
1505
1507
  "aria-label": s,
1506
- className: J("flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors", e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"),
1508
+ className: Y("flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors", e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"),
1507
1509
  children: [d, f]
1508
1510
  }) : /* @__PURE__ */ G(U, { children: [d, f] });
1509
1511
  return /* @__PURE__ */ G("div", {
@@ -1516,7 +1518,7 @@ var $n = {
1516
1518
  };
1517
1519
  //#endregion
1518
1520
  //#region src/components/MessageAttachment/_shared/triggerDownload.ts
1519
- async function rr(e, t) {
1521
+ async function or(e, t) {
1520
1522
  let n = t ?? Q(e);
1521
1523
  try {
1522
1524
  let t = await fetch(e, { mode: "cors" });
@@ -1532,15 +1534,15 @@ async function rr(e, t) {
1532
1534
  }
1533
1535
  //#endregion
1534
1536
  //#region src/components/MessageAttachment/File/index.tsx
1535
- var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
1537
+ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
1536
1538
  src: e,
1537
1539
  filename: t,
1538
1540
  fileSize: n,
1539
1541
  mimeType: r,
1540
1542
  title: i
1541
- }] : [], ar = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
1543
+ }] : [], cr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
1542
1544
  let a = t.filename ?? Q(t.src);
1543
- return /* @__PURE__ */ W(nr, {
1545
+ return /* @__PURE__ */ W(ar, {
1544
1546
  variant: e,
1545
1547
  filename: a,
1546
1548
  title: t.title,
@@ -1550,8 +1552,8 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1550
1552
  activateLabel: `Download ${a}`,
1551
1553
  trailingAction: i
1552
1554
  });
1553
- }, or = ({ state: e, src: t, filename: n, fileSize: r, mimeType: i, title: a, items: o, text: s, groupPosition: c, onClick: l, onDismiss: u }) => {
1554
- let d = Un(e), f = e === "composer" && !!u, p = ir({
1555
+ }, lr = ({ state: e, src: t, filename: n, fileSize: r, mimeType: i, title: a, items: o, text: s, groupPosition: c, onClick: l, onDismiss: u }) => {
1556
+ let d = Kn(e), f = e === "composer" && !!u, p = sr({
1555
1557
  src: t,
1556
1558
  filename: n,
1557
1559
  fileSize: r,
@@ -1563,55 +1565,55 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1563
1565
  let t = p[e];
1564
1566
  if (!t) return;
1565
1567
  let n = t.filename ?? Q(t.src);
1566
- rr(t.src, n);
1568
+ or(t.src, n);
1567
1569
  };
1568
1570
  if (p.length === 0) return null;
1569
1571
  let h = /* @__PURE__ */ W("span", {
1570
- className: J("flex size-8 items-center justify-center rounded-full", d === "dark" ? "text-white/70" : "text-black/70"),
1572
+ className: Y("flex size-8 items-center justify-center rounded-full", d === "dark" ? "text-white/70" : "text-black/70"),
1571
1573
  "aria-hidden": !0,
1572
- children: /* @__PURE__ */ W(je, {
1574
+ children: /* @__PURE__ */ W(Me, {
1573
1575
  className: "size-5",
1574
1576
  weight: "bold"
1575
1577
  })
1576
1578
  });
1577
- return /* @__PURE__ */ W(Vn, {
1579
+ return /* @__PURE__ */ W(Wn, {
1578
1580
  variant: d,
1579
1581
  text: s,
1580
1582
  groupPosition: c,
1581
1583
  "data-testid": "file-attachment",
1582
1584
  children: /* @__PURE__ */ W("div", {
1583
1585
  className: "flex flex-col gap-2",
1584
- children: p.map((e, t) => /* @__PURE__ */ W(ar, {
1586
+ children: p.map((e, t) => /* @__PURE__ */ W(cr, {
1585
1587
  variant: d,
1586
1588
  item: e,
1587
1589
  index: t,
1588
1590
  onActivate: m,
1589
- trailingAction: f && t === 0 ? /* @__PURE__ */ W(Hn, {
1591
+ trailingAction: f && t === 0 ? /* @__PURE__ */ W(Gn, {
1590
1592
  onClick: u,
1591
1593
  variant: "inline"
1592
1594
  }) : h
1593
1595
  }, `${e.src}-${t}`))
1594
1596
  })
1595
1597
  });
1596
- }, sr = {
1597
- Composer: (e) => /* @__PURE__ */ W(or, {
1598
+ }, ur = {
1599
+ Composer: (e) => /* @__PURE__ */ W(lr, {
1598
1600
  ...e,
1599
1601
  state: "composer"
1600
1602
  }),
1601
- Sent: (e) => /* @__PURE__ */ W(or, {
1603
+ Sent: (e) => /* @__PURE__ */ W(lr, {
1602
1604
  ...e,
1603
1605
  state: "sent"
1604
1606
  }),
1605
- Received: (e) => /* @__PURE__ */ W(or, {
1607
+ Received: (e) => /* @__PURE__ */ W(lr, {
1606
1608
  ...e,
1607
1609
  state: "received"
1608
1610
  })
1609
- }, cr = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", lr = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", ur = ({ onPrev: e, onNext: t, prevLabel: n = "Previous", nextLabel: r = "Next" }) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("button", {
1611
+ }, dr = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", fr = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", pr = ({ onPrev: e, onNext: t, prevLabel: n = "Previous", nextLabel: r = "Next" }) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("button", {
1610
1612
  type: "button",
1611
1613
  onClick: e,
1612
1614
  "aria-label": n,
1613
- className: `${lr} left-4`,
1614
- children: /* @__PURE__ */ W(Y, {
1615
+ className: `${fr} left-4`,
1616
+ children: /* @__PURE__ */ W(Oe, {
1615
1617
  size: 20,
1616
1618
  weight: "bold",
1617
1619
  "aria-hidden": !0
@@ -1620,40 +1622,40 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1620
1622
  type: "button",
1621
1623
  onClick: t,
1622
1624
  "aria-label": r,
1623
- className: `${lr} right-4`,
1624
- children: /* @__PURE__ */ W(Ee, {
1625
+ className: `${fr} right-4`,
1626
+ children: /* @__PURE__ */ W(ke, {
1625
1627
  size: 20,
1626
1628
  weight: "bold",
1627
1629
  "aria-hidden": !0
1628
1630
  })
1629
- })] }), dr = ({ url: e, filename: t, variant: n = "pill", label: r = "Download", iconOnly: i, tone: a = "dark", onTriggered: o }) => {
1630
- let [c, l] = p(!1), u = s((n) => {
1631
- n.stopPropagation(), !c && (l(!0), rr(e, t).catch(() => {}).finally(() => {
1632
- l(!1), o?.();
1631
+ })] }), mr = ({ url: e, filename: t, variant: n = "pill", label: r = "Download", iconOnly: i, tone: a = "dark", onTriggered: o }) => {
1632
+ let [s, c] = h(!1), u = l((n) => {
1633
+ n.stopPropagation(), !s && (c(!0), or(e, t).catch(() => {}).finally(() => {
1634
+ c(!1), o?.();
1633
1635
  }));
1634
1636
  }, [
1635
- c,
1637
+ s,
1636
1638
  e,
1637
1639
  t,
1638
1640
  o
1639
1641
  ]), d = i ?? n !== "pill", f = {
1640
- className: J(n === "pill" ? "size-4" : "size-5", "shrink-0"),
1642
+ className: Y(n === "pill" ? "size-4" : "size-5", "shrink-0"),
1641
1643
  weight: "bold"
1642
1644
  };
1643
1645
  return n === "inline" ? /* @__PURE__ */ W("button", {
1644
1646
  type: "button",
1645
1647
  onClick: u,
1646
- disabled: c,
1648
+ disabled: s,
1647
1649
  "aria-label": r,
1648
- className: J("flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70", {
1650
+ className: Y("flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70", {
1649
1651
  dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
1650
1652
  light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
1651
1653
  }[a]),
1652
- children: c ? /* @__PURE__ */ W(Oe, {
1654
+ children: s ? /* @__PURE__ */ W(je, {
1653
1655
  className: "size-4 animate-spin",
1654
1656
  weight: "bold",
1655
1657
  "aria-hidden": !0
1656
- }) : /* @__PURE__ */ W(je, {
1658
+ }) : /* @__PURE__ */ W(Me, {
1657
1659
  className: "size-5 shrink-0",
1658
1660
  weight: "bold",
1659
1661
  "aria-hidden": !0
@@ -1661,10 +1663,10 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1661
1663
  }) : n === "viewer" ? /* @__PURE__ */ W("button", {
1662
1664
  type: "button",
1663
1665
  onClick: u,
1664
- disabled: c,
1666
+ disabled: s,
1665
1667
  "aria-label": r,
1666
- className: cr,
1667
- children: W(c ? Oe : je, {
1668
+ className: dr,
1669
+ children: W(s ? je : Me, {
1668
1670
  size: 20,
1669
1671
  weight: "bold",
1670
1672
  "aria-hidden": !0
@@ -1672,55 +1674,55 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1672
1674
  }) : /* @__PURE__ */ G("button", {
1673
1675
  type: "button",
1674
1676
  onClick: u,
1675
- disabled: c,
1677
+ disabled: s,
1676
1678
  "aria-label": d ? r : void 0,
1677
- className: J("mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70", a === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"),
1678
- children: [c ? /* @__PURE__ */ W(Oe, {
1679
+ className: Y("mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70", a === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"),
1680
+ children: [s ? /* @__PURE__ */ W(je, {
1679
1681
  className: "size-4 animate-spin",
1680
1682
  weight: "bold",
1681
1683
  "aria-hidden": !0
1682
- }) : /* @__PURE__ */ W(je, {
1684
+ }) : /* @__PURE__ */ W(Me, {
1683
1685
  ...f,
1684
1686
  "aria-hidden": !0
1685
1687
  }), d ? null : r]
1686
1688
  });
1687
- }, fr = (e, t, n) => Math.min(Math.max(e, t), n), pr = ({ length: e, initialIndex: t, open: n }) => {
1688
- let r = fr(t, 0, Math.max(e - 1, 0)), [i, a] = p(r);
1689
- l(() => {
1690
- n && a(fr(t, 0, Math.max(e - 1, 0)));
1689
+ }, hr = (e, t, n) => Math.min(Math.max(e, t), n), gr = ({ length: e, initialIndex: t, open: n }) => {
1690
+ let r = hr(t, 0, Math.max(e - 1, 0)), [i, a] = h(r);
1691
+ d(() => {
1692
+ n && a(hr(t, 0, Math.max(e - 1, 0)));
1691
1693
  }, [
1692
1694
  n,
1693
1695
  t,
1694
1696
  e
1695
- ]), l(() => {
1696
- a((t) => fr(t, 0, Math.max(e - 1, 0)));
1697
+ ]), d(() => {
1698
+ a((t) => hr(t, 0, Math.max(e - 1, 0)));
1697
1699
  }, [e]);
1698
- let o = s(() => {
1700
+ let o = l(() => {
1699
1701
  e <= 1 || a((t) => t <= 0 ? e - 1 : t - 1);
1700
- }, [e]), c = s(() => {
1702
+ }, [e]), s = l(() => {
1701
1703
  e <= 1 || a((t) => t >= e - 1 ? 0 : t + 1);
1702
1704
  }, [e]);
1703
- return l(() => {
1705
+ return d(() => {
1704
1706
  if (!n || e <= 1) return;
1705
1707
  let t = (e) => {
1706
1708
  if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
1707
1709
  let t = document.activeElement;
1708
- t && (t.tagName === "VIDEO" || t.tagName === "AUDIO") || (e.preventDefault(), e.key === "ArrowLeft" ? o() : c());
1710
+ t && (t.tagName === "VIDEO" || t.tagName === "AUDIO") || (e.preventDefault(), e.key === "ArrowLeft" ? o() : s());
1709
1711
  };
1710
1712
  return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
1711
1713
  }, [
1712
1714
  n,
1713
1715
  e,
1714
1716
  o,
1715
- c
1717
+ s
1716
1718
  ]), {
1717
1719
  index: i,
1718
1720
  prev: o,
1719
- next: c
1721
+ next: s
1720
1722
  };
1721
- }, mr = ({ open: e, onClose: t, ariaLabel: n, counter: r, actions: i, children: a, "data-testid": o }) => {
1722
- let s = f(null), c = f(null);
1723
- return l(() => {
1723
+ }, _r = ({ open: e, onClose: t, ariaLabel: n, counter: r, actions: i, children: a, "data-testid": o }) => {
1724
+ let s = m(null), c = m(null);
1725
+ return d(() => {
1724
1726
  let t = s.current;
1725
1727
  if (t) {
1726
1728
  if (e) {
@@ -1777,8 +1779,8 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1777
1779
  type: "button",
1778
1780
  onClick: t,
1779
1781
  "aria-label": "Close viewer",
1780
- className: cr,
1781
- children: /* @__PURE__ */ W(We, {
1782
+ className: dr,
1783
+ children: /* @__PURE__ */ W(qe, {
1782
1784
  size: 20,
1783
1785
  weight: "bold",
1784
1786
  "aria-hidden": !0
@@ -1790,18 +1792,18 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1790
1792
  children: a
1791
1793
  })]
1792
1794
  });
1793
- }, hr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
1794
- let { index: i, prev: a, next: o } = pr({
1795
+ }, vr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
1796
+ let { index: i, prev: a, next: o } = gr({
1795
1797
  length: t.length,
1796
1798
  initialIndex: n,
1797
1799
  open: e
1798
- }), s = t[i], c = d(() => s?.filename ?? (s ? Q(s.src) : "image"), [s]);
1799
- return s ? /* @__PURE__ */ G(mr, {
1800
+ }), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "image"), [s]);
1801
+ return s ? /* @__PURE__ */ G(_r, {
1800
1802
  open: e,
1801
1803
  onClose: r,
1802
1804
  ariaLabel: c,
1803
1805
  counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
1804
- actions: /* @__PURE__ */ W(dr, {
1806
+ actions: /* @__PURE__ */ W(mr, {
1805
1807
  url: s.src,
1806
1808
  filename: c,
1807
1809
  variant: "viewer",
@@ -1814,14 +1816,14 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1814
1816
  draggable: !1,
1815
1817
  decoding: "async",
1816
1818
  className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] select-none object-contain"
1817
- }, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ W(ur, {
1819
+ }, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ W(pr, {
1818
1820
  onPrev: a,
1819
1821
  onNext: o,
1820
1822
  prevLabel: "Previous image",
1821
1823
  nextLabel: "Next image"
1822
1824
  }) : null]
1823
1825
  }) : null;
1824
- }, gr = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", _r = {
1826
+ }, yr = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", br = {
1825
1827
  1: ["rounded-[18px]"],
1826
1828
  2: ["rounded-l-[18px]", "rounded-r-[18px]"],
1827
1829
  3: [
@@ -1835,19 +1837,20 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1835
1837
  "rounded-bl-[18px]",
1836
1838
  "rounded-br-[18px]"
1837
1839
  ]
1838
- }, vr = "--mes-single-width-cap", yr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", br = 436, xr = ({ tiles: e, onTileActivate: t, maxVisible: n = 4, singleAspectRatio: r, className: i }) => {
1840
+ }, xr = "--mes-single-width-cap", Sr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", Cr = 436, wr = ({ tiles: e, onTileActivate: t, maxVisible: n = 4, singleAspectRatio: r, className: i }) => {
1839
1841
  let a = e.length;
1840
1842
  if (a === 0) return null;
1841
1843
  let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */ G("div", {
1842
- className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white",
1844
+ "aria-hidden": !0,
1845
+ className: "absolute inset-0 flex items-center justify-center bg-[#040403]/50 text-2xl font-bold leading-[28px] tracking-[-0.24px] text-white",
1843
1846
  children: ["+", s]
1844
1847
  }) : null, l = (e, n, r) => {
1845
- let i = J(gr, "h-full w-full", _r[o.length]?.[n]);
1848
+ let i = Y(yr, "h-full w-full", br[o.length]?.[n]);
1846
1849
  return t ? /* @__PURE__ */ G("button", {
1847
1850
  type: "button",
1848
1851
  onClick: () => t(n),
1849
1852
  "aria-label": e.ariaLabel ?? `Open media ${n + 1}`,
1850
- className: J(i, "cursor-zoom-in"),
1853
+ className: Y(i, e.cursorClassName ?? "cursor-zoom-in"),
1851
1854
  children: [e.content, r]
1852
1855
  }, n) : /* @__PURE__ */ G("div", {
1853
1856
  className: i,
@@ -1856,17 +1859,17 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1856
1859
  }, u;
1857
1860
  return r && (u = {
1858
1861
  aspectRatio: r,
1859
- width: `min(var(${vr}), ${Math.round(br * r * 100) / 100}px)`,
1862
+ width: `min(var(${xr}), ${Math.round(Cr * r * 100) / 100}px)`,
1860
1863
  maxWidth: "100%"
1861
1864
  }), o.length === 1 ? /* @__PURE__ */ W("div", {
1862
- className: J(r ? yr : "aspect-square w-full", i),
1865
+ className: Y(r ? Sr : "aspect-square w-full", i),
1863
1866
  style: u,
1864
1867
  children: l(o[0], 0, c)
1865
1868
  }) : o.length === 2 ? /* @__PURE__ */ W("div", {
1866
- className: J("grid aspect-[16/9] w-full grid-cols-2 gap-0.5", i),
1869
+ className: Y("grid aspect-[16/9] w-full grid-cols-2 gap-0.5", i),
1867
1870
  children: o.map((e, t) => l(e, t, t === o.length - 1 ? c : null))
1868
1871
  }) : o.length === 3 ? /* @__PURE__ */ G("div", {
1869
- className: J("grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
1872
+ className: Y("grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
1870
1873
  children: [
1871
1874
  /* @__PURE__ */ W("div", {
1872
1875
  className: "row-span-2",
@@ -1876,45 +1879,59 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1876
1879
  l(o[2], 2, c)
1877
1880
  ]
1878
1881
  }) : /* @__PURE__ */ W("div", {
1879
- className: J("grid aspect-[379/286] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
1882
+ className: Y("grid aspect-[379/286] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
1880
1883
  children: o.map((e, t) => {
1881
1884
  let n = s > 0 && t === o.length - 1;
1882
1885
  return l(e, t, n ? c : null);
1883
1886
  })
1884
1887
  });
1885
- }, Sr = (e) => {
1886
- let [t, n] = p(!1), [r, i] = p(0);
1888
+ }, Tr = ({ src: e, suppliedRatio: t, fallbackRatio: n }) => {
1889
+ let [r, i] = o.useState(), a = o.useCallback((t) => {
1890
+ if (!t || t.naturalWidth <= 0 || t.naturalHeight <= 0 || e === void 0) return;
1891
+ let n = t.naturalWidth / t.naturalHeight;
1892
+ i((t) => t && t.src === e && t.ratio === n ? t : {
1893
+ src: e,
1894
+ ratio: n
1895
+ });
1896
+ }, [e]), s = o.useCallback((e) => a(e.currentTarget), [a]), c = r && r.src === e ? r.ratio : void 0;
1897
+ return {
1898
+ ratio: t ?? c ?? n,
1899
+ imgRef: a,
1900
+ onLoad: s
1901
+ };
1902
+ }, Er = (e) => {
1903
+ let [t, n] = h(!1), [r, i] = h(0);
1887
1904
  return {
1888
1905
  viewerOpen: t,
1889
1906
  viewerIndex: r,
1890
- handleActivate: s((t) => {
1907
+ handleActivate: l((t) => {
1891
1908
  e?.(t) !== !1 && (i(t), n(!0));
1892
1909
  }, [e]),
1893
- closeViewer: s(() => n(!1), [])
1910
+ closeViewer: l(() => n(!1), [])
1894
1911
  };
1895
- }, Cr = ({ item: t, index: n, totalCount: r, fallbackLoading: i, imgRef: a, onLoad: o }) => ({
1896
- ariaLabel: `Open image ${n + 1} of ${r}`,
1912
+ }, Dr = ({ item: e, index: t, totalCount: n, fallbackLoading: r, imgRef: i, onLoad: o }) => ({
1913
+ ariaLabel: `Open image ${t + 1} of ${n}`,
1897
1914
  content: /* @__PURE__ */ W("img", {
1898
- ref: a,
1899
- src: e(t.src) ?? t.src,
1900
- alt: t.alt ?? "",
1901
- width: t.width,
1902
- height: t.height,
1915
+ ref: i,
1916
+ src: a(e.src) ?? e.src,
1917
+ alt: e.alt ?? "",
1918
+ width: e.width,
1919
+ height: e.height,
1903
1920
  draggable: !1,
1904
- loading: t.loading ?? i,
1921
+ loading: e.loading ?? r,
1905
1922
  decoding: "async",
1906
1923
  onLoad: o,
1907
1924
  className: "absolute inset-0 size-full object-cover"
1908
1925
  })
1909
- }), wr = ({ src: e, alt: t, items: n }) => n && n.length > 0 ? n : e ? [{
1926
+ }), Or = ({ src: e, alt: t, items: n }) => n && n.length > 0 ? n : e ? [{
1910
1927
  src: e,
1911
1928
  alt: t
1912
- }] : [], Tr = (e, t) => e.map((n, r) => ({
1929
+ }] : [], kr = (e, t) => e.map((n, r) => ({
1913
1930
  src: n.src,
1914
1931
  alt: n.alt,
1915
1932
  filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
1916
- })), Er = ({ src: t, alt: n, filename: r, loading: i = "lazy", onClick: a, onDismiss: o }) => {
1917
- let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Sr(a);
1933
+ })), Ar = ({ src: e, alt: t, filename: n, loading: r = "lazy", onClick: i, onDismiss: o }) => {
1934
+ let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Er(i);
1918
1935
  return /* @__PURE__ */ G("div", {
1919
1936
  className: "relative w-fit",
1920
1937
  children: [
@@ -1924,59 +1941,49 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1924
1941
  "aria-label": "Open image",
1925
1942
  className: "block size-[280px] cursor-zoom-in overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
1926
1943
  children: /* @__PURE__ */ W("img", {
1927
- src: e(t) ?? t,
1928
- alt: n ?? "",
1944
+ src: a(e) ?? e,
1945
+ alt: t ?? "",
1929
1946
  draggable: !1,
1930
- loading: i,
1947
+ loading: r,
1931
1948
  decoding: "async",
1932
1949
  className: "size-full object-cover"
1933
1950
  })
1934
1951
  }),
1935
1952
  o ? /* @__PURE__ */ W("div", {
1936
1953
  className: "absolute right-2 top-2 z-10",
1937
- children: /* @__PURE__ */ W(Hn, { onClick: o })
1954
+ children: /* @__PURE__ */ W(Gn, { onClick: o })
1938
1955
  }) : null,
1939
- /* @__PURE__ */ W(hr, {
1956
+ /* @__PURE__ */ W(vr, {
1940
1957
  open: s,
1941
- items: Tr([{
1942
- src: t,
1943
- alt: n
1944
- }], r),
1958
+ items: kr([{
1959
+ src: e,
1960
+ alt: t
1961
+ }], n),
1945
1962
  initialIndex: c,
1946
1963
  onClose: u
1947
1964
  })
1948
1965
  ]
1949
1966
  });
1950
- }, Dr = 326 / 246, Or = (e) => {
1951
- let t = e?.src, [n, r] = i.useState(), a = i.useCallback((e) => {
1952
- if (!e || e.naturalWidth <= 0 || e.naturalHeight <= 0 || t === void 0) return;
1953
- let n = e.naturalWidth / e.naturalHeight;
1954
- r((e) => e && e.src === t && e.ratio === n ? e : {
1955
- src: t,
1956
- ratio: n
1957
- });
1958
- }, [t]), o = i.useCallback((e) => a(e.currentTarget), [a]), s = e?.width && e?.height ? e.width / e.height : void 0, c = n && n.src === t ? n.ratio : void 0;
1959
- return {
1960
- ratio: s ?? c ?? Dr,
1961
- imgRef: a,
1962
- onLoad: o
1963
- };
1964
- }, kr = ({ state: e, src: t, alt: n, filename: r, items: i, text: a, groupPosition: o, loading: s = "lazy", onClick: c }) => {
1965
- let l = wr({
1967
+ }, jr = 326 / 246, Mr = ({ state: e, src: t, alt: n, filename: r, items: i, text: a, groupPosition: o, loading: s = "lazy", onClick: c }) => {
1968
+ let l = Or({
1966
1969
  src: t,
1967
1970
  alt: n,
1968
1971
  items: i
1969
- }), u = Un(e), { viewerOpen: d, viewerIndex: f, handleActivate: p, closeViewer: m } = Sr(c), h = l.length === 1, g = Or(h ? l[0] : void 0);
1972
+ }), u = Kn(e), { viewerOpen: d, viewerIndex: f, handleActivate: p, closeViewer: m } = Er(c), h = l.length === 1, g = h ? l[0] : void 0, _ = Tr({
1973
+ src: g?.src,
1974
+ suppliedRatio: g?.width && g?.height ? g.width / g.height : void 0,
1975
+ fallbackRatio: jr
1976
+ });
1970
1977
  if (l.length === 0) return null;
1971
- let _ = l.map((e, t) => Cr({
1978
+ let v = l.map((e, t) => Dr({
1972
1979
  item: e,
1973
1980
  index: t,
1974
1981
  totalCount: l.length,
1975
1982
  fallbackLoading: s,
1976
- imgRef: h ? g.imgRef : void 0,
1977
- onLoad: h ? g.onLoad : void 0
1983
+ imgRef: h ? _.imgRef : void 0,
1984
+ onLoad: h ? _.onLoad : void 0
1978
1985
  }));
1979
- return /* @__PURE__ */ G(Vn, {
1986
+ return /* @__PURE__ */ G(Wn, {
1980
1987
  variant: u,
1981
1988
  text: a,
1982
1989
  groupPosition: o,
@@ -1987,35 +1994,35 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
1987
1994
  "data-testid": "image-attachment",
1988
1995
  children: [/* @__PURE__ */ W("div", {
1989
1996
  className: "relative",
1990
- children: /* @__PURE__ */ W(xr, {
1991
- tiles: _,
1997
+ children: /* @__PURE__ */ W(wr, {
1998
+ tiles: v,
1992
1999
  onTileActivate: p,
1993
- singleAspectRatio: h ? g.ratio : void 0
2000
+ singleAspectRatio: h ? _.ratio : void 0
1994
2001
  })
1995
- }), /* @__PURE__ */ W(hr, {
2002
+ }), /* @__PURE__ */ W(vr, {
1996
2003
  open: d,
1997
- items: Tr(l, r),
2004
+ items: kr(l, r),
1998
2005
  initialIndex: f,
1999
2006
  onClose: m
2000
2007
  })]
2001
2008
  });
2002
- }, Ar = {
2003
- Composer: (e) => /* @__PURE__ */ W(Er, { ...e }),
2004
- Sent: (e) => /* @__PURE__ */ W(kr, {
2009
+ }, Nr = {
2010
+ Composer: (e) => /* @__PURE__ */ W(Ar, { ...e }),
2011
+ Sent: (e) => /* @__PURE__ */ W(Mr, {
2005
2012
  ...e,
2006
2013
  state: "sent"
2007
2014
  }),
2008
- Received: (e) => /* @__PURE__ */ W(kr, {
2015
+ Received: (e) => /* @__PURE__ */ W(Mr, {
2009
2016
  ...e,
2010
2017
  state: "received"
2011
2018
  })
2012
- }, jr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
2013
- let { index: i, prev: a, next: o } = pr({
2019
+ }, Pr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
2020
+ let { index: i, prev: a, next: o } = gr({
2014
2021
  length: t.length,
2015
2022
  initialIndex: n,
2016
2023
  open: e
2017
- }), s = t[i], c = d(() => s?.filename ?? (s ? Q(s.src) : "document"), [s]), l = d(() => s ? Mr(s.src) : void 0, [s]);
2018
- return !s || !l ? null : /* @__PURE__ */ G(mr, {
2024
+ }), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "document"), [s]), l = p(() => s ? Fr(s.src) : void 0, [s]);
2025
+ return !s || !l ? null : /* @__PURE__ */ G(_r, {
2019
2026
  open: e,
2020
2027
  onClose: r,
2021
2028
  ariaLabel: c,
@@ -2026,24 +2033,24 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2026
2033
  title: c,
2027
2034
  className: "block h-[calc(100dvh-128px)] w-[min(96vw,1400px)] border-0 bg-white",
2028
2035
  sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
2029
- }, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ W(ur, {
2036
+ }, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ W(pr, {
2030
2037
  onPrev: a,
2031
2038
  onNext: o,
2032
2039
  prevLabel: "Previous document",
2033
2040
  nextLabel: "Next document"
2034
2041
  }) : null]
2035
2042
  });
2036
- }, Mr = (e) => {
2043
+ }, Fr = (e) => {
2037
2044
  let t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1), i = new URLSearchParams(r);
2038
2045
  return i.has("toolbar") || i.set("toolbar", "0"), i.has("navpanes") || i.set("navpanes", "0"), `${n}#${i.toString()}`;
2039
- }, Nr = ({ src: e, filename: t, fileSize: n, title: r, items: i }) => i && i.length > 0 ? i : e ? [{
2046
+ }, Ir = ({ src: e, filename: t, fileSize: n, title: r, items: i }) => i && i.length > 0 ? i : e ? [{
2040
2047
  src: e,
2041
2048
  filename: t,
2042
2049
  fileSize: n,
2043
2050
  title: r
2044
- }] : [], Pr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
2051
+ }] : [], Lr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
2045
2052
  let a = t.filename ?? Q(t.src);
2046
- return /* @__PURE__ */ W(nr, {
2053
+ return /* @__PURE__ */ W(ar, {
2047
2054
  variant: e,
2048
2055
  filename: a,
2049
2056
  title: t.title,
@@ -2053,20 +2060,20 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2053
2060
  activateLabel: `Open ${a}`,
2054
2061
  trailingAction: i
2055
2062
  });
2056
- }, Fr = ({ state: e, src: t, filename: n, fileSize: r, title: i, items: a, text: o, groupPosition: s, onClick: c, onDismiss: l }) => {
2057
- let u = Un(e), d = Nr({
2063
+ }, Rr = ({ state: e, src: t, filename: n, fileSize: r, title: i, items: a, text: o, groupPosition: s, onClick: c, onDismiss: l }) => {
2064
+ let u = Kn(e), d = Ir({
2058
2065
  src: t,
2059
2066
  filename: n,
2060
2067
  fileSize: r,
2061
2068
  title: i,
2062
2069
  items: a
2063
- }), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Sr(c), g = e === "composer" && !!l;
2070
+ }), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Er(c), g = e === "composer" && !!l;
2064
2071
  if (d.length === 0) return null;
2065
2072
  let _ = d.map((e) => ({
2066
2073
  src: e.src,
2067
2074
  filename: e.filename ?? Q(e.src)
2068
2075
  }));
2069
- return /* @__PURE__ */ G(Vn, {
2076
+ return /* @__PURE__ */ G(Wn, {
2070
2077
  variant: u,
2071
2078
  text: o,
2072
2079
  groupPosition: s,
@@ -2074,17 +2081,17 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2074
2081
  children: [/* @__PURE__ */ W("div", {
2075
2082
  className: "flex flex-col gap-2",
2076
2083
  children: d.map((t, n) => {
2077
- let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */ W(Hn, {
2084
+ let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */ W(Gn, {
2078
2085
  onClick: l,
2079
2086
  variant: "inline"
2080
- }) : e === "composer" ? void 0 : /* @__PURE__ */ W(dr, {
2087
+ }) : e === "composer" ? void 0 : /* @__PURE__ */ W(mr, {
2081
2088
  url: t.src,
2082
2089
  filename: r,
2083
2090
  variant: "inline",
2084
2091
  label: `Download ${r}`,
2085
2092
  tone: u
2086
2093
  });
2087
- return /* @__PURE__ */ W(Pr, {
2094
+ return /* @__PURE__ */ W(Lr, {
2088
2095
  variant: u,
2089
2096
  item: t,
2090
2097
  index: n,
@@ -2092,107 +2099,126 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2092
2099
  trailingAction: i
2093
2100
  }, `${t.src}-${n}`);
2094
2101
  })
2095
- }), /* @__PURE__ */ W(jr, {
2102
+ }), /* @__PURE__ */ W(Pr, {
2096
2103
  open: f,
2097
2104
  items: _,
2098
2105
  initialIndex: p,
2099
2106
  onClose: h
2100
2107
  })]
2101
2108
  });
2102
- }, Ir = {
2103
- Composer: (e) => /* @__PURE__ */ W(Fr, {
2109
+ }, zr = {
2110
+ Composer: (e) => /* @__PURE__ */ W(Rr, {
2104
2111
  ...e,
2105
2112
  state: "composer"
2106
2113
  }),
2107
- Sent: (e) => /* @__PURE__ */ W(Fr, {
2114
+ Sent: (e) => /* @__PURE__ */ W(Rr, {
2108
2115
  ...e,
2109
2116
  state: "sent"
2110
2117
  }),
2111
- Received: (e) => /* @__PURE__ */ W(Fr, {
2118
+ Received: (e) => /* @__PURE__ */ W(Rr, {
2112
2119
  ...e,
2113
2120
  state: "received"
2114
2121
  })
2115
- }, Lr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
2116
- let { index: i, prev: a, next: o } = pr({
2122
+ }, Br = 150, Vr = ({ open: e, items: t, initialIndex: n = 0, onClose: i }) => {
2123
+ let { index: a, prev: o, next: s } = gr({
2117
2124
  length: t.length,
2118
2125
  initialIndex: n,
2119
2126
  open: e
2120
- }), s = t[i], c = d(() => s?.filename ?? (s ? Q(s.src) : "video"), [s]);
2121
- return s ? /* @__PURE__ */ G(mr, {
2127
+ }), c = m(null), l = pe();
2128
+ d(() => {
2129
+ e && (l?.pause(), r(c.current));
2130
+ }, [e, l]);
2131
+ let [u, f] = h(e);
2132
+ e && !u && f(!0), d(() => {
2133
+ if (e || !u) return;
2134
+ c.current?.pause();
2135
+ let t = window.setTimeout(() => f(!1), Br);
2136
+ return () => window.clearTimeout(t);
2137
+ }, [e, u]);
2138
+ let g = t[a], _ = p(() => g?.filename ?? (g ? Q(g.src) : "video"), [g]);
2139
+ return g ? /* @__PURE__ */ G(_r, {
2122
2140
  open: e,
2123
- onClose: r,
2124
- ariaLabel: c,
2125
- counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
2141
+ onClose: i,
2142
+ ariaLabel: _,
2143
+ counter: t.length > 1 ? `${a + 1} / ${t.length}` : void 0,
2126
2144
  "data-testid": "video-viewer",
2127
- children: [/* @__PURE__ */ W("video", {
2128
- src: s.src,
2129
- poster: s.poster,
2145
+ children: [u ? /* @__PURE__ */ W("video", {
2146
+ ref: c,
2147
+ src: g.src,
2148
+ poster: g.poster,
2130
2149
  controls: !0,
2131
2150
  autoPlay: !0,
2132
2151
  muted: !0,
2133
2152
  playsInline: !0,
2134
- preload: s.preload ?? "metadata",
2153
+ preload: g.preload ?? "metadata",
2135
2154
  className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] bg-black",
2136
- children: s.mimeType ? /* @__PURE__ */ W("source", {
2137
- src: s.src,
2138
- type: s.mimeType
2155
+ children: g.mimeType ? /* @__PURE__ */ W("source", {
2156
+ src: g.src,
2157
+ type: g.mimeType
2139
2158
  }) : null
2140
- }, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ W(ur, {
2141
- onPrev: a,
2142
- onNext: o,
2159
+ }, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */ W(pr, {
2160
+ onPrev: o,
2161
+ onNext: s,
2143
2162
  prevLabel: "Previous video",
2144
2163
  nextLabel: "Next video"
2145
2164
  }) : null]
2146
2165
  }) : null;
2147
- }, Rr = () => /* @__PURE__ */ W("div", {
2166
+ }, Hr = 1, Ur = 4 / 5, Wr = 16 / 9, Gr = () => /* @__PURE__ */ W("div", {
2148
2167
  className: "pointer-events-none absolute inset-0 flex items-center justify-center",
2149
2168
  children: /* @__PURE__ */ W("span", {
2150
- className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur",
2151
- children: /* @__PURE__ */ W(Pe, {
2169
+ className: "flex size-12 items-center justify-center rounded-full bg-black/25 text-white backdrop-blur-[20px]",
2170
+ children: /* @__PURE__ */ W(Le, {
2152
2171
  className: "size-6",
2153
2172
  weight: "fill",
2154
2173
  "aria-hidden": !0
2155
2174
  })
2156
2175
  })
2157
- }), zr = ({ item: e, index: t }) => /* @__PURE__ */ G("div", {
2176
+ }), Kr = ({ item: e, index: t, showPlayBadge: n = !0, imgRef: r, onLoad: i }) => /* @__PURE__ */ G("div", {
2158
2177
  className: "absolute inset-0 size-full bg-[#0d0d0d]",
2159
2178
  children: [e.poster ? /* @__PURE__ */ W("img", {
2179
+ ref: r,
2160
2180
  src: e.poster,
2161
2181
  alt: `Video ${t + 1} thumbnail`,
2162
2182
  draggable: !1,
2163
2183
  loading: "lazy",
2164
2184
  decoding: "async",
2185
+ onLoad: i,
2165
2186
  className: "absolute inset-0 size-full object-cover"
2166
2187
  }) : /* @__PURE__ */ W("div", {
2167
2188
  className: "absolute inset-0 flex items-center justify-center",
2168
- children: /* @__PURE__ */ W(He, {
2189
+ children: /* @__PURE__ */ W(Ge, {
2169
2190
  className: "size-16 text-white/30",
2170
2191
  weight: "regular",
2171
2192
  "aria-hidden": !0
2172
2193
  })
2173
- }), /* @__PURE__ */ W(Rr, {})]
2174
- }), Br = (e, t, n) => ({
2194
+ }), n ? /* @__PURE__ */ W(Gr, {}) : null]
2195
+ }), qr = ({ item: e, index: t, totalCount: n, isOverflowTile: r, imgRef: i, onLoad: a }) => ({
2175
2196
  ariaLabel: `Play video ${t + 1} of ${n}`,
2176
- content: /* @__PURE__ */ W(zr, {
2197
+ cursorClassName: "cursor-pointer",
2198
+ content: /* @__PURE__ */ W(Kr, {
2177
2199
  item: e,
2178
- index: t
2200
+ index: t,
2201
+ showPlayBadge: !r,
2202
+ imgRef: i,
2203
+ onLoad: a
2179
2204
  })
2180
- }), Vr = ({ src: e, poster: t, mimeType: n, preload: r, items: i }) => i && i.length > 0 ? r ? i.map((e) => ({
2205
+ }), Jr = ({ src: e, poster: t, mimeType: n, preload: r, naturalAspectRatio: i, items: a }) => a && a.length > 0 ? r ? a.map((e) => ({
2181
2206
  ...e,
2182
2207
  preload: e.preload ?? r
2183
- })) : i : e ? [{
2208
+ })) : a : e ? [{
2184
2209
  src: e,
2185
2210
  poster: t,
2186
2211
  mimeType: n,
2187
- preload: r
2188
- }] : [], Hr = (e, t) => e.map((n, r) => ({
2212
+ preload: r,
2213
+ naturalAspectRatio: i
2214
+ }] : [], Yr = (e, t) => e.map((n, r) => ({
2189
2215
  src: n.src,
2190
2216
  poster: n.poster,
2191
2217
  mimeType: n.mimeType,
2192
2218
  preload: n.preload,
2193
2219
  filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
2194
- })), Ur = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
2195
- let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Sr(a);
2220
+ })), Xr = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
2221
+ let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Er(a);
2196
2222
  return /* @__PURE__ */ G("div", {
2197
2223
  className: "relative w-fit",
2198
2224
  children: [
@@ -2201,7 +2227,7 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2201
2227
  onClick: () => l(0),
2202
2228
  "aria-label": "Play video",
2203
2229
  className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
2204
- children: /* @__PURE__ */ W(zr, {
2230
+ children: /* @__PURE__ */ W(Kr, {
2205
2231
  item: {
2206
2232
  src: e,
2207
2233
  poster: t,
@@ -2212,11 +2238,11 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2212
2238
  }),
2213
2239
  o ? /* @__PURE__ */ W("div", {
2214
2240
  className: "absolute right-2 top-2 z-10",
2215
- children: /* @__PURE__ */ W(Hn, { onClick: o })
2241
+ children: /* @__PURE__ */ W(Gn, { onClick: o })
2216
2242
  }) : null,
2217
- /* @__PURE__ */ W(Lr, {
2243
+ /* @__PURE__ */ W(Vr, {
2218
2244
  open: s,
2219
- items: Hr([{
2245
+ items: Yr([{
2220
2246
  src: e,
2221
2247
  poster: t,
2222
2248
  mimeType: n,
@@ -2227,85 +2253,106 @@ var ir = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
2227
2253
  })
2228
2254
  ]
2229
2255
  });
2230
- }, Wr = ({ state: e, src: t, poster: n, mimeType: r, filename: i, items: a, text: o, groupPosition: s, preload: c, onClick: l }) => {
2231
- let u = Vr({
2256
+ }, Zr = ({ state: e, src: t, poster: n, mimeType: r, filename: i, items: a, text: o, groupPosition: s, preload: c, naturalAspectRatio: l, onClick: u }) => {
2257
+ let d = Jr({
2232
2258
  src: t,
2233
2259
  poster: n,
2234
2260
  mimeType: r,
2235
2261
  preload: c,
2262
+ naturalAspectRatio: l,
2236
2263
  items: a
2237
- }), d = Un(e), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Sr(l);
2238
- if (u.length === 0) return null;
2239
- let g = u.map((e, t) => Br(e, t, u.length));
2240
- return /* @__PURE__ */ G(Vn, {
2241
- variant: d,
2264
+ }), f = Kn(e), { viewerOpen: p, viewerIndex: m, handleActivate: h, closeViewer: g } = Er(u), _ = d.length === 1, v = _ ? d[0] : void 0, y = Tr({
2265
+ src: v?.poster,
2266
+ suppliedRatio: v?.naturalAspectRatio,
2267
+ fallbackRatio: Hr
2268
+ });
2269
+ if (d.length === 0) return null;
2270
+ let b = d.length > 4 ? 3 : -1, x = d.map((e, t) => qr({
2271
+ item: e,
2272
+ index: t,
2273
+ totalCount: d.length,
2274
+ isOverflowTile: t === b,
2275
+ imgRef: _ ? y.imgRef : void 0,
2276
+ onLoad: _ ? y.onLoad : void 0
2277
+ })), S = Math.min(Math.max(y.ratio, Ur), Wr);
2278
+ return /* @__PURE__ */ G(Wn, {
2279
+ variant: f,
2242
2280
  text: o,
2243
2281
  groupPosition: s,
2282
+ bordered: !1,
2283
+ widthClassName: _ ? "w-fit max-w-[313px] sm:max-w-[330px]" : "w-[383px] max-w-full",
2284
+ paddingClassName: "p-0.5",
2285
+ radiusClassName: s && s !== "single" ? void 0 : "rounded-[20px]",
2244
2286
  "data-testid": "video-attachment",
2245
2287
  children: [/* @__PURE__ */ W("div", {
2246
2288
  className: "relative",
2247
- children: /* @__PURE__ */ W(xr, {
2248
- tiles: g,
2249
- onTileActivate: m
2289
+ children: /* @__PURE__ */ W(wr, {
2290
+ tiles: x,
2291
+ onTileActivate: h,
2292
+ singleAspectRatio: _ ? S : void 0
2250
2293
  })
2251
- }), /* @__PURE__ */ W(Lr, {
2252
- open: f,
2253
- items: Hr(u, i),
2254
- initialIndex: p,
2255
- onClose: h
2294
+ }), /* @__PURE__ */ W(Vr, {
2295
+ open: p,
2296
+ items: Yr(d, i),
2297
+ initialIndex: m,
2298
+ onClose: g
2256
2299
  })]
2257
2300
  });
2258
- }, Gr = {
2259
- Image: Ar,
2301
+ }, Qr = {
2302
+ Image: Nr,
2260
2303
  Video: {
2261
- Composer: (e) => /* @__PURE__ */ W(Ur, { ...e }),
2262
- Sent: (e) => /* @__PURE__ */ W(Wr, {
2304
+ Composer: (e) => /* @__PURE__ */ W(Xr, { ...e }),
2305
+ Sent: (e) => /* @__PURE__ */ W(Zr, {
2263
2306
  ...e,
2264
2307
  state: "sent"
2265
2308
  }),
2266
- Received: (e) => /* @__PURE__ */ W(Wr, {
2309
+ Received: (e) => /* @__PURE__ */ W(Zr, {
2267
2310
  ...e,
2268
2311
  state: "received"
2269
2312
  })
2270
2313
  },
2271
- Audio: Jn,
2272
- Pdf: Ir,
2273
- File: sr
2314
+ Audio: Zn,
2315
+ Pdf: zr,
2316
+ File: ur
2274
2317
  };
2275
2318
  //#endregion
2276
2319
  //#region src/components/CustomMessage/StreamAttachmentMessage.tsx
2277
2320
  function $(e) {
2278
2321
  return e?.trim() || void 0;
2279
2322
  }
2280
- function Kr(e) {
2323
+ function $r(e) {
2324
+ let { original_width: t, original_height: n } = e;
2325
+ if (typeof t == "number" && typeof n == "number" && !(!Number.isFinite(t) || !Number.isFinite(n)) && !(t <= 0 || n <= 0)) return t / n;
2326
+ }
2327
+ function ei(e) {
2281
2328
  return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
2282
2329
  }
2283
- function qr(e, t) {
2330
+ function ti(e, t) {
2284
2331
  if (!e?.trim() || !t?.trim()) return !1;
2285
- let n = Kr(e), r = Kr(t);
2332
+ let n = ei(e), r = ei(t);
2286
2333
  if (n === r) return !0;
2287
2334
  if (!n.includes(r)) return !1;
2288
2335
  let i = n.split(r).join("");
2289
2336
  return !/[^\p{P}\p{Z}\p{C}]/u.test(i);
2290
2337
  }
2291
- function Jr(t) {
2292
- let n = $(t.og_scrape_url) ?? $(t.title_link), r = $(t.image_url) ?? $(t.thumb_url), i = $(t.asset_url), a = $(t.mime_type);
2338
+ function ni(e) {
2339
+ let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.asset_url), i = $(e.mime_type);
2293
2340
  return {
2294
- title: $(t.title),
2295
- description: $(t.text),
2296
- url: n,
2297
- thumbnailUrl: e(r),
2298
- sourceUrl: i,
2299
- layout: r || Sn(a, i) ? "featured" : "classic",
2300
- mimeType: a,
2301
- accentColor: $(t.accent_color),
2341
+ title: $(e.title),
2342
+ description: $(e.text),
2343
+ url: t,
2344
+ thumbnailUrl: a(n),
2345
+ sourceUrl: r,
2346
+ layout: n || Tn(i, r) ? "featured" : "classic",
2347
+ mimeType: i,
2348
+ accentColor: $(e.accent_color),
2302
2349
  status: "ready"
2303
2350
  };
2304
2351
  }
2305
- function Yr(e) {
2306
- return Tt(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
2352
+ function ri(e) {
2353
+ return Ot(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
2307
2354
  }
2308
- function Xr(e) {
2355
+ function ii(e) {
2309
2356
  if (!e?.length) return [];
2310
2357
  let t = [], n = (e, n) => {
2311
2358
  let r = t[t.length - 1];
@@ -2330,43 +2377,44 @@ function Xr(e) {
2330
2377
  });
2331
2378
  };
2332
2379
  for (let t of e) {
2333
- if (Tt(t)) {
2380
+ if (Ot(t)) {
2334
2381
  r(t);
2335
2382
  continue;
2336
2383
  }
2337
- let e = Yr(t);
2384
+ let e = ri(t);
2338
2385
  e && n(e, t);
2339
2386
  }
2340
2387
  return t;
2341
2388
  }
2342
- function Zr(e) {
2389
+ function ai(e) {
2343
2390
  return e.filter((e) => e.type === "media").length;
2344
2391
  }
2345
- function Qr(e, t, n) {
2392
+ function oi(e, t, n) {
2346
2393
  return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
2347
2394
  }
2348
- function $r(e) {
2395
+ function si(e) {
2349
2396
  return $(e.image_url) ?? $(e.asset_url) ?? "";
2350
2397
  }
2351
- function ei(e) {
2398
+ function ci(e) {
2352
2399
  switch (e) {
2353
- case "image": return Gr.Image;
2354
- case "video": return Gr.Video;
2355
- case "audio": return Gr.Audio;
2356
- case "pdf": return Gr.Pdf;
2357
- default: return Gr.File;
2400
+ case "image": return Qr.Image;
2401
+ case "video": return Qr.Video;
2402
+ case "audio": return Qr.Audio;
2403
+ case "pdf": return Qr.Pdf;
2404
+ default: return Qr.File;
2358
2405
  }
2359
2406
  }
2360
- function ti(e, t) {
2407
+ function li(e, t) {
2361
2408
  switch (e) {
2362
2409
  case "image": return {
2363
- src: $r(t),
2410
+ src: si(t),
2364
2411
  alt: $(t.title)
2365
2412
  };
2366
2413
  case "video": return {
2367
2414
  src: $(t.asset_url) ?? "",
2368
- poster: $(t.thumb_url),
2369
- mimeType: $(t.mime_type)
2415
+ poster: a(t.thumb_url),
2416
+ mimeType: $(t.mime_type),
2417
+ naturalAspectRatio: $r(t)
2370
2418
  };
2371
2419
  case "audio": return {
2372
2420
  src: $(t.asset_url) ?? "",
@@ -2386,30 +2434,30 @@ function ti(e, t) {
2386
2434
  };
2387
2435
  }
2388
2436
  }
2389
- function ni(e, t) {
2390
- if (t.length > 1) return { items: t.map((t) => ti(e, t)) };
2437
+ function ui(e, t) {
2438
+ if (t.length > 1) return { items: t.map((t) => li(e, t)) };
2391
2439
  let n = t[0];
2392
- return n ? ti(e, n) : {};
2440
+ return n ? li(e, n) : {};
2393
2441
  }
2394
- function ri({ groupPosition: e, isMyMessage: t, segment: n }) {
2395
- let r = ei(n.kind), i = {
2396
- ...ni(n.kind, n.attachments),
2442
+ function di({ groupPosition: e, isMyMessage: t, segment: n }) {
2443
+ let r = ci(n.kind), i = {
2444
+ ...ui(n.kind, n.attachments),
2397
2445
  groupPosition: e
2398
2446
  };
2399
2447
  return W(t ? r.Sent : r.Received, { ...i });
2400
2448
  }
2401
- var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2402
- let i = Xr(n.attachments);
2449
+ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2450
+ let i = ii(n.attachments);
2403
2451
  if (i.length === 0) return null;
2404
- let a = Zr(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? Jr(s.attachments[0] ?? {}).url : void 0, l = o && qr(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
2405
- let i = t ? Fn.Sent : Fn.Received;
2452
+ let a = ai(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? ni(s.attachments[0] ?? {}).url : void 0, l = o && ti(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
2453
+ let i = t ? Rn.Sent : Rn.Received;
2406
2454
  d.push(/* @__PURE__ */ W(i, {
2407
- ...Jr(e),
2455
+ ...ni(e),
2408
2456
  groupPosition: r ? f : "middle"
2409
2457
  }, n));
2410
2458
  }, h = (n, r) => {
2411
- let i = Qr(u, a, e);
2412
- u += 1, d.push(/* @__PURE__ */ W(ri, {
2459
+ let i = oi(u, a, e);
2460
+ u += 1, d.push(/* @__PURE__ */ W(di, {
2413
2461
  groupPosition: i,
2414
2462
  isMyMessage: t,
2415
2463
  segment: n
@@ -2435,99 +2483,99 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2435
2483
  overflow: "visible",
2436
2484
  padding: 0
2437
2485
  },
2438
- children: [d, !l && /* @__PURE__ */ W(A, {})]
2486
+ children: [d, !l && /* @__PURE__ */ W(M, {})]
2439
2487
  }), l ? /* @__PURE__ */ G("div", {
2440
- className: J("str-chat__message-bubble", { "relative isolate": p }),
2488
+ className: Y("str-chat__message-bubble", { "relative isolate": p }),
2441
2489
  children: [
2442
- /* @__PURE__ */ W(I, {
2490
+ /* @__PURE__ */ W(R, {
2443
2491
  message: n,
2444
2492
  renderText: r
2445
2493
  }),
2446
- /* @__PURE__ */ W(A, {}),
2447
- p && /* @__PURE__ */ W(Wt, { side: t ? "me" : "other" })
2494
+ /* @__PURE__ */ W(M, {}),
2495
+ p && /* @__PURE__ */ W(qt, { side: t ? "me" : "other" })
2448
2496
  ]
2449
2497
  }) : null]
2450
2498
  });
2451
- }, ai = i.memo((e) => {
2452
- let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: f, isMyMessage: m, message: h, renderText: g, threadList: _, viewerLanguage: y, onOutboundClick: b, resolvedOutbound: x } = e, { client: S } = de("CustomMessage"), { channel: C } = ue("CustomMessage"), { isUnlocking: T, onUnlockClick: j, onFetchSource: N, onDownloadClick: F } = kt("LockedAttachment"), [L, z] = p(!1), ne = ge(h.id), { Attachment: re = v, EditMessageModal: B = w, MessageActions: V, MessageBlocked: le = E, MessageBouncePrompt: pe = O, MessageDeleted: me = k, MessageIsThreadReplyInChannelButtonIndicator: H = M, MessageRepliesCountButton: he = P, ReminderNotification: _e = ee, StreamedMessageText: ve = te, PinIndicator: K } = fe("CustomMessage"), ye = se(h), be = ce(h), xe = d(() => f?.(h), [f, h]), q = d(() => {
2453
- let e = h.attachments ?? [], t = h.shared_location ? [h.shared_location, ...e] : e;
2454
- if (!It(h)) return t;
2455
- let n = t.filter((e) => !("type" in e) || !Tt(e));
2499
+ }, pi = o.memo((e) => {
2500
+ let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: x } = e, { client: S } = me("CustomMessage"), { channel: C } = V("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: D, onDownloadClick: N } = Mt("LockedAttachment"), [F, L] = h(!1), z = ye(m.id), { Attachment: te = b, EditMessageModal: ie = E, MessageActions: B, MessageBlocked: ae = O, MessageBouncePrompt: oe = A, MessageDeleted: fe = j, MessageIsThreadReplyInChannelButtonIndicator: pe = P, MessageRepliesCountButton: ge = I, ReminderNotification: _e = ne, StreamedMessageText: H = re, PinIndicator: ve } = he("CustomMessage"), be = ue(m), xe = de(m), K = p(() => d?.(m), [d, m]), q = p(() => {
2501
+ let e = m.attachments ?? [], t = m.shared_location ? [m.shared_location, ...e] : e;
2502
+ if (!zt(m)) return t;
2503
+ let n = t.filter((e) => !("type" in e) || !Ot(e));
2456
2504
  return n.length === t.length ? t : n;
2457
- }, [h]), Se = d(() => Xr(q), [q]), Ce = d(() => {
2458
- let e = wt({
2459
- message: h,
2460
- viewerLanguage: y
2505
+ }, [m]), Se = p(() => ii(q), [q]), Ce = p(() => {
2506
+ let e = Dt({
2507
+ message: m,
2508
+ viewerLanguage: v
2461
2509
  });
2462
- return e === h.text ? h : {
2463
- ...h,
2510
+ return e === m.text ? m : {
2511
+ ...m,
2464
2512
  text: e
2465
2513
  };
2466
- }, [h, y]), we = Se.length > 0, Te = Se.reduce((e, t) => e + t.attachments.length, 0) === (q?.length ?? 0), Y = a?.[0] ?? "", Ee = Y === "top" ? "first" : Y === "middle" ? "middle" : Y === "bottom" ? "end" : "single", De = Y === "single" || Y === "bottom";
2467
- if (ie(h)) return null;
2468
- if (h.deleted_at || h.type === "deleted") return /* @__PURE__ */ W(me, { message: h });
2469
- if (ae(h)) return /* @__PURE__ */ W(le, {});
2470
- let Oe = !_ && !!h.reply_count, ke = !_ && h.show_in_channel && h.parent_id, Ae = h.status === "failed" && h.error?.status !== 403, je = oe(h), X;
2471
- Ae ? X = () => l(h) : je && (X = () => z(!0));
2472
- let Z = m(), Me = J("str-chat__message str-chat__message-simple", `str-chat__message--${h.type}`, `str-chat__message--${h.status}`, Z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other", h.text ? "str-chat__message--has-text" : "has-no-text", {
2473
- "str-chat__message--has-attachment": ye,
2514
+ }, [m, v]), we = Se.length > 0, Te = Se.reduce((e, t) => e + t.attachments.length, 0) === (q?.length ?? 0), J = a?.[0] ?? "", Ee = J === "top" ? "first" : J === "middle" ? "middle" : J === "bottom" ? "end" : "single", De = J === "single" || J === "bottom";
2515
+ if (se(m)) return null;
2516
+ if (m.deleted_at || m.type === "deleted") return /* @__PURE__ */ W(fe, { message: m });
2517
+ if (ce(m)) return /* @__PURE__ */ W(ae, {});
2518
+ let Oe = !_ && !!m.reply_count, ke = !_ && m.show_in_channel && m.parent_id, Ae = m.status === "failed" && m.error?.status !== 403, je = le(m), X;
2519
+ Ae ? X = () => l(m) : je && (X = () => L(!0));
2520
+ let Z = f(), Me = Y("str-chat__message str-chat__message-simple", `str-chat__message--${m.type}`, `str-chat__message--${m.status}`, Z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other", m.text ? "str-chat__message--has-text" : "has-no-text", {
2521
+ "str-chat__message--has-attachment": be,
2474
2522
  "str-chat__message--highlighted": u,
2475
- "str-chat__message--pinned pinned-message": h.pinned,
2476
- "str-chat__message--with-reactions": be,
2477
- "str-chat__message-send-can-be-retried": h?.status === "failed" && h?.error?.status !== 403,
2523
+ "str-chat__message--pinned pinned-message": m.pinned,
2524
+ "str-chat__message--with-reactions": xe,
2525
+ "str-chat__message-send-can-be-retried": m?.status === "failed" && m?.error?.status !== 403,
2478
2526
  "str-chat__message-with-thread-link": Oe || ke,
2479
2527
  "str-chat__virtual-message__wrapper--end": r,
2480
2528
  "str-chat__virtual-message__wrapper--first": i,
2481
2529
  "str-chat__virtual-message__wrapper--group": o
2482
- }), Ne = h.poll_id && S.polls.fromState(h.poll_id), Pe = Xt(h), Fe = It(h), Ie = Lt(h), Le = !!(q?.length && !h.quoted_message), Re = Fe && Z && Le, ze = we && Te && !h.quoted_message && !Ne && !xe && !Fe, Be = {
2530
+ }), Ne = m.poll_id && S.polls.fromState(m.poll_id), Pe = $t(m), Fe = zt(m), Ie = Bt(m), Le = !!(q?.length && !m.quoted_message), Re = Fe && Z && Le, ze = we && Te && !m.quoted_message && !Ne && !K && !Fe, Be = {
2483
2531
  contentType: "text",
2484
- amountText: h.metadata?.amount_text,
2485
- paymentStatus: h.metadata?.payment_status,
2486
- renderedText: h.text && /* @__PURE__ */ W(I, {
2532
+ amountText: m.metadata?.amount_text,
2533
+ paymentStatus: m.metadata?.payment_status,
2534
+ renderedText: m.text && /* @__PURE__ */ W(R, {
2487
2535
  message: Ce,
2488
2536
  renderText: g
2489
2537
  })
2490
2538
  }, Ve = {
2491
2539
  contentType: "media",
2492
- title: h.metadata?.attachment_title,
2493
- mimeType: h.metadata?.attachment_mime_type,
2494
- thumbnailUrl: h.metadata?.attachment_thumbnail,
2495
- amountText: h.metadata?.amount_text,
2496
- detail: h.metadata?.attachment_detail,
2497
- paymentStatus: h.metadata?.payment_status,
2498
- onFetchSource: N ? () => N(h, C) : void 0
2540
+ title: m.metadata?.attachment_title,
2541
+ mimeType: m.metadata?.attachment_mime_type,
2542
+ thumbnailUrl: m.metadata?.attachment_thumbnail,
2543
+ amountText: m.metadata?.amount_text,
2544
+ detail: m.metadata?.attachment_detail,
2545
+ paymentStatus: m.metadata?.payment_status,
2546
+ onFetchSource: D ? () => D(m, C) : void 0
2499
2547
  }, He = /* @__PURE__ */ G("div", {
2500
- className: J("str-chat__message-bubble", { "relative isolate": De }),
2501
- children: [/* @__PURE__ */ W(I, {
2548
+ className: Y("str-chat__message-bubble", { "relative isolate": De }),
2549
+ children: [/* @__PURE__ */ W(R, {
2502
2550
  message: Ce,
2503
2551
  renderText: g
2504
- }), De && /* @__PURE__ */ W(Wt, { side: Z ? "me" : "other" })]
2552
+ }), De && /* @__PURE__ */ W(qt, { side: Z ? "me" : "other" })]
2505
2553
  });
2506
2554
  return /* @__PURE__ */ G(U, { children: [
2507
- n && /* @__PURE__ */ W(B, { additionalMessageInputProps: t }),
2508
- L && /* @__PURE__ */ W(D, {
2509
- MessageBouncePrompt: pe,
2510
- onClose: () => z(!1),
2511
- open: L
2555
+ n && /* @__PURE__ */ W(ie, { additionalMessageInputProps: t }),
2556
+ F && /* @__PURE__ */ W(k, {
2557
+ MessageBouncePrompt: oe,
2558
+ onClose: () => L(!1),
2559
+ open: F
2512
2560
  }),
2513
2561
  /* @__PURE__ */ G("div", {
2514
2562
  className: Me,
2515
- "data-message-id": h.id,
2563
+ "data-message-id": m.id,
2516
2564
  "data-dd-privacy": "mask",
2517
2565
  children: [
2518
- K && /* @__PURE__ */ W(K, {}),
2519
- !!ne && /* @__PURE__ */ W(_e, { reminder: ne }),
2520
- h.user && /* @__PURE__ */ W(pt, {
2566
+ ve && /* @__PURE__ */ W(ve, {}),
2567
+ !!z && /* @__PURE__ */ W(_e, { reminder: z }),
2568
+ m.user && /* @__PURE__ */ W(gt, {
2521
2569
  className: "str-chat__avatar str-chat__message-sender-avatar",
2522
- id: h.user.id,
2523
- image: h.user.image,
2524
- name: h.user.name || h.user.id,
2570
+ id: m.user.id,
2571
+ image: m.user.image,
2572
+ name: m.user.name || m.user.id,
2525
2573
  size: 24,
2526
2574
  shape: "circle",
2527
2575
  dmAgentEnabled: Fe
2528
2576
  }),
2529
2577
  /* @__PURE__ */ W("div", {
2530
- className: J("str-chat__message-inner", { "str-chat__simple-message--error-failed": Ae || je }),
2578
+ className: Y("str-chat__message-inner", { "str-chat__simple-message--error-failed": Ae || je }),
2531
2579
  "data-testid": "message-inner",
2532
2580
  onClick: X,
2533
2581
  onKeyDown: X,
@@ -2539,46 +2587,46 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2539
2587
  },
2540
2588
  children: Pe ? /* @__PURE__ */ G("div", {
2541
2589
  className: "str-chat__message-bubble-wrapper message-tip-wrapper",
2542
- children: [/* @__PURE__ */ W(Zt, { message: h }), h.text?.trim() && He]
2543
- }) : Rt(h) ? /* @__PURE__ */ W("div", {
2590
+ children: [/* @__PURE__ */ W(en, { message: m }), m.text?.trim() && He]
2591
+ }) : Vt(m) ? /* @__PURE__ */ W("div", {
2544
2592
  className: "str-chat__message-bubble-wrapper",
2545
2593
  children: /* @__PURE__ */ G("div", {
2546
2594
  className: "flex items-center gap-2",
2547
2595
  children: [
2548
- Z && V && /* @__PURE__ */ W(V, {}),
2549
- Z ? /* @__PURE__ */ W(Nt, {
2596
+ Z && B && /* @__PURE__ */ W(B, {}),
2597
+ Z ? /* @__PURE__ */ W(It, {
2550
2598
  ...Be,
2551
2599
  isMine: !0
2552
- }) : /* @__PURE__ */ W(Nt, {
2600
+ }) : /* @__PURE__ */ W(It, {
2553
2601
  ...Be,
2554
2602
  isMine: !1,
2555
- isUnlocking: T(h.id),
2556
- onUnlockClick: () => j?.(h, C)
2603
+ isUnlocking: w(m.id),
2604
+ onUnlockClick: () => T?.(m, C)
2557
2605
  }),
2558
- !Z && V && /* @__PURE__ */ W(V, {})
2606
+ !Z && B && /* @__PURE__ */ W(B, {})
2559
2607
  ]
2560
2608
  })
2561
- }) : zt(h) ? /* @__PURE__ */ G("div", {
2609
+ }) : Ht(m) ? /* @__PURE__ */ G("div", {
2562
2610
  className: "str-chat__message-bubble-wrapper message-locked-attachment-wrapper",
2563
2611
  children: [/* @__PURE__ */ G("div", {
2564
2612
  className: "flex items-center gap-2",
2565
2613
  children: [
2566
- Z && V && /* @__PURE__ */ W(V, {}),
2567
- Z ? /* @__PURE__ */ W(Nt, {
2614
+ Z && B && /* @__PURE__ */ W(B, {}),
2615
+ Z ? /* @__PURE__ */ W(It, {
2568
2616
  ...Ve,
2569
2617
  isMine: !0,
2570
- onPreviewClick: () => j ? j(h, C) : void 0
2571
- }) : /* @__PURE__ */ W(Nt, {
2618
+ onPreviewClick: () => T ? T(m, C) : void 0
2619
+ }) : /* @__PURE__ */ W(It, {
2572
2620
  ...Ve,
2573
2621
  isMine: !1,
2574
- isUnlocking: T(h.id),
2575
- onUnlockClick: () => j ? j(h, C) : void 0,
2576
- onDownloadClick: () => F ? F(h, C) : void 0
2622
+ isUnlocking: w(m.id),
2623
+ onUnlockClick: () => T ? T(m, C) : void 0,
2624
+ onDownloadClick: () => N ? N(m, C) : void 0
2577
2625
  }),
2578
- !Z && V && /* @__PURE__ */ W(V, {})
2626
+ !Z && B && /* @__PURE__ */ W(B, {})
2579
2627
  ]
2580
- }), h.text && He]
2581
- }) : ze ? /* @__PURE__ */ W(ii, {
2628
+ }), m.text && He]
2629
+ }) : ze ? /* @__PURE__ */ W(fi, {
2582
2630
  groupPosition: Ee,
2583
2631
  isMyMessage: Z,
2584
2632
  message: {
@@ -2590,101 +2638,101 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2590
2638
  }) : /* @__PURE__ */ W("div", {
2591
2639
  className: "str-chat__message-bubble-wrapper",
2592
2640
  children: /* @__PURE__ */ G("div", {
2593
- className: J("str-chat__message-bubble", { "relative isolate": De }),
2641
+ className: Y("str-chat__message-bubble", { "relative isolate": De }),
2594
2642
  children: [
2595
- Fe && !Re && /* @__PURE__ */ W(Vt, {
2596
- message: h,
2643
+ Fe && !Re && /* @__PURE__ */ W(Wt, {
2644
+ message: m,
2597
2645
  hasAttachment: Le,
2598
2646
  isMyMessage: Z
2599
2647
  }),
2600
- Ne && /* @__PURE__ */ W(R, { poll: Ne }),
2601
- q?.length && !h.quoted_message ? /* @__PURE__ */ W(re, {
2648
+ Ne && /* @__PURE__ */ W(ee, { poll: Ne }),
2649
+ q?.length && !m.quoted_message ? /* @__PURE__ */ W(te, {
2602
2650
  actionHandler: s,
2603
2651
  attachments: q
2604
2652
  }) : null,
2605
- W(xe ? ve : I, {
2653
+ W(K ? H : R, {
2606
2654
  message: Ce,
2607
2655
  renderText: g
2608
2656
  }),
2609
- /* @__PURE__ */ W(A, {}),
2610
- De && /* @__PURE__ */ W(Wt, { side: Z ? "me" : "other" })
2657
+ /* @__PURE__ */ W(M, {}),
2658
+ De && /* @__PURE__ */ W(qt, { side: Z ? "me" : "other" })
2611
2659
  ]
2612
2660
  })
2613
2661
  })
2614
2662
  }),
2615
2663
  !Ie && !Pe && /* @__PURE__ */ W("div", {
2616
2664
  className: "str-chat__message-footer",
2617
- children: (!Fe || Re) && /* @__PURE__ */ W(Vt, {
2618
- message: h,
2665
+ children: (!Fe || Re) && /* @__PURE__ */ W(Wt, {
2666
+ message: m,
2619
2667
  hasAttachment: Le,
2620
2668
  isMyMessage: Z
2621
2669
  })
2622
2670
  }),
2623
- /* @__PURE__ */ W(rn, {
2624
- onOutboundClick: b,
2671
+ /* @__PURE__ */ W(sn, {
2672
+ onOutboundClick: y,
2625
2673
  resolvedOutbound: x
2626
2674
  }),
2627
- Oe && /* @__PURE__ */ W(he, {
2675
+ Oe && /* @__PURE__ */ W(ge, {
2628
2676
  onClick: c,
2629
- reply_count: h.reply_count
2677
+ reply_count: m.reply_count
2630
2678
  }),
2631
- ke && /* @__PURE__ */ W(H, {})
2679
+ ke && /* @__PURE__ */ W(pe, {})
2632
2680
  ]
2633
- }, h.id)
2681
+ }, m.id)
2634
2682
  ] });
2635
- }, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : V(e, t)), oi = (e) => {
2636
- let t = H("CustomMessage"), n = c(Gt), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
2637
- return /* @__PURE__ */ W(ai, {
2683
+ }, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)), mi = (e) => {
2684
+ let t = H("CustomMessage"), n = u(Jt), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
2685
+ return /* @__PURE__ */ W(pi, {
2638
2686
  ...t,
2639
2687
  ...e,
2640
2688
  resolvedOutbound: i
2641
2689
  });
2642
- }, si = () => {
2690
+ }, hi = () => {
2643
2691
  let { handleDelete: e, message: t } = H("CustomMessageActions");
2644
- return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ W(Ge, {
2692
+ return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ W(Je, {
2645
2693
  onClick: e,
2646
2694
  "aria-label": "Delete",
2647
2695
  title: "Delete",
2648
2696
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
2649
- children: /* @__PURE__ */ W(Ve, {
2697
+ children: /* @__PURE__ */ W(We, {
2650
2698
  size: 16,
2651
2699
  weight: "light",
2652
2700
  "aria-hidden": !0
2653
2701
  })
2654
2702
  });
2655
- }, ci = () => {
2703
+ }, gi = () => {
2656
2704
  let { handleFlag: e } = H("CustomMessageActions");
2657
- return /* @__PURE__ */ W(Ge, {
2705
+ return /* @__PURE__ */ W(Je, {
2658
2706
  onClick: e,
2659
2707
  "aria-label": "Report",
2660
2708
  title: "Report",
2661
2709
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
2662
- children: /* @__PURE__ */ W(X, {
2710
+ children: /* @__PURE__ */ W(Ne, {
2663
2711
  size: 16,
2664
2712
  weight: "light",
2665
2713
  "aria-hidden": !0
2666
2714
  })
2667
2715
  });
2668
- }, li = () => {
2716
+ }, _i = () => {
2669
2717
  let { message: e } = H("CustomMessageActions");
2670
- return e.metadata?.custom_type === K.ATTACHMENT ? /* @__PURE__ */ W(Ke, { messageActionSet: [{
2671
- Component: si,
2718
+ return e.metadata?.custom_type === K.ATTACHMENT ? /* @__PURE__ */ W(Ye, { messageActionSet: [{
2719
+ Component: hi,
2672
2720
  placement: "quick",
2673
2721
  type: "delete"
2674
2722
  }, {
2675
- Component: ci,
2723
+ Component: gi,
2676
2724
  placement: "quick",
2677
2725
  type: "flag"
2678
2726
  }] }) : null;
2679
- }, ui = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => h.previewIsLoaded(e) || h.previewIsLoading(e)) }), di = () => {
2680
- let { linkPreviewsManager: e } = pe(), { linkPreviews: t } = _e(e.state, ui), n = (t) => {
2727
+ }, vi = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => _.previewIsLoaded(e) || _.previewIsLoading(e)) }), yi = () => {
2728
+ let { linkPreviewsManager: e } = ge(), { linkPreviews: t } = be(e.state, vi), n = (t) => {
2681
2729
  e.dismissPreview(t);
2682
2730
  };
2683
2731
  return t.length > 0 ? /* @__PURE__ */ W("div", {
2684
2732
  className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2",
2685
2733
  children: t.map((e) => {
2686
- let t = h.previewIsLoading(e);
2687
- return /* @__PURE__ */ W(Fn.Composer, {
2734
+ let t = _.previewIsLoading(e);
2735
+ return /* @__PURE__ */ W(Rn.Composer, {
2688
2736
  title: e.title,
2689
2737
  url: e.og_scrape_url,
2690
2738
  thumbnailUrl: e.image_url,
@@ -2694,27 +2742,27 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2694
2742
  }, e.og_scrape_url);
2695
2743
  })
2696
2744
  }) : null;
2697
- }, fi = i.createContext(!1), pi = 200, mi = () => c(fi), hi = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ W("button", {
2745
+ }, bi = o.createContext(!1), xi = 200, Si = () => u(bi), Ci = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ W("button", {
2698
2746
  ...n,
2699
2747
  type: "button",
2700
2748
  "aria-label": "Send",
2701
2749
  disabled: t,
2702
2750
  onPointerDown: (e) => e.preventDefault(),
2703
2751
  onClick: e,
2704
- children: /* @__PURE__ */ W(Te, {
2752
+ children: /* @__PURE__ */ W(De, {
2705
2753
  weight: "bold",
2706
2754
  className: "size-4"
2707
2755
  })
2708
- }), gi = () => {
2709
- let e = c(fi), { handleSubmit: t } = he(), n = me(), r = e || !n, { SendButton: a = hi, AttachmentPreviewList: o = y } = fe("CustomMessageInput"), s = i.useRef(null);
2710
- return i.useEffect(() => {
2756
+ }), wi = () => {
2757
+ let e = u(bi), { handleSubmit: t } = ve(), n = _e(), r = e || !n, { SendButton: i = Ci, AttachmentPreviewList: a = x } = he("CustomMessageInput"), s = o.useRef(null);
2758
+ return o.useEffect(() => {
2711
2759
  let e = s.current;
2712
2760
  if (!e || typeof ResizeObserver > "u") return;
2713
2761
  let t = new ResizeObserver(() => {
2714
2762
  e.contains(document.activeElement) && (e.scrollTop = e.scrollHeight);
2715
2763
  });
2716
2764
  return t.observe(e), () => t.disconnect();
2717
- }, []), i.useEffect(() => {
2765
+ }, []), o.useEffect(() => {
2718
2766
  let e = s.current;
2719
2767
  if (!e) return;
2720
2768
  let t = (e) => {
@@ -2728,13 +2776,13 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2728
2776
  children: [/* @__PURE__ */ G("div", {
2729
2777
  className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2",
2730
2778
  children: [
2731
- /* @__PURE__ */ W(z, {}),
2732
- /* @__PURE__ */ W(di, {}),
2733
- /* @__PURE__ */ W(o, {})
2779
+ /* @__PURE__ */ W(te, {}),
2780
+ /* @__PURE__ */ W(yi, {}),
2781
+ /* @__PURE__ */ W(a, {})
2734
2782
  ]
2735
2783
  }), /* @__PURE__ */ G("div", {
2736
2784
  className: "messaging-composer-row flex items-start",
2737
- children: [/* @__PURE__ */ W(ne, {
2785
+ children: [/* @__PURE__ */ W(ie, {
2738
2786
  "aria-disabled": e || void 0,
2739
2787
  containerClassName: "min-w-0 flex-1 leading-[0]",
2740
2788
  className: "w-full resize-none overflow-hidden bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm",
@@ -2745,7 +2793,7 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2745
2793
  tabIndex: e ? -1 : void 0
2746
2794
  }), /* @__PURE__ */ W("div", {
2747
2795
  className: "sticky bottom-2 mt-auto mb-2 mr-2 shrink-0 pt-2",
2748
- children: /* @__PURE__ */ W(a, {
2796
+ children: /* @__PURE__ */ W(i, {
2749
2797
  sendMessage: t,
2750
2798
  "aria-label": "Send",
2751
2799
  className: "str-chat__send-button relative flex justify-center items-center rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring before:absolute before:-inset-2 before:content-['']",
@@ -2756,7 +2804,7 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2756
2804
  })]
2757
2805
  })]
2758
2806
  });
2759
- }, _i = () => /* @__PURE__ */ G("div", {
2807
+ }, Ti = () => /* @__PURE__ */ G("div", {
2760
2808
  className: "messaging-composer-backdrop",
2761
2809
  "aria-hidden": "true",
2762
2810
  children: [
@@ -2767,16 +2815,16 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2767
2815
  /* @__PURE__ */ W("div", { className: "messaging-composer-backdrop-blur" }),
2768
2816
  /* @__PURE__ */ W("div", { className: "messaging-composer-backdrop-gradient" })
2769
2817
  ]
2770
- }), vi = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: a, composerInput: o }) => {
2771
- let { channel: s } = ue(), c = s?.data?.frozen === !0, l = !!o, u = i.useRef(null);
2772
- return i.useEffect(() => {
2818
+ }), Ei = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: i, composerInput: a }) => {
2819
+ let { channel: s } = V(), c = s?.data?.frozen === !0, l = !!a, u = o.useRef(null);
2820
+ return o.useEffect(() => {
2773
2821
  if (!l) return;
2774
2822
  let e = u.current, t = e?.parentElement;
2775
2823
  if (!e || !t) return;
2776
2824
  let n = e.offsetHeight, r = () => {
2777
2825
  let r = e.offsetHeight, i = r > n;
2778
2826
  n = r;
2779
- let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight < pi : !1;
2827
+ let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight < xi : !1;
2780
2828
  t.style.setProperty("--messaging-composer-height", `${r}px`), i && o && a && (a.scrollTop = a.scrollHeight);
2781
2829
  };
2782
2830
  if (r(), typeof ResizeObserver > "u") return;
@@ -2787,15 +2835,15 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2787
2835
  }, [l]), r ? l ? /* @__PURE__ */ G("div", {
2788
2836
  ref: u,
2789
2837
  className: "messaging-composer-chrome messaging-composer-chrome--floating",
2790
- children: [/* @__PURE__ */ W(_i, {}), /* @__PURE__ */ G("div", {
2838
+ children: [/* @__PURE__ */ W(Ti, {}), /* @__PURE__ */ G("div", {
2791
2839
  className: "relative z-10 flex flex-col",
2792
2840
  children: [
2793
2841
  t?.(),
2794
2842
  /* @__PURE__ */ W("div", {
2795
2843
  className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4",
2796
- children: a ? /* @__PURE__ */ W("p", {
2844
+ children: i ? /* @__PURE__ */ W("p", {
2797
2845
  className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40",
2798
- children: a
2846
+ children: i
2799
2847
  }) : null
2800
2848
  }),
2801
2849
  n?.()
@@ -2805,16 +2853,16 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2805
2853
  t?.(),
2806
2854
  /* @__PURE__ */ W("div", {
2807
2855
  className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4",
2808
- children: a ? /* @__PURE__ */ W("p", {
2856
+ children: i ? /* @__PURE__ */ W("p", {
2809
2857
  className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40",
2810
- children: a
2858
+ children: i
2811
2859
  }) : null
2812
2860
  }),
2813
2861
  n?.()
2814
2862
  ] }) : l ? /* @__PURE__ */ G("div", {
2815
2863
  ref: u,
2816
2864
  className: "messaging-composer-chrome messaging-composer-chrome--floating",
2817
- children: [/* @__PURE__ */ W(_i, {}), /* @__PURE__ */ G("div", {
2865
+ children: [/* @__PURE__ */ W(Ti, {}), /* @__PURE__ */ G("div", {
2818
2866
  className: "relative z-10 flex min-h-0 flex-col",
2819
2867
  children: [t?.(), /* @__PURE__ */ G("div", {
2820
2868
  className: "flex min-h-0 flex-col gap-4 p-3 pb-5 md:p-5",
@@ -2825,9 +2873,9 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2825
2873
  children: [e && /* @__PURE__ */ W("div", {
2826
2874
  className: "flex h-12 shrink-0 items-center justify-center",
2827
2875
  children: e()
2828
- }), /* @__PURE__ */ W(fi.Provider, {
2876
+ }), /* @__PURE__ */ W(bi.Provider, {
2829
2877
  value: c,
2830
- children: /* @__PURE__ */ W(j, { Input: o ?? gi })
2878
+ children: /* @__PURE__ */ W(N, { Input: a ?? wi })
2831
2879
  })]
2832
2880
  }), n?.()]
2833
2881
  })]
@@ -2843,51 +2891,51 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2843
2891
  children: [e && /* @__PURE__ */ W("div", {
2844
2892
  className: "flex h-12 shrink-0 items-center justify-center",
2845
2893
  children: e()
2846
- }), /* @__PURE__ */ W(fi.Provider, {
2894
+ }), /* @__PURE__ */ W(bi.Provider, {
2847
2895
  value: c,
2848
- children: /* @__PURE__ */ W(j, { Input: gi })
2896
+ children: /* @__PURE__ */ W(N, { Input: wi })
2849
2897
  })]
2850
2898
  }),
2851
2899
  n?.()
2852
2900
  ]
2853
2901
  });
2854
- }, yi = {
2902
+ }, Di = {
2855
2903
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
2856
2904
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
2857
- }, bi = ["SYSTEM_AGE_SAFETY_BLOCKED"], xi = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, Si = "age safety guidelines.", Ci = "https://linktr.ee/s/about/contact", wi = (e) => bi.includes(e), Ti = (e) => wi(e.metadata?.custom_type), Ei = (e) => {
2905
+ }, Oi = ["SYSTEM_AGE_SAFETY_BLOCKED"], ki = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, Ai = "age safety guidelines.", ji = "https://linktr.ee/s/about/contact", Mi = (e) => Oi.includes(e), Ni = (e) => Mi(e.metadata?.custom_type), Pi = (e) => {
2858
2906
  let t = e.metadata?.custom_type;
2859
- if (xe(t)) return {
2907
+ if (Ce(t)) return {
2860
2908
  kind: "dm-agent",
2861
2909
  type: t
2862
2910
  };
2863
- if (be(t)) return {
2911
+ if (Se(t)) return {
2864
2912
  kind: "age-safety",
2865
2913
  type: t
2866
2914
  };
2867
2915
  let n = e.dm_agent_system_type;
2868
- if (xe(n)) return {
2916
+ if (Ce(n)) return {
2869
2917
  kind: "dm-agent",
2870
2918
  type: n
2871
2919
  };
2872
- }, Di = (e) => {
2873
- let t = e.indexOf(Si);
2920
+ }, Fi = (e) => {
2921
+ let t = e.indexOf(Ai);
2874
2922
  if (t === -1) return e;
2875
2923
  let n = t + 22;
2876
2924
  return /* @__PURE__ */ G(U, { children: [
2877
2925
  e.slice(0, t),
2878
2926
  /* @__PURE__ */ W("a", {
2879
- href: Ci,
2927
+ href: ji,
2880
2928
  target: "_blank",
2881
2929
  rel: "noopener noreferrer",
2882
2930
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
2883
- children: Si
2931
+ children: Ai
2884
2932
  }),
2885
2933
  e.slice(n)
2886
2934
  ] });
2887
- }, Oi = (e) => {
2888
- let t = !Ti(e.message), n = Ei(e.message);
2935
+ }, Ii = (e) => {
2936
+ let t = !Ni(e.message), n = Pi(e.message);
2889
2937
  if (n?.kind === "dm-agent") {
2890
- let r = e.message.text?.trim() || yi[n.type];
2938
+ let r = e.message.text?.trim() || Di[n.type];
2891
2939
  return /* @__PURE__ */ G("div", {
2892
2940
  className: "str-chat__message--system",
2893
2941
  "data-testid": "message-system",
@@ -2895,7 +2943,7 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2895
2943
  className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
2896
2944
  "data-testid": "dm-agent-system-message",
2897
2945
  "data-dm-agent-system-type": n.type,
2898
- children: [/* @__PURE__ */ W(Re, {
2946
+ children: [/* @__PURE__ */ W(Ve, {
2899
2947
  size: 16,
2900
2948
  weight: "regular",
2901
2949
  "aria-hidden": !0,
@@ -2904,11 +2952,11 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2904
2952
  className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]",
2905
2953
  children: r
2906
2954
  })]
2907
- }), !t && /* @__PURE__ */ W(L, { message: e.message })]
2955
+ }), !t && /* @__PURE__ */ W(z, { message: e.message })]
2908
2956
  });
2909
2957
  }
2910
2958
  if (n?.kind === "age-safety") {
2911
- let r = e.message.text?.trim() || xi[n.type];
2959
+ let r = e.message.text?.trim() || ki[n.type];
2912
2960
  return /* @__PURE__ */ G("div", {
2913
2961
  className: "str-chat__message--system",
2914
2962
  "data-testid": "message-system",
@@ -2916,7 +2964,7 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2916
2964
  className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
2917
2965
  "data-testid": "age-safety-system-message",
2918
2966
  "data-age-safety-system-type": n.type,
2919
- children: [/* @__PURE__ */ W(Fe, {
2967
+ children: [/* @__PURE__ */ W(Re, {
2920
2968
  size: 24,
2921
2969
  weight: "duotone",
2922
2970
  "aria-hidden": !0,
@@ -2926,10 +2974,10 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2926
2974
  className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]",
2927
2975
  children: /* @__PURE__ */ W("p", {
2928
2976
  className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]",
2929
- children: Di(r)
2977
+ children: Fi(r)
2930
2978
  })
2931
2979
  })]
2932
- }), !t && /* @__PURE__ */ W(L, { message: e.message })]
2980
+ }), !t && /* @__PURE__ */ W(z, { message: e.message })]
2933
2981
  });
2934
2982
  }
2935
2983
  return /* @__PURE__ */ G("div", {
@@ -2942,9 +2990,9 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2942
2990
  /* @__PURE__ */ W("p", { children: e.message.text }),
2943
2991
  /* @__PURE__ */ W("div", { className: "str-chat__message--system__line" })
2944
2992
  ]
2945
- }), !t && /* @__PURE__ */ W(L, { message: e.message })]
2993
+ }), !t && /* @__PURE__ */ W(z, { message: e.message })]
2946
2994
  });
2947
- }, ki = o(!1), Ai = ({ cx: e, index: t }) => /* @__PURE__ */ W("circle", {
2995
+ }, Li = c(!1), Ri = ({ cx: e, index: t }) => /* @__PURE__ */ W("circle", {
2948
2996
  cx: e,
2949
2997
  cy: "6.15",
2950
2998
  r: "3.9",
@@ -2957,15 +3005,15 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2957
3005
  begin: `${120 * t}ms`,
2958
3006
  repeatCount: "indefinite"
2959
3007
  })
2960
- }), ji = /* @__PURE__ */ new Set([
2961
- _.Thinking,
2962
- _.Generating,
2963
- _.ExternalSources
2964
- ]), Mi = ({ threadList: e }) => {
2965
- let { channel: t, channelConfig: n, thread: r } = ue(), { client: i } = de(), { typing: a = {} } = ve(), { aiState: o } = le(t), s = c(ki);
2966
- if (!e && s && ji.has(o)) {
2967
- let e = Pi(t, i.user?.id);
2968
- return /* @__PURE__ */ W(Ni, {
3008
+ }), zi = /* @__PURE__ */ new Set([
3009
+ y.Thinking,
3010
+ y.Generating,
3011
+ y.ExternalSources
3012
+ ]), Bi = ({ threadList: e }) => {
3013
+ let { channel: t, channelConfig: n, thread: r } = V(), { client: i } = me(), { typing: a = {} } = xe(), { aiState: o } = fe(t), s = u(Li);
3014
+ if (!e && s && zi.has(o)) {
3015
+ let e = Hi(t, i.user?.id);
3016
+ return /* @__PURE__ */ W(Vi, {
2969
3017
  avatarId: e?.id ?? "ai-agent",
2970
3018
  avatarName: e?.name ?? e?.id ?? "Agent",
2971
3019
  avatarImage: e?.image,
@@ -2973,22 +3021,22 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
2973
3021
  });
2974
3022
  }
2975
3023
  if (n?.typing_events === !1) return null;
2976
- let l = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), u = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], d = e ? u : l;
3024
+ let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], d = e ? l : c;
2977
3025
  if (!d.length) return null;
2978
3026
  let f = d[0]?.user, p = f?.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
2979
- return /* @__PURE__ */ W(Ni, {
3027
+ return /* @__PURE__ */ W(Vi, {
2980
3028
  avatarId: f?.id ?? p?.id ?? "typing-user",
2981
3029
  avatarName: f?.name ?? p?.name ?? f?.id ?? "Typing user",
2982
3030
  avatarImage: f?.image ?? p?.image,
2983
3031
  testId: "typing-indicator"
2984
3032
  });
2985
- }, Ni = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ W("div", {
3033
+ }, Vi = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ W("div", {
2986
3034
  className: "str-chat__li str-chat__li--single str-chat__typing-indicator !static",
2987
3035
  "data-testid": r,
2988
3036
  style: { marginBottom: "var(--messaging-channel-input-spacer-height, 80px)" },
2989
3037
  children: /* @__PURE__ */ G("div", {
2990
3038
  className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text",
2991
- children: [/* @__PURE__ */ W(pt, {
3039
+ children: [/* @__PURE__ */ W(gt, {
2992
3040
  className: "str-chat__avatar str-chat__message-sender-avatar",
2993
3041
  id: e,
2994
3042
  name: t,
@@ -3013,28 +3061,28 @@ var ii = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
3013
3061
  height: "13",
3014
3062
  overflow: "visible",
3015
3063
  children: [
3016
- /* @__PURE__ */ W(Ai, {
3064
+ /* @__PURE__ */ W(Ri, {
3017
3065
  cx: "4",
3018
3066
  index: 0
3019
3067
  }),
3020
- /* @__PURE__ */ W(Ai, {
3068
+ /* @__PURE__ */ W(Ri, {
3021
3069
  cx: "16",
3022
3070
  index: 1
3023
3071
  }),
3024
- /* @__PURE__ */ W(Ai, {
3072
+ /* @__PURE__ */ W(Ri, {
3025
3073
  cx: "28",
3026
3074
  index: 2
3027
3075
  })
3028
3076
  ]
3029
3077
  })
3030
3078
  })
3031
- }), /* @__PURE__ */ W(Wt, { side: "other" })]
3079
+ }), /* @__PURE__ */ W(qt, { side: "other" })]
3032
3080
  })
3033
3081
  })
3034
3082
  })]
3035
3083
  })
3036
3084
  });
3037
- function Pi(e, t) {
3085
+ function Hi(e, t) {
3038
3086
  let n = e?.state?.members ?? {};
3039
3087
  for (let e of Object.values(n)) {
3040
3088
  let n = e?.user;
@@ -3043,8 +3091,8 @@ function Pi(e, t) {
3043
3091
  }
3044
3092
  //#endregion
3045
3093
  //#region src/components/MessagingShell/ChannelEmptyState.tsx
3046
- var Fi = () => null, Ii = ({ className: e, message: t }) => /* @__PURE__ */ G("div", {
3047
- className: J("flex items-center justify-center h-full", e),
3094
+ var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ G("div", {
3095
+ className: Y("flex items-center justify-center h-full", e),
3048
3096
  children: [/* @__PURE__ */ G("svg", {
3049
3097
  viewBox: "0 0 100 100",
3050
3098
  className: "size-8 fill-pebble",
@@ -3094,65 +3142,65 @@ var Fi = () => null, Ii = ({ className: e, message: t }) => /* @__PURE__ */ G("d
3094
3142
  className: "text-stone",
3095
3143
  children: t
3096
3144
  })]
3097
- }), Li = i.memo(() => /* @__PURE__ */ W("div", {
3145
+ }), Gi = o.memo(() => /* @__PURE__ */ W("div", {
3098
3146
  className: "messaging-loading-state flex items-center justify-center h-full",
3099
3147
  children: /* @__PURE__ */ G("div", {
3100
3148
  className: "flex items-center",
3101
- children: [/* @__PURE__ */ W(Ii, { className: "w-6 h-6" }), /* @__PURE__ */ W("span", {
3149
+ children: [/* @__PURE__ */ W(Wi, { className: "w-6 h-6" }), /* @__PURE__ */ W("span", {
3102
3150
  className: "text-sm text-stone",
3103
3151
  children: "Loading messages"
3104
3152
  })]
3105
3153
  })
3106
3154
  }));
3107
- Li.displayName = "LoadingState";
3155
+ Gi.displayName = "LoadingState";
3108
3156
  //#endregion
3109
3157
  //#region src/components/ChannelView.tsx
3110
- var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: c, showDeleteConversation: u = !0, onDeleteConversationClick: d, onBlockParticipantClick: p, onReportParticipantClick: m, showBlockParticipant: h = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
3111
- let { channel: A, messages: j } = ue(), M = f(D);
3112
- l(() => {
3158
+ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: i, onLeaveConversation: a, onBlockParticipant: s, showDeleteConversation: c = !0, onDeleteConversationClick: u, onBlockParticipantClick: f, onReportParticipantClick: p, showBlockParticipant: h = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
3159
+ let { channel: A, messages: j } = V(), M = m(D);
3160
+ d(() => {
3113
3161
  M.current = D;
3114
3162
  }, [D]);
3115
- let P = s((e) => {
3163
+ let N = l((e) => {
3116
3164
  M.current?.(e);
3117
- }, []), F = D ? P : void 0, I = Yt(j, O), L = A.state.messages.some((e) => e.type !== "deleted"), R = b ? /* @__PURE__ */ W(i.Fragment, { children: b() }, "lt-channel-banner") : null, z = /* @__PURE__ */ W(xt, {
3165
+ }, []), P = D ? N : void 0, I = Qt(j, O), L = A.state.messages.some((e) => e.type !== "deleted"), R = b ? /* @__PURE__ */ W(o.Fragment, { children: b() }, "lt-channel-banner") : null, z = /* @__PURE__ */ W(wt, {
3118
3166
  className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
3119
3167
  onBack: e,
3120
3168
  showBackButton: t,
3121
3169
  showChannelInfo: T,
3122
3170
  showStarButton: y,
3123
- onLeaveConversation: o,
3124
- onBlockParticipant: c,
3125
- showDeleteConversation: u,
3171
+ onLeaveConversation: a,
3172
+ onBlockParticipant: s,
3173
+ showDeleteConversation: c,
3126
3174
  showBlockParticipant: h,
3127
3175
  showReportParticipant: g,
3128
- onDeleteConversationClick: d,
3129
- onBlockParticipantClick: p,
3130
- onReportParticipantClick: m,
3176
+ onDeleteConversationClick: u,
3177
+ onBlockParticipantClick: f,
3178
+ onReportParticipantClick: p,
3131
3179
  customChannelActions: x,
3132
3180
  renderChannelActions: S,
3133
3181
  onParticipantNameClick: E
3134
- }), ee = s((e) => {
3135
- let { message: t } = H("ChannelView"), n = /* @__PURE__ */ W(oi, {
3182
+ }), ee = l((e) => {
3183
+ let { message: t } = H("ChannelView"), n = /* @__PURE__ */ W(mi, {
3136
3184
  ...e,
3137
3185
  viewerLanguage: w,
3138
- onOutboundClick: F
3186
+ onOutboundClick: P
3139
3187
  });
3140
3188
  return !C || !t ? n : C(n, t);
3141
3189
  }, [
3142
- F,
3190
+ P,
3143
3191
  C,
3144
3192
  w
3145
3193
  ]);
3146
- return /* @__PURE__ */ W(Gt.Provider, {
3194
+ return /* @__PURE__ */ W(Jt.Provider, {
3147
3195
  value: I,
3148
- children: /* @__PURE__ */ W(B, {
3196
+ children: /* @__PURE__ */ W(ae, {
3149
3197
  overrides: {
3150
3198
  Message: ee,
3151
- MessageActions: li,
3199
+ MessageActions: _i,
3152
3200
  UnreadMessagesNotification: () => null,
3153
3201
  UnreadMessagesSeparator: () => null
3154
3202
  },
3155
- children: /* @__PURE__ */ W(re, { children: k ? /* @__PURE__ */ G("div", {
3203
+ children: /* @__PURE__ */ W(B, { children: k ? /* @__PURE__ */ G("div", {
3156
3204
  className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col",
3157
3205
  children: [/* @__PURE__ */ G("div", {
3158
3206
  className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
@@ -3162,7 +3210,7 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3162
3210
  className: "str-chat__message-list-scroll",
3163
3211
  children: [z, R]
3164
3212
  })
3165
- }), /* @__PURE__ */ W(N, {
3213
+ }), /* @__PURE__ */ W(F, {
3166
3214
  head: L ? /* @__PURE__ */ G("div", {
3167
3215
  className: "sticky top-0 z-10",
3168
3216
  children: [z, R]
@@ -3170,9 +3218,9 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3170
3218
  hideDeletedMessages: !0,
3171
3219
  hideNewMessageSeparator: !1
3172
3220
  })]
3173
- }, "lt-channel-message-list"), /* @__PURE__ */ W(vi, {
3221
+ }, "lt-channel-message-list"), /* @__PURE__ */ W(Ei, {
3174
3222
  ...n && { renderActions: () => n?.(A) },
3175
- ...a && { renderHeader: () => a(A) },
3223
+ ...i && { renderHeader: () => i(A) },
3176
3224
  renderFooter: () => r?.(A),
3177
3225
  disabled: _,
3178
3226
  disabledReason: v,
@@ -3187,7 +3235,7 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3187
3235
  className: "str-chat__message-list-scroll",
3188
3236
  children: [z, R]
3189
3237
  })
3190
- }), /* @__PURE__ */ W(N, {
3238
+ }), /* @__PURE__ */ W(F, {
3191
3239
  head: L ? /* @__PURE__ */ G("div", {
3192
3240
  className: "sticky top-0 z-10",
3193
3241
  children: [z, R]
@@ -3196,8 +3244,8 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3196
3244
  hideNewMessageSeparator: !1
3197
3245
  })]
3198
3246
  }, "lt-channel-message-list"),
3199
- a ? /* @__PURE__ */ W(i.Fragment, { children: a(A) }, "lt-channel-conversation-footer") : null,
3200
- /* @__PURE__ */ W(vi, {
3247
+ i ? /* @__PURE__ */ W(o.Fragment, { children: i(A) }, "lt-channel-conversation-footer") : null,
3248
+ /* @__PURE__ */ W(Ei, {
3201
3249
  ...n && { renderActions: () => n?.(A) },
3202
3250
  renderFooter: () => r?.(A),
3203
3251
  disabled: _,
@@ -3207,9 +3255,9 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3207
3255
  ] }) })
3208
3256
  })
3209
3257
  });
3210
- }, zi = i.memo(({ channel: e, onBack: t, showBackButton: n = !1, renderMessageInputActions: r, renderMessageInputFooter: i, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: c, className: u, CustomChannelEmptyState: d = Fi, showDeleteConversation: p = !0, onDeleteConversationClick: m, onBlockParticipantClick: h, onReportParticipantClick: g, showBlockParticipant: _ = !0, showReportParticipant: v = !0, composerDisabled: y = !1, composerDisabledReason: x, dmAgentEnabled: S, messageMetadata: C, onMessageSent: w, showStarButton: T = !1, renderChannelBanner: E, customChannelActions: D, renderChannelActions: O, renderMessage: k, onMessageLinkClick: A, sendButton: j, attachmentPreviewList: M, viewerLanguage: N, showChannelInfo: P = !0, onParticipantNameClick: F, onOutboundClick: I, resolveOutbound: L, composerInput: R }) => {
3211
- let z = s(async (t, n, r) => {
3212
- let i = e.data?.chatbot_paused === !0, a = S && !i, o = {
3258
+ }, qi = o.memo(({ channel: e, onBack: t, showBackButton: n = !1, renderMessageInputActions: r, renderMessageInputFooter: i, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: s, className: c, CustomChannelEmptyState: u = Ui, showDeleteConversation: f = !0, onDeleteConversationClick: p, onBlockParticipantClick: h, onReportParticipantClick: g, showBlockParticipant: _ = !0, showReportParticipant: v = !0, composerDisabled: y = !1, composerDisabledReason: b, dmAgentEnabled: x, messageMetadata: C, onMessageSent: w, showStarButton: T = !1, renderChannelBanner: E, customChannelActions: D, renderChannelActions: O, renderMessage: k, onMessageLinkClick: A, sendButton: j, attachmentPreviewList: M, viewerLanguage: N, showChannelInfo: P = !0, onParticipantNameClick: F, onOutboundClick: I, resolveOutbound: L, composerInput: R }) => {
3259
+ let z = l(async (t, n, r) => {
3260
+ let i = e.data?.chatbot_paused === !0, a = x && !i, o = {
3213
3261
  ...n,
3214
3262
  ...a && { silent: !0 },
3215
3263
  ...C && { metadata: {
@@ -3223,11 +3271,11 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3223
3271
  return w?.(c), c;
3224
3272
  }, [
3225
3273
  e,
3226
- S,
3274
+ x,
3227
3275
  C,
3228
3276
  w
3229
- ]), ee = f(null);
3230
- l(() => {
3277
+ ]), ee = m(null);
3278
+ d(() => {
3231
3279
  if (!A) return;
3232
3280
  let t = ee.current;
3233
3281
  if (!t) return;
@@ -3239,40 +3287,40 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3239
3287
  };
3240
3288
  return t.addEventListener("click", n), () => t.removeEventListener("click", n);
3241
3289
  }, [A, e]);
3242
- let te = q(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
3290
+ let te = we(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
3243
3291
  return /* @__PURE__ */ W("div", {
3244
3292
  ref: ee,
3245
- className: J("messaging-channel-view h-full flex flex-col", u),
3293
+ className: Y("messaging-channel-view h-full flex flex-col", c),
3246
3294
  style: te,
3247
- children: /* @__PURE__ */ W(ki.Provider, {
3248
- value: S ?? !1,
3249
- children: /* @__PURE__ */ W(b, {
3295
+ children: /* @__PURE__ */ W(Li.Provider, {
3296
+ value: x ?? !1,
3297
+ children: /* @__PURE__ */ W(S, {
3250
3298
  channel: e,
3251
- MessageSystem: Oi,
3252
- EmptyStateIndicator: d,
3253
- LoadingIndicator: Li,
3254
- DateSeparator: St,
3255
- TypingIndicator: Mi,
3299
+ MessageSystem: Ii,
3300
+ EmptyStateIndicator: u,
3301
+ LoadingIndicator: Gi,
3302
+ DateSeparator: Tt,
3303
+ TypingIndicator: Bi,
3256
3304
  doSendMessageRequest: z,
3257
3305
  ...j ? { SendButton: j } : {},
3258
3306
  ...M ? { AttachmentPreviewList: M } : {},
3259
- children: /* @__PURE__ */ W(Ri, {
3307
+ children: /* @__PURE__ */ W(Ki, {
3260
3308
  onBack: t,
3261
3309
  showBackButton: n,
3262
3310
  renderMessageInputActions: r,
3263
3311
  renderMessageInputFooter: i,
3264
3312
  renderConversationFooter: a,
3265
3313
  onLeaveConversation: o,
3266
- onBlockParticipant: c,
3267
- CustomChannelEmptyState: d,
3268
- showDeleteConversation: p,
3269
- onDeleteConversationClick: m,
3314
+ onBlockParticipant: s,
3315
+ CustomChannelEmptyState: u,
3316
+ showDeleteConversation: f,
3317
+ onDeleteConversationClick: p,
3270
3318
  onBlockParticipantClick: h,
3271
3319
  onReportParticipantClick: g,
3272
3320
  showBlockParticipant: _,
3273
3321
  showReportParticipant: v,
3274
3322
  composerDisabled: y,
3275
- composerDisabledReason: x,
3323
+ composerDisabledReason: b,
3276
3324
  showStarButton: T,
3277
3325
  renderChannelBanner: E,
3278
3326
  customChannelActions: D,
@@ -3289,10 +3337,10 @@ var Ri = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
3289
3337
  })
3290
3338
  });
3291
3339
  });
3292
- zi.displayName = "ChannelView";
3340
+ qi.displayName = "ChannelView";
3293
3341
  //#endregion
3294
3342
  //#region src/components/MessagingShell/ErrorState.tsx
3295
- var Bi = i.memo(({ message: e, onBack: t }) => /* @__PURE__ */ W("div", {
3343
+ var Ji = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ W("div", {
3296
3344
  className: "messaging-error-state flex items-center justify-center h-full p-8",
3297
3345
  children: /* @__PURE__ */ G("div", {
3298
3346
  className: "text-center max-w-sm",
@@ -3321,26 +3369,26 @@ var Bi = i.memo(({ message: e, onBack: t }) => /* @__PURE__ */ W("div", {
3321
3369
  ]
3322
3370
  })
3323
3371
  }));
3324
- Bi.displayName = "ErrorState";
3372
+ Ji.displayName = "ErrorState";
3325
3373
  //#endregion
3326
3374
  //#region src/components/MessagingShell/index.tsx
3327
- var Vi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: c, onBlockParticipantClick: u, onReportParticipantClick: d, dmAgentEnabled: m, onMessageSent: h, viewerLanguage: g, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
3328
- let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = tt(), [F, I] = p(null), [L, R] = p(null), [z, ee] = p(!1), { showDeleteConversation: te = !0 } = e, ne = f(o);
3375
+ var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: s, onBlockParticipantClick: c, onReportParticipantClick: u, dmAgentEnabled: f, onMessageSent: p, viewerLanguage: g, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
3376
+ let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = it(), [F, I] = h(null), [L, R] = h(null), [z, ee] = h(!1), { showDeleteConversation: te = !0 } = e, ne = m(o);
3329
3377
  ne.current = o;
3330
- let re = f(r);
3378
+ let re = m(r);
3331
3379
  re.current = r;
3332
- let B = f(null), V = f(null);
3333
- l(() => {
3334
- V.current = F;
3335
- }, [F]), l(() => {
3380
+ let ie = m(null), B = m(null);
3381
+ d(() => {
3382
+ B.current = F;
3383
+ }, [F]), d(() => {
3336
3384
  if (!O || !k) return;
3337
3385
  let e = O.userID;
3338
3386
  if (!e) return;
3339
3387
  let t = `${e}::${a}`;
3340
- if (B.current === t) return;
3341
- B.current = t;
3388
+ if (ie.current === t) return;
3389
+ ie.current = t;
3342
3390
  let n = () => {
3343
- B.current === t && (B.current = null);
3391
+ ie.current === t && (ie.current = null);
3344
3392
  };
3345
3393
  (async () => {
3346
3394
  try {
@@ -3369,7 +3417,7 @@ var Vi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
3369
3417
  console.error("[MessagingShell] Failed to create conversation:", e), n(), R("Failed to create conversation");
3370
3418
  }
3371
3419
  } catch (e) {
3372
- console.error("[MessagingShell] Failed to load initial conversation:", e), n(), V.current || R("Failed to load conversation");
3420
+ console.error("[MessagingShell] Failed to load initial conversation:", e), n(), B.current || R("Failed to load conversation");
3373
3421
  }
3374
3422
  })();
3375
3423
  }, [
@@ -3379,34 +3427,34 @@ var Vi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
3379
3427
  N,
3380
3428
  P
3381
3429
  ]);
3382
- let ie = f(i);
3383
- ie.current = i;
3384
- let ae = s(() => {
3385
- I(null), ee(!0), ie.current?.();
3430
+ let ae = m(i);
3431
+ ae.current = i;
3432
+ let oe = l(() => {
3433
+ I(null), ee(!0), ae.current?.();
3386
3434
  }, []);
3387
- return A ? /* @__PURE__ */ W(Li, {}) : j ? /* @__PURE__ */ W(Bi, {
3435
+ return A ? /* @__PURE__ */ W(Gi, {}) : j ? /* @__PURE__ */ W(Ji, {
3388
3436
  message: j,
3389
3437
  onBack: M
3390
- }) : !k || !O ? /* @__PURE__ */ W(Bi, {
3438
+ }) : !k || !O ? /* @__PURE__ */ W(Ji, {
3391
3439
  message: "Not connected to messaging service",
3392
3440
  onBack: M
3393
- }) : L ? /* @__PURE__ */ W(Bi, { message: L }) : z && !F ? /* @__PURE__ */ W(Bi, { message: "Conversation ended" }) : F ? /* @__PURE__ */ W("div", {
3441
+ }) : L ? /* @__PURE__ */ W(Ji, { message: L }) : z && !F ? /* @__PURE__ */ W(Ji, { message: "Conversation ended" }) : F ? /* @__PURE__ */ W("div", {
3394
3442
  className: "messaging-shell h-full bg-background-primary overflow-hidden",
3395
3443
  children: /* @__PURE__ */ W("div", {
3396
3444
  className: "flex h-full min-h-0 flex-col",
3397
- children: /* @__PURE__ */ W(zi, {
3445
+ children: /* @__PURE__ */ W(qi, {
3398
3446
  channel: F,
3399
3447
  renderMessageInputActions: t,
3400
3448
  renderConversationFooter: n,
3401
3449
  renderChannelBanner: _,
3402
- onLeaveConversation: ae,
3403
- onBlockParticipant: ae,
3404
- CustomChannelEmptyState: c,
3450
+ onLeaveConversation: oe,
3451
+ onBlockParticipant: oe,
3452
+ CustomChannelEmptyState: s,
3405
3453
  showDeleteConversation: te,
3406
- onBlockParticipantClick: u,
3407
- onReportParticipantClick: d,
3408
- dmAgentEnabled: m,
3409
- onMessageSent: h,
3454
+ onBlockParticipantClick: c,
3455
+ onReportParticipantClick: u,
3456
+ dmAgentEnabled: f,
3457
+ onMessageSent: p,
3410
3458
  viewerLanguage: g,
3411
3459
  customChannelActions: v,
3412
3460
  renderChannelActions: y,
@@ -3420,30 +3468,30 @@ var Vi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
3420
3468
  attachmentPreviewList: D
3421
3469
  }, F.id)
3422
3470
  })
3423
- }) : /* @__PURE__ */ W(Li, {});
3471
+ }) : /* @__PURE__ */ W(Gi, {});
3424
3472
  };
3425
3473
  //#endregion
3426
3474
  //#region src/hooks/useRestorePendingMessages.ts
3427
- function Hi(e) {
3475
+ function Xi(e) {
3428
3476
  let t = e.state.pending_messages;
3429
3477
  if (t?.length) for (let n of t) e.state.addMessageSorted(n.message);
3430
3478
  }
3431
3479
  //#endregion
3432
3480
  //#region src/components/ChannelList/ChannelListContext.tsx
3433
- var Ui = i.createContext({
3481
+ var Zi = o.createContext({
3434
3482
  selectedChannel: void 0,
3435
3483
  onChannelSelect: () => {},
3436
3484
  debug: !1,
3437
3485
  renderMessagePreview: void 0,
3438
3486
  channelPreview: void 0,
3439
3487
  viewerLanguage: void 0
3440
- }), Wi = Ui.Provider, Gi = () => i.useContext(Ui), Ki = (e, t) => {
3488
+ }), Qi = Zi.Provider, $i = () => o.useContext(Zi), ea = (e, t) => {
3441
3489
  let n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), r = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
3442
3490
  return Math.floor((r - n) / 864e5);
3443
- }, qi = (e) => {
3491
+ }, ta = (e) => {
3444
3492
  let t = /* @__PURE__ */ new Date();
3445
3493
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60) return "Just now";
3446
- let n = Ki(e, t);
3494
+ let n = ea(e, t);
3447
3495
  return n === 0 ? e.toLocaleTimeString([], {
3448
3496
  hour: "numeric",
3449
3497
  minute: "2-digit",
@@ -3456,8 +3504,8 @@ var Ui = i.createContext({
3456
3504
  day: "numeric",
3457
3505
  year: "numeric"
3458
3506
  });
3459
- }, Ji = i.memo((e) => {
3460
- let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = Gi(), { client: l } = de(), u = r?.id === t?.id, d = nt(t);
3507
+ }, na = o.memo((e) => {
3508
+ let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = $i(), { client: l } = me(), u = r?.id === t?.id, d = at(t);
3461
3509
  if (o) return /* @__PURE__ */ W(o, {
3462
3510
  ...e,
3463
3511
  active: u,
@@ -3470,13 +3518,13 @@ var Ui = i.createContext({
3470
3518
  }, p = (e) => {
3471
3519
  let t = e.key === "Enter" || e.key === " ", n = e.repeat;
3472
3520
  !t || n || (e.preventDefault(), f());
3473
- }, m = rt(t?.state?.members, l?.userID, t?.type), h = st(m?.user), g = m?.user?.image, _ = (() => {
3521
+ }, m = ot(t?.state?.members, l?.userID, t?.type), h = ut(m?.user), g = m?.user?.image, _ = (() => {
3474
3522
  let e = t?.state?.messages;
3475
3523
  if (e?.length) {
3476
3524
  for (let t = e.length - 1; t >= 0; t--) if (e[t].type !== "system") return e[t];
3477
3525
  }
3478
3526
  })(), v = (() => {
3479
- let e = wt({
3527
+ let e = Dt({
3480
3528
  message: _,
3481
3529
  viewerLanguage: c
3482
3530
  }), { custom_type: t, attachment_content_type: n } = _?.metadata || {};
@@ -3489,7 +3537,7 @@ var Ui = i.createContext({
3489
3537
  if (e) return e;
3490
3538
  let r = _?.attachments?.[0];
3491
3539
  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";
3492
- })(), y = _?.created_at ? qi(new Date(_.created_at)) : "", b = _ ? It(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
3540
+ })(), y = _?.created_at ? ta(new Date(_.created_at)) : "", b = _ ? zt(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
3493
3541
  return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
3494
3542
  channelId: t?.id,
3495
3543
  isSelected: u,
@@ -3501,14 +3549,14 @@ var Ui = i.createContext({
3501
3549
  tabIndex: 0,
3502
3550
  onClick: f,
3503
3551
  onKeyDown: p,
3504
- className: J("group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2", {
3552
+ className: Y("group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2", {
3505
3553
  "bg-black/[0.04]": u,
3506
3554
  "hover:bg-black/[0.02]": !u
3507
3555
  }),
3508
3556
  "data-dd-privacy": "mask",
3509
3557
  children: /* @__PURE__ */ G("div", {
3510
3558
  className: "flex items-start gap-4",
3511
- children: [/* @__PURE__ */ W(pt, {
3559
+ children: [/* @__PURE__ */ W(gt, {
3512
3560
  id: m?.user?.id || t.id || "unknown",
3513
3561
  name: h,
3514
3562
  image: g,
@@ -3519,7 +3567,7 @@ var Ui = i.createContext({
3519
3567
  children: [/* @__PURE__ */ G("div", {
3520
3568
  className: "flex items-center justify-between gap-2",
3521
3569
  children: [/* @__PURE__ */ G("h3", {
3522
- className: J("text-sm font-medium truncate text-[#191918]"),
3570
+ className: Y("text-sm font-medium truncate text-[#191918]"),
3523
3571
  children: [d && /* @__PURE__ */ W("span", {
3524
3572
  className: "sr-only",
3525
3573
  children: "Starred conversation. "
@@ -3542,22 +3590,22 @@ var Ui = i.createContext({
3542
3590
  })
3543
3591
  });
3544
3592
  });
3545
- Ji.displayName = "CustomChannelPreview";
3593
+ na.displayName = "CustomChannelPreview";
3546
3594
  //#endregion
3547
3595
  //#region src/components/ChannelList/index.tsx
3548
- var Yi = { last_message_at: -1 }, Xi = i.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: a, sort: o = Yi, className: s, customEmptyStateIndicator: c, channelListPaginator: l = T, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
3549
- let y = i.useRef(0);
3596
+ var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: i, sort: a = ra, className: s, customEmptyStateIndicator: c, channelListPaginator: l = D, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
3597
+ let y = o.useRef(0);
3550
3598
  y.current++;
3551
- let { debug: b = !1 } = $e(), S = i.useCallback((e) => {
3552
- for (let t of e) Hi(t);
3553
- return a ? a(e) : e;
3554
- }, [a]);
3599
+ let { debug: b = !1 } = nt(), x = o.useCallback((e) => {
3600
+ for (let t of e) Xi(t);
3601
+ return i ? i(e) : e;
3602
+ }, [i]);
3555
3603
  b && console.log("📺 [ChannelList] 🔄 RENDER START", {
3556
3604
  renderCount: y.current,
3557
3605
  selectedChannelId: t?.id,
3558
3606
  filters: n
3559
3607
  });
3560
- let C = i.useMemo(() => ({
3608
+ let S = o.useMemo(() => ({
3561
3609
  selectedChannel: t,
3562
3610
  onChannelSelect: e,
3563
3611
  debug: b,
@@ -3573,17 +3621,17 @@ var Yi = { last_message_at: -1 }, Xi = i.memo(({ onChannelSelect: e, selectedCha
3573
3621
  f
3574
3622
  ]);
3575
3623
  return /* @__PURE__ */ W("div", {
3576
- className: J("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", s),
3624
+ className: Y("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", s),
3577
3625
  children: /* @__PURE__ */ W("div", {
3578
3626
  className: "flex-1 overflow-hidden min-w-0",
3579
- children: /* @__PURE__ */ W(Wi, {
3580
- value: C,
3581
- children: /* @__PURE__ */ W(x, {
3627
+ children: /* @__PURE__ */ W(Qi, {
3628
+ value: S,
3629
+ children: /* @__PURE__ */ W(C, {
3582
3630
  filters: n,
3583
- sort: o,
3631
+ sort: a,
3584
3632
  options: { limit: 30 },
3585
3633
  allowNewMessagesFromUnfilteredChannels: r,
3586
- channelRenderFilterFn: S,
3634
+ channelRenderFilterFn: x,
3587
3635
  lockChannelOrder: p,
3588
3636
  onMessageNewHandler: m,
3589
3637
  onMessageNew: h,
@@ -3591,29 +3639,29 @@ var Yi = { last_message_at: -1 }, Xi = i.memo(({ onChannelSelect: e, selectedCha
3591
3639
  onAddedToChannel: _,
3592
3640
  onChannelUpdated: v,
3593
3641
  Paginator: l,
3594
- Preview: Ji,
3642
+ Preview: na,
3595
3643
  EmptyStateIndicator: c
3596
- }, `${JSON.stringify(n)}:${JSON.stringify(o)}`)
3644
+ }, `${JSON.stringify(n)}:${JSON.stringify(a)}`)
3597
3645
  })
3598
3646
  })
3599
3647
  });
3600
3648
  });
3601
- Xi.displayName = "ChannelList";
3649
+ ia.displayName = "ChannelList";
3602
3650
  //#endregion
3603
3651
  //#region src/components/RichCard/RichCardBody.tsx
3604
- var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text-wrap:balance]", Qi = "text-[12px] leading-4 tracking-[0.24px] [text-wrap:pretty]", $i = ({ surface: e, actions: t, layout: n }) => {
3652
+ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text-wrap:balance]", oa = "text-[12px] leading-4 tracking-[0.24px] [text-wrap:pretty]", sa = ({ surface: e, actions: t, layout: n }) => {
3605
3653
  if (t == null || t.length === 0) return null;
3606
3654
  let r = n === "stacked";
3607
3655
  return /* @__PURE__ */ W("div", {
3608
- className: J("flex gap-2", r ? "mt-3 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"),
3609
- children: t.map((t, n) => /* @__PURE__ */ W(ln, {
3656
+ className: Y("flex gap-2", r ? "mt-3 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"),
3657
+ children: t.map((t, n) => /* @__PURE__ */ W(fn, {
3610
3658
  variant: e,
3611
3659
  cta: t,
3612
3660
  fullWidth: r,
3613
3661
  standalone: !0
3614
3662
  }, `${t.label}-${n}`))
3615
3663
  });
3616
- }, ea = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
3664
+ }, ca = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
3617
3665
  let s = n != null && n.trim() !== "", c = r != null && r.trim() !== "", l = o != null && o.length > 0;
3618
3666
  if (!s && !c && !l) return null;
3619
3667
  let u = { color: t }, d = i > 1 ? {
@@ -3630,12 +3678,12 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3630
3678
  className: "shrink-0",
3631
3679
  children: a
3632
3680
  }) : null, /* @__PURE__ */ W("p", {
3633
- className: J("min-w-0", Zi),
3681
+ className: Y("min-w-0", aa),
3634
3682
  style: u,
3635
3683
  children: n
3636
3684
  })]
3637
3685
  }), c && /* @__PURE__ */ W("p", {
3638
- className: J(Qi, i > 1 && "whitespace-pre-line", i <= 1 && "truncate"),
3686
+ className: Y(oa, i > 1 && "whitespace-pre-line", i <= 1 && "truncate"),
3639
3687
  style: d,
3640
3688
  children: r
3641
3689
  })]
@@ -3644,21 +3692,21 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3644
3692
  className: "shrink-0 px-4 py-3",
3645
3693
  children: f ? /* @__PURE__ */ G("div", {
3646
3694
  className: "flex items-center justify-between gap-3",
3647
- children: [p, /* @__PURE__ */ W($i, {
3695
+ children: [p, /* @__PURE__ */ W(sa, {
3648
3696
  surface: e,
3649
3697
  actions: o,
3650
3698
  layout: "row"
3651
3699
  })]
3652
- }) : /* @__PURE__ */ G(U, { children: [p, /* @__PURE__ */ W($i, {
3700
+ }) : /* @__PURE__ */ G(U, { children: [p, /* @__PURE__ */ W(sa, {
3653
3701
  surface: e,
3654
3702
  actions: o,
3655
3703
  layout: "stacked"
3656
3704
  })] })
3657
3705
  });
3658
- }, ta = {
3706
+ }, la = {
3659
3707
  dark: "bg-white/[0.06]",
3660
3708
  light: "bg-black/[0.04]"
3661
- }, na = {
3709
+ }, ua = {
3662
3710
  1: [0],
3663
3711
  2: [-10, 10],
3664
3712
  3: [
@@ -3666,7 +3714,7 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3666
3714
  0,
3667
3715
  13
3668
3716
  ]
3669
- }, ra = {
3717
+ }, da = {
3670
3718
  1: [0],
3671
3719
  2: [-26, 26],
3672
3720
  3: [
@@ -3674,7 +3722,7 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3674
3722
  0,
3675
3723
  40
3676
3724
  ]
3677
- }, ia = {
3725
+ }, fa = {
3678
3726
  1: [0],
3679
3727
  2: [0, 1],
3680
3728
  3: [
@@ -3682,7 +3730,7 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3682
3730
  3,
3683
3731
  2
3684
3732
  ]
3685
- }, aa = {
3733
+ }, pa = {
3686
3734
  1: [1],
3687
3735
  2: [1, 1],
3688
3736
  3: [
@@ -3690,70 +3738,70 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3690
3738
  1.08,
3691
3739
  1
3692
3740
  ]
3693
- }, oa = ({ variant: t, images: n }) => {
3694
- let [r, a] = i.useState({}), o = n.join("\n"), [s, c] = i.useState(o);
3695
- o !== s && (c(o), a({}));
3696
- let l = n.slice(0, 3).map((e, t) => ({
3741
+ }, ma = ({ variant: e, images: t }) => {
3742
+ let [n, r] = o.useState({}), i = t.join("\n"), [s, c] = o.useState(i);
3743
+ i !== s && (c(i), r({}));
3744
+ let l = t.slice(0, 3).map((e, t) => ({
3697
3745
  src: e,
3698
3746
  index: t
3699
- })).filter(({ index: e }) => !r[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = na[u], f = ra[u], p = ia[u], m = aa[u];
3747
+ })).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = ua[u], f = da[u], p = fa[u], m = pa[u];
3700
3748
  return /* @__PURE__ */ W("div", {
3701
- className: J("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", ta[t]),
3702
- children: l.map(({ src: t, index: n }, r) => /* @__PURE__ */ W("img", {
3703
- src: e(t) ?? t,
3749
+ className: Y("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", la[e]),
3750
+ children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */ W("img", {
3751
+ src: a(e) ?? e,
3704
3752
  alt: "",
3705
3753
  draggable: !1,
3706
3754
  loading: "lazy",
3707
3755
  decoding: "async",
3708
- onError: () => a((e) => ({
3756
+ onError: () => r((e) => ({
3709
3757
  ...e,
3710
- [n]: !0
3758
+ [t]: !0
3711
3759
  })),
3712
3760
  className: "absolute left-1/2 top-1/2 w-[62%] aspect-[3/2] rounded-[12px] bg-[#ffffff] object-cover shadow-md",
3713
3761
  style: {
3714
- transform: `translate(-50%, -50%) translateX(${f[r]}px) rotate(${d[r]}deg) scale(${m[r]})`,
3715
- zIndex: p[r]
3762
+ transform: `translate(-50%, -50%) translateX(${f[n]}px) rotate(${d[n]}deg) scale(${m[n]})`,
3763
+ zIndex: p[n]
3716
3764
  }
3717
- }, `${t}-${n}`))
3765
+ }, `${e}-${t}`))
3718
3766
  });
3719
- }, sa = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", ca = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ W("div", {
3720
- className: sa,
3721
- children: t === "fan" ? /* @__PURE__ */ W(oa, {
3767
+ }, ha = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", ga = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ W("div", {
3768
+ className: ha,
3769
+ children: t === "fan" ? /* @__PURE__ */ W(ma, {
3722
3770
  variant: e,
3723
3771
  images: n
3724
- }) : /* @__PURE__ */ W(wn, {
3772
+ }) : /* @__PURE__ */ W(Dn, {
3725
3773
  variant: e,
3726
3774
  thumbnailUrl: i,
3727
3775
  title: r,
3728
3776
  mimeType: "image/*",
3729
3777
  onImageError: a
3730
3778
  })
3731
- }), la = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
3732
- let u = Se({
3779
+ }), _a = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
3780
+ let u = Te({
3733
3781
  imagePresentation: a,
3734
3782
  images: i
3735
- }), d = i.length > 0, f = d && u === "hero", p = An({
3783
+ }), d = i.length > 0, f = d && u === "hero", p = Nn({
3736
3784
  variant: e,
3737
3785
  accentColor: c,
3738
3786
  layout: "featured",
3739
3787
  thumbnailUrl: f ? i[0] : void 0
3740
3788
  }), m = l === "single" || l === "end";
3741
- return /* @__PURE__ */ W(Pn, {
3789
+ return /* @__PURE__ */ W(Ln, {
3742
3790
  accentHex: p.accentHex,
3743
3791
  side: e === "dark" ? "sender" : "receiver",
3744
3792
  visible: m,
3745
- children: /* @__PURE__ */ G(vn, {
3793
+ children: /* @__PURE__ */ G(xn, {
3746
3794
  variant: e,
3747
3795
  accentHex: p.accentHex,
3748
3796
  "data-testid": "rich-card",
3749
- children: [d && /* @__PURE__ */ W(ca, {
3797
+ children: [d && /* @__PURE__ */ W(ga, {
3750
3798
  variant: e,
3751
3799
  presentation: u,
3752
3800
  images: i,
3753
3801
  title: t,
3754
3802
  heroUrl: f ? p.thumbnailUrl : void 0,
3755
3803
  onHeroError: p.onImageError
3756
- }), /* @__PURE__ */ W(ea, {
3804
+ }), /* @__PURE__ */ W(ca, {
3757
3805
  ctaSurface: p.surface,
3758
3806
  chinTextColor: p.chinTextColor,
3759
3807
  title: t,
@@ -3764,19 +3812,19 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3764
3812
  })]
3765
3813
  })
3766
3814
  });
3767
- }, ua = {
3768
- Sent: (e) => /* @__PURE__ */ W(la, {
3815
+ }, va = {
3816
+ Sent: (e) => /* @__PURE__ */ W(_a, {
3769
3817
  ...e,
3770
3818
  variant: "dark"
3771
3819
  }),
3772
- Received: (e) => /* @__PURE__ */ W(la, {
3820
+ Received: (e) => /* @__PURE__ */ W(_a, {
3773
3821
  ...e,
3774
3822
  variant: "light"
3775
3823
  })
3776
- }, da = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", fa = {
3824
+ }, ya = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", ba = {
3777
3825
  sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
3778
3826
  received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
3779
- }, pa = ({ variant: e }) => /* @__PURE__ */ W("span", {
3827
+ }, xa = ({ variant: e }) => /* @__PURE__ */ W("span", {
3780
3828
  "aria-hidden": "true",
3781
3829
  className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
3782
3830
  style: {
@@ -3784,11 +3832,11 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3784
3832
  insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
3785
3833
  transform: e === "received" ? "scaleX(-1)" : void 0,
3786
3834
  transformOrigin: "center",
3787
- backgroundColor: fa[e],
3788
- WebkitMask: da,
3789
- mask: da
3835
+ backgroundColor: ba[e],
3836
+ WebkitMask: ya,
3837
+ mask: ya
3790
3838
  }
3791
- }), ma = {
3839
+ }), Sa = {
3792
3840
  sent: {
3793
3841
  backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
3794
3842
  color: "var(--str-chat__own-message-bubble-color, #fff)"
@@ -3797,11 +3845,11 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3797
3845
  backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
3798
3846
  color: "var(--str-chat__message-bubble-color, #000000)"
3799
3847
  }
3800
- }, ha = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ G("div", {
3848
+ }, Ca = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ G("div", {
3801
3849
  "data-dd-privacy": "mask",
3802
- className: J("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
3850
+ className: Y("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
3803
3851
  style: {
3804
- ...ma[e],
3852
+ ...Sa[e],
3805
3853
  borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
3806
3854
  isolation: "isolate"
3807
3855
  },
@@ -3815,41 +3863,41 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3815
3863
  className: "m-0 whitespace-pre-wrap break-words hyphens-manual",
3816
3864
  children: t
3817
3865
  }),
3818
- n && /* @__PURE__ */ W(pa, { variant: e })
3866
+ n && /* @__PURE__ */ W(xa, { variant: e })
3819
3867
  ]
3820
- }), ga = {
3821
- Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ W(ha, {
3868
+ }), wa = {
3869
+ Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ W(Ca, {
3822
3870
  variant: "sent",
3823
3871
  text: e,
3824
3872
  tail: t,
3825
3873
  className: n
3826
3874
  }),
3827
- Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ W(ha, {
3875
+ Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ W(Ca, {
3828
3876
  variant: "received",
3829
3877
  text: e,
3830
3878
  tail: t,
3831
3879
  header: n,
3832
3880
  className: r
3833
3881
  })
3834
- }, _a = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ W("button", {
3882
+ }, Ta = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ W("button", {
3835
3883
  type: "button",
3836
3884
  onClick: t,
3837
3885
  disabled: n,
3838
3886
  style: { backgroundColor: "#E6E5E3" },
3839
- className: J("w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring", {
3887
+ className: Y("w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring", {
3840
3888
  "hover:brightness-95 active:brightness-90": !n,
3841
3889
  "opacity-50 cursor-not-allowed": n
3842
3890
  }, r),
3843
3891
  children: e
3844
- }), va = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
3845
- let s = Ce(e);
3892
+ }), Ea = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
3893
+ let s = J(e);
3846
3894
  return s.length === 0 ? null : /* @__PURE__ */ W("div", {
3847
3895
  className: i,
3848
3896
  children: /* @__PURE__ */ G("div", {
3849
3897
  className: "flex gap-3 items-end",
3850
3898
  children: [(a || o) && /* @__PURE__ */ W("div", {
3851
3899
  className: "flex-none",
3852
- children: /* @__PURE__ */ W(pt, {
3900
+ children: /* @__PURE__ */ W(gt, {
3853
3901
  id: o || "account",
3854
3902
  name: o || "Account",
3855
3903
  image: a,
@@ -3862,7 +3910,7 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3862
3910
  children: [r && /* @__PURE__ */ W("p", {
3863
3911
  className: "text-md text-charcoal mb-4",
3864
3912
  children: r
3865
- }), s.map((e) => /* @__PURE__ */ W(_a, {
3913
+ }), s.map((e) => /* @__PURE__ */ W(Ta, {
3866
3914
  question: e.question,
3867
3915
  onClick: () => t(e.id),
3868
3916
  loading: n === e.id
@@ -3872,6 +3920,6 @@ var Zi = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [text
3872
3920
  });
3873
3921
  };
3874
3922
  //#endregion
3875
- export { gt as ActionButton, pt as Avatar, Fi as ChannelEmptyState, Xi as ChannelList, zi as ChannelView, Ot as CustomMessageProvider, va as FaqList, _a as FaqListItem, Fn as LinkAttachment, Nt as LockedAttachment, Gr as MessageAttachment, ga as MessageBubble, Xe as MessagingLoggerProvider, et as MessagingProvider, Vi as MessagingShell, ua as RichCard, Zt as TipMessage, Qn as buildCompactMetaLabel, Yn as formatFileSize, qi as formatRelativeTime, Zn as getFileExtensionLabel, wt as getMessageDisplayText, Tt as isLinkAttachment, Xt as isTipMessage, at as isUuidLike, Wn as messageAttachmentGroupPositionFromStream, Ct as normalizeLanguageCode, e as optimizeMessagingAttachmentUrl, rt as resolveConversationParticipant, st as resolveParticipantDisplayName, mi as useComposerLocked, kt as useCustomMessage, tt as useMessaging, Ze as useMessagingLogger };
3923
+ export { yt as ActionButton, gt as Avatar, Ui as ChannelEmptyState, ia as ChannelList, qi as ChannelView, jt as CustomMessageProvider, Ea as FaqList, Ta as FaqListItem, Rn as LinkAttachment, It as LockedAttachment, Qr as MessageAttachment, wa as MessageBubble, $e as MessagingLoggerProvider, rt as MessagingProvider, Yi as MessagingShell, va as RichCard, en as TipMessage, tr as buildCompactMetaLabel, Qn as formatFileSize, ta as formatRelativeTime, er as getFileExtensionLabel, Dt as getMessageDisplayText, Ot as isLinkAttachment, $t as isTipMessage, ct as isUuidLike, qn as messageAttachmentGroupPositionFromStream, Et as normalizeLanguageCode, a as optimizeMessagingAttachmentUrl, ot as resolveConversationParticipant, ut as resolveParticipantDisplayName, Si as useComposerLocked, Mt as useCustomMessage, it as useMessaging, et as useMessagingLogger };
3876
3924
 
3877
3925
  //# sourceMappingURL=index.js.map