@linktr.ee/messaging-react 4.4.7 → 4.4.8-rc-1788251276

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